@treasuredata/tdx 2026.3.6 → 2026.3.7

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 (201) 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/profile-command.js +1 -1
  34. package/dist/commands/profiles-command.js +1 -1
  35. package/dist/commands/query-command.js +1 -1
  36. package/dist/commands/schedule-command.js +1 -1
  37. package/dist/commands/segment-command.js +1 -1
  38. package/dist/commands/segment-create-command.js +1 -1
  39. package/dist/commands/segment-fields-command.js +1 -1
  40. package/dist/commands/segment-pull-command.js +1 -1
  41. package/dist/commands/segment-push-command.js +1 -1
  42. package/dist/commands/segment-update-command.js +1 -1
  43. package/dist/commands/segment-use-command.js +1 -1
  44. package/dist/commands/segment-validate-command.js +1 -1
  45. package/dist/commands/segments.js +1 -1
  46. package/dist/commands/show.js +1 -1
  47. package/dist/commands/status-command.js +1 -1
  48. package/dist/commands/tables.js +1 -1
  49. package/dist/commands/unset-command.js +1 -1
  50. package/dist/commands/upgrade-command.js +1 -1
  51. package/dist/commands/use-command.js +1 -1
  52. package/dist/commands/user-command.js +1 -1
  53. package/dist/commands/workflow-command.js +1 -1
  54. package/dist/core/auth.js +1 -1
  55. package/dist/core/command-output.js +1 -1
  56. package/dist/core/config.js +1 -1
  57. package/dist/core/connection-cache.js +1 -1
  58. package/dist/core/constants.js +1 -1
  59. package/dist/core/credential-cache.js +1 -1
  60. package/dist/core/global-context.js +1 -1
  61. package/dist/core/keychain.js +1 -1
  62. package/dist/core/oauth-keychain.js +1 -1
  63. package/dist/core/oauth.js +1 -1
  64. package/dist/core/profile.js +1 -1
  65. package/dist/core/project-config.js +1 -1
  66. package/dist/core/session.js +1 -1
  67. package/dist/core/user-cache.js +1 -1
  68. package/dist/core/version.js +1 -1
  69. package/dist/index.js +1 -1
  70. package/dist/mcp/server.js +1 -1
  71. package/dist/mcp/tools/index.js +1 -1
  72. package/dist/mcp/tools/tdx-run.js +1 -1
  73. package/dist/mcp/tools/tdx-search.js +1 -1
  74. package/dist/mcp/utils.js +1 -1
  75. package/dist/proxy/claude-usage-tracker.js +1 -1
  76. package/dist/proxy/passthrough-server.js +1 -1
  77. package/dist/proxy/sse-usage-parser.js +1 -1
  78. package/dist/sdk/agent/agent-config.js +1 -1
  79. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  80. package/dist/sdk/agent/agent-yaml.js +1 -1
  81. package/dist/sdk/agent/test/evaluator.js +1 -1
  82. package/dist/sdk/agent/test/executor.js +1 -1
  83. package/dist/sdk/agent/test/index.js +1 -1
  84. package/dist/sdk/agent/test/output.js +1 -1
  85. package/dist/sdk/agent/test/parser.js +1 -1
  86. package/dist/sdk/agent/tool-target-registry.js +1 -1
  87. package/dist/sdk/api.js +1 -1
  88. package/dist/sdk/client/cdp-api-client.js +1 -1
  89. package/dist/sdk/client/delivery-api-client.js +1 -1
  90. package/dist/sdk/client/endpoints.js +1 -1
  91. package/dist/sdk/client/engage-api-client.js +1 -1
  92. package/dist/sdk/client/http-client.js +1 -1
  93. package/dist/sdk/client/llm-api-client.js +1 -1
  94. package/dist/sdk/client/oauth-refresh.js +1 -1
  95. package/dist/sdk/client/rate-limiter.js +1 -1
  96. package/dist/sdk/client/td-api-client.js +1 -1
  97. package/dist/sdk/client/trino-api-client.js +1 -1
  98. package/dist/sdk/client/workflow-client.js +1 -1
  99. package/dist/sdk/connection-validator.js +1 -1
  100. package/dist/sdk/connection.js +1 -1
  101. package/dist/sdk/delivery.js +1 -1
  102. package/dist/sdk/engage/campaign-pull.js +1 -1
  103. package/dist/sdk/engage/campaign-push.js +1 -1
  104. package/dist/sdk/engage/campaign-validator.js +1 -1
  105. package/dist/sdk/engage/campaign-yaml.js +1 -1
  106. package/dist/sdk/engage/template-pull.js +1 -1
  107. package/dist/sdk/engage/template-push.js +1 -1
  108. package/dist/sdk/engage/template-validator.js +1 -1
  109. package/dist/sdk/engage/template-yaml.js +1 -1
  110. package/dist/sdk/engage/types/campaign-def.js +1 -1
  111. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  112. package/dist/sdk/engage/types/template-schema.js +1 -1
  113. package/dist/sdk/engage.js +1 -1
  114. package/dist/sdk/errors.js +1 -1
  115. package/dist/sdk/index.js +1 -1
  116. package/dist/sdk/io/index.js +1 -1
  117. package/dist/sdk/io/node-filesystem.js +1 -1
  118. package/dist/sdk/job.js +1 -1
  119. package/dist/sdk/journey.js +1 -1
  120. package/dist/sdk/llm/chat-cache.js +1 -1
  121. package/dist/sdk/llm/index.js +1 -1
  122. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  123. package/dist/sdk/llm/model-factors.js +1 -1
  124. package/dist/sdk/personalization.js +1 -1
  125. package/dist/sdk/query/index.js +1 -1
  126. package/dist/sdk/query/sql-parser.js +1 -1
  127. package/dist/sdk/realtime.js +1 -1
  128. package/dist/sdk/schedule.js +1 -1
  129. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  130. package/dist/sdk/segment/fields-display.js +1 -1
  131. package/dist/sdk/segment/file-discovery.js +1 -1
  132. package/dist/sdk/segment/journey-utils.js +1 -1
  133. package/dist/sdk/segment/journey-validator.js +1 -1
  134. package/dist/sdk/segment/journey-yaml.js +1 -1
  135. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  136. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  137. package/dist/sdk/segment/pull-workflow.js +1 -1
  138. package/dist/sdk/segment/push-recovery.js +1 -1
  139. package/dist/sdk/segment/push-workflow.js +1 -1
  140. package/dist/sdk/segment/resolution-context.js +1 -1
  141. package/dist/sdk/segment/segment-path-parser.js +1 -1
  142. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  143. package/dist/sdk/segment/segment-validator.js +1 -1
  144. package/dist/sdk/segment/target-resolution.js +1 -1
  145. package/dist/sdk/segment/tdx-config.js +1 -1
  146. package/dist/sdk/segment/types/activation-schema.js +1 -1
  147. package/dist/sdk/segment/types/journey-def.js +1 -1
  148. package/dist/sdk/segment/types/journey-schema.js +1 -1
  149. package/dist/sdk/segment/types/segment-def.js +1 -1
  150. package/dist/sdk/segment/types/segment-schema.js +1 -1
  151. package/dist/sdk/segment/validate-files.js +1 -1
  152. package/dist/sdk/segment/yaml-validator.js +1 -1
  153. package/dist/sdk/segment.js +1 -1
  154. package/dist/sdk/types/index.js +1 -1
  155. package/dist/sdk/types/progress.js +1 -1
  156. package/dist/sdk/user.js +1 -1
  157. package/dist/sdk/util/format-detector.js +1 -1
  158. package/dist/sdk/util/formatters.js +1 -1
  159. package/dist/sdk/util/index.js +1 -1
  160. package/dist/sdk/util/paginate.js +1 -1
  161. package/dist/sdk/util/tree-formatter.js +1 -1
  162. package/dist/sdk/workflow/archive-validation.js +1 -1
  163. package/dist/sdk/workflow/clone-workflow.js +1 -1
  164. package/dist/sdk/workflow/index.js +1 -1
  165. package/dist/sdk/workflow/pull-workflow.js +1 -1
  166. package/dist/sdk/workflow/push-workflow.js +1 -1
  167. package/dist/sdk/workflow/tdx-config.js +1 -1
  168. package/dist/sdk/workflow/workflow-utils.js +1 -1
  169. package/dist/test-utils/command-runner.js +1 -1
  170. package/dist/test-utils/factories.js +1 -1
  171. package/dist/test-utils/fixtures.js +1 -1
  172. package/dist/test-utils/http-mock.js +1 -1
  173. package/dist/test-utils/index.js +1 -1
  174. package/dist/utils/async.js +1 -1
  175. package/dist/utils/colors.js +1 -1
  176. package/dist/utils/diff.js +1 -1
  177. package/dist/utils/file-permissions.js +1 -1
  178. package/dist/utils/file-reader.js +1 -1
  179. package/dist/utils/github-releases.js +1 -1
  180. package/dist/utils/global-cache.js +1 -1
  181. package/dist/utils/json-loader.js +1 -1
  182. package/dist/utils/local-cache.js +1 -1
  183. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  184. package/dist/utils/logger/formatters/index.js +1 -1
  185. package/dist/utils/logger/handlers/console-handler.js +1 -1
  186. package/dist/utils/logger/handlers/file-handler.js +1 -1
  187. package/dist/utils/logger/handlers/index.js +1 -1
  188. package/dist/utils/logger/handlers/null-handler.js +1 -1
  189. package/dist/utils/logger/index.js +1 -1
  190. package/dist/utils/logger/logger.js +1 -1
  191. package/dist/utils/logger/types.js +1 -1
  192. package/dist/utils/option-validation.js +1 -1
  193. package/dist/utils/process.js +1 -1
  194. package/dist/utils/prompt.js +1 -1
  195. package/dist/utils/spinner.js +1 -1
  196. package/dist/utils/sse-parser.js +1 -1
  197. package/dist/utils/string-utils.js +1 -1
  198. package/dist/utils/table-ref-parser.js +1 -1
  199. package/dist/utils/tdx-logger.js +1 -1
  200. package/dist/utils/version-check.js +1 -1
  201. package/package.json +1 -1
@@ -1 +1 @@
1
- function a3_0x2c91(){const _0x9f204e=['Site:\x20','4184aNfejX','907752jsCBNB','description','execute','\x27...','Child\x20name:\x20','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','segment','Resolved\x20parent\x20ID:\x20','\x20\x20Cause:\x20','6jhWsAS','name','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','1517358gTSSZt','✔\x20Found\x20','189980GiSQAe','462602fkUeMr','activations','10979112bqTDIH','resolveParentId','Resolving\x20child\x20segment\x20\x27','List\x20activations\x20for\x20a\x20segment','Error:\x20Segment\x20name\x20is\x20required','data','listActivations','message','cause','site','error','verbose','resolveSegmentId','2888480IfEEjN','Resolved\x20child\x20ID:\x20'];a3_0x2c91=function(){return _0x9f204e;};return a3_0x2c91();}const a3_0x512405=a3_0x37f5;(function(_0x1c99f3,_0x1b0ae4){const _0x4e79c9=a3_0x37f5,_0x119acc=_0x1c99f3();while(!![]){try{const _0x1d1287=parseInt(_0x4e79c9(0x1ac))/0x1+parseInt(_0x4e79c9(0x1b9))/0x2+parseInt(_0x4e79c9(0x1ad))/0x3+parseInt(_0x4e79c9(0x1a9))/0x4+parseInt(_0x4e79c9(0x1bb))/0x5+-parseInt(_0x4e79c9(0x1b6))/0x6*(-parseInt(_0x4e79c9(0x1bc))/0x7)+-parseInt(_0x4e79c9(0x1be))/0x8;if(_0x1d1287===_0x1b0ae4)break;else _0x119acc['push'](_0x119acc['shift']());}catch(_0x55fbc0){_0x119acc['push'](_0x119acc['shift']());}}}(a3_0x2c91,0x7ec5c));import{BaseCommand}from'./command.js';function a3_0x37f5(_0x58625e,_0x3bcf66){_0x58625e=_0x58625e-0x1a0;const _0x2c9145=a3_0x2c91();let _0x37f5cf=_0x2c9145[_0x58625e];return _0x37f5cf;}import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';export class ActivationsCommand extends BaseCommand{[a3_0x512405(0x1b7)]=a3_0x512405(0x1bd);[a3_0x512405(0x1ae)]=a3_0x512405(0x1c1);async[a3_0x512405(0x1af)](_0x14231b){const _0x3f22d0=a3_0x512405,{options:_0x122f4a,args:_0x5af700,tdx:_0x3203b4}=_0x14231b;if(_0x5af700['length']===0x0)return console[_0x3f22d0(0x1a6)](_0x3f22d0(0x1a0)),console['error'](_0x3f22d0(0x1b2)),0x1;try{const {parentId:_0x4608be,childId:_0x367560}=parseSegmentRef(_0x5af700[0x0]);if(!_0x367560)return console[_0x3f22d0(0x1a6)](_0x3f22d0(0x1b8)),console[_0x3f22d0(0x1a6)]('Usage:\x20tdx\x20activations\x20<parent_name/child_name>'),0x1;_0x122f4a[_0x3f22d0(0x1a7)]&&(console[_0x3f22d0(0x1a6)](_0x3f22d0(0x1ab)+_0x122f4a[_0x3f22d0(0x1a5)]),console['error']('Parent\x20name:\x20'+_0x4608be),console[_0x3f22d0(0x1a6)](_0x3f22d0(0x1b1)+_0x367560));const _0x5bd651=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x4608be+'\x27...',()=>_0x3203b4[_0x3f22d0(0x1b3)][_0x3f22d0(0x1bf)](_0x4608be),{'verbose':_0x122f4a[_0x3f22d0(0x1a7)]}),_0x236ab5=_0x5bd651[_0x3f22d0(0x1a1)];_0x122f4a[_0x3f22d0(0x1a7)]&&console[_0x3f22d0(0x1a6)](_0x3f22d0(0x1b4)+_0x236ab5);const _0x59da43=await withSpinner(_0x3f22d0(0x1c0)+_0x367560+_0x3f22d0(0x1b0),()=>_0x3203b4[_0x3f22d0(0x1b3)][_0x3f22d0(0x1a8)](_0x236ab5,_0x367560),{'verbose':_0x122f4a['verbose']}),_0x26fc39=_0x59da43[_0x3f22d0(0x1a1)];_0x122f4a['verbose']&&console['error'](_0x3f22d0(0x1aa)+_0x26fc39);const _0x55e549=await withSpinner('Listing\x20activations\x20for\x20segment\x20\x27'+_0x367560+'\x27...',()=>_0x3203b4[_0x3f22d0(0x1b3)][_0x3f22d0(0x1a2)](_0x236ab5,_0x26fc39),{'verbose':_0x122f4a[_0x3f22d0(0x1a7)]}),_0x15fefa=_0x55e549[_0x3f22d0(0x1a1)];return console[_0x3f22d0(0x1a6)](_0x3f22d0(0x1ba)+_0x15fefa['length']+'\x20activation'+(_0x15fefa['length']!==0x1?'s':'')),await handleSDKOutput(_0x15fefa,_0x122f4a),0x0;}catch(_0xeafa2e){if(_0xeafa2e instanceof SDKError)return console[_0x3f22d0(0x1a6)]('Error:\x20'+_0xeafa2e[_0x3f22d0(0x1a3)]),_0xeafa2e[_0x3f22d0(0x1a4)]&&console[_0x3f22d0(0x1a6)](_0x3f22d0(0x1b5)+_0xeafa2e[_0x3f22d0(0x1a4)]),0x1;throw _0xeafa2e;}}}
1
+ const a3_0x3fe784=a3_0x2197;function a3_0x54d2(){const _0x3914f1=['List\x20activations\x20for\x20a\x20segment','1579928Ecagto','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','105189CWvrUU','Child\x20name:\x20','\x20activation','154078XOGitW','length','235YxQOis','\x27...','Parent\x20name:\x20','Site:\x20','6etkAQE','message','461328PbRyIR','verbose','✔\x20Found\x20','listActivations','segment','site','1311381KZneJL','Resolved\x20parent\x20ID:\x20','Listing\x20activations\x20for\x20segment\x20\x27','description','Resolved\x20child\x20ID:\x20','cause','resolveSegmentId','12084yNUKMw','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','133560VaYHKX','error','data','resolveParentId','activations','execute','Error:\x20Segment\x20name\x20is\x20required','\x20\x20Cause:\x20'];a3_0x54d2=function(){return _0x3914f1;};return a3_0x54d2();}(function(_0x336ea4,_0x231051){const _0x31b1b7=a3_0x2197,_0x160d8f=_0x336ea4();while(!![]){try{const _0x814ec0=-parseInt(_0x31b1b7(0x116))/0x1+parseInt(_0x31b1b7(0x11c))/0x2*(parseInt(_0x31b1b7(0x113))/0x3)+-parseInt(_0x31b1b7(0x12d))/0x4+-parseInt(_0x31b1b7(0x118))/0x5*(parseInt(_0x31b1b7(0x12b))/0x6)+-parseInt(_0x31b1b7(0x11e))/0x7+parseInt(_0x31b1b7(0x111))/0x8+parseInt(_0x31b1b7(0x124))/0x9;if(_0x814ec0===_0x231051)break;else _0x160d8f['push'](_0x160d8f['shift']());}catch(_0x2b802d){_0x160d8f['push'](_0x160d8f['shift']());}}}(a3_0x54d2,0x18807));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a3_0x2197(_0x5231d3,_0x144c38){_0x5231d3=_0x5231d3-0x10c;const _0x54d285=a3_0x54d2();let _0x219714=_0x54d285[_0x5231d3];return _0x219714;}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_0x3fe784(0x10c);[a3_0x3fe784(0x127)]=a3_0x3fe784(0x110);async[a3_0x3fe784(0x10d)](_0x36e5dd){const _0x46ccd7=a3_0x3fe784,{options:_0x30b48d,args:_0x1a6609,tdx:_0x4466b9}=_0x36e5dd;if(_0x1a6609[_0x46ccd7(0x117)]===0x0)return console[_0x46ccd7(0x12e)](_0x46ccd7(0x10e)),console['error'](_0x46ccd7(0x12c)),0x1;try{const {parentId:_0x7e2e79,childId:_0x434a1a}=parseSegmentRef(_0x1a6609[0x0]);if(!_0x434a1a)return console[_0x46ccd7(0x12e)](_0x46ccd7(0x112)),console[_0x46ccd7(0x12e)](_0x46ccd7(0x12c)),0x1;_0x30b48d[_0x46ccd7(0x11f)]&&(console[_0x46ccd7(0x12e)](_0x46ccd7(0x11b)+_0x30b48d[_0x46ccd7(0x123)]),console['error'](_0x46ccd7(0x11a)+_0x7e2e79),console[_0x46ccd7(0x12e)](_0x46ccd7(0x114)+_0x434a1a));const _0x14f949=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x7e2e79+_0x46ccd7(0x119),()=>_0x4466b9[_0x46ccd7(0x122)][_0x46ccd7(0x130)](_0x7e2e79),{'verbose':_0x30b48d[_0x46ccd7(0x11f)]}),_0x3a6c28=_0x14f949['data'];_0x30b48d[_0x46ccd7(0x11f)]&&console[_0x46ccd7(0x12e)](_0x46ccd7(0x125)+_0x3a6c28);const _0x59b303=await withSpinner('Resolving\x20child\x20segment\x20\x27'+_0x434a1a+'\x27...',()=>_0x4466b9[_0x46ccd7(0x122)][_0x46ccd7(0x12a)](_0x3a6c28,_0x434a1a),{'verbose':_0x30b48d[_0x46ccd7(0x11f)]}),_0x438536=_0x59b303[_0x46ccd7(0x12f)];_0x30b48d[_0x46ccd7(0x11f)]&&console[_0x46ccd7(0x12e)](_0x46ccd7(0x128)+_0x438536);const _0x4d962a=await withSpinner(_0x46ccd7(0x126)+_0x434a1a+_0x46ccd7(0x119),()=>_0x4466b9['segment'][_0x46ccd7(0x121)](_0x3a6c28,_0x438536),{'verbose':_0x30b48d[_0x46ccd7(0x11f)]}),_0x372945=_0x4d962a[_0x46ccd7(0x12f)];return console[_0x46ccd7(0x12e)](_0x46ccd7(0x120)+_0x372945[_0x46ccd7(0x117)]+_0x46ccd7(0x115)+(_0x372945[_0x46ccd7(0x117)]!==0x1?'s':'')),await handleSDKOutput(_0x372945,_0x30b48d),0x0;}catch(_0x4c1762){if(_0x4c1762 instanceof SDKError)return console[_0x46ccd7(0x12e)]('Error:\x20'+_0x4c1762[_0x46ccd7(0x11d)]),_0x4c1762[_0x46ccd7(0x129)]&&console['error'](_0x46ccd7(0x10f)+_0x4c1762['cause']),0x1;throw _0x4c1762;}}}
@@ -1 +1 @@
1
- const a4_0x10cef5=a4_0x5d32;(function(_0xed04b6,_0x26cc45){const _0x2c97b3=a4_0x5d32,_0x555de7=_0xed04b6();while(!![]){try{const _0x3feca8=-parseInt(_0x2c97b3(0x17b))/0x1*(-parseInt(_0x2c97b3(0x153))/0x2)+parseInt(_0x2c97b3(0x14e))/0x3*(-parseInt(_0x2c97b3(0x1b9))/0x4)+parseInt(_0x2c97b3(0x16e))/0x5*(parseInt(_0x2c97b3(0x1cb))/0x6)+parseInt(_0x2c97b3(0x149))/0x7*(parseInt(_0x2c97b3(0x1c6))/0x8)+parseInt(_0x2c97b3(0x1f1))/0x9+-parseInt(_0x2c97b3(0x152))/0xa*(parseInt(_0x2c97b3(0x1bb))/0xb)+-parseInt(_0x2c97b3(0x1bc))/0xc*(parseInt(_0x2c97b3(0x1cf))/0xd);if(_0x3feca8===_0x26cc45)break;else _0x555de7['push'](_0x555de7['shift']());}catch(_0x135c92){_0x555de7['push'](_0x555de7['shift']());}}}(a4_0x4c43,0x4a416));import a4_0x5b8e6c from'chalk';import a4_0x101732 from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a4_0x5d32(_0x416e77,_0x1b0a0b){_0x416e77=_0x416e77-0x13b;const _0x4c4352=a4_0x4c43();let _0x5d3230=_0x4c4352[_0x416e77];return _0x5d3230;}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';function a4_0x4c43(){const _0x150301=['projectDir','message','\x0aChanges\x20to\x20agent\x20\x27','✔\x20Context\x20set:\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20files?','\x20errors','pushProject','pullAgent','projectId','no_context','found','\x0aPull\x20summary\x20for\x20\x27','no_local_folder','diff','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','Using\x20current\x20project:\x20','tdx.json','agentName','execute','agentId','3043557ZNXTvh','\x0aErrors\x20found:','agents','\x20resources?','Using\x20local\x20project:\x20','yes','textKnowledgeBases','\x20|\x20','\x0aChanges\x20to\x20integration\x20\x27','error','new','utf-8','\x20created','\x20--name\x20','cwd-config','Output:\x20','newProjectId','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','join','3177874hHjfuU','INVALID_ARGUMENT','\x20total','\x20new','\x20files\x20to\x20','1296GWKcOS','dryRun','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','\x20\x20Knowledge\x20Bases:\x20','110IHxURl','446aPPSBf','llm','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)','cloneProject','experimentalArtifacts','push','\x20\x20Text\x20Knowledge\x20Bases:\x20','\x20=\x20','action','\x22:\x20','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','Would\x20pull\x20agent:\x20','hasChanges','\x20changed','context','Cancelled','agent:push','\x0a✔\x20Pushed\x20','repeat','counts','New\x20project\x20name\x20is\x20required','outputDir','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','MISSING_ARGUMENT','description','isNew','total','55KJjBBE','\x22\x20to\x20a\x20different\x20profile','llm_project','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','prompts','Using\x20project:\x20','Agent\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','force','\x20successfully','Using\x20context\x20project:\x20','Project\x20cloned\x20successfully','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','2669fWFuEe','\x20\x20Integration\x20\x22','Cannot\x20clone\x20from\x20context\x20project\x20\x22','\x20resources\x20to\x20\x27','\x20\x20Agent\x20\x22','\x27\x20to\x20create\x20the\x20folder\x20structure.','Project:\x20','\x0a✔\x20Pulled\x20','\x20\x20Text\x20Knowledge\x20Base\x20\x22','parse','agent:pull','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','\x22...','integrations','\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','Writing\x20files...','llmProject','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','\x0aPush\x20summary\x20for\x20\x27','Source:\x20','Using\x20project\x20from\x20','<new-name>','arg-dir','Using\x20project\x20from\x20context:\x20','\x20\x20Prompt\x20\x22','\x22\x20from\x20project\x20\x22','\x20\x20tdx\x20agent\x20pull\x20','\x22\x20to\x20new\x20project\x20\x22','dim','Would\x20push\x20agent:\x20','unchanged','Chat:\x20','Agent:\x20','\x0aError:','red','green','Dry\x20run\x20-\x20no\x20changes\x20made','name','Analyzing\x20changes\x20to\x20push...','\x20\x20Experimental\x20Artifacts:\x20','yellow','Errors:','reason','\x20\x20Integrations:\x20','source','No\x20tdx.json\x20found\x20in\x20','\x20\x20Source:\x20','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','\x20\x20Target:\x20','projectName','\x0aWrite\x20','agent:clone','\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','experimentalKnowledgeBases','\x20\x20Prompts:\x20','updated','profile','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory','cwd','created','200ogCTTj','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','185911NnqLAo','12qybLsG','\x20--profile\x20','dirname','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','errors','\x0aChanges:','session','Agent\x20pulled\x20successfully','\x20\x20Agents:\x20','-\x20nothing\x20pushed','8yZGEqe','knowledgeBases','\x0aChanges\x20to\x20prompt\x20\x27','pullProject','\x20\x20Experimental\x20Artifact\x20\x22','157764EXoqkN','-\x20no\x20files\x20written','cyan','agent','15143895vxZJdR','Failed\x20to\x20push\x20agent:\x20','log','gray','outputPath','New\x20project:\x20','\x20\x20Knowledge\x20Base\x20\x22','sourceProjectName','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','Analyzing\x20project\x20\x22','Clone\x20\x22','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project'];a4_0x4c43=function(){return _0x150301;};return a4_0x4c43();}import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x2df844){const _0x37835c=a4_0x5d32,_0x1fe2c2=[];if(_0x2df844['total']!==undefined)_0x1fe2c2['push'](_0x2df844['total']+_0x37835c(0x14b));if(_0x2df844[_0x37835c(0x13f)]!==undefined&&_0x2df844['new']>0x0)_0x1fe2c2[_0x37835c(0x158)](a4_0x5b8e6c[_0x37835c(0x19f)](_0x2df844[_0x37835c(0x13f)]+_0x37835c(0x14c)));if(_0x2df844[_0x37835c(0x1b8)]!==undefined&&_0x2df844[_0x37835c(0x1b8)]>0x0)_0x1fe2c2[_0x37835c(0x158)](a4_0x5b8e6c[_0x37835c(0x19f)](_0x2df844[_0x37835c(0x1b8)]+_0x37835c(0x141)));if(_0x2df844[_0x37835c(0x1b3)]!==undefined&&_0x2df844[_0x37835c(0x1b3)]>0x0)_0x1fe2c2[_0x37835c(0x158)](a4_0x5b8e6c[_0x37835c(0x1a4)](_0x2df844[_0x37835c(0x1b3)]+_0x37835c(0x18a)));if(_0x2df844[_0x37835c(0x19a)]!==undefined&&_0x2df844[_0x37835c(0x19a)]>0x0)_0x1fe2c2[_0x37835c(0x158)](a4_0x5b8e6c[_0x37835c(0x1d2)](_0x2df844['unchanged']+'\x20unchanged'));if(_0x2df844[_0x37835c(0x1c0)]!==undefined&&_0x2df844[_0x37835c(0x1c0)]>0x0)_0x1fe2c2[_0x37835c(0x158)](a4_0x5b8e6c[_0x37835c(0x19e)](_0x2df844[_0x37835c(0x1c0)]+_0x37835c(0x1e2)));return _0x1fe2c2['join'](',\x20');}function displayDiffs(_0x43a8a6,_0x48dcd6,_0x470934,_0x277aa2,_0xb14dcb,_0x4eff3e,_0x3059bb){const _0x5b399b=a4_0x5d32;for(const _0x9f07ce of _0x43a8a6){if(_0x9f07ce['diff']){const _0x3b5f36=_0x9f07ce[_0x5b399b(0x1ee)]||_0x9f07ce[_0x5b399b(0x1a1)];console['log'](_0x5b399b(0x1de)+_0x3b5f36+'\x27:'),console[_0x5b399b(0x1d1)]('─'['repeat'](0x3c)),console[_0x5b399b(0x1d1)](_0x9f07ce[_0x5b399b(0x1ea)]),console['log']('─'[_0x5b399b(0x165)](0x3c));}}for(const _0x4987d4 of _0x48dcd6){_0x4987d4[_0x5b399b(0x1ea)]&&(console[_0x5b399b(0x1d1)](_0x5b399b(0x169)+_0x4987d4[_0x5b399b(0x1a1)]+'\x27:'),console['log']('─'[_0x5b399b(0x165)](0x3c)),console[_0x5b399b(0x1d1)](_0x4987d4[_0x5b399b(0x1ea)]),console[_0x5b399b(0x1d1)]('─'[_0x5b399b(0x165)](0x3c)));}for(const _0x4b4991 of _0x470934){_0x4b4991[_0x5b399b(0x1ea)]&&(console[_0x5b399b(0x1d1)]('\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27'+_0x4b4991['name']+'\x27:'),console[_0x5b399b(0x1d1)]('─'[_0x5b399b(0x165)](0x3c)),console['log'](_0x4b4991['diff']),console['log']('─'['repeat'](0x3c)));}for(const _0x26c991 of _0x277aa2){_0x26c991['diff']&&(console[_0x5b399b(0x1d1)](_0x5b399b(0x1c8)+_0x26c991['name']+'\x27:'),console['log']('─'[_0x5b399b(0x165)](0x3c)),console['log'](_0x26c991['diff']),console[_0x5b399b(0x1d1)]('─'[_0x5b399b(0x165)](0x3c)));}for(const _0x2cb424 of _0xb14dcb){_0x2cb424[_0x5b399b(0x1ea)]&&(console[_0x5b399b(0x1d1)](_0x5b399b(0x13d)+_0x2cb424['name']+'\x27:'),console[_0x5b399b(0x1d1)]('─'['repeat'](0x3c)),console[_0x5b399b(0x1d1)](_0x2cb424[_0x5b399b(0x1ea)]),console['log']('─'[_0x5b399b(0x165)](0x3c)));}for(const _0x55426b of _0x4eff3e){_0x55426b[_0x5b399b(0x1ea)]&&(console[_0x5b399b(0x1d1)]('\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27'+_0x55426b[_0x5b399b(0x1a1)]+'\x27:'),console[_0x5b399b(0x1d1)]('─'[_0x5b399b(0x165)](0x3c)),console[_0x5b399b(0x1d1)](_0x55426b[_0x5b399b(0x1ea)]),console[_0x5b399b(0x1d1)]('─'['repeat'](0x3c)));}for(const _0x12201d of _0x3059bb){_0x12201d[_0x5b399b(0x1ea)]&&(console[_0x5b399b(0x1d1)](_0x5b399b(0x171)+_0x12201d[_0x5b399b(0x1a1)]+'\x27:'),console[_0x5b399b(0x1d1)]('─'[_0x5b399b(0x165)](0x3c)),console[_0x5b399b(0x1d1)](_0x12201d['diff']),console[_0x5b399b(0x1d1)]('─'[_0x5b399b(0x165)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x10cef5(0x1a1)]=a4_0x10cef5(0x185);[a4_0x10cef5(0x16b)]=a4_0x10cef5(0x18d);async[a4_0x10cef5(0x1ef)](_0x596aae){const _0x566599=a4_0x10cef5,{options:_0x4da421,args:_0x1931d2,tdx:_0x3773d8}=_0x596aae,_0x256a06=_0x1931d2[0x0],_0x391e47=_0x1931d2[0x1],_0x47d163=_0x4da421['output'],_0x5edb83=_0x4da421['dryRun'],_0x152d5f=_0x4da421[_0x566599(0x176)],_0x2d75ae=_0x4da421[_0x566599(0x1f6)],_0x37f631=_0x4da421['llmProject'],_0x53f02a=_0x4da421[_0x566599(0x1ce)];let _0x194d6a;if(_0x256a06){const _0x56aa26=a4_0x101732[_0x566599(0x148)](_0x256a06,_0x566599(0x1ed));if(existsSync(_0x56aa26))try{const _0x51b438=JSON[_0x566599(0x184)](readFileSync(_0x56aa26,'utf-8'));_0x51b438[_0x566599(0x170)]&&(_0x194d6a={'llm_project':_0x51b438[_0x566599(0x170)]});}catch{}}const _0xdbcc52=findAgentConfigPath(process[_0x566599(0x1b7)]());let _0x4ad29f;if(_0xdbcc52)try{const _0x140658=JSON[_0x566599(0x184)](readFileSync(_0xdbcc52,_0x566599(0x140)));_0x140658[_0x566599(0x170)]&&(_0x4ad29f={'llm_project':_0x140658[_0x566599(0x170)]});}catch{}const _0x364c27=resolveAgentPullArgs({'arg':_0x256a06,'agentNameArg':_0x391e47,'agentFlag':_0x53f02a,'contextProject':_0x37f631,'argDirConfig':_0x194d6a,'cwdConfigPath':_0xdbcc52||undefined,'cwdConfig':_0x4ad29f}),{projectNameOrId:_0x20f499,targetAgentName:_0x946035,existingOutputDir:_0x5f18f8,source:_0xc08d8b}=_0x364c27;if(_0xc08d8b===_0x566599(0x192))console[_0x566599(0x1d1)](a4_0x5b8e6c['dim'](_0x566599(0x190)+a4_0x101732[_0x566599(0x148)](_0x256a06,_0x566599(0x1ed))+':\x20'+_0x20f499));else{if(_0xc08d8b===_0x566599(0x143))console[_0x566599(0x1d1)](a4_0x5b8e6c['dim'](_0x566599(0x173)+_0x20f499));else _0xc08d8b===_0x566599(0x161)&&console[_0x566599(0x1d1)](a4_0x5b8e6c['dim'](_0x566599(0x193)+_0x20f499));}if(!_0x20f499)return _0x53f02a?(console[_0x566599(0x1d1)](a4_0x5b8e6c[_0x566599(0x1a4)](_0x566599(0x186))),console['log']('Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>'),console[_0x566599(0x1d1)]('Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>')):(console['log'](a4_0x5b8e6c[_0x566599(0x1a4)]('llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a')),console[_0x566599(0x1d1)](_0x566599(0x155)),console['log']('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project'),console[_0x566599(0x1d1)](_0x566599(0x1b6)),console[_0x566599(0x1d1)](_0x566599(0x1b0)),console[_0x566599(0x1d1)](_0x566599(0x189))),0x1;if(_0x946035){const {data:_0x2796b3}=await withSpinner('Pulling\x20agent\x20\x22'+_0x946035+_0x566599(0x195)+_0x20f499+_0x566599(0x187),()=>_0x3773d8['llm'][_0x566599(0x1e4)](_0x20f499,_0x946035,_0x47d163,{'dryRun':_0x5edb83,'force':_0x152d5f}));if(_0x5edb83)return console[_0x566599(0x1d1)](a4_0x5b8e6c[_0x566599(0x1a4)]('Dry\x20run\x20-\x20no\x20files\x20written')),console['log'](_0x566599(0x15e)+_0x2796b3['agentName']),console[_0x566599(0x1d1)]('Output\x20path:\x20'+_0x2796b3['outputPath']),_0x2796b3[_0x566599(0x1ea)]&&(console[_0x566599(0x1d1)](_0x566599(0x1c1)),console['log']('─'[_0x566599(0x165)](0x3c)),console[_0x566599(0x1d1)](_0x2796b3['diff']),console[_0x566599(0x1d1)]('─'[_0x566599(0x165)](0x3c))),0x0;return console[_0x566599(0x1d1)](a4_0x5b8e6c['green'](_0x566599(0x1c3))),console[_0x566599(0x1d1)](_0x566599(0x19c)+_0x2796b3[_0x566599(0x1ee)]),console[_0x566599(0x1d1)](_0x566599(0x144)+_0x2796b3[_0x566599(0x1d3)]),console['log']('Status:\x20'+(_0x2796b3[_0x566599(0x16c)]?a4_0x5b8e6c[_0x566599(0x19f)](_0x566599(0x13f)):_0x2796b3[_0x566599(0x15f)]?a4_0x5b8e6c['yellow'](_0x566599(0x1b3)):a4_0x5b8e6c[_0x566599(0x1d2)](_0x566599(0x19a)))),0x0;}const _0x40e3fc=_0x5f18f8||_0x47d163,{data:_0x2941c9}=await withSpinner(_0x566599(0x1d9)+_0x20f499+_0x566599(0x187),()=>_0x3773d8[_0x566599(0x154)]['pullProject'](_0x20f499,_0x40e3fc,{'dryRun':!![]})),_0x40926f=_0x2941c9['counts'][_0x566599(0x1f3)]['new']+_0x2941c9[_0x566599(0x166)]['knowledgeBases']['new']+_0x2941c9[_0x566599(0x166)]['textKnowledgeBases'][_0x566599(0x13f)]+_0x2941c9[_0x566599(0x166)][_0x566599(0x172)][_0x566599(0x13f)]+_0x2941c9[_0x566599(0x166)][_0x566599(0x188)][_0x566599(0x13f)]+_0x2941c9['counts'][_0x566599(0x1b1)][_0x566599(0x13f)]+_0x2941c9[_0x566599(0x166)]['experimentalArtifacts']['new'],_0x150fee=_0x2941c9[_0x566599(0x166)][_0x566599(0x1f3)][_0x566599(0x1b3)]+_0x2941c9[_0x566599(0x166)][_0x566599(0x1c7)][_0x566599(0x1b3)]+_0x2941c9[_0x566599(0x166)]['textKnowledgeBases'][_0x566599(0x1b3)]+_0x2941c9['counts'][_0x566599(0x172)][_0x566599(0x1b3)]+_0x2941c9['counts'][_0x566599(0x188)][_0x566599(0x1b3)]+_0x2941c9['counts']['experimentalKnowledgeBases']['updated']+_0x2941c9[_0x566599(0x166)][_0x566599(0x157)][_0x566599(0x1b3)],_0x80e617=_0x2941c9[_0x566599(0x166)][_0x566599(0x1f3)][_0x566599(0x19a)]+_0x2941c9[_0x566599(0x166)][_0x566599(0x1c7)][_0x566599(0x19a)]+_0x2941c9[_0x566599(0x166)]['textKnowledgeBases'][_0x566599(0x19a)]+_0x2941c9[_0x566599(0x166)]['prompts']['unchanged']+_0x2941c9[_0x566599(0x166)]['integrations'][_0x566599(0x19a)]+_0x2941c9[_0x566599(0x166)]['experimentalKnowledgeBases'][_0x566599(0x19a)]+_0x2941c9[_0x566599(0x166)]['experimentalArtifacts'][_0x566599(0x19a)];console[_0x566599(0x1d1)](_0x566599(0x1e8)+_0x2941c9[_0x566599(0x1ad)]+'\x27:'),console[_0x566599(0x1d1)]('\x20\x20'+a4_0x5b8e6c[_0x566599(0x19f)]('+\x20'+_0x40926f+'\x20new')+_0x566599(0x13c)+a4_0x5b8e6c[_0x566599(0x1a4)]('~\x20'+_0x150fee+_0x566599(0x160))+_0x566599(0x13c)+a4_0x5b8e6c['dim']('=\x20'+_0x80e617+'\x20unchanged')),console['log'](_0x566599(0x1c4)+formatCountSummary(_0x2941c9[_0x566599(0x166)][_0x566599(0x1f3)])),console[_0x566599(0x1d1)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x2941c9[_0x566599(0x166)]['knowledgeBases'])),console[_0x566599(0x1d1)](_0x566599(0x159)+formatCountSummary(_0x2941c9[_0x566599(0x166)]['textKnowledgeBases'])),console[_0x566599(0x1d1)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x2941c9[_0x566599(0x166)][_0x566599(0x172)])),console[_0x566599(0x1d1)](_0x566599(0x1a7)+formatCountSummary(_0x2941c9['counts'][_0x566599(0x188)]));const _0x165ca8=_0x2941c9[_0x566599(0x166)][_0x566599(0x1b1)][_0x566599(0x16d)]>0x0||_0x2941c9[_0x566599(0x166)][_0x566599(0x157)]['total']>0x0;_0x165ca8&&(console['log'](_0x566599(0x1ab)+formatCountSummary(_0x2941c9[_0x566599(0x166)][_0x566599(0x1b1)])),console['log'](_0x566599(0x1a3)+formatCountSummary(_0x2941c9[_0x566599(0x166)][_0x566599(0x157)])));console[_0x566599(0x1d1)](_0x566599(0x1ac)+a4_0x5b8e6c[_0x566599(0x1cd)](_0x2941c9[_0x566599(0x168)])),displayDiffs(_0x2941c9[_0x566599(0x1f3)],_0x2941c9[_0x566599(0x1c7)],_0x2941c9[_0x566599(0x13b)],_0x2941c9[_0x566599(0x172)],_0x2941c9[_0x566599(0x188)],_0x2941c9['experimentalKnowledgeBases'],_0x2941c9[_0x566599(0x157)]);if(_0x5edb83)return console[_0x566599(0x1d1)](a4_0x5b8e6c['yellow'](_0x566599(0x17a))),0x0;if(_0x40926f===0x0&&_0x150fee===0x0)return console[_0x566599(0x1d1)](a4_0x5b8e6c[_0x566599(0x19f)](_0x566599(0x1d8))),saveSessionContext({'llm_project':_0x2941c9[_0x566599(0x1ad)]},_0x4da421[_0x566599(0x1c2)]),console[_0x566599(0x1d1)](a4_0x5b8e6c[_0x566599(0x19f)](_0x566599(0x1df)+a4_0x5b8e6c[_0x566599(0x198)](_0x566599(0x170))+_0x566599(0x15a)+a4_0x5b8e6c[_0x566599(0x1cd)](_0x2941c9[_0x566599(0x1ad)]))),0x0;if(!_0x2d75ae&&!_0x152d5f){if(!isInteractive())return console[_0x566599(0x13e)](a4_0x5b8e6c['red'](_0x566599(0x19d)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x566599(0x13e)](a4_0x5b8e6c[_0x566599(0x198)](_0x566599(0x1e0))),0x1;const _0x44f9f5=await confirmKey(_0x566599(0x1ae)+(_0x40926f+_0x150fee)+_0x566599(0x1e1));if(!_0x44f9f5)return console[_0x566599(0x1d1)](a4_0x5b8e6c[_0x566599(0x1a4)](_0x566599(0x162)),_0x566599(0x1cc)),0x1;}const {data:_0x5c8488}=await withSpinner(_0x566599(0x18b),()=>_0x3773d8['llm'][_0x566599(0x1c9)](_0x20f499,_0x40e3fc,{'force':_0x152d5f}));return console[_0x566599(0x1d1)](a4_0x5b8e6c[_0x566599(0x19f)](_0x566599(0x182)+(_0x40926f+_0x150fee)+_0x566599(0x14d)+_0x5c8488['outputDir'])),saveSessionContext({'llm_project':_0x5c8488[_0x566599(0x1ad)]},_0x4da421[_0x566599(0x1c2)]),console[_0x566599(0x1d1)](a4_0x5b8e6c['green'](_0x566599(0x1df)+a4_0x5b8e6c[_0x566599(0x198)](_0x566599(0x170))+_0x566599(0x15a)+a4_0x5b8e6c['cyan'](_0x5c8488[_0x566599(0x1ad)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x10cef5(0x1a1)]=a4_0x10cef5(0x1af);[a4_0x10cef5(0x16b)]=a4_0x10cef5(0x1db);async[a4_0x10cef5(0x1ef)](_0x3b4d95){const _0x2e2740=a4_0x10cef5,{options:_0x15bfd1,args:_0x49e68b,tdx:_0xe693ac}=_0x3b4d95,_0x53f647=_0x49e68b[0x0],_0x5c7c06=_0x15bfd1[_0x2e2740(0x1a1)],_0x47f045=_0x15bfd1[_0x2e2740(0x14f)],_0x4c8639=_0x15bfd1[_0x2e2740(0x1f6)],_0x571966=_0x15bfd1['site'],_0x41f820=_0x15bfd1[_0x2e2740(0x18c)];let _0x4da669;const _0x2eacd4=findAgentConfigPath(process[_0x2e2740(0x1b7)]());if(_0x53f647){const _0x1ee6fe=a4_0x101732[_0x2e2740(0x148)](_0x53f647,_0x2e2740(0x1ed));existsSync(_0x1ee6fe)?(_0x4da669=_0x53f647,console[_0x2e2740(0x1d1)](a4_0x5b8e6c['dim'](_0x2e2740(0x1f5)+_0x53f647))):_0x4da669=_0x53f647;}else{if(_0x2eacd4)_0x4da669=a4_0x101732[_0x2e2740(0x1be)](_0x2eacd4),console[_0x2e2740(0x1d1)](a4_0x5b8e6c[_0x2e2740(0x198)](_0x2e2740(0x1ec)+_0x4da669));else{if(_0x41f820){const _0x5efb69=sanitizeForFilesystem(_0x41f820);let _0x278470=_0x5efb69,_0x487578=a4_0x101732[_0x2e2740(0x148)](process['cwd'](),_0x2e2740(0x1f3),_0x5efb69,_0x2e2740(0x1ed));if(!existsSync(_0x487578)){const _0x3f534c=normalizeName(_0x41f820),_0x48cda2=a4_0x101732[_0x2e2740(0x148)](process[_0x2e2740(0x1b7)](),'agents',_0x3f534c,'tdx.json');existsSync(_0x48cda2)&&(_0x278470=_0x3f534c,_0x487578=_0x48cda2);}if(existsSync(_0x487578))_0x4da669=a4_0x101732[_0x2e2740(0x1be)](_0x487578),console[_0x2e2740(0x1d1)](a4_0x5b8e6c[_0x2e2740(0x198)](_0x2e2740(0x1f5)+_0x4da669));else{const _0xff35e8=_0x15bfd1[_0x2e2740(0x1b4)];if(_0xff35e8)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x2e2740(0x17d)+_0x41f820+_0x2e2740(0x16f),undefined,{'helpText':_0x2e2740(0x1d7)+_0x2e2740(0x15d)+(_0x2e2740(0x196)+_0x41f820+'\x0a')+('\x20\x20tdx\x20agent\x20clone\x20agents/'+_0x278470+_0x2e2740(0x142)+(_0x5c7c06||_0x2e2740(0x191))+_0x2e2740(0x1bd)+_0xff35e8)});_0x4da669=_0x41f820,console['log'](a4_0x5b8e6c[_0x2e2740(0x198)](_0x2e2740(0x178)+_0x41f820));}}}}if(!_0x4da669)return console['log'](a4_0x5b8e6c[_0x2e2740(0x1a4)]('No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a')),console[_0x2e2740(0x1d1)](_0x2e2740(0x146)),console[_0x2e2740(0x1d1)](_0x2e2740(0x147)),console[_0x2e2740(0x1d1)]('\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[_0x2e2740(0x1d1)](_0x2e2740(0x1bf)),0x1;if(!_0x5c7c06)throw new SDKError(ErrorCode[_0x2e2740(0x16a)],_0x2e2740(0x167),undefined,{'helpText':'Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>'});if(!_0x4c8639&&!_0x47f045){if(!isInteractive())return console['error'](a4_0x5b8e6c[_0x2e2740(0x19e)](_0x2e2740(0x19d)),_0x2e2740(0x175)),console[_0x2e2740(0x13e)](a4_0x5b8e6c[_0x2e2740(0x198)](_0x2e2740(0x1e0))),0x1;const _0x15d01d=await confirmKey(_0x2e2740(0x1da)+_0x4da669+_0x2e2740(0x197)+_0x5c7c06+'\x22?');if(!_0x15d01d)return console['log'](a4_0x5b8e6c[_0x2e2740(0x1a4)](_0x2e2740(0x162))),0x1;}const {data:_0x386706}=await withSpinner('Cloning\x20\x22'+_0x4da669+'\x22\x20to\x20\x22'+_0x5c7c06+_0x2e2740(0x187),()=>_0xe693ac[_0x2e2740(0x154)][_0x2e2740(0x156)](_0x4da669,_0x5c7c06,{'dryRun':_0x47f045}));if(_0x47f045){console[_0x2e2740(0x1d1)](a4_0x5b8e6c[_0x2e2740(0x1a4)](_0x2e2740(0x1a0))),console['log'](_0x2e2740(0x18f)+_0x386706[_0x2e2740(0x1d6)]),console['log'](_0x2e2740(0x1d4)+_0x5c7c06),console[_0x2e2740(0x1d1)]('Would\x20clone:'),console['log']('\x20\x20Agents:\x20'+_0x386706[_0x2e2740(0x166)][_0x2e2740(0x1f3)][_0x2e2740(0x1b8)]),console[_0x2e2740(0x1d1)]('\x20\x20Knowledge\x20Bases:\x20'+_0x386706[_0x2e2740(0x166)][_0x2e2740(0x1c7)][_0x2e2740(0x1b8)]),console[_0x2e2740(0x1d1)](_0x2e2740(0x1b2)+_0x386706[_0x2e2740(0x166)][_0x2e2740(0x172)]['created']);const _0x31aee9=_0x386706[_0x2e2740(0x166)][_0x2e2740(0x1b1)]['created']>0x0||_0x386706[_0x2e2740(0x166)][_0x2e2740(0x157)]['created']>0x0;return _0x31aee9&&(console['log'](_0x2e2740(0x1ab)+_0x386706['counts'][_0x2e2740(0x1b1)]['created']),console[_0x2e2740(0x1d1)](_0x2e2740(0x1a3)+_0x386706['counts']['experimentalArtifacts']['created'])),0x0;}const _0x1fc2a0=_0x386706[_0x2e2740(0x166)][_0x2e2740(0x1f3)]['errors']>0x0||_0x386706[_0x2e2740(0x166)][_0x2e2740(0x1c7)]['errors']>0x0||_0x386706['counts'][_0x2e2740(0x172)][_0x2e2740(0x1c0)]>0x0||_0x386706[_0x2e2740(0x166)][_0x2e2740(0x1b1)][_0x2e2740(0x1c0)]>0x0||_0x386706[_0x2e2740(0x166)][_0x2e2740(0x157)][_0x2e2740(0x1c0)]>0x0;_0x1fc2a0?console['log'](a4_0x5b8e6c[_0x2e2740(0x1a4)]('Project\x20cloned\x20with\x20errors')):console[_0x2e2740(0x1d1)](a4_0x5b8e6c[_0x2e2740(0x19f)](_0x2e2740(0x179)));console[_0x2e2740(0x1d1)](_0x2e2740(0x18f)+_0x386706[_0x2e2740(0x1d6)]),console['log'](_0x2e2740(0x1d4)+_0x386706['newProjectName']),console[_0x2e2740(0x1d1)]('New\x20project\x20ID:\x20'+_0x386706[_0x2e2740(0x145)]),console[_0x2e2740(0x1d1)](),console['log']('Summary:'),console[_0x2e2740(0x1d1)](_0x2e2740(0x1c4)+formatCountSummary(_0x386706[_0x2e2740(0x166)]['agents'])),console[_0x2e2740(0x1d1)](_0x2e2740(0x151)+formatCountSummary(_0x386706[_0x2e2740(0x166)][_0x2e2740(0x1c7)])),console[_0x2e2740(0x1d1)](_0x2e2740(0x1b2)+formatCountSummary(_0x386706['counts'][_0x2e2740(0x172)])),console['log']('\x20\x20Integrations:\x20'+formatCountSummary(_0x386706[_0x2e2740(0x166)]['integrations']));const _0x5892ab=_0x386706['counts']['experimentalKnowledgeBases'][_0x2e2740(0x1b8)]>0x0||_0x386706[_0x2e2740(0x166)][_0x2e2740(0x1b1)][_0x2e2740(0x1b3)]>0x0||_0x386706['counts'][_0x2e2740(0x1b1)][_0x2e2740(0x19a)]>0x0||_0x386706[_0x2e2740(0x166)][_0x2e2740(0x157)][_0x2e2740(0x1b8)]>0x0||_0x386706[_0x2e2740(0x166)][_0x2e2740(0x157)][_0x2e2740(0x1b3)]>0x0||_0x386706['counts']['experimentalArtifacts']['unchanged']>0x0;_0x5892ab&&(console[_0x2e2740(0x1d1)](_0x2e2740(0x1ab)+formatCountSummary(_0x386706[_0x2e2740(0x166)][_0x2e2740(0x1b1)])),console[_0x2e2740(0x1d1)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x386706[_0x2e2740(0x166)][_0x2e2740(0x157)])));if(_0x1fc2a0){console[_0x2e2740(0x1d1)](),console[_0x2e2740(0x1d1)](a4_0x5b8e6c[_0x2e2740(0x19e)](_0x2e2740(0x1a5)));for(const _0x5eff84 of _0x386706[_0x2e2740(0x1f3)]){_0x5eff84[_0x2e2740(0x15b)]===_0x2e2740(0x13e)&&console[_0x2e2740(0x1d1)](a4_0x5b8e6c[_0x2e2740(0x19e)](_0x2e2740(0x17f)+_0x5eff84[_0x2e2740(0x1ee)]+_0x2e2740(0x15c)+_0x5eff84[_0x2e2740(0x13e)]));}for(const _0x21848c of _0x386706[_0x2e2740(0x1c7)]){_0x21848c[_0x2e2740(0x15b)]===_0x2e2740(0x13e)&&console['log'](a4_0x5b8e6c[_0x2e2740(0x19e)](_0x2e2740(0x1d5)+_0x21848c[_0x2e2740(0x1a1)]+_0x2e2740(0x15c)+_0x21848c['error']));}for(const _0x1c2158 of _0x386706['prompts']){_0x1c2158['action']==='error'&&console[_0x2e2740(0x1d1)](a4_0x5b8e6c[_0x2e2740(0x19e)](_0x2e2740(0x194)+_0x1c2158[_0x2e2740(0x1a1)]+_0x2e2740(0x15c)+_0x1c2158[_0x2e2740(0x13e)]));}for(const _0x521253 of _0x386706[_0x2e2740(0x188)]){_0x521253['action']===_0x2e2740(0x13e)&&console[_0x2e2740(0x1d1)](a4_0x5b8e6c[_0x2e2740(0x19e)]('\x20\x20Integration\x20\x22'+_0x521253[_0x2e2740(0x1a1)]+_0x2e2740(0x15c)+_0x521253['error']));}for(const _0x2e487 of _0x386706['experimentalKnowledgeBases']){_0x2e487[_0x2e2740(0x15b)]===_0x2e2740(0x13e)&&console[_0x2e2740(0x1d1)](a4_0x5b8e6c['red'](_0x2e2740(0x1b5)+_0x2e487[_0x2e2740(0x1a1)]+_0x2e2740(0x15c)+_0x2e487[_0x2e2740(0x13e)]));}for(const _0x173808 of _0x386706['experimentalArtifacts']){_0x173808[_0x2e2740(0x15b)]===_0x2e2740(0x13e)&&console['log'](a4_0x5b8e6c['red'](_0x2e2740(0x1ca)+_0x173808['name']+_0x2e2740(0x15c)+_0x173808[_0x2e2740(0x13e)]));}return 0x1;}console[_0x2e2740(0x1d1)]();const _0x254487=getLLMProjectUrl(_0x571966,_0x386706[_0x2e2740(0x145)]);return console['log']('Project:\x20'+a4_0x5b8e6c[_0x2e2740(0x1cd)](_0x254487)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x10cef5(0x1a1)]=a4_0x10cef5(0x163);[a4_0x10cef5(0x16b)]=a4_0x10cef5(0x1ba);async['execute'](_0x251422){const _0x57d79d=a4_0x10cef5,{options:_0x25da77,args:_0x152eaa,tdx:_0x143157}=_0x251422;let _0x1c53e5=_0x152eaa[0x0]||process['cwd']();const _0x1cdd7=_0x25da77[_0x57d79d(0x14f)],_0x2879ea=_0x25da77[_0x57d79d(0x176)],_0x242b4b=_0x25da77[_0x57d79d(0x1f6)],_0x8d7e60=_0x25da77['site'],_0x729942=a4_0x101732[_0x57d79d(0x148)](_0x1c53e5,'agent.yml'),_0x56880a=existsSync(_0x729942);if(_0x56880a){const {data:_0x195da3}=await withSpinner('Pushing\x20agent\x20from\x20\x22'+_0x1c53e5+'\x22...',()=>_0x143157[_0x57d79d(0x154)]['pushAgent'](_0x1c53e5,{'dryRun':_0x1cdd7,'force':_0x2879ea}));if(_0x1cdd7)return console[_0x57d79d(0x1d1)](a4_0x5b8e6c['yellow']('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x57d79d(0x1d1)](_0x57d79d(0x199)+_0x195da3[_0x57d79d(0x1ee)]),0x0;if(_0x195da3['action']==='error')return console[_0x57d79d(0x1d1)](a4_0x5b8e6c[_0x57d79d(0x19e)](_0x57d79d(0x1d0)+_0x195da3[_0x57d79d(0x13e)])),0x1;console[_0x57d79d(0x1d1)](a4_0x5b8e6c[_0x57d79d(0x19f)](_0x57d79d(0x174)+_0x195da3['action']+_0x57d79d(0x177))),console[_0x57d79d(0x1d1)](_0x57d79d(0x19c)+_0x195da3[_0x57d79d(0x1ee)]);if(_0x195da3[_0x57d79d(0x1f0)]&&_0x195da3[_0x57d79d(0x1e5)]){const _0x566583=getLLMAgentChatUrl(_0x8d7e60,_0x195da3['projectId'],_0x195da3['agentId']);console[_0x57d79d(0x1d1)](_0x57d79d(0x19b)+a4_0x5b8e6c['cyan'](_0x566583));}return 0x0;}const _0x3e7c40=_0x25da77[_0x57d79d(0x18c)],_0x273d84=resolveProjectFromContext(_0x1c53e5,_0x3e7c40);if(_0x273d84[_0x57d79d(0x1e7)])_0x1c53e5=_0x273d84[_0x57d79d(0x1dc)],_0x273d84[_0x57d79d(0x1a8)]===_0x57d79d(0x161)&&console[_0x57d79d(0x1d1)](a4_0x5b8e6c['dim'](_0x57d79d(0x173)+_0x1c53e5));else{let _0x3a1b94=_0x57d79d(0x1eb);_0x273d84[_0x57d79d(0x1a6)]===_0x57d79d(0x1e9)&&(_0x3a1b94=_0x273d84[_0x57d79d(0x1dd)]+'\x0aRun\x20\x27tdx\x20agent\x20pull\x20'+_0x273d84[_0x57d79d(0x18c)]+_0x57d79d(0x180));throw new SDKError(ErrorCode[_0x57d79d(0x14a)],_0x273d84[_0x57d79d(0x1a6)]===_0x57d79d(0x1e6)?_0x273d84[_0x57d79d(0x1dd)]:_0x57d79d(0x1a9)+_0x1c53e5,undefined,{'helpText':_0x3a1b94});}const {data:_0x42f5b7}=await withSpinner(_0x57d79d(0x1a2),()=>_0x143157[_0x57d79d(0x154)][_0x57d79d(0x1e3)](_0x1c53e5,{'dryRun':!![]})),_0x4de9e1=_0x42f5b7[_0x57d79d(0x166)][_0x57d79d(0x1f3)][_0x57d79d(0x1c0)]>0x0;if(_0x4de9e1){console['log'](a4_0x5b8e6c['red'](_0x57d79d(0x1f2)));for(const _0x10129d of _0x42f5b7['agents']){_0x10129d[_0x57d79d(0x15b)]==='error'&&console[_0x57d79d(0x1d1)](a4_0x5b8e6c[_0x57d79d(0x19e)]('\x20\x20Agent\x20\x22'+_0x10129d['agentName']+_0x57d79d(0x15c)+_0x10129d[_0x57d79d(0x13e)]));}return 0x1;}const _0x3ce977=_0x42f5b7[_0x57d79d(0x166)]['agents'][_0x57d79d(0x1b8)]+_0x42f5b7[_0x57d79d(0x166)][_0x57d79d(0x1c7)][_0x57d79d(0x1b8)]+_0x42f5b7[_0x57d79d(0x166)][_0x57d79d(0x13b)][_0x57d79d(0x1b8)]+_0x42f5b7['counts']['prompts'][_0x57d79d(0x1b8)]+_0x42f5b7[_0x57d79d(0x166)][_0x57d79d(0x188)][_0x57d79d(0x1b8)]+_0x42f5b7[_0x57d79d(0x166)][_0x57d79d(0x1b1)]['created']+_0x42f5b7[_0x57d79d(0x166)]['experimentalArtifacts'][_0x57d79d(0x1b8)],_0xa030d8=_0x42f5b7[_0x57d79d(0x166)][_0x57d79d(0x1f3)]['updated']+_0x42f5b7['counts'][_0x57d79d(0x1c7)]['updated']+_0x42f5b7[_0x57d79d(0x166)]['textKnowledgeBases'][_0x57d79d(0x1b3)]+_0x42f5b7[_0x57d79d(0x166)][_0x57d79d(0x172)]['updated']+_0x42f5b7[_0x57d79d(0x166)][_0x57d79d(0x188)]['updated']+_0x42f5b7[_0x57d79d(0x166)][_0x57d79d(0x1b1)][_0x57d79d(0x1b3)]+_0x42f5b7[_0x57d79d(0x166)][_0x57d79d(0x157)][_0x57d79d(0x1b3)],_0x17fab4=_0x42f5b7[_0x57d79d(0x166)][_0x57d79d(0x1f3)]['unchanged']+_0x42f5b7[_0x57d79d(0x166)][_0x57d79d(0x1c7)][_0x57d79d(0x19a)]+_0x42f5b7['counts']['textKnowledgeBases'][_0x57d79d(0x19a)]+_0x42f5b7[_0x57d79d(0x166)]['prompts'][_0x57d79d(0x19a)]+_0x42f5b7[_0x57d79d(0x166)][_0x57d79d(0x188)][_0x57d79d(0x19a)]+_0x42f5b7['counts'][_0x57d79d(0x1b1)][_0x57d79d(0x19a)]+_0x42f5b7[_0x57d79d(0x166)]['experimentalArtifacts'][_0x57d79d(0x19a)];console[_0x57d79d(0x1d1)](_0x57d79d(0x18e)+_0x42f5b7[_0x57d79d(0x1ad)]+'\x27:'),console[_0x57d79d(0x1d1)]('\x20\x20'+a4_0x5b8e6c['green']('+\x20'+_0x3ce977+_0x57d79d(0x14c))+'\x20|\x20'+a4_0x5b8e6c[_0x57d79d(0x1a4)]('~\x20'+_0xa030d8+_0x57d79d(0x160))+_0x57d79d(0x13c)+a4_0x5b8e6c[_0x57d79d(0x198)]('=\x20'+_0x17fab4+'\x20unchanged')),console[_0x57d79d(0x1d1)](_0x57d79d(0x1c4)+formatCountSummary(_0x42f5b7['counts'][_0x57d79d(0x1f3)])),console[_0x57d79d(0x1d1)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x42f5b7[_0x57d79d(0x166)]['knowledgeBases'])),console[_0x57d79d(0x1d1)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x42f5b7[_0x57d79d(0x166)][_0x57d79d(0x13b)])),console['log'](_0x57d79d(0x1b2)+formatCountSummary(_0x42f5b7['counts']['prompts'])),console['log'](_0x57d79d(0x1a7)+formatCountSummary(_0x42f5b7['counts'][_0x57d79d(0x188)]));const _0x5e2519=_0x42f5b7['counts']['experimentalKnowledgeBases'][_0x57d79d(0x1b8)]>0x0||_0x42f5b7[_0x57d79d(0x166)]['experimentalKnowledgeBases'][_0x57d79d(0x1b3)]>0x0||_0x42f5b7[_0x57d79d(0x166)][_0x57d79d(0x1b1)][_0x57d79d(0x19a)]>0x0||_0x42f5b7[_0x57d79d(0x166)]['experimentalArtifacts'][_0x57d79d(0x1b8)]>0x0||_0x42f5b7[_0x57d79d(0x166)]['experimentalArtifacts'][_0x57d79d(0x1b3)]>0x0||_0x42f5b7[_0x57d79d(0x166)][_0x57d79d(0x157)][_0x57d79d(0x19a)]>0x0;_0x5e2519&&(console[_0x57d79d(0x1d1)](_0x57d79d(0x1ab)+formatCountSummary(_0x42f5b7['counts']['experimentalKnowledgeBases'])),console[_0x57d79d(0x1d1)](_0x57d79d(0x1a3)+formatCountSummary(_0x42f5b7[_0x57d79d(0x166)][_0x57d79d(0x157)])));console[_0x57d79d(0x1d1)](_0x57d79d(0x1aa)+a4_0x5b8e6c['cyan'](_0x1c53e5)),displayDiffs(_0x42f5b7[_0x57d79d(0x1f3)],_0x42f5b7[_0x57d79d(0x1c7)],_0x42f5b7[_0x57d79d(0x13b)],_0x42f5b7[_0x57d79d(0x172)],_0x42f5b7[_0x57d79d(0x188)],_0x42f5b7[_0x57d79d(0x1b1)],_0x42f5b7[_0x57d79d(0x157)]);if(_0x1cdd7)return console[_0x57d79d(0x1d1)](a4_0x5b8e6c[_0x57d79d(0x1a4)](_0x57d79d(0x150))),0x0;if(_0x3ce977===0x0&&_0xa030d8===0x0){console[_0x57d79d(0x1d1)](a4_0x5b8e6c[_0x57d79d(0x19f)]('\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date'));const _0x1dc800=getLLMProjectUrl(_0x8d7e60,_0x42f5b7[_0x57d79d(0x1e5)]);return console['log'](_0x57d79d(0x181)+a4_0x5b8e6c[_0x57d79d(0x1cd)](_0x1dc800)),0x0;}if(!_0x242b4b&&!_0x2879ea){if(!isInteractive())return console[_0x57d79d(0x13e)](a4_0x5b8e6c[_0x57d79d(0x19e)](_0x57d79d(0x19d)),_0x57d79d(0x175)),console[_0x57d79d(0x13e)](a4_0x5b8e6c['dim'](_0x57d79d(0x1e0))),0x1;const _0x1c1fdd=await confirmKey('\x0aPush\x20'+(_0x3ce977+_0xa030d8)+_0x57d79d(0x1f4));if(!_0x1c1fdd)return console['log'](a4_0x5b8e6c[_0x57d79d(0x1a4)](_0x57d79d(0x162)),_0x57d79d(0x1c5)),0x1;}const {data:_0x5a8b54}=await withSpinner('Pushing\x20to\x20project...',()=>_0x143157[_0x57d79d(0x154)][_0x57d79d(0x1e3)](_0x1c53e5,{'force':_0x2879ea})),_0x388a8a=_0x5a8b54['counts'][_0x57d79d(0x1f3)]['errors']>0x0||_0x5a8b54[_0x57d79d(0x166)][_0x57d79d(0x1c7)][_0x57d79d(0x1c0)]>0x0||_0x5a8b54[_0x57d79d(0x166)][_0x57d79d(0x13b)][_0x57d79d(0x1c0)]>0x0||_0x5a8b54[_0x57d79d(0x166)][_0x57d79d(0x172)][_0x57d79d(0x1c0)]>0x0;if(_0x388a8a){console[_0x57d79d(0x1d1)](a4_0x5b8e6c[_0x57d79d(0x1a4)]('\x0aProject\x20pushed\x20with\x20errors')),console[_0x57d79d(0x1d1)](),console[_0x57d79d(0x1d1)](a4_0x5b8e6c['red'](_0x57d79d(0x1a5)));for(const _0x281cb4 of _0x5a8b54[_0x57d79d(0x1f3)]){_0x281cb4[_0x57d79d(0x15b)]===_0x57d79d(0x13e)&&console[_0x57d79d(0x1d1)](a4_0x5b8e6c[_0x57d79d(0x19e)]('\x20\x20Agent\x20\x22'+_0x281cb4[_0x57d79d(0x1ee)]+_0x57d79d(0x15c)+_0x281cb4[_0x57d79d(0x13e)]));}for(const _0x3ff832 of _0x5a8b54[_0x57d79d(0x1c7)]){_0x3ff832[_0x57d79d(0x15b)]===_0x57d79d(0x13e)&&console[_0x57d79d(0x1d1)](a4_0x5b8e6c['red']('\x20\x20Knowledge\x20Base\x20\x22'+_0x3ff832['name']+_0x57d79d(0x15c)+_0x3ff832['error']));}for(const _0x399fb8 of _0x5a8b54['textKnowledgeBases']){_0x399fb8['action']===_0x57d79d(0x13e)&&console['log'](a4_0x5b8e6c[_0x57d79d(0x19e)](_0x57d79d(0x183)+_0x399fb8[_0x57d79d(0x1a1)]+'\x22:\x20'+_0x399fb8[_0x57d79d(0x13e)]));}for(const _0x2760d2 of _0x5a8b54['prompts']){_0x2760d2[_0x57d79d(0x15b)]==='error'&&console[_0x57d79d(0x1d1)](a4_0x5b8e6c['red'](_0x57d79d(0x194)+_0x2760d2[_0x57d79d(0x1a1)]+_0x57d79d(0x15c)+_0x2760d2[_0x57d79d(0x13e)]));}for(const _0x311345 of _0x5a8b54[_0x57d79d(0x188)]){_0x311345['action']===_0x57d79d(0x13e)&&console[_0x57d79d(0x1d1)](a4_0x5b8e6c[_0x57d79d(0x19e)](_0x57d79d(0x17c)+_0x311345[_0x57d79d(0x1a1)]+'\x22:\x20'+_0x311345['error']));}return 0x1;}console[_0x57d79d(0x1d1)](a4_0x5b8e6c[_0x57d79d(0x19f)](_0x57d79d(0x164)+(_0x3ce977+_0xa030d8)+_0x57d79d(0x17e)+_0x5a8b54[_0x57d79d(0x1ad)]+'\x27'));const _0x32148a=getLLMProjectUrl(_0x8d7e60,_0x5a8b54['projectId']);return console[_0x57d79d(0x1d1)](_0x57d79d(0x181)+a4_0x5b8e6c[_0x57d79d(0x1cd)](_0x32148a)),0x0;}}
1
+ const a4_0x2a9554=a4_0x3164;(function(_0x2ed969,_0x39f3f5){const _0x5d2989=a4_0x3164,_0x67c71f=_0x2ed969();while(!![]){try{const _0x128d34=parseInt(_0x5d2989(0x1b3))/0x1+parseInt(_0x5d2989(0x1ca))/0x2+-parseInt(_0x5d2989(0x14c))/0x3*(-parseInt(_0x5d2989(0x18a))/0x4)+parseInt(_0x5d2989(0x17e))/0x5+parseInt(_0x5d2989(0x1ac))/0x6*(-parseInt(_0x5d2989(0x16d))/0x7)+-parseInt(_0x5d2989(0x15e))/0x8+-parseInt(_0x5d2989(0x1e7))/0x9;if(_0x128d34===_0x39f3f5)break;else _0x67c71f['push'](_0x67c71f['shift']());}catch(_0x458607){_0x67c71f['push'](_0x67c71f['shift']());}}}(a4_0x4aa9,0xd55d0));import a4_0x4bdfdb from'chalk';import a4_0x4eefd6 from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';function a4_0x4aa9(){const _0x53e221=['\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','dirname','new','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','\x20\x20Experimental\x20Artifacts:\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','errors','knowledgeBases','MISSING_ARGUMENT','\x20errors','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','Agent:\x20','tdx.json','textKnowledgeBases','newProjectName','\x20total','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','llm_project','18HUActr','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)','yes','agent:push','Status:\x20','\x20\x20Target:\x20','\x0aWrite\x20','log','isNew','Using\x20project\x20from\x20context:\x20','action','\x20changed','Chat:\x20','push','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','cloneProject','no_local_folder','Dry\x20run\x20-\x20no\x20files\x20written','7530320qNkaZa','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','Project\x20cloned\x20with\x20errors','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','red','pullProject','sourceProjectName','Using\x20project\x20from\x20','\x20new','Analyzing\x20changes\x20to\x20push...','integrations','\x20updated','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','-\x20nothing\x20pushed','5810bIEYwg','\x20\x20Prompts:\x20','output','agentName','newProjectId','\x20\x20Integration\x20\x22','no_context','\x20\x20Agent\x20\x22','✔\x20Context\x20set:\x20','green','projectName','\x20\x20Agents:\x20','session','Project\x20cloned\x20successfully','New\x20project:\x20','\x20--profile\x20','error','4566180fCpAiJ','\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','projectDir','source','agentId','\x22:\x20','pushProject','cyan','Errors:','hasChanges','Dry\x20run\x20-\x20no\x20changes\x20made','Analyzing\x20project\x20\x22','743144bXRNRX','\x22\x20to\x20new\x20project\x20\x22','\x20--name\x20','\x20\x20Integrations:\x20','\x20\x20Source:\x20','diff','Using\x20context\x20project:\x20','updated','New\x20project\x20name\x20is\x20required','force','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','cwd-config','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','prompts','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','\x20\x20Prompt\x20\x22','experimentalKnowledgeBases','dryRun','cwd','Output:\x20','\x0aChanges\x20to\x20prompt\x20\x27','name','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','No\x20tdx.json\x20found\x20in\x20','agent:pull','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','join','\x20|\x20','utf-8','\x20\x20Text\x20Knowledge\x20Base\x20\x22','\x20files?','site','agent','594iNCvAz','agents','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','\x22\x20from\x20project\x20\x22','Using\x20current\x20project:\x20','\x20\x20Experimental\x20Artifact\x20\x22','agent:clone','619012fSaCGw','\x0a✔\x20Pulled\x20','Cloning\x20\x22','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','gray','Would\x20pull\x20agent:\x20','Agent\x20','unchanged','llmProject','\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','message','\x22\x20to\x20a\x20different\x20profile','<new-name>','arg-dir','\x20\x20tdx\x20agent\x20pull\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','parse','projectId','counts','Project:\x20','dim','\x20unchanged','llm','3213446BNdywo','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','\x20\x20Knowledge\x20Base\x20\x22','\x0aErrors\x20found:','Writing\x20files...','agent.yml','experimentalArtifacts','yellow','reason','\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)','outputPath','Cannot\x20clone\x20from\x20context\x20project\x20\x22','description','Summary:','repeat','\x27\x20to\x20create\x20the\x20folder\x20structure.','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','\x20\x20Text\x20Knowledge\x20Bases:\x20','found','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','Source:\x20','\x0aChanges:','Pulling\x20agent\x20\x22','context','\x20\x20tdx\x20agent\x20clone\x20agents/','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','\x22\x20to\x20\x22','\x22...','execute','21206619jigivx','Failed\x20to\x20push\x20agent:\x20','\x0aPush\x20summary\x20for\x20\x27','\x0aChanges\x20to\x20agent\x20\x27','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','created','\x20created','total','-\x20no\x20files\x20written','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','New\x20project\x20ID:\x20','\x20\x20Knowledge\x20Bases:\x20','INVALID_ARGUMENT','Pushing\x20to\x20project...','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>'];a4_0x4aa9=function(){return _0x53e221;};return a4_0x4aa9();}import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';function a4_0x3164(_0xbc422f,_0x3fee01){_0xbc422f=_0xbc422f-0x147;const _0x4aa93=a4_0x4aa9();let _0x3164b4=_0x4aa93[_0xbc422f];return _0x3164b4;}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(_0x51f84c){const _0x480b5c=a4_0x3164,_0x5c5b4a=[];if(_0x51f84c[_0x480b5c(0x1ee)]!==undefined)_0x5c5b4a[_0x480b5c(0x159)](_0x51f84c[_0x480b5c(0x1ee)]+_0x480b5c(0x149));if(_0x51f84c[_0x480b5c(0x1f8)]!==undefined&&_0x51f84c[_0x480b5c(0x1f8)]>0x0)_0x5c5b4a[_0x480b5c(0x159)](a4_0x4bdfdb['green'](_0x51f84c['new']+'\x20new'));if(_0x51f84c[_0x480b5c(0x1ec)]!==undefined&&_0x51f84c[_0x480b5c(0x1ec)]>0x0)_0x5c5b4a[_0x480b5c(0x159)](a4_0x4bdfdb[_0x480b5c(0x176)](_0x51f84c['created']+_0x480b5c(0x1ed)));if(_0x51f84c[_0x480b5c(0x191)]!==undefined&&_0x51f84c[_0x480b5c(0x191)]>0x0)_0x5c5b4a['push'](a4_0x4bdfdb[_0x480b5c(0x1d1)](_0x51f84c[_0x480b5c(0x191)]+_0x480b5c(0x16a)));if(_0x51f84c[_0x480b5c(0x1ba)]!==undefined&&_0x51f84c['unchanged']>0x0)_0x5c5b4a[_0x480b5c(0x159)](a4_0x4bdfdb[_0x480b5c(0x1b7)](_0x51f84c['unchanged']+_0x480b5c(0x1c8)));if(_0x51f84c[_0x480b5c(0x1fc)]!==undefined&&_0x51f84c[_0x480b5c(0x1fc)]>0x0)_0x5c5b4a[_0x480b5c(0x159)](a4_0x4bdfdb[_0x480b5c(0x163)](_0x51f84c[_0x480b5c(0x1fc)]+_0x480b5c(0x1ff)));return _0x5c5b4a[_0x480b5c(0x1a5)](',\x20');}function displayDiffs(_0x191956,_0x2fc36a,_0x4e5016,_0x198246,_0xe02995,_0x965952,_0x10591b){const _0x42a0d6=a4_0x3164;for(const _0x595063 of _0x191956){if(_0x595063[_0x42a0d6(0x18f)]){const _0x264b9b=_0x595063[_0x42a0d6(0x170)]||_0x595063['name'];console[_0x42a0d6(0x153)](_0x42a0d6(0x1ea)+_0x264b9b+'\x27:'),console[_0x42a0d6(0x153)]('─'[_0x42a0d6(0x1d8)](0x3c)),console[_0x42a0d6(0x153)](_0x595063[_0x42a0d6(0x18f)]),console[_0x42a0d6(0x153)]('─'[_0x42a0d6(0x1d8)](0x3c));}}for(const _0x4c0d50 of _0x2fc36a){_0x4c0d50[_0x42a0d6(0x18f)]&&(console[_0x42a0d6(0x153)](_0x42a0d6(0x1dd)+_0x4c0d50[_0x42a0d6(0x19f)]+'\x27:'),console[_0x42a0d6(0x153)]('─'[_0x42a0d6(0x1d8)](0x3c)),console[_0x42a0d6(0x153)](_0x4c0d50['diff']),console[_0x42a0d6(0x153)]('─'[_0x42a0d6(0x1d8)](0x3c)));}for(const _0x5351e7 of _0x4e5016){_0x5351e7[_0x42a0d6(0x18f)]&&(console['log']('\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27'+_0x5351e7[_0x42a0d6(0x19f)]+'\x27:'),console[_0x42a0d6(0x153)]('─'[_0x42a0d6(0x1d8)](0x3c)),console[_0x42a0d6(0x153)](_0x5351e7[_0x42a0d6(0x18f)]),console[_0x42a0d6(0x153)]('─'['repeat'](0x3c)));}for(const _0x152deb of _0x198246){_0x152deb[_0x42a0d6(0x18f)]&&(console[_0x42a0d6(0x153)](_0x42a0d6(0x19e)+_0x152deb[_0x42a0d6(0x19f)]+'\x27:'),console['log']('─'[_0x42a0d6(0x1d8)](0x3c)),console[_0x42a0d6(0x153)](_0x152deb['diff']),console[_0x42a0d6(0x153)]('─'[_0x42a0d6(0x1d8)](0x3c)));}for(const _0x5af568 of _0xe02995){_0x5af568['diff']&&(console['log']('\x0aChanges\x20to\x20integration\x20\x27'+_0x5af568['name']+'\x27:'),console[_0x42a0d6(0x153)]('─'[_0x42a0d6(0x1d8)](0x3c)),console[_0x42a0d6(0x153)](_0x5af568['diff']),console[_0x42a0d6(0x153)]('─'['repeat'](0x3c)));}for(const _0x3f53e0 of _0x965952){_0x3f53e0[_0x42a0d6(0x18f)]&&(console['log'](_0x42a0d6(0x198)+_0x3f53e0[_0x42a0d6(0x19f)]+'\x27:'),console[_0x42a0d6(0x153)]('─'[_0x42a0d6(0x1d8)](0x3c)),console[_0x42a0d6(0x153)](_0x3f53e0[_0x42a0d6(0x18f)]),console[_0x42a0d6(0x153)]('─'[_0x42a0d6(0x1d8)](0x3c)));}for(const _0x348187 of _0x10591b){_0x348187[_0x42a0d6(0x18f)]&&(console[_0x42a0d6(0x153)]('\x0aChanges\x20to\x20experimental\x20artifact\x20\x27'+_0x348187[_0x42a0d6(0x19f)]+'\x27:'),console[_0x42a0d6(0x153)]('─'[_0x42a0d6(0x1d8)](0x3c)),console[_0x42a0d6(0x153)](_0x348187[_0x42a0d6(0x18f)]),console['log']('─'[_0x42a0d6(0x1d8)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x2a9554(0x19f)]=a4_0x2a9554(0x1a3);[a4_0x2a9554(0x1d6)]=a4_0x2a9554(0x196);async['execute'](_0x447eb7){const _0xce33d1=a4_0x2a9554,{options:_0x9f532d,args:_0x4cdbb2,tdx:_0x1fecad}=_0x447eb7,_0x55564c=_0x4cdbb2[0x0],_0xdba2fd=_0x4cdbb2[0x1],_0x524bd1=_0x9f532d[_0xce33d1(0x16f)],_0x2b6828=_0x9f532d[_0xce33d1(0x19b)],_0x5e61d9=_0x9f532d[_0xce33d1(0x193)],_0x19fc2c=_0x9f532d[_0xce33d1(0x14e)],_0x5cf537=_0x9f532d['llmProject'],_0x583ca3=_0x9f532d[_0xce33d1(0x1ab)];let _0x2fca9f;if(_0x55564c){const _0x443503=a4_0x4eefd6[_0xce33d1(0x1a5)](_0x55564c,_0xce33d1(0x202));if(existsSync(_0x443503))try{const _0x41386e=JSON[_0xce33d1(0x1c3)](readFileSync(_0x443503,_0xce33d1(0x1a7)));_0x41386e[_0xce33d1(0x14b)]&&(_0x2fca9f={'llm_project':_0x41386e[_0xce33d1(0x14b)]});}catch{}}const _0x2c5b28=findAgentConfigPath(process[_0xce33d1(0x19c)]());let _0x431df9;if(_0x2c5b28)try{const _0x36471e=JSON['parse'](readFileSync(_0x2c5b28,'utf-8'));_0x36471e[_0xce33d1(0x14b)]&&(_0x431df9={'llm_project':_0x36471e[_0xce33d1(0x14b)]});}catch{}const _0x5cb515=resolveAgentPullArgs({'arg':_0x55564c,'agentNameArg':_0xdba2fd,'agentFlag':_0x583ca3,'contextProject':_0x5cf537,'argDirConfig':_0x2fca9f,'cwdConfigPath':_0x2c5b28||undefined,'cwdConfig':_0x431df9}),{projectNameOrId:_0x36abd0,targetAgentName:_0x54ede0,existingOutputDir:_0x24e2a3,source:_0x4e2447}=_0x5cb515;if(_0x4e2447===_0xce33d1(0x1c0))console[_0xce33d1(0x153)](a4_0x4bdfdb[_0xce33d1(0x1c7)](_0xce33d1(0x166)+a4_0x4eefd6[_0xce33d1(0x1a5)](_0x55564c,_0xce33d1(0x202))+':\x20'+_0x36abd0));else{if(_0x4e2447===_0xce33d1(0x195))console['log'](a4_0x4bdfdb[_0xce33d1(0x1c7)]('Using\x20project:\x20'+_0x36abd0));else _0x4e2447===_0xce33d1(0x1e1)&&console[_0xce33d1(0x153)](a4_0x4bdfdb['dim'](_0xce33d1(0x155)+_0x36abd0));}if(!_0x36abd0)return _0x583ca3?(console[_0xce33d1(0x153)](a4_0x4bdfdb[_0xce33d1(0x1d1)](_0xce33d1(0x15f))),console[_0xce33d1(0x153)](_0xce33d1(0x1a4)),console['log'](_0xce33d1(0x161))):(console[_0xce33d1(0x153)](a4_0x4bdfdb[_0xce33d1(0x1d1)](_0xce33d1(0x162))),console[_0xce33d1(0x153)](_0xce33d1(0x14d)),console[_0xce33d1(0x153)](_0xce33d1(0x17f)),console[_0xce33d1(0x153)]('\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[_0xce33d1(0x153)](_0xce33d1(0x1f6)),console[_0xce33d1(0x153)](_0xce33d1(0x1bc))),0x1;if(_0x54ede0){const {data:_0x420dbf}=await withSpinner(_0xce33d1(0x1e0)+_0x54ede0+_0xce33d1(0x1af)+_0x36abd0+_0xce33d1(0x1e5),()=>_0x1fecad['llm']['pullAgent'](_0x36abd0,_0x54ede0,_0x524bd1,{'dryRun':_0x2b6828,'force':_0x5e61d9}));if(_0x2b6828)return console[_0xce33d1(0x153)](a4_0x4bdfdb['yellow'](_0xce33d1(0x15d))),console['log'](_0xce33d1(0x1b8)+_0x420dbf[_0xce33d1(0x170)]),console[_0xce33d1(0x153)]('Output\x20path:\x20'+_0x420dbf['outputPath']),_0x420dbf['diff']&&(console[_0xce33d1(0x153)](_0xce33d1(0x1df)),console['log']('─'['repeat'](0x3c)),console[_0xce33d1(0x153)](_0x420dbf['diff']),console[_0xce33d1(0x153)]('─'[_0xce33d1(0x1d8)](0x3c))),0x0;return console['log'](a4_0x4bdfdb[_0xce33d1(0x176)]('Agent\x20pulled\x20successfully')),console[_0xce33d1(0x153)](_0xce33d1(0x201)+_0x420dbf[_0xce33d1(0x170)]),console['log'](_0xce33d1(0x19d)+_0x420dbf[_0xce33d1(0x1d4)]),console['log'](_0xce33d1(0x150)+(_0x420dbf[_0xce33d1(0x154)]?a4_0x4bdfdb[_0xce33d1(0x176)]('new'):_0x420dbf[_0xce33d1(0x187)]?a4_0x4bdfdb[_0xce33d1(0x1d1)](_0xce33d1(0x191)):a4_0x4bdfdb[_0xce33d1(0x1b7)](_0xce33d1(0x1ba)))),0x0;}const _0x193932=_0x24e2a3||_0x524bd1,{data:_0x2a318a}=await withSpinner(_0xce33d1(0x189)+_0x36abd0+_0xce33d1(0x1e5),()=>_0x1fecad[_0xce33d1(0x1c9)]['pullProject'](_0x36abd0,_0x193932,{'dryRun':!![]})),_0x48f0b3=_0x2a318a['counts'][_0xce33d1(0x1ad)][_0xce33d1(0x1f8)]+_0x2a318a['counts']['knowledgeBases'][_0xce33d1(0x1f8)]+_0x2a318a['counts'][_0xce33d1(0x147)][_0xce33d1(0x1f8)]+_0x2a318a['counts'][_0xce33d1(0x197)]['new']+_0x2a318a['counts'][_0xce33d1(0x169)][_0xce33d1(0x1f8)]+_0x2a318a[_0xce33d1(0x1c5)]['experimentalKnowledgeBases'][_0xce33d1(0x1f8)]+_0x2a318a[_0xce33d1(0x1c5)][_0xce33d1(0x1d0)][_0xce33d1(0x1f8)],_0xe7a83=_0x2a318a['counts'][_0xce33d1(0x1ad)][_0xce33d1(0x191)]+_0x2a318a[_0xce33d1(0x1c5)][_0xce33d1(0x1fd)][_0xce33d1(0x191)]+_0x2a318a[_0xce33d1(0x1c5)][_0xce33d1(0x147)]['updated']+_0x2a318a[_0xce33d1(0x1c5)][_0xce33d1(0x197)]['updated']+_0x2a318a['counts'][_0xce33d1(0x169)][_0xce33d1(0x191)]+_0x2a318a[_0xce33d1(0x1c5)][_0xce33d1(0x19a)][_0xce33d1(0x191)]+_0x2a318a['counts'][_0xce33d1(0x1d0)][_0xce33d1(0x191)],_0x399e54=_0x2a318a[_0xce33d1(0x1c5)][_0xce33d1(0x1ad)][_0xce33d1(0x1ba)]+_0x2a318a[_0xce33d1(0x1c5)][_0xce33d1(0x1fd)][_0xce33d1(0x1ba)]+_0x2a318a[_0xce33d1(0x1c5)]['textKnowledgeBases'][_0xce33d1(0x1ba)]+_0x2a318a['counts']['prompts'][_0xce33d1(0x1ba)]+_0x2a318a[_0xce33d1(0x1c5)][_0xce33d1(0x169)]['unchanged']+_0x2a318a[_0xce33d1(0x1c5)]['experimentalKnowledgeBases']['unchanged']+_0x2a318a[_0xce33d1(0x1c5)][_0xce33d1(0x1d0)]['unchanged'];console[_0xce33d1(0x153)]('\x0aPull\x20summary\x20for\x20\x27'+_0x2a318a[_0xce33d1(0x177)]+'\x27:'),console[_0xce33d1(0x153)]('\x20\x20'+a4_0x4bdfdb[_0xce33d1(0x176)]('+\x20'+_0x48f0b3+_0xce33d1(0x167))+_0xce33d1(0x1a6)+a4_0x4bdfdb[_0xce33d1(0x1d1)]('~\x20'+_0xe7a83+_0xce33d1(0x157))+_0xce33d1(0x1a6)+a4_0x4bdfdb[_0xce33d1(0x1c7)]('=\x20'+_0x399e54+'\x20unchanged')),console[_0xce33d1(0x153)]('\x20\x20Agents:\x20'+formatCountSummary(_0x2a318a[_0xce33d1(0x1c5)][_0xce33d1(0x1ad)])),console[_0xce33d1(0x153)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x2a318a[_0xce33d1(0x1c5)][_0xce33d1(0x1fd)])),console[_0xce33d1(0x153)](_0xce33d1(0x1db)+formatCountSummary(_0x2a318a[_0xce33d1(0x1c5)][_0xce33d1(0x147)])),console[_0xce33d1(0x153)](_0xce33d1(0x16e)+formatCountSummary(_0x2a318a[_0xce33d1(0x1c5)]['prompts'])),console['log'](_0xce33d1(0x18d)+formatCountSummary(_0x2a318a[_0xce33d1(0x1c5)][_0xce33d1(0x169)]));const _0x1d8bea=_0x2a318a['counts'][_0xce33d1(0x19a)][_0xce33d1(0x1ee)]>0x0||_0x2a318a[_0xce33d1(0x1c5)][_0xce33d1(0x1d0)][_0xce33d1(0x1ee)]>0x0;_0x1d8bea&&(console['log']('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x2a318a['counts']['experimentalKnowledgeBases'])),console[_0xce33d1(0x153)](_0xce33d1(0x1fa)+formatCountSummary(_0x2a318a[_0xce33d1(0x1c5)][_0xce33d1(0x1d0)])));console['log'](_0xce33d1(0x151)+a4_0x4bdfdb['cyan'](_0x2a318a['outputDir'])),displayDiffs(_0x2a318a[_0xce33d1(0x1ad)],_0x2a318a[_0xce33d1(0x1fd)],_0x2a318a['textKnowledgeBases'],_0x2a318a[_0xce33d1(0x197)],_0x2a318a['integrations'],_0x2a318a[_0xce33d1(0x19a)],_0x2a318a[_0xce33d1(0x1d0)]);if(_0x2b6828)return console[_0xce33d1(0x153)](a4_0x4bdfdb[_0xce33d1(0x1d1)](_0xce33d1(0x1f0))),0x0;if(_0x48f0b3===0x0&&_0xe7a83===0x0)return console['log'](a4_0x4bdfdb[_0xce33d1(0x176)](_0xce33d1(0x1ae))),saveSessionContext({'llm_project':_0x2a318a['projectName']},_0x9f532d[_0xce33d1(0x179)]),console['log'](a4_0x4bdfdb['green'](_0xce33d1(0x175)+a4_0x4bdfdb['dim'](_0xce33d1(0x14b))+'\x20=\x20'+a4_0x4bdfdb[_0xce33d1(0x185)](_0x2a318a[_0xce33d1(0x177)]))),0x0;if(!_0x19fc2c&&!_0x5e61d9){if(!isInteractive())return console[_0xce33d1(0x17d)](a4_0x4bdfdb[_0xce33d1(0x163)]('\x0aError:'),_0xce33d1(0x1c2)),console[_0xce33d1(0x17d)](a4_0x4bdfdb[_0xce33d1(0x1c7)](_0xce33d1(0x1fb))),0x1;const _0x48ee63=await confirmKey(_0xce33d1(0x152)+(_0x48f0b3+_0xe7a83)+_0xce33d1(0x1a9));if(!_0x48ee63)return console[_0xce33d1(0x153)](a4_0x4bdfdb[_0xce33d1(0x1d1)]('Cancelled'),_0xce33d1(0x1ef)),0x1;}const {data:_0x481b63}=await withSpinner(_0xce33d1(0x1ce),()=>_0x1fecad[_0xce33d1(0x1c9)][_0xce33d1(0x164)](_0x36abd0,_0x193932,{'force':_0x5e61d9}));return console['log'](a4_0x4bdfdb[_0xce33d1(0x176)](_0xce33d1(0x1b4)+(_0x48f0b3+_0xe7a83)+'\x20files\x20to\x20'+_0x481b63['outputDir'])),saveSessionContext({'llm_project':_0x481b63[_0xce33d1(0x177)]},_0x9f532d[_0xce33d1(0x179)]),console[_0xce33d1(0x153)](a4_0x4bdfdb['green'](_0xce33d1(0x175)+a4_0x4bdfdb[_0xce33d1(0x1c7)](_0xce33d1(0x14b))+'\x20=\x20'+a4_0x4bdfdb['cyan'](_0x481b63[_0xce33d1(0x177)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x2a9554(0x19f)]=a4_0x2a9554(0x1b2);[a4_0x2a9554(0x1d6)]=a4_0x2a9554(0x1da);async[a4_0x2a9554(0x1e6)](_0x1d277c){const _0x1b4d63=a4_0x2a9554,{options:_0x1ca64f,args:_0x244b00,tdx:_0x3fd57c}=_0x1d277c,_0x3ddf99=_0x244b00[0x0],_0xea6279=_0x1ca64f[_0x1b4d63(0x19f)],_0x2b06c2=_0x1ca64f['dryRun'],_0x443d70=_0x1ca64f['yes'],_0x2418cb=_0x1ca64f['site'],_0x5287a8=_0x1ca64f[_0x1b4d63(0x1bb)];let _0x32780b;const _0x17031f=findAgentConfigPath(process[_0x1b4d63(0x19c)]());if(_0x3ddf99){const _0x4d870e=a4_0x4eefd6[_0x1b4d63(0x1a5)](_0x3ddf99,_0x1b4d63(0x202));existsSync(_0x4d870e)?(_0x32780b=_0x3ddf99,console[_0x1b4d63(0x153)](a4_0x4bdfdb[_0x1b4d63(0x1c7)]('Using\x20local\x20project:\x20'+_0x3ddf99))):_0x32780b=_0x3ddf99;}else{if(_0x17031f)_0x32780b=a4_0x4eefd6['dirname'](_0x17031f),console['log'](a4_0x4bdfdb['dim'](_0x1b4d63(0x1b0)+_0x32780b));else{if(_0x5287a8){const _0x5367be=sanitizeForFilesystem(_0x5287a8);let _0x633a64=_0x5367be,_0x5dd461=a4_0x4eefd6[_0x1b4d63(0x1a5)](process[_0x1b4d63(0x19c)](),_0x1b4d63(0x1ad),_0x5367be,'tdx.json');if(!existsSync(_0x5dd461)){const _0x52575c=normalizeName(_0x5287a8),_0xf47bf=a4_0x4eefd6[_0x1b4d63(0x1a5)](process['cwd'](),_0x1b4d63(0x1ad),_0x52575c,_0x1b4d63(0x202));existsSync(_0xf47bf)&&(_0x633a64=_0x52575c,_0x5dd461=_0xf47bf);}if(existsSync(_0x5dd461))_0x32780b=a4_0x4eefd6[_0x1b4d63(0x1f7)](_0x5dd461),console[_0x1b4d63(0x153)](a4_0x4bdfdb[_0x1b4d63(0x1c7)]('Using\x20local\x20project:\x20'+_0x32780b));else{const _0x505e4a=_0x1ca64f['profile'];if(_0x505e4a)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x1b4d63(0x1d5)+_0x5287a8+_0x1b4d63(0x1be),undefined,{'helpText':_0x1b4d63(0x1cb)+_0x1b4d63(0x1a0)+(_0x1b4d63(0x1c1)+_0x5287a8+'\x0a')+(_0x1b4d63(0x1e2)+_0x633a64+_0x1b4d63(0x18c)+(_0xea6279||_0x1b4d63(0x1bf))+_0x1b4d63(0x17c)+_0x505e4a)});_0x32780b=_0x5287a8,console['log'](a4_0x4bdfdb[_0x1b4d63(0x1c7)](_0x1b4d63(0x190)+_0x5287a8));}}}}if(!_0x32780b)return console[_0x1b4d63(0x153)](a4_0x4bdfdb[_0x1b4d63(0x1d1)](_0x1b4d63(0x14a))),console[_0x1b4d63(0x153)](_0x1b4d63(0x194)),console[_0x1b4d63(0x153)](_0x1b4d63(0x15a)),console[_0x1b4d63(0x153)](_0x1b4d63(0x1d3)),console[_0x1b4d63(0x153)](_0x1b4d63(0x1f5)),0x1;if(!_0xea6279)throw new SDKError(ErrorCode[_0x1b4d63(0x1fe)],_0x1b4d63(0x192),undefined,{'helpText':_0x1b4d63(0x1eb)});if(!_0x443d70&&!_0x2b06c2){if(!isInteractive())return console[_0x1b4d63(0x17d)](a4_0x4bdfdb[_0x1b4d63(0x163)]('\x0aError:'),_0x1b4d63(0x1c2)),console[_0x1b4d63(0x17d)](a4_0x4bdfdb[_0x1b4d63(0x1c7)](_0x1b4d63(0x1fb))),0x1;const _0x57fc51=await confirmKey('Clone\x20\x22'+_0x32780b+_0x1b4d63(0x18b)+_0xea6279+'\x22?');if(!_0x57fc51)return console[_0x1b4d63(0x153)](a4_0x4bdfdb[_0x1b4d63(0x1d1)]('Cancelled')),0x1;}const {data:_0x45b31c}=await withSpinner(_0x1b4d63(0x1b5)+_0x32780b+_0x1b4d63(0x1e4)+_0xea6279+_0x1b4d63(0x1e5),()=>_0x3fd57c[_0x1b4d63(0x1c9)][_0x1b4d63(0x15b)](_0x32780b,_0xea6279,{'dryRun':_0x2b06c2}));if(_0x2b06c2){console[_0x1b4d63(0x153)](a4_0x4bdfdb['yellow'](_0x1b4d63(0x188))),console[_0x1b4d63(0x153)](_0x1b4d63(0x1de)+_0x45b31c[_0x1b4d63(0x165)]),console[_0x1b4d63(0x153)](_0x1b4d63(0x17b)+_0xea6279),console[_0x1b4d63(0x153)]('Would\x20clone:'),console['log'](_0x1b4d63(0x178)+_0x45b31c[_0x1b4d63(0x1c5)][_0x1b4d63(0x1ad)]['created']),console[_0x1b4d63(0x153)]('\x20\x20Knowledge\x20Bases:\x20'+_0x45b31c[_0x1b4d63(0x1c5)][_0x1b4d63(0x1fd)][_0x1b4d63(0x1ec)]),console[_0x1b4d63(0x153)]('\x20\x20Prompts:\x20'+_0x45b31c[_0x1b4d63(0x1c5)]['prompts'][_0x1b4d63(0x1ec)]);const _0x10e158=_0x45b31c[_0x1b4d63(0x1c5)][_0x1b4d63(0x19a)][_0x1b4d63(0x1ec)]>0x0||_0x45b31c[_0x1b4d63(0x1c5)]['experimentalArtifacts'][_0x1b4d63(0x1ec)]>0x0;return _0x10e158&&(console[_0x1b4d63(0x153)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+_0x45b31c[_0x1b4d63(0x1c5)][_0x1b4d63(0x19a)][_0x1b4d63(0x1ec)]),console[_0x1b4d63(0x153)](_0x1b4d63(0x1fa)+_0x45b31c[_0x1b4d63(0x1c5)][_0x1b4d63(0x1d0)][_0x1b4d63(0x1ec)])),0x0;}const _0x9db53d=_0x45b31c['counts'][_0x1b4d63(0x1ad)][_0x1b4d63(0x1fc)]>0x0||_0x45b31c[_0x1b4d63(0x1c5)][_0x1b4d63(0x1fd)]['errors']>0x0||_0x45b31c[_0x1b4d63(0x1c5)][_0x1b4d63(0x197)][_0x1b4d63(0x1fc)]>0x0||_0x45b31c[_0x1b4d63(0x1c5)][_0x1b4d63(0x19a)]['errors']>0x0||_0x45b31c['counts']['experimentalArtifacts'][_0x1b4d63(0x1fc)]>0x0;_0x9db53d?console[_0x1b4d63(0x153)](a4_0x4bdfdb[_0x1b4d63(0x1d1)](_0x1b4d63(0x160))):console[_0x1b4d63(0x153)](a4_0x4bdfdb[_0x1b4d63(0x176)](_0x1b4d63(0x17a)));console[_0x1b4d63(0x153)](_0x1b4d63(0x1de)+_0x45b31c['sourceProjectName']),console[_0x1b4d63(0x153)](_0x1b4d63(0x17b)+_0x45b31c[_0x1b4d63(0x148)]),console['log'](_0x1b4d63(0x1f1)+_0x45b31c['newProjectId']),console['log'](),console['log'](_0x1b4d63(0x1d7)),console['log']('\x20\x20Agents:\x20'+formatCountSummary(_0x45b31c[_0x1b4d63(0x1c5)][_0x1b4d63(0x1ad)])),console[_0x1b4d63(0x153)](_0x1b4d63(0x1f2)+formatCountSummary(_0x45b31c[_0x1b4d63(0x1c5)][_0x1b4d63(0x1fd)])),console[_0x1b4d63(0x153)](_0x1b4d63(0x16e)+formatCountSummary(_0x45b31c[_0x1b4d63(0x1c5)][_0x1b4d63(0x197)])),console[_0x1b4d63(0x153)](_0x1b4d63(0x18d)+formatCountSummary(_0x45b31c[_0x1b4d63(0x1c5)][_0x1b4d63(0x169)]));const _0x51426a=_0x45b31c[_0x1b4d63(0x1c5)][_0x1b4d63(0x19a)][_0x1b4d63(0x1ec)]>0x0||_0x45b31c[_0x1b4d63(0x1c5)]['experimentalKnowledgeBases'][_0x1b4d63(0x191)]>0x0||_0x45b31c[_0x1b4d63(0x1c5)]['experimentalKnowledgeBases']['unchanged']>0x0||_0x45b31c['counts'][_0x1b4d63(0x1d0)][_0x1b4d63(0x1ec)]>0x0||_0x45b31c[_0x1b4d63(0x1c5)][_0x1b4d63(0x1d0)]['updated']>0x0||_0x45b31c[_0x1b4d63(0x1c5)]['experimentalArtifacts'][_0x1b4d63(0x1ba)]>0x0;_0x51426a&&(console[_0x1b4d63(0x153)](_0x1b4d63(0x1a1)+formatCountSummary(_0x45b31c['counts'][_0x1b4d63(0x19a)])),console['log'](_0x1b4d63(0x1fa)+formatCountSummary(_0x45b31c['counts']['experimentalArtifacts'])));if(_0x9db53d){console[_0x1b4d63(0x153)](),console['log'](a4_0x4bdfdb[_0x1b4d63(0x163)]('Errors:'));for(const _0x5cf569 of _0x45b31c[_0x1b4d63(0x1ad)]){_0x5cf569[_0x1b4d63(0x156)]==='error'&&console[_0x1b4d63(0x153)](a4_0x4bdfdb['red'](_0x1b4d63(0x174)+_0x5cf569[_0x1b4d63(0x170)]+_0x1b4d63(0x183)+_0x5cf569[_0x1b4d63(0x17d)]));}for(const _0x30f77b of _0x45b31c[_0x1b4d63(0x1fd)]){_0x30f77b[_0x1b4d63(0x156)]===_0x1b4d63(0x17d)&&console[_0x1b4d63(0x153)](a4_0x4bdfdb[_0x1b4d63(0x163)](_0x1b4d63(0x1cc)+_0x30f77b[_0x1b4d63(0x19f)]+_0x1b4d63(0x183)+_0x30f77b[_0x1b4d63(0x17d)]));}for(const _0x3c8e60 of _0x45b31c[_0x1b4d63(0x197)]){_0x3c8e60[_0x1b4d63(0x156)]===_0x1b4d63(0x17d)&&console[_0x1b4d63(0x153)](a4_0x4bdfdb[_0x1b4d63(0x163)](_0x1b4d63(0x199)+_0x3c8e60['name']+_0x1b4d63(0x183)+_0x3c8e60[_0x1b4d63(0x17d)]));}for(const _0x299283 of _0x45b31c['integrations']){_0x299283['action']==='error'&&console[_0x1b4d63(0x153)](a4_0x4bdfdb['red'](_0x1b4d63(0x172)+_0x299283[_0x1b4d63(0x19f)]+'\x22:\x20'+_0x299283[_0x1b4d63(0x17d)]));}for(const _0x41c7eb of _0x45b31c['experimentalKnowledgeBases']){_0x41c7eb[_0x1b4d63(0x156)]===_0x1b4d63(0x17d)&&console[_0x1b4d63(0x153)](a4_0x4bdfdb[_0x1b4d63(0x163)](_0x1b4d63(0x16b)+_0x41c7eb[_0x1b4d63(0x19f)]+'\x22:\x20'+_0x41c7eb[_0x1b4d63(0x17d)]));}for(const _0x38f3d1 of _0x45b31c['experimentalArtifacts']){_0x38f3d1['action']===_0x1b4d63(0x17d)&&console[_0x1b4d63(0x153)](a4_0x4bdfdb[_0x1b4d63(0x163)](_0x1b4d63(0x1b1)+_0x38f3d1[_0x1b4d63(0x19f)]+_0x1b4d63(0x183)+_0x38f3d1[_0x1b4d63(0x17d)]));}return 0x1;}console[_0x1b4d63(0x153)]();const _0x35fb2d=getLLMProjectUrl(_0x2418cb,_0x45b31c[_0x1b4d63(0x171)]);return console[_0x1b4d63(0x153)](_0x1b4d63(0x1c6)+a4_0x4bdfdb[_0x1b4d63(0x185)](_0x35fb2d)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x2a9554(0x19f)]=a4_0x2a9554(0x14f);[a4_0x2a9554(0x1d6)]='Push\x20local\x20agent\x20files\x20to\x20LLM\x20project';async[a4_0x2a9554(0x1e6)](_0x38957b){const _0x134f66=a4_0x2a9554,{options:_0x3d0213,args:_0xaabd73,tdx:_0xfb119f}=_0x38957b;let _0x40d9b7=_0xaabd73[0x0]||process[_0x134f66(0x19c)]();const _0x3fec86=_0x3d0213[_0x134f66(0x19b)],_0x47bfed=_0x3d0213[_0x134f66(0x193)],_0x2b183d=_0x3d0213[_0x134f66(0x14e)],_0x5e185e=_0x3d0213[_0x134f66(0x1aa)],_0x1a9506=a4_0x4eefd6[_0x134f66(0x1a5)](_0x40d9b7,_0x134f66(0x1cf)),_0x1b9f88=existsSync(_0x1a9506);if(_0x1b9f88){const {data:_0x43ce19}=await withSpinner('Pushing\x20agent\x20from\x20\x22'+_0x40d9b7+_0x134f66(0x1e5),()=>_0xfb119f[_0x134f66(0x1c9)]['pushAgent'](_0x40d9b7,{'dryRun':_0x3fec86,'force':_0x47bfed}));if(_0x3fec86)return console[_0x134f66(0x153)](a4_0x4bdfdb['yellow'](_0x134f66(0x188))),console[_0x134f66(0x153)]('Would\x20push\x20agent:\x20'+_0x43ce19[_0x134f66(0x170)]),0x0;if(_0x43ce19[_0x134f66(0x156)]==='error')return console[_0x134f66(0x153)](a4_0x4bdfdb[_0x134f66(0x163)](_0x134f66(0x1e8)+_0x43ce19['error'])),0x1;console['log'](a4_0x4bdfdb[_0x134f66(0x176)](_0x134f66(0x1b9)+_0x43ce19[_0x134f66(0x156)]+'\x20successfully')),console[_0x134f66(0x153)](_0x134f66(0x201)+_0x43ce19[_0x134f66(0x170)]);if(_0x43ce19[_0x134f66(0x182)]&&_0x43ce19[_0x134f66(0x1c4)]){const _0x35c17c=getLLMAgentChatUrl(_0x5e185e,_0x43ce19['projectId'],_0x43ce19[_0x134f66(0x182)]);console['log'](_0x134f66(0x158)+a4_0x4bdfdb[_0x134f66(0x185)](_0x35c17c));}return 0x0;}const _0x37acf0=_0x3d0213[_0x134f66(0x1bb)],_0x519721=resolveProjectFromContext(_0x40d9b7,_0x37acf0);if(_0x519721[_0x134f66(0x1dc)])_0x40d9b7=_0x519721[_0x134f66(0x180)],_0x519721[_0x134f66(0x181)]===_0x134f66(0x1e1)&&console[_0x134f66(0x153)](a4_0x4bdfdb[_0x134f66(0x1c7)]('Using\x20project:\x20'+_0x40d9b7));else{let _0x3ac448=_0x134f66(0x1e3);_0x519721[_0x134f66(0x1d2)]===_0x134f66(0x15c)&&(_0x3ac448=_0x519721[_0x134f66(0x1bd)]+_0x134f66(0x1f9)+_0x519721['llmProject']+_0x134f66(0x1d9));throw new SDKError(ErrorCode[_0x134f66(0x1f3)],_0x519721[_0x134f66(0x1d2)]===_0x134f66(0x173)?_0x519721[_0x134f66(0x1bd)]:_0x134f66(0x1a2)+_0x40d9b7,undefined,{'helpText':_0x3ac448});}const {data:_0x5ac5df}=await withSpinner(_0x134f66(0x168),()=>_0xfb119f[_0x134f66(0x1c9)][_0x134f66(0x184)](_0x40d9b7,{'dryRun':!![]})),_0x377d48=_0x5ac5df[_0x134f66(0x1c5)]['agents'][_0x134f66(0x1fc)]>0x0;if(_0x377d48){console[_0x134f66(0x153)](a4_0x4bdfdb['red'](_0x134f66(0x1cd)));for(const _0x5525d7 of _0x5ac5df[_0x134f66(0x1ad)]){_0x5525d7[_0x134f66(0x156)]===_0x134f66(0x17d)&&console[_0x134f66(0x153)](a4_0x4bdfdb[_0x134f66(0x163)]('\x20\x20Agent\x20\x22'+_0x5525d7[_0x134f66(0x170)]+'\x22:\x20'+_0x5525d7[_0x134f66(0x17d)]));}return 0x1;}const _0x1aa230=_0x5ac5df[_0x134f66(0x1c5)][_0x134f66(0x1ad)][_0x134f66(0x1ec)]+_0x5ac5df['counts']['knowledgeBases'][_0x134f66(0x1ec)]+_0x5ac5df[_0x134f66(0x1c5)][_0x134f66(0x147)][_0x134f66(0x1ec)]+_0x5ac5df[_0x134f66(0x1c5)][_0x134f66(0x197)]['created']+_0x5ac5df[_0x134f66(0x1c5)][_0x134f66(0x169)][_0x134f66(0x1ec)]+_0x5ac5df[_0x134f66(0x1c5)][_0x134f66(0x19a)][_0x134f66(0x1ec)]+_0x5ac5df['counts']['experimentalArtifacts'][_0x134f66(0x1ec)],_0x3d1435=_0x5ac5df[_0x134f66(0x1c5)][_0x134f66(0x1ad)][_0x134f66(0x191)]+_0x5ac5df['counts'][_0x134f66(0x1fd)][_0x134f66(0x191)]+_0x5ac5df[_0x134f66(0x1c5)][_0x134f66(0x147)][_0x134f66(0x191)]+_0x5ac5df[_0x134f66(0x1c5)][_0x134f66(0x197)][_0x134f66(0x191)]+_0x5ac5df[_0x134f66(0x1c5)]['integrations'][_0x134f66(0x191)]+_0x5ac5df[_0x134f66(0x1c5)][_0x134f66(0x19a)][_0x134f66(0x191)]+_0x5ac5df['counts'][_0x134f66(0x1d0)][_0x134f66(0x191)],_0x3b8d87=_0x5ac5df[_0x134f66(0x1c5)]['agents'][_0x134f66(0x1ba)]+_0x5ac5df[_0x134f66(0x1c5)][_0x134f66(0x1fd)][_0x134f66(0x1ba)]+_0x5ac5df[_0x134f66(0x1c5)][_0x134f66(0x147)][_0x134f66(0x1ba)]+_0x5ac5df[_0x134f66(0x1c5)][_0x134f66(0x197)]['unchanged']+_0x5ac5df[_0x134f66(0x1c5)][_0x134f66(0x169)][_0x134f66(0x1ba)]+_0x5ac5df[_0x134f66(0x1c5)][_0x134f66(0x19a)]['unchanged']+_0x5ac5df[_0x134f66(0x1c5)][_0x134f66(0x1d0)][_0x134f66(0x1ba)];console['log'](_0x134f66(0x1e9)+_0x5ac5df['projectName']+'\x27:'),console[_0x134f66(0x153)]('\x20\x20'+a4_0x4bdfdb[_0x134f66(0x176)]('+\x20'+_0x1aa230+_0x134f66(0x167))+_0x134f66(0x1a6)+a4_0x4bdfdb[_0x134f66(0x1d1)]('~\x20'+_0x3d1435+_0x134f66(0x157))+_0x134f66(0x1a6)+a4_0x4bdfdb[_0x134f66(0x1c7)]('=\x20'+_0x3b8d87+_0x134f66(0x1c8))),console['log'](_0x134f66(0x178)+formatCountSummary(_0x5ac5df[_0x134f66(0x1c5)][_0x134f66(0x1ad)])),console[_0x134f66(0x153)](_0x134f66(0x1f2)+formatCountSummary(_0x5ac5df[_0x134f66(0x1c5)][_0x134f66(0x1fd)])),console[_0x134f66(0x153)](_0x134f66(0x1db)+formatCountSummary(_0x5ac5df[_0x134f66(0x1c5)][_0x134f66(0x147)])),console[_0x134f66(0x153)](_0x134f66(0x16e)+formatCountSummary(_0x5ac5df[_0x134f66(0x1c5)][_0x134f66(0x197)])),console['log']('\x20\x20Integrations:\x20'+formatCountSummary(_0x5ac5df[_0x134f66(0x1c5)]['integrations']));const _0x52039b=_0x5ac5df['counts']['experimentalKnowledgeBases'][_0x134f66(0x1ec)]>0x0||_0x5ac5df[_0x134f66(0x1c5)][_0x134f66(0x19a)][_0x134f66(0x191)]>0x0||_0x5ac5df[_0x134f66(0x1c5)][_0x134f66(0x19a)][_0x134f66(0x1ba)]>0x0||_0x5ac5df['counts'][_0x134f66(0x1d0)][_0x134f66(0x1ec)]>0x0||_0x5ac5df['counts'][_0x134f66(0x1d0)][_0x134f66(0x191)]>0x0||_0x5ac5df[_0x134f66(0x1c5)]['experimentalArtifacts'][_0x134f66(0x1ba)]>0x0;_0x52039b&&(console[_0x134f66(0x153)](_0x134f66(0x1a1)+formatCountSummary(_0x5ac5df['counts']['experimentalKnowledgeBases'])),console[_0x134f66(0x153)](_0x134f66(0x1fa)+formatCountSummary(_0x5ac5df[_0x134f66(0x1c5)][_0x134f66(0x1d0)])));console['log'](_0x134f66(0x18e)+a4_0x4bdfdb[_0x134f66(0x185)](_0x40d9b7)),displayDiffs(_0x5ac5df[_0x134f66(0x1ad)],_0x5ac5df[_0x134f66(0x1fd)],_0x5ac5df[_0x134f66(0x147)],_0x5ac5df[_0x134f66(0x197)],_0x5ac5df['integrations'],_0x5ac5df[_0x134f66(0x19a)],_0x5ac5df['experimentalArtifacts']);if(_0x3fec86)return console[_0x134f66(0x153)](a4_0x4bdfdb[_0x134f66(0x1d1)](_0x134f66(0x1b6))),0x0;if(_0x1aa230===0x0&&_0x3d1435===0x0){console[_0x134f66(0x153)](a4_0x4bdfdb['green'](_0x134f66(0x200)));const _0x513d5b=getLLMProjectUrl(_0x5e185e,_0x5ac5df[_0x134f66(0x1c4)]);return console['log'](_0x134f66(0x1c6)+a4_0x4bdfdb[_0x134f66(0x185)](_0x513d5b)),0x0;}if(!_0x2b183d&&!_0x47bfed){if(!isInteractive())return console[_0x134f66(0x17d)](a4_0x4bdfdb[_0x134f66(0x163)]('\x0aError:'),_0x134f66(0x1c2)),console['error'](a4_0x4bdfdb[_0x134f66(0x1c7)](_0x134f66(0x1fb))),0x1;const _0x572680=await confirmKey('\x0aPush\x20'+(_0x1aa230+_0x3d1435)+'\x20resources?');if(!_0x572680)return console[_0x134f66(0x153)](a4_0x4bdfdb[_0x134f66(0x1d1)]('Cancelled'),_0x134f66(0x16c)),0x1;}const {data:_0x505b56}=await withSpinner(_0x134f66(0x1f4),()=>_0xfb119f[_0x134f66(0x1c9)][_0x134f66(0x184)](_0x40d9b7,{'force':_0x47bfed})),_0x29e305=_0x505b56['counts'][_0x134f66(0x1ad)][_0x134f66(0x1fc)]>0x0||_0x505b56[_0x134f66(0x1c5)][_0x134f66(0x1fd)][_0x134f66(0x1fc)]>0x0||_0x505b56[_0x134f66(0x1c5)][_0x134f66(0x147)]['errors']>0x0||_0x505b56['counts'][_0x134f66(0x197)]['errors']>0x0;if(_0x29e305){console[_0x134f66(0x153)](a4_0x4bdfdb[_0x134f66(0x1d1)]('\x0aProject\x20pushed\x20with\x20errors')),console[_0x134f66(0x153)](),console[_0x134f66(0x153)](a4_0x4bdfdb[_0x134f66(0x163)](_0x134f66(0x186)));for(const _0x23e97c of _0x505b56[_0x134f66(0x1ad)]){_0x23e97c[_0x134f66(0x156)]===_0x134f66(0x17d)&&console[_0x134f66(0x153)](a4_0x4bdfdb[_0x134f66(0x163)](_0x134f66(0x174)+_0x23e97c[_0x134f66(0x170)]+_0x134f66(0x183)+_0x23e97c[_0x134f66(0x17d)]));}for(const _0x16a90d of _0x505b56[_0x134f66(0x1fd)]){_0x16a90d['action']===_0x134f66(0x17d)&&console[_0x134f66(0x153)](a4_0x4bdfdb['red']('\x20\x20Knowledge\x20Base\x20\x22'+_0x16a90d[_0x134f66(0x19f)]+_0x134f66(0x183)+_0x16a90d[_0x134f66(0x17d)]));}for(const _0x91c72 of _0x505b56[_0x134f66(0x147)]){_0x91c72[_0x134f66(0x156)]==='error'&&console[_0x134f66(0x153)](a4_0x4bdfdb[_0x134f66(0x163)](_0x134f66(0x1a8)+_0x91c72['name']+'\x22:\x20'+_0x91c72['error']));}for(const _0x2abb4d of _0x505b56['prompts']){_0x2abb4d['action']===_0x134f66(0x17d)&&console[_0x134f66(0x153)](a4_0x4bdfdb['red'](_0x134f66(0x199)+_0x2abb4d[_0x134f66(0x19f)]+_0x134f66(0x183)+_0x2abb4d[_0x134f66(0x17d)]));}for(const _0x283699 of _0x505b56[_0x134f66(0x169)]){_0x283699[_0x134f66(0x156)]===_0x134f66(0x17d)&&console[_0x134f66(0x153)](a4_0x4bdfdb[_0x134f66(0x163)]('\x20\x20Integration\x20\x22'+_0x283699[_0x134f66(0x19f)]+_0x134f66(0x183)+_0x283699[_0x134f66(0x17d)]));}return 0x1;}console[_0x134f66(0x153)](a4_0x4bdfdb[_0x134f66(0x176)]('\x0a✔\x20Pushed\x20'+(_0x1aa230+_0x3d1435)+'\x20resources\x20to\x20\x27'+_0x505b56[_0x134f66(0x177)]+'\x27'));const _0x334ce7=getLLMProjectUrl(_0x5e185e,_0x505b56[_0x134f66(0x1c4)]);return console[_0x134f66(0x153)](_0x134f66(0x1c6)+a4_0x4bdfdb[_0x134f66(0x185)](_0x334ce7)),0x0;}}
@@ -1 +1 @@
1
- const a5_0x347955=a5_0x2b4b;(function(_0x2162ca,_0x417d3b){const _0x393b34=a5_0x2b4b,_0x49e47e=_0x2162ca();while(!![]){try{const _0x132bb1=-parseInt(_0x393b34(0x181))/0x1+parseInt(_0x393b34(0x19c))/0x2*(parseInt(_0x393b34(0x15a))/0x3)+-parseInt(_0x393b34(0x15f))/0x4+parseInt(_0x393b34(0x170))/0x5+parseInt(_0x393b34(0x168))/0x6*(-parseInt(_0x393b34(0x195))/0x7)+-parseInt(_0x393b34(0x1c6))/0x8+-parseInt(_0x393b34(0x198))/0x9*(-parseInt(_0x393b34(0x17e))/0xa);if(_0x132bb1===_0x417d3b)break;else _0x49e47e['push'](_0x49e47e['shift']());}catch(_0x249d17){_0x49e47e['push'](_0x49e47e['shift']());}}}(a5_0x1272,0x7439e));import*as a5_0x273097 from'node:fs';import*as a5_0x5766ba from'node:path';import a5_0xc31aa4 from'chalk';import{BaseCommand}from'./command.js';function a5_0x2b4b(_0x30f9b9,_0xf45bc7){_0x30f9b9=_0x30f9b9-0x14a;const _0x1272ae=a5_0x1272();let _0x2b4bed=_0x1272ae[_0x30f9b9];return _0x2b4bed;}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_0x347955(0x1c5)]=a5_0x347955(0x1cb);['description']=a5_0x347955(0x17a);async[a5_0x347955(0x1c0)](_0x522cde){const _0x42f179=a5_0x347955,{options:_0x5d7545,args:_0x28e1d1,tdx:_0x3d2a46}=_0x522cde,_0x5aca44=_0x28e1d1[0x0]||'.',_0x163d7c=_0x5d7545[_0x42f179(0x159)],_0x39ae9c=_0x5d7545,_0x1f4047=_0x39ae9c[_0x42f179(0x14e)]===![],_0x1992f9=_0x39ae9c[_0x42f179(0x1b8)],_0x1cffcc=_0x39ae9c[_0x42f179(0x1c5)],_0x131839=_0x39ae9c[_0x42f179(0x199)],_0x5357f7=_0x5d7545[_0x42f179(0x1bd)],_0x2ee67f=_0x39ae9c[_0x42f179(0x14b)];if(_0x1992f9&&_0x1f4047)return console[_0x42f179(0x184)](a5_0xc31aa4[_0x42f179(0x160)](_0x42f179(0x155))),0x1;let _0x25cbcf=_0x42f179(0x197);if(_0x39ae9c[_0x42f179(0x18e)])_0x25cbcf=_0x42f179(0x18e);else{if(_0x39ae9c[_0x42f179(0x172)])_0x25cbcf=_0x42f179(0x172);else{if(_0x39ae9c[_0x42f179(0x19a)])_0x25cbcf=_0x42f179(0x19a);else{if(_0x39ae9c[_0x42f179(0x197)])_0x25cbcf=_0x42f179(0x197);}}}const _0x15d967=_0x39ae9c[_0x42f179(0x1d6)];let _0x490107=_0x5aca44;const _0x51d4f9=a5_0x273097[_0x42f179(0x1b3)](_0x5aca44),_0x43fd68=_0x5aca44==='.';if(!_0x51d4f9||_0x43fd68){const _0xcd4f9b=resolveProjectFromContext(_0x5aca44,_0x15d967,{'requireFile':_0x42f179(0x1c7)});if(_0xcd4f9b[_0x42f179(0x18f)])_0x490107=_0xcd4f9b[_0x42f179(0x18c)],_0xcd4f9b[_0x42f179(0x167)]==='context'&&console[_0x42f179(0x184)](a5_0xc31aa4['dim']('Using\x20agent:\x20'+_0x490107));else switch(_0xcd4f9b['reason']){case'no_context':console[_0x42f179(0x184)](a5_0xc31aa4[_0x42f179(0x1ba)](_0xcd4f9b['message'])),console[_0x42f179(0x184)](),console[_0x42f179(0x184)](_0x42f179(0x1b7)),console['log'](_0x42f179(0x17b)),console[_0x42f179(0x184)]('\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[_0x42f179(0x184)](),console[_0x42f179(0x184)]('Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>');return 0x1;case _0x42f179(0x16d):console[_0x42f179(0x184)](a5_0xc31aa4['yellow'](_0xcd4f9b[_0x42f179(0x164)])),console[_0x42f179(0x184)](),console[_0x42f179(0x184)](_0x42f179(0x14a)+_0xcd4f9b[_0x42f179(0x1d6)]+_0x42f179(0x194));return 0x1;case _0x42f179(0x1d8):{const _0x31ae9e=a5_0x5766ba[_0x42f179(0x1ac)](_0xcd4f9b[_0x42f179(0x18c)]);console[_0x42f179(0x184)](a5_0xc31aa4[_0x42f179(0x1ba)](_0x42f179(0x17c)+_0xcd4f9b[_0x42f179(0x1d6)]+'\x22:'));for(const _0x22bc94 of _0xcd4f9b[_0x42f179(0x151)]){console['log'](_0x42f179(0x193)+_0x22bc94);}return console[_0x42f179(0x184)](),console[_0x42f179(0x184)](_0x42f179(0x1d3)+_0x31ae9e+_0x42f179(0x1d0)),0x1;}case'no_tests':console[_0x42f179(0x184)](a5_0xc31aa4[_0x42f179(0x1ba)](_0x42f179(0x1d1)+_0xcd4f9b[_0x42f179(0x1d6)]+'\x22.')),console[_0x42f179(0x184)](a5_0xc31aa4['dim'](_0x42f179(0x17f)+_0xcd4f9b[_0x42f179(0x18c)])),console['log'](),console[_0x42f179(0x184)](_0x42f179(0x165));return 0x1;}}const {definition:_0x51adda,agentInfo:_0xc09493}=parseTestFile(_0x490107);let _0x6158bd=_0x51adda['tests'];if(_0x1cffcc){const _0x1196c9=_0x1cffcc['split'](',')[_0x42f179(0x188)](_0x120241=>_0x120241[_0x42f179(0x14c)]());_0x6158bd=_0x51adda[_0x42f179(0x174)][_0x42f179(0x1aa)](_0x393a5b=>_0x1196c9[_0x42f179(0x1a7)](_0x393a5b[_0x42f179(0x1c5)]));if(_0x6158bd['length']===0x0)return console['log'](a5_0xc31aa4[_0x42f179(0x1ba)]('No\x20tests\x20found\x20matching:\x20'+_0x1cffcc)),console[_0x42f179(0x184)](a5_0xc31aa4[_0x42f179(0x16f)](_0x42f179(0x1ce)+_0x51adda['tests'][_0x42f179(0x188)](_0x333410=>_0x333410['name'])[_0x42f179(0x1a5)](',\x20'))),0x1;}if(_0x131839){const _0x433ff3=_0x131839[_0x42f179(0x182)](',')[_0x42f179(0x188)](_0xc34a3d=>_0xc34a3d[_0x42f179(0x14c)]()[_0x42f179(0x1e0)]());_0x6158bd=_0x6158bd[_0x42f179(0x1aa)](_0x483d40=>_0x483d40[_0x42f179(0x199)]?.[_0x42f179(0x161)](_0x5bde8e=>_0x433ff3[_0x42f179(0x1a7)](_0x5bde8e[_0x42f179(0x1e0)]())));if(_0x6158bd['length']===0x0){console['log'](a5_0xc31aa4[_0x42f179(0x1ba)](_0x42f179(0x179)+_0x131839));const _0x2556e5=new Set();return _0x51adda['tests']['forEach'](_0x41f4b1=>_0x41f4b1[_0x42f179(0x199)]?.[_0x42f179(0x1d4)](_0x38c5c9=>_0x2556e5[_0x42f179(0x19f)](_0x38c5c9))),_0x2556e5[_0x42f179(0x1df)]>0x0?console['log'](a5_0xc31aa4['dim'](_0x42f179(0x1a9)+[..._0x2556e5][_0x42f179(0x1a5)](',\x20'))):console[_0x42f179(0x184)](a5_0xc31aa4[_0x42f179(0x16f)](_0x42f179(0x1de))),0x1;}}if(_0x1992f9)return this[_0x42f179(0x15e)](_0x522cde,{'definition':{'tests':_0x6158bd},'agentInfo':_0xc09493,'outputFormat':_0x25cbcf,'outputFile':_0x2ee67f,'testNames':_0x1cffcc});if(_0x163d7c){console[_0x42f179(0x184)](a5_0xc31aa4[_0x42f179(0x1e2)](_0x42f179(0x1af))),console[_0x42f179(0x184)]('\x20\x20Site:\x20'+a5_0xc31aa4[_0x42f179(0x16c)](_0x5357f7)),console[_0x42f179(0x184)](_0x42f179(0x169)+a5_0xc31aa4[_0x42f179(0x16c)](_0xc09493[_0x42f179(0x177)])),console[_0x42f179(0x184)](_0x42f179(0x152)+a5_0xc31aa4['white'](_0xc09493[_0x42f179(0x1d2)])),console[_0x42f179(0x184)](),console[_0x42f179(0x184)](_0x42f179(0x16a)+a5_0xc31aa4[_0x42f179(0x16c)](_0x6158bd[_0x42f179(0x1cc)]));for(let _0xb1b262=0x0;_0xb1b262<_0x6158bd[_0x42f179(0x1cc)];_0xb1b262++){const _0x21e5a3=_0x6158bd[_0xb1b262],_0x44ca17=_0x21e5a3[_0x42f179(0x1cf)][_0x42f179(0x1cc)]===0x1?_0x42f179(0x185):_0x42f179(0x1cf),_0x17cd69=_0x21e5a3[_0x42f179(0x199)]?.[_0x42f179(0x1cc)]?'\x20['+_0x21e5a3[_0x42f179(0x199)]['join'](',\x20')+']':'';console[_0x42f179(0x184)]('\x20\x20'+(_0xb1b262+0x1)+'.\x20'+a5_0xc31aa4['white'](_0x21e5a3[_0x42f179(0x1c5)])+'\x20('+_0x21e5a3['rounds']['length']+'\x20'+_0x44ca17+')'+a5_0xc31aa4[_0x42f179(0x16f)](_0x17cd69));}return 0x0;}let _0x3e8e07,_0x41b5cd;try{_0x3e8e07=await _0x3d2a46[_0x42f179(0x1b4)]['resolveProjectId'](_0xc09493[_0x42f179(0x177)]);}catch(_0x59088f){const _0x26de68=_0x59088f instanceof Error?_0x59088f[_0x42f179(0x164)]:String(_0x59088f);return _0x26de68['includes']('404')||_0x26de68['toLowerCase']()[_0x42f179(0x1a7)](_0x42f179(0x1b6))?console[_0x42f179(0x184)](a5_0xc31aa4[_0x42f179(0x160)](_0x42f179(0x1a0)+_0xc09493['projectName'])):console['log'](a5_0xc31aa4['red']('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22'+_0xc09493[_0x42f179(0x177)]+_0x42f179(0x1ab)+_0x26de68)),0x1;}try{_0x41b5cd=await _0x3d2a46[_0x42f179(0x1b4)]['resolveAgentId'](_0xc09493[_0x42f179(0x1d2)],_0x3e8e07);}catch(_0x950083){const _0x2f9a1a=_0x950083 instanceof Error?_0x950083[_0x42f179(0x164)]:String(_0x950083);return _0x2f9a1a[_0x42f179(0x1a7)]('404')||_0x2f9a1a[_0x42f179(0x1e0)]()[_0x42f179(0x1a7)](_0x42f179(0x1b6))?console[_0x42f179(0x184)](a5_0xc31aa4[_0x42f179(0x160)]('✗\x20ERROR:\x20Agent\x20not\x20found:\x20'+_0xc09493[_0x42f179(0x1d2)])):console[_0x42f179(0x184)](a5_0xc31aa4[_0x42f179(0x160)](_0x42f179(0x166)+_0xc09493[_0x42f179(0x1d2)]+_0x42f179(0x1ab)+_0x2f9a1a)),0x1;}let _0x486a5c;if(!_0x1f4047)try{_0x486a5c=await setupEvaluatorAgent(_0x3d2a46[_0x42f179(0x1b4)],_0x5d7545[_0x42f179(0x1bf)]);}catch(_0x41cd3f){const _0x30f663=_0x41cd3f instanceof Error?_0x41cd3f[_0x42f179(0x164)]:String(_0x41cd3f);return console[_0x42f179(0x184)](a5_0xc31aa4[_0x42f179(0x160)](_0x42f179(0x196)+_0x30f663)),0x1;}console[_0x42f179(0x184)](a5_0xc31aa4[_0x42f179(0x1e2)](_0x42f179(0x156))),console['log']('Site:\x20'+a5_0xc31aa4[_0x42f179(0x16c)](_0x5357f7)),console[_0x42f179(0x184)](_0x42f179(0x176)+a5_0xc31aa4[_0x42f179(0x16c)](_0xc09493['projectName']+'/'+_0xc09493['agentName'])),console[_0x42f179(0x184)]();const _0x504ac3=[],_0x3b073f=[],_0x577938=Date[_0x42f179(0x1da)]();for(let _0x5bbfe9=0x0;_0x5bbfe9<_0x6158bd['length'];_0x5bbfe9++){const _0x1158cd=_0x6158bd[_0x5bbfe9];_0x6158bd[_0x42f179(0x1cc)]>0x1?console[_0x42f179(0x184)]('Test\x20'+(_0x5bbfe9+0x1)+'/'+_0x6158bd[_0x42f179(0x1cc)]+':\x20'+a5_0xc31aa4[_0x42f179(0x16c)](_0x1158cd[_0x42f179(0x1c5)])):console[_0x42f179(0x184)]('Running\x20test:\x20'+a5_0xc31aa4[_0x42f179(0x16c)](_0x1158cd['name']));const _0x3d78e6=createCommandSpinner(_0x42f179(0x14f)+_0x1158cd['rounds'][_0x42f179(0x1cc)]+':\x20Sending\x20user\x20input...');_0x3d78e6[_0x42f179(0x15b)]();try{const {result:_0x61d49b,conversation:_0x20710e}=await runTest(_0x3d2a46[_0x42f179(0x1b4)],_0x1158cd,{'agentId':_0x41b5cd,'projectId':_0x3e8e07,'site':_0x5357f7,'noEval':_0x1f4047,'evaluatorId':_0x486a5c,'onRoundStart':(_0x47d7cd,_0x354e51)=>{const _0x371de0=_0x42f179;_0x3d78e6[_0x371de0(0x163)]=_0x371de0(0x178)+(_0x47d7cd+0x1)+'/'+_0x354e51+_0x371de0(0x1d7);},'onRoundComplete':(_0x38af5c,_0x394f63,_0x40158d)=>{const _0x4742f8=_0x42f179,_0x292edf=formatElapsed(_0x394f63);_0x40158d?console[_0x4742f8(0x184)]('\x20\x20Round\x20'+(_0x38af5c+0x1)+'/'+_0x1158cd[_0x4742f8(0x1cf)][_0x4742f8(0x1cc)]+_0x4742f8(0x190)+a5_0xc31aa4[_0x4742f8(0x19d)]('✓')+'\x20('+_0x292edf+')'):console[_0x4742f8(0x184)](_0x4742f8(0x1cd)+(_0x38af5c+0x1)+'/'+_0x1158cd[_0x4742f8(0x1cf)][_0x4742f8(0x1cc)]+_0x4742f8(0x190)+a5_0xc31aa4[_0x4742f8(0x160)]('✗'));},'onEvaluationStart':()=>{const _0x587821=_0x42f179;_0x3d78e6[_0x587821(0x163)]='Evaluating\x20response...';},'onEvaluationComplete':_0x5abd18=>{const _0x1d8b33=_0x42f179,_0x617cf2=formatElapsed(_0x5abd18);console[_0x1d8b33(0x184)]('\x20\x20Evaluating...\x20'+a5_0xc31aa4[_0x1d8b33(0x19d)]('✓')+'\x20('+_0x617cf2+')');}});_0x3d78e6['stop'](),_0x504ac3[_0x42f179(0x191)](_0x61d49b),_0x3b073f[_0x42f179(0x191)](_0x20710e);if(_0x61d49b[_0x42f179(0x183)]===_0x42f179(0x19e))console[_0x42f179(0x184)](a5_0xc31aa4['green'](_0x42f179(0x15d)+_0x61d49b[_0x42f179(0x16e)]));else _0x61d49b['status']===_0x42f179(0x1b2)?console[_0x42f179(0x184)](a5_0xc31aa4['red'](_0x42f179(0x1c9)+_0x61d49b[_0x42f179(0x16e)])):console[_0x42f179(0x184)](a5_0xc31aa4['red'](_0x42f179(0x1d5)+_0x61d49b['reason']));_0x61d49b[_0x42f179(0x15c)]&&console[_0x42f179(0x184)](a5_0xc31aa4[_0x42f179(0x16f)](_0x42f179(0x186)+_0x61d49b[_0x42f179(0x15c)])),console[_0x42f179(0x184)]();}catch(_0x22ffa3){_0x3d78e6[_0x42f179(0x1a2)]();const _0x9e7a2e=_0x22ffa3 instanceof Error?_0x22ffa3['message']:String(_0x22ffa3);console[_0x42f179(0x184)](a5_0xc31aa4['red'](_0x42f179(0x1d5)+_0x9e7a2e)),console[_0x42f179(0x184)](),_0x504ac3[_0x42f179(0x191)]({'name':_0x1158cd[_0x42f179(0x1c5)],'status':_0x42f179(0x1b9),'reason':_0x9e7a2e,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}const _0x14e7c1=Date['now']()-_0x577938,_0x442fc9=_0x504ac3[_0x42f179(0x1aa)](_0x4d68a4=>_0x4d68a4[_0x42f179(0x183)]===_0x42f179(0x19e))[_0x42f179(0x1cc)],_0x2286a3=_0x504ac3[_0x42f179(0x1aa)](_0x542307=>_0x542307[_0x42f179(0x183)]===_0x42f179(0x1b2))[_0x42f179(0x1cc)],_0x17e142=_0x504ac3[_0x42f179(0x1aa)](_0x42573b=>_0x42573b[_0x42f179(0x183)]===_0x42f179(0x1b9))['length'];console[_0x42f179(0x184)]('━'[_0x42f179(0x1b0)](0x3c)),console[_0x42f179(0x184)]('Test\x20Summary'),console['log']('━'[_0x42f179(0x1b0)](0x3c)),console[_0x42f179(0x184)](_0x42f179(0x171)+_0x504ac3[_0x42f179(0x1cc)]),console['log'](_0x42f179(0x19b)+a5_0xc31aa4[_0x42f179(0x19d)](_0x442fc9)),console[_0x42f179(0x184)]('Failed:\x20\x20\x20'+a5_0xc31aa4[_0x42f179(0x160)](_0x2286a3));_0x17e142>0x0&&console[_0x42f179(0x184)](_0x42f179(0x16b)+a5_0xc31aa4[_0x42f179(0x160)](_0x17e142));console[_0x42f179(0x184)](_0x42f179(0x1ad)+formatElapsed(_0x14e7c1)),console[_0x42f179(0x184)]('━'[_0x42f179(0x1b0)](0x3c));const _0x259927=_0x504ac3[_0x42f179(0x1aa)](_0x43b7e1=>_0x43b7e1[_0x42f179(0x183)]!=='PASS');if(_0x259927[_0x42f179(0x1cc)]>0x0){console['log'](),console[_0x42f179(0x184)]('Failed\x20Tests:');for(const _0x59e7f9 of _0x259927){const _0x563c28=a5_0xc31aa4[_0x42f179(0x160)]('✗'),_0x147129=_0x59e7f9[_0x42f179(0x16e)][_0x42f179(0x1cc)]>0x32?_0x59e7f9['reason']['substring'](0x0,0x32)+_0x42f179(0x180):_0x59e7f9[_0x42f179(0x16e)];console['log']('\x20\x20'+_0x563c28+'\x20'+_0x59e7f9[_0x42f179(0x1c5)]+':\x20'+_0x147129);}}const _0x4f3e7e={'summary':{'total':_0x504ac3[_0x42f179(0x1cc)],'passed':_0x442fc9,'failed':_0x2286a3,'errors':_0x17e142>0x0?_0x17e142:undefined,'duration_ms':_0x14e7c1},'tests':_0x504ac3,'agent':{'project':_0xc09493[_0x42f179(0x177)],'name':_0xc09493[_0x42f179(0x1d2)],'site':_0x5357f7},'timestamp':new Date(_0x577938)[_0x42f179(0x18d)]()};try{const _0x5b9c11=buildCachedTestRun(_0x3b073f,{'site':_0x5357f7,'projectId':_0x3e8e07,'projectName':_0xc09493[_0x42f179(0x177)],'agentId':_0x41b5cd,'agentName':_0xc09493[_0x42f179(0x1d2)],'testYmlPath':a5_0x5766ba[_0x42f179(0x1a4)](_0xc09493['testYmlPath'])});saveLastTestRun(_0x5b9c11);}catch{}if(_0x25cbcf!==_0x42f179(0x197)||_0x2ee67f){const _0x538c70=formatResults(_0x4f3e7e,_0x25cbcf);if(_0x2ee67f)try{a5_0x273097[_0x42f179(0x192)](_0x2ee67f,_0x538c70,_0x42f179(0x1dd)),console['log'](),console[_0x42f179(0x184)](a5_0xc31aa4[_0x42f179(0x16f)]('Output\x20written\x20to:\x20'+_0x2ee67f));}catch(_0x56d19f){return console[_0x42f179(0x184)](),console['log'](a5_0xc31aa4['red'](_0x42f179(0x158)+_0x56d19f)),0x1;}else console[_0x42f179(0x184)](),console[_0x42f179(0x184)](_0x538c70);}return _0x259927[_0x42f179(0x1cc)]>0x0?0x1:0x0;}async['executeReeval'](_0x5b1015,_0x50f36f){const _0x22c2ff=a5_0x347955,{options:_0x4c08f7,tdx:_0x3ec7c5}=_0x5b1015,{definition:_0x592a72,agentInfo:_0x1b50c8,outputFormat:_0x5a6e08,outputFile:_0x54ca96}=_0x50f36f,_0x318832=_0x4c08f7[_0x22c2ff(0x1bd)],_0x31368e=loadLastTestRun();if(!_0x31368e)return console['log'](a5_0xc31aa4[_0x22c2ff(0x160)](_0x22c2ff(0x1a3))),console['log'](a5_0xc31aa4[_0x22c2ff(0x16f)](_0x22c2ff(0x153))),0x1;if(_0x31368e[_0x22c2ff(0x1c1)][_0x22c2ff(0x1d2)]!==_0x1b50c8['agentName'])return console['log'](a5_0xc31aa4[_0x22c2ff(0x160)](_0x22c2ff(0x17d)+_0x31368e[_0x22c2ff(0x1c1)]['agentName']+_0x22c2ff(0x187)+_0x1b50c8['agentName']+'\x22.')),console[_0x22c2ff(0x184)](a5_0xc31aa4[_0x22c2ff(0x16f)](_0x22c2ff(0x173))),0x1;const _0x2d776f=new Set(_0x31368e[_0x22c2ff(0x18b)][_0x22c2ff(0x188)](_0x790313=>_0x790313[_0x22c2ff(0x154)])),_0x3872a9=_0x592a72[_0x22c2ff(0x174)][_0x22c2ff(0x1aa)](_0x5c38e7=>!_0x2d776f['has'](_0x5c38e7[_0x22c2ff(0x1c5)]));if(_0x3872a9[_0x22c2ff(0x1cc)]>0x0&&_0x31368e['site']!==_0x318832)return console['log'](a5_0xc31aa4['red'](_0x22c2ff(0x1ca))),console[_0x22c2ff(0x184)](a5_0xc31aa4[_0x22c2ff(0x16f)](_0x22c2ff(0x1bc)+_0x31368e[_0x22c2ff(0x1bd)]+'\x22,\x20but\x20current\x20site\x20is\x20\x22'+_0x318832+'\x22.')),console[_0x22c2ff(0x184)](a5_0xc31aa4['dim'](_0x22c2ff(0x1db)+_0x31368e[_0x22c2ff(0x1bd)]+_0x22c2ff(0x1b1))),0x1;const _0xd7dab1=_0x592a72[_0x22c2ff(0x174)][_0x22c2ff(0x1aa)](_0x302018=>_0x2d776f[_0x22c2ff(0x1c4)](_0x302018[_0x22c2ff(0x1c5)])),_0x4b436a=_0x3872a9;let _0x4ca981;try{_0x4ca981=await setupEvaluatorAgent(_0x3ec7c5[_0x22c2ff(0x1b4)],_0x4c08f7[_0x22c2ff(0x1bf)]);}catch(_0x5b6c56){const _0x1242bb=_0x5b6c56 instanceof Error?_0x5b6c56[_0x22c2ff(0x164)]:String(_0x5b6c56);return console[_0x22c2ff(0x184)](a5_0xc31aa4[_0x22c2ff(0x160)](_0x22c2ff(0x196)+_0x1242bb)),0x1;}console[_0x22c2ff(0x184)](a5_0xc31aa4[_0x22c2ff(0x1e2)]('Re-evaluating\x20cached\x20test\x20run...')),console[_0x22c2ff(0x184)](_0x22c2ff(0x1e1)+a5_0xc31aa4[_0x22c2ff(0x16c)](_0x31368e[_0x22c2ff(0x1a1)])),console[_0x22c2ff(0x184)](_0x22c2ff(0x176)+a5_0xc31aa4[_0x22c2ff(0x16c)](_0x31368e['agent'][_0x22c2ff(0x177)]+'/'+_0x31368e['agent'][_0x22c2ff(0x1d2)]));_0x4b436a[_0x22c2ff(0x1cc)]>0x0&&console['log'](_0x22c2ff(0x1dc)+a5_0xc31aa4[_0x22c2ff(0x1ba)](_0x4b436a['length']));console['log']();const _0x554270=[],_0x1e18bd=Date[_0x22c2ff(0x1da)](),_0x4d2842=createCommandSpinner(_0x22c2ff(0x189));if(_0xd7dab1[_0x22c2ff(0x1cc)]>0x0)try{const _0x426837=await reevaluateFromCache(_0x3ec7c5[_0x22c2ff(0x1b4)],_0x31368e,{'tests':_0xd7dab1},{'evaluatorId':_0x4ca981,'onTestStart':(_0x626a59,_0x14b45f,_0x4cc6db)=>{const _0x353f8b=_0x22c2ff;_0x4d2842[_0x353f8b(0x163)]=_0x353f8b(0x175)+(_0x14b45f+0x1)+'/'+_0x4cc6db+':\x20'+_0x626a59+_0x353f8b(0x180);if(!_0x4d2842[_0x353f8b(0x162)])_0x4d2842[_0x353f8b(0x15b)]();},'onTestComplete':(_0x5a8acf,_0x390e8e)=>{const _0x287fab=_0x22c2ff;_0x4d2842['stop']();if(_0x390e8e[_0x287fab(0x183)]===_0x287fab(0x19e))console['log'](a5_0xc31aa4['green'](_0x287fab(0x15d)+_0x5a8acf)+a5_0xc31aa4[_0x287fab(0x16f)](_0x287fab(0x1d9)));else _0x390e8e[_0x287fab(0x183)]===_0x287fab(0x1b2)?console[_0x287fab(0x184)](a5_0xc31aa4['red'](_0x287fab(0x1c9)+_0x5a8acf+'\x20-\x20'+_0x390e8e[_0x287fab(0x16e)])+a5_0xc31aa4[_0x287fab(0x16f)](_0x287fab(0x1d9))):console[_0x287fab(0x184)](a5_0xc31aa4[_0x287fab(0x160)](_0x287fab(0x1d5)+_0x5a8acf+'\x20-\x20'+_0x390e8e[_0x287fab(0x16e)]));_0x390e8e['conversation_url']&&console[_0x287fab(0x184)](a5_0xc31aa4[_0x287fab(0x16f)]('\x20\x20Conversation:\x20'+_0x390e8e[_0x287fab(0x15c)])),_0x554270[_0x287fab(0x191)](_0x390e8e);},'onTestSkipped':(_0x1afe96,_0x28a66c)=>{const _0x18772d=_0x22c2ff;_0x4d2842[_0x18772d(0x1a2)](),console[_0x18772d(0x184)](a5_0xc31aa4[_0x18772d(0x1ba)](_0x18772d(0x1be)+_0x1afe96+_0x18772d(0x157)+_0x28a66c));}});for(const _0x177a81 of _0x426837){!_0x554270[_0x22c2ff(0x14d)](_0x27c6c9=>_0x27c6c9[_0x22c2ff(0x1c5)]===_0x177a81['name'])&&_0x554270['push'](_0x177a81);}}catch(_0x4ae9cc){_0x4d2842[_0x22c2ff(0x1a2)]();const _0x1c3caf=_0x4ae9cc instanceof Error?_0x4ae9cc['message']:String(_0x4ae9cc);return console[_0x22c2ff(0x184)](a5_0xc31aa4[_0x22c2ff(0x160)](_0x22c2ff(0x1bb)+_0x1c3caf)),0x1;}_0x4d2842[_0x22c2ff(0x1a2)]();if(_0x4b436a['length']>0x0){console[_0x22c2ff(0x184)](),console[_0x22c2ff(0x184)](a5_0xc31aa4[_0x22c2ff(0x1e2)](_0x22c2ff(0x150)));const {projectId:_0x5307e6,agentId:_0x3a690f}=_0x31368e[_0x22c2ff(0x1c1)];for(const _0x3299ac of _0x4b436a){console[_0x22c2ff(0x184)](_0x22c2ff(0x1c3)+a5_0xc31aa4[_0x22c2ff(0x16c)](_0x3299ac['name']));const _0x1ad398=createCommandSpinner(_0x22c2ff(0x14f)+_0x3299ac[_0x22c2ff(0x1cf)]['length']+':\x20Sending\x20user\x20input...');_0x1ad398[_0x22c2ff(0x15b)]();try{const {result:_0x3119c7}=await runTest(_0x3ec7c5[_0x22c2ff(0x1b4)],_0x3299ac,{'agentId':_0x3a690f,'projectId':_0x5307e6,'site':_0x31368e[_0x22c2ff(0x1bd)],'noEval':![],'evaluatorId':_0x4ca981,'onRoundStart':(_0x20c27d,_0x2b3a7c)=>{const _0x445e36=_0x22c2ff;_0x1ad398['text']=_0x445e36(0x178)+(_0x20c27d+0x1)+'/'+_0x2b3a7c+_0x445e36(0x1d7);},'onRoundComplete':(_0x2ec9c1,_0x5d887d,_0xe0b7c4)=>{const _0x5aff5f=_0x22c2ff,_0x12e8e4=formatElapsed(_0x5d887d);_0xe0b7c4?console[_0x5aff5f(0x184)](_0x5aff5f(0x1cd)+(_0x2ec9c1+0x1)+'/'+_0x3299ac[_0x5aff5f(0x1cf)][_0x5aff5f(0x1cc)]+_0x5aff5f(0x190)+a5_0xc31aa4['green']('✓')+'\x20('+_0x12e8e4+')'):console[_0x5aff5f(0x184)](_0x5aff5f(0x1cd)+(_0x2ec9c1+0x1)+'/'+_0x3299ac[_0x5aff5f(0x1cf)][_0x5aff5f(0x1cc)]+'...\x20'+a5_0xc31aa4[_0x5aff5f(0x160)]('✗'));},'onEvaluationStart':()=>{const _0x532833=_0x22c2ff;_0x1ad398[_0x532833(0x163)]=_0x532833(0x18a);},'onEvaluationComplete':_0x5ff2bd=>{const _0x358b7f=_0x22c2ff,_0x50c044=formatElapsed(_0x5ff2bd);console[_0x358b7f(0x184)](_0x358b7f(0x1b5)+a5_0xc31aa4[_0x358b7f(0x19d)]('✓')+'\x20('+_0x50c044+')');}});_0x1ad398[_0x22c2ff(0x1a2)](),_0x554270[_0x22c2ff(0x191)](_0x3119c7);if(_0x3119c7[_0x22c2ff(0x183)]==='PASS')console['log'](a5_0xc31aa4[_0x22c2ff(0x19d)]('✓\x20PASS:\x20'+_0x3119c7[_0x22c2ff(0x16e)])+a5_0xc31aa4[_0x22c2ff(0x16f)](_0x22c2ff(0x1ae)));else _0x3119c7[_0x22c2ff(0x183)]===_0x22c2ff(0x1b2)?console[_0x22c2ff(0x184)](a5_0xc31aa4[_0x22c2ff(0x160)]('✗\x20FAIL:\x20'+_0x3119c7['reason'])+a5_0xc31aa4[_0x22c2ff(0x16f)](_0x22c2ff(0x1ae))):console['log'](a5_0xc31aa4['red'](_0x22c2ff(0x1d5)+_0x3119c7[_0x22c2ff(0x16e)]));_0x3119c7[_0x22c2ff(0x15c)]&&console[_0x22c2ff(0x184)](a5_0xc31aa4['dim'](_0x22c2ff(0x1a6)+_0x3119c7['conversation_url']));}catch(_0xee0785){_0x1ad398['stop']();const _0x5e3a7b=_0xee0785 instanceof Error?_0xee0785[_0x22c2ff(0x164)]:String(_0xee0785);console[_0x22c2ff(0x184)](a5_0xc31aa4[_0x22c2ff(0x160)](_0x22c2ff(0x1d5)+_0x5e3a7b)),_0x554270['push']({'name':_0x3299ac[_0x22c2ff(0x1c5)],'status':_0x22c2ff(0x1b9),'reason':_0x5e3a7b,'timestamp':new Date()[_0x22c2ff(0x18d)](),'duration_ms':0x0});}}}console[_0x22c2ff(0x184)]();const _0x3d2ad0=Date['now']()-_0x1e18bd,_0x4e1769=_0x554270[_0x22c2ff(0x1aa)](_0x440d78=>_0x440d78[_0x22c2ff(0x183)]===_0x22c2ff(0x19e))[_0x22c2ff(0x1cc)],_0x1e5b61=_0x554270['filter'](_0x308bef=>_0x308bef[_0x22c2ff(0x183)]===_0x22c2ff(0x1b2))['length'],_0x3250f2=_0x554270[_0x22c2ff(0x1aa)](_0x39352d=>_0x39352d[_0x22c2ff(0x183)]===_0x22c2ff(0x1b9))['length'];console[_0x22c2ff(0x184)]('━'[_0x22c2ff(0x1b0)](0x3c)),console[_0x22c2ff(0x184)](_0x22c2ff(0x1c8)),console[_0x22c2ff(0x184)]('━'[_0x22c2ff(0x1b0)](0x3c)),console['log']('Total:\x20\x20\x20\x20'+_0x554270['length']),console[_0x22c2ff(0x184)](_0x22c2ff(0x19b)+a5_0xc31aa4[_0x22c2ff(0x19d)](_0x4e1769)),console[_0x22c2ff(0x184)](_0x22c2ff(0x1c2)+a5_0xc31aa4['red'](_0x1e5b61));_0x3250f2>0x0&&console[_0x22c2ff(0x184)](_0x22c2ff(0x16b)+a5_0xc31aa4['red'](_0x3250f2));console[_0x22c2ff(0x184)]('Duration:\x20'+formatElapsed(_0x3d2ad0)),console['log']('━'[_0x22c2ff(0x1b0)](0x3c));const _0x44c488={'summary':{'total':_0x554270['length'],'passed':_0x4e1769,'failed':_0x1e5b61,'errors':_0x3250f2>0x0?_0x3250f2:undefined,'duration_ms':_0x3d2ad0},'tests':_0x554270,'agent':{'project':_0x1b50c8[_0x22c2ff(0x177)],'name':_0x1b50c8[_0x22c2ff(0x1d2)],'site':_0x318832},'timestamp':new Date(_0x1e18bd)[_0x22c2ff(0x18d)]()};if(_0x5a6e08!==_0x22c2ff(0x197)||_0x54ca96){const _0x12906f=formatResults(_0x44c488,_0x5a6e08);if(_0x54ca96)try{a5_0x273097[_0x22c2ff(0x192)](_0x54ca96,_0x12906f,_0x22c2ff(0x1dd)),console[_0x22c2ff(0x184)](),console[_0x22c2ff(0x184)](a5_0xc31aa4['dim'](_0x22c2ff(0x1a8)+_0x54ca96));}catch(_0x313a67){return console[_0x22c2ff(0x184)](),console['log'](a5_0xc31aa4[_0x22c2ff(0x160)](_0x22c2ff(0x158)+_0x313a67)),0x1;}else console[_0x22c2ff(0x184)](),console[_0x22c2ff(0x184)](_0x12906f);}const _0x88b298=_0x554270[_0x22c2ff(0x1aa)](_0x347678=>_0x347678[_0x22c2ff(0x183)]!==_0x22c2ff(0x19e));return _0x88b298[_0x22c2ff(0x1cc)]>0x0?0x1:0x0;}}function a5_0x1272(){const _0x4df020=['no_local_folder','reason','dim','328855Avqtch','Total:\x20\x20\x20\x20','jsonl','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','tests','Re-evaluating\x20','Agent:\x20','projectName','Round\x20','No\x20tests\x20found\x20with\x20tags:\x20','Run\x20tests\x20for\x20an\x20LLM\x20agent','\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','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','6330670WuikRd','Project\x20path:\x20','...','872451VIkBQZ','split','status','log','round','Conversation\x20URL:\x20','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','map','Re-evaluating...','Evaluating\x20response...','conversations','projectDir','toISOString','json','found','...\x20','push','writeFileSync','\x20\x20-\x20','\x27\x20to\x20create\x20the\x20folder\x20structure.','1876xysobO','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','table','27dypKma','tags','tsv','Passed:\x20\x20\x20','6554EmUnky','green','PASS','add','✗\x20ERROR:\x20Project\x20not\x20found:\x20','timestamp','stop','Error:\x20No\x20previous\x20test\x20run\x20found.','resolve','join','\x20\x20Conversation:\x20','includes','Output\x20written\x20to:\x20','Available\x20tags:\x20','filter','\x22:\x20','basename','Duration:\x20','\x20(new)','Test\x20Configuration:','repeat','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','FAIL','existsSync','llm','\x20\x20Evaluating...\x20','not\x20found','Usage:','reeval','ERROR','yellow','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','Cached\x20run\x20is\x20from\x20site\x20\x22','site','⚠\x20SKIPPED:\x20','verbose','execute','agent','Failed:\x20\x20\x20','Running:\x20','has','name','675904fsKbjd','test.yml','Re-evaluation\x20Summary','✗\x20FAIL:\x20','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','agent:test','length','\x20\x20Round\x20','Available\x20tests:\x20','rounds','/<agent-name>','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','agentName','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','forEach','✗\x20ERROR:\x20','llmProject',':\x20Sending\x20user\x20input...','multiple_agents','\x20(cached)','now','Either\x20switch\x20to\x20the\x20\x22','New\x20tests\x20to\x20execute:\x20','utf-8','No\x20tests\x20have\x20tags\x20defined.','size','toLowerCase','Cached\x20run\x20from:\x20','cyan','Run\x20\x27tdx\x20agent\x20pull\x20','output','trim','find','eval','Round\x201/','Executing\x20new\x20tests...','agentDirs','\x20\x20Agent:\x20','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','testName','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','Running\x20agent\x20tests...','\x20-\x20','Error\x20writing\x20output\x20file:\x20','dryRun','327FSsWMN','start','conversation_url','✓\x20PASS:\x20','executeReeval','2216656pZVEhR','red','some','isSpinning','text','message','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','source','7500HrEXXH','\x20\x20Project:\x20','Tests\x20found:\x20','Errors:\x20\x20\x20','white'];a5_0x1272=function(){return _0x4df020;};return a5_0x1272();}
1
+ const a5_0x2d676e=a5_0x12ec;(function(_0x5f14dd,_0x337747){const _0x363ed6=a5_0x12ec,_0x1c832f=_0x5f14dd();while(!![]){try{const _0x4a6b80=parseInt(_0x363ed6(0x226))/0x1*(-parseInt(_0x363ed6(0x23f))/0x2)+parseInt(_0x363ed6(0x216))/0x3*(-parseInt(_0x363ed6(0x249))/0x4)+parseInt(_0x363ed6(0x24e))/0x5+parseInt(_0x363ed6(0x224))/0x6*(parseInt(_0x363ed6(0x21b))/0x7)+parseInt(_0x363ed6(0x1dd))/0x8*(-parseInt(_0x363ed6(0x1d7))/0x9)+-parseInt(_0x363ed6(0x205))/0xa+parseInt(_0x363ed6(0x1d8))/0xb;if(_0x4a6b80===_0x337747)break;else _0x1c832f['push'](_0x1c832f['shift']());}catch(_0x370eb0){_0x1c832f['push'](_0x1c832f['shift']());}}}(a5_0x3bc8,0xa811b));import*as a5_0x2a8738 from'node:fs';import*as a5_0x5ebcc7 from'node:path';import a5_0x1bff63 from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';function a5_0x3bc8(){const _0x25bd9e=['Test\x20','testName','Test\x20Configuration:','\x20\x20Site:\x20','dryRun','repeat','Site:\x20','projectName','Round\x20','\x20\x20Agent:\x20','Agent:\x20','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','reeval','agent','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','some','Cached\x20run\x20is\x20from\x20site\x20\x22','start','Project\x20path:\x20','testYmlPath','2360277deADrK','34361899QwDfrA','basename','FAIL','length','Run\x20tests\x20for\x20an\x20LLM\x20agent','40oufKnN','Either\x20switch\x20to\x20the\x20\x22','\x20-\x20','✗\x20ERROR:\x20','Error:\x20No\x20previous\x20test\x20run\x20found.','status','verbose','Conversation\x20URL:\x20','stop','ERROR','context','PASS','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','conversation_url','Passed:\x20\x20\x20','name','agentDirs','\x20\x20Round\x20','join','Running:\x20','utf-8','toLowerCase','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','round','red','push','Usage:','json','rounds','✗\x20FAIL:\x20','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','No\x20tests\x20found\x20with\x20tags:\x20','reason','description','Round\x201/','yellow','has','Errors:\x20\x20\x20','resolveAgentId','12764890iIZfFH','\x22:\x20','Output\x20written\x20to:\x20','\x27\x20to\x20create\x20the\x20folder\x20structure.','dim','...\x20','isSpinning','\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(new)','tsv','log','forEach','Test\x20Summary','\x20(cached)',':\x20Sending\x20user\x20input...','text','/<agent-name>','3jtefDC','Error\x20writing\x20output\x20file:\x20','not\x20found','Available\x20tests:\x20','table','7PLtfTR','site','conversations','execute','\x20\x20Evaluating...\x20','Tests\x20found:\x20','Duration:\x20','Executing\x20new\x20tests...','tags','2372082jqLlxC','no_tests','417592CqmsNT','No\x20tests\x20found\x20matching:\x20','Failed:\x20\x20\x20','Run\x20\x27tdx\x20agent\x20pull\x20','resolve','Available\x20tags:\x20','✗\x20ERROR:\x20Project\x20not\x20found:\x20','executeReeval','message','substring','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','\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)','add','\x20\x20Conversation:\x20','Evaluating\x20response...','llm','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','no_local_folder','projectDir','Total:\x20\x20\x20\x20','404','existsSync','find','test.yml','map','4iKCWOb','tests','llmProject','agentName','⚠\x20SKIPPED:\x20','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','\x20\x20Project:\x20','no_context','jsonl','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','1208780WFUMrg','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','now','white','4471940elRkqn','Re-evaluating\x20cached\x20test\x20run...','resolveProjectId','✓\x20PASS:\x20','split','includes','size','timestamp','agent:test','New\x20tests\x20to\x20execute:\x20','toISOString','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','trim','Re-evaluating\x20','writeFileSync','Running\x20test:\x20','...','Failed\x20Tests:','green','filter','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','source'];a5_0x3bc8=function(){return _0x25bd9e;};return a5_0x3bc8();}import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';function a5_0x12ec(_0x211d61,_0x420380){_0x211d61=_0x211d61-0x1b1;const _0x3bc89c=a5_0x3bc8();let _0x12ecaa=_0x3bc89c[_0x211d61];return _0x12ecaa;}export class AgentTestCommand extends BaseCommand{['name']=a5_0x2d676e(0x1b5);[a5_0x2d676e(0x1ff)]=a5_0x2d676e(0x1dc);async[a5_0x2d676e(0x21e)](_0x32232e){const _0xd2424e=a5_0x2d676e,{options:_0xa00e2b,args:_0x25feb2,tdx:_0x22ac6f}=_0x32232e,_0x243d74=_0x25feb2[0x0]||'.',_0x3f3965=_0xa00e2b[_0xd2424e(0x1c7)],_0x177ce5=_0xa00e2b,_0xefddd7=_0x177ce5['eval']===![],_0x2092e1=_0x177ce5[_0xd2424e(0x1cf)],_0x57fe7d=_0x177ce5[_0xd2424e(0x1ec)],_0x17342b=_0x177ce5[_0xd2424e(0x223)],_0x505a34=_0xa00e2b[_0xd2424e(0x21c)],_0x1f2261=_0x177ce5['output'];if(_0x2092e1&&_0xefddd7)return console[_0xd2424e(0x20f)](a5_0x1bff63['red'](_0xd2424e(0x1ce))),0x1;let _0x137824='table';if(_0x177ce5[_0xd2424e(0x1f8)])_0x137824=_0xd2424e(0x1f8);else{if(_0x177ce5['jsonl'])_0x137824=_0xd2424e(0x247);else{if(_0x177ce5[_0xd2424e(0x20e)])_0x137824='tsv';else{if(_0x177ce5[_0xd2424e(0x21a)])_0x137824='table';}}}const _0xfeeda8=_0x177ce5[_0xd2424e(0x241)];let _0x3396e8=_0x243d74;const _0x4bbd0a=a5_0x2a8738[_0xd2424e(0x23b)](_0x243d74),_0x9a0739=_0x243d74==='.';if(!_0x4bbd0a||_0x9a0739){const _0x13fe02=resolveProjectFromContext(_0x243d74,_0xfeeda8,{'requireFile':_0xd2424e(0x23d)});if(_0x13fe02['found'])_0x3396e8=_0x13fe02['projectDir'],_0x13fe02[_0xd2424e(0x1c2)]===_0xd2424e(0x1e7)&&console[_0xd2424e(0x20f)](a5_0x1bff63[_0xd2424e(0x209)]('Using\x20agent:\x20'+_0x3396e8));else switch(_0x13fe02['reason']){case _0xd2424e(0x246):console[_0xd2424e(0x20f)](a5_0x1bff63['yellow'](_0x13fe02[_0xd2424e(0x22e)])),console[_0xd2424e(0x20f)](),console[_0xd2424e(0x20f)](_0xd2424e(0x1f7)),console[_0xd2424e(0x20f)](_0xd2424e(0x20c)),console[_0xd2424e(0x20f)](_0xd2424e(0x231)),console[_0xd2424e(0x20f)](),console[_0xd2424e(0x20f)](_0xd2424e(0x1c1));return 0x1;case _0xd2424e(0x237):console[_0xd2424e(0x20f)](a5_0x1bff63[_0xd2424e(0x201)](_0x13fe02[_0xd2424e(0x22e)])),console['log'](),console[_0xd2424e(0x20f)](_0xd2424e(0x229)+_0x13fe02['llmProject']+_0xd2424e(0x208));return 0x1;case'multiple_agents':{const _0x1dcae2=a5_0x5ebcc7[_0xd2424e(0x1d9)](_0x13fe02[_0xd2424e(0x238)]);console[_0xd2424e(0x20f)](a5_0x1bff63[_0xd2424e(0x201)](_0xd2424e(0x24a)+_0x13fe02[_0xd2424e(0x241)]+'\x22:'));for(const _0x49a682 of _0x13fe02[_0xd2424e(0x1ed)]){console[_0xd2424e(0x20f)]('\x20\x20-\x20'+_0x49a682);}return console[_0xd2424e(0x20f)](),console[_0xd2424e(0x20f)]('Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/'+_0x1dcae2+_0xd2424e(0x215)),0x1;}case _0xd2424e(0x225):console['log'](a5_0x1bff63['yellow']('No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22'+_0x13fe02[_0xd2424e(0x241)]+'\x22.')),console[_0xd2424e(0x20f)](a5_0x1bff63['dim'](_0xd2424e(0x1d5)+_0x13fe02[_0xd2424e(0x238)])),console[_0xd2424e(0x20f)](),console[_0xd2424e(0x20f)](_0xd2424e(0x1fb));return 0x1;}}const {definition:_0x134cfe,agentInfo:_0x3c4d87}=parseTestFile(_0x3396e8);let _0x16b761=_0x134cfe[_0xd2424e(0x240)];if(_0x57fe7d){const _0xc4eade=_0x57fe7d[_0xd2424e(0x1b1)](',')['map'](_0x1d3b86=>_0x1d3b86[_0xd2424e(0x1b9)]());_0x16b761=_0x134cfe[_0xd2424e(0x240)][_0xd2424e(0x1c0)](_0x5b8629=>_0xc4eade[_0xd2424e(0x1b2)](_0x5b8629['name']));if(_0x16b761[_0xd2424e(0x1db)]===0x0)return console[_0xd2424e(0x20f)](a5_0x1bff63[_0xd2424e(0x201)](_0xd2424e(0x227)+_0x57fe7d)),console[_0xd2424e(0x20f)](a5_0x1bff63[_0xd2424e(0x209)](_0xd2424e(0x219)+_0x134cfe[_0xd2424e(0x240)]['map'](_0x466a59=>_0x466a59[_0xd2424e(0x1ec)])[_0xd2424e(0x1ef)](',\x20'))),0x1;}if(_0x17342b){const _0x5e04ba=_0x17342b[_0xd2424e(0x1b1)](',')['map'](_0x373d84=>_0x373d84[_0xd2424e(0x1b9)]()[_0xd2424e(0x1f2)]());_0x16b761=_0x16b761['filter'](_0xe434e=>_0xe434e[_0xd2424e(0x223)]?.[_0xd2424e(0x1d2)](_0x39acf3=>_0x5e04ba['includes'](_0x39acf3[_0xd2424e(0x1f2)]())));if(_0x16b761[_0xd2424e(0x1db)]===0x0){console[_0xd2424e(0x20f)](a5_0x1bff63[_0xd2424e(0x201)](_0xd2424e(0x1fd)+_0x17342b));const _0x1c9eb3=new Set();return _0x134cfe['tests'][_0xd2424e(0x210)](_0x2e4cc1=>_0x2e4cc1[_0xd2424e(0x223)]?.[_0xd2424e(0x210)](_0x427d0c=>_0x1c9eb3[_0xd2424e(0x232)](_0x427d0c))),_0x1c9eb3[_0xd2424e(0x1b3)]>0x0?console['log'](a5_0x1bff63[_0xd2424e(0x209)](_0xd2424e(0x22b)+[..._0x1c9eb3]['join'](',\x20'))):console[_0xd2424e(0x20f)](a5_0x1bff63[_0xd2424e(0x209)]('No\x20tests\x20have\x20tags\x20defined.')),0x1;}}if(_0x2092e1)return this[_0xd2424e(0x22d)](_0x32232e,{'definition':{'tests':_0x16b761},'agentInfo':_0x3c4d87,'outputFormat':_0x137824,'outputFile':_0x1f2261,'testNames':_0x57fe7d});if(_0x3f3965){console[_0xd2424e(0x20f)](a5_0x1bff63['cyan'](_0xd2424e(0x1c5))),console[_0xd2424e(0x20f)](_0xd2424e(0x1c6)+a5_0x1bff63['white'](_0x505a34)),console[_0xd2424e(0x20f)](_0xd2424e(0x245)+a5_0x1bff63[_0xd2424e(0x24d)](_0x3c4d87[_0xd2424e(0x1ca)])),console[_0xd2424e(0x20f)](_0xd2424e(0x1cc)+a5_0x1bff63['white'](_0x3c4d87[_0xd2424e(0x242)])),console['log'](),console[_0xd2424e(0x20f)](_0xd2424e(0x220)+a5_0x1bff63[_0xd2424e(0x24d)](_0x16b761[_0xd2424e(0x1db)]));for(let _0x3983c1=0x0;_0x3983c1<_0x16b761[_0xd2424e(0x1db)];_0x3983c1++){const _0x252419=_0x16b761[_0x3983c1],_0x40d534=_0x252419[_0xd2424e(0x1f9)][_0xd2424e(0x1db)]===0x1?_0xd2424e(0x1f4):'rounds',_0x4078aa=_0x252419['tags']?.[_0xd2424e(0x1db)]?'\x20['+_0x252419['tags']['join'](',\x20')+']':'';console[_0xd2424e(0x20f)]('\x20\x20'+(_0x3983c1+0x1)+'.\x20'+a5_0x1bff63['white'](_0x252419[_0xd2424e(0x1ec)])+'\x20('+_0x252419[_0xd2424e(0x1f9)][_0xd2424e(0x1db)]+'\x20'+_0x40d534+')'+a5_0x1bff63[_0xd2424e(0x209)](_0x4078aa));}return 0x0;}let _0x3abf91,_0x3efcea;try{_0x3abf91=await _0x22ac6f[_0xd2424e(0x235)][_0xd2424e(0x250)](_0x3c4d87[_0xd2424e(0x1ca)]);}catch(_0x3f1470){const _0x1bde5b=_0x3f1470 instanceof Error?_0x3f1470[_0xd2424e(0x22e)]:String(_0x3f1470);return _0x1bde5b['includes'](_0xd2424e(0x23a))||_0x1bde5b['toLowerCase']()[_0xd2424e(0x1b2)](_0xd2424e(0x218))?console[_0xd2424e(0x20f)](a5_0x1bff63[_0xd2424e(0x1f5)](_0xd2424e(0x22c)+_0x3c4d87['projectName'])):console['log'](a5_0x1bff63[_0xd2424e(0x1f5)](_0xd2424e(0x1f3)+_0x3c4d87[_0xd2424e(0x1ca)]+'\x22:\x20'+_0x1bde5b)),0x1;}try{_0x3efcea=await _0x22ac6f[_0xd2424e(0x235)][_0xd2424e(0x204)](_0x3c4d87[_0xd2424e(0x242)],_0x3abf91);}catch(_0x39dbb0){const _0x573bf8=_0x39dbb0 instanceof Error?_0x39dbb0['message']:String(_0x39dbb0);return _0x573bf8[_0xd2424e(0x1b2)]('404')||_0x573bf8['toLowerCase']()[_0xd2424e(0x1b2)]('not\x20found')?console[_0xd2424e(0x20f)](a5_0x1bff63[_0xd2424e(0x1f5)](_0xd2424e(0x244)+_0x3c4d87[_0xd2424e(0x242)])):console[_0xd2424e(0x20f)](a5_0x1bff63[_0xd2424e(0x1f5)](_0xd2424e(0x24b)+_0x3c4d87['agentName']+_0xd2424e(0x206)+_0x573bf8)),0x1;}let _0x50983a;if(!_0xefddd7)try{_0x50983a=await setupEvaluatorAgent(_0x22ac6f[_0xd2424e(0x235)],_0xa00e2b['verbose']);}catch(_0x461d49){const _0x511e26=_0x461d49 instanceof Error?_0x461d49[_0xd2424e(0x22e)]:String(_0x461d49);return console[_0xd2424e(0x20f)](a5_0x1bff63[_0xd2424e(0x1f5)](_0xd2424e(0x1e9)+_0x511e26)),0x1;}console[_0xd2424e(0x20f)](a5_0x1bff63['cyan']('Running\x20agent\x20tests...')),console[_0xd2424e(0x20f)](_0xd2424e(0x1c9)+a5_0x1bff63[_0xd2424e(0x24d)](_0x505a34)),console[_0xd2424e(0x20f)](_0xd2424e(0x1cd)+a5_0x1bff63[_0xd2424e(0x24d)](_0x3c4d87[_0xd2424e(0x1ca)]+'/'+_0x3c4d87[_0xd2424e(0x242)])),console[_0xd2424e(0x20f)]();const _0x1da029=[],_0x2aae20=[],_0x2027fd=Date['now']();for(let _0x5d71ed=0x0;_0x5d71ed<_0x16b761[_0xd2424e(0x1db)];_0x5d71ed++){const _0x18ca05=_0x16b761[_0x5d71ed];_0x16b761[_0xd2424e(0x1db)]>0x1?console[_0xd2424e(0x20f)](_0xd2424e(0x1c3)+(_0x5d71ed+0x1)+'/'+_0x16b761[_0xd2424e(0x1db)]+':\x20'+a5_0x1bff63['white'](_0x18ca05['name'])):console[_0xd2424e(0x20f)](_0xd2424e(0x1bc)+a5_0x1bff63[_0xd2424e(0x24d)](_0x18ca05['name']));const _0x51ec1d=createCommandSpinner(_0xd2424e(0x200)+_0x18ca05[_0xd2424e(0x1f9)][_0xd2424e(0x1db)]+_0xd2424e(0x213));_0x51ec1d[_0xd2424e(0x1d4)]();try{const {result:_0x3e877a,conversation:_0x1e77c8}=await runTest(_0x22ac6f[_0xd2424e(0x235)],_0x18ca05,{'agentId':_0x3efcea,'projectId':_0x3abf91,'site':_0x505a34,'noEval':_0xefddd7,'evaluatorId':_0x50983a,'onRoundStart':(_0x3f2190,_0x4461d2)=>{const _0x5df85d=_0xd2424e;_0x51ec1d[_0x5df85d(0x214)]=_0x5df85d(0x1cb)+(_0x3f2190+0x1)+'/'+_0x4461d2+_0x5df85d(0x213);},'onRoundComplete':(_0x448ca3,_0x4d84bd,_0x23ee59)=>{const _0x4e6cd7=_0xd2424e,_0x51c0c4=formatElapsed(_0x4d84bd);_0x23ee59?console[_0x4e6cd7(0x20f)](_0x4e6cd7(0x1ee)+(_0x448ca3+0x1)+'/'+_0x18ca05[_0x4e6cd7(0x1f9)][_0x4e6cd7(0x1db)]+'...\x20'+a5_0x1bff63['green']('✓')+'\x20('+_0x51c0c4+')'):console[_0x4e6cd7(0x20f)](_0x4e6cd7(0x1ee)+(_0x448ca3+0x1)+'/'+_0x18ca05[_0x4e6cd7(0x1f9)]['length']+_0x4e6cd7(0x20a)+a5_0x1bff63['red']('✗'));},'onEvaluationStart':()=>{const _0x37dddc=_0xd2424e;_0x51ec1d['text']=_0x37dddc(0x234);},'onEvaluationComplete':_0x17eeee=>{const _0x8dee7b=_0xd2424e,_0x20a388=formatElapsed(_0x17eeee);console[_0x8dee7b(0x20f)]('\x20\x20Evaluating...\x20'+a5_0x1bff63['green']('✓')+'\x20('+_0x20a388+')');}});_0x51ec1d['stop'](),_0x1da029[_0xd2424e(0x1f6)](_0x3e877a),_0x2aae20['push'](_0x1e77c8);if(_0x3e877a['status']==='PASS')console['log'](a5_0x1bff63[_0xd2424e(0x1bf)](_0xd2424e(0x251)+_0x3e877a[_0xd2424e(0x1fe)]));else _0x3e877a[_0xd2424e(0x1e2)]===_0xd2424e(0x1da)?console[_0xd2424e(0x20f)](a5_0x1bff63[_0xd2424e(0x1f5)](_0xd2424e(0x1fa)+_0x3e877a['reason'])):console[_0xd2424e(0x20f)](a5_0x1bff63['red'](_0xd2424e(0x1e0)+_0x3e877a['reason']));_0x3e877a[_0xd2424e(0x1ea)]&&console[_0xd2424e(0x20f)](a5_0x1bff63[_0xd2424e(0x209)](_0xd2424e(0x1e4)+_0x3e877a['conversation_url'])),console['log']();}catch(_0x760b0d){_0x51ec1d[_0xd2424e(0x1e5)]();const _0xfe01fc=_0x760b0d instanceof Error?_0x760b0d[_0xd2424e(0x22e)]:String(_0x760b0d);console[_0xd2424e(0x20f)](a5_0x1bff63[_0xd2424e(0x1f5)](_0xd2424e(0x1e0)+_0xfe01fc)),console['log'](),_0x1da029[_0xd2424e(0x1f6)]({'name':_0x18ca05[_0xd2424e(0x1ec)],'status':_0xd2424e(0x1e6),'reason':_0xfe01fc,'timestamp':new Date()[_0xd2424e(0x1b7)](),'duration_ms':0x0});}}const _0x1be991=Date[_0xd2424e(0x24c)]()-_0x2027fd,_0x50f28f=_0x1da029[_0xd2424e(0x1c0)](_0x1a48ed=>_0x1a48ed[_0xd2424e(0x1e2)]===_0xd2424e(0x1e8))[_0xd2424e(0x1db)],_0x27e902=_0x1da029['filter'](_0x385c88=>_0x385c88[_0xd2424e(0x1e2)]===_0xd2424e(0x1da))[_0xd2424e(0x1db)],_0x21e492=_0x1da029[_0xd2424e(0x1c0)](_0x453591=>_0x453591[_0xd2424e(0x1e2)]===_0xd2424e(0x1e6))['length'];console[_0xd2424e(0x20f)]('━'[_0xd2424e(0x1c8)](0x3c)),console[_0xd2424e(0x20f)](_0xd2424e(0x211)),console[_0xd2424e(0x20f)]('━'['repeat'](0x3c)),console['log'](_0xd2424e(0x239)+_0x1da029[_0xd2424e(0x1db)]),console['log'](_0xd2424e(0x1eb)+a5_0x1bff63[_0xd2424e(0x1bf)](_0x50f28f)),console[_0xd2424e(0x20f)](_0xd2424e(0x228)+a5_0x1bff63[_0xd2424e(0x1f5)](_0x27e902));_0x21e492>0x0&&console[_0xd2424e(0x20f)](_0xd2424e(0x203)+a5_0x1bff63[_0xd2424e(0x1f5)](_0x21e492));console[_0xd2424e(0x20f)](_0xd2424e(0x221)+formatElapsed(_0x1be991)),console[_0xd2424e(0x20f)]('━'['repeat'](0x3c));const _0x2f06dd=_0x1da029['filter'](_0x1ff3d2=>_0x1ff3d2[_0xd2424e(0x1e2)]!==_0xd2424e(0x1e8));if(_0x2f06dd[_0xd2424e(0x1db)]>0x0){console[_0xd2424e(0x20f)](),console[_0xd2424e(0x20f)](_0xd2424e(0x1be));for(const _0x4fca3c of _0x2f06dd){const _0x22d8a4=a5_0x1bff63[_0xd2424e(0x1f5)]('✗'),_0x11cbc0=_0x4fca3c[_0xd2424e(0x1fe)][_0xd2424e(0x1db)]>0x32?_0x4fca3c['reason'][_0xd2424e(0x22f)](0x0,0x32)+'...':_0x4fca3c[_0xd2424e(0x1fe)];console[_0xd2424e(0x20f)]('\x20\x20'+_0x22d8a4+'\x20'+_0x4fca3c['name']+':\x20'+_0x11cbc0);}}const _0x1045b2={'summary':{'total':_0x1da029['length'],'passed':_0x50f28f,'failed':_0x27e902,'errors':_0x21e492>0x0?_0x21e492:undefined,'duration_ms':_0x1be991},'tests':_0x1da029,'agent':{'project':_0x3c4d87['projectName'],'name':_0x3c4d87['agentName'],'site':_0x505a34},'timestamp':new Date(_0x2027fd)[_0xd2424e(0x1b7)]()};try{const _0x3761fa=buildCachedTestRun(_0x2aae20,{'site':_0x505a34,'projectId':_0x3abf91,'projectName':_0x3c4d87[_0xd2424e(0x1ca)],'agentId':_0x3efcea,'agentName':_0x3c4d87[_0xd2424e(0x242)],'testYmlPath':a5_0x5ebcc7[_0xd2424e(0x22a)](_0x3c4d87[_0xd2424e(0x1d6)])});saveLastTestRun(_0x3761fa);}catch{}if(_0x137824!=='table'||_0x1f2261){const _0xce8a3=formatResults(_0x1045b2,_0x137824);if(_0x1f2261)try{a5_0x2a8738[_0xd2424e(0x1bb)](_0x1f2261,_0xce8a3,_0xd2424e(0x1f1)),console[_0xd2424e(0x20f)](),console[_0xd2424e(0x20f)](a5_0x1bff63[_0xd2424e(0x209)](_0xd2424e(0x207)+_0x1f2261));}catch(_0xc70b66){return console[_0xd2424e(0x20f)](),console['log'](a5_0x1bff63[_0xd2424e(0x1f5)](_0xd2424e(0x217)+_0xc70b66)),0x1;}else console[_0xd2424e(0x20f)](),console[_0xd2424e(0x20f)](_0xce8a3);}return _0x2f06dd[_0xd2424e(0x1db)]>0x0?0x1:0x0;}async[a5_0x2d676e(0x22d)](_0xe6c1f4,_0x4bf0ed){const _0x46d02b=a5_0x2d676e,{options:_0x5f3ab1,tdx:_0x2e3366}=_0xe6c1f4,{definition:_0x452e7c,agentInfo:_0x240d71,outputFormat:_0x4eb935,outputFile:_0x24be2d}=_0x4bf0ed,_0x188633=_0x5f3ab1[_0x46d02b(0x21c)],_0x4001c7=loadLastTestRun();if(!_0x4001c7)return console[_0x46d02b(0x20f)](a5_0x1bff63[_0x46d02b(0x1f5)](_0x46d02b(0x1e1))),console[_0x46d02b(0x20f)](a5_0x1bff63[_0x46d02b(0x209)]('Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.')),0x1;if(_0x4001c7[_0x46d02b(0x1d0)][_0x46d02b(0x242)]!==_0x240d71[_0x46d02b(0x242)])return console[_0x46d02b(0x20f)](a5_0x1bff63[_0x46d02b(0x1f5)](_0x46d02b(0x230)+_0x4001c7[_0x46d02b(0x1d0)]['agentName']+_0x46d02b(0x1fc)+_0x240d71[_0x46d02b(0x242)]+'\x22.')),console[_0x46d02b(0x20f)](a5_0x1bff63[_0x46d02b(0x209)](_0x46d02b(0x1d1))),0x1;const _0x57ec3c=new Set(_0x4001c7[_0x46d02b(0x21d)][_0x46d02b(0x23e)](_0x3e17a7=>_0x3e17a7[_0x46d02b(0x1c4)])),_0x26faa8=_0x452e7c['tests'][_0x46d02b(0x1c0)](_0xac86a5=>!_0x57ec3c[_0x46d02b(0x202)](_0xac86a5[_0x46d02b(0x1ec)]));if(_0x26faa8[_0x46d02b(0x1db)]>0x0&&_0x4001c7[_0x46d02b(0x21c)]!==_0x188633)return console[_0x46d02b(0x20f)](a5_0x1bff63[_0x46d02b(0x1f5)](_0x46d02b(0x236))),console[_0x46d02b(0x20f)](a5_0x1bff63[_0x46d02b(0x209)](_0x46d02b(0x1d3)+_0x4001c7[_0x46d02b(0x21c)]+'\x22,\x20but\x20current\x20site\x20is\x20\x22'+_0x188633+'\x22.')),console[_0x46d02b(0x20f)](a5_0x1bff63[_0x46d02b(0x209)](_0x46d02b(0x1de)+_0x4001c7['site']+_0x46d02b(0x248))),0x1;const _0x5d902f=_0x452e7c['tests'][_0x46d02b(0x1c0)](_0x1ab8f4=>_0x57ec3c[_0x46d02b(0x202)](_0x1ab8f4['name'])),_0x723a95=_0x26faa8;let _0x11ce06;try{_0x11ce06=await setupEvaluatorAgent(_0x2e3366[_0x46d02b(0x235)],_0x5f3ab1[_0x46d02b(0x1e3)]);}catch(_0x47bda1){const _0x460f71=_0x47bda1 instanceof Error?_0x47bda1[_0x46d02b(0x22e)]:String(_0x47bda1);return console[_0x46d02b(0x20f)](a5_0x1bff63[_0x46d02b(0x1f5)](_0x46d02b(0x1e9)+_0x460f71)),0x1;}console[_0x46d02b(0x20f)](a5_0x1bff63['cyan'](_0x46d02b(0x24f))),console['log']('Cached\x20run\x20from:\x20'+a5_0x1bff63[_0x46d02b(0x24d)](_0x4001c7[_0x46d02b(0x1b4)])),console[_0x46d02b(0x20f)](_0x46d02b(0x1cd)+a5_0x1bff63[_0x46d02b(0x24d)](_0x4001c7[_0x46d02b(0x1d0)][_0x46d02b(0x1ca)]+'/'+_0x4001c7[_0x46d02b(0x1d0)][_0x46d02b(0x242)]));_0x723a95[_0x46d02b(0x1db)]>0x0&&console[_0x46d02b(0x20f)](_0x46d02b(0x1b6)+a5_0x1bff63['yellow'](_0x723a95[_0x46d02b(0x1db)]));console[_0x46d02b(0x20f)]();const _0x19aa83=[],_0x369d6a=Date[_0x46d02b(0x24c)](),_0x273633=createCommandSpinner('Re-evaluating...');if(_0x5d902f[_0x46d02b(0x1db)]>0x0)try{const _0x129de4=await reevaluateFromCache(_0x2e3366[_0x46d02b(0x235)],_0x4001c7,{'tests':_0x5d902f},{'evaluatorId':_0x11ce06,'onTestStart':(_0x223d0c,_0xf44550,_0x2f5886)=>{const _0x29239f=_0x46d02b;_0x273633[_0x29239f(0x214)]=_0x29239f(0x1ba)+(_0xf44550+0x1)+'/'+_0x2f5886+':\x20'+_0x223d0c+_0x29239f(0x1bd);if(!_0x273633[_0x29239f(0x20b)])_0x273633[_0x29239f(0x1d4)]();},'onTestComplete':(_0x4380f1,_0x4f8c8f)=>{const _0x187def=_0x46d02b;_0x273633[_0x187def(0x1e5)]();if(_0x4f8c8f[_0x187def(0x1e2)]===_0x187def(0x1e8))console['log'](a5_0x1bff63[_0x187def(0x1bf)](_0x187def(0x251)+_0x4380f1)+a5_0x1bff63[_0x187def(0x209)](_0x187def(0x212)));else _0x4f8c8f[_0x187def(0x1e2)]===_0x187def(0x1da)?console[_0x187def(0x20f)](a5_0x1bff63[_0x187def(0x1f5)]('✗\x20FAIL:\x20'+_0x4380f1+_0x187def(0x1df)+_0x4f8c8f['reason'])+a5_0x1bff63[_0x187def(0x209)](_0x187def(0x212))):console[_0x187def(0x20f)](a5_0x1bff63[_0x187def(0x1f5)](_0x187def(0x1e0)+_0x4380f1+_0x187def(0x1df)+_0x4f8c8f['reason']));_0x4f8c8f[_0x187def(0x1ea)]&&console['log'](a5_0x1bff63['dim'](_0x187def(0x233)+_0x4f8c8f[_0x187def(0x1ea)])),_0x19aa83['push'](_0x4f8c8f);},'onTestSkipped':(_0x3e4d10,_0x4015fe)=>{const _0x23ed19=_0x46d02b;_0x273633['stop'](),console['log'](a5_0x1bff63[_0x23ed19(0x201)](_0x23ed19(0x243)+_0x3e4d10+_0x23ed19(0x1df)+_0x4015fe));}});for(const _0x546605 of _0x129de4){!_0x19aa83[_0x46d02b(0x23c)](_0x35fc48=>_0x35fc48['name']===_0x546605[_0x46d02b(0x1ec)])&&_0x19aa83[_0x46d02b(0x1f6)](_0x546605);}}catch(_0x2e376e){_0x273633[_0x46d02b(0x1e5)]();const _0x42acac=_0x2e376e instanceof Error?_0x2e376e['message']:String(_0x2e376e);return console[_0x46d02b(0x20f)](a5_0x1bff63[_0x46d02b(0x1f5)](_0x46d02b(0x1b8)+_0x42acac)),0x1;}_0x273633[_0x46d02b(0x1e5)]();if(_0x723a95[_0x46d02b(0x1db)]>0x0){console['log'](),console[_0x46d02b(0x20f)](a5_0x1bff63['cyan'](_0x46d02b(0x222)));const {projectId:_0x7a96d4,agentId:_0x2da480}=_0x4001c7[_0x46d02b(0x1d0)];for(const _0x1d1288 of _0x723a95){console[_0x46d02b(0x20f)](_0x46d02b(0x1f0)+a5_0x1bff63[_0x46d02b(0x24d)](_0x1d1288[_0x46d02b(0x1ec)]));const _0x4a5a41=createCommandSpinner(_0x46d02b(0x200)+_0x1d1288[_0x46d02b(0x1f9)][_0x46d02b(0x1db)]+_0x46d02b(0x213));_0x4a5a41[_0x46d02b(0x1d4)]();try{const {result:_0x59ba1f}=await runTest(_0x2e3366['llm'],_0x1d1288,{'agentId':_0x2da480,'projectId':_0x7a96d4,'site':_0x4001c7['site'],'noEval':![],'evaluatorId':_0x11ce06,'onRoundStart':(_0x572420,_0x38d067)=>{const _0x2bafe3=_0x46d02b;_0x4a5a41[_0x2bafe3(0x214)]=_0x2bafe3(0x1cb)+(_0x572420+0x1)+'/'+_0x38d067+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x50e9be,_0xcf4168,_0x2c6957)=>{const _0x46ee96=_0x46d02b,_0x2b9f32=formatElapsed(_0xcf4168);_0x2c6957?console['log'](_0x46ee96(0x1ee)+(_0x50e9be+0x1)+'/'+_0x1d1288[_0x46ee96(0x1f9)][_0x46ee96(0x1db)]+_0x46ee96(0x20a)+a5_0x1bff63[_0x46ee96(0x1bf)]('✓')+'\x20('+_0x2b9f32+')'):console[_0x46ee96(0x20f)](_0x46ee96(0x1ee)+(_0x50e9be+0x1)+'/'+_0x1d1288[_0x46ee96(0x1f9)][_0x46ee96(0x1db)]+_0x46ee96(0x20a)+a5_0x1bff63[_0x46ee96(0x1f5)]('✗'));},'onEvaluationStart':()=>{const _0x38f326=_0x46d02b;_0x4a5a41['text']=_0x38f326(0x234);},'onEvaluationComplete':_0x3bb071=>{const _0x33eace=_0x46d02b,_0x4537fb=formatElapsed(_0x3bb071);console['log'](_0x33eace(0x21f)+a5_0x1bff63[_0x33eace(0x1bf)]('✓')+'\x20('+_0x4537fb+')');}});_0x4a5a41['stop'](),_0x19aa83[_0x46d02b(0x1f6)](_0x59ba1f);if(_0x59ba1f[_0x46d02b(0x1e2)]===_0x46d02b(0x1e8))console[_0x46d02b(0x20f)](a5_0x1bff63[_0x46d02b(0x1bf)](_0x46d02b(0x251)+_0x59ba1f['reason'])+a5_0x1bff63[_0x46d02b(0x209)]('\x20(new)'));else _0x59ba1f['status']===_0x46d02b(0x1da)?console[_0x46d02b(0x20f)](a5_0x1bff63['red']('✗\x20FAIL:\x20'+_0x59ba1f['reason'])+a5_0x1bff63[_0x46d02b(0x209)](_0x46d02b(0x20d))):console[_0x46d02b(0x20f)](a5_0x1bff63[_0x46d02b(0x1f5)](_0x46d02b(0x1e0)+_0x59ba1f[_0x46d02b(0x1fe)]));_0x59ba1f[_0x46d02b(0x1ea)]&&console[_0x46d02b(0x20f)](a5_0x1bff63[_0x46d02b(0x209)]('\x20\x20Conversation:\x20'+_0x59ba1f[_0x46d02b(0x1ea)]));}catch(_0x289d1f){_0x4a5a41['stop']();const _0x32f586=_0x289d1f instanceof Error?_0x289d1f['message']:String(_0x289d1f);console[_0x46d02b(0x20f)](a5_0x1bff63['red'](_0x46d02b(0x1e0)+_0x32f586)),_0x19aa83['push']({'name':_0x1d1288[_0x46d02b(0x1ec)],'status':_0x46d02b(0x1e6),'reason':_0x32f586,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}}console[_0x46d02b(0x20f)]();const _0x5f84ad=Date[_0x46d02b(0x24c)]()-_0x369d6a,_0x80e433=_0x19aa83[_0x46d02b(0x1c0)](_0x523aec=>_0x523aec[_0x46d02b(0x1e2)]==='PASS')['length'],_0x5eb104=_0x19aa83[_0x46d02b(0x1c0)](_0x286f18=>_0x286f18[_0x46d02b(0x1e2)]===_0x46d02b(0x1da))[_0x46d02b(0x1db)],_0x3926dd=_0x19aa83[_0x46d02b(0x1c0)](_0x41968d=>_0x41968d[_0x46d02b(0x1e2)]===_0x46d02b(0x1e6))['length'];console[_0x46d02b(0x20f)]('━'[_0x46d02b(0x1c8)](0x3c)),console[_0x46d02b(0x20f)]('Re-evaluation\x20Summary'),console[_0x46d02b(0x20f)]('━'['repeat'](0x3c)),console[_0x46d02b(0x20f)](_0x46d02b(0x239)+_0x19aa83[_0x46d02b(0x1db)]),console[_0x46d02b(0x20f)](_0x46d02b(0x1eb)+a5_0x1bff63[_0x46d02b(0x1bf)](_0x80e433)),console[_0x46d02b(0x20f)](_0x46d02b(0x228)+a5_0x1bff63[_0x46d02b(0x1f5)](_0x5eb104));_0x3926dd>0x0&&console[_0x46d02b(0x20f)]('Errors:\x20\x20\x20'+a5_0x1bff63[_0x46d02b(0x1f5)](_0x3926dd));console[_0x46d02b(0x20f)](_0x46d02b(0x221)+formatElapsed(_0x5f84ad)),console['log']('━'[_0x46d02b(0x1c8)](0x3c));const _0x254edb={'summary':{'total':_0x19aa83['length'],'passed':_0x80e433,'failed':_0x5eb104,'errors':_0x3926dd>0x0?_0x3926dd:undefined,'duration_ms':_0x5f84ad},'tests':_0x19aa83,'agent':{'project':_0x240d71[_0x46d02b(0x1ca)],'name':_0x240d71[_0x46d02b(0x242)],'site':_0x188633},'timestamp':new Date(_0x369d6a)[_0x46d02b(0x1b7)]()};if(_0x4eb935!==_0x46d02b(0x21a)||_0x24be2d){const _0x201a4e=formatResults(_0x254edb,_0x4eb935);if(_0x24be2d)try{a5_0x2a8738['writeFileSync'](_0x24be2d,_0x201a4e,_0x46d02b(0x1f1)),console[_0x46d02b(0x20f)](),console[_0x46d02b(0x20f)](a5_0x1bff63[_0x46d02b(0x209)]('Output\x20written\x20to:\x20'+_0x24be2d));}catch(_0x11bdaf){return console[_0x46d02b(0x20f)](),console[_0x46d02b(0x20f)](a5_0x1bff63['red'](_0x46d02b(0x217)+_0x11bdaf)),0x1;}else console['log'](),console[_0x46d02b(0x20f)](_0x201a4e);}const _0x2ab6f6=_0x19aa83[_0x46d02b(0x1c0)](_0x4ef5e9=>_0x4ef5e9['status']!=='PASS');return _0x2ab6f6[_0x46d02b(0x1db)]>0x0?0x1:0x0;}}
@@ -1 +1 @@
1
- const a6_0x5e0e31=a6_0x2b67;(function(_0x3753f6,_0x36e567){const _0x1dee3d=a6_0x2b67,_0xca2fbc=_0x3753f6();while(!![]){try{const _0x48b7e9=parseInt(_0x1dee3d(0x1d1))/0x1*(parseInt(_0x1dee3d(0x1cc))/0x2)+parseInt(_0x1dee3d(0x1ca))/0x3+parseInt(_0x1dee3d(0x1f5))/0x4*(-parseInt(_0x1dee3d(0x1b5))/0x5)+parseInt(_0x1dee3d(0x1f6))/0x6+-parseInt(_0x1dee3d(0x1d2))/0x7+parseInt(_0x1dee3d(0x1ef))/0x8*(parseInt(_0x1dee3d(0x1c2))/0x9)+-parseInt(_0x1dee3d(0x1bb))/0xa;if(_0x48b7e9===_0x36e567)break;else _0xca2fbc['push'](_0xca2fbc['shift']());}catch(_0x28e532){_0xca2fbc['push'](_0xca2fbc['shift']());}}}(a6_0x1849,0xd2559));import{BaseCommand}from'./command.js';function a6_0x2b67(_0x246234,_0xb82136){_0x246234=_0x246234-0x1b4;const _0x184960=a6_0x1849();let _0x2b67b8=_0x184960[_0x246234];return _0x2b67b8;}import{RawAPI}from'../sdk/api.js';function a6_0x1849(){const _0xdb44c1=['length','error','color','156216MJFmUz','headers','site','Endpoint\x20must\x20start\x20with\x20/:\x20','trim','stack','6316916BOjxQc','4733922HRBxxE','.\x20Valid\x20types:\x20','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','5PycXdA','substring','PUT','file','message','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','17347610NCctcn','type','keys','validate','Invalid\x20API\x20type:\x20','set-cookie','noColor','783fPpuWD','request','\x0aStack\x20trace:\x0a','Invalid\x20HTTP\x20method:\x20','isArray','Results\x20saved\x20to\x20','DELETE','indexOf','1739460YhxKJF','.\x20Valid\x20methods:\x20','790798SKqsIz','x-trino-user','execute','x-auth-token','startsWith','4AVPTrO','3316131ciOpJN','api','Error:\x20','toUpperCase','has','GET','verbose','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','data','output','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','trino','name','join','header','log','includes','llm-proxy','entries','PATCH','<\x20HTTP/1.1\x20','cookie','description','POST','readBodyFromFile','method'];a6_0x1849=function(){return _0xdb44c1;};return a6_0x1849();}import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set(['authorization','proxy-authorization',a6_0x5e0e31(0x1e7),a6_0x5e0e31(0x1c0),'set-cookie2','x-xsrf-token',a6_0x5e0e31(0x1cf),a6_0x5e0e31(0x1cd)]);function isSensitiveHeader(_0x21b002){const _0x27d3e9=a6_0x5e0e31;return SENSITIVE_HEADERS[_0x27d3e9(0x1d6)](_0x21b002['toLowerCase']());}function parseHeader(_0xc34148){const _0x3ea08d=a6_0x5e0e31,_0x1c1bc5=_0xc34148[_0x3ea08d(0x1c9)](':');if(_0x1c1bc5===-0x1)throw new Error('Invalid\x20header\x20format:\x20\x22'+_0xc34148+'\x22.\x20'+_0x3ea08d(0x1ba));const _0x46feb0=_0xc34148[_0x3ea08d(0x1b6)](0x0,_0x1c1bc5)[_0x3ea08d(0x1f3)](),_0x5e614e=_0xc34148[_0x3ea08d(0x1b6)](_0x1c1bc5+0x1)[_0x3ea08d(0x1f3)]();if(!_0x46feb0)throw new Error(_0x3ea08d(0x1b4)+_0xc34148+'\x22');return[_0x46feb0,_0x5e614e];}export class ApiCommand extends BaseCommand{[a6_0x5e0e31(0x1de)]='api';[a6_0x5e0e31(0x1e8)]=a6_0x5e0e31(0x1d9);[a6_0x5e0e31(0x1be)](_0x12944f){const _0x5cbf47=a6_0x5e0e31,{args:_0x8534c1,options:_0x92e69f}=_0x12944f,_0x55c833=_0x92e69f;if(_0x8534c1[_0x5cbf47(0x1ec)]===0x0)return'Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list';const _0x3c7809=_0x8534c1[0x0];if(!_0x3c7809[_0x5cbf47(0x1d0)]('/'))return _0x5cbf47(0x1f2)+_0x3c7809;const _0x5bd41d=_0x55c833['data'],_0x568010=_0x55c833['file'];if(_0x5bd41d&&_0x568010)return _0x5cbf47(0x1dc);const _0x3b8afd=_0x55c833[_0x5cbf47(0x1eb)]||_0x5cbf47(0x1d7),_0x48f6e4=[_0x5cbf47(0x1d7),_0x5cbf47(0x1e9),_0x5cbf47(0x1b7),_0x5cbf47(0x1c8),_0x5cbf47(0x1e5)];if(!_0x48f6e4[_0x5cbf47(0x1e2)](_0x3b8afd[_0x5cbf47(0x1d5)]()))return _0x5cbf47(0x1c5)+_0x3b8afd+_0x5cbf47(0x1cb)+_0x48f6e4['join'](',\x20');const _0x855309=_0x55c833['type']||'td',_0x1ec96b=['td','cdp','workflow',_0x5cbf47(0x1dd),'llm',_0x5cbf47(0x1e3)];if(!_0x1ec96b[_0x5cbf47(0x1e2)](_0x855309))return _0x5cbf47(0x1bf)+_0x855309+_0x5cbf47(0x1f7)+_0x1ec96b[_0x5cbf47(0x1df)](',\x20');return undefined;}async[a6_0x5e0e31(0x1ce)](_0x56ba53){const _0x1b3fc5=a6_0x5e0e31,{options:_0x159e2e,args:_0x36180b,tdx:_0x42dc0e}=_0x56ba53,_0x2b4860=_0x159e2e,_0x4a1b77=_0x36180b[0x0],_0x43e9a9=(_0x2b4860[_0x1b3fc5(0x1eb)]||_0x1b3fc5(0x1d7))[_0x1b3fc5(0x1d5)](),_0x67ae56=_0x2b4860[_0x1b3fc5(0x1da)],_0x39944c=_0x2b4860[_0x1b3fc5(0x1b8)],_0x1563dd=_0x2b4860[_0x1b3fc5(0x1e0)],_0x32616c=_0x2b4860[_0x1b3fc5(0x1bc)]||'td';try{const _0x296ef8={};if(_0x1563dd){const _0x2a2639=Array[_0x1b3fc5(0x1c6)](_0x1563dd)?_0x1563dd:[_0x1563dd];for(const _0x416916 of _0x2a2639){const [_0xef53a2,_0x590dc3]=parseHeader(_0x416916);_0x296ef8[_0xef53a2]=_0x590dc3;}}let _0x5c9647;if(_0x67ae56)_0x5c9647=_0x67ae56;else{if(_0x39944c)try{_0x5c9647=RawAPI[_0x1b3fc5(0x1ea)](_0x39944c);}catch(_0x22c2b2){return console[_0x1b3fc5(0x1ed)](_0x1b3fc5(0x1d4)+(_0x22c2b2 instanceof Error?_0x22c2b2['message']:String(_0x22c2b2))),0x1;}}const _0x23b225={'method':_0x43e9a9,'apiType':_0x32616c,'includeHeaders':_0x159e2e[_0x1b3fc5(0x1d8)]};_0x5c9647&&(_0x23b225['body']=_0x5c9647);Object[_0x1b3fc5(0x1bd)](_0x296ef8)[_0x1b3fc5(0x1ec)]>0x0&&(_0x23b225[_0x1b3fc5(0x1f0)]=_0x296ef8);if(_0x159e2e['verbose']){const _0x234d74=resolveSite(_0x159e2e[_0x1b3fc5(0x1f1)]),_0xf948df=getEndpoint(_0x234d74,_0x32616c),_0x3acd12=''+_0xf948df+_0x4a1b77;console['error']('>\x20'+_0x43e9a9+'\x20'+_0x3acd12);const _0x57e56a=getAuthHeaders(_0x234d74),_0x13df03={..._0x57e56a,..._0x296ef8};for(const [_0x152f30,_0x566432]of Object[_0x1b3fc5(0x1e4)](_0x13df03)){!isSensitiveHeader(_0x152f30)&&console[_0x1b3fc5(0x1ed)]('>\x20'+_0x152f30+':\x20'+_0x566432);}_0x5c9647&&console['error']('>'),console[_0x1b3fc5(0x1ed)]('');}const _0x4f2d93=await _0x42dc0e[_0x1b3fc5(0x1d3)][_0x1b3fc5(0x1c3)](_0x4a1b77,_0x23b225);if(_0x159e2e[_0x1b3fc5(0x1d8)]&&_0x4f2d93[_0x1b3fc5(0x1f0)]){console['error'](_0x1b3fc5(0x1e6)+_0x4f2d93['status']);for(const [_0x4593ae,_0x1186a3]of Object['entries'](_0x4f2d93[_0x1b3fc5(0x1f0)])){!isSensitiveHeader(_0x4593ae)&&console[_0x1b3fc5(0x1ed)]('<\x20'+_0x4593ae+':\x20'+_0x1186a3);}console[_0x1b3fc5(0x1ed)]('');}const _0x512041=Boolean(_0x159e2e[_0x1b3fc5(0x1db)]),_0x72eabb={'color':_0x159e2e[_0x1b3fc5(0x1ee)],'noColor':_0x159e2e[_0x1b3fc5(0x1c1)]||_0x512041&&!_0x159e2e[_0x1b3fc5(0x1ee)]},_0x38c7d5=colorizeJSON(_0x4f2d93[_0x1b3fc5(0x1da)],_0x72eabb);return _0x159e2e[_0x1b3fc5(0x1db)]?(writeFileSync(_0x159e2e[_0x1b3fc5(0x1db)],_0x38c7d5),console[_0x1b3fc5(0x1ed)](_0x1b3fc5(0x1c7)+_0x159e2e[_0x1b3fc5(0x1db)])):console[_0x1b3fc5(0x1e1)](_0x38c7d5),0x0;}catch(_0x3d6ff1){return _0x3d6ff1 instanceof Error?(console[_0x1b3fc5(0x1ed)]('Error:\x20'+_0x3d6ff1[_0x1b3fc5(0x1b9)]),_0x159e2e[_0x1b3fc5(0x1d8)]&&_0x3d6ff1['stack']&&console['error'](_0x1b3fc5(0x1c4)+_0x3d6ff1[_0x1b3fc5(0x1f4)])):console[_0x1b3fc5(0x1ed)](_0x1b3fc5(0x1d4)+String(_0x3d6ff1)),0x1;}}}
1
+ const a6_0x336d04=a6_0x4b74;(function(_0xe6c58,_0x4e7e83){const _0x265786=a6_0x4b74,_0x444775=_0xe6c58();while(!![]){try{const _0x30309a=parseInt(_0x265786(0x195))/0x1*(parseInt(_0x265786(0x1d6))/0x2)+-parseInt(_0x265786(0x1c3))/0x3*(parseInt(_0x265786(0x1da))/0x4)+-parseInt(_0x265786(0x1ae))/0x5+-parseInt(_0x265786(0x1c5))/0x6*(parseInt(_0x265786(0x1c8))/0x7)+parseInt(_0x265786(0x1c0))/0x8*(-parseInt(_0x265786(0x1df))/0x9)+-parseInt(_0x265786(0x197))/0xa*(-parseInt(_0x265786(0x1c4))/0xb)+-parseInt(_0x265786(0x1be))/0xc*(-parseInt(_0x265786(0x1c7))/0xd);if(_0x30309a===_0x4e7e83)break;else _0x444775['push'](_0x444775['shift']());}catch(_0x5b8bb8){_0x444775['push'](_0x444775['shift']());}}}(a6_0x12ac,0x2cfe3));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';const SENSITIVE_HEADERS=new Set([a6_0x336d04(0x1d4),a6_0x336d04(0x1c1),a6_0x336d04(0x19c),a6_0x336d04(0x19d),a6_0x336d04(0x1d0),a6_0x336d04(0x1a3),a6_0x336d04(0x1bf),a6_0x336d04(0x1b6)]);function a6_0x12ac(){const _0x3d0d17=['body','45qosxMp','Endpoint\x20must\x20start\x20with\x20/:\x20','type','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','file','8837fDhsxv','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','10DbUhby','startsWith','method','keys','output','cookie','set-cookie','api','PATCH','trim','message','workflow','x-xsrf-token','\x22.\x20','Results\x20saved\x20to\x20','PUT','entries','headers','substring','Error:\x20','join','execute','isArray','1349480IThBgj','header','<\x20HTTP/1.1\x20','includes','error','trino','indexOf','.\x20Valid\x20types:\x20','x-trino-user','site','Invalid\x20HTTP\x20method:\x20','POST','length','DELETE','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','GET','3396pgLjAO','x-auth-token','244424kGmdXj','proxy-authorization','request','3vGjGIE','2601291XXRHNJ','1099668IBxXgu','Invalid\x20API\x20type:\x20','28535OyZByq','7eqAUCC','status','llm','toLowerCase','description','color','llm-proxy','name','set-cookie2','stack','data','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','authorization','has','62lWmtak','verbose','noColor','log','1365532xWYHej','toUpperCase','validate','.\x20Valid\x20methods:\x20'];a6_0x12ac=function(){return _0x3d0d17;};return a6_0x12ac();}function a6_0x4b74(_0x623e43,_0xe89068){_0x623e43=_0x623e43-0x193;const _0x12aca3=a6_0x12ac();let _0x4b742b=_0x12aca3[_0x623e43];return _0x4b742b;}function isSensitiveHeader(_0x182007){const _0x15d1c2=a6_0x336d04;return SENSITIVE_HEADERS[_0x15d1c2(0x1d5)](_0x182007[_0x15d1c2(0x1cb)]());}function parseHeader(_0x118269){const _0x3abfbe=a6_0x336d04,_0x2bf362=_0x118269[_0x3abfbe(0x1b4)](':');if(_0x2bf362===-0x1)throw new Error('Invalid\x20header\x20format:\x20\x22'+_0x118269+_0x3abfbe(0x1a4)+_0x3abfbe(0x196));const _0xc440cc=_0x118269[_0x3abfbe(0x1a9)](0x0,_0x2bf362)[_0x3abfbe(0x1a0)](),_0x11818c=_0x118269['substring'](_0x2bf362+0x1)[_0x3abfbe(0x1a0)]();if(!_0xc440cc)throw new Error(_0x3abfbe(0x193)+_0x118269+'\x22');return[_0xc440cc,_0x11818c];}export class ApiCommand extends BaseCommand{[a6_0x336d04(0x1cf)]=a6_0x336d04(0x19e);[a6_0x336d04(0x1cc)]='Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs';[a6_0x336d04(0x1dc)](_0x69e278){const _0x2465f6=a6_0x336d04,{args:_0x5b0227,options:_0x51a12f}=_0x69e278,_0x126cb6=_0x51a12f;if(_0x5b0227['length']===0x0)return _0x2465f6(0x1d3);const _0x32ecb9=_0x5b0227[0x0];if(!_0x32ecb9[_0x2465f6(0x198)]('/'))return _0x2465f6(0x1e0)+_0x32ecb9;const _0x2f612b=_0x126cb6[_0x2465f6(0x1d2)],_0x510f5a=_0x126cb6[_0x2465f6(0x194)];if(_0x2f612b&&_0x510f5a)return _0x2465f6(0x1bc);const _0x199c60=_0x126cb6[_0x2465f6(0x199)]||_0x2465f6(0x1bd),_0x3712e6=['GET',_0x2465f6(0x1b9),_0x2465f6(0x1a6),_0x2465f6(0x1bb),_0x2465f6(0x19f)];if(!_0x3712e6[_0x2465f6(0x1b1)](_0x199c60['toUpperCase']()))return _0x2465f6(0x1b8)+_0x199c60+_0x2465f6(0x1dd)+_0x3712e6[_0x2465f6(0x1ab)](',\x20');const _0x3c0cfe=_0x126cb6['type']||'td',_0xc0aac7=['td','cdp',_0x2465f6(0x1a2),_0x2465f6(0x1b3),_0x2465f6(0x1ca),_0x2465f6(0x1ce)];if(!_0xc0aac7[_0x2465f6(0x1b1)](_0x3c0cfe))return _0x2465f6(0x1c6)+_0x3c0cfe+_0x2465f6(0x1b5)+_0xc0aac7[_0x2465f6(0x1ab)](',\x20');return undefined;}async[a6_0x336d04(0x1ac)](_0xab272a){const _0x4f51a0=a6_0x336d04,{options:_0x408c3d,args:_0x200813,tdx:_0x5149f4}=_0xab272a,_0x569a4f=_0x408c3d,_0x3f2698=_0x200813[0x0],_0x697a49=(_0x569a4f[_0x4f51a0(0x199)]||_0x4f51a0(0x1bd))[_0x4f51a0(0x1db)](),_0x334a00=_0x569a4f[_0x4f51a0(0x1d2)],_0x3f8d45=_0x569a4f[_0x4f51a0(0x194)],_0x34f507=_0x569a4f[_0x4f51a0(0x1af)],_0x521e7c=_0x569a4f[_0x4f51a0(0x1e1)]||'td';try{const _0x4571f3={};if(_0x34f507){const _0x377e1e=Array[_0x4f51a0(0x1ad)](_0x34f507)?_0x34f507:[_0x34f507];for(const _0x5d2726 of _0x377e1e){const [_0x3a398e,_0x4e4057]=parseHeader(_0x5d2726);_0x4571f3[_0x3a398e]=_0x4e4057;}}let _0x2c40c4;if(_0x334a00)_0x2c40c4=_0x334a00;else{if(_0x3f8d45)try{_0x2c40c4=RawAPI['readBodyFromFile'](_0x3f8d45);}catch(_0x40d376){return console[_0x4f51a0(0x1b2)]('Error:\x20'+(_0x40d376 instanceof Error?_0x40d376['message']:String(_0x40d376))),0x1;}}const _0x14b26e={'method':_0x697a49,'apiType':_0x521e7c,'includeHeaders':_0x408c3d['verbose']};_0x2c40c4&&(_0x14b26e[_0x4f51a0(0x1de)]=_0x2c40c4);Object[_0x4f51a0(0x19a)](_0x4571f3)[_0x4f51a0(0x1ba)]>0x0&&(_0x14b26e[_0x4f51a0(0x1a8)]=_0x4571f3);if(_0x408c3d[_0x4f51a0(0x1d7)]){const _0xab3c68=resolveSite(_0x408c3d[_0x4f51a0(0x1b7)]),_0x266a92=getEndpoint(_0xab3c68,_0x521e7c),_0x56d42c=''+_0x266a92+_0x3f2698;console[_0x4f51a0(0x1b2)]('>\x20'+_0x697a49+'\x20'+_0x56d42c);const _0x22d14e=getAuthHeaders(_0xab3c68),_0x420502={..._0x22d14e,..._0x4571f3};for(const [_0x22444c,_0x28b3b2]of Object[_0x4f51a0(0x1a7)](_0x420502)){!isSensitiveHeader(_0x22444c)&&console[_0x4f51a0(0x1b2)]('>\x20'+_0x22444c+':\x20'+_0x28b3b2);}_0x2c40c4&&console['error']('>'),console['error']('');}const _0x59a517=await _0x5149f4[_0x4f51a0(0x19e)][_0x4f51a0(0x1c2)](_0x3f2698,_0x14b26e);if(_0x408c3d[_0x4f51a0(0x1d7)]&&_0x59a517[_0x4f51a0(0x1a8)]){console[_0x4f51a0(0x1b2)](_0x4f51a0(0x1b0)+_0x59a517[_0x4f51a0(0x1c9)]);for(const [_0x3d96e2,_0x48da26]of Object[_0x4f51a0(0x1a7)](_0x59a517['headers'])){!isSensitiveHeader(_0x3d96e2)&&console[_0x4f51a0(0x1b2)]('<\x20'+_0x3d96e2+':\x20'+_0x48da26);}console[_0x4f51a0(0x1b2)]('');}const _0x44f1c3=Boolean(_0x408c3d[_0x4f51a0(0x19b)]),_0x2a0f15={'color':_0x408c3d[_0x4f51a0(0x1cd)],'noColor':_0x408c3d[_0x4f51a0(0x1d8)]||_0x44f1c3&&!_0x408c3d['color']},_0x372b2c=colorizeJSON(_0x59a517[_0x4f51a0(0x1d2)],_0x2a0f15);return _0x408c3d[_0x4f51a0(0x19b)]?(writeFileSync(_0x408c3d[_0x4f51a0(0x19b)],_0x372b2c),console[_0x4f51a0(0x1b2)](_0x4f51a0(0x1a5)+_0x408c3d[_0x4f51a0(0x19b)])):console[_0x4f51a0(0x1d9)](_0x372b2c),0x0;}catch(_0x130b5a){return _0x130b5a instanceof Error?(console[_0x4f51a0(0x1b2)](_0x4f51a0(0x1aa)+_0x130b5a[_0x4f51a0(0x1a1)]),_0x408c3d[_0x4f51a0(0x1d7)]&&_0x130b5a[_0x4f51a0(0x1d1)]&&console['error']('\x0aStack\x20trace:\x0a'+_0x130b5a[_0x4f51a0(0x1d1)])):console[_0x4f51a0(0x1b2)]('Error:\x20'+String(_0x130b5a)),0x1;}}}
@@ -1 +1 @@
1
- const a7_0x3afff5=a7_0x1d29;(function(_0x54c16d,_0x499044){const _0x540e0b=a7_0x1d29,_0x2352d1=_0x54c16d();while(!![]){try{const _0x210b2c=-parseInt(_0x540e0b(0x1fb))/0x1*(parseInt(_0x540e0b(0x1d4))/0x2)+-parseInt(_0x540e0b(0x1d8))/0x3*(parseInt(_0x540e0b(0x217))/0x4)+-parseInt(_0x540e0b(0x1f5))/0x5*(parseInt(_0x540e0b(0x20d))/0x6)+parseInt(_0x540e0b(0x1cd))/0x7*(-parseInt(_0x540e0b(0x1d2))/0x8)+parseInt(_0x540e0b(0x1e5))/0x9*(-parseInt(_0x540e0b(0x1e1))/0xa)+-parseInt(_0x540e0b(0x1f7))/0xb+parseInt(_0x540e0b(0x1f3))/0xc*(parseInt(_0x540e0b(0x1d7))/0xd);if(_0x210b2c===_0x499044)break;else _0x2352d1['push'](_0x2352d1['shift']());}catch(_0x3ca4af){_0x2352d1['push'](_0x2352d1['shift']());}}}(a7_0x250f,0x71878));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens}from'../core/oauth-keychain.js';function a7_0x250f(){const _0x48568e=['56MXbmIx','auth','status','email','error','512776DsQOUX','No\x20credential\x20found','1032006VwNkiH','✓\x20Authentication\x20successful\x0a','\x20\x20tdx','559LkAWtq','3eFAeGb','Choose\x20authentication\x20method:','first_name','Setup\x20API\x20key\x20authentication\x20interactively','us01','yellow','✓\x20Profile\x20\x27','trim','\x20for\x20profile:\x20','2755880YGIsCR','\x20(profile:\x20','name','tdx:\x20auth\x20setup','9MnSAZS','\x27\x20registered','Read\x20credential\x20from\x20keychain','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','create','User:\x20','\x20(site:\x20','✗\x20Validation\x20failed:\x20','Credential\x20type:\x20OAuth','jobs','✓\x20Default\x20site\x20set\x20to\x20','log','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','logLevel','808224KVbvFe','API\x20Key','10975BPldye','OAuth\x20(browser\x20login)','7382881QVjxmQ','Remove\x20API\x20key\x20from\x20system\x20keychain','No\x20credentials\x20found\x20in\x20keychain','ERROR','1LXtKQF','API\x20key\x20cannot\x20be\x20empty','filter','execute','\x0aSetup\x20cancelled','bold','apiKey','Setting\x20up\x20authentication\x20for\x20site:\x20','tdx:\x20auth\x20clear','oauth','apikey','method','join','\x20and\x20','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','You\x20can\x20find\x20your\x20API\x20key\x20at:','OAuth\x20tokens','System\x20keychain\x20is\x20not\x20available','246uZwBHe','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','message','warn','select','red','tdx\x20profile:\x20','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','getUserInfo','profile','1462348OhnlCv','Name:\x20','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','auth:setup','description','site','last_name','green','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key'];a7_0x250f=function(){return _0x48568e;};return a7_0x250f();}import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';function a7_0x1d29(_0x3cf02a,_0x441f32){_0x3cf02a=_0x3cf02a-0x1cc;const _0x250ff2=a7_0x250f();let _0x1d295c=_0x250ff2[_0x3cf02a];return _0x1d295c;}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_0x5545d3 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_0x7d78a2 from'chalk';export class AuthSetupCommand extends BaseCommand{[a7_0x3afff5(0x1e3)]=a7_0x3afff5(0x21a);[a7_0x3afff5(0x21b)]=a7_0x3afff5(0x1db);async[a7_0x3afff5(0x1fe)](_0x3c3cfd){const _0x2482a0=a7_0x3afff5,{options:_0x49771b}=_0x3c3cfd,_0x4fb4f9=_0x49771b[_0x2482a0(0x216)];console[_0x2482a0(0x1f0)](a7_0x7d78a2[_0x2482a0(0x200)](_0x2482a0(0x1e4)));const _0x29c75a=_0x49771b[_0x2482a0(0x21c)]||_0x2482a0(0x1dc),_0x28cc32=await promptSiteSelection(_0x29c75a,_0x4fb4f9,'Setup\x20cancelled');if(!_0x28cc32)return 0x1;const _0x39d6da=resolveSite(_0x28cc32);if(isOAuthSupported(_0x39d6da)){const _0x1003a5=await a7_0x5545d3({'type':_0x2482a0(0x211),'name':_0x2482a0(0x206),'message':_0x2482a0(0x1d9),'choices':[{'title':_0x2482a0(0x1f6),'value':_0x2482a0(0x204)},{'title':_0x2482a0(0x1f4),'value':_0x2482a0(0x205)}]});if(!_0x1003a5[_0x2482a0(0x206)])return console['log'](_0x2482a0(0x1ff)),0x1;if(_0x1003a5['method']===_0x2482a0(0x204))return await runOAuthLoginFlow(_0x39d6da,_0x4fb4f9,_0x49771b[_0x2482a0(0x1f2)]??LogLevel[_0x2482a0(0x1fa)]),0x0;}console[_0x2482a0(0x1f0)](_0x2482a0(0x202)+_0x39d6da),console[_0x2482a0(0x1f0)](_0x2482a0(0x20a)),console[_0x2482a0(0x1f0)]('\x20\x20'+getConsoleUrl(_0x39d6da,'/app/mp/ak'));const _0x11b3c7=await a7_0x5545d3({'type':'password','name':'apiKey','message':'Enter\x20your\x20TD\x20API\x20key:','validate':_0x1d3815=>{const _0x49218e=_0x2482a0;if(!_0x1d3815||!_0x1d3815[_0x49218e(0x1df)]())return _0x49218e(0x1fc);return!![];}});if(!_0x11b3c7[_0x2482a0(0x201)])return console[_0x2482a0(0x1f0)]('\x0aSetup\x20cancelled'),0x1;const _0x288bdd=_0x11b3c7['apiKey'];console[_0x2482a0(0x1f0)]('Validating\x20API\x20key...');try{const _0x717f89=TDX[_0x2482a0(0x1e9)]({'site':_0x39d6da,'apiKey':_0x288bdd[_0x2482a0(0x1df)](),'logLevel':_0x49771b[_0x2482a0(0x1f2)]??LogLevel[_0x2482a0(0x1fa)]}),_0x3c1502=await _0x717f89[_0x2482a0(0x1ee)][_0x2482a0(0x215)]();console['log'](_0x2482a0(0x214)+_0x3c1502[_0x2482a0(0x1d0)]+')');const _0x32fe10=await isKeychainAvailable();_0x32fe10?(await saveAPIKeyAsync(_0x288bdd['trim'](),_0x39d6da,_0x4fb4f9),console[_0x2482a0(0x1f0)]('✓\x20API\x20key\x20saved\x20to\x20system\x20keychain'+(_0x4fb4f9?_0x2482a0(0x1e2)+_0x4fb4f9+')':''))):(console[_0x2482a0(0x210)](a7_0x7d78a2[_0x2482a0(0x1dd)]('⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.')),console['warn'](a7_0x7d78a2['yellow'](_0x2482a0(0x1f1))));if(_0x4fb4f9){const _0x11a15f={'site':_0x39d6da};saveProfileToUserConfig(_0x4fb4f9,_0x11a15f),console[_0x2482a0(0x1f0)](_0x2482a0(0x1de)+_0x4fb4f9+_0x2482a0(0x1e6));}else saveDefaultSiteToUserConfig(_0x39d6da),console[_0x2482a0(0x1f0)](_0x2482a0(0x1ef)+_0x39d6da);const _0x3d2a7a=_0x4fb4f9?'\x20--profile\x20'+_0x4fb4f9:'';return console[_0x2482a0(0x1f0)](),console[_0x2482a0(0x1f0)](_0x2482a0(0x209)),console[_0x2482a0(0x1f0)](_0x2482a0(0x1d6)+_0x3d2a7a+_0x2482a0(0x20e)),console['log'](_0x2482a0(0x1d6)+_0x3d2a7a+_0x2482a0(0x1e8)),0x0;}catch(_0x231bdb){if(_0x231bdb instanceof HTTPClientError&&_0x231bdb[_0x2482a0(0x1cf)]===0x191)return printAuthError(_0x231bdb),0x1;return console[_0x2482a0(0x1d1)](a7_0x7d78a2[_0x2482a0(0x212)](_0x2482a0(0x1ec)+(_0x231bdb instanceof Error?_0x231bdb[_0x2482a0(0x20f)]:String(_0x231bdb)))),console[_0x2482a0(0x1d1)](_0x2482a0(0x219)),0x1;}}}export class AuthStatusCommand extends BaseCommand{['name']=a7_0x3afff5(0x1ce);[a7_0x3afff5(0x21b)]=a7_0x3afff5(0x1cc);async[a7_0x3afff5(0x1fe)](_0x583bbf){const _0x1a03b7=a7_0x3afff5,{options:_0x4ba7b5,tdx:_0x57cca8}=_0x583bbf,_0x5936b9=_0x4ba7b5[_0x1a03b7(0x21c)],_0x3bd5b5=_0x4ba7b5[_0x1a03b7(0x216)],_0x249028=_0x3bd5b5?_0x3bd5b5:'N/A';console[_0x1a03b7(0x1f0)](_0x1a03b7(0x213)+_0x249028+_0x1a03b7(0x1eb)+_0x5936b9+')');const _0x15f428=await getOAuthTokens(_0x3bd5b5);if(_0x15f428)console['log'](_0x1a03b7(0x1ed)),console[_0x1a03b7(0x1f0)](_0x1a03b7(0x1e7)+(_0x3bd5b5?_0x1a03b7(0x1e2)+_0x3bd5b5+')':''));else{const _0x5dcb0f=await resolveAPIKeyAsync(_0x5936b9,_0x3bd5b5);if(_0x5dcb0f){const {source:_0x5bf521,isDeprecated:_0x1eb4e7}=_0x5dcb0f,_0x4a7728='Read\x20credential\x20from\x20'+_0x5bf521;console[_0x1a03b7(0x1f0)](_0x1eb4e7?a7_0x7d78a2[_0x1a03b7(0x1dd)](_0x4a7728):_0x4a7728);}else console[_0x1a03b7(0x1f0)](a7_0x7d78a2[_0x1a03b7(0x1dd)](_0x1a03b7(0x1d3)));}try{const _0x36d65a=await _0x57cca8[_0x1a03b7(0x1ee)][_0x1a03b7(0x215)]();return console[_0x1a03b7(0x1f0)](a7_0x7d78a2[_0x1a03b7(0x21e)](_0x1a03b7(0x1d5))),console[_0x1a03b7(0x1f0)](_0x1a03b7(0x1ea)+_0x36d65a[_0x1a03b7(0x1d0)]),(_0x36d65a[_0x1a03b7(0x1da)]||_0x36d65a[_0x1a03b7(0x21d)])&&console[_0x1a03b7(0x1f0)](_0x1a03b7(0x218)+[_0x36d65a[_0x1a03b7(0x1da)],_0x36d65a[_0x1a03b7(0x21d)]]['filter'](Boolean)['join']('\x20')),0x0;}catch(_0xc047c1){return _0xc047c1 instanceof HTTPClientError&&_0xc047c1[_0x1a03b7(0x1cf)]===0x191?printAuthError(_0xc047c1,!![],_0x3bd5b5):console['error'](a7_0x7d78a2[_0x1a03b7(0x212)](_0x1a03b7(0x1ec)+(_0xc047c1 instanceof Error?_0xc047c1[_0x1a03b7(0x20f)]:String(_0xc047c1)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x3afff5(0x1e3)]='auth:clear';['description']=a7_0x3afff5(0x1f8);async[a7_0x3afff5(0x1fe)](_0x171177){const _0x182b6b=a7_0x3afff5,{options:_0x14a454}=_0x171177,_0x32f7dd=_0x14a454[_0x182b6b(0x216)];console[_0x182b6b(0x1f0)](a7_0x7d78a2[_0x182b6b(0x200)](_0x182b6b(0x203)));const _0x3d3ad5=await isKeychainAvailable();if(!_0x3d3ad5)return console[_0x182b6b(0x1d1)](a7_0x7d78a2['red'](_0x182b6b(0x20c))),0x1;const [_0x59cb7a,_0x5100c3]=await Promise['all']([deleteKeychainAPIKey(_0x32f7dd),deleteOAuthTokens(_0x32f7dd)]);if(_0x59cb7a||_0x5100c3){clearCredentialCache();const _0x4d246e=[_0x59cb7a&&'API\x20key',_0x5100c3&&_0x182b6b(0x20b)][_0x182b6b(0x1fd)](Boolean)[_0x182b6b(0x207)](_0x182b6b(0x208));return console[_0x182b6b(0x1f0)]('✓\x20'+_0x4d246e+'\x20removed\x20from\x20keychain'+(_0x32f7dd?_0x182b6b(0x1e2)+_0x32f7dd+')':'')),0x0;}else return console[_0x182b6b(0x1f0)](_0x182b6b(0x1f9)+(_0x32f7dd?_0x182b6b(0x1e0)+_0x32f7dd:'')),0x1;}}
1
+ const a7_0x2574cc=a7_0x1e09;(function(_0x4fddf4,_0x34c53e){const _0x582986=a7_0x1e09,_0x1c5a0b=_0x4fddf4();while(!![]){try{const _0x3437e1=-parseInt(_0x582986(0x20d))/0x1*(parseInt(_0x582986(0x209))/0x2)+-parseInt(_0x582986(0x207))/0x3+-parseInt(_0x582986(0x20b))/0x4+parseInt(_0x582986(0x1e3))/0x5*(-parseInt(_0x582986(0x1d6))/0x6)+parseInt(_0x582986(0x1df))/0x7+parseInt(_0x582986(0x1e2))/0x8*(parseInt(_0x582986(0x200))/0x9)+parseInt(_0x582986(0x1de))/0xa*(parseInt(_0x582986(0x1f1))/0xb);if(_0x3437e1===_0x34c53e)break;else _0x1c5a0b['push'](_0x1c5a0b['shift']());}catch(_0x81129a){_0x1c5a0b['push'](_0x1c5a0b['shift']());}}}(a7_0x5c1a,0x876ee));import{BaseCommand,printAuthError}from'./command.js';function a7_0x1e09(_0x433d4c,_0x1cc9c3){_0x433d4c=_0x433d4c-0x1c0;const _0x5c1a9c=a7_0x5c1a();let _0x1e09c5=_0x5c1a9c[_0x433d4c];return _0x1e09c5;}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';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_0x3b94f1 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_0x30c208 from'chalk';function a7_0x5c1a(){const _0x570fe6=['name','14084246zMWsfd','warn','\x27\x20registered','\x0aSetup\x20cancelled','tdx:\x20auth\x20setup','tdx\x20profile:\x20','\x20(profile:\x20','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','status','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','OAuth\x20tokens','last_name','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','error','oauth','3273903aDyDLA','\x20--profile\x20','message','\x20(site:\x20','getUserInfo','/app/mp/ak','logLevel','947223sSuqUG','Validating\x20API\x20key...','8tDvqoI','red','1598656oaoScv','create','207287nolOdm','You\x20can\x20find\x20your\x20API\x20key\x20at:','filter','log','bold','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','join','Setting\x20up\x20authentication\x20for\x20site:\x20','No\x20credential\x20found','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','select','execute','auth','site','Enter\x20your\x20TD\x20API\x20key:','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','\x20and\x20','Read\x20credential\x20from\x20keychain','✓\x20Profile\x20\x27','Name:\x20','Setup\x20API\x20key\x20authentication\x20interactively','jobs','trim','profile','email','green','apiKey','auth:setup','340086IFnXBL','ERROR','yellow','Choose\x20authentication\x20method:','API\x20Key','✓\x20Default\x20site\x20set\x20to\x20','\x20\x20tdx','Remove\x20API\x20key\x20from\x20system\x20keychain','10yXjgUL','7153608cRDZtW','apikey','Setup\x20cancelled','8IdNJaw','50uAlHGn','tdx:\x20auth\x20clear','first_name','✓\x20Authentication\x20successful\x0a','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','description','System\x20keychain\x20is\x20not\x20available','N/A','✗\x20Validation\x20failed:\x20','method','\x20for\x20profile:\x20','No\x20credentials\x20found\x20in\x20keychain'];a7_0x5c1a=function(){return _0x570fe6;};return a7_0x5c1a();}export class AuthSetupCommand extends BaseCommand{['name']=a7_0x2574cc(0x1d5);[a7_0x2574cc(0x1e9)]=a7_0x2574cc(0x1ce);async[a7_0x2574cc(0x1c5)](_0x39d66c){const _0x32c90e=a7_0x2574cc,{options:_0x3af893}=_0x39d66c,_0x1394b9=_0x3af893['profile'];console[_0x32c90e(0x210)](a7_0x30c208[_0x32c90e(0x211)](_0x32c90e(0x1f5)));const _0x313e75=_0x3af893[_0x32c90e(0x1c7)]||'us01',_0x55b830=await promptSiteSelection(_0x313e75,_0x1394b9,_0x32c90e(0x1e1));if(!_0x55b830)return 0x1;const _0x4ef3e6=resolveSite(_0x55b830);if(isOAuthSupported(_0x4ef3e6)){const _0x3c80f8=await a7_0x3b94f1({'type':_0x32c90e(0x1c4),'name':_0x32c90e(0x1ed),'message':_0x32c90e(0x1d9),'choices':[{'title':'OAuth\x20(browser\x20login)','value':_0x32c90e(0x1ff)},{'title':_0x32c90e(0x1da),'value':_0x32c90e(0x1e0)}]});if(!_0x3c80f8[_0x32c90e(0x1ed)])return console['log'](_0x32c90e(0x1f4)),0x1;if(_0x3c80f8[_0x32c90e(0x1ed)]==='oauth')return await runOAuthLoginFlow(_0x4ef3e6,_0x1394b9,_0x3af893['logLevel']??LogLevel[_0x32c90e(0x1d7)]),0x0;}console[_0x32c90e(0x210)](_0x32c90e(0x1c1)+_0x4ef3e6),console[_0x32c90e(0x210)](_0x32c90e(0x20e)),console[_0x32c90e(0x210)]('\x20\x20'+getConsoleUrl(_0x4ef3e6,_0x32c90e(0x205)));const _0x5a1236=await a7_0x3b94f1({'type':'password','name':_0x32c90e(0x1d4),'message':_0x32c90e(0x1c8),'validate':_0x13d196=>{const _0x574cda=_0x32c90e;if(!_0x13d196||!_0x13d196[_0x574cda(0x1d0)]())return'API\x20key\x20cannot\x20be\x20empty';return!![];}});if(!_0x5a1236[_0x32c90e(0x1d4)])return console[_0x32c90e(0x210)](_0x32c90e(0x1f4)),0x1;const _0x40a318=_0x5a1236['apiKey'];console[_0x32c90e(0x210)](_0x32c90e(0x208));try{const _0x179a98=TDX[_0x32c90e(0x20c)]({'site':_0x4ef3e6,'apiKey':_0x40a318[_0x32c90e(0x1d0)](),'logLevel':_0x3af893[_0x32c90e(0x206)]??LogLevel['ERROR']}),_0x483b8e=await _0x179a98['jobs'][_0x32c90e(0x204)]();console['log'](_0x32c90e(0x1f8)+_0x483b8e['email']+')');const _0x42886e=await isKeychainAvailable();_0x42886e?(await saveAPIKeyAsync(_0x40a318[_0x32c90e(0x1d0)](),_0x4ef3e6,_0x1394b9),console[_0x32c90e(0x210)](_0x32c90e(0x212)+(_0x1394b9?_0x32c90e(0x1f7)+_0x1394b9+')':''))):(console['warn'](a7_0x30c208[_0x32c90e(0x1d8)]('⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.')),console[_0x32c90e(0x1f2)](a7_0x30c208[_0x32c90e(0x1d8)](_0x32c90e(0x1fa))));if(_0x1394b9){const _0x122991={'site':_0x4ef3e6};saveProfileToUserConfig(_0x1394b9,_0x122991),console['log'](_0x32c90e(0x1cc)+_0x1394b9+_0x32c90e(0x1f3));}else saveDefaultSiteToUserConfig(_0x4ef3e6),console[_0x32c90e(0x210)](_0x32c90e(0x1db)+_0x4ef3e6);const _0x31cede=_0x1394b9?_0x32c90e(0x201)+_0x1394b9:'';return console[_0x32c90e(0x210)](),console[_0x32c90e(0x210)](_0x32c90e(0x1e8)),console[_0x32c90e(0x210)]('\x20\x20tdx'+_0x31cede+_0x32c90e(0x1c9)),console['log'](_0x32c90e(0x1dc)+_0x31cede+_0x32c90e(0x1fd)),0x0;}catch(_0x40b345){if(_0x40b345 instanceof HTTPClientError&&_0x40b345['status']===0x191)return printAuthError(_0x40b345),0x1;return console['error'](a7_0x30c208[_0x32c90e(0x20a)](_0x32c90e(0x1ec)+(_0x40b345 instanceof Error?_0x40b345[_0x32c90e(0x202)]:String(_0x40b345)))),console[_0x32c90e(0x1fe)](_0x32c90e(0x1c3)),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x2574cc(0x1f0)]=a7_0x2574cc(0x1c6);[a7_0x2574cc(0x1e9)]=a7_0x2574cc(0x1e7);async['execute'](_0x181004){const _0x2e7c24=a7_0x2574cc,{options:_0x410564,tdx:_0x4997f9}=_0x181004,_0x66c60e=_0x410564[_0x2e7c24(0x1c7)],_0x388939=_0x410564[_0x2e7c24(0x1d1)],_0x462f31=_0x388939?_0x388939:_0x2e7c24(0x1eb);console[_0x2e7c24(0x210)](_0x2e7c24(0x1f6)+_0x462f31+_0x2e7c24(0x203)+_0x66c60e+')');const _0x3d9293=await getOAuthTokens(_0x388939);if(_0x3d9293)console['log']('Credential\x20type:\x20OAuth'),console[_0x2e7c24(0x210)](_0x2e7c24(0x1cb)+(_0x388939?_0x2e7c24(0x1f7)+_0x388939+')':''));else{const _0x346170=await resolveAPIKeyAsync(_0x66c60e,_0x388939);if(_0x346170){const {source:_0x50ea25,isDeprecated:_0x12f753}=_0x346170,_0x4e20f8='Read\x20credential\x20from\x20'+_0x50ea25;console[_0x2e7c24(0x210)](_0x12f753?a7_0x30c208[_0x2e7c24(0x1d8)](_0x4e20f8):_0x4e20f8);}else console[_0x2e7c24(0x210)](a7_0x30c208[_0x2e7c24(0x1d8)](_0x2e7c24(0x1c2)));}try{const _0x5578a9=await _0x4997f9[_0x2e7c24(0x1cf)][_0x2e7c24(0x204)]();return console[_0x2e7c24(0x210)](a7_0x30c208[_0x2e7c24(0x1d3)](_0x2e7c24(0x1e6))),console[_0x2e7c24(0x210)]('User:\x20'+_0x5578a9[_0x2e7c24(0x1d2)]),(_0x5578a9[_0x2e7c24(0x1e5)]||_0x5578a9['last_name'])&&console[_0x2e7c24(0x210)](_0x2e7c24(0x1cd)+[_0x5578a9[_0x2e7c24(0x1e5)],_0x5578a9[_0x2e7c24(0x1fc)]][_0x2e7c24(0x20f)](Boolean)[_0x2e7c24(0x1c0)]('\x20')),0x0;}catch(_0x44c77e){return _0x44c77e instanceof HTTPClientError&&_0x44c77e[_0x2e7c24(0x1f9)]===0x191?printAuthError(_0x44c77e,!![],_0x388939):console[_0x2e7c24(0x1fe)](a7_0x30c208[_0x2e7c24(0x20a)](_0x2e7c24(0x1ec)+(_0x44c77e instanceof Error?_0x44c77e['message']:String(_0x44c77e)))),0x1;}}}export class AuthClearCommand extends BaseCommand{['name']='auth:clear';[a7_0x2574cc(0x1e9)]=a7_0x2574cc(0x1dd);async[a7_0x2574cc(0x1c5)](_0x52ebb3){const _0x3f0257=a7_0x2574cc,{options:_0x3fa1e4}=_0x52ebb3,_0x587499=_0x3fa1e4[_0x3f0257(0x1d1)];console[_0x3f0257(0x210)](a7_0x30c208[_0x3f0257(0x211)](_0x3f0257(0x1e4)));const _0x66a05e=await isKeychainAvailable();if(!_0x66a05e)return console[_0x3f0257(0x1fe)](a7_0x30c208[_0x3f0257(0x20a)](_0x3f0257(0x1ea))),0x1;const [_0x2183d0,_0x2e6c3b]=await Promise['all']([deleteKeychainAPIKey(_0x587499),deleteOAuthTokens(_0x587499)]);if(_0x2183d0||_0x2e6c3b){clearCredentialCache();const _0xde938d=[_0x2183d0&&'API\x20key',_0x2e6c3b&&_0x3f0257(0x1fb)][_0x3f0257(0x20f)](Boolean)[_0x3f0257(0x1c0)](_0x3f0257(0x1ca));return console[_0x3f0257(0x210)]('✓\x20'+_0xde938d+'\x20removed\x20from\x20keychain'+(_0x587499?_0x3f0257(0x1f7)+_0x587499+')':'')),0x0;}else return console[_0x3f0257(0x210)](_0x3f0257(0x1ef)+(_0x587499?_0x3f0257(0x1ee)+_0x587499:'')),0x1;}}
@@ -1 +1 @@
1
- const a8_0x5282d1=a8_0x3b8e;(function(_0x3f8e96,_0x3af9c4){const _0x58fb60=a8_0x3b8e,_0x218157=_0x3f8e96();while(!![]){try{const _0x4bcc56=parseInt(_0x58fb60(0x118))/0x1+parseInt(_0x58fb60(0x126))/0x2+parseInt(_0x58fb60(0x12b))/0x3*(parseInt(_0x58fb60(0x135))/0x4)+parseInt(_0x58fb60(0x11b))/0x5+-parseInt(_0x58fb60(0x13b))/0x6+parseInt(_0x58fb60(0x11f))/0x7+-parseInt(_0x58fb60(0x115))/0x8;if(_0x4bcc56===_0x3af9c4)break;else _0x218157['push'](_0x218157['shift']());}catch(_0x21f380){_0x218157['push'](_0x218157['shift']());}}}(a8_0x5a15,0xbe574));function a8_0x3b8e(_0x516756,_0xfd99b6){_0x516756=_0x516756-0x113;const _0x5a1570=a8_0x5a15();let _0x3b8ec8=_0x5a1570[_0x516756];return _0x3b8ec8;}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';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';function a8_0x5a15(){const _0x120868=['OAuth\x20is\x20currently\x20supported\x20on\x20dev-us01\x20and\x20dev-eu01\x20only.\x20','Authenticating\x20via\x20OAuth\x20for\x20site:\x20','green','3924284CgxeWH','log','execute','ERROR','tdx:\x20auth\x20login','\x27\x20registered','/oauth/authorize','1805370ubLpTD','auth:login','email','OAuth\x20login\x20is\x20not\x20yet\x20available\x20for\x20site:\x20','bold','467868kVpqsz','create','\x20--profile\x20','profile','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','Login\x20via\x20OAuth\x20(opens\x20browser)','\x20\x20tdx','name','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','jobs','32pwGSsE','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','getUserInfo','✓\x20Profile\x20\x27','Validating\x20OAuth\x20tokens...','467742IXtWbU','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','Login\x20cancelled','35870688SrWtly','logLevel','description','1379080TQxfrO','site','access_token','6257020plOOmT'];a8_0x5a15=function(){return _0x120868;};return a8_0x5a15();}import a8_0x4f093c from'chalk';export async function runOAuthLoginFlow(_0x1ab579,_0x49cbec,_0x3410ad){const _0x42b672=a8_0x3b8e;if(!isOAuthSupported(_0x1ab579))throw new Error(_0x42b672(0x129)+_0x1ab579+'.\x20'+_0x42b672(0x11c)+_0x42b672(0x113));const _0x4b95bc=await isKeychainAvailable();if(!_0x4b95bc)throw new Error(_0x42b672(0x12f)+'Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.');const _0x15ef47=getConsoleUrl(_0x1ab579);console['log']('Opening\x20browser\x20for\x20authentication...'),console[_0x42b672(0x120)]('\x20\x20'+_0x15ef47+_0x42b672(0x125)),console[_0x42b672(0x120)](_0x42b672(0x137));const _0x308f90=await startOAuthFlow(_0x1ab579);console['log'](_0x42b672(0x13a));const _0x2c85f3=TDX[_0x42b672(0x12c)]({'site':_0x1ab579,'accessToken':_0x308f90[_0x42b672(0x11a)],'logLevel':_0x3410ad??LogLevel[_0x42b672(0x122)]}),_0x58f065=await _0x2c85f3[_0x42b672(0x134)][_0x42b672(0x138)]();console[_0x42b672(0x120)](a8_0x4f093c[_0x42b672(0x11e)]('✓\x20Authentication\x20successful\x20(User:\x20'+_0x58f065[_0x42b672(0x128)]+')')),await saveOAuthTokens(_0x308f90,_0x49cbec),console[_0x42b672(0x120)](_0x42b672(0x136)+(_0x49cbec?'\x20(profile:\x20'+_0x49cbec+')':''));if(_0x49cbec){const _0x387b8d={'site':_0x1ab579};saveProfileToUserConfig(_0x49cbec,_0x387b8d),console['log'](_0x42b672(0x139)+_0x49cbec+_0x42b672(0x124));}const _0x1c59cf=_0x49cbec?_0x42b672(0x12d)+_0x49cbec:'';console[_0x42b672(0x120)](),console[_0x42b672(0x120)](_0x42b672(0x133)),console[_0x42b672(0x120)](_0x42b672(0x131)+_0x1c59cf+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console['log'](_0x42b672(0x131)+_0x1c59cf+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases');}export class AuthLoginCommand extends BaseCommand{[a8_0x5282d1(0x132)]=a8_0x5282d1(0x127);[a8_0x5282d1(0x117)]=a8_0x5282d1(0x130);async[a8_0x5282d1(0x121)](_0x19b6bf){const _0x2ed6dc=a8_0x5282d1,{options:_0x6d0426}=_0x19b6bf,_0x358ecd=_0x6d0426[_0x2ed6dc(0x12e)];console['log'](a8_0x4f093c[_0x2ed6dc(0x12a)](_0x2ed6dc(0x123)));const _0x49d450=_0x6d0426[_0x2ed6dc(0x119)]||'us01',_0x450d24=await promptSiteSelection(_0x49d450,_0x358ecd,_0x2ed6dc(0x114));if(!_0x450d24)return 0x1;const _0x2afda3=resolveSite(_0x450d24);return console[_0x2ed6dc(0x120)](_0x2ed6dc(0x11d)+_0x2afda3),await runOAuthLoginFlow(_0x2afda3,_0x358ecd,_0x6d0426[_0x2ed6dc(0x116)]??LogLevel[_0x2ed6dc(0x122)]),0x0;}}
1
+ const a8_0x305a1b=a8_0x422e;(function(_0x599344,_0x46266a){const _0x1d6643=a8_0x422e,_0x21dba7=_0x599344();while(!![]){try{const _0x295446=parseInt(_0x1d6643(0x1a6))/0x1+parseInt(_0x1d6643(0x197))/0x2+-parseInt(_0x1d6643(0x1a7))/0x3+parseInt(_0x1d6643(0x19f))/0x4+parseInt(_0x1d6643(0x191))/0x5*(parseInt(_0x1d6643(0x1aa))/0x6)+parseInt(_0x1d6643(0x1af))/0x7+-parseInt(_0x1d6643(0x196))/0x8;if(_0x295446===_0x46266a)break;else _0x21dba7['push'](_0x21dba7['shift']());}catch(_0x48d9f3){_0x21dba7['push'](_0x21dba7['shift']());}}}(a8_0xe46e,0x9af66));function a8_0xe46e(){const _0xde25ba=['14248552UgtjNu','1150760qzPGdx','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','\x27\x20registered','✓\x20Profile\x20\x27','us01','\x20\x20tdx','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','Login\x20via\x20OAuth\x20(opens\x20browser)','2818500vQMvVy','tdx:\x20auth\x20login','Opening\x20browser\x20for\x20authentication...','Login\x20cancelled','jobs','log','logLevel','901127ZQMgpu','2872497QtqvKe','\x20(profile:\x20','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','63372jiIwYb','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain','\x20--profile\x20','ERROR','site','729932qpqkOi','green','email','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','bold','Authenticating\x20via\x20OAuth\x20for\x20site:\x20','515aNeSLR','getUserInfo','OAuth\x20is\x20currently\x20supported\x20on\x20dev-us01\x20and\x20dev-eu01\x20only.\x20','description','/oauth/authorize'];a8_0xe46e=function(){return _0xde25ba;};return a8_0xe46e();}import{BaseCommand}from'./command.js';import{resolveSite}from'../core/config.js';function a8_0x422e(_0x52c8f0,_0x37af54){_0x52c8f0=_0x52c8f0-0x191;const _0xe46e91=a8_0xe46e();let _0x422e53=_0xe46e91[_0x52c8f0];return _0x422e53;}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_0x30cbbd from'chalk';export async function runOAuthLoginFlow(_0x229648,_0x456080,_0x43e68d){const _0x51b9f4=a8_0x422e;if(!isOAuthSupported(_0x229648))throw new Error('OAuth\x20login\x20is\x20not\x20yet\x20available\x20for\x20site:\x20'+_0x229648+'.\x20'+_0x51b9f4(0x193)+_0x51b9f4(0x1a9));const _0x4675c2=await isKeychainAvailable();if(!_0x4675c2)throw new Error('System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20'+_0x51b9f4(0x1a9));const _0x4f9fc1=getConsoleUrl(_0x229648);console[_0x51b9f4(0x1a4)](_0x51b9f4(0x1a1)),console[_0x51b9f4(0x1a4)]('\x20\x20'+_0x4f9fc1+_0x51b9f4(0x195)),console['log'](_0x51b9f4(0x19d));const _0x371918=await startOAuthFlow(_0x229648);console[_0x51b9f4(0x1a4)]('Validating\x20OAuth\x20tokens...');const _0x573b99=TDX['create']({'site':_0x229648,'accessToken':_0x371918['access_token'],'logLevel':_0x43e68d??LogLevel[_0x51b9f4(0x1ad)]}),_0x2a755b=await _0x573b99[_0x51b9f4(0x1a3)][_0x51b9f4(0x192)]();console[_0x51b9f4(0x1a4)](a8_0x30cbbd[_0x51b9f4(0x1b0)]('✓\x20Authentication\x20successful\x20(User:\x20'+_0x2a755b[_0x51b9f4(0x1b1)]+')')),await saveOAuthTokens(_0x371918,_0x456080),console[_0x51b9f4(0x1a4)](_0x51b9f4(0x1ab)+(_0x456080?_0x51b9f4(0x1a8)+_0x456080+')':''));if(_0x456080){const _0x21b4b6={'site':_0x229648};saveProfileToUserConfig(_0x456080,_0x21b4b6),console[_0x51b9f4(0x1a4)](_0x51b9f4(0x19a)+_0x456080+_0x51b9f4(0x199));}const _0x171ab1=_0x456080?_0x51b9f4(0x1ac)+_0x456080:'';console[_0x51b9f4(0x1a4)](),console[_0x51b9f4(0x1a4)]('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console['log'](_0x51b9f4(0x19c)+_0x171ab1+_0x51b9f4(0x1b2)),console[_0x51b9f4(0x1a4)](_0x51b9f4(0x19c)+_0x171ab1+_0x51b9f4(0x198));}export class AuthLoginCommand extends BaseCommand{['name']='auth:login';[a8_0x305a1b(0x194)]=a8_0x305a1b(0x19e);async['execute'](_0x4e88b2){const _0x3b65a0=a8_0x305a1b,{options:_0x567ff5}=_0x4e88b2,_0x18d969=_0x567ff5['profile'];console[_0x3b65a0(0x1a4)](a8_0x30cbbd[_0x3b65a0(0x1b3)](_0x3b65a0(0x1a0)));const _0x5bd5f1=_0x567ff5[_0x3b65a0(0x1ae)]||_0x3b65a0(0x19b),_0x1c5879=await promptSiteSelection(_0x5bd5f1,_0x18d969,_0x3b65a0(0x1a2));if(!_0x1c5879)return 0x1;const _0xaa1048=resolveSite(_0x1c5879);return console[_0x3b65a0(0x1a4)](_0x3b65a0(0x1b4)+_0xaa1048),await runOAuthLoginFlow(_0xaa1048,_0x18d969,_0x567ff5[_0x3b65a0(0x1a5)]??LogLevel[_0x3b65a0(0x1ad)]),0x0;}}