@treasuredata/tdx 2026.3.19 → 2026.3.20

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 (204) 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.d.ts.map +1 -1
  130. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  131. package/dist/sdk/segment/child-segment-yaml.js.map +1 -1
  132. package/dist/sdk/segment/fields-display.js +1 -1
  133. package/dist/sdk/segment/file-discovery.js +1 -1
  134. package/dist/sdk/segment/journey-utils.js +1 -1
  135. package/dist/sdk/segment/journey-validator.js +1 -1
  136. package/dist/sdk/segment/journey-yaml.js +1 -1
  137. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  138. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  139. package/dist/sdk/segment/pull-workflow.js +1 -1
  140. package/dist/sdk/segment/push-recovery.js +1 -1
  141. package/dist/sdk/segment/push-workflow.js +1 -1
  142. package/dist/sdk/segment/resolution-context.js +1 -1
  143. package/dist/sdk/segment/segment-path-parser.js +1 -1
  144. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  145. package/dist/sdk/segment/segment-validator.js +1 -1
  146. package/dist/sdk/segment/segment-validator.js.map +1 -1
  147. package/dist/sdk/segment/target-resolution.js +1 -1
  148. package/dist/sdk/segment/tdx-config.js +1 -1
  149. package/dist/sdk/segment/types/activation-schema.js +1 -1
  150. package/dist/sdk/segment/types/journey-def.js +1 -1
  151. package/dist/sdk/segment/types/journey-schema.js +1 -1
  152. package/dist/sdk/segment/types/segment-def.js +1 -1
  153. package/dist/sdk/segment/types/segment-schema.js +1 -1
  154. package/dist/sdk/segment/validate-files.js +1 -1
  155. package/dist/sdk/segment/yaml-validator.js +1 -1
  156. package/dist/sdk/segment.js +1 -1
  157. package/dist/sdk/types/index.js +1 -1
  158. package/dist/sdk/types/progress.js +1 -1
  159. package/dist/sdk/user.js +1 -1
  160. package/dist/sdk/util/format-detector.js +1 -1
  161. package/dist/sdk/util/formatters.js +1 -1
  162. package/dist/sdk/util/index.js +1 -1
  163. package/dist/sdk/util/paginate.js +1 -1
  164. package/dist/sdk/util/tree-formatter.js +1 -1
  165. package/dist/sdk/workflow/archive-validation.js +1 -1
  166. package/dist/sdk/workflow/clone-workflow.js +1 -1
  167. package/dist/sdk/workflow/index.js +1 -1
  168. package/dist/sdk/workflow/pull-workflow.js +1 -1
  169. package/dist/sdk/workflow/push-workflow.js +1 -1
  170. package/dist/sdk/workflow/tdx-config.js +1 -1
  171. package/dist/sdk/workflow/workflow-utils.js +1 -1
  172. package/dist/test-utils/command-runner.js +1 -1
  173. package/dist/test-utils/factories.js +1 -1
  174. package/dist/test-utils/fixtures.js +1 -1
  175. package/dist/test-utils/http-mock.js +1 -1
  176. package/dist/test-utils/index.js +1 -1
  177. package/dist/utils/async.js +1 -1
  178. package/dist/utils/colors.js +1 -1
  179. package/dist/utils/diff.js +1 -1
  180. package/dist/utils/file-permissions.js +1 -1
  181. package/dist/utils/file-reader.js +1 -1
  182. package/dist/utils/github-releases.js +1 -1
  183. package/dist/utils/global-cache.js +1 -1
  184. package/dist/utils/json-loader.js +1 -1
  185. package/dist/utils/local-cache.js +1 -1
  186. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  187. package/dist/utils/logger/formatters/index.js +1 -1
  188. package/dist/utils/logger/handlers/console-handler.js +1 -1
  189. package/dist/utils/logger/handlers/file-handler.js +1 -1
  190. package/dist/utils/logger/handlers/index.js +1 -1
  191. package/dist/utils/logger/handlers/null-handler.js +1 -1
  192. package/dist/utils/logger/index.js +1 -1
  193. package/dist/utils/logger/logger.js +1 -1
  194. package/dist/utils/logger/types.js +1 -1
  195. package/dist/utils/option-validation.js +1 -1
  196. package/dist/utils/process.js +1 -1
  197. package/dist/utils/prompt.js +1 -1
  198. package/dist/utils/spinner.js +1 -1
  199. package/dist/utils/sse-parser.js +1 -1
  200. package/dist/utils/string-utils.js +1 -1
  201. package/dist/utils/table-ref-parser.js +1 -1
  202. package/dist/utils/tdx-logger.js +1 -1
  203. package/dist/utils/version-check.js +1 -1
  204. package/package.json +1 -1
@@ -1 +1 @@
1
- const a3_0x17c3ef=a3_0x9587;function a3_0x9587(_0x36a069,_0x6c5738){_0x36a069=_0x36a069-0x1e5;const _0x112f7d=a3_0x112f();let _0x958795=_0x112f7d[_0x36a069];return _0x958795;}(function(_0x552927,_0x293a75){const _0xc69325=a3_0x9587,_0x968825=_0x552927();while(!![]){try{const _0x39e472=parseInt(_0xc69325(0x201))/0x1+-parseInt(_0xc69325(0x205))/0x2*(-parseInt(_0xc69325(0x1ef))/0x3)+parseInt(_0xc69325(0x203))/0x4*(parseInt(_0xc69325(0x1e6))/0x5)+-parseInt(_0xc69325(0x1f3))/0x6+parseInt(_0xc69325(0x206))/0x7*(parseInt(_0xc69325(0x1eb))/0x8)+-parseInt(_0xc69325(0x1f5))/0x9+parseInt(_0xc69325(0x1f2))/0xa;if(_0x39e472===_0x293a75)break;else _0x968825['push'](_0x968825['shift']());}catch(_0x305244){_0x968825['push'](_0x968825['shift']());}}}(a3_0x112f,0xda574));function a3_0x112f(){const _0x2d8882=['7373700chSuqV','2833086RVAgPr','Resolving\x20parent\x20segment\x20\x27','15729435BuxTqf','message','resolveSegmentId','execute','listActivations','resolveParentId','\x20activation','data','Site:\x20','description','Resolved\x20child\x20ID:\x20','✔\x20Found\x20','1306719DkZKiJ','Resolving\x20child\x20segment\x20\x27','28nAmgrJ','Listing\x20activations\x20for\x20segment\x20\x27','6334sPlNql','70rJwcMt','cause','447470qXYZQB','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','Error:\x20Segment\x20name\x20is\x20required','segment','Child\x20name:\x20','53440RmuHau','error','Error:\x20','verbose','357QGUVet','\x27...','length'];a3_0x112f=function(){return _0x2d8882;};return a3_0x112f();}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';export class ActivationsCommand extends BaseCommand{['name']='activations';[a3_0x17c3ef(0x1fe)]='List\x20activations\x20for\x20a\x20segment';async[a3_0x17c3ef(0x1f8)](_0x4095c6){const _0x3ea99d=a3_0x17c3ef,{options:_0x4cedf6,args:_0x5e5631,tdx:_0x133339}=_0x4095c6;if(_0x5e5631[_0x3ea99d(0x1f1)]===0x0)return console[_0x3ea99d(0x1ec)](_0x3ea99d(0x1e8)),console[_0x3ea99d(0x1ec)](_0x3ea99d(0x1e7)),0x1;try{const {parentId:_0x43ecc4,childId:_0x38cf5f}=parseSegmentRef(_0x5e5631[0x0]);if(!_0x38cf5f)return console[_0x3ea99d(0x1ec)]('Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations'),console[_0x3ea99d(0x1ec)]('Usage:\x20tdx\x20activations\x20<parent_name/child_name>'),0x1;_0x4cedf6[_0x3ea99d(0x1ee)]&&(console['error'](_0x3ea99d(0x1fd)+_0x4cedf6['site']),console[_0x3ea99d(0x1ec)]('Parent\x20name:\x20'+_0x43ecc4),console['error'](_0x3ea99d(0x1ea)+_0x38cf5f));const _0x37a550=await withSpinner(_0x3ea99d(0x1f4)+_0x43ecc4+_0x3ea99d(0x1f0),()=>_0x133339[_0x3ea99d(0x1e9)][_0x3ea99d(0x1fa)](_0x43ecc4),{'verbose':_0x4cedf6[_0x3ea99d(0x1ee)]}),_0x9bb93f=_0x37a550['data'];_0x4cedf6[_0x3ea99d(0x1ee)]&&console['error']('Resolved\x20parent\x20ID:\x20'+_0x9bb93f);const _0x3e5f0f=await withSpinner(_0x3ea99d(0x202)+_0x38cf5f+_0x3ea99d(0x1f0),()=>_0x133339[_0x3ea99d(0x1e9)][_0x3ea99d(0x1f7)](_0x9bb93f,_0x38cf5f),{'verbose':_0x4cedf6['verbose']}),_0x2618d1=_0x3e5f0f[_0x3ea99d(0x1fc)];_0x4cedf6[_0x3ea99d(0x1ee)]&&console['error'](_0x3ea99d(0x1ff)+_0x2618d1);const _0x110cdc=await withSpinner(_0x3ea99d(0x204)+_0x38cf5f+'\x27...',()=>_0x133339[_0x3ea99d(0x1e9)][_0x3ea99d(0x1f9)](_0x9bb93f,_0x2618d1),{'verbose':_0x4cedf6[_0x3ea99d(0x1ee)]}),_0x3ea564=_0x110cdc[_0x3ea99d(0x1fc)];return console[_0x3ea99d(0x1ec)](_0x3ea99d(0x200)+_0x3ea564['length']+_0x3ea99d(0x1fb)+(_0x3ea564['length']!==0x1?'s':'')),await handleSDKOutput(_0x3ea564,_0x4cedf6),0x0;}catch(_0xaca5df){if(_0xaca5df instanceof SDKError)return console[_0x3ea99d(0x1ec)](_0x3ea99d(0x1ed)+_0xaca5df[_0x3ea99d(0x1f6)]),_0xaca5df[_0x3ea99d(0x1e5)]&&console[_0x3ea99d(0x1ec)]('\x20\x20Cause:\x20'+_0xaca5df[_0x3ea99d(0x1e5)]),0x1;throw _0xaca5df;}}}
1
+ const a3_0x136739=a3_0x1ff1;function a3_0x1ff1(_0x14bd39,_0x170c44){_0x14bd39=_0x14bd39-0x6e;const _0x380b57=a3_0x380b();let _0x1ff132=_0x380b57[_0x14bd39];return _0x1ff132;}(function(_0x386245,_0x2b7c85){const _0x3ca440=a3_0x1ff1,_0x1ed308=_0x386245();while(!![]){try{const _0x5be749=parseInt(_0x3ca440(0x74))/0x1+parseInt(_0x3ca440(0x6f))/0x2+-parseInt(_0x3ca440(0x79))/0x3*(parseInt(_0x3ca440(0x80))/0x4)+-parseInt(_0x3ca440(0x8c))/0x5*(-parseInt(_0x3ca440(0x6e))/0x6)+parseInt(_0x3ca440(0x92))/0x7*(-parseInt(_0x3ca440(0x93))/0x8)+parseInt(_0x3ca440(0x89))/0x9*(-parseInt(_0x3ca440(0x7e))/0xa)+parseInt(_0x3ca440(0x77))/0xb*(parseInt(_0x3ca440(0x76))/0xc);if(_0x5be749===_0x2b7c85)break;else _0x1ed308['push'](_0x1ed308['shift']());}catch(_0x135d59){_0x1ed308['push'](_0x1ed308['shift']());}}}(a3_0x380b,0x26d22));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a3_0x380b(){const _0x386b1e=['execute','Listing\x20activations\x20for\x20segment\x20\x27','error','List\x20activations\x20for\x20a\x20segment','99thWyVd','verbose','Child\x20name:\x20','656875LfppoG','name','length','Error:\x20Segment\x20name\x20is\x20required','Resolved\x20child\x20ID:\x20','segment','105wAwKtu','164872gbKSMS','6yzjxOd','121130HbcdAz','Error:\x20','Parent\x20name:\x20','Resolving\x20parent\x20segment\x20\x27','✔\x20Found\x20','58087oDVcvF','description','4827348yWBwOU','11TLgArZ','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','2199uHRKOO','\x27...','Resolving\x20child\x20segment\x20\x27','resolveSegmentId','listActivations','70130BxSffr','Resolved\x20parent\x20ID:\x20','584WGNnSj','message','cause','resolveParentId','data'];a3_0x380b=function(){return _0x386b1e;};return a3_0x380b();}import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';export class ActivationsCommand extends BaseCommand{[a3_0x136739(0x8d)]='activations';[a3_0x136739(0x75)]=a3_0x136739(0x88);async[a3_0x136739(0x85)](_0x132275){const _0x2e0078=a3_0x136739,{options:_0x5c08ea,args:_0x3ab95e,tdx:_0x38d450}=_0x132275;if(_0x3ab95e[_0x2e0078(0x8e)]===0x0)return console[_0x2e0078(0x87)](_0x2e0078(0x8f)),console[_0x2e0078(0x87)](_0x2e0078(0x78)),0x1;try{const {parentId:_0x4898bb,childId:_0x1e543c}=parseSegmentRef(_0x3ab95e[0x0]);if(!_0x1e543c)return console[_0x2e0078(0x87)]('Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations'),console[_0x2e0078(0x87)]('Usage:\x20tdx\x20activations\x20<parent_name/child_name>'),0x1;_0x5c08ea[_0x2e0078(0x8a)]&&(console[_0x2e0078(0x87)]('Site:\x20'+_0x5c08ea['site']),console[_0x2e0078(0x87)](_0x2e0078(0x71)+_0x4898bb),console[_0x2e0078(0x87)](_0x2e0078(0x8b)+_0x1e543c));const _0x307e33=await withSpinner(_0x2e0078(0x72)+_0x4898bb+_0x2e0078(0x7a),()=>_0x38d450['segment'][_0x2e0078(0x83)](_0x4898bb),{'verbose':_0x5c08ea['verbose']}),_0xaede6c=_0x307e33[_0x2e0078(0x84)];_0x5c08ea[_0x2e0078(0x8a)]&&console[_0x2e0078(0x87)](_0x2e0078(0x7f)+_0xaede6c);const _0x51d544=await withSpinner(_0x2e0078(0x7b)+_0x1e543c+'\x27...',()=>_0x38d450[_0x2e0078(0x91)][_0x2e0078(0x7c)](_0xaede6c,_0x1e543c),{'verbose':_0x5c08ea[_0x2e0078(0x8a)]}),_0x47c250=_0x51d544[_0x2e0078(0x84)];_0x5c08ea[_0x2e0078(0x8a)]&&console[_0x2e0078(0x87)](_0x2e0078(0x90)+_0x47c250);const _0x782856=await withSpinner(_0x2e0078(0x86)+_0x1e543c+_0x2e0078(0x7a),()=>_0x38d450[_0x2e0078(0x91)][_0x2e0078(0x7d)](_0xaede6c,_0x47c250),{'verbose':_0x5c08ea[_0x2e0078(0x8a)]}),_0x5c43e8=_0x782856[_0x2e0078(0x84)];return console[_0x2e0078(0x87)](_0x2e0078(0x73)+_0x5c43e8[_0x2e0078(0x8e)]+'\x20activation'+(_0x5c43e8[_0x2e0078(0x8e)]!==0x1?'s':'')),await handleSDKOutput(_0x5c43e8,_0x5c08ea),0x0;}catch(_0x152924){if(_0x152924 instanceof SDKError)return console[_0x2e0078(0x87)](_0x2e0078(0x70)+_0x152924[_0x2e0078(0x81)]),_0x152924[_0x2e0078(0x82)]&&console[_0x2e0078(0x87)]('\x20\x20Cause:\x20'+_0x152924[_0x2e0078(0x82)]),0x1;throw _0x152924;}}}
@@ -1 +1 @@
1
- const a4_0x40c5a9=a4_0x52db;(function(_0x25afe3,_0x215ce3){const _0x2fed22=a4_0x52db,_0x50efe3=_0x25afe3();while(!![]){try{const _0x50d42c=-parseInt(_0x2fed22(0x1f4))/0x1+-parseInt(_0x2fed22(0x1aa))/0x2*(parseInt(_0x2fed22(0x16c))/0x3)+-parseInt(_0x2fed22(0x1e4))/0x4*(parseInt(_0x2fed22(0x1ed))/0x5)+parseInt(_0x2fed22(0x172))/0x6*(parseInt(_0x2fed22(0x1d1))/0x7)+parseInt(_0x2fed22(0x1af))/0x8*(-parseInt(_0x2fed22(0x20a))/0x9)+-parseInt(_0x2fed22(0x18c))/0xa*(parseInt(_0x2fed22(0x1f5))/0xb)+parseInt(_0x2fed22(0x1ca))/0xc;if(_0x50d42c===_0x215ce3)break;else _0x50efe3['push'](_0x50efe3['shift']());}catch(_0x4d0c29){_0x50efe3['push'](_0x50efe3['shift']());}}}(a4_0x4731,0x30a36));import a4_0x8d4af9 from'chalk';import a4_0x4047d1 from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a4_0x4731(){const _0x5c0e0d=['Dry\x20run\x20-\x20no\x20changes\x20made','log','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','\x20\x20Prompt\x20\x22','\x20\x20Target:\x20','75KdnmWF','Agent\x20pulled\x20successfully','\x20successfully','updated','llm','agent:clone','\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','47948QjGdqv','81334eNRCtQ','\x0aChanges\x20to\x20prompt\x20\x27','\x20=\x20','\x20\x20Experimental\x20Artifact\x20\x22','\x20\x20Experimental\x20Artifacts:\x20','pullAgent','dirname','Output:\x20','-\x20no\x20files\x20written','\x20resources\x20to\x20\x27','\x20\x20Agents:\x20','\x20\x20Integration\x20\x22','sourceProjectName','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','\x0a✔\x20Pulled\x20','found','cwd-config','push','projectId','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','3352329ncuHTc','Using\x20current\x20project:\x20','agent','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','pushProject','\x20\x20Text\x20Knowledge\x20Bases:\x20','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','prompts','\x20total','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','error','errors','agentName','cwd','\x22\x20to\x20\x22','\x22\x20from\x20project\x20\x22','red','Source:\x20','gray','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','\x0aPull\x20summary\x20for\x20\x27','\x20\x20Integrations:\x20','\x0aPush\x20','\x20|\x20','\x20unchanged','integrations','dryRun','1190661KEtsBH','Cloning\x20\x22','Using\x20project\x20from\x20context:\x20','Status:\x20','Output\x20path:\x20','Using\x20project:\x20','106818YtjMGN','Using\x20project\x20from\x20','\x20files?','cloneProject','Would\x20push\x20agent:\x20','✔\x20Context\x20set:\x20','dim','source','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','\x20\x20Agent\x20\x22','Errors:','pullProject','\x20\x20Text\x20Knowledge\x20Base\x20\x22','hasChanges','Cancelled','\x20changed','outputPath','counts','execute','created','<new-name>','\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','\x0aWrite\x20','yellow','\x20files\x20to\x20','outputDir','170UyxJgd','New\x20project\x20ID:\x20','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','no_local_folder','repeat','\x20\x20tdx\x20agent\x20pull\x20','Writing\x20files...','\x20--name\x20','\x20\x20Knowledge\x20Base\x20\x22','pushAgent','INVALID_ARGUMENT','Using\x20local\x20project:\x20','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','-\x20nothing\x20pushed','total','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','\x20\x20Knowledge\x20Bases:\x20','\x0aChanges:','diff','profile','projectName','\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)','New\x20project:\x20','\x0aError:','experimentalArtifacts','knowledgeBases','\x0aPush\x20summary\x20for\x20\x27','\x0aChanges\x20to\x20integration\x20\x27','message','2CGCDKk','agentId','\x22:\x20','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','Agent:\x20','8WKxJZR','Analyzing\x20changes\x20to\x20push...','llm_project','\x20--profile\x20','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','Summary:','cyan','reason','Project\x20cloned\x20with\x20errors','session','Pulling\x20agent\x20\x22','\x0a✔\x20Pushed\x20','name','newProjectId','MISSING_ARGUMENT','\x20new','agent:pull','unchanged','llmProject','tdx.json','utf-8','join','yes','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','new','force','11143524bsmPwB','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','\x22...','no_context','newProjectName','\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','green','126VefXST','parse','Pushing\x20agent\x20from\x20\x22','action','Project\x20cloned\x20successfully','experimentalKnowledgeBases','textKnowledgeBases','context','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Using\x20context\x20project:\x20','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','Project:\x20','\x0aErrors\x20found:','\x0aProject\x20pushed\x20with\x20errors','arg-dir','site','\x20\x20Prompts:\x20','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','\x20\x20Source:\x20','28492cHfauX','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','Failed\x20to\x20push\x20agent:\x20','agents'];a4_0x4731=function(){return _0x5c0e0d;};return a4_0x4731();}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 a4_0x52db(_0x3fa26f,_0x417cd1){_0x3fa26f=_0x3fa26f-0x164;const _0x473126=a4_0x4731();let _0x52db2b=_0x473126[_0x3fa26f];return _0x52db2b;}function formatCountSummary(_0x3bb810){const _0x1beca0=a4_0x52db,_0x3966cc=[];if(_0x3bb810[_0x1beca0(0x19b)]!==undefined)_0x3966cc[_0x1beca0(0x206)](_0x3bb810[_0x1beca0(0x19b)]+_0x1beca0(0x212));if(_0x3bb810[_0x1beca0(0x1c8)]!==undefined&&_0x3bb810[_0x1beca0(0x1c8)]>0x0)_0x3966cc[_0x1beca0(0x206)](a4_0x8d4af9[_0x1beca0(0x1d0)](_0x3bb810[_0x1beca0(0x1c8)]+_0x1beca0(0x1bf)));if(_0x3bb810['created']!==undefined&&_0x3bb810[_0x1beca0(0x185)]>0x0)_0x3966cc['push'](a4_0x8d4af9[_0x1beca0(0x1d0)](_0x3bb810['created']+'\x20created'));if(_0x3bb810['updated']!==undefined&&_0x3bb810[_0x1beca0(0x1f0)]>0x0)_0x3966cc[_0x1beca0(0x206)](a4_0x8d4af9['yellow'](_0x3bb810[_0x1beca0(0x1f0)]+'\x20updated'));if(_0x3bb810['unchanged']!==undefined&&_0x3bb810['unchanged']>0x0)_0x3966cc[_0x1beca0(0x206)](a4_0x8d4af9['gray'](_0x3bb810[_0x1beca0(0x1c1)]+_0x1beca0(0x169)));if(_0x3bb810[_0x1beca0(0x215)]!==undefined&&_0x3bb810['errors']>0x0)_0x3966cc[_0x1beca0(0x206)](a4_0x8d4af9[_0x1beca0(0x21a)](_0x3bb810[_0x1beca0(0x215)]+'\x20errors'));return _0x3966cc[_0x1beca0(0x1c5)](',\x20');}function displayDiffs(_0x3c7b92,_0x410ab0,_0x4643c6,_0x70a5e,_0x16dc05,_0x55782f,_0x4a95f8){const _0x32caca=a4_0x52db;for(const _0x4adcb6 of _0x3c7b92){if(_0x4adcb6['diff']){const _0x14712e=_0x4adcb6[_0x32caca(0x216)]||_0x4adcb6[_0x32caca(0x1bc)];console[_0x32caca(0x1e9)]('\x0aChanges\x20to\x20agent\x20\x27'+_0x14712e+'\x27:'),console[_0x32caca(0x1e9)]('─'['repeat'](0x3c)),console[_0x32caca(0x1e9)](_0x4adcb6[_0x32caca(0x19f)]),console[_0x32caca(0x1e9)]('─'[_0x32caca(0x191)](0x3c));}}for(const _0x1f1df3 of _0x410ab0){_0x1f1df3[_0x32caca(0x19f)]&&(console[_0x32caca(0x1e9)]('\x0aChanges\x20to\x20knowledge\x20base\x20\x27'+_0x1f1df3[_0x32caca(0x1bc)]+'\x27:'),console[_0x32caca(0x1e9)]('─'['repeat'](0x3c)),console[_0x32caca(0x1e9)](_0x1f1df3['diff']),console[_0x32caca(0x1e9)]('─'[_0x32caca(0x191)](0x3c)));}for(const _0x4ea2e9 of _0x4643c6){_0x4ea2e9['diff']&&(console[_0x32caca(0x1e9)](_0x32caca(0x1ea)+_0x4ea2e9[_0x32caca(0x1bc)]+'\x27:'),console[_0x32caca(0x1e9)]('─'[_0x32caca(0x191)](0x3c)),console[_0x32caca(0x1e9)](_0x4ea2e9[_0x32caca(0x19f)]),console[_0x32caca(0x1e9)]('─'[_0x32caca(0x191)](0x3c)));}for(const _0xa74ef0 of _0x70a5e){_0xa74ef0[_0x32caca(0x19f)]&&(console[_0x32caca(0x1e9)](_0x32caca(0x1f6)+_0xa74ef0[_0x32caca(0x1bc)]+'\x27:'),console[_0x32caca(0x1e9)]('─'[_0x32caca(0x191)](0x3c)),console['log'](_0xa74ef0[_0x32caca(0x19f)]),console[_0x32caca(0x1e9)]('─'['repeat'](0x3c)));}for(const _0x47ed71 of _0x16dc05){_0x47ed71['diff']&&(console['log'](_0x32caca(0x1a8)+_0x47ed71[_0x32caca(0x1bc)]+'\x27:'),console['log']('─'['repeat'](0x3c)),console[_0x32caca(0x1e9)](_0x47ed71[_0x32caca(0x19f)]),console['log']('─'[_0x32caca(0x191)](0x3c)));}for(const _0x46425e of _0x55782f){_0x46425e[_0x32caca(0x19f)]&&(console[_0x32caca(0x1e9)]('\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27'+_0x46425e[_0x32caca(0x1bc)]+'\x27:'),console['log']('─'[_0x32caca(0x191)](0x3c)),console[_0x32caca(0x1e9)](_0x46425e['diff']),console['log']('─'[_0x32caca(0x191)](0x3c)));}for(const _0x1bbd1a of _0x4a95f8){_0x1bbd1a['diff']&&(console[_0x32caca(0x1e9)](_0x32caca(0x210)+_0x1bbd1a['name']+'\x27:'),console[_0x32caca(0x1e9)]('─'[_0x32caca(0x191)](0x3c)),console[_0x32caca(0x1e9)](_0x1bbd1a['diff']),console['log']('─'[_0x32caca(0x191)](0x3c)));}}export class AgentPullCommand extends BaseCommand{['name']=a4_0x40c5a9(0x1c0);['description']=a4_0x40c5a9(0x164);async[a4_0x40c5a9(0x184)](_0x4047eb){const _0x424afa=a4_0x40c5a9,{options:_0x4d3344,args:_0x4194f3,tdx:_0x30befb}=_0x4047eb,_0xcb4356=_0x4194f3[0x0],_0x56b43e=_0x4194f3[0x1],_0x509a64=_0x4d3344['output'],_0x1f610b=_0x4d3344[_0x424afa(0x16b)],_0x174703=_0x4d3344[_0x424afa(0x1c9)],_0x482f42=_0x4d3344[_0x424afa(0x1c6)],_0x51aa17=_0x4d3344[_0x424afa(0x1c2)],_0x388756=_0x4d3344[_0x424afa(0x20c)];let _0x325291;if(_0xcb4356){const _0x2f0d40=a4_0x4047d1[_0x424afa(0x1c5)](_0xcb4356,_0x424afa(0x1c3));if(existsSync(_0x2f0d40))try{const _0x371621=JSON['parse'](readFileSync(_0x2f0d40,_0x424afa(0x1c4)));_0x371621[_0x424afa(0x1b1)]&&(_0x325291={'llm_project':_0x371621[_0x424afa(0x1b1)]});}catch{}}const _0xf5eb51=findAgentConfigPath(process['cwd']());let _0x1935cf;if(_0xf5eb51)try{const _0x23ffe4=JSON[_0x424afa(0x1d2)](readFileSync(_0xf5eb51,_0x424afa(0x1c4)));_0x23ffe4[_0x424afa(0x1b1)]&&(_0x1935cf={'llm_project':_0x23ffe4[_0x424afa(0x1b1)]});}catch{}const _0x236547=resolveAgentPullArgs({'arg':_0xcb4356,'agentNameArg':_0x56b43e,'agentFlag':_0x388756,'contextProject':_0x51aa17,'argDirConfig':_0x325291,'cwdConfigPath':_0xf5eb51||undefined,'cwdConfig':_0x1935cf}),{projectNameOrId:_0x47ea66,targetAgentName:_0x11fd54,existingOutputDir:_0xac0f6c,source:_0x132dde}=_0x236547;if(_0x132dde===_0x424afa(0x1df))console[_0x424afa(0x1e9)](a4_0x8d4af9[_0x424afa(0x178)](_0x424afa(0x173)+a4_0x4047d1[_0x424afa(0x1c5)](_0xcb4356,_0x424afa(0x1c3))+':\x20'+_0x47ea66));else{if(_0x132dde===_0x424afa(0x205))console[_0x424afa(0x1e9)](a4_0x8d4af9['dim'](_0x424afa(0x171)+_0x47ea66));else _0x132dde===_0x424afa(0x1d8)&&console['log'](a4_0x8d4af9['dim'](_0x424afa(0x16e)+_0x47ea66));}if(!_0x47ea66)return _0x388756?(console[_0x424afa(0x1e9)](a4_0x8d4af9[_0x424afa(0x189)](_0x424afa(0x208))),console[_0x424afa(0x1e9)]('Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>'),console['log'](_0x424afa(0x1cb))):(console[_0x424afa(0x1e9)](a4_0x8d4af9[_0x424afa(0x189)](_0x424afa(0x1b4))),console[_0x424afa(0x1e9)]('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[_0x424afa(0x1e9)](_0x424afa(0x1f3)),console[_0x424afa(0x1e9)](_0x424afa(0x187)),console[_0x424afa(0x1e9)](_0x424afa(0x1cf)),console[_0x424afa(0x1e9)]('\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(_0x11fd54){const {data:_0x36a98b}=await withSpinner(_0x424afa(0x1ba)+_0x11fd54+_0x424afa(0x219)+_0x47ea66+_0x424afa(0x1cc),()=>_0x30befb[_0x424afa(0x1f1)][_0x424afa(0x1fa)](_0x47ea66,_0x11fd54,_0x509a64,{'dryRun':_0x1f610b,'force':_0x174703}));if(_0x1f610b)return console[_0x424afa(0x1e9)](a4_0x8d4af9['yellow']('Dry\x20run\x20-\x20no\x20files\x20written')),console['log']('Would\x20pull\x20agent:\x20'+_0x36a98b[_0x424afa(0x216)]),console[_0x424afa(0x1e9)](_0x424afa(0x170)+_0x36a98b['outputPath']),_0x36a98b['diff']&&(console[_0x424afa(0x1e9)](_0x424afa(0x19e)),console[_0x424afa(0x1e9)]('─'[_0x424afa(0x191)](0x3c)),console['log'](_0x36a98b[_0x424afa(0x19f)]),console[_0x424afa(0x1e9)]('─'[_0x424afa(0x191)](0x3c))),0x0;return console['log'](a4_0x8d4af9[_0x424afa(0x1d0)](_0x424afa(0x1ee))),console[_0x424afa(0x1e9)](_0x424afa(0x1ae)+_0x36a98b[_0x424afa(0x216)]),console[_0x424afa(0x1e9)](_0x424afa(0x1fc)+_0x36a98b[_0x424afa(0x182)]),console[_0x424afa(0x1e9)](_0x424afa(0x16f)+(_0x36a98b['isNew']?a4_0x8d4af9[_0x424afa(0x1d0)](_0x424afa(0x1c8)):_0x36a98b[_0x424afa(0x17f)]?a4_0x8d4af9['yellow']('updated'):a4_0x8d4af9[_0x424afa(0x21c)]('unchanged'))),0x0;}const _0x1407de=_0xac0f6c||_0x509a64,{data:_0x440a58}=await withSpinner('Analyzing\x20project\x20\x22'+_0x47ea66+_0x424afa(0x1cc),()=>_0x30befb[_0x424afa(0x1f1)][_0x424afa(0x17d)](_0x47ea66,_0x1407de,{'dryRun':!![]})),_0x36e110=_0x440a58[_0x424afa(0x183)][_0x424afa(0x1e7)][_0x424afa(0x1c8)]+_0x440a58[_0x424afa(0x183)][_0x424afa(0x1a6)]['new']+_0x440a58[_0x424afa(0x183)][_0x424afa(0x1d7)][_0x424afa(0x1c8)]+_0x440a58['counts'][_0x424afa(0x211)][_0x424afa(0x1c8)]+_0x440a58[_0x424afa(0x183)][_0x424afa(0x16a)][_0x424afa(0x1c8)]+_0x440a58[_0x424afa(0x183)][_0x424afa(0x1d6)]['new']+_0x440a58[_0x424afa(0x183)][_0x424afa(0x1a5)]['new'],_0x419ded=_0x440a58['counts'][_0x424afa(0x1e7)][_0x424afa(0x1f0)]+_0x440a58[_0x424afa(0x183)]['knowledgeBases'][_0x424afa(0x1f0)]+_0x440a58[_0x424afa(0x183)][_0x424afa(0x1d7)][_0x424afa(0x1f0)]+_0x440a58[_0x424afa(0x183)][_0x424afa(0x211)]['updated']+_0x440a58[_0x424afa(0x183)]['integrations'][_0x424afa(0x1f0)]+_0x440a58[_0x424afa(0x183)][_0x424afa(0x1d6)][_0x424afa(0x1f0)]+_0x440a58[_0x424afa(0x183)][_0x424afa(0x1a5)]['updated'],_0x1e0037=_0x440a58['counts'][_0x424afa(0x1e7)][_0x424afa(0x1c1)]+_0x440a58[_0x424afa(0x183)]['knowledgeBases']['unchanged']+_0x440a58[_0x424afa(0x183)][_0x424afa(0x1d7)][_0x424afa(0x1c1)]+_0x440a58[_0x424afa(0x183)][_0x424afa(0x211)][_0x424afa(0x1c1)]+_0x440a58[_0x424afa(0x183)][_0x424afa(0x16a)]['unchanged']+_0x440a58[_0x424afa(0x183)]['experimentalKnowledgeBases']['unchanged']+_0x440a58[_0x424afa(0x183)]['experimentalArtifacts'][_0x424afa(0x1c1)];console['log'](_0x424afa(0x165)+_0x440a58['projectName']+'\x27:'),console[_0x424afa(0x1e9)]('\x20\x20'+a4_0x8d4af9[_0x424afa(0x1d0)]('+\x20'+_0x36e110+_0x424afa(0x1bf))+_0x424afa(0x168)+a4_0x8d4af9[_0x424afa(0x189)]('~\x20'+_0x419ded+_0x424afa(0x181))+'\x20|\x20'+a4_0x8d4af9[_0x424afa(0x178)]('=\x20'+_0x1e0037+'\x20unchanged')),console[_0x424afa(0x1e9)]('\x20\x20Agents:\x20'+formatCountSummary(_0x440a58[_0x424afa(0x183)][_0x424afa(0x1e7)])),console[_0x424afa(0x1e9)](_0x424afa(0x19d)+formatCountSummary(_0x440a58[_0x424afa(0x183)][_0x424afa(0x1a6)])),console[_0x424afa(0x1e9)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x440a58[_0x424afa(0x183)][_0x424afa(0x1d7)])),console[_0x424afa(0x1e9)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x440a58[_0x424afa(0x183)]['prompts'])),console[_0x424afa(0x1e9)](_0x424afa(0x166)+formatCountSummary(_0x440a58[_0x424afa(0x183)][_0x424afa(0x16a)]));const _0x32e7bb=_0x440a58[_0x424afa(0x183)][_0x424afa(0x1d6)][_0x424afa(0x19b)]>0x0||_0x440a58[_0x424afa(0x183)][_0x424afa(0x1a5)][_0x424afa(0x19b)]>0x0;_0x32e7bb&&(console[_0x424afa(0x1e9)](_0x424afa(0x1db)+formatCountSummary(_0x440a58['counts'][_0x424afa(0x1d6)])),console[_0x424afa(0x1e9)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x440a58[_0x424afa(0x183)][_0x424afa(0x1a5)])));console[_0x424afa(0x1e9)](_0x424afa(0x1ec)+a4_0x8d4af9[_0x424afa(0x1b6)](_0x440a58[_0x424afa(0x18b)])),displayDiffs(_0x440a58[_0x424afa(0x1e7)],_0x440a58[_0x424afa(0x1a6)],_0x440a58[_0x424afa(0x1d7)],_0x440a58['prompts'],_0x440a58[_0x424afa(0x16a)],_0x440a58[_0x424afa(0x1d6)],_0x440a58[_0x424afa(0x1a5)]);if(_0x1f610b)return console['log'](a4_0x8d4af9[_0x424afa(0x189)](_0x424afa(0x209))),0x0;if(_0x36e110===0x0&&_0x419ded===0x0)return console[_0x424afa(0x1e9)](a4_0x8d4af9[_0x424afa(0x1d0)](_0x424afa(0x202))),saveSessionContext({'llm_project':_0x440a58[_0x424afa(0x1a1)]},_0x4d3344[_0x424afa(0x1b9)]),console[_0x424afa(0x1e9)](a4_0x8d4af9[_0x424afa(0x1d0)](_0x424afa(0x177)+a4_0x8d4af9['dim'](_0x424afa(0x1b1))+_0x424afa(0x1f7)+a4_0x8d4af9[_0x424afa(0x1b6)](_0x440a58[_0x424afa(0x1a1)]))),0x0;if(!_0x482f42&&!_0x174703){if(!isInteractive())return console[_0x424afa(0x214)](a4_0x8d4af9[_0x424afa(0x21a)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a4_0x8d4af9['dim'](_0x424afa(0x1d9))),0x1;const _0x1f6188=await confirmKey(_0x424afa(0x188)+(_0x36e110+_0x419ded)+_0x424afa(0x174));if(!_0x1f6188)return console['log'](a4_0x8d4af9['yellow'](_0x424afa(0x180)),_0x424afa(0x1fd)),0x1;}const {data:_0x2f7c79}=await withSpinner(_0x424afa(0x193),()=>_0x30befb[_0x424afa(0x1f1)]['pullProject'](_0x47ea66,_0x1407de,{'force':_0x174703}));return console[_0x424afa(0x1e9)](a4_0x8d4af9[_0x424afa(0x1d0)](_0x424afa(0x203)+(_0x36e110+_0x419ded)+_0x424afa(0x18a)+_0x2f7c79[_0x424afa(0x18b)])),saveSessionContext({'llm_project':_0x2f7c79[_0x424afa(0x1a1)]},_0x4d3344['session']),console['log'](a4_0x8d4af9[_0x424afa(0x1d0)](_0x424afa(0x177)+a4_0x8d4af9[_0x424afa(0x178)](_0x424afa(0x1b1))+_0x424afa(0x1f7)+a4_0x8d4af9[_0x424afa(0x1b6)](_0x2f7c79[_0x424afa(0x1a1)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x40c5a9(0x1bc)]=a4_0x40c5a9(0x1f2);['description']=a4_0x40c5a9(0x1c7);async['execute'](_0x51084c){const _0x2c459f=a4_0x40c5a9,{options:_0x442b0b,args:_0x51bd4b,tdx:_0x40de18}=_0x51084c,_0xfadf03=_0x51bd4b[0x0],_0x508573=_0x442b0b[_0x2c459f(0x1bc)],_0x1bf5a0=_0x442b0b[_0x2c459f(0x16b)],_0x5cdf4e=_0x442b0b[_0x2c459f(0x1c6)],_0x58cf13=_0x442b0b[_0x2c459f(0x1e0)],_0x4870cf=_0x442b0b[_0x2c459f(0x1c2)];let _0x8a2165;const _0x4a3efe=findAgentConfigPath(process[_0x2c459f(0x217)]());if(_0xfadf03){const _0x189cdc=a4_0x4047d1[_0x2c459f(0x1c5)](_0xfadf03,_0x2c459f(0x1c3));existsSync(_0x189cdc)?(_0x8a2165=_0xfadf03,console[_0x2c459f(0x1e9)](a4_0x8d4af9[_0x2c459f(0x178)](_0x2c459f(0x198)+_0xfadf03))):_0x8a2165=_0xfadf03;}else{if(_0x4a3efe)_0x8a2165=a4_0x4047d1[_0x2c459f(0x1fb)](_0x4a3efe),console['log'](a4_0x8d4af9[_0x2c459f(0x178)](_0x2c459f(0x20b)+_0x8a2165));else{if(_0x4870cf){const _0x1a2447=sanitizeForFilesystem(_0x4870cf);let _0x4d0f5a=_0x1a2447,_0x4efe8e=a4_0x4047d1[_0x2c459f(0x1c5)](process[_0x2c459f(0x217)](),_0x2c459f(0x1e7),_0x1a2447,_0x2c459f(0x1c3));if(!existsSync(_0x4efe8e)){const _0x48099f=normalizeName(_0x4870cf),_0x2107dd=a4_0x4047d1[_0x2c459f(0x1c5)](process[_0x2c459f(0x217)](),_0x2c459f(0x1e7),_0x48099f,_0x2c459f(0x1c3));existsSync(_0x2107dd)&&(_0x4d0f5a=_0x48099f,_0x4efe8e=_0x2107dd);}if(existsSync(_0x4efe8e))_0x8a2165=a4_0x4047d1['dirname'](_0x4efe8e),console[_0x2c459f(0x1e9)](a4_0x8d4af9[_0x2c459f(0x178)](_0x2c459f(0x198)+_0x8a2165));else{const _0x27eea4=_0x442b0b[_0x2c459f(0x1a0)];if(_0x27eea4)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Cannot\x20clone\x20from\x20context\x20project\x20\x22'+_0x4870cf+'\x22\x20to\x20a\x20different\x20profile',undefined,{'helpText':_0x2c459f(0x17a)+_0x2c459f(0x1e5)+(_0x2c459f(0x192)+_0x4870cf+'\x0a')+('\x20\x20tdx\x20agent\x20clone\x20agents/'+_0x4d0f5a+_0x2c459f(0x194)+(_0x508573||_0x2c459f(0x186))+_0x2c459f(0x1b2)+_0x27eea4)});_0x8a2165=_0x4870cf,console[_0x2c459f(0x1e9)](a4_0x8d4af9[_0x2c459f(0x178)](_0x2c459f(0x1da)+_0x4870cf));}}}}if(!_0x8a2165)return console[_0x2c459f(0x1e9)](a4_0x8d4af9[_0x2c459f(0x189)](_0x2c459f(0x18f))),console[_0x2c459f(0x1e9)](_0x2c459f(0x18e)),console[_0x2c459f(0x1e9)](_0x2c459f(0x1ad)),console['log'](_0x2c459f(0x1a2)),console[_0x2c459f(0x1e9)]('\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>'),0x1;if(!_0x508573)throw new SDKError(ErrorCode[_0x2c459f(0x1be)],'New\x20project\x20name\x20is\x20required',undefined,{'helpText':_0x2c459f(0x199)});if(!_0x5cdf4e&&!_0x1bf5a0){if(!isInteractive())return console[_0x2c459f(0x214)](a4_0x8d4af9[_0x2c459f(0x21a)](_0x2c459f(0x1a4)),_0x2c459f(0x20d)),console[_0x2c459f(0x214)](a4_0x8d4af9[_0x2c459f(0x178)](_0x2c459f(0x1d9))),0x1;const _0x5d4b2a=await confirmKey('Clone\x20\x22'+_0x8a2165+'\x22\x20to\x20new\x20project\x20\x22'+_0x508573+'\x22?');if(!_0x5d4b2a)return console[_0x2c459f(0x1e9)](a4_0x8d4af9['yellow']('Cancelled')),0x1;}const {data:_0x447923}=await withSpinner(_0x2c459f(0x16d)+_0x8a2165+_0x2c459f(0x218)+_0x508573+_0x2c459f(0x1cc),()=>_0x40de18[_0x2c459f(0x1f1)][_0x2c459f(0x175)](_0x8a2165,_0x508573,{'dryRun':_0x1bf5a0}));if(_0x1bf5a0){console['log'](a4_0x8d4af9[_0x2c459f(0x189)](_0x2c459f(0x1e8))),console[_0x2c459f(0x1e9)](_0x2c459f(0x21b)+_0x447923[_0x2c459f(0x201)]),console[_0x2c459f(0x1e9)](_0x2c459f(0x1a3)+_0x508573),console[_0x2c459f(0x1e9)]('Would\x20clone:'),console['log']('\x20\x20Agents:\x20'+_0x447923[_0x2c459f(0x183)][_0x2c459f(0x1e7)]['created']),console['log'](_0x2c459f(0x19d)+_0x447923[_0x2c459f(0x183)][_0x2c459f(0x1a6)]['created']),console[_0x2c459f(0x1e9)](_0x2c459f(0x1e1)+_0x447923[_0x2c459f(0x183)][_0x2c459f(0x211)][_0x2c459f(0x185)]);const _0x24c3f8=_0x447923['counts'][_0x2c459f(0x1d6)]['created']>0x0||_0x447923[_0x2c459f(0x183)]['experimentalArtifacts']['created']>0x0;return _0x24c3f8&&(console[_0x2c459f(0x1e9)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+_0x447923[_0x2c459f(0x183)][_0x2c459f(0x1d6)][_0x2c459f(0x185)]),console[_0x2c459f(0x1e9)](_0x2c459f(0x1f9)+_0x447923[_0x2c459f(0x183)]['experimentalArtifacts'][_0x2c459f(0x185)])),0x0;}const _0x3b85a7=_0x447923[_0x2c459f(0x183)]['agents'][_0x2c459f(0x215)]>0x0||_0x447923[_0x2c459f(0x183)][_0x2c459f(0x1a6)][_0x2c459f(0x215)]>0x0||_0x447923[_0x2c459f(0x183)][_0x2c459f(0x211)][_0x2c459f(0x215)]>0x0||_0x447923['counts'][_0x2c459f(0x1d6)]['errors']>0x0||_0x447923['counts'][_0x2c459f(0x1a5)]['errors']>0x0;_0x3b85a7?console[_0x2c459f(0x1e9)](a4_0x8d4af9[_0x2c459f(0x189)](_0x2c459f(0x1b8))):console['log'](a4_0x8d4af9[_0x2c459f(0x1d0)](_0x2c459f(0x1d5)));console[_0x2c459f(0x1e9)](_0x2c459f(0x21b)+_0x447923[_0x2c459f(0x201)]),console[_0x2c459f(0x1e9)]('New\x20project:\x20'+_0x447923[_0x2c459f(0x1ce)]),console[_0x2c459f(0x1e9)](_0x2c459f(0x18d)+_0x447923['newProjectId']),console[_0x2c459f(0x1e9)](),console[_0x2c459f(0x1e9)](_0x2c459f(0x1b5)),console['log'](_0x2c459f(0x1ff)+formatCountSummary(_0x447923[_0x2c459f(0x183)]['agents'])),console[_0x2c459f(0x1e9)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x447923[_0x2c459f(0x183)]['knowledgeBases'])),console[_0x2c459f(0x1e9)](_0x2c459f(0x1e1)+formatCountSummary(_0x447923['counts'][_0x2c459f(0x211)])),console['log'](_0x2c459f(0x166)+formatCountSummary(_0x447923[_0x2c459f(0x183)][_0x2c459f(0x16a)]));const _0x1b8577=_0x447923[_0x2c459f(0x183)][_0x2c459f(0x1d6)][_0x2c459f(0x185)]>0x0||_0x447923[_0x2c459f(0x183)][_0x2c459f(0x1d6)][_0x2c459f(0x1f0)]>0x0||_0x447923[_0x2c459f(0x183)][_0x2c459f(0x1d6)][_0x2c459f(0x1c1)]>0x0||_0x447923[_0x2c459f(0x183)][_0x2c459f(0x1a5)]['created']>0x0||_0x447923[_0x2c459f(0x183)]['experimentalArtifacts'][_0x2c459f(0x1f0)]>0x0||_0x447923[_0x2c459f(0x183)]['experimentalArtifacts'][_0x2c459f(0x1c1)]>0x0;_0x1b8577&&(console[_0x2c459f(0x1e9)](_0x2c459f(0x1db)+formatCountSummary(_0x447923['counts'][_0x2c459f(0x1d6)])),console[_0x2c459f(0x1e9)](_0x2c459f(0x1f9)+formatCountSummary(_0x447923['counts'][_0x2c459f(0x1a5)])));if(_0x3b85a7){console[_0x2c459f(0x1e9)](),console[_0x2c459f(0x1e9)](a4_0x8d4af9[_0x2c459f(0x21a)](_0x2c459f(0x17c)));for(const _0x42ed9e of _0x447923[_0x2c459f(0x1e7)]){_0x42ed9e[_0x2c459f(0x1d4)]===_0x2c459f(0x214)&&console[_0x2c459f(0x1e9)](a4_0x8d4af9[_0x2c459f(0x21a)](_0x2c459f(0x17b)+_0x42ed9e[_0x2c459f(0x216)]+_0x2c459f(0x1ac)+_0x42ed9e[_0x2c459f(0x214)]));}for(const _0x4bf547 of _0x447923[_0x2c459f(0x1a6)]){_0x4bf547[_0x2c459f(0x1d4)]==='error'&&console['log'](a4_0x8d4af9[_0x2c459f(0x21a)](_0x2c459f(0x195)+_0x4bf547[_0x2c459f(0x1bc)]+_0x2c459f(0x1ac)+_0x4bf547['error']));}for(const _0x17861f of _0x447923[_0x2c459f(0x211)]){_0x17861f['action']===_0x2c459f(0x214)&&console['log'](a4_0x8d4af9['red']('\x20\x20Prompt\x20\x22'+_0x17861f[_0x2c459f(0x1bc)]+_0x2c459f(0x1ac)+_0x17861f[_0x2c459f(0x214)]));}for(const _0x14a355 of _0x447923[_0x2c459f(0x16a)]){_0x14a355[_0x2c459f(0x1d4)]==='error'&&console[_0x2c459f(0x1e9)](a4_0x8d4af9[_0x2c459f(0x21a)](_0x2c459f(0x200)+_0x14a355['name']+_0x2c459f(0x1ac)+_0x14a355[_0x2c459f(0x214)]));}for(const _0x5b71ce of _0x447923[_0x2c459f(0x1d6)]){_0x5b71ce[_0x2c459f(0x1d4)]===_0x2c459f(0x214)&&console[_0x2c459f(0x1e9)](a4_0x8d4af9['red'](_0x2c459f(0x1e2)+_0x5b71ce[_0x2c459f(0x1bc)]+'\x22:\x20'+_0x5b71ce[_0x2c459f(0x214)]));}for(const _0x19d8ff of _0x447923[_0x2c459f(0x1a5)]){_0x19d8ff[_0x2c459f(0x1d4)]===_0x2c459f(0x214)&&console['log'](a4_0x8d4af9[_0x2c459f(0x21a)](_0x2c459f(0x1f8)+_0x19d8ff['name']+_0x2c459f(0x1ac)+_0x19d8ff[_0x2c459f(0x214)]));}return 0x1;}console[_0x2c459f(0x1e9)]();const _0x524ab6=getLLMProjectUrl(_0x58cf13,_0x447923[_0x2c459f(0x1bd)]);return console[_0x2c459f(0x1e9)](_0x2c459f(0x1dc)+a4_0x8d4af9['cyan'](_0x524ab6)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x40c5a9(0x1bc)]='agent:push';['description']=a4_0x40c5a9(0x19c);async[a4_0x40c5a9(0x184)](_0x549188){const _0x162587=a4_0x40c5a9,{options:_0x34c233,args:_0x461529,tdx:_0x40d7f8}=_0x549188;let _0x497d2c=_0x461529[0x0]||process['cwd']();const _0x434e3c=_0x34c233[_0x162587(0x16b)],_0x3d089b=_0x34c233['force'],_0x17f067=_0x34c233['yes'],_0x2580e0=_0x34c233[_0x162587(0x1e0)],_0x34180c=a4_0x4047d1[_0x162587(0x1c5)](_0x497d2c,'agent.yml'),_0x18d78e=existsSync(_0x34180c);if(_0x18d78e){const {data:_0x543d9e}=await withSpinner(_0x162587(0x1d3)+_0x497d2c+_0x162587(0x1cc),()=>_0x40d7f8[_0x162587(0x1f1)][_0x162587(0x196)](_0x497d2c,{'dryRun':_0x434e3c,'force':_0x3d089b}));if(_0x434e3c)return console[_0x162587(0x1e9)](a4_0x8d4af9['yellow'](_0x162587(0x1e8))),console['log'](_0x162587(0x176)+_0x543d9e['agentName']),0x0;if(_0x543d9e[_0x162587(0x1d4)]===_0x162587(0x214))return console[_0x162587(0x1e9)](a4_0x8d4af9[_0x162587(0x21a)](_0x162587(0x1e6)+_0x543d9e[_0x162587(0x214)])),0x1;console[_0x162587(0x1e9)](a4_0x8d4af9['green']('Agent\x20'+_0x543d9e['action']+_0x162587(0x1ef))),console[_0x162587(0x1e9)]('Agent:\x20'+_0x543d9e['agentName']);if(_0x543d9e[_0x162587(0x1ab)]&&_0x543d9e['projectId']){const _0x152bb8=getLLMAgentChatUrl(_0x2580e0,_0x543d9e[_0x162587(0x207)],_0x543d9e['agentId']);console[_0x162587(0x1e9)]('Chat:\x20'+a4_0x8d4af9[_0x162587(0x1b6)](_0x152bb8));}return 0x0;}const _0xf148ec=_0x34c233[_0x162587(0x1c2)],_0x56725f=resolveProjectFromContext(_0x497d2c,_0xf148ec);if(_0x56725f[_0x162587(0x204)])_0x497d2c=_0x56725f['projectDir'],_0x56725f[_0x162587(0x179)]===_0x162587(0x1d8)&&console[_0x162587(0x1e9)](a4_0x8d4af9['dim'](_0x162587(0x171)+_0x497d2c));else{let _0x5aa964='Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.';_0x56725f['reason']===_0x162587(0x190)&&(_0x5aa964=_0x56725f[_0x162587(0x1a9)]+'\x0aRun\x20\x27tdx\x20agent\x20pull\x20'+_0x56725f[_0x162587(0x1c2)]+'\x27\x20to\x20create\x20the\x20folder\x20structure.');throw new SDKError(ErrorCode[_0x162587(0x197)],_0x56725f[_0x162587(0x1b7)]===_0x162587(0x1cd)?_0x56725f[_0x162587(0x1a9)]:'No\x20tdx.json\x20found\x20in\x20'+_0x497d2c,undefined,{'helpText':_0x5aa964});}const {data:_0x49278e}=await withSpinner(_0x162587(0x1b0),()=>_0x40d7f8[_0x162587(0x1f1)]['pushProject'](_0x497d2c,{'dryRun':!![]})),_0x549081=_0x49278e['counts'][_0x162587(0x1e7)][_0x162587(0x215)]>0x0;if(_0x549081){console[_0x162587(0x1e9)](a4_0x8d4af9[_0x162587(0x21a)](_0x162587(0x1dd)));for(const _0x48cc35 of _0x49278e[_0x162587(0x1e7)]){_0x48cc35['action']===_0x162587(0x214)&&console[_0x162587(0x1e9)](a4_0x8d4af9[_0x162587(0x21a)](_0x162587(0x17b)+_0x48cc35[_0x162587(0x216)]+_0x162587(0x1ac)+_0x48cc35['error']));}return 0x1;}const _0x5d371c=_0x49278e['counts'][_0x162587(0x1e7)]['created']+_0x49278e[_0x162587(0x183)][_0x162587(0x1a6)][_0x162587(0x185)]+_0x49278e[_0x162587(0x183)][_0x162587(0x1d7)][_0x162587(0x185)]+_0x49278e[_0x162587(0x183)][_0x162587(0x211)][_0x162587(0x185)]+_0x49278e[_0x162587(0x183)][_0x162587(0x16a)][_0x162587(0x185)]+_0x49278e[_0x162587(0x183)][_0x162587(0x1d6)][_0x162587(0x185)]+_0x49278e[_0x162587(0x183)][_0x162587(0x1a5)]['created'],_0x4f5317=_0x49278e['counts']['agents'][_0x162587(0x1f0)]+_0x49278e['counts']['knowledgeBases']['updated']+_0x49278e[_0x162587(0x183)][_0x162587(0x1d7)]['updated']+_0x49278e[_0x162587(0x183)][_0x162587(0x211)][_0x162587(0x1f0)]+_0x49278e[_0x162587(0x183)]['integrations'][_0x162587(0x1f0)]+_0x49278e['counts'][_0x162587(0x1d6)][_0x162587(0x1f0)]+_0x49278e[_0x162587(0x183)][_0x162587(0x1a5)][_0x162587(0x1f0)],_0x3adaf2=_0x49278e['counts'][_0x162587(0x1e7)][_0x162587(0x1c1)]+_0x49278e[_0x162587(0x183)][_0x162587(0x1a6)][_0x162587(0x1c1)]+_0x49278e[_0x162587(0x183)]['textKnowledgeBases'][_0x162587(0x1c1)]+_0x49278e[_0x162587(0x183)][_0x162587(0x211)][_0x162587(0x1c1)]+_0x49278e['counts'][_0x162587(0x16a)]['unchanged']+_0x49278e[_0x162587(0x183)][_0x162587(0x1d6)]['unchanged']+_0x49278e[_0x162587(0x183)]['experimentalArtifacts']['unchanged'];console['log'](_0x162587(0x1a7)+_0x49278e[_0x162587(0x1a1)]+'\x27:'),console[_0x162587(0x1e9)]('\x20\x20'+a4_0x8d4af9[_0x162587(0x1d0)]('+\x20'+_0x5d371c+'\x20new')+_0x162587(0x168)+a4_0x8d4af9[_0x162587(0x189)]('~\x20'+_0x4f5317+_0x162587(0x181))+_0x162587(0x168)+a4_0x8d4af9[_0x162587(0x178)]('=\x20'+_0x3adaf2+_0x162587(0x169))),console[_0x162587(0x1e9)]('\x20\x20Agents:\x20'+formatCountSummary(_0x49278e[_0x162587(0x183)]['agents'])),console[_0x162587(0x1e9)](_0x162587(0x19d)+formatCountSummary(_0x49278e['counts'][_0x162587(0x1a6)])),console[_0x162587(0x1e9)](_0x162587(0x20f)+formatCountSummary(_0x49278e[_0x162587(0x183)][_0x162587(0x1d7)])),console['log'](_0x162587(0x1e1)+formatCountSummary(_0x49278e['counts']['prompts'])),console[_0x162587(0x1e9)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x49278e[_0x162587(0x183)][_0x162587(0x16a)]));const _0xb19bee=_0x49278e[_0x162587(0x183)][_0x162587(0x1d6)][_0x162587(0x185)]>0x0||_0x49278e[_0x162587(0x183)]['experimentalKnowledgeBases']['updated']>0x0||_0x49278e[_0x162587(0x183)][_0x162587(0x1d6)][_0x162587(0x1c1)]>0x0||_0x49278e[_0x162587(0x183)][_0x162587(0x1a5)][_0x162587(0x185)]>0x0||_0x49278e['counts']['experimentalArtifacts'][_0x162587(0x1f0)]>0x0||_0x49278e['counts'][_0x162587(0x1a5)][_0x162587(0x1c1)]>0x0;_0xb19bee&&(console['log'](_0x162587(0x1db)+formatCountSummary(_0x49278e['counts'][_0x162587(0x1d6)])),console[_0x162587(0x1e9)](_0x162587(0x1f9)+formatCountSummary(_0x49278e[_0x162587(0x183)][_0x162587(0x1a5)])));console[_0x162587(0x1e9)](_0x162587(0x1e3)+a4_0x8d4af9['cyan'](_0x497d2c)),displayDiffs(_0x49278e[_0x162587(0x1e7)],_0x49278e[_0x162587(0x1a6)],_0x49278e[_0x162587(0x1d7)],_0x49278e['prompts'],_0x49278e[_0x162587(0x16a)],_0x49278e[_0x162587(0x1d6)],_0x49278e[_0x162587(0x1a5)]);if(_0x434e3c)return console[_0x162587(0x1e9)](a4_0x8d4af9['yellow'](_0x162587(0x213))),0x0;if(_0x5d371c===0x0&&_0x4f5317===0x0){console[_0x162587(0x1e9)](a4_0x8d4af9[_0x162587(0x1d0)](_0x162587(0x1b3)));const _0xc68ea7=getLLMProjectUrl(_0x2580e0,_0x49278e[_0x162587(0x207)]);return console['log'](_0x162587(0x1dc)+a4_0x8d4af9[_0x162587(0x1b6)](_0xc68ea7)),0x0;}if(!_0x17f067&&!_0x3d089b){if(!isInteractive())return console[_0x162587(0x214)](a4_0x8d4af9[_0x162587(0x21a)](_0x162587(0x1a4)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x162587(0x214)](a4_0x8d4af9[_0x162587(0x178)](_0x162587(0x1d9))),0x1;const _0x1c28fe=await confirmKey(_0x162587(0x167)+(_0x5d371c+_0x4f5317)+'\x20resources?');if(!_0x1c28fe)return console[_0x162587(0x1e9)](a4_0x8d4af9['yellow']('Cancelled'),_0x162587(0x19a)),0x1;}const {data:_0x3eb7d1}=await withSpinner('Pushing\x20to\x20project...',()=>_0x40d7f8['llm'][_0x162587(0x20e)](_0x497d2c,{'force':_0x3d089b})),_0x3b9699=_0x3eb7d1[_0x162587(0x183)][_0x162587(0x1e7)][_0x162587(0x215)]>0x0||_0x3eb7d1[_0x162587(0x183)][_0x162587(0x1a6)][_0x162587(0x215)]>0x0||_0x3eb7d1[_0x162587(0x183)][_0x162587(0x1d7)][_0x162587(0x215)]>0x0||_0x3eb7d1[_0x162587(0x183)][_0x162587(0x211)]['errors']>0x0;if(_0x3b9699){console[_0x162587(0x1e9)](a4_0x8d4af9[_0x162587(0x189)](_0x162587(0x1de))),console[_0x162587(0x1e9)](),console['log'](a4_0x8d4af9[_0x162587(0x21a)]('Errors:'));for(const _0x22613d of _0x3eb7d1[_0x162587(0x1e7)]){_0x22613d['action']===_0x162587(0x214)&&console[_0x162587(0x1e9)](a4_0x8d4af9[_0x162587(0x21a)]('\x20\x20Agent\x20\x22'+_0x22613d[_0x162587(0x216)]+_0x162587(0x1ac)+_0x22613d[_0x162587(0x214)]));}for(const _0x4d62c6 of _0x3eb7d1[_0x162587(0x1a6)]){_0x4d62c6[_0x162587(0x1d4)]===_0x162587(0x214)&&console[_0x162587(0x1e9)](a4_0x8d4af9[_0x162587(0x21a)](_0x162587(0x195)+_0x4d62c6['name']+_0x162587(0x1ac)+_0x4d62c6['error']));}for(const _0x15d919 of _0x3eb7d1[_0x162587(0x1d7)]){_0x15d919[_0x162587(0x1d4)]===_0x162587(0x214)&&console[_0x162587(0x1e9)](a4_0x8d4af9[_0x162587(0x21a)](_0x162587(0x17e)+_0x15d919[_0x162587(0x1bc)]+_0x162587(0x1ac)+_0x15d919['error']));}for(const _0x5d9b38 of _0x3eb7d1[_0x162587(0x211)]){_0x5d9b38[_0x162587(0x1d4)]==='error'&&console['log'](a4_0x8d4af9['red'](_0x162587(0x1eb)+_0x5d9b38[_0x162587(0x1bc)]+_0x162587(0x1ac)+_0x5d9b38[_0x162587(0x214)]));}for(const _0x31b667 of _0x3eb7d1[_0x162587(0x16a)]){_0x31b667['action']===_0x162587(0x214)&&console[_0x162587(0x1e9)](a4_0x8d4af9[_0x162587(0x21a)]('\x20\x20Integration\x20\x22'+_0x31b667[_0x162587(0x1bc)]+_0x162587(0x1ac)+_0x31b667[_0x162587(0x214)]));}return 0x1;}console[_0x162587(0x1e9)](a4_0x8d4af9[_0x162587(0x1d0)](_0x162587(0x1bb)+(_0x5d371c+_0x4f5317)+_0x162587(0x1fe)+_0x3eb7d1['projectName']+'\x27'));const _0x2ca6fc=getLLMProjectUrl(_0x2580e0,_0x3eb7d1[_0x162587(0x207)]);return console[_0x162587(0x1e9)](_0x162587(0x1dc)+a4_0x8d4af9[_0x162587(0x1b6)](_0x2ca6fc)),0x0;}}
1
+ const a4_0x331360=a4_0x5a2e;(function(_0x573a2f,_0x2ed40c){const _0x5518dc=a4_0x5a2e,_0x341a4b=_0x573a2f();while(!![]){try{const _0x1aff3a=parseInt(_0x5518dc(0xba))/0x1+parseInt(_0x5518dc(0x123))/0x2*(-parseInt(_0x5518dc(0xb5))/0x3)+parseInt(_0x5518dc(0x142))/0x4+-parseInt(_0x5518dc(0xc6))/0x5+parseInt(_0x5518dc(0xc4))/0x6*(-parseInt(_0x5518dc(0x160))/0x7)+parseInt(_0x5518dc(0xea))/0x8+parseInt(_0x5518dc(0xfe))/0x9;if(_0x1aff3a===_0x2ed40c)break;else _0x341a4b['push'](_0x341a4b['shift']());}catch(_0x172cd9){_0x341a4b['push'](_0x341a4b['shift']());}}}(a4_0x1d91,0x8a4a4));import a4_0x5f490c from'chalk';import a4_0x4515b8 from'path';import{existsSync,readFileSync}from'fs';function a4_0x1d91(){const _0x17504e=['\x20\x20Experimental\x20Knowledge\x20Bases:\x20','source','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','\x0a✔\x20Pushed\x20','Cloning\x20\x22','projectDir','Pushing\x20agent\x20from\x20\x22','Cancelled','\x20\x20Prompts:\x20','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','gray','experimentalKnowledgeBases','Using\x20local\x20project:\x20','\x20total','outputPath','integrations','311376mxDlRC','\x20=\x20','\x20\x20Experimental\x20Artifacts:\x20','\x20\x20Knowledge\x20Base\x20\x22','Writing\x20files...','New\x20project:\x20','Project\x20cloned\x20successfully','\x20\x20Experimental\x20Artifact\x20\x22','\x22:\x20','reason','\x22\x20to\x20new\x20project\x20\x22','profile','cwd','Project:\x20','dim','\x20\x20Integrations:\x20','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','found','Analyzing\x20changes\x20to\x20push...','agent:clone','no_context','yes','\x20--profile\x20','\x0aChanges\x20to\x20agent\x20\x27','log','total','Source:\x20','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','\x0aChanges\x20to\x20integration\x20\x27','\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','63413EYTfxm','<new-name>','agent.yml','\x0aPull\x20summary\x20for\x20\x27','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','join','action','\x0aError:','red','projectId','\x20updated','projectName','Output\x20path:\x20','cyan','\x0aProject\x20pushed\x20with\x20errors','description','knowledgeBases','\x20\x20Text\x20Knowledge\x20Base\x20\x22','555sOOIMV','newProjectId','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','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)','pullProject','93560TpNGhg','\x20\x20Knowledge\x20Bases:\x20','\x20errors','cloneProject','Would\x20pull\x20agent:\x20','Output:\x20','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','new','utf-8','green','258smkHYd','Would\x20clone:','2430670cihoUt','-\x20no\x20files\x20written','\x20\x20Target:\x20','Clone\x20\x22','\x22\x20to\x20\x22','diff','counts','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','experimentalArtifacts','llm','\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','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','Analyzing\x20project\x20\x22','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','site','-\x20nothing\x20pushed','\x0aErrors\x20found:','push','\x0aChanges:','Chat:\x20','\x20\x20Agents:\x20','\x20|\x20','tdx.json','New\x20project\x20name\x20is\x20required','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','prompts','\x22\x20from\x20project\x20\x22','No\x20tdx.json\x20found\x20in\x20','yellow','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','\x27\x20to\x20create\x20the\x20folder\x20structure.','newProjectName','\x20\x20Prompt\x20\x22','hasChanges','arg-dir','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','1362616lipgNi','Using\x20project:\x20','textKnowledgeBases','agents','Errors:','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','Using\x20context\x20project:\x20','llm_project','message','\x20unchanged','name','repeat','Using\x20current\x20project:\x20','pushProject','cwd-config','\x20\x20Agent\x20\x22','\x20\x20Integration\x20\x22','\x20\x20tdx\x20agent\x20clone\x20--name\x20<new-name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clone\x20from\x20context\x20(llm_project)','agentId','llmProject','12136149aYMhyo','agent:push','execute','Would\x20push\x20agent:\x20','Project\x20cloned\x20with\x20errors','\x20changed','Pushing\x20to\x20project...','errors','parse','\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','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','\x20resources\x20to\x20\x27','Status:\x20','agentName','✔\x20Context\x20set:\x20','dryRun','INVALID_ARGUMENT','\x0aWrite\x20','Agent\x20','\x20--name\x20','\x0aPush\x20summary\x20for\x20\x27','force','outputDir','Using\x20project\x20from\x20context:\x20','created','no_local_folder','agent','error','unchanged','\x20new','\x20files\x20to\x20','\x0a✔\x20Pulled\x20','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','New\x20project\x20ID:\x20','updated','Summary:','agent:pull','2682GufHvo','\x20\x20Text\x20Knowledge\x20Bases:\x20','isNew','Cannot\x20clone\x20from\x20context\x20project\x20\x22','sourceProjectName','session','Using\x20project\x20from\x20','Agent:\x20','context','\x22...','\x22\x20to\x20a\x20different\x20profile','dirname','Dry\x20run\x20-\x20no\x20changes\x20made','\x20created'];a4_0x1d91=function(){return _0x17504e;};return a4_0x1d91();}function a4_0x5a2e(_0x460d4a,_0x47ae2a){_0x460d4a=_0x460d4a-0xaf;const _0x1d9114=a4_0x1d91();let _0x5a2e35=_0x1d9114[_0x460d4a];return _0x5a2e35;}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(_0x2a0e6a){const _0x592f38=a4_0x5a2e,_0x39ff7d=[];if(_0x2a0e6a[_0x592f38(0x15b)]!==undefined)_0x39ff7d[_0x592f38(0xd7)](_0x2a0e6a[_0x592f38(0x15b)]+_0x592f38(0x13f));if(_0x2a0e6a[_0x592f38(0xc1)]!==undefined&&_0x2a0e6a[_0x592f38(0xc1)]>0x0)_0x39ff7d['push'](a4_0x5f490c[_0x592f38(0xc3)](_0x2a0e6a['new']+_0x592f38(0x11b)));if(_0x2a0e6a[_0x592f38(0x116)]!==undefined&&_0x2a0e6a[_0x592f38(0x116)]>0x0)_0x39ff7d[_0x592f38(0xd7)](a4_0x5f490c[_0x592f38(0xc3)](_0x2a0e6a['created']+_0x592f38(0x130)));if(_0x2a0e6a[_0x592f38(0x120)]!==undefined&&_0x2a0e6a[_0x592f38(0x120)]>0x0)_0x39ff7d['push'](a4_0x5f490c[_0x592f38(0xe2)](_0x2a0e6a[_0x592f38(0x120)]+_0x592f38(0x16a)));if(_0x2a0e6a[_0x592f38(0x11a)]!==undefined&&_0x2a0e6a[_0x592f38(0x11a)]>0x0)_0x39ff7d[_0x592f38(0xd7)](a4_0x5f490c[_0x592f38(0x13c)](_0x2a0e6a['unchanged']+_0x592f38(0xf3)));if(_0x2a0e6a[_0x592f38(0x105)]!==undefined&&_0x2a0e6a[_0x592f38(0x105)]>0x0)_0x39ff7d[_0x592f38(0xd7)](a4_0x5f490c['red'](_0x2a0e6a['errors']+_0x592f38(0xbc)));return _0x39ff7d[_0x592f38(0x165)](',\x20');}function displayDiffs(_0x322372,_0x18a472,_0x2fef93,_0x3eb37a,_0x457325,_0x21918f,_0x4012d2){const _0x5ec1b4=a4_0x5a2e;for(const _0x52af83 of _0x322372){if(_0x52af83[_0x5ec1b4(0xcb)]){const _0x4c050d=_0x52af83[_0x5ec1b4(0x10b)]||_0x52af83[_0x5ec1b4(0xf4)];console[_0x5ec1b4(0x15a)](_0x5ec1b4(0x159)+_0x4c050d+'\x27:'),console[_0x5ec1b4(0x15a)]('─'['repeat'](0x3c)),console[_0x5ec1b4(0x15a)](_0x52af83[_0x5ec1b4(0xcb)]),console[_0x5ec1b4(0x15a)]('─'[_0x5ec1b4(0xf5)](0x3c));}}for(const _0x332ff9 of _0x18a472){_0x332ff9[_0x5ec1b4(0xcb)]&&(console[_0x5ec1b4(0x15a)](_0x5ec1b4(0x108)+_0x332ff9['name']+'\x27:'),console['log']('─'[_0x5ec1b4(0xf5)](0x3c)),console[_0x5ec1b4(0x15a)](_0x332ff9[_0x5ec1b4(0xcb)]),console[_0x5ec1b4(0x15a)]('─'[_0x5ec1b4(0xf5)](0x3c)));}for(const _0x419e2b of _0x2fef93){_0x419e2b['diff']&&(console[_0x5ec1b4(0x15a)](_0x5ec1b4(0x164)+_0x419e2b[_0x5ec1b4(0xf4)]+'\x27:'),console[_0x5ec1b4(0x15a)]('─'['repeat'](0x3c)),console['log'](_0x419e2b['diff']),console[_0x5ec1b4(0x15a)]('─'[_0x5ec1b4(0xf5)](0x3c)));}for(const _0x51f7c0 of _0x3eb37a){_0x51f7c0[_0x5ec1b4(0xcb)]&&(console['log']('\x0aChanges\x20to\x20prompt\x20\x27'+_0x51f7c0[_0x5ec1b4(0xf4)]+'\x27:'),console['log']('─'[_0x5ec1b4(0xf5)](0x3c)),console[_0x5ec1b4(0x15a)](_0x51f7c0[_0x5ec1b4(0xcb)]),console[_0x5ec1b4(0x15a)]('─'['repeat'](0x3c)));}for(const _0x3aea6d of _0x457325){_0x3aea6d[_0x5ec1b4(0xcb)]&&(console[_0x5ec1b4(0x15a)](_0x5ec1b4(0x15e)+_0x3aea6d['name']+'\x27:'),console[_0x5ec1b4(0x15a)]('─'[_0x5ec1b4(0xf5)](0x3c)),console['log'](_0x3aea6d[_0x5ec1b4(0xcb)]),console[_0x5ec1b4(0x15a)]('─'[_0x5ec1b4(0xf5)](0x3c)));}for(const _0x5408dd of _0x21918f){_0x5408dd[_0x5ec1b4(0xcb)]&&(console[_0x5ec1b4(0x15a)]('\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27'+_0x5408dd['name']+'\x27:'),console[_0x5ec1b4(0x15a)]('─'['repeat'](0x3c)),console['log'](_0x5408dd[_0x5ec1b4(0xcb)]),console[_0x5ec1b4(0x15a)]('─'[_0x5ec1b4(0xf5)](0x3c)));}for(const _0x3cd39b of _0x4012d2){_0x3cd39b[_0x5ec1b4(0xcb)]&&(console[_0x5ec1b4(0x15a)](_0x5ec1b4(0x134)+_0x3cd39b['name']+'\x27:'),console['log']('─'[_0x5ec1b4(0xf5)](0x3c)),console['log'](_0x3cd39b[_0x5ec1b4(0xcb)]),console[_0x5ec1b4(0x15a)]('─'[_0x5ec1b4(0xf5)](0x3c)));}}export class AgentPullCommand extends BaseCommand{['name']=a4_0x331360(0x122);[a4_0x331360(0xb2)]='Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files';async['execute'](_0x30e5f0){const _0x4164e1=a4_0x331360,{options:_0x5c0528,args:_0x1e5fe9,tdx:_0x2c3198}=_0x30e5f0,_0x54962e=_0x1e5fe9[0x0],_0x58fd2a=_0x1e5fe9[0x1],_0x5aa254=_0x5c0528['output'],_0x13159a=_0x5c0528[_0x4164e1(0x10d)],_0x5f09c2=_0x5c0528[_0x4164e1(0x113)],_0x3f1383=_0x5c0528[_0x4164e1(0x157)],_0x434f10=_0x5c0528['llmProject'],_0x1d0859=_0x5c0528[_0x4164e1(0x118)];let _0xf52789;if(_0x54962e){const _0xde893f=a4_0x4515b8[_0x4164e1(0x165)](_0x54962e,_0x4164e1(0xdc));if(existsSync(_0xde893f))try{const _0x4102b6=JSON[_0x4164e1(0x106)](readFileSync(_0xde893f,_0x4164e1(0xc2)));_0x4102b6['llm_project']&&(_0xf52789={'llm_project':_0x4102b6['llm_project']});}catch{}}const _0xcbfdd8=findAgentConfigPath(process[_0x4164e1(0x14e)]());let _0x2901ed;if(_0xcbfdd8)try{const _0x343955=JSON[_0x4164e1(0x106)](readFileSync(_0xcbfdd8,_0x4164e1(0xc2)));_0x343955[_0x4164e1(0xf1)]&&(_0x2901ed={'llm_project':_0x343955[_0x4164e1(0xf1)]});}catch{}const _0x146279=resolveAgentPullArgs({'arg':_0x54962e,'agentNameArg':_0x58fd2a,'agentFlag':_0x1d0859,'contextProject':_0x434f10,'argDirConfig':_0xf52789,'cwdConfigPath':_0xcbfdd8||undefined,'cwdConfig':_0x2901ed}),{projectNameOrId:_0x3d448e,targetAgentName:_0x4affc6,existingOutputDir:_0x5dc4be,source:_0x14adf3}=_0x146279;if(_0x14adf3===_0x4164e1(0xe8))console['log'](a4_0x5f490c[_0x4164e1(0x150)](_0x4164e1(0x129)+a4_0x4515b8[_0x4164e1(0x165)](_0x54962e,'tdx.json')+':\x20'+_0x3d448e));else{if(_0x14adf3===_0x4164e1(0xf8))console['log'](a4_0x5f490c['dim'](_0x4164e1(0xeb)+_0x3d448e));else _0x14adf3===_0x4164e1(0x12b)&&console[_0x4164e1(0x15a)](a4_0x5f490c['dim'](_0x4164e1(0x115)+_0x3d448e));}if(!_0x3d448e)return _0x1d0859?(console['log'](a4_0x5f490c[_0x4164e1(0xe2)](_0x4164e1(0x13b))),console['log']('Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>'),console['log'](_0x4164e1(0x152))):(console[_0x4164e1(0x15a)](a4_0x5f490c[_0x4164e1(0xe2)]('llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a')),console['log'](_0x4164e1(0xb8)),console[_0x4164e1(0x15a)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project'),console[_0x4164e1(0x15a)](_0x4164e1(0xd0)),console['log'](_0x4164e1(0x15f)),console[_0x4164e1(0x15a)](_0x4164e1(0x107))),0x1;if(_0x4affc6){const {data:_0x531c09}=await withSpinner('Pulling\x20agent\x20\x22'+_0x4affc6+_0x4164e1(0xe0)+_0x3d448e+_0x4164e1(0x12c),()=>_0x2c3198[_0x4164e1(0xcf)]['pullAgent'](_0x3d448e,_0x4affc6,_0x5aa254,{'dryRun':_0x13159a,'force':_0x5f09c2}));if(_0x13159a)return console[_0x4164e1(0x15a)](a4_0x5f490c['yellow']('Dry\x20run\x20-\x20no\x20files\x20written')),console[_0x4164e1(0x15a)](_0x4164e1(0xbe)+_0x531c09[_0x4164e1(0x10b)]),console[_0x4164e1(0x15a)](_0x4164e1(0xaf)+_0x531c09[_0x4164e1(0x140)]),_0x531c09[_0x4164e1(0xcb)]&&(console[_0x4164e1(0x15a)](_0x4164e1(0xd8)),console['log']('─'[_0x4164e1(0xf5)](0x3c)),console['log'](_0x531c09[_0x4164e1(0xcb)]),console['log']('─'[_0x4164e1(0xf5)](0x3c))),0x0;return console[_0x4164e1(0x15a)](a4_0x5f490c['green']('Agent\x20pulled\x20successfully')),console[_0x4164e1(0x15a)](_0x4164e1(0x12a)+_0x531c09[_0x4164e1(0x10b)]),console[_0x4164e1(0x15a)](_0x4164e1(0xbf)+_0x531c09[_0x4164e1(0x140)]),console[_0x4164e1(0x15a)](_0x4164e1(0x10a)+(_0x531c09[_0x4164e1(0x125)]?a4_0x5f490c[_0x4164e1(0xc3)](_0x4164e1(0xc1)):_0x531c09[_0x4164e1(0xe7)]?a4_0x5f490c[_0x4164e1(0xe2)](_0x4164e1(0x120)):a4_0x5f490c[_0x4164e1(0x13c)](_0x4164e1(0x11a)))),0x0;}const _0x527d93=_0x5dc4be||_0x5aa254,{data:_0x1af576}=await withSpinner(_0x4164e1(0xd2)+_0x3d448e+'\x22...',()=>_0x2c3198[_0x4164e1(0xcf)]['pullProject'](_0x3d448e,_0x527d93,{'dryRun':!![]})),_0x12fe96=_0x1af576[_0x4164e1(0xcc)][_0x4164e1(0xed)][_0x4164e1(0xc1)]+_0x1af576[_0x4164e1(0xcc)]['knowledgeBases'][_0x4164e1(0xc1)]+_0x1af576[_0x4164e1(0xcc)][_0x4164e1(0xec)][_0x4164e1(0xc1)]+_0x1af576[_0x4164e1(0xcc)][_0x4164e1(0xdf)][_0x4164e1(0xc1)]+_0x1af576[_0x4164e1(0xcc)][_0x4164e1(0x141)][_0x4164e1(0xc1)]+_0x1af576[_0x4164e1(0xcc)]['experimentalKnowledgeBases'][_0x4164e1(0xc1)]+_0x1af576['counts'][_0x4164e1(0xce)][_0x4164e1(0xc1)],_0x46faa7=_0x1af576[_0x4164e1(0xcc)][_0x4164e1(0xed)]['updated']+_0x1af576['counts'][_0x4164e1(0xb3)][_0x4164e1(0x120)]+_0x1af576['counts']['textKnowledgeBases']['updated']+_0x1af576[_0x4164e1(0xcc)][_0x4164e1(0xdf)][_0x4164e1(0x120)]+_0x1af576[_0x4164e1(0xcc)][_0x4164e1(0x141)]['updated']+_0x1af576[_0x4164e1(0xcc)][_0x4164e1(0x13d)][_0x4164e1(0x120)]+_0x1af576[_0x4164e1(0xcc)][_0x4164e1(0xce)][_0x4164e1(0x120)],_0x2be3da=_0x1af576[_0x4164e1(0xcc)][_0x4164e1(0xed)][_0x4164e1(0x11a)]+_0x1af576[_0x4164e1(0xcc)]['knowledgeBases']['unchanged']+_0x1af576['counts'][_0x4164e1(0xec)][_0x4164e1(0x11a)]+_0x1af576[_0x4164e1(0xcc)][_0x4164e1(0xdf)][_0x4164e1(0x11a)]+_0x1af576[_0x4164e1(0xcc)][_0x4164e1(0x141)][_0x4164e1(0x11a)]+_0x1af576[_0x4164e1(0xcc)][_0x4164e1(0x13d)][_0x4164e1(0x11a)]+_0x1af576[_0x4164e1(0xcc)][_0x4164e1(0xce)][_0x4164e1(0x11a)];console['log'](_0x4164e1(0x163)+_0x1af576[_0x4164e1(0x16b)]+'\x27:'),console['log']('\x20\x20'+a4_0x5f490c[_0x4164e1(0xc3)]('+\x20'+_0x12fe96+_0x4164e1(0x11b))+_0x4164e1(0xdb)+a4_0x5f490c[_0x4164e1(0xe2)]('~\x20'+_0x46faa7+_0x4164e1(0x103))+_0x4164e1(0xdb)+a4_0x5f490c[_0x4164e1(0x150)]('=\x20'+_0x2be3da+'\x20unchanged')),console[_0x4164e1(0x15a)](_0x4164e1(0xda)+formatCountSummary(_0x1af576['counts'][_0x4164e1(0xed)])),console['log']('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x1af576[_0x4164e1(0xcc)]['knowledgeBases'])),console[_0x4164e1(0x15a)](_0x4164e1(0x124)+formatCountSummary(_0x1af576[_0x4164e1(0xcc)]['textKnowledgeBases'])),console[_0x4164e1(0x15a)](_0x4164e1(0x13a)+formatCountSummary(_0x1af576[_0x4164e1(0xcc)][_0x4164e1(0xdf)])),console['log'](_0x4164e1(0x151)+formatCountSummary(_0x1af576[_0x4164e1(0xcc)][_0x4164e1(0x141)]));const _0x1332ec=_0x1af576[_0x4164e1(0xcc)][_0x4164e1(0x13d)][_0x4164e1(0x15b)]>0x0||_0x1af576[_0x4164e1(0xcc)][_0x4164e1(0xce)][_0x4164e1(0x15b)]>0x0;_0x1332ec&&(console['log'](_0x4164e1(0x131)+formatCountSummary(_0x1af576[_0x4164e1(0xcc)][_0x4164e1(0x13d)])),console[_0x4164e1(0x15a)](_0x4164e1(0x144)+formatCountSummary(_0x1af576[_0x4164e1(0xcc)][_0x4164e1(0xce)])));console[_0x4164e1(0x15a)](_0x4164e1(0xc8)+a4_0x5f490c[_0x4164e1(0xb0)](_0x1af576['outputDir'])),displayDiffs(_0x1af576[_0x4164e1(0xed)],_0x1af576[_0x4164e1(0xb3)],_0x1af576[_0x4164e1(0xec)],_0x1af576[_0x4164e1(0xdf)],_0x1af576[_0x4164e1(0x141)],_0x1af576[_0x4164e1(0x13d)],_0x1af576[_0x4164e1(0xce)]);if(_0x13159a)return console[_0x4164e1(0x15a)](a4_0x5f490c[_0x4164e1(0xe2)](_0x4164e1(0x133))),0x0;if(_0x12fe96===0x0&&_0x46faa7===0x0)return console['log'](a4_0x5f490c[_0x4164e1(0xc3)](_0x4164e1(0xe9))),saveSessionContext({'llm_project':_0x1af576[_0x4164e1(0x16b)]},_0x5c0528[_0x4164e1(0x128)]),console[_0x4164e1(0x15a)](a4_0x5f490c[_0x4164e1(0xc3)]('✔\x20Context\x20set:\x20'+a4_0x5f490c[_0x4164e1(0x150)]('llm_project')+_0x4164e1(0x143)+a4_0x5f490c[_0x4164e1(0xb0)](_0x1af576['projectName']))),0x0;if(!_0x3f1383&&!_0x5f09c2){if(!isInteractive())return console[_0x4164e1(0x119)](a4_0x5f490c['red']('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x4164e1(0x119)](a4_0x5f490c['dim'](_0x4164e1(0xd3))),0x1;const _0x85b247=await confirmKey(_0x4164e1(0x10f)+(_0x12fe96+_0x46faa7)+'\x20files?');if(!_0x85b247)return console[_0x4164e1(0x15a)](a4_0x5f490c[_0x4164e1(0xe2)](_0x4164e1(0x139)),_0x4164e1(0xc7)),0x1;}const {data:_0x28bef9}=await withSpinner(_0x4164e1(0x146),()=>_0x2c3198[_0x4164e1(0xcf)][_0x4164e1(0xb9)](_0x3d448e,_0x527d93,{'force':_0x5f09c2}));return console[_0x4164e1(0x15a)](a4_0x5f490c[_0x4164e1(0xc3)](_0x4164e1(0x11d)+(_0x12fe96+_0x46faa7)+_0x4164e1(0x11c)+_0x28bef9[_0x4164e1(0x114)])),saveSessionContext({'llm_project':_0x28bef9['projectName']},_0x5c0528['session']),console['log'](a4_0x5f490c[_0x4164e1(0xc3)](_0x4164e1(0x10c)+a4_0x5f490c[_0x4164e1(0x150)](_0x4164e1(0xf1))+_0x4164e1(0x143)+a4_0x5f490c[_0x4164e1(0xb0)](_0x28bef9[_0x4164e1(0x16b)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x331360(0xf4)]=a4_0x331360(0x155);[a4_0x331360(0xb2)]=a4_0x331360(0x15d);async[a4_0x331360(0x100)](_0x5485a6){const _0x233d51=a4_0x331360,{options:_0x289af8,args:_0xe12882,tdx:_0x4868fe}=_0x5485a6,_0x5ca833=_0xe12882[0x0],_0x2c5151=_0x289af8[_0x233d51(0xf4)],_0x56fe8d=_0x289af8[_0x233d51(0x10d)],_0x568b29=_0x289af8[_0x233d51(0x157)],_0x1a1c46=_0x289af8[_0x233d51(0xd4)],_0x3a9416=_0x289af8[_0x233d51(0xfd)];let _0x3e81f8;const _0x524043=findAgentConfigPath(process['cwd']());if(_0x5ca833){const _0x293526=a4_0x4515b8[_0x233d51(0x165)](_0x5ca833,_0x233d51(0xdc));existsSync(_0x293526)?(_0x3e81f8=_0x5ca833,console['log'](a4_0x5f490c[_0x233d51(0x150)](_0x233d51(0x13e)+_0x5ca833))):_0x3e81f8=_0x5ca833;}else{if(_0x524043)_0x3e81f8=a4_0x4515b8[_0x233d51(0x12e)](_0x524043),console[_0x233d51(0x15a)](a4_0x5f490c['dim'](_0x233d51(0xf6)+_0x3e81f8));else{if(_0x3a9416){const _0x4b90ae=sanitizeForFilesystem(_0x3a9416);let _0x1a75a2=_0x4b90ae,_0x524674=a4_0x4515b8['join'](process[_0x233d51(0x14e)](),_0x233d51(0xed),_0x4b90ae,'tdx.json');if(!existsSync(_0x524674)){const _0x568a34=normalizeName(_0x3a9416),_0x3c744f=a4_0x4515b8[_0x233d51(0x165)](process[_0x233d51(0x14e)](),'agents',_0x568a34,_0x233d51(0xdc));existsSync(_0x3c744f)&&(_0x1a75a2=_0x568a34,_0x524674=_0x3c744f);}if(existsSync(_0x524674))_0x3e81f8=a4_0x4515b8[_0x233d51(0x12e)](_0x524674),console['log'](a4_0x5f490c[_0x233d51(0x150)](_0x233d51(0x13e)+_0x3e81f8));else{const _0x1d610d=_0x289af8[_0x233d51(0x14d)];if(_0x1d610d)throw new SDKError(ErrorCode[_0x233d51(0x10e)],_0x233d51(0x126)+_0x3a9416+_0x233d51(0x12d),undefined,{'helpText':'When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a'+_0x233d51(0xef)+('\x20\x20tdx\x20agent\x20pull\x20'+_0x3a9416+'\x0a')+('\x20\x20tdx\x20agent\x20clone\x20agents/'+_0x1a75a2+_0x233d51(0x111)+(_0x2c5151||_0x233d51(0x161))+_0x233d51(0x158)+_0x1d610d)});_0x3e81f8=_0x3a9416,console[_0x233d51(0x15a)](a4_0x5f490c['dim'](_0x233d51(0xf0)+_0x3a9416));}}}}if(!_0x3e81f8)return console['log'](a4_0x5f490c[_0x233d51(0xe2)]('No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a')),console[_0x233d51(0x15a)](_0x233d51(0xcd)),console[_0x233d51(0x15a)](_0x233d51(0xe3)),console[_0x233d51(0x15a)](_0x233d51(0xfb)),console['log']('\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>'),0x1;if(!_0x2c5151)throw new SDKError(ErrorCode['MISSING_ARGUMENT'],_0x233d51(0xdd),undefined,{'helpText':_0x233d51(0xb7)});if(!_0x568b29&&!_0x56fe8d){if(!isInteractive())return console[_0x233d51(0x119)](a4_0x5f490c[_0x233d51(0x168)]('\x0aError:'),_0x233d51(0xde)),console['error'](a4_0x5f490c[_0x233d51(0x150)](_0x233d51(0xd3))),0x1;const _0x2f4451=await confirmKey(_0x233d51(0xc9)+_0x3e81f8+_0x233d51(0x14c)+_0x2c5151+'\x22?');if(!_0x2f4451)return console['log'](a4_0x5f490c[_0x233d51(0xe2)]('Cancelled')),0x1;}const {data:_0x149ee9}=await withSpinner(_0x233d51(0x136)+_0x3e81f8+_0x233d51(0xca)+_0x2c5151+_0x233d51(0x12c),()=>_0x4868fe[_0x233d51(0xcf)][_0x233d51(0xbd)](_0x3e81f8,_0x2c5151,{'dryRun':_0x56fe8d}));if(_0x56fe8d){console[_0x233d51(0x15a)](a4_0x5f490c[_0x233d51(0xe2)](_0x233d51(0x12f))),console[_0x233d51(0x15a)](_0x233d51(0x15c)+_0x149ee9[_0x233d51(0x127)]),console[_0x233d51(0x15a)](_0x233d51(0x147)+_0x2c5151),console[_0x233d51(0x15a)](_0x233d51(0xc5)),console[_0x233d51(0x15a)](_0x233d51(0xda)+_0x149ee9[_0x233d51(0xcc)][_0x233d51(0xed)][_0x233d51(0x116)]),console[_0x233d51(0x15a)](_0x233d51(0xbb)+_0x149ee9[_0x233d51(0xcc)][_0x233d51(0xb3)][_0x233d51(0x116)]),console['log'](_0x233d51(0x13a)+_0x149ee9['counts']['prompts'][_0x233d51(0x116)]);const _0x159965=_0x149ee9['counts'][_0x233d51(0x13d)][_0x233d51(0x116)]>0x0||_0x149ee9[_0x233d51(0xcc)][_0x233d51(0xce)][_0x233d51(0x116)]>0x0;return _0x159965&&(console[_0x233d51(0x15a)](_0x233d51(0x131)+_0x149ee9[_0x233d51(0xcc)][_0x233d51(0x13d)][_0x233d51(0x116)]),console['log'](_0x233d51(0x144)+_0x149ee9[_0x233d51(0xcc)][_0x233d51(0xce)][_0x233d51(0x116)])),0x0;}const _0x3d17c9=_0x149ee9[_0x233d51(0xcc)][_0x233d51(0xed)][_0x233d51(0x105)]>0x0||_0x149ee9[_0x233d51(0xcc)][_0x233d51(0xb3)][_0x233d51(0x105)]>0x0||_0x149ee9[_0x233d51(0xcc)][_0x233d51(0xdf)][_0x233d51(0x105)]>0x0||_0x149ee9['counts'][_0x233d51(0x13d)][_0x233d51(0x105)]>0x0||_0x149ee9[_0x233d51(0xcc)][_0x233d51(0xce)][_0x233d51(0x105)]>0x0;_0x3d17c9?console[_0x233d51(0x15a)](a4_0x5f490c[_0x233d51(0xe2)](_0x233d51(0x102))):console[_0x233d51(0x15a)](a4_0x5f490c['green'](_0x233d51(0x148)));console[_0x233d51(0x15a)](_0x233d51(0x15c)+_0x149ee9[_0x233d51(0x127)]),console[_0x233d51(0x15a)](_0x233d51(0x147)+_0x149ee9[_0x233d51(0xe5)]),console['log'](_0x233d51(0x11f)+_0x149ee9[_0x233d51(0xb6)]),console[_0x233d51(0x15a)](),console[_0x233d51(0x15a)](_0x233d51(0x121)),console[_0x233d51(0x15a)](_0x233d51(0xda)+formatCountSummary(_0x149ee9[_0x233d51(0xcc)][_0x233d51(0xed)])),console[_0x233d51(0x15a)](_0x233d51(0xbb)+formatCountSummary(_0x149ee9[_0x233d51(0xcc)][_0x233d51(0xb3)])),console[_0x233d51(0x15a)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x149ee9[_0x233d51(0xcc)][_0x233d51(0xdf)])),console['log'](_0x233d51(0x151)+formatCountSummary(_0x149ee9[_0x233d51(0xcc)][_0x233d51(0x141)]));const _0x19f889=_0x149ee9[_0x233d51(0xcc)][_0x233d51(0x13d)][_0x233d51(0x116)]>0x0||_0x149ee9[_0x233d51(0xcc)]['experimentalKnowledgeBases'][_0x233d51(0x120)]>0x0||_0x149ee9[_0x233d51(0xcc)][_0x233d51(0x13d)][_0x233d51(0x11a)]>0x0||_0x149ee9[_0x233d51(0xcc)][_0x233d51(0xce)][_0x233d51(0x116)]>0x0||_0x149ee9[_0x233d51(0xcc)][_0x233d51(0xce)][_0x233d51(0x120)]>0x0||_0x149ee9[_0x233d51(0xcc)][_0x233d51(0xce)][_0x233d51(0x11a)]>0x0;_0x19f889&&(console['log'](_0x233d51(0x131)+formatCountSummary(_0x149ee9['counts'][_0x233d51(0x13d)])),console[_0x233d51(0x15a)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x149ee9[_0x233d51(0xcc)]['experimentalArtifacts'])));if(_0x3d17c9){console[_0x233d51(0x15a)](),console[_0x233d51(0x15a)](a4_0x5f490c[_0x233d51(0x168)]('Errors:'));for(const _0x527b79 of _0x149ee9[_0x233d51(0xed)]){_0x527b79[_0x233d51(0x166)]===_0x233d51(0x119)&&console[_0x233d51(0x15a)](a4_0x5f490c[_0x233d51(0x168)](_0x233d51(0xf9)+_0x527b79[_0x233d51(0x10b)]+_0x233d51(0x14a)+_0x527b79['error']));}for(const _0x26049a of _0x149ee9[_0x233d51(0xb3)]){_0x26049a[_0x233d51(0x166)]===_0x233d51(0x119)&&console[_0x233d51(0x15a)](a4_0x5f490c[_0x233d51(0x168)](_0x233d51(0x145)+_0x26049a[_0x233d51(0xf4)]+_0x233d51(0x14a)+_0x26049a[_0x233d51(0x119)]));}for(const _0x27c590 of _0x149ee9['prompts']){_0x27c590['action']==='error'&&console['log'](a4_0x5f490c[_0x233d51(0x168)]('\x20\x20Prompt\x20\x22'+_0x27c590[_0x233d51(0xf4)]+_0x233d51(0x14a)+_0x27c590[_0x233d51(0x119)]));}for(const _0x1d2544 of _0x149ee9['integrations']){_0x1d2544['action']==='error'&&console['log'](a4_0x5f490c['red'](_0x233d51(0xfa)+_0x1d2544[_0x233d51(0xf4)]+'\x22:\x20'+_0x1d2544[_0x233d51(0x119)]));}for(const _0x40afe1 of _0x149ee9[_0x233d51(0x13d)]){_0x40afe1[_0x233d51(0x166)]===_0x233d51(0x119)&&console['log'](a4_0x5f490c[_0x233d51(0x168)]('\x20\x20Experimental\x20Knowledge\x20Base\x20\x22'+_0x40afe1[_0x233d51(0xf4)]+'\x22:\x20'+_0x40afe1[_0x233d51(0x119)]));}for(const _0x304706 of _0x149ee9['experimentalArtifacts']){_0x304706[_0x233d51(0x166)]===_0x233d51(0x119)&&console[_0x233d51(0x15a)](a4_0x5f490c[_0x233d51(0x168)](_0x233d51(0x149)+_0x304706[_0x233d51(0xf4)]+_0x233d51(0x14a)+_0x304706[_0x233d51(0x119)]));}return 0x1;}console[_0x233d51(0x15a)]();const _0x383676=getLLMProjectUrl(_0x1a1c46,_0x149ee9[_0x233d51(0xb6)]);return console['log'](_0x233d51(0x14f)+a4_0x5f490c[_0x233d51(0xb0)](_0x383676)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x331360(0xf4)]=a4_0x331360(0xff);[a4_0x331360(0xb2)]=a4_0x331360(0x11e);async[a4_0x331360(0x100)](_0x51702e){const _0xe5d998=a4_0x331360,{options:_0x486db1,args:_0x2282dd,tdx:_0x2ecfc7}=_0x51702e;let _0xa813c8=_0x2282dd[0x0]||process[_0xe5d998(0x14e)]();const _0x41ff62=_0x486db1['dryRun'],_0x232106=_0x486db1['force'],_0x31c85f=_0x486db1['yes'],_0x488537=_0x486db1[_0xe5d998(0xd4)],_0xa77caa=a4_0x4515b8[_0xe5d998(0x165)](_0xa813c8,_0xe5d998(0x162)),_0x3b7b6b=existsSync(_0xa77caa);if(_0x3b7b6b){const {data:_0x52649a}=await withSpinner(_0xe5d998(0x138)+_0xa813c8+_0xe5d998(0x12c),()=>_0x2ecfc7['llm']['pushAgent'](_0xa813c8,{'dryRun':_0x41ff62,'force':_0x232106}));if(_0x41ff62)return console[_0xe5d998(0x15a)](a4_0x5f490c[_0xe5d998(0xe2)](_0xe5d998(0x12f))),console[_0xe5d998(0x15a)](_0xe5d998(0x101)+_0x52649a[_0xe5d998(0x10b)]),0x0;if(_0x52649a['action']===_0xe5d998(0x119))return console['log'](a4_0x5f490c[_0xe5d998(0x168)]('Failed\x20to\x20push\x20agent:\x20'+_0x52649a[_0xe5d998(0x119)])),0x1;console[_0xe5d998(0x15a)](a4_0x5f490c[_0xe5d998(0xc3)](_0xe5d998(0x110)+_0x52649a[_0xe5d998(0x166)]+'\x20successfully')),console[_0xe5d998(0x15a)](_0xe5d998(0x12a)+_0x52649a['agentName']);if(_0x52649a[_0xe5d998(0xfc)]&&_0x52649a[_0xe5d998(0x169)]){const _0x5a87d1=getLLMAgentChatUrl(_0x488537,_0x52649a[_0xe5d998(0x169)],_0x52649a[_0xe5d998(0xfc)]);console[_0xe5d998(0x15a)](_0xe5d998(0xd9)+a4_0x5f490c[_0xe5d998(0xb0)](_0x5a87d1));}return 0x0;}const _0xb4d210=_0x486db1[_0xe5d998(0xfd)],_0x2dcc66=resolveProjectFromContext(_0xa813c8,_0xb4d210);if(_0x2dcc66[_0xe5d998(0x153)])_0xa813c8=_0x2dcc66[_0xe5d998(0x137)],_0x2dcc66[_0xe5d998(0x132)]===_0xe5d998(0x12b)&&console[_0xe5d998(0x15a)](a4_0x5f490c[_0xe5d998(0x150)](_0xe5d998(0xeb)+_0xa813c8));else{let _0x3bee25=_0xe5d998(0xd1);_0x2dcc66[_0xe5d998(0x14b)]===_0xe5d998(0x117)&&(_0x3bee25=_0x2dcc66[_0xe5d998(0xf2)]+_0xe5d998(0xc0)+_0x2dcc66[_0xe5d998(0xfd)]+_0xe5d998(0xe4));throw new SDKError(ErrorCode[_0xe5d998(0x10e)],_0x2dcc66[_0xe5d998(0x14b)]===_0xe5d998(0x156)?_0x2dcc66[_0xe5d998(0xf2)]:_0xe5d998(0xe1)+_0xa813c8,undefined,{'helpText':_0x3bee25});}const {data:_0x2101a7}=await withSpinner(_0xe5d998(0x154),()=>_0x2ecfc7[_0xe5d998(0xcf)][_0xe5d998(0xf7)](_0xa813c8,{'dryRun':!![]})),_0x45df95=_0x2101a7[_0xe5d998(0xcc)][_0xe5d998(0xed)][_0xe5d998(0x105)]>0x0;if(_0x45df95){console[_0xe5d998(0x15a)](a4_0x5f490c['red'](_0xe5d998(0xd6)));for(const _0x690b87 of _0x2101a7[_0xe5d998(0xed)]){_0x690b87[_0xe5d998(0x166)]===_0xe5d998(0x119)&&console[_0xe5d998(0x15a)](a4_0x5f490c[_0xe5d998(0x168)]('\x20\x20Agent\x20\x22'+_0x690b87[_0xe5d998(0x10b)]+_0xe5d998(0x14a)+_0x690b87[_0xe5d998(0x119)]));}return 0x1;}const _0x59ae31=_0x2101a7[_0xe5d998(0xcc)]['agents'][_0xe5d998(0x116)]+_0x2101a7[_0xe5d998(0xcc)][_0xe5d998(0xb3)][_0xe5d998(0x116)]+_0x2101a7[_0xe5d998(0xcc)][_0xe5d998(0xec)][_0xe5d998(0x116)]+_0x2101a7[_0xe5d998(0xcc)][_0xe5d998(0xdf)][_0xe5d998(0x116)]+_0x2101a7[_0xe5d998(0xcc)][_0xe5d998(0x141)][_0xe5d998(0x116)]+_0x2101a7[_0xe5d998(0xcc)]['experimentalKnowledgeBases'][_0xe5d998(0x116)]+_0x2101a7[_0xe5d998(0xcc)][_0xe5d998(0xce)]['created'],_0x5a3dbb=_0x2101a7[_0xe5d998(0xcc)][_0xe5d998(0xed)][_0xe5d998(0x120)]+_0x2101a7[_0xe5d998(0xcc)][_0xe5d998(0xb3)][_0xe5d998(0x120)]+_0x2101a7[_0xe5d998(0xcc)][_0xe5d998(0xec)]['updated']+_0x2101a7[_0xe5d998(0xcc)]['prompts'][_0xe5d998(0x120)]+_0x2101a7[_0xe5d998(0xcc)]['integrations'][_0xe5d998(0x120)]+_0x2101a7[_0xe5d998(0xcc)][_0xe5d998(0x13d)][_0xe5d998(0x120)]+_0x2101a7[_0xe5d998(0xcc)]['experimentalArtifacts'][_0xe5d998(0x120)],_0x37eddb=_0x2101a7[_0xe5d998(0xcc)][_0xe5d998(0xed)][_0xe5d998(0x11a)]+_0x2101a7['counts'][_0xe5d998(0xb3)]['unchanged']+_0x2101a7['counts'][_0xe5d998(0xec)][_0xe5d998(0x11a)]+_0x2101a7[_0xe5d998(0xcc)][_0xe5d998(0xdf)][_0xe5d998(0x11a)]+_0x2101a7[_0xe5d998(0xcc)][_0xe5d998(0x141)]['unchanged']+_0x2101a7[_0xe5d998(0xcc)][_0xe5d998(0x13d)]['unchanged']+_0x2101a7[_0xe5d998(0xcc)]['experimentalArtifacts'][_0xe5d998(0x11a)];console['log'](_0xe5d998(0x112)+_0x2101a7[_0xe5d998(0x16b)]+'\x27:'),console[_0xe5d998(0x15a)]('\x20\x20'+a4_0x5f490c[_0xe5d998(0xc3)]('+\x20'+_0x59ae31+'\x20new')+_0xe5d998(0xdb)+a4_0x5f490c['yellow']('~\x20'+_0x5a3dbb+'\x20changed')+_0xe5d998(0xdb)+a4_0x5f490c[_0xe5d998(0x150)]('=\x20'+_0x37eddb+_0xe5d998(0xf3))),console['log'](_0xe5d998(0xda)+formatCountSummary(_0x2101a7['counts'][_0xe5d998(0xed)])),console[_0xe5d998(0x15a)](_0xe5d998(0xbb)+formatCountSummary(_0x2101a7['counts'][_0xe5d998(0xb3)])),console['log'](_0xe5d998(0x124)+formatCountSummary(_0x2101a7[_0xe5d998(0xcc)][_0xe5d998(0xec)])),console[_0xe5d998(0x15a)](_0xe5d998(0x13a)+formatCountSummary(_0x2101a7['counts']['prompts'])),console[_0xe5d998(0x15a)](_0xe5d998(0x151)+formatCountSummary(_0x2101a7[_0xe5d998(0xcc)]['integrations']));const _0x176993=_0x2101a7[_0xe5d998(0xcc)][_0xe5d998(0x13d)][_0xe5d998(0x116)]>0x0||_0x2101a7[_0xe5d998(0xcc)][_0xe5d998(0x13d)][_0xe5d998(0x120)]>0x0||_0x2101a7['counts'][_0xe5d998(0x13d)]['unchanged']>0x0||_0x2101a7[_0xe5d998(0xcc)][_0xe5d998(0xce)][_0xe5d998(0x116)]>0x0||_0x2101a7[_0xe5d998(0xcc)]['experimentalArtifacts'][_0xe5d998(0x120)]>0x0||_0x2101a7[_0xe5d998(0xcc)]['experimentalArtifacts'][_0xe5d998(0x11a)]>0x0;_0x176993&&(console['log'](_0xe5d998(0x131)+formatCountSummary(_0x2101a7[_0xe5d998(0xcc)][_0xe5d998(0x13d)])),console['log']('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x2101a7[_0xe5d998(0xcc)][_0xe5d998(0xce)])));console[_0xe5d998(0x15a)]('\x20\x20Source:\x20'+a4_0x5f490c[_0xe5d998(0xb0)](_0xa813c8)),displayDiffs(_0x2101a7['agents'],_0x2101a7[_0xe5d998(0xb3)],_0x2101a7[_0xe5d998(0xec)],_0x2101a7['prompts'],_0x2101a7[_0xe5d998(0x141)],_0x2101a7[_0xe5d998(0x13d)],_0x2101a7['experimentalArtifacts']);if(_0x41ff62)return console['log'](a4_0x5f490c['yellow']('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed')),0x0;if(_0x59ae31===0x0&&_0x5a3dbb===0x0){console[_0xe5d998(0x15a)](a4_0x5f490c[_0xe5d998(0xc3)]('\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date'));const _0x36ff45=getLLMProjectUrl(_0x488537,_0x2101a7[_0xe5d998(0x169)]);return console[_0xe5d998(0x15a)](_0xe5d998(0x14f)+a4_0x5f490c[_0xe5d998(0xb0)](_0x36ff45)),0x0;}if(!_0x31c85f&&!_0x232106){if(!isInteractive())return console[_0xe5d998(0x119)](a4_0x5f490c[_0xe5d998(0x168)](_0xe5d998(0x167)),_0xe5d998(0xde)),console[_0xe5d998(0x119)](a4_0x5f490c[_0xe5d998(0x150)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x582951=await confirmKey('\x0aPush\x20'+(_0x59ae31+_0x5a3dbb)+'\x20resources?');if(!_0x582951)return console[_0xe5d998(0x15a)](a4_0x5f490c['yellow'](_0xe5d998(0x139)),_0xe5d998(0xd5)),0x1;}const {data:_0x53ee01}=await withSpinner(_0xe5d998(0x104),()=>_0x2ecfc7[_0xe5d998(0xcf)]['pushProject'](_0xa813c8,{'force':_0x232106})),_0x19d1ab=_0x53ee01[_0xe5d998(0xcc)][_0xe5d998(0xed)][_0xe5d998(0x105)]>0x0||_0x53ee01[_0xe5d998(0xcc)][_0xe5d998(0xb3)][_0xe5d998(0x105)]>0x0||_0x53ee01[_0xe5d998(0xcc)][_0xe5d998(0xec)]['errors']>0x0||_0x53ee01[_0xe5d998(0xcc)][_0xe5d998(0xdf)][_0xe5d998(0x105)]>0x0;if(_0x19d1ab){console[_0xe5d998(0x15a)](a4_0x5f490c[_0xe5d998(0xe2)](_0xe5d998(0xb1))),console[_0xe5d998(0x15a)](),console[_0xe5d998(0x15a)](a4_0x5f490c['red'](_0xe5d998(0xee)));for(const _0x38fd21 of _0x53ee01[_0xe5d998(0xed)]){_0x38fd21['action']===_0xe5d998(0x119)&&console[_0xe5d998(0x15a)](a4_0x5f490c[_0xe5d998(0x168)](_0xe5d998(0xf9)+_0x38fd21['agentName']+_0xe5d998(0x14a)+_0x38fd21[_0xe5d998(0x119)]));}for(const _0x5014fa of _0x53ee01[_0xe5d998(0xb3)]){_0x5014fa[_0xe5d998(0x166)]===_0xe5d998(0x119)&&console[_0xe5d998(0x15a)](a4_0x5f490c[_0xe5d998(0x168)](_0xe5d998(0x145)+_0x5014fa['name']+_0xe5d998(0x14a)+_0x5014fa[_0xe5d998(0x119)]));}for(const _0x3f25b0 of _0x53ee01[_0xe5d998(0xec)]){_0x3f25b0[_0xe5d998(0x166)]===_0xe5d998(0x119)&&console['log'](a4_0x5f490c['red'](_0xe5d998(0xb4)+_0x3f25b0[_0xe5d998(0xf4)]+_0xe5d998(0x14a)+_0x3f25b0[_0xe5d998(0x119)]));}for(const _0x92e369 of _0x53ee01['prompts']){_0x92e369[_0xe5d998(0x166)]===_0xe5d998(0x119)&&console[_0xe5d998(0x15a)](a4_0x5f490c[_0xe5d998(0x168)](_0xe5d998(0xe6)+_0x92e369[_0xe5d998(0xf4)]+_0xe5d998(0x14a)+_0x92e369[_0xe5d998(0x119)]));}for(const _0x54d352 of _0x53ee01['integrations']){_0x54d352['action']===_0xe5d998(0x119)&&console[_0xe5d998(0x15a)](a4_0x5f490c[_0xe5d998(0x168)](_0xe5d998(0xfa)+_0x54d352['name']+'\x22:\x20'+_0x54d352[_0xe5d998(0x119)]));}return 0x1;}console[_0xe5d998(0x15a)](a4_0x5f490c[_0xe5d998(0xc3)](_0xe5d998(0x135)+(_0x59ae31+_0x5a3dbb)+_0xe5d998(0x109)+_0x53ee01[_0xe5d998(0x16b)]+'\x27'));const _0x5cc9c4=getLLMProjectUrl(_0x488537,_0x53ee01['projectId']);return console[_0xe5d998(0x15a)](_0xe5d998(0x14f)+a4_0x5f490c[_0xe5d998(0xb0)](_0x5cc9c4)),0x0;}}
@@ -1 +1 @@
1
- const a5_0x236b70=a5_0x3342;(function(_0x56fb33,_0x23ce7c){const _0x5db979=a5_0x3342,_0x64fc1b=_0x56fb33();while(!![]){try{const _0x17a58c=parseInt(_0x5db979(0x126))/0x1*(parseInt(_0x5db979(0xdb))/0x2)+parseInt(_0x5db979(0x14a))/0x3*(-parseInt(_0x5db979(0xda))/0x4)+-parseInt(_0x5db979(0x120))/0x5*(parseInt(_0x5db979(0xef))/0x6)+parseInt(_0x5db979(0x14b))/0x7+-parseInt(_0x5db979(0xc1))/0x8*(parseInt(_0x5db979(0xc9))/0x9)+-parseInt(_0x5db979(0xd0))/0xa*(parseInt(_0x5db979(0x11d))/0xb)+-parseInt(_0x5db979(0xe8))/0xc*(-parseInt(_0x5db979(0xdf))/0xd);if(_0x17a58c===_0x23ce7c)break;else _0x64fc1b['push'](_0x64fc1b['shift']());}catch(_0x5c972c){_0x64fc1b['push'](_0x64fc1b['shift']());}}}(a5_0x5114,0x8ff79));function a5_0x5114(){const _0x5cf33e=['PASS','length','cyan','\x20\x20Evaluating...\x20','Project\x20path:\x20','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','table','Error\x20writing\x20output\x20file:\x20','Using\x20agent:\x20','\x20-\x20','9340064zUbivL','\x20\x20Agent:\x20','filter','conversation_url','✗\x20ERROR:\x20Project\x20not\x20found:\x20','no_local_folder','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','multiple_agents','9VICGBZ','execute','reeval','red','Usage:','tests','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','8664830HXZaME','Agent:\x20','add','\x20(new)','utf-8','Executing\x20new\x20tests...','timestamp','No\x20tests\x20have\x20tags\x20defined.','repeat',':\x20Sending\x20user\x20input...','68etPgik','2TZMdHx','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','dim','3979534awfhzE','\x20\x20Round\x20','FAIL','no_tests','Round\x20','site','llmProject','executeReeval','toLowerCase','84iXtVdM','tsv','size','Conversation\x20URL:\x20','name','Failed:\x20\x20\x20','forEach','930nzOiZs','Test\x20Configuration:','tags','projectDir','Available\x20tags:\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','green','isSpinning','dryRun','trim','json','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','✗\x20FAIL:\x20','Tests\x20found:\x20','Run\x20tests\x20for\x20an\x20LLM\x20agent','verbose','conversations','Evaluating\x20response...','✓\x20PASS:\x20','No\x20tests\x20found\x20with\x20tags:\x20','llm','\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)','...\x20','Running\x20test:\x20','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','Either\x20switch\x20to\x20the\x20\x22','join','agentDirs','\x20(cached)','not\x20found','New\x20tests\x20to\x20execute:\x20','Running:\x20','Failed\x20Tests:','Re-evaluation\x20Summary','map','test.yml','No\x20tests\x20found\x20matching:\x20','rounds','⚠\x20SKIPPED:\x20','Re-evaluating\x20cached\x20test\x20run...','push','agentName','white','resolveAgentId','Passed:\x20\x20\x20','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','11GTrirR','reason','status','35535sgMIcL','Round\x201/','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','jsonl','404','\x20\x20Conversation:\x20','591806FtbSox','agent:test','Site:\x20','Available\x20tests:\x20','now','basename','resolve','testName','✗\x20ERROR:\x20','found','start','yellow','Re-evaluating\x20','toISOString','log','ERROR','\x20\x20-\x20','split','has','message','Errors:\x20\x20\x20','some','Run\x20\x27tdx\x20agent\x20pull\x20','agent','text','projectName','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','writeFileSync','stop','Duration:\x20','includes','\x20\x20Site:\x20','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','Re-evaluating...','Output\x20written\x20to:\x20','723CXYNrX','6963110tyMMWI','Test\x20Summary','\x22:\x20','eval','\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'];a5_0x5114=function(){return _0x5cf33e;};return a5_0x5114();}import*as a5_0x26a35a from'node:fs';import*as a5_0x4da2d6 from'node:path';import a5_0x42b249 from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';function a5_0x3342(_0x3bd06d,_0x59822a){_0x3bd06d=_0x3bd06d-0xb5;const _0x5114ad=a5_0x5114();let _0x3342f2=_0x5114ad[_0x3bd06d];return _0x3342f2;}import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x236b70(0xec)]=a5_0x236b70(0x127);['description']=a5_0x236b70(0xfd);async[a5_0x236b70(0xca)](_0x1a5303){const _0x699572=a5_0x236b70,{options:_0x10fc74,args:_0x30aee7,tdx:_0x3582a5}=_0x1a5303,_0x37097d=_0x30aee7[0x0]||'.',_0x3549ca=_0x10fc74[_0x699572(0xf7)],_0x40585a=_0x10fc74,_0x551765=_0x40585a[_0x699572(0x14e)]===![],_0x2a9023=_0x40585a[_0x699572(0xcb)],_0x83334a=_0x40585a[_0x699572(0xec)],_0x4359f0=_0x40585a[_0x699572(0xf1)],_0x5443ae=_0x10fc74[_0x699572(0xe4)],_0xe6be08=_0x40585a['output'];if(_0x2a9023&&_0x551765)return console[_0x699572(0x134)](a5_0x42b249['red']('Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval')),0x1;let _0x2853c5=_0x699572(0xbd);if(_0x40585a[_0x699572(0xf9)])_0x2853c5=_0x699572(0xf9);else{if(_0x40585a[_0x699572(0x123)])_0x2853c5=_0x699572(0x123);else{if(_0x40585a[_0x699572(0xe9)])_0x2853c5=_0x699572(0xe9);else{if(_0x40585a['table'])_0x2853c5='table';}}}const _0x537abe=_0x40585a['llmProject'];let _0x363415=_0x37097d;const _0x42c333=a5_0x26a35a['existsSync'](_0x37097d),_0x59ec8f=_0x37097d==='.';if(!_0x42c333||_0x59ec8f){const _0x41f847=resolveProjectFromContext(_0x37097d,_0x537abe,{'requireFile':_0x699572(0x112)});if(_0x41f847[_0x699572(0x12f)])_0x363415=_0x41f847[_0x699572(0xf2)],_0x41f847['source']==='context'&&console[_0x699572(0x134)](a5_0x42b249[_0x699572(0xde)](_0x699572(0xbf)+_0x363415));else switch(_0x41f847[_0x699572(0x11e)]){case'no_context':console[_0x699572(0x134)](a5_0x42b249[_0x699572(0x131)](_0x41f847[_0x699572(0x139)])),console[_0x699572(0x134)](),console[_0x699572(0x134)](_0x699572(0xcd)),console[_0x699572(0x134)](_0x699572(0xb5)),console[_0x699572(0x134)](_0x699572(0x104)),console[_0x699572(0x134)](),console[_0x699572(0x134)](_0x699572(0xdd));return 0x1;case _0x699572(0xc6):console[_0x699572(0x134)](a5_0x42b249[_0x699572(0x131)](_0x41f847['message'])),console[_0x699572(0x134)](),console[_0x699572(0x134)](_0x699572(0x13c)+_0x41f847[_0x699572(0xe5)]+'\x27\x20to\x20create\x20the\x20folder\x20structure.');return 0x1;case _0x699572(0xc8):{const _0x6cfb84=a5_0x4da2d6[_0x699572(0x12b)](_0x41f847[_0x699572(0xf2)]);console[_0x699572(0x134)](a5_0x42b249[_0x699572(0x131)](_0x699572(0xbc)+_0x41f847[_0x699572(0xe5)]+'\x22:'));for(const _0x1870ae of _0x41f847[_0x699572(0x10a)]){console['log'](_0x699572(0x136)+_0x1870ae);}return console[_0x699572(0x134)](),console['log'](_0x699572(0xdc)+_0x6cfb84+'/<agent-name>'),0x1;}case _0x699572(0xe2):console[_0x699572(0x134)](a5_0x42b249[_0x699572(0x131)](_0x699572(0x11c)+_0x41f847[_0x699572(0xe5)]+'\x22.')),console[_0x699572(0x134)](a5_0x42b249[_0x699572(0xde)](_0x699572(0xba)+_0x41f847[_0x699572(0xf2)])),console[_0x699572(0x134)](),console[_0x699572(0x134)](_0x699572(0xc7));return 0x1;}}const {definition:_0x2c32a0,agentInfo:_0x4a1290}=parseTestFile(_0x363415);let _0x29ea04=_0x2c32a0[_0x699572(0xce)];if(_0x83334a){const _0xb76087=_0x83334a[_0x699572(0x137)](',')[_0x699572(0x111)](_0x3411ff=>_0x3411ff[_0x699572(0xf8)]());_0x29ea04=_0x2c32a0[_0x699572(0xce)][_0x699572(0xc3)](_0x37bd0f=>_0xb76087[_0x699572(0x144)](_0x37bd0f[_0x699572(0xec)]));if(_0x29ea04['length']===0x0)return console[_0x699572(0x134)](a5_0x42b249[_0x699572(0x131)](_0x699572(0x113)+_0x83334a)),console[_0x699572(0x134)](a5_0x42b249[_0x699572(0xde)](_0x699572(0x129)+_0x2c32a0[_0x699572(0xce)]['map'](_0x575f2e=>_0x575f2e[_0x699572(0xec)])['join'](',\x20'))),0x1;}if(_0x4359f0){const _0x3f377b=_0x4359f0['split'](',')[_0x699572(0x111)](_0x5bb8c9=>_0x5bb8c9['trim']()[_0x699572(0xe7)]());_0x29ea04=_0x29ea04[_0x699572(0xc3)](_0x4dd39d=>_0x4dd39d['tags']?.[_0x699572(0x13b)](_0x194de0=>_0x3f377b[_0x699572(0x144)](_0x194de0[_0x699572(0xe7)]())));if(_0x29ea04[_0x699572(0xb7)]===0x0){console[_0x699572(0x134)](a5_0x42b249[_0x699572(0x131)](_0x699572(0x102)+_0x4359f0));const _0x4869dc=new Set();return _0x2c32a0[_0x699572(0xce)][_0x699572(0xee)](_0xe2cb7f=>_0xe2cb7f[_0x699572(0xf1)]?.[_0x699572(0xee)](_0x41bfdc=>_0x4869dc[_0x699572(0xd2)](_0x41bfdc))),_0x4869dc[_0x699572(0xea)]>0x0?console[_0x699572(0x134)](a5_0x42b249[_0x699572(0xde)](_0x699572(0xf3)+[..._0x4869dc][_0x699572(0x109)](',\x20'))):console[_0x699572(0x134)](a5_0x42b249[_0x699572(0xde)](_0x699572(0xd7))),0x1;}}if(_0x2a9023)return this[_0x699572(0xe6)](_0x1a5303,{'definition':{'tests':_0x29ea04},'agentInfo':_0x4a1290,'outputFormat':_0x2853c5,'outputFile':_0xe6be08,'testNames':_0x83334a});if(_0x3549ca){console[_0x699572(0x134)](a5_0x42b249['cyan'](_0x699572(0xf0))),console[_0x699572(0x134)](_0x699572(0x145)+a5_0x42b249[_0x699572(0x119)](_0x5443ae)),console[_0x699572(0x134)]('\x20\x20Project:\x20'+a5_0x42b249[_0x699572(0x119)](_0x4a1290[_0x699572(0x13f)])),console['log'](_0x699572(0xc2)+a5_0x42b249[_0x699572(0x119)](_0x4a1290['agentName'])),console[_0x699572(0x134)](),console[_0x699572(0x134)](_0x699572(0xfc)+a5_0x42b249['white'](_0x29ea04[_0x699572(0xb7)]));for(let _0x3f931d=0x0;_0x3f931d<_0x29ea04[_0x699572(0xb7)];_0x3f931d++){const _0x22dd28=_0x29ea04[_0x3f931d],_0x121e25=_0x22dd28[_0x699572(0x114)][_0x699572(0xb7)]===0x1?'round':_0x699572(0x114),_0x53f80f=_0x22dd28[_0x699572(0xf1)]?.['length']?'\x20['+_0x22dd28[_0x699572(0xf1)][_0x699572(0x109)](',\x20')+']':'';console[_0x699572(0x134)]('\x20\x20'+(_0x3f931d+0x1)+'.\x20'+a5_0x42b249[_0x699572(0x119)](_0x22dd28['name'])+'\x20('+_0x22dd28[_0x699572(0x114)]['length']+'\x20'+_0x121e25+')'+a5_0x42b249['dim'](_0x53f80f));}return 0x0;}let _0x3078dd,_0x40107f;try{_0x3078dd=await _0x3582a5[_0x699572(0x103)]['resolveProjectId'](_0x4a1290[_0x699572(0x13f)]);}catch(_0xff6072){const _0xe97574=_0xff6072 instanceof Error?_0xff6072['message']:String(_0xff6072);return _0xe97574[_0x699572(0x144)](_0x699572(0x124))||_0xe97574['toLowerCase']()['includes'](_0x699572(0x10c))?console[_0x699572(0x134)](a5_0x42b249[_0x699572(0xcc)](_0x699572(0xc5)+_0x4a1290[_0x699572(0x13f)])):console['log'](a5_0x42b249['red']('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22'+_0x4a1290[_0x699572(0x13f)]+_0x699572(0x14d)+_0xe97574)),0x1;}try{_0x40107f=await _0x3582a5[_0x699572(0x103)][_0x699572(0x11a)](_0x4a1290[_0x699572(0x118)],_0x3078dd);}catch(_0x3e9d77){const _0x2fd085=_0x3e9d77 instanceof Error?_0x3e9d77[_0x699572(0x139)]:String(_0x3e9d77);return _0x2fd085[_0x699572(0x144)](_0x699572(0x124))||_0x2fd085[_0x699572(0xe7)]()['includes'](_0x699572(0x10c))?console['log'](a5_0x42b249['red'](_0x699572(0x146)+_0x4a1290[_0x699572(0x118)])):console['log'](a5_0x42b249['red'](_0x699572(0xf4)+_0x4a1290[_0x699572(0x118)]+_0x699572(0x14d)+_0x2fd085)),0x1;}let _0x47da58;if(!_0x551765)try{_0x47da58=await setupEvaluatorAgent(_0x3582a5[_0x699572(0x103)],_0x10fc74['verbose']);}catch(_0x1699fd){const _0x4a24fd=_0x1699fd instanceof Error?_0x1699fd[_0x699572(0x139)]:String(_0x1699fd);return console[_0x699572(0x134)](a5_0x42b249['red'](_0x699572(0x147)+_0x4a24fd)),0x1;}console[_0x699572(0x134)](a5_0x42b249[_0x699572(0xb8)]('Running\x20agent\x20tests...')),console[_0x699572(0x134)](_0x699572(0x128)+a5_0x42b249[_0x699572(0x119)](_0x5443ae)),console['log']('Agent:\x20'+a5_0x42b249[_0x699572(0x119)](_0x4a1290['projectName']+'/'+_0x4a1290['agentName'])),console[_0x699572(0x134)]();const _0x4ba7e1=[],_0x2563ad=[],_0x1d3cfa=Date[_0x699572(0x12a)]();for(let _0xc9df1b=0x0;_0xc9df1b<_0x29ea04[_0x699572(0xb7)];_0xc9df1b++){const _0x1ec015=_0x29ea04[_0xc9df1b];_0x29ea04[_0x699572(0xb7)]>0x1?console[_0x699572(0x134)]('Test\x20'+(_0xc9df1b+0x1)+'/'+_0x29ea04[_0x699572(0xb7)]+':\x20'+a5_0x42b249['white'](_0x1ec015['name'])):console[_0x699572(0x134)](_0x699572(0x106)+a5_0x42b249[_0x699572(0x119)](_0x1ec015[_0x699572(0xec)]));const _0x11dc07=createCommandSpinner(_0x699572(0x121)+_0x1ec015[_0x699572(0x114)]['length']+_0x699572(0xd9));_0x11dc07['start']();try{const {result:_0x34e7e2,conversation:_0x3df221}=await runTest(_0x3582a5[_0x699572(0x103)],_0x1ec015,{'agentId':_0x40107f,'projectId':_0x3078dd,'site':_0x5443ae,'noEval':_0x551765,'evaluatorId':_0x47da58,'onRoundStart':(_0x2ed176,_0x1f844a)=>{const _0x1aecd0=_0x699572;_0x11dc07['text']=_0x1aecd0(0xe3)+(_0x2ed176+0x1)+'/'+_0x1f844a+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x1b41de,_0x394813,_0x298780)=>{const _0x3d1c16=_0x699572,_0xecd44e=formatElapsed(_0x394813);_0x298780?console[_0x3d1c16(0x134)](_0x3d1c16(0xe0)+(_0x1b41de+0x1)+'/'+_0x1ec015[_0x3d1c16(0x114)][_0x3d1c16(0xb7)]+_0x3d1c16(0x105)+a5_0x42b249[_0x3d1c16(0xf5)]('✓')+'\x20('+_0xecd44e+')'):console[_0x3d1c16(0x134)]('\x20\x20Round\x20'+(_0x1b41de+0x1)+'/'+_0x1ec015[_0x3d1c16(0x114)]['length']+_0x3d1c16(0x105)+a5_0x42b249['red']('✗'));},'onEvaluationStart':()=>{const _0x58e62d=_0x699572;_0x11dc07[_0x58e62d(0x13e)]=_0x58e62d(0x100);},'onEvaluationComplete':_0x16b22e=>{const _0x5cbd36=_0x699572,_0xc147ee=formatElapsed(_0x16b22e);console['log'](_0x5cbd36(0xb9)+a5_0x42b249['green']('✓')+'\x20('+_0xc147ee+')');}});_0x11dc07['stop'](),_0x4ba7e1['push'](_0x34e7e2),_0x2563ad['push'](_0x3df221);if(_0x34e7e2['status']===_0x699572(0xb6))console[_0x699572(0x134)](a5_0x42b249[_0x699572(0xf5)](_0x699572(0x101)+_0x34e7e2[_0x699572(0x11e)]));else _0x34e7e2[_0x699572(0x11f)]===_0x699572(0xe1)?console['log'](a5_0x42b249[_0x699572(0xcc)](_0x699572(0xfb)+_0x34e7e2[_0x699572(0x11e)])):console[_0x699572(0x134)](a5_0x42b249['red'](_0x699572(0x12e)+_0x34e7e2['reason']));_0x34e7e2[_0x699572(0xc4)]&&console[_0x699572(0x134)](a5_0x42b249[_0x699572(0xde)](_0x699572(0xeb)+_0x34e7e2[_0x699572(0xc4)])),console[_0x699572(0x134)]();}catch(_0x71bc69){_0x11dc07[_0x699572(0x142)]();const _0x36ae7f=_0x71bc69 instanceof Error?_0x71bc69[_0x699572(0x139)]:String(_0x71bc69);console[_0x699572(0x134)](a5_0x42b249[_0x699572(0xcc)](_0x699572(0x12e)+_0x36ae7f)),console[_0x699572(0x134)](),_0x4ba7e1[_0x699572(0x117)]({'name':_0x1ec015[_0x699572(0xec)],'status':_0x699572(0x135),'reason':_0x36ae7f,'timestamp':new Date()[_0x699572(0x133)](),'duration_ms':0x0});}}const _0x290410=Date[_0x699572(0x12a)]()-_0x1d3cfa,_0x2ae111=_0x4ba7e1[_0x699572(0xc3)](_0xe0fe1=>_0xe0fe1['status']===_0x699572(0xb6))[_0x699572(0xb7)],_0xa4ccc8=_0x4ba7e1[_0x699572(0xc3)](_0x14aa3a=>_0x14aa3a['status']===_0x699572(0xe1))[_0x699572(0xb7)],_0x479dc9=_0x4ba7e1[_0x699572(0xc3)](_0x5a183e=>_0x5a183e[_0x699572(0x11f)]===_0x699572(0x135))[_0x699572(0xb7)];console[_0x699572(0x134)]('━'['repeat'](0x3c)),console[_0x699572(0x134)](_0x699572(0x14c)),console[_0x699572(0x134)]('━'['repeat'](0x3c)),console[_0x699572(0x134)]('Total:\x20\x20\x20\x20'+_0x4ba7e1[_0x699572(0xb7)]),console['log'](_0x699572(0x11b)+a5_0x42b249[_0x699572(0xf5)](_0x2ae111)),console['log'](_0x699572(0xed)+a5_0x42b249[_0x699572(0xcc)](_0xa4ccc8));_0x479dc9>0x0&&console[_0x699572(0x134)](_0x699572(0x13a)+a5_0x42b249[_0x699572(0xcc)](_0x479dc9));console[_0x699572(0x134)](_0x699572(0x143)+formatElapsed(_0x290410)),console[_0x699572(0x134)]('━'[_0x699572(0xd8)](0x3c));const _0x16688b=_0x4ba7e1[_0x699572(0xc3)](_0x5c85b7=>_0x5c85b7[_0x699572(0x11f)]!==_0x699572(0xb6));if(_0x16688b[_0x699572(0xb7)]>0x0){console[_0x699572(0x134)](),console[_0x699572(0x134)](_0x699572(0x10f));for(const _0x43ac6d of _0x16688b){const _0x52e8b8=a5_0x42b249[_0x699572(0xcc)]('✗'),_0x4b2a20=_0x43ac6d[_0x699572(0x11e)]['length']>0x32?_0x43ac6d[_0x699572(0x11e)]['substring'](0x0,0x32)+'...':_0x43ac6d['reason'];console['log']('\x20\x20'+_0x52e8b8+'\x20'+_0x43ac6d[_0x699572(0xec)]+':\x20'+_0x4b2a20);}}const _0x566949={'summary':{'total':_0x4ba7e1['length'],'passed':_0x2ae111,'failed':_0xa4ccc8,'errors':_0x479dc9>0x0?_0x479dc9:undefined,'duration_ms':_0x290410},'tests':_0x4ba7e1,'agent':{'project':_0x4a1290[_0x699572(0x13f)],'name':_0x4a1290[_0x699572(0x118)],'site':_0x5443ae},'timestamp':new Date(_0x1d3cfa)['toISOString']()};try{const _0x44bcd8=buildCachedTestRun(_0x2563ad,{'site':_0x5443ae,'projectId':_0x3078dd,'projectName':_0x4a1290[_0x699572(0x13f)],'agentId':_0x40107f,'agentName':_0x4a1290['agentName'],'testYmlPath':a5_0x4da2d6[_0x699572(0x12c)](_0x4a1290['testYmlPath'])});saveLastTestRun(_0x44bcd8);}catch{}if(_0x2853c5!==_0x699572(0xbd)||_0xe6be08){const _0x16d5ae=formatResults(_0x566949,_0x2853c5);if(_0xe6be08)try{a5_0x26a35a[_0x699572(0x141)](_0xe6be08,_0x16d5ae,'utf-8'),console[_0x699572(0x134)](),console[_0x699572(0x134)](a5_0x42b249[_0x699572(0xde)](_0x699572(0x149)+_0xe6be08));}catch(_0x378b80){return console[_0x699572(0x134)](),console[_0x699572(0x134)](a5_0x42b249[_0x699572(0xcc)](_0x699572(0xbe)+_0x378b80)),0x1;}else console[_0x699572(0x134)](),console[_0x699572(0x134)](_0x16d5ae);}return _0x16688b['length']>0x0?0x1:0x0;}async[a5_0x236b70(0xe6)](_0x225eec,_0x28c712){const _0x342ea6=a5_0x236b70,{options:_0x405ad5,tdx:_0xfc5955}=_0x225eec,{definition:_0x3ce4d5,agentInfo:_0x5c1c3d,outputFormat:_0x533576,outputFile:_0x2581d1}=_0x28c712,_0x57968c=_0x405ad5[_0x342ea6(0xe4)],_0x2c38aa=loadLastTestRun();if(!_0x2c38aa)return console[_0x342ea6(0x134)](a5_0x42b249['red']('Error:\x20No\x20previous\x20test\x20run\x20found.')),console[_0x342ea6(0x134)](a5_0x42b249[_0x342ea6(0xde)](_0x342ea6(0xbb))),0x1;if(_0x2c38aa['agent'][_0x342ea6(0x118)]!==_0x5c1c3d['agentName'])return console[_0x342ea6(0x134)](a5_0x42b249[_0x342ea6(0xcc)]('Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22'+_0x2c38aa[_0x342ea6(0x13d)][_0x342ea6(0x118)]+_0x342ea6(0xcf)+_0x5c1c3d[_0x342ea6(0x118)]+'\x22.')),console[_0x342ea6(0x134)](a5_0x42b249[_0x342ea6(0xde)](_0x342ea6(0x122))),0x1;const _0x38f141=new Set(_0x2c38aa[_0x342ea6(0xff)]['map'](_0x56aef0=>_0x56aef0[_0x342ea6(0x12d)])),_0x594814=_0x3ce4d5['tests'][_0x342ea6(0xc3)](_0x43db90=>!_0x38f141[_0x342ea6(0x138)](_0x43db90[_0x342ea6(0xec)]));if(_0x594814[_0x342ea6(0xb7)]>0x0&&_0x2c38aa[_0x342ea6(0xe4)]!==_0x57968c)return console[_0x342ea6(0x134)](a5_0x42b249[_0x342ea6(0xcc)](_0x342ea6(0xfa))),console[_0x342ea6(0x134)](a5_0x42b249[_0x342ea6(0xde)]('Cached\x20run\x20is\x20from\x20site\x20\x22'+_0x2c38aa[_0x342ea6(0xe4)]+'\x22,\x20but\x20current\x20site\x20is\x20\x22'+_0x57968c+'\x22.')),console['log'](a5_0x42b249[_0x342ea6(0xde)](_0x342ea6(0x108)+_0x2c38aa[_0x342ea6(0xe4)]+_0x342ea6(0x107))),0x1;const _0x2f04a9=_0x3ce4d5[_0x342ea6(0xce)][_0x342ea6(0xc3)](_0x40c1c0=>_0x38f141[_0x342ea6(0x138)](_0x40c1c0[_0x342ea6(0xec)])),_0x21ae95=_0x594814;let _0x414bf3;try{_0x414bf3=await setupEvaluatorAgent(_0xfc5955[_0x342ea6(0x103)],_0x405ad5[_0x342ea6(0xfe)]);}catch(_0x5dbcdb){const _0x22e6ca=_0x5dbcdb instanceof Error?_0x5dbcdb[_0x342ea6(0x139)]:String(_0x5dbcdb);return console['log'](a5_0x42b249[_0x342ea6(0xcc)](_0x342ea6(0x147)+_0x22e6ca)),0x1;}console[_0x342ea6(0x134)](a5_0x42b249[_0x342ea6(0xb8)](_0x342ea6(0x116))),console[_0x342ea6(0x134)]('Cached\x20run\x20from:\x20'+a5_0x42b249[_0x342ea6(0x119)](_0x2c38aa[_0x342ea6(0xd6)])),console[_0x342ea6(0x134)](_0x342ea6(0xd1)+a5_0x42b249[_0x342ea6(0x119)](_0x2c38aa[_0x342ea6(0x13d)]['projectName']+'/'+_0x2c38aa[_0x342ea6(0x13d)][_0x342ea6(0x118)]));_0x21ae95[_0x342ea6(0xb7)]>0x0&&console[_0x342ea6(0x134)](_0x342ea6(0x10d)+a5_0x42b249[_0x342ea6(0x131)](_0x21ae95['length']));console[_0x342ea6(0x134)]();const _0x51059a=[],_0x508d16=Date[_0x342ea6(0x12a)](),_0x2523b1=createCommandSpinner(_0x342ea6(0x148));if(_0x2f04a9['length']>0x0)try{const _0x1ac40f=await reevaluateFromCache(_0xfc5955['llm'],_0x2c38aa,{'tests':_0x2f04a9},{'evaluatorId':_0x414bf3,'onTestStart':(_0x6ef005,_0x3492c7,_0x157336)=>{const _0x1cb5f7=_0x342ea6;_0x2523b1[_0x1cb5f7(0x13e)]=_0x1cb5f7(0x132)+(_0x3492c7+0x1)+'/'+_0x157336+':\x20'+_0x6ef005+'...';if(!_0x2523b1[_0x1cb5f7(0xf6)])_0x2523b1[_0x1cb5f7(0x130)]();},'onTestComplete':(_0x4c119f,_0x4081ee)=>{const _0x2dcc60=_0x342ea6;_0x2523b1[_0x2dcc60(0x142)]();if(_0x4081ee['status']===_0x2dcc60(0xb6))console[_0x2dcc60(0x134)](a5_0x42b249['green'](_0x2dcc60(0x101)+_0x4c119f)+a5_0x42b249[_0x2dcc60(0xde)](_0x2dcc60(0x10b)));else _0x4081ee[_0x2dcc60(0x11f)]===_0x2dcc60(0xe1)?console[_0x2dcc60(0x134)](a5_0x42b249[_0x2dcc60(0xcc)](_0x2dcc60(0xfb)+_0x4c119f+_0x2dcc60(0xc0)+_0x4081ee[_0x2dcc60(0x11e)])+a5_0x42b249[_0x2dcc60(0xde)](_0x2dcc60(0x10b))):console[_0x2dcc60(0x134)](a5_0x42b249[_0x2dcc60(0xcc)]('✗\x20ERROR:\x20'+_0x4c119f+_0x2dcc60(0xc0)+_0x4081ee[_0x2dcc60(0x11e)]));_0x4081ee[_0x2dcc60(0xc4)]&&console[_0x2dcc60(0x134)](a5_0x42b249[_0x2dcc60(0xde)]('\x20\x20Conversation:\x20'+_0x4081ee['conversation_url'])),_0x51059a[_0x2dcc60(0x117)](_0x4081ee);},'onTestSkipped':(_0x2897ca,_0x1d097f)=>{const _0x3a89b3=_0x342ea6;_0x2523b1[_0x3a89b3(0x142)](),console[_0x3a89b3(0x134)](a5_0x42b249['yellow'](_0x3a89b3(0x115)+_0x2897ca+_0x3a89b3(0xc0)+_0x1d097f));}});for(const _0x4f8b5d of _0x1ac40f){!_0x51059a['find'](_0x2d55de=>_0x2d55de['name']===_0x4f8b5d[_0x342ea6(0xec)])&&_0x51059a[_0x342ea6(0x117)](_0x4f8b5d);}}catch(_0x494fd7){_0x2523b1[_0x342ea6(0x142)]();const _0x5ab6ab=_0x494fd7 instanceof Error?_0x494fd7[_0x342ea6(0x139)]:String(_0x494fd7);return console[_0x342ea6(0x134)](a5_0x42b249['red'](_0x342ea6(0x140)+_0x5ab6ab)),0x1;}_0x2523b1[_0x342ea6(0x142)]();if(_0x21ae95[_0x342ea6(0xb7)]>0x0){console[_0x342ea6(0x134)](),console[_0x342ea6(0x134)](a5_0x42b249[_0x342ea6(0xb8)](_0x342ea6(0xd5)));const {projectId:_0x217ea9,agentId:_0x1d30f9}=_0x2c38aa[_0x342ea6(0x13d)];for(const _0x25f9a7 of _0x21ae95){console['log'](_0x342ea6(0x10e)+a5_0x42b249[_0x342ea6(0x119)](_0x25f9a7[_0x342ea6(0xec)]));const _0x55aeb7=createCommandSpinner(_0x342ea6(0x121)+_0x25f9a7[_0x342ea6(0x114)][_0x342ea6(0xb7)]+':\x20Sending\x20user\x20input...');_0x55aeb7[_0x342ea6(0x130)]();try{const {result:_0x3acfc9}=await runTest(_0xfc5955[_0x342ea6(0x103)],_0x25f9a7,{'agentId':_0x1d30f9,'projectId':_0x217ea9,'site':_0x2c38aa[_0x342ea6(0xe4)],'noEval':![],'evaluatorId':_0x414bf3,'onRoundStart':(_0x4fed3a,_0x41a030)=>{const _0x4a1749=_0x342ea6;_0x55aeb7[_0x4a1749(0x13e)]=_0x4a1749(0xe3)+(_0x4fed3a+0x1)+'/'+_0x41a030+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x180019,_0x189200,_0x18cc10)=>{const _0x429f6f=_0x342ea6,_0x35471c=formatElapsed(_0x189200);_0x18cc10?console['log'](_0x429f6f(0xe0)+(_0x180019+0x1)+'/'+_0x25f9a7[_0x429f6f(0x114)][_0x429f6f(0xb7)]+_0x429f6f(0x105)+a5_0x42b249['green']('✓')+'\x20('+_0x35471c+')'):console[_0x429f6f(0x134)](_0x429f6f(0xe0)+(_0x180019+0x1)+'/'+_0x25f9a7['rounds']['length']+_0x429f6f(0x105)+a5_0x42b249['red']('✗'));},'onEvaluationStart':()=>{const _0x2138d1=_0x342ea6;_0x55aeb7[_0x2138d1(0x13e)]=_0x2138d1(0x100);},'onEvaluationComplete':_0x3c9dce=>{const _0x36451f=_0x342ea6,_0x47ca34=formatElapsed(_0x3c9dce);console['log'](_0x36451f(0xb9)+a5_0x42b249[_0x36451f(0xf5)]('✓')+'\x20('+_0x47ca34+')');}});_0x55aeb7[_0x342ea6(0x142)](),_0x51059a[_0x342ea6(0x117)](_0x3acfc9);if(_0x3acfc9[_0x342ea6(0x11f)]==='PASS')console['log'](a5_0x42b249[_0x342ea6(0xf5)](_0x342ea6(0x101)+_0x3acfc9[_0x342ea6(0x11e)])+a5_0x42b249[_0x342ea6(0xde)]('\x20(new)'));else _0x3acfc9[_0x342ea6(0x11f)]===_0x342ea6(0xe1)?console[_0x342ea6(0x134)](a5_0x42b249['red']('✗\x20FAIL:\x20'+_0x3acfc9[_0x342ea6(0x11e)])+a5_0x42b249['dim'](_0x342ea6(0xd3))):console[_0x342ea6(0x134)](a5_0x42b249['red']('✗\x20ERROR:\x20'+_0x3acfc9[_0x342ea6(0x11e)]));_0x3acfc9[_0x342ea6(0xc4)]&&console[_0x342ea6(0x134)](a5_0x42b249[_0x342ea6(0xde)](_0x342ea6(0x125)+_0x3acfc9[_0x342ea6(0xc4)]));}catch(_0x41ebdf){_0x55aeb7[_0x342ea6(0x142)]();const _0x5155c6=_0x41ebdf instanceof Error?_0x41ebdf[_0x342ea6(0x139)]:String(_0x41ebdf);console[_0x342ea6(0x134)](a5_0x42b249[_0x342ea6(0xcc)]('✗\x20ERROR:\x20'+_0x5155c6)),_0x51059a[_0x342ea6(0x117)]({'name':_0x25f9a7[_0x342ea6(0xec)],'status':_0x342ea6(0x135),'reason':_0x5155c6,'timestamp':new Date()[_0x342ea6(0x133)](),'duration_ms':0x0});}}}console[_0x342ea6(0x134)]();const _0x47c886=Date[_0x342ea6(0x12a)]()-_0x508d16,_0x191c66=_0x51059a[_0x342ea6(0xc3)](_0x3334e0=>_0x3334e0['status']==='PASS')['length'],_0x152f51=_0x51059a[_0x342ea6(0xc3)](_0x40ea2d=>_0x40ea2d[_0x342ea6(0x11f)]===_0x342ea6(0xe1))[_0x342ea6(0xb7)],_0x173d92=_0x51059a[_0x342ea6(0xc3)](_0x5b850d=>_0x5b850d[_0x342ea6(0x11f)]===_0x342ea6(0x135))[_0x342ea6(0xb7)];console[_0x342ea6(0x134)]('━'[_0x342ea6(0xd8)](0x3c)),console[_0x342ea6(0x134)](_0x342ea6(0x110)),console[_0x342ea6(0x134)]('━'[_0x342ea6(0xd8)](0x3c)),console[_0x342ea6(0x134)]('Total:\x20\x20\x20\x20'+_0x51059a[_0x342ea6(0xb7)]),console[_0x342ea6(0x134)](_0x342ea6(0x11b)+a5_0x42b249[_0x342ea6(0xf5)](_0x191c66)),console[_0x342ea6(0x134)](_0x342ea6(0xed)+a5_0x42b249[_0x342ea6(0xcc)](_0x152f51));_0x173d92>0x0&&console[_0x342ea6(0x134)](_0x342ea6(0x13a)+a5_0x42b249['red'](_0x173d92));console[_0x342ea6(0x134)]('Duration:\x20'+formatElapsed(_0x47c886)),console['log']('━'[_0x342ea6(0xd8)](0x3c));const _0x3e076a={'summary':{'total':_0x51059a['length'],'passed':_0x191c66,'failed':_0x152f51,'errors':_0x173d92>0x0?_0x173d92:undefined,'duration_ms':_0x47c886},'tests':_0x51059a,'agent':{'project':_0x5c1c3d[_0x342ea6(0x13f)],'name':_0x5c1c3d[_0x342ea6(0x118)],'site':_0x57968c},'timestamp':new Date(_0x508d16)[_0x342ea6(0x133)]()};if(_0x533576!==_0x342ea6(0xbd)||_0x2581d1){const _0x49054f=formatResults(_0x3e076a,_0x533576);if(_0x2581d1)try{a5_0x26a35a['writeFileSync'](_0x2581d1,_0x49054f,_0x342ea6(0xd4)),console[_0x342ea6(0x134)](),console[_0x342ea6(0x134)](a5_0x42b249[_0x342ea6(0xde)]('Output\x20written\x20to:\x20'+_0x2581d1));}catch(_0x27635f){return console[_0x342ea6(0x134)](),console[_0x342ea6(0x134)](a5_0x42b249[_0x342ea6(0xcc)](_0x342ea6(0xbe)+_0x27635f)),0x1;}else console[_0x342ea6(0x134)](),console[_0x342ea6(0x134)](_0x49054f);}const _0x3d5437=_0x51059a[_0x342ea6(0xc3)](_0x5b7808=>_0x5b7808['status']!==_0x342ea6(0xb6));return _0x3d5437[_0x342ea6(0xb7)]>0x0?0x1:0x0;}}
1
+ function a5_0x19f7(){const _0x56d9af=['Re-evaluating\x20','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','substring','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','tags','output','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','dryRun','reeval','log','table','join','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','\x20\x20-\x20','find','Re-evaluating...','map','FAIL','387aqsjLm','llm','\x27\x20to\x20create\x20the\x20folder\x20structure.','Duration:\x20','404','344daqqSj','jsonl','Round\x201/','164299jPYDen','basename','white','filter','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','executeReeval','toLowerCase','Cached\x20run\x20is\x20from\x20site\x20\x22','\x20\x20tdx\x20agent\x20test\x20<path>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20from\x20path','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','No\x20tests\x20found\x20with\x20tags:\x20','yellow','verbose','message','agentDirs','llmProject','no_local_folder','Run\x20\x27tdx\x20agent\x20pull\x20','No\x20tests\x20found\x20matching:\x20','Test\x20','push','\x20\x20Agent:\x20','rounds','not\x20found','repeat','Output\x20written\x20to:\x20','reason','Cached\x20run\x20from:\x20','\x20\x20Evaluating...\x20','isSpinning','⚠\x20SKIPPED:\x20','size','Using\x20agent:\x20','Passed:\x20\x20\x20','length','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','context','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','eval','description','Available\x20tags:\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','add','tsv','Re-evaluation\x20Summary','site','no_tests','Round\x20','cyan','resolve','testYmlPath','Agent:\x20','projectName','no_context','1380010kruwQT','42oQfbnn','\x20(new)','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','includes','1929180JwZrjp','\x20\x20Round\x20','start','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','text','round','Failed:\x20\x20\x20','forEach','conversations','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','Site:\x20','red',':\x20Sending\x20user\x20input...','some','now','json','source','has','\x20-\x20','Either\x20switch\x20to\x20the\x20\x22','\x20\x20Conversation:\x20','PASS','name','...\x20','green','✗\x20FAIL:\x20','10105HpsmnA','32753RbFaBb','\x20\x20Project:\x20','dim','\x20(cached)','agentName','projectDir','114KrWxAc','trim','\x22:\x20','37486vaqwRf','stop','agent','...','Project\x20path:\x20','timestamp','Errors:\x20\x20\x20','\x22,\x20but\x20current\x20site\x20is\x20\x22','execute','Usage:','30120icvUIc','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','conversation_url','Test\x20Configuration:','ERROR','✓\x20PASS:\x20','Evaluating\x20response...','Available\x20tests:\x20','Running\x20test:\x20','writeFileSync','No\x20tests\x20have\x20tags\x20defined.','✗\x20ERROR:\x20','\x20\x20tdx\x20agent\x20test\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20(requires\x20context\x20or\x20tdx.json)','agent:test','Executing\x20new\x20tests...','Error\x20writing\x20output\x20file:\x20','Test\x20Summary','New\x20tests\x20to\x20execute:\x20','Total:\x20\x20\x20\x20','found','✗\x20ERROR:\x20Project\x20not\x20found:\x20','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','tests','status','toISOString','✗\x20ERROR:\x20Agent\x20not\x20found:\x20'];a5_0x19f7=function(){return _0x56d9af;};return a5_0x19f7();}const a5_0xa60653=a5_0x5a2b;(function(_0x436f16,_0x20da0d){const _0x4439da=a5_0x5a2b,_0x3ebfef=_0x436f16();while(!![]){try{const _0x3b7f84=-parseInt(_0x4439da(0xd4))/0x1+parseInt(_0x4439da(0x96))/0x2*(parseInt(_0x4439da(0x10b))/0x3)+-parseInt(_0x4439da(0xd1))/0x4*(-parseInt(_0x4439da(0x8c))/0x5)+-parseInt(_0x4439da(0x93))/0x6*(-parseInt(_0x4439da(0x8d))/0x7)+-parseInt(_0x4439da(0xa0))/0x8*(parseInt(_0x4439da(0xcc))/0x9)+parseInt(_0x4439da(0x10a))/0xa+-parseInt(_0x4439da(0x10f))/0xb;if(_0x3b7f84===_0x20da0d)break;else _0x3ebfef['push'](_0x3ebfef['shift']());}catch(_0x189382){_0x3ebfef['push'](_0x3ebfef['shift']());}}}(a5_0x19f7,0x27700));import*as a5_0x35afb0 from'node:fs';import*as a5_0x46fc01 from'node:path';import a5_0xdc0274 from'chalk';function a5_0x5a2b(_0x2a3d3b,_0x556ea7){_0x2a3d3b=_0x2a3d3b-0x7b;const _0x19f724=a5_0x19f7();let _0x5a2b01=_0x19f724[_0x2a3d3b];return _0x5a2b01;}import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{['name']=a5_0xa60653(0xad);[a5_0xa60653(0xfb)]='Run\x20tests\x20for\x20an\x20LLM\x20agent';async[a5_0xa60653(0x9e)](_0x40484a){const _0x2396e4=a5_0xa60653,{options:_0x5ad9f8,args:_0x57c72d,tdx:_0x5a4514}=_0x40484a,_0xebda57=_0x57c72d[0x0]||'.',_0x1314c0=_0x5ad9f8[_0x2396e4(0xc1)],_0x43e520=_0x5ad9f8,_0x5f46aa=_0x43e520[_0x2396e4(0xfa)]===![],_0x2566d5=_0x43e520[_0x2396e4(0xc2)],_0x324f87=_0x43e520[_0x2396e4(0x88)],_0x22fe20=_0x43e520[_0x2396e4(0xbe)],_0x556b3e=_0x5ad9f8[_0x2396e4(0x101)],_0x564118=_0x43e520[_0x2396e4(0xbf)];if(_0x2566d5&&_0x5f46aa)return console[_0x2396e4(0xc3)](a5_0xdc0274[_0x2396e4(0x7d)](_0x2396e4(0x112))),0x1;let _0x205c23=_0x2396e4(0xc4);if(_0x43e520[_0x2396e4(0x81)])_0x205c23=_0x2396e4(0x81);else{if(_0x43e520[_0x2396e4(0xd2)])_0x205c23=_0x2396e4(0xd2);else{if(_0x43e520[_0x2396e4(0xff)])_0x205c23=_0x2396e4(0xff);else{if(_0x43e520[_0x2396e4(0xc4)])_0x205c23=_0x2396e4(0xc4);}}}const _0x1f42a3=_0x43e520[_0x2396e4(0xe3)];let _0x48f75a=_0xebda57;const _0x17d191=a5_0x35afb0['existsSync'](_0xebda57),_0x20e5f0=_0xebda57==='.';if(!_0x17d191||_0x20e5f0){const _0x432388=resolveProjectFromContext(_0xebda57,_0x1f42a3,{'requireFile':'test.yml'});if(_0x432388[_0x2396e4(0xb3)])_0x48f75a=_0x432388[_0x2396e4(0x92)],_0x432388[_0x2396e4(0x82)]===_0x2396e4(0xf8)&&console[_0x2396e4(0xc3)](a5_0xdc0274[_0x2396e4(0x8f)](_0x2396e4(0xf4)+_0x48f75a));else switch(_0x432388['reason']){case _0x2396e4(0x109):console[_0x2396e4(0xc3)](a5_0xdc0274['yellow'](_0x432388[_0x2396e4(0xe1)])),console[_0x2396e4(0xc3)](),console[_0x2396e4(0xc3)](_0x2396e4(0x9f)),console[_0x2396e4(0xc3)](_0x2396e4(0xdc)),console[_0x2396e4(0xc3)](_0x2396e4(0xac)),console[_0x2396e4(0xc3)](),console[_0x2396e4(0xc3)](_0x2396e4(0xa1));return 0x1;case _0x2396e4(0xe4):console[_0x2396e4(0xc3)](a5_0xdc0274[_0x2396e4(0xdf)](_0x432388['message'])),console[_0x2396e4(0xc3)](),console[_0x2396e4(0xc3)](_0x2396e4(0xe5)+_0x432388[_0x2396e4(0xe3)]+_0x2396e4(0xce));return 0x1;case'multiple_agents':{const _0x4ac9a0=a5_0x46fc01[_0x2396e4(0xd5)](_0x432388[_0x2396e4(0x92)]);console[_0x2396e4(0xc3)](a5_0xdc0274['yellow'](_0x2396e4(0xb5)+_0x432388[_0x2396e4(0xe3)]+'\x22:'));for(const _0x2e1886 of _0x432388[_0x2396e4(0xe2)]){console[_0x2396e4(0xc3)](_0x2396e4(0xc7)+_0x2e1886);}return console[_0x2396e4(0xc3)](),console[_0x2396e4(0xc3)](_0x2396e4(0xdd)+_0x4ac9a0+'/<agent-name>'),0x1;}case _0x2396e4(0x102):console[_0x2396e4(0xc3)](a5_0xdc0274['yellow'](_0x2396e4(0xf7)+_0x432388[_0x2396e4(0xe3)]+'\x22.')),console[_0x2396e4(0xc3)](a5_0xdc0274['dim'](_0x2396e4(0x9a)+_0x432388['projectDir'])),console[_0x2396e4(0xc3)](),console[_0x2396e4(0xc3)](_0x2396e4(0x7b));return 0x1;}}const {definition:_0x1e36f6,agentInfo:_0x635603}=parseTestFile(_0x48f75a);let _0x1ba8b7=_0x1e36f6[_0x2396e4(0xb6)];if(_0x324f87){const _0xbb240b=_0x324f87['split'](',')[_0x2396e4(0xca)](_0x205a9b=>_0x205a9b[_0x2396e4(0x94)]());_0x1ba8b7=_0x1e36f6[_0x2396e4(0xb6)]['filter'](_0x2f36d2=>_0xbb240b[_0x2396e4(0x10e)](_0x2f36d2['name']));if(_0x1ba8b7[_0x2396e4(0xf6)]===0x0)return console[_0x2396e4(0xc3)](a5_0xdc0274[_0x2396e4(0xdf)](_0x2396e4(0xe6)+_0x324f87)),console['log'](a5_0xdc0274[_0x2396e4(0x8f)](_0x2396e4(0xa7)+_0x1e36f6[_0x2396e4(0xb6)][_0x2396e4(0xca)](_0x21f330=>_0x21f330[_0x2396e4(0x88)])['join'](',\x20'))),0x1;}if(_0x22fe20){const _0x3570aa=_0x22fe20['split'](',')[_0x2396e4(0xca)](_0x57de94=>_0x57de94['trim']()[_0x2396e4(0xda)]());_0x1ba8b7=_0x1ba8b7[_0x2396e4(0xd7)](_0x5db7a3=>_0x5db7a3[_0x2396e4(0xbe)]?.[_0x2396e4(0x7f)](_0x10df41=>_0x3570aa['includes'](_0x10df41[_0x2396e4(0xda)]())));if(_0x1ba8b7[_0x2396e4(0xf6)]===0x0){console['log'](a5_0xdc0274[_0x2396e4(0xdf)](_0x2396e4(0xde)+_0x22fe20));const _0x1308dd=new Set();return _0x1e36f6['tests'][_0x2396e4(0x116)](_0x138d4e=>_0x138d4e['tags']?.['forEach'](_0x4bef0c=>_0x1308dd[_0x2396e4(0xfe)](_0x4bef0c))),_0x1308dd[_0x2396e4(0xf3)]>0x0?console[_0x2396e4(0xc3)](a5_0xdc0274['dim'](_0x2396e4(0xfc)+[..._0x1308dd][_0x2396e4(0xc5)](',\x20'))):console[_0x2396e4(0xc3)](a5_0xdc0274[_0x2396e4(0x8f)](_0x2396e4(0xaa))),0x1;}}if(_0x2566d5)return this['executeReeval'](_0x40484a,{'definition':{'tests':_0x1ba8b7},'agentInfo':_0x635603,'outputFormat':_0x205c23,'outputFile':_0x564118,'testNames':_0x324f87});if(_0x1314c0){console[_0x2396e4(0xc3)](a5_0xdc0274[_0x2396e4(0x104)](_0x2396e4(0xa3))),console[_0x2396e4(0xc3)]('\x20\x20Site:\x20'+a5_0xdc0274[_0x2396e4(0xd6)](_0x556b3e)),console[_0x2396e4(0xc3)](_0x2396e4(0x8e)+a5_0xdc0274[_0x2396e4(0xd6)](_0x635603[_0x2396e4(0x108)])),console[_0x2396e4(0xc3)](_0x2396e4(0xe9)+a5_0xdc0274[_0x2396e4(0xd6)](_0x635603[_0x2396e4(0x91)])),console['log'](),console['log']('Tests\x20found:\x20'+a5_0xdc0274[_0x2396e4(0xd6)](_0x1ba8b7[_0x2396e4(0xf6)]));for(let _0x38211c=0x0;_0x38211c<_0x1ba8b7[_0x2396e4(0xf6)];_0x38211c++){const _0x42ae24=_0x1ba8b7[_0x38211c],_0x1ddf8c=_0x42ae24[_0x2396e4(0xea)][_0x2396e4(0xf6)]===0x1?_0x2396e4(0x114):_0x2396e4(0xea),_0xf5e382=_0x42ae24[_0x2396e4(0xbe)]?.[_0x2396e4(0xf6)]?'\x20['+_0x42ae24[_0x2396e4(0xbe)][_0x2396e4(0xc5)](',\x20')+']':'';console[_0x2396e4(0xc3)]('\x20\x20'+(_0x38211c+0x1)+'.\x20'+a5_0xdc0274['white'](_0x42ae24[_0x2396e4(0x88)])+'\x20('+_0x42ae24[_0x2396e4(0xea)][_0x2396e4(0xf6)]+'\x20'+_0x1ddf8c+')'+a5_0xdc0274[_0x2396e4(0x8f)](_0xf5e382));}return 0x0;}let _0x1cf430,_0x22440f;try{_0x1cf430=await _0x5a4514[_0x2396e4(0xcd)]['resolveProjectId'](_0x635603[_0x2396e4(0x108)]);}catch(_0x5f3257){const _0x3bdf1f=_0x5f3257 instanceof Error?_0x5f3257[_0x2396e4(0xe1)]:String(_0x5f3257);return _0x3bdf1f[_0x2396e4(0x10e)](_0x2396e4(0xd0))||_0x3bdf1f['toLowerCase']()[_0x2396e4(0x10e)](_0x2396e4(0xeb))?console[_0x2396e4(0xc3)](a5_0xdc0274[_0x2396e4(0x7d)](_0x2396e4(0xb4)+_0x635603[_0x2396e4(0x108)])):console[_0x2396e4(0xc3)](a5_0xdc0274[_0x2396e4(0x7d)](_0x2396e4(0xfd)+_0x635603[_0x2396e4(0x108)]+_0x2396e4(0x95)+_0x3bdf1f)),0x1;}try{_0x22440f=await _0x5a4514[_0x2396e4(0xcd)]['resolveAgentId'](_0x635603['agentName'],_0x1cf430);}catch(_0x20daba){const _0x69db97=_0x20daba instanceof Error?_0x20daba[_0x2396e4(0xe1)]:String(_0x20daba);return _0x69db97[_0x2396e4(0x10e)]('404')||_0x69db97[_0x2396e4(0xda)]()[_0x2396e4(0x10e)]('not\x20found')?console[_0x2396e4(0xc3)](a5_0xdc0274['red'](_0x2396e4(0xb9)+_0x635603[_0x2396e4(0x91)])):console[_0x2396e4(0xc3)](a5_0xdc0274[_0x2396e4(0x7d)](_0x2396e4(0x10d)+_0x635603[_0x2396e4(0x91)]+'\x22:\x20'+_0x69db97)),0x1;}let _0x4d4bf6;if(!_0x5f46aa)try{_0x4d4bf6=await setupEvaluatorAgent(_0x5a4514[_0x2396e4(0xcd)],_0x5ad9f8['verbose']);}catch(_0x86f09b){const _0x41ad79=_0x86f09b instanceof Error?_0x86f09b[_0x2396e4(0xe1)]:String(_0x86f09b);return console['log'](a5_0xdc0274[_0x2396e4(0x7d)](_0x2396e4(0xc6)+_0x41ad79)),0x1;}console[_0x2396e4(0xc3)](a5_0xdc0274[_0x2396e4(0x104)]('Running\x20agent\x20tests...')),console['log'](_0x2396e4(0x7c)+a5_0xdc0274[_0x2396e4(0xd6)](_0x556b3e)),console['log'](_0x2396e4(0x107)+a5_0xdc0274[_0x2396e4(0xd6)](_0x635603[_0x2396e4(0x108)]+'/'+_0x635603[_0x2396e4(0x91)])),console[_0x2396e4(0xc3)]();const _0x4751f7=[],_0x3aaa1c=[],_0x425be1=Date[_0x2396e4(0x80)]();for(let _0x2af7fd=0x0;_0x2af7fd<_0x1ba8b7[_0x2396e4(0xf6)];_0x2af7fd++){const _0x4738cf=_0x1ba8b7[_0x2af7fd];_0x1ba8b7[_0x2396e4(0xf6)]>0x1?console[_0x2396e4(0xc3)](_0x2396e4(0xe7)+(_0x2af7fd+0x1)+'/'+_0x1ba8b7['length']+':\x20'+a5_0xdc0274['white'](_0x4738cf['name'])):console[_0x2396e4(0xc3)](_0x2396e4(0xa8)+a5_0xdc0274[_0x2396e4(0xd6)](_0x4738cf[_0x2396e4(0x88)]));const _0x42333a=createCommandSpinner(_0x2396e4(0xd3)+_0x4738cf['rounds'][_0x2396e4(0xf6)]+_0x2396e4(0x7e));_0x42333a['start']();try{const {result:_0x3db7d7,conversation:_0x3695d9}=await runTest(_0x5a4514[_0x2396e4(0xcd)],_0x4738cf,{'agentId':_0x22440f,'projectId':_0x1cf430,'site':_0x556b3e,'noEval':_0x5f46aa,'evaluatorId':_0x4d4bf6,'onRoundStart':(_0x181fa4,_0x50462a)=>{const _0x4e84ca=_0x2396e4;_0x42333a[_0x4e84ca(0x113)]=_0x4e84ca(0x103)+(_0x181fa4+0x1)+'/'+_0x50462a+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x1e76e1,_0xa5abd1,_0x69c190)=>{const _0x19ba64=_0x2396e4,_0x39342e=formatElapsed(_0xa5abd1);_0x69c190?console[_0x19ba64(0xc3)](_0x19ba64(0x110)+(_0x1e76e1+0x1)+'/'+_0x4738cf[_0x19ba64(0xea)][_0x19ba64(0xf6)]+'...\x20'+a5_0xdc0274['green']('✓')+'\x20('+_0x39342e+')'):console[_0x19ba64(0xc3)](_0x19ba64(0x110)+(_0x1e76e1+0x1)+'/'+_0x4738cf['rounds'][_0x19ba64(0xf6)]+_0x19ba64(0x89)+a5_0xdc0274[_0x19ba64(0x7d)]('✗'));},'onEvaluationStart':()=>{const _0x31bb4d=_0x2396e4;_0x42333a[_0x31bb4d(0x113)]=_0x31bb4d(0xa6);},'onEvaluationComplete':_0xcd6f1b=>{const _0x3d3627=_0x2396e4,_0x3d83b7=formatElapsed(_0xcd6f1b);console[_0x3d3627(0xc3)]('\x20\x20Evaluating...\x20'+a5_0xdc0274[_0x3d3627(0x8a)]('✓')+'\x20('+_0x3d83b7+')');}});_0x42333a[_0x2396e4(0x97)](),_0x4751f7['push'](_0x3db7d7),_0x3aaa1c[_0x2396e4(0xe8)](_0x3695d9);if(_0x3db7d7[_0x2396e4(0xb7)]===_0x2396e4(0x87))console[_0x2396e4(0xc3)](a5_0xdc0274[_0x2396e4(0x8a)](_0x2396e4(0xa5)+_0x3db7d7['reason']));else _0x3db7d7[_0x2396e4(0xb7)]===_0x2396e4(0xcb)?console[_0x2396e4(0xc3)](a5_0xdc0274[_0x2396e4(0x7d)](_0x2396e4(0x8b)+_0x3db7d7[_0x2396e4(0xee)])):console[_0x2396e4(0xc3)](a5_0xdc0274[_0x2396e4(0x7d)]('✗\x20ERROR:\x20'+_0x3db7d7[_0x2396e4(0xee)]));_0x3db7d7[_0x2396e4(0xa2)]&&console[_0x2396e4(0xc3)](a5_0xdc0274['dim']('Conversation\x20URL:\x20'+_0x3db7d7['conversation_url'])),console[_0x2396e4(0xc3)]();}catch(_0x5cf1d3){_0x42333a[_0x2396e4(0x97)]();const _0x4d0c9a=_0x5cf1d3 instanceof Error?_0x5cf1d3['message']:String(_0x5cf1d3);console['log'](a5_0xdc0274[_0x2396e4(0x7d)](_0x2396e4(0xab)+_0x4d0c9a)),console[_0x2396e4(0xc3)](),_0x4751f7[_0x2396e4(0xe8)]({'name':_0x4738cf['name'],'status':_0x2396e4(0xa4),'reason':_0x4d0c9a,'timestamp':new Date()[_0x2396e4(0xb8)](),'duration_ms':0x0});}}const _0x8a8384=Date[_0x2396e4(0x80)]()-_0x425be1,_0x565759=_0x4751f7[_0x2396e4(0xd7)](_0x2c8d1e=>_0x2c8d1e[_0x2396e4(0xb7)]===_0x2396e4(0x87))[_0x2396e4(0xf6)],_0x1a0b3a=_0x4751f7[_0x2396e4(0xd7)](_0x452c81=>_0x452c81[_0x2396e4(0xb7)]===_0x2396e4(0xcb))[_0x2396e4(0xf6)],_0x36f2f5=_0x4751f7[_0x2396e4(0xd7)](_0x1f141b=>_0x1f141b['status']==='ERROR')[_0x2396e4(0xf6)];console[_0x2396e4(0xc3)]('━'[_0x2396e4(0xec)](0x3c)),console[_0x2396e4(0xc3)](_0x2396e4(0xb0)),console[_0x2396e4(0xc3)]('━'[_0x2396e4(0xec)](0x3c)),console[_0x2396e4(0xc3)](_0x2396e4(0xb2)+_0x4751f7['length']),console[_0x2396e4(0xc3)](_0x2396e4(0xf5)+a5_0xdc0274[_0x2396e4(0x8a)](_0x565759)),console[_0x2396e4(0xc3)](_0x2396e4(0x115)+a5_0xdc0274[_0x2396e4(0x7d)](_0x1a0b3a));_0x36f2f5>0x0&&console[_0x2396e4(0xc3)](_0x2396e4(0x9c)+a5_0xdc0274[_0x2396e4(0x7d)](_0x36f2f5));console[_0x2396e4(0xc3)](_0x2396e4(0xcf)+formatElapsed(_0x8a8384)),console[_0x2396e4(0xc3)]('━'[_0x2396e4(0xec)](0x3c));const _0x194a34=_0x4751f7['filter'](_0x2486ff=>_0x2486ff['status']!==_0x2396e4(0x87));if(_0x194a34[_0x2396e4(0xf6)]>0x0){console['log'](),console[_0x2396e4(0xc3)]('Failed\x20Tests:');for(const _0x487169 of _0x194a34){const _0x344fc8=a5_0xdc0274[_0x2396e4(0x7d)]('✗'),_0x313a4d=_0x487169[_0x2396e4(0xee)]['length']>0x32?_0x487169[_0x2396e4(0xee)][_0x2396e4(0xbc)](0x0,0x32)+'...':_0x487169[_0x2396e4(0xee)];console['log']('\x20\x20'+_0x344fc8+'\x20'+_0x487169['name']+':\x20'+_0x313a4d);}}const _0x515f5f={'summary':{'total':_0x4751f7[_0x2396e4(0xf6)],'passed':_0x565759,'failed':_0x1a0b3a,'errors':_0x36f2f5>0x0?_0x36f2f5:undefined,'duration_ms':_0x8a8384},'tests':_0x4751f7,'agent':{'project':_0x635603['projectName'],'name':_0x635603[_0x2396e4(0x91)],'site':_0x556b3e},'timestamp':new Date(_0x425be1)[_0x2396e4(0xb8)]()};try{const _0x56e6d7=buildCachedTestRun(_0x3aaa1c,{'site':_0x556b3e,'projectId':_0x1cf430,'projectName':_0x635603[_0x2396e4(0x108)],'agentId':_0x22440f,'agentName':_0x635603['agentName'],'testYmlPath':a5_0x46fc01[_0x2396e4(0x105)](_0x635603[_0x2396e4(0x106)])});saveLastTestRun(_0x56e6d7);}catch{}if(_0x205c23!==_0x2396e4(0xc4)||_0x564118){const _0x2fd7b8=formatResults(_0x515f5f,_0x205c23);if(_0x564118)try{a5_0x35afb0[_0x2396e4(0xa9)](_0x564118,_0x2fd7b8,'utf-8'),console[_0x2396e4(0xc3)](),console[_0x2396e4(0xc3)](a5_0xdc0274[_0x2396e4(0x8f)](_0x2396e4(0xed)+_0x564118));}catch(_0x1aed0d){return console[_0x2396e4(0xc3)](),console[_0x2396e4(0xc3)](a5_0xdc0274[_0x2396e4(0x7d)](_0x2396e4(0xaf)+_0x1aed0d)),0x1;}else console[_0x2396e4(0xc3)](),console[_0x2396e4(0xc3)](_0x2fd7b8);}return _0x194a34[_0x2396e4(0xf6)]>0x0?0x1:0x0;}async[a5_0xa60653(0xd9)](_0x1562ef,_0x1f37cc){const _0x5eb8d8=a5_0xa60653,{options:_0x3f994f,tdx:_0x2398a9}=_0x1562ef,{definition:_0x513cd6,agentInfo:_0x23abbc,outputFormat:_0x4c0b09,outputFile:_0x35c144}=_0x1f37cc,_0x7c8bc3=_0x3f994f['site'],_0x37008e=loadLastTestRun();if(!_0x37008e)return console[_0x5eb8d8(0xc3)](a5_0xdc0274['red']('Error:\x20No\x20previous\x20test\x20run\x20found.')),console['log'](a5_0xdc0274[_0x5eb8d8(0x8f)](_0x5eb8d8(0xf9))),0x1;if(_0x37008e[_0x5eb8d8(0x98)][_0x5eb8d8(0x91)]!==_0x23abbc[_0x5eb8d8(0x91)])return console[_0x5eb8d8(0xc3)](a5_0xdc0274['red']('Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22'+_0x37008e['agent'][_0x5eb8d8(0x91)]+_0x5eb8d8(0xc0)+_0x23abbc['agentName']+'\x22.')),console[_0x5eb8d8(0xc3)](a5_0xdc0274[_0x5eb8d8(0x8f)]('Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.')),0x1;const _0x4f5e4d=new Set(_0x37008e[_0x5eb8d8(0x117)]['map'](_0x31028a=>_0x31028a['testName'])),_0x4460b4=_0x513cd6[_0x5eb8d8(0xb6)][_0x5eb8d8(0xd7)](_0xb1b295=>!_0x4f5e4d[_0x5eb8d8(0x83)](_0xb1b295[_0x5eb8d8(0x88)]));if(_0x4460b4[_0x5eb8d8(0xf6)]>0x0&&_0x37008e['site']!==_0x7c8bc3)return console['log'](a5_0xdc0274[_0x5eb8d8(0x7d)](_0x5eb8d8(0xbb))),console['log'](a5_0xdc0274[_0x5eb8d8(0x8f)](_0x5eb8d8(0xdb)+_0x37008e[_0x5eb8d8(0x101)]+_0x5eb8d8(0x9d)+_0x7c8bc3+'\x22.')),console['log'](a5_0xdc0274[_0x5eb8d8(0x8f)](_0x5eb8d8(0x85)+_0x37008e['site']+_0x5eb8d8(0xbd))),0x1;const _0x53e98f=_0x513cd6[_0x5eb8d8(0xb6)]['filter'](_0x335b0e=>_0x4f5e4d[_0x5eb8d8(0x83)](_0x335b0e[_0x5eb8d8(0x88)])),_0x46fc2a=_0x4460b4;let _0x1cc551;try{_0x1cc551=await setupEvaluatorAgent(_0x2398a9[_0x5eb8d8(0xcd)],_0x3f994f[_0x5eb8d8(0xe0)]);}catch(_0x47be4e){const _0x3382ce=_0x47be4e instanceof Error?_0x47be4e[_0x5eb8d8(0xe1)]:String(_0x47be4e);return console[_0x5eb8d8(0xc3)](a5_0xdc0274[_0x5eb8d8(0x7d)](_0x5eb8d8(0xc6)+_0x3382ce)),0x1;}console[_0x5eb8d8(0xc3)](a5_0xdc0274['cyan']('Re-evaluating\x20cached\x20test\x20run...')),console[_0x5eb8d8(0xc3)](_0x5eb8d8(0xef)+a5_0xdc0274['white'](_0x37008e[_0x5eb8d8(0x9b)])),console[_0x5eb8d8(0xc3)](_0x5eb8d8(0x107)+a5_0xdc0274['white'](_0x37008e[_0x5eb8d8(0x98)]['projectName']+'/'+_0x37008e[_0x5eb8d8(0x98)][_0x5eb8d8(0x91)]));_0x46fc2a['length']>0x0&&console[_0x5eb8d8(0xc3)](_0x5eb8d8(0xb1)+a5_0xdc0274[_0x5eb8d8(0xdf)](_0x46fc2a[_0x5eb8d8(0xf6)]));console['log']();const _0x2e0d78=[],_0x57dd83=Date[_0x5eb8d8(0x80)](),_0x4ae20f=createCommandSpinner(_0x5eb8d8(0xc9));if(_0x53e98f[_0x5eb8d8(0xf6)]>0x0)try{const _0xd68473=await reevaluateFromCache(_0x2398a9['llm'],_0x37008e,{'tests':_0x53e98f},{'evaluatorId':_0x1cc551,'onTestStart':(_0x423b57,_0x38c41c,_0xf8df9)=>{const _0xd3e4f0=_0x5eb8d8;_0x4ae20f[_0xd3e4f0(0x113)]=_0xd3e4f0(0xba)+(_0x38c41c+0x1)+'/'+_0xf8df9+':\x20'+_0x423b57+_0xd3e4f0(0x99);if(!_0x4ae20f[_0xd3e4f0(0xf1)])_0x4ae20f['start']();},'onTestComplete':(_0x5d6d5d,_0x5575d4)=>{const _0x479483=_0x5eb8d8;_0x4ae20f[_0x479483(0x97)]();if(_0x5575d4[_0x479483(0xb7)]===_0x479483(0x87))console[_0x479483(0xc3)](a5_0xdc0274[_0x479483(0x8a)]('✓\x20PASS:\x20'+_0x5d6d5d)+a5_0xdc0274[_0x479483(0x8f)](_0x479483(0x90)));else _0x5575d4[_0x479483(0xb7)]===_0x479483(0xcb)?console[_0x479483(0xc3)](a5_0xdc0274[_0x479483(0x7d)](_0x479483(0x8b)+_0x5d6d5d+_0x479483(0x84)+_0x5575d4['reason'])+a5_0xdc0274[_0x479483(0x8f)]('\x20(cached)')):console['log'](a5_0xdc0274[_0x479483(0x7d)](_0x479483(0xab)+_0x5d6d5d+_0x479483(0x84)+_0x5575d4[_0x479483(0xee)]));_0x5575d4[_0x479483(0xa2)]&&console[_0x479483(0xc3)](a5_0xdc0274[_0x479483(0x8f)](_0x479483(0x86)+_0x5575d4[_0x479483(0xa2)])),_0x2e0d78[_0x479483(0xe8)](_0x5575d4);},'onTestSkipped':(_0x467684,_0x47368f)=>{const _0x5d7a26=_0x5eb8d8;_0x4ae20f[_0x5d7a26(0x97)](),console[_0x5d7a26(0xc3)](a5_0xdc0274[_0x5d7a26(0xdf)](_0x5d7a26(0xf2)+_0x467684+'\x20-\x20'+_0x47368f));}});for(const _0x328a4a of _0xd68473){!_0x2e0d78[_0x5eb8d8(0xc8)](_0x3576de=>_0x3576de['name']===_0x328a4a[_0x5eb8d8(0x88)])&&_0x2e0d78[_0x5eb8d8(0xe8)](_0x328a4a);}}catch(_0x403b98){_0x4ae20f[_0x5eb8d8(0x97)]();const _0x281746=_0x403b98 instanceof Error?_0x403b98['message']:String(_0x403b98);return console[_0x5eb8d8(0xc3)](a5_0xdc0274[_0x5eb8d8(0x7d)](_0x5eb8d8(0xd8)+_0x281746)),0x1;}_0x4ae20f['stop']();if(_0x46fc2a[_0x5eb8d8(0xf6)]>0x0){console['log'](),console['log'](a5_0xdc0274[_0x5eb8d8(0x104)](_0x5eb8d8(0xae)));const {projectId:_0x5898a7,agentId:_0x462098}=_0x37008e[_0x5eb8d8(0x98)];for(const _0x5892a1 of _0x46fc2a){console['log']('Running:\x20'+a5_0xdc0274[_0x5eb8d8(0xd6)](_0x5892a1['name']));const _0x44333b=createCommandSpinner(_0x5eb8d8(0xd3)+_0x5892a1[_0x5eb8d8(0xea)][_0x5eb8d8(0xf6)]+':\x20Sending\x20user\x20input...');_0x44333b[_0x5eb8d8(0x111)]();try{const {result:_0x19ad13}=await runTest(_0x2398a9['llm'],_0x5892a1,{'agentId':_0x462098,'projectId':_0x5898a7,'site':_0x37008e[_0x5eb8d8(0x101)],'noEval':![],'evaluatorId':_0x1cc551,'onRoundStart':(_0x5481bc,_0x5b0563)=>{const _0x1c33fb=_0x5eb8d8;_0x44333b['text']='Round\x20'+(_0x5481bc+0x1)+'/'+_0x5b0563+_0x1c33fb(0x7e);},'onRoundComplete':(_0x54529d,_0x303a9f,_0x397f0d)=>{const _0x254918=_0x5eb8d8,_0x33b918=formatElapsed(_0x303a9f);_0x397f0d?console[_0x254918(0xc3)](_0x254918(0x110)+(_0x54529d+0x1)+'/'+_0x5892a1[_0x254918(0xea)]['length']+_0x254918(0x89)+a5_0xdc0274[_0x254918(0x8a)]('✓')+'\x20('+_0x33b918+')'):console[_0x254918(0xc3)]('\x20\x20Round\x20'+(_0x54529d+0x1)+'/'+_0x5892a1[_0x254918(0xea)][_0x254918(0xf6)]+_0x254918(0x89)+a5_0xdc0274['red']('✗'));},'onEvaluationStart':()=>{const _0x5c0e60=_0x5eb8d8;_0x44333b[_0x5c0e60(0x113)]=_0x5c0e60(0xa6);},'onEvaluationComplete':_0x1b08c8=>{const _0x3d0037=_0x5eb8d8,_0xe8690=formatElapsed(_0x1b08c8);console['log'](_0x3d0037(0xf0)+a5_0xdc0274[_0x3d0037(0x8a)]('✓')+'\x20('+_0xe8690+')');}});_0x44333b[_0x5eb8d8(0x97)](),_0x2e0d78[_0x5eb8d8(0xe8)](_0x19ad13);if(_0x19ad13[_0x5eb8d8(0xb7)]===_0x5eb8d8(0x87))console['log'](a5_0xdc0274[_0x5eb8d8(0x8a)]('✓\x20PASS:\x20'+_0x19ad13[_0x5eb8d8(0xee)])+a5_0xdc0274[_0x5eb8d8(0x8f)](_0x5eb8d8(0x10c)));else _0x19ad13[_0x5eb8d8(0xb7)]==='FAIL'?console[_0x5eb8d8(0xc3)](a5_0xdc0274[_0x5eb8d8(0x7d)](_0x5eb8d8(0x8b)+_0x19ad13[_0x5eb8d8(0xee)])+a5_0xdc0274[_0x5eb8d8(0x8f)]('\x20(new)')):console['log'](a5_0xdc0274[_0x5eb8d8(0x7d)](_0x5eb8d8(0xab)+_0x19ad13[_0x5eb8d8(0xee)]));_0x19ad13[_0x5eb8d8(0xa2)]&&console[_0x5eb8d8(0xc3)](a5_0xdc0274['dim']('\x20\x20Conversation:\x20'+_0x19ad13[_0x5eb8d8(0xa2)]));}catch(_0x350dad){_0x44333b[_0x5eb8d8(0x97)]();const _0x597ee9=_0x350dad instanceof Error?_0x350dad[_0x5eb8d8(0xe1)]:String(_0x350dad);console['log'](a5_0xdc0274[_0x5eb8d8(0x7d)](_0x5eb8d8(0xab)+_0x597ee9)),_0x2e0d78[_0x5eb8d8(0xe8)]({'name':_0x5892a1['name'],'status':_0x5eb8d8(0xa4),'reason':_0x597ee9,'timestamp':new Date()[_0x5eb8d8(0xb8)](),'duration_ms':0x0});}}}console[_0x5eb8d8(0xc3)]();const _0x254265=Date[_0x5eb8d8(0x80)]()-_0x57dd83,_0x4f62d3=_0x2e0d78[_0x5eb8d8(0xd7)](_0x24b661=>_0x24b661[_0x5eb8d8(0xb7)]===_0x5eb8d8(0x87))[_0x5eb8d8(0xf6)],_0x381cd3=_0x2e0d78['filter'](_0x525298=>_0x525298['status']===_0x5eb8d8(0xcb))['length'],_0x5a713a=_0x2e0d78[_0x5eb8d8(0xd7)](_0xdf7485=>_0xdf7485[_0x5eb8d8(0xb7)]==='ERROR')['length'];console[_0x5eb8d8(0xc3)]('━'[_0x5eb8d8(0xec)](0x3c)),console[_0x5eb8d8(0xc3)](_0x5eb8d8(0x100)),console['log']('━'[_0x5eb8d8(0xec)](0x3c)),console['log'](_0x5eb8d8(0xb2)+_0x2e0d78['length']),console[_0x5eb8d8(0xc3)](_0x5eb8d8(0xf5)+a5_0xdc0274[_0x5eb8d8(0x8a)](_0x4f62d3)),console['log'](_0x5eb8d8(0x115)+a5_0xdc0274[_0x5eb8d8(0x7d)](_0x381cd3));_0x5a713a>0x0&&console['log']('Errors:\x20\x20\x20'+a5_0xdc0274[_0x5eb8d8(0x7d)](_0x5a713a));console[_0x5eb8d8(0xc3)]('Duration:\x20'+formatElapsed(_0x254265)),console[_0x5eb8d8(0xc3)]('━'[_0x5eb8d8(0xec)](0x3c));const _0x5862e9={'summary':{'total':_0x2e0d78[_0x5eb8d8(0xf6)],'passed':_0x4f62d3,'failed':_0x381cd3,'errors':_0x5a713a>0x0?_0x5a713a:undefined,'duration_ms':_0x254265},'tests':_0x2e0d78,'agent':{'project':_0x23abbc[_0x5eb8d8(0x108)],'name':_0x23abbc['agentName'],'site':_0x7c8bc3},'timestamp':new Date(_0x57dd83)[_0x5eb8d8(0xb8)]()};if(_0x4c0b09!=='table'||_0x35c144){const _0x14b866=formatResults(_0x5862e9,_0x4c0b09);if(_0x35c144)try{a5_0x35afb0[_0x5eb8d8(0xa9)](_0x35c144,_0x14b866,'utf-8'),console[_0x5eb8d8(0xc3)](),console[_0x5eb8d8(0xc3)](a5_0xdc0274[_0x5eb8d8(0x8f)](_0x5eb8d8(0xed)+_0x35c144));}catch(_0x2041cf){return console[_0x5eb8d8(0xc3)](),console[_0x5eb8d8(0xc3)](a5_0xdc0274[_0x5eb8d8(0x7d)](_0x5eb8d8(0xaf)+_0x2041cf)),0x1;}else console['log'](),console[_0x5eb8d8(0xc3)](_0x14b866);}const _0xa8bf2f=_0x2e0d78[_0x5eb8d8(0xd7)](_0x7a4a6a=>_0x7a4a6a[_0x5eb8d8(0xb7)]!==_0x5eb8d8(0x87));return _0xa8bf2f[_0x5eb8d8(0xf6)]>0x0?0x1:0x0;}}
@@ -1 +1 @@
1
- const a6_0xa5ef=a6_0x2a2a;(function(_0x460bdc,_0x36ad42){const _0x323307=a6_0x2a2a,_0xf9794d=_0x460bdc();while(!![]){try{const _0x22da15=parseInt(_0x323307(0x208))/0x1*(-parseInt(_0x323307(0x207))/0x2)+parseInt(_0x323307(0x221))/0x3*(-parseInt(_0x323307(0x1fd))/0x4)+parseInt(_0x323307(0x216))/0x5+parseInt(_0x323307(0x1e2))/0x6+-parseInt(_0x323307(0x205))/0x7+-parseInt(_0x323307(0x202))/0x8+parseInt(_0x323307(0x1e9))/0x9;if(_0x22da15===_0x36ad42)break;else _0xf9794d['push'](_0xf9794d['shift']());}catch(_0x23b7e5){_0xf9794d['push'](_0xf9794d['shift']());}}}(a6_0x1a45,0x3e132));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';function a6_0x1a45(){const _0xf20428=['readBodyFromFile','body','7374627npOQxg','Invalid\x20HTTP\x20method:\x20','authorization','Results\x20saved\x20to\x20','trino','header','name','site','length','x-xsrf-token','GET','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','\x22.\x20','substring','entries','x-trino-user','error','set-cookie2','x-auth-token','Invalid\x20header\x20format:\x20\x22','1833112gXwjuW','keys','toLowerCase','llm','proxy-authorization','1570704uwJgSm','method','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','70462RNMLUH','includes','2AwKqSX','65171sfnxuZ','startsWith','stack','file','color','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','validate','\x0aStack\x20trace:\x0a','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','headers','type','data','workflow','PATCH','222205zdGmQF','message','join','llm-proxy','trim','cdp','Error:\x20','execute','noColor','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','verbose','3GxiSYA','PUT','status','indexOf','POST','721602XfBNmj','request','Invalid\x20API\x20type:\x20','DELETE','.\x20Valid\x20methods:\x20'];a6_0x1a45=function(){return _0xf20428;};return a6_0x1a45();}import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';function a6_0x2a2a(_0x2baa8b,_0x2e9cd8){_0x2baa8b=_0x2baa8b-0x1de;const _0x1a4553=a6_0x1a45();let _0x2a2aa6=_0x1a4553[_0x2baa8b];return _0x2a2aa6;}const SENSITIVE_HEADERS=new Set([a6_0xa5ef(0x1eb),a6_0xa5ef(0x201),'cookie','set-cookie',a6_0xa5ef(0x1fa),a6_0xa5ef(0x1f2),a6_0xa5ef(0x1fb),a6_0xa5ef(0x1f8)]);function isSensitiveHeader(_0xa5be0a){const _0x4f32b2=a6_0xa5ef;return SENSITIVE_HEADERS['has'](_0xa5be0a[_0x4f32b2(0x1ff)]());}function parseHeader(_0x3e91ce){const _0x3f7221=a6_0xa5ef,_0x4e5969=_0x3e91ce[_0x3f7221(0x1e0)](':');if(_0x4e5969===-0x1)throw new Error(_0x3f7221(0x1fc)+_0x3e91ce+_0x3f7221(0x1f5)+_0x3f7221(0x21f));const _0x11e537=_0x3e91ce[_0x3f7221(0x1f6)](0x0,_0x4e5969)[_0x3f7221(0x21a)](),_0x52b6f4=_0x3e91ce[_0x3f7221(0x1f6)](_0x4e5969+0x1)['trim']();if(!_0x11e537)throw new Error(_0x3f7221(0x204)+_0x3e91ce+'\x22');return[_0x11e537,_0x52b6f4];}export class ApiCommand extends BaseCommand{[a6_0xa5ef(0x1ef)]='api';['description']=a6_0xa5ef(0x210);[a6_0xa5ef(0x20e)](_0x5e8ecc){const _0x2aa4ca=a6_0xa5ef,{args:_0x19b695,options:_0x556e0b}=_0x5e8ecc,_0x16ace5=_0x556e0b;if(_0x19b695[_0x2aa4ca(0x1f1)]===0x0)return _0x2aa4ca(0x20d);const _0x1dfe61=_0x19b695[0x0];if(!_0x1dfe61[_0x2aa4ca(0x209)]('/'))return'Endpoint\x20must\x20start\x20with\x20/:\x20'+_0x1dfe61;const _0x8ec23e=_0x16ace5['data'],_0x239bbe=_0x16ace5[_0x2aa4ca(0x20b)];if(_0x8ec23e&&_0x239bbe)return _0x2aa4ca(0x1f4);const _0x20c2a7=_0x16ace5[_0x2aa4ca(0x203)]||_0x2aa4ca(0x1f3),_0x549d44=[_0x2aa4ca(0x1f3),_0x2aa4ca(0x1e1),_0x2aa4ca(0x1de),_0x2aa4ca(0x1e5),_0x2aa4ca(0x215)];if(!_0x549d44[_0x2aa4ca(0x206)](_0x20c2a7['toUpperCase']()))return _0x2aa4ca(0x1ea)+_0x20c2a7+_0x2aa4ca(0x1e6)+_0x549d44['join'](',\x20');const _0x59626c=_0x16ace5[_0x2aa4ca(0x212)]||'td',_0x70d95=['td',_0x2aa4ca(0x21b),_0x2aa4ca(0x214),_0x2aa4ca(0x1ed),_0x2aa4ca(0x200),_0x2aa4ca(0x219)];if(!_0x70d95[_0x2aa4ca(0x206)](_0x59626c))return _0x2aa4ca(0x1e4)+_0x59626c+'.\x20Valid\x20types:\x20'+_0x70d95[_0x2aa4ca(0x218)](',\x20');return undefined;}async[a6_0xa5ef(0x21d)](_0x1da988){const _0x1816d7=a6_0xa5ef,{options:_0x235f11,args:_0x2fee56,tdx:_0x4e5350}=_0x1da988,_0x523fc7=_0x235f11,_0x5971a7=_0x2fee56[0x0],_0x58440c=(_0x523fc7['method']||_0x1816d7(0x1f3))['toUpperCase'](),_0x2076ed=_0x523fc7[_0x1816d7(0x213)],_0xd42790=_0x523fc7[_0x1816d7(0x20b)],_0x282699=_0x523fc7[_0x1816d7(0x1ee)],_0x50ea7a=_0x523fc7[_0x1816d7(0x212)]||'td';try{const _0x56e74d={};if(_0x282699){const _0x289aea=Array['isArray'](_0x282699)?_0x282699:[_0x282699];for(const _0x4a7cef of _0x289aea){const [_0x191c08,_0x31c3ce]=parseHeader(_0x4a7cef);_0x56e74d[_0x191c08]=_0x31c3ce;}}let _0xdca2e5;if(_0x2076ed)_0xdca2e5=_0x2076ed;else{if(_0xd42790)try{_0xdca2e5=RawAPI[_0x1816d7(0x1e7)](_0xd42790);}catch(_0x10d947){return console[_0x1816d7(0x1f9)](_0x1816d7(0x21c)+(_0x10d947 instanceof Error?_0x10d947[_0x1816d7(0x217)]:String(_0x10d947))),0x1;}}const _0x51e4c7={'method':_0x58440c,'apiType':_0x50ea7a,'includeHeaders':_0x235f11[_0x1816d7(0x220)]};_0xdca2e5&&(_0x51e4c7[_0x1816d7(0x1e8)]=_0xdca2e5);Object[_0x1816d7(0x1fe)](_0x56e74d)[_0x1816d7(0x1f1)]>0x0&&(_0x51e4c7['headers']=_0x56e74d);if(_0x235f11[_0x1816d7(0x220)]){const _0x5ef58c=resolveSite(_0x235f11[_0x1816d7(0x1f0)]),_0x153ca5=getEndpoint(_0x5ef58c,_0x50ea7a),_0x580106=''+_0x153ca5+_0x5971a7;console['error']('>\x20'+_0x58440c+'\x20'+_0x580106);const _0x48e5f3=getAuthHeaders(_0x5ef58c),_0xe11c68={..._0x48e5f3,..._0x56e74d};for(const [_0x5d9e37,_0x5d0679]of Object[_0x1816d7(0x1f7)](_0xe11c68)){!isSensitiveHeader(_0x5d9e37)&&console['error']('>\x20'+_0x5d9e37+':\x20'+_0x5d0679);}_0xdca2e5&&console[_0x1816d7(0x1f9)]('>'),console[_0x1816d7(0x1f9)]('');}const _0x9be13=await _0x4e5350['api'][_0x1816d7(0x1e3)](_0x5971a7,_0x51e4c7);if(_0x235f11[_0x1816d7(0x220)]&&_0x9be13['headers']){console[_0x1816d7(0x1f9)]('<\x20HTTP/1.1\x20'+_0x9be13[_0x1816d7(0x1df)]);for(const [_0x359eff,_0x24566b]of Object[_0x1816d7(0x1f7)](_0x9be13[_0x1816d7(0x211)])){!isSensitiveHeader(_0x359eff)&&console[_0x1816d7(0x1f9)]('<\x20'+_0x359eff+':\x20'+_0x24566b);}console['error']('');}const _0x37aa03=Boolean(_0x235f11['output']),_0x1a2699={'color':_0x235f11[_0x1816d7(0x20c)],'noColor':_0x235f11[_0x1816d7(0x21e)]||_0x37aa03&&!_0x235f11[_0x1816d7(0x20c)]},_0x2ab456=colorizeJSON(_0x9be13[_0x1816d7(0x213)],_0x1a2699);return _0x235f11['output']?(writeFileSync(_0x235f11['output'],_0x2ab456),console[_0x1816d7(0x1f9)](_0x1816d7(0x1ec)+_0x235f11['output'])):console['log'](_0x2ab456),0x0;}catch(_0x2d94a8){return _0x2d94a8 instanceof Error?(console[_0x1816d7(0x1f9)](_0x1816d7(0x21c)+_0x2d94a8[_0x1816d7(0x217)]),_0x235f11[_0x1816d7(0x220)]&&_0x2d94a8[_0x1816d7(0x20a)]&&console['error'](_0x1816d7(0x20f)+_0x2d94a8[_0x1816d7(0x20a)])):console['error'](_0x1816d7(0x21c)+String(_0x2d94a8)),0x1;}}}
1
+ const a6_0x14f6ab=a6_0x2171;(function(_0x2d2d52,_0x329331){const _0x1d233a=a6_0x2171,_0x54265f=_0x2d2d52();while(!![]){try{const _0x243423=parseInt(_0x1d233a(0x1c9))/0x1*(parseInt(_0x1d233a(0x1e9))/0x2)+-parseInt(_0x1d233a(0x1ca))/0x3*(parseInt(_0x1d233a(0x1d8))/0x4)+-parseInt(_0x1d233a(0x1c1))/0x5*(parseInt(_0x1d233a(0x1f7))/0x6)+parseInt(_0x1d233a(0x1be))/0x7*(-parseInt(_0x1d233a(0x1bf))/0x8)+-parseInt(_0x1d233a(0x1e6))/0x9+parseInt(_0x1d233a(0x1f9))/0xa*(-parseInt(_0x1d233a(0x1ef))/0xb)+-parseInt(_0x1d233a(0x1e4))/0xc*(-parseInt(_0x1d233a(0x1d5))/0xd);if(_0x243423===_0x329331)break;else _0x54265f['push'](_0x54265f['shift']());}catch(_0x46f25c){_0x54265f['push'](_0x54265f['shift']());}}}(a6_0x3c28,0xc2b12));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';function a6_0x2171(_0x1ddd1a,_0x1b73d1){_0x1ddd1a=_0x1ddd1a-0x1bc;const _0x3c287e=a6_0x3c28();let _0x2171b8=_0x3c287e[_0x1ddd1a];return _0x2171b8;}import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';function a6_0x3c28(){const _0x26b55a=['GET','method','POST','set-cookie','\x22.\x20','stack','entries','join','trim','workflow','36cIsYUA','substring','12385152UuMpvN','PATCH','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','292aoNxPA','name','type','Invalid\x20API\x20type:\x20','message','PUT','6997859yrVxWP','cookie','Endpoint\x20must\x20start\x20with\x20/:\x20','keys','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','cdp','proxy-authorization','file','1926636bFqdGk','.\x20Valid\x20methods:\x20','10SzvOZe','authorization','has','verbose','data','headers','validate','1911343KvjGwy','16lmuvco','description','5MFvxsd','indexOf','length','isArray','Invalid\x20HTTP\x20method:\x20','includes','log','output','9959FRPtyk','4182slVjzC','Error:\x20','x-xsrf-token','x-auth-token','api','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','color','request','llm-proxy','status','error','11946337fWTlmX','\x0aStack\x20trace:\x0a','header','1532gICYSc','DELETE'];a6_0x3c28=function(){return _0x26b55a;};return a6_0x3c28();}import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a6_0x14f6ab(0x1fa),a6_0x14f6ab(0x1f5),a6_0x14f6ab(0x1f0),a6_0x14f6ab(0x1dd),'set-cookie2',a6_0x14f6ab(0x1cc),a6_0x14f6ab(0x1cd),'x-trino-user']);function isSensitiveHeader(_0x3a7382){const _0x5318bc=a6_0x14f6ab;return SENSITIVE_HEADERS[_0x5318bc(0x1fb)](_0x3a7382['toLowerCase']());}function parseHeader(_0x425ed7){const _0xe699df=a6_0x14f6ab,_0x5f1972=_0x425ed7[_0xe699df(0x1c2)](':');if(_0x5f1972===-0x1)throw new Error('Invalid\x20header\x20format:\x20\x22'+_0x425ed7+_0xe699df(0x1de)+_0xe699df(0x1e8));const _0x5c5443=_0x425ed7[_0xe699df(0x1e5)](0x0,_0x5f1972)[_0xe699df(0x1e2)](),_0x3920=_0x425ed7[_0xe699df(0x1e5)](_0x5f1972+0x1)['trim']();if(!_0x5c5443)throw new Error(_0xe699df(0x1cf)+_0x425ed7+'\x22');return[_0x5c5443,_0x3920];}export class ApiCommand extends BaseCommand{[a6_0x14f6ab(0x1ea)]=a6_0x14f6ab(0x1ce);[a6_0x14f6ab(0x1c0)]=a6_0x14f6ab(0x1f3);[a6_0x14f6ab(0x1bd)](_0x58fba3){const _0x226abc=a6_0x14f6ab,{args:_0xdd567,options:_0x48df5b}=_0x58fba3,_0x483da7=_0x48df5b;if(_0xdd567[_0x226abc(0x1c3)]===0x0)return'Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list';const _0x35f0e9=_0xdd567[0x0];if(!_0x35f0e9['startsWith']('/'))return _0x226abc(0x1f1)+_0x35f0e9;const _0x579f51=_0x483da7[_0x226abc(0x1fd)],_0x1f1f02=_0x483da7[_0x226abc(0x1f6)];if(_0x579f51&&_0x1f1f02)return'Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.';const _0x169ec5=_0x483da7[_0x226abc(0x1db)]||_0x226abc(0x1da),_0xb7e899=[_0x226abc(0x1da),_0x226abc(0x1dc),_0x226abc(0x1ee),_0x226abc(0x1d9),_0x226abc(0x1e7)];if(!_0xb7e899[_0x226abc(0x1c6)](_0x169ec5['toUpperCase']()))return _0x226abc(0x1c5)+_0x169ec5+_0x226abc(0x1f8)+_0xb7e899[_0x226abc(0x1e1)](',\x20');const _0xa11364=_0x483da7[_0x226abc(0x1eb)]||'td',_0x360d40=['td',_0x226abc(0x1f4),_0x226abc(0x1e3),'trino','llm',_0x226abc(0x1d2)];if(!_0x360d40[_0x226abc(0x1c6)](_0xa11364))return _0x226abc(0x1ec)+_0xa11364+'.\x20Valid\x20types:\x20'+_0x360d40['join'](',\x20');return undefined;}async['execute'](_0x52dcba){const _0x5c5bf2=a6_0x14f6ab,{options:_0x22e707,args:_0x5e0cc8,tdx:_0xec6e16}=_0x52dcba,_0x4a905e=_0x22e707,_0x220481=_0x5e0cc8[0x0],_0x4dfee1=(_0x4a905e[_0x5c5bf2(0x1db)]||'GET')['toUpperCase'](),_0x509b20=_0x4a905e['data'],_0x1c9a84=_0x4a905e['file'],_0x4b9025=_0x4a905e[_0x5c5bf2(0x1d7)],_0x3392f9=_0x4a905e[_0x5c5bf2(0x1eb)]||'td';try{const _0x472f7e={};if(_0x4b9025){const _0x45fae8=Array[_0x5c5bf2(0x1c4)](_0x4b9025)?_0x4b9025:[_0x4b9025];for(const _0x3faaed of _0x45fae8){const [_0x49232a,_0xf04a1a]=parseHeader(_0x3faaed);_0x472f7e[_0x49232a]=_0xf04a1a;}}let _0x5d834f;if(_0x509b20)_0x5d834f=_0x509b20;else{if(_0x1c9a84)try{_0x5d834f=RawAPI['readBodyFromFile'](_0x1c9a84);}catch(_0xc845cd){return console[_0x5c5bf2(0x1d4)](_0x5c5bf2(0x1cb)+(_0xc845cd instanceof Error?_0xc845cd[_0x5c5bf2(0x1ed)]:String(_0xc845cd))),0x1;}}const _0x1ac7bf={'method':_0x4dfee1,'apiType':_0x3392f9,'includeHeaders':_0x22e707['verbose']};_0x5d834f&&(_0x1ac7bf['body']=_0x5d834f);Object[_0x5c5bf2(0x1f2)](_0x472f7e)['length']>0x0&&(_0x1ac7bf[_0x5c5bf2(0x1bc)]=_0x472f7e);if(_0x22e707['verbose']){const _0x3f9bba=resolveSite(_0x22e707['site']),_0x5ce3f3=getEndpoint(_0x3f9bba,_0x3392f9),_0x248e80=''+_0x5ce3f3+_0x220481;console[_0x5c5bf2(0x1d4)]('>\x20'+_0x4dfee1+'\x20'+_0x248e80);const _0x480aea=getAuthHeaders(_0x3f9bba),_0x39505a={..._0x480aea,..._0x472f7e};for(const [_0x3df141,_0x3fe07a]of Object[_0x5c5bf2(0x1e0)](_0x39505a)){!isSensitiveHeader(_0x3df141)&&console['error']('>\x20'+_0x3df141+':\x20'+_0x3fe07a);}_0x5d834f&&console[_0x5c5bf2(0x1d4)]('>'),console[_0x5c5bf2(0x1d4)]('');}const _0xaf9d8c=await _0xec6e16[_0x5c5bf2(0x1ce)][_0x5c5bf2(0x1d1)](_0x220481,_0x1ac7bf);if(_0x22e707[_0x5c5bf2(0x1fc)]&&_0xaf9d8c['headers']){console[_0x5c5bf2(0x1d4)]('<\x20HTTP/1.1\x20'+_0xaf9d8c[_0x5c5bf2(0x1d3)]);for(const [_0x2e96a6,_0x14b299]of Object[_0x5c5bf2(0x1e0)](_0xaf9d8c['headers'])){!isSensitiveHeader(_0x2e96a6)&&console['error']('<\x20'+_0x2e96a6+':\x20'+_0x14b299);}console[_0x5c5bf2(0x1d4)]('');}const _0x5dc4d1=Boolean(_0x22e707[_0x5c5bf2(0x1c8)]),_0x5c3bf0={'color':_0x22e707[_0x5c5bf2(0x1d0)],'noColor':_0x22e707['noColor']||_0x5dc4d1&&!_0x22e707[_0x5c5bf2(0x1d0)]},_0x3dfe52=colorizeJSON(_0xaf9d8c['data'],_0x5c3bf0);return _0x22e707[_0x5c5bf2(0x1c8)]?(writeFileSync(_0x22e707[_0x5c5bf2(0x1c8)],_0x3dfe52),console[_0x5c5bf2(0x1d4)]('Results\x20saved\x20to\x20'+_0x22e707['output'])):console[_0x5c5bf2(0x1c7)](_0x3dfe52),0x0;}catch(_0x56590e){return _0x56590e instanceof Error?(console[_0x5c5bf2(0x1d4)](_0x5c5bf2(0x1cb)+_0x56590e[_0x5c5bf2(0x1ed)]),_0x22e707['verbose']&&_0x56590e['stack']&&console[_0x5c5bf2(0x1d4)](_0x5c5bf2(0x1d6)+_0x56590e[_0x5c5bf2(0x1df)])):console['error'](_0x5c5bf2(0x1cb)+String(_0x56590e)),0x1;}}}
@@ -1 +1 @@
1
- const a7_0xd1af96=a7_0x5b2e;(function(_0x8a19e5,_0x1bfe1f){const _0x4dafd0=a7_0x5b2e,_0xf04aff=_0x8a19e5();while(!![]){try{const _0x385688=parseInt(_0x4dafd0(0x1e3))/0x1+parseInt(_0x4dafd0(0x1ee))/0x2+parseInt(_0x4dafd0(0x1e6))/0x3*(parseInt(_0x4dafd0(0x1dd))/0x4)+-parseInt(_0x4dafd0(0x1da))/0x5+-parseInt(_0x4dafd0(0x200))/0x6*(parseInt(_0x4dafd0(0x1db))/0x7)+parseInt(_0x4dafd0(0x202))/0x8+parseInt(_0x4dafd0(0x1eb))/0x9*(-parseInt(_0x4dafd0(0x1e8))/0xa);if(_0x385688===_0x1bfe1f)break;else _0xf04aff['push'](_0xf04aff['shift']());}catch(_0x548ba5){_0xf04aff['push'](_0xf04aff['shift']());}}}(a7_0x1241,0xe4f55));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens}from'../core/oauth-keychain.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';function a7_0x1241(){const _0x215d29=['2900875sPpDlG','217WlcIQn','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','4axpOZS','warn','trim','✓\x20Profile\x20\x27','method','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','85985yTfBsY','auth','No\x20credential\x20found','592485jHACxu','description','362130avwEmz','Read\x20credential\x20from\x20','Validating\x20API\x20key...','405eHVGHu','N/A','Remove\x20API\x20key\x20from\x20system\x20keychain','2491864ckFMHO','/app/mp/ak','jobs','last_name','\x20\x20tdx','yellow','Enter\x20your\x20TD\x20API\x20key:','ERROR','password','tdx:\x20auth\x20clear','Name:\x20','error','\x20--profile\x20','Read\x20credential\x20from\x20keychain','site','message','Setup\x20cancelled','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','15546wPBrCB','bold','13587856mkJoNo','\x20removed\x20from\x20keychain','log','profile','red','No\x20credentials\x20found\x20in\x20keychain','join','green','User:\x20','\x20(site:\x20','API\x20key\x20cannot\x20be\x20empty','Credential\x20type:\x20OAuth','\x20and\x20','status','\x27\x20registered','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','filter','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','✗\x20Validation\x20failed:\x20','logLevel','\x20(profile:\x20','tdx:\x20auth\x20setup','System\x20keychain\x20is\x20not\x20available','Setting\x20up\x20authentication\x20for\x20site:\x20','create','first_name','execute','You\x20can\x20find\x20your\x20API\x20key\x20at:','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','✓\x20Authentication\x20successful\x0a','getUserInfo','select','API\x20key','oauth','all','\x0aSetup\x20cancelled','auth:setup','apiKey','Choose\x20authentication\x20method:','OAuth\x20tokens'];a7_0x1241=function(){return _0x215d29;};return a7_0x1241();}import{deleteOAuthTokens}from'../core/oauth-keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';function a7_0x5b2e(_0x2bdfcc,_0x2f04e8){_0x2bdfcc=_0x2bdfcc-0x1bb;const _0x1241ca=a7_0x1241();let _0x5b2e30=_0x1241ca[_0x2bdfcc];return _0x5b2e30;}import{isOAuthSupported}from'../core/oauth.js';import{runOAuthLoginFlow}from'./auth-login-command.js';import{promptSiteSelection}from'../core/constants.js';import a7_0x502421 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_0x5bcbdc from'chalk';export class AuthSetupCommand extends BaseCommand{['name']=a7_0xd1af96(0x1d6);[a7_0xd1af96(0x1e7)]='Setup\x20API\x20key\x20authentication\x20interactively';async[a7_0xd1af96(0x1cc)](_0x168c37){const _0xd7ee5=a7_0xd1af96,{options:_0x1d56b7}=_0x168c37,_0xe06745=_0x1d56b7['profile'];console[_0xd7ee5(0x204)](a7_0x5bcbdc[_0xd7ee5(0x201)](_0xd7ee5(0x1c7)));const _0x396c1f=_0x1d56b7[_0xd7ee5(0x1fc)]||'us01',_0x127a6b=await promptSiteSelection(_0x396c1f,_0xe06745,_0xd7ee5(0x1fe));if(!_0x127a6b)return 0x1;const _0x255dc8=resolveSite(_0x127a6b);if(isOAuthSupported(_0x255dc8)){const _0x31f913=await a7_0x502421({'type':_0xd7ee5(0x1d1),'name':_0xd7ee5(0x1e1),'message':_0xd7ee5(0x1d8),'choices':[{'title':'OAuth\x20(browser\x20login)','value':_0xd7ee5(0x1d3)},{'title':'API\x20Key','value':'apikey'}]});if(!_0x31f913['method'])return console[_0xd7ee5(0x204)](_0xd7ee5(0x1d5)),0x1;if(_0x31f913[_0xd7ee5(0x1e1)]===_0xd7ee5(0x1d3))return await runOAuthLoginFlow(_0x255dc8,_0xe06745,_0x1d56b7[_0xd7ee5(0x1c5)]??LogLevel['ERROR']),0x0;}console[_0xd7ee5(0x204)](_0xd7ee5(0x1c9)+_0x255dc8),console[_0xd7ee5(0x204)](_0xd7ee5(0x1cd)),console['log']('\x20\x20'+getConsoleUrl(_0x255dc8,_0xd7ee5(0x1ef)));const _0x5b7af7=await a7_0x502421({'type':_0xd7ee5(0x1f6),'name':'apiKey','message':_0xd7ee5(0x1f4),'validate':_0x4e2eb7=>{const _0x1aa5dd=_0xd7ee5;if(!_0x4e2eb7||!_0x4e2eb7[_0x1aa5dd(0x1df)]())return _0x1aa5dd(0x1bc);return!![];}});if(!_0x5b7af7[_0xd7ee5(0x1d7)])return console['log'](_0xd7ee5(0x1d5)),0x1;const _0x4d0a2f=_0x5b7af7[_0xd7ee5(0x1d7)];console[_0xd7ee5(0x204)](_0xd7ee5(0x1ea));try{const _0xdc262f=TDX[_0xd7ee5(0x1ca)]({'site':_0x255dc8,'apiKey':_0x4d0a2f['trim'](),'logLevel':_0x1d56b7[_0xd7ee5(0x1c5)]??LogLevel[_0xd7ee5(0x1f5)]}),_0x52da7a=await _0xdc262f['jobs']['getUserInfo']();console['log'](_0xd7ee5(0x1c3)+_0x52da7a['email']+')');const _0x4bd28d=await isKeychainAvailable();_0x4bd28d?(await saveAPIKeyAsync(_0x4d0a2f[_0xd7ee5(0x1df)](),_0x255dc8,_0xe06745),console[_0xd7ee5(0x204)](_0xd7ee5(0x1ce)+(_0xe06745?_0xd7ee5(0x1c6)+_0xe06745+')':''))):(console[_0xd7ee5(0x1de)](a7_0x5bcbdc['yellow']('⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.')),console[_0xd7ee5(0x1de)](a7_0x5bcbdc[_0xd7ee5(0x1f3)](_0xd7ee5(0x1dc))));if(_0xe06745){const _0x50476e={'site':_0x255dc8};saveProfileToUserConfig(_0xe06745,_0x50476e),console['log'](_0xd7ee5(0x1e0)+_0xe06745+_0xd7ee5(0x1c0));}else saveDefaultSiteToUserConfig(_0x255dc8),console[_0xd7ee5(0x204)]('✓\x20Default\x20site\x20set\x20to\x20'+_0x255dc8);const _0x2f18b2=_0xe06745?_0xd7ee5(0x1fa)+_0xe06745:'';return console['log'](),console['log'](_0xd7ee5(0x1e2)),console[_0xd7ee5(0x204)](_0xd7ee5(0x1f2)+_0x2f18b2+_0xd7ee5(0x1c1)),console[_0xd7ee5(0x204)](_0xd7ee5(0x1f2)+_0x2f18b2+_0xd7ee5(0x1ff)),0x0;}catch(_0x14585d){if(_0x14585d instanceof HTTPClientError&&_0x14585d[_0xd7ee5(0x1bf)]===0x191)return printAuthError(_0x14585d),0x1;return console['error'](a7_0x5bcbdc[_0xd7ee5(0x206)]('✗\x20Validation\x20failed:\x20'+(_0x14585d instanceof Error?_0x14585d[_0xd7ee5(0x1fd)]:String(_0x14585d)))),console[_0xd7ee5(0x1f9)]('API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.'),0x1;}}}export class AuthStatusCommand extends BaseCommand{['name']=a7_0xd1af96(0x1e4);[a7_0xd1af96(0x1e7)]='Show\x20authentication\x20status\x20and\x20validate\x20API\x20key';async[a7_0xd1af96(0x1cc)](_0x1c17f7){const _0x28e4eb=a7_0xd1af96,{options:_0x35ff4e,tdx:_0x5b5004}=_0x1c17f7,_0x2d98ec=_0x35ff4e['site'],_0x502adb=_0x35ff4e[_0x28e4eb(0x205)],_0xb5acb8=_0x502adb?_0x502adb:_0x28e4eb(0x1ec);console[_0x28e4eb(0x204)]('tdx\x20profile:\x20'+_0xb5acb8+_0x28e4eb(0x1bb)+_0x2d98ec+')');const _0x144d1e=await getOAuthTokens(_0x502adb);if(_0x144d1e)console['log'](_0x28e4eb(0x1bd)),console['log'](_0x28e4eb(0x1fb)+(_0x502adb?'\x20(profile:\x20'+_0x502adb+')':''));else{const _0x1497bf=await resolveAPIKeyAsync(_0x2d98ec,_0x502adb);if(_0x1497bf){const {source:_0x45d29b,isDeprecated:_0x1bbc72}=_0x1497bf,_0x3beace=_0x28e4eb(0x1e9)+_0x45d29b;console[_0x28e4eb(0x204)](_0x1bbc72?a7_0x5bcbdc[_0x28e4eb(0x1f3)](_0x3beace):_0x3beace);}else console[_0x28e4eb(0x204)](a7_0x5bcbdc[_0x28e4eb(0x1f3)](_0x28e4eb(0x1e5)));}try{const _0x4142f4=await _0x5b5004[_0x28e4eb(0x1f0)][_0x28e4eb(0x1d0)]();return console[_0x28e4eb(0x204)](a7_0x5bcbdc[_0x28e4eb(0x209)](_0x28e4eb(0x1cf))),console[_0x28e4eb(0x204)](_0x28e4eb(0x20a)+_0x4142f4['email']),(_0x4142f4[_0x28e4eb(0x1cb)]||_0x4142f4[_0x28e4eb(0x1f1)])&&console['log'](_0x28e4eb(0x1f8)+[_0x4142f4[_0x28e4eb(0x1cb)],_0x4142f4[_0x28e4eb(0x1f1)]]['filter'](Boolean)[_0x28e4eb(0x208)]('\x20')),0x0;}catch(_0x5cf59d){return _0x5cf59d instanceof HTTPClientError&&_0x5cf59d[_0x28e4eb(0x1bf)]===0x191?printAuthError(_0x5cf59d,!![],_0x502adb):console['error'](a7_0x5bcbdc[_0x28e4eb(0x206)](_0x28e4eb(0x1c4)+(_0x5cf59d instanceof Error?_0x5cf59d['message']:String(_0x5cf59d)))),0x1;}}}export class AuthClearCommand extends BaseCommand{['name']='auth:clear';[a7_0xd1af96(0x1e7)]=a7_0xd1af96(0x1ed);async[a7_0xd1af96(0x1cc)](_0x365a7c){const _0x1d2db1=a7_0xd1af96,{options:_0x2963bf}=_0x365a7c,_0x32e865=_0x2963bf[_0x1d2db1(0x205)];console[_0x1d2db1(0x204)](a7_0x5bcbdc[_0x1d2db1(0x201)](_0x1d2db1(0x1f7)));const _0x17e30f=await isKeychainAvailable();if(!_0x17e30f)return console[_0x1d2db1(0x1f9)](a7_0x5bcbdc[_0x1d2db1(0x206)](_0x1d2db1(0x1c8))),0x1;const [_0x334a27,_0x4b376b]=await Promise[_0x1d2db1(0x1d4)]([deleteKeychainAPIKey(_0x32e865),deleteOAuthTokens(_0x32e865)]);if(_0x334a27||_0x4b376b){clearCredentialCache();const _0x3c6661=[_0x334a27&&_0x1d2db1(0x1d2),_0x4b376b&&_0x1d2db1(0x1d9)][_0x1d2db1(0x1c2)](Boolean)[_0x1d2db1(0x208)](_0x1d2db1(0x1be));return console[_0x1d2db1(0x204)]('✓\x20'+_0x3c6661+_0x1d2db1(0x203)+(_0x32e865?_0x1d2db1(0x1c6)+_0x32e865+')':'')),0x0;}else return console[_0x1d2db1(0x204)](_0x1d2db1(0x207)+(_0x32e865?'\x20for\x20profile:\x20'+_0x32e865:'')),0x1;}}
1
+ const a7_0x317fae=a7_0x1169;(function(_0x53fcbd,_0x41b2a1){const _0x3ba0fc=a7_0x1169,_0x5075d1=_0x53fcbd();while(!![]){try{const _0x52c392=parseInt(_0x3ba0fc(0x215))/0x1+parseInt(_0x3ba0fc(0x1f0))/0x2+-parseInt(_0x3ba0fc(0x208))/0x3*(-parseInt(_0x3ba0fc(0x218))/0x4)+-parseInt(_0x3ba0fc(0x1e1))/0x5*(parseInt(_0x3ba0fc(0x21c))/0x6)+parseInt(_0x3ba0fc(0x1fe))/0x7*(-parseInt(_0x3ba0fc(0x21e))/0x8)+parseInt(_0x3ba0fc(0x210))/0x9*(-parseInt(_0x3ba0fc(0x20c))/0xa)+parseInt(_0x3ba0fc(0x1f9))/0xb;if(_0x52c392===_0x41b2a1)break;else _0x5075d1['push'](_0x5075d1['shift']());}catch(_0xf53562){_0x5075d1['push'](_0x5075d1['shift']());}}}(a7_0x5426,0xb0a5a));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens}from'../core/oauth-keychain.js';function a7_0x5426(){const _0xcd7bd8=['\x20--profile\x20','OAuth\x20(browser\x20login)','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','No\x20credential\x20found','name','apikey','✗\x20Validation\x20failed:\x20','auth','log','55LRzInV','\x20(site:\x20','ERROR','first_name','Choose\x20authentication\x20method:','password','yellow','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','trim','all','description','logLevel','jobs','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','1912694feVmpV','OAuth\x20tokens','\x20for\x20profile:\x20','auth:clear','\x27\x20registered','\x0aSetup\x20cancelled','User:\x20','✓\x20Profile\x20\x27','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','17423626IwpWXx','API\x20key\x20cannot\x20be\x20empty','us01','/app/mp/ak','execute','91vpdmXO','Setting\x20up\x20authentication\x20for\x20site:\x20','Setup\x20cancelled','join','tdx:\x20auth\x20clear','System\x20keychain\x20is\x20not\x20available','API\x20key','Read\x20credential\x20from\x20keychain','\x20\x20tdx','warn','31287RcSOuB','Read\x20credential\x20from\x20','profile','error','339550HvVGlz','last_name','oauth','tdx:\x20auth\x20setup','333KXRfWk','site','filter','select','Enter\x20your\x20TD\x20API\x20key:','844160MGjNUw','N/A','method','40uXOEUT','Validating\x20API\x20key...','red','apiKey','290244hKLLOr','\x20(profile:\x20','601088HyQZsh','tdx\x20profile:\x20','bold'];a7_0x5426=function(){return _0xcd7bd8;};return a7_0x5426();}import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';function a7_0x1169(_0x39a5d9,_0x4c7aff){_0x39a5d9=_0x39a5d9-0x1d8;const _0x5426a1=a7_0x5426();let _0x116957=_0x5426a1[_0x39a5d9];return _0x116957;}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_0x2abc05 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_0x52e211 from'chalk';export class AuthSetupCommand extends BaseCommand{[a7_0x317fae(0x1dc)]='auth:setup';[a7_0x317fae(0x1eb)]='Setup\x20API\x20key\x20authentication\x20interactively';async[a7_0x317fae(0x1fd)](_0x3cad50){const _0x223996=a7_0x317fae,{options:_0x4e6a87}=_0x3cad50,_0x969e7b=_0x4e6a87[_0x223996(0x20a)];console[_0x223996(0x1e0)](a7_0x52e211[_0x223996(0x220)](_0x223996(0x20f)));const _0x5621e3=_0x4e6a87[_0x223996(0x211)]||_0x223996(0x1fb),_0x4cfa76=await promptSiteSelection(_0x5621e3,_0x969e7b,_0x223996(0x200));if(!_0x4cfa76)return 0x1;const _0x402201=resolveSite(_0x4cfa76);if(isOAuthSupported(_0x402201)){const _0x11f482=await a7_0x2abc05({'type':_0x223996(0x213),'name':'method','message':_0x223996(0x1e5),'choices':[{'title':_0x223996(0x1d9),'value':_0x223996(0x20e)},{'title':'API\x20Key','value':_0x223996(0x1dd)}]});if(!_0x11f482[_0x223996(0x217)])return console['log'](_0x223996(0x1f5)),0x1;if(_0x11f482[_0x223996(0x217)]===_0x223996(0x20e))return await runOAuthLoginFlow(_0x402201,_0x969e7b,_0x4e6a87[_0x223996(0x1ec)]??LogLevel['ERROR']),0x0;}console[_0x223996(0x1e0)](_0x223996(0x1ff)+_0x402201),console['log']('You\x20can\x20find\x20your\x20API\x20key\x20at:'),console[_0x223996(0x1e0)]('\x20\x20'+getConsoleUrl(_0x402201,_0x223996(0x1fc)));const _0x1ec806=await a7_0x2abc05({'type':_0x223996(0x1e6),'name':_0x223996(0x21b),'message':_0x223996(0x214),'validate':_0x1c36c1=>{const _0xcf7124=_0x223996;if(!_0x1c36c1||!_0x1c36c1[_0xcf7124(0x1e9)]())return _0xcf7124(0x1fa);return!![];}});if(!_0x1ec806['apiKey'])return console[_0x223996(0x1e0)](_0x223996(0x1f5)),0x1;const _0x16bfaa=_0x1ec806['apiKey'];console['log'](_0x223996(0x219));try{const _0x4f7d98=TDX['create']({'site':_0x402201,'apiKey':_0x16bfaa['trim'](),'logLevel':_0x4e6a87['logLevel']??LogLevel[_0x223996(0x1e3)]}),_0x309a76=await _0x4f7d98[_0x223996(0x1ed)]['getUserInfo']();console[_0x223996(0x1e0)](_0x223996(0x1ef)+_0x309a76['email']+')');const _0xbc5810=await isKeychainAvailable();_0xbc5810?(await saveAPIKeyAsync(_0x16bfaa['trim'](),_0x402201,_0x969e7b),console[_0x223996(0x1e0)](_0x223996(0x1da)+(_0x969e7b?_0x223996(0x21d)+_0x969e7b+')':''))):(console['warn'](a7_0x52e211['yellow'](_0x223996(0x1ee))),console[_0x223996(0x207)](a7_0x52e211[_0x223996(0x1e7)](_0x223996(0x1f8))));if(_0x969e7b){const _0x4e82c8={'site':_0x402201};saveProfileToUserConfig(_0x969e7b,_0x4e82c8),console['log'](_0x223996(0x1f7)+_0x969e7b+_0x223996(0x1f4));}else saveDefaultSiteToUserConfig(_0x402201),console[_0x223996(0x1e0)]('✓\x20Default\x20site\x20set\x20to\x20'+_0x402201);const _0x36346f=_0x969e7b?_0x223996(0x1d8)+_0x969e7b:'';return console[_0x223996(0x1e0)](),console[_0x223996(0x1e0)]('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console['log'](_0x223996(0x206)+_0x36346f+_0x223996(0x1e8)),console['log']('\x20\x20tdx'+_0x36346f+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases'),0x0;}catch(_0x9b6f64){if(_0x9b6f64 instanceof HTTPClientError&&_0x9b6f64['status']===0x191)return printAuthError(_0x9b6f64),0x1;return console[_0x223996(0x20b)](a7_0x52e211['red']('✗\x20Validation\x20failed:\x20'+(_0x9b6f64 instanceof Error?_0x9b6f64['message']:String(_0x9b6f64)))),console[_0x223996(0x20b)]('API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.'),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x317fae(0x1dc)]=a7_0x317fae(0x1df);[a7_0x317fae(0x1eb)]='Show\x20authentication\x20status\x20and\x20validate\x20API\x20key';async['execute'](_0xcbe773){const _0x5d612d=a7_0x317fae,{options:_0xe3c61c,tdx:_0x1e0fa6}=_0xcbe773,_0xc65ccb=_0xe3c61c[_0x5d612d(0x211)],_0x321e82=_0xe3c61c[_0x5d612d(0x20a)],_0x27271c=_0x321e82?_0x321e82:_0x5d612d(0x216);console[_0x5d612d(0x1e0)](_0x5d612d(0x21f)+_0x27271c+_0x5d612d(0x1e2)+_0xc65ccb+')');const _0x538003=await getOAuthTokens(_0x321e82);if(_0x538003)console[_0x5d612d(0x1e0)]('Credential\x20type:\x20OAuth'),console[_0x5d612d(0x1e0)](_0x5d612d(0x205)+(_0x321e82?_0x5d612d(0x21d)+_0x321e82+')':''));else{const _0x399802=await resolveAPIKeyAsync(_0xc65ccb,_0x321e82);if(_0x399802){const {source:_0x5ae292,isDeprecated:_0x5b0808}=_0x399802,_0x224c9f=_0x5d612d(0x209)+_0x5ae292;console[_0x5d612d(0x1e0)](_0x5b0808?a7_0x52e211[_0x5d612d(0x1e7)](_0x224c9f):_0x224c9f);}else console['log'](a7_0x52e211[_0x5d612d(0x1e7)](_0x5d612d(0x1db)));}try{const _0x4a8c7e=await _0x1e0fa6[_0x5d612d(0x1ed)]['getUserInfo']();return console[_0x5d612d(0x1e0)](a7_0x52e211['green']('✓\x20Authentication\x20successful\x0a')),console['log'](_0x5d612d(0x1f6)+_0x4a8c7e['email']),(_0x4a8c7e[_0x5d612d(0x1e4)]||_0x4a8c7e[_0x5d612d(0x20d)])&&console[_0x5d612d(0x1e0)]('Name:\x20'+[_0x4a8c7e[_0x5d612d(0x1e4)],_0x4a8c7e['last_name']][_0x5d612d(0x212)](Boolean)[_0x5d612d(0x201)]('\x20')),0x0;}catch(_0x5f03d2){return _0x5f03d2 instanceof HTTPClientError&&_0x5f03d2['status']===0x191?printAuthError(_0x5f03d2,!![],_0x321e82):console['error'](a7_0x52e211[_0x5d612d(0x21a)](_0x5d612d(0x1de)+(_0x5f03d2 instanceof Error?_0x5f03d2['message']:String(_0x5f03d2)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x317fae(0x1dc)]=a7_0x317fae(0x1f3);[a7_0x317fae(0x1eb)]='Remove\x20API\x20key\x20from\x20system\x20keychain';async['execute'](_0x136464){const _0x358479=a7_0x317fae,{options:_0x44f91f}=_0x136464,_0x30d28e=_0x44f91f[_0x358479(0x20a)];console[_0x358479(0x1e0)](a7_0x52e211[_0x358479(0x220)](_0x358479(0x202)));const _0xd1d492=await isKeychainAvailable();if(!_0xd1d492)return console['error'](a7_0x52e211['red'](_0x358479(0x203))),0x1;const [_0x83651,_0x3a9093]=await Promise[_0x358479(0x1ea)]([deleteKeychainAPIKey(_0x30d28e),deleteOAuthTokens(_0x30d28e)]);if(_0x83651||_0x3a9093){clearCredentialCache();const _0x4a577f=[_0x83651&&_0x358479(0x204),_0x3a9093&&_0x358479(0x1f1)]['filter'](Boolean)[_0x358479(0x201)]('\x20and\x20');return console[_0x358479(0x1e0)]('✓\x20'+_0x4a577f+'\x20removed\x20from\x20keychain'+(_0x30d28e?_0x358479(0x21d)+_0x30d28e+')':'')),0x0;}else return console['log']('No\x20credentials\x20found\x20in\x20keychain'+(_0x30d28e?_0x358479(0x1f2)+_0x30d28e:'')),0x1;}}
@@ -1 +1 @@
1
- const a8_0x52fee1=a8_0x3d67;(function(_0x5162bb,_0x52d294){const _0x2264c5=a8_0x3d67,_0x115a78=_0x5162bb();while(!![]){try{const _0x65b731=-parseInt(_0x2264c5(0x19d))/0x1*(-parseInt(_0x2264c5(0x192))/0x2)+parseInt(_0x2264c5(0x183))/0x3+-parseInt(_0x2264c5(0x18f))/0x4+-parseInt(_0x2264c5(0x17e))/0x5*(-parseInt(_0x2264c5(0x1a6))/0x6)+-parseInt(_0x2264c5(0x19b))/0x7*(-parseInt(_0x2264c5(0x190))/0x8)+-parseInt(_0x2264c5(0x18b))/0x9+-parseInt(_0x2264c5(0x18d))/0xa;if(_0x65b731===_0x52d294)break;else _0x115a78['push'](_0x115a78['shift']());}catch(_0x42762e){_0x115a78['push'](_0x115a78['shift']());}}}(a8_0x3966,0x4de30));import{BaseCommand}from'./command.js';import{resolveSite}from'../core/config.js';import{saveProfileToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{isKeychainAvailable}from'../core/keychain.js';import{saveOAuthTokens}from'../core/oauth-keychain.js';import{startOAuthFlow,isOAuthSupported}from'../core/oauth.js';import{promptSiteSelection}from'../core/constants.js';function a8_0x3d67(_0x26d360,_0x4e9455){_0x26d360=_0x26d360-0x17e;const _0x396688=a8_0x3966();let _0x3d67fc=_0x396688[_0x26d360];return _0x3d67fc;}import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a8_0x3f5a49 from'chalk';export async function runOAuthLoginFlow(_0x3065bd,_0x3f6311,_0x1654e9){const _0x720784=a8_0x3d67;if(!isOAuthSupported(_0x3065bd))throw new Error(_0x720784(0x19e)+_0x3065bd+'.\x20'+_0x720784(0x1a5)+_0x720784(0x18e));const _0xbb4f30=await isKeychainAvailable();if(!_0xbb4f30)throw new Error(_0x720784(0x1a1)+_0x720784(0x18e));const _0x638384=getConsoleUrl(_0x3065bd);console['log'](_0x720784(0x19f)),console[_0x720784(0x182)]('\x20\x20'+_0x638384+_0x720784(0x194)),console[_0x720784(0x182)]('Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...');const _0x2fc6cb=await startOAuthFlow(_0x3065bd);console['log'](_0x720784(0x184));const _0x42ede1=TDX[_0x720784(0x193)]({'site':_0x3065bd,'accessToken':_0x2fc6cb[_0x720784(0x19c)],'logLevel':_0x1654e9??LogLevel[_0x720784(0x196)]}),_0x5b52d4=await _0x42ede1[_0x720784(0x181)][_0x720784(0x1a8)]();console[_0x720784(0x182)](a8_0x3f5a49[_0x720784(0x198)]('✓\x20Authentication\x20successful\x20(User:\x20'+_0x5b52d4[_0x720784(0x17f)]+')')),await saveOAuthTokens(_0x2fc6cb,_0x3f6311),console[_0x720784(0x182)](_0x720784(0x19a)+(_0x3f6311?_0x720784(0x180)+_0x3f6311+')':''));if(_0x3f6311){const _0x5523eb={'site':_0x3065bd};saveProfileToUserConfig(_0x3f6311,_0x5523eb),console['log'](_0x720784(0x187)+_0x3f6311+_0x720784(0x1a0));}const _0x20f23b=_0x3f6311?_0x720784(0x188)+_0x3f6311:'';console[_0x720784(0x182)](),console[_0x720784(0x182)](_0x720784(0x197)),console['log']('\x20\x20tdx'+_0x20f23b+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console[_0x720784(0x182)](_0x720784(0x191)+_0x20f23b+_0x720784(0x18a));}function a8_0x3966(){const _0xdabc96=['site','tdx:\x20auth\x20login','✓\x20Profile\x20\x27','\x20--profile\x20','Authenticating\x20via\x20OAuth\x20for\x20site:\x20','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','205920KRhbgd','Login\x20cancelled','2610540wPeDCw','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','2095952wamsdN','938200VZjXFN','\x20\x20tdx','98aDABkg','create','/oauth/authorize','bold','ERROR','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','green','auth:login','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain','21hvbJOt','access_token','711AybToU','OAuth\x20login\x20is\x20not\x20yet\x20available\x20for\x20site:\x20','Opening\x20browser\x20for\x20authentication...','\x27\x20registered','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','us01','profile','description','OAuth\x20is\x20currently\x20supported\x20on\x20dev-us01\x20and\x20dev-eu01\x20only.\x20','46716sYjGCK','logLevel','getUserInfo','190xdLPsG','email','\x20(profile:\x20','jobs','log','1333242uGJFXU','Validating\x20OAuth\x20tokens...'];a8_0x3966=function(){return _0xdabc96;};return a8_0x3966();}export class AuthLoginCommand extends BaseCommand{['name']=a8_0x52fee1(0x199);[a8_0x52fee1(0x1a4)]='Login\x20via\x20OAuth\x20(opens\x20browser)';async['execute'](_0x2fd0cf){const _0x449d1d=a8_0x52fee1,{options:_0x3521a9}=_0x2fd0cf,_0x563a4f=_0x3521a9[_0x449d1d(0x1a3)];console[_0x449d1d(0x182)](a8_0x3f5a49[_0x449d1d(0x195)](_0x449d1d(0x186)));const _0xabd9a5=_0x3521a9[_0x449d1d(0x185)]||_0x449d1d(0x1a2),_0x9f52e7=await promptSiteSelection(_0xabd9a5,_0x563a4f,_0x449d1d(0x18c));if(!_0x9f52e7)return 0x1;const _0x24babf=resolveSite(_0x9f52e7);return console[_0x449d1d(0x182)](_0x449d1d(0x189)+_0x24babf),await runOAuthLoginFlow(_0x24babf,_0x563a4f,_0x3521a9[_0x449d1d(0x1a7)]??LogLevel['ERROR']),0x0;}}
1
+ function a8_0x32d5(_0x59b560,_0x45f077){_0x59b560=_0x59b560-0x10d;const _0x283742=a8_0x2837();let _0x32d532=_0x283742[_0x59b560];return _0x32d532;}const a8_0x58b372=a8_0x32d5;(function(_0x4ebef5,_0x302450){const _0x4b5c15=a8_0x32d5,_0x3e1534=_0x4ebef5();while(!![]){try{const _0x3c3619=parseInt(_0x4b5c15(0x12f))/0x1*(parseInt(_0x4b5c15(0x134))/0x2)+parseInt(_0x4b5c15(0x131))/0x3*(-parseInt(_0x4b5c15(0x11f))/0x4)+-parseInt(_0x4b5c15(0x114))/0x5*(-parseInt(_0x4b5c15(0x11b))/0x6)+-parseInt(_0x4b5c15(0x12b))/0x7+-parseInt(_0x4b5c15(0x11c))/0x8*(-parseInt(_0x4b5c15(0x10f))/0x9)+-parseInt(_0x4b5c15(0x125))/0xa+parseInt(_0x4b5c15(0x130))/0xb;if(_0x3c3619===_0x302450)break;else _0x3e1534['push'](_0x3e1534['shift']());}catch(_0x2cf39c){_0x3e1534['push'](_0x3e1534['shift']());}}}(a8_0x2837,0x2110f));import{BaseCommand}from'./command.js';function a8_0x2837(){const _0x1c2c92=['OAuth\x20login\x20is\x20not\x20yet\x20available\x20for\x20site:\x20','OAuth\x20is\x20currently\x20supported\x20on\x20dev-us01\x20and\x20dev-eu01\x20only.\x20','198MZhUJe','create','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','\x20(profile:\x20','us01','5kMlFWf','\x27\x20registered','ERROR','\x20\x20tdx','log','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','green','144114LSSuKo','49552eEhUxG','access_token','\x20--profile\x20','652efDwvb','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','name','Login\x20cancelled','execute','profile','2550220JsiHdz','Opening\x20browser\x20for\x20authentication...','jobs','site','✓\x20Authentication\x20successful\x20(User:\x20','email','1540357bPVLsa','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','Authenticating\x20via\x20OAuth\x20for\x20site:\x20','✓\x20Profile\x20\x27','109jnGPlY','6693665Zvymxz','4446UFGZru','Login\x20via\x20OAuth\x20(opens\x20browser)','bold','1528GnUFPe','tdx:\x20auth\x20login'];a8_0x2837=function(){return _0x1c2c92;};return a8_0x2837();}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_0x1a3081 from'chalk';export async function runOAuthLoginFlow(_0x221ac4,_0x184cfb,_0x21d129){const _0x1f14eb=a8_0x32d5;if(!isOAuthSupported(_0x221ac4))throw new Error(_0x1f14eb(0x10d)+_0x221ac4+'.\x20'+_0x1f14eb(0x10e)+_0x1f14eb(0x119));const _0x4fe920=await isKeychainAvailable();if(!_0x4fe920)throw new Error(_0x1f14eb(0x12c)+_0x1f14eb(0x119));const _0xc80a8c=getConsoleUrl(_0x221ac4);console['log'](_0x1f14eb(0x126)),console[_0x1f14eb(0x118)]('\x20\x20'+_0xc80a8c+'/oauth/authorize'),console[_0x1f14eb(0x118)](_0x1f14eb(0x111));const _0x40b1df=await startOAuthFlow(_0x221ac4);console[_0x1f14eb(0x118)]('Validating\x20OAuth\x20tokens...');const _0xf6e7a4=TDX[_0x1f14eb(0x110)]({'site':_0x221ac4,'accessToken':_0x40b1df[_0x1f14eb(0x11d)],'logLevel':_0x21d129??LogLevel[_0x1f14eb(0x116)]}),_0x2915d0=await _0xf6e7a4[_0x1f14eb(0x127)]['getUserInfo']();console['log'](a8_0x1a3081[_0x1f14eb(0x11a)](_0x1f14eb(0x129)+_0x2915d0[_0x1f14eb(0x12a)]+')')),await saveOAuthTokens(_0x40b1df,_0x184cfb),console['log']('✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain'+(_0x184cfb?_0x1f14eb(0x112)+_0x184cfb+')':''));if(_0x184cfb){const _0xb415fd={'site':_0x221ac4};saveProfileToUserConfig(_0x184cfb,_0xb415fd),console['log'](_0x1f14eb(0x12e)+_0x184cfb+_0x1f14eb(0x115));}const _0x270067=_0x184cfb?_0x1f14eb(0x11e)+_0x184cfb:'';console[_0x1f14eb(0x118)](),console[_0x1f14eb(0x118)]('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console[_0x1f14eb(0x118)](_0x1f14eb(0x117)+_0x270067+_0x1f14eb(0x120)),console[_0x1f14eb(0x118)](_0x1f14eb(0x117)+_0x270067+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases');}export class AuthLoginCommand extends BaseCommand{[a8_0x58b372(0x121)]='auth:login';['description']=a8_0x58b372(0x132);async[a8_0x58b372(0x123)](_0xf37e22){const _0xb88fd8=a8_0x58b372,{options:_0x487ebe}=_0xf37e22,_0x7ca5b0=_0x487ebe[_0xb88fd8(0x124)];console[_0xb88fd8(0x118)](a8_0x1a3081[_0xb88fd8(0x133)](_0xb88fd8(0x135)));const _0x26358d=_0x487ebe[_0xb88fd8(0x128)]||_0xb88fd8(0x113),_0x24dbc5=await promptSiteSelection(_0x26358d,_0x7ca5b0,_0xb88fd8(0x122));if(!_0x24dbc5)return 0x1;const _0x38ee0f=resolveSite(_0x24dbc5);return console[_0xb88fd8(0x118)](_0xb88fd8(0x12d)+_0x38ee0f),await runOAuthLoginFlow(_0x38ee0f,_0x7ca5b0,_0x487ebe['logLevel']??LogLevel[_0xb88fd8(0x116)]),0x0;}}