@treasuredata/tdx 2026.3.10 → 2026.3.12

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_0x3cd9(_0x409080,_0x1fc14c){_0x409080=_0x409080-0x117;const _0xa2823=a3_0xa282();let _0x3cd931=_0xa2823[_0x409080];return _0x3cd931;}const a3_0x2418e3=a3_0x3cd9;(function(_0x2d9943,_0x330505){const _0x5b5607=a3_0x3cd9,_0x511b52=_0x2d9943();while(!![]){try{const _0xcf4162=parseInt(_0x5b5607(0x11d))/0x1*(parseInt(_0x5b5607(0x119))/0x2)+-parseInt(_0x5b5607(0x13a))/0x3+parseInt(_0x5b5607(0x12f))/0x4+-parseInt(_0x5b5607(0x139))/0x5*(parseInt(_0x5b5607(0x118))/0x6)+parseInt(_0x5b5607(0x126))/0x7*(parseInt(_0x5b5607(0x120))/0x8)+parseInt(_0x5b5607(0x11a))/0x9*(-parseInt(_0x5b5607(0x11b))/0xa)+parseInt(_0x5b5607(0x13c))/0xb;if(_0xcf4162===_0x330505)break;else _0x511b52['push'](_0x511b52['shift']());}catch(_0xd77f62){_0x511b52['push'](_0x511b52['shift']());}}}(a3_0xa282,0x1bcb6));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';function a3_0xa282(){const _0x174681=['717296UWsmwJ','listActivations','data','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','site','Resolving\x20parent\x20segment\x20\x27','Resolved\x20parent\x20ID:\x20','\x27...','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','Error:\x20Segment\x20name\x20is\x20required','3435VLDzzH','466692XCSqJc','resolveParentId','2501939cxZfRl','Error:\x20','492VeQxaf','2154DaIFgS','9ZLQEfg','1733980PRxwwa','verbose','9CbDgFH','execute','resolveSegmentId','16LqNSSB','List\x20activations\x20for\x20a\x20segment','segment','name','Site:\x20','Resolved\x20child\x20ID:\x20','289366naeuje','Child\x20name:\x20','Parent\x20name:\x20','error','\x20\x20Cause:\x20','\x20activation','length','✔\x20Found\x20','message'];a3_0xa282=function(){return _0x174681;};return a3_0xa282();}export class ActivationsCommand extends BaseCommand{[a3_0x2418e3(0x123)]='activations';['description']=a3_0x2418e3(0x121);async[a3_0x2418e3(0x11e)](_0x45636e){const _0x14267f=a3_0x2418e3,{options:_0x481345,args:_0x2096c0,tdx:_0xdbd43}=_0x45636e;if(_0x2096c0['length']===0x0)return console[_0x14267f(0x129)](_0x14267f(0x138)),console['error'](_0x14267f(0x132)),0x1;try{const {parentId:_0x4d67b3,childId:_0x282e53}=parseSegmentRef(_0x2096c0[0x0]);if(!_0x282e53)return console[_0x14267f(0x129)](_0x14267f(0x137)),console[_0x14267f(0x129)]('Usage:\x20tdx\x20activations\x20<parent_name/child_name>'),0x1;_0x481345[_0x14267f(0x11c)]&&(console['error'](_0x14267f(0x124)+_0x481345[_0x14267f(0x133)]),console[_0x14267f(0x129)](_0x14267f(0x128)+_0x4d67b3),console['error'](_0x14267f(0x127)+_0x282e53));const _0x4178d2=await withSpinner(_0x14267f(0x134)+_0x4d67b3+'\x27...',()=>_0xdbd43[_0x14267f(0x122)][_0x14267f(0x13b)](_0x4d67b3),{'verbose':_0x481345[_0x14267f(0x11c)]}),_0x31cb95=_0x4178d2['data'];_0x481345[_0x14267f(0x11c)]&&console['error'](_0x14267f(0x135)+_0x31cb95);const _0x357bb8=await withSpinner('Resolving\x20child\x20segment\x20\x27'+_0x282e53+_0x14267f(0x136),()=>_0xdbd43[_0x14267f(0x122)][_0x14267f(0x11f)](_0x31cb95,_0x282e53),{'verbose':_0x481345[_0x14267f(0x11c)]}),_0x45a6ae=_0x357bb8[_0x14267f(0x131)];_0x481345['verbose']&&console[_0x14267f(0x129)](_0x14267f(0x125)+_0x45a6ae);const _0xbba62c=await withSpinner('Listing\x20activations\x20for\x20segment\x20\x27'+_0x282e53+'\x27...',()=>_0xdbd43['segment'][_0x14267f(0x130)](_0x31cb95,_0x45a6ae),{'verbose':_0x481345[_0x14267f(0x11c)]}),_0x4023d2=_0xbba62c[_0x14267f(0x131)];return console[_0x14267f(0x129)](_0x14267f(0x12d)+_0x4023d2[_0x14267f(0x12c)]+_0x14267f(0x12b)+(_0x4023d2[_0x14267f(0x12c)]!==0x1?'s':'')),await handleSDKOutput(_0x4023d2,_0x481345),0x0;}catch(_0x2a976a){if(_0x2a976a instanceof SDKError)return console[_0x14267f(0x129)](_0x14267f(0x117)+_0x2a976a[_0x14267f(0x12e)]),_0x2a976a['cause']&&console[_0x14267f(0x129)](_0x14267f(0x12a)+_0x2a976a['cause']),0x1;throw _0x2a976a;}}}
1
+ const a3_0x5277a7=a3_0x17c3;(function(_0x428160,_0x293384){const _0x2049c6=a3_0x17c3,_0x33755c=_0x428160();while(!![]){try{const _0x780eb1=-parseInt(_0x2049c6(0x14c))/0x1+parseInt(_0x2049c6(0x154))/0x2*(-parseInt(_0x2049c6(0x136))/0x3)+-parseInt(_0x2049c6(0x146))/0x4+parseInt(_0x2049c6(0x156))/0x5+-parseInt(_0x2049c6(0x155))/0x6+parseInt(_0x2049c6(0x147))/0x7*(parseInt(_0x2049c6(0x14a))/0x8)+parseInt(_0x2049c6(0x150))/0x9*(parseInt(_0x2049c6(0x151))/0xa);if(_0x780eb1===_0x293384)break;else _0x33755c['push'](_0x33755c['shift']());}catch(_0x49d4d9){_0x33755c['push'](_0x33755c['shift']());}}}(a3_0x59f9,0x236cf));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';function a3_0x59f9(){const _0x17f861=['activations','Site:\x20','8tDtQUa','Parent\x20name:\x20','284689AeOPKy','length','listActivations','Error:\x20','27JsOOMb','1878740uEHEAL','cause','execute','3958ICmpYJ','1605030xTzXbZ','762115DsyoiE','segment','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','\x27...','69uVqlNZ','message','name','\x20activation','verbose','Resolved\x20child\x20ID:\x20','✔\x20Found\x20','Error:\x20Segment\x20name\x20is\x20required','error','description','Resolving\x20parent\x20segment\x20\x27','Child\x20name:\x20','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','List\x20activations\x20for\x20a\x20segment','\x20\x20Cause:\x20','data','763088qxwDSZ','1522787MLnLFW'];a3_0x59f9=function(){return _0x17f861;};return a3_0x59f9();}import{withSpinner}from'../utils/spinner.js';function a3_0x17c3(_0x3bdcc1,_0x34af32){_0x3bdcc1=_0x3bdcc1-0x135;const _0x59f90c=a3_0x59f9();let _0x17c305=_0x59f90c[_0x3bdcc1];return _0x17c305;}import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';export class ActivationsCommand extends BaseCommand{[a3_0x5277a7(0x138)]=a3_0x5277a7(0x148);[a3_0x5277a7(0x13f)]=a3_0x5277a7(0x143);async[a3_0x5277a7(0x153)](_0x585e3f){const _0x32b341=a3_0x5277a7,{options:_0x23e06c,args:_0x16c32c,tdx:_0x510bec}=_0x585e3f;if(_0x16c32c['length']===0x0)return console[_0x32b341(0x13e)](_0x32b341(0x13d)),console[_0x32b341(0x13e)](_0x32b341(0x142)),0x1;try{const {parentId:_0x30bcb0,childId:_0x14e29a}=parseSegmentRef(_0x16c32c[0x0]);if(!_0x14e29a)return console[_0x32b341(0x13e)](_0x32b341(0x158)),console[_0x32b341(0x13e)](_0x32b341(0x142)),0x1;_0x23e06c[_0x32b341(0x13a)]&&(console['error'](_0x32b341(0x149)+_0x23e06c['site']),console['error'](_0x32b341(0x14b)+_0x30bcb0),console[_0x32b341(0x13e)](_0x32b341(0x141)+_0x14e29a));const _0x16f381=await withSpinner(_0x32b341(0x140)+_0x30bcb0+_0x32b341(0x135),()=>_0x510bec[_0x32b341(0x157)]['resolveParentId'](_0x30bcb0),{'verbose':_0x23e06c[_0x32b341(0x13a)]}),_0x1df96d=_0x16f381['data'];_0x23e06c['verbose']&&console[_0x32b341(0x13e)]('Resolved\x20parent\x20ID:\x20'+_0x1df96d);const _0x7f0398=await withSpinner('Resolving\x20child\x20segment\x20\x27'+_0x14e29a+_0x32b341(0x135),()=>_0x510bec[_0x32b341(0x157)]['resolveSegmentId'](_0x1df96d,_0x14e29a),{'verbose':_0x23e06c[_0x32b341(0x13a)]}),_0x4018ae=_0x7f0398[_0x32b341(0x145)];_0x23e06c['verbose']&&console['error'](_0x32b341(0x13b)+_0x4018ae);const _0x9e1343=await withSpinner('Listing\x20activations\x20for\x20segment\x20\x27'+_0x14e29a+'\x27...',()=>_0x510bec[_0x32b341(0x157)][_0x32b341(0x14e)](_0x1df96d,_0x4018ae),{'verbose':_0x23e06c[_0x32b341(0x13a)]}),_0xfa7ed=_0x9e1343[_0x32b341(0x145)];return console[_0x32b341(0x13e)](_0x32b341(0x13c)+_0xfa7ed['length']+_0x32b341(0x139)+(_0xfa7ed[_0x32b341(0x14d)]!==0x1?'s':'')),await handleSDKOutput(_0xfa7ed,_0x23e06c),0x0;}catch(_0x2069dc){if(_0x2069dc instanceof SDKError)return console[_0x32b341(0x13e)](_0x32b341(0x14f)+_0x2069dc[_0x32b341(0x137)]),_0x2069dc[_0x32b341(0x152)]&&console['error'](_0x32b341(0x144)+_0x2069dc[_0x32b341(0x152)]),0x1;throw _0x2069dc;}}}
@@ -1 +1 @@
1
- const a4_0x601200=a4_0x1297;(function(_0x1e4344,_0x41d99a){const _0x446499=a4_0x1297,_0x24ac8b=_0x1e4344();while(!![]){try{const _0x3f33ec=-parseInt(_0x446499(0x105))/0x1+-parseInt(_0x446499(0x108))/0x2*(-parseInt(_0x446499(0x100))/0x3)+-parseInt(_0x446499(0x16b))/0x4*(-parseInt(_0x446499(0xe9))/0x5)+-parseInt(_0x446499(0xe5))/0x6*(parseInt(_0x446499(0x102))/0x7)+parseInt(_0x446499(0x118))/0x8+parseInt(_0x446499(0xd4))/0x9+-parseInt(_0x446499(0xba))/0xa*(parseInt(_0x446499(0x145))/0xb);if(_0x3f33ec===_0x41d99a)break;else _0x24ac8b['push'](_0x24ac8b['shift']());}catch(_0x542d86){_0x24ac8b['push'](_0x24ac8b['shift']());}}}(a4_0x3134,0x1970a));function a4_0x1297(_0x450cb1,_0xbe4519){_0x450cb1=_0x450cb1-0xb0;const _0x313403=a4_0x3134();let _0x129786=_0x313403[_0x450cb1];return _0x129786;}import a4_0x2b303b from'chalk';import a4_0xe8fa2f from'path';function a4_0x3134(){const _0x2987d6=['Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','cloneProject','updated','\x20--name\x20','reason','agentId','Project\x20cloned\x20successfully','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','Dry\x20run\x20-\x20no\x20changes\x20made','pushAgent','pushProject','\x20changed','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','cwd-config','diff','\x20\x20tdx\x20agent\x20pull\x20','\x20\x20Knowledge\x20Base\x20\x22','\x0a✔\x20Pulled\x20','Cancelled','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','Using\x20project\x20from\x20','agent:push','yellow','Pushing\x20to\x20project...','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','\x0aWrite\x20','Using\x20project:\x20','\x20\x20Experimental\x20Artifact\x20\x22','\x20\x20Agent\x20\x22','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','output','Dry\x20run\x20-\x20no\x20files\x20written','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','387937zekdbX','projectDir','\x0aPull\x20summary\x20for\x20\x27','\x20created','Source:\x20','-\x20no\x20files\x20written','\x20|\x20','\x20\x20Knowledge\x20Bases:\x20','context','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','source','Agent\x20','MISSING_ARGUMENT','\x20\x20tdx\x20agent\x20clone\x20agents/','\x0a✔\x20Pushed\x20','\x0aPush\x20','\x22\x20to\x20a\x20different\x20profile','agentName','Cannot\x20clone\x20from\x20context\x20project\x20\x22','session','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','arg-dir','pullAgent','Using\x20project\x20from\x20context:\x20','\x20\x20Prompts:\x20','\x20files?','\x20errors','✔\x20Context\x20set:\x20','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','\x20--profile\x20','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','name','\x22\x20to\x20new\x20project\x20\x22','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','utf-8','\x0aError:','textKnowledgeBases','87908AwBHJG','prompts','integrations','Output\x20path:\x20','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','log','<new-name>','agent','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','Status:\x20','Would\x20pull\x20agent:\x20','30EFgCKM','error','llmProject','tdx.json','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','\x20resources?','Clone\x20\x22','dim','\x20\x20Target:\x20','llm_project','New\x20project\x20name\x20is\x20required','site','\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','green','join','description','isNew','force','\x0aProject\x20pushed\x20with\x20errors','\x0aChanges\x20to\x20integration\x20\x27','created','\x20\x20Agents:\x20','\x20updated','\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','\x22\x20to\x20\x22','unchanged','446670bKfLdO','counts','\x20\x20Text\x20Knowledge\x20Base\x20\x22','Project\x20cloned\x20with\x20errors','agent.yml','No\x20tdx.json\x20found\x20in\x20','\x20resources\x20to\x20\x27','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','no_context','Failed\x20to\x20push\x20agent:\x20','experimentalArtifacts','new','Would\x20clone:','Pulling\x20agent\x20\x22','\x20=\x20','action','\x20\x20Prompt\x20\x22','919902YDUzgh','New\x20project:\x20','repeat','agent:pull','10GkkRrQ','\x20\x20Text\x20Knowledge\x20Bases:\x20','\x20files\x20to\x20','push','projectId','outputPath','dryRun','cwd','\x20new','\x0aChanges:','Agent:\x20','agent:clone','newProjectId','cyan','Project:\x20','knowledgeBases','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','\x20\x20Integrations:\x20','red','\x20\x20Integration\x20\x22','total','llm','12WljkkE','\x20\x20Experimental\x20Artifacts:\x20','7DdtYyU','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','execute','76281ODMcGg','yes','hasChanges','102636vXOjke','New\x20project\x20ID:\x20','agents','-\x20nothing\x20pushed','message','\x20total','gray','Output:\x20','Chat:\x20','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','\x22...','Using\x20local\x20project:\x20','projectName','Errors:','experimentalKnowledgeBases','profile','1125960XcjVVB','\x0aChanges\x20to\x20agent\x20\x27','dirname','errors','parse','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','\x22:\x20','sourceProjectName','Using\x20context\x20project:\x20','outputDir','INVALID_ARGUMENT'];a4_0x3134=function(){return _0x2987d6;};return a4_0x3134();}import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext,resolveAgentPullArgs}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x1b8ade){const _0x18adc7=a4_0x1297,_0x621797=[];if(_0x1b8ade[_0x18adc7(0xfe)]!==undefined)_0x621797[_0x18adc7(0xec)](_0x1b8ade[_0x18adc7(0xfe)]+_0x18adc7(0x10d));if(_0x1b8ade[_0x18adc7(0xdf)]!==undefined&&_0x1b8ade[_0x18adc7(0xdf)]>0x0)_0x621797[_0x18adc7(0xec)](a4_0x2b303b[_0x18adc7(0xc7)](_0x1b8ade[_0x18adc7(0xdf)]+_0x18adc7(0xf1)));if(_0x1b8ade[_0x18adc7(0xce)]!==undefined&&_0x1b8ade[_0x18adc7(0xce)]>0x0)_0x621797[_0x18adc7(0xec)](a4_0x2b303b[_0x18adc7(0xc7)](_0x1b8ade[_0x18adc7(0xce)]+_0x18adc7(0x148)));if(_0x1b8ade[_0x18adc7(0x126)]!==undefined&&_0x1b8ade[_0x18adc7(0x126)]>0x0)_0x621797['push'](a4_0x2b303b['yellow'](_0x1b8ade[_0x18adc7(0x126)]+_0x18adc7(0xd0)));if(_0x1b8ade[_0x18adc7(0xd3)]!==undefined&&_0x1b8ade[_0x18adc7(0xd3)]>0x0)_0x621797[_0x18adc7(0xec)](a4_0x2b303b[_0x18adc7(0x10e)](_0x1b8ade[_0x18adc7(0xd3)]+'\x20unchanged'));if(_0x1b8ade[_0x18adc7(0x11b)]!==undefined&&_0x1b8ade['errors']>0x0)_0x621797[_0x18adc7(0xec)](a4_0x2b303b['red'](_0x1b8ade[_0x18adc7(0x11b)]+_0x18adc7(0x160)));return _0x621797[_0x18adc7(0xc8)](',\x20');}function displayDiffs(_0x3c1701,_0x2bb363,_0x540645,_0x49dcdf,_0x43988e,_0x650d95,_0x4876ea){const _0x50a897=a4_0x1297;for(const _0x538fdf of _0x3c1701){if(_0x538fdf['diff']){const _0x524602=_0x538fdf[_0x50a897(0x156)]||_0x538fdf[_0x50a897(0x165)];console[_0x50a897(0xb4)](_0x50a897(0x119)+_0x524602+'\x27:'),console[_0x50a897(0xb4)]('─'[_0x50a897(0xe7)](0x3c)),console[_0x50a897(0xb4)](_0x538fdf[_0x50a897(0x132)]),console[_0x50a897(0xb4)]('─'[_0x50a897(0xe7)](0x3c));}}for(const _0xaed32f of _0x2bb363){_0xaed32f[_0x50a897(0x132)]&&(console['log']('\x0aChanges\x20to\x20knowledge\x20base\x20\x27'+_0xaed32f[_0x50a897(0x165)]+'\x27:'),console[_0x50a897(0xb4)]('─'[_0x50a897(0xe7)](0x3c)),console[_0x50a897(0xb4)](_0xaed32f['diff']),console['log']('─'[_0x50a897(0xe7)](0x3c)));}for(const _0x3511ed of _0x540645){_0x3511ed[_0x50a897(0x132)]&&(console[_0x50a897(0xb4)](_0x50a897(0x12b)+_0x3511ed[_0x50a897(0x165)]+'\x27:'),console['log']('─'[_0x50a897(0xe7)](0x3c)),console[_0x50a897(0xb4)](_0x3511ed[_0x50a897(0x132)]),console[_0x50a897(0xb4)]('─'['repeat'](0x3c)));}for(const _0x2c9368 of _0x49dcdf){_0x2c9368[_0x50a897(0x132)]&&(console[_0x50a897(0xb4)]('\x0aChanges\x20to\x20prompt\x20\x27'+_0x2c9368[_0x50a897(0x165)]+'\x27:'),console['log']('─'[_0x50a897(0xe7)](0x3c)),console[_0x50a897(0xb4)](_0x2c9368[_0x50a897(0x132)]),console['log']('─'[_0x50a897(0xe7)](0x3c)));}for(const _0x5e228c of _0x43988e){_0x5e228c[_0x50a897(0x132)]&&(console[_0x50a897(0xb4)](_0x50a897(0xcd)+_0x5e228c['name']+'\x27:'),console[_0x50a897(0xb4)]('─'[_0x50a897(0xe7)](0x3c)),console['log'](_0x5e228c['diff']),console[_0x50a897(0xb4)]('─'[_0x50a897(0xe7)](0x3c)));}for(const _0x4f62ec of _0x650d95){_0x4f62ec[_0x50a897(0x132)]&&(console[_0x50a897(0xb4)]('\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27'+_0x4f62ec[_0x50a897(0x165)]+'\x27:'),console[_0x50a897(0xb4)]('─'[_0x50a897(0xe7)](0x3c)),console['log'](_0x4f62ec[_0x50a897(0x132)]),console[_0x50a897(0xb4)]('─'['repeat'](0x3c)));}for(const _0x1ed7bc of _0x4876ea){_0x1ed7bc[_0x50a897(0x132)]&&(console[_0x50a897(0xb4)](_0x50a897(0xdb)+_0x1ed7bc['name']+'\x27:'),console[_0x50a897(0xb4)]('─'[_0x50a897(0xe7)](0x3c)),console[_0x50a897(0xb4)](_0x1ed7bc['diff']),console[_0x50a897(0xb4)]('─'['repeat'](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x601200(0x165)]=a4_0x601200(0xe8);[a4_0x601200(0xc9)]='Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files';async[a4_0x601200(0x104)](_0x5eb65b){const _0x288110=a4_0x601200,{options:_0x107e21,args:_0xc8e6a7,tdx:_0x583683}=_0x5eb65b,_0x3f36eb=_0xc8e6a7[0x0],_0x1d3f2e=_0xc8e6a7[0x1],_0x291846=_0x107e21[_0x288110(0x142)],_0x5631c5=_0x107e21['dryRun'],_0x4356ba=_0x107e21['force'],_0x2e4fca=_0x107e21['yes'],_0x8200d1=_0x107e21[_0x288110(0xbc)],_0x1dbe46=_0x107e21[_0x288110(0xb6)];let _0x28d24b;if(_0x3f36eb){const _0xd9fdd8=a4_0xe8fa2f[_0x288110(0xc8)](_0x3f36eb,_0x288110(0xbd));if(existsSync(_0xd9fdd8))try{const _0x52e15d=JSON[_0x288110(0x11c)](readFileSync(_0xd9fdd8,_0x288110(0x168)));_0x52e15d['llm_project']&&(_0x28d24b={'llm_project':_0x52e15d['llm_project']});}catch{}}const _0x143467=findAgentConfigPath(process[_0x288110(0xf0)]());let _0x22ec9c;if(_0x143467)try{const _0xca9784=JSON[_0x288110(0x11c)](readFileSync(_0x143467,_0x288110(0x168)));_0xca9784[_0x288110(0xc3)]&&(_0x22ec9c={'llm_project':_0xca9784[_0x288110(0xc3)]});}catch{}const _0x382d19=resolveAgentPullArgs({'arg':_0x3f36eb,'agentNameArg':_0x1d3f2e,'agentFlag':_0x1dbe46,'contextProject':_0x8200d1,'argDirConfig':_0x28d24b,'cwdConfigPath':_0x143467||undefined,'cwdConfig':_0x22ec9c}),{projectNameOrId:_0x361870,targetAgentName:_0x2dc2b4,existingOutputDir:_0x179572,source:_0x38af30}=_0x382d19;if(_0x38af30===_0x288110(0x15b))console['log'](a4_0x2b303b['dim'](_0x288110(0x138)+a4_0xe8fa2f[_0x288110(0xc8)](_0x3f36eb,_0x288110(0xbd))+':\x20'+_0x361870));else{if(_0x38af30===_0x288110(0x131))console[_0x288110(0xb4)](a4_0x2b303b[_0x288110(0xc1)](_0x288110(0x13e)+_0x361870));else _0x38af30===_0x288110(0x14d)&&console['log'](a4_0x2b303b[_0x288110(0xc1)](_0x288110(0x15d)+_0x361870));}if(!_0x361870)return _0x1dbe46?(console[_0x288110(0xb4)](a4_0x2b303b[_0x288110(0x13a)](_0x288110(0x159))),console[_0x288110(0xb4)]('Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>'),console[_0x288110(0xb4)](_0x288110(0x11d))):(console[_0x288110(0xb4)](a4_0x2b303b[_0x288110(0x13a)](_0x288110(0x111))),console['log']('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)'),console[_0x288110(0xb4)](_0x288110(0xc6)),console[_0x288110(0xb4)](_0x288110(0xd1)),console[_0x288110(0xb4)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20--agent\x20<name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20context\x20project'),console['log']('\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')),0x1;if(_0x2dc2b4){const {data:_0x5f46c4}=await withSpinner(_0x288110(0xe1)+_0x2dc2b4+'\x22\x20from\x20project\x20\x22'+_0x361870+_0x288110(0x112),()=>_0x583683['llm'][_0x288110(0x15c)](_0x361870,_0x2dc2b4,_0x291846,{'dryRun':_0x5631c5,'force':_0x4356ba}));if(_0x5631c5)return console['log'](a4_0x2b303b[_0x288110(0x13a)](_0x288110(0x143))),console[_0x288110(0xb4)](_0x288110(0xb9)+_0x5f46c4[_0x288110(0x156)]),console[_0x288110(0xb4)](_0x288110(0xb2)+_0x5f46c4[_0x288110(0xee)]),_0x5f46c4[_0x288110(0x132)]&&(console[_0x288110(0xb4)](_0x288110(0xf2)),console[_0x288110(0xb4)]('─'[_0x288110(0xe7)](0x3c)),console[_0x288110(0xb4)](_0x5f46c4['diff']),console[_0x288110(0xb4)]('─'[_0x288110(0xe7)](0x3c))),0x0;return console[_0x288110(0xb4)](a4_0x2b303b[_0x288110(0xc7)]('Agent\x20pulled\x20successfully')),console[_0x288110(0xb4)](_0x288110(0xf3)+_0x5f46c4[_0x288110(0x156)]),console['log'](_0x288110(0x10f)+_0x5f46c4[_0x288110(0xee)]),console[_0x288110(0xb4)](_0x288110(0xb8)+(_0x5f46c4[_0x288110(0xca)]?a4_0x2b303b[_0x288110(0xc7)](_0x288110(0xdf)):_0x5f46c4[_0x288110(0x107)]?a4_0x2b303b['yellow'](_0x288110(0x126)):a4_0x2b303b['gray'](_0x288110(0xd3)))),0x0;}const _0x2fee21=_0x179572||_0x291846,{data:_0x302a34}=await withSpinner('Analyzing\x20project\x20\x22'+_0x361870+_0x288110(0x112),()=>_0x583683['llm']['pullProject'](_0x361870,_0x2fee21,{'dryRun':!![]})),_0x1e9983=_0x302a34[_0x288110(0xd5)][_0x288110(0x10a)][_0x288110(0xdf)]+_0x302a34[_0x288110(0xd5)]['knowledgeBases'][_0x288110(0xdf)]+_0x302a34['counts'][_0x288110(0x16a)][_0x288110(0xdf)]+_0x302a34[_0x288110(0xd5)][_0x288110(0xb0)]['new']+_0x302a34[_0x288110(0xd5)]['integrations'][_0x288110(0xdf)]+_0x302a34[_0x288110(0xd5)][_0x288110(0x116)][_0x288110(0xdf)]+_0x302a34[_0x288110(0xd5)][_0x288110(0xde)]['new'],_0x5c4e1d=_0x302a34['counts'][_0x288110(0x10a)][_0x288110(0x126)]+_0x302a34[_0x288110(0xd5)][_0x288110(0xf8)][_0x288110(0x126)]+_0x302a34[_0x288110(0xd5)][_0x288110(0x16a)]['updated']+_0x302a34['counts']['prompts'][_0x288110(0x126)]+_0x302a34['counts'][_0x288110(0xb1)][_0x288110(0x126)]+_0x302a34[_0x288110(0xd5)]['experimentalKnowledgeBases']['updated']+_0x302a34['counts'][_0x288110(0xde)][_0x288110(0x126)],_0x1319e6=_0x302a34[_0x288110(0xd5)][_0x288110(0x10a)][_0x288110(0xd3)]+_0x302a34[_0x288110(0xd5)][_0x288110(0xf8)][_0x288110(0xd3)]+_0x302a34[_0x288110(0xd5)][_0x288110(0x16a)]['unchanged']+_0x302a34['counts'][_0x288110(0xb0)][_0x288110(0xd3)]+_0x302a34[_0x288110(0xd5)]['integrations'][_0x288110(0xd3)]+_0x302a34['counts'][_0x288110(0x116)]['unchanged']+_0x302a34[_0x288110(0xd5)][_0x288110(0xde)]['unchanged'];console[_0x288110(0xb4)](_0x288110(0x147)+_0x302a34[_0x288110(0x114)]+'\x27:'),console[_0x288110(0xb4)]('\x20\x20'+a4_0x2b303b[_0x288110(0xc7)]('+\x20'+_0x1e9983+'\x20new')+_0x288110(0x14b)+a4_0x2b303b[_0x288110(0x13a)]('~\x20'+_0x5c4e1d+_0x288110(0x12f))+_0x288110(0x14b)+a4_0x2b303b[_0x288110(0xc1)]('=\x20'+_0x1319e6+'\x20unchanged')),console['log'](_0x288110(0xcf)+formatCountSummary(_0x302a34[_0x288110(0xd5)]['agents'])),console[_0x288110(0xb4)](_0x288110(0x14c)+formatCountSummary(_0x302a34[_0x288110(0xd5)][_0x288110(0xf8)])),console[_0x288110(0xb4)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x302a34[_0x288110(0xd5)][_0x288110(0x16a)])),console[_0x288110(0xb4)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x302a34[_0x288110(0xd5)][_0x288110(0xb0)])),console[_0x288110(0xb4)](_0x288110(0xfb)+formatCountSummary(_0x302a34[_0x288110(0xd5)][_0x288110(0xb1)]));const _0x23bf14=_0x302a34[_0x288110(0xd5)]['experimentalKnowledgeBases'][_0x288110(0xfe)]>0x0||_0x302a34[_0x288110(0xd5)][_0x288110(0xde)]['total']>0x0;_0x23bf14&&(console['log']('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x302a34[_0x288110(0xd5)][_0x288110(0x116)])),console['log'](_0x288110(0x101)+formatCountSummary(_0x302a34['counts']['experimentalArtifacts'])));console[_0x288110(0xb4)](_0x288110(0xc2)+a4_0x2b303b[_0x288110(0xf6)](_0x302a34[_0x288110(0x121)])),displayDiffs(_0x302a34[_0x288110(0x10a)],_0x302a34['knowledgeBases'],_0x302a34[_0x288110(0x16a)],_0x302a34['prompts'],_0x302a34['integrations'],_0x302a34[_0x288110(0x116)],_0x302a34[_0x288110(0xde)]);if(_0x5631c5)return console[_0x288110(0xb4)](a4_0x2b303b['yellow'](_0x288110(0x162))),0x0;if(_0x1e9983===0x0&&_0x5c4e1d===0x0)return console[_0x288110(0xb4)](a4_0x2b303b[_0x288110(0xc7)](_0x288110(0xbe))),saveSessionContext({'llm_project':_0x302a34[_0x288110(0x114)]},_0x107e21[_0x288110(0x158)]),console['log'](a4_0x2b303b[_0x288110(0xc7)](_0x288110(0x161)+a4_0x2b303b[_0x288110(0xc1)]('llm_project')+_0x288110(0xe2)+a4_0x2b303b[_0x288110(0xf6)](_0x302a34[_0x288110(0x114)]))),0x0;if(!_0x2e4fca&&!_0x4356ba){if(!isInteractive())return console[_0x288110(0xbb)](a4_0x2b303b[_0x288110(0xfc)](_0x288110(0x169)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x288110(0xbb)](a4_0x2b303b[_0x288110(0xc1)](_0x288110(0x14e))),0x1;const _0x372669=await confirmKey(_0x288110(0x13d)+(_0x1e9983+_0x5c4e1d)+_0x288110(0x15f));if(!_0x372669)return console[_0x288110(0xb4)](a4_0x2b303b[_0x288110(0x13a)](_0x288110(0x136)),_0x288110(0x14a)),0x1;}const {data:_0x3ca051}=await withSpinner('Writing\x20files...',()=>_0x583683[_0x288110(0xff)]['pullProject'](_0x361870,_0x2fee21,{'force':_0x4356ba}));return console[_0x288110(0xb4)](a4_0x2b303b[_0x288110(0xc7)](_0x288110(0x135)+(_0x1e9983+_0x5c4e1d)+_0x288110(0xeb)+_0x3ca051[_0x288110(0x121)])),saveSessionContext({'llm_project':_0x3ca051[_0x288110(0x114)]},_0x107e21[_0x288110(0x158)]),console[_0x288110(0xb4)](a4_0x2b303b[_0x288110(0xc7)]('✔\x20Context\x20set:\x20'+a4_0x2b303b[_0x288110(0xc1)]('llm_project')+_0x288110(0xe2)+a4_0x2b303b['cyan'](_0x3ca051[_0x288110(0x114)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x601200(0x165)]=a4_0x601200(0xf4);[a4_0x601200(0xc9)]=a4_0x601200(0xb7);async[a4_0x601200(0x104)](_0x327271){const _0x752529=a4_0x601200,{options:_0x47afcd,args:_0x1518aa,tdx:_0x103842}=_0x327271,_0x3c2f41=_0x1518aa[0x0],_0x54abcb=_0x47afcd[_0x752529(0x165)],_0x37cf96=_0x47afcd['dryRun'],_0x4f4f50=_0x47afcd[_0x752529(0x106)],_0x13c5b6=_0x47afcd[_0x752529(0xc5)],_0xf84414=_0x47afcd[_0x752529(0xbc)];let _0x4f15ba;const _0x542d57=findAgentConfigPath(process[_0x752529(0xf0)]());if(_0x3c2f41){const _0x3eec7e=a4_0xe8fa2f[_0x752529(0xc8)](_0x3c2f41,'tdx.json');existsSync(_0x3eec7e)?(_0x4f15ba=_0x3c2f41,console[_0x752529(0xb4)](a4_0x2b303b[_0x752529(0xc1)](_0x752529(0x113)+_0x3c2f41))):_0x4f15ba=_0x3c2f41;}else{if(_0x542d57)_0x4f15ba=a4_0xe8fa2f[_0x752529(0x11a)](_0x542d57),console[_0x752529(0xb4)](a4_0x2b303b[_0x752529(0xc1)]('Using\x20current\x20project:\x20'+_0x4f15ba));else{if(_0xf84414){const _0x1b76a3=sanitizeForFilesystem(_0xf84414);let _0x14eb81=_0x1b76a3,_0x298628=a4_0xe8fa2f['join'](process[_0x752529(0xf0)](),_0x752529(0x10a),_0x1b76a3,'tdx.json');if(!existsSync(_0x298628)){const _0x229c9e=normalizeName(_0xf84414),_0x5b00b6=a4_0xe8fa2f['join'](process[_0x752529(0xf0)](),_0x752529(0x10a),_0x229c9e,'tdx.json');existsSync(_0x5b00b6)&&(_0x14eb81=_0x229c9e,_0x298628=_0x5b00b6);}if(existsSync(_0x298628))_0x4f15ba=a4_0xe8fa2f['dirname'](_0x298628),console[_0x752529(0xb4)](a4_0x2b303b[_0x752529(0xc1)](_0x752529(0x113)+_0x4f15ba));else{const _0xc76242=_0x47afcd[_0x752529(0x117)];if(_0xc76242)throw new SDKError(ErrorCode[_0x752529(0x122)],_0x752529(0x157)+_0xf84414+_0x752529(0x155),undefined,{'helpText':_0x752529(0x130)+_0x752529(0xb3)+(_0x752529(0x133)+_0xf84414+'\x0a')+(_0x752529(0x152)+_0x14eb81+_0x752529(0x127)+(_0x54abcb||_0x752529(0xb5))+_0x752529(0x163)+_0xc76242)});_0x4f15ba=_0xf84414,console[_0x752529(0xb4)](a4_0x2b303b[_0x752529(0xc1)](_0x752529(0x120)+_0xf84414));}}}}if(!_0x4f15ba)return console[_0x752529(0xb4)](a4_0x2b303b[_0x752529(0x13a)](_0x752529(0x103))),console['log'](_0x752529(0x137)),console['log'](_0x752529(0x167)),console[_0x752529(0xb4)]('\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['log'](_0x752529(0x15a)),0x1;if(!_0x54abcb)throw new SDKError(ErrorCode[_0x752529(0x151)],_0x752529(0xc4),undefined,{'helpText':_0x752529(0x123)});if(!_0x4f4f50&&!_0x37cf96){if(!isInteractive())return console[_0x752529(0xbb)](a4_0x2b303b['red'](_0x752529(0x169)),_0x752529(0x144)),console['error'](a4_0x2b303b[_0x752529(0xc1)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x1dea9a=await confirmKey(_0x752529(0xc0)+_0x4f15ba+_0x752529(0x166)+_0x54abcb+'\x22?');if(!_0x1dea9a)return console[_0x752529(0xb4)](a4_0x2b303b['yellow'](_0x752529(0x136))),0x1;}const {data:_0x51e613}=await withSpinner('Cloning\x20\x22'+_0x4f15ba+_0x752529(0xd2)+_0x54abcb+_0x752529(0x112),()=>_0x103842[_0x752529(0xff)][_0x752529(0x125)](_0x4f15ba,_0x54abcb,{'dryRun':_0x37cf96}));if(_0x37cf96){console[_0x752529(0xb4)](a4_0x2b303b[_0x752529(0x13a)](_0x752529(0x12c))),console['log']('Source:\x20'+_0x51e613[_0x752529(0x11f)]),console[_0x752529(0xb4)](_0x752529(0xe6)+_0x54abcb),console['log'](_0x752529(0xe0)),console[_0x752529(0xb4)](_0x752529(0xcf)+_0x51e613[_0x752529(0xd5)][_0x752529(0x10a)][_0x752529(0xce)]),console['log'](_0x752529(0x14c)+_0x51e613[_0x752529(0xd5)][_0x752529(0xf8)][_0x752529(0xce)]),console[_0x752529(0xb4)]('\x20\x20Prompts:\x20'+_0x51e613[_0x752529(0xd5)][_0x752529(0xb0)][_0x752529(0xce)]);const _0x40e690=_0x51e613[_0x752529(0xd5)][_0x752529(0x116)]['created']>0x0||_0x51e613[_0x752529(0xd5)][_0x752529(0xde)]['created']>0x0;return _0x40e690&&(console[_0x752529(0xb4)](_0x752529(0xf9)+_0x51e613['counts'][_0x752529(0x116)][_0x752529(0xce)]),console['log'](_0x752529(0x101)+_0x51e613['counts'][_0x752529(0xde)][_0x752529(0xce)])),0x0;}const _0x24b165=_0x51e613[_0x752529(0xd5)][_0x752529(0x10a)][_0x752529(0x11b)]>0x0||_0x51e613[_0x752529(0xd5)][_0x752529(0xf8)][_0x752529(0x11b)]>0x0||_0x51e613['counts'][_0x752529(0xb0)][_0x752529(0x11b)]>0x0||_0x51e613[_0x752529(0xd5)][_0x752529(0x116)]['errors']>0x0||_0x51e613[_0x752529(0xd5)][_0x752529(0xde)]['errors']>0x0;_0x24b165?console[_0x752529(0xb4)](a4_0x2b303b['yellow'](_0x752529(0xd7))):console[_0x752529(0xb4)](a4_0x2b303b[_0x752529(0xc7)](_0x752529(0x12a)));console['log'](_0x752529(0x149)+_0x51e613[_0x752529(0x11f)]),console[_0x752529(0xb4)](_0x752529(0xe6)+_0x51e613['newProjectName']),console[_0x752529(0xb4)](_0x752529(0x109)+_0x51e613['newProjectId']),console[_0x752529(0xb4)](),console['log']('Summary:'),console['log']('\x20\x20Agents:\x20'+formatCountSummary(_0x51e613[_0x752529(0xd5)][_0x752529(0x10a)])),console[_0x752529(0xb4)](_0x752529(0x14c)+formatCountSummary(_0x51e613[_0x752529(0xd5)][_0x752529(0xf8)])),console[_0x752529(0xb4)](_0x752529(0x15e)+formatCountSummary(_0x51e613[_0x752529(0xd5)][_0x752529(0xb0)])),console['log'](_0x752529(0xfb)+formatCountSummary(_0x51e613[_0x752529(0xd5)]['integrations']));const _0x127b3f=_0x51e613['counts']['experimentalKnowledgeBases'][_0x752529(0xce)]>0x0||_0x51e613['counts']['experimentalKnowledgeBases'][_0x752529(0x126)]>0x0||_0x51e613[_0x752529(0xd5)][_0x752529(0x116)]['unchanged']>0x0||_0x51e613[_0x752529(0xd5)][_0x752529(0xde)][_0x752529(0xce)]>0x0||_0x51e613[_0x752529(0xd5)]['experimentalArtifacts'][_0x752529(0x126)]>0x0||_0x51e613[_0x752529(0xd5)][_0x752529(0xde)][_0x752529(0xd3)]>0x0;_0x127b3f&&(console[_0x752529(0xb4)](_0x752529(0xf9)+formatCountSummary(_0x51e613['counts'][_0x752529(0x116)])),console[_0x752529(0xb4)](_0x752529(0x101)+formatCountSummary(_0x51e613[_0x752529(0xd5)]['experimentalArtifacts'])));if(_0x24b165){console[_0x752529(0xb4)](),console[_0x752529(0xb4)](a4_0x2b303b['red'](_0x752529(0x115)));for(const _0x43f9d7 of _0x51e613[_0x752529(0x10a)]){_0x43f9d7[_0x752529(0xe3)]===_0x752529(0xbb)&&console[_0x752529(0xb4)](a4_0x2b303b[_0x752529(0xfc)](_0x752529(0x140)+_0x43f9d7[_0x752529(0x156)]+_0x752529(0x11e)+_0x43f9d7[_0x752529(0xbb)]));}for(const _0x3b7cb8 of _0x51e613['knowledgeBases']){_0x3b7cb8['action']==='error'&&console[_0x752529(0xb4)](a4_0x2b303b[_0x752529(0xfc)]('\x20\x20Knowledge\x20Base\x20\x22'+_0x3b7cb8['name']+_0x752529(0x11e)+_0x3b7cb8[_0x752529(0xbb)]));}for(const _0x5887d5 of _0x51e613[_0x752529(0xb0)]){_0x5887d5['action']==='error'&&console['log'](a4_0x2b303b[_0x752529(0xfc)]('\x20\x20Prompt\x20\x22'+_0x5887d5[_0x752529(0x165)]+_0x752529(0x11e)+_0x5887d5['error']));}for(const _0x7a1e91 of _0x51e613[_0x752529(0xb1)]){_0x7a1e91['action']===_0x752529(0xbb)&&console[_0x752529(0xb4)](a4_0x2b303b[_0x752529(0xfc)](_0x752529(0xfd)+_0x7a1e91[_0x752529(0x165)]+_0x752529(0x11e)+_0x7a1e91[_0x752529(0xbb)]));}for(const _0x3f6ecc of _0x51e613[_0x752529(0x116)]){_0x3f6ecc[_0x752529(0xe3)]===_0x752529(0xbb)&&console[_0x752529(0xb4)](a4_0x2b303b[_0x752529(0xfc)](_0x752529(0xfa)+_0x3f6ecc[_0x752529(0x165)]+_0x752529(0x11e)+_0x3f6ecc['error']));}for(const _0x4233a1 of _0x51e613[_0x752529(0xde)]){_0x4233a1[_0x752529(0xe3)]===_0x752529(0xbb)&&console[_0x752529(0xb4)](a4_0x2b303b[_0x752529(0xfc)](_0x752529(0x13f)+_0x4233a1[_0x752529(0x165)]+_0x752529(0x11e)+_0x4233a1['error']));}return 0x1;}console[_0x752529(0xb4)]();const _0xcf5265=getLLMProjectUrl(_0x13c5b6,_0x51e613[_0x752529(0xf5)]);return console[_0x752529(0xb4)](_0x752529(0xf7)+a4_0x2b303b[_0x752529(0xf6)](_0xcf5265)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x601200(0x165)]=a4_0x601200(0x139);[a4_0x601200(0xc9)]=a4_0x601200(0x164);async[a4_0x601200(0x104)](_0x18c00f){const _0x395f8e=a4_0x601200,{options:_0x2be765,args:_0xafe6ca,tdx:_0x3216d8}=_0x18c00f;let _0x19bcee=_0xafe6ca[0x0]||process[_0x395f8e(0xf0)]();const _0x2baf17=_0x2be765[_0x395f8e(0xef)],_0x1e38fe=_0x2be765[_0x395f8e(0xcb)],_0x2b6dc2=_0x2be765[_0x395f8e(0x106)],_0x391e49=_0x2be765[_0x395f8e(0xc5)],_0x10c0c5=a4_0xe8fa2f['join'](_0x19bcee,_0x395f8e(0xd8)),_0x34b3a5=existsSync(_0x10c0c5);if(_0x34b3a5){const {data:_0x1308be}=await withSpinner('Pushing\x20agent\x20from\x20\x22'+_0x19bcee+_0x395f8e(0x112),()=>_0x3216d8[_0x395f8e(0xff)][_0x395f8e(0x12d)](_0x19bcee,{'dryRun':_0x2baf17,'force':_0x1e38fe}));if(_0x2baf17)return console['log'](a4_0x2b303b['yellow'](_0x395f8e(0x12c))),console[_0x395f8e(0xb4)]('Would\x20push\x20agent:\x20'+_0x1308be[_0x395f8e(0x156)]),0x0;if(_0x1308be[_0x395f8e(0xe3)]===_0x395f8e(0xbb))return console[_0x395f8e(0xb4)](a4_0x2b303b['red'](_0x395f8e(0xdd)+_0x1308be['error'])),0x1;console[_0x395f8e(0xb4)](a4_0x2b303b[_0x395f8e(0xc7)](_0x395f8e(0x150)+_0x1308be[_0x395f8e(0xe3)]+'\x20successfully')),console[_0x395f8e(0xb4)]('Agent:\x20'+_0x1308be[_0x395f8e(0x156)]);if(_0x1308be[_0x395f8e(0x129)]&&_0x1308be[_0x395f8e(0xed)]){const _0x5efd28=getLLMAgentChatUrl(_0x391e49,_0x1308be[_0x395f8e(0xed)],_0x1308be[_0x395f8e(0x129)]);console[_0x395f8e(0xb4)](_0x395f8e(0x110)+a4_0x2b303b[_0x395f8e(0xf6)](_0x5efd28));}return 0x0;}const _0x1153f4=_0x2be765[_0x395f8e(0xbc)],_0x3b7cc=resolveProjectFromContext(_0x19bcee,_0x1153f4);if(_0x3b7cc['found'])_0x19bcee=_0x3b7cc[_0x395f8e(0x146)],_0x3b7cc[_0x395f8e(0x14f)]===_0x395f8e(0x14d)&&console[_0x395f8e(0xb4)](a4_0x2b303b[_0x395f8e(0xc1)](_0x395f8e(0x13e)+_0x19bcee));else{let _0x425a81=_0x395f8e(0x13c);_0x3b7cc['reason']==='no_local_folder'&&(_0x425a81=_0x3b7cc[_0x395f8e(0x10c)]+_0x395f8e(0x124)+_0x3b7cc[_0x395f8e(0xbc)]+'\x27\x20to\x20create\x20the\x20folder\x20structure.');throw new SDKError(ErrorCode[_0x395f8e(0x122)],_0x3b7cc[_0x395f8e(0x128)]===_0x395f8e(0xdc)?_0x3b7cc[_0x395f8e(0x10c)]:_0x395f8e(0xd9)+_0x19bcee,undefined,{'helpText':_0x425a81});}const {data:_0x9bd05f}=await withSpinner('Analyzing\x20changes\x20to\x20push...',()=>_0x3216d8[_0x395f8e(0xff)][_0x395f8e(0x12e)](_0x19bcee,{'dryRun':!![]})),_0x3196aa=_0x9bd05f[_0x395f8e(0xd5)][_0x395f8e(0x10a)]['errors']>0x0;if(_0x3196aa){console[_0x395f8e(0xb4)](a4_0x2b303b[_0x395f8e(0xfc)]('\x0aErrors\x20found:'));for(const _0x4ef963 of _0x9bd05f[_0x395f8e(0x10a)]){_0x4ef963[_0x395f8e(0xe3)]===_0x395f8e(0xbb)&&console[_0x395f8e(0xb4)](a4_0x2b303b[_0x395f8e(0xfc)](_0x395f8e(0x140)+_0x4ef963[_0x395f8e(0x156)]+_0x395f8e(0x11e)+_0x4ef963[_0x395f8e(0xbb)]));}return 0x1;}const _0x4f8897=_0x9bd05f['counts'][_0x395f8e(0x10a)]['created']+_0x9bd05f[_0x395f8e(0xd5)][_0x395f8e(0xf8)][_0x395f8e(0xce)]+_0x9bd05f[_0x395f8e(0xd5)][_0x395f8e(0x16a)][_0x395f8e(0xce)]+_0x9bd05f[_0x395f8e(0xd5)]['prompts'][_0x395f8e(0xce)]+_0x9bd05f[_0x395f8e(0xd5)][_0x395f8e(0xb1)][_0x395f8e(0xce)]+_0x9bd05f[_0x395f8e(0xd5)][_0x395f8e(0x116)][_0x395f8e(0xce)]+_0x9bd05f[_0x395f8e(0xd5)]['experimentalArtifacts'][_0x395f8e(0xce)],_0x154138=_0x9bd05f[_0x395f8e(0xd5)]['agents'][_0x395f8e(0x126)]+_0x9bd05f['counts'][_0x395f8e(0xf8)][_0x395f8e(0x126)]+_0x9bd05f[_0x395f8e(0xd5)][_0x395f8e(0x16a)][_0x395f8e(0x126)]+_0x9bd05f[_0x395f8e(0xd5)]['prompts'][_0x395f8e(0x126)]+_0x9bd05f[_0x395f8e(0xd5)][_0x395f8e(0xb1)][_0x395f8e(0x126)]+_0x9bd05f[_0x395f8e(0xd5)]['experimentalKnowledgeBases'][_0x395f8e(0x126)]+_0x9bd05f[_0x395f8e(0xd5)][_0x395f8e(0xde)][_0x395f8e(0x126)],_0x17c47f=_0x9bd05f[_0x395f8e(0xd5)]['agents']['unchanged']+_0x9bd05f['counts'][_0x395f8e(0xf8)][_0x395f8e(0xd3)]+_0x9bd05f['counts'][_0x395f8e(0x16a)]['unchanged']+_0x9bd05f[_0x395f8e(0xd5)][_0x395f8e(0xb0)][_0x395f8e(0xd3)]+_0x9bd05f[_0x395f8e(0xd5)]['integrations']['unchanged']+_0x9bd05f[_0x395f8e(0xd5)][_0x395f8e(0x116)][_0x395f8e(0xd3)]+_0x9bd05f['counts'][_0x395f8e(0xde)][_0x395f8e(0xd3)];console[_0x395f8e(0xb4)]('\x0aPush\x20summary\x20for\x20\x27'+_0x9bd05f[_0x395f8e(0x114)]+'\x27:'),console['log']('\x20\x20'+a4_0x2b303b[_0x395f8e(0xc7)]('+\x20'+_0x4f8897+'\x20new')+_0x395f8e(0x14b)+a4_0x2b303b['yellow']('~\x20'+_0x154138+_0x395f8e(0x12f))+_0x395f8e(0x14b)+a4_0x2b303b[_0x395f8e(0xc1)]('=\x20'+_0x17c47f+'\x20unchanged')),console[_0x395f8e(0xb4)](_0x395f8e(0xcf)+formatCountSummary(_0x9bd05f['counts'][_0x395f8e(0x10a)])),console['log'](_0x395f8e(0x14c)+formatCountSummary(_0x9bd05f[_0x395f8e(0xd5)]['knowledgeBases'])),console[_0x395f8e(0xb4)](_0x395f8e(0xea)+formatCountSummary(_0x9bd05f[_0x395f8e(0xd5)][_0x395f8e(0x16a)])),console[_0x395f8e(0xb4)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x9bd05f['counts']['prompts'])),console['log'](_0x395f8e(0xfb)+formatCountSummary(_0x9bd05f[_0x395f8e(0xd5)][_0x395f8e(0xb1)]));const _0x2716f5=_0x9bd05f[_0x395f8e(0xd5)][_0x395f8e(0x116)][_0x395f8e(0xce)]>0x0||_0x9bd05f[_0x395f8e(0xd5)][_0x395f8e(0x116)]['updated']>0x0||_0x9bd05f[_0x395f8e(0xd5)][_0x395f8e(0x116)][_0x395f8e(0xd3)]>0x0||_0x9bd05f[_0x395f8e(0xd5)][_0x395f8e(0xde)][_0x395f8e(0xce)]>0x0||_0x9bd05f[_0x395f8e(0xd5)][_0x395f8e(0xde)][_0x395f8e(0x126)]>0x0||_0x9bd05f[_0x395f8e(0xd5)]['experimentalArtifacts']['unchanged']>0x0;_0x2716f5&&(console[_0x395f8e(0xb4)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x9bd05f[_0x395f8e(0xd5)][_0x395f8e(0x116)])),console[_0x395f8e(0xb4)](_0x395f8e(0x101)+formatCountSummary(_0x9bd05f[_0x395f8e(0xd5)][_0x395f8e(0xde)])));console['log']('\x20\x20Source:\x20'+a4_0x2b303b[_0x395f8e(0xf6)](_0x19bcee)),displayDiffs(_0x9bd05f[_0x395f8e(0x10a)],_0x9bd05f[_0x395f8e(0xf8)],_0x9bd05f['textKnowledgeBases'],_0x9bd05f[_0x395f8e(0xb0)],_0x9bd05f[_0x395f8e(0xb1)],_0x9bd05f[_0x395f8e(0x116)],_0x9bd05f[_0x395f8e(0xde)]);if(_0x2baf17)return console['log'](a4_0x2b303b['yellow'](_0x395f8e(0x141))),0x0;if(_0x4f8897===0x0&&_0x154138===0x0){console[_0x395f8e(0xb4)](a4_0x2b303b[_0x395f8e(0xc7)]('\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date'));const _0x3636a3=getLLMProjectUrl(_0x391e49,_0x9bd05f['projectId']);return console[_0x395f8e(0xb4)](_0x395f8e(0xf7)+a4_0x2b303b['cyan'](_0x3636a3)),0x0;}if(!_0x2b6dc2&&!_0x1e38fe){if(!isInteractive())return console[_0x395f8e(0xbb)](a4_0x2b303b[_0x395f8e(0xfc)](_0x395f8e(0x169)),_0x395f8e(0x144)),console[_0x395f8e(0xbb)](a4_0x2b303b[_0x395f8e(0xc1)](_0x395f8e(0x14e))),0x1;const _0x43ef74=await confirmKey(_0x395f8e(0x154)+(_0x4f8897+_0x154138)+_0x395f8e(0xbf));if(!_0x43ef74)return console[_0x395f8e(0xb4)](a4_0x2b303b['yellow'](_0x395f8e(0x136)),_0x395f8e(0x10b)),0x1;}const {data:_0x55c45b}=await withSpinner(_0x395f8e(0x13b),()=>_0x3216d8[_0x395f8e(0xff)][_0x395f8e(0x12e)](_0x19bcee,{'force':_0x1e38fe})),_0x253f24=_0x55c45b[_0x395f8e(0xd5)]['agents'][_0x395f8e(0x11b)]>0x0||_0x55c45b['counts'][_0x395f8e(0xf8)]['errors']>0x0||_0x55c45b[_0x395f8e(0xd5)][_0x395f8e(0x16a)][_0x395f8e(0x11b)]>0x0||_0x55c45b[_0x395f8e(0xd5)][_0x395f8e(0xb0)][_0x395f8e(0x11b)]>0x0;if(_0x253f24){console[_0x395f8e(0xb4)](a4_0x2b303b[_0x395f8e(0x13a)](_0x395f8e(0xcc))),console[_0x395f8e(0xb4)](),console[_0x395f8e(0xb4)](a4_0x2b303b[_0x395f8e(0xfc)](_0x395f8e(0x115)));for(const _0x2d218b of _0x55c45b[_0x395f8e(0x10a)]){_0x2d218b[_0x395f8e(0xe3)]==='error'&&console['log'](a4_0x2b303b[_0x395f8e(0xfc)](_0x395f8e(0x140)+_0x2d218b['agentName']+_0x395f8e(0x11e)+_0x2d218b[_0x395f8e(0xbb)]));}for(const _0x3da534 of _0x55c45b[_0x395f8e(0xf8)]){_0x3da534[_0x395f8e(0xe3)]===_0x395f8e(0xbb)&&console[_0x395f8e(0xb4)](a4_0x2b303b[_0x395f8e(0xfc)](_0x395f8e(0x134)+_0x3da534['name']+_0x395f8e(0x11e)+_0x3da534[_0x395f8e(0xbb)]));}for(const _0x2783a2 of _0x55c45b[_0x395f8e(0x16a)]){_0x2783a2[_0x395f8e(0xe3)]===_0x395f8e(0xbb)&&console[_0x395f8e(0xb4)](a4_0x2b303b[_0x395f8e(0xfc)](_0x395f8e(0xd6)+_0x2783a2[_0x395f8e(0x165)]+_0x395f8e(0x11e)+_0x2783a2[_0x395f8e(0xbb)]));}for(const _0xf9e442 of _0x55c45b[_0x395f8e(0xb0)]){_0xf9e442['action']==='error'&&console['log'](a4_0x2b303b[_0x395f8e(0xfc)](_0x395f8e(0xe4)+_0xf9e442[_0x395f8e(0x165)]+'\x22:\x20'+_0xf9e442[_0x395f8e(0xbb)]));}for(const _0x2cf2c3 of _0x55c45b['integrations']){_0x2cf2c3[_0x395f8e(0xe3)]===_0x395f8e(0xbb)&&console[_0x395f8e(0xb4)](a4_0x2b303b[_0x395f8e(0xfc)](_0x395f8e(0xfd)+_0x2cf2c3['name']+_0x395f8e(0x11e)+_0x2cf2c3[_0x395f8e(0xbb)]));}return 0x1;}console[_0x395f8e(0xb4)](a4_0x2b303b[_0x395f8e(0xc7)](_0x395f8e(0x153)+(_0x4f8897+_0x154138)+_0x395f8e(0xda)+_0x55c45b[_0x395f8e(0x114)]+'\x27'));const _0x408d50=getLLMProjectUrl(_0x391e49,_0x55c45b[_0x395f8e(0xed)]);return console['log'](_0x395f8e(0xf7)+a4_0x2b303b[_0x395f8e(0xf6)](_0x408d50)),0x0;}}
1
+ const a4_0x468322=a4_0x4f28;(function(_0x41f446,_0x5c5771){const _0x595e90=a4_0x4f28,_0x13a419=_0x41f446();while(!![]){try{const _0x4d5503=parseInt(_0x595e90(0x1eb))/0x1*(-parseInt(_0x595e90(0x1a9))/0x2)+-parseInt(_0x595e90(0x19c))/0x3*(-parseInt(_0x595e90(0x1cc))/0x4)+parseInt(_0x595e90(0x236))/0x5+parseInt(_0x595e90(0x234))/0x6*(-parseInt(_0x595e90(0x1e0))/0x7)+-parseInt(_0x595e90(0x204))/0x8+-parseInt(_0x595e90(0x22c))/0x9+parseInt(_0x595e90(0x1c5))/0xa*(parseInt(_0x595e90(0x1ff))/0xb);if(_0x4d5503===_0x5c5771)break;else _0x13a419['push'](_0x13a419['shift']());}catch(_0x1b148d){_0x13a419['push'](_0x13a419['shift']());}}}(a4_0x4e19,0x5a5ba));import a4_0x47f33c from'chalk';import a4_0x1a16d8 from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';function a4_0x4f28(_0x49d73f,_0x22f73e){_0x49d73f=_0x49d73f-0x179;const _0x4e19d8=a4_0x4e19();let _0x4f2875=_0x4e19d8[_0x49d73f];return _0x4f2875;}import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext,resolveAgentPullArgs}from'../sdk/agent/agent-config.js';function a4_0x4e19(){const _0x354204=['Cannot\x20clone\x20from\x20context\x20project\x20\x22','✔\x20Context\x20set:\x20','Agent\x20','\x0aChanges:','Summary:','agent','prompts','\x20changed','cwd-config','\x0aPull\x20summary\x20for\x20\x27','\x0aError:','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','Would\x20pull\x20agent:\x20','Output\x20path:\x20','cyan','found','outputPath','Agent\x20pulled\x20successfully','\x20|\x20','execute','projectId','2692017JpsHNH','Cancelled','\x0aProject\x20pushed\x20with\x20errors','hasChanges','MISSING_ARGUMENT','action','\x20\x20Target:\x20','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','37626OxaOwH','Pushing\x20to\x20project...','1838410UIFLPA','yes','cloneProject','knowledgeBases','agentId','\x20\x20Integration\x20\x22','Pulling\x20agent\x20\x22','push','New\x20project\x20name\x20is\x20required','profile','\x20\x20Experimental\x20Artifacts:\x20','Agent:\x20','\x0aChanges\x20to\x20prompt\x20\x27','\x27\x20to\x20create\x20the\x20folder\x20structure.','Source:\x20','New\x20project:\x20','\x20\x20Agent\x20\x22','name','\x20=\x20','<new-name>','agents','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','\x20\x20Knowledge\x20Bases:\x20','parse','\x22...','\x20\x20Knowledge\x20Base\x20\x22','projectName','llmProject','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','\x0a✔\x20Pushed\x20','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','outputDir','Errors:','isNew','\x20files?','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','site','18aIJyYj','\x0a✔\x20Pulled\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\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','agent:clone','\x20errors','diff','llm_project','Chat:\x20','\x20files\x20to\x20','pullAgent','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','-\x20nothing\x20pushed','4GmsZbW','New\x20project\x20ID:\x20','Using\x20project\x20from\x20','No\x20tdx.json\x20found\x20in\x20','\x20unchanged','yellow','\x20\x20Prompts:\x20','\x20successfully','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)','log','\x0aChanges\x20to\x20agent\x20\x27','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','\x20--profile\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Status:\x20','integrations','\x22\x20to\x20new\x20project\x20\x22','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','reason','\x20\x20Text\x20Knowledge\x20Bases:\x20','created','\x20\x20Agents:\x20','\x20\x20Integrations:\x20','Analyzing\x20project\x20\x22','experimentalKnowledgeBases','INVALID_ARGUMENT','textKnowledgeBases','20krFcmY','\x20\x20Prompt\x20\x22','Project\x20cloned\x20successfully','\x20\x20Text\x20Knowledge\x20Base\x20\x22','arg-dir','red','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','148848hXwyRQ','unchanged','description','\x22:\x20','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','Using\x20local\x20project:\x20','counts','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','\x20\x20tdx\x20agent\x20pull\x20','gray','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','\x20created','agentName','updated','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','Failed\x20to\x20push\x20agent:\x20','green','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','dryRun','Project:\x20','665IgWDqi','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','error','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','Clone\x20\x22','cwd','Using\x20project:\x20','Dry\x20run\x20-\x20no\x20files\x20written','Would\x20clone:','\x22\x20from\x20project\x20\x22','\x0aWrite\x20','310809LjrfeG','force','pushProject','tdx.json','source','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','dim','agent.yml','join','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','dirname','errors','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory','\x20\x20Source:\x20','new','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','\x0aPush\x20summary\x20for\x20\x27','pullProject','\x20new','10642610HzkNmf','total','repeat','Using\x20current\x20project:\x20','agent:pull','5115136gqCYAE','no_context','Project\x20cloned\x20with\x20errors','Would\x20push\x20agent:\x20','experimentalArtifacts','\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','sourceProjectName','\x0aChanges\x20to\x20integration\x20\x27','-\x20no\x20files\x20written','llm','newProjectId','output','\x22\x20to\x20\x22','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','Using\x20project\x20from\x20context:\x20','Using\x20context\x20project:\x20','agent:push','session','\x20\x20tdx\x20agent\x20clone\x20agents/'];a4_0x4e19=function(){return _0x354204;};return a4_0x4e19();}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(_0x5b7f57){const _0x134a11=a4_0x4f28,_0x339dc6=[];if(_0x5b7f57['total']!==undefined)_0x339dc6[_0x134a11(0x17e)](_0x5b7f57['total']+'\x20total');if(_0x5b7f57[_0x134a11(0x1f9)]!==undefined&&_0x5b7f57['new']>0x0)_0x339dc6['push'](a4_0x47f33c['green'](_0x5b7f57[_0x134a11(0x1f9)]+_0x134a11(0x1fe)));if(_0x5b7f57[_0x134a11(0x1be)]!==undefined&&_0x5b7f57[_0x134a11(0x1be)]>0x0)_0x339dc6[_0x134a11(0x17e)](a4_0x47f33c['green'](_0x5b7f57[_0x134a11(0x1be)]+_0x134a11(0x1d7)));if(_0x5b7f57[_0x134a11(0x1d9)]!==undefined&&_0x5b7f57[_0x134a11(0x1d9)]>0x0)_0x339dc6[_0x134a11(0x17e)](a4_0x47f33c[_0x134a11(0x1ae)](_0x5b7f57[_0x134a11(0x1d9)]+'\x20updated'));if(_0x5b7f57['unchanged']!==undefined&&_0x5b7f57[_0x134a11(0x1cd)]>0x0)_0x339dc6[_0x134a11(0x17e)](a4_0x47f33c[_0x134a11(0x1d5)](_0x5b7f57[_0x134a11(0x1cd)]+_0x134a11(0x1ad)));if(_0x5b7f57[_0x134a11(0x1f6)]!==undefined&&_0x5b7f57[_0x134a11(0x1f6)]>0x0)_0x339dc6['push'](a4_0x47f33c[_0x134a11(0x1ca)](_0x5b7f57[_0x134a11(0x1f6)]+_0x134a11(0x1a1)));return _0x339dc6[_0x134a11(0x1f3)](',\x20');}function displayDiffs(_0x49cb71,_0x1c927e,_0x8a992,_0x68265d,_0x4fae26,_0x3e90c0,_0x5ea0d9){const _0x3d036f=a4_0x4f28;for(const _0x5a4b9b of _0x49cb71){if(_0x5a4b9b[_0x3d036f(0x1a2)]){const _0x1be630=_0x5a4b9b['agentName']||_0x5a4b9b[_0x3d036f(0x188)];console[_0x3d036f(0x1b2)](_0x3d036f(0x1b3)+_0x1be630+'\x27:'),console[_0x3d036f(0x1b2)]('─'[_0x3d036f(0x201)](0x3c)),console['log'](_0x5a4b9b[_0x3d036f(0x1a2)]),console['log']('─'['repeat'](0x3c));}}for(const _0x36bafa of _0x1c927e){_0x36bafa['diff']&&(console[_0x3d036f(0x1b2)](_0x3d036f(0x193)+_0x36bafa[_0x3d036f(0x188)]+'\x27:'),console['log']('─'[_0x3d036f(0x201)](0x3c)),console[_0x3d036f(0x1b2)](_0x36bafa[_0x3d036f(0x1a2)]),console['log']('─'[_0x3d036f(0x201)](0x3c)));}for(const _0x246289 of _0x8a992){_0x246289[_0x3d036f(0x1a2)]&&(console['log'](_0x3d036f(0x1f4)+_0x246289[_0x3d036f(0x188)]+'\x27:'),console['log']('─'[_0x3d036f(0x201)](0x3c)),console[_0x3d036f(0x1b2)](_0x246289[_0x3d036f(0x1a2)]),console[_0x3d036f(0x1b2)]('─'['repeat'](0x3c)));}for(const _0x185b9e of _0x68265d){_0x185b9e['diff']&&(console[_0x3d036f(0x1b2)](_0x3d036f(0x183)+_0x185b9e[_0x3d036f(0x188)]+'\x27:'),console[_0x3d036f(0x1b2)]('─'['repeat'](0x3c)),console[_0x3d036f(0x1b2)](_0x185b9e['diff']),console[_0x3d036f(0x1b2)]('─'[_0x3d036f(0x201)](0x3c)));}for(const _0x3e2d16 of _0x4fae26){_0x3e2d16[_0x3d036f(0x1a2)]&&(console['log'](_0x3d036f(0x20b)+_0x3e2d16['name']+'\x27:'),console[_0x3d036f(0x1b2)]('─'[_0x3d036f(0x201)](0x3c)),console[_0x3d036f(0x1b2)](_0x3e2d16[_0x3d036f(0x1a2)]),console[_0x3d036f(0x1b2)]('─'[_0x3d036f(0x201)](0x3c)));}for(const _0x23494f of _0x3e90c0){_0x23494f[_0x3d036f(0x1a2)]&&(console[_0x3d036f(0x1b2)](_0x3d036f(0x195)+_0x23494f['name']+'\x27:'),console['log']('─'[_0x3d036f(0x201)](0x3c)),console[_0x3d036f(0x1b2)](_0x23494f['diff']),console[_0x3d036f(0x1b2)]('─'[_0x3d036f(0x201)](0x3c)));}for(const _0x1c3146 of _0x5ea0d9){_0x1c3146[_0x3d036f(0x1a2)]&&(console[_0x3d036f(0x1b2)]('\x0aChanges\x20to\x20experimental\x20artifact\x20\x27'+_0x1c3146['name']+'\x27:'),console[_0x3d036f(0x1b2)]('─'['repeat'](0x3c)),console[_0x3d036f(0x1b2)](_0x1c3146[_0x3d036f(0x1a2)]),console['log']('─'['repeat'](0x3c)));}}export class AgentPullCommand extends BaseCommand{['name']=a4_0x468322(0x203);[a4_0x468322(0x1ce)]=a4_0x468322(0x1cb);async['execute'](_0x4c3f01){const _0x33ec46=a4_0x468322,{options:_0x3801cf,args:_0x23cf12,tdx:_0x15b246}=_0x4c3f01,_0x542ce5=_0x23cf12[0x0],_0x25660e=_0x23cf12[0x1],_0x30b30c=_0x3801cf[_0x33ec46(0x20f)],_0x1f7461=_0x3801cf[_0x33ec46(0x1de)],_0x408db7=_0x3801cf[_0x33ec46(0x1ec)],_0x493ac1=_0x3801cf[_0x33ec46(0x237)],_0xb4cd9f=_0x3801cf['llmProject'],_0x38dffd=_0x3801cf[_0x33ec46(0x21c)];let _0x30151f;if(_0x542ce5){const _0x314578=a4_0x1a16d8[_0x33ec46(0x1f3)](_0x542ce5,'tdx.json');if(existsSync(_0x314578))try{const _0x2b4878=JSON['parse'](readFileSync(_0x314578,'utf-8'));_0x2b4878[_0x33ec46(0x1a3)]&&(_0x30151f={'llm_project':_0x2b4878[_0x33ec46(0x1a3)]});}catch{}}const _0x19120b=findAgentConfigPath(process[_0x33ec46(0x1e5)]());let _0x26a01a;if(_0x19120b)try{const _0x3aca7f=JSON[_0x33ec46(0x18e)](readFileSync(_0x19120b,'utf-8'));_0x3aca7f[_0x33ec46(0x1a3)]&&(_0x26a01a={'llm_project':_0x3aca7f['llm_project']});}catch{}const _0xf78d9c=resolveAgentPullArgs({'arg':_0x542ce5,'agentNameArg':_0x25660e,'agentFlag':_0x38dffd,'contextProject':_0xb4cd9f,'argDirConfig':_0x30151f,'cwdConfigPath':_0x19120b||undefined,'cwdConfig':_0x26a01a}),{projectNameOrId:_0x434f84,targetAgentName:_0x68dcae,existingOutputDir:_0x39e48c,source:_0x2687fa}=_0xf78d9c;if(_0x2687fa===_0x33ec46(0x1c9))console[_0x33ec46(0x1b2)](a4_0x47f33c[_0x33ec46(0x1f1)](_0x33ec46(0x1ab)+a4_0x1a16d8[_0x33ec46(0x1f3)](_0x542ce5,_0x33ec46(0x1ee))+':\x20'+_0x434f84));else{if(_0x2687fa===_0x33ec46(0x21f))console[_0x33ec46(0x1b2)](a4_0x47f33c[_0x33ec46(0x1f1)]('Using\x20project:\x20'+_0x434f84));else _0x2687fa==='context'&&console['log'](a4_0x47f33c['dim'](_0x33ec46(0x212)+_0x434f84));}if(!_0x434f84)return _0x38dffd?(console[_0x33ec46(0x1b2)](a4_0x47f33c[_0x33ec46(0x1ae)](_0x33ec46(0x1fa))),console[_0x33ec46(0x1b2)](_0x33ec46(0x19a)),console[_0x33ec46(0x1b2)](_0x33ec46(0x1d0))):(console[_0x33ec46(0x1b2)](a4_0x47f33c['yellow'](_0x33ec46(0x1d3))),console[_0x33ec46(0x1b2)](_0x33ec46(0x1b1)),console[_0x33ec46(0x1b2)](_0x33ec46(0x209)),console[_0x33ec46(0x1b2)](_0x33ec46(0x1f7)),console[_0x33ec46(0x1b2)](_0x33ec46(0x19f)),console[_0x33ec46(0x1b2)]('\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')),0x1;if(_0x68dcae){const {data:_0x265a84}=await withSpinner(_0x33ec46(0x17d)+_0x68dcae+_0x33ec46(0x1e9)+_0x434f84+_0x33ec46(0x18f),()=>_0x15b246[_0x33ec46(0x20d)][_0x33ec46(0x1a6)](_0x434f84,_0x68dcae,_0x30b30c,{'dryRun':_0x1f7461,'force':_0x408db7}));if(_0x1f7461)return console[_0x33ec46(0x1b2)](a4_0x47f33c['yellow'](_0x33ec46(0x1e7))),console[_0x33ec46(0x1b2)](_0x33ec46(0x223)+_0x265a84[_0x33ec46(0x1d8)]),console[_0x33ec46(0x1b2)](_0x33ec46(0x224)+_0x265a84[_0x33ec46(0x227)]),_0x265a84[_0x33ec46(0x1a2)]&&(console[_0x33ec46(0x1b2)](_0x33ec46(0x21a)),console['log']('─'['repeat'](0x3c)),console[_0x33ec46(0x1b2)](_0x265a84[_0x33ec46(0x1a2)]),console[_0x33ec46(0x1b2)]('─'[_0x33ec46(0x201)](0x3c))),0x0;return console[_0x33ec46(0x1b2)](a4_0x47f33c[_0x33ec46(0x1dc)](_0x33ec46(0x228))),console[_0x33ec46(0x1b2)](_0x33ec46(0x182)+_0x265a84[_0x33ec46(0x1d8)]),console[_0x33ec46(0x1b2)]('Output:\x20'+_0x265a84[_0x33ec46(0x227)]),console['log'](_0x33ec46(0x1b8)+(_0x265a84[_0x33ec46(0x198)]?a4_0x47f33c['green'](_0x33ec46(0x1f9)):_0x265a84[_0x33ec46(0x22f)]?a4_0x47f33c[_0x33ec46(0x1ae)](_0x33ec46(0x1d9)):a4_0x47f33c[_0x33ec46(0x1d5)](_0x33ec46(0x1cd)))),0x0;}const _0x3e8db9=_0x39e48c||_0x30b30c,{data:_0x25e8b1}=await withSpinner(_0x33ec46(0x1c1)+_0x434f84+'\x22...',()=>_0x15b246[_0x33ec46(0x20d)][_0x33ec46(0x1fd)](_0x434f84,_0x3e8db9,{'dryRun':!![]})),_0x2807a9=_0x25e8b1[_0x33ec46(0x1d2)][_0x33ec46(0x18b)]['new']+_0x25e8b1['counts']['knowledgeBases'][_0x33ec46(0x1f9)]+_0x25e8b1[_0x33ec46(0x1d2)][_0x33ec46(0x1c4)][_0x33ec46(0x1f9)]+_0x25e8b1['counts'][_0x33ec46(0x21d)]['new']+_0x25e8b1[_0x33ec46(0x1d2)][_0x33ec46(0x1b9)][_0x33ec46(0x1f9)]+_0x25e8b1['counts'][_0x33ec46(0x1c2)][_0x33ec46(0x1f9)]+_0x25e8b1[_0x33ec46(0x1d2)][_0x33ec46(0x208)][_0x33ec46(0x1f9)],_0xbc69ef=_0x25e8b1[_0x33ec46(0x1d2)][_0x33ec46(0x18b)]['updated']+_0x25e8b1['counts'][_0x33ec46(0x17a)]['updated']+_0x25e8b1[_0x33ec46(0x1d2)]['textKnowledgeBases'][_0x33ec46(0x1d9)]+_0x25e8b1[_0x33ec46(0x1d2)]['prompts'][_0x33ec46(0x1d9)]+_0x25e8b1[_0x33ec46(0x1d2)]['integrations']['updated']+_0x25e8b1[_0x33ec46(0x1d2)][_0x33ec46(0x1c2)][_0x33ec46(0x1d9)]+_0x25e8b1[_0x33ec46(0x1d2)]['experimentalArtifacts'][_0x33ec46(0x1d9)],_0x1428b4=_0x25e8b1['counts'][_0x33ec46(0x18b)]['unchanged']+_0x25e8b1[_0x33ec46(0x1d2)][_0x33ec46(0x17a)][_0x33ec46(0x1cd)]+_0x25e8b1['counts']['textKnowledgeBases'][_0x33ec46(0x1cd)]+_0x25e8b1[_0x33ec46(0x1d2)]['prompts'][_0x33ec46(0x1cd)]+_0x25e8b1['counts']['integrations'][_0x33ec46(0x1cd)]+_0x25e8b1[_0x33ec46(0x1d2)][_0x33ec46(0x1c2)]['unchanged']+_0x25e8b1[_0x33ec46(0x1d2)]['experimentalArtifacts'][_0x33ec46(0x1cd)];console[_0x33ec46(0x1b2)](_0x33ec46(0x220)+_0x25e8b1[_0x33ec46(0x191)]+'\x27:'),console[_0x33ec46(0x1b2)]('\x20\x20'+a4_0x47f33c[_0x33ec46(0x1dc)]('+\x20'+_0x2807a9+_0x33ec46(0x1fe))+_0x33ec46(0x229)+a4_0x47f33c[_0x33ec46(0x1ae)]('~\x20'+_0xbc69ef+_0x33ec46(0x21e))+_0x33ec46(0x229)+a4_0x47f33c[_0x33ec46(0x1f1)]('=\x20'+_0x1428b4+'\x20unchanged')),console[_0x33ec46(0x1b2)](_0x33ec46(0x1bf)+formatCountSummary(_0x25e8b1[_0x33ec46(0x1d2)]['agents'])),console[_0x33ec46(0x1b2)](_0x33ec46(0x18d)+formatCountSummary(_0x25e8b1[_0x33ec46(0x1d2)][_0x33ec46(0x17a)])),console[_0x33ec46(0x1b2)](_0x33ec46(0x1bd)+formatCountSummary(_0x25e8b1['counts']['textKnowledgeBases'])),console[_0x33ec46(0x1b2)](_0x33ec46(0x1af)+formatCountSummary(_0x25e8b1[_0x33ec46(0x1d2)]['prompts'])),console[_0x33ec46(0x1b2)](_0x33ec46(0x1c0)+formatCountSummary(_0x25e8b1[_0x33ec46(0x1d2)][_0x33ec46(0x1b9)]));const _0x409888=_0x25e8b1[_0x33ec46(0x1d2)][_0x33ec46(0x1c2)][_0x33ec46(0x200)]>0x0||_0x25e8b1[_0x33ec46(0x1d2)][_0x33ec46(0x208)][_0x33ec46(0x200)]>0x0;_0x409888&&(console[_0x33ec46(0x1b2)](_0x33ec46(0x222)+formatCountSummary(_0x25e8b1['counts'][_0x33ec46(0x1c2)])),console['log'](_0x33ec46(0x181)+formatCountSummary(_0x25e8b1[_0x33ec46(0x1d2)][_0x33ec46(0x208)])));console[_0x33ec46(0x1b2)](_0x33ec46(0x232)+a4_0x47f33c[_0x33ec46(0x225)](_0x25e8b1[_0x33ec46(0x196)])),displayDiffs(_0x25e8b1[_0x33ec46(0x18b)],_0x25e8b1[_0x33ec46(0x17a)],_0x25e8b1['textKnowledgeBases'],_0x25e8b1['prompts'],_0x25e8b1[_0x33ec46(0x1b9)],_0x25e8b1['experimentalKnowledgeBases'],_0x25e8b1[_0x33ec46(0x208)]);if(_0x1f7461)return console[_0x33ec46(0x1b2)](a4_0x47f33c[_0x33ec46(0x1ae)](_0x33ec46(0x1a7))),0x0;if(_0x2807a9===0x0&&_0xbc69ef===0x0)return console[_0x33ec46(0x1b2)](a4_0x47f33c[_0x33ec46(0x1dc)](_0x33ec46(0x233))),saveSessionContext({'llm_project':_0x25e8b1['projectName']},_0x3801cf[_0x33ec46(0x215)]),console[_0x33ec46(0x1b2)](a4_0x47f33c['green']('✔\x20Context\x20set:\x20'+a4_0x47f33c['dim'](_0x33ec46(0x1a3))+'\x20=\x20'+a4_0x47f33c[_0x33ec46(0x225)](_0x25e8b1['projectName']))),0x0;if(!_0x493ac1&&!_0x408db7){if(!isInteractive())return console['error'](a4_0x47f33c[_0x33ec46(0x1ca)]('\x0aError:'),_0x33ec46(0x19e)),console[_0x33ec46(0x1e2)](a4_0x47f33c[_0x33ec46(0x1f1)](_0x33ec46(0x1b7))),0x1;const _0x1d074e=await confirmKey(_0x33ec46(0x1ea)+(_0x2807a9+_0xbc69ef)+_0x33ec46(0x199));if(!_0x1d074e)return console[_0x33ec46(0x1b2)](a4_0x47f33c[_0x33ec46(0x1ae)](_0x33ec46(0x22d)),_0x33ec46(0x20c)),0x1;}const {data:_0x36cef7}=await withSpinner('Writing\x20files...',()=>_0x15b246['llm'][_0x33ec46(0x1fd)](_0x434f84,_0x3e8db9,{'force':_0x408db7}));return console[_0x33ec46(0x1b2)](a4_0x47f33c[_0x33ec46(0x1dc)](_0x33ec46(0x19d)+(_0x2807a9+_0xbc69ef)+_0x33ec46(0x1a5)+_0x36cef7[_0x33ec46(0x196)])),saveSessionContext({'llm_project':_0x36cef7[_0x33ec46(0x191)]},_0x3801cf[_0x33ec46(0x215)]),console[_0x33ec46(0x1b2)](a4_0x47f33c[_0x33ec46(0x1dc)](_0x33ec46(0x218)+a4_0x47f33c[_0x33ec46(0x1f1)](_0x33ec46(0x1a3))+_0x33ec46(0x189)+a4_0x47f33c[_0x33ec46(0x225)](_0x36cef7[_0x33ec46(0x191)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{['name']=a4_0x468322(0x1a0);[a4_0x468322(0x1ce)]=a4_0x468322(0x1e1);async[a4_0x468322(0x22a)](_0x3b24c9){const _0x3d012a=a4_0x468322,{options:_0x10b17d,args:_0x1f9fb0,tdx:_0x302bdb}=_0x3b24c9,_0x2e9765=_0x1f9fb0[0x0],_0x50ca4f=_0x10b17d[_0x3d012a(0x188)],_0x1dc194=_0x10b17d[_0x3d012a(0x1de)],_0x1e464c=_0x10b17d[_0x3d012a(0x237)],_0x332e3a=_0x10b17d[_0x3d012a(0x19b)],_0xf6bbb2=_0x10b17d[_0x3d012a(0x192)];let _0x54a641;const _0x77c670=findAgentConfigPath(process[_0x3d012a(0x1e5)]());if(_0x2e9765){const _0xe3b4d5=a4_0x1a16d8[_0x3d012a(0x1f3)](_0x2e9765,_0x3d012a(0x1ee));existsSync(_0xe3b4d5)?(_0x54a641=_0x2e9765,console[_0x3d012a(0x1b2)](a4_0x47f33c[_0x3d012a(0x1f1)]('Using\x20local\x20project:\x20'+_0x2e9765))):_0x54a641=_0x2e9765;}else{if(_0x77c670)_0x54a641=a4_0x1a16d8[_0x3d012a(0x1f5)](_0x77c670),console[_0x3d012a(0x1b2)](a4_0x47f33c['dim'](_0x3d012a(0x202)+_0x54a641));else{if(_0xf6bbb2){const _0xdab222=sanitizeForFilesystem(_0xf6bbb2);let _0x28033e=_0xdab222,_0x16e7dd=a4_0x1a16d8['join'](process['cwd'](),_0x3d012a(0x18b),_0xdab222,_0x3d012a(0x1ee));if(!existsSync(_0x16e7dd)){const _0x180265=normalizeName(_0xf6bbb2),_0x231e58=a4_0x1a16d8[_0x3d012a(0x1f3)](process[_0x3d012a(0x1e5)](),_0x3d012a(0x18b),_0x180265,_0x3d012a(0x1ee));existsSync(_0x231e58)&&(_0x28033e=_0x180265,_0x16e7dd=_0x231e58);}if(existsSync(_0x16e7dd))_0x54a641=a4_0x1a16d8[_0x3d012a(0x1f5)](_0x16e7dd),console['log'](a4_0x47f33c['dim'](_0x3d012a(0x1d1)+_0x54a641));else{const _0x284357=_0x10b17d[_0x3d012a(0x180)];if(_0x284357)throw new SDKError(ErrorCode[_0x3d012a(0x1c3)],_0x3d012a(0x217)+_0xf6bbb2+'\x22\x20to\x20a\x20different\x20profile',undefined,{'helpText':_0x3d012a(0x1bb)+_0x3d012a(0x1d6)+(_0x3d012a(0x1d4)+_0xf6bbb2+'\x0a')+(_0x3d012a(0x216)+_0x28033e+'\x20--name\x20'+(_0x50ca4f||_0x3d012a(0x18a))+_0x3d012a(0x1b6)+_0x284357)});_0x54a641=_0xf6bbb2,console[_0x3d012a(0x1b2)](a4_0x47f33c[_0x3d012a(0x1f1)](_0x3d012a(0x213)+_0xf6bbb2));}}}}if(!_0x54a641)return console['log'](a4_0x47f33c[_0x3d012a(0x1ae)]('No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a')),console[_0x3d012a(0x1b2)]('\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project'),console[_0x3d012a(0x1b2)](_0x3d012a(0x1da)),console['log']('\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['log'](_0x3d012a(0x1dd)),0x1;if(!_0x50ca4f)throw new SDKError(ErrorCode[_0x3d012a(0x230)],_0x3d012a(0x17f),undefined,{'helpText':_0x3d012a(0x1b4)});if(!_0x1e464c&&!_0x1dc194){if(!isInteractive())return console[_0x3d012a(0x1e2)](a4_0x47f33c['red'](_0x3d012a(0x221)),_0x3d012a(0x19e)),console['error'](a4_0x47f33c[_0x3d012a(0x1f1)](_0x3d012a(0x1b7))),0x1;const _0x374066=await confirmKey(_0x3d012a(0x1e4)+_0x54a641+_0x3d012a(0x1ba)+_0x50ca4f+'\x22?');if(!_0x374066)return console[_0x3d012a(0x1b2)](a4_0x47f33c['yellow'](_0x3d012a(0x22d))),0x1;}const {data:_0x5b7cf2}=await withSpinner('Cloning\x20\x22'+_0x54a641+_0x3d012a(0x210)+_0x50ca4f+'\x22...',()=>_0x302bdb[_0x3d012a(0x20d)][_0x3d012a(0x179)](_0x54a641,_0x50ca4f,{'dryRun':_0x1dc194}));if(_0x1dc194){console['log'](a4_0x47f33c[_0x3d012a(0x1ae)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x3d012a(0x1b2)](_0x3d012a(0x185)+_0x5b7cf2[_0x3d012a(0x20a)]),console[_0x3d012a(0x1b2)](_0x3d012a(0x186)+_0x50ca4f),console[_0x3d012a(0x1b2)](_0x3d012a(0x1e8)),console['log'](_0x3d012a(0x1bf)+_0x5b7cf2[_0x3d012a(0x1d2)][_0x3d012a(0x18b)][_0x3d012a(0x1be)]),console['log'](_0x3d012a(0x18d)+_0x5b7cf2['counts'][_0x3d012a(0x17a)][_0x3d012a(0x1be)]),console[_0x3d012a(0x1b2)](_0x3d012a(0x1af)+_0x5b7cf2[_0x3d012a(0x1d2)][_0x3d012a(0x21d)][_0x3d012a(0x1be)]);const _0x44f455=_0x5b7cf2[_0x3d012a(0x1d2)][_0x3d012a(0x1c2)][_0x3d012a(0x1be)]>0x0||_0x5b7cf2[_0x3d012a(0x1d2)]['experimentalArtifacts'][_0x3d012a(0x1be)]>0x0;return _0x44f455&&(console['log'](_0x3d012a(0x222)+_0x5b7cf2['counts']['experimentalKnowledgeBases'][_0x3d012a(0x1be)]),console[_0x3d012a(0x1b2)](_0x3d012a(0x181)+_0x5b7cf2[_0x3d012a(0x1d2)][_0x3d012a(0x208)][_0x3d012a(0x1be)])),0x0;}const _0x471128=_0x5b7cf2[_0x3d012a(0x1d2)][_0x3d012a(0x18b)]['errors']>0x0||_0x5b7cf2[_0x3d012a(0x1d2)][_0x3d012a(0x17a)][_0x3d012a(0x1f6)]>0x0||_0x5b7cf2[_0x3d012a(0x1d2)][_0x3d012a(0x21d)][_0x3d012a(0x1f6)]>0x0||_0x5b7cf2['counts'][_0x3d012a(0x1c2)][_0x3d012a(0x1f6)]>0x0||_0x5b7cf2['counts'][_0x3d012a(0x208)][_0x3d012a(0x1f6)]>0x0;_0x471128?console[_0x3d012a(0x1b2)](a4_0x47f33c[_0x3d012a(0x1ae)](_0x3d012a(0x206))):console['log'](a4_0x47f33c[_0x3d012a(0x1dc)](_0x3d012a(0x1c7)));console[_0x3d012a(0x1b2)](_0x3d012a(0x185)+_0x5b7cf2[_0x3d012a(0x20a)]),console[_0x3d012a(0x1b2)](_0x3d012a(0x186)+_0x5b7cf2['newProjectName']),console[_0x3d012a(0x1b2)](_0x3d012a(0x1aa)+_0x5b7cf2[_0x3d012a(0x20e)]),console['log'](),console[_0x3d012a(0x1b2)](_0x3d012a(0x21b)),console[_0x3d012a(0x1b2)]('\x20\x20Agents:\x20'+formatCountSummary(_0x5b7cf2[_0x3d012a(0x1d2)][_0x3d012a(0x18b)])),console['log'](_0x3d012a(0x18d)+formatCountSummary(_0x5b7cf2['counts']['knowledgeBases'])),console[_0x3d012a(0x1b2)](_0x3d012a(0x1af)+formatCountSummary(_0x5b7cf2['counts']['prompts'])),console[_0x3d012a(0x1b2)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x5b7cf2['counts']['integrations']));const _0x5cb32f=_0x5b7cf2[_0x3d012a(0x1d2)]['experimentalKnowledgeBases'][_0x3d012a(0x1be)]>0x0||_0x5b7cf2['counts']['experimentalKnowledgeBases']['updated']>0x0||_0x5b7cf2[_0x3d012a(0x1d2)][_0x3d012a(0x1c2)][_0x3d012a(0x1cd)]>0x0||_0x5b7cf2['counts'][_0x3d012a(0x208)][_0x3d012a(0x1be)]>0x0||_0x5b7cf2[_0x3d012a(0x1d2)]['experimentalArtifacts'][_0x3d012a(0x1d9)]>0x0||_0x5b7cf2[_0x3d012a(0x1d2)][_0x3d012a(0x208)][_0x3d012a(0x1cd)]>0x0;_0x5cb32f&&(console['log'](_0x3d012a(0x222)+formatCountSummary(_0x5b7cf2['counts'][_0x3d012a(0x1c2)])),console['log'](_0x3d012a(0x181)+formatCountSummary(_0x5b7cf2['counts'][_0x3d012a(0x208)])));if(_0x471128){console['log'](),console[_0x3d012a(0x1b2)](a4_0x47f33c[_0x3d012a(0x1ca)](_0x3d012a(0x197)));for(const _0x20ee18 of _0x5b7cf2[_0x3d012a(0x18b)]){_0x20ee18[_0x3d012a(0x231)]===_0x3d012a(0x1e2)&&console['log'](a4_0x47f33c[_0x3d012a(0x1ca)](_0x3d012a(0x187)+_0x20ee18[_0x3d012a(0x1d8)]+_0x3d012a(0x1cf)+_0x20ee18[_0x3d012a(0x1e2)]));}for(const _0x190ffe of _0x5b7cf2['knowledgeBases']){_0x190ffe[_0x3d012a(0x231)]===_0x3d012a(0x1e2)&&console[_0x3d012a(0x1b2)](a4_0x47f33c[_0x3d012a(0x1ca)](_0x3d012a(0x190)+_0x190ffe[_0x3d012a(0x188)]+_0x3d012a(0x1cf)+_0x190ffe[_0x3d012a(0x1e2)]));}for(const _0x4a1fe0 of _0x5b7cf2['prompts']){_0x4a1fe0[_0x3d012a(0x231)]===_0x3d012a(0x1e2)&&console['log'](a4_0x47f33c[_0x3d012a(0x1ca)]('\x20\x20Prompt\x20\x22'+_0x4a1fe0['name']+_0x3d012a(0x1cf)+_0x4a1fe0[_0x3d012a(0x1e2)]));}for(const _0x541d15 of _0x5b7cf2[_0x3d012a(0x1b9)]){_0x541d15[_0x3d012a(0x231)]===_0x3d012a(0x1e2)&&console[_0x3d012a(0x1b2)](a4_0x47f33c[_0x3d012a(0x1ca)](_0x3d012a(0x17c)+_0x541d15['name']+_0x3d012a(0x1cf)+_0x541d15[_0x3d012a(0x1e2)]));}for(const _0x32a584 of _0x5b7cf2[_0x3d012a(0x1c2)]){_0x32a584['action']===_0x3d012a(0x1e2)&&console[_0x3d012a(0x1b2)](a4_0x47f33c[_0x3d012a(0x1ca)](_0x3d012a(0x211)+_0x32a584['name']+'\x22:\x20'+_0x32a584[_0x3d012a(0x1e2)]));}for(const _0x27545c of _0x5b7cf2[_0x3d012a(0x208)]){_0x27545c['action']===_0x3d012a(0x1e2)&&console[_0x3d012a(0x1b2)](a4_0x47f33c[_0x3d012a(0x1ca)]('\x20\x20Experimental\x20Artifact\x20\x22'+_0x27545c[_0x3d012a(0x188)]+'\x22:\x20'+_0x27545c[_0x3d012a(0x1e2)]));}return 0x1;}console[_0x3d012a(0x1b2)]();const _0x94a397=getLLMProjectUrl(_0x332e3a,_0x5b7cf2[_0x3d012a(0x20e)]);return console['log'](_0x3d012a(0x1df)+a4_0x47f33c[_0x3d012a(0x225)](_0x94a397)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x468322(0x188)]=a4_0x468322(0x214);[a4_0x468322(0x1ce)]=a4_0x468322(0x18c);async[a4_0x468322(0x22a)](_0xfc529c){const _0x4eed85=a4_0x468322,{options:_0x3d5c7b,args:_0x132866,tdx:_0x1a1f63}=_0xfc529c;let _0x4050ac=_0x132866[0x0]||process[_0x4eed85(0x1e5)]();const _0x1f8578=_0x3d5c7b[_0x4eed85(0x1de)],_0x284782=_0x3d5c7b[_0x4eed85(0x1ec)],_0x465cf2=_0x3d5c7b[_0x4eed85(0x237)],_0x2c76cb=_0x3d5c7b[_0x4eed85(0x19b)],_0x142a7b=a4_0x1a16d8[_0x4eed85(0x1f3)](_0x4050ac,_0x4eed85(0x1f2)),_0x3cfdc1=existsSync(_0x142a7b);if(_0x3cfdc1){const {data:_0x184926}=await withSpinner('Pushing\x20agent\x20from\x20\x22'+_0x4050ac+'\x22...',()=>_0x1a1f63['llm']['pushAgent'](_0x4050ac,{'dryRun':_0x1f8578,'force':_0x284782}));if(_0x1f8578)return console[_0x4eed85(0x1b2)](a4_0x47f33c[_0x4eed85(0x1ae)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x4eed85(0x1b2)](_0x4eed85(0x207)+_0x184926[_0x4eed85(0x1d8)]),0x0;if(_0x184926[_0x4eed85(0x231)]===_0x4eed85(0x1e2))return console['log'](a4_0x47f33c[_0x4eed85(0x1ca)](_0x4eed85(0x1db)+_0x184926[_0x4eed85(0x1e2)])),0x1;console['log'](a4_0x47f33c['green'](_0x4eed85(0x219)+_0x184926[_0x4eed85(0x231)]+_0x4eed85(0x1b0))),console['log'](_0x4eed85(0x182)+_0x184926[_0x4eed85(0x1d8)]);if(_0x184926[_0x4eed85(0x17b)]&&_0x184926[_0x4eed85(0x22b)]){const _0xa38a8=getLLMAgentChatUrl(_0x2c76cb,_0x184926[_0x4eed85(0x22b)],_0x184926['agentId']);console[_0x4eed85(0x1b2)](_0x4eed85(0x1a4)+a4_0x47f33c['cyan'](_0xa38a8));}return 0x0;}const _0x5beeda=_0x3d5c7b[_0x4eed85(0x192)],_0x26e0e9=resolveProjectFromContext(_0x4050ac,_0x5beeda);if(_0x26e0e9[_0x4eed85(0x226)])_0x4050ac=_0x26e0e9['projectDir'],_0x26e0e9[_0x4eed85(0x1ef)]==='context'&&console[_0x4eed85(0x1b2)](a4_0x47f33c[_0x4eed85(0x1f1)](_0x4eed85(0x1e6)+_0x4050ac));else{let _0x267214=_0x4eed85(0x1fb);_0x26e0e9[_0x4eed85(0x1bc)]==='no_local_folder'&&(_0x267214=_0x26e0e9['message']+_0x4eed85(0x1e3)+_0x26e0e9['llmProject']+_0x4eed85(0x184));throw new SDKError(ErrorCode[_0x4eed85(0x1c3)],_0x26e0e9[_0x4eed85(0x1bc)]===_0x4eed85(0x205)?_0x26e0e9['message']:_0x4eed85(0x1ac)+_0x4050ac,undefined,{'helpText':_0x267214});}const {data:_0x3e07a7}=await withSpinner('Analyzing\x20changes\x20to\x20push...',()=>_0x1a1f63['llm'][_0x4eed85(0x1ed)](_0x4050ac,{'dryRun':!![]})),_0x436ebe=_0x3e07a7['counts'][_0x4eed85(0x18b)]['errors']>0x0;if(_0x436ebe){console['log'](a4_0x47f33c[_0x4eed85(0x1ca)]('\x0aErrors\x20found:'));for(const _0x109032 of _0x3e07a7[_0x4eed85(0x18b)]){_0x109032[_0x4eed85(0x231)]===_0x4eed85(0x1e2)&&console[_0x4eed85(0x1b2)](a4_0x47f33c[_0x4eed85(0x1ca)](_0x4eed85(0x187)+_0x109032[_0x4eed85(0x1d8)]+_0x4eed85(0x1cf)+_0x109032[_0x4eed85(0x1e2)]));}return 0x1;}const _0x2cc85f=_0x3e07a7[_0x4eed85(0x1d2)][_0x4eed85(0x18b)]['created']+_0x3e07a7[_0x4eed85(0x1d2)][_0x4eed85(0x17a)]['created']+_0x3e07a7[_0x4eed85(0x1d2)][_0x4eed85(0x1c4)][_0x4eed85(0x1be)]+_0x3e07a7['counts']['prompts'][_0x4eed85(0x1be)]+_0x3e07a7[_0x4eed85(0x1d2)]['integrations'][_0x4eed85(0x1be)]+_0x3e07a7[_0x4eed85(0x1d2)][_0x4eed85(0x1c2)][_0x4eed85(0x1be)]+_0x3e07a7[_0x4eed85(0x1d2)][_0x4eed85(0x208)][_0x4eed85(0x1be)],_0x10b001=_0x3e07a7[_0x4eed85(0x1d2)][_0x4eed85(0x18b)][_0x4eed85(0x1d9)]+_0x3e07a7[_0x4eed85(0x1d2)][_0x4eed85(0x17a)][_0x4eed85(0x1d9)]+_0x3e07a7[_0x4eed85(0x1d2)][_0x4eed85(0x1c4)]['updated']+_0x3e07a7[_0x4eed85(0x1d2)][_0x4eed85(0x21d)][_0x4eed85(0x1d9)]+_0x3e07a7['counts'][_0x4eed85(0x1b9)][_0x4eed85(0x1d9)]+_0x3e07a7[_0x4eed85(0x1d2)][_0x4eed85(0x1c2)]['updated']+_0x3e07a7['counts'][_0x4eed85(0x208)][_0x4eed85(0x1d9)],_0x5d691d=_0x3e07a7['counts']['agents'][_0x4eed85(0x1cd)]+_0x3e07a7[_0x4eed85(0x1d2)]['knowledgeBases'][_0x4eed85(0x1cd)]+_0x3e07a7[_0x4eed85(0x1d2)][_0x4eed85(0x1c4)][_0x4eed85(0x1cd)]+_0x3e07a7[_0x4eed85(0x1d2)][_0x4eed85(0x21d)][_0x4eed85(0x1cd)]+_0x3e07a7['counts'][_0x4eed85(0x1b9)][_0x4eed85(0x1cd)]+_0x3e07a7[_0x4eed85(0x1d2)][_0x4eed85(0x1c2)][_0x4eed85(0x1cd)]+_0x3e07a7['counts']['experimentalArtifacts']['unchanged'];console['log'](_0x4eed85(0x1fc)+_0x3e07a7[_0x4eed85(0x191)]+'\x27:'),console[_0x4eed85(0x1b2)]('\x20\x20'+a4_0x47f33c[_0x4eed85(0x1dc)]('+\x20'+_0x2cc85f+_0x4eed85(0x1fe))+_0x4eed85(0x229)+a4_0x47f33c[_0x4eed85(0x1ae)]('~\x20'+_0x10b001+'\x20changed')+_0x4eed85(0x229)+a4_0x47f33c['dim']('=\x20'+_0x5d691d+_0x4eed85(0x1ad))),console[_0x4eed85(0x1b2)](_0x4eed85(0x1bf)+formatCountSummary(_0x3e07a7['counts'][_0x4eed85(0x18b)])),console[_0x4eed85(0x1b2)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x3e07a7[_0x4eed85(0x1d2)]['knowledgeBases'])),console[_0x4eed85(0x1b2)](_0x4eed85(0x1bd)+formatCountSummary(_0x3e07a7['counts'][_0x4eed85(0x1c4)])),console[_0x4eed85(0x1b2)](_0x4eed85(0x1af)+formatCountSummary(_0x3e07a7['counts']['prompts'])),console[_0x4eed85(0x1b2)](_0x4eed85(0x1c0)+formatCountSummary(_0x3e07a7[_0x4eed85(0x1d2)][_0x4eed85(0x1b9)]));const _0x32b001=_0x3e07a7['counts']['experimentalKnowledgeBases'][_0x4eed85(0x1be)]>0x0||_0x3e07a7['counts'][_0x4eed85(0x1c2)][_0x4eed85(0x1d9)]>0x0||_0x3e07a7[_0x4eed85(0x1d2)][_0x4eed85(0x1c2)][_0x4eed85(0x1cd)]>0x0||_0x3e07a7['counts'][_0x4eed85(0x208)][_0x4eed85(0x1be)]>0x0||_0x3e07a7['counts'][_0x4eed85(0x208)][_0x4eed85(0x1d9)]>0x0||_0x3e07a7['counts']['experimentalArtifacts']['unchanged']>0x0;_0x32b001&&(console['log'](_0x4eed85(0x222)+formatCountSummary(_0x3e07a7['counts'][_0x4eed85(0x1c2)])),console['log'](_0x4eed85(0x181)+formatCountSummary(_0x3e07a7[_0x4eed85(0x1d2)][_0x4eed85(0x208)])));console[_0x4eed85(0x1b2)](_0x4eed85(0x1f8)+a4_0x47f33c[_0x4eed85(0x225)](_0x4050ac)),displayDiffs(_0x3e07a7[_0x4eed85(0x18b)],_0x3e07a7[_0x4eed85(0x17a)],_0x3e07a7[_0x4eed85(0x1c4)],_0x3e07a7[_0x4eed85(0x21d)],_0x3e07a7['integrations'],_0x3e07a7[_0x4eed85(0x1c2)],_0x3e07a7[_0x4eed85(0x208)]);if(_0x1f8578)return console[_0x4eed85(0x1b2)](a4_0x47f33c[_0x4eed85(0x1ae)](_0x4eed85(0x1b5))),0x0;if(_0x2cc85f===0x0&&_0x10b001===0x0){console[_0x4eed85(0x1b2)](a4_0x47f33c[_0x4eed85(0x1dc)](_0x4eed85(0x1f0)));const _0xbed347=getLLMProjectUrl(_0x2c76cb,_0x3e07a7[_0x4eed85(0x22b)]);return console[_0x4eed85(0x1b2)](_0x4eed85(0x1df)+a4_0x47f33c[_0x4eed85(0x225)](_0xbed347)),0x0;}if(!_0x465cf2&&!_0x284782){if(!isInteractive())return console[_0x4eed85(0x1e2)](a4_0x47f33c[_0x4eed85(0x1ca)](_0x4eed85(0x221)),_0x4eed85(0x19e)),console[_0x4eed85(0x1e2)](a4_0x47f33c['dim'](_0x4eed85(0x1b7))),0x1;const _0x285c23=await confirmKey('\x0aPush\x20'+(_0x2cc85f+_0x10b001)+'\x20resources?');if(!_0x285c23)return console[_0x4eed85(0x1b2)](a4_0x47f33c[_0x4eed85(0x1ae)](_0x4eed85(0x22d)),_0x4eed85(0x1a8)),0x1;}const {data:_0x4fd1be}=await withSpinner(_0x4eed85(0x235),()=>_0x1a1f63[_0x4eed85(0x20d)][_0x4eed85(0x1ed)](_0x4050ac,{'force':_0x284782})),_0x30e22f=_0x4fd1be[_0x4eed85(0x1d2)][_0x4eed85(0x18b)][_0x4eed85(0x1f6)]>0x0||_0x4fd1be[_0x4eed85(0x1d2)][_0x4eed85(0x17a)]['errors']>0x0||_0x4fd1be[_0x4eed85(0x1d2)][_0x4eed85(0x1c4)][_0x4eed85(0x1f6)]>0x0||_0x4fd1be['counts'][_0x4eed85(0x21d)]['errors']>0x0;if(_0x30e22f){console[_0x4eed85(0x1b2)](a4_0x47f33c[_0x4eed85(0x1ae)](_0x4eed85(0x22e))),console[_0x4eed85(0x1b2)](),console[_0x4eed85(0x1b2)](a4_0x47f33c[_0x4eed85(0x1ca)](_0x4eed85(0x197)));for(const _0x3372bf of _0x4fd1be[_0x4eed85(0x18b)]){_0x3372bf[_0x4eed85(0x231)]===_0x4eed85(0x1e2)&&console[_0x4eed85(0x1b2)](a4_0x47f33c[_0x4eed85(0x1ca)](_0x4eed85(0x187)+_0x3372bf['agentName']+_0x4eed85(0x1cf)+_0x3372bf[_0x4eed85(0x1e2)]));}for(const _0x55d95e of _0x4fd1be['knowledgeBases']){_0x55d95e[_0x4eed85(0x231)]===_0x4eed85(0x1e2)&&console[_0x4eed85(0x1b2)](a4_0x47f33c[_0x4eed85(0x1ca)](_0x4eed85(0x190)+_0x55d95e['name']+_0x4eed85(0x1cf)+_0x55d95e[_0x4eed85(0x1e2)]));}for(const _0x4aae82 of _0x4fd1be[_0x4eed85(0x1c4)]){_0x4aae82[_0x4eed85(0x231)]===_0x4eed85(0x1e2)&&console[_0x4eed85(0x1b2)](a4_0x47f33c[_0x4eed85(0x1ca)](_0x4eed85(0x1c8)+_0x4aae82[_0x4eed85(0x188)]+_0x4eed85(0x1cf)+_0x4aae82[_0x4eed85(0x1e2)]));}for(const _0x15582a of _0x4fd1be[_0x4eed85(0x21d)]){_0x15582a[_0x4eed85(0x231)]===_0x4eed85(0x1e2)&&console[_0x4eed85(0x1b2)](a4_0x47f33c[_0x4eed85(0x1ca)](_0x4eed85(0x1c6)+_0x15582a[_0x4eed85(0x188)]+_0x4eed85(0x1cf)+_0x15582a[_0x4eed85(0x1e2)]));}for(const _0x90e45d of _0x4fd1be[_0x4eed85(0x1b9)]){_0x90e45d[_0x4eed85(0x231)]===_0x4eed85(0x1e2)&&console[_0x4eed85(0x1b2)](a4_0x47f33c[_0x4eed85(0x1ca)]('\x20\x20Integration\x20\x22'+_0x90e45d[_0x4eed85(0x188)]+_0x4eed85(0x1cf)+_0x90e45d[_0x4eed85(0x1e2)]));}return 0x1;}console[_0x4eed85(0x1b2)](a4_0x47f33c[_0x4eed85(0x1dc)](_0x4eed85(0x194)+(_0x2cc85f+_0x10b001)+'\x20resources\x20to\x20\x27'+_0x4fd1be[_0x4eed85(0x191)]+'\x27'));const _0x20b54a=getLLMProjectUrl(_0x2c76cb,_0x4fd1be['projectId']);return console[_0x4eed85(0x1b2)](_0x4eed85(0x1df)+a4_0x47f33c[_0x4eed85(0x225)](_0x20b54a)),0x0;}}
@@ -1 +1 @@
1
- const a5_0x523791=a5_0x3c02;(function(_0x194fc2,_0x4c1ec9){const _0x8b398f=a5_0x3c02,_0x34af21=_0x194fc2();while(!![]){try{const _0x2dd514=parseInt(_0x8b398f(0x15d))/0x1+parseInt(_0x8b398f(0xf2))/0x2*(-parseInt(_0x8b398f(0x17d))/0x3)+parseInt(_0x8b398f(0x152))/0x4+-parseInt(_0x8b398f(0xf9))/0x5*(parseInt(_0x8b398f(0x14c))/0x6)+parseInt(_0x8b398f(0x14d))/0x7+parseInt(_0x8b398f(0xf0))/0x8*(-parseInt(_0x8b398f(0x13b))/0x9)+parseInt(_0x8b398f(0xfe))/0xa;if(_0x2dd514===_0x4c1ec9)break;else _0x34af21['push'](_0x34af21['shift']());}catch(_0x46c15d){_0x34af21['push'](_0x34af21['shift']());}}}(a5_0x381d,0x341fa));import*as a5_0x5ec645 from'node:fs';import*as a5_0x418b8b from'node:path';import a5_0x565188 from'chalk';import{BaseCommand}from'./command.js';function a5_0x3c02(_0x3258fc,_0x56c78a){_0x3258fc=_0x3258fc-0xec;const _0x381dd2=a5_0x381d();let _0x3c02c2=_0x381dd2[_0x3258fc];return _0x3c02c2;}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';function a5_0x381d(){const _0x3aef13=['green','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','no_tests','4596sDuuHq','774781ygYMMA','Project\x20path:\x20','split','conversations','agentDirs','751340BDZYNi','\x20\x20Site:\x20','status','...','✓\x20PASS:\x20','Error\x20writing\x20output\x20file:\x20','\x27\x20to\x20create\x20the\x20folder\x20structure.','repeat','text','filter','Re-evaluating\x20cached\x20test\x20run...','144903LUKPGw','Round\x20','start','agentName','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','json','verbose','FAIL','cyan','\x20-\x20','output','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','Test\x20Summary','Running:\x20','white','resolveProjectId','\x20\x20Round\x20','table','Evaluating\x20response...','not\x20found','Site:\x20','tags','Tests\x20found:\x20','ERROR','message','...\x20','has','PASS','Round\x201/','timestamp','228024bVvdlh','Run\x20\x27tdx\x20agent\x20pull\x20',':\x20Sending\x20user\x20input...','Output\x20written\x20to:\x20','Running\x20agent\x20tests...','/<agent-name>','16BTUhgj','tests','4CGbHgo','found','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','No\x20tests\x20found\x20matching:\x20','jsonl','Passed:\x20\x20\x20','join','2270vfmnWi','substring','\x20\x20Evaluating...\x20','forEach','length','5304230cbLjca','context','dim','name','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','tsv','red','yellow','reason','stop','toLowerCase','Test\x20','\x20\x20-\x20','agent','Cached\x20run\x20from:\x20','\x22,\x20but\x20current\x20site\x20is\x20\x22','Running\x20test:\x20','no_local_folder','\x20\x20Agent:\x20','resolve','multiple_agents','Errors:\x20\x20\x20','basename','New\x20tests\x20to\x20execute:\x20','agent:test','add','dryRun','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','\x20(new)','404','rounds','push','Either\x20switch\x20to\x20the\x20\x22','⚠\x20SKIPPED:\x20','log','llm','description','resolveAgentId','Conversation\x20URL:\x20','Agent:\x20','includes','Test\x20Configuration:','some','projectName','executeReeval','Re-evaluation\x20Summary','now','writeFileSync','toISOString','trim','✗\x20FAIL:\x20','llmProject','\x22:\x20','no_context','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','utf-8','testYmlPath','Using\x20agent:\x20','\x20\x20Project:\x20','size','✗\x20ERROR:\x20','1172547wVrKxp','reeval','conversation_url','projectDir','site','existsSync','map','No\x20tests\x20found\x20with\x20tags:\x20','\x20(cached)','Failed:\x20\x20\x20','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','Duration:\x20','\x20\x20Conversation:\x20','isSpinning'];a5_0x381d=function(){return _0x3aef13;};return a5_0x381d();}export class AgentTestCommand extends BaseCommand{[a5_0x523791(0x101)]=a5_0x523791(0x116);[a5_0x523791(0x122)]='Run\x20tests\x20for\x20an\x20LLM\x20agent';async['execute'](_0xbcd5c9){const _0x5e3d2d=a5_0x523791,{options:_0xcd4e8f,args:_0x14f658,tdx:_0x41a4f5}=_0xbcd5c9,_0x4d0760=_0x14f658[0x0]||'.',_0x420fd1=_0xcd4e8f[_0x5e3d2d(0x118)],_0x1e3953=_0xcd4e8f,_0x329d4d=_0x1e3953['eval']===![],_0x2894c6=_0x1e3953[_0x5e3d2d(0x13c)],_0x59f3b4=_0x1e3953['name'],_0x2e039f=_0x1e3953[_0x5e3d2d(0x174)],_0x248220=_0xcd4e8f[_0x5e3d2d(0x13f)],_0x3c2901=_0x1e3953[_0x5e3d2d(0x167)];if(_0x2894c6&&_0x329d4d)return console[_0x5e3d2d(0x120)](a5_0x565188[_0x5e3d2d(0x104)](_0x5e3d2d(0x102))),0x1;let _0x535b4f=_0x5e3d2d(0x170);if(_0x1e3953[_0x5e3d2d(0x162)])_0x535b4f='json';else{if(_0x1e3953[_0x5e3d2d(0xf6)])_0x535b4f=_0x5e3d2d(0xf6);else{if(_0x1e3953[_0x5e3d2d(0x103)])_0x535b4f=_0x5e3d2d(0x103);else{if(_0x1e3953[_0x5e3d2d(0x170)])_0x535b4f=_0x5e3d2d(0x170);}}}const _0x4b5e84=_0x1e3953['llmProject'];let _0x55b9aa=_0x4d0760;const _0x1e9881=a5_0x5ec645[_0x5e3d2d(0x140)](_0x4d0760),_0xe6458=_0x4d0760==='.';if(!_0x1e9881||_0xe6458){const _0x6a5bee=resolveProjectFromContext(_0x4d0760,_0x4b5e84,{'requireFile':'test.yml'});if(_0x6a5bee[_0x5e3d2d(0xf3)])_0x55b9aa=_0x6a5bee['projectDir'],_0x6a5bee['source']===_0x5e3d2d(0xff)&&console[_0x5e3d2d(0x120)](a5_0x565188[_0x5e3d2d(0x100)](_0x5e3d2d(0x137)+_0x55b9aa));else switch(_0x6a5bee[_0x5e3d2d(0x106)]){case _0x5e3d2d(0x133):console[_0x5e3d2d(0x120)](a5_0x565188[_0x5e3d2d(0x105)](_0x6a5bee[_0x5e3d2d(0x177)])),console[_0x5e3d2d(0x120)](),console[_0x5e3d2d(0x120)]('Usage:'),console['log']('\x20\x20tdx\x20agent\x20test\x20<path>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20from\x20path'),console[_0x5e3d2d(0x120)]('\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[_0x5e3d2d(0x120)](),console[_0x5e3d2d(0x120)](_0x5e3d2d(0x14a));return 0x1;case _0x5e3d2d(0x10f):console[_0x5e3d2d(0x120)](a5_0x565188[_0x5e3d2d(0x105)](_0x6a5bee[_0x5e3d2d(0x177)])),console[_0x5e3d2d(0x120)](),console[_0x5e3d2d(0x120)](_0x5e3d2d(0x17e)+_0x6a5bee['llmProject']+_0x5e3d2d(0x158));return 0x1;case _0x5e3d2d(0x112):{const _0x4e10b3=a5_0x418b8b[_0x5e3d2d(0x114)](_0x6a5bee[_0x5e3d2d(0x13e)]);console[_0x5e3d2d(0x120)](a5_0x565188[_0x5e3d2d(0x105)](_0x5e3d2d(0x134)+_0x6a5bee[_0x5e3d2d(0x131)]+'\x22:'));for(const _0x35b61d of _0x6a5bee[_0x5e3d2d(0x151)]){console[_0x5e3d2d(0x120)](_0x5e3d2d(0x10a)+_0x35b61d);}return console[_0x5e3d2d(0x120)](),console['log'](_0x5e3d2d(0x168)+_0x4e10b3+_0x5e3d2d(0xef)),0x1;}case _0x5e3d2d(0x14b):console[_0x5e3d2d(0x120)](a5_0x565188['yellow']('No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22'+_0x6a5bee['llmProject']+'\x22.')),console[_0x5e3d2d(0x120)](a5_0x565188[_0x5e3d2d(0x100)](_0x5e3d2d(0x14e)+_0x6a5bee[_0x5e3d2d(0x13e)])),console[_0x5e3d2d(0x120)](),console[_0x5e3d2d(0x120)](_0x5e3d2d(0x145));return 0x1;}}const {definition:_0x571796,agentInfo:_0x1d7abd}=parseTestFile(_0x55b9aa);let _0x1a368c=_0x571796['tests'];if(_0x59f3b4){const _0x39dd55=_0x59f3b4['split'](',')[_0x5e3d2d(0x141)](_0x28f6b0=>_0x28f6b0[_0x5e3d2d(0x12f)]());_0x1a368c=_0x571796[_0x5e3d2d(0xf1)][_0x5e3d2d(0x15b)](_0xe7f222=>_0x39dd55[_0x5e3d2d(0x126)](_0xe7f222[_0x5e3d2d(0x101)]));if(_0x1a368c[_0x5e3d2d(0xfd)]===0x0)return console[_0x5e3d2d(0x120)](a5_0x565188[_0x5e3d2d(0x105)](_0x5e3d2d(0xf5)+_0x59f3b4)),console[_0x5e3d2d(0x120)](a5_0x565188['dim']('Available\x20tests:\x20'+_0x571796['tests'][_0x5e3d2d(0x141)](_0x5d8324=>_0x5d8324[_0x5e3d2d(0x101)])['join'](',\x20'))),0x1;}if(_0x2e039f){const _0x39fb8b=_0x2e039f[_0x5e3d2d(0x14f)](',')['map'](_0x2588bc=>_0x2588bc[_0x5e3d2d(0x12f)]()['toLowerCase']());_0x1a368c=_0x1a368c[_0x5e3d2d(0x15b)](_0x9971c6=>_0x9971c6[_0x5e3d2d(0x174)]?.[_0x5e3d2d(0x128)](_0x30fea4=>_0x39fb8b[_0x5e3d2d(0x126)](_0x30fea4['toLowerCase']())));if(_0x1a368c[_0x5e3d2d(0xfd)]===0x0){console[_0x5e3d2d(0x120)](a5_0x565188[_0x5e3d2d(0x105)](_0x5e3d2d(0x142)+_0x2e039f));const _0x4c9f7a=new Set();return _0x571796[_0x5e3d2d(0xf1)][_0x5e3d2d(0xfc)](_0x3430ca=>_0x3430ca[_0x5e3d2d(0x174)]?.[_0x5e3d2d(0xfc)](_0xf68287=>_0x4c9f7a[_0x5e3d2d(0x117)](_0xf68287))),_0x4c9f7a[_0x5e3d2d(0x139)]>0x0?console[_0x5e3d2d(0x120)](a5_0x565188['dim']('Available\x20tags:\x20'+[..._0x4c9f7a]['join'](',\x20'))):console[_0x5e3d2d(0x120)](a5_0x565188[_0x5e3d2d(0x100)]('No\x20tests\x20have\x20tags\x20defined.')),0x1;}}if(_0x2894c6)return this[_0x5e3d2d(0x12a)](_0xbcd5c9,{'definition':{'tests':_0x1a368c},'agentInfo':_0x1d7abd,'outputFormat':_0x535b4f,'outputFile':_0x3c2901,'testNames':_0x59f3b4});if(_0x420fd1){console[_0x5e3d2d(0x120)](a5_0x565188[_0x5e3d2d(0x165)](_0x5e3d2d(0x127))),console[_0x5e3d2d(0x120)](_0x5e3d2d(0x153)+a5_0x565188[_0x5e3d2d(0x16d)](_0x248220)),console[_0x5e3d2d(0x120)](_0x5e3d2d(0x138)+a5_0x565188['white'](_0x1d7abd['projectName'])),console[_0x5e3d2d(0x120)](_0x5e3d2d(0x110)+a5_0x565188[_0x5e3d2d(0x16d)](_0x1d7abd[_0x5e3d2d(0x160)])),console[_0x5e3d2d(0x120)](),console['log'](_0x5e3d2d(0x175)+a5_0x565188['white'](_0x1a368c[_0x5e3d2d(0xfd)]));for(let _0x14d5f1=0x0;_0x14d5f1<_0x1a368c[_0x5e3d2d(0xfd)];_0x14d5f1++){const _0x5c44c5=_0x1a368c[_0x14d5f1],_0xe1608f=_0x5c44c5['rounds'][_0x5e3d2d(0xfd)]===0x1?'round':'rounds',_0xc7a9f=_0x5c44c5[_0x5e3d2d(0x174)]?.[_0x5e3d2d(0xfd)]?'\x20['+_0x5c44c5[_0x5e3d2d(0x174)][_0x5e3d2d(0xf8)](',\x20')+']':'';console[_0x5e3d2d(0x120)]('\x20\x20'+(_0x14d5f1+0x1)+'.\x20'+a5_0x565188[_0x5e3d2d(0x16d)](_0x5c44c5[_0x5e3d2d(0x101)])+'\x20('+_0x5c44c5[_0x5e3d2d(0x11c)][_0x5e3d2d(0xfd)]+'\x20'+_0xe1608f+')'+a5_0x565188['dim'](_0xc7a9f));}return 0x0;}let _0x190ae1,_0x5df5d8;try{_0x190ae1=await _0x41a4f5[_0x5e3d2d(0x121)][_0x5e3d2d(0x16e)](_0x1d7abd['projectName']);}catch(_0x4e98c0){const _0x1b2808=_0x4e98c0 instanceof Error?_0x4e98c0[_0x5e3d2d(0x177)]:String(_0x4e98c0);return _0x1b2808[_0x5e3d2d(0x126)](_0x5e3d2d(0x11b))||_0x1b2808[_0x5e3d2d(0x108)]()[_0x5e3d2d(0x126)](_0x5e3d2d(0x172))?console[_0x5e3d2d(0x120)](a5_0x565188[_0x5e3d2d(0x104)]('✗\x20ERROR:\x20Project\x20not\x20found:\x20'+_0x1d7abd[_0x5e3d2d(0x129)])):console[_0x5e3d2d(0x120)](a5_0x565188[_0x5e3d2d(0x104)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22'+_0x1d7abd[_0x5e3d2d(0x129)]+_0x5e3d2d(0x132)+_0x1b2808)),0x1;}try{_0x5df5d8=await _0x41a4f5[_0x5e3d2d(0x121)][_0x5e3d2d(0x123)](_0x1d7abd[_0x5e3d2d(0x160)],_0x190ae1);}catch(_0x33e78a){const _0xce51ff=_0x33e78a instanceof Error?_0x33e78a[_0x5e3d2d(0x177)]:String(_0x33e78a);return _0xce51ff['includes'](_0x5e3d2d(0x11b))||_0xce51ff[_0x5e3d2d(0x108)]()[_0x5e3d2d(0x126)](_0x5e3d2d(0x172))?console[_0x5e3d2d(0x120)](a5_0x565188['red']('✗\x20ERROR:\x20Agent\x20not\x20found:\x20'+_0x1d7abd[_0x5e3d2d(0x160)])):console[_0x5e3d2d(0x120)](a5_0x565188[_0x5e3d2d(0x104)](_0x5e3d2d(0x16a)+_0x1d7abd[_0x5e3d2d(0x160)]+_0x5e3d2d(0x132)+_0xce51ff)),0x1;}let _0x114c63;if(!_0x329d4d)try{_0x114c63=await setupEvaluatorAgent(_0x41a4f5[_0x5e3d2d(0x121)],_0xcd4e8f['verbose']);}catch(_0x1c6c41){const _0x5078c6=_0x1c6c41 instanceof Error?_0x1c6c41[_0x5e3d2d(0x177)]:String(_0x1c6c41);return console[_0x5e3d2d(0x120)](a5_0x565188[_0x5e3d2d(0x104)](_0x5e3d2d(0x161)+_0x5078c6)),0x1;}console[_0x5e3d2d(0x120)](a5_0x565188[_0x5e3d2d(0x165)](_0x5e3d2d(0xee))),console[_0x5e3d2d(0x120)](_0x5e3d2d(0x173)+a5_0x565188[_0x5e3d2d(0x16d)](_0x248220)),console[_0x5e3d2d(0x120)](_0x5e3d2d(0x125)+a5_0x565188[_0x5e3d2d(0x16d)](_0x1d7abd['projectName']+'/'+_0x1d7abd['agentName'])),console[_0x5e3d2d(0x120)]();const _0x43dc5e=[],_0x2ff229=[],_0x27e0f0=Date[_0x5e3d2d(0x12c)]();for(let _0x3c2d9a=0x0;_0x3c2d9a<_0x1a368c[_0x5e3d2d(0xfd)];_0x3c2d9a++){const _0xbbc9fb=_0x1a368c[_0x3c2d9a];_0x1a368c['length']>0x1?console[_0x5e3d2d(0x120)](_0x5e3d2d(0x109)+(_0x3c2d9a+0x1)+'/'+_0x1a368c['length']+':\x20'+a5_0x565188['white'](_0xbbc9fb[_0x5e3d2d(0x101)])):console[_0x5e3d2d(0x120)](_0x5e3d2d(0x10e)+a5_0x565188[_0x5e3d2d(0x16d)](_0xbbc9fb[_0x5e3d2d(0x101)]));const _0x42a25f=createCommandSpinner('Round\x201/'+_0xbbc9fb[_0x5e3d2d(0x11c)][_0x5e3d2d(0xfd)]+_0x5e3d2d(0xec));_0x42a25f[_0x5e3d2d(0x15f)]();try{const {result:_0x50aade,conversation:_0x57889f}=await runTest(_0x41a4f5[_0x5e3d2d(0x121)],_0xbbc9fb,{'agentId':_0x5df5d8,'projectId':_0x190ae1,'site':_0x248220,'noEval':_0x329d4d,'evaluatorId':_0x114c63,'onRoundStart':(_0x5c6eae,_0x3b4173)=>{const _0x17aa85=_0x5e3d2d;_0x42a25f[_0x17aa85(0x15a)]=_0x17aa85(0x15e)+(_0x5c6eae+0x1)+'/'+_0x3b4173+_0x17aa85(0xec);},'onRoundComplete':(_0x38cc37,_0x479bb9,_0x3a1e1e)=>{const _0x26ca62=_0x5e3d2d,_0x1be16b=formatElapsed(_0x479bb9);_0x3a1e1e?console[_0x26ca62(0x120)](_0x26ca62(0x16f)+(_0x38cc37+0x1)+'/'+_0xbbc9fb['rounds'][_0x26ca62(0xfd)]+_0x26ca62(0x178)+a5_0x565188['green']('✓')+'\x20('+_0x1be16b+')'):console[_0x26ca62(0x120)](_0x26ca62(0x16f)+(_0x38cc37+0x1)+'/'+_0xbbc9fb[_0x26ca62(0x11c)][_0x26ca62(0xfd)]+_0x26ca62(0x178)+a5_0x565188[_0x26ca62(0x104)]('✗'));},'onEvaluationStart':()=>{const _0x386a6c=_0x5e3d2d;_0x42a25f[_0x386a6c(0x15a)]=_0x386a6c(0x171);},'onEvaluationComplete':_0x4203ff=>{const _0x5c5087=_0x5e3d2d,_0x8128e9=formatElapsed(_0x4203ff);console[_0x5c5087(0x120)](_0x5c5087(0xfb)+a5_0x565188[_0x5c5087(0x149)]('✓')+'\x20('+_0x8128e9+')');}});_0x42a25f[_0x5e3d2d(0x107)](),_0x43dc5e['push'](_0x50aade),_0x2ff229[_0x5e3d2d(0x11d)](_0x57889f);if(_0x50aade['status']===_0x5e3d2d(0x17a))console['log'](a5_0x565188[_0x5e3d2d(0x149)](_0x5e3d2d(0x156)+_0x50aade[_0x5e3d2d(0x106)]));else _0x50aade[_0x5e3d2d(0x154)]==='FAIL'?console[_0x5e3d2d(0x120)](a5_0x565188[_0x5e3d2d(0x104)]('✗\x20FAIL:\x20'+_0x50aade[_0x5e3d2d(0x106)])):console['log'](a5_0x565188[_0x5e3d2d(0x104)](_0x5e3d2d(0x13a)+_0x50aade[_0x5e3d2d(0x106)]));_0x50aade[_0x5e3d2d(0x13d)]&&console[_0x5e3d2d(0x120)](a5_0x565188[_0x5e3d2d(0x100)](_0x5e3d2d(0x124)+_0x50aade[_0x5e3d2d(0x13d)])),console[_0x5e3d2d(0x120)]();}catch(_0x2a2c95){_0x42a25f['stop']();const _0x128f39=_0x2a2c95 instanceof Error?_0x2a2c95['message']:String(_0x2a2c95);console[_0x5e3d2d(0x120)](a5_0x565188[_0x5e3d2d(0x104)]('✗\x20ERROR:\x20'+_0x128f39)),console['log'](),_0x43dc5e[_0x5e3d2d(0x11d)]({'name':_0xbbc9fb[_0x5e3d2d(0x101)],'status':_0x5e3d2d(0x176),'reason':_0x128f39,'timestamp':new Date()[_0x5e3d2d(0x12e)](),'duration_ms':0x0});}}const _0xf7c64c=Date[_0x5e3d2d(0x12c)]()-_0x27e0f0,_0x371e52=_0x43dc5e[_0x5e3d2d(0x15b)](_0xd5f38f=>_0xd5f38f['status']===_0x5e3d2d(0x17a))[_0x5e3d2d(0xfd)],_0x10bb26=_0x43dc5e[_0x5e3d2d(0x15b)](_0x5c2ba6=>_0x5c2ba6[_0x5e3d2d(0x154)]==='FAIL')[_0x5e3d2d(0xfd)],_0x13a50e=_0x43dc5e[_0x5e3d2d(0x15b)](_0x5b4fc0=>_0x5b4fc0[_0x5e3d2d(0x154)]===_0x5e3d2d(0x176))[_0x5e3d2d(0xfd)];console[_0x5e3d2d(0x120)]('━'['repeat'](0x3c)),console[_0x5e3d2d(0x120)](_0x5e3d2d(0x16b)),console[_0x5e3d2d(0x120)]('━'[_0x5e3d2d(0x159)](0x3c)),console[_0x5e3d2d(0x120)]('Total:\x20\x20\x20\x20'+_0x43dc5e[_0x5e3d2d(0xfd)]),console[_0x5e3d2d(0x120)](_0x5e3d2d(0xf7)+a5_0x565188[_0x5e3d2d(0x149)](_0x371e52)),console[_0x5e3d2d(0x120)](_0x5e3d2d(0x144)+a5_0x565188[_0x5e3d2d(0x104)](_0x10bb26));_0x13a50e>0x0&&console['log'](_0x5e3d2d(0x113)+a5_0x565188[_0x5e3d2d(0x104)](_0x13a50e));console['log']('Duration:\x20'+formatElapsed(_0xf7c64c)),console[_0x5e3d2d(0x120)]('━'[_0x5e3d2d(0x159)](0x3c));const _0x5b73be=_0x43dc5e[_0x5e3d2d(0x15b)](_0x3d5a2c=>_0x3d5a2c['status']!=='PASS');if(_0x5b73be[_0x5e3d2d(0xfd)]>0x0){console[_0x5e3d2d(0x120)](),console['log']('Failed\x20Tests:');for(const _0x4a1736 of _0x5b73be){const _0x43006a=a5_0x565188[_0x5e3d2d(0x104)]('✗'),_0x55132b=_0x4a1736['reason']['length']>0x32?_0x4a1736[_0x5e3d2d(0x106)][_0x5e3d2d(0xfa)](0x0,0x32)+_0x5e3d2d(0x155):_0x4a1736[_0x5e3d2d(0x106)];console[_0x5e3d2d(0x120)]('\x20\x20'+_0x43006a+'\x20'+_0x4a1736[_0x5e3d2d(0x101)]+':\x20'+_0x55132b);}}const _0x11d9ef={'summary':{'total':_0x43dc5e[_0x5e3d2d(0xfd)],'passed':_0x371e52,'failed':_0x10bb26,'errors':_0x13a50e>0x0?_0x13a50e:undefined,'duration_ms':_0xf7c64c},'tests':_0x43dc5e,'agent':{'project':_0x1d7abd[_0x5e3d2d(0x129)],'name':_0x1d7abd[_0x5e3d2d(0x160)],'site':_0x248220},'timestamp':new Date(_0x27e0f0)['toISOString']()};try{const _0x37ce7b=buildCachedTestRun(_0x2ff229,{'site':_0x248220,'projectId':_0x190ae1,'projectName':_0x1d7abd[_0x5e3d2d(0x129)],'agentId':_0x5df5d8,'agentName':_0x1d7abd['agentName'],'testYmlPath':a5_0x418b8b[_0x5e3d2d(0x111)](_0x1d7abd[_0x5e3d2d(0x136)])});saveLastTestRun(_0x37ce7b);}catch{}if(_0x535b4f!==_0x5e3d2d(0x170)||_0x3c2901){const _0x131a1f=formatResults(_0x11d9ef,_0x535b4f);if(_0x3c2901)try{a5_0x5ec645['writeFileSync'](_0x3c2901,_0x131a1f,_0x5e3d2d(0x135)),console['log'](),console[_0x5e3d2d(0x120)](a5_0x565188[_0x5e3d2d(0x100)](_0x5e3d2d(0xed)+_0x3c2901));}catch(_0x1ac994){return console[_0x5e3d2d(0x120)](),console['log'](a5_0x565188[_0x5e3d2d(0x104)](_0x5e3d2d(0x157)+_0x1ac994)),0x1;}else console['log'](),console[_0x5e3d2d(0x120)](_0x131a1f);}return _0x5b73be[_0x5e3d2d(0xfd)]>0x0?0x1:0x0;}async['executeReeval'](_0x1970b9,_0x504ad1){const _0x3982f5=a5_0x523791,{options:_0x2db70f,tdx:_0x5a1cfa}=_0x1970b9,{definition:_0x40b1dc,agentInfo:_0x190099,outputFormat:_0x11cc7b,outputFile:_0x4433e9}=_0x504ad1,_0x3796e4=_0x2db70f[_0x3982f5(0x13f)],_0x32b91e=loadLastTestRun();if(!_0x32b91e)return console[_0x3982f5(0x120)](a5_0x565188['red']('Error:\x20No\x20previous\x20test\x20run\x20found.')),console[_0x3982f5(0x120)](a5_0x565188[_0x3982f5(0x100)]('Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.')),0x1;if(_0x32b91e['agent'][_0x3982f5(0x160)]!==_0x190099['agentName'])return console[_0x3982f5(0x120)](a5_0x565188[_0x3982f5(0x104)]('Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22'+_0x32b91e[_0x3982f5(0x10b)]['agentName']+_0x3982f5(0xf4)+_0x190099[_0x3982f5(0x160)]+'\x22.')),console[_0x3982f5(0x120)](a5_0x565188[_0x3982f5(0x100)](_0x3982f5(0x119))),0x1;const _0x2f242d=new Set(_0x32b91e[_0x3982f5(0x150)][_0x3982f5(0x141)](_0x541bfd=>_0x541bfd['testName'])),_0x4e3de2=_0x40b1dc[_0x3982f5(0xf1)][_0x3982f5(0x15b)](_0x152eea=>!_0x2f242d['has'](_0x152eea['name']));if(_0x4e3de2[_0x3982f5(0xfd)]>0x0&&_0x32b91e['site']!==_0x3796e4)return console['log'](a5_0x565188[_0x3982f5(0x104)]('Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.')),console[_0x3982f5(0x120)](a5_0x565188[_0x3982f5(0x100)]('Cached\x20run\x20is\x20from\x20site\x20\x22'+_0x32b91e['site']+_0x3982f5(0x10d)+_0x3796e4+'\x22.')),console['log'](a5_0x565188[_0x3982f5(0x100)](_0x3982f5(0x11e)+_0x32b91e[_0x3982f5(0x13f)]+'\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.')),0x1;const _0x1109d6=_0x40b1dc['tests']['filter'](_0xfed0fc=>_0x2f242d[_0x3982f5(0x179)](_0xfed0fc[_0x3982f5(0x101)])),_0x4eb7c1=_0x4e3de2;let _0x3298bc;try{_0x3298bc=await setupEvaluatorAgent(_0x5a1cfa[_0x3982f5(0x121)],_0x2db70f[_0x3982f5(0x163)]);}catch(_0x4660b3){const _0x43b9d6=_0x4660b3 instanceof Error?_0x4660b3['message']:String(_0x4660b3);return console[_0x3982f5(0x120)](a5_0x565188['red'](_0x3982f5(0x161)+_0x43b9d6)),0x1;}console[_0x3982f5(0x120)](a5_0x565188['cyan'](_0x3982f5(0x15c))),console[_0x3982f5(0x120)](_0x3982f5(0x10c)+a5_0x565188[_0x3982f5(0x16d)](_0x32b91e[_0x3982f5(0x17c)])),console[_0x3982f5(0x120)](_0x3982f5(0x125)+a5_0x565188[_0x3982f5(0x16d)](_0x32b91e[_0x3982f5(0x10b)][_0x3982f5(0x129)]+'/'+_0x32b91e[_0x3982f5(0x10b)][_0x3982f5(0x160)]));_0x4eb7c1[_0x3982f5(0xfd)]>0x0&&console[_0x3982f5(0x120)](_0x3982f5(0x115)+a5_0x565188[_0x3982f5(0x105)](_0x4eb7c1[_0x3982f5(0xfd)]));console[_0x3982f5(0x120)]();const _0x282ca8=[],_0xfd1db6=Date[_0x3982f5(0x12c)](),_0x5c5c4d=createCommandSpinner('Re-evaluating...');if(_0x1109d6['length']>0x0)try{const _0x3cdf46=await reevaluateFromCache(_0x5a1cfa['llm'],_0x32b91e,{'tests':_0x1109d6},{'evaluatorId':_0x3298bc,'onTestStart':(_0x1dd863,_0x1528d6,_0x3108c0)=>{const _0x63ac71=_0x3982f5;_0x5c5c4d[_0x63ac71(0x15a)]='Re-evaluating\x20'+(_0x1528d6+0x1)+'/'+_0x3108c0+':\x20'+_0x1dd863+'...';if(!_0x5c5c4d[_0x63ac71(0x148)])_0x5c5c4d[_0x63ac71(0x15f)]();},'onTestComplete':(_0x5e49ce,_0x4ed3ce)=>{const _0x33a452=_0x3982f5;_0x5c5c4d[_0x33a452(0x107)]();if(_0x4ed3ce[_0x33a452(0x154)]===_0x33a452(0x17a))console[_0x33a452(0x120)](a5_0x565188[_0x33a452(0x149)](_0x33a452(0x156)+_0x5e49ce)+a5_0x565188[_0x33a452(0x100)](_0x33a452(0x143)));else _0x4ed3ce[_0x33a452(0x154)]==='FAIL'?console[_0x33a452(0x120)](a5_0x565188[_0x33a452(0x104)](_0x33a452(0x130)+_0x5e49ce+'\x20-\x20'+_0x4ed3ce[_0x33a452(0x106)])+a5_0x565188[_0x33a452(0x100)](_0x33a452(0x143))):console[_0x33a452(0x120)](a5_0x565188[_0x33a452(0x104)](_0x33a452(0x13a)+_0x5e49ce+_0x33a452(0x166)+_0x4ed3ce[_0x33a452(0x106)]));_0x4ed3ce['conversation_url']&&console[_0x33a452(0x120)](a5_0x565188[_0x33a452(0x100)](_0x33a452(0x147)+_0x4ed3ce['conversation_url'])),_0x282ca8[_0x33a452(0x11d)](_0x4ed3ce);},'onTestSkipped':(_0x13c3ab,_0x2cebac)=>{const _0x4dfe1d=_0x3982f5;_0x5c5c4d[_0x4dfe1d(0x107)](),console[_0x4dfe1d(0x120)](a5_0x565188[_0x4dfe1d(0x105)](_0x4dfe1d(0x11f)+_0x13c3ab+'\x20-\x20'+_0x2cebac));}});for(const _0x433844 of _0x3cdf46){!_0x282ca8['find'](_0x11369a=>_0x11369a[_0x3982f5(0x101)]===_0x433844[_0x3982f5(0x101)])&&_0x282ca8['push'](_0x433844);}}catch(_0xb7889b){_0x5c5c4d[_0x3982f5(0x107)]();const _0x42a35c=_0xb7889b instanceof Error?_0xb7889b[_0x3982f5(0x177)]:String(_0xb7889b);return console[_0x3982f5(0x120)](a5_0x565188['red'](_0x3982f5(0x169)+_0x42a35c)),0x1;}_0x5c5c4d[_0x3982f5(0x107)]();if(_0x4eb7c1[_0x3982f5(0xfd)]>0x0){console[_0x3982f5(0x120)](),console[_0x3982f5(0x120)](a5_0x565188['cyan']('Executing\x20new\x20tests...'));const {projectId:_0x2a93ae,agentId:_0x12466d}=_0x32b91e[_0x3982f5(0x10b)];for(const _0x2bd9a9 of _0x4eb7c1){console[_0x3982f5(0x120)](_0x3982f5(0x16c)+a5_0x565188[_0x3982f5(0x16d)](_0x2bd9a9[_0x3982f5(0x101)]));const _0x7eafb2=createCommandSpinner(_0x3982f5(0x17b)+_0x2bd9a9[_0x3982f5(0x11c)][_0x3982f5(0xfd)]+':\x20Sending\x20user\x20input...');_0x7eafb2[_0x3982f5(0x15f)]();try{const {result:_0x5eb39c}=await runTest(_0x5a1cfa[_0x3982f5(0x121)],_0x2bd9a9,{'agentId':_0x12466d,'projectId':_0x2a93ae,'site':_0x32b91e['site'],'noEval':![],'evaluatorId':_0x3298bc,'onRoundStart':(_0x21de15,_0x3e9225)=>{const _0x38735f=_0x3982f5;_0x7eafb2[_0x38735f(0x15a)]=_0x38735f(0x15e)+(_0x21de15+0x1)+'/'+_0x3e9225+_0x38735f(0xec);},'onRoundComplete':(_0x461ddc,_0x3bdc3b,_0xd22a32)=>{const _0x1874f0=_0x3982f5,_0x57ff50=formatElapsed(_0x3bdc3b);_0xd22a32?console['log'](_0x1874f0(0x16f)+(_0x461ddc+0x1)+'/'+_0x2bd9a9[_0x1874f0(0x11c)][_0x1874f0(0xfd)]+_0x1874f0(0x178)+a5_0x565188[_0x1874f0(0x149)]('✓')+'\x20('+_0x57ff50+')'):console['log'](_0x1874f0(0x16f)+(_0x461ddc+0x1)+'/'+_0x2bd9a9[_0x1874f0(0x11c)][_0x1874f0(0xfd)]+_0x1874f0(0x178)+a5_0x565188[_0x1874f0(0x104)]('✗'));},'onEvaluationStart':()=>{const _0x215b36=_0x3982f5;_0x7eafb2[_0x215b36(0x15a)]=_0x215b36(0x171);},'onEvaluationComplete':_0x31a421=>{const _0x50d86f=_0x3982f5,_0x3ddbfa=formatElapsed(_0x31a421);console['log'](_0x50d86f(0xfb)+a5_0x565188[_0x50d86f(0x149)]('✓')+'\x20('+_0x3ddbfa+')');}});_0x7eafb2[_0x3982f5(0x107)](),_0x282ca8[_0x3982f5(0x11d)](_0x5eb39c);if(_0x5eb39c[_0x3982f5(0x154)]===_0x3982f5(0x17a))console[_0x3982f5(0x120)](a5_0x565188['green'](_0x3982f5(0x156)+_0x5eb39c[_0x3982f5(0x106)])+a5_0x565188[_0x3982f5(0x100)](_0x3982f5(0x11a)));else _0x5eb39c[_0x3982f5(0x154)]===_0x3982f5(0x164)?console[_0x3982f5(0x120)](a5_0x565188['red'](_0x3982f5(0x130)+_0x5eb39c['reason'])+a5_0x565188[_0x3982f5(0x100)](_0x3982f5(0x11a))):console['log'](a5_0x565188[_0x3982f5(0x104)](_0x3982f5(0x13a)+_0x5eb39c[_0x3982f5(0x106)]));_0x5eb39c[_0x3982f5(0x13d)]&&console[_0x3982f5(0x120)](a5_0x565188[_0x3982f5(0x100)](_0x3982f5(0x147)+_0x5eb39c[_0x3982f5(0x13d)]));}catch(_0x28b509){_0x7eafb2[_0x3982f5(0x107)]();const _0x545d31=_0x28b509 instanceof Error?_0x28b509[_0x3982f5(0x177)]:String(_0x28b509);console[_0x3982f5(0x120)](a5_0x565188[_0x3982f5(0x104)]('✗\x20ERROR:\x20'+_0x545d31)),_0x282ca8['push']({'name':_0x2bd9a9['name'],'status':_0x3982f5(0x176),'reason':_0x545d31,'timestamp':new Date()[_0x3982f5(0x12e)](),'duration_ms':0x0});}}}console[_0x3982f5(0x120)]();const _0x466971=Date[_0x3982f5(0x12c)]()-_0xfd1db6,_0x3ccc0c=_0x282ca8['filter'](_0x98808b=>_0x98808b[_0x3982f5(0x154)]===_0x3982f5(0x17a))[_0x3982f5(0xfd)],_0x5a4f89=_0x282ca8[_0x3982f5(0x15b)](_0x842a=>_0x842a['status']===_0x3982f5(0x164))[_0x3982f5(0xfd)],_0x1b38c1=_0x282ca8['filter'](_0xb7612d=>_0xb7612d[_0x3982f5(0x154)]===_0x3982f5(0x176))[_0x3982f5(0xfd)];console[_0x3982f5(0x120)]('━'[_0x3982f5(0x159)](0x3c)),console[_0x3982f5(0x120)](_0x3982f5(0x12b)),console[_0x3982f5(0x120)]('━'[_0x3982f5(0x159)](0x3c)),console[_0x3982f5(0x120)]('Total:\x20\x20\x20\x20'+_0x282ca8[_0x3982f5(0xfd)]),console[_0x3982f5(0x120)](_0x3982f5(0xf7)+a5_0x565188[_0x3982f5(0x149)](_0x3ccc0c)),console[_0x3982f5(0x120)](_0x3982f5(0x144)+a5_0x565188[_0x3982f5(0x104)](_0x5a4f89));_0x1b38c1>0x0&&console[_0x3982f5(0x120)](_0x3982f5(0x113)+a5_0x565188[_0x3982f5(0x104)](_0x1b38c1));console[_0x3982f5(0x120)](_0x3982f5(0x146)+formatElapsed(_0x466971)),console['log']('━'[_0x3982f5(0x159)](0x3c));const _0x46a370={'summary':{'total':_0x282ca8[_0x3982f5(0xfd)],'passed':_0x3ccc0c,'failed':_0x5a4f89,'errors':_0x1b38c1>0x0?_0x1b38c1:undefined,'duration_ms':_0x466971},'tests':_0x282ca8,'agent':{'project':_0x190099[_0x3982f5(0x129)],'name':_0x190099[_0x3982f5(0x160)],'site':_0x3796e4},'timestamp':new Date(_0xfd1db6)[_0x3982f5(0x12e)]()};if(_0x11cc7b!=='table'||_0x4433e9){const _0xc0dc35=formatResults(_0x46a370,_0x11cc7b);if(_0x4433e9)try{a5_0x5ec645[_0x3982f5(0x12d)](_0x4433e9,_0xc0dc35,'utf-8'),console[_0x3982f5(0x120)](),console[_0x3982f5(0x120)](a5_0x565188[_0x3982f5(0x100)]('Output\x20written\x20to:\x20'+_0x4433e9));}catch(_0x1892d8){return console[_0x3982f5(0x120)](),console['log'](a5_0x565188['red'](_0x3982f5(0x157)+_0x1892d8)),0x1;}else console[_0x3982f5(0x120)](),console[_0x3982f5(0x120)](_0xc0dc35);}const _0x325423=_0x282ca8[_0x3982f5(0x15b)](_0x327177=>_0x327177[_0x3982f5(0x154)]!==_0x3982f5(0x17a));return _0x325423[_0x3982f5(0xfd)]>0x0?0x1:0x0;}}
1
+ const a5_0x51fdad=a5_0x5bb5;(function(_0x3b14ec,_0x86328b){const _0x5b32dd=a5_0x5bb5,_0xacc89=_0x3b14ec();while(!![]){try{const _0x4647d6=-parseInt(_0x5b32dd(0xf2))/0x1*(parseInt(_0x5b32dd(0x12c))/0x2)+-parseInt(_0x5b32dd(0x124))/0x3+-parseInt(_0x5b32dd(0xef))/0x4*(-parseInt(_0x5b32dd(0xee))/0x5)+-parseInt(_0x5b32dd(0x142))/0x6*(-parseInt(_0x5b32dd(0xec))/0x7)+parseInt(_0x5b32dd(0x138))/0x8+parseInt(_0x5b32dd(0x149))/0x9*(parseInt(_0x5b32dd(0xd4))/0xa)+-parseInt(_0x5b32dd(0x13a))/0xb*(parseInt(_0x5b32dd(0xf6))/0xc);if(_0x4647d6===_0x86328b)break;else _0xacc89['push'](_0xacc89['shift']());}catch(_0x1d83fa){_0xacc89['push'](_0xacc89['shift']());}}}(a5_0x4120,0xd1972));import*as a5_0x368b4c from'node:fs';function a5_0x4120(){const _0x138bb8=['site','\x20\x20Agent:\x20','\x22,\x20but\x20current\x20site\x20is\x20\x22','toLowerCase','add','tsv','found','Duration:\x20','No\x20tests\x20found\x20matching:\x20','ERROR','Error\x20writing\x20output\x20file:\x20','executeReeval','context','message','tags','2248056lGiJWD','no_context','toISOString','\x27\x20to\x20create\x20the\x20folder\x20structure.','table','New\x20tests\x20to\x20execute:\x20','round','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','196474kcPupx','\x20\x20Site:\x20','name','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','\x20-\x20','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','Running\x20agent\x20tests...','eval','reason','push','includes','4152024jeWlRC','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','286DGWhae','red','Re-evaluating\x20','✗\x20FAIL:\x20','join','Round\x20','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','\x20\x20Round\x20','84ppMsuJ','trim','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','dim','forEach','conversation_url','resolve','99LMlbcr','Project\x20path:\x20','\x20(new)','Re-evaluation\x20Summary','repeat','Run\x20tests\x20for\x20an\x20LLM\x20agent','writeFileSync','white','Output\x20written\x20to:\x20','isSpinning','resolveAgentId','Total:\x20\x20\x20\x20','agentName','\x20\x20Project:\x20','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','...','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','log','rounds','jsonl','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','Failed\x20Tests:','\x20\x20Conversation:\x20','Using\x20agent:\x20','description','Test\x20','FAIL','start','Re-evaluating\x20cached\x20test\x20run...','existsSync','no_tests','source','Passed:\x20\x20\x20','\x22:\x20','\x20\x20-\x20','green','Usage:','filter','597500YUJQVI','not\x20found','cyan','Failed:\x20\x20\x20','Tests\x20found:\x20','...\x20','Running:\x20','404','now','Round\x201/','No\x20tests\x20found\x20with\x20tags:\x20','text','Executing\x20new\x20tests...','size','✗\x20ERROR:\x20','Evaluating\x20response...','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','Either\x20switch\x20to\x20the\x20\x22','projectName','multiple_agents','projectDir','\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)','llmProject','Conversation\x20URL:\x20','396347zNeEPE','Test\x20Summary','5sbBwFJ','5186728zelPpz','status','agent:test','1VDaVyu','\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(cached)','Run\x20\x27tdx\x20agent\x20pull\x20','719796lHPsLx','Error:\x20No\x20previous\x20test\x20run\x20found.','stop','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','⚠\x20SKIPPED:\x20','some','agent','Errors:\x20\x20\x20','has','llm','✗\x20ERROR:\x20Project\x20not\x20found:\x20','utf-8','tests','Available\x20tags:\x20','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','Available\x20tests:\x20','/<agent-name>','map','find','PASS','length','\x20\x20Evaluating...\x20','yellow','output','Site:\x20',':\x20Sending\x20user\x20input...','No\x20tests\x20have\x20tags\x20defined.','reeval','timestamp','Agent:\x20','Cached\x20run\x20is\x20from\x20site\x20\x22'];a5_0x4120=function(){return _0x138bb8;};return a5_0x4120();}import*as a5_0x19d0ef from'node:path';import a5_0x5114ff from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';function a5_0x5bb5(_0x216a1b,_0x2aef58){_0x216a1b=_0x216a1b-0xb1;const _0x412017=a5_0x4120();let _0x5bb595=_0x412017[_0x216a1b];return _0x5bb595;}import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x51fdad(0x12e)]=a5_0x51fdad(0xf1);[a5_0x51fdad(0xc6)]=a5_0x51fdad(0xb3);async['execute'](_0x2d1b2c){const _0x7cf6d7=a5_0x51fdad,{options:_0x9aa1e,args:_0x1a7a64,tdx:_0x23f152}=_0x2d1b2c,_0x11265d=_0x1a7a64[0x0]||'.',_0x50ac11=_0x9aa1e['dryRun'],_0x50b2d6=_0x9aa1e,_0x1440a8=_0x50b2d6[_0x7cf6d7(0x134)]===![],_0x5e64b5=_0x50b2d6[_0x7cf6d7(0x111)],_0x343c3b=_0x50b2d6[_0x7cf6d7(0x12e)],_0x427d6c=_0x50b2d6[_0x7cf6d7(0x123)],_0x4e7836=_0x9aa1e[_0x7cf6d7(0x115)],_0x269fd1=_0x50b2d6[_0x7cf6d7(0x10d)];if(_0x5e64b5&&_0x1440a8)return console['log'](a5_0x5114ff[_0x7cf6d7(0x13b)](_0x7cf6d7(0xe4))),0x1;let _0x5375ef=_0x7cf6d7(0x128);if(_0x50b2d6['json'])_0x5375ef='json';else{if(_0x50b2d6[_0x7cf6d7(0xc1)])_0x5375ef=_0x7cf6d7(0xc1);else{if(_0x50b2d6['tsv'])_0x5375ef=_0x7cf6d7(0x11a);else{if(_0x50b2d6[_0x7cf6d7(0x128)])_0x5375ef=_0x7cf6d7(0x128);}}}const _0x22117e=_0x50b2d6[_0x7cf6d7(0xea)];let _0x58e311=_0x11265d;const _0x1c5ba5=a5_0x368b4c[_0x7cf6d7(0xcb)](_0x11265d),_0x306d10=_0x11265d==='.';if(!_0x1c5ba5||_0x306d10){const _0x16fa9f=resolveProjectFromContext(_0x11265d,_0x22117e,{'requireFile':'test.yml'});if(_0x16fa9f[_0x7cf6d7(0x11b)])_0x58e311=_0x16fa9f[_0x7cf6d7(0xe8)],_0x16fa9f[_0x7cf6d7(0xcd)]===_0x7cf6d7(0x121)&&console['log'](a5_0x5114ff[_0x7cf6d7(0x145)](_0x7cf6d7(0xc5)+_0x58e311));else switch(_0x16fa9f[_0x7cf6d7(0x135)]){case _0x7cf6d7(0x125):console[_0x7cf6d7(0xbf)](a5_0x5114ff[_0x7cf6d7(0x10c)](_0x16fa9f[_0x7cf6d7(0x122)])),console[_0x7cf6d7(0xbf)](),console['log'](_0x7cf6d7(0xd2)),console[_0x7cf6d7(0xbf)](_0x7cf6d7(0xf3)),console['log'](_0x7cf6d7(0xe9)),console[_0x7cf6d7(0xbf)](),console['log'](_0x7cf6d7(0xbe));return 0x1;case'no_local_folder':console['log'](a5_0x5114ff[_0x7cf6d7(0x10c)](_0x16fa9f['message'])),console['log'](),console['log'](_0x7cf6d7(0xf5)+_0x16fa9f[_0x7cf6d7(0xea)]+_0x7cf6d7(0x127));return 0x1;case _0x7cf6d7(0xe7):{const _0x8f911f=a5_0x19d0ef['basename'](_0x16fa9f['projectDir']);console[_0x7cf6d7(0xbf)](a5_0x5114ff[_0x7cf6d7(0x10c)](_0x7cf6d7(0x12f)+_0x16fa9f[_0x7cf6d7(0xea)]+'\x22:'));for(const _0xfba7 of _0x16fa9f['agentDirs']){console[_0x7cf6d7(0xbf)](_0x7cf6d7(0xd0)+_0xfba7);}return console['log'](),console[_0x7cf6d7(0xbf)](_0x7cf6d7(0x131)+_0x8f911f+_0x7cf6d7(0x106)),0x1;}case _0x7cf6d7(0xcc):console['log'](a5_0x5114ff['yellow']('No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22'+_0x16fa9f[_0x7cf6d7(0xea)]+'\x22.')),console['log'](a5_0x5114ff[_0x7cf6d7(0x145)](_0x7cf6d7(0x14a)+_0x16fa9f['projectDir'])),console[_0x7cf6d7(0xbf)](),console[_0x7cf6d7(0xbf)]('Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.');return 0x1;}}const {definition:_0x9b9ee6,agentInfo:_0x424eb1}=parseTestFile(_0x58e311);let _0x1e830f=_0x9b9ee6[_0x7cf6d7(0x102)];if(_0x343c3b){const _0xe4a4c2=_0x343c3b['split'](',')[_0x7cf6d7(0x107)](_0x168edf=>_0x168edf[_0x7cf6d7(0x143)]());_0x1e830f=_0x9b9ee6['tests'][_0x7cf6d7(0xd3)](_0x3f1729=>_0xe4a4c2[_0x7cf6d7(0x137)](_0x3f1729[_0x7cf6d7(0x12e)]));if(_0x1e830f['length']===0x0)return console['log'](a5_0x5114ff['yellow'](_0x7cf6d7(0x11d)+_0x343c3b)),console[_0x7cf6d7(0xbf)](a5_0x5114ff['dim'](_0x7cf6d7(0x105)+_0x9b9ee6[_0x7cf6d7(0x102)][_0x7cf6d7(0x107)](_0x2d89e8=>_0x2d89e8[_0x7cf6d7(0x12e)])[_0x7cf6d7(0x13e)](',\x20'))),0x1;}if(_0x427d6c){const _0x546dd9=_0x427d6c['split'](',')[_0x7cf6d7(0x107)](_0x48a601=>_0x48a601[_0x7cf6d7(0x143)]()['toLowerCase']());_0x1e830f=_0x1e830f[_0x7cf6d7(0xd3)](_0x3c64b3=>_0x3c64b3[_0x7cf6d7(0x123)]?.[_0x7cf6d7(0xfb)](_0x19fc7b=>_0x546dd9[_0x7cf6d7(0x137)](_0x19fc7b[_0x7cf6d7(0x118)]())));if(_0x1e830f['length']===0x0){console['log'](a5_0x5114ff[_0x7cf6d7(0x10c)](_0x7cf6d7(0xde)+_0x427d6c));const _0xa41230=new Set();return _0x9b9ee6[_0x7cf6d7(0x102)][_0x7cf6d7(0x146)](_0x2e1450=>_0x2e1450[_0x7cf6d7(0x123)]?.['forEach'](_0xbe9797=>_0xa41230[_0x7cf6d7(0x119)](_0xbe9797))),_0xa41230[_0x7cf6d7(0xe1)]>0x0?console['log'](a5_0x5114ff[_0x7cf6d7(0x145)](_0x7cf6d7(0x103)+[..._0xa41230][_0x7cf6d7(0x13e)](',\x20'))):console[_0x7cf6d7(0xbf)](a5_0x5114ff['dim'](_0x7cf6d7(0x110))),0x1;}}if(_0x5e64b5)return this[_0x7cf6d7(0x120)](_0x2d1b2c,{'definition':{'tests':_0x1e830f},'agentInfo':_0x424eb1,'outputFormat':_0x5375ef,'outputFile':_0x269fd1,'testNames':_0x343c3b});if(_0x50ac11){console['log'](a5_0x5114ff[_0x7cf6d7(0xd6)]('Test\x20Configuration:')),console['log'](_0x7cf6d7(0x12d)+a5_0x5114ff[_0x7cf6d7(0xb5)](_0x4e7836)),console['log'](_0x7cf6d7(0xbb)+a5_0x5114ff[_0x7cf6d7(0xb5)](_0x424eb1[_0x7cf6d7(0xe6)])),console[_0x7cf6d7(0xbf)](_0x7cf6d7(0x116)+a5_0x5114ff[_0x7cf6d7(0xb5)](_0x424eb1[_0x7cf6d7(0xba)])),console[_0x7cf6d7(0xbf)](),console['log'](_0x7cf6d7(0xd8)+a5_0x5114ff[_0x7cf6d7(0xb5)](_0x1e830f['length']));for(let _0xf2c20e=0x0;_0xf2c20e<_0x1e830f[_0x7cf6d7(0x10a)];_0xf2c20e++){const _0x575c83=_0x1e830f[_0xf2c20e],_0x590efb=_0x575c83['rounds'][_0x7cf6d7(0x10a)]===0x1?_0x7cf6d7(0x12a):_0x7cf6d7(0xc0),_0x392d67=_0x575c83['tags']?.['length']?'\x20['+_0x575c83[_0x7cf6d7(0x123)]['join'](',\x20')+']':'';console[_0x7cf6d7(0xbf)]('\x20\x20'+(_0xf2c20e+0x1)+'.\x20'+a5_0x5114ff['white'](_0x575c83[_0x7cf6d7(0x12e)])+'\x20('+_0x575c83[_0x7cf6d7(0xc0)][_0x7cf6d7(0x10a)]+'\x20'+_0x590efb+')'+a5_0x5114ff[_0x7cf6d7(0x145)](_0x392d67));}return 0x0;}let _0x8d8b94,_0x46246d;try{_0x8d8b94=await _0x23f152['llm']['resolveProjectId'](_0x424eb1['projectName']);}catch(_0xc6f10d){const _0x589e67=_0xc6f10d instanceof Error?_0xc6f10d[_0x7cf6d7(0x122)]:String(_0xc6f10d);return _0x589e67['includes']('404')||_0x589e67[_0x7cf6d7(0x118)]()[_0x7cf6d7(0x137)](_0x7cf6d7(0xd5))?console[_0x7cf6d7(0xbf)](a5_0x5114ff[_0x7cf6d7(0x13b)](_0x7cf6d7(0x100)+_0x424eb1['projectName'])):console['log'](a5_0x5114ff[_0x7cf6d7(0x13b)](_0x7cf6d7(0xf9)+_0x424eb1['projectName']+_0x7cf6d7(0xcf)+_0x589e67)),0x1;}try{_0x46246d=await _0x23f152[_0x7cf6d7(0xff)][_0x7cf6d7(0xb8)](_0x424eb1[_0x7cf6d7(0xba)],_0x8d8b94);}catch(_0xd9ebec){const _0xc4fd6e=_0xd9ebec instanceof Error?_0xd9ebec['message']:String(_0xd9ebec);return _0xc4fd6e[_0x7cf6d7(0x137)](_0x7cf6d7(0xdb))||_0xc4fd6e[_0x7cf6d7(0x118)]()[_0x7cf6d7(0x137)](_0x7cf6d7(0xd5))?console[_0x7cf6d7(0xbf)](a5_0x5114ff['red'](_0x7cf6d7(0x12b)+_0x424eb1['agentName'])):console['log'](a5_0x5114ff['red']('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22'+_0x424eb1[_0x7cf6d7(0xba)]+_0x7cf6d7(0xcf)+_0xc4fd6e)),0x1;}let _0x1948dd;if(!_0x1440a8)try{_0x1948dd=await setupEvaluatorAgent(_0x23f152[_0x7cf6d7(0xff)],_0x9aa1e['verbose']);}catch(_0x56bd15){const _0x488882=_0x56bd15 instanceof Error?_0x56bd15['message']:String(_0x56bd15);return console[_0x7cf6d7(0xbf)](a5_0x5114ff[_0x7cf6d7(0x13b)](_0x7cf6d7(0x139)+_0x488882)),0x1;}console[_0x7cf6d7(0xbf)](a5_0x5114ff[_0x7cf6d7(0xd6)](_0x7cf6d7(0x133))),console[_0x7cf6d7(0xbf)](_0x7cf6d7(0x10e)+a5_0x5114ff[_0x7cf6d7(0xb5)](_0x4e7836)),console['log'](_0x7cf6d7(0x113)+a5_0x5114ff[_0x7cf6d7(0xb5)](_0x424eb1[_0x7cf6d7(0xe6)]+'/'+_0x424eb1[_0x7cf6d7(0xba)])),console[_0x7cf6d7(0xbf)]();const _0x706691=[],_0x5f2feb=[],_0x859823=Date[_0x7cf6d7(0xdc)]();for(let _0x4d3fd3=0x0;_0x4d3fd3<_0x1e830f[_0x7cf6d7(0x10a)];_0x4d3fd3++){const _0x17708b=_0x1e830f[_0x4d3fd3];_0x1e830f[_0x7cf6d7(0x10a)]>0x1?console[_0x7cf6d7(0xbf)](_0x7cf6d7(0xc7)+(_0x4d3fd3+0x1)+'/'+_0x1e830f[_0x7cf6d7(0x10a)]+':\x20'+a5_0x5114ff[_0x7cf6d7(0xb5)](_0x17708b['name'])):console[_0x7cf6d7(0xbf)]('Running\x20test:\x20'+a5_0x5114ff[_0x7cf6d7(0xb5)](_0x17708b[_0x7cf6d7(0x12e)]));const _0x26f7b7=createCommandSpinner(_0x7cf6d7(0xdd)+_0x17708b[_0x7cf6d7(0xc0)][_0x7cf6d7(0x10a)]+_0x7cf6d7(0x10f));_0x26f7b7[_0x7cf6d7(0xc9)]();try{const {result:_0x4187e9,conversation:_0x208010}=await runTest(_0x23f152[_0x7cf6d7(0xff)],_0x17708b,{'agentId':_0x46246d,'projectId':_0x8d8b94,'site':_0x4e7836,'noEval':_0x1440a8,'evaluatorId':_0x1948dd,'onRoundStart':(_0x37b7b3,_0x2d1a7a)=>{const _0x3dcbd5=_0x7cf6d7;_0x26f7b7['text']=_0x3dcbd5(0x13f)+(_0x37b7b3+0x1)+'/'+_0x2d1a7a+_0x3dcbd5(0x10f);},'onRoundComplete':(_0x179f9f,_0x27a706,_0x3cfb3a)=>{const _0x5103e7=_0x7cf6d7,_0x1e6dbc=formatElapsed(_0x27a706);_0x3cfb3a?console[_0x5103e7(0xbf)](_0x5103e7(0x141)+(_0x179f9f+0x1)+'/'+_0x17708b[_0x5103e7(0xc0)][_0x5103e7(0x10a)]+_0x5103e7(0xd9)+a5_0x5114ff[_0x5103e7(0xd1)]('✓')+'\x20('+_0x1e6dbc+')'):console['log'](_0x5103e7(0x141)+(_0x179f9f+0x1)+'/'+_0x17708b[_0x5103e7(0xc0)][_0x5103e7(0x10a)]+_0x5103e7(0xd9)+a5_0x5114ff['red']('✗'));},'onEvaluationStart':()=>{const _0x52f23c=_0x7cf6d7;_0x26f7b7['text']=_0x52f23c(0xe3);},'onEvaluationComplete':_0x40edd1=>{const _0x551137=_0x7cf6d7,_0x366905=formatElapsed(_0x40edd1);console[_0x551137(0xbf)]('\x20\x20Evaluating...\x20'+a5_0x5114ff[_0x551137(0xd1)]('✓')+'\x20('+_0x366905+')');}});_0x26f7b7[_0x7cf6d7(0xf8)](),_0x706691[_0x7cf6d7(0x136)](_0x4187e9),_0x5f2feb['push'](_0x208010);if(_0x4187e9['status']===_0x7cf6d7(0x109))console[_0x7cf6d7(0xbf)](a5_0x5114ff['green']('✓\x20PASS:\x20'+_0x4187e9[_0x7cf6d7(0x135)]));else _0x4187e9['status']===_0x7cf6d7(0xc8)?console[_0x7cf6d7(0xbf)](a5_0x5114ff['red'](_0x7cf6d7(0x13d)+_0x4187e9['reason'])):console[_0x7cf6d7(0xbf)](a5_0x5114ff[_0x7cf6d7(0x13b)](_0x7cf6d7(0xe2)+_0x4187e9[_0x7cf6d7(0x135)]));_0x4187e9[_0x7cf6d7(0x147)]&&console['log'](a5_0x5114ff[_0x7cf6d7(0x145)](_0x7cf6d7(0xeb)+_0x4187e9[_0x7cf6d7(0x147)])),console['log']();}catch(_0x29335f){_0x26f7b7[_0x7cf6d7(0xf8)]();const _0x352107=_0x29335f instanceof Error?_0x29335f[_0x7cf6d7(0x122)]:String(_0x29335f);console[_0x7cf6d7(0xbf)](a5_0x5114ff[_0x7cf6d7(0x13b)](_0x7cf6d7(0xe2)+_0x352107)),console[_0x7cf6d7(0xbf)](),_0x706691[_0x7cf6d7(0x136)]({'name':_0x17708b[_0x7cf6d7(0x12e)],'status':_0x7cf6d7(0x11e),'reason':_0x352107,'timestamp':new Date()[_0x7cf6d7(0x126)](),'duration_ms':0x0});}}const _0x288ea4=Date[_0x7cf6d7(0xdc)]()-_0x859823,_0x3e912c=_0x706691[_0x7cf6d7(0xd3)](_0x136902=>_0x136902[_0x7cf6d7(0xf0)]===_0x7cf6d7(0x109))[_0x7cf6d7(0x10a)],_0x4d97aa=_0x706691[_0x7cf6d7(0xd3)](_0x28906f=>_0x28906f['status']===_0x7cf6d7(0xc8))[_0x7cf6d7(0x10a)],_0xae72c4=_0x706691[_0x7cf6d7(0xd3)](_0x12d437=>_0x12d437[_0x7cf6d7(0xf0)]===_0x7cf6d7(0x11e))['length'];console[_0x7cf6d7(0xbf)]('━'[_0x7cf6d7(0xb2)](0x3c)),console['log'](_0x7cf6d7(0xed)),console['log']('━'['repeat'](0x3c)),console[_0x7cf6d7(0xbf)](_0x7cf6d7(0xb9)+_0x706691['length']),console['log'](_0x7cf6d7(0xce)+a5_0x5114ff[_0x7cf6d7(0xd1)](_0x3e912c)),console[_0x7cf6d7(0xbf)]('Failed:\x20\x20\x20'+a5_0x5114ff['red'](_0x4d97aa));_0xae72c4>0x0&&console[_0x7cf6d7(0xbf)](_0x7cf6d7(0xfd)+a5_0x5114ff[_0x7cf6d7(0x13b)](_0xae72c4));console['log'](_0x7cf6d7(0x11c)+formatElapsed(_0x288ea4)),console[_0x7cf6d7(0xbf)]('━'[_0x7cf6d7(0xb2)](0x3c));const _0x2381f5=_0x706691[_0x7cf6d7(0xd3)](_0x2a89fc=>_0x2a89fc[_0x7cf6d7(0xf0)]!==_0x7cf6d7(0x109));if(_0x2381f5[_0x7cf6d7(0x10a)]>0x0){console[_0x7cf6d7(0xbf)](),console[_0x7cf6d7(0xbf)](_0x7cf6d7(0xc3));for(const _0x32ad0c of _0x2381f5){const _0x5e15c2=a5_0x5114ff['red']('✗'),_0x1cd833=_0x32ad0c[_0x7cf6d7(0x135)]['length']>0x32?_0x32ad0c[_0x7cf6d7(0x135)]['substring'](0x0,0x32)+_0x7cf6d7(0xbd):_0x32ad0c[_0x7cf6d7(0x135)];console[_0x7cf6d7(0xbf)]('\x20\x20'+_0x5e15c2+'\x20'+_0x32ad0c['name']+':\x20'+_0x1cd833);}}const _0x517bc3={'summary':{'total':_0x706691[_0x7cf6d7(0x10a)],'passed':_0x3e912c,'failed':_0x4d97aa,'errors':_0xae72c4>0x0?_0xae72c4:undefined,'duration_ms':_0x288ea4},'tests':_0x706691,'agent':{'project':_0x424eb1[_0x7cf6d7(0xe6)],'name':_0x424eb1[_0x7cf6d7(0xba)],'site':_0x4e7836},'timestamp':new Date(_0x859823)[_0x7cf6d7(0x126)]()};try{const _0x3f8d85=buildCachedTestRun(_0x5f2feb,{'site':_0x4e7836,'projectId':_0x8d8b94,'projectName':_0x424eb1[_0x7cf6d7(0xe6)],'agentId':_0x46246d,'agentName':_0x424eb1['agentName'],'testYmlPath':a5_0x19d0ef[_0x7cf6d7(0x148)](_0x424eb1['testYmlPath'])});saveLastTestRun(_0x3f8d85);}catch{}if(_0x5375ef!==_0x7cf6d7(0x128)||_0x269fd1){const _0x416a6a=formatResults(_0x517bc3,_0x5375ef);if(_0x269fd1)try{a5_0x368b4c[_0x7cf6d7(0xb4)](_0x269fd1,_0x416a6a,_0x7cf6d7(0x101)),console[_0x7cf6d7(0xbf)](),console[_0x7cf6d7(0xbf)](a5_0x5114ff[_0x7cf6d7(0x145)](_0x7cf6d7(0xb6)+_0x269fd1));}catch(_0x83aa99){return console[_0x7cf6d7(0xbf)](),console[_0x7cf6d7(0xbf)](a5_0x5114ff[_0x7cf6d7(0x13b)](_0x7cf6d7(0x11f)+_0x83aa99)),0x1;}else console[_0x7cf6d7(0xbf)](),console[_0x7cf6d7(0xbf)](_0x416a6a);}return _0x2381f5[_0x7cf6d7(0x10a)]>0x0?0x1:0x0;}async[a5_0x51fdad(0x120)](_0x5aeda8,_0x492c05){const _0x4f7a22=a5_0x51fdad,{options:_0x109dd7,tdx:_0xd2652}=_0x5aeda8,{definition:_0x2bb14a,agentInfo:_0x4b998a,outputFormat:_0x5e503c,outputFile:_0x475252}=_0x492c05,_0x5b0ceb=_0x109dd7[_0x4f7a22(0x115)],_0x25ace0=loadLastTestRun();if(!_0x25ace0)return console[_0x4f7a22(0xbf)](a5_0x5114ff['red'](_0x4f7a22(0xf7))),console['log'](a5_0x5114ff[_0x4f7a22(0x145)](_0x4f7a22(0x132))),0x1;if(_0x25ace0['agent'][_0x4f7a22(0xba)]!==_0x4b998a[_0x4f7a22(0xba)])return console[_0x4f7a22(0xbf)](a5_0x5114ff[_0x4f7a22(0x13b)](_0x4f7a22(0x140)+_0x25ace0[_0x4f7a22(0xfc)]['agentName']+_0x4f7a22(0x144)+_0x4b998a[_0x4f7a22(0xba)]+'\x22.')),console[_0x4f7a22(0xbf)](a5_0x5114ff[_0x4f7a22(0x145)](_0x4f7a22(0xbc))),0x1;const _0x5577f4=new Set(_0x25ace0['conversations'][_0x4f7a22(0x107)](_0x265869=>_0x265869['testName'])),_0x42385a=_0x2bb14a[_0x4f7a22(0x102)]['filter'](_0x44130c=>!_0x5577f4[_0x4f7a22(0xfe)](_0x44130c[_0x4f7a22(0x12e)]));if(_0x42385a[_0x4f7a22(0x10a)]>0x0&&_0x25ace0[_0x4f7a22(0x115)]!==_0x5b0ceb)return console[_0x4f7a22(0xbf)](a5_0x5114ff[_0x4f7a22(0x13b)]('Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.')),console[_0x4f7a22(0xbf)](a5_0x5114ff['dim'](_0x4f7a22(0x114)+_0x25ace0[_0x4f7a22(0x115)]+_0x4f7a22(0x117)+_0x5b0ceb+'\x22.')),console[_0x4f7a22(0xbf)](a5_0x5114ff['dim'](_0x4f7a22(0xe5)+_0x25ace0['site']+_0x4f7a22(0x104))),0x1;const _0x1ce20f=_0x2bb14a[_0x4f7a22(0x102)][_0x4f7a22(0xd3)](_0x4f1e49=>_0x5577f4[_0x4f7a22(0xfe)](_0x4f1e49['name'])),_0x11d6dd=_0x42385a;let _0x4e4f32;try{_0x4e4f32=await setupEvaluatorAgent(_0xd2652['llm'],_0x109dd7['verbose']);}catch(_0x4b73fb){const _0x19d3ad=_0x4b73fb instanceof Error?_0x4b73fb[_0x4f7a22(0x122)]:String(_0x4b73fb);return console['log'](a5_0x5114ff['red']('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x19d3ad)),0x1;}console[_0x4f7a22(0xbf)](a5_0x5114ff[_0x4f7a22(0xd6)](_0x4f7a22(0xca))),console[_0x4f7a22(0xbf)]('Cached\x20run\x20from:\x20'+a5_0x5114ff[_0x4f7a22(0xb5)](_0x25ace0[_0x4f7a22(0x112)])),console[_0x4f7a22(0xbf)](_0x4f7a22(0x113)+a5_0x5114ff[_0x4f7a22(0xb5)](_0x25ace0[_0x4f7a22(0xfc)][_0x4f7a22(0xe6)]+'/'+_0x25ace0[_0x4f7a22(0xfc)][_0x4f7a22(0xba)]));_0x11d6dd[_0x4f7a22(0x10a)]>0x0&&console[_0x4f7a22(0xbf)](_0x4f7a22(0x129)+a5_0x5114ff[_0x4f7a22(0x10c)](_0x11d6dd[_0x4f7a22(0x10a)]));console[_0x4f7a22(0xbf)]();const _0x4b4b3c=[],_0x20de4d=Date['now'](),_0x274f11=createCommandSpinner('Re-evaluating...');if(_0x1ce20f[_0x4f7a22(0x10a)]>0x0)try{const _0x40ba2f=await reevaluateFromCache(_0xd2652[_0x4f7a22(0xff)],_0x25ace0,{'tests':_0x1ce20f},{'evaluatorId':_0x4e4f32,'onTestStart':(_0x4ba5f4,_0x5e992c,_0x289b32)=>{const _0x2c67f7=_0x4f7a22;_0x274f11[_0x2c67f7(0xdf)]=_0x2c67f7(0x13c)+(_0x5e992c+0x1)+'/'+_0x289b32+':\x20'+_0x4ba5f4+_0x2c67f7(0xbd);if(!_0x274f11[_0x2c67f7(0xb7)])_0x274f11[_0x2c67f7(0xc9)]();},'onTestComplete':(_0x481d7b,_0xdad91e)=>{const _0x9dc638=_0x4f7a22;_0x274f11[_0x9dc638(0xf8)]();if(_0xdad91e['status']===_0x9dc638(0x109))console[_0x9dc638(0xbf)](a5_0x5114ff[_0x9dc638(0xd1)]('✓\x20PASS:\x20'+_0x481d7b)+a5_0x5114ff['dim'](_0x9dc638(0xf4)));else _0xdad91e[_0x9dc638(0xf0)]===_0x9dc638(0xc8)?console[_0x9dc638(0xbf)](a5_0x5114ff[_0x9dc638(0x13b)]('✗\x20FAIL:\x20'+_0x481d7b+'\x20-\x20'+_0xdad91e[_0x9dc638(0x135)])+a5_0x5114ff[_0x9dc638(0x145)]('\x20(cached)')):console[_0x9dc638(0xbf)](a5_0x5114ff[_0x9dc638(0x13b)]('✗\x20ERROR:\x20'+_0x481d7b+_0x9dc638(0x130)+_0xdad91e[_0x9dc638(0x135)]));_0xdad91e['conversation_url']&&console[_0x9dc638(0xbf)](a5_0x5114ff[_0x9dc638(0x145)](_0x9dc638(0xc4)+_0xdad91e['conversation_url'])),_0x4b4b3c[_0x9dc638(0x136)](_0xdad91e);},'onTestSkipped':(_0x24e4e7,_0x1c65e5)=>{const _0x7e019=_0x4f7a22;_0x274f11[_0x7e019(0xf8)](),console[_0x7e019(0xbf)](a5_0x5114ff['yellow'](_0x7e019(0xfa)+_0x24e4e7+_0x7e019(0x130)+_0x1c65e5));}});for(const _0x5e21a7 of _0x40ba2f){!_0x4b4b3c[_0x4f7a22(0x108)](_0x365378=>_0x365378[_0x4f7a22(0x12e)]===_0x5e21a7['name'])&&_0x4b4b3c[_0x4f7a22(0x136)](_0x5e21a7);}}catch(_0x3f5c65){_0x274f11[_0x4f7a22(0xf8)]();const _0x56a791=_0x3f5c65 instanceof Error?_0x3f5c65['message']:String(_0x3f5c65);return console['log'](a5_0x5114ff[_0x4f7a22(0x13b)](_0x4f7a22(0xc2)+_0x56a791)),0x1;}_0x274f11['stop']();if(_0x11d6dd[_0x4f7a22(0x10a)]>0x0){console[_0x4f7a22(0xbf)](),console[_0x4f7a22(0xbf)](a5_0x5114ff[_0x4f7a22(0xd6)](_0x4f7a22(0xe0)));const {projectId:_0x28de2a,agentId:_0x3303a2}=_0x25ace0[_0x4f7a22(0xfc)];for(const _0x46d543 of _0x11d6dd){console[_0x4f7a22(0xbf)](_0x4f7a22(0xda)+a5_0x5114ff['white'](_0x46d543[_0x4f7a22(0x12e)]));const _0xbe8443=createCommandSpinner('Round\x201/'+_0x46d543[_0x4f7a22(0xc0)][_0x4f7a22(0x10a)]+':\x20Sending\x20user\x20input...');_0xbe8443[_0x4f7a22(0xc9)]();try{const {result:_0x2e1ad1}=await runTest(_0xd2652[_0x4f7a22(0xff)],_0x46d543,{'agentId':_0x3303a2,'projectId':_0x28de2a,'site':_0x25ace0[_0x4f7a22(0x115)],'noEval':![],'evaluatorId':_0x4e4f32,'onRoundStart':(_0x4f4c99,_0x2d2f92)=>{const _0x247c50=_0x4f7a22;_0xbe8443[_0x247c50(0xdf)]=_0x247c50(0x13f)+(_0x4f4c99+0x1)+'/'+_0x2d2f92+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x25c116,_0x25b1c9,_0x4ac7d0)=>{const _0x481c11=_0x4f7a22,_0x41e1ab=formatElapsed(_0x25b1c9);_0x4ac7d0?console[_0x481c11(0xbf)](_0x481c11(0x141)+(_0x25c116+0x1)+'/'+_0x46d543[_0x481c11(0xc0)][_0x481c11(0x10a)]+_0x481c11(0xd9)+a5_0x5114ff[_0x481c11(0xd1)]('✓')+'\x20('+_0x41e1ab+')'):console[_0x481c11(0xbf)]('\x20\x20Round\x20'+(_0x25c116+0x1)+'/'+_0x46d543[_0x481c11(0xc0)][_0x481c11(0x10a)]+'...\x20'+a5_0x5114ff[_0x481c11(0x13b)]('✗'));},'onEvaluationStart':()=>{const _0x3a60cb=_0x4f7a22;_0xbe8443[_0x3a60cb(0xdf)]=_0x3a60cb(0xe3);},'onEvaluationComplete':_0x47190e=>{const _0x26a73f=_0x4f7a22,_0x10f174=formatElapsed(_0x47190e);console[_0x26a73f(0xbf)](_0x26a73f(0x10b)+a5_0x5114ff[_0x26a73f(0xd1)]('✓')+'\x20('+_0x10f174+')');}});_0xbe8443[_0x4f7a22(0xf8)](),_0x4b4b3c[_0x4f7a22(0x136)](_0x2e1ad1);if(_0x2e1ad1['status']===_0x4f7a22(0x109))console[_0x4f7a22(0xbf)](a5_0x5114ff[_0x4f7a22(0xd1)]('✓\x20PASS:\x20'+_0x2e1ad1['reason'])+a5_0x5114ff[_0x4f7a22(0x145)](_0x4f7a22(0x14b)));else _0x2e1ad1['status']===_0x4f7a22(0xc8)?console[_0x4f7a22(0xbf)](a5_0x5114ff[_0x4f7a22(0x13b)](_0x4f7a22(0x13d)+_0x2e1ad1[_0x4f7a22(0x135)])+a5_0x5114ff[_0x4f7a22(0x145)](_0x4f7a22(0x14b))):console[_0x4f7a22(0xbf)](a5_0x5114ff[_0x4f7a22(0x13b)]('✗\x20ERROR:\x20'+_0x2e1ad1[_0x4f7a22(0x135)]));_0x2e1ad1[_0x4f7a22(0x147)]&&console[_0x4f7a22(0xbf)](a5_0x5114ff[_0x4f7a22(0x145)](_0x4f7a22(0xc4)+_0x2e1ad1[_0x4f7a22(0x147)]));}catch(_0x8d314c){_0xbe8443[_0x4f7a22(0xf8)]();const _0x284868=_0x8d314c instanceof Error?_0x8d314c[_0x4f7a22(0x122)]:String(_0x8d314c);console[_0x4f7a22(0xbf)](a5_0x5114ff[_0x4f7a22(0x13b)](_0x4f7a22(0xe2)+_0x284868)),_0x4b4b3c['push']({'name':_0x46d543[_0x4f7a22(0x12e)],'status':_0x4f7a22(0x11e),'reason':_0x284868,'timestamp':new Date()[_0x4f7a22(0x126)](),'duration_ms':0x0});}}}console[_0x4f7a22(0xbf)]();const _0x9c7f77=Date[_0x4f7a22(0xdc)]()-_0x20de4d,_0x3e12a2=_0x4b4b3c[_0x4f7a22(0xd3)](_0x414ec1=>_0x414ec1[_0x4f7a22(0xf0)]===_0x4f7a22(0x109))['length'],_0x49c6a9=_0x4b4b3c[_0x4f7a22(0xd3)](_0x274903=>_0x274903[_0x4f7a22(0xf0)]===_0x4f7a22(0xc8))['length'],_0x35df72=_0x4b4b3c['filter'](_0x4c8e85=>_0x4c8e85[_0x4f7a22(0xf0)]===_0x4f7a22(0x11e))[_0x4f7a22(0x10a)];console[_0x4f7a22(0xbf)]('━'[_0x4f7a22(0xb2)](0x3c)),console[_0x4f7a22(0xbf)](_0x4f7a22(0xb1)),console[_0x4f7a22(0xbf)]('━'['repeat'](0x3c)),console[_0x4f7a22(0xbf)](_0x4f7a22(0xb9)+_0x4b4b3c['length']),console[_0x4f7a22(0xbf)](_0x4f7a22(0xce)+a5_0x5114ff[_0x4f7a22(0xd1)](_0x3e12a2)),console[_0x4f7a22(0xbf)](_0x4f7a22(0xd7)+a5_0x5114ff[_0x4f7a22(0x13b)](_0x49c6a9));_0x35df72>0x0&&console[_0x4f7a22(0xbf)]('Errors:\x20\x20\x20'+a5_0x5114ff[_0x4f7a22(0x13b)](_0x35df72));console[_0x4f7a22(0xbf)](_0x4f7a22(0x11c)+formatElapsed(_0x9c7f77)),console[_0x4f7a22(0xbf)]('━'['repeat'](0x3c));const _0xe7ce85={'summary':{'total':_0x4b4b3c[_0x4f7a22(0x10a)],'passed':_0x3e12a2,'failed':_0x49c6a9,'errors':_0x35df72>0x0?_0x35df72:undefined,'duration_ms':_0x9c7f77},'tests':_0x4b4b3c,'agent':{'project':_0x4b998a[_0x4f7a22(0xe6)],'name':_0x4b998a[_0x4f7a22(0xba)],'site':_0x5b0ceb},'timestamp':new Date(_0x20de4d)[_0x4f7a22(0x126)]()};if(_0x5e503c!=='table'||_0x475252){const _0x35211b=formatResults(_0xe7ce85,_0x5e503c);if(_0x475252)try{a5_0x368b4c['writeFileSync'](_0x475252,_0x35211b,_0x4f7a22(0x101)),console[_0x4f7a22(0xbf)](),console['log'](a5_0x5114ff[_0x4f7a22(0x145)](_0x4f7a22(0xb6)+_0x475252));}catch(_0x4e5fc2){return console[_0x4f7a22(0xbf)](),console[_0x4f7a22(0xbf)](a5_0x5114ff[_0x4f7a22(0x13b)]('Error\x20writing\x20output\x20file:\x20'+_0x4e5fc2)),0x1;}else console['log'](),console[_0x4f7a22(0xbf)](_0x35211b);}const _0x51a0ad=_0x4b4b3c['filter'](_0x50ee84=>_0x50ee84['status']!==_0x4f7a22(0x109));return _0x51a0ad[_0x4f7a22(0x10a)]>0x0?0x1:0x0;}}
@@ -1 +1 @@
1
- function a6_0x46e4(){const _0x409645=['DELETE','headers','415112mjxsCv','trim','validate','entries','readBodyFromFile','verbose','join','Invalid\x20API\x20type:\x20','keys','stack','indexOf','log','x-xsrf-token','error','POST','4700829LLikup','PUT','description','length','1728664KdIowg','46677612DmKKFz','.\x20Valid\x20types:\x20','cdp','Endpoint\x20must\x20start\x20with\x20/:\x20','body','includes','method','status','llm','toLowerCase','data','execute','27ADmaaA','has','isArray','\x22.\x20','header','11ZDDOOE','message','38aweaEJ','set-cookie','x-auth-token','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','file','color','toUpperCase','24IlSQSG','Results\x20saved\x20to\x20','name','GET','site','api','startsWith','Error:\x20','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','11866570znebHU','cookie','12703WcrPXf','trino','4dUZxnK','substring','noColor','type','output','proxy-authorization','Invalid\x20HTTP\x20method:\x20','4681255WsatSz','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','set-cookie2'];a6_0x46e4=function(){return _0x409645;};return a6_0x46e4();}const a6_0x114ed4=a6_0x23d9;(function(_0x6adc84,_0x51c13b){const _0x227015=a6_0x23d9,_0x38d837=_0x6adc84();while(!![]){try{const _0x299a58=parseInt(_0x227015(0x173))/0x1*(-parseInt(_0x227015(0x160))/0x2)+-parseInt(_0x227015(0x148))/0x3+parseInt(_0x227015(0x175))/0x4*(parseInt(_0x227015(0x134))/0x5)+-parseInt(_0x227015(0x167))/0x6*(parseInt(_0x227015(0x14c))/0x7)+parseInt(_0x227015(0x139))/0x8*(parseInt(_0x227015(0x159))/0x9)+-parseInt(_0x227015(0x171))/0xa+parseInt(_0x227015(0x15e))/0xb*(parseInt(_0x227015(0x14d))/0xc);if(_0x299a58===_0x51c13b)break;else _0x38d837['push'](_0x38d837['shift']());}catch(_0x324277){_0x38d837['push'](_0x38d837['shift']());}}}(a6_0x46e4,0xf3e2a));function a6_0x23d9(_0x21ab24,_0xd443e3){_0x21ab24=_0x21ab24-0x131;const _0x46e4f2=a6_0x46e4();let _0x23d9cb=_0x46e4f2[_0x21ab24];return _0x23d9cb;}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(['authorization',a6_0x114ed4(0x132),a6_0x114ed4(0x172),a6_0x114ed4(0x161),a6_0x114ed4(0x136),a6_0x114ed4(0x145),a6_0x114ed4(0x162),'x-trino-user']);function isSensitiveHeader(_0x54a56b){const _0x316e4d=a6_0x114ed4;return SENSITIVE_HEADERS[_0x316e4d(0x15a)](_0x54a56b[_0x316e4d(0x156)]());}function parseHeader(_0x4f7d45){const _0x3f0cd6=a6_0x114ed4,_0x4a286b=_0x4f7d45[_0x3f0cd6(0x143)](':');if(_0x4a286b===-0x1)throw new Error('Invalid\x20header\x20format:\x20\x22'+_0x4f7d45+_0x3f0cd6(0x15c)+'Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22');const _0x52439a=_0x4f7d45[_0x3f0cd6(0x176)](0x0,_0x4a286b)['trim'](),_0x5e6eba=_0x4f7d45[_0x3f0cd6(0x176)](_0x4a286b+0x1)[_0x3f0cd6(0x13a)]();if(!_0x52439a)throw new Error(_0x3f0cd6(0x163)+_0x4f7d45+'\x22');return[_0x52439a,_0x5e6eba];}export class ApiCommand extends BaseCommand{[a6_0x114ed4(0x169)]=a6_0x114ed4(0x16c);[a6_0x114ed4(0x14a)]=a6_0x114ed4(0x16f);[a6_0x114ed4(0x13b)](_0x8a7e72){const _0x25b564=a6_0x114ed4,{args:_0x118dd8,options:_0x3fe830}=_0x8a7e72,_0x5a1b4c=_0x3fe830;if(_0x118dd8[_0x25b564(0x14b)]===0x0)return _0x25b564(0x170);const _0x2c89bf=_0x118dd8[0x0];if(!_0x2c89bf[_0x25b564(0x16d)]('/'))return _0x25b564(0x150)+_0x2c89bf;const _0x26969b=_0x5a1b4c[_0x25b564(0x157)],_0x2e4f67=_0x5a1b4c[_0x25b564(0x164)];if(_0x26969b&&_0x2e4f67)return _0x25b564(0x135);const _0x501fe2=_0x5a1b4c[_0x25b564(0x153)]||'GET',_0x5082fc=[_0x25b564(0x16a),_0x25b564(0x147),_0x25b564(0x149),_0x25b564(0x137),'PATCH'];if(!_0x5082fc[_0x25b564(0x152)](_0x501fe2[_0x25b564(0x166)]()))return _0x25b564(0x133)+_0x501fe2+'.\x20Valid\x20methods:\x20'+_0x5082fc['join'](',\x20');const _0xfa7e03=_0x5a1b4c['type']||'td',_0xb8e4af=['td',_0x25b564(0x14f),'workflow',_0x25b564(0x174),_0x25b564(0x155),'llm-proxy'];if(!_0xb8e4af[_0x25b564(0x152)](_0xfa7e03))return _0x25b564(0x140)+_0xfa7e03+_0x25b564(0x14e)+_0xb8e4af[_0x25b564(0x13f)](',\x20');return undefined;}async[a6_0x114ed4(0x158)](_0x503d1e){const _0x417dd5=a6_0x114ed4,{options:_0x371fcf,args:_0x3c9b49,tdx:_0x806433}=_0x503d1e,_0x492275=_0x371fcf,_0x372d7e=_0x3c9b49[0x0],_0x5122f7=(_0x492275[_0x417dd5(0x153)]||_0x417dd5(0x16a))[_0x417dd5(0x166)](),_0x13614f=_0x492275['data'],_0x39fe9b=_0x492275['file'],_0x4d4b51=_0x492275[_0x417dd5(0x15d)],_0x32cbe7=_0x492275[_0x417dd5(0x178)]||'td';try{const _0xb77e05={};if(_0x4d4b51){const _0x362720=Array[_0x417dd5(0x15b)](_0x4d4b51)?_0x4d4b51:[_0x4d4b51];for(const _0x27ac6c of _0x362720){const [_0x143dee,_0x33c114]=parseHeader(_0x27ac6c);_0xb77e05[_0x143dee]=_0x33c114;}}let _0x318406;if(_0x13614f)_0x318406=_0x13614f;else{if(_0x39fe9b)try{_0x318406=RawAPI[_0x417dd5(0x13d)](_0x39fe9b);}catch(_0x4986c5){return console[_0x417dd5(0x146)](_0x417dd5(0x16e)+(_0x4986c5 instanceof Error?_0x4986c5[_0x417dd5(0x15f)]:String(_0x4986c5))),0x1;}}const _0x5e8aa2={'method':_0x5122f7,'apiType':_0x32cbe7,'includeHeaders':_0x371fcf[_0x417dd5(0x13e)]};_0x318406&&(_0x5e8aa2[_0x417dd5(0x151)]=_0x318406);Object[_0x417dd5(0x141)](_0xb77e05)[_0x417dd5(0x14b)]>0x0&&(_0x5e8aa2[_0x417dd5(0x138)]=_0xb77e05);if(_0x371fcf[_0x417dd5(0x13e)]){const _0x256da9=resolveSite(_0x371fcf[_0x417dd5(0x16b)]),_0x49be9b=getEndpoint(_0x256da9,_0x32cbe7),_0x2c24ce=''+_0x49be9b+_0x372d7e;console[_0x417dd5(0x146)]('>\x20'+_0x5122f7+'\x20'+_0x2c24ce);const _0x2078d9=getAuthHeaders(_0x256da9),_0x142219={..._0x2078d9,..._0xb77e05};for(const [_0x4c6b3e,_0x424b86]of Object['entries'](_0x142219)){!isSensitiveHeader(_0x4c6b3e)&&console[_0x417dd5(0x146)]('>\x20'+_0x4c6b3e+':\x20'+_0x424b86);}_0x318406&&console[_0x417dd5(0x146)]('>'),console['error']('');}const _0x3eac2a=await _0x806433['api']['request'](_0x372d7e,_0x5e8aa2);if(_0x371fcf[_0x417dd5(0x13e)]&&_0x3eac2a[_0x417dd5(0x138)]){console[_0x417dd5(0x146)]('<\x20HTTP/1.1\x20'+_0x3eac2a[_0x417dd5(0x154)]);for(const [_0x29acc9,_0x27caa4]of Object[_0x417dd5(0x13c)](_0x3eac2a[_0x417dd5(0x138)])){!isSensitiveHeader(_0x29acc9)&&console['error']('<\x20'+_0x29acc9+':\x20'+_0x27caa4);}console[_0x417dd5(0x146)]('');}const _0xbf939f=Boolean(_0x371fcf['output']),_0x4bcf9a={'color':_0x371fcf[_0x417dd5(0x165)],'noColor':_0x371fcf[_0x417dd5(0x177)]||_0xbf939f&&!_0x371fcf[_0x417dd5(0x165)]},_0x4b77e2=colorizeJSON(_0x3eac2a[_0x417dd5(0x157)],_0x4bcf9a);return _0x371fcf[_0x417dd5(0x131)]?(writeFileSync(_0x371fcf['output'],_0x4b77e2),console[_0x417dd5(0x146)](_0x417dd5(0x168)+_0x371fcf['output'])):console[_0x417dd5(0x144)](_0x4b77e2),0x0;}catch(_0x4631dc){return _0x4631dc instanceof Error?(console[_0x417dd5(0x146)](_0x417dd5(0x16e)+_0x4631dc[_0x417dd5(0x15f)]),_0x371fcf[_0x417dd5(0x13e)]&&_0x4631dc[_0x417dd5(0x142)]&&console['error']('\x0aStack\x20trace:\x0a'+_0x4631dc[_0x417dd5(0x142)])):console[_0x417dd5(0x146)](_0x417dd5(0x16e)+String(_0x4631dc)),0x1;}}}
1
+ const a6_0x45993c=a6_0x5a78;(function(_0x541e50,_0x5d3241){const _0x44ed37=a6_0x5a78,_0x458498=_0x541e50();while(!![]){try{const _0x35d283=-parseInt(_0x44ed37(0x192))/0x1+parseInt(_0x44ed37(0x1b3))/0x2*(parseInt(_0x44ed37(0x198))/0x3)+parseInt(_0x44ed37(0x17e))/0x4*(parseInt(_0x44ed37(0x18b))/0x5)+parseInt(_0x44ed37(0x1a2))/0x6+parseInt(_0x44ed37(0x189))/0x7*(-parseInt(_0x44ed37(0x18a))/0x8)+parseInt(_0x44ed37(0x17b))/0x9*(-parseInt(_0x44ed37(0x1bb))/0xa)+parseInt(_0x44ed37(0x17d))/0xb;if(_0x35d283===_0x5d3241)break;else _0x458498['push'](_0x458498['shift']());}catch(_0x280bbd){_0x458498['push'](_0x458498['shift']());}}}(a6_0x1d74,0x223c5));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';function a6_0x1d74(){const _0x5bb313=['998634iaVaSP','verbose','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','x-auth-token','proxy-authorization','substring','trim','GET','output','startsWith','message','body','length','Results\x20saved\x20to\x20','join','noColor','type','2GgZAAw','POST','set-cookie','cdp','error','request','.\x20Valid\x20methods:\x20','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','20sreKFk','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','set-cookie2','name','x-trino-user','readBodyFromFile','721998weSJvb','site','2937814lPujUZ','4ONztts','llm-proxy','indexOf','method','description','data','execute','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','PATCH','DELETE','\x22.\x20','7IxTLeV','1606808RpPNyy','1034745rGoKld','entries','keys','toLowerCase','Error:\x20','api','PUT','176320rFIHgU','isArray','file','llm','color','Invalid\x20API\x20type:\x20','112146bKBvkO','workflow','has','toUpperCase','validate','trino','Invalid\x20HTTP\x20method:\x20','headers','\x0aStack\x20trace:\x0a','stack'];a6_0x1d74=function(){return _0x5bb313;};return a6_0x1d74();}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',a6_0x45993c(0x1a6),'cookie',a6_0x45993c(0x1b5),a6_0x45993c(0x1bd),'x-xsrf-token',a6_0x45993c(0x1a5),a6_0x45993c(0x1bf)]);function isSensitiveHeader(_0x1cecd3){const _0x24f854=a6_0x45993c;return SENSITIVE_HEADERS[_0x24f854(0x19a)](_0x1cecd3[_0x24f854(0x18e)]());}function parseHeader(_0x5acf8b){const _0x6e7b95=a6_0x45993c,_0x5d1b00=_0x5acf8b[_0x6e7b95(0x180)](':');if(_0x5d1b00===-0x1)throw new Error('Invalid\x20header\x20format:\x20\x22'+_0x5acf8b+_0x6e7b95(0x188)+_0x6e7b95(0x185));const _0x40241e=_0x5acf8b[_0x6e7b95(0x1a7)](0x0,_0x5d1b00)[_0x6e7b95(0x1a8)](),_0x1b79bc=_0x5acf8b['substring'](_0x5d1b00+0x1)['trim']();if(!_0x40241e)throw new Error(_0x6e7b95(0x1ba)+_0x5acf8b+'\x22');return[_0x40241e,_0x1b79bc];}function a6_0x5a78(_0x4b1622,_0x5f402f){_0x4b1622=_0x4b1622-0x17b;const _0x1d7454=a6_0x1d74();let _0x5a7809=_0x1d7454[_0x4b1622];return _0x5a7809;}export class ApiCommand extends BaseCommand{[a6_0x45993c(0x1be)]=a6_0x45993c(0x190);[a6_0x45993c(0x182)]=a6_0x45993c(0x1a4);[a6_0x45993c(0x19c)](_0x1ad9c8){const _0x14c9d2=a6_0x45993c,{args:_0x31aa9e,options:_0x39e6c2}=_0x1ad9c8,_0x1cca12=_0x39e6c2;if(_0x31aa9e[_0x14c9d2(0x1ae)]===0x0)return _0x14c9d2(0x1bc);const _0x20972b=_0x31aa9e[0x0];if(!_0x20972b[_0x14c9d2(0x1ab)]('/'))return'Endpoint\x20must\x20start\x20with\x20/:\x20'+_0x20972b;const _0x54ada4=_0x1cca12[_0x14c9d2(0x183)],_0x3d9696=_0x1cca12[_0x14c9d2(0x194)];if(_0x54ada4&&_0x3d9696)return'Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.';const _0x341584=_0x1cca12[_0x14c9d2(0x181)]||_0x14c9d2(0x1a9),_0x465249=['GET',_0x14c9d2(0x1b4),_0x14c9d2(0x191),_0x14c9d2(0x187),_0x14c9d2(0x186)];if(!_0x465249['includes'](_0x341584[_0x14c9d2(0x19b)]()))return _0x14c9d2(0x19e)+_0x341584+_0x14c9d2(0x1b9)+_0x465249['join'](',\x20');const _0x580ad7=_0x1cca12[_0x14c9d2(0x1b2)]||'td',_0x4b9065=['td',_0x14c9d2(0x1b6),_0x14c9d2(0x199),_0x14c9d2(0x19d),_0x14c9d2(0x195),_0x14c9d2(0x17f)];if(!_0x4b9065['includes'](_0x580ad7))return _0x14c9d2(0x197)+_0x580ad7+'.\x20Valid\x20types:\x20'+_0x4b9065[_0x14c9d2(0x1b0)](',\x20');return undefined;}async[a6_0x45993c(0x184)](_0x320d16){const _0x480bdb=a6_0x45993c,{options:_0x174f02,args:_0x58e087,tdx:_0x57d643}=_0x320d16,_0x2ee458=_0x174f02,_0x2e75dd=_0x58e087[0x0],_0x548693=(_0x2ee458[_0x480bdb(0x181)]||'GET')[_0x480bdb(0x19b)](),_0x1c845a=_0x2ee458[_0x480bdb(0x183)],_0x2019cd=_0x2ee458[_0x480bdb(0x194)],_0x2cd178=_0x2ee458['header'],_0x3e43d3=_0x2ee458[_0x480bdb(0x1b2)]||'td';try{const _0x1b3d9a={};if(_0x2cd178){const _0x26e2a2=Array[_0x480bdb(0x193)](_0x2cd178)?_0x2cd178:[_0x2cd178];for(const _0x13044e of _0x26e2a2){const [_0x49afbe,_0x38dbc5]=parseHeader(_0x13044e);_0x1b3d9a[_0x49afbe]=_0x38dbc5;}}let _0xff70d6;if(_0x1c845a)_0xff70d6=_0x1c845a;else{if(_0x2019cd)try{_0xff70d6=RawAPI[_0x480bdb(0x1c0)](_0x2019cd);}catch(_0x34e63d){return console[_0x480bdb(0x1b7)](_0x480bdb(0x18f)+(_0x34e63d instanceof Error?_0x34e63d[_0x480bdb(0x1ac)]:String(_0x34e63d))),0x1;}}const _0x1e5aa9={'method':_0x548693,'apiType':_0x3e43d3,'includeHeaders':_0x174f02[_0x480bdb(0x1a3)]};_0xff70d6&&(_0x1e5aa9[_0x480bdb(0x1ad)]=_0xff70d6);Object[_0x480bdb(0x18d)](_0x1b3d9a)[_0x480bdb(0x1ae)]>0x0&&(_0x1e5aa9[_0x480bdb(0x19f)]=_0x1b3d9a);if(_0x174f02[_0x480bdb(0x1a3)]){const _0x299f27=resolveSite(_0x174f02[_0x480bdb(0x17c)]),_0x1b3189=getEndpoint(_0x299f27,_0x3e43d3),_0x5795cc=''+_0x1b3189+_0x2e75dd;console[_0x480bdb(0x1b7)]('>\x20'+_0x548693+'\x20'+_0x5795cc);const _0x3c53f4=getAuthHeaders(_0x299f27),_0xa4961a={..._0x3c53f4,..._0x1b3d9a};for(const [_0x1396fa,_0x2786a6]of Object[_0x480bdb(0x18c)](_0xa4961a)){!isSensitiveHeader(_0x1396fa)&&console[_0x480bdb(0x1b7)]('>\x20'+_0x1396fa+':\x20'+_0x2786a6);}_0xff70d6&&console[_0x480bdb(0x1b7)]('>'),console[_0x480bdb(0x1b7)]('');}const _0x27fd52=await _0x57d643[_0x480bdb(0x190)][_0x480bdb(0x1b8)](_0x2e75dd,_0x1e5aa9);if(_0x174f02[_0x480bdb(0x1a3)]&&_0x27fd52[_0x480bdb(0x19f)]){console[_0x480bdb(0x1b7)]('<\x20HTTP/1.1\x20'+_0x27fd52['status']);for(const [_0x3999e9,_0x57c676]of Object[_0x480bdb(0x18c)](_0x27fd52['headers'])){!isSensitiveHeader(_0x3999e9)&&console['error']('<\x20'+_0x3999e9+':\x20'+_0x57c676);}console[_0x480bdb(0x1b7)]('');}const _0x3443c3=Boolean(_0x174f02[_0x480bdb(0x1aa)]),_0x2ab040={'color':_0x174f02[_0x480bdb(0x196)],'noColor':_0x174f02[_0x480bdb(0x1b1)]||_0x3443c3&&!_0x174f02[_0x480bdb(0x196)]},_0x1200b5=colorizeJSON(_0x27fd52['data'],_0x2ab040);return _0x174f02[_0x480bdb(0x1aa)]?(writeFileSync(_0x174f02['output'],_0x1200b5),console[_0x480bdb(0x1b7)](_0x480bdb(0x1af)+_0x174f02[_0x480bdb(0x1aa)])):console['log'](_0x1200b5),0x0;}catch(_0x32782e){return _0x32782e instanceof Error?(console[_0x480bdb(0x1b7)](_0x480bdb(0x18f)+_0x32782e[_0x480bdb(0x1ac)]),_0x174f02[_0x480bdb(0x1a3)]&&_0x32782e['stack']&&console[_0x480bdb(0x1b7)](_0x480bdb(0x1a0)+_0x32782e[_0x480bdb(0x1a1)])):console[_0x480bdb(0x1b7)](_0x480bdb(0x18f)+String(_0x32782e)),0x1;}}}
@@ -1 +1 @@
1
- const a7_0x3c713d=a7_0x18e4;(function(_0x107cb3,_0x3da0e3){const _0x42acac=a7_0x18e4,_0x245efe=_0x107cb3();while(!![]){try{const _0x52100b=parseInt(_0x42acac(0x118))/0x1*(parseInt(_0x42acac(0xed))/0x2)+-parseInt(_0x42acac(0xfd))/0x3*(parseInt(_0x42acac(0xf5))/0x4)+parseInt(_0x42acac(0x105))/0x5+-parseInt(_0x42acac(0x11a))/0x6*(-parseInt(_0x42acac(0x112))/0x7)+parseInt(_0x42acac(0x10d))/0x8*(-parseInt(_0x42acac(0x106))/0x9)+parseInt(_0x42acac(0xfb))/0xa+-parseInt(_0x42acac(0x11d))/0xb;if(_0x52100b===_0x3da0e3)break;else _0x245efe['push'](_0x245efe['shift']());}catch(_0x3f25db){_0x245efe['push'](_0x245efe['shift']());}}}(a7_0x17f3,0xbce68));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens}from'../core/oauth-keychain.js';function a7_0x18e4(_0x6afb11,_0x308f06){_0x6afb11=_0x6afb11-0xd9;const _0x17f3a3=a7_0x17f3();let _0x18e4da=_0x17f3a3[_0x6afb11];return _0x18e4da;}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_0x210644 from'prompts';import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';function a7_0x17f3(){const _0x368191=['tdx:\x20auth\x20setup','User:\x20','OAuth\x20(browser\x20login)','API\x20Key','logLevel','us01','216Clkchm','✓\x20Profile\x20\x27','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','\x20\x20tdx','auth','69083XOFopY','log','trim','Remove\x20API\x20key\x20from\x20system\x20keychain','method','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','27KDKYNH','tdx:\x20auth\x20clear','42HNwDvg','\x20(profile:\x20','getUserInfo','13404226yEaloL','yellow','auth:clear','ERROR','email','Read\x20credential\x20from\x20keychain','OAuth\x20tokens','password','warn','\x20and\x20','N/A','\x20removed\x20from\x20keychain','first_name','name','Enter\x20your\x20TD\x20API\x20key:','✗\x20Validation\x20failed:\x20','profile','apiKey','tdx\x20profile:\x20','message','red','Name:\x20','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','jobs','\x20(site:\x20','oauth','75434SVHYzx','/app/mp/ak','join','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','bold','Setup\x20API\x20key\x20authentication\x20interactively','API\x20key','\x0aSetup\x20cancelled','2747180ChEizL','error','No\x20credentials\x20found\x20in\x20keychain','description','execute','last_name','12665450FrLVAy','status','3eexqLf','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','System\x20keychain\x20is\x20not\x20available','Setup\x20cancelled','all','green','Setting\x20up\x20authentication\x20for\x20site:\x20','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','2478615vDEdbQ','56871lMszXb'];a7_0x17f3=function(){return _0x368191;};return a7_0x17f3();}import{LogLevel}from'../utils/tdx-logger.js';import a7_0x134ac1 from'chalk';export class AuthSetupCommand extends BaseCommand{[a7_0x3c713d(0xe0)]='auth:setup';[a7_0x3c713d(0xf8)]=a7_0x3c713d(0xf2);async[a7_0x3c713d(0xf9)](_0x2b4a1d){const _0x481d55=a7_0x3c713d,{options:_0x25aae8}=_0x2b4a1d,_0x43b79d=_0x25aae8[_0x481d55(0xe3)];console['log'](a7_0x134ac1[_0x481d55(0xf1)](_0x481d55(0x107)));const _0xb6d035=_0x25aae8['site']||_0x481d55(0x10c),_0x1362dd=await promptSiteSelection(_0xb6d035,_0x43b79d,_0x481d55(0x100));if(!_0x1362dd)return 0x1;const _0x51b30a=resolveSite(_0x1362dd);if(isOAuthSupported(_0x51b30a)){const _0x43a3a3=await a7_0x210644({'type':'select','name':_0x481d55(0x116),'message':'Choose\x20authentication\x20method:','choices':[{'title':_0x481d55(0x109),'value':'oauth'},{'title':_0x481d55(0x10a),'value':'apikey'}]});if(!_0x43a3a3[_0x481d55(0x116)])return console[_0x481d55(0x113)]('\x0aSetup\x20cancelled'),0x1;if(_0x43a3a3[_0x481d55(0x116)]===_0x481d55(0xec))return await runOAuthLoginFlow(_0x51b30a,_0x43b79d,_0x25aae8[_0x481d55(0x10b)]??LogLevel['ERROR']),0x0;}console[_0x481d55(0x113)](_0x481d55(0x103)+_0x51b30a),console['log']('You\x20can\x20find\x20your\x20API\x20key\x20at:'),console[_0x481d55(0x113)]('\x20\x20'+getConsoleUrl(_0x51b30a,_0x481d55(0xee)));const _0x3fd23b=await a7_0x210644({'type':_0x481d55(0xda),'name':_0x481d55(0xe4),'message':_0x481d55(0xe1),'validate':_0x483e62=>{if(!_0x483e62||!_0x483e62['trim']())return'API\x20key\x20cannot\x20be\x20empty';return!![];}});if(!_0x3fd23b[_0x481d55(0xe4)])return console[_0x481d55(0x113)](_0x481d55(0xf4)),0x1;const _0x31c0cc=_0x3fd23b['apiKey'];console[_0x481d55(0x113)]('Validating\x20API\x20key...');try{const _0x147f40=TDX['create']({'site':_0x51b30a,'apiKey':_0x31c0cc[_0x481d55(0x114)](),'logLevel':_0x25aae8[_0x481d55(0x10b)]??LogLevel[_0x481d55(0x120)]}),_0xf0f559=await _0x147f40[_0x481d55(0xea)][_0x481d55(0x11c)]();console['log']('✓\x20API\x20key\x20is\x20valid\x20(User:\x20'+_0xf0f559[_0x481d55(0x121)]+')');const _0x3f3808=await isKeychainAvailable();_0x3f3808?(await saveAPIKeyAsync(_0x31c0cc[_0x481d55(0x114)](),_0x51b30a,_0x43b79d),console[_0x481d55(0x113)](_0x481d55(0x104)+(_0x43b79d?_0x481d55(0x11b)+_0x43b79d+')':''))):(console[_0x481d55(0xdb)](a7_0x134ac1['yellow'](_0x481d55(0xf0))),console[_0x481d55(0xdb)](a7_0x134ac1['yellow']('\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.')));if(_0x43b79d){const _0x108c8d={'site':_0x51b30a};saveProfileToUserConfig(_0x43b79d,_0x108c8d),console['log'](_0x481d55(0x10e)+_0x43b79d+'\x27\x20registered');}else saveDefaultSiteToUserConfig(_0x51b30a),console[_0x481d55(0x113)]('✓\x20Default\x20site\x20set\x20to\x20'+_0x51b30a);const _0x5e364d=_0x43b79d?'\x20--profile\x20'+_0x43b79d:'';return console[_0x481d55(0x113)](),console[_0x481d55(0x113)]('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console[_0x481d55(0x113)](_0x481d55(0x110)+_0x5e364d+_0x481d55(0xe9)),console[_0x481d55(0x113)](_0x481d55(0x110)+_0x5e364d+_0x481d55(0x117)),0x0;}catch(_0x537631){if(_0x537631 instanceof HTTPClientError&&_0x537631['status']===0x191)return printAuthError(_0x537631),0x1;return console[_0x481d55(0xf6)](a7_0x134ac1[_0x481d55(0xe7)](_0x481d55(0xe2)+(_0x537631 instanceof Error?_0x537631[_0x481d55(0xe6)]:String(_0x537631)))),console[_0x481d55(0xf6)](_0x481d55(0xfe)),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x3c713d(0xe0)]=a7_0x3c713d(0x111);[a7_0x3c713d(0xf8)]=a7_0x3c713d(0x10f);async[a7_0x3c713d(0xf9)](_0x205d77){const _0x9c090f=a7_0x3c713d,{options:_0x5d560c,tdx:_0x204268}=_0x205d77,_0x44cfe0=_0x5d560c['site'],_0x5ae137=_0x5d560c[_0x9c090f(0xe3)],_0x4015f3=_0x5ae137?_0x5ae137:_0x9c090f(0xdd);console[_0x9c090f(0x113)](_0x9c090f(0xe5)+_0x4015f3+_0x9c090f(0xeb)+_0x44cfe0+')');const _0xbcd404=await getOAuthTokens(_0x5ae137);if(_0xbcd404)console[_0x9c090f(0x113)]('Credential\x20type:\x20OAuth'),console[_0x9c090f(0x113)](_0x9c090f(0x122)+(_0x5ae137?_0x9c090f(0x11b)+_0x5ae137+')':''));else{const _0xe13a01=await resolveAPIKeyAsync(_0x44cfe0,_0x5ae137);if(_0xe13a01){const {source:_0x19b408,isDeprecated:_0x47d06d}=_0xe13a01,_0x22217f='Read\x20credential\x20from\x20'+_0x19b408;console[_0x9c090f(0x113)](_0x47d06d?a7_0x134ac1[_0x9c090f(0x11e)](_0x22217f):_0x22217f);}else console[_0x9c090f(0x113)](a7_0x134ac1[_0x9c090f(0x11e)]('No\x20credential\x20found'));}try{const _0x3152cf=await _0x204268[_0x9c090f(0xea)][_0x9c090f(0x11c)]();return console[_0x9c090f(0x113)](a7_0x134ac1[_0x9c090f(0x102)]('✓\x20Authentication\x20successful\x0a')),console['log'](_0x9c090f(0x108)+_0x3152cf[_0x9c090f(0x121)]),(_0x3152cf['first_name']||_0x3152cf[_0x9c090f(0xfa)])&&console[_0x9c090f(0x113)](_0x9c090f(0xe8)+[_0x3152cf[_0x9c090f(0xdf)],_0x3152cf[_0x9c090f(0xfa)]]['filter'](Boolean)[_0x9c090f(0xef)]('\x20')),0x0;}catch(_0x4afd27){return _0x4afd27 instanceof HTTPClientError&&_0x4afd27[_0x9c090f(0xfc)]===0x191?printAuthError(_0x4afd27,!![],_0x5ae137):console[_0x9c090f(0xf6)](a7_0x134ac1[_0x9c090f(0xe7)](_0x9c090f(0xe2)+(_0x4afd27 instanceof Error?_0x4afd27[_0x9c090f(0xe6)]:String(_0x4afd27)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x3c713d(0xe0)]=a7_0x3c713d(0x11f);[a7_0x3c713d(0xf8)]=a7_0x3c713d(0x115);async[a7_0x3c713d(0xf9)](_0x1796bf){const _0x3c9d76=a7_0x3c713d,{options:_0x1a5a98}=_0x1796bf,_0xdc28fb=_0x1a5a98[_0x3c9d76(0xe3)];console['log'](a7_0x134ac1[_0x3c9d76(0xf1)](_0x3c9d76(0x119)));const _0x2ed7fd=await isKeychainAvailable();if(!_0x2ed7fd)return console['error'](a7_0x134ac1[_0x3c9d76(0xe7)](_0x3c9d76(0xff))),0x1;const [_0x5fc191,_0x1ee0e5]=await Promise[_0x3c9d76(0x101)]([deleteKeychainAPIKey(_0xdc28fb),deleteOAuthTokens(_0xdc28fb)]);if(_0x5fc191||_0x1ee0e5){clearCredentialCache();const _0x42a347=[_0x5fc191&&_0x3c9d76(0xf3),_0x1ee0e5&&_0x3c9d76(0xd9)]['filter'](Boolean)[_0x3c9d76(0xef)](_0x3c9d76(0xdc));return console[_0x3c9d76(0x113)]('✓\x20'+_0x42a347+_0x3c9d76(0xde)+(_0xdc28fb?_0x3c9d76(0x11b)+_0xdc28fb+')':'')),0x0;}else return console[_0x3c9d76(0x113)](_0x3c9d76(0xf7)+(_0xdc28fb?'\x20for\x20profile:\x20'+_0xdc28fb:'')),0x1;}}
1
+ const a7_0x51e174=a7_0x1763;(function(_0xcbd2e8,_0x41f046){const _0xcb80e9=a7_0x1763,_0x1e95a5=_0xcbd2e8();while(!![]){try{const _0x176f08=-parseInt(_0xcb80e9(0x18d))/0x1+-parseInt(_0xcb80e9(0x167))/0x2*(parseInt(_0xcb80e9(0x18f))/0x3)+parseInt(_0xcb80e9(0x17f))/0x4+-parseInt(_0xcb80e9(0x16a))/0x5+parseInt(_0xcb80e9(0x160))/0x6*(parseInt(_0xcb80e9(0x184))/0x7)+-parseInt(_0xcb80e9(0x198))/0x8+-parseInt(_0xcb80e9(0x165))/0x9*(-parseInt(_0xcb80e9(0x163))/0xa);if(_0x176f08===_0x41f046)break;else _0x1e95a5['push'](_0x1e95a5['shift']());}catch(_0x31ea8f){_0x1e95a5['push'](_0x1e95a5['shift']());}}}(a7_0x5719,0xc4d3f));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens}from'../core/oauth-keychain.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{deleteOAuthTokens}from'../core/oauth-keychain.js';function a7_0x5719(){const _0x412e37=['error','join','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','Setup\x20cancelled','✓\x20Profile\x20\x27','\x27\x20registered','method','site','API\x20key','tdx:\x20auth\x20setup','logLevel','✓\x20Authentication\x20successful\x0a','✓\x20Default\x20site\x20set\x20to\x20','✗\x20Validation\x20failed:\x20','description','OAuth\x20tokens','tdx:\x20auth\x20clear','User:\x20','oauth','execute','1849938MkSYeg','filter','N/A','120QiHwQi','You\x20can\x20find\x20your\x20API\x20key\x20at:','2509767sAzxYT','Choose\x20authentication\x20method:','8VAMwud','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','979995QvDqQh','\x20(site:\x20','Remove\x20API\x20key\x20from\x20system\x20keychain','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','apiKey','trim','log','API\x20Key','us01','jobs','ERROR','message','red','email','auth:clear','Enter\x20your\x20TD\x20API\x20key:','last_name','Read\x20credential\x20from\x20keychain','Setup\x20API\x20key\x20authentication\x20interactively','password','all','488496bZBolh','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','profile','\x20--profile\x20','14BhlQlW','Credential\x20type:\x20OAuth','status','No\x20credential\x20found','first_name','\x0aSetup\x20cancelled','warn','/app/mp/ak','No\x20credentials\x20found\x20in\x20keychain','986392kArGUl','tdx\x20profile:\x20','471477qqvbJv','\x20\x20tdx','OAuth\x20(browser\x20login)','yellow','green','create','Name:\x20','bold','\x20(profile:\x20','11743136pHRgjV','API\x20key\x20cannot\x20be\x20empty'];a7_0x5719=function(){return _0x412e37;};return a7_0x5719();}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';function a7_0x1763(_0x3e0ffa,_0x2053f7){_0x3e0ffa=_0x3e0ffa-0x158;const _0x57198a=a7_0x5719();let _0x17632c=_0x57198a[_0x3e0ffa];return _0x17632c;}import a7_0x423a7f 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_0x19c47d from'chalk';export class AuthSetupCommand extends BaseCommand{['name']='auth:setup';[a7_0x51e174(0x15a)]=a7_0x51e174(0x17c);async[a7_0x51e174(0x15f)](_0x577589){const _0x10a345=a7_0x51e174,{options:_0x46d222}=_0x577589,_0x4911ce=_0x46d222['profile'];console[_0x10a345(0x170)](a7_0x19c47d[_0x10a345(0x196)](_0x10a345(0x1a3)));const _0x3c398f=_0x46d222[_0x10a345(0x1a1)]||_0x10a345(0x172),_0x293adf=await promptSiteSelection(_0x3c398f,_0x4911ce,_0x10a345(0x19d));if(!_0x293adf)return 0x1;const _0x3fa9ff=resolveSite(_0x293adf);if(isOAuthSupported(_0x3fa9ff)){const _0x346f55=await a7_0x423a7f({'type':'select','name':_0x10a345(0x1a0),'message':_0x10a345(0x166),'choices':[{'title':_0x10a345(0x191),'value':_0x10a345(0x15e)},{'title':_0x10a345(0x171),'value':'apikey'}]});if(!_0x346f55[_0x10a345(0x1a0)])return console[_0x10a345(0x170)](_0x10a345(0x189)),0x1;if(_0x346f55['method']===_0x10a345(0x15e))return await runOAuthLoginFlow(_0x3fa9ff,_0x4911ce,_0x46d222[_0x10a345(0x1a4)]??LogLevel[_0x10a345(0x174)]),0x0;}console[_0x10a345(0x170)]('Setting\x20up\x20authentication\x20for\x20site:\x20'+_0x3fa9ff),console[_0x10a345(0x170)](_0x10a345(0x164)),console[_0x10a345(0x170)]('\x20\x20'+getConsoleUrl(_0x3fa9ff,_0x10a345(0x18b)));const _0x375f4f=await a7_0x423a7f({'type':_0x10a345(0x17d),'name':_0x10a345(0x16e),'message':_0x10a345(0x179),'validate':_0xf2ab24=>{const _0x4ccc78=_0x10a345;if(!_0xf2ab24||!_0xf2ab24[_0x4ccc78(0x16f)]())return _0x4ccc78(0x199);return!![];}});if(!_0x375f4f[_0x10a345(0x16e)])return console[_0x10a345(0x170)](_0x10a345(0x189)),0x1;const _0x2592e1=_0x375f4f[_0x10a345(0x16e)];console[_0x10a345(0x170)]('Validating\x20API\x20key...');try{const _0x57578a=TDX[_0x10a345(0x194)]({'site':_0x3fa9ff,'apiKey':_0x2592e1['trim'](),'logLevel':_0x46d222[_0x10a345(0x1a4)]??LogLevel[_0x10a345(0x174)]}),_0xb2d118=await _0x57578a[_0x10a345(0x173)]['getUserInfo']();console['log'](_0x10a345(0x180)+_0xb2d118['email']+')');const _0x49a66a=await isKeychainAvailable();_0x49a66a?(await saveAPIKeyAsync(_0x2592e1[_0x10a345(0x16f)](),_0x3fa9ff,_0x4911ce),console[_0x10a345(0x170)](_0x10a345(0x181)+(_0x4911ce?_0x10a345(0x197)+_0x4911ce+')':''))):(console[_0x10a345(0x18a)](a7_0x19c47d[_0x10a345(0x192)]('⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.')),console[_0x10a345(0x18a)](a7_0x19c47d['yellow']('\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.')));if(_0x4911ce){const _0x335b8d={'site':_0x3fa9ff};saveProfileToUserConfig(_0x4911ce,_0x335b8d),console['log'](_0x10a345(0x19e)+_0x4911ce+_0x10a345(0x19f));}else saveDefaultSiteToUserConfig(_0x3fa9ff),console[_0x10a345(0x170)](_0x10a345(0x158)+_0x3fa9ff);const _0x5b1f0d=_0x4911ce?_0x10a345(0x183)+_0x4911ce:'';return console['log'](),console[_0x10a345(0x170)](_0x10a345(0x168)),console[_0x10a345(0x170)](_0x10a345(0x190)+_0x5b1f0d+_0x10a345(0x16d)),console[_0x10a345(0x170)](_0x10a345(0x190)+_0x5b1f0d+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases'),0x0;}catch(_0x2961ba){if(_0x2961ba instanceof HTTPClientError&&_0x2961ba[_0x10a345(0x186)]===0x191)return printAuthError(_0x2961ba),0x1;return console[_0x10a345(0x19a)](a7_0x19c47d[_0x10a345(0x176)](_0x10a345(0x159)+(_0x2961ba instanceof Error?_0x2961ba[_0x10a345(0x175)]:String(_0x2961ba)))),console[_0x10a345(0x19a)](_0x10a345(0x19c)),0x1;}}}export class AuthStatusCommand extends BaseCommand{['name']='auth';[a7_0x51e174(0x15a)]=a7_0x51e174(0x169);async[a7_0x51e174(0x15f)](_0x5c47cb){const _0x22cb9=a7_0x51e174,{options:_0x57e1c1,tdx:_0x2d2482}=_0x5c47cb,_0x3e799b=_0x57e1c1[_0x22cb9(0x1a1)],_0x345de2=_0x57e1c1[_0x22cb9(0x182)],_0x304bb5=_0x345de2?_0x345de2:_0x22cb9(0x162);console[_0x22cb9(0x170)](_0x22cb9(0x18e)+_0x304bb5+_0x22cb9(0x16b)+_0x3e799b+')');const _0x4e1b60=await getOAuthTokens(_0x345de2);if(_0x4e1b60)console[_0x22cb9(0x170)](_0x22cb9(0x185)),console['log'](_0x22cb9(0x17b)+(_0x345de2?'\x20(profile:\x20'+_0x345de2+')':''));else{const _0x1230d3=await resolveAPIKeyAsync(_0x3e799b,_0x345de2);if(_0x1230d3){const {source:_0x2a7728,isDeprecated:_0x5b7ee0}=_0x1230d3,_0x399a1c='Read\x20credential\x20from\x20'+_0x2a7728;console[_0x22cb9(0x170)](_0x5b7ee0?a7_0x19c47d[_0x22cb9(0x192)](_0x399a1c):_0x399a1c);}else console[_0x22cb9(0x170)](a7_0x19c47d['yellow'](_0x22cb9(0x187)));}try{const _0x54f8be=await _0x2d2482[_0x22cb9(0x173)]['getUserInfo']();return console['log'](a7_0x19c47d[_0x22cb9(0x193)](_0x22cb9(0x1a5))),console[_0x22cb9(0x170)](_0x22cb9(0x15d)+_0x54f8be[_0x22cb9(0x177)]),(_0x54f8be['first_name']||_0x54f8be[_0x22cb9(0x17a)])&&console['log'](_0x22cb9(0x195)+[_0x54f8be[_0x22cb9(0x188)],_0x54f8be[_0x22cb9(0x17a)]][_0x22cb9(0x161)](Boolean)[_0x22cb9(0x19b)]('\x20')),0x0;}catch(_0x4d0b86){return _0x4d0b86 instanceof HTTPClientError&&_0x4d0b86[_0x22cb9(0x186)]===0x191?printAuthError(_0x4d0b86,!![],_0x345de2):console[_0x22cb9(0x19a)](a7_0x19c47d[_0x22cb9(0x176)](_0x22cb9(0x159)+(_0x4d0b86 instanceof Error?_0x4d0b86[_0x22cb9(0x175)]:String(_0x4d0b86)))),0x1;}}}export class AuthClearCommand extends BaseCommand{['name']=a7_0x51e174(0x178);['description']=a7_0x51e174(0x16c);async[a7_0x51e174(0x15f)](_0x1db091){const _0xb29263=a7_0x51e174,{options:_0x352c98}=_0x1db091,_0x51e026=_0x352c98[_0xb29263(0x182)];console['log'](a7_0x19c47d[_0xb29263(0x196)](_0xb29263(0x15c)));const _0x3e705=await isKeychainAvailable();if(!_0x3e705)return console[_0xb29263(0x19a)](a7_0x19c47d['red']('System\x20keychain\x20is\x20not\x20available')),0x1;const [_0x19239d,_0x338d83]=await Promise[_0xb29263(0x17e)]([deleteKeychainAPIKey(_0x51e026),deleteOAuthTokens(_0x51e026)]);if(_0x19239d||_0x338d83){clearCredentialCache();const _0x1d356b=[_0x19239d&&_0xb29263(0x1a2),_0x338d83&&_0xb29263(0x15b)][_0xb29263(0x161)](Boolean)['join']('\x20and\x20');return console[_0xb29263(0x170)]('✓\x20'+_0x1d356b+'\x20removed\x20from\x20keychain'+(_0x51e026?_0xb29263(0x197)+_0x51e026+')':'')),0x0;}else return console[_0xb29263(0x170)](_0xb29263(0x18c)+(_0x51e026?'\x20for\x20profile:\x20'+_0x51e026:'')),0x1;}}
@@ -1 +1 @@
1
- const a8_0x18fd40=a8_0x2a1c;(function(_0x1a5cb5,_0x3f40f0){const _0x10da76=a8_0x2a1c,_0x2ba68f=_0x1a5cb5();while(!![]){try{const _0x5430c4=-parseInt(_0x10da76(0x10b))/0x1*(parseInt(_0x10da76(0x116))/0x2)+parseInt(_0x10da76(0x12e))/0x3+-parseInt(_0x10da76(0x125))/0x4+parseInt(_0x10da76(0x10a))/0x5+parseInt(_0x10da76(0x127))/0x6*(-parseInt(_0x10da76(0x12a))/0x7)+parseInt(_0x10da76(0x11f))/0x8*(-parseInt(_0x10da76(0x102))/0x9)+parseInt(_0x10da76(0x12f))/0xa*(parseInt(_0x10da76(0x103))/0xb);if(_0x5430c4===_0x3f40f0)break;else _0x2ba68f['push'](_0x2ba68f['shift']());}catch(_0x26abba){_0x2ba68f['push'](_0x2ba68f['shift']());}}}(a8_0x5209,0x4d4a1));import{BaseCommand}from'./command.js';import{resolveSite}from'../core/config.js';import{saveProfileToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';function a8_0x2a1c(_0x1f947f,_0x1edc1d){_0x1f947f=_0x1f947f-0x101;const _0x520903=a8_0x5209();let _0x2a1cfc=_0x520903[_0x1f947f];return _0x2a1cfc;}import{isKeychainAvailable}from'../core/keychain.js';import{saveOAuthTokens}from'../core/oauth-keychain.js';import{startOAuthFlow,isOAuthSupported}from'../core/oauth.js';import{promptSiteSelection}from'../core/constants.js';function a8_0x5209(){const _0x4db303=['OAuth\x20is\x20currently\x20supported\x20on\x20dev-us01\x20and\x20dev-eu01\x20only.\x20','log','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','auth:login','ERROR','Validating\x20OAuth\x20tokens...','tdx:\x20auth\x20login','execute','856376bFVwKX','create','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','Login\x20via\x20OAuth\x20(opens\x20browser)','logLevel','Opening\x20browser\x20for\x20authentication...','1705028gskdKw','Authenticating\x20via\x20OAuth\x20for\x20site:\x20','5226pMFSYW','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','access_token','4186iZJgwL','us01','site','name','856092hvBNTP','1319330IZHzlV','\x20\x20tdx','9JYMEnd','88XWbXhs','bold','✓\x20Profile\x20\x27','\x20(profile:\x20','OAuth\x20login\x20is\x20not\x20yet\x20available\x20for\x20site:\x20','profile','getUserInfo','623125cbPoLG','1633NFDRlm','email','description','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','\x27\x20registered','✓\x20Authentication\x20successful\x20(User:\x20','\x20--profile\x20','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain','green','/oauth/authorize','Login\x20cancelled','116StGMmE'];a8_0x5209=function(){return _0x4db303;};return a8_0x5209();}import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a8_0x4395c5 from'chalk';export async function runOAuthLoginFlow(_0x2a57f4,_0x141665,_0x2a0bff){const _0x2cd271=a8_0x2a1c;if(!isOAuthSupported(_0x2a57f4))throw new Error(_0x2cd271(0x107)+_0x2a57f4+'.\x20'+_0x2cd271(0x117)+_0x2cd271(0x121));const _0x5aee5c=await isKeychainAvailable();if(!_0x5aee5c)throw new Error('System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20'+_0x2cd271(0x121));const _0x393231=getConsoleUrl(_0x2a57f4);console[_0x2cd271(0x118)](_0x2cd271(0x124)),console[_0x2cd271(0x118)]('\x20\x20'+_0x393231+_0x2cd271(0x114)),console[_0x2cd271(0x118)](_0x2cd271(0x10e));const _0x45d19f=await startOAuthFlow(_0x2a57f4);console[_0x2cd271(0x118)](_0x2cd271(0x11c));const _0x551838=TDX[_0x2cd271(0x120)]({'site':_0x2a57f4,'accessToken':_0x45d19f[_0x2cd271(0x129)],'logLevel':_0x2a0bff??LogLevel['ERROR']}),_0x1b2961=await _0x551838['jobs'][_0x2cd271(0x109)]();console[_0x2cd271(0x118)](a8_0x4395c5[_0x2cd271(0x113)](_0x2cd271(0x110)+_0x1b2961[_0x2cd271(0x10c)]+')')),await saveOAuthTokens(_0x45d19f,_0x141665),console['log'](_0x2cd271(0x112)+(_0x141665?_0x2cd271(0x106)+_0x141665+')':''));if(_0x141665){const _0x2b5773={'site':_0x2a57f4};saveProfileToUserConfig(_0x141665,_0x2b5773),console[_0x2cd271(0x118)](_0x2cd271(0x105)+_0x141665+_0x2cd271(0x10f));}const _0x2573e2=_0x141665?_0x2cd271(0x111)+_0x141665:'';console[_0x2cd271(0x118)](),console['log']('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console['log']('\x20\x20tdx'+_0x2573e2+_0x2cd271(0x128)),console[_0x2cd271(0x118)](_0x2cd271(0x101)+_0x2573e2+_0x2cd271(0x119));}export class AuthLoginCommand extends BaseCommand{[a8_0x18fd40(0x12d)]=a8_0x18fd40(0x11a);[a8_0x18fd40(0x10d)]=a8_0x18fd40(0x122);async[a8_0x18fd40(0x11e)](_0x339281){const _0x321e3b=a8_0x18fd40,{options:_0x484edb}=_0x339281,_0x5b6577=_0x484edb[_0x321e3b(0x108)];console[_0x321e3b(0x118)](a8_0x4395c5[_0x321e3b(0x104)](_0x321e3b(0x11d)));const _0x2402a5=_0x484edb[_0x321e3b(0x12c)]||_0x321e3b(0x12b),_0x5c36ec=await promptSiteSelection(_0x2402a5,_0x5b6577,_0x321e3b(0x115));if(!_0x5c36ec)return 0x1;const _0x1bf83b=resolveSite(_0x5c36ec);return console[_0x321e3b(0x118)](_0x321e3b(0x126)+_0x1bf83b),await runOAuthLoginFlow(_0x1bf83b,_0x5b6577,_0x484edb[_0x321e3b(0x123)]??LogLevel[_0x321e3b(0x11b)]),0x0;}}
1
+ const a8_0x2d39cb=a8_0x4218;(function(_0x3c4456,_0x355c9e){const _0xd5a25f=a8_0x4218,_0x4ea009=_0x3c4456();while(!![]){try{const _0x458be2=-parseInt(_0xd5a25f(0x11f))/0x1+parseInt(_0xd5a25f(0x129))/0x2*(-parseInt(_0xd5a25f(0x140))/0x3)+-parseInt(_0xd5a25f(0x12c))/0x4*(-parseInt(_0xd5a25f(0x121))/0x5)+parseInt(_0xd5a25f(0x13a))/0x6+parseInt(_0xd5a25f(0x125))/0x7+-parseInt(_0xd5a25f(0x11b))/0x8+-parseInt(_0xd5a25f(0x131))/0x9*(-parseInt(_0xd5a25f(0x11c))/0xa);if(_0x458be2===_0x355c9e)break;else _0x4ea009['push'](_0x4ea009['shift']());}catch(_0x1f7baa){_0x4ea009['push'](_0x4ea009['shift']());}}}(a8_0x279f,0x5627c));import{BaseCommand}from'./command.js';function a8_0x4218(_0x139a2a,_0x1dc799){_0x139a2a=_0x139a2a-0x117;const _0x279f26=a8_0x279f();let _0x4218b2=_0x279f26[_0x139a2a];return _0x4218b2;}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';import a8_0x500d2a from'chalk';export async function runOAuthLoginFlow(_0x27308e,_0x3ef654,_0x88741e){const _0x4264fc=a8_0x4218;if(!isOAuthSupported(_0x27308e))throw new Error('OAuth\x20login\x20is\x20not\x20yet\x20available\x20for\x20site:\x20'+_0x27308e+'.\x20'+_0x4264fc(0x12d)+'Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.');const _0x44c954=await isKeychainAvailable();if(!_0x44c954)throw new Error(_0x4264fc(0x11e)+_0x4264fc(0x13c));const _0x470b26=getConsoleUrl(_0x27308e);console['log'](_0x4264fc(0x128)),console[_0x4264fc(0x122)]('\x20\x20'+_0x470b26+'/oauth/authorize'),console[_0x4264fc(0x122)](_0x4264fc(0x126));const _0x2da4fa=await startOAuthFlow(_0x27308e);console[_0x4264fc(0x122)](_0x4264fc(0x132));const _0x33b5d1=TDX['create']({'site':_0x27308e,'accessToken':_0x2da4fa['access_token'],'logLevel':_0x88741e??LogLevel[_0x4264fc(0x117)]}),_0x532154=await _0x33b5d1[_0x4264fc(0x11a)][_0x4264fc(0x135)]();console[_0x4264fc(0x122)](a8_0x500d2a[_0x4264fc(0x136)](_0x4264fc(0x11d)+_0x532154[_0x4264fc(0x118)]+')')),await saveOAuthTokens(_0x2da4fa,_0x3ef654),console[_0x4264fc(0x122)](_0x4264fc(0x133)+(_0x3ef654?_0x4264fc(0x13d)+_0x3ef654+')':''));if(_0x3ef654){const _0xd46ab3={'site':_0x27308e};saveProfileToUserConfig(_0x3ef654,_0xd46ab3),console[_0x4264fc(0x122)](_0x4264fc(0x124)+_0x3ef654+_0x4264fc(0x13e));}const _0x5e2783=_0x3ef654?_0x4264fc(0x138)+_0x3ef654:'';console[_0x4264fc(0x122)](),console[_0x4264fc(0x122)](_0x4264fc(0x130)),console[_0x4264fc(0x122)](_0x4264fc(0x120)+_0x5e2783+_0x4264fc(0x119)),console[_0x4264fc(0x122)](_0x4264fc(0x120)+_0x5e2783+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases');}function a8_0x279f(){const _0x38a84e=['name','execute','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','414sRespo','Validating\x20OAuth\x20tokens...','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain','tdx:\x20auth\x20login','getUserInfo','green','Login\x20via\x20OAuth\x20(opens\x20browser)','\x20--profile\x20','bold','195474fgSDtk','us01','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','\x20(profile:\x20','\x27\x20registered','Authenticating\x20via\x20OAuth\x20for\x20site:\x20','60678vocYGR','logLevel','description','ERROR','email','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','jobs','4963408RtruxM','103990tOvvyr','✓\x20Authentication\x20successful\x20(User:\x20','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','268942ISjFSy','\x20\x20tdx','172045GoOlsq','log','auth:login','✓\x20Profile\x20\x27','4098857vAkKaQ','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','profile','Opening\x20browser\x20for\x20authentication...','6vspGkp','Login\x20cancelled','site','24NNvYAi','OAuth\x20is\x20currently\x20supported\x20on\x20dev-us01\x20and\x20dev-eu01\x20only.\x20'];a8_0x279f=function(){return _0x38a84e;};return a8_0x279f();}export class AuthLoginCommand extends BaseCommand{[a8_0x2d39cb(0x12e)]=a8_0x2d39cb(0x123);[a8_0x2d39cb(0x142)]=a8_0x2d39cb(0x137);async[a8_0x2d39cb(0x12f)](_0x32e5af){const _0x4cdac2=a8_0x2d39cb,{options:_0x2e32a3}=_0x32e5af,_0x5945ba=_0x2e32a3[_0x4cdac2(0x127)];console['log'](a8_0x500d2a[_0x4cdac2(0x139)](_0x4cdac2(0x134)));const _0x5967ac=_0x2e32a3[_0x4cdac2(0x12b)]||_0x4cdac2(0x13b),_0x1d9fb2=await promptSiteSelection(_0x5967ac,_0x5945ba,_0x4cdac2(0x12a));if(!_0x1d9fb2)return 0x1;const _0x4682a2=resolveSite(_0x1d9fb2);return console[_0x4cdac2(0x122)](_0x4cdac2(0x13f)+_0x4682a2),await runOAuthLoginFlow(_0x4682a2,_0x5945ba,_0x2e32a3[_0x4cdac2(0x141)]??LogLevel[_0x4cdac2(0x117)]),0x0;}}