@treasuredata/tdx 2026.3.23 → 2026.3.24

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 (203) 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/auth-login-command.js +1 -1
  11. package/dist/commands/chat-command.js +1 -1
  12. package/dist/commands/claude-command.js +1 -1
  13. package/dist/commands/claude-statusline-command.js +1 -1
  14. package/dist/commands/claude-usage-command.js +1 -1
  15. package/dist/commands/command.js +1 -1
  16. package/dist/commands/connection-command.js +1 -1
  17. package/dist/commands/databases.js +1 -1
  18. package/dist/commands/delivery-command.js +1 -1
  19. package/dist/commands/describe.js +1 -1
  20. package/dist/commands/engage-campaign-pull-command.js +1 -1
  21. package/dist/commands/engage-campaign-push-command.js +1 -1
  22. package/dist/commands/engage-campaign-validate-command.js +1 -1
  23. package/dist/commands/engage-command.js +1 -1
  24. package/dist/commands/engage-template-pull-command.js +1 -1
  25. package/dist/commands/engage-template-push-command.js +1 -1
  26. package/dist/commands/engage-template-validate-command.js +1 -1
  27. package/dist/commands/job-command.js +1 -1
  28. package/dist/commands/journey-command.js +1 -1
  29. package/dist/commands/journey-validate-command.js +1 -1
  30. package/dist/commands/llm-command.js +1 -1
  31. package/dist/commands/mcp-command.js +1 -1
  32. package/dist/commands/parent-segment-command.js +1 -1
  33. package/dist/commands/policy-command.js +1 -1
  34. package/dist/commands/profile-command.js +1 -1
  35. package/dist/commands/profiles-command.js +1 -1
  36. package/dist/commands/query-command.js +1 -1
  37. package/dist/commands/schedule-command.js +1 -1
  38. package/dist/commands/segment-command.js +1 -1
  39. package/dist/commands/segment-create-command.js +1 -1
  40. package/dist/commands/segment-fields-command.js +1 -1
  41. package/dist/commands/segment-pull-command.js +1 -1
  42. package/dist/commands/segment-push-command.js +1 -1
  43. package/dist/commands/segment-update-command.js +1 -1
  44. package/dist/commands/segment-use-command.js +1 -1
  45. package/dist/commands/segment-validate-command.js +1 -1
  46. package/dist/commands/segments.js +1 -1
  47. package/dist/commands/show.js +1 -1
  48. package/dist/commands/status-command.js +1 -1
  49. package/dist/commands/tables.js +1 -1
  50. package/dist/commands/unset-command.js +1 -1
  51. package/dist/commands/upgrade-command.js +1 -1
  52. package/dist/commands/use-command.js +1 -1
  53. package/dist/commands/user-command.js +1 -1
  54. package/dist/commands/workflow-command.js +1 -1
  55. package/dist/core/auth.js +1 -1
  56. package/dist/core/command-output.js +1 -1
  57. package/dist/core/config.js +1 -1
  58. package/dist/core/connection-cache.js +1 -1
  59. package/dist/core/constants.js +1 -1
  60. package/dist/core/credential-cache.js +1 -1
  61. package/dist/core/global-context.js +1 -1
  62. package/dist/core/keychain.js +1 -1
  63. package/dist/core/oauth-keychain.js +1 -1
  64. package/dist/core/oauth.js +1 -1
  65. package/dist/core/profile.js +1 -1
  66. package/dist/core/project-config.js +1 -1
  67. package/dist/core/session.js +1 -1
  68. package/dist/core/user-cache.js +1 -1
  69. package/dist/core/version.js +1 -1
  70. package/dist/index.js +1 -1
  71. package/dist/mcp/server.js +1 -1
  72. package/dist/mcp/tools/index.js +1 -1
  73. package/dist/mcp/tools/tdx-run.js +1 -1
  74. package/dist/mcp/tools/tdx-search.js +1 -1
  75. package/dist/mcp/utils.js +1 -1
  76. package/dist/proxy/claude-usage-tracker.js +1 -1
  77. package/dist/proxy/passthrough-server.js +1 -1
  78. package/dist/proxy/sse-usage-parser.js +1 -1
  79. package/dist/sdk/agent/agent-config.js +1 -1
  80. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  81. package/dist/sdk/agent/agent-yaml.js +1 -1
  82. package/dist/sdk/agent/test/evaluator.js +1 -1
  83. package/dist/sdk/agent/test/executor.js +1 -1
  84. package/dist/sdk/agent/test/index.js +1 -1
  85. package/dist/sdk/agent/test/output.js +1 -1
  86. package/dist/sdk/agent/test/parser.js +1 -1
  87. package/dist/sdk/agent/tool-target-registry.js +1 -1
  88. package/dist/sdk/api.js +1 -1
  89. package/dist/sdk/client/cdp-api-client.js +1 -1
  90. package/dist/sdk/client/delivery-api-client.js +1 -1
  91. package/dist/sdk/client/endpoints.js +1 -1
  92. package/dist/sdk/client/engage-api-client.js +1 -1
  93. package/dist/sdk/client/http-client.js +1 -1
  94. package/dist/sdk/client/llm-api-client.js +1 -1
  95. package/dist/sdk/client/oauth-refresh.js +1 -1
  96. package/dist/sdk/client/rate-limiter.js +1 -1
  97. package/dist/sdk/client/td-api-client.js +1 -1
  98. package/dist/sdk/client/trino-api-client.js +1 -1
  99. package/dist/sdk/client/workflow-client.js +1 -1
  100. package/dist/sdk/connection-validator.js +1 -1
  101. package/dist/sdk/connection.js +1 -1
  102. package/dist/sdk/delivery.js +1 -1
  103. package/dist/sdk/engage/campaign-pull.js +1 -1
  104. package/dist/sdk/engage/campaign-push.js +1 -1
  105. package/dist/sdk/engage/campaign-validator.js +1 -1
  106. package/dist/sdk/engage/campaign-yaml.js +1 -1
  107. package/dist/sdk/engage/template-pull.js +1 -1
  108. package/dist/sdk/engage/template-push.js +1 -1
  109. package/dist/sdk/engage/template-validator.js +1 -1
  110. package/dist/sdk/engage/template-yaml.js +1 -1
  111. package/dist/sdk/engage/types/campaign-def.js +1 -1
  112. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  113. package/dist/sdk/engage/types/template-schema.js +1 -1
  114. package/dist/sdk/engage.js +1 -1
  115. package/dist/sdk/errors.js +1 -1
  116. package/dist/sdk/index.js +1 -1
  117. package/dist/sdk/io/index.js +1 -1
  118. package/dist/sdk/io/node-filesystem.js +1 -1
  119. package/dist/sdk/job.js +1 -1
  120. package/dist/sdk/journey.js +1 -1
  121. package/dist/sdk/llm/chat-cache.js +1 -1
  122. package/dist/sdk/llm/index.js +1 -1
  123. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  124. package/dist/sdk/llm/model-factors.js +1 -1
  125. package/dist/sdk/personalization.js +1 -1
  126. package/dist/sdk/policy.js +1 -1
  127. package/dist/sdk/query/index.js +1 -1
  128. package/dist/sdk/query/sql-parser.js +1 -1
  129. package/dist/sdk/realtime.js +1 -1
  130. package/dist/sdk/schedule.js +1 -1
  131. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  132. package/dist/sdk/segment/fields-display.js +1 -1
  133. package/dist/sdk/segment/file-discovery.js +1 -1
  134. package/dist/sdk/segment/journey-utils.js +1 -1
  135. package/dist/sdk/segment/journey-validator.js +1 -1
  136. package/dist/sdk/segment/journey-yaml.js +1 -1
  137. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  138. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  139. package/dist/sdk/segment/pull-workflow.js +1 -1
  140. package/dist/sdk/segment/push-recovery.js +1 -1
  141. package/dist/sdk/segment/push-workflow.js +1 -1
  142. package/dist/sdk/segment/resolution-context.js +1 -1
  143. package/dist/sdk/segment/segment-path-parser.js +1 -1
  144. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  145. package/dist/sdk/segment/segment-validator.js +1 -1
  146. package/dist/sdk/segment/target-resolution.js +1 -1
  147. package/dist/sdk/segment/tdx-config.js +1 -1
  148. package/dist/sdk/segment/types/activation-schema.js +1 -1
  149. package/dist/sdk/segment/types/journey-def.js +1 -1
  150. package/dist/sdk/segment/types/journey-schema.js +1 -1
  151. package/dist/sdk/segment/types/segment-def.js +1 -1
  152. package/dist/sdk/segment/types/segment-schema.js +1 -1
  153. package/dist/sdk/segment/validate-files.js +1 -1
  154. package/dist/sdk/segment/yaml-validator.js +1 -1
  155. package/dist/sdk/segment.js +1 -1
  156. package/dist/sdk/types/index.js +1 -1
  157. package/dist/sdk/types/progress.js +1 -1
  158. package/dist/sdk/user.js +1 -1
  159. package/dist/sdk/util/format-detector.js +1 -1
  160. package/dist/sdk/util/formatters.js +1 -1
  161. package/dist/sdk/util/index.js +1 -1
  162. package/dist/sdk/util/paginate.js +1 -1
  163. package/dist/sdk/util/tree-formatter.js +1 -1
  164. package/dist/sdk/workflow/archive-validation.js +1 -1
  165. package/dist/sdk/workflow/clone-workflow.js +1 -1
  166. package/dist/sdk/workflow/index.js +1 -1
  167. package/dist/sdk/workflow/pull-workflow.js +1 -1
  168. package/dist/sdk/workflow/push-workflow.js +1 -1
  169. package/dist/sdk/workflow/tdx-config.js +1 -1
  170. package/dist/sdk/workflow/workflow-utils.js +1 -1
  171. package/dist/test-utils/command-runner.js +1 -1
  172. package/dist/test-utils/factories.js +1 -1
  173. package/dist/test-utils/fixtures.js +1 -1
  174. package/dist/test-utils/http-mock.js +1 -1
  175. package/dist/test-utils/index.js +1 -1
  176. package/dist/utils/async.js +1 -1
  177. package/dist/utils/colors.js +1 -1
  178. package/dist/utils/diff.js +1 -1
  179. package/dist/utils/file-permissions.js +1 -1
  180. package/dist/utils/file-reader.js +1 -1
  181. package/dist/utils/github-releases.js +1 -1
  182. package/dist/utils/global-cache.js +1 -1
  183. package/dist/utils/json-loader.js +1 -1
  184. package/dist/utils/local-cache.js +1 -1
  185. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  186. package/dist/utils/logger/formatters/index.js +1 -1
  187. package/dist/utils/logger/handlers/console-handler.js +1 -1
  188. package/dist/utils/logger/handlers/file-handler.js +1 -1
  189. package/dist/utils/logger/handlers/index.js +1 -1
  190. package/dist/utils/logger/handlers/null-handler.js +1 -1
  191. package/dist/utils/logger/index.js +1 -1
  192. package/dist/utils/logger/logger.js +1 -1
  193. package/dist/utils/logger/types.js +1 -1
  194. package/dist/utils/option-validation.js +1 -1
  195. package/dist/utils/process.js +1 -1
  196. package/dist/utils/prompt.js +1 -1
  197. package/dist/utils/spinner.js +1 -1
  198. package/dist/utils/sse-parser.js +1 -1
  199. package/dist/utils/string-utils.js +1 -1
  200. package/dist/utils/table-ref-parser.js +1 -1
  201. package/dist/utils/tdx-logger.js +1 -1
  202. package/dist/utils/version-check.js +1 -1
  203. package/package.json +1 -1
@@ -1 +1 @@
1
- const a3_0x131873=a3_0x14e4;(function(_0x5f459c,_0xa7afd3){const _0x1c4cc8=a3_0x14e4,_0x332c20=_0x5f459c();while(!![]){try{const _0x3929c8=parseInt(_0x1c4cc8(0xfa))/0x1*(-parseInt(_0x1c4cc8(0xfb))/0x2)+parseInt(_0x1c4cc8(0x101))/0x3*(-parseInt(_0x1c4cc8(0xf2))/0x4)+parseInt(_0x1c4cc8(0xe4))/0x5+parseInt(_0x1c4cc8(0xe6))/0x6*(-parseInt(_0x1c4cc8(0xf3))/0x7)+-parseInt(_0x1c4cc8(0xf6))/0x8+-parseInt(_0x1c4cc8(0xee))/0x9+parseInt(_0x1c4cc8(0x102))/0xa;if(_0x3929c8===_0xa7afd3)break;else _0x332c20['push'](_0x332c20['shift']());}catch(_0x640baa){_0x332c20['push'](_0x332c20['shift']());}}}(a3_0x5e3c,0x656a0));function a3_0x5e3c(){const _0x43714d=['Resolving\x20parent\x20segment\x20\x27','\x20\x20Cause:\x20','List\x20activations\x20for\x20a\x20segment','execute','\x27...','6wDdsDi','20101630JOxWNT','Resolving\x20child\x20segment\x20\x27','Error:\x20Segment\x20name\x20is\x20required','length','cause','1456965LqBgNT','verbose','24VvLQLw','Site:\x20','Resolved\x20parent\x20ID:\x20','activations','error','listActivations','resolveSegmentId','resolveParentId','692622XhyvSc','segment','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','site','1320432GBNXWA','1158675KkkqxO','\x20activation','Error:\x20','1833616wrOayN','message','data','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','54HnCCxL','9544VzukAc'];a3_0x5e3c=function(){return _0x43714d;};return a3_0x5e3c();}import{BaseCommand}from'./command.js';function a3_0x14e4(_0x29710f,_0x42cc6d){_0x29710f=_0x29710f-0xe1;const _0x5e3cec=a3_0x5e3c();let _0x14e495=_0x5e3cec[_0x29710f];return _0x14e495;}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{['name']=a3_0x131873(0xe9);['description']=a3_0x131873(0xfe);async[a3_0x131873(0xff)](_0x377c6e){const _0x3a3495=a3_0x131873,{options:_0x12ba48,args:_0x5a57cc,tdx:_0x58bc48}=_0x377c6e;if(_0x5a57cc[_0x3a3495(0xe2)]===0x0)return console[_0x3a3495(0xea)](_0x3a3495(0xe1)),console['error'](_0x3a3495(0xf9)),0x1;try{const {parentId:_0x3bbfd0,childId:_0x42d92f}=parseSegmentRef(_0x5a57cc[0x0]);if(!_0x42d92f)return console['error'](_0x3a3495(0xf0)),console[_0x3a3495(0xea)](_0x3a3495(0xf9)),0x1;_0x12ba48[_0x3a3495(0xe5)]&&(console['error'](_0x3a3495(0xe7)+_0x12ba48[_0x3a3495(0xf1)]),console[_0x3a3495(0xea)]('Parent\x20name:\x20'+_0x3bbfd0),console[_0x3a3495(0xea)]('Child\x20name:\x20'+_0x42d92f));const _0x5a8ab1=await withSpinner(_0x3a3495(0xfc)+_0x3bbfd0+_0x3a3495(0x100),()=>_0x58bc48[_0x3a3495(0xef)][_0x3a3495(0xed)](_0x3bbfd0),{'verbose':_0x12ba48[_0x3a3495(0xe5)]}),_0x5ddc7f=_0x5a8ab1[_0x3a3495(0xf8)];_0x12ba48[_0x3a3495(0xe5)]&&console[_0x3a3495(0xea)](_0x3a3495(0xe8)+_0x5ddc7f);const _0x264b66=await withSpinner(_0x3a3495(0x103)+_0x42d92f+'\x27...',()=>_0x58bc48[_0x3a3495(0xef)][_0x3a3495(0xec)](_0x5ddc7f,_0x42d92f),{'verbose':_0x12ba48[_0x3a3495(0xe5)]}),_0x2a2161=_0x264b66['data'];_0x12ba48[_0x3a3495(0xe5)]&&console[_0x3a3495(0xea)]('Resolved\x20child\x20ID:\x20'+_0x2a2161);const _0x1785b3=await withSpinner('Listing\x20activations\x20for\x20segment\x20\x27'+_0x42d92f+'\x27...',()=>_0x58bc48[_0x3a3495(0xef)][_0x3a3495(0xeb)](_0x5ddc7f,_0x2a2161),{'verbose':_0x12ba48['verbose']}),_0x4e4b7d=_0x1785b3[_0x3a3495(0xf8)];return console[_0x3a3495(0xea)]('✔\x20Found\x20'+_0x4e4b7d[_0x3a3495(0xe2)]+_0x3a3495(0xf4)+(_0x4e4b7d[_0x3a3495(0xe2)]!==0x1?'s':'')),await handleSDKOutput(_0x4e4b7d,_0x12ba48),0x0;}catch(_0x5efb27){if(_0x5efb27 instanceof SDKError)return console[_0x3a3495(0xea)](_0x3a3495(0xf5)+_0x5efb27[_0x3a3495(0xf7)]),_0x5efb27['cause']&&console[_0x3a3495(0xea)](_0x3a3495(0xfd)+_0x5efb27[_0x3a3495(0xe3)]),0x1;throw _0x5efb27;}}}
1
+ function a3_0x1a92(){const _0x49aa7f=['15LvCFYr','resolveSegmentId','Listing\x20activations\x20for\x20segment\x20\x27','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','1511583ZhbBIW','5447410agtRFk','✔\x20Found\x20','segment','error','\x20activation','Resolving\x20parent\x20segment\x20\x27','verbose','site','7329938xIAVbO','642151FAuXiS','resolveParentId','Parent\x20name:\x20','9lhOetT','558510awhLoZ','Child\x20name:\x20','Resolved\x20parent\x20ID:\x20','Resolved\x20child\x20ID:\x20','length','message','19047KuLDlg','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','execute','data','cause','Error:\x20Segment\x20name\x20is\x20required','description','listActivations','\x27...','2XZdhOu','Error:\x20','4572332MPXeoy','968oCyLuR','activations'];a3_0x1a92=function(){return _0x49aa7f;};return a3_0x1a92();}const a3_0xab93e0=a3_0x5546;function a3_0x5546(_0x2ba5a2,_0x23d0e3){_0x2ba5a2=_0x2ba5a2-0x8a;const _0x1a921c=a3_0x1a92();let _0x554651=_0x1a921c[_0x2ba5a2];return _0x554651;}(function(_0x2e342c,_0x35c23e){const _0xd2855e=a3_0x5546,_0x145dee=_0x2e342c();while(!![]){try{const _0x5511fa=-parseInt(_0xd2855e(0xa5))/0x1*(-parseInt(_0xd2855e(0x92))/0x2)+-parseInt(_0xd2855e(0x9b))/0x3+parseInt(_0xd2855e(0x94))/0x4+parseInt(_0xd2855e(0x97))/0x5*(parseInt(_0xd2855e(0xa9))/0x6)+-parseInt(_0xd2855e(0xaf))/0x7*(-parseInt(_0xd2855e(0x95))/0x8)+parseInt(_0xd2855e(0xa8))/0x9*(-parseInt(_0xd2855e(0x9c))/0xa)+-parseInt(_0xd2855e(0xa4))/0xb;if(_0x5511fa===_0x35c23e)break;else _0x145dee['push'](_0x145dee['shift']());}catch(_0x585c15){_0x145dee['push'](_0x145dee['shift']());}}}(a3_0x1a92,0xa5b72));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';export class ActivationsCommand extends BaseCommand{['name']=a3_0xab93e0(0x96);[a3_0xab93e0(0x8f)]='List\x20activations\x20for\x20a\x20segment';async[a3_0xab93e0(0x8b)](_0x490205){const _0x25ed1f=a3_0xab93e0,{options:_0x4e7198,args:_0x517845,tdx:_0x2ee247}=_0x490205;if(_0x517845[_0x25ed1f(0xad)]===0x0)return console[_0x25ed1f(0x9f)](_0x25ed1f(0x8e)),console['error']('Usage:\x20tdx\x20activations\x20<parent_name/child_name>'),0x1;try{const {parentId:_0x2ef5df,childId:_0x3de016}=parseSegmentRef(_0x517845[0x0]);if(!_0x3de016)return console[_0x25ed1f(0x9f)](_0x25ed1f(0x9a)),console['error'](_0x25ed1f(0x8a)),0x1;_0x4e7198[_0x25ed1f(0xa2)]&&(console[_0x25ed1f(0x9f)]('Site:\x20'+_0x4e7198[_0x25ed1f(0xa3)]),console[_0x25ed1f(0x9f)](_0x25ed1f(0xa7)+_0x2ef5df),console[_0x25ed1f(0x9f)](_0x25ed1f(0xaa)+_0x3de016));const _0x47090d=await withSpinner(_0x25ed1f(0xa1)+_0x2ef5df+_0x25ed1f(0x91),()=>_0x2ee247[_0x25ed1f(0x9e)][_0x25ed1f(0xa6)](_0x2ef5df),{'verbose':_0x4e7198[_0x25ed1f(0xa2)]}),_0x1a7fa0=_0x47090d[_0x25ed1f(0x8c)];_0x4e7198['verbose']&&console[_0x25ed1f(0x9f)](_0x25ed1f(0xab)+_0x1a7fa0);const _0x4ed841=await withSpinner('Resolving\x20child\x20segment\x20\x27'+_0x3de016+_0x25ed1f(0x91),()=>_0x2ee247[_0x25ed1f(0x9e)][_0x25ed1f(0x98)](_0x1a7fa0,_0x3de016),{'verbose':_0x4e7198['verbose']}),_0xc3273=_0x4ed841['data'];_0x4e7198['verbose']&&console[_0x25ed1f(0x9f)](_0x25ed1f(0xac)+_0xc3273);const _0x2a601a=await withSpinner(_0x25ed1f(0x99)+_0x3de016+_0x25ed1f(0x91),()=>_0x2ee247[_0x25ed1f(0x9e)][_0x25ed1f(0x90)](_0x1a7fa0,_0xc3273),{'verbose':_0x4e7198[_0x25ed1f(0xa2)]}),_0x5ea3b3=_0x2a601a[_0x25ed1f(0x8c)];return console['error'](_0x25ed1f(0x9d)+_0x5ea3b3[_0x25ed1f(0xad)]+_0x25ed1f(0xa0)+(_0x5ea3b3[_0x25ed1f(0xad)]!==0x1?'s':'')),await handleSDKOutput(_0x5ea3b3,_0x4e7198),0x0;}catch(_0x15a7df){if(_0x15a7df instanceof SDKError)return console['error'](_0x25ed1f(0x93)+_0x15a7df[_0x25ed1f(0xae)]),_0x15a7df[_0x25ed1f(0x8d)]&&console['error']('\x20\x20Cause:\x20'+_0x15a7df[_0x25ed1f(0x8d)]),0x1;throw _0x15a7df;}}}
@@ -1 +1 @@
1
- const a4_0x36616f=a4_0x1c77;(function(_0x1d9765,_0x45ba79){const _0x3796f0=a4_0x1c77,_0x3574c7=_0x1d9765();while(!![]){try{const _0xc76eb8=parseInt(_0x3796f0(0x1a1))/0x1+-parseInt(_0x3796f0(0x19a))/0x2+parseInt(_0x3796f0(0x1b1))/0x3*(parseInt(_0x3796f0(0x249))/0x4)+parseInt(_0x3796f0(0x22a))/0x5+parseInt(_0x3796f0(0x244))/0x6*(parseInt(_0x3796f0(0x1fc))/0x7)+parseInt(_0x3796f0(0x1a5))/0x8*(-parseInt(_0x3796f0(0x1d2))/0x9)+-parseInt(_0x3796f0(0x220))/0xa*(parseInt(_0x3796f0(0x1a6))/0xb);if(_0xc76eb8===_0x45ba79)break;else _0x3574c7['push'](_0x3574c7['shift']());}catch(_0x233f22){_0x3574c7['push'](_0x3574c7['shift']());}}}(a4_0x4bb9,0x8be4c));import a4_0x1f4b9a from'chalk';import a4_0x4e9b75 from'path';function a4_0x1c77(_0x127676,_0x2e3b85){_0x127676=_0x127676-0x192;const _0x4bb983=a4_0x4bb9();let _0x1c772c=_0x4bb983[_0x127676];return _0x1c772c;}import{existsSync,readFileSync}from'fs';function a4_0x4bb9(){const _0x28a309=['action','\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','integrations','unchanged','\x22:\x20','projectId','1314189FwtcIG','pushProject','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','\x0aError:','\x20\x20Source:\x20','No\x20tdx.json\x20found\x20in\x20','\x0aErrors\x20found:','✔\x20Context\x20set:\x20','\x20new','\x0aPull\x20summary\x20for\x20\x27','-\x20nothing\x20pushed','\x20successfully','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','outputPath','green','Cancelled','Writing\x20files...','Pushing\x20to\x20project...','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','-\x20no\x20files\x20written','hasChanges','join','description','Source:\x20','total','Would\x20clone:','profile','knowledgeBases','INVALID_ARGUMENT','log','\x27\x20to\x20create\x20the\x20folder\x20structure.','\x20\x20Integrations:\x20','New\x20project:\x20','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','session','arg-dir','\x0aChanges\x20to\x20prompt\x20\x27','dirname','updated','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','errors','Using\x20project\x20from\x20context:\x20','77dNqINa','\x20resources\x20to\x20\x27','\x20\x20Text\x20Knowledge\x20Bases:\x20','error','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','\x20\x20Agents:\x20','Status:\x20','\x0aPush\x20summary\x20for\x20\x27','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','output','newProjectId','\x20\x20tdx\x20agent\x20clone\x20agents/','tdx.json','llm_project','counts','\x20files\x20to\x20','Dry\x20run\x20-\x20no\x20changes\x20made','agents','Pulling\x20agent\x20\x22','Would\x20push\x20agent:\x20','Would\x20pull\x20agent:\x20','diff','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','yellow','\x22\x20to\x20a\x20different\x20profile','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','\x20\x20Knowledge\x20Bases:\x20','textKnowledgeBases','dim','\x20\x20Integration\x20\x22','no_context','isNew','\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','reason','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','\x20errors','15410hakpKx','projectName','site','\x0aPush\x20','\x20\x20Prompt\x20\x22','\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)','message','agent:clone','\x20\x20tdx\x20agent\x20pull\x20','\x20created','3963120ZBZGWS','New\x20project\x20name\x20is\x20required','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','pushAgent','\x0aChanges\x20to\x20integration\x20\x27','Using\x20project\x20from\x20','experimentalKnowledgeBases','pullAgent','\x22...','force','Dry\x20run\x20-\x20no\x20files\x20written','agentName','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)','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','name','execute','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','red','cyan','found','\x20\x20Prompts:\x20','\x20\x20Knowledge\x20Base\x20\x22','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','\x20changed','424860eQLvBi','yes','\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','\x20updated','no_local_folder','1188dhCBKa','New\x20project\x20ID:\x20','\x20unchanged','\x20\x20Target:\x20','Analyzing\x20project\x20\x22','dryRun','repeat','sourceProjectName','cwd','\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','agent','\x20--name\x20','798400GJpQRn','agent.yml','Chat:\x20','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','MISSING_ARGUMENT','utf-8','llm','649945JIGtBo','Project\x20cloned\x20with\x20errors','Errors:','push','16BKKDWY','9218URDzrM','Project\x20cloned\x20successfully','prompts','Output\x20path:\x20','<new-name>','Agent\x20','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','llmProject','Using\x20local\x20project:\x20','new','Project:\x20','3375qLyegR','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','agentId','\x20\x20Text\x20Knowledge\x20Base\x20\x22','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','created','Summary:','Agent\x20pulled\x20successfully','Cloning\x20\x22','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','\x20\x20Experimental\x20Artifacts:\x20','\x0a✔\x20Pulled\x20','Agent:\x20','context','\x22\x20from\x20project\x20\x22','outputDir','Using\x20project:\x20','gray','\x20=\x20','source','\x22\x20to\x20\x22','agent:pull','\x20|\x20','Using\x20context\x20project:\x20','experimentalArtifacts'];a4_0x4bb9=function(){return _0x28a309;};return a4_0x4bb9();}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(_0x3e4555){const _0x422c00=a4_0x1c77,_0xe22fa7=[];if(_0x3e4555['total']!==undefined)_0xe22fa7[_0x422c00(0x1a4)](_0x3e4555['total']+'\x20total');if(_0x3e4555[_0x422c00(0x1af)]!==undefined&&_0x3e4555[_0x422c00(0x1af)]>0x0)_0xe22fa7[_0x422c00(0x1a4)](a4_0x1f4b9a[_0x422c00(0x1e0)](_0x3e4555['new']+_0x422c00(0x1da)));if(_0x3e4555[_0x422c00(0x1b8)]!==undefined&&_0x3e4555['created']>0x0)_0xe22fa7['push'](a4_0x1f4b9a['green'](_0x3e4555[_0x422c00(0x1b8)]+_0x422c00(0x229)));if(_0x3e4555[_0x422c00(0x1f8)]!==undefined&&_0x3e4555[_0x422c00(0x1f8)]>0x0)_0xe22fa7[_0x422c00(0x1a4)](a4_0x1f4b9a[_0x422c00(0x213)](_0x3e4555['updated']+_0x422c00(0x247)));if(_0x3e4555[_0x422c00(0x1cf)]!==undefined&&_0x3e4555['unchanged']>0x0)_0xe22fa7[_0x422c00(0x1a4)](a4_0x1f4b9a[_0x422c00(0x1c4)](_0x3e4555[_0x422c00(0x1cf)]+_0x422c00(0x24b)));if(_0x3e4555[_0x422c00(0x1fa)]!==undefined&&_0x3e4555[_0x422c00(0x1fa)]>0x0)_0xe22fa7[_0x422c00(0x1a4)](a4_0x1f4b9a[_0x422c00(0x23d)](_0x3e4555[_0x422c00(0x1fa)]+_0x422c00(0x21f)));return _0xe22fa7['join'](',\x20');}function displayDiffs(_0x16f5ab,_0x3879ff,_0x3088e0,_0x2de9db,_0xddeec,_0x44c352,_0x106f78){const _0x3202bb=a4_0x1c77;for(const _0x28911d of _0x16f5ab){if(_0x28911d[_0x3202bb(0x211)]){const _0x2acd49=_0x28911d['agentName']||_0x28911d[_0x3202bb(0x239)];console[_0x3202bb(0x1ef)]('\x0aChanges\x20to\x20agent\x20\x27'+_0x2acd49+'\x27:'),console['log']('─'[_0x3202bb(0x194)](0x3c)),console['log'](_0x28911d['diff']),console[_0x3202bb(0x1ef)]('─'[_0x3202bb(0x194)](0x3c));}}for(const _0x29242e of _0x3879ff){_0x29242e[_0x3202bb(0x211)]&&(console[_0x3202bb(0x1ef)](_0x3202bb(0x22c)+_0x29242e[_0x3202bb(0x239)]+'\x27:'),console[_0x3202bb(0x1ef)]('─'[_0x3202bb(0x194)](0x3c)),console[_0x3202bb(0x1ef)](_0x29242e[_0x3202bb(0x211)]),console[_0x3202bb(0x1ef)]('─'[_0x3202bb(0x194)](0x3c)));}for(const _0x107acf of _0x3088e0){_0x107acf['diff']&&(console[_0x3202bb(0x1ef)](_0x3202bb(0x19d)+_0x107acf['name']+'\x27:'),console[_0x3202bb(0x1ef)]('─'[_0x3202bb(0x194)](0x3c)),console[_0x3202bb(0x1ef)](_0x107acf[_0x3202bb(0x211)]),console[_0x3202bb(0x1ef)]('─'[_0x3202bb(0x194)](0x3c)));}for(const _0x1a218a of _0x2de9db){_0x1a218a[_0x3202bb(0x211)]&&(console[_0x3202bb(0x1ef)](_0x3202bb(0x1f6)+_0x1a218a[_0x3202bb(0x239)]+'\x27:'),console[_0x3202bb(0x1ef)]('─'['repeat'](0x3c)),console[_0x3202bb(0x1ef)](_0x1a218a['diff']),console[_0x3202bb(0x1ef)]('─'[_0x3202bb(0x194)](0x3c)));}for(const _0x57731d of _0xddeec){_0x57731d[_0x3202bb(0x211)]&&(console[_0x3202bb(0x1ef)](_0x3202bb(0x22e)+_0x57731d[_0x3202bb(0x239)]+'\x27:'),console[_0x3202bb(0x1ef)]('─'[_0x3202bb(0x194)](0x3c)),console['log'](_0x57731d[_0x3202bb(0x211)]),console['log']('─'[_0x3202bb(0x194)](0x3c)));}for(const _0x523235 of _0x44c352){_0x523235[_0x3202bb(0x211)]&&(console[_0x3202bb(0x1ef)](_0x3202bb(0x1f3)+_0x523235['name']+'\x27:'),console[_0x3202bb(0x1ef)]('─'[_0x3202bb(0x194)](0x3c)),console['log'](_0x523235[_0x3202bb(0x211)]),console[_0x3202bb(0x1ef)]('─'[_0x3202bb(0x194)](0x3c)));}for(const _0x31f486 of _0x106f78){_0x31f486['diff']&&(console[_0x3202bb(0x1ef)](_0x3202bb(0x21e)+_0x31f486[_0x3202bb(0x239)]+'\x27:'),console[_0x3202bb(0x1ef)]('─'[_0x3202bb(0x194)](0x3c)),console['log'](_0x31f486[_0x3202bb(0x211)]),console[_0x3202bb(0x1ef)]('─'[_0x3202bb(0x194)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x36616f(0x239)]=a4_0x36616f(0x1c8);['description']='Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files';async[a4_0x36616f(0x23a)](_0xcaad55){const _0x1ad9b7=a4_0x36616f,{options:_0x457e12,args:_0x579e72,tdx:_0x2df277}=_0xcaad55,_0x53bdcf=_0x579e72[0x0],_0x2ce4ca=_0x579e72[0x1],_0x474fac=_0x457e12[_0x1ad9b7(0x205)],_0x170537=_0x457e12[_0x1ad9b7(0x193)],_0x32cc9d=_0x457e12[_0x1ad9b7(0x233)],_0x1b6348=_0x457e12[_0x1ad9b7(0x245)],_0x591e5d=_0x457e12[_0x1ad9b7(0x1ad)],_0x2d1337=_0x457e12[_0x1ad9b7(0x198)];let _0x511121;if(_0x53bdcf){const _0x588254=a4_0x4e9b75[_0x1ad9b7(0x1e7)](_0x53bdcf,'tdx.json');if(existsSync(_0x588254))try{const _0x3aed0c=JSON['parse'](readFileSync(_0x588254,_0x1ad9b7(0x19f)));_0x3aed0c[_0x1ad9b7(0x209)]&&(_0x511121={'llm_project':_0x3aed0c['llm_project']});}catch{}}const _0x22b6ed=findAgentConfigPath(process[_0x1ad9b7(0x196)]());let _0x948c81;if(_0x22b6ed)try{const _0x40bdfa=JSON['parse'](readFileSync(_0x22b6ed,_0x1ad9b7(0x19f)));_0x40bdfa[_0x1ad9b7(0x209)]&&(_0x948c81={'llm_project':_0x40bdfa[_0x1ad9b7(0x209)]});}catch{}const _0x263e2a=resolveAgentPullArgs({'arg':_0x53bdcf,'agentNameArg':_0x2ce4ca,'agentFlag':_0x2d1337,'contextProject':_0x591e5d,'argDirConfig':_0x511121,'cwdConfigPath':_0x22b6ed||undefined,'cwdConfig':_0x948c81}),{projectNameOrId:_0x3c0d02,targetAgentName:_0x2ac72f,existingOutputDir:_0x43c647,source:_0xe9bb5a}=_0x263e2a;if(_0xe9bb5a===_0x1ad9b7(0x1f5))console[_0x1ad9b7(0x1ef)](a4_0x1f4b9a[_0x1ad9b7(0x218)](_0x1ad9b7(0x22f)+a4_0x4e9b75[_0x1ad9b7(0x1e7)](_0x53bdcf,_0x1ad9b7(0x208))+':\x20'+_0x3c0d02));else{if(_0xe9bb5a==='cwd-config')console[_0x1ad9b7(0x1ef)](a4_0x1f4b9a[_0x1ad9b7(0x218)](_0x1ad9b7(0x1c3)+_0x3c0d02));else _0xe9bb5a===_0x1ad9b7(0x1c0)&&console[_0x1ad9b7(0x1ef)](a4_0x1f4b9a[_0x1ad9b7(0x218)](_0x1ad9b7(0x1fb)+_0x3c0d02));}if(!_0x3c0d02)return _0x2d1337?(console[_0x1ad9b7(0x1ef)](a4_0x1f4b9a[_0x1ad9b7(0x213)](_0x1ad9b7(0x1ac))),console[_0x1ad9b7(0x1ef)](_0x1ad9b7(0x242)),console[_0x1ad9b7(0x1ef)](_0x1ad9b7(0x215))):(console[_0x1ad9b7(0x1ef)](a4_0x1f4b9a[_0x1ad9b7(0x213)](_0x1ad9b7(0x204))),console['log'](_0x1ad9b7(0x236)),console[_0x1ad9b7(0x1ef)](_0x1ad9b7(0x197)),console[_0x1ad9b7(0x1ef)](_0x1ad9b7(0x1cd)),console[_0x1ad9b7(0x1ef)](_0x1ad9b7(0x21c)),console['log'](_0x1ad9b7(0x246))),0x1;if(_0x2ac72f){const {data:_0x26bf0f}=await withSpinner(_0x1ad9b7(0x20e)+_0x2ac72f+_0x1ad9b7(0x1c1)+_0x3c0d02+_0x1ad9b7(0x232),()=>_0x2df277[_0x1ad9b7(0x1a0)][_0x1ad9b7(0x231)](_0x3c0d02,_0x2ac72f,_0x474fac,{'dryRun':_0x170537,'force':_0x32cc9d}));if(_0x170537)return console[_0x1ad9b7(0x1ef)](a4_0x1f4b9a[_0x1ad9b7(0x213)](_0x1ad9b7(0x234))),console[_0x1ad9b7(0x1ef)](_0x1ad9b7(0x210)+_0x26bf0f[_0x1ad9b7(0x235)]),console[_0x1ad9b7(0x1ef)](_0x1ad9b7(0x1a9)+_0x26bf0f[_0x1ad9b7(0x1df)]),_0x26bf0f[_0x1ad9b7(0x211)]&&(console[_0x1ad9b7(0x1ef)]('\x0aChanges:'),console[_0x1ad9b7(0x1ef)]('─'['repeat'](0x3c)),console['log'](_0x26bf0f['diff']),console[_0x1ad9b7(0x1ef)]('─'[_0x1ad9b7(0x194)](0x3c))),0x0;return console['log'](a4_0x1f4b9a[_0x1ad9b7(0x1e0)](_0x1ad9b7(0x1ba))),console[_0x1ad9b7(0x1ef)](_0x1ad9b7(0x1bf)+_0x26bf0f[_0x1ad9b7(0x235)]),console[_0x1ad9b7(0x1ef)]('Output:\x20'+_0x26bf0f['outputPath']),console[_0x1ad9b7(0x1ef)](_0x1ad9b7(0x202)+(_0x26bf0f[_0x1ad9b7(0x21b)]?a4_0x1f4b9a[_0x1ad9b7(0x1e0)]('new'):_0x26bf0f[_0x1ad9b7(0x1e6)]?a4_0x1f4b9a[_0x1ad9b7(0x213)]('updated'):a4_0x1f4b9a['gray'](_0x1ad9b7(0x1cf)))),0x0;}const _0x92f812=_0x43c647||_0x474fac,{data:_0x25221e}=await withSpinner(_0x1ad9b7(0x192)+_0x3c0d02+_0x1ad9b7(0x232),()=>_0x2df277[_0x1ad9b7(0x1a0)]['pullProject'](_0x3c0d02,_0x92f812,{'dryRun':!![]})),_0x202076=_0x25221e[_0x1ad9b7(0x20a)][_0x1ad9b7(0x20d)][_0x1ad9b7(0x1af)]+_0x25221e[_0x1ad9b7(0x20a)][_0x1ad9b7(0x1ed)][_0x1ad9b7(0x1af)]+_0x25221e['counts'][_0x1ad9b7(0x217)][_0x1ad9b7(0x1af)]+_0x25221e['counts'][_0x1ad9b7(0x1a8)][_0x1ad9b7(0x1af)]+_0x25221e[_0x1ad9b7(0x20a)][_0x1ad9b7(0x1ce)][_0x1ad9b7(0x1af)]+_0x25221e[_0x1ad9b7(0x20a)][_0x1ad9b7(0x230)][_0x1ad9b7(0x1af)]+_0x25221e[_0x1ad9b7(0x20a)][_0x1ad9b7(0x1cb)]['new'],_0x5e2d96=_0x25221e[_0x1ad9b7(0x20a)][_0x1ad9b7(0x20d)][_0x1ad9b7(0x1f8)]+_0x25221e[_0x1ad9b7(0x20a)][_0x1ad9b7(0x1ed)]['updated']+_0x25221e['counts']['textKnowledgeBases']['updated']+_0x25221e[_0x1ad9b7(0x20a)]['prompts'][_0x1ad9b7(0x1f8)]+_0x25221e[_0x1ad9b7(0x20a)][_0x1ad9b7(0x1ce)]['updated']+_0x25221e[_0x1ad9b7(0x20a)][_0x1ad9b7(0x230)][_0x1ad9b7(0x1f8)]+_0x25221e[_0x1ad9b7(0x20a)][_0x1ad9b7(0x1cb)][_0x1ad9b7(0x1f8)],_0x1e047b=_0x25221e['counts'][_0x1ad9b7(0x20d)]['unchanged']+_0x25221e[_0x1ad9b7(0x20a)]['knowledgeBases'][_0x1ad9b7(0x1cf)]+_0x25221e['counts'][_0x1ad9b7(0x217)][_0x1ad9b7(0x1cf)]+_0x25221e[_0x1ad9b7(0x20a)][_0x1ad9b7(0x1a8)]['unchanged']+_0x25221e['counts'][_0x1ad9b7(0x1ce)][_0x1ad9b7(0x1cf)]+_0x25221e[_0x1ad9b7(0x20a)][_0x1ad9b7(0x230)][_0x1ad9b7(0x1cf)]+_0x25221e[_0x1ad9b7(0x20a)][_0x1ad9b7(0x1cb)]['unchanged'];console['log'](_0x1ad9b7(0x1db)+_0x25221e['projectName']+'\x27:'),console[_0x1ad9b7(0x1ef)]('\x20\x20'+a4_0x1f4b9a['green']('+\x20'+_0x202076+_0x1ad9b7(0x1da))+_0x1ad9b7(0x1c9)+a4_0x1f4b9a[_0x1ad9b7(0x213)]('~\x20'+_0x5e2d96+'\x20changed')+_0x1ad9b7(0x1c9)+a4_0x1f4b9a[_0x1ad9b7(0x218)]('=\x20'+_0x1e047b+_0x1ad9b7(0x24b))),console[_0x1ad9b7(0x1ef)]('\x20\x20Agents:\x20'+formatCountSummary(_0x25221e[_0x1ad9b7(0x20a)][_0x1ad9b7(0x20d)])),console['log'](_0x1ad9b7(0x216)+formatCountSummary(_0x25221e['counts'][_0x1ad9b7(0x1ed)])),console[_0x1ad9b7(0x1ef)](_0x1ad9b7(0x1fe)+formatCountSummary(_0x25221e['counts']['textKnowledgeBases'])),console[_0x1ad9b7(0x1ef)](_0x1ad9b7(0x240)+formatCountSummary(_0x25221e['counts'][_0x1ad9b7(0x1a8)])),console[_0x1ad9b7(0x1ef)](_0x1ad9b7(0x1f1)+formatCountSummary(_0x25221e['counts'][_0x1ad9b7(0x1ce)]));const _0x39c85a=_0x25221e['counts'][_0x1ad9b7(0x230)]['total']>0x0||_0x25221e['counts']['experimentalArtifacts'][_0x1ad9b7(0x1ea)]>0x0;_0x39c85a&&(console['log'](_0x1ad9b7(0x23b)+formatCountSummary(_0x25221e[_0x1ad9b7(0x20a)][_0x1ad9b7(0x230)])),console[_0x1ad9b7(0x1ef)](_0x1ad9b7(0x1bd)+formatCountSummary(_0x25221e['counts'][_0x1ad9b7(0x1cb)])));console[_0x1ad9b7(0x1ef)](_0x1ad9b7(0x24c)+a4_0x1f4b9a[_0x1ad9b7(0x23e)](_0x25221e[_0x1ad9b7(0x1c2)])),displayDiffs(_0x25221e[_0x1ad9b7(0x20d)],_0x25221e[_0x1ad9b7(0x1ed)],_0x25221e['textKnowledgeBases'],_0x25221e[_0x1ad9b7(0x1a8)],_0x25221e[_0x1ad9b7(0x1ce)],_0x25221e['experimentalKnowledgeBases'],_0x25221e[_0x1ad9b7(0x1cb)]);if(_0x170537)return console[_0x1ad9b7(0x1ef)](a4_0x1f4b9a['yellow'](_0x1ad9b7(0x1b3))),0x0;if(_0x202076===0x0&&_0x5e2d96===0x0)return console[_0x1ad9b7(0x1ef)](a4_0x1f4b9a[_0x1ad9b7(0x1e0)]('\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'llm_project':_0x25221e['projectName']},_0x457e12[_0x1ad9b7(0x1f4)]),console[_0x1ad9b7(0x1ef)](a4_0x1f4b9a[_0x1ad9b7(0x1e0)]('✔\x20Context\x20set:\x20'+a4_0x1f4b9a[_0x1ad9b7(0x218)]('llm_project')+_0x1ad9b7(0x1c5)+a4_0x1f4b9a[_0x1ad9b7(0x23e)](_0x25221e['projectName']))),0x0;if(!_0x1b6348&&!_0x32cc9d){if(!isInteractive())return console[_0x1ad9b7(0x1ff)](a4_0x1f4b9a[_0x1ad9b7(0x23d)](_0x1ad9b7(0x1d5)),_0x1ad9b7(0x23c)),console[_0x1ad9b7(0x1ff)](a4_0x1f4b9a[_0x1ad9b7(0x218)](_0x1ad9b7(0x238))),0x1;const _0x3615e0=await confirmKey('\x0aWrite\x20'+(_0x202076+_0x5e2d96)+'\x20files?');if(!_0x3615e0)return console['log'](a4_0x1f4b9a[_0x1ad9b7(0x213)](_0x1ad9b7(0x1e1)),_0x1ad9b7(0x1e5)),0x1;}const {data:_0x16251b}=await withSpinner(_0x1ad9b7(0x1e2),()=>_0x2df277['llm']['pullProject'](_0x3c0d02,_0x92f812,{'force':_0x32cc9d}));return console[_0x1ad9b7(0x1ef)](a4_0x1f4b9a['green'](_0x1ad9b7(0x1be)+(_0x202076+_0x5e2d96)+_0x1ad9b7(0x20b)+_0x16251b[_0x1ad9b7(0x1c2)])),saveSessionContext({'llm_project':_0x16251b[_0x1ad9b7(0x221)]},_0x457e12[_0x1ad9b7(0x1f4)]),console['log'](a4_0x1f4b9a['green'](_0x1ad9b7(0x1d9)+a4_0x1f4b9a[_0x1ad9b7(0x218)](_0x1ad9b7(0x209))+_0x1ad9b7(0x1c5)+a4_0x1f4b9a[_0x1ad9b7(0x23e)](_0x16251b['projectName']))),0x0;}}export class AgentCloneCommand extends BaseCommand{['name']=a4_0x36616f(0x227);['description']=a4_0x36616f(0x1b7);async[a4_0x36616f(0x23a)](_0xd9f55d){const _0x488cbd=a4_0x36616f,{options:_0x23760b,args:_0x3ed4d5,tdx:_0x7d5ec2}=_0xd9f55d,_0x53d883=_0x3ed4d5[0x0],_0x515338=_0x23760b[_0x488cbd(0x239)],_0x487d25=_0x23760b['dryRun'],_0x16cf15=_0x23760b[_0x488cbd(0x245)],_0xaaf592=_0x23760b['site'],_0x5f11d7=_0x23760b[_0x488cbd(0x1ad)];let _0x4c6a08;const _0x4c8a66=findAgentConfigPath(process[_0x488cbd(0x196)]());if(_0x53d883){const _0x42945d=a4_0x4e9b75[_0x488cbd(0x1e7)](_0x53d883,_0x488cbd(0x208));existsSync(_0x42945d)?(_0x4c6a08=_0x53d883,console[_0x488cbd(0x1ef)](a4_0x1f4b9a[_0x488cbd(0x218)]('Using\x20local\x20project:\x20'+_0x53d883))):_0x4c6a08=_0x53d883;}else{if(_0x4c8a66)_0x4c6a08=a4_0x4e9b75[_0x488cbd(0x1f7)](_0x4c8a66),console[_0x488cbd(0x1ef)](a4_0x1f4b9a[_0x488cbd(0x218)]('Using\x20current\x20project:\x20'+_0x4c6a08));else{if(_0x5f11d7){const _0xdf81e9=sanitizeForFilesystem(_0x5f11d7);let _0x5ca3c7=_0xdf81e9,_0xdc1808=a4_0x4e9b75[_0x488cbd(0x1e7)](process[_0x488cbd(0x196)](),_0x488cbd(0x20d),_0xdf81e9,_0x488cbd(0x208));if(!existsSync(_0xdc1808)){const _0x1c3deb=normalizeName(_0x5f11d7),_0x4ae1fc=a4_0x4e9b75[_0x488cbd(0x1e7)](process[_0x488cbd(0x196)](),_0x488cbd(0x20d),_0x1c3deb,_0x488cbd(0x208));existsSync(_0x4ae1fc)&&(_0x5ca3c7=_0x1c3deb,_0xdc1808=_0x4ae1fc);}if(existsSync(_0xdc1808))_0x4c6a08=a4_0x4e9b75[_0x488cbd(0x1f7)](_0xdc1808),console[_0x488cbd(0x1ef)](a4_0x1f4b9a['dim'](_0x488cbd(0x1ae)+_0x4c6a08));else{const _0x57c308=_0x23760b[_0x488cbd(0x1ec)];if(_0x57c308)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Cannot\x20clone\x20from\x20context\x20project\x20\x22'+_0x5f11d7+_0x488cbd(0x214),undefined,{'helpText':_0x488cbd(0x237)+_0x488cbd(0x1f9)+(_0x488cbd(0x228)+_0x5f11d7+'\x0a')+(_0x488cbd(0x207)+_0x5ca3c7+_0x488cbd(0x199)+(_0x515338||_0x488cbd(0x1aa))+'\x20--profile\x20'+_0x57c308)});_0x4c6a08=_0x5f11d7,console[_0x488cbd(0x1ef)](a4_0x1f4b9a['dim'](_0x488cbd(0x1ca)+_0x5f11d7));}}}}if(!_0x4c6a08)return console[_0x488cbd(0x1ef)](a4_0x1f4b9a[_0x488cbd(0x213)](_0x488cbd(0x1b2))),console['log'](_0x488cbd(0x1b6)),console[_0x488cbd(0x1ef)](_0x488cbd(0x1d4)),console[_0x488cbd(0x1ef)](_0x488cbd(0x225)),console[_0x488cbd(0x1ef)](_0x488cbd(0x1de)),0x1;if(!_0x515338)throw new SDKError(ErrorCode[_0x488cbd(0x19e)],_0x488cbd(0x22b),undefined,{'helpText':_0x488cbd(0x1bc)});if(!_0x16cf15&&!_0x487d25){if(!isInteractive())return console['error'](a4_0x1f4b9a[_0x488cbd(0x23d)](_0x488cbd(0x1d5)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x488cbd(0x1ff)](a4_0x1f4b9a[_0x488cbd(0x218)](_0x488cbd(0x238))),0x1;const _0x436700=await confirmKey('Clone\x20\x22'+_0x4c6a08+'\x22\x20to\x20new\x20project\x20\x22'+_0x515338+'\x22?');if(!_0x436700)return console[_0x488cbd(0x1ef)](a4_0x1f4b9a[_0x488cbd(0x213)](_0x488cbd(0x1e1))),0x1;}const {data:_0x2d6a12}=await withSpinner(_0x488cbd(0x1bb)+_0x4c6a08+_0x488cbd(0x1c7)+_0x515338+_0x488cbd(0x232),()=>_0x7d5ec2[_0x488cbd(0x1a0)]['cloneProject'](_0x4c6a08,_0x515338,{'dryRun':_0x487d25}));if(_0x487d25){console[_0x488cbd(0x1ef)](a4_0x1f4b9a[_0x488cbd(0x213)](_0x488cbd(0x20c))),console[_0x488cbd(0x1ef)](_0x488cbd(0x1e9)+_0x2d6a12[_0x488cbd(0x195)]),console[_0x488cbd(0x1ef)](_0x488cbd(0x1f2)+_0x515338),console[_0x488cbd(0x1ef)](_0x488cbd(0x1eb)),console['log'](_0x488cbd(0x201)+_0x2d6a12[_0x488cbd(0x20a)][_0x488cbd(0x20d)][_0x488cbd(0x1b8)]),console[_0x488cbd(0x1ef)](_0x488cbd(0x216)+_0x2d6a12[_0x488cbd(0x20a)][_0x488cbd(0x1ed)][_0x488cbd(0x1b8)]),console[_0x488cbd(0x1ef)](_0x488cbd(0x240)+_0x2d6a12[_0x488cbd(0x20a)][_0x488cbd(0x1a8)][_0x488cbd(0x1b8)]);const _0x3f1b59=_0x2d6a12[_0x488cbd(0x20a)][_0x488cbd(0x230)][_0x488cbd(0x1b8)]>0x0||_0x2d6a12['counts']['experimentalArtifacts'][_0x488cbd(0x1b8)]>0x0;return _0x3f1b59&&(console[_0x488cbd(0x1ef)](_0x488cbd(0x23b)+_0x2d6a12[_0x488cbd(0x20a)][_0x488cbd(0x230)]['created']),console[_0x488cbd(0x1ef)](_0x488cbd(0x1bd)+_0x2d6a12['counts'][_0x488cbd(0x1cb)][_0x488cbd(0x1b8)])),0x0;}const _0x4f1f07=_0x2d6a12[_0x488cbd(0x20a)][_0x488cbd(0x20d)][_0x488cbd(0x1fa)]>0x0||_0x2d6a12[_0x488cbd(0x20a)][_0x488cbd(0x1ed)][_0x488cbd(0x1fa)]>0x0||_0x2d6a12['counts'][_0x488cbd(0x1a8)][_0x488cbd(0x1fa)]>0x0||_0x2d6a12[_0x488cbd(0x20a)][_0x488cbd(0x230)][_0x488cbd(0x1fa)]>0x0||_0x2d6a12[_0x488cbd(0x20a)]['experimentalArtifacts'][_0x488cbd(0x1fa)]>0x0;_0x4f1f07?console[_0x488cbd(0x1ef)](a4_0x1f4b9a['yellow'](_0x488cbd(0x1a2))):console[_0x488cbd(0x1ef)](a4_0x1f4b9a['green'](_0x488cbd(0x1a7)));console[_0x488cbd(0x1ef)]('Source:\x20'+_0x2d6a12[_0x488cbd(0x195)]),console[_0x488cbd(0x1ef)](_0x488cbd(0x1f2)+_0x2d6a12['newProjectName']),console[_0x488cbd(0x1ef)](_0x488cbd(0x24a)+_0x2d6a12[_0x488cbd(0x206)]),console[_0x488cbd(0x1ef)](),console['log'](_0x488cbd(0x1b9)),console[_0x488cbd(0x1ef)](_0x488cbd(0x201)+formatCountSummary(_0x2d6a12['counts'][_0x488cbd(0x20d)])),console[_0x488cbd(0x1ef)](_0x488cbd(0x216)+formatCountSummary(_0x2d6a12[_0x488cbd(0x20a)][_0x488cbd(0x1ed)])),console[_0x488cbd(0x1ef)](_0x488cbd(0x240)+formatCountSummary(_0x2d6a12['counts'][_0x488cbd(0x1a8)])),console[_0x488cbd(0x1ef)](_0x488cbd(0x1f1)+formatCountSummary(_0x2d6a12[_0x488cbd(0x20a)][_0x488cbd(0x1ce)]));const _0x355ea6=_0x2d6a12[_0x488cbd(0x20a)][_0x488cbd(0x230)][_0x488cbd(0x1b8)]>0x0||_0x2d6a12[_0x488cbd(0x20a)][_0x488cbd(0x230)][_0x488cbd(0x1f8)]>0x0||_0x2d6a12[_0x488cbd(0x20a)][_0x488cbd(0x230)][_0x488cbd(0x1cf)]>0x0||_0x2d6a12[_0x488cbd(0x20a)][_0x488cbd(0x1cb)][_0x488cbd(0x1b8)]>0x0||_0x2d6a12[_0x488cbd(0x20a)]['experimentalArtifacts'][_0x488cbd(0x1f8)]>0x0||_0x2d6a12[_0x488cbd(0x20a)][_0x488cbd(0x1cb)]['unchanged']>0x0;_0x355ea6&&(console[_0x488cbd(0x1ef)](_0x488cbd(0x23b)+formatCountSummary(_0x2d6a12[_0x488cbd(0x20a)][_0x488cbd(0x230)])),console['log'](_0x488cbd(0x1bd)+formatCountSummary(_0x2d6a12[_0x488cbd(0x20a)]['experimentalArtifacts'])));if(_0x4f1f07){console[_0x488cbd(0x1ef)](),console[_0x488cbd(0x1ef)](a4_0x1f4b9a[_0x488cbd(0x23d)](_0x488cbd(0x1a3)));for(const _0xb15bae of _0x2d6a12[_0x488cbd(0x20d)]){_0xb15bae[_0x488cbd(0x1cc)]===_0x488cbd(0x1ff)&&console[_0x488cbd(0x1ef)](a4_0x1f4b9a[_0x488cbd(0x23d)]('\x20\x20Agent\x20\x22'+_0xb15bae[_0x488cbd(0x235)]+_0x488cbd(0x1d0)+_0xb15bae[_0x488cbd(0x1ff)]));}for(const _0x29a989 of _0x2d6a12[_0x488cbd(0x1ed)]){_0x29a989[_0x488cbd(0x1cc)]===_0x488cbd(0x1ff)&&console['log'](a4_0x1f4b9a[_0x488cbd(0x23d)]('\x20\x20Knowledge\x20Base\x20\x22'+_0x29a989[_0x488cbd(0x239)]+_0x488cbd(0x1d0)+_0x29a989['error']));}for(const _0x15b908 of _0x2d6a12['prompts']){_0x15b908[_0x488cbd(0x1cc)]==='error'&&console[_0x488cbd(0x1ef)](a4_0x1f4b9a[_0x488cbd(0x23d)](_0x488cbd(0x224)+_0x15b908[_0x488cbd(0x239)]+'\x22:\x20'+_0x15b908[_0x488cbd(0x1ff)]));}for(const _0x356246 of _0x2d6a12[_0x488cbd(0x1ce)]){_0x356246['action']==='error'&&console[_0x488cbd(0x1ef)](a4_0x1f4b9a[_0x488cbd(0x23d)](_0x488cbd(0x219)+_0x356246[_0x488cbd(0x239)]+_0x488cbd(0x1d0)+_0x356246[_0x488cbd(0x1ff)]));}for(const _0x4fdf8d of _0x2d6a12[_0x488cbd(0x230)]){_0x4fdf8d[_0x488cbd(0x1cc)]===_0x488cbd(0x1ff)&&console['log'](a4_0x1f4b9a[_0x488cbd(0x23d)]('\x20\x20Experimental\x20Knowledge\x20Base\x20\x22'+_0x4fdf8d['name']+_0x488cbd(0x1d0)+_0x4fdf8d[_0x488cbd(0x1ff)]));}for(const _0x28c8eb of _0x2d6a12[_0x488cbd(0x1cb)]){_0x28c8eb[_0x488cbd(0x1cc)]===_0x488cbd(0x1ff)&&console[_0x488cbd(0x1ef)](a4_0x1f4b9a['red']('\x20\x20Experimental\x20Artifact\x20\x22'+_0x28c8eb[_0x488cbd(0x239)]+'\x22:\x20'+_0x28c8eb[_0x488cbd(0x1ff)]));}return 0x1;}console[_0x488cbd(0x1ef)]();const _0xe74705=getLLMProjectUrl(_0xaaf592,_0x2d6a12[_0x488cbd(0x206)]);return console[_0x488cbd(0x1ef)](_0x488cbd(0x1b0)+a4_0x1f4b9a[_0x488cbd(0x23e)](_0xe74705)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x36616f(0x239)]='agent:push';[a4_0x36616f(0x1e8)]=a4_0x36616f(0x212);async['execute'](_0x556035){const _0x49be48=a4_0x36616f,{options:_0x24ac5e,args:_0x51fee3,tdx:_0x2dd979}=_0x556035;let _0x2cb93b=_0x51fee3[0x0]||process['cwd']();const _0x3239bb=_0x24ac5e[_0x49be48(0x193)],_0x4cbee9=_0x24ac5e[_0x49be48(0x233)],_0x3f26ef=_0x24ac5e[_0x49be48(0x245)],_0x314213=_0x24ac5e[_0x49be48(0x222)],_0x1478cc=a4_0x4e9b75[_0x49be48(0x1e7)](_0x2cb93b,_0x49be48(0x19b)),_0x19adfc=existsSync(_0x1478cc);if(_0x19adfc){const {data:_0x436fa9}=await withSpinner('Pushing\x20agent\x20from\x20\x22'+_0x2cb93b+_0x49be48(0x232),()=>_0x2dd979[_0x49be48(0x1a0)][_0x49be48(0x22d)](_0x2cb93b,{'dryRun':_0x3239bb,'force':_0x4cbee9}));if(_0x3239bb)return console[_0x49be48(0x1ef)](a4_0x1f4b9a[_0x49be48(0x213)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x49be48(0x1ef)](_0x49be48(0x20f)+_0x436fa9[_0x49be48(0x235)]),0x0;if(_0x436fa9['action']===_0x49be48(0x1ff))return console['log'](a4_0x1f4b9a[_0x49be48(0x23d)]('Failed\x20to\x20push\x20agent:\x20'+_0x436fa9['error'])),0x1;console[_0x49be48(0x1ef)](a4_0x1f4b9a[_0x49be48(0x1e0)](_0x49be48(0x1ab)+_0x436fa9[_0x49be48(0x1cc)]+_0x49be48(0x1dd))),console[_0x49be48(0x1ef)](_0x49be48(0x1bf)+_0x436fa9[_0x49be48(0x235)]);if(_0x436fa9[_0x49be48(0x1b4)]&&_0x436fa9[_0x49be48(0x1d1)]){const _0x2bf396=getLLMAgentChatUrl(_0x314213,_0x436fa9[_0x49be48(0x1d1)],_0x436fa9[_0x49be48(0x1b4)]);console[_0x49be48(0x1ef)](_0x49be48(0x19c)+a4_0x1f4b9a[_0x49be48(0x23e)](_0x2bf396));}return 0x0;}const _0x17ab3a=_0x24ac5e['llmProject'],_0xfc2e8d=resolveProjectFromContext(_0x2cb93b,_0x17ab3a);if(_0xfc2e8d[_0x49be48(0x23f)])_0x2cb93b=_0xfc2e8d['projectDir'],_0xfc2e8d[_0x49be48(0x1c6)]===_0x49be48(0x1c0)&&console[_0x49be48(0x1ef)](a4_0x1f4b9a[_0x49be48(0x218)](_0x49be48(0x1c3)+_0x2cb93b));else{let _0x8cbfa8='Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.';_0xfc2e8d[_0x49be48(0x21d)]===_0x49be48(0x248)&&(_0x8cbfa8=_0xfc2e8d['message']+'\x0aRun\x20\x27tdx\x20agent\x20pull\x20'+_0xfc2e8d[_0x49be48(0x1ad)]+_0x49be48(0x1f0));throw new SDKError(ErrorCode[_0x49be48(0x1ee)],_0xfc2e8d['reason']===_0x49be48(0x21a)?_0xfc2e8d[_0x49be48(0x226)]:_0x49be48(0x1d7)+_0x2cb93b,undefined,{'helpText':_0x8cbfa8});}const {data:_0x5d256e}=await withSpinner('Analyzing\x20changes\x20to\x20push...',()=>_0x2dd979['llm'][_0x49be48(0x1d3)](_0x2cb93b,{'dryRun':!![]})),_0x20568e=_0x5d256e[_0x49be48(0x20a)]['agents']['errors']>0x0;if(_0x20568e){console[_0x49be48(0x1ef)](a4_0x1f4b9a[_0x49be48(0x23d)](_0x49be48(0x1d8)));for(const _0x1bc8ab of _0x5d256e['agents']){_0x1bc8ab[_0x49be48(0x1cc)]==='error'&&console[_0x49be48(0x1ef)](a4_0x1f4b9a[_0x49be48(0x23d)]('\x20\x20Agent\x20\x22'+_0x1bc8ab[_0x49be48(0x235)]+_0x49be48(0x1d0)+_0x1bc8ab['error']));}return 0x1;}const _0xb733c0=_0x5d256e[_0x49be48(0x20a)][_0x49be48(0x20d)]['created']+_0x5d256e[_0x49be48(0x20a)]['knowledgeBases'][_0x49be48(0x1b8)]+_0x5d256e[_0x49be48(0x20a)][_0x49be48(0x217)][_0x49be48(0x1b8)]+_0x5d256e[_0x49be48(0x20a)][_0x49be48(0x1a8)][_0x49be48(0x1b8)]+_0x5d256e[_0x49be48(0x20a)][_0x49be48(0x1ce)][_0x49be48(0x1b8)]+_0x5d256e[_0x49be48(0x20a)]['experimentalKnowledgeBases'][_0x49be48(0x1b8)]+_0x5d256e[_0x49be48(0x20a)]['experimentalArtifacts']['created'],_0x3de0cc=_0x5d256e[_0x49be48(0x20a)][_0x49be48(0x20d)][_0x49be48(0x1f8)]+_0x5d256e['counts']['knowledgeBases'][_0x49be48(0x1f8)]+_0x5d256e[_0x49be48(0x20a)]['textKnowledgeBases'][_0x49be48(0x1f8)]+_0x5d256e['counts']['prompts']['updated']+_0x5d256e[_0x49be48(0x20a)][_0x49be48(0x1ce)]['updated']+_0x5d256e[_0x49be48(0x20a)]['experimentalKnowledgeBases'][_0x49be48(0x1f8)]+_0x5d256e[_0x49be48(0x20a)]['experimentalArtifacts']['updated'],_0x13dc63=_0x5d256e[_0x49be48(0x20a)]['agents'][_0x49be48(0x1cf)]+_0x5d256e['counts'][_0x49be48(0x1ed)][_0x49be48(0x1cf)]+_0x5d256e[_0x49be48(0x20a)][_0x49be48(0x217)][_0x49be48(0x1cf)]+_0x5d256e[_0x49be48(0x20a)][_0x49be48(0x1a8)][_0x49be48(0x1cf)]+_0x5d256e[_0x49be48(0x20a)][_0x49be48(0x1ce)]['unchanged']+_0x5d256e[_0x49be48(0x20a)][_0x49be48(0x230)]['unchanged']+_0x5d256e['counts'][_0x49be48(0x1cb)]['unchanged'];console[_0x49be48(0x1ef)](_0x49be48(0x203)+_0x5d256e['projectName']+'\x27:'),console['log']('\x20\x20'+a4_0x1f4b9a[_0x49be48(0x1e0)]('+\x20'+_0xb733c0+_0x49be48(0x1da))+_0x49be48(0x1c9)+a4_0x1f4b9a['yellow']('~\x20'+_0x3de0cc+_0x49be48(0x243))+_0x49be48(0x1c9)+a4_0x1f4b9a[_0x49be48(0x218)]('=\x20'+_0x13dc63+_0x49be48(0x24b))),console[_0x49be48(0x1ef)]('\x20\x20Agents:\x20'+formatCountSummary(_0x5d256e['counts'][_0x49be48(0x20d)])),console['log'](_0x49be48(0x216)+formatCountSummary(_0x5d256e[_0x49be48(0x20a)][_0x49be48(0x1ed)])),console['log']('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x5d256e[_0x49be48(0x20a)][_0x49be48(0x217)])),console[_0x49be48(0x1ef)](_0x49be48(0x240)+formatCountSummary(_0x5d256e[_0x49be48(0x20a)]['prompts'])),console[_0x49be48(0x1ef)](_0x49be48(0x1f1)+formatCountSummary(_0x5d256e[_0x49be48(0x20a)][_0x49be48(0x1ce)]));const _0x13371d=_0x5d256e[_0x49be48(0x20a)][_0x49be48(0x230)][_0x49be48(0x1b8)]>0x0||_0x5d256e[_0x49be48(0x20a)][_0x49be48(0x230)][_0x49be48(0x1f8)]>0x0||_0x5d256e[_0x49be48(0x20a)][_0x49be48(0x230)][_0x49be48(0x1cf)]>0x0||_0x5d256e['counts'][_0x49be48(0x1cb)][_0x49be48(0x1b8)]>0x0||_0x5d256e[_0x49be48(0x20a)][_0x49be48(0x1cb)]['updated']>0x0||_0x5d256e[_0x49be48(0x20a)][_0x49be48(0x1cb)][_0x49be48(0x1cf)]>0x0;_0x13371d&&(console['log'](_0x49be48(0x23b)+formatCountSummary(_0x5d256e[_0x49be48(0x20a)]['experimentalKnowledgeBases'])),console['log'](_0x49be48(0x1bd)+formatCountSummary(_0x5d256e['counts']['experimentalArtifacts'])));console[_0x49be48(0x1ef)](_0x49be48(0x1d6)+a4_0x1f4b9a[_0x49be48(0x23e)](_0x2cb93b)),displayDiffs(_0x5d256e['agents'],_0x5d256e['knowledgeBases'],_0x5d256e[_0x49be48(0x217)],_0x5d256e[_0x49be48(0x1a8)],_0x5d256e[_0x49be48(0x1ce)],_0x5d256e[_0x49be48(0x230)],_0x5d256e[_0x49be48(0x1cb)]);if(_0x3239bb)return console[_0x49be48(0x1ef)](a4_0x1f4b9a[_0x49be48(0x213)](_0x49be48(0x1e4))),0x0;if(_0xb733c0===0x0&&_0x3de0cc===0x0){console['log'](a4_0x1f4b9a[_0x49be48(0x1e0)](_0x49be48(0x200)));const _0x85813b=getLLMProjectUrl(_0x314213,_0x5d256e[_0x49be48(0x1d1)]);return console[_0x49be48(0x1ef)](_0x49be48(0x1b0)+a4_0x1f4b9a[_0x49be48(0x23e)](_0x85813b)),0x0;}if(!_0x3f26ef&&!_0x4cbee9){if(!isInteractive())return console[_0x49be48(0x1ff)](a4_0x1f4b9a[_0x49be48(0x23d)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x49be48(0x1ff)](a4_0x1f4b9a[_0x49be48(0x218)](_0x49be48(0x238))),0x1;const _0x4b3b6a=await confirmKey(_0x49be48(0x223)+(_0xb733c0+_0x3de0cc)+'\x20resources?');if(!_0x4b3b6a)return console[_0x49be48(0x1ef)](a4_0x1f4b9a['yellow'](_0x49be48(0x1e1)),_0x49be48(0x1dc)),0x1;}const {data:_0x239723}=await withSpinner(_0x49be48(0x1e3),()=>_0x2dd979[_0x49be48(0x1a0)][_0x49be48(0x1d3)](_0x2cb93b,{'force':_0x4cbee9})),_0x103307=_0x239723[_0x49be48(0x20a)][_0x49be48(0x20d)][_0x49be48(0x1fa)]>0x0||_0x239723['counts']['knowledgeBases'][_0x49be48(0x1fa)]>0x0||_0x239723[_0x49be48(0x20a)][_0x49be48(0x217)][_0x49be48(0x1fa)]>0x0||_0x239723['counts'][_0x49be48(0x1a8)][_0x49be48(0x1fa)]>0x0;if(_0x103307){console[_0x49be48(0x1ef)](a4_0x1f4b9a[_0x49be48(0x213)]('\x0aProject\x20pushed\x20with\x20errors')),console[_0x49be48(0x1ef)](),console[_0x49be48(0x1ef)](a4_0x1f4b9a[_0x49be48(0x23d)](_0x49be48(0x1a3)));for(const _0x1bf646 of _0x239723['agents']){_0x1bf646[_0x49be48(0x1cc)]==='error'&&console[_0x49be48(0x1ef)](a4_0x1f4b9a[_0x49be48(0x23d)]('\x20\x20Agent\x20\x22'+_0x1bf646[_0x49be48(0x235)]+_0x49be48(0x1d0)+_0x1bf646[_0x49be48(0x1ff)]));}for(const _0x3e04bb of _0x239723[_0x49be48(0x1ed)]){_0x3e04bb['action']===_0x49be48(0x1ff)&&console['log'](a4_0x1f4b9a[_0x49be48(0x23d)](_0x49be48(0x241)+_0x3e04bb[_0x49be48(0x239)]+_0x49be48(0x1d0)+_0x3e04bb['error']));}for(const _0x3be7cf of _0x239723[_0x49be48(0x217)]){_0x3be7cf[_0x49be48(0x1cc)]===_0x49be48(0x1ff)&&console['log'](a4_0x1f4b9a['red'](_0x49be48(0x1b5)+_0x3be7cf[_0x49be48(0x239)]+'\x22:\x20'+_0x3be7cf[_0x49be48(0x1ff)]));}for(const _0x566369 of _0x239723[_0x49be48(0x1a8)]){_0x566369[_0x49be48(0x1cc)]===_0x49be48(0x1ff)&&console[_0x49be48(0x1ef)](a4_0x1f4b9a['red'](_0x49be48(0x224)+_0x566369[_0x49be48(0x239)]+'\x22:\x20'+_0x566369[_0x49be48(0x1ff)]));}for(const _0x39216f of _0x239723[_0x49be48(0x1ce)]){_0x39216f[_0x49be48(0x1cc)]===_0x49be48(0x1ff)&&console[_0x49be48(0x1ef)](a4_0x1f4b9a['red']('\x20\x20Integration\x20\x22'+_0x39216f[_0x49be48(0x239)]+_0x49be48(0x1d0)+_0x39216f[_0x49be48(0x1ff)]));}return 0x1;}console[_0x49be48(0x1ef)](a4_0x1f4b9a[_0x49be48(0x1e0)]('\x0a✔\x20Pushed\x20'+(_0xb733c0+_0x3de0cc)+_0x49be48(0x1fd)+_0x239723['projectName']+'\x27'));const _0x59a191=getLLMProjectUrl(_0x314213,_0x239723[_0x49be48(0x1d1)]);return console[_0x49be48(0x1ef)](_0x49be48(0x1b0)+a4_0x1f4b9a[_0x49be48(0x23e)](_0x59a191)),0x0;}}
1
+ const a4_0xbf99dc=a4_0x1b51;(function(_0x4ad687,_0x25bb16){const _0x1037bf=a4_0x1b51,_0x524355=_0x4ad687();while(!![]){try{const _0x2c43fc=-parseInt(_0x1037bf(0x225))/0x1*(parseInt(_0x1037bf(0x240))/0x2)+parseInt(_0x1037bf(0x1ba))/0x3*(parseInt(_0x1037bf(0x23f))/0x4)+-parseInt(_0x1037bf(0x207))/0x5+parseInt(_0x1037bf(0x203))/0x6*(-parseInt(_0x1037bf(0x22c))/0x7)+parseInt(_0x1037bf(0x24b))/0x8*(-parseInt(_0x1037bf(0x239))/0x9)+-parseInt(_0x1037bf(0x206))/0xa+-parseInt(_0x1037bf(0x228))/0xb*(-parseInt(_0x1037bf(0x1de))/0xc);if(_0x2c43fc===_0x25bb16)break;else _0x524355['push'](_0x524355['shift']());}catch(_0x4e1c60){_0x524355['push'](_0x524355['shift']());}}}(a4_0x1139,0x67bce));function a4_0x1139(){const _0x9cb418=['\x20total','1560152QVXYQT','1440MazVdU','no_local_folder','Output:\x20','agent:clone','\x20unchanged','source','counts','cyan','Failed\x20to\x20push\x20agent:\x20','Pulling\x20agent\x20\x22','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','6232ISSAvS','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','textKnowledgeBases','Status:\x20','error','no_context','dirname','projectDir','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','\x22...','outputDir','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','outputPath','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20project','\x0aPush\x20','llm_project','Chat:\x20','No\x20tdx.json\x20found\x20in\x20','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','newProjectId','output','\x20\x20Experimental\x20Artifacts:\x20','Cancelled','agentId','parse','\x20\x20Knowledge\x20Base\x20\x22','Analyzing\x20changes\x20to\x20push...','new','Project\x20cloned\x20with\x20errors','updated','Project:\x20','Using\x20local\x20project:\x20','\x20\x20tdx\x20agent\x20clone\x20agents/','\x20successfully','\x20resources?','unchanged','isNew','\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','6pLBjJK','\x20created','yes','errors','projectId','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','Using\x20project:\x20','name','\x0aPull\x20summary\x20for\x20\x27','Agent:\x20','\x22\x20to\x20new\x20project\x20\x22','\x20\x20Agent\x20\x22','Writing\x20files...','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','total','Using\x20project\x20from\x20','MISSING_ARGUMENT','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','session','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','\x0aError:','Output\x20path:\x20','\x20\x20Knowledge\x20Bases:\x20','Would\x20push\x20agent:\x20','Source:\x20','projectName','experimentalArtifacts','execute','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','hasChanges','\x0aChanges\x20to\x20integration\x20\x27','agent:push','Agent\x20','found','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','dim','12TKmTdB','cwd','agentName','knowledgeBases','experimentalKnowledgeBases','context','dryRun','Using\x20context\x20project:\x20','\x20new','force','\x20\x20Source:\x20','Using\x20current\x20project:\x20','cwd-config','<new-name>','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','\x22:\x20','\x22\x20to\x20a\x20different\x20profile','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','Errors:','\x20\x20Integrations:\x20','\x0a✔\x20Pushed\x20','yellow','\x20\x20Text\x20Knowledge\x20Bases:\x20','red','Project\x20cloned\x20successfully','\x0a✔\x20Pulled\x20','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','\x20changed','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','diff','INVALID_ARGUMENT','site','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','Agent\x20pulled\x20successfully','green','agent.yml','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','1426752qSJJYb','agent:pull','Cannot\x20clone\x20from\x20context\x20project\x20\x22','3864640NHZgXl','1126810LfIlVF','\x20errors','llmProject','prompts','Analyzing\x20project\x20\x22','\x0aPush\x20summary\x20for\x20\x27','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','Cloning\x20\x22','\x20\x20Prompts:\x20','New\x20project\x20ID:\x20','repeat','newProjectName','action','\x20--profile\x20','\x20files\x20to\x20','cloneProject','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','integrations','\x20\x20Agents:\x20','\x20|\x20','✔\x20Context\x20set:\x20','\x20\x20Text\x20Knowledge\x20Base\x20\x22','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','tdx.json','Usage:\x20tdx\x20agent\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20project\x20(requires\x20context\x20or\x20tdx.json)','Pushing\x20to\x20project...','llm','\x0aProject\x20pushed\x20with\x20errors','Summary:','10DUXSkQ','join','log','13815131SHYkMh','pullProject','\x22\x20from\x20project\x20\x22','sourceProjectName','14onCFBH','message','New\x20project:\x20','gray','push','agents','Pushing\x20agent\x20from\x20\x22','pushProject','\x27\x20to\x20create\x20the\x20folder\x20structure.','Would\x20pull\x20agent:\x20','utf-8','created','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','5967OSgvbO','-\x20nothing\x20pushed','\x20\x20Prompt\x20\x22','Clone\x20\x22','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27'];a4_0x1139=function(){return _0x9cb418;};return a4_0x1139();}import a4_0x25a774 from'chalk';import a4_0x5479b5 from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext,resolveAgentPullArgs}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x33fca6){const _0x58e461=a4_0x1b51,_0x4651c9=[];if(_0x33fca6['total']!==undefined)_0x4651c9[_0x58e461(0x230)](_0x33fca6[_0x58e461(0x1c8)]+_0x58e461(0x23e));if(_0x33fca6['new']!==undefined&&_0x33fca6['new']>0x0)_0x4651c9[_0x58e461(0x230)](a4_0x25a774[_0x58e461(0x200)](_0x33fca6[_0x58e461(0x1af)]+'\x20new'));if(_0x33fca6[_0x58e461(0x237)]!==undefined&&_0x33fca6[_0x58e461(0x237)]>0x0)_0x4651c9[_0x58e461(0x230)](a4_0x25a774[_0x58e461(0x200)](_0x33fca6[_0x58e461(0x237)]+_0x58e461(0x1bb)));if(_0x33fca6['updated']!==undefined&&_0x33fca6[_0x58e461(0x1b1)]>0x0)_0x4651c9[_0x58e461(0x230)](a4_0x25a774[_0x58e461(0x1f3)](_0x33fca6['updated']+'\x20updated'));if(_0x33fca6['unchanged']!==undefined&&_0x33fca6[_0x58e461(0x1b7)]>0x0)_0x4651c9[_0x58e461(0x230)](a4_0x25a774[_0x58e461(0x22f)](_0x33fca6[_0x58e461(0x1b7)]+_0x58e461(0x244)));if(_0x33fca6[_0x58e461(0x1bd)]!==undefined&&_0x33fca6[_0x58e461(0x1bd)]>0x0)_0x4651c9[_0x58e461(0x230)](a4_0x25a774[_0x58e461(0x1f5)](_0x33fca6[_0x58e461(0x1bd)]+_0x58e461(0x208)));return _0x4651c9[_0x58e461(0x226)](',\x20');}function displayDiffs(_0x5030e1,_0x4b21c6,_0x1a4fd4,_0x4903d4,_0x2f7718,_0xb2e212,_0x2d5a12){const _0x1a9534=a4_0x1b51;for(const _0x10c108 of _0x5030e1){if(_0x10c108[_0x1a9534(0x1fb)]){const _0x29c673=_0x10c108[_0x1a9534(0x1e0)]||_0x10c108[_0x1a9534(0x1c1)];console[_0x1a9534(0x227)]('\x0aChanges\x20to\x20agent\x20\x27'+_0x29c673+'\x27:'),console[_0x1a9534(0x227)]('─'[_0x1a9534(0x211)](0x3c)),console[_0x1a9534(0x227)](_0x10c108[_0x1a9534(0x1fb)]),console[_0x1a9534(0x227)]('─'['repeat'](0x3c));}}for(const _0x5593ca of _0x4b21c6){_0x5593ca['diff']&&(console['log'](_0x1a9534(0x24a)+_0x5593ca[_0x1a9534(0x1c1)]+'\x27:'),console[_0x1a9534(0x227)]('─'[_0x1a9534(0x211)](0x3c)),console[_0x1a9534(0x227)](_0x5593ca['diff']),console[_0x1a9534(0x227)]('─'[_0x1a9534(0x211)](0x3c)));}for(const _0xd369f9 of _0x1a4fd4){_0xd369f9['diff']&&(console['log']('\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27'+_0xd369f9['name']+'\x27:'),console['log']('─'['repeat'](0x3c)),console['log'](_0xd369f9[_0x1a9534(0x1fb)]),console[_0x1a9534(0x227)]('─'['repeat'](0x3c)));}for(const _0x515493 of _0x4903d4){_0x515493['diff']&&(console[_0x1a9534(0x227)]('\x0aChanges\x20to\x20prompt\x20\x27'+_0x515493[_0x1a9534(0x1c1)]+'\x27:'),console['log']('─'['repeat'](0x3c)),console[_0x1a9534(0x227)](_0x515493[_0x1a9534(0x1fb)]),console[_0x1a9534(0x227)]('─'[_0x1a9534(0x211)](0x3c)));}for(const _0x2fd9ae of _0x2f7718){_0x2fd9ae['diff']&&(console[_0x1a9534(0x227)](_0x1a9534(0x1d8)+_0x2fd9ae['name']+'\x27:'),console['log']('─'[_0x1a9534(0x211)](0x3c)),console[_0x1a9534(0x227)](_0x2fd9ae['diff']),console[_0x1a9534(0x227)]('─'['repeat'](0x3c)));}for(const _0x950d05 of _0xb2e212){_0x950d05[_0x1a9534(0x1fb)]&&(console[_0x1a9534(0x227)](_0x1a9534(0x217)+_0x950d05[_0x1a9534(0x1c1)]+'\x27:'),console[_0x1a9534(0x227)]('─'[_0x1a9534(0x211)](0x3c)),console[_0x1a9534(0x227)](_0x950d05[_0x1a9534(0x1fb)]),console[_0x1a9534(0x227)]('─'[_0x1a9534(0x211)](0x3c)));}for(const _0x1b8232 of _0x2d5a12){_0x1b8232[_0x1a9534(0x1fb)]&&(console[_0x1a9534(0x227)](_0x1a9534(0x23d)+_0x1b8232[_0x1a9534(0x1c1)]+'\x27:'),console[_0x1a9534(0x227)]('─'[_0x1a9534(0x211)](0x3c)),console[_0x1a9534(0x227)](_0x1b8232['diff']),console['log']('─'[_0x1a9534(0x211)](0x3c)));}}export class AgentPullCommand extends BaseCommand{['name']=a4_0xbf99dc(0x204);['description']=a4_0xbf99dc(0x253);async['execute'](_0x1c052d){const _0x5e6e26=a4_0xbf99dc,{options:_0x3e9624,args:_0x30cb45,tdx:_0x4cfde3}=_0x1c052d,_0x16def1=_0x30cb45[0x0],_0x339739=_0x30cb45[0x1],_0x32f9e4=_0x3e9624[_0x5e6e26(0x25f)],_0x3af933=_0x3e9624[_0x5e6e26(0x1e4)],_0x40c9e8=_0x3e9624[_0x5e6e26(0x1e7)],_0x1a11c0=_0x3e9624['yes'],_0x268541=_0x3e9624[_0x5e6e26(0x209)],_0xaa84cc=_0x3e9624['agent'];let _0x5deb76;if(_0x16def1){const _0x3f90bc=a4_0x5479b5[_0x5e6e26(0x226)](_0x16def1,_0x5e6e26(0x21f));if(existsSync(_0x3f90bc))try{const _0x36d2cc=JSON[_0x5e6e26(0x1ac)](readFileSync(_0x3f90bc,_0x5e6e26(0x236)));_0x36d2cc['llm_project']&&(_0x5deb76={'llm_project':_0x36d2cc[_0x5e6e26(0x25a)]});}catch{}}const _0x462767=findAgentConfigPath(process[_0x5e6e26(0x1df)]());let _0x2f21f7;if(_0x462767)try{const _0x582c2b=JSON[_0x5e6e26(0x1ac)](readFileSync(_0x462767,_0x5e6e26(0x236)));_0x582c2b['llm_project']&&(_0x2f21f7={'llm_project':_0x582c2b[_0x5e6e26(0x25a)]});}catch{}const _0x32a2fe=resolveAgentPullArgs({'arg':_0x16def1,'agentNameArg':_0x339739,'agentFlag':_0xaa84cc,'contextProject':_0x268541,'argDirConfig':_0x5deb76,'cwdConfigPath':_0x462767||undefined,'cwdConfig':_0x2f21f7}),{projectNameOrId:_0x1924b6,targetAgentName:_0x5e9f08,existingOutputDir:_0x3d8d53,source:_0x34b4d0}=_0x32a2fe;if(_0x34b4d0==='arg-dir')console[_0x5e6e26(0x227)](a4_0x25a774[_0x5e6e26(0x1dd)](_0x5e6e26(0x1c9)+a4_0x5479b5[_0x5e6e26(0x226)](_0x16def1,'tdx.json')+':\x20'+_0x1924b6));else{if(_0x34b4d0===_0x5e6e26(0x1ea))console[_0x5e6e26(0x227)](a4_0x25a774['dim'](_0x5e6e26(0x1c0)+_0x1924b6));else _0x34b4d0===_0x5e6e26(0x1e3)&&console[_0x5e6e26(0x227)](a4_0x25a774['dim']('Using\x20project\x20from\x20context:\x20'+_0x1924b6));}if(!_0x1924b6)return _0xaa84cc?(console[_0x5e6e26(0x227)](a4_0x25a774[_0x5e6e26(0x1f3)](_0x5e6e26(0x1ef))),console['log'](_0x5e6e26(0x202)),console[_0x5e6e26(0x227)](_0x5e6e26(0x1ec))):(console[_0x5e6e26(0x227)](a4_0x25a774['yellow'](_0x5e6e26(0x1cb))),console[_0x5e6e26(0x227)](_0x5e6e26(0x220)),console[_0x5e6e26(0x227)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project'),console[_0x5e6e26(0x227)]('\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[_0x5e6e26(0x227)](_0x5e6e26(0x1b9)),console[_0x5e6e26(0x227)](_0x5e6e26(0x258))),0x1;if(_0x5e9f08){const {data:_0x3bf000}=await withSpinner(_0x5e6e26(0x249)+_0x5e9f08+_0x5e6e26(0x22a)+_0x1924b6+_0x5e6e26(0x254),()=>_0x4cfde3['llm']['pullAgent'](_0x1924b6,_0x5e9f08,_0x32f9e4,{'dryRun':_0x3af933,'force':_0x40c9e8}));if(_0x3af933)return console['log'](a4_0x25a774[_0x5e6e26(0x1f3)]('Dry\x20run\x20-\x20no\x20files\x20written')),console[_0x5e6e26(0x227)](_0x5e6e26(0x235)+_0x3bf000[_0x5e6e26(0x1e0)]),console[_0x5e6e26(0x227)](_0x5e6e26(0x1cf)+_0x3bf000['outputPath']),_0x3bf000[_0x5e6e26(0x1fb)]&&(console[_0x5e6e26(0x227)]('\x0aChanges:'),console[_0x5e6e26(0x227)]('─'[_0x5e6e26(0x211)](0x3c)),console[_0x5e6e26(0x227)](_0x3bf000[_0x5e6e26(0x1fb)]),console[_0x5e6e26(0x227)]('─'[_0x5e6e26(0x211)](0x3c))),0x0;return console[_0x5e6e26(0x227)](a4_0x25a774[_0x5e6e26(0x200)](_0x5e6e26(0x1ff))),console[_0x5e6e26(0x227)](_0x5e6e26(0x1c3)+_0x3bf000[_0x5e6e26(0x1e0)]),console[_0x5e6e26(0x227)](_0x5e6e26(0x242)+_0x3bf000[_0x5e6e26(0x257)]),console[_0x5e6e26(0x227)](_0x5e6e26(0x24e)+(_0x3bf000[_0x5e6e26(0x1b8)]?a4_0x25a774['green']('new'):_0x3bf000[_0x5e6e26(0x1d7)]?a4_0x25a774['yellow'](_0x5e6e26(0x1b1)):a4_0x25a774[_0x5e6e26(0x22f)](_0x5e6e26(0x1b7)))),0x0;}const _0x3c54dc=_0x3d8d53||_0x32f9e4,{data:_0x38469d}=await withSpinner(_0x5e6e26(0x20b)+_0x1924b6+_0x5e6e26(0x254),()=>_0x4cfde3[_0x5e6e26(0x222)][_0x5e6e26(0x229)](_0x1924b6,_0x3c54dc,{'dryRun':!![]})),_0xd51447=_0x38469d['counts'][_0x5e6e26(0x231)]['new']+_0x38469d[_0x5e6e26(0x246)][_0x5e6e26(0x1e1)]['new']+_0x38469d[_0x5e6e26(0x246)][_0x5e6e26(0x24d)][_0x5e6e26(0x1af)]+_0x38469d[_0x5e6e26(0x246)]['prompts']['new']+_0x38469d[_0x5e6e26(0x246)][_0x5e6e26(0x218)][_0x5e6e26(0x1af)]+_0x38469d['counts']['experimentalKnowledgeBases'][_0x5e6e26(0x1af)]+_0x38469d[_0x5e6e26(0x246)][_0x5e6e26(0x1d4)][_0x5e6e26(0x1af)],_0x4fd1e8=_0x38469d[_0x5e6e26(0x246)][_0x5e6e26(0x231)][_0x5e6e26(0x1b1)]+_0x38469d['counts']['knowledgeBases'][_0x5e6e26(0x1b1)]+_0x38469d[_0x5e6e26(0x246)][_0x5e6e26(0x24d)][_0x5e6e26(0x1b1)]+_0x38469d[_0x5e6e26(0x246)][_0x5e6e26(0x20a)][_0x5e6e26(0x1b1)]+_0x38469d[_0x5e6e26(0x246)][_0x5e6e26(0x218)][_0x5e6e26(0x1b1)]+_0x38469d['counts'][_0x5e6e26(0x1e2)][_0x5e6e26(0x1b1)]+_0x38469d[_0x5e6e26(0x246)][_0x5e6e26(0x1d4)][_0x5e6e26(0x1b1)],_0x576566=_0x38469d['counts'][_0x5e6e26(0x231)][_0x5e6e26(0x1b7)]+_0x38469d[_0x5e6e26(0x246)][_0x5e6e26(0x1e1)][_0x5e6e26(0x1b7)]+_0x38469d[_0x5e6e26(0x246)][_0x5e6e26(0x24d)][_0x5e6e26(0x1b7)]+_0x38469d[_0x5e6e26(0x246)]['prompts']['unchanged']+_0x38469d[_0x5e6e26(0x246)][_0x5e6e26(0x218)][_0x5e6e26(0x1b7)]+_0x38469d['counts'][_0x5e6e26(0x1e2)]['unchanged']+_0x38469d[_0x5e6e26(0x246)]['experimentalArtifacts'][_0x5e6e26(0x1b7)];console[_0x5e6e26(0x227)](_0x5e6e26(0x1c2)+_0x38469d[_0x5e6e26(0x1d3)]+'\x27:'),console['log']('\x20\x20'+a4_0x25a774[_0x5e6e26(0x200)]('+\x20'+_0xd51447+'\x20new')+_0x5e6e26(0x21a)+a4_0x25a774['yellow']('~\x20'+_0x4fd1e8+_0x5e6e26(0x1f9))+_0x5e6e26(0x21a)+a4_0x25a774[_0x5e6e26(0x1dd)]('=\x20'+_0x576566+_0x5e6e26(0x244))),console[_0x5e6e26(0x227)](_0x5e6e26(0x219)+formatCountSummary(_0x38469d[_0x5e6e26(0x246)]['agents'])),console[_0x5e6e26(0x227)](_0x5e6e26(0x1d0)+formatCountSummary(_0x38469d[_0x5e6e26(0x246)]['knowledgeBases'])),console[_0x5e6e26(0x227)](_0x5e6e26(0x1f4)+formatCountSummary(_0x38469d[_0x5e6e26(0x246)]['textKnowledgeBases'])),console['log']('\x20\x20Prompts:\x20'+formatCountSummary(_0x38469d[_0x5e6e26(0x246)][_0x5e6e26(0x20a)])),console[_0x5e6e26(0x227)](_0x5e6e26(0x1f1)+formatCountSummary(_0x38469d[_0x5e6e26(0x246)]['integrations']));const _0x2b29d6=_0x38469d['counts'][_0x5e6e26(0x1e2)][_0x5e6e26(0x1c8)]>0x0||_0x38469d[_0x5e6e26(0x246)]['experimentalArtifacts'][_0x5e6e26(0x1c8)]>0x0;_0x2b29d6&&(console['log'](_0x5e6e26(0x256)+formatCountSummary(_0x38469d['counts'][_0x5e6e26(0x1e2)])),console[_0x5e6e26(0x227)](_0x5e6e26(0x260)+formatCountSummary(_0x38469d[_0x5e6e26(0x246)][_0x5e6e26(0x1d4)])));console[_0x5e6e26(0x227)]('\x20\x20Target:\x20'+a4_0x25a774[_0x5e6e26(0x247)](_0x38469d[_0x5e6e26(0x255)])),displayDiffs(_0x38469d[_0x5e6e26(0x231)],_0x38469d[_0x5e6e26(0x1e1)],_0x38469d[_0x5e6e26(0x24d)],_0x38469d[_0x5e6e26(0x20a)],_0x38469d[_0x5e6e26(0x218)],_0x38469d[_0x5e6e26(0x1e2)],_0x38469d[_0x5e6e26(0x1d4)]);if(_0x3af933)return console[_0x5e6e26(0x227)](a4_0x25a774[_0x5e6e26(0x1f3)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0xd51447===0x0&&_0x4fd1e8===0x0)return console[_0x5e6e26(0x227)](a4_0x25a774[_0x5e6e26(0x200)](_0x5e6e26(0x21e))),saveSessionContext({'llm_project':_0x38469d[_0x5e6e26(0x1d3)]},_0x3e9624[_0x5e6e26(0x1cc)]),console[_0x5e6e26(0x227)](a4_0x25a774[_0x5e6e26(0x200)]('✔\x20Context\x20set:\x20'+a4_0x25a774[_0x5e6e26(0x1dd)](_0x5e6e26(0x25a))+'\x20=\x20'+a4_0x25a774[_0x5e6e26(0x247)](_0x38469d[_0x5e6e26(0x1d3)]))),0x0;if(!_0x1a11c0&&!_0x40c9e8){if(!isInteractive())return console[_0x5e6e26(0x24f)](a4_0x25a774[_0x5e6e26(0x1f5)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x5e6e26(0x24f)](a4_0x25a774['dim'](_0x5e6e26(0x1c7))),0x1;const _0x4a62e2=await confirmKey('\x0aWrite\x20'+(_0xd51447+_0x4fd1e8)+'\x20files?');if(!_0x4a62e2)return console['log'](a4_0x25a774['yellow'](_0x5e6e26(0x261)),'-\x20no\x20files\x20written'),0x1;}const {data:_0x15135c}=await withSpinner(_0x5e6e26(0x1c6),()=>_0x4cfde3['llm'][_0x5e6e26(0x229)](_0x1924b6,_0x3c54dc,{'force':_0x40c9e8}));return console[_0x5e6e26(0x227)](a4_0x25a774[_0x5e6e26(0x200)](_0x5e6e26(0x1f7)+(_0xd51447+_0x4fd1e8)+_0x5e6e26(0x215)+_0x15135c[_0x5e6e26(0x255)])),saveSessionContext({'llm_project':_0x15135c['projectName']},_0x3e9624[_0x5e6e26(0x1cc)]),console[_0x5e6e26(0x227)](a4_0x25a774[_0x5e6e26(0x200)](_0x5e6e26(0x21b)+a4_0x25a774[_0x5e6e26(0x1dd)](_0x5e6e26(0x25a))+'\x20=\x20'+a4_0x25a774['cyan'](_0x15135c['projectName']))),0x0;}}function a4_0x1b51(_0x4ccfe8,_0xe32432){_0x4ccfe8=_0x4ccfe8-0x1ac;const _0x113984=a4_0x1139();let _0x1b51d2=_0x113984[_0x4ccfe8];return _0x1b51d2;}export class AgentCloneCommand extends BaseCommand{[a4_0xbf99dc(0x1c1)]=a4_0xbf99dc(0x243);['description']=a4_0xbf99dc(0x24c);async['execute'](_0x35eedd){const _0x45da3c=a4_0xbf99dc,{options:_0x4dd020,args:_0x4825a3,tdx:_0x45449d}=_0x35eedd,_0x2d342d=_0x4825a3[0x0],_0x48e536=_0x4dd020[_0x45da3c(0x1c1)],_0x565e5c=_0x4dd020[_0x45da3c(0x1e4)],_0x230ebd=_0x4dd020[_0x45da3c(0x1bc)],_0x1ab8fd=_0x4dd020[_0x45da3c(0x1fd)],_0x449374=_0x4dd020[_0x45da3c(0x209)];let _0x386659;const _0x573834=findAgentConfigPath(process[_0x45da3c(0x1df)]());if(_0x2d342d){const _0xdf25c3=a4_0x5479b5[_0x45da3c(0x226)](_0x2d342d,_0x45da3c(0x21f));existsSync(_0xdf25c3)?(_0x386659=_0x2d342d,console['log'](a4_0x25a774[_0x45da3c(0x1dd)](_0x45da3c(0x1b3)+_0x2d342d))):_0x386659=_0x2d342d;}else{if(_0x573834)_0x386659=a4_0x5479b5['dirname'](_0x573834),console[_0x45da3c(0x227)](a4_0x25a774[_0x45da3c(0x1dd)](_0x45da3c(0x1e9)+_0x386659));else{if(_0x449374){const _0x4170c8=sanitizeForFilesystem(_0x449374);let _0x5b0bc8=_0x4170c8,_0x2fd08d=a4_0x5479b5['join'](process[_0x45da3c(0x1df)](),_0x45da3c(0x231),_0x4170c8,_0x45da3c(0x21f));if(!existsSync(_0x2fd08d)){const _0x444216=normalizeName(_0x449374),_0x2c3974=a4_0x5479b5['join'](process[_0x45da3c(0x1df)](),_0x45da3c(0x231),_0x444216,_0x45da3c(0x21f));existsSync(_0x2c3974)&&(_0x5b0bc8=_0x444216,_0x2fd08d=_0x2c3974);}if(existsSync(_0x2fd08d))_0x386659=a4_0x5479b5[_0x45da3c(0x251)](_0x2fd08d),console[_0x45da3c(0x227)](a4_0x25a774[_0x45da3c(0x1dd)](_0x45da3c(0x1b3)+_0x386659));else{const _0x51a24c=_0x4dd020['profile'];if(_0x51a24c)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x45da3c(0x205)+_0x449374+_0x45da3c(0x1ee),undefined,{'helpText':_0x45da3c(0x1bf)+_0x45da3c(0x1cd)+('\x20\x20tdx\x20agent\x20pull\x20'+_0x449374+'\x0a')+(_0x45da3c(0x1b4)+_0x5b0bc8+'\x20--name\x20'+(_0x48e536||_0x45da3c(0x1eb))+_0x45da3c(0x214)+_0x51a24c)});_0x386659=_0x449374,console[_0x45da3c(0x227)](a4_0x25a774[_0x45da3c(0x1dd)](_0x45da3c(0x1e5)+_0x449374));}}}}if(!_0x386659)return console[_0x45da3c(0x227)](a4_0x25a774[_0x45da3c(0x1f3)](_0x45da3c(0x1fe))),console['log'](_0x45da3c(0x1d6)),console[_0x45da3c(0x227)](_0x45da3c(0x20d)),console[_0x45da3c(0x227)]('\x20\x20tdx\x20agent\x20clone\x20--name\x20<new-name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clone\x20from\x20context\x20(llm_project)'),console[_0x45da3c(0x227)](_0x45da3c(0x1dc)),0x1;if(!_0x48e536)throw new SDKError(ErrorCode[_0x45da3c(0x1ca)],'New\x20project\x20name\x20is\x20required',undefined,{'helpText':'Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>'});if(!_0x230ebd&&!_0x565e5c){if(!isInteractive())return console['error'](a4_0x25a774[_0x45da3c(0x1f5)](_0x45da3c(0x1ce)),_0x45da3c(0x21d)),console[_0x45da3c(0x24f)](a4_0x25a774[_0x45da3c(0x1dd)](_0x45da3c(0x1c7))),0x1;const _0x22afa9=await confirmKey(_0x45da3c(0x23c)+_0x386659+_0x45da3c(0x1c4)+_0x48e536+'\x22?');if(!_0x22afa9)return console[_0x45da3c(0x227)](a4_0x25a774['yellow']('Cancelled')),0x1;}const {data:_0x1372d9}=await withSpinner(_0x45da3c(0x20e)+_0x386659+'\x22\x20to\x20\x22'+_0x48e536+'\x22...',()=>_0x45449d[_0x45da3c(0x222)][_0x45da3c(0x216)](_0x386659,_0x48e536,{'dryRun':_0x565e5c}));if(_0x565e5c){console[_0x45da3c(0x227)](a4_0x25a774[_0x45da3c(0x1f3)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console['log'](_0x45da3c(0x1d2)+_0x1372d9[_0x45da3c(0x22b)]),console['log'](_0x45da3c(0x22e)+_0x48e536),console[_0x45da3c(0x227)]('Would\x20clone:'),console['log']('\x20\x20Agents:\x20'+_0x1372d9[_0x45da3c(0x246)]['agents'][_0x45da3c(0x237)]),console[_0x45da3c(0x227)](_0x45da3c(0x1d0)+_0x1372d9[_0x45da3c(0x246)][_0x45da3c(0x1e1)][_0x45da3c(0x237)]),console[_0x45da3c(0x227)](_0x45da3c(0x20f)+_0x1372d9[_0x45da3c(0x246)][_0x45da3c(0x20a)]['created']);const _0x2f3a83=_0x1372d9[_0x45da3c(0x246)][_0x45da3c(0x1e2)]['created']>0x0||_0x1372d9['counts']['experimentalArtifacts'][_0x45da3c(0x237)]>0x0;return _0x2f3a83&&(console['log'](_0x45da3c(0x256)+_0x1372d9[_0x45da3c(0x246)][_0x45da3c(0x1e2)][_0x45da3c(0x237)]),console[_0x45da3c(0x227)]('\x20\x20Experimental\x20Artifacts:\x20'+_0x1372d9[_0x45da3c(0x246)]['experimentalArtifacts'][_0x45da3c(0x237)])),0x0;}const _0x5a39c3=_0x1372d9[_0x45da3c(0x246)][_0x45da3c(0x231)][_0x45da3c(0x1bd)]>0x0||_0x1372d9[_0x45da3c(0x246)][_0x45da3c(0x1e1)]['errors']>0x0||_0x1372d9[_0x45da3c(0x246)][_0x45da3c(0x20a)]['errors']>0x0||_0x1372d9['counts'][_0x45da3c(0x1e2)][_0x45da3c(0x1bd)]>0x0||_0x1372d9[_0x45da3c(0x246)][_0x45da3c(0x1d4)]['errors']>0x0;_0x5a39c3?console[_0x45da3c(0x227)](a4_0x25a774[_0x45da3c(0x1f3)](_0x45da3c(0x1b0))):console[_0x45da3c(0x227)](a4_0x25a774['green'](_0x45da3c(0x1f6)));console[_0x45da3c(0x227)](_0x45da3c(0x1d2)+_0x1372d9[_0x45da3c(0x22b)]),console[_0x45da3c(0x227)](_0x45da3c(0x22e)+_0x1372d9[_0x45da3c(0x212)]),console['log'](_0x45da3c(0x210)+_0x1372d9[_0x45da3c(0x25e)]),console['log'](),console[_0x45da3c(0x227)](_0x45da3c(0x224)),console[_0x45da3c(0x227)](_0x45da3c(0x219)+formatCountSummary(_0x1372d9['counts']['agents'])),console[_0x45da3c(0x227)](_0x45da3c(0x1d0)+formatCountSummary(_0x1372d9['counts'][_0x45da3c(0x1e1)])),console[_0x45da3c(0x227)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x1372d9[_0x45da3c(0x246)]['prompts'])),console[_0x45da3c(0x227)](_0x45da3c(0x1f1)+formatCountSummary(_0x1372d9[_0x45da3c(0x246)]['integrations']));const _0x2a576d=_0x1372d9[_0x45da3c(0x246)][_0x45da3c(0x1e2)][_0x45da3c(0x237)]>0x0||_0x1372d9[_0x45da3c(0x246)][_0x45da3c(0x1e2)]['updated']>0x0||_0x1372d9[_0x45da3c(0x246)]['experimentalKnowledgeBases'][_0x45da3c(0x1b7)]>0x0||_0x1372d9[_0x45da3c(0x246)][_0x45da3c(0x1d4)][_0x45da3c(0x237)]>0x0||_0x1372d9[_0x45da3c(0x246)][_0x45da3c(0x1d4)]['updated']>0x0||_0x1372d9[_0x45da3c(0x246)][_0x45da3c(0x1d4)][_0x45da3c(0x1b7)]>0x0;_0x2a576d&&(console[_0x45da3c(0x227)](_0x45da3c(0x256)+formatCountSummary(_0x1372d9[_0x45da3c(0x246)][_0x45da3c(0x1e2)])),console[_0x45da3c(0x227)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x1372d9[_0x45da3c(0x246)][_0x45da3c(0x1d4)])));if(_0x5a39c3){console[_0x45da3c(0x227)](),console[_0x45da3c(0x227)](a4_0x25a774[_0x45da3c(0x1f5)](_0x45da3c(0x1f0)));for(const _0x5666da of _0x1372d9['agents']){_0x5666da['action']===_0x45da3c(0x24f)&&console[_0x45da3c(0x227)](a4_0x25a774['red']('\x20\x20Agent\x20\x22'+_0x5666da[_0x45da3c(0x1e0)]+_0x45da3c(0x1ed)+_0x5666da[_0x45da3c(0x24f)]));}for(const _0x3b1054 of _0x1372d9['knowledgeBases']){_0x3b1054[_0x45da3c(0x213)]===_0x45da3c(0x24f)&&console[_0x45da3c(0x227)](a4_0x25a774[_0x45da3c(0x1f5)](_0x45da3c(0x1ad)+_0x3b1054[_0x45da3c(0x1c1)]+_0x45da3c(0x1ed)+_0x3b1054[_0x45da3c(0x24f)]));}for(const _0x492fa6 of _0x1372d9[_0x45da3c(0x20a)]){_0x492fa6[_0x45da3c(0x213)]===_0x45da3c(0x24f)&&console[_0x45da3c(0x227)](a4_0x25a774['red'](_0x45da3c(0x23b)+_0x492fa6[_0x45da3c(0x1c1)]+_0x45da3c(0x1ed)+_0x492fa6[_0x45da3c(0x24f)]));}for(const _0x4d7479 of _0x1372d9['integrations']){_0x4d7479[_0x45da3c(0x213)]===_0x45da3c(0x24f)&&console['log'](a4_0x25a774[_0x45da3c(0x1f5)]('\x20\x20Integration\x20\x22'+_0x4d7479['name']+'\x22:\x20'+_0x4d7479[_0x45da3c(0x24f)]));}for(const _0x11ab0d of _0x1372d9[_0x45da3c(0x1e2)]){_0x11ab0d[_0x45da3c(0x213)]===_0x45da3c(0x24f)&&console['log'](a4_0x25a774[_0x45da3c(0x1f5)](_0x45da3c(0x25d)+_0x11ab0d[_0x45da3c(0x1c1)]+_0x45da3c(0x1ed)+_0x11ab0d[_0x45da3c(0x24f)]));}for(const _0x3655a3 of _0x1372d9[_0x45da3c(0x1d4)]){_0x3655a3['action']===_0x45da3c(0x24f)&&console[_0x45da3c(0x227)](a4_0x25a774['red']('\x20\x20Experimental\x20Artifact\x20\x22'+_0x3655a3[_0x45da3c(0x1c1)]+_0x45da3c(0x1ed)+_0x3655a3[_0x45da3c(0x24f)]));}return 0x1;}console['log']();const _0x7a6ec9=getLLMProjectUrl(_0x1ab8fd,_0x1372d9[_0x45da3c(0x25e)]);return console[_0x45da3c(0x227)](_0x45da3c(0x1b2)+a4_0x25a774['cyan'](_0x7a6ec9)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0xbf99dc(0x1c1)]=a4_0xbf99dc(0x1d9);['description']='Push\x20local\x20agent\x20files\x20to\x20LLM\x20project';async[a4_0xbf99dc(0x1d5)](_0x4ed291){const _0x1f5c60=a4_0xbf99dc,{options:_0x2bb5da,args:_0x25953e,tdx:_0x2e5a7f}=_0x4ed291;let _0xaf816b=_0x25953e[0x0]||process[_0x1f5c60(0x1df)]();const _0x599029=_0x2bb5da[_0x1f5c60(0x1e4)],_0x3352c2=_0x2bb5da[_0x1f5c60(0x1e7)],_0x50860b=_0x2bb5da['yes'],_0x1030f3=_0x2bb5da[_0x1f5c60(0x1fd)],_0x244d85=a4_0x5479b5[_0x1f5c60(0x226)](_0xaf816b,_0x1f5c60(0x201)),_0x4a049e=existsSync(_0x244d85);if(_0x4a049e){const {data:_0x4ef049}=await withSpinner(_0x1f5c60(0x232)+_0xaf816b+_0x1f5c60(0x254),()=>_0x2e5a7f[_0x1f5c60(0x222)]['pushAgent'](_0xaf816b,{'dryRun':_0x599029,'force':_0x3352c2}));if(_0x599029)return console['log'](a4_0x25a774[_0x1f5c60(0x1f3)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x1f5c60(0x227)](_0x1f5c60(0x1d1)+_0x4ef049[_0x1f5c60(0x1e0)]),0x0;if(_0x4ef049[_0x1f5c60(0x213)]===_0x1f5c60(0x24f))return console[_0x1f5c60(0x227)](a4_0x25a774[_0x1f5c60(0x1f5)](_0x1f5c60(0x248)+_0x4ef049['error'])),0x1;console['log'](a4_0x25a774[_0x1f5c60(0x200)](_0x1f5c60(0x1da)+_0x4ef049[_0x1f5c60(0x213)]+_0x1f5c60(0x1b5))),console['log']('Agent:\x20'+_0x4ef049['agentName']);if(_0x4ef049[_0x1f5c60(0x262)]&&_0x4ef049['projectId']){const _0x897e41=getLLMAgentChatUrl(_0x1030f3,_0x4ef049[_0x1f5c60(0x1be)],_0x4ef049[_0x1f5c60(0x262)]);console['log'](_0x1f5c60(0x25b)+a4_0x25a774[_0x1f5c60(0x247)](_0x897e41));}return 0x0;}const _0x42a4cc=_0x2bb5da[_0x1f5c60(0x209)],_0x1d96f4=resolveProjectFromContext(_0xaf816b,_0x42a4cc);if(_0x1d96f4[_0x1f5c60(0x1db)])_0xaf816b=_0x1d96f4[_0x1f5c60(0x252)],_0x1d96f4[_0x1f5c60(0x245)]==='context'&&console[_0x1f5c60(0x227)](a4_0x25a774['dim'](_0x1f5c60(0x1c0)+_0xaf816b));else{let _0x3072ce=_0x1f5c60(0x1fa);_0x1d96f4['reason']===_0x1f5c60(0x241)&&(_0x3072ce=_0x1d96f4[_0x1f5c60(0x22d)]+_0x1f5c60(0x1f8)+_0x1d96f4[_0x1f5c60(0x209)]+_0x1f5c60(0x234));throw new SDKError(ErrorCode[_0x1f5c60(0x1fc)],_0x1d96f4['reason']===_0x1f5c60(0x250)?_0x1d96f4[_0x1f5c60(0x22d)]:_0x1f5c60(0x25c)+_0xaf816b,undefined,{'helpText':_0x3072ce});}const {data:_0x51b00e}=await withSpinner(_0x1f5c60(0x1ae),()=>_0x2e5a7f['llm']['pushProject'](_0xaf816b,{'dryRun':!![]})),_0x4c531d=_0x51b00e[_0x1f5c60(0x246)][_0x1f5c60(0x231)][_0x1f5c60(0x1bd)]>0x0;if(_0x4c531d){console[_0x1f5c60(0x227)](a4_0x25a774[_0x1f5c60(0x1f5)]('\x0aErrors\x20found:'));for(const _0x1626f8 of _0x51b00e[_0x1f5c60(0x231)]){_0x1626f8['action']==='error'&&console[_0x1f5c60(0x227)](a4_0x25a774[_0x1f5c60(0x1f5)]('\x20\x20Agent\x20\x22'+_0x1626f8[_0x1f5c60(0x1e0)]+_0x1f5c60(0x1ed)+_0x1626f8[_0x1f5c60(0x24f)]));}return 0x1;}const _0x2d37d4=_0x51b00e['counts'][_0x1f5c60(0x231)][_0x1f5c60(0x237)]+_0x51b00e[_0x1f5c60(0x246)]['knowledgeBases'][_0x1f5c60(0x237)]+_0x51b00e['counts'][_0x1f5c60(0x24d)][_0x1f5c60(0x237)]+_0x51b00e[_0x1f5c60(0x246)][_0x1f5c60(0x20a)]['created']+_0x51b00e[_0x1f5c60(0x246)][_0x1f5c60(0x218)][_0x1f5c60(0x237)]+_0x51b00e['counts']['experimentalKnowledgeBases'][_0x1f5c60(0x237)]+_0x51b00e[_0x1f5c60(0x246)]['experimentalArtifacts'][_0x1f5c60(0x237)],_0x172005=_0x51b00e[_0x1f5c60(0x246)]['agents']['updated']+_0x51b00e[_0x1f5c60(0x246)][_0x1f5c60(0x1e1)][_0x1f5c60(0x1b1)]+_0x51b00e[_0x1f5c60(0x246)][_0x1f5c60(0x24d)]['updated']+_0x51b00e[_0x1f5c60(0x246)]['prompts']['updated']+_0x51b00e['counts']['integrations']['updated']+_0x51b00e['counts'][_0x1f5c60(0x1e2)][_0x1f5c60(0x1b1)]+_0x51b00e[_0x1f5c60(0x246)][_0x1f5c60(0x1d4)]['updated'],_0x5ab0a6=_0x51b00e[_0x1f5c60(0x246)]['agents'][_0x1f5c60(0x1b7)]+_0x51b00e[_0x1f5c60(0x246)][_0x1f5c60(0x1e1)][_0x1f5c60(0x1b7)]+_0x51b00e['counts'][_0x1f5c60(0x24d)]['unchanged']+_0x51b00e['counts'][_0x1f5c60(0x20a)][_0x1f5c60(0x1b7)]+_0x51b00e[_0x1f5c60(0x246)][_0x1f5c60(0x218)][_0x1f5c60(0x1b7)]+_0x51b00e['counts']['experimentalKnowledgeBases'][_0x1f5c60(0x1b7)]+_0x51b00e[_0x1f5c60(0x246)][_0x1f5c60(0x1d4)][_0x1f5c60(0x1b7)];console[_0x1f5c60(0x227)](_0x1f5c60(0x20c)+_0x51b00e[_0x1f5c60(0x1d3)]+'\x27:'),console['log']('\x20\x20'+a4_0x25a774[_0x1f5c60(0x200)]('+\x20'+_0x2d37d4+_0x1f5c60(0x1e6))+_0x1f5c60(0x21a)+a4_0x25a774['yellow']('~\x20'+_0x172005+_0x1f5c60(0x1f9))+_0x1f5c60(0x21a)+a4_0x25a774[_0x1f5c60(0x1dd)]('=\x20'+_0x5ab0a6+_0x1f5c60(0x244))),console['log'](_0x1f5c60(0x219)+formatCountSummary(_0x51b00e[_0x1f5c60(0x246)][_0x1f5c60(0x231)])),console[_0x1f5c60(0x227)](_0x1f5c60(0x1d0)+formatCountSummary(_0x51b00e[_0x1f5c60(0x246)][_0x1f5c60(0x1e1)])),console[_0x1f5c60(0x227)](_0x1f5c60(0x1f4)+formatCountSummary(_0x51b00e[_0x1f5c60(0x246)][_0x1f5c60(0x24d)])),console[_0x1f5c60(0x227)](_0x1f5c60(0x20f)+formatCountSummary(_0x51b00e['counts'][_0x1f5c60(0x20a)])),console['log'](_0x1f5c60(0x1f1)+formatCountSummary(_0x51b00e[_0x1f5c60(0x246)]['integrations']));const _0x3dcda4=_0x51b00e['counts'][_0x1f5c60(0x1e2)][_0x1f5c60(0x237)]>0x0||_0x51b00e[_0x1f5c60(0x246)][_0x1f5c60(0x1e2)]['updated']>0x0||_0x51b00e[_0x1f5c60(0x246)][_0x1f5c60(0x1e2)]['unchanged']>0x0||_0x51b00e[_0x1f5c60(0x246)][_0x1f5c60(0x1d4)][_0x1f5c60(0x237)]>0x0||_0x51b00e[_0x1f5c60(0x246)]['experimentalArtifacts']['updated']>0x0||_0x51b00e[_0x1f5c60(0x246)]['experimentalArtifacts']['unchanged']>0x0;_0x3dcda4&&(console[_0x1f5c60(0x227)](_0x1f5c60(0x256)+formatCountSummary(_0x51b00e['counts'][_0x1f5c60(0x1e2)])),console[_0x1f5c60(0x227)](_0x1f5c60(0x260)+formatCountSummary(_0x51b00e['counts'][_0x1f5c60(0x1d4)])));console[_0x1f5c60(0x227)](_0x1f5c60(0x1e8)+a4_0x25a774[_0x1f5c60(0x247)](_0xaf816b)),displayDiffs(_0x51b00e[_0x1f5c60(0x231)],_0x51b00e[_0x1f5c60(0x1e1)],_0x51b00e[_0x1f5c60(0x24d)],_0x51b00e[_0x1f5c60(0x20a)],_0x51b00e[_0x1f5c60(0x218)],_0x51b00e['experimentalKnowledgeBases'],_0x51b00e[_0x1f5c60(0x1d4)]);if(_0x599029)return console[_0x1f5c60(0x227)](a4_0x25a774[_0x1f5c60(0x1f3)](_0x1f5c60(0x238))),0x0;if(_0x2d37d4===0x0&&_0x172005===0x0){console[_0x1f5c60(0x227)](a4_0x25a774['green']('\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date'));const _0x431d49=getLLMProjectUrl(_0x1030f3,_0x51b00e['projectId']);return console['log'](_0x1f5c60(0x1b2)+a4_0x25a774[_0x1f5c60(0x247)](_0x431d49)),0x0;}if(!_0x50860b&&!_0x3352c2){if(!isInteractive())return console[_0x1f5c60(0x24f)](a4_0x25a774['red'](_0x1f5c60(0x1ce)),_0x1f5c60(0x21d)),console['error'](a4_0x25a774[_0x1f5c60(0x1dd)](_0x1f5c60(0x1c7))),0x1;const _0x5d62b4=await confirmKey(_0x1f5c60(0x259)+(_0x2d37d4+_0x172005)+_0x1f5c60(0x1b6));if(!_0x5d62b4)return console['log'](a4_0x25a774[_0x1f5c60(0x1f3)](_0x1f5c60(0x261)),_0x1f5c60(0x23a)),0x1;}const {data:_0x4f4ef5}=await withSpinner(_0x1f5c60(0x221),()=>_0x2e5a7f[_0x1f5c60(0x222)][_0x1f5c60(0x233)](_0xaf816b,{'force':_0x3352c2})),_0x5938d0=_0x4f4ef5[_0x1f5c60(0x246)][_0x1f5c60(0x231)][_0x1f5c60(0x1bd)]>0x0||_0x4f4ef5[_0x1f5c60(0x246)]['knowledgeBases']['errors']>0x0||_0x4f4ef5[_0x1f5c60(0x246)]['textKnowledgeBases']['errors']>0x0||_0x4f4ef5[_0x1f5c60(0x246)][_0x1f5c60(0x20a)][_0x1f5c60(0x1bd)]>0x0;if(_0x5938d0){console['log'](a4_0x25a774[_0x1f5c60(0x1f3)](_0x1f5c60(0x223))),console[_0x1f5c60(0x227)](),console[_0x1f5c60(0x227)](a4_0x25a774[_0x1f5c60(0x1f5)](_0x1f5c60(0x1f0)));for(const _0x3ebbab of _0x4f4ef5[_0x1f5c60(0x231)]){_0x3ebbab['action']==='error'&&console['log'](a4_0x25a774['red'](_0x1f5c60(0x1c5)+_0x3ebbab[_0x1f5c60(0x1e0)]+_0x1f5c60(0x1ed)+_0x3ebbab['error']));}for(const _0x1ccc04 of _0x4f4ef5[_0x1f5c60(0x1e1)]){_0x1ccc04[_0x1f5c60(0x213)]===_0x1f5c60(0x24f)&&console['log'](a4_0x25a774[_0x1f5c60(0x1f5)]('\x20\x20Knowledge\x20Base\x20\x22'+_0x1ccc04[_0x1f5c60(0x1c1)]+'\x22:\x20'+_0x1ccc04[_0x1f5c60(0x24f)]));}for(const _0x58d490 of _0x4f4ef5['textKnowledgeBases']){_0x58d490[_0x1f5c60(0x213)]==='error'&&console[_0x1f5c60(0x227)](a4_0x25a774[_0x1f5c60(0x1f5)](_0x1f5c60(0x21c)+_0x58d490['name']+_0x1f5c60(0x1ed)+_0x58d490[_0x1f5c60(0x24f)]));}for(const _0xd69d72 of _0x4f4ef5[_0x1f5c60(0x20a)]){_0xd69d72[_0x1f5c60(0x213)]===_0x1f5c60(0x24f)&&console[_0x1f5c60(0x227)](a4_0x25a774['red'](_0x1f5c60(0x23b)+_0xd69d72[_0x1f5c60(0x1c1)]+_0x1f5c60(0x1ed)+_0xd69d72['error']));}for(const _0x752eeb of _0x4f4ef5[_0x1f5c60(0x218)]){_0x752eeb[_0x1f5c60(0x213)]===_0x1f5c60(0x24f)&&console[_0x1f5c60(0x227)](a4_0x25a774['red']('\x20\x20Integration\x20\x22'+_0x752eeb[_0x1f5c60(0x1c1)]+_0x1f5c60(0x1ed)+_0x752eeb[_0x1f5c60(0x24f)]));}return 0x1;}console[_0x1f5c60(0x227)](a4_0x25a774[_0x1f5c60(0x200)](_0x1f5c60(0x1f2)+(_0x2d37d4+_0x172005)+'\x20resources\x20to\x20\x27'+_0x4f4ef5[_0x1f5c60(0x1d3)]+'\x27'));const _0x8e66a7=getLLMProjectUrl(_0x1030f3,_0x4f4ef5[_0x1f5c60(0x1be)]);return console[_0x1f5c60(0x227)]('Project:\x20'+a4_0x25a774[_0x1f5c60(0x247)](_0x8e66a7)),0x0;}}
@@ -1 +1 @@
1
- function a5_0x9b25(_0x44fe9b,_0x41c0b3){_0x44fe9b=_0x44fe9b-0xb4;const _0x916d4b=a5_0x916d();let _0x9b258f=_0x916d4b[_0x44fe9b];return _0x9b258f;}const a5_0x136a22=a5_0x9b25;(function(_0x53f7a3,_0x186737){const _0x39d408=a5_0x9b25,_0x2eaf11=_0x53f7a3();while(!![]){try{const _0x1e53df=parseInt(_0x39d408(0xcf))/0x1*(-parseInt(_0x39d408(0x135))/0x2)+-parseInt(_0x39d408(0x10d))/0x3*(parseInt(_0x39d408(0x117))/0x4)+-parseInt(_0x39d408(0x138))/0x5*(parseInt(_0x39d408(0x13b))/0x6)+parseInt(_0x39d408(0x10b))/0x7+-parseInt(_0x39d408(0x13f))/0x8*(parseInt(_0x39d408(0x101))/0x9)+parseInt(_0x39d408(0x127))/0xa+parseInt(_0x39d408(0xde))/0xb;if(_0x1e53df===_0x186737)break;else _0x2eaf11['push'](_0x2eaf11['shift']());}catch(_0x586e32){_0x2eaf11['push'](_0x2eaf11['shift']());}}}(a5_0x916d,0xc969c));import*as a5_0x184740 from'node:fs';function a5_0x916d(){const _0x20071c=['Re-evaluating...','repeat','✓\x20PASS:\x20','Either\x20switch\x20to\x20the\x20\x22','json','projectDir','log','some','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','Test\x20','size','testYmlPath','/<agent-name>','27201240cNCTwq','\x20(new)','context','source','Re-evaluation\x20Summary','New\x20tests\x20to\x20execute:\x20','Usage:','agentName','length','execute','\x22:\x20','Total:\x20\x20\x20\x20','testName','tests','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','resolveProjectId','✗\x20FAIL:\x20','writeFileSync','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','tags','conversation_url','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','table','trim','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','\x20\x20Site:\x20','Available\x20tests:\x20','reason','\x22,\x20but\x20current\x20site\x20is\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','not\x20found','Evaluating\x20response...','rounds','\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)','Cached\x20run\x20from:\x20','143073cWxFja','No\x20tests\x20found\x20with\x20tags:\x20','\x20\x20Agent:\x20','isSpinning','push','Cached\x20run\x20is\x20from\x20site\x20\x22','utf-8','no_context','reeval','agentDirs','1547553uRZSYL','name','2258103IOzmTq','basename','Error\x20writing\x20output\x20file:\x20','text','projectName','llm','message','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','\x20\x20Project:\x20','4gqbxSY','dim','site','red','status','...','stop','has','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','Failed:\x20\x20\x20','FAIL','\x20\x20-\x20','start','now','timestamp','resolveAgentId','8870660IEPOPM','no_tests','agent:test','Executing\x20new\x20tests...','Test\x20Configuration:','no_local_folder',':\x20Sending\x20user\x20input...','\x20\x20Round\x20','filter','conversations','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','\x20\x20Evaluating...\x20','includes','cyan','2HyTnBF','resolve','map','5KoMXTD','404','multiple_agents','9528186oFSHtT','\x20-\x20','Output\x20written\x20to:\x20','Conversation\x20URL:\x20','192bRmLMY','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','agent','tsv','Running\x20test:\x20','ERROR','llmProject','green','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','jsonl','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','\x20\x20Conversation:\x20','found','yellow','...\x20','Run\x20\x27tdx\x20agent\x20pull\x20','split','Round\x201/','toISOString','✗\x20ERROR:\x20','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','toLowerCase','Running:\x20','Re-evaluating\x20','Passed:\x20\x20\x20','PASS','output','Re-evaluating\x20cached\x20test\x20run...','verbose','Running\x20agent\x20tests...','Round\x20','Failed\x20Tests:','⚠\x20SKIPPED:\x20','join','existsSync','Project\x20path:\x20','find','\x20(cached)','Site:\x20','Test\x20Summary','Errors:\x20\x20\x20','Error:\x20No\x20previous\x20test\x20run\x20found.','forEach','Run\x20tests\x20for\x20an\x20LLM\x20agent','Tests\x20found:\x20','executeReeval','white','round','33737YxQDuE','substring'];a5_0x916d=function(){return _0x20071c;};return a5_0x916d();}import*as a5_0x36abb9 from'node:path';import a5_0x4942b0 from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x136a22(0x10c)]=a5_0x136a22(0x129);['description']=a5_0x136a22(0xca);async[a5_0x136a22(0xe7)](_0xbf8871){const _0x4c08f7=a5_0x136a22,{options:_0x2d1174,args:_0x519464,tdx:_0x845b02}=_0xbf8871,_0x540736=_0x519464[0x0]||'.',_0x311d3a=_0x2d1174['dryRun'],_0x2a63ee=_0x2d1174,_0x4b1afe=_0x2a63ee['eval']===![],_0x291528=_0x2a63ee[_0x4c08f7(0x109)],_0x12efab=_0x2a63ee[_0x4c08f7(0x10c)],_0x4a1674=_0x2a63ee[_0x4c08f7(0xf1)],_0x40004f=_0x2d1174[_0x4c08f7(0x119)],_0x2d113b=_0x2a63ee[_0x4c08f7(0xb9)];if(_0x291528&&_0x4b1afe)return console[_0x4c08f7(0xd7)](a5_0x4942b0['red'](_0x4c08f7(0xd9))),0x1;let _0x33f8e2='table';if(_0x2a63ee['json'])_0x33f8e2=_0x4c08f7(0xd5);else{if(_0x2a63ee['jsonl'])_0x33f8e2=_0x4c08f7(0x148);else{if(_0x2a63ee[_0x4c08f7(0x142)])_0x33f8e2='tsv';else{if(_0x2a63ee[_0x4c08f7(0xf4)])_0x33f8e2=_0x4c08f7(0xf4);}}}const _0x106129=_0x2a63ee[_0x4c08f7(0x145)];let _0x42dc54=_0x540736;const _0x44200d=a5_0x184740[_0x4c08f7(0xc1)](_0x540736),_0x8fcc30=_0x540736==='.';if(!_0x44200d||_0x8fcc30){const _0x1677af=resolveProjectFromContext(_0x540736,_0x106129,{'requireFile':'test.yml'});if(_0x1677af[_0x4c08f7(0x14b)])_0x42dc54=_0x1677af[_0x4c08f7(0xd6)],_0x1677af[_0x4c08f7(0xe1)]===_0x4c08f7(0xe0)&&console[_0x4c08f7(0xd7)](a5_0x4942b0[_0x4c08f7(0x118)]('Using\x20agent:\x20'+_0x42dc54));else switch(_0x1677af[_0x4c08f7(0xf9)]){case _0x4c08f7(0x108):console[_0x4c08f7(0xd7)](a5_0x4942b0['yellow'](_0x1677af['message'])),console[_0x4c08f7(0xd7)](),console[_0x4c08f7(0xd7)](_0x4c08f7(0xe4)),console['log'](_0x4c08f7(0xfb)),console[_0x4c08f7(0xd7)](_0x4c08f7(0xff)),console[_0x4c08f7(0xd7)](),console[_0x4c08f7(0xd7)](_0x4c08f7(0x114));return 0x1;case _0x4c08f7(0x12c):console[_0x4c08f7(0xd7)](a5_0x4942b0[_0x4c08f7(0x14c)](_0x1677af[_0x4c08f7(0x113)])),console[_0x4c08f7(0xd7)](),console[_0x4c08f7(0xd7)](_0x4c08f7(0x14e)+_0x1677af['llmProject']+'\x27\x20to\x20create\x20the\x20folder\x20structure.');return 0x1;case _0x4c08f7(0x13a):{const _0x2a52df=a5_0x36abb9[_0x4c08f7(0x10e)](_0x1677af[_0x4c08f7(0xd6)]);console[_0x4c08f7(0xd7)](a5_0x4942b0[_0x4c08f7(0x14c)](_0x4c08f7(0xf6)+_0x1677af[_0x4c08f7(0x145)]+'\x22:'));for(const _0x59b1b2 of _0x1677af[_0x4c08f7(0x10a)]){console[_0x4c08f7(0xd7)](_0x4c08f7(0x122)+_0x59b1b2);}return console[_0x4c08f7(0xd7)](),console[_0x4c08f7(0xd7)](_0x4c08f7(0xec)+_0x2a52df+_0x4c08f7(0xdd)),0x1;}case _0x4c08f7(0x128):console[_0x4c08f7(0xd7)](a5_0x4942b0['yellow'](_0x4c08f7(0x147)+_0x1677af[_0x4c08f7(0x145)]+'\x22.')),console[_0x4c08f7(0xd7)](a5_0x4942b0[_0x4c08f7(0x118)](_0x4c08f7(0xc2)+_0x1677af[_0x4c08f7(0xd6)])),console[_0x4c08f7(0xd7)](),console[_0x4c08f7(0xd7)]('Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.');return 0x1;}}const {definition:_0x619ba0,agentInfo:_0xe86f3a}=parseTestFile(_0x42dc54);let _0x56f1d8=_0x619ba0[_0x4c08f7(0xeb)];if(_0x12efab){const _0x1fc436=_0x12efab[_0x4c08f7(0x14f)](',')[_0x4c08f7(0x137)](_0x4af2f8=>_0x4af2f8[_0x4c08f7(0xf5)]());_0x56f1d8=_0x619ba0['tests'][_0x4c08f7(0x12f)](_0x1f5798=>_0x1fc436[_0x4c08f7(0x133)](_0x1f5798[_0x4c08f7(0x10c)]));if(_0x56f1d8['length']===0x0)return console[_0x4c08f7(0xd7)](a5_0x4942b0[_0x4c08f7(0x14c)]('No\x20tests\x20found\x20matching:\x20'+_0x12efab)),console[_0x4c08f7(0xd7)](a5_0x4942b0[_0x4c08f7(0x118)](_0x4c08f7(0xf8)+_0x619ba0[_0x4c08f7(0xeb)][_0x4c08f7(0x137)](_0x2dba1b=>_0x2dba1b[_0x4c08f7(0x10c)])[_0x4c08f7(0xc0)](',\x20'))),0x1;}if(_0x4a1674){const _0x3a7e06=_0x4a1674[_0x4c08f7(0x14f)](',')[_0x4c08f7(0x137)](_0x181715=>_0x181715[_0x4c08f7(0xf5)]()[_0x4c08f7(0xb4)]());_0x56f1d8=_0x56f1d8['filter'](_0x24f786=>_0x24f786['tags']?.[_0x4c08f7(0xd8)](_0xa6ce0c=>_0x3a7e06[_0x4c08f7(0x133)](_0xa6ce0c[_0x4c08f7(0xb4)]())));if(_0x56f1d8['length']===0x0){console['log'](a5_0x4942b0[_0x4c08f7(0x14c)](_0x4c08f7(0x102)+_0x4a1674));const _0x5b61bb=new Set();return _0x619ba0[_0x4c08f7(0xeb)]['forEach'](_0x185c9f=>_0x185c9f[_0x4c08f7(0xf1)]?.[_0x4c08f7(0xc9)](_0xc04c6f=>_0x5b61bb['add'](_0xc04c6f))),_0x5b61bb[_0x4c08f7(0xdb)]>0x0?console[_0x4c08f7(0xd7)](a5_0x4942b0['dim']('Available\x20tags:\x20'+[..._0x5b61bb]['join'](',\x20'))):console[_0x4c08f7(0xd7)](a5_0x4942b0['dim']('No\x20tests\x20have\x20tags\x20defined.')),0x1;}}if(_0x291528)return this[_0x4c08f7(0xcc)](_0xbf8871,{'definition':{'tests':_0x56f1d8},'agentInfo':_0xe86f3a,'outputFormat':_0x33f8e2,'outputFile':_0x2d113b,'testNames':_0x12efab});if(_0x311d3a){console['log'](a5_0x4942b0[_0x4c08f7(0x134)](_0x4c08f7(0x12b))),console[_0x4c08f7(0xd7)](_0x4c08f7(0xf7)+a5_0x4942b0[_0x4c08f7(0xcd)](_0x40004f)),console['log'](_0x4c08f7(0x116)+a5_0x4942b0[_0x4c08f7(0xcd)](_0xe86f3a[_0x4c08f7(0x111)])),console['log'](_0x4c08f7(0x103)+a5_0x4942b0[_0x4c08f7(0xcd)](_0xe86f3a[_0x4c08f7(0xe5)])),console[_0x4c08f7(0xd7)](),console[_0x4c08f7(0xd7)](_0x4c08f7(0xcb)+a5_0x4942b0['white'](_0x56f1d8['length']));for(let _0x3931df=0x0;_0x3931df<_0x56f1d8[_0x4c08f7(0xe6)];_0x3931df++){const _0x22e2c9=_0x56f1d8[_0x3931df],_0x5df6b3=_0x22e2c9[_0x4c08f7(0xfe)][_0x4c08f7(0xe6)]===0x1?_0x4c08f7(0xce):'rounds',_0x3871a7=_0x22e2c9[_0x4c08f7(0xf1)]?.[_0x4c08f7(0xe6)]?'\x20['+_0x22e2c9['tags'][_0x4c08f7(0xc0)](',\x20')+']':'';console[_0x4c08f7(0xd7)]('\x20\x20'+(_0x3931df+0x1)+'.\x20'+a5_0x4942b0[_0x4c08f7(0xcd)](_0x22e2c9[_0x4c08f7(0x10c)])+'\x20('+_0x22e2c9['rounds'][_0x4c08f7(0xe6)]+'\x20'+_0x5df6b3+')'+a5_0x4942b0['dim'](_0x3871a7));}return 0x0;}let _0xde2d0e,_0x364e4b;try{_0xde2d0e=await _0x845b02[_0x4c08f7(0x112)][_0x4c08f7(0xed)](_0xe86f3a[_0x4c08f7(0x111)]);}catch(_0x8659fc){const _0x3b3d9f=_0x8659fc instanceof Error?_0x8659fc[_0x4c08f7(0x113)]:String(_0x8659fc);return _0x3b3d9f['includes'](_0x4c08f7(0x139))||_0x3b3d9f[_0x4c08f7(0xb4)]()['includes'](_0x4c08f7(0xfc))?console[_0x4c08f7(0xd7)](a5_0x4942b0[_0x4c08f7(0x11a)]('✗\x20ERROR:\x20Project\x20not\x20found:\x20'+_0xe86f3a[_0x4c08f7(0x111)])):console[_0x4c08f7(0xd7)](a5_0x4942b0[_0x4c08f7(0x11a)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22'+_0xe86f3a[_0x4c08f7(0x111)]+_0x4c08f7(0xe8)+_0x3b3d9f)),0x1;}try{_0x364e4b=await _0x845b02[_0x4c08f7(0x112)][_0x4c08f7(0x126)](_0xe86f3a[_0x4c08f7(0xe5)],_0xde2d0e);}catch(_0x55ba94){const _0x4482fc=_0x55ba94 instanceof Error?_0x55ba94[_0x4c08f7(0x113)]:String(_0x55ba94);return _0x4482fc['includes']('404')||_0x4482fc[_0x4c08f7(0xb4)]()[_0x4c08f7(0x133)](_0x4c08f7(0xfc))?console[_0x4c08f7(0xd7)](a5_0x4942b0[_0x4c08f7(0x11a)]('✗\x20ERROR:\x20Agent\x20not\x20found:\x20'+_0xe86f3a['agentName'])):console[_0x4c08f7(0xd7)](a5_0x4942b0['red'](_0x4c08f7(0x149)+_0xe86f3a[_0x4c08f7(0xe5)]+_0x4c08f7(0xe8)+_0x4482fc)),0x1;}let _0x574d93;if(!_0x4b1afe)try{_0x574d93=await setupEvaluatorAgent(_0x845b02['llm'],_0x2d1174[_0x4c08f7(0xbb)]);}catch(_0x34a47c){const _0x5b5527=_0x34a47c instanceof Error?_0x34a47c[_0x4c08f7(0x113)]:String(_0x34a47c);return console[_0x4c08f7(0xd7)](a5_0x4942b0[_0x4c08f7(0x11a)](_0x4c08f7(0x153)+_0x5b5527)),0x1;}console[_0x4c08f7(0xd7)](a5_0x4942b0[_0x4c08f7(0x134)](_0x4c08f7(0xbc))),console['log'](_0x4c08f7(0xc5)+a5_0x4942b0[_0x4c08f7(0xcd)](_0x40004f)),console['log']('Agent:\x20'+a5_0x4942b0['white'](_0xe86f3a[_0x4c08f7(0x111)]+'/'+_0xe86f3a['agentName'])),console[_0x4c08f7(0xd7)]();const _0x1f0f59=[],_0x36fbd0=[],_0x385e32=Date['now']();for(let _0x4327c5=0x0;_0x4327c5<_0x56f1d8[_0x4c08f7(0xe6)];_0x4327c5++){const _0x23eaca=_0x56f1d8[_0x4327c5];_0x56f1d8[_0x4c08f7(0xe6)]>0x1?console[_0x4c08f7(0xd7)](_0x4c08f7(0xda)+(_0x4327c5+0x1)+'/'+_0x56f1d8[_0x4c08f7(0xe6)]+':\x20'+a5_0x4942b0[_0x4c08f7(0xcd)](_0x23eaca[_0x4c08f7(0x10c)])):console[_0x4c08f7(0xd7)](_0x4c08f7(0x143)+a5_0x4942b0[_0x4c08f7(0xcd)](_0x23eaca[_0x4c08f7(0x10c)]));const _0x482118=createCommandSpinner(_0x4c08f7(0x150)+_0x23eaca[_0x4c08f7(0xfe)][_0x4c08f7(0xe6)]+_0x4c08f7(0x12d));_0x482118[_0x4c08f7(0x123)]();try{const {result:_0x4afb3a,conversation:_0xa13b16}=await runTest(_0x845b02[_0x4c08f7(0x112)],_0x23eaca,{'agentId':_0x364e4b,'projectId':_0xde2d0e,'site':_0x40004f,'noEval':_0x4b1afe,'evaluatorId':_0x574d93,'onRoundStart':(_0x1c2a6f,_0x4b3744)=>{const _0x3e5916=_0x4c08f7;_0x482118[_0x3e5916(0x110)]=_0x3e5916(0xbd)+(_0x1c2a6f+0x1)+'/'+_0x4b3744+_0x3e5916(0x12d);},'onRoundComplete':(_0x5100c2,_0x59059d,_0x1e2a7d)=>{const _0x4a0bda=_0x4c08f7,_0x2b8fe4=formatElapsed(_0x59059d);_0x1e2a7d?console[_0x4a0bda(0xd7)](_0x4a0bda(0x12e)+(_0x5100c2+0x1)+'/'+_0x23eaca[_0x4a0bda(0xfe)]['length']+_0x4a0bda(0x14d)+a5_0x4942b0[_0x4a0bda(0x146)]('✓')+'\x20('+_0x2b8fe4+')'):console['log'](_0x4a0bda(0x12e)+(_0x5100c2+0x1)+'/'+_0x23eaca[_0x4a0bda(0xfe)]['length']+_0x4a0bda(0x14d)+a5_0x4942b0['red']('✗'));},'onEvaluationStart':()=>{const _0x10e1ee=_0x4c08f7;_0x482118[_0x10e1ee(0x110)]=_0x10e1ee(0xfd);},'onEvaluationComplete':_0x432859=>{const _0x283d6c=_0x4c08f7,_0x1c7ba4=formatElapsed(_0x432859);console[_0x283d6c(0xd7)](_0x283d6c(0x132)+a5_0x4942b0[_0x283d6c(0x146)]('✓')+'\x20('+_0x1c7ba4+')');}});_0x482118[_0x4c08f7(0x11d)](),_0x1f0f59['push'](_0x4afb3a),_0x36fbd0['push'](_0xa13b16);if(_0x4afb3a[_0x4c08f7(0x11b)]==='PASS')console[_0x4c08f7(0xd7)](a5_0x4942b0['green']('✓\x20PASS:\x20'+_0x4afb3a['reason']));else _0x4afb3a[_0x4c08f7(0x11b)]==='FAIL'?console[_0x4c08f7(0xd7)](a5_0x4942b0[_0x4c08f7(0x11a)](_0x4c08f7(0xee)+_0x4afb3a[_0x4c08f7(0xf9)])):console['log'](a5_0x4942b0[_0x4c08f7(0x11a)](_0x4c08f7(0x152)+_0x4afb3a['reason']));_0x4afb3a[_0x4c08f7(0xf2)]&&console[_0x4c08f7(0xd7)](a5_0x4942b0[_0x4c08f7(0x118)](_0x4c08f7(0x13e)+_0x4afb3a[_0x4c08f7(0xf2)])),console[_0x4c08f7(0xd7)]();}catch(_0x4c7e70){_0x482118[_0x4c08f7(0x11d)]();const _0x1b4bd3=_0x4c7e70 instanceof Error?_0x4c7e70[_0x4c08f7(0x113)]:String(_0x4c7e70);console[_0x4c08f7(0xd7)](a5_0x4942b0[_0x4c08f7(0x11a)]('✗\x20ERROR:\x20'+_0x1b4bd3)),console[_0x4c08f7(0xd7)](),_0x1f0f59[_0x4c08f7(0x105)]({'name':_0x23eaca['name'],'status':_0x4c08f7(0x144),'reason':_0x1b4bd3,'timestamp':new Date()[_0x4c08f7(0x151)](),'duration_ms':0x0});}}const _0x702a3b=Date[_0x4c08f7(0x124)]()-_0x385e32,_0x54f01f=_0x1f0f59[_0x4c08f7(0x12f)](_0xb15b7a=>_0xb15b7a[_0x4c08f7(0x11b)]===_0x4c08f7(0xb8))[_0x4c08f7(0xe6)],_0x568bcb=_0x1f0f59[_0x4c08f7(0x12f)](_0x44d369=>_0x44d369[_0x4c08f7(0x11b)]===_0x4c08f7(0x121))[_0x4c08f7(0xe6)],_0x55b704=_0x1f0f59[_0x4c08f7(0x12f)](_0x57be84=>_0x57be84[_0x4c08f7(0x11b)]==='ERROR')[_0x4c08f7(0xe6)];console[_0x4c08f7(0xd7)]('━'[_0x4c08f7(0xd2)](0x3c)),console[_0x4c08f7(0xd7)](_0x4c08f7(0xc6)),console[_0x4c08f7(0xd7)]('━'[_0x4c08f7(0xd2)](0x3c)),console['log']('Total:\x20\x20\x20\x20'+_0x1f0f59[_0x4c08f7(0xe6)]),console[_0x4c08f7(0xd7)](_0x4c08f7(0xb7)+a5_0x4942b0['green'](_0x54f01f)),console[_0x4c08f7(0xd7)](_0x4c08f7(0x120)+a5_0x4942b0[_0x4c08f7(0x11a)](_0x568bcb));_0x55b704>0x0&&console['log'](_0x4c08f7(0xc7)+a5_0x4942b0[_0x4c08f7(0x11a)](_0x55b704));console[_0x4c08f7(0xd7)]('Duration:\x20'+formatElapsed(_0x702a3b)),console['log']('━'[_0x4c08f7(0xd2)](0x3c));const _0x227171=_0x1f0f59[_0x4c08f7(0x12f)](_0x2d2a01=>_0x2d2a01['status']!==_0x4c08f7(0xb8));if(_0x227171[_0x4c08f7(0xe6)]>0x0){console[_0x4c08f7(0xd7)](),console[_0x4c08f7(0xd7)](_0x4c08f7(0xbe));for(const _0x29541d of _0x227171){const _0x1fcb90=a5_0x4942b0[_0x4c08f7(0x11a)]('✗'),_0x2e900e=_0x29541d[_0x4c08f7(0xf9)][_0x4c08f7(0xe6)]>0x32?_0x29541d[_0x4c08f7(0xf9)][_0x4c08f7(0xd0)](0x0,0x32)+_0x4c08f7(0x11c):_0x29541d[_0x4c08f7(0xf9)];console[_0x4c08f7(0xd7)]('\x20\x20'+_0x1fcb90+'\x20'+_0x29541d['name']+':\x20'+_0x2e900e);}}const _0x1747c5={'summary':{'total':_0x1f0f59[_0x4c08f7(0xe6)],'passed':_0x54f01f,'failed':_0x568bcb,'errors':_0x55b704>0x0?_0x55b704:undefined,'duration_ms':_0x702a3b},'tests':_0x1f0f59,'agent':{'project':_0xe86f3a[_0x4c08f7(0x111)],'name':_0xe86f3a[_0x4c08f7(0xe5)],'site':_0x40004f},'timestamp':new Date(_0x385e32)[_0x4c08f7(0x151)]()};try{const _0x37a408=buildCachedTestRun(_0x36fbd0,{'site':_0x40004f,'projectId':_0xde2d0e,'projectName':_0xe86f3a[_0x4c08f7(0x111)],'agentId':_0x364e4b,'agentName':_0xe86f3a[_0x4c08f7(0xe5)],'testYmlPath':a5_0x36abb9[_0x4c08f7(0x136)](_0xe86f3a[_0x4c08f7(0xdc)])});saveLastTestRun(_0x37a408);}catch{}if(_0x33f8e2!==_0x4c08f7(0xf4)||_0x2d113b){const _0x25614c=formatResults(_0x1747c5,_0x33f8e2);if(_0x2d113b)try{a5_0x184740['writeFileSync'](_0x2d113b,_0x25614c,'utf-8'),console['log'](),console[_0x4c08f7(0xd7)](a5_0x4942b0['dim'](_0x4c08f7(0x13d)+_0x2d113b));}catch(_0x4d24b7){return console[_0x4c08f7(0xd7)](),console[_0x4c08f7(0xd7)](a5_0x4942b0['red'](_0x4c08f7(0x10f)+_0x4d24b7)),0x1;}else console[_0x4c08f7(0xd7)](),console[_0x4c08f7(0xd7)](_0x25614c);}return _0x227171[_0x4c08f7(0xe6)]>0x0?0x1:0x0;}async['executeReeval'](_0x472f98,_0x326b61){const _0x78975b=a5_0x136a22,{options:_0x170f7f,tdx:_0x8fc036}=_0x472f98,{definition:_0x535ca5,agentInfo:_0x283964,outputFormat:_0x6dc066,outputFile:_0x252595}=_0x326b61,_0x2d65ab=_0x170f7f[_0x78975b(0x119)],_0x24d1f2=loadLastTestRun();if(!_0x24d1f2)return console[_0x78975b(0xd7)](a5_0x4942b0[_0x78975b(0x11a)](_0x78975b(0xc8))),console[_0x78975b(0xd7)](a5_0x4942b0[_0x78975b(0x118)](_0x78975b(0xf0))),0x1;if(_0x24d1f2[_0x78975b(0x141)]['agentName']!==_0x283964[_0x78975b(0xe5)])return console[_0x78975b(0xd7)](a5_0x4942b0[_0x78975b(0x11a)](_0x78975b(0xf3)+_0x24d1f2[_0x78975b(0x141)][_0x78975b(0xe5)]+'\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22'+_0x283964['agentName']+'\x22.')),console[_0x78975b(0xd7)](a5_0x4942b0[_0x78975b(0x118)](_0x78975b(0x140))),0x1;const _0x21b6d0=new Set(_0x24d1f2[_0x78975b(0x130)][_0x78975b(0x137)](_0x36469e=>_0x36469e[_0x78975b(0xea)])),_0x54e1cf=_0x535ca5[_0x78975b(0xeb)][_0x78975b(0x12f)](_0x106f06=>!_0x21b6d0[_0x78975b(0x11e)](_0x106f06[_0x78975b(0x10c)]));if(_0x54e1cf[_0x78975b(0xe6)]>0x0&&_0x24d1f2[_0x78975b(0x119)]!==_0x2d65ab)return console[_0x78975b(0xd7)](a5_0x4942b0['red'](_0x78975b(0x131))),console[_0x78975b(0xd7)](a5_0x4942b0[_0x78975b(0x118)](_0x78975b(0x106)+_0x24d1f2['site']+_0x78975b(0xfa)+_0x2d65ab+'\x22.')),console[_0x78975b(0xd7)](a5_0x4942b0[_0x78975b(0x118)](_0x78975b(0xd4)+_0x24d1f2[_0x78975b(0x119)]+_0x78975b(0x115))),0x1;const _0x5bf7eb=_0x535ca5[_0x78975b(0xeb)][_0x78975b(0x12f)](_0x359f12=>_0x21b6d0[_0x78975b(0x11e)](_0x359f12[_0x78975b(0x10c)])),_0x69ef1c=_0x54e1cf;let _0x3e2518;try{_0x3e2518=await setupEvaluatorAgent(_0x8fc036[_0x78975b(0x112)],_0x170f7f[_0x78975b(0xbb)]);}catch(_0xc678c7){const _0x23378a=_0xc678c7 instanceof Error?_0xc678c7['message']:String(_0xc678c7);return console['log'](a5_0x4942b0[_0x78975b(0x11a)](_0x78975b(0x153)+_0x23378a)),0x1;}console[_0x78975b(0xd7)](a5_0x4942b0[_0x78975b(0x134)](_0x78975b(0xba))),console[_0x78975b(0xd7)](_0x78975b(0x100)+a5_0x4942b0[_0x78975b(0xcd)](_0x24d1f2[_0x78975b(0x125)])),console[_0x78975b(0xd7)]('Agent:\x20'+a5_0x4942b0[_0x78975b(0xcd)](_0x24d1f2['agent'][_0x78975b(0x111)]+'/'+_0x24d1f2[_0x78975b(0x141)][_0x78975b(0xe5)]));_0x69ef1c[_0x78975b(0xe6)]>0x0&&console[_0x78975b(0xd7)](_0x78975b(0xe3)+a5_0x4942b0[_0x78975b(0x14c)](_0x69ef1c[_0x78975b(0xe6)]));console['log']();const _0x253599=[],_0x582f64=Date[_0x78975b(0x124)](),_0xedb7fd=createCommandSpinner(_0x78975b(0xd1));if(_0x5bf7eb[_0x78975b(0xe6)]>0x0)try{const _0x410c80=await reevaluateFromCache(_0x8fc036[_0x78975b(0x112)],_0x24d1f2,{'tests':_0x5bf7eb},{'evaluatorId':_0x3e2518,'onTestStart':(_0xa24e86,_0x30e55d,_0x56d39a)=>{const _0x495fdc=_0x78975b;_0xedb7fd[_0x495fdc(0x110)]=_0x495fdc(0xb6)+(_0x30e55d+0x1)+'/'+_0x56d39a+':\x20'+_0xa24e86+_0x495fdc(0x11c);if(!_0xedb7fd[_0x495fdc(0x104)])_0xedb7fd[_0x495fdc(0x123)]();},'onTestComplete':(_0x5d62c8,_0xa6d762)=>{const _0x4cdd70=_0x78975b;_0xedb7fd[_0x4cdd70(0x11d)]();if(_0xa6d762[_0x4cdd70(0x11b)]==='PASS')console[_0x4cdd70(0xd7)](a5_0x4942b0[_0x4cdd70(0x146)](_0x4cdd70(0xd3)+_0x5d62c8)+a5_0x4942b0[_0x4cdd70(0x118)](_0x4cdd70(0xc4)));else _0xa6d762['status']==='FAIL'?console[_0x4cdd70(0xd7)](a5_0x4942b0[_0x4cdd70(0x11a)]('✗\x20FAIL:\x20'+_0x5d62c8+_0x4cdd70(0x13c)+_0xa6d762[_0x4cdd70(0xf9)])+a5_0x4942b0['dim'](_0x4cdd70(0xc4))):console[_0x4cdd70(0xd7)](a5_0x4942b0[_0x4cdd70(0x11a)](_0x4cdd70(0x152)+_0x5d62c8+_0x4cdd70(0x13c)+_0xa6d762[_0x4cdd70(0xf9)]));_0xa6d762[_0x4cdd70(0xf2)]&&console[_0x4cdd70(0xd7)](a5_0x4942b0[_0x4cdd70(0x118)](_0x4cdd70(0x14a)+_0xa6d762[_0x4cdd70(0xf2)])),_0x253599[_0x4cdd70(0x105)](_0xa6d762);},'onTestSkipped':(_0x22aabb,_0x39ad03)=>{const _0x171cba=_0x78975b;_0xedb7fd[_0x171cba(0x11d)](),console[_0x171cba(0xd7)](a5_0x4942b0[_0x171cba(0x14c)](_0x171cba(0xbf)+_0x22aabb+_0x171cba(0x13c)+_0x39ad03));}});for(const _0x247e3d of _0x410c80){!_0x253599[_0x78975b(0xc3)](_0x53834c=>_0x53834c['name']===_0x247e3d[_0x78975b(0x10c)])&&_0x253599['push'](_0x247e3d);}}catch(_0x47de77){_0xedb7fd[_0x78975b(0x11d)]();const _0x31c541=_0x47de77 instanceof Error?_0x47de77[_0x78975b(0x113)]:String(_0x47de77);return console[_0x78975b(0xd7)](a5_0x4942b0[_0x78975b(0x11a)](_0x78975b(0x11f)+_0x31c541)),0x1;}_0xedb7fd[_0x78975b(0x11d)]();if(_0x69ef1c[_0x78975b(0xe6)]>0x0){console[_0x78975b(0xd7)](),console[_0x78975b(0xd7)](a5_0x4942b0[_0x78975b(0x134)](_0x78975b(0x12a)));const {projectId:_0x576f5c,agentId:_0x4138c1}=_0x24d1f2['agent'];for(const _0x1a82ae of _0x69ef1c){console[_0x78975b(0xd7)](_0x78975b(0xb5)+a5_0x4942b0['white'](_0x1a82ae[_0x78975b(0x10c)]));const _0x43f407=createCommandSpinner(_0x78975b(0x150)+_0x1a82ae['rounds'][_0x78975b(0xe6)]+':\x20Sending\x20user\x20input...');_0x43f407['start']();try{const {result:_0x492ae8}=await runTest(_0x8fc036['llm'],_0x1a82ae,{'agentId':_0x4138c1,'projectId':_0x576f5c,'site':_0x24d1f2[_0x78975b(0x119)],'noEval':![],'evaluatorId':_0x3e2518,'onRoundStart':(_0x1f2c30,_0x1a7c84)=>{const _0x302723=_0x78975b;_0x43f407[_0x302723(0x110)]=_0x302723(0xbd)+(_0x1f2c30+0x1)+'/'+_0x1a7c84+_0x302723(0x12d);},'onRoundComplete':(_0x242629,_0x4b2d36,_0x108a5c)=>{const _0x51d856=_0x78975b,_0xd56dcb=formatElapsed(_0x4b2d36);_0x108a5c?console['log'](_0x51d856(0x12e)+(_0x242629+0x1)+'/'+_0x1a82ae[_0x51d856(0xfe)][_0x51d856(0xe6)]+_0x51d856(0x14d)+a5_0x4942b0[_0x51d856(0x146)]('✓')+'\x20('+_0xd56dcb+')'):console[_0x51d856(0xd7)](_0x51d856(0x12e)+(_0x242629+0x1)+'/'+_0x1a82ae[_0x51d856(0xfe)][_0x51d856(0xe6)]+'...\x20'+a5_0x4942b0[_0x51d856(0x11a)]('✗'));},'onEvaluationStart':()=>{const _0x5402d3=_0x78975b;_0x43f407[_0x5402d3(0x110)]=_0x5402d3(0xfd);},'onEvaluationComplete':_0x2850e2=>{const _0x3789e7=_0x78975b,_0xdf5783=formatElapsed(_0x2850e2);console[_0x3789e7(0xd7)](_0x3789e7(0x132)+a5_0x4942b0['green']('✓')+'\x20('+_0xdf5783+')');}});_0x43f407['stop'](),_0x253599[_0x78975b(0x105)](_0x492ae8);if(_0x492ae8[_0x78975b(0x11b)]==='PASS')console[_0x78975b(0xd7)](a5_0x4942b0[_0x78975b(0x146)](_0x78975b(0xd3)+_0x492ae8['reason'])+a5_0x4942b0[_0x78975b(0x118)](_0x78975b(0xdf)));else _0x492ae8['status']===_0x78975b(0x121)?console['log'](a5_0x4942b0['red'](_0x78975b(0xee)+_0x492ae8[_0x78975b(0xf9)])+a5_0x4942b0[_0x78975b(0x118)]('\x20(new)')):console[_0x78975b(0xd7)](a5_0x4942b0['red']('✗\x20ERROR:\x20'+_0x492ae8[_0x78975b(0xf9)]));_0x492ae8[_0x78975b(0xf2)]&&console[_0x78975b(0xd7)](a5_0x4942b0[_0x78975b(0x118)](_0x78975b(0x14a)+_0x492ae8[_0x78975b(0xf2)]));}catch(_0x1c1bde){_0x43f407[_0x78975b(0x11d)]();const _0x15f9c3=_0x1c1bde instanceof Error?_0x1c1bde[_0x78975b(0x113)]:String(_0x1c1bde);console[_0x78975b(0xd7)](a5_0x4942b0[_0x78975b(0x11a)](_0x78975b(0x152)+_0x15f9c3)),_0x253599[_0x78975b(0x105)]({'name':_0x1a82ae[_0x78975b(0x10c)],'status':_0x78975b(0x144),'reason':_0x15f9c3,'timestamp':new Date()[_0x78975b(0x151)](),'duration_ms':0x0});}}}console[_0x78975b(0xd7)]();const _0x1ab1b7=Date[_0x78975b(0x124)]()-_0x582f64,_0x4d73a4=_0x253599[_0x78975b(0x12f)](_0x1efff8=>_0x1efff8['status']===_0x78975b(0xb8))[_0x78975b(0xe6)],_0x3f3529=_0x253599[_0x78975b(0x12f)](_0x4df0f4=>_0x4df0f4[_0x78975b(0x11b)]==='FAIL')[_0x78975b(0xe6)],_0x10c4c2=_0x253599[_0x78975b(0x12f)](_0x576d81=>_0x576d81[_0x78975b(0x11b)]===_0x78975b(0x144))['length'];console[_0x78975b(0xd7)]('━'[_0x78975b(0xd2)](0x3c)),console[_0x78975b(0xd7)](_0x78975b(0xe2)),console['log']('━'['repeat'](0x3c)),console[_0x78975b(0xd7)](_0x78975b(0xe9)+_0x253599[_0x78975b(0xe6)]),console[_0x78975b(0xd7)](_0x78975b(0xb7)+a5_0x4942b0[_0x78975b(0x146)](_0x4d73a4)),console[_0x78975b(0xd7)]('Failed:\x20\x20\x20'+a5_0x4942b0[_0x78975b(0x11a)](_0x3f3529));_0x10c4c2>0x0&&console[_0x78975b(0xd7)](_0x78975b(0xc7)+a5_0x4942b0[_0x78975b(0x11a)](_0x10c4c2));console[_0x78975b(0xd7)]('Duration:\x20'+formatElapsed(_0x1ab1b7)),console[_0x78975b(0xd7)]('━'[_0x78975b(0xd2)](0x3c));const _0x13ab37={'summary':{'total':_0x253599[_0x78975b(0xe6)],'passed':_0x4d73a4,'failed':_0x3f3529,'errors':_0x10c4c2>0x0?_0x10c4c2:undefined,'duration_ms':_0x1ab1b7},'tests':_0x253599,'agent':{'project':_0x283964[_0x78975b(0x111)],'name':_0x283964[_0x78975b(0xe5)],'site':_0x2d65ab},'timestamp':new Date(_0x582f64)[_0x78975b(0x151)]()};if(_0x6dc066!==_0x78975b(0xf4)||_0x252595){const _0x3bf07c=formatResults(_0x13ab37,_0x6dc066);if(_0x252595)try{a5_0x184740[_0x78975b(0xef)](_0x252595,_0x3bf07c,_0x78975b(0x107)),console[_0x78975b(0xd7)](),console[_0x78975b(0xd7)](a5_0x4942b0[_0x78975b(0x118)](_0x78975b(0x13d)+_0x252595));}catch(_0x32db1c){return console[_0x78975b(0xd7)](),console[_0x78975b(0xd7)](a5_0x4942b0['red'](_0x78975b(0x10f)+_0x32db1c)),0x1;}else console[_0x78975b(0xd7)](),console[_0x78975b(0xd7)](_0x3bf07c);}const _0x23c94b=_0x253599[_0x78975b(0x12f)](_0x32440a=>_0x32440a[_0x78975b(0x11b)]!==_0x78975b(0xb8));return _0x23c94b['length']>0x0?0x1:0x0;}}
1
+ const a5_0x2b7648=a5_0x53bf;function a5_0x2f49(){const _0x437bce=['Error\x20writing\x20output\x20file:\x20','Re-evaluating\x20cached\x20test\x20run...','filter','no_tests','now','repeat','Run\x20\x27tdx\x20agent\x20pull\x20','⚠\x20SKIPPED:\x20','Re-evaluating\x20','round','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','...\x20','\x20\x20-\x20','length','llmProject','resolveProjectId','stop','trim','map','New\x20tests\x20to\x20execute:\x20','basename','Output\x20written\x20to:\x20','175rjTSwd','log','toLowerCase','No\x20tests\x20found\x20matching:\x20','404','Re-evaluating...','9902cGpyyn','message','tests','tags','execute','Errors:\x20\x20\x20','\x20\x20Project:\x20','find','\x20(new)','Re-evaluation\x20Summary','white','Round\x201/','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','verbose','Project\x20path:\x20','Available\x20tags:\x20','Usage:','dim','99ZGQQFk','...','red','Evaluating\x20response...','green','5181300AwIPgk','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','Running:\x20','Running\x20test:\x20','text','✗\x20FAIL:\x20','site','Agent:\x20','Cached\x20run\x20from:\x20','10DCiHkk','Total:\x20\x20\x20\x20','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','context','size','description','reason','dryRun','json','includes','✗\x20ERROR:\x20','128vqpSEF','source','\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','\x20\x20Conversation:\x20','Test\x20','\x20-\x20','\x20(cached)','tsv','start','Failed:\x20\x20\x20','yellow','3129304yOMdaO','toISOString','multiple_agents','285691AvzKlj','Using\x20agent:\x20','FAIL','agent','eval','2491836QCnolf','projectName','Site:\x20','ERROR','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','status','3gkeXgI','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','llm','\x22:\x20','PASS','rounds','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','conversation_url','\x20\x20Round\x20','reeval','cyan','Round\x20','\x20\x20Evaluating...\x20','Run\x20tests\x20for\x20an\x20LLM\x20agent','3232175TxiQPV','✓\x20PASS:\x20','forEach','testName','writeFileSync','\x22,\x20but\x20current\x20site\x20is\x20\x22','substring','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','existsSync','utf-8','name','found','jsonl','/<agent-name>','Running\x20agent\x20tests...','Duration:\x20','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.',':\x20Sending\x20user\x20input...','agentName','timestamp','projectDir','table','resolveAgentId','executeReeval','resolve','4595418uGzugN','agentDirs','conversations','\x27\x20to\x20create\x20the\x20folder\x20structure.','not\x20found','some','Either\x20switch\x20to\x20the\x20\x22','join','has','no_local_folder','Failed\x20Tests:','push','split','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22'];a5_0x2f49=function(){return _0x437bce;};return a5_0x2f49();}(function(_0x3e6af6,_0x1c46ee){const _0x30a7f1=a5_0x53bf,_0x3a81bb=_0x3e6af6();while(!![]){try{const _0x12484f=-parseInt(_0x30a7f1(0xe1))/0x1*(parseInt(_0x30a7f1(0xe7))/0x2)+parseInt(_0x30a7f1(0x12c))/0x3*(parseInt(_0x30a7f1(0x11e))/0x4)+-parseInt(_0x30a7f1(0x13a))/0x5+-parseInt(_0x30a7f1(0xbd))/0x6+-parseInt(_0x30a7f1(0x121))/0x7*(-parseInt(_0x30a7f1(0x113))/0x8)+parseInt(_0x30a7f1(0xfe))/0x9*(-parseInt(_0x30a7f1(0x108))/0xa)+parseInt(_0x30a7f1(0xf9))/0xb*(parseInt(_0x30a7f1(0x126))/0xc);if(_0x12484f===_0x1c46ee)break;else _0x3a81bb['push'](_0x3a81bb['shift']());}catch(_0x542991){_0x3a81bb['push'](_0x3a81bb['shift']());}}}(a5_0x2f49,0x6dcd4));import*as a5_0x30c0d7 from'node:fs';import*as a5_0x1c74d5 from'node:path';import a5_0xe4a0c2 from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';function a5_0x53bf(_0x4891ca,_0x95337a){_0x4891ca=_0x4891ca-0xb3;const _0x2f499a=a5_0x2f49();let _0x53bf89=_0x2f499a[_0x4891ca];return _0x53bf89;}import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x2b7648(0x145)]='agent:test';[a5_0x2b7648(0x10d)]=a5_0x2b7648(0x139);async[a5_0x2b7648(0xeb)](_0x5a3b67){const _0x79e44a=a5_0x2b7648,{options:_0x136b28,args:_0x30d3c9,tdx:_0x276dbc}=_0x5a3b67,_0x3ecd02=_0x30d3c9[0x0]||'.',_0xc8d0b2=_0x136b28[_0x79e44a(0x10f)],_0x36a74c=_0x136b28,_0x127477=_0x36a74c[_0x79e44a(0x125)]===![],_0x58e858=_0x36a74c[_0x79e44a(0x135)],_0x42803e=_0x36a74c[_0x79e44a(0x145)],_0x106fa4=_0x36a74c['tags'],_0x594840=_0x136b28['site'],_0x5eb3f0=_0x36a74c['output'];if(_0x58e858&&_0x127477)return console[_0x79e44a(0xe2)](a5_0xe4a0c2['red'](_0x79e44a(0x100))),0x1;let _0x42dee5='table';if(_0x36a74c['json'])_0x42dee5=_0x79e44a(0x110);else{if(_0x36a74c[_0x79e44a(0x147)])_0x42dee5=_0x79e44a(0x147);else{if(_0x36a74c[_0x79e44a(0x11a)])_0x42dee5=_0x79e44a(0x11a);else{if(_0x36a74c[_0x79e44a(0xb9)])_0x42dee5='table';}}}const _0x47886f=_0x36a74c[_0x79e44a(0xd9)];let _0x595fff=_0x3ecd02;const _0x4984ef=a5_0x30c0d7[_0x79e44a(0x143)](_0x3ecd02),_0x4ac0c4=_0x3ecd02==='.';if(!_0x4984ef||_0x4ac0c4){const _0x390206=resolveProjectFromContext(_0x3ecd02,_0x47886f,{'requireFile':'test.yml'});if(_0x390206[_0x79e44a(0x146)])_0x595fff=_0x390206[_0x79e44a(0xb8)],_0x390206[_0x79e44a(0x114)]===_0x79e44a(0x10b)&&console[_0x79e44a(0xe2)](a5_0xe4a0c2[_0x79e44a(0xf8)](_0x79e44a(0x122)+_0x595fff));else switch(_0x390206[_0x79e44a(0x10e)]){case'no_context':console['log'](a5_0xe4a0c2['yellow'](_0x390206[_0x79e44a(0xe8)])),console[_0x79e44a(0xe2)](),console[_0x79e44a(0xe2)](_0x79e44a(0xf7)),console['log'](_0x79e44a(0x115)),console[_0x79e44a(0xe2)]('\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)'),console[_0x79e44a(0xe2)](),console[_0x79e44a(0xe2)](_0x79e44a(0x142));return 0x1;case _0x79e44a(0xc6):console[_0x79e44a(0xe2)](a5_0xe4a0c2[_0x79e44a(0x11d)](_0x390206['message'])),console[_0x79e44a(0xe2)](),console[_0x79e44a(0xe2)](_0x79e44a(0xd1)+_0x390206['llmProject']+_0x79e44a(0xc0));return 0x1;case _0x79e44a(0x120):{const _0x5082f3=a5_0x1c74d5[_0x79e44a(0xdf)](_0x390206[_0x79e44a(0xb8)]);console[_0x79e44a(0xe2)](a5_0xe4a0c2[_0x79e44a(0x11d)](_0x79e44a(0x141)+_0x390206[_0x79e44a(0xd9)]+'\x22:'));for(const _0x421454 of _0x390206[_0x79e44a(0xbe)]){console[_0x79e44a(0xe2)](_0x79e44a(0xd7)+_0x421454);}return console[_0x79e44a(0xe2)](),console['log'](_0x79e44a(0x10a)+_0x5082f3+_0x79e44a(0x148)),0x1;}case _0x79e44a(0xce):console[_0x79e44a(0xe2)](a5_0xe4a0c2[_0x79e44a(0x11d)](_0x79e44a(0x12a)+_0x390206['llmProject']+'\x22.')),console[_0x79e44a(0xe2)](a5_0xe4a0c2['dim'](_0x79e44a(0xf5)+_0x390206[_0x79e44a(0xb8)])),console[_0x79e44a(0xe2)](),console['log'](_0x79e44a(0x12d));return 0x1;}}const {definition:_0x2a72ec,agentInfo:_0x470878}=parseTestFile(_0x595fff);let _0x11eed5=_0x2a72ec[_0x79e44a(0xe9)];if(_0x42803e){const _0x14531a=_0x42803e['split'](',')[_0x79e44a(0xdd)](_0x5a422e=>_0x5a422e[_0x79e44a(0xdc)]());_0x11eed5=_0x2a72ec['tests']['filter'](_0x5239bc=>_0x14531a[_0x79e44a(0x111)](_0x5239bc[_0x79e44a(0x145)]));if(_0x11eed5[_0x79e44a(0xd8)]===0x0)return console[_0x79e44a(0xe2)](a5_0xe4a0c2[_0x79e44a(0x11d)](_0x79e44a(0xe4)+_0x42803e)),console['log'](a5_0xe4a0c2[_0x79e44a(0xf8)]('Available\x20tests:\x20'+_0x2a72ec[_0x79e44a(0xe9)][_0x79e44a(0xdd)](_0x48edfe=>_0x48edfe['name'])['join'](',\x20'))),0x1;}if(_0x106fa4){const _0x1b1c15=_0x106fa4[_0x79e44a(0xc9)](',')[_0x79e44a(0xdd)](_0x103995=>_0x103995[_0x79e44a(0xdc)]()[_0x79e44a(0xe3)]());_0x11eed5=_0x11eed5['filter'](_0x400dfa=>_0x400dfa['tags']?.[_0x79e44a(0xc2)](_0xd84c0b=>_0x1b1c15[_0x79e44a(0x111)](_0xd84c0b['toLowerCase']())));if(_0x11eed5[_0x79e44a(0xd8)]===0x0){console[_0x79e44a(0xe2)](a5_0xe4a0c2['yellow']('No\x20tests\x20found\x20with\x20tags:\x20'+_0x106fa4));const _0x3c1a17=new Set();return _0x2a72ec['tests'][_0x79e44a(0x13c)](_0x26be6c=>_0x26be6c[_0x79e44a(0xea)]?.[_0x79e44a(0x13c)](_0x21384f=>_0x3c1a17['add'](_0x21384f))),_0x3c1a17[_0x79e44a(0x10c)]>0x0?console[_0x79e44a(0xe2)](a5_0xe4a0c2['dim'](_0x79e44a(0xf6)+[..._0x3c1a17][_0x79e44a(0xc4)](',\x20'))):console[_0x79e44a(0xe2)](a5_0xe4a0c2[_0x79e44a(0xf8)]('No\x20tests\x20have\x20tags\x20defined.')),0x1;}}if(_0x58e858)return this[_0x79e44a(0xbb)](_0x5a3b67,{'definition':{'tests':_0x11eed5},'agentInfo':_0x470878,'outputFormat':_0x42dee5,'outputFile':_0x5eb3f0,'testNames':_0x42803e});if(_0xc8d0b2){console[_0x79e44a(0xe2)](a5_0xe4a0c2[_0x79e44a(0x136)]('Test\x20Configuration:')),console[_0x79e44a(0xe2)]('\x20\x20Site:\x20'+a5_0xe4a0c2[_0x79e44a(0xf1)](_0x594840)),console[_0x79e44a(0xe2)](_0x79e44a(0xed)+a5_0xe4a0c2[_0x79e44a(0xf1)](_0x470878[_0x79e44a(0x127)])),console['log']('\x20\x20Agent:\x20'+a5_0xe4a0c2['white'](_0x470878['agentName'])),console['log'](),console['log']('Tests\x20found:\x20'+a5_0xe4a0c2[_0x79e44a(0xf1)](_0x11eed5[_0x79e44a(0xd8)]));for(let _0x4587aa=0x0;_0x4587aa<_0x11eed5[_0x79e44a(0xd8)];_0x4587aa++){const _0x28bea3=_0x11eed5[_0x4587aa],_0x5320db=_0x28bea3[_0x79e44a(0x131)][_0x79e44a(0xd8)]===0x1?_0x79e44a(0xd4):_0x79e44a(0x131),_0x1389cc=_0x28bea3[_0x79e44a(0xea)]?.['length']?'\x20['+_0x28bea3[_0x79e44a(0xea)]['join'](',\x20')+']':'';console['log']('\x20\x20'+(_0x4587aa+0x1)+'.\x20'+a5_0xe4a0c2['white'](_0x28bea3[_0x79e44a(0x145)])+'\x20('+_0x28bea3['rounds']['length']+'\x20'+_0x5320db+')'+a5_0xe4a0c2[_0x79e44a(0xf8)](_0x1389cc));}return 0x0;}let _0x31587b,_0x238702;try{_0x31587b=await _0x276dbc[_0x79e44a(0x12e)][_0x79e44a(0xda)](_0x470878[_0x79e44a(0x127)]);}catch(_0x29ee49){const _0x3694a4=_0x29ee49 instanceof Error?_0x29ee49[_0x79e44a(0xe8)]:String(_0x29ee49);return _0x3694a4['includes'](_0x79e44a(0xe5))||_0x3694a4[_0x79e44a(0xe3)]()[_0x79e44a(0x111)](_0x79e44a(0xc1))?console[_0x79e44a(0xe2)](a5_0xe4a0c2[_0x79e44a(0xfb)]('✗\x20ERROR:\x20Project\x20not\x20found:\x20'+_0x470878[_0x79e44a(0x127)])):console[_0x79e44a(0xe2)](a5_0xe4a0c2[_0x79e44a(0xfb)](_0x79e44a(0xca)+_0x470878[_0x79e44a(0x127)]+'\x22:\x20'+_0x3694a4)),0x1;}try{_0x238702=await _0x276dbc['llm'][_0x79e44a(0xba)](_0x470878['agentName'],_0x31587b);}catch(_0x5ea9e1){const _0x459bb0=_0x5ea9e1 instanceof Error?_0x5ea9e1[_0x79e44a(0xe8)]:String(_0x5ea9e1);return _0x459bb0[_0x79e44a(0x111)](_0x79e44a(0xe5))||_0x459bb0[_0x79e44a(0xe3)]()[_0x79e44a(0x111)](_0x79e44a(0xc1))?console['log'](a5_0xe4a0c2['red']('✗\x20ERROR:\x20Agent\x20not\x20found:\x20'+_0x470878['agentName'])):console[_0x79e44a(0xe2)](a5_0xe4a0c2['red']('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22'+_0x470878[_0x79e44a(0xb6)]+_0x79e44a(0x12f)+_0x459bb0)),0x1;}let _0x5d09de;if(!_0x127477)try{_0x5d09de=await setupEvaluatorAgent(_0x276dbc[_0x79e44a(0x12e)],_0x136b28[_0x79e44a(0xf4)]);}catch(_0x30f327){const _0x3b14cf=_0x30f327 instanceof Error?_0x30f327[_0x79e44a(0xe8)]:String(_0x30f327);return console['log'](a5_0xe4a0c2[_0x79e44a(0xfb)](_0x79e44a(0xff)+_0x3b14cf)),0x1;}console[_0x79e44a(0xe2)](a5_0xe4a0c2[_0x79e44a(0x136)](_0x79e44a(0x149))),console[_0x79e44a(0xe2)](_0x79e44a(0x128)+a5_0xe4a0c2[_0x79e44a(0xf1)](_0x594840)),console[_0x79e44a(0xe2)](_0x79e44a(0x106)+a5_0xe4a0c2[_0x79e44a(0xf1)](_0x470878['projectName']+'/'+_0x470878[_0x79e44a(0xb6)])),console[_0x79e44a(0xe2)]();const _0x27bfef=[],_0xbf0be0=[],_0x5d65b0=Date['now']();for(let _0x33f09b=0x0;_0x33f09b<_0x11eed5[_0x79e44a(0xd8)];_0x33f09b++){const _0x761f86=_0x11eed5[_0x33f09b];_0x11eed5[_0x79e44a(0xd8)]>0x1?console[_0x79e44a(0xe2)](_0x79e44a(0x117)+(_0x33f09b+0x1)+'/'+_0x11eed5[_0x79e44a(0xd8)]+':\x20'+a5_0xe4a0c2[_0x79e44a(0xf1)](_0x761f86['name'])):console[_0x79e44a(0xe2)](_0x79e44a(0x102)+a5_0xe4a0c2[_0x79e44a(0xf1)](_0x761f86[_0x79e44a(0x145)]));const _0x33b1bf=createCommandSpinner(_0x79e44a(0xf2)+_0x761f86[_0x79e44a(0x131)]['length']+_0x79e44a(0xb5));_0x33b1bf[_0x79e44a(0x11b)]();try{const {result:_0x49d519,conversation:_0x24b0ab}=await runTest(_0x276dbc['llm'],_0x761f86,{'agentId':_0x238702,'projectId':_0x31587b,'site':_0x594840,'noEval':_0x127477,'evaluatorId':_0x5d09de,'onRoundStart':(_0x2ee3c8,_0x1a4f3a)=>{const _0x345899=_0x79e44a;_0x33b1bf[_0x345899(0x103)]=_0x345899(0x137)+(_0x2ee3c8+0x1)+'/'+_0x1a4f3a+_0x345899(0xb5);},'onRoundComplete':(_0x1c25a3,_0x5ea0e1,_0x47c813)=>{const _0x244344=_0x79e44a,_0x39a0f8=formatElapsed(_0x5ea0e1);_0x47c813?console[_0x244344(0xe2)]('\x20\x20Round\x20'+(_0x1c25a3+0x1)+'/'+_0x761f86['rounds'][_0x244344(0xd8)]+_0x244344(0xd6)+a5_0xe4a0c2[_0x244344(0xfd)]('✓')+'\x20('+_0x39a0f8+')'):console[_0x244344(0xe2)](_0x244344(0x134)+(_0x1c25a3+0x1)+'/'+_0x761f86[_0x244344(0x131)][_0x244344(0xd8)]+'...\x20'+a5_0xe4a0c2[_0x244344(0xfb)]('✗'));},'onEvaluationStart':()=>{const _0x30d970=_0x79e44a;_0x33b1bf[_0x30d970(0x103)]=_0x30d970(0xfc);},'onEvaluationComplete':_0x2dca40=>{const _0x511a96=_0x79e44a,_0x31cd7a=formatElapsed(_0x2dca40);console[_0x511a96(0xe2)]('\x20\x20Evaluating...\x20'+a5_0xe4a0c2['green']('✓')+'\x20('+_0x31cd7a+')');}});_0x33b1bf[_0x79e44a(0xdb)](),_0x27bfef[_0x79e44a(0xc8)](_0x49d519),_0xbf0be0[_0x79e44a(0xc8)](_0x24b0ab);if(_0x49d519[_0x79e44a(0x12b)]===_0x79e44a(0x130))console['log'](a5_0xe4a0c2[_0x79e44a(0xfd)](_0x79e44a(0x13b)+_0x49d519[_0x79e44a(0x10e)]));else _0x49d519[_0x79e44a(0x12b)]===_0x79e44a(0x123)?console[_0x79e44a(0xe2)](a5_0xe4a0c2['red'](_0x79e44a(0x104)+_0x49d519[_0x79e44a(0x10e)])):console[_0x79e44a(0xe2)](a5_0xe4a0c2[_0x79e44a(0xfb)](_0x79e44a(0x112)+_0x49d519['reason']));_0x49d519['conversation_url']&&console[_0x79e44a(0xe2)](a5_0xe4a0c2[_0x79e44a(0xf8)]('Conversation\x20URL:\x20'+_0x49d519[_0x79e44a(0x133)])),console['log']();}catch(_0x364f7f){_0x33b1bf[_0x79e44a(0xdb)]();const _0x12fe89=_0x364f7f instanceof Error?_0x364f7f[_0x79e44a(0xe8)]:String(_0x364f7f);console[_0x79e44a(0xe2)](a5_0xe4a0c2[_0x79e44a(0xfb)](_0x79e44a(0x112)+_0x12fe89)),console[_0x79e44a(0xe2)](),_0x27bfef[_0x79e44a(0xc8)]({'name':_0x761f86[_0x79e44a(0x145)],'status':_0x79e44a(0x129),'reason':_0x12fe89,'timestamp':new Date()[_0x79e44a(0x11f)](),'duration_ms':0x0});}}const _0x4f431b=Date[_0x79e44a(0xcf)]()-_0x5d65b0,_0xdee543=_0x27bfef[_0x79e44a(0xcd)](_0x5a8b1f=>_0x5a8b1f['status']===_0x79e44a(0x130))['length'],_0x5380d1=_0x27bfef['filter'](_0x53f5a4=>_0x53f5a4['status']===_0x79e44a(0x123))[_0x79e44a(0xd8)],_0xd30b81=_0x27bfef[_0x79e44a(0xcd)](_0x3746a9=>_0x3746a9[_0x79e44a(0x12b)]===_0x79e44a(0x129))[_0x79e44a(0xd8)];console[_0x79e44a(0xe2)]('━'['repeat'](0x3c)),console[_0x79e44a(0xe2)]('Test\x20Summary'),console[_0x79e44a(0xe2)]('━'[_0x79e44a(0xd0)](0x3c)),console[_0x79e44a(0xe2)](_0x79e44a(0x109)+_0x27bfef[_0x79e44a(0xd8)]),console[_0x79e44a(0xe2)]('Passed:\x20\x20\x20'+a5_0xe4a0c2[_0x79e44a(0xfd)](_0xdee543)),console[_0x79e44a(0xe2)]('Failed:\x20\x20\x20'+a5_0xe4a0c2[_0x79e44a(0xfb)](_0x5380d1));_0xd30b81>0x0&&console['log'](_0x79e44a(0xec)+a5_0xe4a0c2['red'](_0xd30b81));console['log'](_0x79e44a(0xb3)+formatElapsed(_0x4f431b)),console[_0x79e44a(0xe2)]('━'[_0x79e44a(0xd0)](0x3c));const _0x2be722=_0x27bfef[_0x79e44a(0xcd)](_0x1f018a=>_0x1f018a[_0x79e44a(0x12b)]!==_0x79e44a(0x130));if(_0x2be722['length']>0x0){console['log'](),console[_0x79e44a(0xe2)](_0x79e44a(0xc7));for(const _0x2f5b05 of _0x2be722){const _0x22c70c=a5_0xe4a0c2[_0x79e44a(0xfb)]('✗'),_0x17028c=_0x2f5b05['reason'][_0x79e44a(0xd8)]>0x32?_0x2f5b05[_0x79e44a(0x10e)][_0x79e44a(0x140)](0x0,0x32)+_0x79e44a(0xfa):_0x2f5b05[_0x79e44a(0x10e)];console[_0x79e44a(0xe2)]('\x20\x20'+_0x22c70c+'\x20'+_0x2f5b05[_0x79e44a(0x145)]+':\x20'+_0x17028c);}}const _0x4688ae={'summary':{'total':_0x27bfef[_0x79e44a(0xd8)],'passed':_0xdee543,'failed':_0x5380d1,'errors':_0xd30b81>0x0?_0xd30b81:undefined,'duration_ms':_0x4f431b},'tests':_0x27bfef,'agent':{'project':_0x470878[_0x79e44a(0x127)],'name':_0x470878[_0x79e44a(0xb6)],'site':_0x594840},'timestamp':new Date(_0x5d65b0)['toISOString']()};try{const _0x22d3cf=buildCachedTestRun(_0xbf0be0,{'site':_0x594840,'projectId':_0x31587b,'projectName':_0x470878['projectName'],'agentId':_0x238702,'agentName':_0x470878['agentName'],'testYmlPath':a5_0x1c74d5[_0x79e44a(0xbc)](_0x470878['testYmlPath'])});saveLastTestRun(_0x22d3cf);}catch{}if(_0x42dee5!==_0x79e44a(0xb9)||_0x5eb3f0){const _0xdd3db0=formatResults(_0x4688ae,_0x42dee5);if(_0x5eb3f0)try{a5_0x30c0d7[_0x79e44a(0x13e)](_0x5eb3f0,_0xdd3db0,_0x79e44a(0x144)),console[_0x79e44a(0xe2)](),console[_0x79e44a(0xe2)](a5_0xe4a0c2['dim'](_0x79e44a(0xe0)+_0x5eb3f0));}catch(_0x5b1888){return console['log'](),console[_0x79e44a(0xe2)](a5_0xe4a0c2[_0x79e44a(0xfb)](_0x79e44a(0xcb)+_0x5b1888)),0x1;}else console['log'](),console[_0x79e44a(0xe2)](_0xdd3db0);}return _0x2be722[_0x79e44a(0xd8)]>0x0?0x1:0x0;}async[a5_0x2b7648(0xbb)](_0x384d69,_0x5eeb3f){const _0x1620d4=a5_0x2b7648,{options:_0xb41ebf,tdx:_0x38a414}=_0x384d69,{definition:_0x3e1633,agentInfo:_0x14bddc,outputFormat:_0x2616be,outputFile:_0x60a1e1}=_0x5eeb3f,_0x52a6e0=_0xb41ebf['site'],_0x50e912=loadLastTestRun();if(!_0x50e912)return console[_0x1620d4(0xe2)](a5_0xe4a0c2[_0x1620d4(0xfb)]('Error:\x20No\x20previous\x20test\x20run\x20found.')),console[_0x1620d4(0xe2)](a5_0xe4a0c2[_0x1620d4(0xf8)]('Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.')),0x1;if(_0x50e912[_0x1620d4(0x124)][_0x1620d4(0xb6)]!==_0x14bddc[_0x1620d4(0xb6)])return console['log'](a5_0xe4a0c2['red']('Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22'+_0x50e912[_0x1620d4(0x124)][_0x1620d4(0xb6)]+'\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22'+_0x14bddc['agentName']+'\x22.')),console[_0x1620d4(0xe2)](a5_0xe4a0c2[_0x1620d4(0xf8)](_0x1620d4(0x132))),0x1;const _0x49e66f=new Set(_0x50e912[_0x1620d4(0xbf)]['map'](_0x3c8624=>_0x3c8624[_0x1620d4(0x13d)])),_0x1c93bb=_0x3e1633[_0x1620d4(0xe9)]['filter'](_0x15bd70=>!_0x49e66f[_0x1620d4(0xc5)](_0x15bd70[_0x1620d4(0x145)]));if(_0x1c93bb['length']>0x0&&_0x50e912[_0x1620d4(0x105)]!==_0x52a6e0)return console[_0x1620d4(0xe2)](a5_0xe4a0c2[_0x1620d4(0xfb)](_0x1620d4(0xd5))),console[_0x1620d4(0xe2)](a5_0xe4a0c2[_0x1620d4(0xf8)]('Cached\x20run\x20is\x20from\x20site\x20\x22'+_0x50e912[_0x1620d4(0x105)]+_0x1620d4(0x13f)+_0x52a6e0+'\x22.')),console['log'](a5_0xe4a0c2[_0x1620d4(0xf8)](_0x1620d4(0xc3)+_0x50e912['site']+_0x1620d4(0xb4))),0x1;const _0x3516b=_0x3e1633[_0x1620d4(0xe9)][_0x1620d4(0xcd)](_0x2f3d36=>_0x49e66f[_0x1620d4(0xc5)](_0x2f3d36['name'])),_0x7c745=_0x1c93bb;let _0x3e066f;try{_0x3e066f=await setupEvaluatorAgent(_0x38a414['llm'],_0xb41ebf[_0x1620d4(0xf4)]);}catch(_0x541b77){const _0x53056a=_0x541b77 instanceof Error?_0x541b77[_0x1620d4(0xe8)]:String(_0x541b77);return console[_0x1620d4(0xe2)](a5_0xe4a0c2['red'](_0x1620d4(0xff)+_0x53056a)),0x1;}console['log'](a5_0xe4a0c2['cyan'](_0x1620d4(0xcc))),console[_0x1620d4(0xe2)](_0x1620d4(0x107)+a5_0xe4a0c2[_0x1620d4(0xf1)](_0x50e912[_0x1620d4(0xb7)])),console['log'](_0x1620d4(0x106)+a5_0xe4a0c2[_0x1620d4(0xf1)](_0x50e912[_0x1620d4(0x124)][_0x1620d4(0x127)]+'/'+_0x50e912['agent'][_0x1620d4(0xb6)]));_0x7c745[_0x1620d4(0xd8)]>0x0&&console['log'](_0x1620d4(0xde)+a5_0xe4a0c2[_0x1620d4(0x11d)](_0x7c745[_0x1620d4(0xd8)]));console[_0x1620d4(0xe2)]();const _0x4e657f=[],_0x53067c=Date[_0x1620d4(0xcf)](),_0x1b26bc=createCommandSpinner(_0x1620d4(0xe6));if(_0x3516b['length']>0x0)try{const _0x167e21=await reevaluateFromCache(_0x38a414[_0x1620d4(0x12e)],_0x50e912,{'tests':_0x3516b},{'evaluatorId':_0x3e066f,'onTestStart':(_0x3468bb,_0xa621b4,_0x3c22b0)=>{const _0x33802d=_0x1620d4;_0x1b26bc[_0x33802d(0x103)]=_0x33802d(0xd3)+(_0xa621b4+0x1)+'/'+_0x3c22b0+':\x20'+_0x3468bb+_0x33802d(0xfa);if(!_0x1b26bc['isSpinning'])_0x1b26bc[_0x33802d(0x11b)]();},'onTestComplete':(_0x2a6bcb,_0x5aa765)=>{const _0x5eb3e8=_0x1620d4;_0x1b26bc[_0x5eb3e8(0xdb)]();if(_0x5aa765[_0x5eb3e8(0x12b)]===_0x5eb3e8(0x130))console[_0x5eb3e8(0xe2)](a5_0xe4a0c2[_0x5eb3e8(0xfd)](_0x5eb3e8(0x13b)+_0x2a6bcb)+a5_0xe4a0c2[_0x5eb3e8(0xf8)](_0x5eb3e8(0x119)));else _0x5aa765[_0x5eb3e8(0x12b)]===_0x5eb3e8(0x123)?console[_0x5eb3e8(0xe2)](a5_0xe4a0c2['red'](_0x5eb3e8(0x104)+_0x2a6bcb+'\x20-\x20'+_0x5aa765[_0x5eb3e8(0x10e)])+a5_0xe4a0c2[_0x5eb3e8(0xf8)]('\x20(cached)')):console[_0x5eb3e8(0xe2)](a5_0xe4a0c2[_0x5eb3e8(0xfb)](_0x5eb3e8(0x112)+_0x2a6bcb+_0x5eb3e8(0x118)+_0x5aa765[_0x5eb3e8(0x10e)]));_0x5aa765[_0x5eb3e8(0x133)]&&console[_0x5eb3e8(0xe2)](a5_0xe4a0c2['dim'](_0x5eb3e8(0x116)+_0x5aa765['conversation_url'])),_0x4e657f[_0x5eb3e8(0xc8)](_0x5aa765);},'onTestSkipped':(_0x2643e7,_0x4abb4e)=>{const _0x4c71c1=_0x1620d4;_0x1b26bc[_0x4c71c1(0xdb)](),console[_0x4c71c1(0xe2)](a5_0xe4a0c2[_0x4c71c1(0x11d)](_0x4c71c1(0xd2)+_0x2643e7+_0x4c71c1(0x118)+_0x4abb4e));}});for(const _0x286755 of _0x167e21){!_0x4e657f[_0x1620d4(0xee)](_0x55844f=>_0x55844f['name']===_0x286755[_0x1620d4(0x145)])&&_0x4e657f[_0x1620d4(0xc8)](_0x286755);}}catch(_0x2e7e1f){_0x1b26bc['stop']();const _0x28bafc=_0x2e7e1f instanceof Error?_0x2e7e1f[_0x1620d4(0xe8)]:String(_0x2e7e1f);return console[_0x1620d4(0xe2)](a5_0xe4a0c2[_0x1620d4(0xfb)](_0x1620d4(0xf3)+_0x28bafc)),0x1;}_0x1b26bc[_0x1620d4(0xdb)]();if(_0x7c745[_0x1620d4(0xd8)]>0x0){console[_0x1620d4(0xe2)](),console['log'](a5_0xe4a0c2[_0x1620d4(0x136)]('Executing\x20new\x20tests...'));const {projectId:_0x454bfe,agentId:_0x562d12}=_0x50e912[_0x1620d4(0x124)];for(const _0x102830 of _0x7c745){console[_0x1620d4(0xe2)](_0x1620d4(0x101)+a5_0xe4a0c2[_0x1620d4(0xf1)](_0x102830[_0x1620d4(0x145)]));const _0x3ef223=createCommandSpinner(_0x1620d4(0xf2)+_0x102830['rounds'][_0x1620d4(0xd8)]+_0x1620d4(0xb5));_0x3ef223[_0x1620d4(0x11b)]();try{const {result:_0x2de774}=await runTest(_0x38a414['llm'],_0x102830,{'agentId':_0x562d12,'projectId':_0x454bfe,'site':_0x50e912[_0x1620d4(0x105)],'noEval':![],'evaluatorId':_0x3e066f,'onRoundStart':(_0x2dcfec,_0x38005a)=>{const _0x1f0fc0=_0x1620d4;_0x3ef223['text']=_0x1f0fc0(0x137)+(_0x2dcfec+0x1)+'/'+_0x38005a+_0x1f0fc0(0xb5);},'onRoundComplete':(_0x5cc92e,_0x45fcc4,_0x51a571)=>{const _0x232b77=_0x1620d4,_0x108cff=formatElapsed(_0x45fcc4);_0x51a571?console['log'](_0x232b77(0x134)+(_0x5cc92e+0x1)+'/'+_0x102830[_0x232b77(0x131)][_0x232b77(0xd8)]+_0x232b77(0xd6)+a5_0xe4a0c2['green']('✓')+'\x20('+_0x108cff+')'):console[_0x232b77(0xe2)](_0x232b77(0x134)+(_0x5cc92e+0x1)+'/'+_0x102830[_0x232b77(0x131)][_0x232b77(0xd8)]+_0x232b77(0xd6)+a5_0xe4a0c2[_0x232b77(0xfb)]('✗'));},'onEvaluationStart':()=>{const _0x45292f=_0x1620d4;_0x3ef223[_0x45292f(0x103)]=_0x45292f(0xfc);},'onEvaluationComplete':_0x5e3820=>{const _0x54c9a1=_0x1620d4,_0x1b40a5=formatElapsed(_0x5e3820);console['log'](_0x54c9a1(0x138)+a5_0xe4a0c2[_0x54c9a1(0xfd)]('✓')+'\x20('+_0x1b40a5+')');}});_0x3ef223[_0x1620d4(0xdb)](),_0x4e657f['push'](_0x2de774);if(_0x2de774[_0x1620d4(0x12b)]===_0x1620d4(0x130))console[_0x1620d4(0xe2)](a5_0xe4a0c2[_0x1620d4(0xfd)](_0x1620d4(0x13b)+_0x2de774[_0x1620d4(0x10e)])+a5_0xe4a0c2[_0x1620d4(0xf8)](_0x1620d4(0xef)));else _0x2de774[_0x1620d4(0x12b)]===_0x1620d4(0x123)?console[_0x1620d4(0xe2)](a5_0xe4a0c2['red'](_0x1620d4(0x104)+_0x2de774[_0x1620d4(0x10e)])+a5_0xe4a0c2[_0x1620d4(0xf8)](_0x1620d4(0xef))):console[_0x1620d4(0xe2)](a5_0xe4a0c2['red']('✗\x20ERROR:\x20'+_0x2de774[_0x1620d4(0x10e)]));_0x2de774[_0x1620d4(0x133)]&&console[_0x1620d4(0xe2)](a5_0xe4a0c2['dim'](_0x1620d4(0x116)+_0x2de774['conversation_url']));}catch(_0xfbe738){_0x3ef223['stop']();const _0x29b48f=_0xfbe738 instanceof Error?_0xfbe738['message']:String(_0xfbe738);console[_0x1620d4(0xe2)](a5_0xe4a0c2[_0x1620d4(0xfb)]('✗\x20ERROR:\x20'+_0x29b48f)),_0x4e657f['push']({'name':_0x102830['name'],'status':'ERROR','reason':_0x29b48f,'timestamp':new Date()[_0x1620d4(0x11f)](),'duration_ms':0x0});}}}console['log']();const _0x401c20=Date[_0x1620d4(0xcf)]()-_0x53067c,_0x3acf97=_0x4e657f[_0x1620d4(0xcd)](_0x2f7b39=>_0x2f7b39['status']===_0x1620d4(0x130))[_0x1620d4(0xd8)],_0x1b1ae3=_0x4e657f[_0x1620d4(0xcd)](_0x14175a=>_0x14175a[_0x1620d4(0x12b)]===_0x1620d4(0x123))[_0x1620d4(0xd8)],_0x3bd56b=_0x4e657f[_0x1620d4(0xcd)](_0x377593=>_0x377593[_0x1620d4(0x12b)]==='ERROR')[_0x1620d4(0xd8)];console[_0x1620d4(0xe2)]('━'[_0x1620d4(0xd0)](0x3c)),console[_0x1620d4(0xe2)](_0x1620d4(0xf0)),console[_0x1620d4(0xe2)]('━'['repeat'](0x3c)),console['log'](_0x1620d4(0x109)+_0x4e657f[_0x1620d4(0xd8)]),console[_0x1620d4(0xe2)]('Passed:\x20\x20\x20'+a5_0xe4a0c2[_0x1620d4(0xfd)](_0x3acf97)),console[_0x1620d4(0xe2)](_0x1620d4(0x11c)+a5_0xe4a0c2[_0x1620d4(0xfb)](_0x1b1ae3));_0x3bd56b>0x0&&console['log'](_0x1620d4(0xec)+a5_0xe4a0c2[_0x1620d4(0xfb)](_0x3bd56b));console[_0x1620d4(0xe2)]('Duration:\x20'+formatElapsed(_0x401c20)),console[_0x1620d4(0xe2)]('━'[_0x1620d4(0xd0)](0x3c));const _0x2eeff1={'summary':{'total':_0x4e657f['length'],'passed':_0x3acf97,'failed':_0x1b1ae3,'errors':_0x3bd56b>0x0?_0x3bd56b:undefined,'duration_ms':_0x401c20},'tests':_0x4e657f,'agent':{'project':_0x14bddc['projectName'],'name':_0x14bddc[_0x1620d4(0xb6)],'site':_0x52a6e0},'timestamp':new Date(_0x53067c)[_0x1620d4(0x11f)]()};if(_0x2616be!==_0x1620d4(0xb9)||_0x60a1e1){const _0x1a0a11=formatResults(_0x2eeff1,_0x2616be);if(_0x60a1e1)try{a5_0x30c0d7[_0x1620d4(0x13e)](_0x60a1e1,_0x1a0a11,'utf-8'),console['log'](),console['log'](a5_0xe4a0c2[_0x1620d4(0xf8)](_0x1620d4(0xe0)+_0x60a1e1));}catch(_0x14a4a5){return console[_0x1620d4(0xe2)](),console[_0x1620d4(0xe2)](a5_0xe4a0c2[_0x1620d4(0xfb)](_0x1620d4(0xcb)+_0x14a4a5)),0x1;}else console[_0x1620d4(0xe2)](),console['log'](_0x1a0a11);}const _0x3940e2=_0x4e657f[_0x1620d4(0xcd)](_0x5e1ce6=>_0x5e1ce6[_0x1620d4(0x12b)]!=='PASS');return _0x3940e2[_0x1620d4(0xd8)]>0x0?0x1:0x0;}}
@@ -1 +1 @@
1
- const a6_0x329082=a6_0x4cb2;(function(_0x4b6b52,_0x2e96fe){const _0x48f300=a6_0x4cb2,_0x20c028=_0x4b6b52();while(!![]){try{const _0x24644f=-parseInt(_0x48f300(0xe7))/0x1*(-parseInt(_0x48f300(0xb8))/0x2)+-parseInt(_0x48f300(0xc4))/0x3*(parseInt(_0x48f300(0xb3))/0x4)+parseInt(_0x48f300(0xcb))/0x5*(parseInt(_0x48f300(0xe5))/0x6)+parseInt(_0x48f300(0xad))/0x7+-parseInt(_0x48f300(0xea))/0x8*(parseInt(_0x48f300(0xbb))/0x9)+parseInt(_0x48f300(0xd4))/0xa*(-parseInt(_0x48f300(0xa6))/0xb)+parseInt(_0x48f300(0xde))/0xc;if(_0x24644f===_0x2e96fe)break;else _0x20c028['push'](_0x20c028['shift']());}catch(_0x30d433){_0x20c028['push'](_0x20c028['shift']());}}}(a6_0x4bed,0xef2aa));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';function a6_0x4bed(){const _0xecd54=['method','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','347634nGJZaP','isArray','921499JIusxg','description','has','11505224rXddMi','workflow','cookie','15499JywPUY','DELETE','PUT','entries','x-xsrf-token','status','verbose','9436658tEHKvW','PATCH','Invalid\x20HTTP\x20method:\x20','output','toLowerCase','header','2687376crHIxi','trim','log','Error:\x20','GET','4jtabjW','headers','length','9EOIYpD','Invalid\x20API\x20type:\x20','proxy-authorization','substring','message','indexOf','color','keys','data','3ghpiEu','set-cookie','join','stack','site','validate','cdp','115fBEOKo','\x0aStack\x20trace:\x0a','.\x20Valid\x20types:\x20','api','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','Endpoint\x20must\x20start\x20with\x20/:\x20','.\x20Valid\x20methods:\x20','execute','\x22.\x20','10790zenEir','file','authorization','x-auth-token','<\x20HTTP/1.1\x20','includes','name','error','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','type','1034940keOZXV','POST','request','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','Results\x20saved\x20to\x20'];a6_0x4bed=function(){return _0xecd54;};return a6_0x4bed();}const SENSITIVE_HEADERS=new Set([a6_0x329082(0xd6),a6_0x329082(0xbd),a6_0x329082(0xec),a6_0x329082(0xc5),'set-cookie2',a6_0x329082(0xaa),a6_0x329082(0xd7),'x-trino-user']);function isSensitiveHeader(_0x429966){const _0x254309=a6_0x329082;return SENSITIVE_HEADERS[_0x254309(0xe9)](_0x429966[_0x254309(0xb1)]());}function a6_0x4cb2(_0x2cc566,_0x3ced10){_0x2cc566=_0x2cc566-0xa6;const _0x4bed0b=a6_0x4bed();let _0x4cb2ec=_0x4bed0b[_0x2cc566];return _0x4cb2ec;}function parseHeader(_0x250483){const _0x284a2b=a6_0x329082,_0x516e74=_0x250483[_0x284a2b(0xc0)](':');if(_0x516e74===-0x1)throw new Error('Invalid\x20header\x20format:\x20\x22'+_0x250483+_0x284a2b(0xd3)+_0x284a2b(0xcf));const _0x37ecb3=_0x250483[_0x284a2b(0xbe)](0x0,_0x516e74)[_0x284a2b(0xb4)](),_0x567643=_0x250483[_0x284a2b(0xbe)](_0x516e74+0x1)[_0x284a2b(0xb4)]();if(!_0x37ecb3)throw new Error('Header\x20key\x20cannot\x20be\x20empty:\x20\x22'+_0x250483+'\x22');return[_0x37ecb3,_0x567643];}export class ApiCommand extends BaseCommand{[a6_0x329082(0xda)]='api';[a6_0x329082(0xe8)]=a6_0x329082(0xe1);[a6_0x329082(0xc9)](_0x4bd368){const _0x40171e=a6_0x329082,{args:_0x5d4d8a,options:_0x34209f}=_0x4bd368,_0x4885d7=_0x34209f;if(_0x5d4d8a[_0x40171e(0xba)]===0x0)return _0x40171e(0xdc);const _0x50244f=_0x5d4d8a[0x0];if(!_0x50244f['startsWith']('/'))return _0x40171e(0xd0)+_0x50244f;const _0x413a28=_0x4885d7[_0x40171e(0xc3)],_0x5e3e3b=_0x4885d7[_0x40171e(0xd5)];if(_0x413a28&&_0x5e3e3b)return _0x40171e(0xe4);const _0x54b96c=_0x4885d7[_0x40171e(0xe3)]||'GET',_0x212d16=[_0x40171e(0xb7),_0x40171e(0xdf),_0x40171e(0xa8),_0x40171e(0xa7),_0x40171e(0xae)];if(!_0x212d16[_0x40171e(0xd9)](_0x54b96c['toUpperCase']()))return _0x40171e(0xaf)+_0x54b96c+_0x40171e(0xd1)+_0x212d16[_0x40171e(0xc6)](',\x20');const _0x285f21=_0x4885d7[_0x40171e(0xdd)]||'td',_0x287c44=['td',_0x40171e(0xca),_0x40171e(0xeb),'trino','llm','llm-proxy'];if(!_0x287c44['includes'](_0x285f21))return _0x40171e(0xbc)+_0x285f21+_0x40171e(0xcd)+_0x287c44['join'](',\x20');return undefined;}async[a6_0x329082(0xd2)](_0x249f71){const _0x2523d6=a6_0x329082,{options:_0x497ee7,args:_0x29c42d,tdx:_0x964ae5}=_0x249f71,_0xdbcd4a=_0x497ee7,_0x592f27=_0x29c42d[0x0],_0x105524=(_0xdbcd4a[_0x2523d6(0xe3)]||_0x2523d6(0xb7))['toUpperCase'](),_0x274c83=_0xdbcd4a[_0x2523d6(0xc3)],_0x48f499=_0xdbcd4a['file'],_0x14ed41=_0xdbcd4a[_0x2523d6(0xb2)],_0x36a56d=_0xdbcd4a['type']||'td';try{const _0x3445a5={};if(_0x14ed41){const _0x33a49c=Array[_0x2523d6(0xe6)](_0x14ed41)?_0x14ed41:[_0x14ed41];for(const _0x22a2c6 of _0x33a49c){const [_0x54cad1,_0x4d54b3]=parseHeader(_0x22a2c6);_0x3445a5[_0x54cad1]=_0x4d54b3;}}let _0x2f31b0;if(_0x274c83)_0x2f31b0=_0x274c83;else{if(_0x48f499)try{_0x2f31b0=RawAPI['readBodyFromFile'](_0x48f499);}catch(_0x1522b7){return console[_0x2523d6(0xdb)]('Error:\x20'+(_0x1522b7 instanceof Error?_0x1522b7[_0x2523d6(0xbf)]:String(_0x1522b7))),0x1;}}const _0x598fbd={'method':_0x105524,'apiType':_0x36a56d,'includeHeaders':_0x497ee7[_0x2523d6(0xac)]};_0x2f31b0&&(_0x598fbd['body']=_0x2f31b0);Object[_0x2523d6(0xc2)](_0x3445a5)['length']>0x0&&(_0x598fbd[_0x2523d6(0xb9)]=_0x3445a5);if(_0x497ee7[_0x2523d6(0xac)]){const _0x2ef7d6=resolveSite(_0x497ee7[_0x2523d6(0xc8)]),_0x300498=getEndpoint(_0x2ef7d6,_0x36a56d),_0xeaf43=''+_0x300498+_0x592f27;console[_0x2523d6(0xdb)]('>\x20'+_0x105524+'\x20'+_0xeaf43);const _0x15f9c9=getAuthHeaders(_0x2ef7d6),_0x3329f3={..._0x15f9c9,..._0x3445a5};for(const [_0x558f27,_0x501cab]of Object[_0x2523d6(0xa9)](_0x3329f3)){!isSensitiveHeader(_0x558f27)&&console[_0x2523d6(0xdb)]('>\x20'+_0x558f27+':\x20'+_0x501cab);}_0x2f31b0&&console['error']('>'),console[_0x2523d6(0xdb)]('');}const _0x549a59=await _0x964ae5[_0x2523d6(0xce)][_0x2523d6(0xe0)](_0x592f27,_0x598fbd);if(_0x497ee7[_0x2523d6(0xac)]&&_0x549a59[_0x2523d6(0xb9)]){console[_0x2523d6(0xdb)](_0x2523d6(0xd8)+_0x549a59[_0x2523d6(0xab)]);for(const [_0x2f01cc,_0x5b4da4]of Object[_0x2523d6(0xa9)](_0x549a59['headers'])){!isSensitiveHeader(_0x2f01cc)&&console['error']('<\x20'+_0x2f01cc+':\x20'+_0x5b4da4);}console[_0x2523d6(0xdb)]('');}const _0x2d258e=Boolean(_0x497ee7[_0x2523d6(0xb0)]),_0x10f17f={'color':_0x497ee7[_0x2523d6(0xc1)],'noColor':_0x497ee7['noColor']||_0x2d258e&&!_0x497ee7[_0x2523d6(0xc1)]},_0x24830f=colorizeJSON(_0x549a59['data'],_0x10f17f);return _0x497ee7['output']?(writeFileSync(_0x497ee7[_0x2523d6(0xb0)],_0x24830f),console['error'](_0x2523d6(0xe2)+_0x497ee7[_0x2523d6(0xb0)])):console[_0x2523d6(0xb5)](_0x24830f),0x0;}catch(_0x4a2bc4){return _0x4a2bc4 instanceof Error?(console['error']('Error:\x20'+_0x4a2bc4['message']),_0x497ee7[_0x2523d6(0xac)]&&_0x4a2bc4[_0x2523d6(0xc7)]&&console[_0x2523d6(0xdb)](_0x2523d6(0xcc)+_0x4a2bc4[_0x2523d6(0xc7)])):console[_0x2523d6(0xdb)](_0x2523d6(0xb6)+String(_0x4a2bc4)),0x1;}}}
1
+ const a6_0x219fe7=a6_0xce1a;(function(_0x33195e,_0x491f6){const _0x5950d6=a6_0xce1a,_0x1ca2ab=_0x33195e();while(!![]){try{const _0x47a525=parseInt(_0x5950d6(0xe0))/0x1*(parseInt(_0x5950d6(0xe4))/0x2)+-parseInt(_0x5950d6(0xe5))/0x3+-parseInt(_0x5950d6(0xd9))/0x4+-parseInt(_0x5950d6(0xf3))/0x5*(-parseInt(_0x5950d6(0x109))/0x6)+-parseInt(_0x5950d6(0x11a))/0x7+parseInt(_0x5950d6(0x112))/0x8+parseInt(_0x5950d6(0x105))/0x9*(parseInt(_0x5950d6(0xe3))/0xa);if(_0x47a525===_0x491f6)break;else _0x1ca2ab['push'](_0x1ca2ab['shift']());}catch(_0x360dc6){_0x1ca2ab['push'](_0x1ca2ab['shift']());}}}(a6_0xe878,0x92c03));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';function a6_0xce1a(_0x4abbe2,_0x3ea705){_0x4abbe2=_0x4abbe2-0xd5;const _0xe878b=a6_0xe878();let _0xce1a07=_0xe878b[_0x4abbe2];return _0xce1a07;}import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a6_0x219fe7(0xf1),a6_0x219fe7(0x108),a6_0x219fe7(0x106),a6_0x219fe7(0x11b),a6_0x219fe7(0x11f),a6_0x219fe7(0x10e),a6_0x219fe7(0xdd),a6_0x219fe7(0xe6)]);function isSensitiveHeader(_0x1bb025){const _0x1b9ba4=a6_0x219fe7;return SENSITIVE_HEADERS[_0x1b9ba4(0xf6)](_0x1bb025['toLowerCase']());}function a6_0xe878(){const _0x4fb224=['PUT','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','log','.\x20Valid\x20types:\x20','request','execute','message','llm-proxy','toUpperCase','PATCH','data','48897OEucvb','cookie','.\x20Valid\x20methods:\x20','proxy-authorization','12hEKLoR','file','body','Invalid\x20header\x20format:\x20\x22','site','x-xsrf-token','GET','\x22.\x20','type','4475496cJEWVL','output','Invalid\x20HTTP\x20method:\x20','Invalid\x20API\x20type:\x20','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','verbose','isArray','POST','7668087NNVAsA','set-cookie','name','substring','llm','set-cookie2','api','length','noColor','startsWith','995168GHXpvU','method','entries','status','x-auth-token','trim','color','1aukbfB','<\x20HTTP/1.1\x20','includes','2390FHLQcJ','1415332LbMXYt','2626488wXYMYt','x-trino-user','Error:\x20','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','cdp','Endpoint\x20must\x20start\x20with\x20/:\x20','validate','DELETE','workflow','description','headers','stack','authorization','indexOf','638075xwKVmw','readBodyFromFile','error','has','\x0aStack\x20trace:\x0a','join','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22'];a6_0xe878=function(){return _0x4fb224;};return a6_0xe878();}function parseHeader(_0x58e0f3){const _0x1a0ef9=a6_0x219fe7,_0x882301=_0x58e0f3[_0x1a0ef9(0xf2)](':');if(_0x882301===-0x1)throw new Error(_0x1a0ef9(0x10c)+_0x58e0f3+_0x1a0ef9(0x110)+_0x1a0ef9(0xf9));const _0x38c090=_0x58e0f3[_0x1a0ef9(0x11d)](0x0,_0x882301)['trim'](),_0x253fd2=_0x58e0f3[_0x1a0ef9(0x11d)](_0x882301+0x1)[_0x1a0ef9(0xde)]();if(!_0x38c090)throw new Error(_0x1a0ef9(0xfb)+_0x58e0f3+'\x22');return[_0x38c090,_0x253fd2];}export class ApiCommand extends BaseCommand{[a6_0x219fe7(0x11c)]=a6_0x219fe7(0xd5);[a6_0x219fe7(0xee)]=a6_0x219fe7(0xe8);[a6_0x219fe7(0xeb)](_0x834afa){const _0x2410a5=a6_0x219fe7,{args:_0x98ad49,options:_0xfba90b}=_0x834afa,_0x1d63ad=_0xfba90b;if(_0x98ad49[_0x2410a5(0xd6)]===0x0)return'Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list';const _0x2b5c49=_0x98ad49[0x0];if(!_0x2b5c49[_0x2410a5(0xd8)]('/'))return _0x2410a5(0xea)+_0x2b5c49;const _0x478ae3=_0x1d63ad[_0x2410a5(0x104)],_0x38d6b3=_0x1d63ad['file'];if(_0x478ae3&&_0x38d6b3)return _0x2410a5(0x116);const _0x914bcc=_0x1d63ad[_0x2410a5(0xda)]||_0x2410a5(0x10f),_0x32635b=[_0x2410a5(0x10f),_0x2410a5(0x119),_0x2410a5(0xfa),_0x2410a5(0xec),_0x2410a5(0x103)];if(!_0x32635b[_0x2410a5(0xe2)](_0x914bcc[_0x2410a5(0x102)]()))return _0x2410a5(0x114)+_0x914bcc+_0x2410a5(0x107)+_0x32635b[_0x2410a5(0xf8)](',\x20');const _0x2a77a6=_0x1d63ad['type']||'td',_0x8f54a=['td',_0x2410a5(0xe9),_0x2410a5(0xed),'trino',_0x2410a5(0x11e),_0x2410a5(0x101)];if(!_0x8f54a['includes'](_0x2a77a6))return _0x2410a5(0x115)+_0x2a77a6+_0x2410a5(0xfd)+_0x8f54a['join'](',\x20');return undefined;}async[a6_0x219fe7(0xff)](_0x1f3e55){const _0x421e9f=a6_0x219fe7,{options:_0x59bc9b,args:_0x4bcd65,tdx:_0x29a34b}=_0x1f3e55,_0x435f88=_0x59bc9b,_0xf98fcd=_0x4bcd65[0x0],_0x44278b=(_0x435f88['method']||_0x421e9f(0x10f))['toUpperCase'](),_0x39836d=_0x435f88[_0x421e9f(0x104)],_0x3a8215=_0x435f88[_0x421e9f(0x10a)],_0x624e89=_0x435f88['header'],_0x186103=_0x435f88[_0x421e9f(0x111)]||'td';try{const _0x556efc={};if(_0x624e89){const _0x385ae9=Array[_0x421e9f(0x118)](_0x624e89)?_0x624e89:[_0x624e89];for(const _0x2923f6 of _0x385ae9){const [_0x25ecd8,_0x575b62]=parseHeader(_0x2923f6);_0x556efc[_0x25ecd8]=_0x575b62;}}let _0x18192b;if(_0x39836d)_0x18192b=_0x39836d;else{if(_0x3a8215)try{_0x18192b=RawAPI[_0x421e9f(0xf4)](_0x3a8215);}catch(_0x6e1e5e){return console[_0x421e9f(0xf5)](_0x421e9f(0xe7)+(_0x6e1e5e instanceof Error?_0x6e1e5e['message']:String(_0x6e1e5e))),0x1;}}const _0x6f390b={'method':_0x44278b,'apiType':_0x186103,'includeHeaders':_0x59bc9b['verbose']};_0x18192b&&(_0x6f390b[_0x421e9f(0x10b)]=_0x18192b);Object['keys'](_0x556efc)['length']>0x0&&(_0x6f390b[_0x421e9f(0xef)]=_0x556efc);if(_0x59bc9b[_0x421e9f(0x117)]){const _0x518971=resolveSite(_0x59bc9b[_0x421e9f(0x10d)]),_0x2de27a=getEndpoint(_0x518971,_0x186103),_0x25afd0=''+_0x2de27a+_0xf98fcd;console[_0x421e9f(0xf5)]('>\x20'+_0x44278b+'\x20'+_0x25afd0);const _0x5a159d=getAuthHeaders(_0x518971),_0x217c7e={..._0x5a159d,..._0x556efc};for(const [_0xeb3a4f,_0x54c6b8]of Object[_0x421e9f(0xdb)](_0x217c7e)){!isSensitiveHeader(_0xeb3a4f)&&console[_0x421e9f(0xf5)]('>\x20'+_0xeb3a4f+':\x20'+_0x54c6b8);}_0x18192b&&console['error']('>'),console[_0x421e9f(0xf5)]('');}const _0x1a0b62=await _0x29a34b[_0x421e9f(0xd5)][_0x421e9f(0xfe)](_0xf98fcd,_0x6f390b);if(_0x59bc9b[_0x421e9f(0x117)]&&_0x1a0b62[_0x421e9f(0xef)]){console[_0x421e9f(0xf5)](_0x421e9f(0xe1)+_0x1a0b62[_0x421e9f(0xdc)]);for(const [_0x377990,_0x23f4b9]of Object[_0x421e9f(0xdb)](_0x1a0b62['headers'])){!isSensitiveHeader(_0x377990)&&console[_0x421e9f(0xf5)]('<\x20'+_0x377990+':\x20'+_0x23f4b9);}console[_0x421e9f(0xf5)]('');}const _0x1a12c1=Boolean(_0x59bc9b['output']),_0xb10970={'color':_0x59bc9b[_0x421e9f(0xdf)],'noColor':_0x59bc9b[_0x421e9f(0xd7)]||_0x1a12c1&&!_0x59bc9b[_0x421e9f(0xdf)]},_0x12fe75=colorizeJSON(_0x1a0b62[_0x421e9f(0x104)],_0xb10970);return _0x59bc9b[_0x421e9f(0x113)]?(writeFileSync(_0x59bc9b[_0x421e9f(0x113)],_0x12fe75),console[_0x421e9f(0xf5)]('Results\x20saved\x20to\x20'+_0x59bc9b['output'])):console[_0x421e9f(0xfc)](_0x12fe75),0x0;}catch(_0x18bd1d){return _0x18bd1d instanceof Error?(console[_0x421e9f(0xf5)](_0x421e9f(0xe7)+_0x18bd1d[_0x421e9f(0x100)]),_0x59bc9b[_0x421e9f(0x117)]&&_0x18bd1d[_0x421e9f(0xf0)]&&console[_0x421e9f(0xf5)](_0x421e9f(0xf7)+_0x18bd1d[_0x421e9f(0xf0)])):console[_0x421e9f(0xf5)]('Error:\x20'+String(_0x18bd1d)),0x1;}}}
@@ -1 +1 @@
1
- const a7_0x5ca324=a7_0x1cf9;(function(_0x1bcdbf,_0x21efd9){const _0x330179=a7_0x1cf9,_0x3e4728=_0x1bcdbf();while(!![]){try{const _0x11c64b=parseInt(_0x330179(0x109))/0x1*(-parseInt(_0x330179(0x114))/0x2)+parseInt(_0x330179(0xed))/0x3+parseInt(_0x330179(0xde))/0x4+-parseInt(_0x330179(0xec))/0x5*(parseInt(_0x330179(0xdb))/0x6)+-parseInt(_0x330179(0xe2))/0x7*(parseInt(_0x330179(0xf2))/0x8)+-parseInt(_0x330179(0x113))/0x9+parseInt(_0x330179(0xfc))/0xa*(parseInt(_0x330179(0xf5))/0xb);if(_0x11c64b===_0x21efd9)break;else _0x3e4728['push'](_0x3e4728['shift']());}catch(_0x13da5c){_0x3e4728['push'](_0x3e4728['shift']());}}}(a7_0x4f01,0x87d50));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens}from'../core/oauth-keychain.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';function a7_0x4f01(){const _0x1771a1=['method','select','\x20(site:\x20','apiKey','Remove\x20API\x20key\x20from\x20system\x20keychain','Read\x20credential\x20from\x20','775555LuIfMq','1656696SoYtfl','message','N/A','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','log','92168VyYneM','Enter\x20your\x20TD\x20API\x20key:','\x20removed\x20from\x20keychain','15310889wveQda','Name:\x20','Read\x20credential\x20from\x20keychain','\x20and\x20','Setting\x20up\x20authentication\x20for\x20site:\x20','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','\x20(profile:\x20','10MuISsO','description','site','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','email','warn','profile','join','oauth','filter','Choose\x20authentication\x20method:','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','Setup\x20API\x20key\x20authentication\x20interactively','505SCMGQz','tdx\x20profile:\x20','/app/mp/ak','logLevel','red','No\x20credential\x20found','OAuth\x20(browser\x20login)','\x20--profile\x20','\x27\x20registered','\x0aSetup\x20cancelled','9868311lsGGmu','638anZMSx','OAuth\x20tokens','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','trim','last_name','API\x20key\x20cannot\x20be\x20empty','getUserInfo','API\x20Key','apikey','✓\x20Default\x20site\x20set\x20to\x20','✓\x20Authentication\x20successful\x0a','API\x20key','yellow','execute','status','auth','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','error','User:\x20','You\x20can\x20find\x20your\x20API\x20key\x20at:','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','\x20\x20tdx','bold','6EjWDSr','No\x20credentials\x20found\x20in\x20keychain','Credential\x20type:\x20OAuth','2680392yNzQft','first_name','Setup\x20cancelled','jobs','392KXbhHR','name','green','Validating\x20API\x20key...'];a7_0x4f01=function(){return _0x1771a1;};return a7_0x4f01();}function a7_0x1cf9(_0x26d596,_0x5c12d0){_0x26d596=_0x26d596-0xc8;const _0x4f0111=a7_0x4f01();let _0x1cf95c=_0x4f0111[_0x26d596];return _0x1cf95c;}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{isOAuthSupported}from'../core/oauth.js';import{runOAuthLoginFlow}from'./auth-login-command.js';import{promptSiteSelection}from'../core/constants.js';import a7_0x4acc4a from'prompts';import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a7_0xe9efc8 from'chalk';export class AuthSetupCommand extends BaseCommand{['name']='auth:setup';[a7_0x5ca324(0xfd)]=a7_0x5ca324(0x108);async[a7_0x5ca324(0xd1)](_0x446952){const _0x5b5126=a7_0x5ca324,{options:_0x126a21}=_0x446952,_0x4261a4=_0x126a21['profile'];console['log'](a7_0xe9efc8[_0x5b5126(0xda)]('tdx:\x20auth\x20setup'));const _0x436e55=_0x126a21['site']||'us01',_0x4afb42=await promptSiteSelection(_0x436e55,_0x4261a4,_0x5b5126(0xe0));if(!_0x4afb42)return 0x1;const _0x3a40f7=resolveSite(_0x4afb42);if(isOAuthSupported(_0x3a40f7)){const _0x2af1e3=await a7_0x4acc4a({'type':_0x5b5126(0xe7),'name':_0x5b5126(0xe6),'message':_0x5b5126(0x106),'choices':[{'title':_0x5b5126(0x10f),'value':_0x5b5126(0x104)},{'title':_0x5b5126(0xcb),'value':_0x5b5126(0xcc)}]});if(!_0x2af1e3['method'])return console['log'](_0x5b5126(0x112)),0x1;if(_0x2af1e3[_0x5b5126(0xe6)]==='oauth')return await runOAuthLoginFlow(_0x3a40f7,_0x4261a4,_0x126a21[_0x5b5126(0x10c)]??LogLevel['ERROR']),0x0;}console['log'](_0x5b5126(0xf9)+_0x3a40f7),console[_0x5b5126(0xf1)](_0x5b5126(0xd7)),console[_0x5b5126(0xf1)]('\x20\x20'+getConsoleUrl(_0x3a40f7,_0x5b5126(0x10b)));const _0x2efe7c=await a7_0x4acc4a({'type':'password','name':_0x5b5126(0xe9),'message':_0x5b5126(0xf3),'validate':_0x4e1526=>{const _0x5b830f=_0x5b5126;if(!_0x4e1526||!_0x4e1526[_0x5b830f(0x117)]())return _0x5b830f(0xc9);return!![];}});if(!_0x2efe7c[_0x5b5126(0xe9)])return console[_0x5b5126(0xf1)](_0x5b5126(0x112)),0x1;const _0x5681e6=_0x2efe7c[_0x5b5126(0xe9)];console[_0x5b5126(0xf1)](_0x5b5126(0xe5));try{const _0x97ef91=TDX['create']({'site':_0x3a40f7,'apiKey':_0x5681e6[_0x5b5126(0x117)](),'logLevel':_0x126a21[_0x5b5126(0x10c)]??LogLevel['ERROR']}),_0x242070=await _0x97ef91[_0x5b5126(0xe1)][_0x5b5126(0xca)]();console['log'](_0x5b5126(0xd4)+_0x242070[_0x5b5126(0x100)]+')');const _0x4357a9=await isKeychainAvailable();_0x4357a9?(await saveAPIKeyAsync(_0x5681e6[_0x5b5126(0x117)](),_0x3a40f7,_0x4261a4),console['log']('✓\x20API\x20key\x20saved\x20to\x20system\x20keychain'+(_0x4261a4?_0x5b5126(0xfb)+_0x4261a4+')':''))):(console[_0x5b5126(0x101)](a7_0xe9efc8['yellow']('⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.')),console[_0x5b5126(0x101)](a7_0xe9efc8[_0x5b5126(0xd0)](_0x5b5126(0x107))));if(_0x4261a4){const _0x4802bd={'site':_0x3a40f7};saveProfileToUserConfig(_0x4261a4,_0x4802bd),console[_0x5b5126(0xf1)]('✓\x20Profile\x20\x27'+_0x4261a4+_0x5b5126(0x111));}else saveDefaultSiteToUserConfig(_0x3a40f7),console['log'](_0x5b5126(0xcd)+_0x3a40f7);const _0x28f79a=_0x4261a4?_0x5b5126(0x110)+_0x4261a4:'';return console[_0x5b5126(0xf1)](),console['log'](_0x5b5126(0xff)),console[_0x5b5126(0xf1)]('\x20\x20tdx'+_0x28f79a+_0x5b5126(0xf0)),console[_0x5b5126(0xf1)](_0x5b5126(0xd9)+_0x28f79a+_0x5b5126(0xfa)),0x0;}catch(_0x35cdd9){if(_0x35cdd9 instanceof HTTPClientError&&_0x35cdd9[_0x5b5126(0xd2)]===0x191)return printAuthError(_0x35cdd9),0x1;return console[_0x5b5126(0xd5)](a7_0xe9efc8[_0x5b5126(0x10d)]('✗\x20Validation\x20failed:\x20'+(_0x35cdd9 instanceof Error?_0x35cdd9['message']:String(_0x35cdd9)))),console[_0x5b5126(0xd5)](_0x5b5126(0x116)),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x5ca324(0xe3)]=a7_0x5ca324(0xd3);['description']=a7_0x5ca324(0xd8);async['execute'](_0x4ea85a){const _0x8319d=a7_0x5ca324,{options:_0x5b21d6,tdx:_0x4dd0d5}=_0x4ea85a,_0x4815fc=_0x5b21d6[_0x8319d(0xfe)],_0x2f7fa2=_0x5b21d6[_0x8319d(0x102)],_0x529d6a=_0x2f7fa2?_0x2f7fa2:_0x8319d(0xef);console[_0x8319d(0xf1)](_0x8319d(0x10a)+_0x529d6a+_0x8319d(0xe8)+_0x4815fc+')');const _0x1347f5=await getOAuthTokens(_0x2f7fa2);if(_0x1347f5)console['log'](_0x8319d(0xdd)),console['log'](_0x8319d(0xf7)+(_0x2f7fa2?_0x8319d(0xfb)+_0x2f7fa2+')':''));else{const _0x274056=await resolveAPIKeyAsync(_0x4815fc,_0x2f7fa2);if(_0x274056){const {source:_0x291a29,isDeprecated:_0x2b5074}=_0x274056,_0xb05103=_0x8319d(0xeb)+_0x291a29;console[_0x8319d(0xf1)](_0x2b5074?a7_0xe9efc8[_0x8319d(0xd0)](_0xb05103):_0xb05103);}else console[_0x8319d(0xf1)](a7_0xe9efc8[_0x8319d(0xd0)](_0x8319d(0x10e)));}try{const _0x3c1181=await _0x4dd0d5[_0x8319d(0xe1)][_0x8319d(0xca)]();return console[_0x8319d(0xf1)](a7_0xe9efc8[_0x8319d(0xe4)](_0x8319d(0xce))),console['log'](_0x8319d(0xd6)+_0x3c1181[_0x8319d(0x100)]),(_0x3c1181[_0x8319d(0xdf)]||_0x3c1181[_0x8319d(0xc8)])&&console[_0x8319d(0xf1)](_0x8319d(0xf6)+[_0x3c1181[_0x8319d(0xdf)],_0x3c1181[_0x8319d(0xc8)]][_0x8319d(0x105)](Boolean)[_0x8319d(0x103)]('\x20')),0x0;}catch(_0x11ffde){return _0x11ffde instanceof HTTPClientError&&_0x11ffde['status']===0x191?printAuthError(_0x11ffde,!![],_0x2f7fa2):console[_0x8319d(0xd5)](a7_0xe9efc8[_0x8319d(0x10d)]('✗\x20Validation\x20failed:\x20'+(_0x11ffde instanceof Error?_0x11ffde[_0x8319d(0xee)]:String(_0x11ffde)))),0x1;}}}export class AuthClearCommand extends BaseCommand{['name']='auth:clear';[a7_0x5ca324(0xfd)]=a7_0x5ca324(0xea);async['execute'](_0x23c213){const _0x32b60f=a7_0x5ca324,{options:_0x5345c9}=_0x23c213,_0x2ebe49=_0x5345c9[_0x32b60f(0x102)];console[_0x32b60f(0xf1)](a7_0xe9efc8['bold']('tdx:\x20auth\x20clear'));const _0x4d18ec=await isKeychainAvailable();if(!_0x4d18ec)return console['error'](a7_0xe9efc8[_0x32b60f(0x10d)]('System\x20keychain\x20is\x20not\x20available')),0x1;const [_0x34cf02,_0x2516e1]=await Promise['all']([deleteKeychainAPIKey(_0x2ebe49),deleteOAuthTokens(_0x2ebe49)]);if(_0x34cf02||_0x2516e1){clearCredentialCache();const _0x11a7ba=[_0x34cf02&&_0x32b60f(0xcf),_0x2516e1&&_0x32b60f(0x115)]['filter'](Boolean)[_0x32b60f(0x103)](_0x32b60f(0xf8));return console[_0x32b60f(0xf1)]('✓\x20'+_0x11a7ba+_0x32b60f(0xf4)+(_0x2ebe49?_0x32b60f(0xfb)+_0x2ebe49+')':'')),0x0;}else return console[_0x32b60f(0xf1)](_0x32b60f(0xdc)+(_0x2ebe49?'\x20for\x20profile:\x20'+_0x2ebe49:'')),0x1;}}
1
+ const a7_0x509b89=a7_0x549f;(function(_0x52b013,_0x1fcad6){const _0x1a3e7d=a7_0x549f,_0x50b837=_0x52b013();while(!![]){try{const _0xef1518=parseInt(_0x1a3e7d(0x12b))/0x1+parseInt(_0x1a3e7d(0x15d))/0x2*(-parseInt(_0x1a3e7d(0x137))/0x3)+-parseInt(_0x1a3e7d(0x111))/0x4*(-parseInt(_0x1a3e7d(0x11f))/0x5)+-parseInt(_0x1a3e7d(0x145))/0x6*(-parseInt(_0x1a3e7d(0x135))/0x7)+parseInt(_0x1a3e7d(0x13d))/0x8*(-parseInt(_0x1a3e7d(0x12f))/0x9)+parseInt(_0x1a3e7d(0x150))/0xa+-parseInt(_0x1a3e7d(0x12c))/0xb*(-parseInt(_0x1a3e7d(0x13e))/0xc);if(_0xef1518===_0x1fcad6)break;else _0x50b837['push'](_0x50b837['shift']());}catch(_0x1d4779){_0x50b837['push'](_0x50b837['shift']());}}}(a7_0x43c4,0xbc090));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens}from'../core/oauth-keychain.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';function a7_0x549f(_0x1845b0,_0x5cf19c){_0x1845b0=_0x1845b0-0x10f;const _0x43c470=a7_0x43c4();let _0x549f47=_0x43c470[_0x1845b0];return _0x549f47;}import{deleteOAuthTokens}from'../core/oauth-keychain.js';function a7_0x43c4(){const _0x33083b=['\x27\x20registered','7gzHoMB','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','423guOPhx','name','tdx:\x20auth\x20clear','email','create','select','3976hstUty','60sADiVK','logLevel','Setup\x20API\x20key\x20authentication\x20interactively','Setup\x20cancelled','Read\x20credential\x20from\x20keychain','\x0aSetup\x20cancelled','Credential\x20type:\x20OAuth','2624586MJAznr','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','✗\x20Validation\x20failed:\x20','\x20and\x20','execute','log','API\x20Key','green','yellow','oauth','apiKey','8353960xumWAQ','\x20removed\x20from\x20keychain','OAuth\x20(browser\x20login)','error','auth:setup','description','User:\x20','Remove\x20API\x20key\x20from\x20system\x20keychain','Validating\x20API\x20key...','\x20--profile\x20','warn','You\x20can\x20find\x20your\x20API\x20key\x20at:','auth','16364maTaNk','status','profile','OAuth\x20tokens','API\x20key\x20cannot\x20be\x20empty','13028SkzTBY','/app/mp/ak','API\x20key','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','first_name','No\x20credentials\x20found\x20in\x20keychain','\x20(profile:\x20','Name:\x20','✓\x20Profile\x20\x27','Read\x20credential\x20from\x20','method','bold','site','ERROR','1455EgJemZ','\x20for\x20profile:\x20','red','join','Choose\x20authentication\x20method:','trim','tdx:\x20auth\x20setup','\x20(site:\x20','message','N/A','tdx\x20profile:\x20','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','316038RpNWJP','662607NDQGos','filter','apikey','16551jBvvdn','\x20\x20tdx','✓\x20Default\x20site\x20set\x20to\x20','last_name','auth:clear'];a7_0x43c4=function(){return _0x33083b;};return a7_0x43c4();}import{clearCredentialCache}from'../core/credential-cache.js';import{isOAuthSupported}from'../core/oauth.js';import{runOAuthLoginFlow}from'./auth-login-command.js';import{promptSiteSelection}from'../core/constants.js';import a7_0x38b3b9 from'prompts';import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a7_0x3ba4c3 from'chalk';export class AuthSetupCommand extends BaseCommand{[a7_0x509b89(0x138)]=a7_0x509b89(0x154);['description']=a7_0x509b89(0x140);async[a7_0x509b89(0x149)](_0x4238d5){const _0x3baee7=a7_0x509b89,{options:_0x4af7c9}=_0x4238d5,_0x5c6f4a=_0x4af7c9[_0x3baee7(0x15f)];console['log'](a7_0x3ba4c3[_0x3baee7(0x11c)](_0x3baee7(0x125)));const _0x2418d6=_0x4af7c9[_0x3baee7(0x11d)]||'us01',_0x3fe852=await promptSiteSelection(_0x2418d6,_0x5c6f4a,_0x3baee7(0x141));if(!_0x3fe852)return 0x1;const _0x2a2de6=resolveSite(_0x3fe852);if(isOAuthSupported(_0x2a2de6)){const _0x3f1a1e=await a7_0x38b3b9({'type':_0x3baee7(0x13c),'name':_0x3baee7(0x11b),'message':_0x3baee7(0x123),'choices':[{'title':_0x3baee7(0x152),'value':_0x3baee7(0x14e)},{'title':_0x3baee7(0x14b),'value':_0x3baee7(0x12e)}]});if(!_0x3f1a1e['method'])return console[_0x3baee7(0x14a)](_0x3baee7(0x143)),0x1;if(_0x3f1a1e[_0x3baee7(0x11b)]===_0x3baee7(0x14e))return await runOAuthLoginFlow(_0x2a2de6,_0x5c6f4a,_0x4af7c9[_0x3baee7(0x13f)]??LogLevel[_0x3baee7(0x11e)]),0x0;}console[_0x3baee7(0x14a)]('Setting\x20up\x20authentication\x20for\x20site:\x20'+_0x2a2de6),console[_0x3baee7(0x14a)](_0x3baee7(0x15b)),console[_0x3baee7(0x14a)]('\x20\x20'+getConsoleUrl(_0x2a2de6,_0x3baee7(0x112)));const _0x5d4132=await a7_0x38b3b9({'type':'password','name':_0x3baee7(0x14f),'message':'Enter\x20your\x20TD\x20API\x20key:','validate':_0x561d54=>{const _0x54ff58=_0x3baee7;if(!_0x561d54||!_0x561d54[_0x54ff58(0x124)]())return _0x54ff58(0x110);return!![];}});if(!_0x5d4132[_0x3baee7(0x14f)])return console[_0x3baee7(0x14a)](_0x3baee7(0x143)),0x1;const _0x244e99=_0x5d4132['apiKey'];console[_0x3baee7(0x14a)](_0x3baee7(0x158));try{const _0xa82899=TDX[_0x3baee7(0x13b)]({'site':_0x2a2de6,'apiKey':_0x244e99['trim'](),'logLevel':_0x4af7c9[_0x3baee7(0x13f)]??LogLevel[_0x3baee7(0x11e)]}),_0x2ac3da=await _0xa82899['jobs']['getUserInfo']();console[_0x3baee7(0x14a)]('✓\x20API\x20key\x20is\x20valid\x20(User:\x20'+_0x2ac3da[_0x3baee7(0x13a)]+')');const _0x584f05=await isKeychainAvailable();_0x584f05?(await saveAPIKeyAsync(_0x244e99['trim'](),_0x2a2de6,_0x5c6f4a),console[_0x3baee7(0x14a)]('✓\x20API\x20key\x20saved\x20to\x20system\x20keychain'+(_0x5c6f4a?_0x3baee7(0x117)+_0x5c6f4a+')':''))):(console[_0x3baee7(0x15a)](a7_0x3ba4c3[_0x3baee7(0x14d)]('⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.')),console['warn'](a7_0x3ba4c3['yellow'](_0x3baee7(0x136))));if(_0x5c6f4a){const _0x25d684={'site':_0x2a2de6};saveProfileToUserConfig(_0x5c6f4a,_0x25d684),console[_0x3baee7(0x14a)](_0x3baee7(0x119)+_0x5c6f4a+_0x3baee7(0x134));}else saveDefaultSiteToUserConfig(_0x2a2de6),console[_0x3baee7(0x14a)](_0x3baee7(0x131)+_0x2a2de6);const _0xa6d362=_0x5c6f4a?_0x3baee7(0x159)+_0x5c6f4a:'';return console[_0x3baee7(0x14a)](),console[_0x3baee7(0x14a)]('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console['log'](_0x3baee7(0x130)+_0xa6d362+_0x3baee7(0x146)),console[_0x3baee7(0x14a)](_0x3baee7(0x130)+_0xa6d362+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases'),0x0;}catch(_0x1daacd){if(_0x1daacd instanceof HTTPClientError&&_0x1daacd[_0x3baee7(0x15e)]===0x191)return printAuthError(_0x1daacd),0x1;return console[_0x3baee7(0x153)](a7_0x3ba4c3['red']('✗\x20Validation\x20failed:\x20'+(_0x1daacd instanceof Error?_0x1daacd[_0x3baee7(0x127)]:String(_0x1daacd)))),console[_0x3baee7(0x153)](_0x3baee7(0x12a)),0x1;}}}export class AuthStatusCommand extends BaseCommand{['name']=a7_0x509b89(0x15c);[a7_0x509b89(0x155)]=a7_0x509b89(0x114);async['execute'](_0x5668bd){const _0x10489f=a7_0x509b89,{options:_0x4cc969,tdx:_0x2495b9}=_0x5668bd,_0x72ec69=_0x4cc969[_0x10489f(0x11d)],_0x3b3af4=_0x4cc969['profile'],_0x2d42c3=_0x3b3af4?_0x3b3af4:_0x10489f(0x128);console['log'](_0x10489f(0x129)+_0x2d42c3+_0x10489f(0x126)+_0x72ec69+')');const _0x41eb13=await getOAuthTokens(_0x3b3af4);if(_0x41eb13)console['log'](_0x10489f(0x144)),console[_0x10489f(0x14a)](_0x10489f(0x142)+(_0x3b3af4?_0x10489f(0x117)+_0x3b3af4+')':''));else{const _0x53ef4f=await resolveAPIKeyAsync(_0x72ec69,_0x3b3af4);if(_0x53ef4f){const {source:_0x40c16,isDeprecated:_0x3db27c}=_0x53ef4f,_0x5b8d5e=_0x10489f(0x11a)+_0x40c16;console['log'](_0x3db27c?a7_0x3ba4c3[_0x10489f(0x14d)](_0x5b8d5e):_0x5b8d5e);}else console[_0x10489f(0x14a)](a7_0x3ba4c3[_0x10489f(0x14d)]('No\x20credential\x20found'));}try{const _0xbf3403=await _0x2495b9['jobs']['getUserInfo']();return console['log'](a7_0x3ba4c3[_0x10489f(0x14c)]('✓\x20Authentication\x20successful\x0a')),console[_0x10489f(0x14a)](_0x10489f(0x156)+_0xbf3403[_0x10489f(0x13a)]),(_0xbf3403[_0x10489f(0x115)]||_0xbf3403[_0x10489f(0x132)])&&console[_0x10489f(0x14a)](_0x10489f(0x118)+[_0xbf3403['first_name'],_0xbf3403[_0x10489f(0x132)]][_0x10489f(0x12d)](Boolean)['join']('\x20')),0x0;}catch(_0x486a2c){return _0x486a2c instanceof HTTPClientError&&_0x486a2c['status']===0x191?printAuthError(_0x486a2c,!![],_0x3b3af4):console[_0x10489f(0x153)](a7_0x3ba4c3[_0x10489f(0x121)](_0x10489f(0x147)+(_0x486a2c instanceof Error?_0x486a2c[_0x10489f(0x127)]:String(_0x486a2c)))),0x1;}}}export class AuthClearCommand extends BaseCommand{['name']=a7_0x509b89(0x133);['description']=a7_0x509b89(0x157);async[a7_0x509b89(0x149)](_0x4c72b5){const _0x1d9e0e=a7_0x509b89,{options:_0x21573b}=_0x4c72b5,_0x11ac52=_0x21573b[_0x1d9e0e(0x15f)];console['log'](a7_0x3ba4c3['bold'](_0x1d9e0e(0x139)));const _0x5ac91b=await isKeychainAvailable();if(!_0x5ac91b)return console['error'](a7_0x3ba4c3[_0x1d9e0e(0x121)]('System\x20keychain\x20is\x20not\x20available')),0x1;const [_0x402a74,_0x13fa0e]=await Promise['all']([deleteKeychainAPIKey(_0x11ac52),deleteOAuthTokens(_0x11ac52)]);if(_0x402a74||_0x13fa0e){clearCredentialCache();const _0x343751=[_0x402a74&&_0x1d9e0e(0x113),_0x13fa0e&&_0x1d9e0e(0x10f)]['filter'](Boolean)[_0x1d9e0e(0x122)](_0x1d9e0e(0x148));return console[_0x1d9e0e(0x14a)]('✓\x20'+_0x343751+_0x1d9e0e(0x151)+(_0x11ac52?_0x1d9e0e(0x117)+_0x11ac52+')':'')),0x0;}else return console['log'](_0x1d9e0e(0x116)+(_0x11ac52?_0x1d9e0e(0x120)+_0x11ac52:'')),0x1;}}
@@ -1 +1 @@
1
- const a8_0x1ed0fa=a8_0x5cc7;(function(_0x2c2f94,_0x1e1b28){const _0x156905=a8_0x5cc7,_0x382646=_0x2c2f94();while(!![]){try{const _0x1ddbb9=parseInt(_0x156905(0x81))/0x1*(-parseInt(_0x156905(0x89))/0x2)+parseInt(_0x156905(0x97))/0x3*(parseInt(_0x156905(0x88))/0x4)+-parseInt(_0x156905(0x8c))/0x5*(-parseInt(_0x156905(0x83))/0x6)+-parseInt(_0x156905(0xa5))/0x7+parseInt(_0x156905(0xa1))/0x8+parseInt(_0x156905(0xa0))/0x9*(-parseInt(_0x156905(0xa6))/0xa)+-parseInt(_0x156905(0x85))/0xb*(parseInt(_0x156905(0xaa))/0xc);if(_0x1ddbb9===_0x1e1b28)break;else _0x382646['push'](_0x382646['shift']());}catch(_0x1a12a8){_0x382646['push'](_0x382646['shift']());}}}(a8_0x4997,0xa9ea7));import{BaseCommand}from'./command.js';import{resolveSite}from'../core/config.js';import{saveProfileToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{isKeychainAvailable}from'../core/keychain.js';import{saveOAuthTokens}from'../core/oauth-keychain.js';import{startOAuthFlow,isOAuthSupported}from'../core/oauth.js';import{promptSiteSelection}from'../core/constants.js';function a8_0x4997(){const _0x180932=['OAuth\x20login\x20is\x20not\x20yet\x20available\x20for\x20site:\x20','2081871UTtQqD','site','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','✓\x20Authentication\x20successful\x20(User:\x20','tdx:\x20auth\x20login','Opening\x20browser\x20for\x20authentication...','us01','logLevel','✓\x20Profile\x20\x27','5175WJhiVd','8414432OGFiGi','green','\x20\x20tdx','Validating\x20OAuth\x20tokens...','3393880XPsWQJ','18790UtFZbi','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','jobs','getUserInfo','4792836pLTWkU','1hbWtfs','Authenticating\x20via\x20OAuth\x20for\x20site:\x20','3967686ZmLRag','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','11Kuhxhk','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','auth:login','8XBgtTx','2203274ztAUNi','\x20--profile\x20','\x27\x20registered','10dTnBUc','name','description','log','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','create','OAuth\x20is\x20currently\x20supported\x20on\x20dev-us01\x20and\x20dev-eu01\x20only.\x20','email','/oauth/authorize','Login\x20cancelled'];a8_0x4997=function(){return _0x180932;};return a8_0x4997();}import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a8_0x2ad7fc from'chalk';function a8_0x5cc7(_0x5749c8,_0x3fc02a){_0x5749c8=_0x5749c8-0x81;const _0x49970a=a8_0x4997();let _0x5cc731=_0x49970a[_0x5749c8];return _0x5cc731;}export async function runOAuthLoginFlow(_0x54e7bb,_0x345a36,_0x515a21){const _0x4d0c38=a8_0x5cc7;if(!isOAuthSupported(_0x54e7bb))throw new Error(_0x4d0c38(0x96)+_0x54e7bb+'.\x20'+_0x4d0c38(0x92)+_0x4d0c38(0x90));const _0x78276a=await isKeychainAvailable();if(!_0x78276a)throw new Error(_0x4d0c38(0xa7)+_0x4d0c38(0x90));const _0x1998e6=getConsoleUrl(_0x54e7bb);console[_0x4d0c38(0x8f)](_0x4d0c38(0x9c)),console[_0x4d0c38(0x8f)]('\x20\x20'+_0x1998e6+_0x4d0c38(0x94)),console[_0x4d0c38(0x8f)]('Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...');const _0xae4cbe=await startOAuthFlow(_0x54e7bb);console['log'](_0x4d0c38(0xa4));const _0x2892e4=TDX[_0x4d0c38(0x91)]({'site':_0x54e7bb,'accessToken':_0xae4cbe['access_token'],'logLevel':_0x515a21??LogLevel['ERROR']}),_0x1d1a00=await _0x2892e4[_0x4d0c38(0xa8)][_0x4d0c38(0xa9)]();console[_0x4d0c38(0x8f)](a8_0x2ad7fc[_0x4d0c38(0xa2)](_0x4d0c38(0x9a)+_0x1d1a00[_0x4d0c38(0x93)]+')')),await saveOAuthTokens(_0xae4cbe,_0x345a36),console[_0x4d0c38(0x8f)]('✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain'+(_0x345a36?'\x20(profile:\x20'+_0x345a36+')':''));if(_0x345a36){const _0x2f53fc={'site':_0x54e7bb};saveProfileToUserConfig(_0x345a36,_0x2f53fc),console['log'](_0x4d0c38(0x9f)+_0x345a36+_0x4d0c38(0x8b));}const _0x3fed34=_0x345a36?_0x4d0c38(0x8a)+_0x345a36:'';console[_0x4d0c38(0x8f)](),console[_0x4d0c38(0x8f)](_0x4d0c38(0x99)),console[_0x4d0c38(0x8f)](_0x4d0c38(0xa3)+_0x3fed34+_0x4d0c38(0x86)),console['log'](_0x4d0c38(0xa3)+_0x3fed34+_0x4d0c38(0x84));}export class AuthLoginCommand extends BaseCommand{[a8_0x1ed0fa(0x8d)]=a8_0x1ed0fa(0x87);[a8_0x1ed0fa(0x8e)]='Login\x20via\x20OAuth\x20(opens\x20browser)';async['execute'](_0x592069){const _0x16c376=a8_0x1ed0fa,{options:_0x9881f9}=_0x592069,_0x40f44d=_0x9881f9['profile'];console[_0x16c376(0x8f)](a8_0x2ad7fc['bold'](_0x16c376(0x9b)));const _0x276540=_0x9881f9[_0x16c376(0x98)]||_0x16c376(0x9d),_0x4961cc=await promptSiteSelection(_0x276540,_0x40f44d,_0x16c376(0x95));if(!_0x4961cc)return 0x1;const _0x10ebca=resolveSite(_0x4961cc);return console[_0x16c376(0x8f)](_0x16c376(0x82)+_0x10ebca),await runOAuthLoginFlow(_0x10ebca,_0x40f44d,_0x9881f9[_0x16c376(0x9e)]??LogLevel['ERROR']),0x0;}}
1
+ function a8_0x2a9c(_0xb822f3,_0x3639a7){_0xb822f3=_0xb822f3-0x136;const _0x394d89=a8_0x394d();let _0x2a9cec=_0x394d89[_0xb822f3];return _0x2a9cec;}const a8_0x48d9d7=a8_0x2a9c;(function(_0x4041e7,_0x583a52){const _0x4ede3c=a8_0x2a9c,_0x3db487=_0x4041e7();while(!![]){try{const _0x320444=-parseInt(_0x4ede3c(0x157))/0x1+-parseInt(_0x4ede3c(0x137))/0x2+-parseInt(_0x4ede3c(0x151))/0x3+parseInt(_0x4ede3c(0x14c))/0x4+-parseInt(_0x4ede3c(0x155))/0x5*(parseInt(_0x4ede3c(0x15c))/0x6)+-parseInt(_0x4ede3c(0x156))/0x7*(parseInt(_0x4ede3c(0x140))/0x8)+-parseInt(_0x4ede3c(0x139))/0x9*(-parseInt(_0x4ede3c(0x13e))/0xa);if(_0x320444===_0x583a52)break;else _0x3db487['push'](_0x3db487['shift']());}catch(_0x24d18d){_0x3db487['push'](_0x3db487['shift']());}}}(a8_0x394d,0x868f9));import{BaseCommand}from'./command.js';import{resolveSite}from'../core/config.js';function a8_0x394d(){const _0xb7af7d=['Authenticating\x20via\x20OAuth\x20for\x20site:\x20','✓\x20Profile\x20\x27','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','290tVJftb','7eAIKSt','299636scbGyx','log','execute','site','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','38262ajuSnx','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain','\x20(profile:\x20','1466688QSXKzV','logLevel','390078glHcSC','\x20\x20tdx','access_token','Login\x20via\x20OAuth\x20(opens\x20browser)','us01','620hMCnjR','create','1718536dCnMYL','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','/oauth/authorize','name','\x27\x20registered','Opening\x20browser\x20for\x20authentication...','OAuth\x20login\x20is\x20not\x20yet\x20available\x20for\x20site:\x20','email','Login\x20cancelled','Validating\x20OAuth\x20tokens...','jobs','getUserInfo','763580eavGZX','\x20--profile\x20','description','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','ERROR','2127825dTwlgu'];a8_0x394d=function(){return _0xb7af7d;};return a8_0x394d();}import{saveProfileToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{isKeychainAvailable}from'../core/keychain.js';import{saveOAuthTokens}from'../core/oauth-keychain.js';import{startOAuthFlow,isOAuthSupported}from'../core/oauth.js';import{promptSiteSelection}from'../core/constants.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a8_0x41bced from'chalk';export async function runOAuthLoginFlow(_0x15271c,_0x1687eb,_0x5842ec){const _0x57d228=a8_0x2a9c;if(!isOAuthSupported(_0x15271c))throw new Error(_0x57d228(0x146)+_0x15271c+'.\x20'+'OAuth\x20is\x20currently\x20supported\x20on\x20dev-us01\x20and\x20dev-eu01\x20only.\x20'+'Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.');const _0x4bd64b=await isKeychainAvailable();if(!_0x4bd64b)throw new Error(_0x57d228(0x141)+_0x57d228(0x15b));const _0x26c68a=getConsoleUrl(_0x15271c);console[_0x57d228(0x158)](_0x57d228(0x145)),console[_0x57d228(0x158)]('\x20\x20'+_0x26c68a+_0x57d228(0x142)),console[_0x57d228(0x158)](_0x57d228(0x14f));const _0x410fc9=await startOAuthFlow(_0x15271c);console[_0x57d228(0x158)](_0x57d228(0x149));const _0x30b3e6=TDX[_0x57d228(0x13f)]({'site':_0x15271c,'accessToken':_0x410fc9[_0x57d228(0x13b)],'logLevel':_0x5842ec??LogLevel['ERROR']}),_0x23d9b0=await _0x30b3e6[_0x57d228(0x14a)][_0x57d228(0x14b)]();console[_0x57d228(0x158)](a8_0x41bced['green']('✓\x20Authentication\x20successful\x20(User:\x20'+_0x23d9b0[_0x57d228(0x147)]+')')),await saveOAuthTokens(_0x410fc9,_0x1687eb),console[_0x57d228(0x158)](_0x57d228(0x15d)+(_0x1687eb?_0x57d228(0x136)+_0x1687eb+')':''));if(_0x1687eb){const _0x2fc337={'site':_0x15271c};saveProfileToUserConfig(_0x1687eb,_0x2fc337),console[_0x57d228(0x158)](_0x57d228(0x153)+_0x1687eb+_0x57d228(0x144));}const _0x1c2baf=_0x1687eb?_0x57d228(0x14d)+_0x1687eb:'';console[_0x57d228(0x158)](),console[_0x57d228(0x158)]('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console['log']('\x20\x20tdx'+_0x1c2baf+_0x57d228(0x154)),console['log'](_0x57d228(0x13a)+_0x1c2baf+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases');}export class AuthLoginCommand extends BaseCommand{[a8_0x48d9d7(0x143)]='auth:login';[a8_0x48d9d7(0x14e)]=a8_0x48d9d7(0x13c);async[a8_0x48d9d7(0x159)](_0x10ffc3){const _0xb22dbb=a8_0x48d9d7,{options:_0x459845}=_0x10ffc3,_0x15eaa5=_0x459845['profile'];console['log'](a8_0x41bced['bold']('tdx:\x20auth\x20login'));const _0x14041b=_0x459845[_0xb22dbb(0x15a)]||_0xb22dbb(0x13d),_0x4fe5df=await promptSiteSelection(_0x14041b,_0x15eaa5,_0xb22dbb(0x148));if(!_0x4fe5df)return 0x1;const _0x5d83ed=resolveSite(_0x4fe5df);return console[_0xb22dbb(0x158)](_0xb22dbb(0x152)+_0x5d83ed),await runOAuthLoginFlow(_0x5d83ed,_0x15eaa5,_0x459845[_0xb22dbb(0x138)]??LogLevel[_0xb22dbb(0x150)]),0x0;}}