@treasuredata/tdx 2026.3.26 → 2026.3.27

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 (205) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/auth-login-command.js +1 -1
  11. package/dist/commands/chat-command.js +1 -1
  12. package/dist/commands/claude-command.js +1 -1
  13. package/dist/commands/claude-statusline-command.js +1 -1
  14. package/dist/commands/claude-usage-command.js +1 -1
  15. package/dist/commands/command.js +1 -1
  16. package/dist/commands/connection-command.js +1 -1
  17. package/dist/commands/databases.js +1 -1
  18. package/dist/commands/delivery-command.js +1 -1
  19. package/dist/commands/describe.js +1 -1
  20. package/dist/commands/engage-campaign-pull-command.js +1 -1
  21. package/dist/commands/engage-campaign-push-command.js +1 -1
  22. package/dist/commands/engage-campaign-validate-command.js +1 -1
  23. package/dist/commands/engage-command.js +1 -1
  24. package/dist/commands/engage-template-pull-command.js +1 -1
  25. package/dist/commands/engage-template-push-command.js +1 -1
  26. package/dist/commands/engage-template-validate-command.js +1 -1
  27. package/dist/commands/job-command.js +1 -1
  28. package/dist/commands/journey-command.js +1 -1
  29. package/dist/commands/journey-validate-command.js +1 -1
  30. package/dist/commands/llm-command.js +1 -1
  31. package/dist/commands/mcp-command.js +1 -1
  32. package/dist/commands/parent-segment-command.js +1 -1
  33. package/dist/commands/policy-command.js +1 -1
  34. package/dist/commands/profile-command.js +1 -1
  35. package/dist/commands/profiles-command.js +1 -1
  36. package/dist/commands/query-command.js +1 -1
  37. package/dist/commands/schedule-command.js +1 -1
  38. package/dist/commands/segment-command.js +1 -1
  39. package/dist/commands/segment-create-command.js +1 -1
  40. package/dist/commands/segment-fields-command.js +1 -1
  41. package/dist/commands/segment-pull-command.js +1 -1
  42. package/dist/commands/segment-push-command.js +1 -1
  43. package/dist/commands/segment-update-command.js +1 -1
  44. package/dist/commands/segment-use-command.js +1 -1
  45. package/dist/commands/segment-validate-command.js +1 -1
  46. package/dist/commands/segments.js +1 -1
  47. package/dist/commands/show.js +1 -1
  48. package/dist/commands/status-command.js +1 -1
  49. package/dist/commands/tables.js +1 -1
  50. package/dist/commands/unset-command.js +1 -1
  51. package/dist/commands/upgrade-command.js +1 -1
  52. package/dist/commands/use-command.js +1 -1
  53. package/dist/commands/user-command.js +1 -1
  54. package/dist/commands/workflow-command.js +1 -1
  55. package/dist/core/auth.js +1 -1
  56. package/dist/core/command-output.js +1 -1
  57. package/dist/core/config.js +1 -1
  58. package/dist/core/connection-cache.js +1 -1
  59. package/dist/core/constants.js +1 -1
  60. package/dist/core/credential-cache.js +1 -1
  61. package/dist/core/global-context.js +1 -1
  62. package/dist/core/keychain.js +1 -1
  63. package/dist/core/oauth-keychain.js +1 -1
  64. package/dist/core/oauth.d.ts.map +1 -1
  65. package/dist/core/oauth.js +1 -1
  66. package/dist/core/oauth.js.map +1 -1
  67. package/dist/core/profile.js +1 -1
  68. package/dist/core/project-config.js +1 -1
  69. package/dist/core/session.js +1 -1
  70. package/dist/core/user-cache.js +1 -1
  71. package/dist/core/version.js +1 -1
  72. package/dist/index.js +1 -1
  73. package/dist/mcp/server.js +1 -1
  74. package/dist/mcp/tools/index.js +1 -1
  75. package/dist/mcp/tools/tdx-run.js +1 -1
  76. package/dist/mcp/tools/tdx-search.js +1 -1
  77. package/dist/mcp/utils.js +1 -1
  78. package/dist/proxy/claude-usage-tracker.js +1 -1
  79. package/dist/proxy/passthrough-server.js +1 -1
  80. package/dist/proxy/sse-usage-parser.js +1 -1
  81. package/dist/sdk/agent/agent-config.js +1 -1
  82. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  83. package/dist/sdk/agent/agent-yaml.js +1 -1
  84. package/dist/sdk/agent/test/evaluator.js +1 -1
  85. package/dist/sdk/agent/test/executor.js +1 -1
  86. package/dist/sdk/agent/test/index.js +1 -1
  87. package/dist/sdk/agent/test/output.js +1 -1
  88. package/dist/sdk/agent/test/parser.js +1 -1
  89. package/dist/sdk/agent/tool-target-registry.js +1 -1
  90. package/dist/sdk/api.js +1 -1
  91. package/dist/sdk/client/cdp-api-client.js +1 -1
  92. package/dist/sdk/client/delivery-api-client.js +1 -1
  93. package/dist/sdk/client/endpoints.js +1 -1
  94. package/dist/sdk/client/engage-api-client.js +1 -1
  95. package/dist/sdk/client/http-client.js +1 -1
  96. package/dist/sdk/client/llm-api-client.js +1 -1
  97. package/dist/sdk/client/oauth-refresh.js +1 -1
  98. package/dist/sdk/client/rate-limiter.js +1 -1
  99. package/dist/sdk/client/td-api-client.js +1 -1
  100. package/dist/sdk/client/trino-api-client.js +1 -1
  101. package/dist/sdk/client/workflow-client.js +1 -1
  102. package/dist/sdk/connection-validator.js +1 -1
  103. package/dist/sdk/connection.js +1 -1
  104. package/dist/sdk/delivery.js +1 -1
  105. package/dist/sdk/engage/campaign-pull.js +1 -1
  106. package/dist/sdk/engage/campaign-push.js +1 -1
  107. package/dist/sdk/engage/campaign-validator.js +1 -1
  108. package/dist/sdk/engage/campaign-yaml.js +1 -1
  109. package/dist/sdk/engage/template-pull.js +1 -1
  110. package/dist/sdk/engage/template-push.js +1 -1
  111. package/dist/sdk/engage/template-validator.js +1 -1
  112. package/dist/sdk/engage/template-yaml.js +1 -1
  113. package/dist/sdk/engage/types/campaign-def.js +1 -1
  114. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  115. package/dist/sdk/engage/types/template-schema.js +1 -1
  116. package/dist/sdk/engage.js +1 -1
  117. package/dist/sdk/errors.js +1 -1
  118. package/dist/sdk/index.js +1 -1
  119. package/dist/sdk/io/index.js +1 -1
  120. package/dist/sdk/io/node-filesystem.js +1 -1
  121. package/dist/sdk/job.js +1 -1
  122. package/dist/sdk/journey.js +1 -1
  123. package/dist/sdk/llm/chat-cache.js +1 -1
  124. package/dist/sdk/llm/index.js +1 -1
  125. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  126. package/dist/sdk/llm/model-factors.js +1 -1
  127. package/dist/sdk/personalization.js +1 -1
  128. package/dist/sdk/policy.js +1 -1
  129. package/dist/sdk/query/index.js +1 -1
  130. package/dist/sdk/query/sql-parser.js +1 -1
  131. package/dist/sdk/realtime.js +1 -1
  132. package/dist/sdk/schedule.js +1 -1
  133. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  134. package/dist/sdk/segment/fields-display.js +1 -1
  135. package/dist/sdk/segment/file-discovery.js +1 -1
  136. package/dist/sdk/segment/journey-utils.js +1 -1
  137. package/dist/sdk/segment/journey-validator.js +1 -1
  138. package/dist/sdk/segment/journey-yaml.js +1 -1
  139. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  140. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  141. package/dist/sdk/segment/pull-workflow.js +1 -1
  142. package/dist/sdk/segment/push-recovery.js +1 -1
  143. package/dist/sdk/segment/push-workflow.js +1 -1
  144. package/dist/sdk/segment/resolution-context.js +1 -1
  145. package/dist/sdk/segment/segment-path-parser.js +1 -1
  146. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  147. package/dist/sdk/segment/segment-validator.js +1 -1
  148. package/dist/sdk/segment/target-resolution.js +1 -1
  149. package/dist/sdk/segment/tdx-config.js +1 -1
  150. package/dist/sdk/segment/types/activation-schema.js +1 -1
  151. package/dist/sdk/segment/types/journey-def.js +1 -1
  152. package/dist/sdk/segment/types/journey-schema.js +1 -1
  153. package/dist/sdk/segment/types/segment-def.js +1 -1
  154. package/dist/sdk/segment/types/segment-schema.js +1 -1
  155. package/dist/sdk/segment/validate-files.js +1 -1
  156. package/dist/sdk/segment/yaml-validator.js +1 -1
  157. package/dist/sdk/segment.js +1 -1
  158. package/dist/sdk/types/index.js +1 -1
  159. package/dist/sdk/types/progress.js +1 -1
  160. package/dist/sdk/user.js +1 -1
  161. package/dist/sdk/util/format-detector.js +1 -1
  162. package/dist/sdk/util/formatters.js +1 -1
  163. package/dist/sdk/util/index.js +1 -1
  164. package/dist/sdk/util/paginate.js +1 -1
  165. package/dist/sdk/util/tree-formatter.js +1 -1
  166. package/dist/sdk/workflow/archive-validation.js +1 -1
  167. package/dist/sdk/workflow/clone-workflow.js +1 -1
  168. package/dist/sdk/workflow/index.js +1 -1
  169. package/dist/sdk/workflow/pull-workflow.js +1 -1
  170. package/dist/sdk/workflow/push-workflow.js +1 -1
  171. package/dist/sdk/workflow/tdx-config.js +1 -1
  172. package/dist/sdk/workflow/workflow-utils.js +1 -1
  173. package/dist/test-utils/command-runner.js +1 -1
  174. package/dist/test-utils/factories.js +1 -1
  175. package/dist/test-utils/fixtures.js +1 -1
  176. package/dist/test-utils/http-mock.js +1 -1
  177. package/dist/test-utils/index.js +1 -1
  178. package/dist/utils/async.js +1 -1
  179. package/dist/utils/colors.js +1 -1
  180. package/dist/utils/diff.js +1 -1
  181. package/dist/utils/file-permissions.js +1 -1
  182. package/dist/utils/file-reader.js +1 -1
  183. package/dist/utils/github-releases.js +1 -1
  184. package/dist/utils/global-cache.js +1 -1
  185. package/dist/utils/json-loader.js +1 -1
  186. package/dist/utils/local-cache.js +1 -1
  187. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  188. package/dist/utils/logger/formatters/index.js +1 -1
  189. package/dist/utils/logger/handlers/console-handler.js +1 -1
  190. package/dist/utils/logger/handlers/file-handler.js +1 -1
  191. package/dist/utils/logger/handlers/index.js +1 -1
  192. package/dist/utils/logger/handlers/null-handler.js +1 -1
  193. package/dist/utils/logger/index.js +1 -1
  194. package/dist/utils/logger/logger.js +1 -1
  195. package/dist/utils/logger/types.js +1 -1
  196. package/dist/utils/option-validation.js +1 -1
  197. package/dist/utils/process.js +1 -1
  198. package/dist/utils/prompt.js +1 -1
  199. package/dist/utils/spinner.js +1 -1
  200. package/dist/utils/sse-parser.js +1 -1
  201. package/dist/utils/string-utils.js +1 -1
  202. package/dist/utils/table-ref-parser.js +1 -1
  203. package/dist/utils/tdx-logger.js +1 -1
  204. package/dist/utils/version-check.js +1 -1
  205. package/package.json +1 -1
@@ -1 +1 @@
1
- const a3_0x2f0755=a3_0x9eb1;(function(_0x15981e,_0x29942f){const _0x5b9696=a3_0x9eb1,_0x563603=_0x15981e();while(!![]){try{const _0x2b10bd=parseInt(_0x5b9696(0xd3))/0x1+parseInt(_0x5b9696(0xcf))/0x2+parseInt(_0x5b9696(0xe5))/0x3+parseInt(_0x5b9696(0xe3))/0x4*(parseInt(_0x5b9696(0xd2))/0x5)+-parseInt(_0x5b9696(0xe4))/0x6*(-parseInt(_0x5b9696(0xd1))/0x7)+-parseInt(_0x5b9696(0xe1))/0x8+parseInt(_0x5b9696(0xcd))/0x9*(-parseInt(_0x5b9696(0xd5))/0xa);if(_0x2b10bd===_0x29942f)break;else _0x563603['push'](_0x563603['shift']());}catch(_0x44c2db){_0x563603['push'](_0x563603['shift']());}}}(a3_0x2e2a,0x5f929));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a3_0x9eb1(_0x4c9d1f,_0x3ba556){_0x4c9d1f=_0x4c9d1f-0xca;const _0x2e2acf=a3_0x2e2a();let _0x9eb1ac=_0x2e2acf[_0x4c9d1f];return _0x9eb1ac;}import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';export class ActivationsCommand extends BaseCommand{['name']=a3_0x2f0755(0xe6);[a3_0x2f0755(0xeb)]='List\x20activations\x20for\x20a\x20segment';async[a3_0x2f0755(0xdc)](_0x3827ad){const _0x3bfe21=a3_0x2f0755,{options:_0x3f48de,args:_0xc2bad,tdx:_0x1d8e24}=_0x3827ad;if(_0xc2bad[_0x3bfe21(0xd8)]===0x0)return console[_0x3bfe21(0xe2)]('Error:\x20Segment\x20name\x20is\x20required'),console[_0x3bfe21(0xe2)](_0x3bfe21(0xdd)),0x1;try{const {parentId:_0x40eaed,childId:_0x35a294}=parseSegmentRef(_0xc2bad[0x0]);if(!_0x35a294)return console['error'](_0x3bfe21(0xce)),console[_0x3bfe21(0xe2)](_0x3bfe21(0xdd)),0x1;_0x3f48de[_0x3bfe21(0xec)]&&(console[_0x3bfe21(0xe2)]('Site:\x20'+_0x3f48de[_0x3bfe21(0xde)]),console[_0x3bfe21(0xe2)]('Parent\x20name:\x20'+_0x40eaed),console[_0x3bfe21(0xe2)](_0x3bfe21(0xd6)+_0x35a294));const _0x5a342a=await withSpinner(_0x3bfe21(0xe9)+_0x40eaed+_0x3bfe21(0xea),()=>_0x1d8e24['segment'][_0x3bfe21(0xdb)](_0x40eaed),{'verbose':_0x3f48de[_0x3bfe21(0xec)]}),_0x31fac8=_0x5a342a['data'];_0x3f48de[_0x3bfe21(0xec)]&&console[_0x3bfe21(0xe2)](_0x3bfe21(0xe0)+_0x31fac8);const _0x3b7514=await withSpinner(_0x3bfe21(0xd7)+_0x35a294+_0x3bfe21(0xea),()=>_0x1d8e24[_0x3bfe21(0xdf)][_0x3bfe21(0xd9)](_0x31fac8,_0x35a294),{'verbose':_0x3f48de['verbose']}),_0x59f6d3=_0x3b7514[_0x3bfe21(0xda)];_0x3f48de[_0x3bfe21(0xec)]&&console[_0x3bfe21(0xe2)](_0x3bfe21(0xca)+_0x59f6d3);const _0x32504d=await withSpinner('Listing\x20activations\x20for\x20segment\x20\x27'+_0x35a294+_0x3bfe21(0xea),()=>_0x1d8e24['segment'][_0x3bfe21(0xe8)](_0x31fac8,_0x59f6d3),{'verbose':_0x3f48de[_0x3bfe21(0xec)]}),_0x5567d2=_0x32504d[_0x3bfe21(0xda)];return console[_0x3bfe21(0xe2)](_0x3bfe21(0xcc)+_0x5567d2['length']+_0x3bfe21(0xd4)+(_0x5567d2[_0x3bfe21(0xd8)]!==0x1?'s':'')),await handleSDKOutput(_0x5567d2,_0x3f48de),0x0;}catch(_0x570eea){if(_0x570eea instanceof SDKError)return console[_0x3bfe21(0xe2)](_0x3bfe21(0xcb)+_0x570eea[_0x3bfe21(0xe7)]),_0x570eea[_0x3bfe21(0xd0)]&&console[_0x3bfe21(0xe2)]('\x20\x20Cause:\x20'+_0x570eea[_0x3bfe21(0xd0)]),0x1;throw _0x570eea;}}}function a3_0x2e2a(){const _0xb61cae=['data','resolveParentId','execute','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','site','segment','Resolved\x20parent\x20ID:\x20','240784riJQsd','error','4BxCzwc','6spUOlf','1842867xTfJKG','activations','message','listActivations','Resolving\x20parent\x20segment\x20\x27','\x27...','description','verbose','Resolved\x20child\x20ID:\x20','Error:\x20','✔\x20Found\x20','2680281Nxcnxz','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','340714qAMVjX','cause','5419477PPChTL','870215NfJDbf','475517pRRtEG','\x20activation','60rdHeTh','Child\x20name:\x20','Resolving\x20child\x20segment\x20\x27','length','resolveSegmentId'];a3_0x2e2a=function(){return _0xb61cae;};return a3_0x2e2a();}
1
+ function a3_0x59bc(){const _0x299be6=['Resolved\x20parent\x20ID:\x20','length','site','verbose','\x20\x20Cause:\x20','cause','Resolving\x20child\x20segment\x20\x27','Error:\x20','1040KaIuct','resolveSegmentId','error','name','Listing\x20activations\x20for\x20segment\x20\x27','2729828iXowba','Error:\x20Segment\x20name\x20is\x20required','\x20activation','Child\x20name:\x20','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','4qEPFSG','139123qvHrHX','Resolving\x20parent\x20segment\x20\x27','1719162tNQKel','activations','49257mYvayi','✔\x20Found\x20','10NoIUtc','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','\x27...','10805662UoPZgm','2739858JauSHh','resolveParentId','Parent\x20name:\x20','15579014NApraJ','listActivations','5BldHPs','data'];a3_0x59bc=function(){return _0x299be6;};return a3_0x59bc();}const a3_0x535def=a3_0x50a2;function a3_0x50a2(_0x47f471,_0x5d7809){_0x47f471=_0x47f471-0xea;const _0x59bce5=a3_0x59bc();let _0x50a275=_0x59bce5[_0x47f471];return _0x50a275;}(function(_0x2230e7,_0x20b4f2){const _0x34fb42=a3_0x50a2,_0xfa7b69=_0x2230e7();while(!![]){try{const _0x382379=-parseInt(_0x34fb42(0x109))/0x1*(-parseInt(_0x34fb42(0x108))/0x2)+-parseInt(_0x34fb42(0x10b))/0x3+-parseInt(_0x34fb42(0x103))/0x4+-parseInt(_0x34fb42(0xf4))/0x5*(parseInt(_0x34fb42(0xef))/0x6)+parseInt(_0x34fb42(0xee))/0x7+parseInt(_0x34fb42(0xfe))/0x8*(-parseInt(_0x34fb42(0x10d))/0x9)+-parseInt(_0x34fb42(0xeb))/0xa*(-parseInt(_0x34fb42(0xf2))/0xb);if(_0x382379===_0x20b4f2)break;else _0xfa7b69['push'](_0xfa7b69['shift']());}catch(_0x109e75){_0xfa7b69['push'](_0xfa7b69['shift']());}}}(a3_0x59bc,0xc6dce));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{[a3_0x535def(0x101)]=a3_0x535def(0x10c);['description']='List\x20activations\x20for\x20a\x20segment';async['execute'](_0x57157b){const _0x499360=a3_0x535def,{options:_0x5ebcfc,args:_0x1ee8fe,tdx:_0x5e823c}=_0x57157b;if(_0x1ee8fe[_0x499360(0xf7)]===0x0)return console[_0x499360(0x100)](_0x499360(0x104)),console[_0x499360(0x100)](_0x499360(0xec)),0x1;try{const {parentId:_0x3f6fcb,childId:_0xee12ba}=parseSegmentRef(_0x1ee8fe[0x0]);if(!_0xee12ba)return console[_0x499360(0x100)](_0x499360(0x107)),console[_0x499360(0x100)]('Usage:\x20tdx\x20activations\x20<parent_name/child_name>'),0x1;_0x5ebcfc[_0x499360(0xf9)]&&(console[_0x499360(0x100)]('Site:\x20'+_0x5ebcfc[_0x499360(0xf8)]),console[_0x499360(0x100)](_0x499360(0xf1)+_0x3f6fcb),console[_0x499360(0x100)](_0x499360(0x106)+_0xee12ba));const _0x570420=await withSpinner(_0x499360(0x10a)+_0x3f6fcb+_0x499360(0xed),()=>_0x5e823c['segment'][_0x499360(0xf0)](_0x3f6fcb),{'verbose':_0x5ebcfc[_0x499360(0xf9)]}),_0x447a15=_0x570420[_0x499360(0xf5)];_0x5ebcfc[_0x499360(0xf9)]&&console['error'](_0x499360(0xf6)+_0x447a15);const _0x26f536=await withSpinner(_0x499360(0xfc)+_0xee12ba+'\x27...',()=>_0x5e823c['segment'][_0x499360(0xff)](_0x447a15,_0xee12ba),{'verbose':_0x5ebcfc['verbose']}),_0x2d5c97=_0x26f536[_0x499360(0xf5)];_0x5ebcfc[_0x499360(0xf9)]&&console[_0x499360(0x100)]('Resolved\x20child\x20ID:\x20'+_0x2d5c97);const _0x8e98f4=await withSpinner(_0x499360(0x102)+_0xee12ba+_0x499360(0xed),()=>_0x5e823c['segment'][_0x499360(0xf3)](_0x447a15,_0x2d5c97),{'verbose':_0x5ebcfc[_0x499360(0xf9)]}),_0x1ef93d=_0x8e98f4[_0x499360(0xf5)];return console['error'](_0x499360(0xea)+_0x1ef93d[_0x499360(0xf7)]+_0x499360(0x105)+(_0x1ef93d[_0x499360(0xf7)]!==0x1?'s':'')),await handleSDKOutput(_0x1ef93d,_0x5ebcfc),0x0;}catch(_0x3dd4f7){if(_0x3dd4f7 instanceof SDKError)return console[_0x499360(0x100)](_0x499360(0xfd)+_0x3dd4f7['message']),_0x3dd4f7['cause']&&console[_0x499360(0x100)](_0x499360(0xfa)+_0x3dd4f7[_0x499360(0xfb)]),0x1;throw _0x3dd4f7;}}}
@@ -1 +1 @@
1
- const a4_0x2bd6c2=a4_0x14ff;(function(_0x2fd52d,_0x58f3a4){const _0x57fc4f=a4_0x14ff,_0x335f33=_0x2fd52d();while(!![]){try{const _0x2f447c=parseInt(_0x57fc4f(0x1e8))/0x1*(parseInt(_0x57fc4f(0x197))/0x2)+parseInt(_0x57fc4f(0x1b5))/0x3+-parseInt(_0x57fc4f(0x1a0))/0x4*(parseInt(_0x57fc4f(0x1e3))/0x5)+-parseInt(_0x57fc4f(0x199))/0x6*(-parseInt(_0x57fc4f(0x1a1))/0x7)+-parseInt(_0x57fc4f(0x19b))/0x8+-parseInt(_0x57fc4f(0x1f5))/0x9+-parseInt(_0x57fc4f(0x1d7))/0xa;if(_0x2f447c===_0x58f3a4)break;else _0x335f33['push'](_0x335f33['shift']());}catch(_0x2d7072){_0x335f33['push'](_0x335f33['shift']());}}}(a4_0x1bd1,0x49ef6));import a4_0x16ef45 from'chalk';import a4_0x34ce8e from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext,resolveAgentPullArgs}from'../sdk/agent/agent-config.js';function a4_0x14ff(_0x107dcb,_0x2f907d){_0x107dcb=_0x107dcb-0x18d;const _0x1bd1d2=a4_0x1bd1();let _0x14ff86=_0x1bd1d2[_0x107dcb];return _0x14ff86;}function a4_0x1bd1(){const _0x5855f1=['\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','cwd','yes','green','description','\x20resources\x20to\x20\x27','New\x20project:\x20','Would\x20clone:','llm','Failed\x20to\x20push\x20agent:\x20','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','Would\x20pull\x20agent:\x20','\x20total','Output:\x20','<new-name>','textKnowledgeBases','\x20--name\x20','Agent\x20','Using\x20context\x20project:\x20','repeat','action','\x20\x20Integrations:\x20','Summary:','No\x20tdx.json\x20found\x20in\x20','\x0aChanges\x20to\x20integration\x20\x27','dirname','output','1206880ACXjOh','arg-dir','found','force','outputPath','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','new','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','Chat:\x20','\x20\x20Knowledge\x20Bases:\x20','llm_project','\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','940DCJZQi','pullAgent','\x0aPush\x20summary\x20for\x20\x27','Writing\x20files...','\x20updated','261UUtZwD','\x0aError:','errors','total','Using\x20project\x20from\x20','Using\x20project\x20from\x20context:\x20','Using\x20project:\x20','pushProject','diff','Project\x20cloned\x20successfully','✔\x20Context\x20set:\x20','\x22:\x20','site','1202643YpmZro','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','\x0aChanges\x20to\x20agent\x20\x27','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','hasChanges','newProjectName','agentId','Source:\x20','\x20files?','Errors:','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','Pushing\x20agent\x20from\x20\x22','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','yellow','projectId','message','agent:push','New\x20project\x20ID:\x20','\x20errors','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20project','\x20\x20Integration\x20\x22','dim','session','agent.yml','log','\x20\x20Prompts:\x20','utf-8','New\x20project\x20name\x20is\x20required','\x20files\x20to\x20','unchanged','\x20\x20Knowledge\x20Base\x20\x22','\x20unchanged','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','\x20new','experimentalKnowledgeBases','Agent\x20pulled\x20successfully','pullProject','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','no_local_folder','Status:\x20','prompts','llmProject','\x20\x20Text\x20Knowledge\x20Base\x20\x22','\x0aPush\x20','\x22\x20to\x20new\x20project\x20\x22','sourceProjectName','experimentalArtifacts','\x0aProject\x20pushed\x20with\x20errors','\x20changed','\x0aChanges\x20to\x20prompt\x20\x27','\x22...','agent','\x0aWrite\x20','projectName','agent:clone','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','\x20--profile\x20','Agent:\x20','join','integrations','name','Would\x20push\x20agent:\x20','Cancelled','knowledgeBases','context','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','profile','\x20\x20Agents:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project','source','projectDir','cyan','\x20|\x20','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','\x0aChanges:','updated','Cloning\x20\x22','red','execute','\x20\x20Experimental\x20Artifacts:\x20','\x20\x20Target:\x20','-\x20nothing\x20pushed','Analyzing\x20changes\x20to\x20push...','Project\x20cloned\x20with\x20errors','\x20\x20Prompt\x20\x22','\x20\x20Text\x20Knowledge\x20Bases:\x20','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','1474BsxNjh','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','260070vqedwY','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','462696fccIgW','dryRun','\x20created','INVALID_ARGUMENT','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','4080lgsZRf','7sMPqCB','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','Project:\x20','cloneProject','Dry\x20run\x20-\x20no\x20files\x20written','agentName','Analyzing\x20project\x20\x22','-\x20no\x20files\x20written','\x27\x20to\x20create\x20the\x20folder\x20structure.','tdx.json','created','\x20\x20tdx\x20agent\x20pull\x20','counts','error','no_context','Using\x20current\x20project:\x20','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','agents','push','1713144dkjTuL','Dry\x20run\x20-\x20no\x20changes\x20made','\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','Pulling\x20agent\x20\x22','\x20\x20Agent\x20\x22','Using\x20local\x20project:\x20','newProjectId'];a4_0x1bd1=function(){return _0x5855f1;};return a4_0x1bd1();}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(_0x2aee48){const _0x2f778a=a4_0x14ff,_0x4a371e=[];if(_0x2aee48[_0x2f778a(0x1eb)]!==undefined)_0x4a371e[_0x2f778a(0x1b4)](_0x2aee48[_0x2f778a(0x1eb)]+_0x2f778a(0x1c8));if(_0x2aee48[_0x2f778a(0x1dd)]!==undefined&&_0x2aee48[_0x2f778a(0x1dd)]>0x0)_0x4a371e['push'](a4_0x16ef45[_0x2f778a(0x1bf)](_0x2aee48[_0x2f778a(0x1dd)]+_0x2f778a(0x217)));if(_0x2aee48['created']!==undefined&&_0x2aee48['created']>0x0)_0x4a371e['push'](a4_0x16ef45[_0x2f778a(0x1bf)](_0x2aee48[_0x2f778a(0x1ab)]+_0x2f778a(0x19d)));if(_0x2aee48['updated']!==undefined&&_0x2aee48[_0x2f778a(0x241)]>0x0)_0x4a371e[_0x2f778a(0x1b4)](a4_0x16ef45[_0x2f778a(0x203)](_0x2aee48['updated']+_0x2f778a(0x1e7)));if(_0x2aee48['unchanged']!==undefined&&_0x2aee48['unchanged']>0x0)_0x4a371e[_0x2f778a(0x1b4)](a4_0x16ef45['gray'](_0x2aee48[_0x2f778a(0x213)]+_0x2f778a(0x215)));if(_0x2aee48['errors']!==undefined&&_0x2aee48[_0x2f778a(0x1ea)]>0x0)_0x4a371e[_0x2f778a(0x1b4)](a4_0x16ef45[_0x2f778a(0x243)](_0x2aee48[_0x2f778a(0x1ea)]+_0x2f778a(0x208)));return _0x4a371e[_0x2f778a(0x230)](',\x20');}function displayDiffs(_0x214f00,_0x2fbbc0,_0x1a837f,_0x253091,_0x294b86,_0x20dd40,_0x1fc696){const _0x484e82=a4_0x14ff;for(const _0x28d9f0 of _0x214f00){if(_0x28d9f0[_0x484e82(0x1f0)]){const _0x3fddad=_0x28d9f0[_0x484e82(0x1a6)]||_0x28d9f0['name'];console[_0x484e82(0x20e)](_0x484e82(0x1f7)+_0x3fddad+'\x27:'),console[_0x484e82(0x20e)]('─'[_0x484e82(0x1cf)](0x3c)),console['log'](_0x28d9f0[_0x484e82(0x1f0)]),console['log']('─'['repeat'](0x3c));}}for(const _0x691aaf of _0x2fbbc0){_0x691aaf[_0x484e82(0x1f0)]&&(console[_0x484e82(0x20e)](_0x484e82(0x237)+_0x691aaf['name']+'\x27:'),console['log']('─'['repeat'](0x3c)),console[_0x484e82(0x20e)](_0x691aaf[_0x484e82(0x1f0)]),console[_0x484e82(0x20e)]('─'[_0x484e82(0x1cf)](0x3c)));}for(const _0x422ee8 of _0x1a837f){_0x422ee8[_0x484e82(0x1f0)]&&(console['log'](_0x484e82(0x23f)+_0x422ee8['name']+'\x27:'),console[_0x484e82(0x20e)]('─'['repeat'](0x3c)),console[_0x484e82(0x20e)](_0x422ee8[_0x484e82(0x1f0)]),console[_0x484e82(0x20e)]('─'[_0x484e82(0x1cf)](0x3c)));}for(const _0xec8b4b of _0x253091){_0xec8b4b[_0x484e82(0x1f0)]&&(console['log'](_0x484e82(0x227)+_0xec8b4b[_0x484e82(0x232)]+'\x27:'),console['log']('─'['repeat'](0x3c)),console[_0x484e82(0x20e)](_0xec8b4b['diff']),console[_0x484e82(0x20e)]('─'[_0x484e82(0x1cf)](0x3c)));}for(const _0xced836 of _0x294b86){_0xced836['diff']&&(console[_0x484e82(0x20e)](_0x484e82(0x1d4)+_0xced836[_0x484e82(0x232)]+'\x27:'),console[_0x484e82(0x20e)]('─'[_0x484e82(0x1cf)](0x3c)),console[_0x484e82(0x20e)](_0xced836['diff']),console[_0x484e82(0x20e)]('─'[_0x484e82(0x1cf)](0x3c)));}for(const _0x31eb37 of _0x20dd40){_0x31eb37[_0x484e82(0x1f0)]&&(console[_0x484e82(0x20e)]('\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27'+_0x31eb37['name']+'\x27:'),console[_0x484e82(0x20e)]('─'[_0x484e82(0x1cf)](0x3c)),console[_0x484e82(0x20e)](_0x31eb37[_0x484e82(0x1f0)]),console[_0x484e82(0x20e)]('─'[_0x484e82(0x1cf)](0x3c)));}for(const _0x25ac68 of _0x1fc696){_0x25ac68[_0x484e82(0x1f0)]&&(console[_0x484e82(0x20e)](_0x484e82(0x1f6)+_0x25ac68[_0x484e82(0x232)]+'\x27:'),console[_0x484e82(0x20e)]('─'[_0x484e82(0x1cf)](0x3c)),console[_0x484e82(0x20e)](_0x25ac68['diff']),console[_0x484e82(0x20e)]('─'['repeat'](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x2bd6c2(0x232)]='agent:pull';[a4_0x2bd6c2(0x1c0)]='Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files';async[a4_0x2bd6c2(0x18d)](_0x35fe7d){const _0x57942c=a4_0x2bd6c2,{options:_0x20e1b6,args:_0x14dedf,tdx:_0x148395}=_0x35fe7d,_0x175875=_0x14dedf[0x0],_0x1c1125=_0x14dedf[0x1],_0x30efca=_0x20e1b6[_0x57942c(0x1d6)],_0x2f9bd8=_0x20e1b6[_0x57942c(0x19c)],_0x4b2e91=_0x20e1b6[_0x57942c(0x1da)],_0x313e26=_0x20e1b6[_0x57942c(0x1be)],_0x160fec=_0x20e1b6[_0x57942c(0x21f)],_0x34612f=_0x20e1b6[_0x57942c(0x229)];let _0x55e0da;if(_0x175875){const _0x24f0d8=a4_0x34ce8e[_0x57942c(0x230)](_0x175875,'tdx.json');if(existsSync(_0x24f0d8))try{const _0x3984da=JSON['parse'](readFileSync(_0x24f0d8,'utf-8'));_0x3984da[_0x57942c(0x1e1)]&&(_0x55e0da={'llm_project':_0x3984da['llm_project']});}catch{}}const _0x24cc9c=findAgentConfigPath(process[_0x57942c(0x1bd)]());let _0x165c07;if(_0x24cc9c)try{const _0x4ff139=JSON['parse'](readFileSync(_0x24cc9c,_0x57942c(0x210)));_0x4ff139[_0x57942c(0x1e1)]&&(_0x165c07={'llm_project':_0x4ff139[_0x57942c(0x1e1)]});}catch{}const _0x3a1e54=resolveAgentPullArgs({'arg':_0x175875,'agentNameArg':_0x1c1125,'agentFlag':_0x34612f,'contextProject':_0x160fec,'argDirConfig':_0x55e0da,'cwdConfigPath':_0x24cc9c||undefined,'cwdConfig':_0x165c07}),{projectNameOrId:_0x240aa9,targetAgentName:_0x1b757e,existingOutputDir:_0x4cfe2c,source:_0x3d868c}=_0x3a1e54;if(_0x3d868c===_0x57942c(0x1d8))console[_0x57942c(0x20e)](a4_0x16ef45[_0x57942c(0x20b)](_0x57942c(0x1ec)+a4_0x34ce8e['join'](_0x175875,'tdx.json')+':\x20'+_0x240aa9));else{if(_0x3d868c==='cwd-config')console[_0x57942c(0x20e)](a4_0x16ef45[_0x57942c(0x20b)](_0x57942c(0x1ee)+_0x240aa9));else _0x3d868c===_0x57942c(0x236)&&console[_0x57942c(0x20e)](a4_0x16ef45[_0x57942c(0x20b)](_0x57942c(0x1ed)+_0x240aa9));}if(!_0x240aa9)return _0x34612f?(console[_0x57942c(0x20e)](a4_0x16ef45[_0x57942c(0x203)](_0x57942c(0x200))),console[_0x57942c(0x20e)](_0x57942c(0x1a2)),console[_0x57942c(0x20e)](_0x57942c(0x21b))):(console[_0x57942c(0x20e)](a4_0x16ef45[_0x57942c(0x203)]('llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a')),console[_0x57942c(0x20e)]('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['log'](_0x57942c(0x23a)),console[_0x57942c(0x20e)](_0x57942c(0x1b7)),console[_0x57942c(0x20e)](_0x57942c(0x1e2)),console[_0x57942c(0x20e)](_0x57942c(0x209))),0x1;if(_0x1b757e){const {data:_0x5d16d5}=await withSpinner(_0x57942c(0x1b8)+_0x1b757e+'\x22\x20from\x20project\x20\x22'+_0x240aa9+'\x22...',()=>_0x148395[_0x57942c(0x1c4)][_0x57942c(0x1e4)](_0x240aa9,_0x1b757e,_0x30efca,{'dryRun':_0x2f9bd8,'force':_0x4b2e91}));if(_0x2f9bd8)return console[_0x57942c(0x20e)](a4_0x16ef45[_0x57942c(0x203)](_0x57942c(0x1a5))),console[_0x57942c(0x20e)](_0x57942c(0x1c7)+_0x5d16d5[_0x57942c(0x1a6)]),console[_0x57942c(0x20e)]('Output\x20path:\x20'+_0x5d16d5[_0x57942c(0x1db)]),_0x5d16d5['diff']&&(console['log'](_0x57942c(0x240)),console[_0x57942c(0x20e)]('─'[_0x57942c(0x1cf)](0x3c)),console[_0x57942c(0x20e)](_0x5d16d5[_0x57942c(0x1f0)]),console[_0x57942c(0x20e)]('─'[_0x57942c(0x1cf)](0x3c))),0x0;return console[_0x57942c(0x20e)](a4_0x16ef45[_0x57942c(0x1bf)](_0x57942c(0x219))),console[_0x57942c(0x20e)](_0x57942c(0x22f)+_0x5d16d5['agentName']),console[_0x57942c(0x20e)](_0x57942c(0x1c9)+_0x5d16d5[_0x57942c(0x1db)]),console[_0x57942c(0x20e)](_0x57942c(0x21d)+(_0x5d16d5['isNew']?a4_0x16ef45['green']('new'):_0x5d16d5[_0x57942c(0x1f9)]?a4_0x16ef45[_0x57942c(0x203)](_0x57942c(0x241)):a4_0x16ef45['gray'](_0x57942c(0x213)))),0x0;}const _0x34a936=_0x4cfe2c||_0x30efca,{data:_0x26373c}=await withSpinner(_0x57942c(0x1a7)+_0x240aa9+'\x22...',()=>_0x148395[_0x57942c(0x1c4)][_0x57942c(0x21a)](_0x240aa9,_0x34a936,{'dryRun':!![]})),_0x32b5ba=_0x26373c['counts'][_0x57942c(0x1b3)][_0x57942c(0x1dd)]+_0x26373c['counts'][_0x57942c(0x235)][_0x57942c(0x1dd)]+_0x26373c[_0x57942c(0x1ad)]['textKnowledgeBases'][_0x57942c(0x1dd)]+_0x26373c[_0x57942c(0x1ad)][_0x57942c(0x21e)]['new']+_0x26373c[_0x57942c(0x1ad)][_0x57942c(0x231)][_0x57942c(0x1dd)]+_0x26373c[_0x57942c(0x1ad)][_0x57942c(0x218)][_0x57942c(0x1dd)]+_0x26373c[_0x57942c(0x1ad)][_0x57942c(0x224)]['new'],_0x1985ff=_0x26373c['counts']['agents']['updated']+_0x26373c['counts'][_0x57942c(0x235)][_0x57942c(0x241)]+_0x26373c[_0x57942c(0x1ad)][_0x57942c(0x1cb)][_0x57942c(0x241)]+_0x26373c[_0x57942c(0x1ad)][_0x57942c(0x21e)][_0x57942c(0x241)]+_0x26373c[_0x57942c(0x1ad)][_0x57942c(0x231)][_0x57942c(0x241)]+_0x26373c[_0x57942c(0x1ad)]['experimentalKnowledgeBases'][_0x57942c(0x241)]+_0x26373c[_0x57942c(0x1ad)]['experimentalArtifacts'][_0x57942c(0x241)],_0x342a73=_0x26373c[_0x57942c(0x1ad)][_0x57942c(0x1b3)][_0x57942c(0x213)]+_0x26373c['counts'][_0x57942c(0x235)][_0x57942c(0x213)]+_0x26373c[_0x57942c(0x1ad)][_0x57942c(0x1cb)][_0x57942c(0x213)]+_0x26373c[_0x57942c(0x1ad)][_0x57942c(0x21e)][_0x57942c(0x213)]+_0x26373c[_0x57942c(0x1ad)]['integrations']['unchanged']+_0x26373c[_0x57942c(0x1ad)][_0x57942c(0x218)][_0x57942c(0x213)]+_0x26373c[_0x57942c(0x1ad)][_0x57942c(0x224)][_0x57942c(0x213)];console[_0x57942c(0x20e)]('\x0aPull\x20summary\x20for\x20\x27'+_0x26373c[_0x57942c(0x22b)]+'\x27:'),console['log']('\x20\x20'+a4_0x16ef45[_0x57942c(0x1bf)]('+\x20'+_0x32b5ba+_0x57942c(0x217))+_0x57942c(0x23e)+a4_0x16ef45[_0x57942c(0x203)]('~\x20'+_0x1985ff+_0x57942c(0x226))+'\x20|\x20'+a4_0x16ef45[_0x57942c(0x20b)]('=\x20'+_0x342a73+_0x57942c(0x215))),console['log'](_0x57942c(0x239)+formatCountSummary(_0x26373c[_0x57942c(0x1ad)]['agents'])),console[_0x57942c(0x20e)](_0x57942c(0x1e0)+formatCountSummary(_0x26373c[_0x57942c(0x1ad)]['knowledgeBases'])),console['log'](_0x57942c(0x194)+formatCountSummary(_0x26373c['counts'][_0x57942c(0x1cb)])),console[_0x57942c(0x20e)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x26373c[_0x57942c(0x1ad)][_0x57942c(0x21e)])),console['log']('\x20\x20Integrations:\x20'+formatCountSummary(_0x26373c[_0x57942c(0x1ad)]['integrations']));const _0x3c251f=_0x26373c['counts'][_0x57942c(0x218)][_0x57942c(0x1eb)]>0x0||_0x26373c['counts'][_0x57942c(0x224)][_0x57942c(0x1eb)]>0x0;_0x3c251f&&(console[_0x57942c(0x20e)](_0x57942c(0x1de)+formatCountSummary(_0x26373c[_0x57942c(0x1ad)][_0x57942c(0x218)])),console[_0x57942c(0x20e)](_0x57942c(0x18e)+formatCountSummary(_0x26373c[_0x57942c(0x1ad)]['experimentalArtifacts'])));console[_0x57942c(0x20e)](_0x57942c(0x18f)+a4_0x16ef45[_0x57942c(0x23d)](_0x26373c['outputDir'])),displayDiffs(_0x26373c['agents'],_0x26373c['knowledgeBases'],_0x26373c[_0x57942c(0x1cb)],_0x26373c[_0x57942c(0x21e)],_0x26373c[_0x57942c(0x231)],_0x26373c[_0x57942c(0x218)],_0x26373c[_0x57942c(0x224)]);if(_0x2f9bd8)return console[_0x57942c(0x20e)](a4_0x16ef45[_0x57942c(0x203)](_0x57942c(0x19f))),0x0;if(_0x32b5ba===0x0&&_0x1985ff===0x0)return console[_0x57942c(0x20e)](a4_0x16ef45[_0x57942c(0x1bf)](_0x57942c(0x1c6))),saveSessionContext({'llm_project':_0x26373c['projectName']},_0x20e1b6[_0x57942c(0x20c)]),console['log'](a4_0x16ef45[_0x57942c(0x1bf)]('✔\x20Context\x20set:\x20'+a4_0x16ef45['dim'](_0x57942c(0x1e1))+'\x20=\x20'+a4_0x16ef45[_0x57942c(0x23d)](_0x26373c[_0x57942c(0x22b)]))),0x0;if(!_0x313e26&&!_0x4b2e91){if(!isInteractive())return console['error'](a4_0x16ef45[_0x57942c(0x243)](_0x57942c(0x1e9)),_0x57942c(0x196)),console['error'](a4_0x16ef45['dim'](_0x57942c(0x198))),0x1;const _0x3ac6b7=await confirmKey(_0x57942c(0x22a)+(_0x32b5ba+_0x1985ff)+_0x57942c(0x1fd));if(!_0x3ac6b7)return console[_0x57942c(0x20e)](a4_0x16ef45[_0x57942c(0x203)](_0x57942c(0x234)),_0x57942c(0x1a8)),0x1;}const {data:_0x4fea0d}=await withSpinner(_0x57942c(0x1e6),()=>_0x148395[_0x57942c(0x1c4)][_0x57942c(0x21a)](_0x240aa9,_0x34a936,{'force':_0x4b2e91}));return console[_0x57942c(0x20e)](a4_0x16ef45[_0x57942c(0x1bf)]('\x0a✔\x20Pulled\x20'+(_0x32b5ba+_0x1985ff)+_0x57942c(0x212)+_0x4fea0d['outputDir'])),saveSessionContext({'llm_project':_0x4fea0d[_0x57942c(0x22b)]},_0x20e1b6[_0x57942c(0x20c)]),console[_0x57942c(0x20e)](a4_0x16ef45[_0x57942c(0x1bf)](_0x57942c(0x1f2)+a4_0x16ef45['dim'](_0x57942c(0x1e1))+'\x20=\x20'+a4_0x16ef45[_0x57942c(0x23d)](_0x4fea0d[_0x57942c(0x22b)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x2bd6c2(0x232)]=a4_0x2bd6c2(0x22c);[a4_0x2bd6c2(0x1c0)]=a4_0x2bd6c2(0x195);async['execute'](_0x19b8c4){const _0x21f6b8=a4_0x2bd6c2,{options:_0x412c70,args:_0x2f54c7,tdx:_0x440a88}=_0x19b8c4,_0x5442fd=_0x2f54c7[0x0],_0x1ba377=_0x412c70[_0x21f6b8(0x232)],_0x5b16e5=_0x412c70[_0x21f6b8(0x19c)],_0x4a65b1=_0x412c70[_0x21f6b8(0x1be)],_0xfb8699=_0x412c70[_0x21f6b8(0x1f4)],_0x8de3e0=_0x412c70['llmProject'];let _0x183b77;const _0x3a2250=findAgentConfigPath(process[_0x21f6b8(0x1bd)]());if(_0x5442fd){const _0x561fd5=a4_0x34ce8e['join'](_0x5442fd,_0x21f6b8(0x1aa));existsSync(_0x561fd5)?(_0x183b77=_0x5442fd,console['log'](a4_0x16ef45[_0x21f6b8(0x20b)](_0x21f6b8(0x1ba)+_0x5442fd))):_0x183b77=_0x5442fd;}else{if(_0x3a2250)_0x183b77=a4_0x34ce8e[_0x21f6b8(0x1d5)](_0x3a2250),console['log'](a4_0x16ef45[_0x21f6b8(0x20b)](_0x21f6b8(0x1b0)+_0x183b77));else{if(_0x8de3e0){const _0x1c8448=sanitizeForFilesystem(_0x8de3e0);let _0x51d7fe=_0x1c8448,_0x3365fb=a4_0x34ce8e[_0x21f6b8(0x230)](process[_0x21f6b8(0x1bd)](),_0x21f6b8(0x1b3),_0x1c8448,_0x21f6b8(0x1aa));if(!existsSync(_0x3365fb)){const _0x3e94e5=normalizeName(_0x8de3e0),_0x3e3f20=a4_0x34ce8e[_0x21f6b8(0x230)](process[_0x21f6b8(0x1bd)](),_0x21f6b8(0x1b3),_0x3e94e5,_0x21f6b8(0x1aa));existsSync(_0x3e3f20)&&(_0x51d7fe=_0x3e94e5,_0x3365fb=_0x3e3f20);}if(existsSync(_0x3365fb))_0x183b77=a4_0x34ce8e['dirname'](_0x3365fb),console['log'](a4_0x16ef45['dim'](_0x21f6b8(0x1ba)+_0x183b77));else{const _0x137830=_0x412c70[_0x21f6b8(0x238)];if(_0x137830)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Cannot\x20clone\x20from\x20context\x20project\x20\x22'+_0x8de3e0+'\x22\x20to\x20a\x20different\x20profile',undefined,{'helpText':_0x21f6b8(0x19a)+'First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a'+(_0x21f6b8(0x1ac)+_0x8de3e0+'\x0a')+('\x20\x20tdx\x20agent\x20clone\x20agents/'+_0x51d7fe+_0x21f6b8(0x1cc)+(_0x1ba377||_0x21f6b8(0x1ca))+_0x21f6b8(0x22e)+_0x137830)});_0x183b77=_0x8de3e0,console['log'](a4_0x16ef45[_0x21f6b8(0x20b)](_0x21f6b8(0x1ce)+_0x8de3e0));}}}}if(!_0x183b77)return console[_0x21f6b8(0x20e)](a4_0x16ef45[_0x21f6b8(0x203)](_0x21f6b8(0x1b1))),console[_0x21f6b8(0x20e)]('\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project'),console[_0x21f6b8(0x20e)](_0x21f6b8(0x1dc)),console[_0x21f6b8(0x20e)]('\x20\x20tdx\x20agent\x20clone\x20--name\x20<new-name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clone\x20from\x20context\x20(llm_project)'),console[_0x21f6b8(0x20e)](_0x21f6b8(0x1ff)),0x1;if(!_0x1ba377)throw new SDKError(ErrorCode['MISSING_ARGUMENT'],_0x21f6b8(0x211),undefined,{'helpText':_0x21f6b8(0x202)});if(!_0x4a65b1&&!_0x5b16e5){if(!isInteractive())return console[_0x21f6b8(0x1ae)](a4_0x16ef45['red'](_0x21f6b8(0x1e9)),_0x21f6b8(0x196)),console['error'](a4_0x16ef45['dim'](_0x21f6b8(0x198))),0x1;const _0x5ab7da=await confirmKey('Clone\x20\x22'+_0x183b77+_0x21f6b8(0x222)+_0x1ba377+'\x22?');if(!_0x5ab7da)return console[_0x21f6b8(0x20e)](a4_0x16ef45[_0x21f6b8(0x203)](_0x21f6b8(0x234))),0x1;}const {data:_0x5b4a7b}=await withSpinner(_0x21f6b8(0x242)+_0x183b77+'\x22\x20to\x20\x22'+_0x1ba377+_0x21f6b8(0x228),()=>_0x440a88['llm'][_0x21f6b8(0x1a4)](_0x183b77,_0x1ba377,{'dryRun':_0x5b16e5}));if(_0x5b16e5){console[_0x21f6b8(0x20e)](a4_0x16ef45[_0x21f6b8(0x203)](_0x21f6b8(0x1b6))),console[_0x21f6b8(0x20e)](_0x21f6b8(0x1fc)+_0x5b4a7b['sourceProjectName']),console[_0x21f6b8(0x20e)]('New\x20project:\x20'+_0x1ba377),console[_0x21f6b8(0x20e)](_0x21f6b8(0x1c3)),console[_0x21f6b8(0x20e)]('\x20\x20Agents:\x20'+_0x5b4a7b[_0x21f6b8(0x1ad)][_0x21f6b8(0x1b3)][_0x21f6b8(0x1ab)]),console['log'](_0x21f6b8(0x1e0)+_0x5b4a7b[_0x21f6b8(0x1ad)][_0x21f6b8(0x235)][_0x21f6b8(0x1ab)]),console[_0x21f6b8(0x20e)](_0x21f6b8(0x20f)+_0x5b4a7b[_0x21f6b8(0x1ad)][_0x21f6b8(0x21e)][_0x21f6b8(0x1ab)]);const _0x3473b5=_0x5b4a7b[_0x21f6b8(0x1ad)][_0x21f6b8(0x218)]['created']>0x0||_0x5b4a7b[_0x21f6b8(0x1ad)]['experimentalArtifacts'][_0x21f6b8(0x1ab)]>0x0;return _0x3473b5&&(console[_0x21f6b8(0x20e)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+_0x5b4a7b[_0x21f6b8(0x1ad)][_0x21f6b8(0x218)]['created']),console['log'](_0x21f6b8(0x18e)+_0x5b4a7b['counts'][_0x21f6b8(0x224)][_0x21f6b8(0x1ab)])),0x0;}const _0x517987=_0x5b4a7b[_0x21f6b8(0x1ad)][_0x21f6b8(0x1b3)][_0x21f6b8(0x1ea)]>0x0||_0x5b4a7b[_0x21f6b8(0x1ad)][_0x21f6b8(0x235)][_0x21f6b8(0x1ea)]>0x0||_0x5b4a7b[_0x21f6b8(0x1ad)][_0x21f6b8(0x21e)][_0x21f6b8(0x1ea)]>0x0||_0x5b4a7b[_0x21f6b8(0x1ad)]['experimentalKnowledgeBases']['errors']>0x0||_0x5b4a7b[_0x21f6b8(0x1ad)]['experimentalArtifacts'][_0x21f6b8(0x1ea)]>0x0;_0x517987?console[_0x21f6b8(0x20e)](a4_0x16ef45[_0x21f6b8(0x203)](_0x21f6b8(0x192))):console[_0x21f6b8(0x20e)](a4_0x16ef45[_0x21f6b8(0x1bf)](_0x21f6b8(0x1f1)));console[_0x21f6b8(0x20e)](_0x21f6b8(0x1fc)+_0x5b4a7b[_0x21f6b8(0x223)]),console['log'](_0x21f6b8(0x1c2)+_0x5b4a7b[_0x21f6b8(0x1fa)]),console['log'](_0x21f6b8(0x207)+_0x5b4a7b[_0x21f6b8(0x1bb)]),console['log'](),console['log'](_0x21f6b8(0x1d2)),console[_0x21f6b8(0x20e)](_0x21f6b8(0x239)+formatCountSummary(_0x5b4a7b['counts'][_0x21f6b8(0x1b3)])),console[_0x21f6b8(0x20e)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x5b4a7b[_0x21f6b8(0x1ad)]['knowledgeBases'])),console['log'](_0x21f6b8(0x20f)+formatCountSummary(_0x5b4a7b['counts']['prompts'])),console[_0x21f6b8(0x20e)](_0x21f6b8(0x1d1)+formatCountSummary(_0x5b4a7b[_0x21f6b8(0x1ad)][_0x21f6b8(0x231)]));const _0x2de6dc=_0x5b4a7b[_0x21f6b8(0x1ad)][_0x21f6b8(0x218)][_0x21f6b8(0x1ab)]>0x0||_0x5b4a7b[_0x21f6b8(0x1ad)][_0x21f6b8(0x218)][_0x21f6b8(0x241)]>0x0||_0x5b4a7b['counts'][_0x21f6b8(0x218)][_0x21f6b8(0x213)]>0x0||_0x5b4a7b['counts']['experimentalArtifacts'][_0x21f6b8(0x1ab)]>0x0||_0x5b4a7b['counts'][_0x21f6b8(0x224)][_0x21f6b8(0x241)]>0x0||_0x5b4a7b[_0x21f6b8(0x1ad)][_0x21f6b8(0x224)][_0x21f6b8(0x213)]>0x0;_0x2de6dc&&(console['log'](_0x21f6b8(0x1de)+formatCountSummary(_0x5b4a7b[_0x21f6b8(0x1ad)][_0x21f6b8(0x218)])),console[_0x21f6b8(0x20e)](_0x21f6b8(0x18e)+formatCountSummary(_0x5b4a7b[_0x21f6b8(0x1ad)][_0x21f6b8(0x224)])));if(_0x517987){console[_0x21f6b8(0x20e)](),console[_0x21f6b8(0x20e)](a4_0x16ef45[_0x21f6b8(0x243)](_0x21f6b8(0x1fe)));for(const _0x5b6349 of _0x5b4a7b['agents']){_0x5b6349[_0x21f6b8(0x1d0)]===_0x21f6b8(0x1ae)&&console['log'](a4_0x16ef45[_0x21f6b8(0x243)](_0x21f6b8(0x1b9)+_0x5b6349[_0x21f6b8(0x1a6)]+_0x21f6b8(0x1f3)+_0x5b6349[_0x21f6b8(0x1ae)]));}for(const _0x1faa48 of _0x5b4a7b[_0x21f6b8(0x235)]){_0x1faa48[_0x21f6b8(0x1d0)]===_0x21f6b8(0x1ae)&&console[_0x21f6b8(0x20e)](a4_0x16ef45['red'](_0x21f6b8(0x214)+_0x1faa48[_0x21f6b8(0x232)]+_0x21f6b8(0x1f3)+_0x1faa48[_0x21f6b8(0x1ae)]));}for(const _0x59c0eb of _0x5b4a7b['prompts']){_0x59c0eb[_0x21f6b8(0x1d0)]===_0x21f6b8(0x1ae)&&console[_0x21f6b8(0x20e)](a4_0x16ef45[_0x21f6b8(0x243)](_0x21f6b8(0x193)+_0x59c0eb[_0x21f6b8(0x232)]+_0x21f6b8(0x1f3)+_0x59c0eb[_0x21f6b8(0x1ae)]));}for(const _0x390e63 of _0x5b4a7b[_0x21f6b8(0x231)]){_0x390e63[_0x21f6b8(0x1d0)]===_0x21f6b8(0x1ae)&&console[_0x21f6b8(0x20e)](a4_0x16ef45['red']('\x20\x20Integration\x20\x22'+_0x390e63[_0x21f6b8(0x232)]+_0x21f6b8(0x1f3)+_0x390e63[_0x21f6b8(0x1ae)]));}for(const _0x5cdaab of _0x5b4a7b[_0x21f6b8(0x218)]){_0x5cdaab[_0x21f6b8(0x1d0)]==='error'&&console['log'](a4_0x16ef45['red'](_0x21f6b8(0x216)+_0x5cdaab['name']+_0x21f6b8(0x1f3)+_0x5cdaab[_0x21f6b8(0x1ae)]));}for(const _0x5b3dd6 of _0x5b4a7b[_0x21f6b8(0x224)]){_0x5b3dd6['action']==='error'&&console[_0x21f6b8(0x20e)](a4_0x16ef45['red']('\x20\x20Experimental\x20Artifact\x20\x22'+_0x5b3dd6['name']+_0x21f6b8(0x1f3)+_0x5b3dd6[_0x21f6b8(0x1ae)]));}return 0x1;}console[_0x21f6b8(0x20e)]();const _0x314974=getLLMProjectUrl(_0xfb8699,_0x5b4a7b[_0x21f6b8(0x1bb)]);return console[_0x21f6b8(0x20e)]('Project:\x20'+a4_0x16ef45[_0x21f6b8(0x23d)](_0x314974)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x2bd6c2(0x232)]=a4_0x2bd6c2(0x206);[a4_0x2bd6c2(0x1c0)]=a4_0x2bd6c2(0x22d);async[a4_0x2bd6c2(0x18d)](_0x37ac38){const _0x5dfbb0=a4_0x2bd6c2,{options:_0x271612,args:_0x173abe,tdx:_0x18997e}=_0x37ac38;let _0x1f63b6=_0x173abe[0x0]||process['cwd']();const _0x43fe18=_0x271612[_0x5dfbb0(0x19c)],_0x18322d=_0x271612['force'],_0x4124f4=_0x271612[_0x5dfbb0(0x1be)],_0x4a9c97=_0x271612[_0x5dfbb0(0x1f4)],_0x5cd2f3=a4_0x34ce8e['join'](_0x1f63b6,_0x5dfbb0(0x20d)),_0x1265c5=existsSync(_0x5cd2f3);if(_0x1265c5){const {data:_0x24c872}=await withSpinner(_0x5dfbb0(0x201)+_0x1f63b6+_0x5dfbb0(0x228),()=>_0x18997e[_0x5dfbb0(0x1c4)]['pushAgent'](_0x1f63b6,{'dryRun':_0x43fe18,'force':_0x18322d}));if(_0x43fe18)return console['log'](a4_0x16ef45['yellow'](_0x5dfbb0(0x1b6))),console[_0x5dfbb0(0x20e)](_0x5dfbb0(0x233)+_0x24c872[_0x5dfbb0(0x1a6)]),0x0;if(_0x24c872[_0x5dfbb0(0x1d0)]===_0x5dfbb0(0x1ae))return console[_0x5dfbb0(0x20e)](a4_0x16ef45[_0x5dfbb0(0x243)](_0x5dfbb0(0x1c5)+_0x24c872[_0x5dfbb0(0x1ae)])),0x1;console[_0x5dfbb0(0x20e)](a4_0x16ef45[_0x5dfbb0(0x1bf)](_0x5dfbb0(0x1cd)+_0x24c872[_0x5dfbb0(0x1d0)]+'\x20successfully')),console[_0x5dfbb0(0x20e)](_0x5dfbb0(0x22f)+_0x24c872[_0x5dfbb0(0x1a6)]);if(_0x24c872[_0x5dfbb0(0x1fb)]&&_0x24c872[_0x5dfbb0(0x204)]){const _0x531a56=getLLMAgentChatUrl(_0x4a9c97,_0x24c872[_0x5dfbb0(0x204)],_0x24c872[_0x5dfbb0(0x1fb)]);console[_0x5dfbb0(0x20e)](_0x5dfbb0(0x1df)+a4_0x16ef45[_0x5dfbb0(0x23d)](_0x531a56));}return 0x0;}const _0x3c113a=_0x271612[_0x5dfbb0(0x21f)],_0x563845=resolveProjectFromContext(_0x1f63b6,_0x3c113a);if(_0x563845[_0x5dfbb0(0x1d9)])_0x1f63b6=_0x563845[_0x5dfbb0(0x23c)],_0x563845[_0x5dfbb0(0x23b)]===_0x5dfbb0(0x236)&&console['log'](a4_0x16ef45[_0x5dfbb0(0x20b)](_0x5dfbb0(0x1ee)+_0x1f63b6));else{let _0x4cbbf0=_0x5dfbb0(0x1b2);_0x563845['reason']===_0x5dfbb0(0x21c)&&(_0x4cbbf0=_0x563845[_0x5dfbb0(0x205)]+_0x5dfbb0(0x1f8)+_0x563845[_0x5dfbb0(0x21f)]+_0x5dfbb0(0x1a9));throw new SDKError(ErrorCode[_0x5dfbb0(0x19e)],_0x563845['reason']===_0x5dfbb0(0x1af)?_0x563845['message']:_0x5dfbb0(0x1d3)+_0x1f63b6,undefined,{'helpText':_0x4cbbf0});}const {data:_0x4aa480}=await withSpinner(_0x5dfbb0(0x191),()=>_0x18997e[_0x5dfbb0(0x1c4)][_0x5dfbb0(0x1ef)](_0x1f63b6,{'dryRun':!![]})),_0x402add=_0x4aa480['counts'][_0x5dfbb0(0x1b3)]['errors']>0x0;if(_0x402add){console[_0x5dfbb0(0x20e)](a4_0x16ef45['red']('\x0aErrors\x20found:'));for(const _0x318f4e of _0x4aa480['agents']){_0x318f4e['action']===_0x5dfbb0(0x1ae)&&console[_0x5dfbb0(0x20e)](a4_0x16ef45[_0x5dfbb0(0x243)](_0x5dfbb0(0x1b9)+_0x318f4e[_0x5dfbb0(0x1a6)]+'\x22:\x20'+_0x318f4e[_0x5dfbb0(0x1ae)]));}return 0x1;}const _0x545903=_0x4aa480[_0x5dfbb0(0x1ad)][_0x5dfbb0(0x1b3)][_0x5dfbb0(0x1ab)]+_0x4aa480[_0x5dfbb0(0x1ad)][_0x5dfbb0(0x235)]['created']+_0x4aa480[_0x5dfbb0(0x1ad)][_0x5dfbb0(0x1cb)][_0x5dfbb0(0x1ab)]+_0x4aa480[_0x5dfbb0(0x1ad)][_0x5dfbb0(0x21e)]['created']+_0x4aa480['counts'][_0x5dfbb0(0x231)][_0x5dfbb0(0x1ab)]+_0x4aa480[_0x5dfbb0(0x1ad)][_0x5dfbb0(0x218)][_0x5dfbb0(0x1ab)]+_0x4aa480[_0x5dfbb0(0x1ad)][_0x5dfbb0(0x224)][_0x5dfbb0(0x1ab)],_0x47dcad=_0x4aa480['counts'][_0x5dfbb0(0x1b3)][_0x5dfbb0(0x241)]+_0x4aa480['counts'][_0x5dfbb0(0x235)][_0x5dfbb0(0x241)]+_0x4aa480['counts'][_0x5dfbb0(0x1cb)]['updated']+_0x4aa480[_0x5dfbb0(0x1ad)][_0x5dfbb0(0x21e)][_0x5dfbb0(0x241)]+_0x4aa480['counts'][_0x5dfbb0(0x231)][_0x5dfbb0(0x241)]+_0x4aa480[_0x5dfbb0(0x1ad)][_0x5dfbb0(0x218)][_0x5dfbb0(0x241)]+_0x4aa480[_0x5dfbb0(0x1ad)][_0x5dfbb0(0x224)][_0x5dfbb0(0x241)],_0x976da4=_0x4aa480[_0x5dfbb0(0x1ad)][_0x5dfbb0(0x1b3)][_0x5dfbb0(0x213)]+_0x4aa480['counts'][_0x5dfbb0(0x235)][_0x5dfbb0(0x213)]+_0x4aa480['counts'][_0x5dfbb0(0x1cb)]['unchanged']+_0x4aa480[_0x5dfbb0(0x1ad)]['prompts']['unchanged']+_0x4aa480[_0x5dfbb0(0x1ad)][_0x5dfbb0(0x231)][_0x5dfbb0(0x213)]+_0x4aa480[_0x5dfbb0(0x1ad)][_0x5dfbb0(0x218)][_0x5dfbb0(0x213)]+_0x4aa480['counts'][_0x5dfbb0(0x224)][_0x5dfbb0(0x213)];console[_0x5dfbb0(0x20e)](_0x5dfbb0(0x1e5)+_0x4aa480[_0x5dfbb0(0x22b)]+'\x27:'),console['log']('\x20\x20'+a4_0x16ef45[_0x5dfbb0(0x1bf)]('+\x20'+_0x545903+_0x5dfbb0(0x217))+_0x5dfbb0(0x23e)+a4_0x16ef45[_0x5dfbb0(0x203)]('~\x20'+_0x47dcad+_0x5dfbb0(0x226))+_0x5dfbb0(0x23e)+a4_0x16ef45[_0x5dfbb0(0x20b)]('=\x20'+_0x976da4+_0x5dfbb0(0x215))),console[_0x5dfbb0(0x20e)](_0x5dfbb0(0x239)+formatCountSummary(_0x4aa480[_0x5dfbb0(0x1ad)][_0x5dfbb0(0x1b3)])),console[_0x5dfbb0(0x20e)](_0x5dfbb0(0x1e0)+formatCountSummary(_0x4aa480[_0x5dfbb0(0x1ad)][_0x5dfbb0(0x235)])),console[_0x5dfbb0(0x20e)](_0x5dfbb0(0x194)+formatCountSummary(_0x4aa480['counts'][_0x5dfbb0(0x1cb)])),console[_0x5dfbb0(0x20e)](_0x5dfbb0(0x20f)+formatCountSummary(_0x4aa480[_0x5dfbb0(0x1ad)][_0x5dfbb0(0x21e)])),console[_0x5dfbb0(0x20e)](_0x5dfbb0(0x1d1)+formatCountSummary(_0x4aa480['counts']['integrations']));const _0x3b9a8a=_0x4aa480[_0x5dfbb0(0x1ad)][_0x5dfbb0(0x218)]['created']>0x0||_0x4aa480[_0x5dfbb0(0x1ad)][_0x5dfbb0(0x218)][_0x5dfbb0(0x241)]>0x0||_0x4aa480[_0x5dfbb0(0x1ad)]['experimentalKnowledgeBases'][_0x5dfbb0(0x213)]>0x0||_0x4aa480[_0x5dfbb0(0x1ad)]['experimentalArtifacts'][_0x5dfbb0(0x1ab)]>0x0||_0x4aa480[_0x5dfbb0(0x1ad)][_0x5dfbb0(0x224)][_0x5dfbb0(0x241)]>0x0||_0x4aa480[_0x5dfbb0(0x1ad)][_0x5dfbb0(0x224)][_0x5dfbb0(0x213)]>0x0;_0x3b9a8a&&(console['log'](_0x5dfbb0(0x1de)+formatCountSummary(_0x4aa480[_0x5dfbb0(0x1ad)]['experimentalKnowledgeBases'])),console[_0x5dfbb0(0x20e)](_0x5dfbb0(0x18e)+formatCountSummary(_0x4aa480[_0x5dfbb0(0x1ad)][_0x5dfbb0(0x224)])));console[_0x5dfbb0(0x20e)]('\x20\x20Source:\x20'+a4_0x16ef45[_0x5dfbb0(0x23d)](_0x1f63b6)),displayDiffs(_0x4aa480[_0x5dfbb0(0x1b3)],_0x4aa480[_0x5dfbb0(0x235)],_0x4aa480[_0x5dfbb0(0x1cb)],_0x4aa480['prompts'],_0x4aa480[_0x5dfbb0(0x231)],_0x4aa480['experimentalKnowledgeBases'],_0x4aa480[_0x5dfbb0(0x224)]);if(_0x43fe18)return console[_0x5dfbb0(0x20e)](a4_0x16ef45[_0x5dfbb0(0x203)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed')),0x0;if(_0x545903===0x0&&_0x47dcad===0x0){console[_0x5dfbb0(0x20e)](a4_0x16ef45[_0x5dfbb0(0x1bf)](_0x5dfbb0(0x1bc)));const _0x3d8efa=getLLMProjectUrl(_0x4a9c97,_0x4aa480[_0x5dfbb0(0x204)]);return console[_0x5dfbb0(0x20e)]('Project:\x20'+a4_0x16ef45[_0x5dfbb0(0x23d)](_0x3d8efa)),0x0;}if(!_0x4124f4&&!_0x18322d){if(!isInteractive())return console[_0x5dfbb0(0x1ae)](a4_0x16ef45[_0x5dfbb0(0x243)]('\x0aError:'),_0x5dfbb0(0x196)),console['error'](a4_0x16ef45[_0x5dfbb0(0x20b)](_0x5dfbb0(0x198))),0x1;const _0x5e9452=await confirmKey(_0x5dfbb0(0x221)+(_0x545903+_0x47dcad)+'\x20resources?');if(!_0x5e9452)return console[_0x5dfbb0(0x20e)](a4_0x16ef45[_0x5dfbb0(0x203)](_0x5dfbb0(0x234)),_0x5dfbb0(0x190)),0x1;}const {data:_0x2ecfdc}=await withSpinner('Pushing\x20to\x20project...',()=>_0x18997e['llm'][_0x5dfbb0(0x1ef)](_0x1f63b6,{'force':_0x18322d})),_0x3e757a=_0x2ecfdc[_0x5dfbb0(0x1ad)][_0x5dfbb0(0x1b3)][_0x5dfbb0(0x1ea)]>0x0||_0x2ecfdc['counts'][_0x5dfbb0(0x235)][_0x5dfbb0(0x1ea)]>0x0||_0x2ecfdc[_0x5dfbb0(0x1ad)][_0x5dfbb0(0x1cb)][_0x5dfbb0(0x1ea)]>0x0||_0x2ecfdc['counts'][_0x5dfbb0(0x21e)][_0x5dfbb0(0x1ea)]>0x0;if(_0x3e757a){console[_0x5dfbb0(0x20e)](a4_0x16ef45[_0x5dfbb0(0x203)](_0x5dfbb0(0x225))),console[_0x5dfbb0(0x20e)](),console[_0x5dfbb0(0x20e)](a4_0x16ef45[_0x5dfbb0(0x243)](_0x5dfbb0(0x1fe)));for(const _0x21cec7 of _0x2ecfdc[_0x5dfbb0(0x1b3)]){_0x21cec7[_0x5dfbb0(0x1d0)]===_0x5dfbb0(0x1ae)&&console[_0x5dfbb0(0x20e)](a4_0x16ef45['red'](_0x5dfbb0(0x1b9)+_0x21cec7['agentName']+'\x22:\x20'+_0x21cec7[_0x5dfbb0(0x1ae)]));}for(const _0x23b465 of _0x2ecfdc[_0x5dfbb0(0x235)]){_0x23b465[_0x5dfbb0(0x1d0)]===_0x5dfbb0(0x1ae)&&console[_0x5dfbb0(0x20e)](a4_0x16ef45[_0x5dfbb0(0x243)](_0x5dfbb0(0x214)+_0x23b465['name']+_0x5dfbb0(0x1f3)+_0x23b465[_0x5dfbb0(0x1ae)]));}for(const _0x4edefa of _0x2ecfdc[_0x5dfbb0(0x1cb)]){_0x4edefa[_0x5dfbb0(0x1d0)]===_0x5dfbb0(0x1ae)&&console[_0x5dfbb0(0x20e)](a4_0x16ef45[_0x5dfbb0(0x243)](_0x5dfbb0(0x220)+_0x4edefa['name']+'\x22:\x20'+_0x4edefa[_0x5dfbb0(0x1ae)]));}for(const _0x443367 of _0x2ecfdc[_0x5dfbb0(0x21e)]){_0x443367['action']===_0x5dfbb0(0x1ae)&&console['log'](a4_0x16ef45['red'](_0x5dfbb0(0x193)+_0x443367[_0x5dfbb0(0x232)]+_0x5dfbb0(0x1f3)+_0x443367[_0x5dfbb0(0x1ae)]));}for(const _0x5b000a of _0x2ecfdc[_0x5dfbb0(0x231)]){_0x5b000a[_0x5dfbb0(0x1d0)]===_0x5dfbb0(0x1ae)&&console[_0x5dfbb0(0x20e)](a4_0x16ef45['red'](_0x5dfbb0(0x20a)+_0x5b000a['name']+_0x5dfbb0(0x1f3)+_0x5b000a[_0x5dfbb0(0x1ae)]));}return 0x1;}console[_0x5dfbb0(0x20e)](a4_0x16ef45[_0x5dfbb0(0x1bf)]('\x0a✔\x20Pushed\x20'+(_0x545903+_0x47dcad)+_0x5dfbb0(0x1c1)+_0x2ecfdc[_0x5dfbb0(0x22b)]+'\x27'));const _0x2304cb=getLLMProjectUrl(_0x4a9c97,_0x2ecfdc['projectId']);return console[_0x5dfbb0(0x20e)](_0x5dfbb0(0x1a3)+a4_0x16ef45[_0x5dfbb0(0x23d)](_0x2304cb)),0x0;}}
1
+ function a4_0x17ca(_0xa50518,_0x1e0b37){_0xa50518=_0xa50518-0x16c;const _0x274681=a4_0x2746();let _0x17ca38=_0x274681[_0xa50518];return _0x17ca38;}const a4_0x347051=a4_0x17ca;(function(_0x272bfd,_0x45b63a){const _0x2be592=a4_0x17ca,_0x4aa24b=_0x272bfd();while(!![]){try{const _0x2b8c5b=-parseInt(_0x2be592(0x1f9))/0x1*(parseInt(_0x2be592(0x18f))/0x2)+-parseInt(_0x2be592(0x18c))/0x3*(-parseInt(_0x2be592(0x20c))/0x4)+parseInt(_0x2be592(0x1ce))/0x5+-parseInt(_0x2be592(0x1ef))/0x6*(-parseInt(_0x2be592(0x1a3))/0x7)+-parseInt(_0x2be592(0x1c6))/0x8*(-parseInt(_0x2be592(0x1c0))/0x9)+parseInt(_0x2be592(0x1b1))/0xa+parseInt(_0x2be592(0x207))/0xb*(-parseInt(_0x2be592(0x1cc))/0xc);if(_0x2b8c5b===_0x45b63a)break;else _0x4aa24b['push'](_0x4aa24b['shift']());}catch(_0x1861b1){_0x4aa24b['push'](_0x4aa24b['shift']());}}}(a4_0x2746,0x23da8));import a4_0x53f3cc from'chalk';import a4_0x374f36 from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext,resolveAgentPullArgs}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0xbc142e){const _0x59d543=a4_0x17ca,_0x297701=[];if(_0xbc142e[_0x59d543(0x1b0)]!==undefined)_0x297701[_0x59d543(0x16d)](_0xbc142e[_0x59d543(0x1b0)]+_0x59d543(0x18e));if(_0xbc142e[_0x59d543(0x199)]!==undefined&&_0xbc142e['new']>0x0)_0x297701['push'](a4_0x53f3cc[_0x59d543(0x189)](_0xbc142e['new']+_0x59d543(0x1ac)));if(_0xbc142e[_0x59d543(0x204)]!==undefined&&_0xbc142e[_0x59d543(0x204)]>0x0)_0x297701[_0x59d543(0x16d)](a4_0x53f3cc[_0x59d543(0x189)](_0xbc142e['created']+_0x59d543(0x195)));if(_0xbc142e['updated']!==undefined&&_0xbc142e[_0x59d543(0x178)]>0x0)_0x297701['push'](a4_0x53f3cc[_0x59d543(0x1b7)](_0xbc142e[_0x59d543(0x178)]+_0x59d543(0x220)));if(_0xbc142e[_0x59d543(0x1e6)]!==undefined&&_0xbc142e[_0x59d543(0x1e6)]>0x0)_0x297701[_0x59d543(0x16d)](a4_0x53f3cc[_0x59d543(0x1ec)](_0xbc142e[_0x59d543(0x1e6)]+_0x59d543(0x176)));if(_0xbc142e[_0x59d543(0x1fc)]!==undefined&&_0xbc142e[_0x59d543(0x1fc)]>0x0)_0x297701['push'](a4_0x53f3cc[_0x59d543(0x187)](_0xbc142e[_0x59d543(0x1fc)]+'\x20errors'));return _0x297701['join'](',\x20');}function displayDiffs(_0x3cd27c,_0x36a229,_0xd192bc,_0x34a40c,_0x109ebd,_0x9f473c,_0x279b96){const _0x2e9282=a4_0x17ca;for(const _0xf8eb56 of _0x3cd27c){if(_0xf8eb56[_0x2e9282(0x1f4)]){const _0x3857d8=_0xf8eb56['agentName']||_0xf8eb56['name'];console[_0x2e9282(0x177)](_0x2e9282(0x1ba)+_0x3857d8+'\x27:'),console[_0x2e9282(0x177)]('─'[_0x2e9282(0x1a7)](0x3c)),console[_0x2e9282(0x177)](_0xf8eb56[_0x2e9282(0x1f4)]),console['log']('─'[_0x2e9282(0x1a7)](0x3c));}}for(const _0x1fbe4f of _0x36a229){_0x1fbe4f[_0x2e9282(0x1f4)]&&(console['log'](_0x2e9282(0x194)+_0x1fbe4f[_0x2e9282(0x1e7)]+'\x27:'),console[_0x2e9282(0x177)]('─'['repeat'](0x3c)),console[_0x2e9282(0x177)](_0x1fbe4f[_0x2e9282(0x1f4)]),console[_0x2e9282(0x177)]('─'[_0x2e9282(0x1a7)](0x3c)));}for(const _0x435be5 of _0xd192bc){_0x435be5[_0x2e9282(0x1f4)]&&(console['log'](_0x2e9282(0x203)+_0x435be5['name']+'\x27:'),console[_0x2e9282(0x177)]('─'[_0x2e9282(0x1a7)](0x3c)),console['log'](_0x435be5[_0x2e9282(0x1f4)]),console[_0x2e9282(0x177)]('─'[_0x2e9282(0x1a7)](0x3c)));}for(const _0x31afc9 of _0x34a40c){_0x31afc9[_0x2e9282(0x1f4)]&&(console[_0x2e9282(0x177)]('\x0aChanges\x20to\x20prompt\x20\x27'+_0x31afc9[_0x2e9282(0x1e7)]+'\x27:'),console[_0x2e9282(0x177)]('─'[_0x2e9282(0x1a7)](0x3c)),console['log'](_0x31afc9[_0x2e9282(0x1f4)]),console[_0x2e9282(0x177)]('─'['repeat'](0x3c)));}for(const _0x106a1a of _0x109ebd){_0x106a1a['diff']&&(console[_0x2e9282(0x177)](_0x2e9282(0x1a5)+_0x106a1a['name']+'\x27:'),console[_0x2e9282(0x177)]('─'['repeat'](0x3c)),console[_0x2e9282(0x177)](_0x106a1a[_0x2e9282(0x1f4)]),console['log']('─'[_0x2e9282(0x1a7)](0x3c)));}for(const _0x2260f6 of _0x9f473c){_0x2260f6[_0x2e9282(0x1f4)]&&(console[_0x2e9282(0x177)](_0x2e9282(0x209)+_0x2260f6[_0x2e9282(0x1e7)]+'\x27:'),console[_0x2e9282(0x177)]('─'[_0x2e9282(0x1a7)](0x3c)),console[_0x2e9282(0x177)](_0x2260f6['diff']),console['log']('─'[_0x2e9282(0x1a7)](0x3c)));}for(const _0x2c9c39 of _0x279b96){_0x2c9c39['diff']&&(console[_0x2e9282(0x177)](_0x2e9282(0x1c4)+_0x2c9c39[_0x2e9282(0x1e7)]+'\x27:'),console['log']('─'['repeat'](0x3c)),console[_0x2e9282(0x177)](_0x2c9c39[_0x2e9282(0x1f4)]),console[_0x2e9282(0x177)]('─'[_0x2e9282(0x1a7)](0x3c)));}}function a4_0x2746(){const _0x383b43=['agent:push','outputDir','Using\x20project\x20from\x20','\x20updated','message','push','INVALID_ARGUMENT','projectName','context','\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','agent','Cannot\x20clone\x20from\x20context\x20project\x20\x22','Agent:\x20','dim','\x20unchanged','log','updated','experimentalKnowledgeBases','pushProject','cyan','\x22\x20to\x20a\x20different\x20profile','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','pullAgent','\x0aErrors\x20found:','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','Dry\x20run\x20-\x20no\x20changes\x20made','\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','llm','Output\x20path:\x20','red','dirname','green','cwd-config','sourceProjectName','149943IQeuJh','yes','\x20total','53796NoeeAq','outputPath','counts','Output:\x20','Source:\x20','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','\x20created','\x22:\x20','New\x20project\x20ID:\x20','\x0aPush\x20summary\x20for\x20\x27','new','Status:\x20','MISSING_ARGUMENT','join','\x20\x20Knowledge\x20Base\x20\x22','textKnowledgeBases','\x0aPush\x20','Summary:','\x0aError:','\x20\x20Integrations:\x20','1531327IGNcAM','Analyzing\x20project\x20\x22','\x0aChanges\x20to\x20integration\x20\x27','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','repeat','\x0aProject\x20pushed\x20with\x20errors','agentName','error','Pushing\x20agent\x20from\x20\x22','\x20new','\x20\x20Agents:\x20','\x20\x20tdx\x20agent\x20pull\x20','\x20\x20Integration\x20\x22','total','2160630TrbRbT','Project:\x20','\x0aChanges:','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','description','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','yellow','\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','New\x20project\x20name\x20is\x20required','\x0aChanges\x20to\x20agent\x20\x27','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','\x20--profile\x20','Errors:','\x20--name\x20','\x20\x20Knowledge\x20Bases:\x20','477nbNOyx','Would\x20push\x20agent:\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','parse','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','168UHSpAw','Chat:\x20','\x20|\x20','hasChanges','\x20resources?','agentId','12PPtQuW','experimentalArtifacts','1251800rbjcnM','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','Pulling\x20agent\x20\x22','\x20\x20tdx\x20agent\x20clone\x20agents/','llmProject','output','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','\x20\x20Text\x20Knowledge\x20Base\x20\x22','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20\x20Source:\x20','agents','agent.yml','site','tdx.json','-\x20no\x20files\x20written','\x20\x20Text\x20Knowledge\x20Bases:\x20','\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)','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','\x20=\x20','\x0a✔\x20Pushed\x20','\x20\x20Prompts:\x20','utf-8','prompts','Using\x20local\x20project:\x20','unchanged','name','\x20changed','Pushing\x20to\x20project...','llm_project','\x22\x20to\x20new\x20project\x20\x22','gray','✔\x20Context\x20set:\x20','\x20files?','6yfQTTS','-\x20nothing\x20pushed','integrations','Cancelled','agent:pull','diff','knowledgeBases','found','newProjectId','\x20\x20Experimental\x20Artifact\x20\x22','10WeDwKA','\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','cloneProject','errors','source','isNew','Using\x20project:\x20','New\x20project:\x20','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','session','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','created','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','force','4074653XQxpAa','newProjectName','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','\x22...','cwd','8LCgIxZ','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','Using\x20current\x20project:\x20','Would\x20clone:','No\x20tdx.json\x20found\x20in\x20','dryRun','\x0a✔\x20Pulled\x20','projectId','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','Analyzing\x20changes\x20to\x20push...','execute','\x20\x20Experimental\x20Artifacts:\x20','reason','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','action','\x20resources\x20to\x20\x27','\x20\x20Agent\x20\x22'];a4_0x2746=function(){return _0x383b43;};return a4_0x2746();}export class AgentPullCommand extends BaseCommand{[a4_0x347051(0x1e7)]=a4_0x347051(0x1f3);[a4_0x347051(0x1b5)]='Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files';async[a4_0x347051(0x216)](_0x3c8928){const _0x2bae98=a4_0x347051,{options:_0x5f0215,args:_0x37194e,tdx:_0x2b0c96}=_0x3c8928,_0x43ae0c=_0x37194e[0x0],_0x53685b=_0x37194e[0x1],_0x5158c3=_0x5f0215[_0x2bae98(0x1d3)],_0x2da4c9=_0x5f0215['dryRun'],_0x1a37b3=_0x5f0215[_0x2bae98(0x206)],_0x461123=_0x5f0215[_0x2bae98(0x18d)],_0x53cf2a=_0x5f0215['llmProject'],_0x4cfc15=_0x5f0215[_0x2bae98(0x172)];let _0x2c2e01;if(_0x43ae0c){const _0x5aa942=a4_0x374f36[_0x2bae98(0x19c)](_0x43ae0c,_0x2bae98(0x1db));if(existsSync(_0x5aa942))try{const _0x297be9=JSON['parse'](readFileSync(_0x5aa942,_0x2bae98(0x1e3)));_0x297be9['llm_project']&&(_0x2c2e01={'llm_project':_0x297be9[_0x2bae98(0x1ea)]});}catch{}}const _0x43a35d=findAgentConfigPath(process[_0x2bae98(0x20b)]());let _0x4e2fea;if(_0x43a35d)try{const _0x2906be=JSON[_0x2bae98(0x1c3)](readFileSync(_0x43a35d,_0x2bae98(0x1e3)));_0x2906be[_0x2bae98(0x1ea)]&&(_0x4e2fea={'llm_project':_0x2906be[_0x2bae98(0x1ea)]});}catch{}const _0x1bcaa1=resolveAgentPullArgs({'arg':_0x43ae0c,'agentNameArg':_0x53685b,'agentFlag':_0x4cfc15,'contextProject':_0x53cf2a,'argDirConfig':_0x2c2e01,'cwdConfigPath':_0x43a35d||undefined,'cwdConfig':_0x4e2fea}),{projectNameOrId:_0x252428,targetAgentName:_0x1afdfe,existingOutputDir:_0x1e0879,source:_0x4e50ee}=_0x1bcaa1;if(_0x4e50ee==='arg-dir')console[_0x2bae98(0x177)](a4_0x53f3cc[_0x2bae98(0x175)](_0x2bae98(0x21f)+a4_0x374f36['join'](_0x43ae0c,_0x2bae98(0x1db))+':\x20'+_0x252428));else{if(_0x4e50ee===_0x2bae98(0x18a))console[_0x2bae98(0x177)](a4_0x53f3cc[_0x2bae98(0x175)](_0x2bae98(0x1ff)+_0x252428));else _0x4e50ee==='context'&&console[_0x2bae98(0x177)](a4_0x53f3cc[_0x2bae98(0x175)]('Using\x20project\x20from\x20context:\x20'+_0x252428));}if(!_0x252428)return _0x4cfc15?(console['log'](a4_0x53f3cc['yellow'](_0x2bae98(0x181))),console[_0x2bae98(0x177)](_0x2bae98(0x182)),console[_0x2bae98(0x177)](_0x2bae98(0x1cf))):(console[_0x2bae98(0x177)](a4_0x53f3cc[_0x2bae98(0x1b7)](_0x2bae98(0x205))),console[_0x2bae98(0x177)]('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[_0x2bae98(0x177)](_0x2bae98(0x184)),console[_0x2bae98(0x177)](_0x2bae98(0x1b8)),console[_0x2bae98(0x177)](_0x2bae98(0x1fa)),console['log'](_0x2bae98(0x171))),0x1;if(_0x1afdfe){const {data:_0xf2e226}=await withSpinner(_0x2bae98(0x1d0)+_0x1afdfe+'\x22\x20from\x20project\x20\x22'+_0x252428+_0x2bae98(0x20a),()=>_0x2b0c96[_0x2bae98(0x185)][_0x2bae98(0x17e)](_0x252428,_0x1afdfe,_0x5158c3,{'dryRun':_0x2da4c9,'force':_0x1a37b3}));if(_0x2da4c9)return console['log'](a4_0x53f3cc['yellow']('Dry\x20run\x20-\x20no\x20files\x20written')),console['log']('Would\x20pull\x20agent:\x20'+_0xf2e226[_0x2bae98(0x1a9)]),console['log'](_0x2bae98(0x186)+_0xf2e226['outputPath']),_0xf2e226[_0x2bae98(0x1f4)]&&(console['log'](_0x2bae98(0x1b3)),console[_0x2bae98(0x177)]('─'[_0x2bae98(0x1a7)](0x3c)),console[_0x2bae98(0x177)](_0xf2e226[_0x2bae98(0x1f4)]),console[_0x2bae98(0x177)]('─'['repeat'](0x3c))),0x0;return console[_0x2bae98(0x177)](a4_0x53f3cc[_0x2bae98(0x189)]('Agent\x20pulled\x20successfully')),console[_0x2bae98(0x177)]('Agent:\x20'+_0xf2e226['agentName']),console[_0x2bae98(0x177)](_0x2bae98(0x192)+_0xf2e226[_0x2bae98(0x190)]),console[_0x2bae98(0x177)](_0x2bae98(0x19a)+(_0xf2e226[_0x2bae98(0x1fe)]?a4_0x53f3cc[_0x2bae98(0x189)](_0x2bae98(0x199)):_0xf2e226[_0x2bae98(0x1c9)]?a4_0x53f3cc[_0x2bae98(0x1b7)](_0x2bae98(0x178)):a4_0x53f3cc['gray'](_0x2bae98(0x1e6)))),0x0;}const _0x1b0e48=_0x1e0879||_0x5158c3,{data:_0x469ab2}=await withSpinner(_0x2bae98(0x1a4)+_0x252428+'\x22...',()=>_0x2b0c96[_0x2bae98(0x185)]['pullProject'](_0x252428,_0x1b0e48,{'dryRun':!![]})),_0x32bab9=_0x469ab2[_0x2bae98(0x191)][_0x2bae98(0x1d8)][_0x2bae98(0x199)]+_0x469ab2[_0x2bae98(0x191)]['knowledgeBases']['new']+_0x469ab2[_0x2bae98(0x191)][_0x2bae98(0x19e)][_0x2bae98(0x199)]+_0x469ab2[_0x2bae98(0x191)]['prompts'][_0x2bae98(0x199)]+_0x469ab2[_0x2bae98(0x191)][_0x2bae98(0x1f1)][_0x2bae98(0x199)]+_0x469ab2[_0x2bae98(0x191)]['experimentalKnowledgeBases'][_0x2bae98(0x199)]+_0x469ab2[_0x2bae98(0x191)][_0x2bae98(0x1cd)][_0x2bae98(0x199)],_0x3b6ef6=_0x469ab2[_0x2bae98(0x191)][_0x2bae98(0x1d8)][_0x2bae98(0x178)]+_0x469ab2['counts'][_0x2bae98(0x1f5)][_0x2bae98(0x178)]+_0x469ab2[_0x2bae98(0x191)][_0x2bae98(0x19e)]['updated']+_0x469ab2[_0x2bae98(0x191)][_0x2bae98(0x1e4)][_0x2bae98(0x178)]+_0x469ab2[_0x2bae98(0x191)]['integrations'][_0x2bae98(0x178)]+_0x469ab2[_0x2bae98(0x191)][_0x2bae98(0x179)]['updated']+_0x469ab2[_0x2bae98(0x191)][_0x2bae98(0x1cd)]['updated'],_0x57fc26=_0x469ab2[_0x2bae98(0x191)][_0x2bae98(0x1d8)]['unchanged']+_0x469ab2[_0x2bae98(0x191)]['knowledgeBases'][_0x2bae98(0x1e6)]+_0x469ab2[_0x2bae98(0x191)]['textKnowledgeBases']['unchanged']+_0x469ab2[_0x2bae98(0x191)][_0x2bae98(0x1e4)][_0x2bae98(0x1e6)]+_0x469ab2['counts'][_0x2bae98(0x1f1)]['unchanged']+_0x469ab2[_0x2bae98(0x191)][_0x2bae98(0x179)][_0x2bae98(0x1e6)]+_0x469ab2[_0x2bae98(0x191)][_0x2bae98(0x1cd)]['unchanged'];console[_0x2bae98(0x177)]('\x0aPull\x20summary\x20for\x20\x27'+_0x469ab2[_0x2bae98(0x16f)]+'\x27:'),console['log']('\x20\x20'+a4_0x53f3cc[_0x2bae98(0x189)]('+\x20'+_0x32bab9+_0x2bae98(0x1ac))+'\x20|\x20'+a4_0x53f3cc[_0x2bae98(0x1b7)]('~\x20'+_0x3b6ef6+_0x2bae98(0x1e8))+_0x2bae98(0x1c8)+a4_0x53f3cc[_0x2bae98(0x175)]('=\x20'+_0x57fc26+_0x2bae98(0x176))),console[_0x2bae98(0x177)]('\x20\x20Agents:\x20'+formatCountSummary(_0x469ab2[_0x2bae98(0x191)][_0x2bae98(0x1d8)])),console[_0x2bae98(0x177)](_0x2bae98(0x1bf)+formatCountSummary(_0x469ab2['counts'][_0x2bae98(0x1f5)])),console[_0x2bae98(0x177)](_0x2bae98(0x1dd)+formatCountSummary(_0x469ab2['counts'][_0x2bae98(0x19e)])),console[_0x2bae98(0x177)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x469ab2[_0x2bae98(0x191)][_0x2bae98(0x1e4)])),console[_0x2bae98(0x177)](_0x2bae98(0x1a2)+formatCountSummary(_0x469ab2[_0x2bae98(0x191)][_0x2bae98(0x1f1)]));const _0x4371c1=_0x469ab2[_0x2bae98(0x191)][_0x2bae98(0x179)]['total']>0x0||_0x469ab2[_0x2bae98(0x191)][_0x2bae98(0x1cd)]['total']>0x0;_0x4371c1&&(console['log']('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x469ab2[_0x2bae98(0x191)]['experimentalKnowledgeBases'])),console[_0x2bae98(0x177)](_0x2bae98(0x217)+formatCountSummary(_0x469ab2['counts'][_0x2bae98(0x1cd)])));console[_0x2bae98(0x177)]('\x20\x20Target:\x20'+a4_0x53f3cc[_0x2bae98(0x17b)](_0x469ab2['outputDir'])),displayDiffs(_0x469ab2[_0x2bae98(0x1d8)],_0x469ab2[_0x2bae98(0x1f5)],_0x469ab2['textKnowledgeBases'],_0x469ab2[_0x2bae98(0x1e4)],_0x469ab2[_0x2bae98(0x1f1)],_0x469ab2[_0x2bae98(0x179)],_0x469ab2[_0x2bae98(0x1cd)]);if(_0x2da4c9)return console[_0x2bae98(0x177)](a4_0x53f3cc[_0x2bae98(0x1b7)](_0x2bae98(0x1d4))),0x0;if(_0x32bab9===0x0&&_0x3b6ef6===0x0)return console[_0x2bae98(0x177)](a4_0x53f3cc['green'](_0x2bae98(0x1b6))),saveSessionContext({'llm_project':_0x469ab2[_0x2bae98(0x16f)]},_0x5f0215[_0x2bae98(0x202)]),console['log'](a4_0x53f3cc[_0x2bae98(0x189)]('✔\x20Context\x20set:\x20'+a4_0x53f3cc['dim'](_0x2bae98(0x1ea))+_0x2bae98(0x1e0)+a4_0x53f3cc[_0x2bae98(0x17b)](_0x469ab2[_0x2bae98(0x16f)]))),0x0;if(!_0x461123&&!_0x1a37b3){if(!isInteractive())return console[_0x2bae98(0x1aa)](a4_0x53f3cc[_0x2bae98(0x187)]('\x0aError:'),_0x2bae98(0x1d6)),console[_0x2bae98(0x1aa)](a4_0x53f3cc[_0x2bae98(0x175)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x4e8b47=await confirmKey('\x0aWrite\x20'+(_0x32bab9+_0x3b6ef6)+_0x2bae98(0x1ee));if(!_0x4e8b47)return console[_0x2bae98(0x177)](a4_0x53f3cc['yellow'](_0x2bae98(0x1f2)),_0x2bae98(0x1dc)),0x1;}const {data:_0x97b896}=await withSpinner('Writing\x20files...',()=>_0x2b0c96[_0x2bae98(0x185)]['pullProject'](_0x252428,_0x1b0e48,{'force':_0x1a37b3}));return console[_0x2bae98(0x177)](a4_0x53f3cc[_0x2bae98(0x189)](_0x2bae98(0x212)+(_0x32bab9+_0x3b6ef6)+'\x20files\x20to\x20'+_0x97b896[_0x2bae98(0x21e)])),saveSessionContext({'llm_project':_0x97b896[_0x2bae98(0x16f)]},_0x5f0215[_0x2bae98(0x202)]),console[_0x2bae98(0x177)](a4_0x53f3cc[_0x2bae98(0x189)](_0x2bae98(0x1ed)+a4_0x53f3cc['dim']('llm_project')+_0x2bae98(0x1e0)+a4_0x53f3cc[_0x2bae98(0x17b)](_0x97b896[_0x2bae98(0x16f)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{['name']='agent:clone';[a4_0x347051(0x1b5)]='Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project';async[a4_0x347051(0x216)](_0x342f81){const _0x4c9986=a4_0x347051,{options:_0x1d331c,args:_0x9b70c7,tdx:_0x38e009}=_0x342f81,_0x4b5f21=_0x9b70c7[0x0],_0x148505=_0x1d331c[_0x4c9986(0x1e7)],_0x2390be=_0x1d331c[_0x4c9986(0x211)],_0x538c90=_0x1d331c[_0x4c9986(0x18d)],_0x138468=_0x1d331c['site'],_0x50dd54=_0x1d331c['llmProject'];let _0x5aa164;const _0x3cdc67=findAgentConfigPath(process[_0x4c9986(0x20b)]());if(_0x4b5f21){const _0x4d9622=a4_0x374f36['join'](_0x4b5f21,_0x4c9986(0x1db));existsSync(_0x4d9622)?(_0x5aa164=_0x4b5f21,console[_0x4c9986(0x177)](a4_0x53f3cc[_0x4c9986(0x175)](_0x4c9986(0x1e5)+_0x4b5f21))):_0x5aa164=_0x4b5f21;}else{if(_0x3cdc67)_0x5aa164=a4_0x374f36[_0x4c9986(0x188)](_0x3cdc67),console[_0x4c9986(0x177)](a4_0x53f3cc[_0x4c9986(0x175)](_0x4c9986(0x20e)+_0x5aa164));else{if(_0x50dd54){const _0x163c36=sanitizeForFilesystem(_0x50dd54);let _0x29b959=_0x163c36,_0x441fb0=a4_0x374f36[_0x4c9986(0x19c)](process[_0x4c9986(0x20b)](),_0x4c9986(0x1d8),_0x163c36,_0x4c9986(0x1db));if(!existsSync(_0x441fb0)){const _0x44d5f3=normalizeName(_0x50dd54),_0x15e358=a4_0x374f36[_0x4c9986(0x19c)](process[_0x4c9986(0x20b)](),_0x4c9986(0x1d8),_0x44d5f3,_0x4c9986(0x1db));existsSync(_0x15e358)&&(_0x29b959=_0x44d5f3,_0x441fb0=_0x15e358);}if(existsSync(_0x441fb0))_0x5aa164=a4_0x374f36[_0x4c9986(0x188)](_0x441fb0),console['log'](a4_0x53f3cc[_0x4c9986(0x175)]('Using\x20local\x20project:\x20'+_0x5aa164));else{const _0x3483a9=_0x1d331c['profile'];if(_0x3483a9)throw new SDKError(ErrorCode[_0x4c9986(0x16e)],_0x4c9986(0x173)+_0x50dd54+_0x4c9986(0x17c),undefined,{'helpText':_0x4c9986(0x214)+_0x4c9986(0x20d)+(_0x4c9986(0x1ae)+_0x50dd54+'\x0a')+(_0x4c9986(0x1d1)+_0x29b959+_0x4c9986(0x1be)+(_0x148505||'<new-name>')+_0x4c9986(0x1bc)+_0x3483a9)});_0x5aa164=_0x50dd54,console[_0x4c9986(0x177)](a4_0x53f3cc[_0x4c9986(0x175)]('Using\x20context\x20project:\x20'+_0x50dd54));}}}}if(!_0x5aa164)return console[_0x4c9986(0x177)](a4_0x53f3cc[_0x4c9986(0x1b7)]('No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a')),console[_0x4c9986(0x177)](_0x4c9986(0x180)),console[_0x4c9986(0x177)](_0x4c9986(0x17d)),console['log'](_0x4c9986(0x1de)),console[_0x4c9986(0x177)](_0x4c9986(0x1b4)),0x1;if(!_0x148505)throw new SDKError(ErrorCode[_0x4c9986(0x19b)],_0x4c9986(0x1b9),undefined,{'helpText':_0x4c9986(0x219)});if(!_0x538c90&&!_0x2390be){if(!isInteractive())return console['error'](a4_0x53f3cc[_0x4c9986(0x187)](_0x4c9986(0x1a1)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x4c9986(0x1aa)](a4_0x53f3cc['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x404c80=await confirmKey('Clone\x20\x22'+_0x5aa164+_0x4c9986(0x1eb)+_0x148505+'\x22?');if(!_0x404c80)return console[_0x4c9986(0x177)](a4_0x53f3cc[_0x4c9986(0x1b7)](_0x4c9986(0x1f2))),0x1;}const {data:_0x30ac16}=await withSpinner('Cloning\x20\x22'+_0x5aa164+'\x22\x20to\x20\x22'+_0x148505+_0x4c9986(0x20a),()=>_0x38e009[_0x4c9986(0x185)][_0x4c9986(0x1fb)](_0x5aa164,_0x148505,{'dryRun':_0x2390be}));if(_0x2390be){console[_0x4c9986(0x177)](a4_0x53f3cc[_0x4c9986(0x1b7)](_0x4c9986(0x183))),console['log'](_0x4c9986(0x193)+_0x30ac16[_0x4c9986(0x18b)]),console[_0x4c9986(0x177)](_0x4c9986(0x200)+_0x148505),console[_0x4c9986(0x177)](_0x4c9986(0x20f)),console[_0x4c9986(0x177)](_0x4c9986(0x1ad)+_0x30ac16[_0x4c9986(0x191)][_0x4c9986(0x1d8)]['created']),console[_0x4c9986(0x177)](_0x4c9986(0x1bf)+_0x30ac16[_0x4c9986(0x191)][_0x4c9986(0x1f5)][_0x4c9986(0x204)]),console[_0x4c9986(0x177)]('\x20\x20Prompts:\x20'+_0x30ac16['counts'][_0x4c9986(0x1e4)][_0x4c9986(0x204)]);const _0x4822fb=_0x30ac16['counts'][_0x4c9986(0x179)][_0x4c9986(0x204)]>0x0||_0x30ac16[_0x4c9986(0x191)][_0x4c9986(0x1cd)][_0x4c9986(0x204)]>0x0;return _0x4822fb&&(console[_0x4c9986(0x177)](_0x4c9986(0x1c5)+_0x30ac16['counts'][_0x4c9986(0x179)][_0x4c9986(0x204)]),console[_0x4c9986(0x177)](_0x4c9986(0x217)+_0x30ac16[_0x4c9986(0x191)]['experimentalArtifacts'][_0x4c9986(0x204)])),0x0;}const _0x5554af=_0x30ac16[_0x4c9986(0x191)][_0x4c9986(0x1d8)][_0x4c9986(0x1fc)]>0x0||_0x30ac16[_0x4c9986(0x191)][_0x4c9986(0x1f5)][_0x4c9986(0x1fc)]>0x0||_0x30ac16[_0x4c9986(0x191)]['prompts'][_0x4c9986(0x1fc)]>0x0||_0x30ac16[_0x4c9986(0x191)]['experimentalKnowledgeBases']['errors']>0x0||_0x30ac16[_0x4c9986(0x191)]['experimentalArtifacts'][_0x4c9986(0x1fc)]>0x0;_0x5554af?console[_0x4c9986(0x177)](a4_0x53f3cc[_0x4c9986(0x1b7)]('Project\x20cloned\x20with\x20errors')):console[_0x4c9986(0x177)](a4_0x53f3cc[_0x4c9986(0x189)]('Project\x20cloned\x20successfully'));console[_0x4c9986(0x177)](_0x4c9986(0x193)+_0x30ac16[_0x4c9986(0x18b)]),console[_0x4c9986(0x177)](_0x4c9986(0x200)+_0x30ac16[_0x4c9986(0x208)]),console[_0x4c9986(0x177)](_0x4c9986(0x197)+_0x30ac16[_0x4c9986(0x1f7)]),console['log'](),console['log'](_0x4c9986(0x1a0)),console[_0x4c9986(0x177)](_0x4c9986(0x1ad)+formatCountSummary(_0x30ac16[_0x4c9986(0x191)]['agents'])),console[_0x4c9986(0x177)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x30ac16[_0x4c9986(0x191)][_0x4c9986(0x1f5)])),console[_0x4c9986(0x177)](_0x4c9986(0x1e2)+formatCountSummary(_0x30ac16[_0x4c9986(0x191)]['prompts'])),console[_0x4c9986(0x177)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x30ac16[_0x4c9986(0x191)][_0x4c9986(0x1f1)]));const _0x103b59=_0x30ac16[_0x4c9986(0x191)]['experimentalKnowledgeBases'][_0x4c9986(0x204)]>0x0||_0x30ac16[_0x4c9986(0x191)][_0x4c9986(0x179)][_0x4c9986(0x178)]>0x0||_0x30ac16[_0x4c9986(0x191)][_0x4c9986(0x179)]['unchanged']>0x0||_0x30ac16[_0x4c9986(0x191)]['experimentalArtifacts'][_0x4c9986(0x204)]>0x0||_0x30ac16[_0x4c9986(0x191)]['experimentalArtifacts']['updated']>0x0||_0x30ac16[_0x4c9986(0x191)][_0x4c9986(0x1cd)][_0x4c9986(0x1e6)]>0x0;_0x103b59&&(console[_0x4c9986(0x177)](_0x4c9986(0x1c5)+formatCountSummary(_0x30ac16['counts'][_0x4c9986(0x179)])),console[_0x4c9986(0x177)](_0x4c9986(0x217)+formatCountSummary(_0x30ac16[_0x4c9986(0x191)][_0x4c9986(0x1cd)])));if(_0x5554af){console[_0x4c9986(0x177)](),console[_0x4c9986(0x177)](a4_0x53f3cc[_0x4c9986(0x187)](_0x4c9986(0x1bd)));for(const _0x354803 of _0x30ac16[_0x4c9986(0x1d8)]){_0x354803['action']===_0x4c9986(0x1aa)&&console[_0x4c9986(0x177)](a4_0x53f3cc[_0x4c9986(0x187)](_0x4c9986(0x21c)+_0x354803[_0x4c9986(0x1a9)]+_0x4c9986(0x196)+_0x354803[_0x4c9986(0x1aa)]));}for(const _0x3bc835 of _0x30ac16[_0x4c9986(0x1f5)]){_0x3bc835[_0x4c9986(0x21a)]===_0x4c9986(0x1aa)&&console[_0x4c9986(0x177)](a4_0x53f3cc[_0x4c9986(0x187)](_0x4c9986(0x19d)+_0x3bc835[_0x4c9986(0x1e7)]+'\x22:\x20'+_0x3bc835[_0x4c9986(0x1aa)]));}for(const _0x2f5ef2 of _0x30ac16[_0x4c9986(0x1e4)]){_0x2f5ef2[_0x4c9986(0x21a)]==='error'&&console['log'](a4_0x53f3cc['red']('\x20\x20Prompt\x20\x22'+_0x2f5ef2[_0x4c9986(0x1e7)]+_0x4c9986(0x196)+_0x2f5ef2[_0x4c9986(0x1aa)]));}for(const _0x56d81c of _0x30ac16[_0x4c9986(0x1f1)]){_0x56d81c[_0x4c9986(0x21a)]===_0x4c9986(0x1aa)&&console[_0x4c9986(0x177)](a4_0x53f3cc[_0x4c9986(0x187)](_0x4c9986(0x1af)+_0x56d81c[_0x4c9986(0x1e7)]+'\x22:\x20'+_0x56d81c[_0x4c9986(0x1aa)]));}for(const _0x28182c of _0x30ac16[_0x4c9986(0x179)]){_0x28182c['action']===_0x4c9986(0x1aa)&&console[_0x4c9986(0x177)](a4_0x53f3cc[_0x4c9986(0x187)](_0x4c9986(0x1bb)+_0x28182c['name']+_0x4c9986(0x196)+_0x28182c[_0x4c9986(0x1aa)]));}for(const _0x44ab72 of _0x30ac16[_0x4c9986(0x1cd)]){_0x44ab72[_0x4c9986(0x21a)]==='error'&&console['log'](a4_0x53f3cc[_0x4c9986(0x187)](_0x4c9986(0x1f8)+_0x44ab72['name']+_0x4c9986(0x196)+_0x44ab72[_0x4c9986(0x1aa)]));}return 0x1;}console[_0x4c9986(0x177)]();const _0xd31b21=getLLMProjectUrl(_0x138468,_0x30ac16[_0x4c9986(0x1f7)]);return console[_0x4c9986(0x177)](_0x4c9986(0x1b2)+a4_0x53f3cc[_0x4c9986(0x17b)](_0xd31b21)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x347051(0x1e7)]=a4_0x347051(0x21d);[a4_0x347051(0x1b5)]='Push\x20local\x20agent\x20files\x20to\x20LLM\x20project';async[a4_0x347051(0x216)](_0x116c00){const _0x2918ee=a4_0x347051,{options:_0x4a962d,args:_0x1f2efe,tdx:_0x2c3867}=_0x116c00;let _0x4cd716=_0x1f2efe[0x0]||process['cwd']();const _0x20c188=_0x4a962d[_0x2918ee(0x211)],_0x21186e=_0x4a962d[_0x2918ee(0x206)],_0x21480f=_0x4a962d['yes'],_0x4b4350=_0x4a962d[_0x2918ee(0x1da)],_0x533ea6=a4_0x374f36[_0x2918ee(0x19c)](_0x4cd716,_0x2918ee(0x1d9)),_0x40733f=existsSync(_0x533ea6);if(_0x40733f){const {data:_0x212600}=await withSpinner(_0x2918ee(0x1ab)+_0x4cd716+'\x22...',()=>_0x2c3867['llm']['pushAgent'](_0x4cd716,{'dryRun':_0x20c188,'force':_0x21186e}));if(_0x20c188)return console[_0x2918ee(0x177)](a4_0x53f3cc[_0x2918ee(0x1b7)](_0x2918ee(0x183))),console['log'](_0x2918ee(0x1c1)+_0x212600[_0x2918ee(0x1a9)]),0x0;if(_0x212600[_0x2918ee(0x21a)]===_0x2918ee(0x1aa))return console[_0x2918ee(0x177)](a4_0x53f3cc[_0x2918ee(0x187)]('Failed\x20to\x20push\x20agent:\x20'+_0x212600[_0x2918ee(0x1aa)])),0x1;console[_0x2918ee(0x177)](a4_0x53f3cc[_0x2918ee(0x189)]('Agent\x20'+_0x212600[_0x2918ee(0x21a)]+'\x20successfully')),console[_0x2918ee(0x177)](_0x2918ee(0x174)+_0x212600['agentName']);if(_0x212600[_0x2918ee(0x1cb)]&&_0x212600['projectId']){const _0x5a7322=getLLMAgentChatUrl(_0x4b4350,_0x212600[_0x2918ee(0x213)],_0x212600[_0x2918ee(0x1cb)]);console[_0x2918ee(0x177)](_0x2918ee(0x1c7)+a4_0x53f3cc[_0x2918ee(0x17b)](_0x5a7322));}return 0x0;}const _0x33088f=_0x4a962d['llmProject'],_0x247497=resolveProjectFromContext(_0x4cd716,_0x33088f);if(_0x247497[_0x2918ee(0x1f6)])_0x4cd716=_0x247497['projectDir'],_0x247497[_0x2918ee(0x1fd)]===_0x2918ee(0x170)&&console[_0x2918ee(0x177)](a4_0x53f3cc[_0x2918ee(0x175)](_0x2918ee(0x1ff)+_0x4cd716));else{let _0xb7cbe1=_0x2918ee(0x201);_0x247497[_0x2918ee(0x218)]==='no_local_folder'&&(_0xb7cbe1=_0x247497[_0x2918ee(0x16c)]+_0x2918ee(0x1a6)+_0x247497[_0x2918ee(0x1d2)]+'\x27\x20to\x20create\x20the\x20folder\x20structure.');throw new SDKError(ErrorCode[_0x2918ee(0x16e)],_0x247497[_0x2918ee(0x218)]==='no_context'?_0x247497['message']:_0x2918ee(0x210)+_0x4cd716,undefined,{'helpText':_0xb7cbe1});}const {data:_0x5e0f96}=await withSpinner(_0x2918ee(0x215),()=>_0x2c3867[_0x2918ee(0x185)][_0x2918ee(0x17a)](_0x4cd716,{'dryRun':!![]})),_0x464252=_0x5e0f96['counts'][_0x2918ee(0x1d8)]['errors']>0x0;if(_0x464252){console['log'](a4_0x53f3cc['red'](_0x2918ee(0x17f)));for(const _0x24a8ac of _0x5e0f96[_0x2918ee(0x1d8)]){_0x24a8ac[_0x2918ee(0x21a)]===_0x2918ee(0x1aa)&&console[_0x2918ee(0x177)](a4_0x53f3cc['red'](_0x2918ee(0x21c)+_0x24a8ac[_0x2918ee(0x1a9)]+_0x2918ee(0x196)+_0x24a8ac[_0x2918ee(0x1aa)]));}return 0x1;}const _0x13c4ed=_0x5e0f96['counts'][_0x2918ee(0x1d8)][_0x2918ee(0x204)]+_0x5e0f96[_0x2918ee(0x191)][_0x2918ee(0x1f5)]['created']+_0x5e0f96['counts'][_0x2918ee(0x19e)][_0x2918ee(0x204)]+_0x5e0f96[_0x2918ee(0x191)][_0x2918ee(0x1e4)]['created']+_0x5e0f96[_0x2918ee(0x191)][_0x2918ee(0x1f1)][_0x2918ee(0x204)]+_0x5e0f96['counts'][_0x2918ee(0x179)][_0x2918ee(0x204)]+_0x5e0f96[_0x2918ee(0x191)]['experimentalArtifacts'][_0x2918ee(0x204)],_0x27ee41=_0x5e0f96['counts'][_0x2918ee(0x1d8)][_0x2918ee(0x178)]+_0x5e0f96[_0x2918ee(0x191)]['knowledgeBases']['updated']+_0x5e0f96[_0x2918ee(0x191)][_0x2918ee(0x19e)][_0x2918ee(0x178)]+_0x5e0f96[_0x2918ee(0x191)][_0x2918ee(0x1e4)]['updated']+_0x5e0f96[_0x2918ee(0x191)][_0x2918ee(0x1f1)][_0x2918ee(0x178)]+_0x5e0f96[_0x2918ee(0x191)]['experimentalKnowledgeBases']['updated']+_0x5e0f96[_0x2918ee(0x191)][_0x2918ee(0x1cd)][_0x2918ee(0x178)],_0x2e838f=_0x5e0f96['counts'][_0x2918ee(0x1d8)][_0x2918ee(0x1e6)]+_0x5e0f96[_0x2918ee(0x191)][_0x2918ee(0x1f5)][_0x2918ee(0x1e6)]+_0x5e0f96['counts'][_0x2918ee(0x19e)][_0x2918ee(0x1e6)]+_0x5e0f96[_0x2918ee(0x191)]['prompts'][_0x2918ee(0x1e6)]+_0x5e0f96[_0x2918ee(0x191)][_0x2918ee(0x1f1)][_0x2918ee(0x1e6)]+_0x5e0f96[_0x2918ee(0x191)][_0x2918ee(0x179)][_0x2918ee(0x1e6)]+_0x5e0f96[_0x2918ee(0x191)]['experimentalArtifacts'][_0x2918ee(0x1e6)];console[_0x2918ee(0x177)](_0x2918ee(0x198)+_0x5e0f96[_0x2918ee(0x16f)]+'\x27:'),console[_0x2918ee(0x177)]('\x20\x20'+a4_0x53f3cc[_0x2918ee(0x189)]('+\x20'+_0x13c4ed+_0x2918ee(0x1ac))+'\x20|\x20'+a4_0x53f3cc[_0x2918ee(0x1b7)]('~\x20'+_0x27ee41+_0x2918ee(0x1e8))+_0x2918ee(0x1c8)+a4_0x53f3cc['dim']('=\x20'+_0x2e838f+_0x2918ee(0x176))),console[_0x2918ee(0x177)]('\x20\x20Agents:\x20'+formatCountSummary(_0x5e0f96[_0x2918ee(0x191)][_0x2918ee(0x1d8)])),console[_0x2918ee(0x177)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x5e0f96[_0x2918ee(0x191)]['knowledgeBases'])),console[_0x2918ee(0x177)](_0x2918ee(0x1dd)+formatCountSummary(_0x5e0f96[_0x2918ee(0x191)][_0x2918ee(0x19e)])),console[_0x2918ee(0x177)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x5e0f96[_0x2918ee(0x191)][_0x2918ee(0x1e4)])),console[_0x2918ee(0x177)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x5e0f96['counts'][_0x2918ee(0x1f1)]));const _0x21d0b7=_0x5e0f96['counts'][_0x2918ee(0x179)]['created']>0x0||_0x5e0f96[_0x2918ee(0x191)][_0x2918ee(0x179)][_0x2918ee(0x178)]>0x0||_0x5e0f96[_0x2918ee(0x191)][_0x2918ee(0x179)]['unchanged']>0x0||_0x5e0f96['counts'][_0x2918ee(0x1cd)]['created']>0x0||_0x5e0f96['counts']['experimentalArtifacts']['updated']>0x0||_0x5e0f96[_0x2918ee(0x191)][_0x2918ee(0x1cd)][_0x2918ee(0x1e6)]>0x0;_0x21d0b7&&(console['log'](_0x2918ee(0x1c5)+formatCountSummary(_0x5e0f96[_0x2918ee(0x191)][_0x2918ee(0x179)])),console[_0x2918ee(0x177)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x5e0f96['counts']['experimentalArtifacts'])));console['log'](_0x2918ee(0x1d7)+a4_0x53f3cc[_0x2918ee(0x17b)](_0x4cd716)),displayDiffs(_0x5e0f96[_0x2918ee(0x1d8)],_0x5e0f96['knowledgeBases'],_0x5e0f96[_0x2918ee(0x19e)],_0x5e0f96[_0x2918ee(0x1e4)],_0x5e0f96[_0x2918ee(0x1f1)],_0x5e0f96['experimentalKnowledgeBases'],_0x5e0f96['experimentalArtifacts']);if(_0x20c188)return console['log'](a4_0x53f3cc[_0x2918ee(0x1b7)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed')),0x0;if(_0x13c4ed===0x0&&_0x27ee41===0x0){console['log'](a4_0x53f3cc['green'](_0x2918ee(0x1df)));const _0x4454d5=getLLMProjectUrl(_0x4b4350,_0x5e0f96[_0x2918ee(0x213)]);return console[_0x2918ee(0x177)](_0x2918ee(0x1b2)+a4_0x53f3cc[_0x2918ee(0x17b)](_0x4454d5)),0x0;}if(!_0x21480f&&!_0x21186e){if(!isInteractive())return console[_0x2918ee(0x1aa)](a4_0x53f3cc[_0x2918ee(0x187)](_0x2918ee(0x1a1)),_0x2918ee(0x1d6)),console[_0x2918ee(0x1aa)](a4_0x53f3cc[_0x2918ee(0x175)](_0x2918ee(0x1c2))),0x1;const _0x1a72de=await confirmKey(_0x2918ee(0x19f)+(_0x13c4ed+_0x27ee41)+_0x2918ee(0x1ca));if(!_0x1a72de)return console['log'](a4_0x53f3cc[_0x2918ee(0x1b7)](_0x2918ee(0x1f2)),_0x2918ee(0x1f0)),0x1;}const {data:_0x4f9ec5}=await withSpinner(_0x2918ee(0x1e9),()=>_0x2c3867[_0x2918ee(0x185)]['pushProject'](_0x4cd716,{'force':_0x21186e})),_0x21917a=_0x4f9ec5[_0x2918ee(0x191)][_0x2918ee(0x1d8)]['errors']>0x0||_0x4f9ec5[_0x2918ee(0x191)][_0x2918ee(0x1f5)][_0x2918ee(0x1fc)]>0x0||_0x4f9ec5[_0x2918ee(0x191)][_0x2918ee(0x19e)]['errors']>0x0||_0x4f9ec5[_0x2918ee(0x191)][_0x2918ee(0x1e4)][_0x2918ee(0x1fc)]>0x0;if(_0x21917a){console[_0x2918ee(0x177)](a4_0x53f3cc[_0x2918ee(0x1b7)](_0x2918ee(0x1a8))),console[_0x2918ee(0x177)](),console[_0x2918ee(0x177)](a4_0x53f3cc[_0x2918ee(0x187)](_0x2918ee(0x1bd)));for(const _0x646ce2 of _0x4f9ec5['agents']){_0x646ce2['action']===_0x2918ee(0x1aa)&&console[_0x2918ee(0x177)](a4_0x53f3cc[_0x2918ee(0x187)](_0x2918ee(0x21c)+_0x646ce2[_0x2918ee(0x1a9)]+_0x2918ee(0x196)+_0x646ce2['error']));}for(const _0x5e61ae of _0x4f9ec5[_0x2918ee(0x1f5)]){_0x5e61ae[_0x2918ee(0x21a)]===_0x2918ee(0x1aa)&&console['log'](a4_0x53f3cc[_0x2918ee(0x187)](_0x2918ee(0x19d)+_0x5e61ae['name']+_0x2918ee(0x196)+_0x5e61ae[_0x2918ee(0x1aa)]));}for(const _0x42204c of _0x4f9ec5[_0x2918ee(0x19e)]){_0x42204c['action']===_0x2918ee(0x1aa)&&console[_0x2918ee(0x177)](a4_0x53f3cc[_0x2918ee(0x187)](_0x2918ee(0x1d5)+_0x42204c[_0x2918ee(0x1e7)]+_0x2918ee(0x196)+_0x42204c[_0x2918ee(0x1aa)]));}for(const _0x1ead43 of _0x4f9ec5[_0x2918ee(0x1e4)]){_0x1ead43[_0x2918ee(0x21a)]==='error'&&console[_0x2918ee(0x177)](a4_0x53f3cc[_0x2918ee(0x187)]('\x20\x20Prompt\x20\x22'+_0x1ead43[_0x2918ee(0x1e7)]+_0x2918ee(0x196)+_0x1ead43[_0x2918ee(0x1aa)]));}for(const _0x12dc66 of _0x4f9ec5[_0x2918ee(0x1f1)]){_0x12dc66[_0x2918ee(0x21a)]===_0x2918ee(0x1aa)&&console[_0x2918ee(0x177)](a4_0x53f3cc[_0x2918ee(0x187)](_0x2918ee(0x1af)+_0x12dc66[_0x2918ee(0x1e7)]+_0x2918ee(0x196)+_0x12dc66['error']));}return 0x1;}console[_0x2918ee(0x177)](a4_0x53f3cc['green'](_0x2918ee(0x1e1)+(_0x13c4ed+_0x27ee41)+_0x2918ee(0x21b)+_0x4f9ec5['projectName']+'\x27'));const _0x2c9255=getLLMProjectUrl(_0x4b4350,_0x4f9ec5[_0x2918ee(0x213)]);return console[_0x2918ee(0x177)](_0x2918ee(0x1b2)+a4_0x53f3cc['cyan'](_0x2c9255)),0x0;}}
@@ -1 +1 @@
1
- function a5_0x1b7b(_0x1d7dc9,_0x18d07f){_0x1d7dc9=_0x1d7dc9-0x126;const _0x5679d0=a5_0x5679();let _0x1b7bdf=_0x5679d0[_0x1d7dc9];return _0x1b7bdf;}const a5_0x18a3ac=a5_0x1b7b;(function(_0x25912a,_0x39a207){const _0x3dabfc=a5_0x1b7b,_0x5aebef=_0x25912a();while(!![]){try{const _0x2c5f2f=-parseInt(_0x3dabfc(0x143))/0x1+-parseInt(_0x3dabfc(0x174))/0x2+-parseInt(_0x3dabfc(0x173))/0x3+-parseInt(_0x3dabfc(0x12d))/0x4+-parseInt(_0x3dabfc(0x18f))/0x5+-parseInt(_0x3dabfc(0x1b5))/0x6*(parseInt(_0x3dabfc(0x179))/0x7)+-parseInt(_0x3dabfc(0x19a))/0x8*(-parseInt(_0x3dabfc(0x1a4))/0x9);if(_0x2c5f2f===_0x39a207)break;else _0x5aebef['push'](_0x5aebef['shift']());}catch(_0x54aabe){_0x5aebef['push'](_0x5aebef['shift']());}}}(a5_0x5679,0x2c3ab));import*as a5_0x3fec7f from'node:fs';import*as a5_0x4216f6 from'node:path';import a5_0x4fd7a0 from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';function a5_0x5679(){const _0x128bca=['/<agent-name>','conversations','Executing\x20new\x20tests...','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','Round\x201/','\x20\x20-\x20','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','\x20-\x20','projectDir','testName','Site:\x20','writeFileSync','Round\x20','resolve','Duration:\x20','log','No\x20tests\x20have\x20tags\x20defined.','basename','\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','cyan','Test\x20','48576QKxric','resolveProjectId','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','FAIL','New\x20tests\x20to\x20execute:\x20','white','length','includes','\x20(new)','agentName','find','round','Cached\x20run\x20is\x20from\x20site\x20\x22','start','tsv','404','ERROR','tests','Usage:','✗\x20FAIL:\x20','✓\x20PASS:\x20','Error\x20writing\x20output\x20file:\x20','Agent:\x20','yellow','\x27\x20to\x20create\x20the\x20folder\x20structure.','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','\x22:\x20','rounds','site','push','Available\x20tags:\x20','now','green','conversation_url','\x20(cached)','Using\x20agent:\x20','llmProject','eval','source','forEach','description','map','execute','Failed\x20Tests:','reeval','\x20\x20Conversation:\x20','join','red','497397qUZNyV','251160Uhiwhp','Conversation\x20URL:\x20','timestamp','Test\x20Summary','\x20\x20Round\x20','133eBzmad','Tests\x20found:\x20','dim','tags','No\x20tests\x20found\x20matching:\x20','llm','testYmlPath','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','multiple_agents','name','not\x20found','\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\x20Evaluating...\x20','no_local_folder','verbose',':\x20Sending\x20user\x20input...','Total:\x20\x20\x20\x20','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','utf-8','isSpinning','substring','resolveAgentId','1348785LqlurZ','json','toISOString','Available\x20tests:\x20','Test\x20Configuration:','Evaluating\x20response...','\x22,\x20but\x20current\x20site\x20is\x20\x22','has','⚠\x20SKIPPED:\x20','agent','jsonl','9980648jYhGap','dryRun','filter','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','stop','Re-evaluating\x20cached\x20test\x20run...','reason','✗\x20ERROR:\x20Project\x20not\x20found:\x20','agentDirs','PASS','9pPMYWI','Either\x20switch\x20to\x20the\x20\x22','no_context','Passed:\x20\x20\x20','✗\x20ERROR:\x20','projectName','existsSync','No\x20tests\x20found\x20with\x20tags:\x20','...','context','Run\x20\x27tdx\x20agent\x20pull\x20','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','Run\x20tests\x20for\x20an\x20LLM\x20agent','Re-evaluating\x20','table','message','72678feIFXM','Output\x20written\x20to:\x20','found','Running\x20test:\x20','split','size','toLowerCase','add','repeat','no_tests','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','executeReeval','Cached\x20run\x20from:\x20','Re-evaluation\x20Summary','status','Errors:\x20\x20\x20','...\x20','text','\x20\x20Agent:\x20','906236UvRKEk'];a5_0x5679=function(){return _0x128bca;};return a5_0x5679();}export class AgentTestCommand extends BaseCommand{[a5_0x18a3ac(0x182)]='agent:test';[a5_0x18a3ac(0x16b)]=a5_0x18a3ac(0x1b1);async[a5_0x18a3ac(0x16d)](_0xd31cc){const _0x1d182d=a5_0x18a3ac,{options:_0x158b05,args:_0x3b94d8,tdx:_0x34ad35}=_0xd31cc,_0x1627b4=_0x3b94d8[0x0]||'.',_0x43be27=_0x158b05[_0x1d182d(0x19b)],_0x47719b=_0x158b05,_0x432bd8=_0x47719b[_0x1d182d(0x168)]===![],_0x315342=_0x47719b[_0x1d182d(0x16f)],_0x14b2d8=_0x47719b[_0x1d182d(0x182)],_0x23b656=_0x47719b[_0x1d182d(0x17c)],_0x4e92ab=_0x158b05['site'],_0x395bfe=_0x47719b['output'];if(_0x315342&&_0x432bd8)return console[_0x1d182d(0x13d)](a5_0x4fd7a0[_0x1d182d(0x172)](_0x1d182d(0x1bf))),0x1;let _0x5b2ac7=_0x1d182d(0x1b3);if(_0x47719b[_0x1d182d(0x190)])_0x5b2ac7=_0x1d182d(0x190);else{if(_0x47719b[_0x1d182d(0x199)])_0x5b2ac7=_0x1d182d(0x199);else{if(_0x47719b['tsv'])_0x5b2ac7=_0x1d182d(0x151);else{if(_0x47719b[_0x1d182d(0x1b3)])_0x5b2ac7='table';}}}const _0x45c075=_0x47719b['llmProject'];let _0x5255b5=_0x1627b4;const _0x13b412=a5_0x3fec7f[_0x1d182d(0x1aa)](_0x1627b4),_0x332668=_0x1627b4==='.';if(!_0x13b412||_0x332668){const _0x275722=resolveProjectFromContext(_0x1627b4,_0x45c075,{'requireFile':'test.yml'});if(_0x275722[_0x1d182d(0x1b7)])_0x5255b5=_0x275722[_0x1d182d(0x136)],_0x275722[_0x1d182d(0x169)]===_0x1d182d(0x1ad)&&console[_0x1d182d(0x13d)](a5_0x4fd7a0[_0x1d182d(0x17b)](_0x1d182d(0x166)+_0x5255b5));else switch(_0x275722[_0x1d182d(0x1a0)]){case _0x1d182d(0x1a6):console[_0x1d182d(0x13d)](a5_0x4fd7a0['yellow'](_0x275722[_0x1d182d(0x1b4)])),console['log'](),console[_0x1d182d(0x13d)](_0x1d182d(0x155)),console['log'](_0x1d182d(0x140)),console[_0x1d182d(0x13d)](_0x1d182d(0x184)),console[_0x1d182d(0x13d)](),console[_0x1d182d(0x13d)](_0x1d182d(0x131));return 0x1;case _0x1d182d(0x186):console['log'](a5_0x4fd7a0[_0x1d182d(0x15a)](_0x275722[_0x1d182d(0x1b4)])),console[_0x1d182d(0x13d)](),console[_0x1d182d(0x13d)](_0x1d182d(0x1ae)+_0x275722['llmProject']+_0x1d182d(0x15b));return 0x1;case _0x1d182d(0x181):{const _0x1b9c49=a5_0x4216f6[_0x1d182d(0x13f)](_0x275722[_0x1d182d(0x136)]);console[_0x1d182d(0x13d)](a5_0x4fd7a0[_0x1d182d(0x15a)](_0x1d182d(0x15c)+_0x275722[_0x1d182d(0x167)]+'\x22:'));for(const _0x4374c8 of _0x275722[_0x1d182d(0x1a2)]){console[_0x1d182d(0x13d)](_0x1d182d(0x133)+_0x4374c8);}return console[_0x1d182d(0x13d)](),console[_0x1d182d(0x13d)]('Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/'+_0x1b9c49+_0x1d182d(0x12e)),0x1;}case _0x1d182d(0x1be):console[_0x1d182d(0x13d)](a5_0x4fd7a0[_0x1d182d(0x15a)]('No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22'+_0x275722[_0x1d182d(0x167)]+'\x22.')),console[_0x1d182d(0x13d)](a5_0x4fd7a0[_0x1d182d(0x17b)]('Project\x20path:\x20'+_0x275722['projectDir'])),console[_0x1d182d(0x13d)](),console[_0x1d182d(0x13d)](_0x1d182d(0x134));return 0x1;}}const {definition:_0x2cc8e3,agentInfo:_0x19dda8}=parseTestFile(_0x5255b5);let _0x68cffb=_0x2cc8e3[_0x1d182d(0x154)];if(_0x14b2d8){const _0x28785e=_0x14b2d8[_0x1d182d(0x1b9)](',')['map'](_0x1bd0b2=>_0x1bd0b2['trim']());_0x68cffb=_0x2cc8e3[_0x1d182d(0x154)][_0x1d182d(0x19c)](_0x1f4862=>_0x28785e[_0x1d182d(0x14a)](_0x1f4862[_0x1d182d(0x182)]));if(_0x68cffb[_0x1d182d(0x149)]===0x0)return console[_0x1d182d(0x13d)](a5_0x4fd7a0['yellow'](_0x1d182d(0x17d)+_0x14b2d8)),console[_0x1d182d(0x13d)](a5_0x4fd7a0['dim'](_0x1d182d(0x192)+_0x2cc8e3['tests'][_0x1d182d(0x16c)](_0xc21f38=>_0xc21f38[_0x1d182d(0x182)])[_0x1d182d(0x171)](',\x20'))),0x1;}if(_0x23b656){const _0x3615f3=_0x23b656[_0x1d182d(0x1b9)](',')[_0x1d182d(0x16c)](_0x1c7ada=>_0x1c7ada['trim']()[_0x1d182d(0x1bb)]());_0x68cffb=_0x68cffb[_0x1d182d(0x19c)](_0x33eeb1=>_0x33eeb1['tags']?.['some'](_0x1dd700=>_0x3615f3[_0x1d182d(0x14a)](_0x1dd700['toLowerCase']())));if(_0x68cffb['length']===0x0){console[_0x1d182d(0x13d)](a5_0x4fd7a0[_0x1d182d(0x15a)](_0x1d182d(0x1ab)+_0x23b656));const _0x4d011a=new Set();return _0x2cc8e3['tests'][_0x1d182d(0x16a)](_0xd5ae5d=>_0xd5ae5d[_0x1d182d(0x17c)]?.[_0x1d182d(0x16a)](_0x1e60ca=>_0x4d011a[_0x1d182d(0x1bc)](_0x1e60ca))),_0x4d011a[_0x1d182d(0x1ba)]>0x0?console[_0x1d182d(0x13d)](a5_0x4fd7a0['dim'](_0x1d182d(0x161)+[..._0x4d011a][_0x1d182d(0x171)](',\x20'))):console['log'](a5_0x4fd7a0[_0x1d182d(0x17b)](_0x1d182d(0x13e))),0x1;}}if(_0x315342)return this[_0x1d182d(0x1c0)](_0xd31cc,{'definition':{'tests':_0x68cffb},'agentInfo':_0x19dda8,'outputFormat':_0x5b2ac7,'outputFile':_0x395bfe,'testNames':_0x14b2d8});if(_0x43be27){console[_0x1d182d(0x13d)](a5_0x4fd7a0['cyan'](_0x1d182d(0x193))),console[_0x1d182d(0x13d)]('\x20\x20Site:\x20'+a5_0x4fd7a0[_0x1d182d(0x148)](_0x4e92ab)),console[_0x1d182d(0x13d)]('\x20\x20Project:\x20'+a5_0x4fd7a0['white'](_0x19dda8[_0x1d182d(0x1a9)])),console['log'](_0x1d182d(0x12c)+a5_0x4fd7a0['white'](_0x19dda8['agentName'])),console[_0x1d182d(0x13d)](),console[_0x1d182d(0x13d)](_0x1d182d(0x17a)+a5_0x4fd7a0[_0x1d182d(0x148)](_0x68cffb[_0x1d182d(0x149)]));for(let _0x15e1da=0x0;_0x15e1da<_0x68cffb[_0x1d182d(0x149)];_0x15e1da++){const _0x32186b=_0x68cffb[_0x15e1da],_0x4a897c=_0x32186b[_0x1d182d(0x15e)][_0x1d182d(0x149)]===0x1?_0x1d182d(0x14e):_0x1d182d(0x15e),_0x19e887=_0x32186b['tags']?.[_0x1d182d(0x149)]?'\x20['+_0x32186b[_0x1d182d(0x17c)][_0x1d182d(0x171)](',\x20')+']':'';console[_0x1d182d(0x13d)]('\x20\x20'+(_0x15e1da+0x1)+'.\x20'+a5_0x4fd7a0[_0x1d182d(0x148)](_0x32186b[_0x1d182d(0x182)])+'\x20('+_0x32186b[_0x1d182d(0x15e)][_0x1d182d(0x149)]+'\x20'+_0x4a897c+')'+a5_0x4fd7a0[_0x1d182d(0x17b)](_0x19e887));}return 0x0;}let _0x3946ae,_0x14227a;try{_0x3946ae=await _0x34ad35['llm'][_0x1d182d(0x144)](_0x19dda8['projectName']);}catch(_0x1d6fe2){const _0x45df89=_0x1d6fe2 instanceof Error?_0x1d6fe2[_0x1d182d(0x1b4)]:String(_0x1d6fe2);return _0x45df89[_0x1d182d(0x14a)](_0x1d182d(0x152))||_0x45df89[_0x1d182d(0x1bb)]()[_0x1d182d(0x14a)](_0x1d182d(0x183))?console[_0x1d182d(0x13d)](a5_0x4fd7a0[_0x1d182d(0x172)](_0x1d182d(0x1a1)+_0x19dda8[_0x1d182d(0x1a9)])):console[_0x1d182d(0x13d)](a5_0x4fd7a0[_0x1d182d(0x172)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22'+_0x19dda8[_0x1d182d(0x1a9)]+'\x22:\x20'+_0x45df89)),0x1;}try{_0x14227a=await _0x34ad35['llm'][_0x1d182d(0x18e)](_0x19dda8[_0x1d182d(0x14c)],_0x3946ae);}catch(_0x210355){const _0x1a643d=_0x210355 instanceof Error?_0x210355[_0x1d182d(0x1b4)]:String(_0x210355);return _0x1a643d[_0x1d182d(0x14a)]('404')||_0x1a643d['toLowerCase']()[_0x1d182d(0x14a)](_0x1d182d(0x183))?console[_0x1d182d(0x13d)](a5_0x4fd7a0[_0x1d182d(0x172)](_0x1d182d(0x1af)+_0x19dda8[_0x1d182d(0x14c)])):console[_0x1d182d(0x13d)](a5_0x4fd7a0['red'](_0x1d182d(0x1b0)+_0x19dda8['agentName']+_0x1d182d(0x15d)+_0x1a643d)),0x1;}let _0x286c4c;if(!_0x432bd8)try{_0x286c4c=await setupEvaluatorAgent(_0x34ad35[_0x1d182d(0x17e)],_0x158b05[_0x1d182d(0x187)]);}catch(_0x921622){const _0x5e3139=_0x921622 instanceof Error?_0x921622[_0x1d182d(0x1b4)]:String(_0x921622);return console[_0x1d182d(0x13d)](a5_0x4fd7a0[_0x1d182d(0x172)](_0x1d182d(0x180)+_0x5e3139)),0x1;}console[_0x1d182d(0x13d)](a5_0x4fd7a0[_0x1d182d(0x141)]('Running\x20agent\x20tests...')),console['log'](_0x1d182d(0x138)+a5_0x4fd7a0[_0x1d182d(0x148)](_0x4e92ab)),console[_0x1d182d(0x13d)]('Agent:\x20'+a5_0x4fd7a0['white'](_0x19dda8[_0x1d182d(0x1a9)]+'/'+_0x19dda8[_0x1d182d(0x14c)])),console['log']();const _0x511cb8=[],_0x3e42be=[],_0x2e37cc=Date[_0x1d182d(0x162)]();for(let _0x5e9ff9=0x0;_0x5e9ff9<_0x68cffb['length'];_0x5e9ff9++){const _0x4bd725=_0x68cffb[_0x5e9ff9];_0x68cffb[_0x1d182d(0x149)]>0x1?console['log'](_0x1d182d(0x142)+(_0x5e9ff9+0x1)+'/'+_0x68cffb[_0x1d182d(0x149)]+':\x20'+a5_0x4fd7a0[_0x1d182d(0x148)](_0x4bd725[_0x1d182d(0x182)])):console[_0x1d182d(0x13d)](_0x1d182d(0x1b8)+a5_0x4fd7a0[_0x1d182d(0x148)](_0x4bd725['name']));const _0x18e9ba=createCommandSpinner(_0x1d182d(0x132)+_0x4bd725[_0x1d182d(0x15e)][_0x1d182d(0x149)]+_0x1d182d(0x188));_0x18e9ba[_0x1d182d(0x150)]();try{const {result:_0x36a3af,conversation:_0x2807af}=await runTest(_0x34ad35[_0x1d182d(0x17e)],_0x4bd725,{'agentId':_0x14227a,'projectId':_0x3946ae,'site':_0x4e92ab,'noEval':_0x432bd8,'evaluatorId':_0x286c4c,'onRoundStart':(_0x5d4f56,_0x232519)=>{const _0x295668=_0x1d182d;_0x18e9ba[_0x295668(0x12b)]='Round\x20'+(_0x5d4f56+0x1)+'/'+_0x232519+_0x295668(0x188);},'onRoundComplete':(_0x50c9a6,_0x23929e,_0x213331)=>{const _0x1afc5c=_0x1d182d,_0x27ab43=formatElapsed(_0x23929e);_0x213331?console[_0x1afc5c(0x13d)]('\x20\x20Round\x20'+(_0x50c9a6+0x1)+'/'+_0x4bd725['rounds'][_0x1afc5c(0x149)]+_0x1afc5c(0x12a)+a5_0x4fd7a0[_0x1afc5c(0x163)]('✓')+'\x20('+_0x27ab43+')'):console[_0x1afc5c(0x13d)]('\x20\x20Round\x20'+(_0x50c9a6+0x1)+'/'+_0x4bd725[_0x1afc5c(0x15e)]['length']+_0x1afc5c(0x12a)+a5_0x4fd7a0['red']('✗'));},'onEvaluationStart':()=>{const _0x40a28e=_0x1d182d;_0x18e9ba[_0x40a28e(0x12b)]=_0x40a28e(0x194);},'onEvaluationComplete':_0x412121=>{const _0x105419=_0x1d182d,_0x40960d=formatElapsed(_0x412121);console[_0x105419(0x13d)](_0x105419(0x185)+a5_0x4fd7a0[_0x105419(0x163)]('✓')+'\x20('+_0x40960d+')');}});_0x18e9ba[_0x1d182d(0x19e)](),_0x511cb8[_0x1d182d(0x160)](_0x36a3af),_0x3e42be[_0x1d182d(0x160)](_0x2807af);if(_0x36a3af[_0x1d182d(0x128)]===_0x1d182d(0x1a3))console[_0x1d182d(0x13d)](a5_0x4fd7a0[_0x1d182d(0x163)](_0x1d182d(0x157)+_0x36a3af[_0x1d182d(0x1a0)]));else _0x36a3af[_0x1d182d(0x128)]===_0x1d182d(0x146)?console[_0x1d182d(0x13d)](a5_0x4fd7a0[_0x1d182d(0x172)](_0x1d182d(0x156)+_0x36a3af['reason'])):console[_0x1d182d(0x13d)](a5_0x4fd7a0['red'](_0x1d182d(0x1a8)+_0x36a3af[_0x1d182d(0x1a0)]));_0x36a3af[_0x1d182d(0x164)]&&console['log'](a5_0x4fd7a0[_0x1d182d(0x17b)](_0x1d182d(0x175)+_0x36a3af['conversation_url'])),console[_0x1d182d(0x13d)]();}catch(_0x117fef){_0x18e9ba[_0x1d182d(0x19e)]();const _0x204d5c=_0x117fef instanceof Error?_0x117fef[_0x1d182d(0x1b4)]:String(_0x117fef);console[_0x1d182d(0x13d)](a5_0x4fd7a0['red'](_0x1d182d(0x1a8)+_0x204d5c)),console[_0x1d182d(0x13d)](),_0x511cb8[_0x1d182d(0x160)]({'name':_0x4bd725[_0x1d182d(0x182)],'status':_0x1d182d(0x153),'reason':_0x204d5c,'timestamp':new Date()[_0x1d182d(0x191)](),'duration_ms':0x0});}}const _0x5d5c48=Date[_0x1d182d(0x162)]()-_0x2e37cc,_0x30eb9a=_0x511cb8[_0x1d182d(0x19c)](_0x347883=>_0x347883[_0x1d182d(0x128)]===_0x1d182d(0x1a3))[_0x1d182d(0x149)],_0x3f2fd3=_0x511cb8['filter'](_0x5d1375=>_0x5d1375['status']===_0x1d182d(0x146))['length'],_0x553655=_0x511cb8[_0x1d182d(0x19c)](_0x2fd6fe=>_0x2fd6fe['status']===_0x1d182d(0x153))[_0x1d182d(0x149)];console[_0x1d182d(0x13d)]('━'[_0x1d182d(0x1bd)](0x3c)),console[_0x1d182d(0x13d)](_0x1d182d(0x177)),console[_0x1d182d(0x13d)]('━'[_0x1d182d(0x1bd)](0x3c)),console[_0x1d182d(0x13d)](_0x1d182d(0x189)+_0x511cb8[_0x1d182d(0x149)]),console[_0x1d182d(0x13d)](_0x1d182d(0x1a7)+a5_0x4fd7a0[_0x1d182d(0x163)](_0x30eb9a)),console['log']('Failed:\x20\x20\x20'+a5_0x4fd7a0[_0x1d182d(0x172)](_0x3f2fd3));_0x553655>0x0&&console[_0x1d182d(0x13d)](_0x1d182d(0x129)+a5_0x4fd7a0[_0x1d182d(0x172)](_0x553655));console['log'](_0x1d182d(0x13c)+formatElapsed(_0x5d5c48)),console[_0x1d182d(0x13d)]('━'[_0x1d182d(0x1bd)](0x3c));const _0x176d97=_0x511cb8[_0x1d182d(0x19c)](_0x2e1d39=>_0x2e1d39[_0x1d182d(0x128)]!=='PASS');if(_0x176d97[_0x1d182d(0x149)]>0x0){console[_0x1d182d(0x13d)](),console[_0x1d182d(0x13d)](_0x1d182d(0x16e));for(const _0x1c1b74 of _0x176d97){const _0x57cbc6=a5_0x4fd7a0[_0x1d182d(0x172)]('✗'),_0x557c75=_0x1c1b74[_0x1d182d(0x1a0)]['length']>0x32?_0x1c1b74[_0x1d182d(0x1a0)][_0x1d182d(0x18d)](0x0,0x32)+'...':_0x1c1b74[_0x1d182d(0x1a0)];console['log']('\x20\x20'+_0x57cbc6+'\x20'+_0x1c1b74[_0x1d182d(0x182)]+':\x20'+_0x557c75);}}const _0x3339f3={'summary':{'total':_0x511cb8[_0x1d182d(0x149)],'passed':_0x30eb9a,'failed':_0x3f2fd3,'errors':_0x553655>0x0?_0x553655:undefined,'duration_ms':_0x5d5c48},'tests':_0x511cb8,'agent':{'project':_0x19dda8['projectName'],'name':_0x19dda8[_0x1d182d(0x14c)],'site':_0x4e92ab},'timestamp':new Date(_0x2e37cc)['toISOString']()};try{const _0x27d902=buildCachedTestRun(_0x3e42be,{'site':_0x4e92ab,'projectId':_0x3946ae,'projectName':_0x19dda8[_0x1d182d(0x1a9)],'agentId':_0x14227a,'agentName':_0x19dda8[_0x1d182d(0x14c)],'testYmlPath':a5_0x4216f6[_0x1d182d(0x13b)](_0x19dda8[_0x1d182d(0x17f)])});saveLastTestRun(_0x27d902);}catch{}if(_0x5b2ac7!==_0x1d182d(0x1b3)||_0x395bfe){const _0x177f3f=formatResults(_0x3339f3,_0x5b2ac7);if(_0x395bfe)try{a5_0x3fec7f[_0x1d182d(0x139)](_0x395bfe,_0x177f3f,'utf-8'),console[_0x1d182d(0x13d)](),console[_0x1d182d(0x13d)](a5_0x4fd7a0['dim']('Output\x20written\x20to:\x20'+_0x395bfe));}catch(_0x5c913c){return console['log'](),console[_0x1d182d(0x13d)](a5_0x4fd7a0[_0x1d182d(0x172)](_0x1d182d(0x158)+_0x5c913c)),0x1;}else console[_0x1d182d(0x13d)](),console[_0x1d182d(0x13d)](_0x177f3f);}return _0x176d97['length']>0x0?0x1:0x0;}async['executeReeval'](_0x20318a,_0x4a739a){const _0x189c65=a5_0x18a3ac,{options:_0x3c0dd5,tdx:_0x3c1625}=_0x20318a,{definition:_0x50e3c0,agentInfo:_0x5b9542,outputFormat:_0x3a8ced,outputFile:_0x296bbd}=_0x4a739a,_0x21ea41=_0x3c0dd5[_0x189c65(0x15f)],_0x508c4a=loadLastTestRun();if(!_0x508c4a)return console[_0x189c65(0x13d)](a5_0x4fd7a0[_0x189c65(0x172)]('Error:\x20No\x20previous\x20test\x20run\x20found.')),console[_0x189c65(0x13d)](a5_0x4fd7a0['dim'](_0x189c65(0x145))),0x1;if(_0x508c4a['agent'][_0x189c65(0x14c)]!==_0x5b9542['agentName'])return console[_0x189c65(0x13d)](a5_0x4fd7a0['red'](_0x189c65(0x19d)+_0x508c4a[_0x189c65(0x198)]['agentName']+'\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22'+_0x5b9542[_0x189c65(0x14c)]+'\x22.')),console[_0x189c65(0x13d)](a5_0x4fd7a0[_0x189c65(0x17b)]('Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.')),0x1;const _0xba7891=new Set(_0x508c4a[_0x189c65(0x12f)]['map'](_0x586d1c=>_0x586d1c[_0x189c65(0x137)])),_0x5ad5a8=_0x50e3c0[_0x189c65(0x154)][_0x189c65(0x19c)](_0x298ef0=>!_0xba7891[_0x189c65(0x196)](_0x298ef0['name']));if(_0x5ad5a8[_0x189c65(0x149)]>0x0&&_0x508c4a[_0x189c65(0x15f)]!==_0x21ea41)return console[_0x189c65(0x13d)](a5_0x4fd7a0[_0x189c65(0x172)](_0x189c65(0x18a))),console[_0x189c65(0x13d)](a5_0x4fd7a0[_0x189c65(0x17b)](_0x189c65(0x14f)+_0x508c4a[_0x189c65(0x15f)]+_0x189c65(0x195)+_0x21ea41+'\x22.')),console[_0x189c65(0x13d)](a5_0x4fd7a0[_0x189c65(0x17b)](_0x189c65(0x1a5)+_0x508c4a['site']+'\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.')),0x1;const _0x17828e=_0x50e3c0['tests'][_0x189c65(0x19c)](_0x19b29d=>_0xba7891[_0x189c65(0x196)](_0x19b29d['name'])),_0x24bac8=_0x5ad5a8;let _0x298ee9;try{_0x298ee9=await setupEvaluatorAgent(_0x3c1625[_0x189c65(0x17e)],_0x3c0dd5[_0x189c65(0x187)]);}catch(_0x49c963){const _0x1a0c43=_0x49c963 instanceof Error?_0x49c963[_0x189c65(0x1b4)]:String(_0x49c963);return console[_0x189c65(0x13d)](a5_0x4fd7a0[_0x189c65(0x172)]('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x1a0c43)),0x1;}console[_0x189c65(0x13d)](a5_0x4fd7a0['cyan'](_0x189c65(0x19f))),console[_0x189c65(0x13d)](_0x189c65(0x126)+a5_0x4fd7a0['white'](_0x508c4a[_0x189c65(0x176)])),console['log'](_0x189c65(0x159)+a5_0x4fd7a0[_0x189c65(0x148)](_0x508c4a[_0x189c65(0x198)][_0x189c65(0x1a9)]+'/'+_0x508c4a[_0x189c65(0x198)][_0x189c65(0x14c)]));_0x24bac8[_0x189c65(0x149)]>0x0&&console[_0x189c65(0x13d)](_0x189c65(0x147)+a5_0x4fd7a0[_0x189c65(0x15a)](_0x24bac8[_0x189c65(0x149)]));console[_0x189c65(0x13d)]();const _0x209229=[],_0x5bea51=Date[_0x189c65(0x162)](),_0x33783f=createCommandSpinner('Re-evaluating...');if(_0x17828e[_0x189c65(0x149)]>0x0)try{const _0x26ab43=await reevaluateFromCache(_0x3c1625['llm'],_0x508c4a,{'tests':_0x17828e},{'evaluatorId':_0x298ee9,'onTestStart':(_0x4e8450,_0xc7516b,_0x38ba2d)=>{const _0x4d1fb6=_0x189c65;_0x33783f[_0x4d1fb6(0x12b)]=_0x4d1fb6(0x1b2)+(_0xc7516b+0x1)+'/'+_0x38ba2d+':\x20'+_0x4e8450+_0x4d1fb6(0x1ac);if(!_0x33783f[_0x4d1fb6(0x18c)])_0x33783f[_0x4d1fb6(0x150)]();},'onTestComplete':(_0x71f4b2,_0x400328)=>{const _0x30be85=_0x189c65;_0x33783f[_0x30be85(0x19e)]();if(_0x400328[_0x30be85(0x128)]===_0x30be85(0x1a3))console['log'](a5_0x4fd7a0[_0x30be85(0x163)]('✓\x20PASS:\x20'+_0x71f4b2)+a5_0x4fd7a0[_0x30be85(0x17b)](_0x30be85(0x165)));else _0x400328[_0x30be85(0x128)]===_0x30be85(0x146)?console['log'](a5_0x4fd7a0[_0x30be85(0x172)]('✗\x20FAIL:\x20'+_0x71f4b2+_0x30be85(0x135)+_0x400328['reason'])+a5_0x4fd7a0[_0x30be85(0x17b)](_0x30be85(0x165))):console[_0x30be85(0x13d)](a5_0x4fd7a0['red'](_0x30be85(0x1a8)+_0x71f4b2+_0x30be85(0x135)+_0x400328[_0x30be85(0x1a0)]));_0x400328[_0x30be85(0x164)]&&console[_0x30be85(0x13d)](a5_0x4fd7a0['dim'](_0x30be85(0x170)+_0x400328[_0x30be85(0x164)])),_0x209229[_0x30be85(0x160)](_0x400328);},'onTestSkipped':(_0x21b743,_0x58326d)=>{const _0x4f14b3=_0x189c65;_0x33783f[_0x4f14b3(0x19e)](),console[_0x4f14b3(0x13d)](a5_0x4fd7a0['yellow'](_0x4f14b3(0x197)+_0x21b743+'\x20-\x20'+_0x58326d));}});for(const _0xa062d2 of _0x26ab43){!_0x209229[_0x189c65(0x14d)](_0x17183e=>_0x17183e['name']===_0xa062d2[_0x189c65(0x182)])&&_0x209229[_0x189c65(0x160)](_0xa062d2);}}catch(_0x36099a){_0x33783f[_0x189c65(0x19e)]();const _0x3d26c4=_0x36099a instanceof Error?_0x36099a[_0x189c65(0x1b4)]:String(_0x36099a);return console[_0x189c65(0x13d)](a5_0x4fd7a0[_0x189c65(0x172)]('✗\x20ERROR:\x20Re-evaluation\x20failed:\x20'+_0x3d26c4)),0x1;}_0x33783f[_0x189c65(0x19e)]();if(_0x24bac8[_0x189c65(0x149)]>0x0){console[_0x189c65(0x13d)](),console['log'](a5_0x4fd7a0[_0x189c65(0x141)](_0x189c65(0x130)));const {projectId:_0x552af8,agentId:_0x4fa780}=_0x508c4a[_0x189c65(0x198)];for(const _0x1231c1 of _0x24bac8){console[_0x189c65(0x13d)]('Running:\x20'+a5_0x4fd7a0[_0x189c65(0x148)](_0x1231c1[_0x189c65(0x182)]));const _0x3a2698=createCommandSpinner(_0x189c65(0x132)+_0x1231c1[_0x189c65(0x15e)]['length']+_0x189c65(0x188));_0x3a2698['start']();try{const {result:_0x18e917}=await runTest(_0x3c1625[_0x189c65(0x17e)],_0x1231c1,{'agentId':_0x4fa780,'projectId':_0x552af8,'site':_0x508c4a[_0x189c65(0x15f)],'noEval':![],'evaluatorId':_0x298ee9,'onRoundStart':(_0x9962c4,_0x2f4e24)=>{const _0x1126d8=_0x189c65;_0x3a2698[_0x1126d8(0x12b)]=_0x1126d8(0x13a)+(_0x9962c4+0x1)+'/'+_0x2f4e24+_0x1126d8(0x188);},'onRoundComplete':(_0x8d646b,_0x31a842,_0x24d9c3)=>{const _0x285147=_0x189c65,_0x547f8d=formatElapsed(_0x31a842);_0x24d9c3?console[_0x285147(0x13d)](_0x285147(0x178)+(_0x8d646b+0x1)+'/'+_0x1231c1[_0x285147(0x15e)]['length']+_0x285147(0x12a)+a5_0x4fd7a0[_0x285147(0x163)]('✓')+'\x20('+_0x547f8d+')'):console['log'](_0x285147(0x178)+(_0x8d646b+0x1)+'/'+_0x1231c1[_0x285147(0x15e)][_0x285147(0x149)]+'...\x20'+a5_0x4fd7a0[_0x285147(0x172)]('✗'));},'onEvaluationStart':()=>{const _0x4df3b4=_0x189c65;_0x3a2698[_0x4df3b4(0x12b)]='Evaluating\x20response...';},'onEvaluationComplete':_0x3de95a=>{const _0x2698a9=_0x189c65,_0x3c080f=formatElapsed(_0x3de95a);console[_0x2698a9(0x13d)](_0x2698a9(0x185)+a5_0x4fd7a0[_0x2698a9(0x163)]('✓')+'\x20('+_0x3c080f+')');}});_0x3a2698[_0x189c65(0x19e)](),_0x209229[_0x189c65(0x160)](_0x18e917);if(_0x18e917[_0x189c65(0x128)]==='PASS')console['log'](a5_0x4fd7a0[_0x189c65(0x163)](_0x189c65(0x157)+_0x18e917[_0x189c65(0x1a0)])+a5_0x4fd7a0[_0x189c65(0x17b)](_0x189c65(0x14b)));else _0x18e917[_0x189c65(0x128)]===_0x189c65(0x146)?console[_0x189c65(0x13d)](a5_0x4fd7a0[_0x189c65(0x172)](_0x189c65(0x156)+_0x18e917['reason'])+a5_0x4fd7a0[_0x189c65(0x17b)](_0x189c65(0x14b))):console[_0x189c65(0x13d)](a5_0x4fd7a0[_0x189c65(0x172)](_0x189c65(0x1a8)+_0x18e917[_0x189c65(0x1a0)]));_0x18e917[_0x189c65(0x164)]&&console[_0x189c65(0x13d)](a5_0x4fd7a0['dim'](_0x189c65(0x170)+_0x18e917[_0x189c65(0x164)]));}catch(_0x3adb6f){_0x3a2698[_0x189c65(0x19e)]();const _0x2cfdff=_0x3adb6f instanceof Error?_0x3adb6f[_0x189c65(0x1b4)]:String(_0x3adb6f);console[_0x189c65(0x13d)](a5_0x4fd7a0['red'](_0x189c65(0x1a8)+_0x2cfdff)),_0x209229[_0x189c65(0x160)]({'name':_0x1231c1['name'],'status':'ERROR','reason':_0x2cfdff,'timestamp':new Date()[_0x189c65(0x191)](),'duration_ms':0x0});}}}console['log']();const _0x56a9f5=Date[_0x189c65(0x162)]()-_0x5bea51,_0x39549c=_0x209229[_0x189c65(0x19c)](_0x3cf9be=>_0x3cf9be[_0x189c65(0x128)]===_0x189c65(0x1a3))[_0x189c65(0x149)],_0x49c485=_0x209229[_0x189c65(0x19c)](_0x473e72=>_0x473e72[_0x189c65(0x128)]===_0x189c65(0x146))[_0x189c65(0x149)],_0x2729b2=_0x209229[_0x189c65(0x19c)](_0x9d3c5c=>_0x9d3c5c['status']===_0x189c65(0x153))['length'];console['log']('━'['repeat'](0x3c)),console[_0x189c65(0x13d)](_0x189c65(0x127)),console[_0x189c65(0x13d)]('━'[_0x189c65(0x1bd)](0x3c)),console[_0x189c65(0x13d)](_0x189c65(0x189)+_0x209229[_0x189c65(0x149)]),console['log'](_0x189c65(0x1a7)+a5_0x4fd7a0[_0x189c65(0x163)](_0x39549c)),console[_0x189c65(0x13d)]('Failed:\x20\x20\x20'+a5_0x4fd7a0[_0x189c65(0x172)](_0x49c485));_0x2729b2>0x0&&console[_0x189c65(0x13d)](_0x189c65(0x129)+a5_0x4fd7a0['red'](_0x2729b2));console[_0x189c65(0x13d)](_0x189c65(0x13c)+formatElapsed(_0x56a9f5)),console[_0x189c65(0x13d)]('━'['repeat'](0x3c));const _0x203c38={'summary':{'total':_0x209229[_0x189c65(0x149)],'passed':_0x39549c,'failed':_0x49c485,'errors':_0x2729b2>0x0?_0x2729b2:undefined,'duration_ms':_0x56a9f5},'tests':_0x209229,'agent':{'project':_0x5b9542[_0x189c65(0x1a9)],'name':_0x5b9542[_0x189c65(0x14c)],'site':_0x21ea41},'timestamp':new Date(_0x5bea51)[_0x189c65(0x191)]()};if(_0x3a8ced!==_0x189c65(0x1b3)||_0x296bbd){const _0x7112fb=formatResults(_0x203c38,_0x3a8ced);if(_0x296bbd)try{a5_0x3fec7f[_0x189c65(0x139)](_0x296bbd,_0x7112fb,_0x189c65(0x18b)),console[_0x189c65(0x13d)](),console[_0x189c65(0x13d)](a5_0x4fd7a0[_0x189c65(0x17b)](_0x189c65(0x1b6)+_0x296bbd));}catch(_0x2366b0){return console[_0x189c65(0x13d)](),console[_0x189c65(0x13d)](a5_0x4fd7a0[_0x189c65(0x172)](_0x189c65(0x158)+_0x2366b0)),0x1;}else console[_0x189c65(0x13d)](),console[_0x189c65(0x13d)](_0x7112fb);}const _0x20e286=_0x209229[_0x189c65(0x19c)](_0x55174e=>_0x55174e[_0x189c65(0x128)]!==_0x189c65(0x1a3));return _0x20e286[_0x189c65(0x149)]>0x0?0x1:0x0;}}
1
+ function a5_0x554e(_0x4029cb,_0x27f3b9){_0x4029cb=_0x4029cb-0x11f;const _0x438e34=a5_0x438e();let _0x554e38=_0x438e34[_0x4029cb];return _0x554e38;}const a5_0x5ec6a5=a5_0x554e;(function(_0x30594f,_0x2218e8){const _0x35100e=a5_0x554e,_0x23ff87=_0x30594f();while(!![]){try{const _0x2df584=parseInt(_0x35100e(0x155))/0x1*(-parseInt(_0x35100e(0x1b0))/0x2)+parseInt(_0x35100e(0x135))/0x3*(parseInt(_0x35100e(0x1ae))/0x4)+-parseInt(_0x35100e(0x197))/0x5+parseInt(_0x35100e(0x181))/0x6+-parseInt(_0x35100e(0x15b))/0x7+-parseInt(_0x35100e(0x185))/0x8+parseInt(_0x35100e(0x173))/0x9;if(_0x2df584===_0x2218e8)break;else _0x23ff87['push'](_0x23ff87['shift']());}catch(_0x59311e){_0x23ff87['push'](_0x23ff87['shift']());}}}(a5_0x438e,0x40186));import*as a5_0x8b428c from'node:fs';import*as a5_0x5d6cf2 from'node:path';import a5_0x10f466 from'chalk';function a5_0x438e(){const _0x34042d=['trim','output','Either\x20switch\x20to\x20the\x20\x22','Running\x20test:\x20','Using\x20agent:\x20','Evaluating\x20response...','found','126660AhIZuQ','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','green','llmProject','\x22,\x20but\x20current\x20site\x20is\x20\x22','projectName','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','table','Re-evaluating\x20','conversation_url','writeFileSync','includes','testYmlPath','has',':\x20Sending\x20user\x20input...','substring','\x27\x20to\x20create\x20the\x20folder\x20structure.','Cached\x20run\x20is\x20from\x20site\x20\x22','Agent:\x20','map','\x20\x20Round\x20','isSpinning','now','✗\x20ERROR:\x20','\x20(new)','No\x20tests\x20found\x20matching:\x20','Available\x20tests:\x20','Total:\x20\x20\x20\x20','join','\x22:\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','text','1087bKzKFm','...\x20','llm','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','reason','\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','2575720KuzJQM','✓\x20PASS:\x20','FAIL','agentDirs','name','executeReeval','Round\x20','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','find','status','projectDir','\x20\x20Conversation:\x20','Error\x20writing\x20output\x20file:\x20','toISOString','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','Output\x20written\x20to:\x20','Errors:\x20\x20\x20','length','split','site','Error:\x20No\x20previous\x20test\x20run\x20found.','resolveProjectId','\x20\x20Evaluating...\x20','Re-evaluating...','6680871NPIIwu','Failed:\x20\x20\x20','Run\x20\x27tdx\x20agent\x20pull\x20','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','round','no_local_folder','Test\x20','✗\x20ERROR:\x20Project\x20not\x20found:\x20','\x20\x20Agent:\x20','json','log','size','execute','forEach','2903736fFDzuy','Round\x201/','ERROR','Duration:\x20','1774112pfVEhN','testName','rounds','PASS','Test\x20Summary','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','start','resolve','reeval','message','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','cyan','tsv','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','⚠\x20SKIPPED:\x20','No\x20tests\x20found\x20with\x20tags:\x20','Cached\x20run\x20from:\x20','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','1249010fnVIim','Site:\x20','utf-8','jsonl','...','\x20-\x20','eval','tests','stop','add','agent','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','test.yml','dryRun','white','push','\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)','agentName','404','\x20\x20-\x20','filter','Failed\x20Tests:','32foiUIN','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','850YCxnwR','multiple_agents','not\x20found','context','yellow','dim','New\x20tests\x20to\x20execute:\x20','timestamp','description','No\x20tests\x20have\x20tags\x20defined.','verbose','✗\x20FAIL:\x20','tags','repeat','Test\x20Configuration:','Conversation\x20URL:\x20','red','Running:\x20','toLowerCase'];a5_0x438e=function(){return _0x34042d;};return a5_0x438e();}import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{['name']='agent:test';[a5_0x5ec6a5(0x123)]='Run\x20tests\x20for\x20an\x20LLM\x20agent';async[a5_0x5ec6a5(0x17f)](_0x5d9ec2){const _0x530df6=a5_0x5ec6a5,{options:_0x11fb7a,args:_0x286e6c,tdx:_0xbf98e}=_0x5d9ec2,_0x45f8b8=_0x286e6c[0x0]||'.',_0x1a028f=_0x11fb7a[_0x530df6(0x1a5)],_0x10bbb0=_0x11fb7a,_0x1a803e=_0x10bbb0[_0x530df6(0x19d)]===![],_0x3f4d2b=_0x10bbb0[_0x530df6(0x18d)],_0x409c3d=_0x10bbb0[_0x530df6(0x15f)],_0x2225f4=_0x10bbb0['tags'],_0x499cce=_0x11fb7a[_0x530df6(0x16e)],_0x4e420d=_0x10bbb0[_0x530df6(0x12f)];if(_0x3f4d2b&&_0x1a803e)return console[_0x530df6(0x17d)](a5_0x10f466[_0x530df6(0x12b)](_0x530df6(0x18a))),0x1;let _0xd863f4=_0x530df6(0x13c);if(_0x10bbb0[_0x530df6(0x17c)])_0xd863f4='json';else{if(_0x10bbb0['jsonl'])_0xd863f4=_0x530df6(0x19a);else{if(_0x10bbb0[_0x530df6(0x191)])_0xd863f4='tsv';else{if(_0x10bbb0[_0x530df6(0x13c)])_0xd863f4=_0x530df6(0x13c);}}}const _0x1a6d06=_0x10bbb0[_0x530df6(0x138)];let _0x53534e=_0x45f8b8;const _0x586d54=a5_0x8b428c['existsSync'](_0x45f8b8),_0x264448=_0x45f8b8==='.';if(!_0x586d54||_0x264448){const _0x125385=resolveProjectFromContext(_0x45f8b8,_0x1a6d06,{'requireFile':_0x530df6(0x1a4)});if(_0x125385[_0x530df6(0x134)])_0x53534e=_0x125385[_0x530df6(0x165)],_0x125385['source']===_0x530df6(0x1b3)&&console['log'](a5_0x10f466['dim'](_0x530df6(0x132)+_0x53534e));else switch(_0x125385['reason']){case'no_context':console['log'](a5_0x10f466[_0x530df6(0x11f)](_0x125385[_0x530df6(0x18e)])),console[_0x530df6(0x17d)](),console[_0x530df6(0x17d)]('Usage:'),console[_0x530df6(0x17d)](_0x530df6(0x15a)),console[_0x530df6(0x17d)](_0x530df6(0x1a8)),console[_0x530df6(0x17d)](),console[_0x530df6(0x17d)](_0x530df6(0x196));return 0x1;case _0x530df6(0x178):console[_0x530df6(0x17d)](a5_0x10f466[_0x530df6(0x11f)](_0x125385[_0x530df6(0x18e)])),console['log'](),console[_0x530df6(0x17d)](_0x530df6(0x175)+_0x125385['llmProject']+_0x530df6(0x145));return 0x1;case _0x530df6(0x1b1):{const _0x3a5d42=a5_0x5d6cf2['basename'](_0x125385['projectDir']);console[_0x530df6(0x17d)](a5_0x10f466['yellow'](_0x530df6(0x192)+_0x125385[_0x530df6(0x138)]+'\x22:'));for(const _0x30a6fb of _0x125385[_0x530df6(0x15e)]){console[_0x530df6(0x17d)](_0x530df6(0x1ab)+_0x30a6fb);}return console['log'](),console['log']('Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/'+_0x3a5d42+'/<agent-name>'),0x1;}case'no_tests':console['log'](a5_0x10f466[_0x530df6(0x11f)](_0x530df6(0x136)+_0x125385[_0x530df6(0x138)]+'\x22.')),console['log'](a5_0x10f466[_0x530df6(0x120)]('Project\x20path:\x20'+_0x125385[_0x530df6(0x165)])),console[_0x530df6(0x17d)](),console[_0x530df6(0x17d)](_0x530df6(0x18f));return 0x1;}}const {definition:_0x4d5caf,agentInfo:_0x3dabfb}=parseTestFile(_0x53534e);let _0x4e9391=_0x4d5caf[_0x530df6(0x19e)];if(_0x409c3d){const _0x43028c=_0x409c3d[_0x530df6(0x16d)](',')[_0x530df6(0x148)](_0x172fb3=>_0x172fb3[_0x530df6(0x12e)]());_0x4e9391=_0x4d5caf[_0x530df6(0x19e)]['filter'](_0x7b96c=>_0x43028c[_0x530df6(0x140)](_0x7b96c['name']));if(_0x4e9391[_0x530df6(0x16c)]===0x0)return console['log'](a5_0x10f466[_0x530df6(0x11f)](_0x530df6(0x14e)+_0x409c3d)),console['log'](a5_0x10f466['dim'](_0x530df6(0x14f)+_0x4d5caf['tests']['map'](_0x1ac888=>_0x1ac888[_0x530df6(0x15f)])[_0x530df6(0x151)](',\x20'))),0x1;}if(_0x2225f4){const _0x46940b=_0x2225f4[_0x530df6(0x16d)](',')['map'](_0x3dd75e=>_0x3dd75e[_0x530df6(0x12e)]()['toLowerCase']());_0x4e9391=_0x4e9391[_0x530df6(0x1ac)](_0x714d20=>_0x714d20['tags']?.['some'](_0x38c099=>_0x46940b['includes'](_0x38c099['toLowerCase']())));if(_0x4e9391[_0x530df6(0x16c)]===0x0){console[_0x530df6(0x17d)](a5_0x10f466['yellow'](_0x530df6(0x194)+_0x2225f4));const _0x5ae5da=new Set();return _0x4d5caf['tests'][_0x530df6(0x180)](_0x8f93c2=>_0x8f93c2['tags']?.[_0x530df6(0x180)](_0x44b86d=>_0x5ae5da[_0x530df6(0x1a0)](_0x44b86d))),_0x5ae5da[_0x530df6(0x17e)]>0x0?console[_0x530df6(0x17d)](a5_0x10f466['dim']('Available\x20tags:\x20'+[..._0x5ae5da][_0x530df6(0x151)](',\x20'))):console['log'](a5_0x10f466[_0x530df6(0x120)](_0x530df6(0x124))),0x1;}}if(_0x3f4d2b)return this['executeReeval'](_0x5d9ec2,{'definition':{'tests':_0x4e9391},'agentInfo':_0x3dabfb,'outputFormat':_0xd863f4,'outputFile':_0x4e420d,'testNames':_0x409c3d});if(_0x1a028f){console[_0x530df6(0x17d)](a5_0x10f466[_0x530df6(0x190)](_0x530df6(0x129))),console[_0x530df6(0x17d)]('\x20\x20Site:\x20'+a5_0x10f466['white'](_0x499cce)),console[_0x530df6(0x17d)]('\x20\x20Project:\x20'+a5_0x10f466[_0x530df6(0x1a6)](_0x3dabfb['projectName'])),console[_0x530df6(0x17d)](_0x530df6(0x17b)+a5_0x10f466[_0x530df6(0x1a6)](_0x3dabfb['agentName'])),console[_0x530df6(0x17d)](),console[_0x530df6(0x17d)]('Tests\x20found:\x20'+a5_0x10f466[_0x530df6(0x1a6)](_0x4e9391[_0x530df6(0x16c)]));for(let _0x3b4f60=0x0;_0x3b4f60<_0x4e9391[_0x530df6(0x16c)];_0x3b4f60++){const _0x580822=_0x4e9391[_0x3b4f60],_0x1f2df3=_0x580822[_0x530df6(0x187)][_0x530df6(0x16c)]===0x1?_0x530df6(0x177):'rounds',_0x1a7662=_0x580822[_0x530df6(0x127)]?.[_0x530df6(0x16c)]?'\x20['+_0x580822[_0x530df6(0x127)]['join'](',\x20')+']':'';console[_0x530df6(0x17d)]('\x20\x20'+(_0x3b4f60+0x1)+'.\x20'+a5_0x10f466['white'](_0x580822[_0x530df6(0x15f)])+'\x20('+_0x580822[_0x530df6(0x187)][_0x530df6(0x16c)]+'\x20'+_0x1f2df3+')'+a5_0x10f466[_0x530df6(0x120)](_0x1a7662));}return 0x0;}let _0x21d113,_0x15842d;try{_0x21d113=await _0xbf98e['llm'][_0x530df6(0x170)](_0x3dabfb[_0x530df6(0x13a)]);}catch(_0x25273c){const _0x3b68bd=_0x25273c instanceof Error?_0x25273c[_0x530df6(0x18e)]:String(_0x25273c);return _0x3b68bd[_0x530df6(0x140)](_0x530df6(0x1aa))||_0x3b68bd[_0x530df6(0x12d)]()[_0x530df6(0x140)]('not\x20found')?console[_0x530df6(0x17d)](a5_0x10f466[_0x530df6(0x12b)](_0x530df6(0x17a)+_0x3dabfb[_0x530df6(0x13a)])):console[_0x530df6(0x17d)](a5_0x10f466[_0x530df6(0x12b)](_0x530df6(0x153)+_0x3dabfb[_0x530df6(0x13a)]+_0x530df6(0x152)+_0x3b68bd)),0x1;}try{_0x15842d=await _0xbf98e['llm']['resolveAgentId'](_0x3dabfb[_0x530df6(0x1a9)],_0x21d113);}catch(_0x2fa916){const _0x19bad6=_0x2fa916 instanceof Error?_0x2fa916['message']:String(_0x2fa916);return _0x19bad6[_0x530df6(0x140)](_0x530df6(0x1aa))||_0x19bad6[_0x530df6(0x12d)]()[_0x530df6(0x140)](_0x530df6(0x1b2))?console[_0x530df6(0x17d)](a5_0x10f466[_0x530df6(0x12b)](_0x530df6(0x158)+_0x3dabfb['agentName'])):console[_0x530df6(0x17d)](a5_0x10f466['red'](_0x530df6(0x169)+_0x3dabfb['agentName']+'\x22:\x20'+_0x19bad6)),0x1;}let _0x2fcba2;if(!_0x1a803e)try{_0x2fcba2=await setupEvaluatorAgent(_0xbf98e[_0x530df6(0x157)],_0x11fb7a[_0x530df6(0x125)]);}catch(_0x5c6e44){const _0x4fbfda=_0x5c6e44 instanceof Error?_0x5c6e44[_0x530df6(0x18e)]:String(_0x5c6e44);return console['log'](a5_0x10f466['red']('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x4fbfda)),0x1;}console[_0x530df6(0x17d)](a5_0x10f466[_0x530df6(0x190)]('Running\x20agent\x20tests...')),console['log'](_0x530df6(0x198)+a5_0x10f466['white'](_0x499cce)),console['log']('Agent:\x20'+a5_0x10f466[_0x530df6(0x1a6)](_0x3dabfb[_0x530df6(0x13a)]+'/'+_0x3dabfb[_0x530df6(0x1a9)])),console[_0x530df6(0x17d)]();const _0x5b993b=[],_0x54e09e=[],_0x500800=Date[_0x530df6(0x14b)]();for(let _0x455820=0x0;_0x455820<_0x4e9391[_0x530df6(0x16c)];_0x455820++){const _0x3e7fd5=_0x4e9391[_0x455820];_0x4e9391[_0x530df6(0x16c)]>0x1?console['log'](_0x530df6(0x179)+(_0x455820+0x1)+'/'+_0x4e9391[_0x530df6(0x16c)]+':\x20'+a5_0x10f466[_0x530df6(0x1a6)](_0x3e7fd5[_0x530df6(0x15f)])):console[_0x530df6(0x17d)](_0x530df6(0x131)+a5_0x10f466[_0x530df6(0x1a6)](_0x3e7fd5[_0x530df6(0x15f)]));const _0x2b068a=createCommandSpinner(_0x530df6(0x182)+_0x3e7fd5[_0x530df6(0x187)][_0x530df6(0x16c)]+_0x530df6(0x143));_0x2b068a[_0x530df6(0x18b)]();try{const {result:_0x594da7,conversation:_0x12dab5}=await runTest(_0xbf98e[_0x530df6(0x157)],_0x3e7fd5,{'agentId':_0x15842d,'projectId':_0x21d113,'site':_0x499cce,'noEval':_0x1a803e,'evaluatorId':_0x2fcba2,'onRoundStart':(_0x52a37c,_0x23ad2d)=>{const _0x32b000=_0x530df6;_0x2b068a[_0x32b000(0x154)]=_0x32b000(0x161)+(_0x52a37c+0x1)+'/'+_0x23ad2d+_0x32b000(0x143);},'onRoundComplete':(_0x12cce7,_0x3816e7,_0xb883d2)=>{const _0x4fde3e=_0x530df6,_0x9bb5e2=formatElapsed(_0x3816e7);_0xb883d2?console[_0x4fde3e(0x17d)](_0x4fde3e(0x149)+(_0x12cce7+0x1)+'/'+_0x3e7fd5[_0x4fde3e(0x187)][_0x4fde3e(0x16c)]+_0x4fde3e(0x156)+a5_0x10f466[_0x4fde3e(0x137)]('✓')+'\x20('+_0x9bb5e2+')'):console['log'](_0x4fde3e(0x149)+(_0x12cce7+0x1)+'/'+_0x3e7fd5[_0x4fde3e(0x187)][_0x4fde3e(0x16c)]+_0x4fde3e(0x156)+a5_0x10f466[_0x4fde3e(0x12b)]('✗'));},'onEvaluationStart':()=>{const _0x3245d1=_0x530df6;_0x2b068a['text']=_0x3245d1(0x133);},'onEvaluationComplete':_0x4a4a09=>{const _0x41777e=_0x530df6,_0x10dcdd=formatElapsed(_0x4a4a09);console[_0x41777e(0x17d)](_0x41777e(0x171)+a5_0x10f466[_0x41777e(0x137)]('✓')+'\x20('+_0x10dcdd+')');}});_0x2b068a[_0x530df6(0x19f)](),_0x5b993b['push'](_0x594da7),_0x54e09e[_0x530df6(0x1a7)](_0x12dab5);if(_0x594da7[_0x530df6(0x164)]===_0x530df6(0x188))console['log'](a5_0x10f466[_0x530df6(0x137)](_0x530df6(0x15c)+_0x594da7[_0x530df6(0x159)]));else _0x594da7['status']===_0x530df6(0x15d)?console[_0x530df6(0x17d)](a5_0x10f466[_0x530df6(0x12b)](_0x530df6(0x126)+_0x594da7['reason'])):console[_0x530df6(0x17d)](a5_0x10f466[_0x530df6(0x12b)](_0x530df6(0x14c)+_0x594da7['reason']));_0x594da7[_0x530df6(0x13e)]&&console[_0x530df6(0x17d)](a5_0x10f466[_0x530df6(0x120)](_0x530df6(0x12a)+_0x594da7[_0x530df6(0x13e)])),console['log']();}catch(_0x49d69b){_0x2b068a[_0x530df6(0x19f)]();const _0x3c0aa2=_0x49d69b instanceof Error?_0x49d69b['message']:String(_0x49d69b);console[_0x530df6(0x17d)](a5_0x10f466[_0x530df6(0x12b)](_0x530df6(0x14c)+_0x3c0aa2)),console[_0x530df6(0x17d)](),_0x5b993b[_0x530df6(0x1a7)]({'name':_0x3e7fd5[_0x530df6(0x15f)],'status':'ERROR','reason':_0x3c0aa2,'timestamp':new Date()[_0x530df6(0x168)](),'duration_ms':0x0});}}const _0x5b8dc4=Date[_0x530df6(0x14b)]()-_0x500800,_0x2a9557=_0x5b993b['filter'](_0x44e974=>_0x44e974['status']===_0x530df6(0x188))[_0x530df6(0x16c)],_0x3b45af=_0x5b993b[_0x530df6(0x1ac)](_0x4364a2=>_0x4364a2[_0x530df6(0x164)]===_0x530df6(0x15d))[_0x530df6(0x16c)],_0x1814fb=_0x5b993b[_0x530df6(0x1ac)](_0x3a6675=>_0x3a6675[_0x530df6(0x164)]===_0x530df6(0x183))[_0x530df6(0x16c)];console[_0x530df6(0x17d)]('━'[_0x530df6(0x128)](0x3c)),console[_0x530df6(0x17d)](_0x530df6(0x189)),console[_0x530df6(0x17d)]('━'[_0x530df6(0x128)](0x3c)),console[_0x530df6(0x17d)](_0x530df6(0x150)+_0x5b993b[_0x530df6(0x16c)]),console[_0x530df6(0x17d)]('Passed:\x20\x20\x20'+a5_0x10f466[_0x530df6(0x137)](_0x2a9557)),console['log']('Failed:\x20\x20\x20'+a5_0x10f466[_0x530df6(0x12b)](_0x3b45af));_0x1814fb>0x0&&console[_0x530df6(0x17d)](_0x530df6(0x16b)+a5_0x10f466[_0x530df6(0x12b)](_0x1814fb));console['log'](_0x530df6(0x184)+formatElapsed(_0x5b8dc4)),console[_0x530df6(0x17d)]('━'[_0x530df6(0x128)](0x3c));const _0x19e116=_0x5b993b['filter'](_0x2496c0=>_0x2496c0[_0x530df6(0x164)]!==_0x530df6(0x188));if(_0x19e116[_0x530df6(0x16c)]>0x0){console[_0x530df6(0x17d)](),console['log'](_0x530df6(0x1ad));for(const _0x4b7d9a of _0x19e116){const _0x58e01d=a5_0x10f466[_0x530df6(0x12b)]('✗'),_0x32a41c=_0x4b7d9a[_0x530df6(0x159)][_0x530df6(0x16c)]>0x32?_0x4b7d9a[_0x530df6(0x159)][_0x530df6(0x144)](0x0,0x32)+_0x530df6(0x19b):_0x4b7d9a[_0x530df6(0x159)];console[_0x530df6(0x17d)]('\x20\x20'+_0x58e01d+'\x20'+_0x4b7d9a['name']+':\x20'+_0x32a41c);}}const _0x10be97={'summary':{'total':_0x5b993b[_0x530df6(0x16c)],'passed':_0x2a9557,'failed':_0x3b45af,'errors':_0x1814fb>0x0?_0x1814fb:undefined,'duration_ms':_0x5b8dc4},'tests':_0x5b993b,'agent':{'project':_0x3dabfb[_0x530df6(0x13a)],'name':_0x3dabfb[_0x530df6(0x1a9)],'site':_0x499cce},'timestamp':new Date(_0x500800)['toISOString']()};try{const _0x4c6808=buildCachedTestRun(_0x54e09e,{'site':_0x499cce,'projectId':_0x21d113,'projectName':_0x3dabfb[_0x530df6(0x13a)],'agentId':_0x15842d,'agentName':_0x3dabfb['agentName'],'testYmlPath':a5_0x5d6cf2[_0x530df6(0x18c)](_0x3dabfb[_0x530df6(0x141)])});saveLastTestRun(_0x4c6808);}catch{}if(_0xd863f4!=='table'||_0x4e420d){const _0x2282ce=formatResults(_0x10be97,_0xd863f4);if(_0x4e420d)try{a5_0x8b428c[_0x530df6(0x13f)](_0x4e420d,_0x2282ce,_0x530df6(0x199)),console[_0x530df6(0x17d)](),console[_0x530df6(0x17d)](a5_0x10f466[_0x530df6(0x120)](_0x530df6(0x16a)+_0x4e420d));}catch(_0x47b658){return console['log'](),console[_0x530df6(0x17d)](a5_0x10f466[_0x530df6(0x12b)]('Error\x20writing\x20output\x20file:\x20'+_0x47b658)),0x1;}else console[_0x530df6(0x17d)](),console['log'](_0x2282ce);}return _0x19e116['length']>0x0?0x1:0x0;}async[a5_0x5ec6a5(0x160)](_0x1335cc,_0x2524fa){const _0x1b82b0=a5_0x5ec6a5,{options:_0x40402e,tdx:_0x35ccb2}=_0x1335cc,{definition:_0xead0a2,agentInfo:_0x37bdaa,outputFormat:_0x556475,outputFile:_0x49d664}=_0x2524fa,_0x5172e7=_0x40402e[_0x1b82b0(0x16e)],_0x15155e=loadLastTestRun();if(!_0x15155e)return console[_0x1b82b0(0x17d)](a5_0x10f466[_0x1b82b0(0x12b)](_0x1b82b0(0x16f))),console[_0x1b82b0(0x17d)](a5_0x10f466[_0x1b82b0(0x120)](_0x1b82b0(0x162))),0x1;if(_0x15155e[_0x1b82b0(0x1a1)][_0x1b82b0(0x1a9)]!==_0x37bdaa[_0x1b82b0(0x1a9)])return console[_0x1b82b0(0x17d)](a5_0x10f466['red']('Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22'+_0x15155e['agent'][_0x1b82b0(0x1a9)]+'\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22'+_0x37bdaa[_0x1b82b0(0x1a9)]+'\x22.')),console[_0x1b82b0(0x17d)](a5_0x10f466[_0x1b82b0(0x120)](_0x1b82b0(0x1a2))),0x1;const _0x5371b5=new Set(_0x15155e['conversations'][_0x1b82b0(0x148)](_0x4b1b4b=>_0x4b1b4b[_0x1b82b0(0x186)])),_0x2065f4=_0xead0a2[_0x1b82b0(0x19e)][_0x1b82b0(0x1ac)](_0x36242e=>!_0x5371b5[_0x1b82b0(0x142)](_0x36242e[_0x1b82b0(0x15f)]));if(_0x2065f4['length']>0x0&&_0x15155e[_0x1b82b0(0x16e)]!==_0x5172e7)return console['log'](a5_0x10f466['red'](_0x1b82b0(0x176))),console['log'](a5_0x10f466['dim'](_0x1b82b0(0x146)+_0x15155e[_0x1b82b0(0x16e)]+_0x1b82b0(0x139)+_0x5172e7+'\x22.')),console[_0x1b82b0(0x17d)](a5_0x10f466[_0x1b82b0(0x120)](_0x1b82b0(0x130)+_0x15155e['site']+_0x1b82b0(0x1a3))),0x1;const _0x2f945c=_0xead0a2[_0x1b82b0(0x19e)][_0x1b82b0(0x1ac)](_0x14f37d=>_0x5371b5[_0x1b82b0(0x142)](_0x14f37d[_0x1b82b0(0x15f)])),_0x2c9a7d=_0x2065f4;let _0x3c0b13;try{_0x3c0b13=await setupEvaluatorAgent(_0x35ccb2[_0x1b82b0(0x157)],_0x40402e['verbose']);}catch(_0x3714ed){const _0x1bae9c=_0x3714ed instanceof Error?_0x3714ed[_0x1b82b0(0x18e)]:String(_0x3714ed);return console[_0x1b82b0(0x17d)](a5_0x10f466[_0x1b82b0(0x12b)](_0x1b82b0(0x1af)+_0x1bae9c)),0x1;}console['log'](a5_0x10f466[_0x1b82b0(0x190)]('Re-evaluating\x20cached\x20test\x20run...')),console[_0x1b82b0(0x17d)](_0x1b82b0(0x195)+a5_0x10f466[_0x1b82b0(0x1a6)](_0x15155e[_0x1b82b0(0x122)])),console[_0x1b82b0(0x17d)](_0x1b82b0(0x147)+a5_0x10f466['white'](_0x15155e['agent']['projectName']+'/'+_0x15155e[_0x1b82b0(0x1a1)]['agentName']));_0x2c9a7d['length']>0x0&&console[_0x1b82b0(0x17d)](_0x1b82b0(0x121)+a5_0x10f466['yellow'](_0x2c9a7d[_0x1b82b0(0x16c)]));console[_0x1b82b0(0x17d)]();const _0x3ddc4e=[],_0x8f283d=Date[_0x1b82b0(0x14b)](),_0x3d76f9=createCommandSpinner(_0x1b82b0(0x172));if(_0x2f945c[_0x1b82b0(0x16c)]>0x0)try{const _0x21f378=await reevaluateFromCache(_0x35ccb2[_0x1b82b0(0x157)],_0x15155e,{'tests':_0x2f945c},{'evaluatorId':_0x3c0b13,'onTestStart':(_0x365a1d,_0x1c7e4d,_0x30934f)=>{const _0x2676cb=_0x1b82b0;_0x3d76f9['text']=_0x2676cb(0x13d)+(_0x1c7e4d+0x1)+'/'+_0x30934f+':\x20'+_0x365a1d+_0x2676cb(0x19b);if(!_0x3d76f9[_0x2676cb(0x14a)])_0x3d76f9[_0x2676cb(0x18b)]();},'onTestComplete':(_0x35ab86,_0x4a56b7)=>{const _0x628b65=_0x1b82b0;_0x3d76f9[_0x628b65(0x19f)]();if(_0x4a56b7[_0x628b65(0x164)]==='PASS')console[_0x628b65(0x17d)](a5_0x10f466[_0x628b65(0x137)](_0x628b65(0x15c)+_0x35ab86)+a5_0x10f466[_0x628b65(0x120)]('\x20(cached)'));else _0x4a56b7['status']===_0x628b65(0x15d)?console['log'](a5_0x10f466['red']('✗\x20FAIL:\x20'+_0x35ab86+'\x20-\x20'+_0x4a56b7['reason'])+a5_0x10f466['dim']('\x20(cached)')):console[_0x628b65(0x17d)](a5_0x10f466[_0x628b65(0x12b)]('✗\x20ERROR:\x20'+_0x35ab86+_0x628b65(0x19c)+_0x4a56b7[_0x628b65(0x159)]));_0x4a56b7[_0x628b65(0x13e)]&&console[_0x628b65(0x17d)](a5_0x10f466[_0x628b65(0x120)](_0x628b65(0x166)+_0x4a56b7[_0x628b65(0x13e)])),_0x3ddc4e[_0x628b65(0x1a7)](_0x4a56b7);},'onTestSkipped':(_0xf786f7,_0x3b5003)=>{const _0x3543db=_0x1b82b0;_0x3d76f9[_0x3543db(0x19f)](),console[_0x3543db(0x17d)](a5_0x10f466['yellow'](_0x3543db(0x193)+_0xf786f7+'\x20-\x20'+_0x3b5003));}});for(const _0x32338f of _0x21f378){!_0x3ddc4e[_0x1b82b0(0x163)](_0x98a7c7=>_0x98a7c7[_0x1b82b0(0x15f)]===_0x32338f[_0x1b82b0(0x15f)])&&_0x3ddc4e[_0x1b82b0(0x1a7)](_0x32338f);}}catch(_0x160eda){_0x3d76f9[_0x1b82b0(0x19f)]();const _0x2154f0=_0x160eda instanceof Error?_0x160eda[_0x1b82b0(0x18e)]:String(_0x160eda);return console['log'](a5_0x10f466[_0x1b82b0(0x12b)](_0x1b82b0(0x13b)+_0x2154f0)),0x1;}_0x3d76f9[_0x1b82b0(0x19f)]();if(_0x2c9a7d['length']>0x0){console['log'](),console[_0x1b82b0(0x17d)](a5_0x10f466[_0x1b82b0(0x190)]('Executing\x20new\x20tests...'));const {projectId:_0x43e3b8,agentId:_0x44e7bb}=_0x15155e['agent'];for(const _0x337e3f of _0x2c9a7d){console['log'](_0x1b82b0(0x12c)+a5_0x10f466[_0x1b82b0(0x1a6)](_0x337e3f['name']));const _0x5dc10b=createCommandSpinner('Round\x201/'+_0x337e3f['rounds'][_0x1b82b0(0x16c)]+_0x1b82b0(0x143));_0x5dc10b['start']();try{const {result:_0x593d5e}=await runTest(_0x35ccb2['llm'],_0x337e3f,{'agentId':_0x44e7bb,'projectId':_0x43e3b8,'site':_0x15155e[_0x1b82b0(0x16e)],'noEval':![],'evaluatorId':_0x3c0b13,'onRoundStart':(_0x23e45d,_0x63aea0)=>{const _0x3de2c2=_0x1b82b0;_0x5dc10b[_0x3de2c2(0x154)]=_0x3de2c2(0x161)+(_0x23e45d+0x1)+'/'+_0x63aea0+_0x3de2c2(0x143);},'onRoundComplete':(_0x2f3c77,_0xbd4629,_0x2313a)=>{const _0x438999=_0x1b82b0,_0x3c5729=formatElapsed(_0xbd4629);_0x2313a?console[_0x438999(0x17d)]('\x20\x20Round\x20'+(_0x2f3c77+0x1)+'/'+_0x337e3f['rounds'][_0x438999(0x16c)]+_0x438999(0x156)+a5_0x10f466['green']('✓')+'\x20('+_0x3c5729+')'):console[_0x438999(0x17d)](_0x438999(0x149)+(_0x2f3c77+0x1)+'/'+_0x337e3f['rounds']['length']+_0x438999(0x156)+a5_0x10f466[_0x438999(0x12b)]('✗'));},'onEvaluationStart':()=>{const _0x56a4b7=_0x1b82b0;_0x5dc10b['text']=_0x56a4b7(0x133);},'onEvaluationComplete':_0x3f69d3=>{const _0x8b93ea=_0x1b82b0,_0x59f9ff=formatElapsed(_0x3f69d3);console[_0x8b93ea(0x17d)](_0x8b93ea(0x171)+a5_0x10f466[_0x8b93ea(0x137)]('✓')+'\x20('+_0x59f9ff+')');}});_0x5dc10b[_0x1b82b0(0x19f)](),_0x3ddc4e['push'](_0x593d5e);if(_0x593d5e[_0x1b82b0(0x164)]===_0x1b82b0(0x188))console[_0x1b82b0(0x17d)](a5_0x10f466[_0x1b82b0(0x137)](_0x1b82b0(0x15c)+_0x593d5e[_0x1b82b0(0x159)])+a5_0x10f466[_0x1b82b0(0x120)]('\x20(new)'));else _0x593d5e[_0x1b82b0(0x164)]===_0x1b82b0(0x15d)?console[_0x1b82b0(0x17d)](a5_0x10f466[_0x1b82b0(0x12b)](_0x1b82b0(0x126)+_0x593d5e[_0x1b82b0(0x159)])+a5_0x10f466[_0x1b82b0(0x120)](_0x1b82b0(0x14d))):console[_0x1b82b0(0x17d)](a5_0x10f466['red'](_0x1b82b0(0x14c)+_0x593d5e['reason']));_0x593d5e[_0x1b82b0(0x13e)]&&console[_0x1b82b0(0x17d)](a5_0x10f466['dim'](_0x1b82b0(0x166)+_0x593d5e['conversation_url']));}catch(_0x3203f3){_0x5dc10b['stop']();const _0x20600c=_0x3203f3 instanceof Error?_0x3203f3[_0x1b82b0(0x18e)]:String(_0x3203f3);console['log'](a5_0x10f466['red'](_0x1b82b0(0x14c)+_0x20600c)),_0x3ddc4e[_0x1b82b0(0x1a7)]({'name':_0x337e3f[_0x1b82b0(0x15f)],'status':_0x1b82b0(0x183),'reason':_0x20600c,'timestamp':new Date()[_0x1b82b0(0x168)](),'duration_ms':0x0});}}}console[_0x1b82b0(0x17d)]();const _0xd076e8=Date[_0x1b82b0(0x14b)]()-_0x8f283d,_0x5d4c00=_0x3ddc4e[_0x1b82b0(0x1ac)](_0x8cc89c=>_0x8cc89c[_0x1b82b0(0x164)]===_0x1b82b0(0x188))[_0x1b82b0(0x16c)],_0x4f0788=_0x3ddc4e[_0x1b82b0(0x1ac)](_0x2b0630=>_0x2b0630[_0x1b82b0(0x164)]===_0x1b82b0(0x15d))['length'],_0x2d72c6=_0x3ddc4e[_0x1b82b0(0x1ac)](_0x9f7c3c=>_0x9f7c3c[_0x1b82b0(0x164)]===_0x1b82b0(0x183))[_0x1b82b0(0x16c)];console[_0x1b82b0(0x17d)]('━'[_0x1b82b0(0x128)](0x3c)),console[_0x1b82b0(0x17d)]('Re-evaluation\x20Summary'),console[_0x1b82b0(0x17d)]('━'[_0x1b82b0(0x128)](0x3c)),console[_0x1b82b0(0x17d)](_0x1b82b0(0x150)+_0x3ddc4e[_0x1b82b0(0x16c)]),console[_0x1b82b0(0x17d)]('Passed:\x20\x20\x20'+a5_0x10f466[_0x1b82b0(0x137)](_0x5d4c00)),console[_0x1b82b0(0x17d)](_0x1b82b0(0x174)+a5_0x10f466[_0x1b82b0(0x12b)](_0x4f0788));_0x2d72c6>0x0&&console[_0x1b82b0(0x17d)](_0x1b82b0(0x16b)+a5_0x10f466[_0x1b82b0(0x12b)](_0x2d72c6));console[_0x1b82b0(0x17d)]('Duration:\x20'+formatElapsed(_0xd076e8)),console[_0x1b82b0(0x17d)]('━'[_0x1b82b0(0x128)](0x3c));const _0x30b0cf={'summary':{'total':_0x3ddc4e[_0x1b82b0(0x16c)],'passed':_0x5d4c00,'failed':_0x4f0788,'errors':_0x2d72c6>0x0?_0x2d72c6:undefined,'duration_ms':_0xd076e8},'tests':_0x3ddc4e,'agent':{'project':_0x37bdaa['projectName'],'name':_0x37bdaa[_0x1b82b0(0x1a9)],'site':_0x5172e7},'timestamp':new Date(_0x8f283d)[_0x1b82b0(0x168)]()};if(_0x556475!=='table'||_0x49d664){const _0x4e873f=formatResults(_0x30b0cf,_0x556475);if(_0x49d664)try{a5_0x8b428c[_0x1b82b0(0x13f)](_0x49d664,_0x4e873f,'utf-8'),console['log'](),console[_0x1b82b0(0x17d)](a5_0x10f466['dim'](_0x1b82b0(0x16a)+_0x49d664));}catch(_0x1d69f6){return console[_0x1b82b0(0x17d)](),console[_0x1b82b0(0x17d)](a5_0x10f466['red'](_0x1b82b0(0x167)+_0x1d69f6)),0x1;}else console[_0x1b82b0(0x17d)](),console[_0x1b82b0(0x17d)](_0x4e873f);}const _0x5ebeb9=_0x3ddc4e[_0x1b82b0(0x1ac)](_0x2d5f7e=>_0x2d5f7e[_0x1b82b0(0x164)]!==_0x1b82b0(0x188));return _0x5ebeb9['length']>0x0?0x1:0x0;}}
@@ -1 +1 @@
1
- const a6_0x4604df=a6_0xf9e6;(function(_0x24e9cd,_0x432071){const _0x146494=a6_0xf9e6,_0x55f1a3=_0x24e9cd();while(!![]){try{const _0x2856ce=parseInt(_0x146494(0x133))/0x1+parseInt(_0x146494(0x126))/0x2+-parseInt(_0x146494(0x12f))/0x3+-parseInt(_0x146494(0x11f))/0x4*(-parseInt(_0x146494(0x128))/0x5)+-parseInt(_0x146494(0x115))/0x6+parseInt(_0x146494(0x12b))/0x7*(parseInt(_0x146494(0x136))/0x8)+-parseInt(_0x146494(0x10e))/0x9;if(_0x2856ce===_0x432071)break;else _0x55f1a3['push'](_0x55f1a3['shift']());}catch(_0x58dfa2){_0x55f1a3['push'](_0x55f1a3['shift']());}}}(a6_0x2500,0x69174));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';function a6_0xf9e6(_0x430203,_0x424726){_0x430203=_0x430203-0xf8;const _0x2500de=a6_0x2500();let _0xf9e6c5=_0x2500de[_0x430203];return _0xf9e6c5;}import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a6_0x4604df(0xff),'proxy-authorization',a6_0x4604df(0x104),a6_0x4604df(0xfb),a6_0x4604df(0x123),a6_0x4604df(0xfd),a6_0x4604df(0x129),a6_0x4604df(0x135)]);function isSensitiveHeader(_0x12f4ca){const _0x29388d=a6_0x4604df;return SENSITIVE_HEADERS[_0x29388d(0x122)](_0x12f4ca[_0x29388d(0x108)]());}function parseHeader(_0x49e8d9){const _0x3889d3=a6_0x4604df,_0x56d1e6=_0x49e8d9['indexOf'](':');if(_0x56d1e6===-0x1)throw new Error(_0x3889d3(0x132)+_0x49e8d9+_0x3889d3(0x131)+_0x3889d3(0x138));const _0x267565=_0x49e8d9[_0x3889d3(0x106)](0x0,_0x56d1e6)[_0x3889d3(0x103)](),_0x236669=_0x49e8d9[_0x3889d3(0x106)](_0x56d1e6+0x1)['trim']();if(!_0x267565)throw new Error('Header\x20key\x20cannot\x20be\x20empty:\x20\x22'+_0x49e8d9+'\x22');return[_0x267565,_0x236669];}export class ApiCommand extends BaseCommand{['name']=a6_0x4604df(0xfa);[a6_0x4604df(0x117)]=a6_0x4604df(0x112);[a6_0x4604df(0xfc)](_0x310345){const _0x5abe26=a6_0x4604df,{args:_0x1b4a75,options:_0x1a822b}=_0x310345,_0x25664a=_0x1a822b;if(_0x1b4a75[_0x5abe26(0x105)]===0x0)return _0x5abe26(0x119);const _0x47d39f=_0x1b4a75[0x0];if(!_0x47d39f[_0x5abe26(0x113)]('/'))return'Endpoint\x20must\x20start\x20with\x20/:\x20'+_0x47d39f;const _0x5de724=_0x25664a[_0x5abe26(0xf9)],_0x5874a0=_0x25664a[_0x5abe26(0x102)];if(_0x5de724&&_0x5874a0)return _0x5abe26(0x118);const _0x5ac2cd=_0x25664a[_0x5abe26(0x10f)]||'GET',_0x365dda=[_0x5abe26(0x101),'POST',_0x5abe26(0x124),_0x5abe26(0x11a),_0x5abe26(0x11d)];if(!_0x365dda['includes'](_0x5ac2cd[_0x5abe26(0xfe)]()))return _0x5abe26(0x11c)+_0x5ac2cd+'.\x20Valid\x20methods:\x20'+_0x365dda[_0x5abe26(0x10c)](',\x20');const _0xf3bfac=_0x25664a['type']||'td',_0x667655=['td',_0x5abe26(0x134),_0x5abe26(0x110),_0x5abe26(0x109),'llm',_0x5abe26(0x10b)];if(!_0x667655['includes'](_0xf3bfac))return'Invalid\x20API\x20type:\x20'+_0xf3bfac+_0x5abe26(0x130)+_0x667655[_0x5abe26(0x10c)](',\x20');return undefined;}async[a6_0x4604df(0x137)](_0x5b794f){const _0x33ff8e=a6_0x4604df,{options:_0x47e3c3,args:_0x776578,tdx:_0x371d0b}=_0x5b794f,_0x5f5985=_0x47e3c3,_0x1b34d3=_0x776578[0x0],_0x5e3b11=(_0x5f5985[_0x33ff8e(0x10f)]||_0x33ff8e(0x101))[_0x33ff8e(0xfe)](),_0x5a6994=_0x5f5985['data'],_0x1f1f69=_0x5f5985[_0x33ff8e(0x102)],_0x52c352=_0x5f5985[_0x33ff8e(0xf8)],_0xa2ada1=_0x5f5985[_0x33ff8e(0x139)]||'td';try{const _0x52e150={};if(_0x52c352){const _0x4482cd=Array[_0x33ff8e(0x11b)](_0x52c352)?_0x52c352:[_0x52c352];for(const _0x1c6964 of _0x4482cd){const [_0x57e807,_0x34d359]=parseHeader(_0x1c6964);_0x52e150[_0x57e807]=_0x34d359;}}let _0x2d1c32;if(_0x5a6994)_0x2d1c32=_0x5a6994;else{if(_0x1f1f69)try{_0x2d1c32=RawAPI[_0x33ff8e(0x127)](_0x1f1f69);}catch(_0x10e227){return console[_0x33ff8e(0x111)]('Error:\x20'+(_0x10e227 instanceof Error?_0x10e227['message']:String(_0x10e227))),0x1;}}const _0x6c067b={'method':_0x5e3b11,'apiType':_0xa2ada1,'includeHeaders':_0x47e3c3[_0x33ff8e(0x116)]};_0x2d1c32&&(_0x6c067b[_0x33ff8e(0x12e)]=_0x2d1c32);Object[_0x33ff8e(0x107)](_0x52e150)[_0x33ff8e(0x105)]>0x0&&(_0x6c067b[_0x33ff8e(0x10a)]=_0x52e150);if(_0x47e3c3[_0x33ff8e(0x116)]){const _0x2fe248=resolveSite(_0x47e3c3[_0x33ff8e(0x114)]),_0x4da452=getEndpoint(_0x2fe248,_0xa2ada1),_0x5c5e13=''+_0x4da452+_0x1b34d3;console[_0x33ff8e(0x111)]('>\x20'+_0x5e3b11+'\x20'+_0x5c5e13);const _0x3fcafa=getAuthHeaders(_0x2fe248),_0x27eefe={..._0x3fcafa,..._0x52e150};for(const [_0x84436f,_0x31944e]of Object['entries'](_0x27eefe)){!isSensitiveHeader(_0x84436f)&&console[_0x33ff8e(0x111)]('>\x20'+_0x84436f+':\x20'+_0x31944e);}_0x2d1c32&&console[_0x33ff8e(0x111)]('>'),console[_0x33ff8e(0x111)]('');}const _0x48cf71=await _0x371d0b['api'][_0x33ff8e(0x12d)](_0x1b34d3,_0x6c067b);if(_0x47e3c3[_0x33ff8e(0x116)]&&_0x48cf71[_0x33ff8e(0x10a)]){console[_0x33ff8e(0x111)](_0x33ff8e(0x10d)+_0x48cf71[_0x33ff8e(0x12a)]);for(const [_0xc97726,_0x17844f]of Object['entries'](_0x48cf71[_0x33ff8e(0x10a)])){!isSensitiveHeader(_0xc97726)&&console[_0x33ff8e(0x111)]('<\x20'+_0xc97726+':\x20'+_0x17844f);}console[_0x33ff8e(0x111)]('');}const _0x1eb196=Boolean(_0x47e3c3['output']),_0x5c9911={'color':_0x47e3c3[_0x33ff8e(0x100)],'noColor':_0x47e3c3['noColor']||_0x1eb196&&!_0x47e3c3['color']},_0xe71e47=colorizeJSON(_0x48cf71[_0x33ff8e(0xf9)],_0x5c9911);return _0x47e3c3[_0x33ff8e(0x125)]?(writeFileSync(_0x47e3c3['output'],_0xe71e47),console[_0x33ff8e(0x111)]('Results\x20saved\x20to\x20'+_0x47e3c3[_0x33ff8e(0x125)])):console[_0x33ff8e(0x11e)](_0xe71e47),0x0;}catch(_0x374663){return _0x374663 instanceof Error?(console[_0x33ff8e(0x111)](_0x33ff8e(0x12c)+_0x374663['message']),_0x47e3c3[_0x33ff8e(0x116)]&&_0x374663[_0x33ff8e(0x121)]&&console[_0x33ff8e(0x111)](_0x33ff8e(0x120)+_0x374663[_0x33ff8e(0x121)])):console[_0x33ff8e(0x111)](_0x33ff8e(0x12c)+String(_0x374663)),0x1;}}}function a6_0x2500(){const _0x140680=['output','388170ktnzFh','readBodyFromFile','1051465pttNsc','x-auth-token','status','999397zfwtcc','Error:\x20','request','body','1865268hnbUyK','.\x20Valid\x20types:\x20','\x22.\x20','Invalid\x20header\x20format:\x20\x22','602728kQBlhK','cdp','x-trino-user','8DURXRy','execute','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','type','header','data','api','set-cookie','validate','x-xsrf-token','toUpperCase','authorization','color','GET','file','trim','cookie','length','substring','keys','toLowerCase','trino','headers','llm-proxy','join','<\x20HTTP/1.1\x20','165942qhsjUl','method','workflow','error','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','startsWith','site','475386tKeHPg','verbose','description','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','DELETE','isArray','Invalid\x20HTTP\x20method:\x20','PATCH','log','4swBPdH','\x0aStack\x20trace:\x0a','stack','has','set-cookie2','PUT'];a6_0x2500=function(){return _0x140680;};return a6_0x2500();}
1
+ const a6_0x496c35=a6_0x5e24;(function(_0x4fbdd0,_0x35d438){const _0x4e2786=a6_0x5e24,_0x12590b=_0x4fbdd0();while(!![]){try{const _0x269240=-parseInt(_0x4e2786(0x20d))/0x1+-parseInt(_0x4e2786(0x1f1))/0x2*(parseInt(_0x4e2786(0x20e))/0x3)+-parseInt(_0x4e2786(0x1d5))/0x4+parseInt(_0x4e2786(0x1ec))/0x5*(parseInt(_0x4e2786(0x1e3))/0x6)+parseInt(_0x4e2786(0x1d8))/0x7+parseInt(_0x4e2786(0x1f6))/0x8*(parseInt(_0x4e2786(0x1ff))/0x9)+parseInt(_0x4e2786(0x1fe))/0xa*(parseInt(_0x4e2786(0x1ea))/0xb);if(_0x269240===_0x35d438)break;else _0x12590b['push'](_0x12590b['shift']());}catch(_0x506229){_0x12590b['push'](_0x12590b['shift']());}}}(a6_0x5a50,0xe73e7));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';function a6_0x5a50(){const _0x1fa4ae=['37885yEtREV','includes','message','Error:\x20','method','280FOTkYp','stack','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','cdp','DELETE','32424VieJgh','trim','site','llm','startsWith','cookie','file','.\x20Valid\x20types:\x20','282630mmdIai','4113ZBlcKh','readBodyFromFile','toLowerCase','x-auth-token','Invalid\x20HTTP\x20method:\x20','header','data','substring','output','type','length','indexOf','api','\x22.\x20','1654737YWWfgd','22299idPuup','join','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','error','color','Invalid\x20API\x20type:\x20','4233156uDOuTd','x-xsrf-token','GET','8726396zRcMCe','proxy-authorization','x-trino-user','toUpperCase','execute','workflow','description','headers','POST','set-cookie2','request','60tiYdla','log','set-cookie','entries','name','PUT','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','594EeIeEl','verbose'];a6_0x5a50=function(){return _0x1fa4ae;};return a6_0x5a50();}import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';function a6_0x5e24(_0x3f93a0,_0x38a9ff){_0x3f93a0=_0x3f93a0-0x1d5;const _0x5a508d=a6_0x5a50();let _0x5e2445=_0x5a508d[_0x3f93a0];return _0x5e2445;}const SENSITIVE_HEADERS=new Set(['authorization',a6_0x496c35(0x1d9),a6_0x496c35(0x1fb),a6_0x496c35(0x1e5),a6_0x496c35(0x1e1),a6_0x496c35(0x1d6),a6_0x496c35(0x202),a6_0x496c35(0x1da)]);function isSensitiveHeader(_0x1ce936){const _0x244702=a6_0x496c35;return SENSITIVE_HEADERS['has'](_0x1ce936[_0x244702(0x201)]());}function parseHeader(_0x1c085a){const _0x1bac02=a6_0x496c35,_0x4efa63=_0x1c085a[_0x1bac02(0x20a)](':');if(_0x4efa63===-0x1)throw new Error('Invalid\x20header\x20format:\x20\x22'+_0x1c085a+_0x1bac02(0x20c)+_0x1bac02(0x210));const _0xc4a12e=_0x1c085a[_0x1bac02(0x206)](0x0,_0x4efa63)[_0x1bac02(0x1f7)](),_0x4baa84=_0x1c085a[_0x1bac02(0x206)](_0x4efa63+0x1)[_0x1bac02(0x1f7)]();if(!_0xc4a12e)throw new Error('Header\x20key\x20cannot\x20be\x20empty:\x20\x22'+_0x1c085a+'\x22');return[_0xc4a12e,_0x4baa84];}export class ApiCommand extends BaseCommand{[a6_0x496c35(0x1e7)]=a6_0x496c35(0x20b);[a6_0x496c35(0x1de)]='Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs';['validate'](_0x3cb18f){const _0x3fa464=a6_0x496c35,{args:_0x2734b4,options:_0x1fa0d9}=_0x3cb18f,_0x2fa799=_0x1fa0d9;if(_0x2734b4[_0x3fa464(0x209)]===0x0)return _0x3fa464(0x1e9);const _0x14550c=_0x2734b4[0x0];if(!_0x14550c[_0x3fa464(0x1fa)]('/'))return'Endpoint\x20must\x20start\x20with\x20/:\x20'+_0x14550c;const _0x548403=_0x2fa799['data'],_0x1651e2=_0x2fa799[_0x3fa464(0x1fc)];if(_0x548403&&_0x1651e2)return _0x3fa464(0x1f3);const _0x534adc=_0x2fa799['method']||_0x3fa464(0x1d7),_0x9f6e01=['GET',_0x3fa464(0x1e0),_0x3fa464(0x1e8),_0x3fa464(0x1f5),'PATCH'];if(!_0x9f6e01[_0x3fa464(0x1ed)](_0x534adc[_0x3fa464(0x1db)]()))return _0x3fa464(0x203)+_0x534adc+'.\x20Valid\x20methods:\x20'+_0x9f6e01['join'](',\x20');const _0x1e7ea8=_0x2fa799['type']||'td',_0xfa5c0=['td',_0x3fa464(0x1f4),_0x3fa464(0x1dd),'trino',_0x3fa464(0x1f9),'llm-proxy'];if(!_0xfa5c0[_0x3fa464(0x1ed)](_0x1e7ea8))return _0x3fa464(0x213)+_0x1e7ea8+_0x3fa464(0x1fd)+_0xfa5c0[_0x3fa464(0x20f)](',\x20');return undefined;}async[a6_0x496c35(0x1dc)](_0xf4b289){const _0x587ba8=a6_0x496c35,{options:_0x237358,args:_0x2863d6,tdx:_0x5a8442}=_0xf4b289,_0x5b8c5b=_0x237358,_0x5620f5=_0x2863d6[0x0],_0x3b76d7=(_0x5b8c5b[_0x587ba8(0x1f0)]||_0x587ba8(0x1d7))[_0x587ba8(0x1db)](),_0x37ada8=_0x5b8c5b[_0x587ba8(0x205)],_0xebbaae=_0x5b8c5b[_0x587ba8(0x1fc)],_0xe6b6ce=_0x5b8c5b[_0x587ba8(0x204)],_0x392e1a=_0x5b8c5b[_0x587ba8(0x208)]||'td';try{const _0x34ba17={};if(_0xe6b6ce){const _0x41eabd=Array['isArray'](_0xe6b6ce)?_0xe6b6ce:[_0xe6b6ce];for(const _0x5bfc10 of _0x41eabd){const [_0x360798,_0x13b005]=parseHeader(_0x5bfc10);_0x34ba17[_0x360798]=_0x13b005;}}let _0x1d1133;if(_0x37ada8)_0x1d1133=_0x37ada8;else{if(_0xebbaae)try{_0x1d1133=RawAPI[_0x587ba8(0x200)](_0xebbaae);}catch(_0x5e2cde){return console[_0x587ba8(0x211)](_0x587ba8(0x1ef)+(_0x5e2cde instanceof Error?_0x5e2cde[_0x587ba8(0x1ee)]:String(_0x5e2cde))),0x1;}}const _0x4f5e2e={'method':_0x3b76d7,'apiType':_0x392e1a,'includeHeaders':_0x237358[_0x587ba8(0x1eb)]};_0x1d1133&&(_0x4f5e2e['body']=_0x1d1133);Object['keys'](_0x34ba17)[_0x587ba8(0x209)]>0x0&&(_0x4f5e2e[_0x587ba8(0x1df)]=_0x34ba17);if(_0x237358[_0x587ba8(0x1eb)]){const _0x3f2b07=resolveSite(_0x237358[_0x587ba8(0x1f8)]),_0x686ae1=getEndpoint(_0x3f2b07,_0x392e1a),_0x2922cc=''+_0x686ae1+_0x5620f5;console['error']('>\x20'+_0x3b76d7+'\x20'+_0x2922cc);const _0x1501d8=getAuthHeaders(_0x3f2b07),_0x9f9c5f={..._0x1501d8,..._0x34ba17};for(const [_0x445077,_0x434c36]of Object[_0x587ba8(0x1e6)](_0x9f9c5f)){!isSensitiveHeader(_0x445077)&&console['error']('>\x20'+_0x445077+':\x20'+_0x434c36);}_0x1d1133&&console[_0x587ba8(0x211)]('>'),console[_0x587ba8(0x211)]('');}const _0x1a102c=await _0x5a8442[_0x587ba8(0x20b)][_0x587ba8(0x1e2)](_0x5620f5,_0x4f5e2e);if(_0x237358[_0x587ba8(0x1eb)]&&_0x1a102c[_0x587ba8(0x1df)]){console[_0x587ba8(0x211)]('<\x20HTTP/1.1\x20'+_0x1a102c['status']);for(const [_0xc76588,_0x315382]of Object[_0x587ba8(0x1e6)](_0x1a102c[_0x587ba8(0x1df)])){!isSensitiveHeader(_0xc76588)&&console['error']('<\x20'+_0xc76588+':\x20'+_0x315382);}console['error']('');}const _0x1aa455=Boolean(_0x237358[_0x587ba8(0x207)]),_0x4b179d={'color':_0x237358[_0x587ba8(0x212)],'noColor':_0x237358['noColor']||_0x1aa455&&!_0x237358[_0x587ba8(0x212)]},_0xc5ea1c=colorizeJSON(_0x1a102c['data'],_0x4b179d);return _0x237358[_0x587ba8(0x207)]?(writeFileSync(_0x237358[_0x587ba8(0x207)],_0xc5ea1c),console[_0x587ba8(0x211)]('Results\x20saved\x20to\x20'+_0x237358['output'])):console[_0x587ba8(0x1e4)](_0xc5ea1c),0x0;}catch(_0x37ce12){return _0x37ce12 instanceof Error?(console[_0x587ba8(0x211)](_0x587ba8(0x1ef)+_0x37ce12[_0x587ba8(0x1ee)]),_0x237358['verbose']&&_0x37ce12[_0x587ba8(0x1f2)]&&console[_0x587ba8(0x211)]('\x0aStack\x20trace:\x0a'+_0x37ce12[_0x587ba8(0x1f2)])):console[_0x587ba8(0x211)](_0x587ba8(0x1ef)+String(_0x37ce12)),0x1;}}}
@@ -1 +1 @@
1
- const a7_0x1a0ba9=a7_0x2673;(function(_0xf66a3e,_0x393d90){const _0x3c89ad=a7_0x2673,_0x4707dd=_0xf66a3e();while(!![]){try{const _0x263031=parseInt(_0x3c89ad(0x72))/0x1+-parseInt(_0x3c89ad(0xb2))/0x2+parseInt(_0x3c89ad(0x76))/0x3+parseInt(_0x3c89ad(0x9d))/0x4*(parseInt(_0x3c89ad(0xb7))/0x5)+-parseInt(_0x3c89ad(0x7c))/0x6+-parseInt(_0x3c89ad(0xb6))/0x7+parseInt(_0x3c89ad(0xad))/0x8*(parseInt(_0x3c89ad(0xbc))/0x9);if(_0x263031===_0x393d90)break;else _0x4707dd['push'](_0x4707dd['shift']());}catch(_0x2b216f){_0x4707dd['push'](_0x4707dd['shift']());}}}(a7_0x2507,0x6d037));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens}from'../core/oauth-keychain.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';function a7_0x2673(_0x4443c6,_0x2810d4){_0x4443c6=_0x4443c6-0x72;const _0x2507ef=a7_0x2507();let _0x2673b6=_0x2507ef[_0x4443c6];return _0x2673b6;}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_0x5c1f19 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_0x2beedd from'chalk';export class AuthSetupCommand extends BaseCommand{[a7_0x1a0ba9(0xb8)]=a7_0x1a0ba9(0x9c);['description']='Setup\x20API\x20key\x20authentication\x20interactively';async[a7_0x1a0ba9(0xab)](_0x11a477){const _0x3e44af=a7_0x1a0ba9,{options:_0x864a9}=_0x11a477,_0xc11819=_0x864a9[_0x3e44af(0x82)];console[_0x3e44af(0x8c)](a7_0x2beedd[_0x3e44af(0xa8)](_0x3e44af(0xb0)));const _0x248605=_0x864a9['site']||_0x3e44af(0x8f),_0x44eec0=await promptSiteSelection(_0x248605,_0xc11819,_0x3e44af(0x7a));if(!_0x44eec0)return 0x1;const _0x4ea2c2=resolveSite(_0x44eec0);if(isOAuthSupported(_0x4ea2c2)){const _0x4be81e=await a7_0x5c1f19({'type':_0x3e44af(0x95),'name':_0x3e44af(0xa9),'message':_0x3e44af(0x8b),'choices':[{'title':_0x3e44af(0x80),'value':_0x3e44af(0x84)},{'title':_0x3e44af(0x8e),'value':'apikey'}]});if(!_0x4be81e[_0x3e44af(0xa9)])return console[_0x3e44af(0x8c)]('\x0aSetup\x20cancelled'),0x1;if(_0x4be81e[_0x3e44af(0xa9)]===_0x3e44af(0x84))return await runOAuthLoginFlow(_0x4ea2c2,_0xc11819,_0x864a9[_0x3e44af(0xbf)]??LogLevel[_0x3e44af(0xbd)]),0x0;}console[_0x3e44af(0x8c)](_0x3e44af(0x93)+_0x4ea2c2),console[_0x3e44af(0x8c)]('You\x20can\x20find\x20your\x20API\x20key\x20at:'),console[_0x3e44af(0x8c)]('\x20\x20'+getConsoleUrl(_0x4ea2c2,_0x3e44af(0x9f)));const _0x1f2093=await a7_0x5c1f19({'type':_0x3e44af(0x85),'name':_0x3e44af(0xb3),'message':_0x3e44af(0x94),'validate':_0x434198=>{const _0x3a275b=_0x3e44af;if(!_0x434198||!_0x434198[_0x3a275b(0xb1)]())return _0x3a275b(0xaf);return!![];}});if(!_0x1f2093[_0x3e44af(0xb3)])return console[_0x3e44af(0x8c)](_0x3e44af(0xc1)),0x1;const _0x4fc748=_0x1f2093['apiKey'];console[_0x3e44af(0x8c)](_0x3e44af(0xa2));try{const _0x8b4e39=TDX[_0x3e44af(0xa5)]({'site':_0x4ea2c2,'apiKey':_0x4fc748['trim'](),'logLevel':_0x864a9['logLevel']??LogLevel[_0x3e44af(0xbd)]}),_0x3896de=await _0x8b4e39[_0x3e44af(0xb9)][_0x3e44af(0x7e)]();console['log'](_0x3e44af(0xae)+_0x3896de[_0x3e44af(0xa4)]+')');const _0x95f7ac=await isKeychainAvailable();_0x95f7ac?(await saveAPIKeyAsync(_0x4fc748[_0x3e44af(0xb1)](),_0x4ea2c2,_0xc11819),console[_0x3e44af(0x8c)](_0x3e44af(0x78)+(_0xc11819?'\x20(profile:\x20'+_0xc11819+')':''))):(console[_0x3e44af(0xb5)](a7_0x2beedd[_0x3e44af(0x7d)](_0x3e44af(0x7f))),console[_0x3e44af(0xb5)](a7_0x2beedd[_0x3e44af(0x7d)](_0x3e44af(0x75))));if(_0xc11819){const _0x38e6da={'site':_0x4ea2c2};saveProfileToUserConfig(_0xc11819,_0x38e6da),console[_0x3e44af(0x8c)](_0x3e44af(0x7b)+_0xc11819+_0x3e44af(0x81));}else saveDefaultSiteToUserConfig(_0x4ea2c2),console[_0x3e44af(0x8c)]('✓\x20Default\x20site\x20set\x20to\x20'+_0x4ea2c2);const _0x4110b9=_0xc11819?_0x3e44af(0x99)+_0xc11819:'';return console['log'](),console[_0x3e44af(0x8c)]('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console[_0x3e44af(0x8c)](_0x3e44af(0xa7)+_0x4110b9+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console[_0x3e44af(0x8c)](_0x3e44af(0xa7)+_0x4110b9+_0x3e44af(0xc0)),0x0;}catch(_0x5d3411){if(_0x5d3411 instanceof HTTPClientError&&_0x5d3411[_0x3e44af(0x9a)]===0x191)return printAuthError(_0x5d3411),0x1;return console[_0x3e44af(0xc2)](a7_0x2beedd[_0x3e44af(0xa3)]('✗\x20Validation\x20failed:\x20'+(_0x5d3411 instanceof Error?_0x5d3411[_0x3e44af(0x79)]:String(_0x5d3411)))),console[_0x3e44af(0xc2)](_0x3e44af(0xac)),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x1a0ba9(0xb8)]='auth';[a7_0x1a0ba9(0xba)]=a7_0x1a0ba9(0x9e);async[a7_0x1a0ba9(0xab)](_0xe15c7a){const _0x2e3088=a7_0x1a0ba9,{options:_0x5b70dc,tdx:_0x570da5}=_0xe15c7a,_0x5d0386=_0x5b70dc[_0x2e3088(0x8d)],_0x2a857d=_0x5b70dc[_0x2e3088(0x82)],_0x5f4570=_0x2a857d?_0x2a857d:_0x2e3088(0x86);console[_0x2e3088(0x8c)](_0x2e3088(0xa1)+_0x5f4570+_0x2e3088(0x92)+_0x5d0386+')');const _0x2e8060=await getOAuthTokens(_0x2a857d);if(_0x2e8060)console['log'](_0x2e3088(0xa0)),console[_0x2e3088(0x8c)](_0x2e3088(0x97)+(_0x2a857d?_0x2e3088(0xbe)+_0x2a857d+')':''));else{const _0x4d8856=await resolveAPIKeyAsync(_0x5d0386,_0x2a857d);if(_0x4d8856){const {source:_0x5a2a48,isDeprecated:_0x1b9f3a}=_0x4d8856,_0x4458e0=_0x2e3088(0x96)+_0x5a2a48;console[_0x2e3088(0x8c)](_0x1b9f3a?a7_0x2beedd[_0x2e3088(0x7d)](_0x4458e0):_0x4458e0);}else console[_0x2e3088(0x8c)](a7_0x2beedd[_0x2e3088(0x7d)](_0x2e3088(0x90)));}try{const _0x6aa4cc=await _0x570da5[_0x2e3088(0xb9)]['getUserInfo']();return console[_0x2e3088(0x8c)](a7_0x2beedd['green'](_0x2e3088(0x73))),console[_0x2e3088(0x8c)](_0x2e3088(0x8a)+_0x6aa4cc['email']),(_0x6aa4cc[_0x2e3088(0x74)]||_0x6aa4cc[_0x2e3088(0xb4)])&&console[_0x2e3088(0x8c)]('Name:\x20'+[_0x6aa4cc[_0x2e3088(0x74)],_0x6aa4cc[_0x2e3088(0xb4)]][_0x2e3088(0x91)](Boolean)[_0x2e3088(0xaa)]('\x20')),0x0;}catch(_0x9f140f){return _0x9f140f instanceof HTTPClientError&&_0x9f140f[_0x2e3088(0x9a)]===0x191?printAuthError(_0x9f140f,!![],_0x2a857d):console['error'](a7_0x2beedd[_0x2e3088(0xa3)](_0x2e3088(0xbb)+(_0x9f140f instanceof Error?_0x9f140f[_0x2e3088(0x79)]:String(_0x9f140f)))),0x1;}}}function a7_0x2507(){const _0x1ade1a=['filter','\x20(site:\x20','Setting\x20up\x20authentication\x20for\x20site:\x20','Enter\x20your\x20TD\x20API\x20key:','select','Read\x20credential\x20from\x20','Read\x20credential\x20from\x20keychain','Remove\x20API\x20key\x20from\x20system\x20keychain','\x20--profile\x20','status','\x20and\x20','auth:setup','4DtidFK','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','/app/mp/ak','Credential\x20type:\x20OAuth','tdx\x20profile:\x20','Validating\x20API\x20key...','red','email','create','tdx:\x20auth\x20clear','\x20\x20tdx','bold','method','join','execute','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','24664aGGFSA','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','API\x20key\x20cannot\x20be\x20empty','tdx:\x20auth\x20setup','trim','1030172DbsyCd','apiKey','last_name','warn','2924698anuwsb','4259145uebJXC','name','jobs','description','✗\x20Validation\x20failed:\x20','1197DXzZhG','ERROR','\x20(profile:\x20','logLevel','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','\x0aSetup\x20cancelled','error','System\x20keychain\x20is\x20not\x20available','111476lXDtSs','✓\x20Authentication\x20successful\x0a','first_name','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','982449DsyXrE','OAuth\x20tokens','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','message','Setup\x20cancelled','✓\x20Profile\x20\x27','1928448QpHwet','yellow','getUserInfo','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','OAuth\x20(browser\x20login)','\x27\x20registered','profile','all','oauth','password','N/A','auth:clear','API\x20key','No\x20credentials\x20found\x20in\x20keychain','User:\x20','Choose\x20authentication\x20method:','log','site','API\x20Key','us01','No\x20credential\x20found'];a7_0x2507=function(){return _0x1ade1a;};return a7_0x2507();}export class AuthClearCommand extends BaseCommand{['name']=a7_0x1a0ba9(0x87);[a7_0x1a0ba9(0xba)]=a7_0x1a0ba9(0x98);async[a7_0x1a0ba9(0xab)](_0x5e4bf6){const _0x444eaa=a7_0x1a0ba9,{options:_0x5c4079}=_0x5e4bf6,_0x40be30=_0x5c4079[_0x444eaa(0x82)];console[_0x444eaa(0x8c)](a7_0x2beedd[_0x444eaa(0xa8)](_0x444eaa(0xa6)));const _0x434c1d=await isKeychainAvailable();if(!_0x434c1d)return console[_0x444eaa(0xc2)](a7_0x2beedd[_0x444eaa(0xa3)](_0x444eaa(0xc3))),0x1;const [_0x15dade,_0x196fe2]=await Promise[_0x444eaa(0x83)]([deleteKeychainAPIKey(_0x40be30),deleteOAuthTokens(_0x40be30)]);if(_0x15dade||_0x196fe2){clearCredentialCache();const _0x4490e1=[_0x15dade&&_0x444eaa(0x88),_0x196fe2&&_0x444eaa(0x77)]['filter'](Boolean)['join'](_0x444eaa(0x9b));return console[_0x444eaa(0x8c)]('✓\x20'+_0x4490e1+'\x20removed\x20from\x20keychain'+(_0x40be30?_0x444eaa(0xbe)+_0x40be30+')':'')),0x0;}else return console[_0x444eaa(0x8c)](_0x444eaa(0x89)+(_0x40be30?'\x20for\x20profile:\x20'+_0x40be30:'')),0x1;}}
1
+ const a7_0x590b95=a7_0x4c92;(function(_0x22fb81,_0x37177f){const _0x2b6bed=a7_0x4c92,_0x2279c8=_0x22fb81();while(!![]){try{const _0x3966d7=parseInt(_0x2b6bed(0x16e))/0x1*(-parseInt(_0x2b6bed(0x175))/0x2)+-parseInt(_0x2b6bed(0x138))/0x3*(-parseInt(_0x2b6bed(0x16d))/0x4)+-parseInt(_0x2b6bed(0x15a))/0x5+-parseInt(_0x2b6bed(0x136))/0x6+-parseInt(_0x2b6bed(0x155))/0x7*(-parseInt(_0x2b6bed(0x164))/0x8)+-parseInt(_0x2b6bed(0x15e))/0x9*(parseInt(_0x2b6bed(0x17d))/0xa)+parseInt(_0x2b6bed(0x16c))/0xb;if(_0x3966d7===_0x37177f)break;else _0x2279c8['push'](_0x2279c8['shift']());}catch(_0x387f7f){_0x2279c8['push'](_0x2279c8['shift']());}}}(a7_0xad75,0x4c29f));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';function a7_0xad75(){const _0x3a6bd3=['⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','\x20and\x20','\x20--profile\x20','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','\x20removed\x20from\x20keychain','System\x20keychain\x20is\x20not\x20available','red','jobs','description','✓\x20Authentication\x20successful\x0a','green','API\x20Key','\x20for\x20profile:\x20','/app/mp/ak','Setup\x20cancelled','Remove\x20API\x20key\x20from\x20system\x20keychain','email','execute','\x27\x20registered','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','tdx:\x20auth\x20clear','tdx:\x20auth\x20setup','message','apiKey','7kOBoiy','getUserInfo','tdx\x20profile:\x20','method','Read\x20credential\x20from\x20','470705RLVOhr','Enter\x20your\x20TD\x20API\x20key:','logLevel','join','5370408YQqHKE','bold','first_name','auth:clear','Setup\x20API\x20key\x20authentication\x20interactively','API\x20key\x20cannot\x20be\x20empty','4295744cwAmKL','all','API\x20key','status','ERROR','No\x20credentials\x20found\x20in\x20keychain','auth:setup','filter','1511994zCapyb','2260924tXwztT','231911YOSttA','No\x20credential\x20found','\x20(site:\x20','Name:\x20','Choose\x20authentication\x20method:','OAuth\x20(browser\x20login)','OAuth\x20tokens','2rYPudg','last_name','\x0aSetup\x20cancelled','\x20(profile:\x20','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','error','apikey','create','10AGHSWd','site','warn','N/A','password','yellow','oauth','profile','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','\x20\x20tdx','✗\x20Validation\x20failed:\x20','trim','Credential\x20type:\x20OAuth','29532ucUaoa','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','3JkflKT','✓\x20Default\x20site\x20set\x20to\x20','auth','log','You\x20can\x20find\x20your\x20API\x20key\x20at:'];a7_0xad75=function(){return _0x3a6bd3;};return a7_0xad75();}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';function a7_0x4c92(_0x483920,_0x4d32ef){_0x483920=_0x483920-0x136;const _0xad757b=a7_0xad75();let _0x4c92c5=_0xad757b[_0x483920];return _0x4c92c5;}import{promptSiteSelection}from'../core/constants.js';import a7_0x237662 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_0x1c2f94 from'chalk';export class AuthSetupCommand extends BaseCommand{['name']=a7_0x590b95(0x16a);[a7_0x590b95(0x145)]=a7_0x590b95(0x162);async[a7_0x590b95(0x14e)](_0x4c9758){const _0xaed6d7=a7_0x590b95,{options:_0x379b68}=_0x4c9758,_0x1f637b=_0x379b68[_0xaed6d7(0x184)];console['log'](a7_0x1c2f94[_0xaed6d7(0x15f)](_0xaed6d7(0x152)));const _0x4a0a07=_0x379b68['site']||'us01',_0x344fd3=await promptSiteSelection(_0x4a0a07,_0x1f637b,_0xaed6d7(0x14b));if(!_0x344fd3)return 0x1;const _0x5a6c4d=resolveSite(_0x344fd3);if(isOAuthSupported(_0x5a6c4d)){const _0xf23930=await a7_0x237662({'type':'select','name':'method','message':_0xaed6d7(0x172),'choices':[{'title':_0xaed6d7(0x173),'value':_0xaed6d7(0x183)},{'title':_0xaed6d7(0x148),'value':_0xaed6d7(0x17b)}]});if(!_0xf23930['method'])return console[_0xaed6d7(0x13b)](_0xaed6d7(0x177)),0x1;if(_0xf23930[_0xaed6d7(0x158)]===_0xaed6d7(0x183))return await runOAuthLoginFlow(_0x5a6c4d,_0x1f637b,_0x379b68[_0xaed6d7(0x15c)]??LogLevel[_0xaed6d7(0x168)]),0x0;}console[_0xaed6d7(0x13b)]('Setting\x20up\x20authentication\x20for\x20site:\x20'+_0x5a6c4d),console[_0xaed6d7(0x13b)](_0xaed6d7(0x13c)),console[_0xaed6d7(0x13b)]('\x20\x20'+getConsoleUrl(_0x5a6c4d,_0xaed6d7(0x14a)));const _0x53066f=await a7_0x237662({'type':_0xaed6d7(0x181),'name':_0xaed6d7(0x154),'message':_0xaed6d7(0x15b),'validate':_0x514399=>{const _0x35ebf9=_0xaed6d7;if(!_0x514399||!_0x514399[_0x35ebf9(0x188)]())return _0x35ebf9(0x163);return!![];}});if(!_0x53066f[_0xaed6d7(0x154)])return console[_0xaed6d7(0x13b)](_0xaed6d7(0x177)),0x1;const _0x67cad3=_0x53066f[_0xaed6d7(0x154)];console[_0xaed6d7(0x13b)]('Validating\x20API\x20key...');try{const _0x42275e=TDX[_0xaed6d7(0x17c)]({'site':_0x5a6c4d,'apiKey':_0x67cad3[_0xaed6d7(0x188)](),'logLevel':_0x379b68[_0xaed6d7(0x15c)]??LogLevel[_0xaed6d7(0x168)]}),_0x29d39c=await _0x42275e[_0xaed6d7(0x144)][_0xaed6d7(0x156)]();console[_0xaed6d7(0x13b)](_0xaed6d7(0x137)+_0x29d39c[_0xaed6d7(0x14d)]+')');const _0x5daab8=await isKeychainAvailable();_0x5daab8?(await saveAPIKeyAsync(_0x67cad3[_0xaed6d7(0x188)](),_0x5a6c4d,_0x1f637b),console[_0xaed6d7(0x13b)]('✓\x20API\x20key\x20saved\x20to\x20system\x20keychain'+(_0x1f637b?'\x20(profile:\x20'+_0x1f637b+')':''))):(console[_0xaed6d7(0x17f)](a7_0x1c2f94['yellow'](_0xaed6d7(0x13d))),console[_0xaed6d7(0x17f)](a7_0x1c2f94[_0xaed6d7(0x182)](_0xaed6d7(0x185))));if(_0x1f637b){const _0x40f33c={'site':_0x5a6c4d};saveProfileToUserConfig(_0x1f637b,_0x40f33c),console[_0xaed6d7(0x13b)]('✓\x20Profile\x20\x27'+_0x1f637b+_0xaed6d7(0x14f));}else saveDefaultSiteToUserConfig(_0x5a6c4d),console[_0xaed6d7(0x13b)](_0xaed6d7(0x139)+_0x5a6c4d);const _0x1191a1=_0x1f637b?_0xaed6d7(0x13f)+_0x1f637b:'';return console[_0xaed6d7(0x13b)](),console[_0xaed6d7(0x13b)]('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console[_0xaed6d7(0x13b)](_0xaed6d7(0x186)+_0x1191a1+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console['log'](_0xaed6d7(0x186)+_0x1191a1+_0xaed6d7(0x140)),0x0;}catch(_0x38ccdc){if(_0x38ccdc instanceof HTTPClientError&&_0x38ccdc[_0xaed6d7(0x167)]===0x191)return printAuthError(_0x38ccdc),0x1;return console[_0xaed6d7(0x17a)](a7_0x1c2f94['red']('✗\x20Validation\x20failed:\x20'+(_0x38ccdc instanceof Error?_0x38ccdc[_0xaed6d7(0x153)]:String(_0x38ccdc)))),console[_0xaed6d7(0x17a)](_0xaed6d7(0x150)),0x1;}}}export class AuthStatusCommand extends BaseCommand{['name']=a7_0x590b95(0x13a);['description']=a7_0x590b95(0x179);async['execute'](_0x494286){const _0x59b21e=a7_0x590b95,{options:_0x7f57d,tdx:_0x3f151f}=_0x494286,_0x566722=_0x7f57d[_0x59b21e(0x17e)],_0x45fdad=_0x7f57d[_0x59b21e(0x184)],_0xc68b2d=_0x45fdad?_0x45fdad:_0x59b21e(0x180);console[_0x59b21e(0x13b)](_0x59b21e(0x157)+_0xc68b2d+_0x59b21e(0x170)+_0x566722+')');const _0x258774=await getOAuthTokens(_0x45fdad);if(_0x258774)console[_0x59b21e(0x13b)](_0x59b21e(0x189)),console['log']('Read\x20credential\x20from\x20keychain'+(_0x45fdad?_0x59b21e(0x178)+_0x45fdad+')':''));else{const _0x51dbb1=await resolveAPIKeyAsync(_0x566722,_0x45fdad);if(_0x51dbb1){const {source:_0x399133,isDeprecated:_0x10f6d7}=_0x51dbb1,_0x2d36a4=_0x59b21e(0x159)+_0x399133;console[_0x59b21e(0x13b)](_0x10f6d7?a7_0x1c2f94[_0x59b21e(0x182)](_0x2d36a4):_0x2d36a4);}else console[_0x59b21e(0x13b)](a7_0x1c2f94['yellow'](_0x59b21e(0x16f)));}try{const _0x4a9232=await _0x3f151f[_0x59b21e(0x144)][_0x59b21e(0x156)]();return console['log'](a7_0x1c2f94[_0x59b21e(0x147)](_0x59b21e(0x146))),console[_0x59b21e(0x13b)]('User:\x20'+_0x4a9232[_0x59b21e(0x14d)]),(_0x4a9232['first_name']||_0x4a9232['last_name'])&&console['log'](_0x59b21e(0x171)+[_0x4a9232[_0x59b21e(0x160)],_0x4a9232[_0x59b21e(0x176)]][_0x59b21e(0x16b)](Boolean)['join']('\x20')),0x0;}catch(_0x178bfa){return _0x178bfa instanceof HTTPClientError&&_0x178bfa['status']===0x191?printAuthError(_0x178bfa,!![],_0x45fdad):console[_0x59b21e(0x17a)](a7_0x1c2f94['red'](_0x59b21e(0x187)+(_0x178bfa instanceof Error?_0x178bfa[_0x59b21e(0x153)]:String(_0x178bfa)))),0x1;}}}export class AuthClearCommand extends BaseCommand{['name']=a7_0x590b95(0x161);[a7_0x590b95(0x145)]=a7_0x590b95(0x14c);async[a7_0x590b95(0x14e)](_0x117b19){const _0x3effd5=a7_0x590b95,{options:_0x125790}=_0x117b19,_0x41aa7e=_0x125790[_0x3effd5(0x184)];console[_0x3effd5(0x13b)](a7_0x1c2f94[_0x3effd5(0x15f)](_0x3effd5(0x151)));const _0x103911=await isKeychainAvailable();if(!_0x103911)return console[_0x3effd5(0x17a)](a7_0x1c2f94[_0x3effd5(0x143)](_0x3effd5(0x142))),0x1;const [_0x464075,_0x540080]=await Promise[_0x3effd5(0x165)]([deleteKeychainAPIKey(_0x41aa7e),deleteOAuthTokens(_0x41aa7e)]);if(_0x464075||_0x540080){clearCredentialCache();const _0x351809=[_0x464075&&_0x3effd5(0x166),_0x540080&&_0x3effd5(0x174)][_0x3effd5(0x16b)](Boolean)[_0x3effd5(0x15d)](_0x3effd5(0x13e));return console['log']('✓\x20'+_0x351809+_0x3effd5(0x141)+(_0x41aa7e?_0x3effd5(0x178)+_0x41aa7e+')':'')),0x0;}else return console[_0x3effd5(0x13b)](_0x3effd5(0x169)+(_0x41aa7e?_0x3effd5(0x149)+_0x41aa7e:'')),0x1;}}
@@ -1 +1 @@
1
- const a8_0x305239=a8_0x5501;(function(_0x546ada,_0x5f4c49){const _0x4f70ac=a8_0x5501,_0xa39651=_0x546ada();while(!![]){try{const _0x18e6d4=parseInt(_0x4f70ac(0x76))/0x1*(parseInt(_0x4f70ac(0x80))/0x2)+parseInt(_0x4f70ac(0x89))/0x3+-parseInt(_0x4f70ac(0x85))/0x4+-parseInt(_0x4f70ac(0x8c))/0x5+parseInt(_0x4f70ac(0x92))/0x6*(parseInt(_0x4f70ac(0x8d))/0x7)+-parseInt(_0x4f70ac(0x93))/0x8+parseInt(_0x4f70ac(0x91))/0x9*(parseInt(_0x4f70ac(0x96))/0xa);if(_0x18e6d4===_0x5f4c49)break;else _0xa39651['push'](_0xa39651['shift']());}catch(_0x474823){_0xa39651['push'](_0xa39651['shift']());}}}(a8_0x1148,0x624e9));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';function a8_0x1148(){const _0x1a69b9=['377355ecyRIn','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain','tdx:\x20auth\x20login','2216035CJfdGT','7RIQPcU','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','OAuth\x20is\x20currently\x20supported\x20on\x20dev-us01\x20and\x20dev-eu01\x20only.\x20','description','13094253fxIrEi','2028090fycnwx','5561216cKxJsA','\x20--profile\x20','profile','10tzsCDH','execute','site','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','Login\x20via\x20OAuth\x20(opens\x20browser)','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','✓\x20Authentication\x20successful\x20(User:\x20','log','22cAbtrK','\x20(profile:\x20','access_token','getUserInfo','Authenticating\x20via\x20OAuth\x20for\x20site:\x20','auth:login','green','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','us01','\x20\x20tdx','38838DggSOM','Opening\x20browser\x20for\x20authentication...','jobs','/oauth/authorize','✓\x20Profile\x20\x27','3219644FZaxce','logLevel','ERROR','Login\x20cancelled'];a8_0x1148=function(){return _0x1a69b9;};return a8_0x1148();}import{promptSiteSelection}from'../core/constants.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';function a8_0x5501(_0x51fbb9,_0x58f031){_0x51fbb9=_0x51fbb9-0x73;const _0x114869=a8_0x1148();let _0x550196=_0x114869[_0x51fbb9];return _0x550196;}import a8_0x458a20 from'chalk';export async function runOAuthLoginFlow(_0x24b455,_0xa4cd10,_0x2a0279){const _0x48b380=a8_0x5501;if(!isOAuthSupported(_0x24b455))throw new Error('OAuth\x20login\x20is\x20not\x20yet\x20available\x20for\x20site:\x20'+_0x24b455+'.\x20'+_0x48b380(0x8f)+_0x48b380(0x7d));const _0x30235d=await isKeychainAvailable();if(!_0x30235d)throw new Error(_0x48b380(0x8e)+'Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.');const _0x257da6=getConsoleUrl(_0x24b455);console['log'](_0x48b380(0x81)),console[_0x48b380(0x75)]('\x20\x20'+_0x257da6+_0x48b380(0x83)),console['log'](_0x48b380(0x99));const _0x2010f5=await startOAuthFlow(_0x24b455);console[_0x48b380(0x75)]('Validating\x20OAuth\x20tokens...');const _0x4798ac=TDX['create']({'site':_0x24b455,'accessToken':_0x2010f5[_0x48b380(0x78)],'logLevel':_0x2a0279??LogLevel[_0x48b380(0x87)]}),_0x3f546b=await _0x4798ac[_0x48b380(0x82)][_0x48b380(0x79)]();console['log'](a8_0x458a20[_0x48b380(0x7c)](_0x48b380(0x74)+_0x3f546b['email']+')')),await saveOAuthTokens(_0x2010f5,_0xa4cd10),console['log'](_0x48b380(0x8a)+(_0xa4cd10?_0x48b380(0x77)+_0xa4cd10+')':''));if(_0xa4cd10){const _0x37d879={'site':_0x24b455};saveProfileToUserConfig(_0xa4cd10,_0x37d879),console[_0x48b380(0x75)](_0x48b380(0x84)+_0xa4cd10+'\x27\x20registered');}const _0x5ee2b9=_0xa4cd10?_0x48b380(0x94)+_0xa4cd10:'';console[_0x48b380(0x75)](),console[_0x48b380(0x75)](_0x48b380(0x73)),console['log'](_0x48b380(0x7f)+_0x5ee2b9+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console[_0x48b380(0x75)](_0x48b380(0x7f)+_0x5ee2b9+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases');}export class AuthLoginCommand extends BaseCommand{['name']=a8_0x305239(0x7b);[a8_0x305239(0x90)]=a8_0x305239(0x9a);async[a8_0x305239(0x97)](_0x1ae9ee){const _0x5a02f1=a8_0x305239,{options:_0xd5179d}=_0x1ae9ee,_0xcece3b=_0xd5179d[_0x5a02f1(0x95)];console[_0x5a02f1(0x75)](a8_0x458a20['bold'](_0x5a02f1(0x8b)));const _0x2aa8f0=_0xd5179d[_0x5a02f1(0x98)]||_0x5a02f1(0x7e),_0x29a9ea=await promptSiteSelection(_0x2aa8f0,_0xcece3b,_0x5a02f1(0x88));if(!_0x29a9ea)return 0x1;const _0x4de02d=resolveSite(_0x29a9ea);return console['log'](_0x5a02f1(0x7a)+_0x4de02d),await runOAuthLoginFlow(_0x4de02d,_0xcece3b,_0xd5179d[_0x5a02f1(0x86)]??LogLevel[_0x5a02f1(0x87)]),0x0;}}
1
+ const a8_0x171d01=a8_0x4a02;(function(_0x14548e,_0x1d565e){const _0x4136fe=a8_0x4a02,_0x56ab44=_0x14548e();while(!![]){try{const _0x529eaa=-parseInt(_0x4136fe(0x1ae))/0x1+-parseInt(_0x4136fe(0x197))/0x2+-parseInt(_0x4136fe(0x1b0))/0x3+parseInt(_0x4136fe(0x1b5))/0x4+parseInt(_0x4136fe(0x1a9))/0x5+parseInt(_0x4136fe(0x1b7))/0x6*(parseInt(_0x4136fe(0x1af))/0x7)+-parseInt(_0x4136fe(0x1b8))/0x8*(-parseInt(_0x4136fe(0x1a2))/0x9);if(_0x529eaa===_0x1d565e)break;else _0x56ab44['push'](_0x56ab44['shift']());}catch(_0x330bd0){_0x56ab44['push'](_0x56ab44['shift']());}}}(a8_0x4078,0x2798f));import{BaseCommand}from'./command.js';function a8_0x4078(){const _0x27b0b3=['description','bold','tdx:\x20auth\x20login','Login\x20via\x20OAuth\x20(opens\x20browser)','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','99735sKlhpb','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','profile','Authenticating\x20via\x20OAuth\x20for\x20site:\x20','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','176651jXxRYt','2247GTkkNb','255573crmBJc','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain','Validating\x20OAuth\x20tokens...','jobs','✓\x20Authentication\x20successful\x20(User:\x20','171320FIRdvt','auth:login','3390gpEyRB','8FdRyZj','name','/oauth/authorize','\x20--profile\x20','getUserInfo','402576kejkpj','site','log','logLevel','ERROR','create','Opening\x20browser\x20for\x20authentication...','Login\x20cancelled','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','\x20\x20tdx','\x20(profile:\x20','3430611VibLNW'];a8_0x4078=function(){return _0x27b0b3;};return a8_0x4078();}import{resolveSite}from'../core/config.js';function a8_0x4a02(_0x2bb00e,_0x4117c3){_0x2bb00e=_0x2bb00e-0x193;const _0x407818=a8_0x4078();let _0x4a029b=_0x407818[_0x2bb00e];return _0x4a029b;}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_0x4e2338 from'chalk';export async function runOAuthLoginFlow(_0x2ecdae,_0x357628,_0x5d6beb){const _0x262167=a8_0x4a02;if(!isOAuthSupported(_0x2ecdae))throw new Error('OAuth\x20login\x20is\x20not\x20yet\x20available\x20for\x20site:\x20'+_0x2ecdae+'.\x20'+'OAuth\x20is\x20currently\x20supported\x20on\x20dev-us01\x20and\x20dev-eu01\x20only.\x20'+_0x262167(0x1a8));const _0x56ea40=await isKeychainAvailable();if(!_0x56ea40)throw new Error(_0x262167(0x1aa)+_0x262167(0x1a8));const _0x3e4ec=getConsoleUrl(_0x2ecdae);console[_0x262167(0x199)](_0x262167(0x19d)),console['log']('\x20\x20'+_0x3e4ec+_0x262167(0x194)),console[_0x262167(0x199)](_0x262167(0x1a7));const _0x4af92a=await startOAuthFlow(_0x2ecdae);console[_0x262167(0x199)](_0x262167(0x1b2));const _0x291b67=TDX[_0x262167(0x19c)]({'site':_0x2ecdae,'accessToken':_0x4af92a['access_token'],'logLevel':_0x5d6beb??LogLevel[_0x262167(0x19b)]}),_0x5907aa=await _0x291b67[_0x262167(0x1b3)][_0x262167(0x196)]();console[_0x262167(0x199)](a8_0x4e2338['green'](_0x262167(0x1b4)+_0x5907aa['email']+')')),await saveOAuthTokens(_0x4af92a,_0x357628),console['log'](_0x262167(0x1b1)+(_0x357628?_0x262167(0x1a1)+_0x357628+')':''));if(_0x357628){const _0x4e2ad0={'site':_0x2ecdae};saveProfileToUserConfig(_0x357628,_0x4e2ad0),console['log']('✓\x20Profile\x20\x27'+_0x357628+'\x27\x20registered');}const _0x522b2d=_0x357628?_0x262167(0x195)+_0x357628:'';console['log'](),console['log'](_0x262167(0x1ad)),console['log'](_0x262167(0x1a0)+_0x522b2d+_0x262167(0x19f)),console['log'](_0x262167(0x1a0)+_0x522b2d+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases');}export class AuthLoginCommand extends BaseCommand{[a8_0x171d01(0x193)]=a8_0x171d01(0x1b6);[a8_0x171d01(0x1a3)]=a8_0x171d01(0x1a6);async['execute'](_0x3e4572){const _0x2d13f0=a8_0x171d01,{options:_0x2a697d}=_0x3e4572,_0x38ab1b=_0x2a697d[_0x2d13f0(0x1ab)];console['log'](a8_0x4e2338[_0x2d13f0(0x1a4)](_0x2d13f0(0x1a5)));const _0x10d1d7=_0x2a697d[_0x2d13f0(0x198)]||'us01',_0x5bdbdc=await promptSiteSelection(_0x10d1d7,_0x38ab1b,_0x2d13f0(0x19e));if(!_0x5bdbdc)return 0x1;const _0xcb84bb=resolveSite(_0x5bdbdc);return console['log'](_0x2d13f0(0x1ac)+_0xcb84bb),await runOAuthLoginFlow(_0xcb84bb,_0x38ab1b,_0x2a697d[_0x2d13f0(0x19a)]??LogLevel[_0x2d13f0(0x19b)]),0x0;}}