@treasuredata/tdx 2026.4.13 → 2026.4.14

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 (220) 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/cas-command.js +1 -1
  11. package/dist/commands/cas-segment-command.js +1 -1
  12. package/dist/commands/chat-command.js +1 -1
  13. package/dist/commands/claude-command.js +1 -1
  14. package/dist/commands/claude-statusline-command.js +1 -1
  15. package/dist/commands/claude-usage-command.js +1 -1
  16. package/dist/commands/command.js +1 -1
  17. package/dist/commands/connection-command.js +1 -1
  18. package/dist/commands/databases.js +1 -1
  19. package/dist/commands/delivery-command.js +1 -1
  20. package/dist/commands/describe.js +1 -1
  21. package/dist/commands/engage-campaign-pull-command.js +1 -1
  22. package/dist/commands/engage-campaign-push-command.js +1 -1
  23. package/dist/commands/engage-campaign-validate-command.js +1 -1
  24. package/dist/commands/engage-command.js +1 -1
  25. package/dist/commands/engage-template-pull-command.js +1 -1
  26. package/dist/commands/engage-template-push-command.js +1 -1
  27. package/dist/commands/engage-template-validate-command.js +1 -1
  28. package/dist/commands/job-command.js +1 -1
  29. package/dist/commands/journey-command.js +1 -1
  30. package/dist/commands/journey-validate-command.js +1 -1
  31. package/dist/commands/llm-command.js +1 -1
  32. package/dist/commands/mcp-command.js +1 -1
  33. package/dist/commands/parent-segment-command.js +1 -1
  34. package/dist/commands/policy-command.js +1 -1
  35. package/dist/commands/profile-command.js +1 -1
  36. package/dist/commands/profiles-command.js +1 -1
  37. package/dist/commands/query-command.js +1 -1
  38. package/dist/commands/schedule-command.js +1 -1
  39. package/dist/commands/segment-command.js +1 -1
  40. package/dist/commands/segment-create-command.js +1 -1
  41. package/dist/commands/segment-fields-command.js +1 -1
  42. package/dist/commands/segment-pull-command.js +1 -1
  43. package/dist/commands/segment-push-command.js +1 -1
  44. package/dist/commands/segment-update-command.js +1 -1
  45. package/dist/commands/segment-use-command.js +1 -1
  46. package/dist/commands/segment-validate-command.js +1 -1
  47. package/dist/commands/segments.js +1 -1
  48. package/dist/commands/show.js +1 -1
  49. package/dist/commands/status-command.js +1 -1
  50. package/dist/commands/tables.js +1 -1
  51. package/dist/commands/unset-command.js +1 -1
  52. package/dist/commands/upgrade-command.js +1 -1
  53. package/dist/commands/use-command.js +1 -1
  54. package/dist/commands/user-command.js +1 -1
  55. package/dist/commands/work-command.js +1 -1
  56. package/dist/commands/workflow-command.js +1 -1
  57. package/dist/core/auth.js +1 -1
  58. package/dist/core/command-output.js +1 -1
  59. package/dist/core/config.js +1 -1
  60. package/dist/core/connection-cache.js +1 -1
  61. package/dist/core/constants.js +1 -1
  62. package/dist/core/credential-cache.js +1 -1
  63. package/dist/core/global-context.js +1 -1
  64. package/dist/core/keychain.js +1 -1
  65. package/dist/core/oauth-keychain.js +1 -1
  66. package/dist/core/oauth.js +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/tools/work-create-item.js +1 -1
  78. package/dist/mcp/utils.js +1 -1
  79. package/dist/proxy/claude-usage-tracker.js +1 -1
  80. package/dist/proxy/passthrough-server.js +1 -1
  81. package/dist/proxy/sse-usage-parser.js +1 -1
  82. package/dist/sdk/agent/agent-config.js +1 -1
  83. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  84. package/dist/sdk/agent/agent-yaml.js +1 -1
  85. package/dist/sdk/agent/test/evaluator.js +1 -1
  86. package/dist/sdk/agent/test/executor.js +1 -1
  87. package/dist/sdk/agent/test/index.js +1 -1
  88. package/dist/sdk/agent/test/output.js +1 -1
  89. package/dist/sdk/agent/test/parser.js +1 -1
  90. package/dist/sdk/agent/tool-target-registry.js +1 -1
  91. package/dist/sdk/api.js +1 -1
  92. package/dist/sdk/cas/cas-api-client.js +1 -1
  93. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  94. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  95. package/dist/sdk/cas/index.js +1 -1
  96. package/dist/sdk/cas/pull-workflow.js +1 -1
  97. package/dist/sdk/cas/push-workflow.js +1 -1
  98. package/dist/sdk/client/cdp-api-client.js +1 -1
  99. package/dist/sdk/client/delivery-api-client.js +1 -1
  100. package/dist/sdk/client/endpoints.js +1 -1
  101. package/dist/sdk/client/engage-api-client.js +1 -1
  102. package/dist/sdk/client/http-client.js +1 -1
  103. package/dist/sdk/client/llm-api-client.js +1 -1
  104. package/dist/sdk/client/oauth-refresh.js +1 -1
  105. package/dist/sdk/client/rate-limiter.js +1 -1
  106. package/dist/sdk/client/td-api-client.js +1 -1
  107. package/dist/sdk/client/trino-api-client.js +1 -1
  108. package/dist/sdk/client/workflow-client.js +1 -1
  109. package/dist/sdk/connection-validator.js +1 -1
  110. package/dist/sdk/connection.js +1 -1
  111. package/dist/sdk/delivery.js +1 -1
  112. package/dist/sdk/engage/campaign-pull.js +1 -1
  113. package/dist/sdk/engage/campaign-push.js +1 -1
  114. package/dist/sdk/engage/campaign-validator.js +1 -1
  115. package/dist/sdk/engage/campaign-yaml.js +1 -1
  116. package/dist/sdk/engage/template-pull.js +1 -1
  117. package/dist/sdk/engage/template-push.js +1 -1
  118. package/dist/sdk/engage/template-validator.js +1 -1
  119. package/dist/sdk/engage/template-yaml.js +1 -1
  120. package/dist/sdk/engage/types/campaign-def.js +1 -1
  121. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  122. package/dist/sdk/engage/types/template-schema.js +1 -1
  123. package/dist/sdk/engage.js +1 -1
  124. package/dist/sdk/errors.js +1 -1
  125. package/dist/sdk/index.js +1 -1
  126. package/dist/sdk/io/index.js +1 -1
  127. package/dist/sdk/io/node-filesystem.js +1 -1
  128. package/dist/sdk/job.js +1 -1
  129. package/dist/sdk/journey.js +1 -1
  130. package/dist/sdk/llm/chat-cache.js +1 -1
  131. package/dist/sdk/llm/index.js +1 -1
  132. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  133. package/dist/sdk/llm/model-factors.js +1 -1
  134. package/dist/sdk/personalization.js +1 -1
  135. package/dist/sdk/policy.js +1 -1
  136. package/dist/sdk/query/index.js +1 -1
  137. package/dist/sdk/query/sql-parser.js +1 -1
  138. package/dist/sdk/realtime.js +1 -1
  139. package/dist/sdk/schedule.js +1 -1
  140. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  141. package/dist/sdk/segment/fields-display.js +1 -1
  142. package/dist/sdk/segment/file-discovery.js +1 -1
  143. package/dist/sdk/segment/journey-utils.js +1 -1
  144. package/dist/sdk/segment/journey-validator.js +1 -1
  145. package/dist/sdk/segment/journey-yaml.js +1 -1
  146. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  147. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  148. package/dist/sdk/segment/pull-workflow.js +1 -1
  149. package/dist/sdk/segment/push-recovery.js +1 -1
  150. package/dist/sdk/segment/push-workflow.js +1 -1
  151. package/dist/sdk/segment/resolution-context.js +1 -1
  152. package/dist/sdk/segment/segment-path-parser.js +1 -1
  153. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  154. package/dist/sdk/segment/segment-validator.js +1 -1
  155. package/dist/sdk/segment/target-resolution.js +1 -1
  156. package/dist/sdk/segment/tdx-config.js +1 -1
  157. package/dist/sdk/segment/types/activation-schema.js +1 -1
  158. package/dist/sdk/segment/types/journey-def.js +1 -1
  159. package/dist/sdk/segment/types/journey-schema.js +1 -1
  160. package/dist/sdk/segment/types/segment-def.js +1 -1
  161. package/dist/sdk/segment/types/segment-schema.js +1 -1
  162. package/dist/sdk/segment/validate-files.js +1 -1
  163. package/dist/sdk/segment/yaml-validator.js +1 -1
  164. package/dist/sdk/segment.js +1 -1
  165. package/dist/sdk/types/index.js +1 -1
  166. package/dist/sdk/types/progress.js +1 -1
  167. package/dist/sdk/types/workspace.js +1 -1
  168. package/dist/sdk/user.js +1 -1
  169. package/dist/sdk/util/format-detector.js +1 -1
  170. package/dist/sdk/util/formatters.js +1 -1
  171. package/dist/sdk/util/index.js +1 -1
  172. package/dist/sdk/util/paginate.js +1 -1
  173. package/dist/sdk/util/tree-formatter.js +1 -1
  174. package/dist/sdk/workflow/archive-validation.js +1 -1
  175. package/dist/sdk/workflow/clone-workflow.js +1 -1
  176. package/dist/sdk/workflow/index.js +1 -1
  177. package/dist/sdk/workflow/pull-workflow.js +1 -1
  178. package/dist/sdk/workflow/push-workflow.js +1 -1
  179. package/dist/sdk/workflow/tdx-config.js +1 -1
  180. package/dist/sdk/workflow/workflow-utils.js +1 -1
  181. package/dist/sdk/workspace/access-tracker.js +1 -1
  182. package/dist/sdk/workspace/frontmatter.js +1 -1
  183. package/dist/sdk/workspace/git.js +1 -1
  184. package/dist/sdk/workspace/index.js +1 -1
  185. package/dist/sdk/workspace/templates.js +1 -1
  186. package/dist/sdk/workspace/weekly.js +1 -1
  187. package/dist/sdk/workspace/wikilinks.js +1 -1
  188. package/dist/test-utils/command-runner.js +1 -1
  189. package/dist/test-utils/factories.js +1 -1
  190. package/dist/test-utils/fixtures.js +1 -1
  191. package/dist/test-utils/http-mock.js +1 -1
  192. package/dist/test-utils/index.js +1 -1
  193. package/dist/utils/async.js +1 -1
  194. package/dist/utils/colors.js +1 -1
  195. package/dist/utils/diff.js +1 -1
  196. package/dist/utils/file-permissions.js +1 -1
  197. package/dist/utils/file-reader.js +1 -1
  198. package/dist/utils/github-releases.js +1 -1
  199. package/dist/utils/global-cache.js +1 -1
  200. package/dist/utils/json-loader.js +1 -1
  201. package/dist/utils/local-cache.js +1 -1
  202. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  203. package/dist/utils/logger/formatters/index.js +1 -1
  204. package/dist/utils/logger/handlers/console-handler.js +1 -1
  205. package/dist/utils/logger/handlers/file-handler.js +1 -1
  206. package/dist/utils/logger/handlers/index.js +1 -1
  207. package/dist/utils/logger/handlers/null-handler.js +1 -1
  208. package/dist/utils/logger/index.js +1 -1
  209. package/dist/utils/logger/logger.js +1 -1
  210. package/dist/utils/logger/types.js +1 -1
  211. package/dist/utils/option-validation.js +1 -1
  212. package/dist/utils/process.js +1 -1
  213. package/dist/utils/prompt.js +1 -1
  214. package/dist/utils/spinner.js +1 -1
  215. package/dist/utils/sse-parser.js +1 -1
  216. package/dist/utils/string-utils.js +1 -1
  217. package/dist/utils/table-ref-parser.js +1 -1
  218. package/dist/utils/tdx-logger.js +1 -1
  219. package/dist/utils/version-check.js +1 -1
  220. package/package.json +1 -1
@@ -1 +1 @@
1
- const a3_0x3d93c1=a3_0x40ee;function a3_0x41c6(){const _0x1c1a69=['List\x20activations\x20for\x20a\x20segment','execute','name','Resolving\x20child\x20segment\x20\x27','10gkqOIa','error','verbose','\x20\x20Cause:\x20','description','Resolved\x20parent\x20ID:\x20','site','segment','cause','1376bMlyFC','Resolved\x20child\x20ID:\x20','message','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','102TOLSUe','resolveSegmentId','Resolving\x20parent\x20segment\x20\x27','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','1226514lVeRdg','data','activations','Parent\x20name:\x20','1043702otytCs','12663NqAoIQ','42DjRVmz','139724EzuyHJ','length','3966193rnjUCL','resolveParentId','Error:\x20Segment\x20name\x20is\x20required','Listing\x20activations\x20for\x20segment\x20\x27','listActivations','88500TXLBZz','4916250uYSYby'];a3_0x41c6=function(){return _0x1c1a69;};return a3_0x41c6();}(function(_0xc5e1d6,_0x168875){const _0x180aa4=a3_0x40ee,_0x3e1728=_0xc5e1d6();while(!![]){try{const _0x28d8d5=parseInt(_0x180aa4(0x1b2))/0x1+-parseInt(_0x180aa4(0x1bc))/0x2+parseInt(_0x180aa4(0x1aa))/0x3*(-parseInt(_0x180aa4(0x1b5))/0x4)+-parseInt(_0x180aa4(0x1bd))/0x5+parseInt(_0x180aa4(0x1ae))/0x6*(parseInt(_0x180aa4(0x1b4))/0x7)+-parseInt(_0x180aa4(0x1a6))/0x8*(-parseInt(_0x180aa4(0x1b3))/0x9)+-parseInt(_0x180aa4(0x1c2))/0xa*(-parseInt(_0x180aa4(0x1b7))/0xb);if(_0x28d8d5===_0x168875)break;else _0x3e1728['push'](_0x3e1728['shift']());}catch(_0x4ad2b4){_0x3e1728['push'](_0x3e1728['shift']());}}}(a3_0x41c6,0xa08dd));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a3_0x40ee(_0x59d50f,_0x508e9d){_0x59d50f=_0x59d50f-0x19e;const _0x41c6c8=a3_0x41c6();let _0x40ee19=_0x41c6c8[_0x59d50f];return _0x40ee19;}import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';export class ActivationsCommand extends BaseCommand{[a3_0x3d93c1(0x1c0)]=a3_0x3d93c1(0x1b0);[a3_0x3d93c1(0x1a1)]=a3_0x3d93c1(0x1be);async[a3_0x3d93c1(0x1bf)](_0x3b5164){const _0x451933=a3_0x3d93c1,{options:_0x59b447,args:_0x5282de,tdx:_0x14a49c}=_0x3b5164;if(_0x5282de[_0x451933(0x1b6)]===0x0)return console[_0x451933(0x19e)](_0x451933(0x1b9)),console[_0x451933(0x19e)](_0x451933(0x1ad)),0x1;try{const {parentId:_0xa59332,childId:_0x288f93}=parseSegmentRef(_0x5282de[0x0]);if(!_0x288f93)return console[_0x451933(0x19e)](_0x451933(0x1a9)),console['error'](_0x451933(0x1ad)),0x1;_0x59b447[_0x451933(0x19f)]&&(console[_0x451933(0x19e)]('Site:\x20'+_0x59b447[_0x451933(0x1a3)]),console[_0x451933(0x19e)](_0x451933(0x1b1)+_0xa59332),console[_0x451933(0x19e)]('Child\x20name:\x20'+_0x288f93));const _0x5ee323=await withSpinner(_0x451933(0x1ac)+_0xa59332+'\x27...',()=>_0x14a49c[_0x451933(0x1a4)][_0x451933(0x1b8)](_0xa59332),{'verbose':_0x59b447[_0x451933(0x19f)]}),_0x5443d9=_0x5ee323[_0x451933(0x1af)];_0x59b447[_0x451933(0x19f)]&&console[_0x451933(0x19e)](_0x451933(0x1a2)+_0x5443d9);const _0x2f7095=await withSpinner(_0x451933(0x1c1)+_0x288f93+'\x27...',()=>_0x14a49c['segment'][_0x451933(0x1ab)](_0x5443d9,_0x288f93),{'verbose':_0x59b447[_0x451933(0x19f)]}),_0x5a3659=_0x2f7095[_0x451933(0x1af)];_0x59b447[_0x451933(0x19f)]&&console['error'](_0x451933(0x1a7)+_0x5a3659);const _0x14a417=await withSpinner(_0x451933(0x1ba)+_0x288f93+'\x27...',()=>_0x14a49c[_0x451933(0x1a4)][_0x451933(0x1bb)](_0x5443d9,_0x5a3659),{'verbose':_0x59b447[_0x451933(0x19f)]}),_0x5a27d9=_0x14a417[_0x451933(0x1af)];return console[_0x451933(0x19e)]('✔\x20Found\x20'+_0x5a27d9['length']+'\x20activation'+(_0x5a27d9[_0x451933(0x1b6)]!==0x1?'s':'')),await handleSDKOutput(_0x5a27d9,_0x59b447),0x0;}catch(_0x40f5d0){if(_0x40f5d0 instanceof SDKError)return console[_0x451933(0x19e)]('Error:\x20'+_0x40f5d0[_0x451933(0x1a8)]),_0x40f5d0[_0x451933(0x1a5)]&&console[_0x451933(0x19e)](_0x451933(0x1a0)+_0x40f5d0[_0x451933(0x1a5)]),0x1;throw _0x40f5d0;}}}
1
+ const a3_0xf83002=a3_0x4ea4;function a3_0x4ea4(_0x4a3724,_0x12712c){_0x4a3724=_0x4a3724-0x71;const _0x2a8939=a3_0x2a89();let _0x4ea4e5=_0x2a8939[_0x4a3724];return _0x4ea4e5;}(function(_0x395a22,_0xbade96){const _0x49efed=a3_0x4ea4,_0x4191c7=_0x395a22();while(!![]){try{const _0x30fed5=-parseInt(_0x49efed(0x8d))/0x1*(-parseInt(_0x49efed(0x78))/0x2)+parseInt(_0x49efed(0x8f))/0x3+parseInt(_0x49efed(0x7b))/0x4+parseInt(_0x49efed(0x7d))/0x5+-parseInt(_0x49efed(0x83))/0x6*(-parseInt(_0x49efed(0x8c))/0x7)+-parseInt(_0x49efed(0x8b))/0x8+parseInt(_0x49efed(0x86))/0x9*(-parseInt(_0x49efed(0x92))/0xa);if(_0x30fed5===_0xbade96)break;else _0x4191c7['push'](_0x4191c7['shift']());}catch(_0x445b6f){_0x4191c7['push'](_0x4191c7['shift']());}}}(a3_0x2a89,0x3960f));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a3_0x2a89(){const _0x5a6907=['1784664sABMJC','cause','2206805RgyuNm','resolveParentId','listActivations','List\x20activations\x20for\x20a\x20segment','error','✔\x20Found\x20','102tZuuNG','Site:\x20','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','7617906IPYCVf','Error:\x20Segment\x20name\x20is\x20required','message','segment','Resolving\x20parent\x20segment\x20\x27','662048DOpVsL','131817hHvKXJ','36583tQByNP','Resolved\x20child\x20ID:\x20','1201740SURPtJ','verbose','description','20bchHai','\x20activation','Resolving\x20child\x20segment\x20\x27','Error:\x20','data','Parent\x20name:\x20','Resolved\x20parent\x20ID:\x20','\x27...','length','site','22gdFZIU','Child\x20name:\x20','activations'];a3_0x2a89=function(){return _0x5a6907;};return a3_0x2a89();}import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';export class ActivationsCommand extends BaseCommand{['name']=a3_0xf83002(0x7a);[a3_0xf83002(0x91)]=a3_0xf83002(0x80);async['execute'](_0x471df4){const _0x33c9f1=a3_0xf83002,{options:_0x186679,args:_0x2cfdc2,tdx:_0xbf1ccd}=_0x471df4;if(_0x2cfdc2[_0x33c9f1(0x76)]===0x0)return console[_0x33c9f1(0x81)](_0x33c9f1(0x87)),console[_0x33c9f1(0x81)]('Usage:\x20tdx\x20activations\x20<parent_name/child_name>'),0x1;try{const {parentId:_0x3a90f3,childId:_0x41ae87}=parseSegmentRef(_0x2cfdc2[0x0]);if(!_0x41ae87)return console[_0x33c9f1(0x81)]('Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations'),console[_0x33c9f1(0x81)](_0x33c9f1(0x85)),0x1;_0x186679[_0x33c9f1(0x90)]&&(console[_0x33c9f1(0x81)](_0x33c9f1(0x84)+_0x186679[_0x33c9f1(0x77)]),console['error'](_0x33c9f1(0x73)+_0x3a90f3),console[_0x33c9f1(0x81)](_0x33c9f1(0x79)+_0x41ae87));const _0x46b63c=await withSpinner(_0x33c9f1(0x8a)+_0x3a90f3+_0x33c9f1(0x75),()=>_0xbf1ccd[_0x33c9f1(0x89)][_0x33c9f1(0x7e)](_0x3a90f3),{'verbose':_0x186679[_0x33c9f1(0x90)]}),_0x10fb24=_0x46b63c[_0x33c9f1(0x72)];_0x186679[_0x33c9f1(0x90)]&&console[_0x33c9f1(0x81)](_0x33c9f1(0x74)+_0x10fb24);const _0x2de8da=await withSpinner(_0x33c9f1(0x94)+_0x41ae87+_0x33c9f1(0x75),()=>_0xbf1ccd[_0x33c9f1(0x89)]['resolveSegmentId'](_0x10fb24,_0x41ae87),{'verbose':_0x186679[_0x33c9f1(0x90)]}),_0x3f86af=_0x2de8da[_0x33c9f1(0x72)];_0x186679[_0x33c9f1(0x90)]&&console[_0x33c9f1(0x81)](_0x33c9f1(0x8e)+_0x3f86af);const _0x3978bf=await withSpinner('Listing\x20activations\x20for\x20segment\x20\x27'+_0x41ae87+_0x33c9f1(0x75),()=>_0xbf1ccd[_0x33c9f1(0x89)][_0x33c9f1(0x7f)](_0x10fb24,_0x3f86af),{'verbose':_0x186679['verbose']}),_0x150399=_0x3978bf[_0x33c9f1(0x72)];return console[_0x33c9f1(0x81)](_0x33c9f1(0x82)+_0x150399['length']+_0x33c9f1(0x93)+(_0x150399['length']!==0x1?'s':'')),await handleSDKOutput(_0x150399,_0x186679),0x0;}catch(_0x20d3be){if(_0x20d3be instanceof SDKError)return console[_0x33c9f1(0x81)](_0x33c9f1(0x71)+_0x20d3be[_0x33c9f1(0x88)]),_0x20d3be[_0x33c9f1(0x7c)]&&console[_0x33c9f1(0x81)]('\x20\x20Cause:\x20'+_0x20d3be[_0x33c9f1(0x7c)]),0x1;throw _0x20d3be;}}}
@@ -1 +1 @@
1
- function a4_0x3376(_0x25cf17,_0x413f7b){_0x25cf17=_0x25cf17-0x1b3;const _0x30a112=a4_0x30a1();let _0x3376b7=_0x30a112[_0x25cf17];return _0x3376b7;}const a4_0xc37a6a=a4_0x3376;(function(_0x25ea34,_0x1f089c){const _0x369d13=a4_0x3376,_0x20b9e3=_0x25ea34();while(!![]){try{const _0x504101=-parseInt(_0x369d13(0x233))/0x1+parseInt(_0x369d13(0x229))/0x2*(-parseInt(_0x369d13(0x25a))/0x3)+parseInt(_0x369d13(0x212))/0x4*(-parseInt(_0x369d13(0x260))/0x5)+-parseInt(_0x369d13(0x256))/0x6*(parseInt(_0x369d13(0x232))/0x7)+parseInt(_0x369d13(0x1ef))/0x8+parseInt(_0x369d13(0x1bd))/0x9*(parseInt(_0x369d13(0x1c5))/0xa)+parseInt(_0x369d13(0x1e0))/0xb;if(_0x504101===_0x1f089c)break;else _0x20b9e3['push'](_0x20b9e3['shift']());}catch(_0x280945){_0x20b9e3['push'](_0x20b9e3['shift']());}}}(a4_0x30a1,0xbcf02));import a4_0x1140fa from'chalk';import a4_0x3f8ec3 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(_0x25986a){const _0x1ce2ba=a4_0x3376,_0x256660=[];if(_0x25986a[_0x1ce2ba(0x22e)]!==undefined)_0x256660[_0x1ce2ba(0x20c)](_0x25986a[_0x1ce2ba(0x22e)]+'\x20total');if(_0x25986a['new']!==undefined&&_0x25986a[_0x1ce2ba(0x1d4)]>0x0)_0x256660[_0x1ce2ba(0x20c)](a4_0x1140fa[_0x1ce2ba(0x24e)](_0x25986a[_0x1ce2ba(0x1d4)]+_0x1ce2ba(0x21f)));if(_0x25986a[_0x1ce2ba(0x1ff)]!==undefined&&_0x25986a[_0x1ce2ba(0x1ff)]>0x0)_0x256660[_0x1ce2ba(0x20c)](a4_0x1140fa['green'](_0x25986a[_0x1ce2ba(0x1ff)]+_0x1ce2ba(0x1d0)));if(_0x25986a['updated']!==undefined&&_0x25986a[_0x1ce2ba(0x227)]>0x0)_0x256660[_0x1ce2ba(0x20c)](a4_0x1140fa[_0x1ce2ba(0x1ea)](_0x25986a['updated']+_0x1ce2ba(0x254)));if(_0x25986a[_0x1ce2ba(0x226)]!==undefined&&_0x25986a[_0x1ce2ba(0x226)]>0x0)_0x256660[_0x1ce2ba(0x20c)](a4_0x1140fa[_0x1ce2ba(0x1b4)](_0x25986a[_0x1ce2ba(0x226)]+_0x1ce2ba(0x1c6)));if(_0x25986a[_0x1ce2ba(0x1e1)]!==undefined&&_0x25986a[_0x1ce2ba(0x1e1)]>0x0)_0x256660['push'](a4_0x1140fa['red'](_0x25986a[_0x1ce2ba(0x1e1)]+_0x1ce2ba(0x210)));return _0x256660[_0x1ce2ba(0x202)](',\x20');}function displayDiffs(_0x5b2868,_0x49c085,_0x50d6b5,_0x2c272d,_0xa9b500,_0x22d3d2,_0x3aac49,_0x22d466,_0x48add5){const _0x30992a=a4_0x3376;for(const _0x38636b of _0x5b2868){if(_0x38636b['diff']){const _0x17d673=_0x38636b[_0x30992a(0x20d)]||_0x38636b[_0x30992a(0x1c1)];console[_0x30992a(0x258)]('\x0aChanges\x20to\x20agent\x20\x27'+_0x17d673+'\x27:'),console[_0x30992a(0x258)]('─'[_0x30992a(0x1c2)](0x3c)),console['log'](_0x38636b[_0x30992a(0x1e9)]),console[_0x30992a(0x258)]('─'[_0x30992a(0x1c2)](0x3c));}}for(const _0x26bb15 of _0x49c085){_0x26bb15[_0x30992a(0x1e9)]&&(console['log'](_0x30992a(0x1b8)+_0x26bb15[_0x30992a(0x1c1)]+'\x27:'),console['log']('─'['repeat'](0x3c)),console['log'](_0x26bb15[_0x30992a(0x1e9)]),console[_0x30992a(0x258)]('─'[_0x30992a(0x1c2)](0x3c)));}for(const _0x2ec620 of _0x50d6b5){_0x2ec620['diff']&&(console[_0x30992a(0x258)](_0x30992a(0x1da)+_0x2ec620[_0x30992a(0x1c1)]+'\x27:'),console[_0x30992a(0x258)]('─'[_0x30992a(0x1c2)](0x3c)),console[_0x30992a(0x258)](_0x2ec620[_0x30992a(0x1e9)]),console[_0x30992a(0x258)]('─'[_0x30992a(0x1c2)](0x3c)));}for(const _0x1bd359 of _0x2c272d){_0x1bd359[_0x30992a(0x1e9)]&&(console[_0x30992a(0x258)]('\x0aChanges\x20to\x20prompt\x20\x27'+_0x1bd359[_0x30992a(0x1c1)]+'\x27:'),console[_0x30992a(0x258)]('─'[_0x30992a(0x1c2)](0x3c)),console[_0x30992a(0x258)](_0x1bd359[_0x30992a(0x1e9)]),console[_0x30992a(0x258)]('─'[_0x30992a(0x1c2)](0x3c)));}for(const _0x49560b of _0xa9b500){_0x49560b[_0x30992a(0x1e9)]&&(console[_0x30992a(0x258)]('\x0aChanges\x20to\x20integration\x20\x27'+_0x49560b['name']+'\x27:'),console['log']('─'[_0x30992a(0x1c2)](0x3c)),console[_0x30992a(0x258)](_0x49560b[_0x30992a(0x1e9)]),console[_0x30992a(0x258)]('─'[_0x30992a(0x1c2)](0x3c)));}for(const _0x47f8ca of _0x22d3d2){_0x47f8ca[_0x30992a(0x1e9)]&&(console[_0x30992a(0x258)]('\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27'+_0x47f8ca['name']+'\x27:'),console['log']('─'[_0x30992a(0x1c2)](0x3c)),console[_0x30992a(0x258)](_0x47f8ca[_0x30992a(0x1e9)]),console[_0x30992a(0x258)]('─'[_0x30992a(0x1c2)](0x3c)));}for(const _0x1f5270 of _0x3aac49){_0x1f5270[_0x30992a(0x1e9)]&&(console[_0x30992a(0x258)](_0x30992a(0x1fa)+_0x1f5270[_0x30992a(0x1c1)]+'\x27:'),console[_0x30992a(0x258)]('─'['repeat'](0x3c)),console['log'](_0x1f5270['diff']),console[_0x30992a(0x258)]('─'[_0x30992a(0x1c2)](0x3c)));}for(const _0x56a7ca of _0x22d466){_0x56a7ca[_0x30992a(0x1e9)]&&(console[_0x30992a(0x258)]('\x0aChanges\x20to\x20form\x20interface\x20\x27'+_0x56a7ca[_0x30992a(0x1c1)]+'\x27:'),console[_0x30992a(0x258)]('─'['repeat'](0x3c)),console[_0x30992a(0x258)](_0x56a7ca[_0x30992a(0x1e9)]),console[_0x30992a(0x258)]('─'[_0x30992a(0x1c2)](0x3c)));}for(const _0x3efb79 of _0x48add5){_0x3efb79[_0x30992a(0x1e9)]&&(console['log'](_0x30992a(0x1f6)+_0x3efb79[_0x30992a(0x1c1)]+'\x27:'),console[_0x30992a(0x258)]('─'[_0x30992a(0x1c2)](0x3c)),console[_0x30992a(0x258)](_0x3efb79[_0x30992a(0x1e9)]),console[_0x30992a(0x258)]('─'[_0x30992a(0x1c2)](0x3c)));}}export class AgentPullCommand extends BaseCommand{['name']=a4_0xc37a6a(0x240);[a4_0xc37a6a(0x1b7)]=a4_0xc37a6a(0x1c8);async['execute'](_0x289fa0){const _0x3b021b=a4_0xc37a6a,{options:_0x15840a,args:_0x17c6f4,tdx:_0x1e43c7}=_0x289fa0,_0x1f3f54=_0x17c6f4[0x0],_0x315801=_0x17c6f4[0x1],_0x43257d=_0x15840a[_0x3b021b(0x1c0)],_0x3bcfc9=_0x15840a['dryRun'],_0x53f2d8=_0x15840a[_0x3b021b(0x252)],_0x26f686=_0x15840a[_0x3b021b(0x20f)],_0x397cb8=_0x15840a[_0x3b021b(0x1d6)],_0x4e6b43=_0x15840a['agent'];let _0x3b3ddc;if(_0x1f3f54){const _0x3a9788=a4_0x3f8ec3[_0x3b021b(0x202)](_0x1f3f54,_0x3b021b(0x1ce));if(existsSync(_0x3a9788))try{const _0x1c1b97=JSON[_0x3b021b(0x24a)](readFileSync(_0x3a9788,'utf-8'));_0x1c1b97[_0x3b021b(0x238)]&&(_0x3b3ddc={'llm_project':_0x1c1b97[_0x3b021b(0x238)]});}catch{}}const _0x5606ae=findAgentConfigPath(process[_0x3b021b(0x20e)]());let _0x302124;if(_0x5606ae)try{const _0x84ec20=JSON[_0x3b021b(0x24a)](readFileSync(_0x5606ae,_0x3b021b(0x242)));_0x84ec20[_0x3b021b(0x238)]&&(_0x302124={'llm_project':_0x84ec20[_0x3b021b(0x238)]});}catch{}const _0x2d5c30=resolveAgentPullArgs({'arg':_0x1f3f54,'agentNameArg':_0x315801,'agentFlag':_0x4e6b43,'contextProject':_0x397cb8,'argDirConfig':_0x3b3ddc,'cwdConfigPath':_0x5606ae||undefined,'cwdConfig':_0x302124}),{projectNameOrId:_0x1a10a5,targetAgentName:_0x14ba8d,existingOutputDir:_0x895d85,source:_0x33eae3}=_0x2d5c30;if(_0x33eae3==='arg-dir')console[_0x3b021b(0x258)](a4_0x1140fa[_0x3b021b(0x216)]('Using\x20project\x20from\x20'+a4_0x3f8ec3[_0x3b021b(0x202)](_0x1f3f54,'tdx.json')+':\x20'+_0x1a10a5));else{if(_0x33eae3===_0x3b021b(0x244))console[_0x3b021b(0x258)](a4_0x1140fa[_0x3b021b(0x216)](_0x3b021b(0x1d8)+_0x1a10a5));else _0x33eae3===_0x3b021b(0x217)&&console[_0x3b021b(0x258)](a4_0x1140fa[_0x3b021b(0x216)]('Using\x20project\x20from\x20context:\x20'+_0x1a10a5));}if(!_0x1a10a5)return _0x4e6b43?(console['log'](a4_0x1140fa[_0x3b021b(0x1ea)](_0x3b021b(0x1f4))),console[_0x3b021b(0x258)]('Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>'),console['log'](_0x3b021b(0x23d))):(console[_0x3b021b(0x258)](a4_0x1140fa[_0x3b021b(0x1ea)](_0x3b021b(0x1c3))),console[_0x3b021b(0x258)](_0x3b021b(0x1f1)),console[_0x3b021b(0x258)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project'),console[_0x3b021b(0x258)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory'),console[_0x3b021b(0x258)](_0x3b021b(0x24b)),console[_0x3b021b(0x258)](_0x3b021b(0x206))),0x1;if(_0x14ba8d){const {data:_0x4d148e}=await withSpinner(_0x3b021b(0x1c4)+_0x14ba8d+'\x22\x20from\x20project\x20\x22'+_0x1a10a5+'\x22...',()=>_0x1e43c7[_0x3b021b(0x23b)][_0x3b021b(0x239)](_0x1a10a5,_0x14ba8d,_0x43257d,{'dryRun':_0x3bcfc9,'force':_0x53f2d8}));if(_0x3bcfc9)return console[_0x3b021b(0x258)](a4_0x1140fa[_0x3b021b(0x1ea)]('Dry\x20run\x20-\x20no\x20files\x20written')),console[_0x3b021b(0x258)](_0x3b021b(0x20a)+_0x4d148e[_0x3b021b(0x20d)]),console[_0x3b021b(0x258)](_0x3b021b(0x1fe)+_0x4d148e[_0x3b021b(0x25d)]),_0x4d148e[_0x3b021b(0x1e9)]&&(console[_0x3b021b(0x258)](_0x3b021b(0x23e)),console[_0x3b021b(0x258)]('─'[_0x3b021b(0x1c2)](0x3c)),console['log'](_0x4d148e[_0x3b021b(0x1e9)]),console[_0x3b021b(0x258)]('─'[_0x3b021b(0x1c2)](0x3c))),0x0;return console[_0x3b021b(0x258)](a4_0x1140fa[_0x3b021b(0x24e)](_0x3b021b(0x21c))),console['log'](_0x3b021b(0x24c)+_0x4d148e[_0x3b021b(0x20d)]),console[_0x3b021b(0x258)](_0x3b021b(0x21a)+_0x4d148e[_0x3b021b(0x25d)]),console[_0x3b021b(0x258)](_0x3b021b(0x251)+(_0x4d148e[_0x3b021b(0x1dd)]?a4_0x1140fa['green'](_0x3b021b(0x1d4)):_0x4d148e[_0x3b021b(0x223)]?a4_0x1140fa[_0x3b021b(0x1ea)](_0x3b021b(0x227)):a4_0x1140fa['gray'](_0x3b021b(0x226)))),0x0;}const _0x59ec1a=_0x895d85||_0x43257d,{data:_0x30a9f4}=await withSpinner('Analyzing\x20project\x20\x22'+_0x1a10a5+'\x22...',()=>_0x1e43c7[_0x3b021b(0x23b)][_0x3b021b(0x1c9)](_0x1a10a5,_0x59ec1a,{'dryRun':!![]})),_0x402a35=_0x30a9f4['counts']['agents']['new']+_0x30a9f4[_0x3b021b(0x1cf)][_0x3b021b(0x269)]['new']+_0x30a9f4[_0x3b021b(0x1cf)]['textKnowledgeBases'][_0x3b021b(0x1d4)]+_0x30a9f4[_0x3b021b(0x1cf)][_0x3b021b(0x246)][_0x3b021b(0x1d4)]+_0x30a9f4[_0x3b021b(0x1cf)][_0x3b021b(0x22f)][_0x3b021b(0x1d4)]+_0x30a9f4[_0x3b021b(0x1cf)]['experimentalKnowledgeBases'][_0x3b021b(0x1d4)]+_0x30a9f4[_0x3b021b(0x1cf)][_0x3b021b(0x22b)][_0x3b021b(0x1d4)]+_0x30a9f4['counts']['formInterfaces'][_0x3b021b(0x1d4)]+_0x30a9f4[_0x3b021b(0x1cf)][_0x3b021b(0x25f)]['new'],_0x4a0961=_0x30a9f4[_0x3b021b(0x1cf)]['agents'][_0x3b021b(0x227)]+_0x30a9f4[_0x3b021b(0x1cf)][_0x3b021b(0x269)]['updated']+_0x30a9f4[_0x3b021b(0x1cf)][_0x3b021b(0x224)][_0x3b021b(0x227)]+_0x30a9f4[_0x3b021b(0x1cf)][_0x3b021b(0x246)][_0x3b021b(0x227)]+_0x30a9f4['counts'][_0x3b021b(0x22f)][_0x3b021b(0x227)]+_0x30a9f4[_0x3b021b(0x1cf)][_0x3b021b(0x268)][_0x3b021b(0x227)]+_0x30a9f4[_0x3b021b(0x1cf)]['experimentalArtifacts'][_0x3b021b(0x227)]+_0x30a9f4[_0x3b021b(0x1cf)][_0x3b021b(0x21e)][_0x3b021b(0x227)]+_0x30a9f4[_0x3b021b(0x1cf)]['chatInterfaces'][_0x3b021b(0x227)],_0x33a425=_0x30a9f4['counts'][_0x3b021b(0x234)][_0x3b021b(0x226)]+_0x30a9f4[_0x3b021b(0x1cf)][_0x3b021b(0x269)]['unchanged']+_0x30a9f4[_0x3b021b(0x1cf)]['textKnowledgeBases'][_0x3b021b(0x226)]+_0x30a9f4['counts'][_0x3b021b(0x246)]['unchanged']+_0x30a9f4['counts']['integrations']['unchanged']+_0x30a9f4['counts'][_0x3b021b(0x268)][_0x3b021b(0x226)]+_0x30a9f4['counts'][_0x3b021b(0x22b)]['unchanged']+_0x30a9f4[_0x3b021b(0x1cf)][_0x3b021b(0x21e)][_0x3b021b(0x226)]+_0x30a9f4[_0x3b021b(0x1cf)][_0x3b021b(0x25f)][_0x3b021b(0x226)];console[_0x3b021b(0x258)](_0x3b021b(0x231)+_0x30a9f4['projectName']+'\x27:'),console[_0x3b021b(0x258)]('\x20\x20'+a4_0x1140fa[_0x3b021b(0x24e)]('+\x20'+_0x402a35+_0x3b021b(0x21f))+_0x3b021b(0x1fc)+a4_0x1140fa['yellow']('~\x20'+_0x4a0961+_0x3b021b(0x1ca))+_0x3b021b(0x1fc)+a4_0x1140fa[_0x3b021b(0x216)]('=\x20'+_0x33a425+_0x3b021b(0x1c6))),console[_0x3b021b(0x258)](_0x3b021b(0x23c)+formatCountSummary(_0x30a9f4['counts'][_0x3b021b(0x234)])),console[_0x3b021b(0x258)](_0x3b021b(0x265)+formatCountSummary(_0x30a9f4[_0x3b021b(0x1cf)][_0x3b021b(0x269)])),console['log']('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x30a9f4['counts']['textKnowledgeBases'])),console[_0x3b021b(0x258)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x30a9f4[_0x3b021b(0x1cf)][_0x3b021b(0x246)])),console[_0x3b021b(0x258)](_0x3b021b(0x1fd)+formatCountSummary(_0x30a9f4[_0x3b021b(0x1cf)][_0x3b021b(0x22f)])),console[_0x3b021b(0x258)]('\x20\x20Form\x20Interfaces:\x20'+formatCountSummary(_0x30a9f4['counts'][_0x3b021b(0x21e)])),console[_0x3b021b(0x258)](_0x3b021b(0x26d)+formatCountSummary(_0x30a9f4[_0x3b021b(0x1cf)][_0x3b021b(0x25f)]));const _0x4cfd34=_0x30a9f4[_0x3b021b(0x1cf)]['experimentalKnowledgeBases'][_0x3b021b(0x22e)]>0x0||_0x30a9f4[_0x3b021b(0x1cf)]['experimentalArtifacts'][_0x3b021b(0x22e)]>0x0;_0x4cfd34&&(console[_0x3b021b(0x258)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x30a9f4[_0x3b021b(0x1cf)][_0x3b021b(0x268)])),console['log']('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x30a9f4[_0x3b021b(0x1cf)][_0x3b021b(0x22b)])));console[_0x3b021b(0x258)](_0x3b021b(0x1eb)+a4_0x1140fa[_0x3b021b(0x1cb)](_0x30a9f4[_0x3b021b(0x1b5)])),displayDiffs(_0x30a9f4[_0x3b021b(0x234)],_0x30a9f4[_0x3b021b(0x269)],_0x30a9f4[_0x3b021b(0x224)],_0x30a9f4[_0x3b021b(0x246)],_0x30a9f4[_0x3b021b(0x22f)],_0x30a9f4[_0x3b021b(0x268)],_0x30a9f4[_0x3b021b(0x22b)],_0x30a9f4[_0x3b021b(0x21e)],_0x30a9f4[_0x3b021b(0x25f)]);if(_0x3bcfc9)return console[_0x3b021b(0x258)](a4_0x1140fa['yellow'](_0x3b021b(0x1be))),0x0;if(_0x402a35===0x0&&_0x4a0961===0x0)return console['log'](a4_0x1140fa[_0x3b021b(0x24e)](_0x3b021b(0x200))),saveSessionContext({'llm_project':_0x30a9f4[_0x3b021b(0x267)]},_0x15840a[_0x3b021b(0x243)]),console[_0x3b021b(0x258)](a4_0x1140fa['green'](_0x3b021b(0x1d3)+a4_0x1140fa[_0x3b021b(0x216)](_0x3b021b(0x238))+_0x3b021b(0x221)+a4_0x1140fa['cyan'](_0x30a9f4[_0x3b021b(0x267)]))),0x0;if(!_0x26f686&&!_0x53f2d8){if(!isInteractive())return console[_0x3b021b(0x262)](a4_0x1140fa[_0x3b021b(0x23a)]('\x0aError:'),_0x3b021b(0x205)),console[_0x3b021b(0x262)](a4_0x1140fa[_0x3b021b(0x216)](_0x3b021b(0x21d))),0x1;const _0x146edb=await confirmKey('\x0aWrite\x20'+(_0x402a35+_0x4a0961)+_0x3b021b(0x1f7));if(!_0x146edb)return console[_0x3b021b(0x258)](a4_0x1140fa['yellow']('Cancelled'),_0x3b021b(0x266)),0x1;}const {data:_0x1df425}=await withSpinner('Writing\x20files...',()=>_0x1e43c7[_0x3b021b(0x23b)][_0x3b021b(0x1c9)](_0x1a10a5,_0x59ec1a,{'force':_0x53f2d8}));return console[_0x3b021b(0x258)](a4_0x1140fa['green'](_0x3b021b(0x264)+(_0x402a35+_0x4a0961)+_0x3b021b(0x22d)+_0x1df425[_0x3b021b(0x1b5)])),saveSessionContext({'llm_project':_0x1df425['projectName']},_0x15840a['session']),console[_0x3b021b(0x258)](a4_0x1140fa[_0x3b021b(0x24e)](_0x3b021b(0x1d3)+a4_0x1140fa[_0x3b021b(0x216)](_0x3b021b(0x238))+_0x3b021b(0x221)+a4_0x1140fa['cyan'](_0x1df425[_0x3b021b(0x267)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{['name']='agent:clone';[a4_0xc37a6a(0x1b7)]='Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project';async['execute'](_0x381cf6){const _0x1a6be5=a4_0xc37a6a,{options:_0x3f8ede,args:_0x3d1a37,tdx:_0x33ff13}=_0x381cf6,_0x4a4b37=_0x3d1a37[0x0],_0xfcbe7=_0x3f8ede[_0x1a6be5(0x1c1)],_0x2fa998=_0x3f8ede[_0x1a6be5(0x1dc)],_0x27e9a8=_0x3f8ede[_0x1a6be5(0x20f)],_0x18d932=_0x3f8ede[_0x1a6be5(0x219)],_0x2f20af=_0x3f8ede['llmProject'];let _0x3e5291;const _0x2ead77=findAgentConfigPath(process[_0x1a6be5(0x20e)]());if(_0x4a4b37){const _0x2274af=a4_0x3f8ec3['join'](_0x4a4b37,_0x1a6be5(0x1ce));existsSync(_0x2274af)?(_0x3e5291=_0x4a4b37,console[_0x1a6be5(0x258)](a4_0x1140fa['dim'](_0x1a6be5(0x1ed)+_0x4a4b37))):_0x3e5291=_0x4a4b37;}else{if(_0x2ead77)_0x3e5291=a4_0x3f8ec3['dirname'](_0x2ead77),console[_0x1a6be5(0x258)](a4_0x1140fa[_0x1a6be5(0x216)]('Using\x20current\x20project:\x20'+_0x3e5291));else{if(_0x2f20af){const _0x1de73f=sanitizeForFilesystem(_0x2f20af);let _0x29578b=_0x1de73f,_0x559f5d=a4_0x3f8ec3[_0x1a6be5(0x202)](process[_0x1a6be5(0x20e)](),_0x1a6be5(0x234),_0x1de73f,_0x1a6be5(0x1ce));if(!existsSync(_0x559f5d)){const _0x29b49b=normalizeName(_0x2f20af),_0x41f0cb=a4_0x3f8ec3[_0x1a6be5(0x202)](process[_0x1a6be5(0x20e)](),_0x1a6be5(0x234),_0x29b49b,_0x1a6be5(0x1ce));existsSync(_0x41f0cb)&&(_0x29578b=_0x29b49b,_0x559f5d=_0x41f0cb);}if(existsSync(_0x559f5d))_0x3e5291=a4_0x3f8ec3[_0x1a6be5(0x241)](_0x559f5d),console[_0x1a6be5(0x258)](a4_0x1140fa['dim']('Using\x20local\x20project:\x20'+_0x3e5291));else{const _0x4cc418=_0x3f8ede[_0x1a6be5(0x1cd)];if(_0x4cc418)throw new SDKError(ErrorCode[_0x1a6be5(0x237)],_0x1a6be5(0x25c)+_0x2f20af+'\x22\x20to\x20a\x20different\x20profile',undefined,{'helpText':_0x1a6be5(0x249)+'First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a'+(_0x1a6be5(0x222)+_0x2f20af+'\x0a')+('\x20\x20tdx\x20agent\x20clone\x20agents/'+_0x29578b+'\x20--name\x20'+(_0xfcbe7||_0x1a6be5(0x25e))+_0x1a6be5(0x1bc)+_0x4cc418)});_0x3e5291=_0x2f20af,console[_0x1a6be5(0x258)](a4_0x1140fa['dim'](_0x1a6be5(0x26b)+_0x2f20af));}}}}if(!_0x3e5291)return console[_0x1a6be5(0x258)](a4_0x1140fa[_0x1a6be5(0x1ea)](_0x1a6be5(0x214))),console[_0x1a6be5(0x258)](_0x1a6be5(0x1d2)),console[_0x1a6be5(0x258)](_0x1a6be5(0x218)),console['log'](_0x1a6be5(0x21b)),console[_0x1a6be5(0x258)]('\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>'),0x1;if(!_0xfcbe7)throw new SDKError(ErrorCode[_0x1a6be5(0x1d1)],'New\x20project\x20name\x20is\x20required',undefined,{'helpText':_0x1a6be5(0x1bf)});if(!_0x27e9a8&&!_0x2fa998){if(!isInteractive())return console[_0x1a6be5(0x262)](a4_0x1140fa[_0x1a6be5(0x23a)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x1a6be5(0x262)](a4_0x1140fa[_0x1a6be5(0x216)](_0x1a6be5(0x21d))),0x1;const _0x5ba3b9=await confirmKey(_0x1a6be5(0x245)+_0x3e5291+_0x1a6be5(0x1b9)+_0xfcbe7+'\x22?');if(!_0x5ba3b9)return console['log'](a4_0x1140fa[_0x1a6be5(0x1ea)](_0x1a6be5(0x1e8))),0x1;}const {data:_0x43a78c}=await withSpinner(_0x1a6be5(0x1b6)+_0x3e5291+_0x1a6be5(0x203)+_0xfcbe7+'\x22...',()=>_0x33ff13[_0x1a6be5(0x23b)][_0x1a6be5(0x1bb)](_0x3e5291,_0xfcbe7,{'dryRun':_0x2fa998}));if(_0x2fa998){console[_0x1a6be5(0x258)](a4_0x1140fa['yellow'](_0x1a6be5(0x1c7))),console[_0x1a6be5(0x258)]('Source:\x20'+_0x43a78c[_0x1a6be5(0x207)]),console[_0x1a6be5(0x258)](_0x1a6be5(0x1ba)+_0xfcbe7),console[_0x1a6be5(0x258)]('Would\x20clone:'),console['log'](_0x1a6be5(0x23c)+_0x43a78c[_0x1a6be5(0x1cf)][_0x1a6be5(0x234)][_0x1a6be5(0x1ff)]),console[_0x1a6be5(0x258)](_0x1a6be5(0x265)+_0x43a78c[_0x1a6be5(0x1cf)][_0x1a6be5(0x269)][_0x1a6be5(0x1ff)]),console[_0x1a6be5(0x258)](_0x1a6be5(0x1f5)+_0x43a78c[_0x1a6be5(0x1cf)][_0x1a6be5(0x246)]['created']),console[_0x1a6be5(0x258)](_0x1a6be5(0x1db)+_0x43a78c[_0x1a6be5(0x1cf)]['formInterfaces'][_0x1a6be5(0x1ff)]),console[_0x1a6be5(0x258)](_0x1a6be5(0x26d)+_0x43a78c['counts'][_0x1a6be5(0x25f)]['created']);const _0x4df055=_0x43a78c[_0x1a6be5(0x1cf)][_0x1a6be5(0x268)][_0x1a6be5(0x1ff)]>0x0||_0x43a78c['counts'][_0x1a6be5(0x22b)][_0x1a6be5(0x1ff)]>0x0;return _0x4df055&&(console[_0x1a6be5(0x258)](_0x1a6be5(0x22a)+_0x43a78c[_0x1a6be5(0x1cf)][_0x1a6be5(0x268)]['created']),console[_0x1a6be5(0x258)](_0x1a6be5(0x1f3)+_0x43a78c[_0x1a6be5(0x1cf)]['experimentalArtifacts'][_0x1a6be5(0x1ff)])),0x0;}const _0xd7da43=_0x43a78c[_0x1a6be5(0x1cf)][_0x1a6be5(0x234)][_0x1a6be5(0x1e1)]>0x0||_0x43a78c[_0x1a6be5(0x1cf)]['knowledgeBases']['errors']>0x0||_0x43a78c['counts'][_0x1a6be5(0x246)]['errors']>0x0||_0x43a78c[_0x1a6be5(0x1cf)]['formInterfaces'][_0x1a6be5(0x1e1)]>0x0||_0x43a78c[_0x1a6be5(0x1cf)][_0x1a6be5(0x25f)][_0x1a6be5(0x1e1)]>0x0||_0x43a78c[_0x1a6be5(0x1cf)]['experimentalKnowledgeBases'][_0x1a6be5(0x1e1)]>0x0||_0x43a78c[_0x1a6be5(0x1cf)][_0x1a6be5(0x22b)][_0x1a6be5(0x1e1)]>0x0;_0xd7da43?console[_0x1a6be5(0x258)](a4_0x1140fa['yellow'](_0x1a6be5(0x24f))):console[_0x1a6be5(0x258)](a4_0x1140fa[_0x1a6be5(0x24e)]('Project\x20cloned\x20successfully'));console[_0x1a6be5(0x258)](_0x1a6be5(0x1e7)+_0x43a78c['sourceProjectName']),console[_0x1a6be5(0x258)](_0x1a6be5(0x1ba)+_0x43a78c[_0x1a6be5(0x25b)]),console[_0x1a6be5(0x258)](_0x1a6be5(0x1e6)+_0x43a78c[_0x1a6be5(0x22c)]),console['log'](),console[_0x1a6be5(0x258)](_0x1a6be5(0x1f9)),console[_0x1a6be5(0x258)]('\x20\x20Agents:\x20'+formatCountSummary(_0x43a78c[_0x1a6be5(0x1cf)]['agents'])),console['log'](_0x1a6be5(0x265)+formatCountSummary(_0x43a78c[_0x1a6be5(0x1cf)][_0x1a6be5(0x269)])),console['log'](_0x1a6be5(0x1f5)+formatCountSummary(_0x43a78c[_0x1a6be5(0x1cf)]['prompts'])),console[_0x1a6be5(0x258)](_0x1a6be5(0x1fd)+formatCountSummary(_0x43a78c[_0x1a6be5(0x1cf)][_0x1a6be5(0x22f)])),console[_0x1a6be5(0x258)](_0x1a6be5(0x1db)+formatCountSummary(_0x43a78c[_0x1a6be5(0x1cf)][_0x1a6be5(0x21e)])),console['log'](_0x1a6be5(0x26d)+formatCountSummary(_0x43a78c['counts'][_0x1a6be5(0x25f)]));const _0x1942d1=_0x43a78c[_0x1a6be5(0x1cf)][_0x1a6be5(0x268)]['created']>0x0||_0x43a78c['counts']['experimentalKnowledgeBases'][_0x1a6be5(0x227)]>0x0||_0x43a78c[_0x1a6be5(0x1cf)]['experimentalKnowledgeBases'][_0x1a6be5(0x226)]>0x0||_0x43a78c[_0x1a6be5(0x1cf)][_0x1a6be5(0x22b)][_0x1a6be5(0x1ff)]>0x0||_0x43a78c['counts'][_0x1a6be5(0x22b)][_0x1a6be5(0x227)]>0x0||_0x43a78c[_0x1a6be5(0x1cf)][_0x1a6be5(0x22b)]['unchanged']>0x0;_0x1942d1&&(console[_0x1a6be5(0x258)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x43a78c['counts'][_0x1a6be5(0x268)])),console[_0x1a6be5(0x258)](_0x1a6be5(0x1f3)+formatCountSummary(_0x43a78c['counts'][_0x1a6be5(0x22b)])));if(_0xd7da43){console['log'](),console[_0x1a6be5(0x258)](a4_0x1140fa[_0x1a6be5(0x23a)](_0x1a6be5(0x1b3)));for(const _0xbc8f88 of _0x43a78c[_0x1a6be5(0x234)]){_0xbc8f88[_0x1a6be5(0x24d)]===_0x1a6be5(0x262)&&console[_0x1a6be5(0x258)](a4_0x1140fa['red'](_0x1a6be5(0x1d5)+_0xbc8f88['agentName']+_0x1a6be5(0x261)+_0xbc8f88[_0x1a6be5(0x262)]));}for(const _0x17bd09 of _0x43a78c[_0x1a6be5(0x269)]){_0x17bd09[_0x1a6be5(0x24d)]===_0x1a6be5(0x262)&&console['log'](a4_0x1140fa[_0x1a6be5(0x23a)]('\x20\x20Knowledge\x20Base\x20\x22'+_0x17bd09[_0x1a6be5(0x1c1)]+_0x1a6be5(0x261)+_0x17bd09[_0x1a6be5(0x262)]));}for(const _0x4ed9d8 of _0x43a78c[_0x1a6be5(0x246)]){_0x4ed9d8[_0x1a6be5(0x24d)]==='error'&&console[_0x1a6be5(0x258)](a4_0x1140fa[_0x1a6be5(0x23a)](_0x1a6be5(0x235)+_0x4ed9d8[_0x1a6be5(0x1c1)]+_0x1a6be5(0x261)+_0x4ed9d8['error']));}for(const _0x5dde76 of _0x43a78c[_0x1a6be5(0x22f)]){_0x5dde76['action']==='error'&&console[_0x1a6be5(0x258)](a4_0x1140fa[_0x1a6be5(0x23a)](_0x1a6be5(0x263)+_0x5dde76[_0x1a6be5(0x1c1)]+'\x22:\x20'+_0x5dde76['error']));}for(const _0x5f3ab4 of _0x43a78c['formInterfaces']){_0x5f3ab4['action']===_0x1a6be5(0x262)&&console[_0x1a6be5(0x258)](a4_0x1140fa[_0x1a6be5(0x23a)](_0x1a6be5(0x215)+_0x5f3ab4[_0x1a6be5(0x1c1)]+'\x22:\x20'+_0x5f3ab4[_0x1a6be5(0x262)]));}for(const _0x105557 of _0x43a78c[_0x1a6be5(0x25f)]){_0x105557[_0x1a6be5(0x24d)]==='error'&&console[_0x1a6be5(0x258)](a4_0x1140fa['red'](_0x1a6be5(0x1e5)+_0x105557[_0x1a6be5(0x1c1)]+_0x1a6be5(0x261)+_0x105557[_0x1a6be5(0x262)]));}for(const _0x1600a3 of _0x43a78c['experimentalKnowledgeBases']){_0x1600a3[_0x1a6be5(0x24d)]===_0x1a6be5(0x262)&&console['log'](a4_0x1140fa[_0x1a6be5(0x23a)](_0x1a6be5(0x230)+_0x1600a3[_0x1a6be5(0x1c1)]+_0x1a6be5(0x261)+_0x1600a3['error']));}for(const _0x400b00 of _0x43a78c[_0x1a6be5(0x22b)]){_0x400b00[_0x1a6be5(0x24d)]===_0x1a6be5(0x262)&&console['log'](a4_0x1140fa[_0x1a6be5(0x23a)](_0x1a6be5(0x1ee)+_0x400b00['name']+_0x1a6be5(0x261)+_0x400b00['error']));}return 0x1;}console[_0x1a6be5(0x258)]();const _0x42e675=getLLMProjectUrl(_0x18d932,_0x43a78c[_0x1a6be5(0x22c)]);return console[_0x1a6be5(0x258)](_0x1a6be5(0x1d7)+a4_0x1140fa['cyan'](_0x42e675)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0xc37a6a(0x1c1)]='agent:push';[a4_0xc37a6a(0x1b7)]=a4_0xc37a6a(0x1ec);async[a4_0xc37a6a(0x1f8)](_0x47483e){const _0x4721a5=a4_0xc37a6a,{options:_0x33a740,args:_0x1cbed1,tdx:_0x4194e8}=_0x47483e;let _0x596d24=_0x1cbed1[0x0]||process['cwd']();const _0x1008ea=_0x33a740[_0x4721a5(0x1dc)],_0x4a61ad=_0x33a740[_0x4721a5(0x252)],_0x3bc897=_0x33a740[_0x4721a5(0x20f)],_0x2206a6=_0x33a740[_0x4721a5(0x219)],_0x2a6d6f=a4_0x3f8ec3['join'](_0x596d24,_0x4721a5(0x20b)),_0x27c465=existsSync(_0x2a6d6f);if(_0x27c465){const {data:_0x4203ed}=await withSpinner(_0x4721a5(0x257)+_0x596d24+_0x4721a5(0x1f2),()=>_0x4194e8[_0x4721a5(0x23b)]['pushAgent'](_0x596d24,{'dryRun':_0x1008ea,'force':_0x4a61ad}));if(_0x1008ea)return console[_0x4721a5(0x258)](a4_0x1140fa[_0x4721a5(0x1ea)](_0x4721a5(0x1c7))),console['log'](_0x4721a5(0x23f)+_0x4203ed[_0x4721a5(0x20d)]),0x0;if(_0x4203ed[_0x4721a5(0x24d)]==='error')return console[_0x4721a5(0x258)](a4_0x1140fa['red']('Failed\x20to\x20push\x20agent:\x20'+_0x4203ed['error'])),0x1;console[_0x4721a5(0x258)](a4_0x1140fa[_0x4721a5(0x24e)](_0x4721a5(0x208)+_0x4203ed[_0x4721a5(0x24d)]+_0x4721a5(0x1e2))),console[_0x4721a5(0x258)](_0x4721a5(0x24c)+_0x4203ed[_0x4721a5(0x20d)]);if(_0x4203ed[_0x4721a5(0x213)]&&_0x4203ed[_0x4721a5(0x220)]){const _0x5a54a6=getLLMAgentChatUrl(_0x2206a6,_0x4203ed[_0x4721a5(0x220)],_0x4203ed[_0x4721a5(0x213)]);console['log']('Chat:\x20'+a4_0x1140fa[_0x4721a5(0x1cb)](_0x5a54a6));}return 0x0;}const _0x47f25b=_0x33a740[_0x4721a5(0x1d6)],_0x1d3ccd=resolveProjectFromContext(_0x596d24,_0x47f25b);if(_0x1d3ccd[_0x4721a5(0x236)])_0x596d24=_0x1d3ccd[_0x4721a5(0x26c)],_0x1d3ccd['source']===_0x4721a5(0x217)&&console[_0x4721a5(0x258)](a4_0x1140fa['dim'](_0x4721a5(0x1d8)+_0x596d24));else{let _0x4952cc=_0x4721a5(0x259);_0x1d3ccd['reason']===_0x4721a5(0x26a)&&(_0x4952cc=_0x1d3ccd['message']+_0x4721a5(0x248)+_0x1d3ccd[_0x4721a5(0x1d6)]+_0x4721a5(0x1e4));throw new SDKError(ErrorCode[_0x4721a5(0x237)],_0x1d3ccd['reason']==='no_context'?_0x1d3ccd['message']:_0x4721a5(0x255)+_0x596d24,undefined,{'helpText':_0x4952cc});}const {data:_0x48fb0d}=await withSpinner(_0x4721a5(0x1cc),()=>_0x4194e8[_0x4721a5(0x23b)][_0x4721a5(0x225)](_0x596d24,{'dryRun':!![]})),_0x2485a7=_0x48fb0d[_0x4721a5(0x1cf)][_0x4721a5(0x234)]['errors']>0x0;if(_0x2485a7){console[_0x4721a5(0x258)](a4_0x1140fa[_0x4721a5(0x23a)]('\x0aErrors\x20found:'));for(const _0x449153 of _0x48fb0d[_0x4721a5(0x234)]){_0x449153[_0x4721a5(0x24d)]===_0x4721a5(0x262)&&console[_0x4721a5(0x258)](a4_0x1140fa[_0x4721a5(0x23a)](_0x4721a5(0x1d5)+_0x449153[_0x4721a5(0x20d)]+_0x4721a5(0x261)+_0x449153[_0x4721a5(0x262)]));}return 0x1;}const _0x589ef1=_0x48fb0d[_0x4721a5(0x1cf)][_0x4721a5(0x234)][_0x4721a5(0x1ff)]+_0x48fb0d[_0x4721a5(0x1cf)]['knowledgeBases'][_0x4721a5(0x1ff)]+_0x48fb0d[_0x4721a5(0x1cf)][_0x4721a5(0x224)]['created']+_0x48fb0d[_0x4721a5(0x1cf)][_0x4721a5(0x246)][_0x4721a5(0x1ff)]+_0x48fb0d[_0x4721a5(0x1cf)]['integrations'][_0x4721a5(0x1ff)]+_0x48fb0d[_0x4721a5(0x1cf)][_0x4721a5(0x268)][_0x4721a5(0x1ff)]+_0x48fb0d[_0x4721a5(0x1cf)]['experimentalArtifacts'][_0x4721a5(0x1ff)]+_0x48fb0d[_0x4721a5(0x1cf)][_0x4721a5(0x21e)][_0x4721a5(0x1ff)]+_0x48fb0d[_0x4721a5(0x1cf)][_0x4721a5(0x25f)][_0x4721a5(0x1ff)],_0x3e6eb6=_0x48fb0d['counts'][_0x4721a5(0x234)]['updated']+_0x48fb0d['counts'][_0x4721a5(0x269)][_0x4721a5(0x227)]+_0x48fb0d[_0x4721a5(0x1cf)][_0x4721a5(0x224)][_0x4721a5(0x227)]+_0x48fb0d[_0x4721a5(0x1cf)][_0x4721a5(0x246)][_0x4721a5(0x227)]+_0x48fb0d[_0x4721a5(0x1cf)][_0x4721a5(0x22f)][_0x4721a5(0x227)]+_0x48fb0d['counts']['experimentalKnowledgeBases'][_0x4721a5(0x227)]+_0x48fb0d[_0x4721a5(0x1cf)][_0x4721a5(0x22b)][_0x4721a5(0x227)]+_0x48fb0d[_0x4721a5(0x1cf)][_0x4721a5(0x21e)][_0x4721a5(0x227)]+_0x48fb0d[_0x4721a5(0x1cf)][_0x4721a5(0x25f)][_0x4721a5(0x227)],_0x19d1f2=_0x48fb0d[_0x4721a5(0x1cf)][_0x4721a5(0x234)][_0x4721a5(0x226)]+_0x48fb0d['counts'][_0x4721a5(0x269)][_0x4721a5(0x226)]+_0x48fb0d[_0x4721a5(0x1cf)]['textKnowledgeBases'][_0x4721a5(0x226)]+_0x48fb0d[_0x4721a5(0x1cf)][_0x4721a5(0x246)]['unchanged']+_0x48fb0d[_0x4721a5(0x1cf)][_0x4721a5(0x22f)][_0x4721a5(0x226)]+_0x48fb0d[_0x4721a5(0x1cf)][_0x4721a5(0x268)][_0x4721a5(0x226)]+_0x48fb0d['counts'][_0x4721a5(0x22b)][_0x4721a5(0x226)]+_0x48fb0d[_0x4721a5(0x1cf)]['formInterfaces'][_0x4721a5(0x226)]+_0x48fb0d[_0x4721a5(0x1cf)][_0x4721a5(0x25f)][_0x4721a5(0x226)];console[_0x4721a5(0x258)](_0x4721a5(0x253)+_0x48fb0d[_0x4721a5(0x267)]+'\x27:'),console['log']('\x20\x20'+a4_0x1140fa['green']('+\x20'+_0x589ef1+_0x4721a5(0x21f))+_0x4721a5(0x1fc)+a4_0x1140fa[_0x4721a5(0x1ea)]('~\x20'+_0x3e6eb6+_0x4721a5(0x1ca))+_0x4721a5(0x1fc)+a4_0x1140fa[_0x4721a5(0x216)]('=\x20'+_0x19d1f2+'\x20unchanged')),console['log'](_0x4721a5(0x23c)+formatCountSummary(_0x48fb0d[_0x4721a5(0x1cf)][_0x4721a5(0x234)])),console[_0x4721a5(0x258)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x48fb0d[_0x4721a5(0x1cf)][_0x4721a5(0x269)])),console['log'](_0x4721a5(0x1de)+formatCountSummary(_0x48fb0d[_0x4721a5(0x1cf)][_0x4721a5(0x224)])),console[_0x4721a5(0x258)](_0x4721a5(0x1f5)+formatCountSummary(_0x48fb0d[_0x4721a5(0x1cf)][_0x4721a5(0x246)])),console[_0x4721a5(0x258)](_0x4721a5(0x1fd)+formatCountSummary(_0x48fb0d[_0x4721a5(0x1cf)][_0x4721a5(0x22f)])),console[_0x4721a5(0x258)](_0x4721a5(0x1db)+formatCountSummary(_0x48fb0d[_0x4721a5(0x1cf)][_0x4721a5(0x21e)])),console[_0x4721a5(0x258)](_0x4721a5(0x26d)+formatCountSummary(_0x48fb0d[_0x4721a5(0x1cf)]['chatInterfaces']));const _0x208b09=_0x48fb0d[_0x4721a5(0x1cf)][_0x4721a5(0x268)][_0x4721a5(0x1ff)]>0x0||_0x48fb0d[_0x4721a5(0x1cf)][_0x4721a5(0x268)]['updated']>0x0||_0x48fb0d[_0x4721a5(0x1cf)]['experimentalKnowledgeBases']['unchanged']>0x0||_0x48fb0d[_0x4721a5(0x1cf)][_0x4721a5(0x22b)][_0x4721a5(0x1ff)]>0x0||_0x48fb0d[_0x4721a5(0x1cf)]['experimentalArtifacts'][_0x4721a5(0x227)]>0x0||_0x48fb0d['counts']['experimentalArtifacts'][_0x4721a5(0x226)]>0x0;_0x208b09&&(console[_0x4721a5(0x258)](_0x4721a5(0x22a)+formatCountSummary(_0x48fb0d['counts'][_0x4721a5(0x268)])),console[_0x4721a5(0x258)](_0x4721a5(0x1f3)+formatCountSummary(_0x48fb0d[_0x4721a5(0x1cf)][_0x4721a5(0x22b)])));console[_0x4721a5(0x258)](_0x4721a5(0x1d9)+a4_0x1140fa[_0x4721a5(0x1cb)](_0x596d24)),displayDiffs(_0x48fb0d[_0x4721a5(0x234)],_0x48fb0d['knowledgeBases'],_0x48fb0d[_0x4721a5(0x224)],_0x48fb0d[_0x4721a5(0x246)],_0x48fb0d[_0x4721a5(0x22f)],_0x48fb0d[_0x4721a5(0x268)],_0x48fb0d[_0x4721a5(0x22b)],_0x48fb0d[_0x4721a5(0x21e)],_0x48fb0d['chatInterfaces']);if(_0x1008ea)return console[_0x4721a5(0x258)](a4_0x1140fa[_0x4721a5(0x1ea)](_0x4721a5(0x1df))),0x0;if(_0x589ef1===0x0&&_0x3e6eb6===0x0){console[_0x4721a5(0x258)](a4_0x1140fa[_0x4721a5(0x24e)](_0x4721a5(0x1e3)));const _0x30916f=getLLMProjectUrl(_0x2206a6,_0x48fb0d['projectId']);return console[_0x4721a5(0x258)](_0x4721a5(0x1d7)+a4_0x1140fa[_0x4721a5(0x1cb)](_0x30916f)),0x0;}if(!_0x3bc897&&!_0x4a61ad){if(!isInteractive())return console[_0x4721a5(0x262)](a4_0x1140fa['red'](_0x4721a5(0x211)),_0x4721a5(0x205)),console[_0x4721a5(0x262)](a4_0x1140fa[_0x4721a5(0x216)](_0x4721a5(0x21d))),0x1;const _0x5f0728=await confirmKey(_0x4721a5(0x204)+(_0x589ef1+_0x3e6eb6)+_0x4721a5(0x247));if(!_0x5f0728)return console[_0x4721a5(0x258)](a4_0x1140fa[_0x4721a5(0x1ea)](_0x4721a5(0x1e8)),_0x4721a5(0x228)),0x1;}const {data:_0x2dffa1}=await withSpinner(_0x4721a5(0x1f0),()=>_0x4194e8['llm'][_0x4721a5(0x225)](_0x596d24,{'force':_0x4a61ad})),_0x30ea2c=_0x2dffa1[_0x4721a5(0x1cf)]['agents']['errors']>0x0||_0x2dffa1[_0x4721a5(0x1cf)][_0x4721a5(0x269)]['errors']>0x0||_0x2dffa1[_0x4721a5(0x1cf)][_0x4721a5(0x224)][_0x4721a5(0x1e1)]>0x0||_0x2dffa1[_0x4721a5(0x1cf)]['prompts'][_0x4721a5(0x1e1)]>0x0||_0x2dffa1['counts'][_0x4721a5(0x21e)][_0x4721a5(0x1e1)]>0x0||_0x2dffa1[_0x4721a5(0x1cf)][_0x4721a5(0x25f)][_0x4721a5(0x1e1)]>0x0;if(_0x30ea2c){console['log'](a4_0x1140fa[_0x4721a5(0x1ea)](_0x4721a5(0x201))),console[_0x4721a5(0x258)](),console['log'](a4_0x1140fa[_0x4721a5(0x23a)](_0x4721a5(0x1b3)));for(const _0x1d0ec9 of _0x2dffa1[_0x4721a5(0x234)]){_0x1d0ec9[_0x4721a5(0x24d)]===_0x4721a5(0x262)&&console[_0x4721a5(0x258)](a4_0x1140fa[_0x4721a5(0x23a)]('\x20\x20Agent\x20\x22'+_0x1d0ec9['agentName']+'\x22:\x20'+_0x1d0ec9['error']));}for(const _0x1783ee of _0x2dffa1[_0x4721a5(0x269)]){_0x1783ee['action']==='error'&&console[_0x4721a5(0x258)](a4_0x1140fa['red'](_0x4721a5(0x250)+_0x1783ee[_0x4721a5(0x1c1)]+'\x22:\x20'+_0x1783ee[_0x4721a5(0x262)]));}for(const _0x16c63e of _0x2dffa1[_0x4721a5(0x224)]){_0x16c63e[_0x4721a5(0x24d)]===_0x4721a5(0x262)&&console[_0x4721a5(0x258)](a4_0x1140fa[_0x4721a5(0x23a)](_0x4721a5(0x1fb)+_0x16c63e['name']+_0x4721a5(0x261)+_0x16c63e['error']));}for(const _0x2c3efe of _0x2dffa1[_0x4721a5(0x246)]){_0x2c3efe[_0x4721a5(0x24d)]===_0x4721a5(0x262)&&console[_0x4721a5(0x258)](a4_0x1140fa['red'](_0x4721a5(0x235)+_0x2c3efe[_0x4721a5(0x1c1)]+_0x4721a5(0x261)+_0x2c3efe[_0x4721a5(0x262)]));}for(const _0x391deb of _0x2dffa1[_0x4721a5(0x22f)]){_0x391deb[_0x4721a5(0x24d)]===_0x4721a5(0x262)&&console[_0x4721a5(0x258)](a4_0x1140fa[_0x4721a5(0x23a)]('\x20\x20Integration\x20\x22'+_0x391deb[_0x4721a5(0x1c1)]+_0x4721a5(0x261)+_0x391deb[_0x4721a5(0x262)]));}for(const _0x5b51cf of _0x2dffa1[_0x4721a5(0x21e)]){_0x5b51cf[_0x4721a5(0x24d)]===_0x4721a5(0x262)&&console['log'](a4_0x1140fa[_0x4721a5(0x23a)](_0x4721a5(0x215)+_0x5b51cf[_0x4721a5(0x1c1)]+'\x22:\x20'+_0x5b51cf['error']));}for(const _0xb3c309 of _0x2dffa1[_0x4721a5(0x25f)]){_0xb3c309[_0x4721a5(0x24d)]===_0x4721a5(0x262)&&console['log'](a4_0x1140fa[_0x4721a5(0x23a)](_0x4721a5(0x1e5)+_0xb3c309[_0x4721a5(0x1c1)]+_0x4721a5(0x261)+_0xb3c309[_0x4721a5(0x262)]));}return 0x1;}console[_0x4721a5(0x258)](a4_0x1140fa['green']('\x0a✔\x20Pushed\x20'+(_0x589ef1+_0x3e6eb6)+_0x4721a5(0x209)+_0x2dffa1['projectName']+'\x27'));const _0x570616=getLLMProjectUrl(_0x2206a6,_0x2dffa1['projectId']);return console[_0x4721a5(0x258)](_0x4721a5(0x1d7)+a4_0x1140fa[_0x4721a5(0x1cb)](_0x570616)),0x0;}}function a4_0x30a1(){const _0xc11550=['-\x20nothing\x20pushed','2506YfTIxw','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','experimentalArtifacts','newProjectId','\x20files\x20to\x20','total','integrations','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','\x0aPull\x20summary\x20for\x20\x27','23492IUUgsw','1118132yFYgNW','agents','\x20\x20Prompt\x20\x22','found','INVALID_ARGUMENT','llm_project','pullAgent','red','llm','\x20\x20Agents:\x20','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','\x0aChanges:','Would\x20push\x20agent:\x20','agent:pull','dirname','utf-8','session','cwd-config','Clone\x20\x22','prompts','\x20resources?','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','parse','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20--agent\x20<name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20context\x20project','Agent:\x20','action','green','Project\x20cloned\x20with\x20errors','\x20\x20Knowledge\x20Base\x20\x22','Status:\x20','force','\x0aPush\x20summary\x20for\x20\x27','\x20updated','No\x20tdx.json\x20found\x20in\x20','1638iKGhoX','Pushing\x20agent\x20from\x20\x22','log','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','2736AZKIOn','newProjectName','Cannot\x20clone\x20from\x20context\x20project\x20\x22','outputPath','<new-name>','chatInterfaces','55fuYFpA','\x22:\x20','error','\x20\x20Integration\x20\x22','\x0a✔\x20Pulled\x20','\x20\x20Knowledge\x20Bases:\x20','-\x20no\x20files\x20written','projectName','experimentalKnowledgeBases','knowledgeBases','no_local_folder','Using\x20context\x20project:\x20','projectDir','\x20\x20Chat\x20Interfaces:\x20','Errors:','gray','outputDir','Cloning\x20\x22','description','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','\x22\x20to\x20new\x20project\x20\x22','New\x20project:\x20','cloneProject','\x20--profile\x20','9LnktSE','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','output','name','repeat','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','Pulling\x20agent\x20\x22','1712150JvawWj','\x20unchanged','Dry\x20run\x20-\x20no\x20changes\x20made','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','pullProject','\x20changed','cyan','Analyzing\x20changes\x20to\x20push...','profile','tdx.json','counts','\x20created','MISSING_ARGUMENT','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','✔\x20Context\x20set:\x20','new','\x20\x20Agent\x20\x22','llmProject','Project:\x20','Using\x20project:\x20','\x20\x20Source:\x20','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','\x20\x20Form\x20Interfaces:\x20','dryRun','isNew','\x20\x20Text\x20Knowledge\x20Bases:\x20','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','36736535hRyKhu','errors','\x20successfully','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','\x27\x20to\x20create\x20the\x20folder\x20structure.','\x20\x20Chat\x20Interface\x20\x22','New\x20project\x20ID:\x20','Source:\x20','Cancelled','diff','yellow','\x20\x20Target:\x20','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','Using\x20local\x20project:\x20','\x20\x20Experimental\x20Artifact\x20\x22','10141752TVMOTI','Pushing\x20to\x20project...','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)','\x22...','\x20\x20Experimental\x20Artifacts:\x20','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','\x20\x20Prompts:\x20','\x0aChanges\x20to\x20chat\x20interface\x20\x27','\x20files?','execute','Summary:','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','\x20\x20Text\x20Knowledge\x20Base\x20\x22','\x20|\x20','\x20\x20Integrations:\x20','Output\x20path:\x20','created','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','\x0aProject\x20pushed\x20with\x20errors','join','\x22\x20to\x20\x22','\x0aPush\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\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','sourceProjectName','Agent\x20','\x20resources\x20to\x20\x27','Would\x20pull\x20agent:\x20','agent.yml','push','agentName','cwd','yes','\x20errors','\x0aError:','300972LXbHqd','agentId','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','\x20\x20Form\x20Interface\x20\x22','dim','context','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','site','Output:\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)','Agent\x20pulled\x20successfully','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','formInterfaces','\x20new','projectId','\x20=\x20','\x20\x20tdx\x20agent\x20pull\x20','hasChanges','textKnowledgeBases','pushProject','unchanged','updated'];a4_0x30a1=function(){return _0xc11550;};return a4_0x30a1();}
1
+ const a4_0x1484db=a4_0x56ef;(function(_0x190b47,_0x56808f){const _0x3e0f6d=a4_0x56ef,_0x3c547a=_0x190b47();while(!![]){try{const _0x560f0f=parseInt(_0x3e0f6d(0x13b))/0x1*(parseInt(_0x3e0f6d(0xe2))/0x2)+-parseInt(_0x3e0f6d(0xee))/0x3*(parseInt(_0x3e0f6d(0x12c))/0x4)+parseInt(_0x3e0f6d(0x14a))/0x5+-parseInt(_0x3e0f6d(0xe0))/0x6*(parseInt(_0x3e0f6d(0xd1))/0x7)+parseInt(_0x3e0f6d(0xdf))/0x8*(parseInt(_0x3e0f6d(0x115))/0x9)+-parseInt(_0x3e0f6d(0x11b))/0xa+parseInt(_0x3e0f6d(0xd4))/0xb;if(_0x560f0f===_0x56808f)break;else _0x3c547a['push'](_0x3c547a['shift']());}catch(_0x35730c){_0x3c547a['push'](_0x3c547a['shift']());}}}(a4_0x25c4,0xa3247));import a4_0x34bb3b from'chalk';import a4_0x1764f5 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(_0x334616){const _0xa7d05b=a4_0x56ef,_0x34dc5d=[];if(_0x334616[_0xa7d05b(0xab)]!==undefined)_0x34dc5d['push'](_0x334616[_0xa7d05b(0xab)]+_0xa7d05b(0x154));if(_0x334616[_0xa7d05b(0xe7)]!==undefined&&_0x334616['new']>0x0)_0x34dc5d[_0xa7d05b(0x13a)](a4_0x34bb3b[_0xa7d05b(0x165)](_0x334616[_0xa7d05b(0xe7)]+_0xa7d05b(0x163)));if(_0x334616[_0xa7d05b(0x145)]!==undefined&&_0x334616[_0xa7d05b(0x145)]>0x0)_0x34dc5d[_0xa7d05b(0x13a)](a4_0x34bb3b['green'](_0x334616[_0xa7d05b(0x145)]+'\x20created'));if(_0x334616[_0xa7d05b(0xe8)]!==undefined&&_0x334616['updated']>0x0)_0x34dc5d[_0xa7d05b(0x13a)](a4_0x34bb3b[_0xa7d05b(0xb6)](_0x334616['updated']+_0xa7d05b(0xb3)));if(_0x334616['unchanged']!==undefined&&_0x334616[_0xa7d05b(0x112)]>0x0)_0x34dc5d[_0xa7d05b(0x13a)](a4_0x34bb3b['gray'](_0x334616[_0xa7d05b(0x112)]+_0xa7d05b(0x15c)));if(_0x334616[_0xa7d05b(0xe1)]!==undefined&&_0x334616[_0xa7d05b(0xe1)]>0x0)_0x34dc5d[_0xa7d05b(0x13a)](a4_0x34bb3b[_0xa7d05b(0xed)](_0x334616[_0xa7d05b(0xe1)]+_0xa7d05b(0x137)));return _0x34dc5d[_0xa7d05b(0xef)](',\x20');}function displayDiffs(_0xaa79f7,_0x4dc64c,_0x3e5de0,_0x52ce89,_0x1de8ff,_0x41f6f9,_0x18b7b1,_0x4e95be,_0x3bf32c){const _0x5a7631=a4_0x56ef;for(const _0x4b2ab8 of _0xaa79f7){if(_0x4b2ab8[_0x5a7631(0xac)]){const _0x21148d=_0x4b2ab8[_0x5a7631(0x120)]||_0x4b2ab8[_0x5a7631(0x12b)];console[_0x5a7631(0xf1)]('\x0aChanges\x20to\x20agent\x20\x27'+_0x21148d+'\x27:'),console[_0x5a7631(0xf1)]('─'[_0x5a7631(0xd5)](0x3c)),console[_0x5a7631(0xf1)](_0x4b2ab8['diff']),console[_0x5a7631(0xf1)]('─'[_0x5a7631(0xd5)](0x3c));}}for(const _0x51b233 of _0x4dc64c){_0x51b233[_0x5a7631(0xac)]&&(console[_0x5a7631(0xf1)](_0x5a7631(0xbc)+_0x51b233['name']+'\x27:'),console[_0x5a7631(0xf1)]('─'[_0x5a7631(0xd5)](0x3c)),console[_0x5a7631(0xf1)](_0x51b233[_0x5a7631(0xac)]),console[_0x5a7631(0xf1)]('─'[_0x5a7631(0xd5)](0x3c)));}for(const _0xfc40ec of _0x3e5de0){_0xfc40ec[_0x5a7631(0xac)]&&(console['log'](_0x5a7631(0x108)+_0xfc40ec[_0x5a7631(0x12b)]+'\x27:'),console[_0x5a7631(0xf1)]('─'[_0x5a7631(0xd5)](0x3c)),console['log'](_0xfc40ec[_0x5a7631(0xac)]),console[_0x5a7631(0xf1)]('─'[_0x5a7631(0xd5)](0x3c)));}for(const _0x2d37aa of _0x52ce89){_0x2d37aa[_0x5a7631(0xac)]&&(console[_0x5a7631(0xf1)](_0x5a7631(0xb1)+_0x2d37aa['name']+'\x27:'),console[_0x5a7631(0xf1)]('─'[_0x5a7631(0xd5)](0x3c)),console[_0x5a7631(0xf1)](_0x2d37aa['diff']),console[_0x5a7631(0xf1)]('─'[_0x5a7631(0xd5)](0x3c)));}for(const _0x367f44 of _0x1de8ff){_0x367f44['diff']&&(console[_0x5a7631(0xf1)]('\x0aChanges\x20to\x20integration\x20\x27'+_0x367f44[_0x5a7631(0x12b)]+'\x27:'),console[_0x5a7631(0xf1)]('─'[_0x5a7631(0xd5)](0x3c)),console[_0x5a7631(0xf1)](_0x367f44['diff']),console[_0x5a7631(0xf1)]('─'[_0x5a7631(0xd5)](0x3c)));}for(const _0x49321c of _0x41f6f9){_0x49321c[_0x5a7631(0xac)]&&(console[_0x5a7631(0xf1)](_0x5a7631(0xa8)+_0x49321c[_0x5a7631(0x12b)]+'\x27:'),console[_0x5a7631(0xf1)]('─'[_0x5a7631(0xd5)](0x3c)),console[_0x5a7631(0xf1)](_0x49321c[_0x5a7631(0xac)]),console[_0x5a7631(0xf1)]('─'[_0x5a7631(0xd5)](0x3c)));}for(const _0x1ca237 of _0x18b7b1){_0x1ca237[_0x5a7631(0xac)]&&(console[_0x5a7631(0xf1)](_0x5a7631(0x136)+_0x1ca237[_0x5a7631(0x12b)]+'\x27:'),console[_0x5a7631(0xf1)]('─'[_0x5a7631(0xd5)](0x3c)),console[_0x5a7631(0xf1)](_0x1ca237[_0x5a7631(0xac)]),console[_0x5a7631(0xf1)]('─'[_0x5a7631(0xd5)](0x3c)));}for(const _0x2f99db of _0x4e95be){_0x2f99db['diff']&&(console[_0x5a7631(0xf1)](_0x5a7631(0x149)+_0x2f99db['name']+'\x27:'),console[_0x5a7631(0xf1)]('─'['repeat'](0x3c)),console[_0x5a7631(0xf1)](_0x2f99db[_0x5a7631(0xac)]),console[_0x5a7631(0xf1)]('─'[_0x5a7631(0xd5)](0x3c)));}for(const _0xe3d0a2 of _0x3bf32c){_0xe3d0a2[_0x5a7631(0xac)]&&(console['log'](_0x5a7631(0x138)+_0xe3d0a2[_0x5a7631(0x12b)]+'\x27:'),console[_0x5a7631(0xf1)]('─'[_0x5a7631(0xd5)](0x3c)),console[_0x5a7631(0xf1)](_0xe3d0a2[_0x5a7631(0xac)]),console['log']('─'[_0x5a7631(0xd5)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x1484db(0x12b)]=a4_0x1484db(0x13e);[a4_0x1484db(0xc6)]=a4_0x1484db(0xc8);async[a4_0x1484db(0x100)](_0x5c6804){const _0x37fc06=a4_0x1484db,{options:_0x4a5dc3,args:_0x12880a,tdx:_0x303ef5}=_0x5c6804,_0x204a5f=_0x12880a[0x0],_0xa6fd17=_0x12880a[0x1],_0x21f7ce=_0x4a5dc3['output'],_0x39c16d=_0x4a5dc3['dryRun'],_0x39688f=_0x4a5dc3[_0x37fc06(0x144)],_0x2705d7=_0x4a5dc3[_0x37fc06(0xb2)],_0xc33837=_0x4a5dc3[_0x37fc06(0xec)],_0x39a3e7=_0x4a5dc3[_0x37fc06(0xff)];let _0x525fde;if(_0x204a5f){const _0x3773df=a4_0x1764f5[_0x37fc06(0xef)](_0x204a5f,_0x37fc06(0x117));if(existsSync(_0x3773df))try{const _0x5069b0=JSON[_0x37fc06(0x14c)](readFileSync(_0x3773df,_0x37fc06(0xfb)));_0x5069b0[_0x37fc06(0x106)]&&(_0x525fde={'llm_project':_0x5069b0[_0x37fc06(0x106)]});}catch{}}const _0x40b12a=findAgentConfigPath(process[_0x37fc06(0xaa)]());let _0x261888;if(_0x40b12a)try{const _0x55d3ee=JSON['parse'](readFileSync(_0x40b12a,_0x37fc06(0xfb)));_0x55d3ee['llm_project']&&(_0x261888={'llm_project':_0x55d3ee[_0x37fc06(0x106)]});}catch{}const _0x71c90=resolveAgentPullArgs({'arg':_0x204a5f,'agentNameArg':_0xa6fd17,'agentFlag':_0x39a3e7,'contextProject':_0xc33837,'argDirConfig':_0x525fde,'cwdConfigPath':_0x40b12a||undefined,'cwdConfig':_0x261888}),{projectNameOrId:_0x2c7871,targetAgentName:_0x45477a,existingOutputDir:_0x1746f8,source:_0x3262ef}=_0x71c90;if(_0x3262ef===_0x37fc06(0x11a))console[_0x37fc06(0xf1)](a4_0x34bb3b[_0x37fc06(0x11e)](_0x37fc06(0xc9)+a4_0x1764f5['join'](_0x204a5f,_0x37fc06(0x117))+':\x20'+_0x2c7871));else{if(_0x3262ef==='cwd-config')console[_0x37fc06(0xf1)](a4_0x34bb3b[_0x37fc06(0x11e)](_0x37fc06(0x140)+_0x2c7871));else _0x3262ef==='context'&&console['log'](a4_0x34bb3b[_0x37fc06(0x11e)](_0x37fc06(0x143)+_0x2c7871));}if(!_0x2c7871)return _0x39a3e7?(console['log'](a4_0x34bb3b[_0x37fc06(0xb6)](_0x37fc06(0x134))),console['log'](_0x37fc06(0xde)),console[_0x37fc06(0xf1)](_0x37fc06(0xd7))):(console[_0x37fc06(0xf1)](a4_0x34bb3b[_0x37fc06(0xb6)]('llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a')),console[_0x37fc06(0xf1)](_0x37fc06(0xcf)),console['log'](_0x37fc06(0xc2)),console[_0x37fc06(0xf1)](_0x37fc06(0x139)),console[_0x37fc06(0xf1)](_0x37fc06(0x153)),console[_0x37fc06(0xf1)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20project')),0x1;if(_0x45477a){const {data:_0x42b9a8}=await withSpinner(_0x37fc06(0xa9)+_0x45477a+_0x37fc06(0xf3)+_0x2c7871+_0x37fc06(0xfe),()=>_0x303ef5['llm'][_0x37fc06(0xe3)](_0x2c7871,_0x45477a,_0x21f7ce,{'dryRun':_0x39c16d,'force':_0x39688f}));if(_0x39c16d)return console[_0x37fc06(0xf1)](a4_0x34bb3b[_0x37fc06(0xb6)](_0x37fc06(0x105))),console['log'](_0x37fc06(0x122)+_0x42b9a8[_0x37fc06(0x120)]),console[_0x37fc06(0xf1)]('Output\x20path:\x20'+_0x42b9a8[_0x37fc06(0xbf)]),_0x42b9a8[_0x37fc06(0xac)]&&(console[_0x37fc06(0xf1)](_0x37fc06(0xd3)),console[_0x37fc06(0xf1)]('─'[_0x37fc06(0xd5)](0x3c)),console['log'](_0x42b9a8[_0x37fc06(0xac)]),console[_0x37fc06(0xf1)]('─'[_0x37fc06(0xd5)](0x3c))),0x0;return console[_0x37fc06(0xf1)](a4_0x34bb3b['green'](_0x37fc06(0x103))),console['log']('Agent:\x20'+_0x42b9a8['agentName']),console[_0x37fc06(0xf1)](_0x37fc06(0xad)+_0x42b9a8['outputPath']),console['log'](_0x37fc06(0x161)+(_0x42b9a8[_0x37fc06(0xe9)]?a4_0x34bb3b['green'](_0x37fc06(0xe7)):_0x42b9a8[_0x37fc06(0x14e)]?a4_0x34bb3b[_0x37fc06(0xb6)](_0x37fc06(0xe8)):a4_0x34bb3b[_0x37fc06(0xbe)](_0x37fc06(0x112)))),0x0;}const _0x1bca85=_0x1746f8||_0x21f7ce,{data:_0x22b7c1}=await withSpinner(_0x37fc06(0x119)+_0x2c7871+_0x37fc06(0xfe),()=>_0x303ef5[_0x37fc06(0xf4)][_0x37fc06(0xbb)](_0x2c7871,_0x1bca85,{'dryRun':!![]})),_0x49bb6a=_0x22b7c1['counts']['agents'][_0x37fc06(0xe7)]+_0x22b7c1[_0x37fc06(0xf2)][_0x37fc06(0x114)][_0x37fc06(0xe7)]+_0x22b7c1[_0x37fc06(0xf2)]['textKnowledgeBases'][_0x37fc06(0xe7)]+_0x22b7c1[_0x37fc06(0xf2)][_0x37fc06(0x13f)][_0x37fc06(0xe7)]+_0x22b7c1['counts'][_0x37fc06(0x146)][_0x37fc06(0xe7)]+_0x22b7c1[_0x37fc06(0xf2)][_0x37fc06(0xf9)][_0x37fc06(0xe7)]+_0x22b7c1[_0x37fc06(0xf2)][_0x37fc06(0x128)][_0x37fc06(0xe7)]+_0x22b7c1[_0x37fc06(0xf2)][_0x37fc06(0xc1)]['new']+_0x22b7c1[_0x37fc06(0xf2)]['chatInterfaces'][_0x37fc06(0xe7)],_0x2c2fc3=_0x22b7c1[_0x37fc06(0xf2)][_0x37fc06(0x10a)]['updated']+_0x22b7c1[_0x37fc06(0xf2)][_0x37fc06(0x114)][_0x37fc06(0xe8)]+_0x22b7c1[_0x37fc06(0xf2)][_0x37fc06(0x101)][_0x37fc06(0xe8)]+_0x22b7c1[_0x37fc06(0xf2)]['prompts'][_0x37fc06(0xe8)]+_0x22b7c1[_0x37fc06(0xf2)][_0x37fc06(0x146)][_0x37fc06(0xe8)]+_0x22b7c1[_0x37fc06(0xf2)]['experimentalKnowledgeBases'][_0x37fc06(0xe8)]+_0x22b7c1[_0x37fc06(0xf2)][_0x37fc06(0x128)][_0x37fc06(0xe8)]+_0x22b7c1[_0x37fc06(0xf2)][_0x37fc06(0xc1)][_0x37fc06(0xe8)]+_0x22b7c1['counts'][_0x37fc06(0x11c)][_0x37fc06(0xe8)],_0x43b647=_0x22b7c1['counts'][_0x37fc06(0x10a)][_0x37fc06(0x112)]+_0x22b7c1[_0x37fc06(0xf2)][_0x37fc06(0x114)][_0x37fc06(0x112)]+_0x22b7c1[_0x37fc06(0xf2)][_0x37fc06(0x101)][_0x37fc06(0x112)]+_0x22b7c1[_0x37fc06(0xf2)][_0x37fc06(0x13f)][_0x37fc06(0x112)]+_0x22b7c1[_0x37fc06(0xf2)][_0x37fc06(0x146)][_0x37fc06(0x112)]+_0x22b7c1[_0x37fc06(0xf2)][_0x37fc06(0xf9)][_0x37fc06(0x112)]+_0x22b7c1[_0x37fc06(0xf2)][_0x37fc06(0x128)][_0x37fc06(0x112)]+_0x22b7c1[_0x37fc06(0xf2)]['formInterfaces'][_0x37fc06(0x112)]+_0x22b7c1[_0x37fc06(0xf2)]['chatInterfaces'][_0x37fc06(0x112)];console[_0x37fc06(0xf1)]('\x0aPull\x20summary\x20for\x20\x27'+_0x22b7c1[_0x37fc06(0xc4)]+'\x27:'),console[_0x37fc06(0xf1)]('\x20\x20'+a4_0x34bb3b['green']('+\x20'+_0x49bb6a+_0x37fc06(0x163))+_0x37fc06(0xe6)+a4_0x34bb3b[_0x37fc06(0xb6)]('~\x20'+_0x2c2fc3+_0x37fc06(0x110))+_0x37fc06(0xe6)+a4_0x34bb3b['dim']('=\x20'+_0x43b647+_0x37fc06(0x15c))),console['log'](_0x37fc06(0xb5)+formatCountSummary(_0x22b7c1['counts'][_0x37fc06(0x10a)])),console[_0x37fc06(0xf1)](_0x37fc06(0x164)+formatCountSummary(_0x22b7c1[_0x37fc06(0xf2)]['knowledgeBases'])),console['log']('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x22b7c1[_0x37fc06(0xf2)]['textKnowledgeBases'])),console['log']('\x20\x20Prompts:\x20'+formatCountSummary(_0x22b7c1[_0x37fc06(0xf2)][_0x37fc06(0x13f)])),console[_0x37fc06(0xf1)](_0x37fc06(0x10c)+formatCountSummary(_0x22b7c1[_0x37fc06(0xf2)][_0x37fc06(0x146)])),console['log']('\x20\x20Form\x20Interfaces:\x20'+formatCountSummary(_0x22b7c1[_0x37fc06(0xf2)][_0x37fc06(0xc1)])),console[_0x37fc06(0xf1)](_0x37fc06(0x168)+formatCountSummary(_0x22b7c1[_0x37fc06(0xf2)]['chatInterfaces']));const _0x1bd7fe=_0x22b7c1[_0x37fc06(0xf2)][_0x37fc06(0xf9)][_0x37fc06(0xab)]>0x0||_0x22b7c1[_0x37fc06(0xf2)]['experimentalArtifacts'][_0x37fc06(0xab)]>0x0;_0x1bd7fe&&(console['log'](_0x37fc06(0x102)+formatCountSummary(_0x22b7c1['counts'][_0x37fc06(0xf9)])),console[_0x37fc06(0xf1)](_0x37fc06(0x141)+formatCountSummary(_0x22b7c1[_0x37fc06(0xf2)]['experimentalArtifacts'])));console[_0x37fc06(0xf1)]('\x20\x20Target:\x20'+a4_0x34bb3b['cyan'](_0x22b7c1[_0x37fc06(0xcd)])),displayDiffs(_0x22b7c1[_0x37fc06(0x10a)],_0x22b7c1[_0x37fc06(0x114)],_0x22b7c1['textKnowledgeBases'],_0x22b7c1[_0x37fc06(0x13f)],_0x22b7c1[_0x37fc06(0x146)],_0x22b7c1[_0x37fc06(0xf9)],_0x22b7c1[_0x37fc06(0x128)],_0x22b7c1['formInterfaces'],_0x22b7c1[_0x37fc06(0x11c)]);if(_0x39c16d)return console[_0x37fc06(0xf1)](a4_0x34bb3b[_0x37fc06(0xb6)](_0x37fc06(0x152))),0x0;if(_0x49bb6a===0x0&&_0x2c2fc3===0x0)return console[_0x37fc06(0xf1)](a4_0x34bb3b[_0x37fc06(0x165)](_0x37fc06(0xd8))),saveSessionContext({'llm_project':_0x22b7c1[_0x37fc06(0xc4)]},_0x4a5dc3[_0x37fc06(0xb7)]),console[_0x37fc06(0xf1)](a4_0x34bb3b[_0x37fc06(0x165)](_0x37fc06(0xbd)+a4_0x34bb3b['dim']('llm_project')+'\x20=\x20'+a4_0x34bb3b[_0x37fc06(0xf8)](_0x22b7c1['projectName']))),0x0;if(!_0x2705d7&&!_0x39688f){if(!isInteractive())return console[_0x37fc06(0x10f)](a4_0x34bb3b[_0x37fc06(0xed)](_0x37fc06(0x12f)),_0x37fc06(0xc3)),console[_0x37fc06(0x10f)](a4_0x34bb3b[_0x37fc06(0x11e)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x1e308e=await confirmKey(_0x37fc06(0xe5)+(_0x49bb6a+_0x2c2fc3)+_0x37fc06(0x15d));if(!_0x1e308e)return console[_0x37fc06(0xf1)](a4_0x34bb3b[_0x37fc06(0xb6)](_0x37fc06(0xce)),'-\x20no\x20files\x20written'),0x1;}const {data:_0x1dc52c}=await withSpinner(_0x37fc06(0x107),()=>_0x303ef5[_0x37fc06(0xf4)]['pullProject'](_0x2c7871,_0x1bca85,{'force':_0x39688f}));return console[_0x37fc06(0xf1)](a4_0x34bb3b[_0x37fc06(0x165)](_0x37fc06(0x13d)+(_0x49bb6a+_0x2c2fc3)+_0x37fc06(0xb4)+_0x1dc52c[_0x37fc06(0xcd)])),saveSessionContext({'llm_project':_0x1dc52c['projectName']},_0x4a5dc3['session']),console['log'](a4_0x34bb3b['green'](_0x37fc06(0xbd)+a4_0x34bb3b[_0x37fc06(0x11e)](_0x37fc06(0x106))+_0x37fc06(0xf7)+a4_0x34bb3b[_0x37fc06(0xf8)](_0x1dc52c[_0x37fc06(0xc4)]))),0x0;}}function a4_0x56ef(_0x23bff5,_0x390237){_0x23bff5=_0x23bff5-0xa8;const _0x25c493=a4_0x25c4();let _0x56ef28=_0x25c493[_0x23bff5];return _0x56ef28;}export class AgentCloneCommand extends BaseCommand{['name']=a4_0x1484db(0x15b);[a4_0x1484db(0xc6)]='Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project';async[a4_0x1484db(0x100)](_0xcdab12){const _0x2162be=a4_0x1484db,{options:_0x545184,args:_0x55938b,tdx:_0x40801c}=_0xcdab12,_0x179cca=_0x55938b[0x0],_0x447e1e=_0x545184[_0x2162be(0x12b)],_0xb6955=_0x545184[_0x2162be(0xc5)],_0x44c640=_0x545184['yes'],_0x4c3345=_0x545184[_0x2162be(0x14f)],_0x4ffc4a=_0x545184[_0x2162be(0xec)];let _0x8b025f;const _0x3e2fe7=findAgentConfigPath(process[_0x2162be(0xaa)]());if(_0x179cca){const _0x4c2ab3=a4_0x1764f5[_0x2162be(0xef)](_0x179cca,_0x2162be(0x117));existsSync(_0x4c2ab3)?(_0x8b025f=_0x179cca,console['log'](a4_0x34bb3b[_0x2162be(0x11e)](_0x2162be(0x148)+_0x179cca))):_0x8b025f=_0x179cca;}else{if(_0x3e2fe7)_0x8b025f=a4_0x1764f5[_0x2162be(0xcc)](_0x3e2fe7),console[_0x2162be(0xf1)](a4_0x34bb3b[_0x2162be(0x11e)](_0x2162be(0x12d)+_0x8b025f));else{if(_0x4ffc4a){const _0x4b7995=sanitizeForFilesystem(_0x4ffc4a);let _0x225c04=_0x4b7995,_0x30f558=a4_0x1764f5[_0x2162be(0xef)](process[_0x2162be(0xaa)](),_0x2162be(0x10a),_0x4b7995,_0x2162be(0x117));if(!existsSync(_0x30f558)){const _0x4d4305=normalizeName(_0x4ffc4a),_0x3df9ee=a4_0x1764f5['join'](process[_0x2162be(0xaa)](),'agents',_0x4d4305,'tdx.json');existsSync(_0x3df9ee)&&(_0x225c04=_0x4d4305,_0x30f558=_0x3df9ee);}if(existsSync(_0x30f558))_0x8b025f=a4_0x1764f5['dirname'](_0x30f558),console['log'](a4_0x34bb3b['dim']('Using\x20local\x20project:\x20'+_0x8b025f));else{const _0x29597b=_0x545184['profile'];if(_0x29597b)throw new SDKError(ErrorCode[_0x2162be(0xdc)],'Cannot\x20clone\x20from\x20context\x20project\x20\x22'+_0x4ffc4a+_0x2162be(0x167),undefined,{'helpText':_0x2162be(0x14b)+_0x2162be(0xdb)+(_0x2162be(0xd0)+_0x4ffc4a+'\x0a')+('\x20\x20tdx\x20agent\x20clone\x20agents/'+_0x225c04+_0x2162be(0xda)+(_0x447e1e||_0x2162be(0x142))+_0x2162be(0x130)+_0x29597b)});_0x8b025f=_0x4ffc4a,console[_0x2162be(0xf1)](a4_0x34bb3b[_0x2162be(0x11e)](_0x2162be(0xd6)+_0x4ffc4a));}}}}if(!_0x8b025f)return console[_0x2162be(0xf1)](a4_0x34bb3b[_0x2162be(0xb6)](_0x2162be(0x160))),console['log'](_0x2162be(0x129)),console[_0x2162be(0xf1)](_0x2162be(0xc0)),console[_0x2162be(0xf1)](_0x2162be(0xd2)),console['log']('\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>'),0x1;if(!_0x447e1e)throw new SDKError(ErrorCode['MISSING_ARGUMENT'],_0x2162be(0xfa),undefined,{'helpText':_0x2162be(0xdd)});if(!_0x44c640&&!_0xb6955){if(!isInteractive())return console[_0x2162be(0x10f)](a4_0x34bb3b[_0x2162be(0xed)]('\x0aError:'),_0x2162be(0xc3)),console[_0x2162be(0x10f)](a4_0x34bb3b['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x2162f8=await confirmKey('Clone\x20\x22'+_0x8b025f+_0x2162be(0xc7)+_0x447e1e+'\x22?');if(!_0x2162f8)return console[_0x2162be(0xf1)](a4_0x34bb3b[_0x2162be(0xb6)]('Cancelled')),0x1;}const {data:_0x2c506d}=await withSpinner(_0x2162be(0x124)+_0x8b025f+_0x2162be(0x12a)+_0x447e1e+_0x2162be(0xfe),()=>_0x40801c['llm']['cloneProject'](_0x8b025f,_0x447e1e,{'dryRun':_0xb6955}));if(_0xb6955){console[_0x2162be(0xf1)](a4_0x34bb3b['yellow'](_0x2162be(0x10d))),console[_0x2162be(0xf1)](_0x2162be(0x166)+_0x2c506d[_0x2162be(0x109)]),console['log']('New\x20project:\x20'+_0x447e1e),console[_0x2162be(0xf1)]('Would\x20clone:'),console['log']('\x20\x20Agents:\x20'+_0x2c506d['counts']['agents'][_0x2162be(0x145)]),console[_0x2162be(0xf1)](_0x2162be(0x164)+_0x2c506d[_0x2162be(0xf2)]['knowledgeBases'][_0x2162be(0x145)]),console[_0x2162be(0xf1)](_0x2162be(0x158)+_0x2c506d[_0x2162be(0xf2)][_0x2162be(0x13f)]['created']),console['log']('\x20\x20Form\x20Interfaces:\x20'+_0x2c506d['counts'][_0x2162be(0xc1)][_0x2162be(0x145)]),console['log'](_0x2162be(0x168)+_0x2c506d[_0x2162be(0xf2)][_0x2162be(0x11c)]['created']);const _0x70bfac=_0x2c506d[_0x2162be(0xf2)][_0x2162be(0xf9)][_0x2162be(0x145)]>0x0||_0x2c506d[_0x2162be(0xf2)][_0x2162be(0x128)][_0x2162be(0x145)]>0x0;return _0x70bfac&&(console[_0x2162be(0xf1)](_0x2162be(0x102)+_0x2c506d[_0x2162be(0xf2)]['experimentalKnowledgeBases']['created']),console[_0x2162be(0xf1)](_0x2162be(0x141)+_0x2c506d[_0x2162be(0xf2)]['experimentalArtifacts'][_0x2162be(0x145)])),0x0;}const _0x5c6a05=_0x2c506d[_0x2162be(0xf2)][_0x2162be(0x10a)][_0x2162be(0xe1)]>0x0||_0x2c506d['counts'][_0x2162be(0x114)][_0x2162be(0xe1)]>0x0||_0x2c506d[_0x2162be(0xf2)][_0x2162be(0x13f)]['errors']>0x0||_0x2c506d[_0x2162be(0xf2)]['formInterfaces']['errors']>0x0||_0x2c506d[_0x2162be(0xf2)]['chatInterfaces']['errors']>0x0||_0x2c506d['counts'][_0x2162be(0xf9)][_0x2162be(0xe1)]>0x0||_0x2c506d[_0x2162be(0xf2)][_0x2162be(0x128)]['errors']>0x0;_0x5c6a05?console[_0x2162be(0xf1)](a4_0x34bb3b['yellow'](_0x2162be(0x135))):console['log'](a4_0x34bb3b[_0x2162be(0x165)](_0x2162be(0xca)));console['log'](_0x2162be(0x166)+_0x2c506d[_0x2162be(0x109)]),console[_0x2162be(0xf1)](_0x2162be(0x111)+_0x2c506d[_0x2162be(0xf6)]),console[_0x2162be(0xf1)]('New\x20project\x20ID:\x20'+_0x2c506d['newProjectId']),console[_0x2162be(0xf1)](),console['log']('Summary:'),console[_0x2162be(0xf1)](_0x2162be(0xb5)+formatCountSummary(_0x2c506d[_0x2162be(0xf2)][_0x2162be(0x10a)])),console[_0x2162be(0xf1)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x2c506d[_0x2162be(0xf2)][_0x2162be(0x114)])),console['log'](_0x2162be(0x158)+formatCountSummary(_0x2c506d[_0x2162be(0xf2)][_0x2162be(0x13f)])),console[_0x2162be(0xf1)](_0x2162be(0x10c)+formatCountSummary(_0x2c506d[_0x2162be(0xf2)][_0x2162be(0x146)])),console[_0x2162be(0xf1)](_0x2162be(0x155)+formatCountSummary(_0x2c506d['counts'][_0x2162be(0xc1)])),console[_0x2162be(0xf1)](_0x2162be(0x168)+formatCountSummary(_0x2c506d[_0x2162be(0xf2)][_0x2162be(0x11c)]));const _0x106010=_0x2c506d[_0x2162be(0xf2)][_0x2162be(0xf9)][_0x2162be(0x145)]>0x0||_0x2c506d['counts'][_0x2162be(0xf9)]['updated']>0x0||_0x2c506d[_0x2162be(0xf2)][_0x2162be(0xf9)][_0x2162be(0x112)]>0x0||_0x2c506d['counts']['experimentalArtifacts'][_0x2162be(0x145)]>0x0||_0x2c506d[_0x2162be(0xf2)]['experimentalArtifacts'][_0x2162be(0xe8)]>0x0||_0x2c506d['counts'][_0x2162be(0x128)][_0x2162be(0x112)]>0x0;_0x106010&&(console[_0x2162be(0xf1)](_0x2162be(0x102)+formatCountSummary(_0x2c506d[_0x2162be(0xf2)][_0x2162be(0xf9)])),console[_0x2162be(0xf1)](_0x2162be(0x141)+formatCountSummary(_0x2c506d['counts'][_0x2162be(0x128)])));if(_0x5c6a05){console[_0x2162be(0xf1)](),console['log'](a4_0x34bb3b[_0x2162be(0xed)](_0x2162be(0xe4)));for(const _0x137386 of _0x2c506d[_0x2162be(0x10a)]){_0x137386['action']==='error'&&console[_0x2162be(0xf1)](a4_0x34bb3b['red'](_0x2162be(0xf0)+_0x137386[_0x2162be(0x120)]+'\x22:\x20'+_0x137386[_0x2162be(0x10f)]));}for(const _0x2b8a4d of _0x2c506d['knowledgeBases']){_0x2b8a4d[_0x2162be(0x159)]===_0x2162be(0x10f)&&console[_0x2162be(0xf1)](a4_0x34bb3b[_0x2162be(0xed)]('\x20\x20Knowledge\x20Base\x20\x22'+_0x2b8a4d[_0x2162be(0x12b)]+'\x22:\x20'+_0x2b8a4d[_0x2162be(0x10f)]));}for(const _0x3d5ee1 of _0x2c506d[_0x2162be(0x13f)]){_0x3d5ee1[_0x2162be(0x159)]===_0x2162be(0x10f)&&console[_0x2162be(0xf1)](a4_0x34bb3b[_0x2162be(0xed)](_0x2162be(0x162)+_0x3d5ee1['name']+_0x2162be(0x147)+_0x3d5ee1[_0x2162be(0x10f)]));}for(const _0x203b17 of _0x2c506d['integrations']){_0x203b17[_0x2162be(0x159)]===_0x2162be(0x10f)&&console[_0x2162be(0xf1)](a4_0x34bb3b[_0x2162be(0xed)](_0x2162be(0xfc)+_0x203b17[_0x2162be(0x12b)]+_0x2162be(0x147)+_0x203b17[_0x2162be(0x10f)]));}for(const _0x1110c6 of _0x2c506d[_0x2162be(0xc1)]){_0x1110c6[_0x2162be(0x159)]===_0x2162be(0x10f)&&console[_0x2162be(0xf1)](a4_0x34bb3b[_0x2162be(0xed)]('\x20\x20Form\x20Interface\x20\x22'+_0x1110c6['name']+_0x2162be(0x147)+_0x1110c6[_0x2162be(0x10f)]));}for(const _0x2f7cdb of _0x2c506d[_0x2162be(0x11c)]){_0x2f7cdb[_0x2162be(0x159)]===_0x2162be(0x10f)&&console[_0x2162be(0xf1)](a4_0x34bb3b['red'](_0x2162be(0xb0)+_0x2f7cdb[_0x2162be(0x12b)]+_0x2162be(0x147)+_0x2f7cdb[_0x2162be(0x10f)]));}for(const _0x1ed0b3 of _0x2c506d[_0x2162be(0xf9)]){_0x1ed0b3[_0x2162be(0x159)]===_0x2162be(0x10f)&&console[_0x2162be(0xf1)](a4_0x34bb3b[_0x2162be(0xed)](_0x2162be(0x121)+_0x1ed0b3['name']+'\x22:\x20'+_0x1ed0b3['error']));}for(const _0x4d33bb of _0x2c506d[_0x2162be(0x128)]){_0x4d33bb[_0x2162be(0x159)]==='error'&&console[_0x2162be(0xf1)](a4_0x34bb3b['red'](_0x2162be(0xd9)+_0x4d33bb[_0x2162be(0x12b)]+'\x22:\x20'+_0x4d33bb[_0x2162be(0x10f)]));}return 0x1;}console['log']();const _0x2d8192=getLLMProjectUrl(_0x4c3345,_0x2c506d['newProjectId']);return console['log'](_0x2162be(0x132)+a4_0x34bb3b['cyan'](_0x2d8192)),0x0;}}function a4_0x25c4(){const _0xeb7471=['156yQGDSm','errors','1754020SpRcyv','pullAgent','Errors:','\x0aWrite\x20','\x20|\x20','new','updated','isNew','found','Pushing\x20to\x20project...','llmProject','red','3525iNFqWs','join','\x20\x20Agent\x20\x22','log','counts','\x22\x20from\x20project\x20\x22','llm','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','newProjectName','\x20=\x20','cyan','experimentalKnowledgeBases','New\x20project\x20name\x20is\x20required','utf-8','\x20\x20Integration\x20\x22','\x20\x20Knowledge\x20Base\x20\x22','\x22...','agent','execute','textKnowledgeBases','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','Agent\x20pulled\x20successfully','projectDir','Dry\x20run\x20-\x20no\x20files\x20written','llm_project','Writing\x20files...','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','sourceProjectName','agents','message','\x20\x20Integrations:\x20','Dry\x20run\x20-\x20no\x20changes\x20made','agentId','error','\x20changed','New\x20project:\x20','unchanged','Agent\x20','knowledgeBases','181017RSGqmX','\x0aProject\x20pushed\x20with\x20errors','tdx.json','\x20\x20Text\x20Knowledge\x20Bases:\x20','Analyzing\x20project\x20\x22','arg-dir','6039910KSpoVn','chatInterfaces','no_context','dim','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','agentName','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','Would\x20pull\x20agent:\x20','Agent:\x20','Cloning\x20\x22','\x20resources?','\x20resources\x20to\x20\x27','\x20\x20Text\x20Knowledge\x20Base\x20\x22','experimentalArtifacts','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','\x22\x20to\x20\x22','name','2776AGwMHl','Using\x20current\x20project:\x20','Analyzing\x20changes\x20to\x20push...','\x0aError:','\x20--profile\x20','context','Project:\x20','pushProject','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','Project\x20cloned\x20with\x20errors','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','\x20errors','\x0aChanges\x20to\x20chat\x20interface\x20\x27','\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','push','1ScKITE','Would\x20push\x20agent:\x20','\x0a✔\x20Pulled\x20','agent:pull','prompts','Using\x20project:\x20','\x20\x20Experimental\x20Artifacts:\x20','<new-name>','Using\x20project\x20from\x20context:\x20','force','created','integrations','\x22:\x20','Using\x20local\x20project:\x20','\x0aChanges\x20to\x20form\x20interface\x20\x27','2881135URuYFH','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','parse','\x0aPush\x20summary\x20for\x20\x27','hasChanges','site','\x27\x20to\x20create\x20the\x20folder\x20structure.','Pushing\x20agent\x20from\x20\x22','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','\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','\x20total','\x20\x20Form\x20Interfaces:\x20','agent:push','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','\x20\x20Prompts:\x20','action','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','agent:clone','\x20unchanged','\x20files?','pushAgent','reason','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','Status:\x20','\x20\x20Prompt\x20\x22','\x20new','\x20\x20Knowledge\x20Bases:\x20','green','Source:\x20','\x22\x20to\x20a\x20different\x20profile','\x20\x20Chat\x20Interfaces:\x20','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','Pulling\x20agent\x20\x22','cwd','total','diff','Output:\x20','No\x20tdx.json\x20found\x20in\x20','\x20successfully','\x20\x20Chat\x20Interface\x20\x22','\x0aChanges\x20to\x20prompt\x20\x27','yes','\x20updated','\x20files\x20to\x20','\x20\x20Agents:\x20','yellow','session','\x0aPush\x20','source','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','pullProject','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','✔\x20Context\x20set:\x20','gray','outputPath','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','formInterfaces','\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','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','projectName','dryRun','description','\x22\x20to\x20new\x20project\x20\x22','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','Using\x20project\x20from\x20','Project\x20cloned\x20successfully','projectId','dirname','outputDir','Cancelled','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)','\x20\x20tdx\x20agent\x20pull\x20','275569CJpTmn','\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)','\x0aChanges:','16689046jwsiii','repeat','Using\x20context\x20project:\x20','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','\x20\x20Experimental\x20Artifact\x20\x22','\x20--name\x20','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','INVALID_ARGUMENT','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','56ltuPVo'];a4_0x25c4=function(){return _0xeb7471;};return a4_0x25c4();}export class AgentPushCommand extends BaseCommand{[a4_0x1484db(0x12b)]=a4_0x1484db(0x156);[a4_0x1484db(0xc6)]=a4_0x1484db(0x157);async[a4_0x1484db(0x100)](_0x13a563){const _0x34fe97=a4_0x1484db,{options:_0x343750,args:_0xca1f24,tdx:_0x208108}=_0x13a563;let _0x4c9ac1=_0xca1f24[0x0]||process[_0x34fe97(0xaa)]();const _0x54bfd0=_0x343750[_0x34fe97(0xc5)],_0x394d67=_0x343750[_0x34fe97(0x144)],_0x1dfd29=_0x343750[_0x34fe97(0xb2)],_0x50e31d=_0x343750[_0x34fe97(0x14f)],_0x532239=a4_0x1764f5[_0x34fe97(0xef)](_0x4c9ac1,'agent.yml'),_0x7d43ff=existsSync(_0x532239);if(_0x7d43ff){const {data:_0x339718}=await withSpinner(_0x34fe97(0x151)+_0x4c9ac1+_0x34fe97(0xfe),()=>_0x208108[_0x34fe97(0xf4)][_0x34fe97(0x15e)](_0x4c9ac1,{'dryRun':_0x54bfd0,'force':_0x394d67}));if(_0x54bfd0)return console['log'](a4_0x34bb3b[_0x34fe97(0xb6)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x34fe97(0xf1)](_0x34fe97(0x13c)+_0x339718[_0x34fe97(0x120)]),0x0;if(_0x339718[_0x34fe97(0x159)]===_0x34fe97(0x10f))return console[_0x34fe97(0xf1)](a4_0x34bb3b[_0x34fe97(0xed)]('Failed\x20to\x20push\x20agent:\x20'+_0x339718[_0x34fe97(0x10f)])),0x1;console[_0x34fe97(0xf1)](a4_0x34bb3b[_0x34fe97(0x165)](_0x34fe97(0x113)+_0x339718[_0x34fe97(0x159)]+_0x34fe97(0xaf))),console['log'](_0x34fe97(0x123)+_0x339718[_0x34fe97(0x120)]);if(_0x339718[_0x34fe97(0x10e)]&&_0x339718['projectId']){const _0x28f4db=getLLMAgentChatUrl(_0x50e31d,_0x339718['projectId'],_0x339718[_0x34fe97(0x10e)]);console[_0x34fe97(0xf1)]('Chat:\x20'+a4_0x34bb3b[_0x34fe97(0xf8)](_0x28f4db));}return 0x0;}const _0x3769d6=_0x343750[_0x34fe97(0xec)],_0x2eb0f9=resolveProjectFromContext(_0x4c9ac1,_0x3769d6);if(_0x2eb0f9[_0x34fe97(0xea)])_0x4c9ac1=_0x2eb0f9[_0x34fe97(0x104)],_0x2eb0f9[_0x34fe97(0xb9)]===_0x34fe97(0x131)&&console[_0x34fe97(0xf1)](a4_0x34bb3b[_0x34fe97(0x11e)](_0x34fe97(0x140)+_0x4c9ac1));else{let _0xfb0092=_0x34fe97(0xf5);_0x2eb0f9['reason']==='no_local_folder'&&(_0xfb0092=_0x2eb0f9['message']+_0x34fe97(0xba)+_0x2eb0f9[_0x34fe97(0xec)]+_0x34fe97(0x150));throw new SDKError(ErrorCode[_0x34fe97(0xdc)],_0x2eb0f9[_0x34fe97(0x15f)]===_0x34fe97(0x11d)?_0x2eb0f9[_0x34fe97(0x10b)]:_0x34fe97(0xae)+_0x4c9ac1,undefined,{'helpText':_0xfb0092});}const {data:_0x4ff319}=await withSpinner(_0x34fe97(0x12e),()=>_0x208108[_0x34fe97(0xf4)][_0x34fe97(0x133)](_0x4c9ac1,{'dryRun':!![]})),_0x3c225c=_0x4ff319[_0x34fe97(0xf2)]['agents'][_0x34fe97(0xe1)]>0x0;if(_0x3c225c){console[_0x34fe97(0xf1)](a4_0x34bb3b[_0x34fe97(0xed)]('\x0aErrors\x20found:'));for(const _0xddfcfc of _0x4ff319['agents']){_0xddfcfc[_0x34fe97(0x159)]==='error'&&console[_0x34fe97(0xf1)](a4_0x34bb3b[_0x34fe97(0xed)](_0x34fe97(0xf0)+_0xddfcfc[_0x34fe97(0x120)]+_0x34fe97(0x147)+_0xddfcfc[_0x34fe97(0x10f)]));}return 0x1;}const _0x14bc0b=_0x4ff319[_0x34fe97(0xf2)][_0x34fe97(0x10a)][_0x34fe97(0x145)]+_0x4ff319[_0x34fe97(0xf2)][_0x34fe97(0x114)][_0x34fe97(0x145)]+_0x4ff319[_0x34fe97(0xf2)][_0x34fe97(0x101)]['created']+_0x4ff319[_0x34fe97(0xf2)][_0x34fe97(0x13f)]['created']+_0x4ff319[_0x34fe97(0xf2)][_0x34fe97(0x146)][_0x34fe97(0x145)]+_0x4ff319[_0x34fe97(0xf2)]['experimentalKnowledgeBases'][_0x34fe97(0x145)]+_0x4ff319[_0x34fe97(0xf2)][_0x34fe97(0x128)][_0x34fe97(0x145)]+_0x4ff319['counts'][_0x34fe97(0xc1)][_0x34fe97(0x145)]+_0x4ff319[_0x34fe97(0xf2)][_0x34fe97(0x11c)]['created'],_0x22ee59=_0x4ff319['counts']['agents'][_0x34fe97(0xe8)]+_0x4ff319[_0x34fe97(0xf2)][_0x34fe97(0x114)][_0x34fe97(0xe8)]+_0x4ff319[_0x34fe97(0xf2)][_0x34fe97(0x101)][_0x34fe97(0xe8)]+_0x4ff319[_0x34fe97(0xf2)][_0x34fe97(0x13f)][_0x34fe97(0xe8)]+_0x4ff319[_0x34fe97(0xf2)][_0x34fe97(0x146)]['updated']+_0x4ff319[_0x34fe97(0xf2)][_0x34fe97(0xf9)]['updated']+_0x4ff319[_0x34fe97(0xf2)][_0x34fe97(0x128)]['updated']+_0x4ff319[_0x34fe97(0xf2)][_0x34fe97(0xc1)][_0x34fe97(0xe8)]+_0x4ff319['counts'][_0x34fe97(0x11c)][_0x34fe97(0xe8)],_0x5e2b1f=_0x4ff319['counts']['agents'][_0x34fe97(0x112)]+_0x4ff319[_0x34fe97(0xf2)][_0x34fe97(0x114)][_0x34fe97(0x112)]+_0x4ff319[_0x34fe97(0xf2)][_0x34fe97(0x101)]['unchanged']+_0x4ff319['counts'][_0x34fe97(0x13f)][_0x34fe97(0x112)]+_0x4ff319['counts'][_0x34fe97(0x146)]['unchanged']+_0x4ff319['counts'][_0x34fe97(0xf9)][_0x34fe97(0x112)]+_0x4ff319['counts'][_0x34fe97(0x128)]['unchanged']+_0x4ff319[_0x34fe97(0xf2)][_0x34fe97(0xc1)][_0x34fe97(0x112)]+_0x4ff319['counts'][_0x34fe97(0x11c)]['unchanged'];console[_0x34fe97(0xf1)](_0x34fe97(0x14d)+_0x4ff319[_0x34fe97(0xc4)]+'\x27:'),console[_0x34fe97(0xf1)]('\x20\x20'+a4_0x34bb3b['green']('+\x20'+_0x14bc0b+_0x34fe97(0x163))+_0x34fe97(0xe6)+a4_0x34bb3b['yellow']('~\x20'+_0x22ee59+_0x34fe97(0x110))+_0x34fe97(0xe6)+a4_0x34bb3b[_0x34fe97(0x11e)]('=\x20'+_0x5e2b1f+_0x34fe97(0x15c))),console[_0x34fe97(0xf1)](_0x34fe97(0xb5)+formatCountSummary(_0x4ff319[_0x34fe97(0xf2)][_0x34fe97(0x10a)])),console[_0x34fe97(0xf1)](_0x34fe97(0x164)+formatCountSummary(_0x4ff319[_0x34fe97(0xf2)][_0x34fe97(0x114)])),console['log'](_0x34fe97(0x118)+formatCountSummary(_0x4ff319[_0x34fe97(0xf2)][_0x34fe97(0x101)])),console['log'](_0x34fe97(0x158)+formatCountSummary(_0x4ff319[_0x34fe97(0xf2)][_0x34fe97(0x13f)])),console[_0x34fe97(0xf1)](_0x34fe97(0x10c)+formatCountSummary(_0x4ff319['counts'][_0x34fe97(0x146)])),console['log'](_0x34fe97(0x155)+formatCountSummary(_0x4ff319[_0x34fe97(0xf2)]['formInterfaces'])),console[_0x34fe97(0xf1)](_0x34fe97(0x168)+formatCountSummary(_0x4ff319[_0x34fe97(0xf2)][_0x34fe97(0x11c)]));const _0x2e2737=_0x4ff319[_0x34fe97(0xf2)][_0x34fe97(0xf9)][_0x34fe97(0x145)]>0x0||_0x4ff319[_0x34fe97(0xf2)][_0x34fe97(0xf9)][_0x34fe97(0xe8)]>0x0||_0x4ff319[_0x34fe97(0xf2)][_0x34fe97(0xf9)]['unchanged']>0x0||_0x4ff319[_0x34fe97(0xf2)][_0x34fe97(0x128)][_0x34fe97(0x145)]>0x0||_0x4ff319[_0x34fe97(0xf2)][_0x34fe97(0x128)][_0x34fe97(0xe8)]>0x0||_0x4ff319['counts'][_0x34fe97(0x128)]['unchanged']>0x0;_0x2e2737&&(console[_0x34fe97(0xf1)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x4ff319[_0x34fe97(0xf2)]['experimentalKnowledgeBases'])),console[_0x34fe97(0xf1)](_0x34fe97(0x141)+formatCountSummary(_0x4ff319[_0x34fe97(0xf2)]['experimentalArtifacts'])));console[_0x34fe97(0xf1)]('\x20\x20Source:\x20'+a4_0x34bb3b[_0x34fe97(0xf8)](_0x4c9ac1)),displayDiffs(_0x4ff319['agents'],_0x4ff319['knowledgeBases'],_0x4ff319[_0x34fe97(0x101)],_0x4ff319['prompts'],_0x4ff319[_0x34fe97(0x146)],_0x4ff319[_0x34fe97(0xf9)],_0x4ff319[_0x34fe97(0x128)],_0x4ff319[_0x34fe97(0xc1)],_0x4ff319[_0x34fe97(0x11c)]);if(_0x54bfd0)return console[_0x34fe97(0xf1)](a4_0x34bb3b['yellow'](_0x34fe97(0x11f))),0x0;if(_0x14bc0b===0x0&&_0x22ee59===0x0){console[_0x34fe97(0xf1)](a4_0x34bb3b[_0x34fe97(0x165)]('\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date'));const _0x2cdb90=getLLMProjectUrl(_0x50e31d,_0x4ff319[_0x34fe97(0xcb)]);return console[_0x34fe97(0xf1)](_0x34fe97(0x132)+a4_0x34bb3b[_0x34fe97(0xf8)](_0x2cdb90)),0x0;}if(!_0x1dfd29&&!_0x394d67){if(!isInteractive())return console[_0x34fe97(0x10f)](a4_0x34bb3b[_0x34fe97(0xed)](_0x34fe97(0x12f)),_0x34fe97(0xc3)),console[_0x34fe97(0x10f)](a4_0x34bb3b['dim'](_0x34fe97(0x15a))),0x1;const _0x7f9596=await confirmKey(_0x34fe97(0xb8)+(_0x14bc0b+_0x22ee59)+_0x34fe97(0x125));if(!_0x7f9596)return console['log'](a4_0x34bb3b[_0x34fe97(0xb6)](_0x34fe97(0xce)),'-\x20nothing\x20pushed'),0x1;}const {data:_0x25f29d}=await withSpinner(_0x34fe97(0xeb),()=>_0x208108[_0x34fe97(0xf4)]['pushProject'](_0x4c9ac1,{'force':_0x394d67})),_0x57144d=_0x25f29d[_0x34fe97(0xf2)][_0x34fe97(0x10a)]['errors']>0x0||_0x25f29d['counts'][_0x34fe97(0x114)][_0x34fe97(0xe1)]>0x0||_0x25f29d['counts'][_0x34fe97(0x101)][_0x34fe97(0xe1)]>0x0||_0x25f29d[_0x34fe97(0xf2)][_0x34fe97(0x13f)][_0x34fe97(0xe1)]>0x0||_0x25f29d[_0x34fe97(0xf2)][_0x34fe97(0xc1)][_0x34fe97(0xe1)]>0x0||_0x25f29d['counts'][_0x34fe97(0x11c)][_0x34fe97(0xe1)]>0x0;if(_0x57144d){console[_0x34fe97(0xf1)](a4_0x34bb3b['yellow'](_0x34fe97(0x116))),console['log'](),console[_0x34fe97(0xf1)](a4_0x34bb3b['red'](_0x34fe97(0xe4)));for(const _0x31e1e9 of _0x25f29d['agents']){_0x31e1e9[_0x34fe97(0x159)]===_0x34fe97(0x10f)&&console[_0x34fe97(0xf1)](a4_0x34bb3b['red'](_0x34fe97(0xf0)+_0x31e1e9[_0x34fe97(0x120)]+_0x34fe97(0x147)+_0x31e1e9[_0x34fe97(0x10f)]));}for(const _0x282c11 of _0x25f29d[_0x34fe97(0x114)]){_0x282c11[_0x34fe97(0x159)]===_0x34fe97(0x10f)&&console[_0x34fe97(0xf1)](a4_0x34bb3b[_0x34fe97(0xed)](_0x34fe97(0xfd)+_0x282c11[_0x34fe97(0x12b)]+_0x34fe97(0x147)+_0x282c11[_0x34fe97(0x10f)]));}for(const _0xdf3652 of _0x25f29d['textKnowledgeBases']){_0xdf3652[_0x34fe97(0x159)]===_0x34fe97(0x10f)&&console['log'](a4_0x34bb3b[_0x34fe97(0xed)](_0x34fe97(0x127)+_0xdf3652['name']+_0x34fe97(0x147)+_0xdf3652[_0x34fe97(0x10f)]));}for(const _0x3fe858 of _0x25f29d[_0x34fe97(0x13f)]){_0x3fe858[_0x34fe97(0x159)]===_0x34fe97(0x10f)&&console[_0x34fe97(0xf1)](a4_0x34bb3b[_0x34fe97(0xed)](_0x34fe97(0x162)+_0x3fe858[_0x34fe97(0x12b)]+_0x34fe97(0x147)+_0x3fe858[_0x34fe97(0x10f)]));}for(const _0x18e86b of _0x25f29d[_0x34fe97(0x146)]){_0x18e86b[_0x34fe97(0x159)]===_0x34fe97(0x10f)&&console[_0x34fe97(0xf1)](a4_0x34bb3b[_0x34fe97(0xed)](_0x34fe97(0xfc)+_0x18e86b[_0x34fe97(0x12b)]+_0x34fe97(0x147)+_0x18e86b[_0x34fe97(0x10f)]));}for(const _0x18f7d3 of _0x25f29d[_0x34fe97(0xc1)]){_0x18f7d3[_0x34fe97(0x159)]===_0x34fe97(0x10f)&&console[_0x34fe97(0xf1)](a4_0x34bb3b['red']('\x20\x20Form\x20Interface\x20\x22'+_0x18f7d3[_0x34fe97(0x12b)]+'\x22:\x20'+_0x18f7d3[_0x34fe97(0x10f)]));}for(const _0x2c24be of _0x25f29d[_0x34fe97(0x11c)]){_0x2c24be[_0x34fe97(0x159)]===_0x34fe97(0x10f)&&console[_0x34fe97(0xf1)](a4_0x34bb3b[_0x34fe97(0xed)](_0x34fe97(0xb0)+_0x2c24be[_0x34fe97(0x12b)]+_0x34fe97(0x147)+_0x2c24be[_0x34fe97(0x10f)]));}return 0x1;}console[_0x34fe97(0xf1)](a4_0x34bb3b[_0x34fe97(0x165)]('\x0a✔\x20Pushed\x20'+(_0x14bc0b+_0x22ee59)+_0x34fe97(0x126)+_0x25f29d[_0x34fe97(0xc4)]+'\x27'));const _0x55a6d9=getLLMProjectUrl(_0x50e31d,_0x25f29d['projectId']);return console['log']('Project:\x20'+a4_0x34bb3b['cyan'](_0x55a6d9)),0x0;}}
@@ -1 +1 @@
1
- const a5_0x635f2f=a5_0x2233;function a5_0x2233(_0x5abb0c,_0x4f2516){_0x5abb0c=_0x5abb0c-0xac;const _0x35fcf0=a5_0x35fc();let _0x22335b=_0x35fcf0[_0x5abb0c];return _0x22335b;}(function(_0x4f4835,_0x5a2924){const _0x4f0fd6=a5_0x2233,_0x347888=_0x4f4835();while(!![]){try{const _0x4fa8b6=parseInt(_0x4f0fd6(0xb4))/0x1+parseInt(_0x4f0fd6(0xf9))/0x2*(parseInt(_0x4f0fd6(0xac))/0x3)+-parseInt(_0x4f0fd6(0x11f))/0x4+-parseInt(_0x4f0fd6(0x12f))/0x5*(-parseInt(_0x4f0fd6(0xe0))/0x6)+parseInt(_0x4f0fd6(0x129))/0x7*(parseInt(_0x4f0fd6(0x13c))/0x8)+-parseInt(_0x4f0fd6(0xad))/0x9+parseInt(_0x4f0fd6(0xce))/0xa*(-parseInt(_0x4f0fd6(0x118))/0xb);if(_0x4fa8b6===_0x5a2924)break;else _0x347888['push'](_0x347888['shift']());}catch(_0x16745b){_0x347888['push'](_0x347888['shift']());}}}(a5_0x35fc,0x22afe));import*as a5_0x2b90ad from'node:fs';import*as a5_0x30dedb from'node:path';function a5_0x35fc(){const _0xad4774=['source','agent:test','294456xJiZIl','Conversation\x20URL:\x20','\x20\x20Evaluating...\x20','tests','✓\x20PASS:\x20','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','Running\x20agent\x20tests...','FAIL','timestamp','dryRun','Re-evaluation\x20Summary','⚠\x20SKIPPED:\x20','rounds','description','writeFileSync','log','isSpinning','\x20(cached)','Round\x20','Re-evaluating\x20','length','Total:\x20\x20\x20\x20','Re-evaluating\x20cached\x20test\x20run...','\x20\x20Round\x20','87166QyEKky','tsv','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','verbose','has','Errors:\x20\x20\x20','Failed\x20Tests:','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','trim','Site:\x20','output','text','conversation_url','llmProject','\x27\x20to\x20create\x20the\x20folder\x20structure.','projectDir','white','Round\x201/','round','projectName','Output\x20written\x20to:\x20','No\x20tests\x20found\x20matching:\x20','name','join','cyan','...','not\x20found','filter','includes','json','✗\x20ERROR:\x20Project\x20not\x20found:\x20','110gTLgcb','push','message','site','forEach','reeval','split','566704oSaXMH','\x20\x20Conversation:\x20','executeReeval','context','dim','✗\x20FAIL:\x20','reason','start','PASS','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','79702eFWcpN','No\x20tests\x20found\x20with\x20tags:\x20','\x20(new)','\x22,\x20but\x20current\x20site\x20is\x20\x22','tags','ERROR','20FmDCAU','Test\x20Summary','resolve','size','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','red','jsonl','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','resolveProjectId','Failed:\x20\x20\x20','Available\x20tags:\x20','Passed:\x20\x20\x20','agentName','184xumVJc',':\x20Sending\x20user\x20input...','utf-8','Error\x20writing\x20output\x20file:\x20','15AiRznW','885087CCrdQi','toLowerCase','Agent:\x20','Executing\x20new\x20tests...','status','Evaluating\x20response...','Run\x20tests\x20for\x20an\x20LLM\x20agent','169180BbdUrT','testName','green','basename','\x20\x20Agent:\x20','agent','llm','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','Using\x20agent:\x20','eval','no_local_folder','\x22:\x20','No\x20tests\x20have\x20tags\x20defined.','toISOString','...\x20','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','\x20\x20Project:\x20','execute','\x20-\x20','✗\x20ERROR:\x20','/<agent-name>','add','yellow','\x20\x20-\x20','Available\x20tests:\x20','map','463180ThrPQr','Either\x20switch\x20to\x20the\x20\x22','some','\x20\x20Site:\x20','New\x20tests\x20to\x20execute:\x20','Duration:\x20','repeat','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','multiple_agents','table','testYmlPath','stop','now','Error:\x20No\x20previous\x20test\x20run\x20found.','Tests\x20found:\x20','404'];a5_0x35fc=function(){return _0xad4774;};return a5_0x35fc();}import a5_0x329cbf from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x635f2f(0x10f)]=a5_0x635f2f(0xdf);[a5_0x635f2f(0xee)]=a5_0x635f2f(0xb3);async[a5_0x635f2f(0xc5)](_0x2603ac){const _0x4244e5=a5_0x635f2f,{options:_0x577383,args:_0xc1fbc7,tdx:_0x35a6d7}=_0x2603ac,_0x21322e=_0xc1fbc7[0x0]||'.',_0x1b98d8=_0x577383[_0x4244e5(0xea)],_0x5f3c65=_0x577383,_0x217cda=_0x5f3c65[_0x4244e5(0xbd)]===![],_0x488785=_0x5f3c65[_0x4244e5(0x11d)],_0x3572fc=_0x5f3c65[_0x4244e5(0x10f)],_0x976296=_0x5f3c65[_0x4244e5(0x12d)],_0x53453a=_0x577383[_0x4244e5(0x11b)],_0x478983=_0x5f3c65[_0x4244e5(0x103)];if(_0x488785&&_0x217cda)return console[_0x4244e5(0xf0)](a5_0x329cbf[_0x4244e5(0x134)]('Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval')),0x1;let _0x4c06a4='table';if(_0x5f3c65[_0x4244e5(0x116)])_0x4c06a4=_0x4244e5(0x116);else{if(_0x5f3c65[_0x4244e5(0x135)])_0x4c06a4=_0x4244e5(0x135);else{if(_0x5f3c65['tsv'])_0x4c06a4=_0x4244e5(0xfa);else{if(_0x5f3c65[_0x4244e5(0xd7)])_0x4c06a4=_0x4244e5(0xd7);}}}const _0x5c2858=_0x5f3c65['llmProject'];let _0x5b2dd1=_0x21322e;const _0x57789d=a5_0x2b90ad['existsSync'](_0x21322e),_0x22e611=_0x21322e==='.';if(!_0x57789d||_0x22e611){const _0x4fabb8=resolveProjectFromContext(_0x21322e,_0x5c2858,{'requireFile':'test.yml'});if(_0x4fabb8['found'])_0x5b2dd1=_0x4fabb8[_0x4244e5(0x108)],_0x4fabb8[_0x4244e5(0xde)]===_0x4244e5(0x122)&&console['log'](a5_0x329cbf[_0x4244e5(0x123)](_0x4244e5(0xbc)+_0x5b2dd1));else switch(_0x4fabb8[_0x4244e5(0x125)]){case'no_context':console[_0x4244e5(0xf0)](a5_0x329cbf[_0x4244e5(0xca)](_0x4fabb8['message'])),console['log'](),console[_0x4244e5(0xf0)]('Usage:'),console[_0x4244e5(0xf0)]('\x20\x20tdx\x20agent\x20test\x20<path>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20from\x20path'),console[_0x4244e5(0xf0)]('\x20\x20tdx\x20agent\x20test\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20(requires\x20context\x20or\x20tdx.json)'),console[_0x4244e5(0xf0)](),console['log'](_0x4244e5(0x136));return 0x1;case _0x4244e5(0xbe):console[_0x4244e5(0xf0)](a5_0x329cbf[_0x4244e5(0xca)](_0x4fabb8[_0x4244e5(0x11a)])),console[_0x4244e5(0xf0)](),console['log']('Run\x20\x27tdx\x20agent\x20pull\x20'+_0x4fabb8['llmProject']+_0x4244e5(0x107));return 0x1;case _0x4244e5(0xd6):{const _0x442a12=a5_0x30dedb[_0x4244e5(0xb7)](_0x4fabb8[_0x4244e5(0x108)]);console['log'](a5_0x329cbf[_0x4244e5(0xca)](_0x4244e5(0xe5)+_0x4fabb8[_0x4244e5(0x106)]+'\x22:'));for(const _0x34af15 of _0x4fabb8['agentDirs']){console[_0x4244e5(0xf0)](_0x4244e5(0xcb)+_0x34af15);}return console[_0x4244e5(0xf0)](),console[_0x4244e5(0xf0)]('Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/'+_0x442a12+_0x4244e5(0xc8)),0x1;}case'no_tests':console[_0x4244e5(0xf0)](a5_0x329cbf['yellow'](_0x4244e5(0xc3)+_0x4fabb8[_0x4244e5(0x106)]+'\x22.')),console[_0x4244e5(0xf0)](a5_0x329cbf[_0x4244e5(0x123)]('Project\x20path:\x20'+_0x4fabb8[_0x4244e5(0x108)])),console[_0x4244e5(0xf0)](),console[_0x4244e5(0xf0)](_0x4244e5(0xd5));return 0x1;}}const {definition:_0x24d078,agentInfo:_0x32c432}=parseTestFile(_0x5b2dd1);let _0x4edc08=_0x24d078[_0x4244e5(0xe3)];if(_0x3572fc){const _0x19b73a=_0x3572fc[_0x4244e5(0x11e)](',')['map'](_0x31e875=>_0x31e875['trim']());_0x4edc08=_0x24d078[_0x4244e5(0xe3)][_0x4244e5(0x114)](_0x453ed3=>_0x19b73a[_0x4244e5(0x115)](_0x453ed3['name']));if(_0x4edc08[_0x4244e5(0xf5)]===0x0)return console[_0x4244e5(0xf0)](a5_0x329cbf[_0x4244e5(0xca)](_0x4244e5(0x10e)+_0x3572fc)),console[_0x4244e5(0xf0)](a5_0x329cbf[_0x4244e5(0x123)](_0x4244e5(0xcc)+_0x24d078[_0x4244e5(0xe3)][_0x4244e5(0xcd)](_0x3c2000=>_0x3c2000['name'])[_0x4244e5(0x110)](',\x20'))),0x1;}if(_0x976296){const _0x5e0abc=_0x976296[_0x4244e5(0x11e)](',')['map'](_0x19062a=>_0x19062a[_0x4244e5(0x101)]()[_0x4244e5(0xae)]());_0x4edc08=_0x4edc08[_0x4244e5(0x114)](_0x5aa876=>_0x5aa876[_0x4244e5(0x12d)]?.[_0x4244e5(0xd0)](_0x4b50cd=>_0x5e0abc[_0x4244e5(0x115)](_0x4b50cd[_0x4244e5(0xae)]())));if(_0x4edc08['length']===0x0){console[_0x4244e5(0xf0)](a5_0x329cbf['yellow'](_0x4244e5(0x12a)+_0x976296));const _0x55f65a=new Set();return _0x24d078[_0x4244e5(0xe3)][_0x4244e5(0x11c)](_0x59f109=>_0x59f109[_0x4244e5(0x12d)]?.[_0x4244e5(0x11c)](_0xa52366=>_0x55f65a[_0x4244e5(0xc9)](_0xa52366))),_0x55f65a[_0x4244e5(0x132)]>0x0?console[_0x4244e5(0xf0)](a5_0x329cbf[_0x4244e5(0x123)](_0x4244e5(0x139)+[..._0x55f65a][_0x4244e5(0x110)](',\x20'))):console[_0x4244e5(0xf0)](a5_0x329cbf[_0x4244e5(0x123)](_0x4244e5(0xc0))),0x1;}}if(_0x488785)return this['executeReeval'](_0x2603ac,{'definition':{'tests':_0x4edc08},'agentInfo':_0x32c432,'outputFormat':_0x4c06a4,'outputFile':_0x478983,'testNames':_0x3572fc});if(_0x1b98d8){console[_0x4244e5(0xf0)](a5_0x329cbf[_0x4244e5(0x111)]('Test\x20Configuration:')),console['log'](_0x4244e5(0xd1)+a5_0x329cbf[_0x4244e5(0x109)](_0x53453a)),console[_0x4244e5(0xf0)](_0x4244e5(0xc4)+a5_0x329cbf[_0x4244e5(0x109)](_0x32c432[_0x4244e5(0x10c)])),console[_0x4244e5(0xf0)](_0x4244e5(0xb8)+a5_0x329cbf[_0x4244e5(0x109)](_0x32c432[_0x4244e5(0x13b)])),console[_0x4244e5(0xf0)](),console[_0x4244e5(0xf0)](_0x4244e5(0xdc)+a5_0x329cbf[_0x4244e5(0x109)](_0x4edc08[_0x4244e5(0xf5)]));for(let _0x41e15b=0x0;_0x41e15b<_0x4edc08[_0x4244e5(0xf5)];_0x41e15b++){const _0x3db7b4=_0x4edc08[_0x41e15b],_0xbae653=_0x3db7b4['rounds'][_0x4244e5(0xf5)]===0x1?_0x4244e5(0x10b):_0x4244e5(0xed),_0x1ca9a5=_0x3db7b4[_0x4244e5(0x12d)]?.['length']?'\x20['+_0x3db7b4['tags'][_0x4244e5(0x110)](',\x20')+']':'';console[_0x4244e5(0xf0)]('\x20\x20'+(_0x41e15b+0x1)+'.\x20'+a5_0x329cbf[_0x4244e5(0x109)](_0x3db7b4[_0x4244e5(0x10f)])+'\x20('+_0x3db7b4['rounds']['length']+'\x20'+_0xbae653+')'+a5_0x329cbf[_0x4244e5(0x123)](_0x1ca9a5));}return 0x0;}let _0x342239,_0xf7f5c2;try{_0x342239=await _0x35a6d7[_0x4244e5(0xba)][_0x4244e5(0x137)](_0x32c432[_0x4244e5(0x10c)]);}catch(_0xfd2026){const _0x19c060=_0xfd2026 instanceof Error?_0xfd2026[_0x4244e5(0x11a)]:String(_0xfd2026);return _0x19c060[_0x4244e5(0x115)](_0x4244e5(0xdd))||_0x19c060[_0x4244e5(0xae)]()[_0x4244e5(0x115)]('not\x20found')?console[_0x4244e5(0xf0)](a5_0x329cbf[_0x4244e5(0x134)](_0x4244e5(0x117)+_0x32c432[_0x4244e5(0x10c)])):console['log'](a5_0x329cbf['red'](_0x4244e5(0x128)+_0x32c432[_0x4244e5(0x10c)]+'\x22:\x20'+_0x19c060)),0x1;}try{_0xf7f5c2=await _0x35a6d7[_0x4244e5(0xba)]['resolveAgentId'](_0x32c432[_0x4244e5(0x13b)],_0x342239);}catch(_0x19ed28){const _0xc52372=_0x19ed28 instanceof Error?_0x19ed28[_0x4244e5(0x11a)]:String(_0x19ed28);return _0xc52372[_0x4244e5(0x115)](_0x4244e5(0xdd))||_0xc52372[_0x4244e5(0xae)]()[_0x4244e5(0x115)](_0x4244e5(0x113))?console[_0x4244e5(0xf0)](a5_0x329cbf[_0x4244e5(0x134)]('✗\x20ERROR:\x20Agent\x20not\x20found:\x20'+_0x32c432[_0x4244e5(0x13b)])):console[_0x4244e5(0xf0)](a5_0x329cbf[_0x4244e5(0x134)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22'+_0x32c432['agentName']+_0x4244e5(0xbf)+_0xc52372)),0x1;}let _0xd3866f;if(!_0x217cda)try{_0xd3866f=await setupEvaluatorAgent(_0x35a6d7[_0x4244e5(0xba)],_0x577383[_0x4244e5(0xfc)]);}catch(_0x5165b7){const _0x205b57=_0x5165b7 instanceof Error?_0x5165b7['message']:String(_0x5165b7);return console[_0x4244e5(0xf0)](a5_0x329cbf[_0x4244e5(0x134)](_0x4244e5(0xbb)+_0x205b57)),0x1;}console[_0x4244e5(0xf0)](a5_0x329cbf[_0x4244e5(0x111)](_0x4244e5(0xe7))),console[_0x4244e5(0xf0)](_0x4244e5(0x102)+a5_0x329cbf[_0x4244e5(0x109)](_0x53453a)),console['log'](_0x4244e5(0xaf)+a5_0x329cbf[_0x4244e5(0x109)](_0x32c432['projectName']+'/'+_0x32c432[_0x4244e5(0x13b)])),console[_0x4244e5(0xf0)]();const _0x961728=[],_0x80c657=[],_0x57108e=Date[_0x4244e5(0xda)]();for(let _0x6407be=0x0;_0x6407be<_0x4edc08[_0x4244e5(0xf5)];_0x6407be++){const _0x4230e6=_0x4edc08[_0x6407be];_0x4edc08['length']>0x1?console[_0x4244e5(0xf0)]('Test\x20'+(_0x6407be+0x1)+'/'+_0x4edc08['length']+':\x20'+a5_0x329cbf[_0x4244e5(0x109)](_0x4230e6[_0x4244e5(0x10f)])):console[_0x4244e5(0xf0)]('Running\x20test:\x20'+a5_0x329cbf[_0x4244e5(0x109)](_0x4230e6[_0x4244e5(0x10f)]));const _0x187e8a=createCommandSpinner(_0x4244e5(0x10a)+_0x4230e6['rounds'][_0x4244e5(0xf5)]+_0x4244e5(0x13d));_0x187e8a[_0x4244e5(0x126)]();try{const {result:_0x31711e,conversation:_0x1208cc}=await runTest(_0x35a6d7['llm'],_0x4230e6,{'agentId':_0xf7f5c2,'projectId':_0x342239,'site':_0x53453a,'noEval':_0x217cda,'evaluatorId':_0xd3866f,'onRoundStart':(_0xdaa03,_0x1f0d12)=>{const _0x131272=_0x4244e5;_0x187e8a[_0x131272(0x104)]='Round\x20'+(_0xdaa03+0x1)+'/'+_0x1f0d12+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x57479c,_0x2cafd9,_0x353625)=>{const _0x58d2f8=_0x4244e5,_0x16aab6=formatElapsed(_0x2cafd9);_0x353625?console['log'](_0x58d2f8(0xf8)+(_0x57479c+0x1)+'/'+_0x4230e6[_0x58d2f8(0xed)][_0x58d2f8(0xf5)]+_0x58d2f8(0xc2)+a5_0x329cbf[_0x58d2f8(0xb6)]('✓')+'\x20('+_0x16aab6+')'):console[_0x58d2f8(0xf0)](_0x58d2f8(0xf8)+(_0x57479c+0x1)+'/'+_0x4230e6[_0x58d2f8(0xed)][_0x58d2f8(0xf5)]+_0x58d2f8(0xc2)+a5_0x329cbf[_0x58d2f8(0x134)]('✗'));},'onEvaluationStart':()=>{const _0x483213=_0x4244e5;_0x187e8a['text']=_0x483213(0xb2);},'onEvaluationComplete':_0x213614=>{const _0x89a7ca=_0x4244e5,_0x5b7fef=formatElapsed(_0x213614);console['log'](_0x89a7ca(0xe2)+a5_0x329cbf[_0x89a7ca(0xb6)]('✓')+'\x20('+_0x5b7fef+')');}});_0x187e8a['stop'](),_0x961728[_0x4244e5(0x119)](_0x31711e),_0x80c657[_0x4244e5(0x119)](_0x1208cc);if(_0x31711e[_0x4244e5(0xb1)]===_0x4244e5(0x127))console[_0x4244e5(0xf0)](a5_0x329cbf[_0x4244e5(0xb6)](_0x4244e5(0xe4)+_0x31711e[_0x4244e5(0x125)]));else _0x31711e[_0x4244e5(0xb1)]===_0x4244e5(0xe8)?console[_0x4244e5(0xf0)](a5_0x329cbf['red']('✗\x20FAIL:\x20'+_0x31711e[_0x4244e5(0x125)])):console[_0x4244e5(0xf0)](a5_0x329cbf[_0x4244e5(0x134)](_0x4244e5(0xc7)+_0x31711e['reason']));_0x31711e[_0x4244e5(0x105)]&&console[_0x4244e5(0xf0)](a5_0x329cbf[_0x4244e5(0x123)](_0x4244e5(0xe1)+_0x31711e[_0x4244e5(0x105)])),console[_0x4244e5(0xf0)]();}catch(_0x3aa39c){_0x187e8a[_0x4244e5(0xd9)]();const _0x210856=_0x3aa39c instanceof Error?_0x3aa39c[_0x4244e5(0x11a)]:String(_0x3aa39c);console[_0x4244e5(0xf0)](a5_0x329cbf[_0x4244e5(0x134)](_0x4244e5(0xc7)+_0x210856)),console[_0x4244e5(0xf0)](),_0x961728[_0x4244e5(0x119)]({'name':_0x4230e6['name'],'status':'ERROR','reason':_0x210856,'timestamp':new Date()[_0x4244e5(0xc1)](),'duration_ms':0x0});}}const _0x5c67c3=Date[_0x4244e5(0xda)]()-_0x57108e,_0xd963a9=_0x961728[_0x4244e5(0x114)](_0x430b72=>_0x430b72['status']===_0x4244e5(0x127))[_0x4244e5(0xf5)],_0x15b7cb=_0x961728[_0x4244e5(0x114)](_0x2198dd=>_0x2198dd[_0x4244e5(0xb1)]===_0x4244e5(0xe8))[_0x4244e5(0xf5)],_0x5c9612=_0x961728['filter'](_0x49165f=>_0x49165f['status']===_0x4244e5(0x12e))[_0x4244e5(0xf5)];console[_0x4244e5(0xf0)]('━'[_0x4244e5(0xd4)](0x3c)),console[_0x4244e5(0xf0)](_0x4244e5(0x130)),console[_0x4244e5(0xf0)]('━'[_0x4244e5(0xd4)](0x3c)),console['log'](_0x4244e5(0xf6)+_0x961728[_0x4244e5(0xf5)]),console[_0x4244e5(0xf0)](_0x4244e5(0x13a)+a5_0x329cbf[_0x4244e5(0xb6)](_0xd963a9)),console[_0x4244e5(0xf0)](_0x4244e5(0x138)+a5_0x329cbf[_0x4244e5(0x134)](_0x15b7cb));_0x5c9612>0x0&&console[_0x4244e5(0xf0)]('Errors:\x20\x20\x20'+a5_0x329cbf['red'](_0x5c9612));console[_0x4244e5(0xf0)]('Duration:\x20'+formatElapsed(_0x5c67c3)),console['log']('━'[_0x4244e5(0xd4)](0x3c));const _0x36e7f5=_0x961728[_0x4244e5(0x114)](_0x198cf8=>_0x198cf8[_0x4244e5(0xb1)]!==_0x4244e5(0x127));if(_0x36e7f5['length']>0x0){console[_0x4244e5(0xf0)](),console[_0x4244e5(0xf0)](_0x4244e5(0xff));for(const _0x253ae8 of _0x36e7f5){const _0x21c39d=a5_0x329cbf[_0x4244e5(0x134)]('✗'),_0x236355=_0x253ae8[_0x4244e5(0x125)][_0x4244e5(0xf5)]>0x32?_0x253ae8[_0x4244e5(0x125)]['substring'](0x0,0x32)+_0x4244e5(0x112):_0x253ae8[_0x4244e5(0x125)];console[_0x4244e5(0xf0)]('\x20\x20'+_0x21c39d+'\x20'+_0x253ae8[_0x4244e5(0x10f)]+':\x20'+_0x236355);}}const _0x467eb6={'summary':{'total':_0x961728[_0x4244e5(0xf5)],'passed':_0xd963a9,'failed':_0x15b7cb,'errors':_0x5c9612>0x0?_0x5c9612:undefined,'duration_ms':_0x5c67c3},'tests':_0x961728,'agent':{'project':_0x32c432['projectName'],'name':_0x32c432[_0x4244e5(0x13b)],'site':_0x53453a},'timestamp':new Date(_0x57108e)[_0x4244e5(0xc1)]()};try{const _0x345707=buildCachedTestRun(_0x80c657,{'site':_0x53453a,'projectId':_0x342239,'projectName':_0x32c432['projectName'],'agentId':_0xf7f5c2,'agentName':_0x32c432[_0x4244e5(0x13b)],'testYmlPath':a5_0x30dedb[_0x4244e5(0x131)](_0x32c432[_0x4244e5(0xd8)])});saveLastTestRun(_0x345707);}catch{}if(_0x4c06a4!==_0x4244e5(0xd7)||_0x478983){const _0x4e6b7c=formatResults(_0x467eb6,_0x4c06a4);if(_0x478983)try{a5_0x2b90ad[_0x4244e5(0xef)](_0x478983,_0x4e6b7c,_0x4244e5(0x13e)),console[_0x4244e5(0xf0)](),console[_0x4244e5(0xf0)](a5_0x329cbf[_0x4244e5(0x123)](_0x4244e5(0x10d)+_0x478983));}catch(_0x3bbace){return console[_0x4244e5(0xf0)](),console[_0x4244e5(0xf0)](a5_0x329cbf[_0x4244e5(0x134)](_0x4244e5(0x13f)+_0x3bbace)),0x1;}else console[_0x4244e5(0xf0)](),console[_0x4244e5(0xf0)](_0x4e6b7c);}return _0x36e7f5[_0x4244e5(0xf5)]>0x0?0x1:0x0;}async[a5_0x635f2f(0x121)](_0x3a8bd6,_0x4e99f4){const _0x412766=a5_0x635f2f,{options:_0x4d5173,tdx:_0x3d2d3a}=_0x3a8bd6,{definition:_0x2ebb6c,agentInfo:_0x3bffd6,outputFormat:_0x596bdf,outputFile:_0x40c177}=_0x4e99f4,_0x5a5bb7=_0x4d5173[_0x412766(0x11b)],_0x28efaf=loadLastTestRun();if(!_0x28efaf)return console[_0x412766(0xf0)](a5_0x329cbf['red'](_0x412766(0xdb))),console[_0x412766(0xf0)](a5_0x329cbf[_0x412766(0x123)](_0x412766(0x100))),0x1;if(_0x28efaf[_0x412766(0xb9)][_0x412766(0x13b)]!==_0x3bffd6[_0x412766(0x13b)])return console[_0x412766(0xf0)](a5_0x329cbf[_0x412766(0x134)]('Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22'+_0x28efaf[_0x412766(0xb9)][_0x412766(0x13b)]+'\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22'+_0x3bffd6['agentName']+'\x22.')),console[_0x412766(0xf0)](a5_0x329cbf[_0x412766(0x123)](_0x412766(0xe6))),0x1;const _0xf412d4=new Set(_0x28efaf['conversations'][_0x412766(0xcd)](_0x37dd33=>_0x37dd33[_0x412766(0xb5)])),_0x469b7c=_0x2ebb6c[_0x412766(0xe3)][_0x412766(0x114)](_0x1cceba=>!_0xf412d4['has'](_0x1cceba[_0x412766(0x10f)]));if(_0x469b7c['length']>0x0&&_0x28efaf[_0x412766(0x11b)]!==_0x5a5bb7)return console[_0x412766(0xf0)](a5_0x329cbf['red']('Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.')),console[_0x412766(0xf0)](a5_0x329cbf[_0x412766(0x123)]('Cached\x20run\x20is\x20from\x20site\x20\x22'+_0x28efaf[_0x412766(0x11b)]+_0x412766(0x12c)+_0x5a5bb7+'\x22.')),console['log'](a5_0x329cbf[_0x412766(0x123)](_0x412766(0xcf)+_0x28efaf[_0x412766(0x11b)]+_0x412766(0x133))),0x1;const _0x31d770=_0x2ebb6c['tests'][_0x412766(0x114)](_0x222352=>_0xf412d4[_0x412766(0xfd)](_0x222352['name'])),_0x4e4133=_0x469b7c;let _0x4e371d;try{_0x4e371d=await setupEvaluatorAgent(_0x3d2d3a[_0x412766(0xba)],_0x4d5173[_0x412766(0xfc)]);}catch(_0xcf7972){const _0x4d0e64=_0xcf7972 instanceof Error?_0xcf7972[_0x412766(0x11a)]:String(_0xcf7972);return console[_0x412766(0xf0)](a5_0x329cbf[_0x412766(0x134)]('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x4d0e64)),0x1;}console['log'](a5_0x329cbf[_0x412766(0x111)](_0x412766(0xf7))),console[_0x412766(0xf0)]('Cached\x20run\x20from:\x20'+a5_0x329cbf[_0x412766(0x109)](_0x28efaf[_0x412766(0xe9)])),console[_0x412766(0xf0)](_0x412766(0xaf)+a5_0x329cbf[_0x412766(0x109)](_0x28efaf['agent'][_0x412766(0x10c)]+'/'+_0x28efaf[_0x412766(0xb9)][_0x412766(0x13b)]));_0x4e4133[_0x412766(0xf5)]>0x0&&console['log'](_0x412766(0xd2)+a5_0x329cbf['yellow'](_0x4e4133[_0x412766(0xf5)]));console[_0x412766(0xf0)]();const _0x53d034=[],_0x3768de=Date[_0x412766(0xda)](),_0x54b035=createCommandSpinner('Re-evaluating...');if(_0x31d770[_0x412766(0xf5)]>0x0)try{const _0xbb27f4=await reevaluateFromCache(_0x3d2d3a[_0x412766(0xba)],_0x28efaf,{'tests':_0x31d770},{'evaluatorId':_0x4e371d,'onTestStart':(_0x5b9998,_0x5f1e2e,_0x3a61b7)=>{const _0x54806a=_0x412766;_0x54b035[_0x54806a(0x104)]=_0x54806a(0xf4)+(_0x5f1e2e+0x1)+'/'+_0x3a61b7+':\x20'+_0x5b9998+_0x54806a(0x112);if(!_0x54b035[_0x54806a(0xf1)])_0x54b035[_0x54806a(0x126)]();},'onTestComplete':(_0x1af1d9,_0x3f452a)=>{const _0x1e8cd9=_0x412766;_0x54b035[_0x1e8cd9(0xd9)]();if(_0x3f452a['status']==='PASS')console[_0x1e8cd9(0xf0)](a5_0x329cbf['green'](_0x1e8cd9(0xe4)+_0x1af1d9)+a5_0x329cbf[_0x1e8cd9(0x123)](_0x1e8cd9(0xf2)));else _0x3f452a[_0x1e8cd9(0xb1)]===_0x1e8cd9(0xe8)?console['log'](a5_0x329cbf[_0x1e8cd9(0x134)](_0x1e8cd9(0x124)+_0x1af1d9+_0x1e8cd9(0xc6)+_0x3f452a[_0x1e8cd9(0x125)])+a5_0x329cbf[_0x1e8cd9(0x123)](_0x1e8cd9(0xf2))):console[_0x1e8cd9(0xf0)](a5_0x329cbf[_0x1e8cd9(0x134)](_0x1e8cd9(0xc7)+_0x1af1d9+_0x1e8cd9(0xc6)+_0x3f452a[_0x1e8cd9(0x125)]));_0x3f452a[_0x1e8cd9(0x105)]&&console[_0x1e8cd9(0xf0)](a5_0x329cbf[_0x1e8cd9(0x123)](_0x1e8cd9(0x120)+_0x3f452a[_0x1e8cd9(0x105)])),_0x53d034[_0x1e8cd9(0x119)](_0x3f452a);},'onTestSkipped':(_0x3eaf76,_0x40aaa3)=>{const _0x14537b=_0x412766;_0x54b035[_0x14537b(0xd9)](),console[_0x14537b(0xf0)](a5_0x329cbf[_0x14537b(0xca)](_0x14537b(0xec)+_0x3eaf76+_0x14537b(0xc6)+_0x40aaa3));}});for(const _0x129baa of _0xbb27f4){!_0x53d034['find'](_0x129820=>_0x129820[_0x412766(0x10f)]===_0x129baa[_0x412766(0x10f)])&&_0x53d034[_0x412766(0x119)](_0x129baa);}}catch(_0x4598f7){_0x54b035[_0x412766(0xd9)]();const _0x1641b3=_0x4598f7 instanceof Error?_0x4598f7['message']:String(_0x4598f7);return console[_0x412766(0xf0)](a5_0x329cbf[_0x412766(0x134)](_0x412766(0xfb)+_0x1641b3)),0x1;}_0x54b035[_0x412766(0xd9)]();if(_0x4e4133[_0x412766(0xf5)]>0x0){console[_0x412766(0xf0)](),console['log'](a5_0x329cbf['cyan'](_0x412766(0xb0)));const {projectId:_0x423283,agentId:_0x20d783}=_0x28efaf[_0x412766(0xb9)];for(const _0x49c448 of _0x4e4133){console[_0x412766(0xf0)]('Running:\x20'+a5_0x329cbf[_0x412766(0x109)](_0x49c448[_0x412766(0x10f)]));const _0x458e88=createCommandSpinner(_0x412766(0x10a)+_0x49c448[_0x412766(0xed)][_0x412766(0xf5)]+_0x412766(0x13d));_0x458e88['start']();try{const {result:_0x4239f1}=await runTest(_0x3d2d3a['llm'],_0x49c448,{'agentId':_0x20d783,'projectId':_0x423283,'site':_0x28efaf[_0x412766(0x11b)],'noEval':![],'evaluatorId':_0x4e371d,'onRoundStart':(_0x5f3d78,_0x3ea5c0)=>{const _0x56e981=_0x412766;_0x458e88[_0x56e981(0x104)]=_0x56e981(0xf3)+(_0x5f3d78+0x1)+'/'+_0x3ea5c0+_0x56e981(0x13d);},'onRoundComplete':(_0x54a167,_0x7968a3,_0x26220a)=>{const _0x2a1718=_0x412766,_0x97ccc7=formatElapsed(_0x7968a3);_0x26220a?console['log']('\x20\x20Round\x20'+(_0x54a167+0x1)+'/'+_0x49c448[_0x2a1718(0xed)][_0x2a1718(0xf5)]+_0x2a1718(0xc2)+a5_0x329cbf[_0x2a1718(0xb6)]('✓')+'\x20('+_0x97ccc7+')'):console[_0x2a1718(0xf0)](_0x2a1718(0xf8)+(_0x54a167+0x1)+'/'+_0x49c448['rounds']['length']+'...\x20'+a5_0x329cbf[_0x2a1718(0x134)]('✗'));},'onEvaluationStart':()=>{const _0x22e0b6=_0x412766;_0x458e88['text']=_0x22e0b6(0xb2);},'onEvaluationComplete':_0x1f98fa=>{const _0x4b0d61=_0x412766,_0x3554f3=formatElapsed(_0x1f98fa);console['log']('\x20\x20Evaluating...\x20'+a5_0x329cbf[_0x4b0d61(0xb6)]('✓')+'\x20('+_0x3554f3+')');}});_0x458e88['stop'](),_0x53d034[_0x412766(0x119)](_0x4239f1);if(_0x4239f1[_0x412766(0xb1)]==='PASS')console[_0x412766(0xf0)](a5_0x329cbf['green'](_0x412766(0xe4)+_0x4239f1[_0x412766(0x125)])+a5_0x329cbf[_0x412766(0x123)]('\x20(new)'));else _0x4239f1[_0x412766(0xb1)]===_0x412766(0xe8)?console[_0x412766(0xf0)](a5_0x329cbf[_0x412766(0x134)](_0x412766(0x124)+_0x4239f1[_0x412766(0x125)])+a5_0x329cbf['dim'](_0x412766(0x12b))):console[_0x412766(0xf0)](a5_0x329cbf[_0x412766(0x134)]('✗\x20ERROR:\x20'+_0x4239f1[_0x412766(0x125)]));_0x4239f1['conversation_url']&&console[_0x412766(0xf0)](a5_0x329cbf[_0x412766(0x123)](_0x412766(0x120)+_0x4239f1[_0x412766(0x105)]));}catch(_0x4d97d4){_0x458e88['stop']();const _0x1b7c05=_0x4d97d4 instanceof Error?_0x4d97d4['message']:String(_0x4d97d4);console[_0x412766(0xf0)](a5_0x329cbf[_0x412766(0x134)](_0x412766(0xc7)+_0x1b7c05)),_0x53d034[_0x412766(0x119)]({'name':_0x49c448[_0x412766(0x10f)],'status':_0x412766(0x12e),'reason':_0x1b7c05,'timestamp':new Date()[_0x412766(0xc1)](),'duration_ms':0x0});}}}console['log']();const _0x11ab2d=Date['now']()-_0x3768de,_0x4be95c=_0x53d034[_0x412766(0x114)](_0x974d0=>_0x974d0[_0x412766(0xb1)]===_0x412766(0x127))[_0x412766(0xf5)],_0x20d58d=_0x53d034[_0x412766(0x114)](_0x11355b=>_0x11355b[_0x412766(0xb1)]==='FAIL')[_0x412766(0xf5)],_0x1ad998=_0x53d034[_0x412766(0x114)](_0x477617=>_0x477617[_0x412766(0xb1)]===_0x412766(0x12e))['length'];console[_0x412766(0xf0)]('━'[_0x412766(0xd4)](0x3c)),console[_0x412766(0xf0)](_0x412766(0xeb)),console[_0x412766(0xf0)]('━'[_0x412766(0xd4)](0x3c)),console[_0x412766(0xf0)](_0x412766(0xf6)+_0x53d034[_0x412766(0xf5)]),console[_0x412766(0xf0)](_0x412766(0x13a)+a5_0x329cbf['green'](_0x4be95c)),console[_0x412766(0xf0)]('Failed:\x20\x20\x20'+a5_0x329cbf[_0x412766(0x134)](_0x20d58d));_0x1ad998>0x0&&console[_0x412766(0xf0)](_0x412766(0xfe)+a5_0x329cbf['red'](_0x1ad998));console['log'](_0x412766(0xd3)+formatElapsed(_0x11ab2d)),console[_0x412766(0xf0)]('━'[_0x412766(0xd4)](0x3c));const _0x1b1f10={'summary':{'total':_0x53d034['length'],'passed':_0x4be95c,'failed':_0x20d58d,'errors':_0x1ad998>0x0?_0x1ad998:undefined,'duration_ms':_0x11ab2d},'tests':_0x53d034,'agent':{'project':_0x3bffd6[_0x412766(0x10c)],'name':_0x3bffd6['agentName'],'site':_0x5a5bb7},'timestamp':new Date(_0x3768de)[_0x412766(0xc1)]()};if(_0x596bdf!==_0x412766(0xd7)||_0x40c177){const _0x159f92=formatResults(_0x1b1f10,_0x596bdf);if(_0x40c177)try{a5_0x2b90ad[_0x412766(0xef)](_0x40c177,_0x159f92,_0x412766(0x13e)),console[_0x412766(0xf0)](),console[_0x412766(0xf0)](a5_0x329cbf[_0x412766(0x123)](_0x412766(0x10d)+_0x40c177));}catch(_0x22c9ad){return console[_0x412766(0xf0)](),console[_0x412766(0xf0)](a5_0x329cbf[_0x412766(0x134)](_0x412766(0x13f)+_0x22c9ad)),0x1;}else console[_0x412766(0xf0)](),console[_0x412766(0xf0)](_0x159f92);}const _0x26661b=_0x53d034[_0x412766(0x114)](_0x3ecf4b=>_0x3ecf4b[_0x412766(0xb1)]!==_0x412766(0x127));return _0x26661b[_0x412766(0xf5)]>0x0?0x1:0x0;}}
1
+ const a5_0x3628a1=a5_0x330e;function a5_0x330e(_0x394d36,_0x480c52){_0x394d36=_0x394d36-0x167;const _0x20bafe=a5_0x20ba();let _0x330e32=_0x20bafe[_0x394d36];return _0x330e32;}(function(_0x574998,_0x2da5eb){const _0x4e8071=a5_0x330e,_0x1320d3=_0x574998();while(!![]){try{const _0x53fea7=-parseInt(_0x4e8071(0x17c))/0x1+parseInt(_0x4e8071(0x1f1))/0x2*(parseInt(_0x4e8071(0x189))/0x3)+parseInt(_0x4e8071(0x1fb))/0x4+parseInt(_0x4e8071(0x170))/0x5+-parseInt(_0x4e8071(0x194))/0x6+parseInt(_0x4e8071(0x1e3))/0x7+-parseInt(_0x4e8071(0x1ba))/0x8;if(_0x53fea7===_0x2da5eb)break;else _0x1320d3['push'](_0x1320d3['shift']());}catch(_0x31f25c){_0x1320d3['push'](_0x1320d3['shift']());}}}(a5_0x20ba,0x9ebdb));import*as a5_0x90e4db from'node:fs';import*as a5_0x390327 from'node:path';import a5_0x38cb53 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_0x20ba(){const _0x207276=['start','\x27\x20to\x20create\x20the\x20folder\x20structure.','cyan','rounds','834110PGJwxO','repeat','Duration:\x20','verbose','eval','trim','json','red','Output\x20written\x20to:\x20','forEach','2522704RauEMG','add','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','found','✗\x20FAIL:\x20','reeval','stop','now','testName','yellow','✗\x20ERROR:\x20Project\x20not\x20found:\x20','projectName','no_tests','\x20\x20-\x20','3597325oixAGb','join','Either\x20switch\x20to\x20the\x20\x22','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','filter','\x20(new)','ERROR','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','\x20\x20Project:\x20','jsonl','No\x20tests\x20have\x20tags\x20defined.','has','110217rXCjAF','split','map','conversation_url','Error:\x20No\x20previous\x20test\x20run\x20found.','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','log','\x20\x20tdx\x20agent\x20test\x20<path>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20from\x20path','Passed:\x20\x20\x20','\x20\x20Round\x20','PASS','llm','\x22,\x20but\x20current\x20site\x20is\x20\x22','9MAKArg','dryRun','Re-evaluating\x20cached\x20test\x20run...','Total:\x20\x20\x20\x20','Cached\x20run\x20from:\x20','white','site','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','Available\x20tests:\x20','resolveProjectId','New\x20tests\x20to\x20execute:\x20','1522548bDvSNO','description','toISOString','Site:\x20','agent','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','\x22:\x20','Usage:','404',':\x20Sending\x20user\x20input...','dim','no_context','table','tsv','Error\x20writing\x20output\x20file:\x20','Executing\x20new\x20tests...','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','...\x20','Evaluating\x20response...','resolve','✗\x20ERROR:\x20','Tests\x20found:\x20','testYmlPath','source','agentName','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','tags','Conversation\x20URL:\x20','writeFileSync','Test\x20Configuration:','toLowerCase','Running\x20agent\x20tests...','No\x20tests\x20found\x20matching:\x20','Project\x20path:\x20','includes','Failed:\x20\x20\x20','\x20\x20Agent:\x20','✓\x20PASS:\x20','17332280wFvGit','push','Agent:\x20','No\x20tests\x20found\x20with\x20tags:\x20','resolveAgentId','\x20(cached)','\x20\x20Site:\x20','message','green','Re-evaluating\x20','Round\x201/','basename','size','Available\x20tags:\x20','Running:\x20','tests','Failed\x20Tests:','text','⚠\x20SKIPPED:\x20','\x20-\x20','Round\x20','utf-8','substring','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','llmProject','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','Run\x20\x27tdx\x20agent\x20pull\x20','agentDirs','executeReeval','test.yml','FAIL','Errors:\x20\x20\x20','multiple_agents','find','\x20\x20Evaluating...\x20','execute','agent:test','\x20\x20Conversation:\x20','Running\x20test:\x20','...','reason','4055849hoITWN','length','Using\x20agent:\x20','Re-evaluating...','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','some','timestamp','projectDir','name','status'];a5_0x20ba=function(){return _0x207276;};return a5_0x20ba();}export class AgentTestCommand extends BaseCommand{[a5_0x3628a1(0x1eb)]=a5_0x3628a1(0x1de);[a5_0x3628a1(0x195)]='Run\x20tests\x20for\x20an\x20LLM\x20agent';async[a5_0x3628a1(0x1dd)](_0x19fe5d){const _0x1e7018=a5_0x3628a1,{options:_0x4a6ab8,args:_0x6f7d,tdx:_0x54d8cf}=_0x19fe5d,_0x370869=_0x6f7d[0x0]||'.',_0x5d5f3d=_0x4a6ab8[_0x1e7018(0x18a)],_0x18bc40=_0x4a6ab8,_0x27fec8=_0x18bc40[_0x1e7018(0x1f5)]===![],_0x3aaf08=_0x18bc40[_0x1e7018(0x167)],_0x406343=_0x18bc40[_0x1e7018(0x1eb)],_0x310863=_0x18bc40[_0x1e7018(0x1ae)],_0x4cc472=_0x4a6ab8[_0x1e7018(0x18f)],_0x2fc1d4=_0x18bc40['output'];if(_0x3aaf08&&_0x27fec8)return console[_0x1e7018(0x182)](a5_0x38cb53[_0x1e7018(0x1f8)](_0x1e7018(0x173))),0x1;let _0x1bdaec=_0x1e7018(0x1a0);if(_0x18bc40[_0x1e7018(0x1f7)])_0x1bdaec='json';else{if(_0x18bc40[_0x1e7018(0x179)])_0x1bdaec='jsonl';else{if(_0x18bc40[_0x1e7018(0x1a1)])_0x1bdaec=_0x1e7018(0x1a1);else{if(_0x18bc40[_0x1e7018(0x1a0)])_0x1bdaec=_0x1e7018(0x1a0);}}}const _0x17c10b=_0x18bc40[_0x1e7018(0x1d2)];let _0x367513=_0x370869;const _0xfe0473=a5_0x90e4db['existsSync'](_0x370869),_0x4da76f=_0x370869==='.';if(!_0xfe0473||_0x4da76f){const _0x5f2360=resolveProjectFromContext(_0x370869,_0x17c10b,{'requireFile':_0x1e7018(0x1d7)});if(_0x5f2360[_0x1e7018(0x1fe)])_0x367513=_0x5f2360[_0x1e7018(0x1ea)],_0x5f2360[_0x1e7018(0x1ab)]==='context'&&console[_0x1e7018(0x182)](a5_0x38cb53[_0x1e7018(0x19e)](_0x1e7018(0x1e5)+_0x367513));else switch(_0x5f2360[_0x1e7018(0x1e2)]){case _0x1e7018(0x19f):console['log'](a5_0x38cb53[_0x1e7018(0x16b)](_0x5f2360[_0x1e7018(0x1c1)])),console[_0x1e7018(0x182)](),console[_0x1e7018(0x182)](_0x1e7018(0x19b)),console[_0x1e7018(0x182)](_0x1e7018(0x183)),console[_0x1e7018(0x182)]('\x20\x20tdx\x20agent\x20test\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20(requires\x20context\x20or\x20tdx.json)'),console[_0x1e7018(0x182)](),console[_0x1e7018(0x182)](_0x1e7018(0x1fd));return 0x1;case'no_local_folder':console['log'](a5_0x38cb53['yellow'](_0x5f2360['message'])),console[_0x1e7018(0x182)](),console[_0x1e7018(0x182)](_0x1e7018(0x1d4)+_0x5f2360[_0x1e7018(0x1d2)]+_0x1e7018(0x1ee));return 0x1;case _0x1e7018(0x1da):{const _0x56eb9a=a5_0x390327[_0x1e7018(0x1c5)](_0x5f2360[_0x1e7018(0x1ea)]);console[_0x1e7018(0x182)](a5_0x38cb53[_0x1e7018(0x16b)](_0x1e7018(0x1ad)+_0x5f2360[_0x1e7018(0x1d2)]+'\x22:'));for(const _0x1ef167 of _0x5f2360[_0x1e7018(0x1d5)]){console['log'](_0x1e7018(0x16f)+_0x1ef167);}return console[_0x1e7018(0x182)](),console[_0x1e7018(0x182)](_0x1e7018(0x181)+_0x56eb9a+'/<agent-name>'),0x1;}case _0x1e7018(0x16e):console['log'](a5_0x38cb53[_0x1e7018(0x16b)]('No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22'+_0x5f2360[_0x1e7018(0x1d2)]+'\x22.')),console[_0x1e7018(0x182)](a5_0x38cb53[_0x1e7018(0x19e)](_0x1e7018(0x1b5)+_0x5f2360[_0x1e7018(0x1ea)])),console[_0x1e7018(0x182)](),console[_0x1e7018(0x182)](_0x1e7018(0x1e7));return 0x1;}}const {definition:_0x1045b5,agentInfo:_0xf1ede8}=parseTestFile(_0x367513);let _0x381dc9=_0x1045b5['tests'];if(_0x406343){const _0x42b402=_0x406343[_0x1e7018(0x17d)](',')[_0x1e7018(0x17e)](_0x26a3e0=>_0x26a3e0[_0x1e7018(0x1f6)]());_0x381dc9=_0x1045b5[_0x1e7018(0x1c9)][_0x1e7018(0x174)](_0x2ab366=>_0x42b402[_0x1e7018(0x1b6)](_0x2ab366[_0x1e7018(0x1eb)]));if(_0x381dc9[_0x1e7018(0x1e4)]===0x0)return console[_0x1e7018(0x182)](a5_0x38cb53[_0x1e7018(0x16b)](_0x1e7018(0x1b4)+_0x406343)),console['log'](a5_0x38cb53[_0x1e7018(0x19e)](_0x1e7018(0x191)+_0x1045b5['tests'][_0x1e7018(0x17e)](_0x426170=>_0x426170[_0x1e7018(0x1eb)])['join'](',\x20'))),0x1;}if(_0x310863){const _0x50d5cc=_0x310863[_0x1e7018(0x17d)](',')[_0x1e7018(0x17e)](_0x4c813f=>_0x4c813f[_0x1e7018(0x1f6)]()[_0x1e7018(0x1b2)]());_0x381dc9=_0x381dc9['filter'](_0x48c9b4=>_0x48c9b4[_0x1e7018(0x1ae)]?.[_0x1e7018(0x1e8)](_0x81f21b=>_0x50d5cc[_0x1e7018(0x1b6)](_0x81f21b['toLowerCase']())));if(_0x381dc9[_0x1e7018(0x1e4)]===0x0){console['log'](a5_0x38cb53[_0x1e7018(0x16b)](_0x1e7018(0x1bd)+_0x310863));const _0x56cbaf=new Set();return _0x1045b5[_0x1e7018(0x1c9)][_0x1e7018(0x1fa)](_0x426564=>_0x426564['tags']?.[_0x1e7018(0x1fa)](_0x3e2839=>_0x56cbaf[_0x1e7018(0x1fc)](_0x3e2839))),_0x56cbaf[_0x1e7018(0x1c6)]>0x0?console[_0x1e7018(0x182)](a5_0x38cb53[_0x1e7018(0x19e)](_0x1e7018(0x1c7)+[..._0x56cbaf][_0x1e7018(0x171)](',\x20'))):console[_0x1e7018(0x182)](a5_0x38cb53['dim'](_0x1e7018(0x17a))),0x1;}}if(_0x3aaf08)return this['executeReeval'](_0x19fe5d,{'definition':{'tests':_0x381dc9},'agentInfo':_0xf1ede8,'outputFormat':_0x1bdaec,'outputFile':_0x2fc1d4,'testNames':_0x406343});if(_0x5d5f3d){console[_0x1e7018(0x182)](a5_0x38cb53[_0x1e7018(0x1ef)](_0x1e7018(0x1b1))),console['log'](_0x1e7018(0x1c0)+a5_0x38cb53[_0x1e7018(0x18e)](_0x4cc472)),console[_0x1e7018(0x182)](_0x1e7018(0x178)+a5_0x38cb53[_0x1e7018(0x18e)](_0xf1ede8['projectName'])),console[_0x1e7018(0x182)](_0x1e7018(0x1b8)+a5_0x38cb53['white'](_0xf1ede8[_0x1e7018(0x1ac)])),console[_0x1e7018(0x182)](),console[_0x1e7018(0x182)](_0x1e7018(0x1a9)+a5_0x38cb53[_0x1e7018(0x18e)](_0x381dc9[_0x1e7018(0x1e4)]));for(let _0x1a40a3=0x0;_0x1a40a3<_0x381dc9[_0x1e7018(0x1e4)];_0x1a40a3++){const _0x3dde68=_0x381dc9[_0x1a40a3],_0x1755bd=_0x3dde68[_0x1e7018(0x1f0)][_0x1e7018(0x1e4)]===0x1?'round':_0x1e7018(0x1f0),_0x46d998=_0x3dde68['tags']?.[_0x1e7018(0x1e4)]?'\x20['+_0x3dde68[_0x1e7018(0x1ae)][_0x1e7018(0x171)](',\x20')+']':'';console[_0x1e7018(0x182)]('\x20\x20'+(_0x1a40a3+0x1)+'.\x20'+a5_0x38cb53[_0x1e7018(0x18e)](_0x3dde68[_0x1e7018(0x1eb)])+'\x20('+_0x3dde68['rounds'][_0x1e7018(0x1e4)]+'\x20'+_0x1755bd+')'+a5_0x38cb53[_0x1e7018(0x19e)](_0x46d998));}return 0x0;}let _0x372212,_0x59b3ae;try{_0x372212=await _0x54d8cf[_0x1e7018(0x187)][_0x1e7018(0x192)](_0xf1ede8['projectName']);}catch(_0x45eb10){const _0x2247f6=_0x45eb10 instanceof Error?_0x45eb10[_0x1e7018(0x1c1)]:String(_0x45eb10);return _0x2247f6['includes'](_0x1e7018(0x19c))||_0x2247f6[_0x1e7018(0x1b2)]()['includes']('not\x20found')?console[_0x1e7018(0x182)](a5_0x38cb53[_0x1e7018(0x1f8)](_0x1e7018(0x16c)+_0xf1ede8[_0x1e7018(0x16d)])):console['log'](a5_0x38cb53[_0x1e7018(0x1f8)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22'+_0xf1ede8[_0x1e7018(0x16d)]+_0x1e7018(0x19a)+_0x2247f6)),0x1;}try{_0x59b3ae=await _0x54d8cf[_0x1e7018(0x187)][_0x1e7018(0x1be)](_0xf1ede8['agentName'],_0x372212);}catch(_0x12446f){const _0x120cb3=_0x12446f instanceof Error?_0x12446f[_0x1e7018(0x1c1)]:String(_0x12446f);return _0x120cb3[_0x1e7018(0x1b6)](_0x1e7018(0x19c))||_0x120cb3[_0x1e7018(0x1b2)]()[_0x1e7018(0x1b6)]('not\x20found')?console['log'](a5_0x38cb53[_0x1e7018(0x1f8)]('✗\x20ERROR:\x20Agent\x20not\x20found:\x20'+_0xf1ede8[_0x1e7018(0x1ac)])):console[_0x1e7018(0x182)](a5_0x38cb53['red'](_0x1e7018(0x1d1)+_0xf1ede8[_0x1e7018(0x1ac)]+_0x1e7018(0x19a)+_0x120cb3)),0x1;}let _0x1b1981;if(!_0x27fec8)try{_0x1b1981=await setupEvaluatorAgent(_0x54d8cf[_0x1e7018(0x187)],_0x4a6ab8[_0x1e7018(0x1f4)]);}catch(_0x15af70){const _0x360b64=_0x15af70 instanceof Error?_0x15af70[_0x1e7018(0x1c1)]:String(_0x15af70);return console[_0x1e7018(0x182)](a5_0x38cb53[_0x1e7018(0x1f8)](_0x1e7018(0x1a4)+_0x360b64)),0x1;}console[_0x1e7018(0x182)](a5_0x38cb53['cyan'](_0x1e7018(0x1b3))),console[_0x1e7018(0x182)](_0x1e7018(0x197)+a5_0x38cb53['white'](_0x4cc472)),console['log'](_0x1e7018(0x1bc)+a5_0x38cb53[_0x1e7018(0x18e)](_0xf1ede8['projectName']+'/'+_0xf1ede8[_0x1e7018(0x1ac)])),console[_0x1e7018(0x182)]();const _0x45e0c6=[],_0x421bf8=[],_0x5a67b9=Date[_0x1e7018(0x169)]();for(let _0x5ca2c6=0x0;_0x5ca2c6<_0x381dc9[_0x1e7018(0x1e4)];_0x5ca2c6++){const _0x31b6cd=_0x381dc9[_0x5ca2c6];_0x381dc9[_0x1e7018(0x1e4)]>0x1?console['log']('Test\x20'+(_0x5ca2c6+0x1)+'/'+_0x381dc9['length']+':\x20'+a5_0x38cb53['white'](_0x31b6cd[_0x1e7018(0x1eb)])):console[_0x1e7018(0x182)](_0x1e7018(0x1e0)+a5_0x38cb53[_0x1e7018(0x18e)](_0x31b6cd['name']));const _0x4522d8=createCommandSpinner(_0x1e7018(0x1c4)+_0x31b6cd[_0x1e7018(0x1f0)][_0x1e7018(0x1e4)]+':\x20Sending\x20user\x20input...');_0x4522d8[_0x1e7018(0x1ed)]();try{const {result:_0x579b56,conversation:_0x3518aa}=await runTest(_0x54d8cf[_0x1e7018(0x187)],_0x31b6cd,{'agentId':_0x59b3ae,'projectId':_0x372212,'site':_0x4cc472,'noEval':_0x27fec8,'evaluatorId':_0x1b1981,'onRoundStart':(_0x1b377d,_0x51768c)=>{const _0x5e6d52=_0x1e7018;_0x4522d8[_0x5e6d52(0x1cb)]=_0x5e6d52(0x1ce)+(_0x1b377d+0x1)+'/'+_0x51768c+_0x5e6d52(0x19d);},'onRoundComplete':(_0x2277be,_0x31978b,_0x264455)=>{const _0x30dd6f=_0x1e7018,_0x2a8f95=formatElapsed(_0x31978b);_0x264455?console[_0x30dd6f(0x182)](_0x30dd6f(0x185)+(_0x2277be+0x1)+'/'+_0x31b6cd[_0x30dd6f(0x1f0)]['length']+_0x30dd6f(0x1a5)+a5_0x38cb53[_0x30dd6f(0x1c2)]('✓')+'\x20('+_0x2a8f95+')'):console[_0x30dd6f(0x182)](_0x30dd6f(0x185)+(_0x2277be+0x1)+'/'+_0x31b6cd[_0x30dd6f(0x1f0)][_0x30dd6f(0x1e4)]+_0x30dd6f(0x1a5)+a5_0x38cb53[_0x30dd6f(0x1f8)]('✗'));},'onEvaluationStart':()=>{const _0x296dee=_0x1e7018;_0x4522d8[_0x296dee(0x1cb)]=_0x296dee(0x1a6);},'onEvaluationComplete':_0x2da0b5=>{const _0x21553a=_0x1e7018,_0x4afd91=formatElapsed(_0x2da0b5);console[_0x21553a(0x182)]('\x20\x20Evaluating...\x20'+a5_0x38cb53[_0x21553a(0x1c2)]('✓')+'\x20('+_0x4afd91+')');}});_0x4522d8[_0x1e7018(0x168)](),_0x45e0c6[_0x1e7018(0x1bb)](_0x579b56),_0x421bf8[_0x1e7018(0x1bb)](_0x3518aa);if(_0x579b56[_0x1e7018(0x1ec)]===_0x1e7018(0x186))console[_0x1e7018(0x182)](a5_0x38cb53['green'](_0x1e7018(0x1b9)+_0x579b56[_0x1e7018(0x1e2)]));else _0x579b56[_0x1e7018(0x1ec)]===_0x1e7018(0x1d8)?console[_0x1e7018(0x182)](a5_0x38cb53[_0x1e7018(0x1f8)](_0x1e7018(0x1ff)+_0x579b56[_0x1e7018(0x1e2)])):console['log'](a5_0x38cb53[_0x1e7018(0x1f8)](_0x1e7018(0x1a8)+_0x579b56[_0x1e7018(0x1e2)]));_0x579b56[_0x1e7018(0x17f)]&&console['log'](a5_0x38cb53[_0x1e7018(0x19e)](_0x1e7018(0x1af)+_0x579b56[_0x1e7018(0x17f)])),console[_0x1e7018(0x182)]();}catch(_0x12f2c9){_0x4522d8[_0x1e7018(0x168)]();const _0x46987a=_0x12f2c9 instanceof Error?_0x12f2c9[_0x1e7018(0x1c1)]:String(_0x12f2c9);console[_0x1e7018(0x182)](a5_0x38cb53['red'](_0x1e7018(0x1a8)+_0x46987a)),console[_0x1e7018(0x182)](),_0x45e0c6[_0x1e7018(0x1bb)]({'name':_0x31b6cd['name'],'status':_0x1e7018(0x176),'reason':_0x46987a,'timestamp':new Date()[_0x1e7018(0x196)](),'duration_ms':0x0});}}const _0x132105=Date[_0x1e7018(0x169)]()-_0x5a67b9,_0x4b0307=_0x45e0c6[_0x1e7018(0x174)](_0x332844=>_0x332844[_0x1e7018(0x1ec)]===_0x1e7018(0x186))[_0x1e7018(0x1e4)],_0x55faa0=_0x45e0c6['filter'](_0x287d24=>_0x287d24[_0x1e7018(0x1ec)]===_0x1e7018(0x1d8))[_0x1e7018(0x1e4)],_0x10feb6=_0x45e0c6[_0x1e7018(0x174)](_0xdce649=>_0xdce649[_0x1e7018(0x1ec)]===_0x1e7018(0x176))[_0x1e7018(0x1e4)];console[_0x1e7018(0x182)]('━'[_0x1e7018(0x1f2)](0x3c)),console[_0x1e7018(0x182)]('Test\x20Summary'),console[_0x1e7018(0x182)]('━'[_0x1e7018(0x1f2)](0x3c)),console[_0x1e7018(0x182)](_0x1e7018(0x18c)+_0x45e0c6['length']),console[_0x1e7018(0x182)](_0x1e7018(0x184)+a5_0x38cb53[_0x1e7018(0x1c2)](_0x4b0307)),console[_0x1e7018(0x182)](_0x1e7018(0x1b7)+a5_0x38cb53[_0x1e7018(0x1f8)](_0x55faa0));_0x10feb6>0x0&&console[_0x1e7018(0x182)](_0x1e7018(0x1d9)+a5_0x38cb53[_0x1e7018(0x1f8)](_0x10feb6));console[_0x1e7018(0x182)](_0x1e7018(0x1f3)+formatElapsed(_0x132105)),console[_0x1e7018(0x182)]('━'[_0x1e7018(0x1f2)](0x3c));const _0x2d6322=_0x45e0c6[_0x1e7018(0x174)](_0x43d514=>_0x43d514[_0x1e7018(0x1ec)]!==_0x1e7018(0x186));if(_0x2d6322[_0x1e7018(0x1e4)]>0x0){console[_0x1e7018(0x182)](),console[_0x1e7018(0x182)](_0x1e7018(0x1ca));for(const _0x2a197f of _0x2d6322){const _0x599c98=a5_0x38cb53[_0x1e7018(0x1f8)]('✗'),_0x590d26=_0x2a197f[_0x1e7018(0x1e2)]['length']>0x32?_0x2a197f[_0x1e7018(0x1e2)][_0x1e7018(0x1d0)](0x0,0x32)+'...':_0x2a197f[_0x1e7018(0x1e2)];console[_0x1e7018(0x182)]('\x20\x20'+_0x599c98+'\x20'+_0x2a197f[_0x1e7018(0x1eb)]+':\x20'+_0x590d26);}}const _0x3648a2={'summary':{'total':_0x45e0c6[_0x1e7018(0x1e4)],'passed':_0x4b0307,'failed':_0x55faa0,'errors':_0x10feb6>0x0?_0x10feb6:undefined,'duration_ms':_0x132105},'tests':_0x45e0c6,'agent':{'project':_0xf1ede8[_0x1e7018(0x16d)],'name':_0xf1ede8[_0x1e7018(0x1ac)],'site':_0x4cc472},'timestamp':new Date(_0x5a67b9)['toISOString']()};try{const _0x459374=buildCachedTestRun(_0x421bf8,{'site':_0x4cc472,'projectId':_0x372212,'projectName':_0xf1ede8[_0x1e7018(0x16d)],'agentId':_0x59b3ae,'agentName':_0xf1ede8[_0x1e7018(0x1ac)],'testYmlPath':a5_0x390327[_0x1e7018(0x1a7)](_0xf1ede8[_0x1e7018(0x1aa)])});saveLastTestRun(_0x459374);}catch{}if(_0x1bdaec!==_0x1e7018(0x1a0)||_0x2fc1d4){const _0x1161a7=formatResults(_0x3648a2,_0x1bdaec);if(_0x2fc1d4)try{a5_0x90e4db[_0x1e7018(0x1b0)](_0x2fc1d4,_0x1161a7,_0x1e7018(0x1cf)),console[_0x1e7018(0x182)](),console['log'](a5_0x38cb53['dim'](_0x1e7018(0x1f9)+_0x2fc1d4));}catch(_0x5d82de){return console['log'](),console[_0x1e7018(0x182)](a5_0x38cb53[_0x1e7018(0x1f8)](_0x1e7018(0x1a2)+_0x5d82de)),0x1;}else console[_0x1e7018(0x182)](),console['log'](_0x1161a7);}return _0x2d6322[_0x1e7018(0x1e4)]>0x0?0x1:0x0;}async[a5_0x3628a1(0x1d6)](_0x476253,_0x1023c5){const _0x2edda9=a5_0x3628a1,{options:_0x201950,tdx:_0x16ab15}=_0x476253,{definition:_0x5f8749,agentInfo:_0x4b430e,outputFormat:_0x3d9dc4,outputFile:_0x45747f}=_0x1023c5,_0x2b4ceb=_0x201950[_0x2edda9(0x18f)],_0x86cea=loadLastTestRun();if(!_0x86cea)return console[_0x2edda9(0x182)](a5_0x38cb53['red'](_0x2edda9(0x180))),console[_0x2edda9(0x182)](a5_0x38cb53[_0x2edda9(0x19e)](_0x2edda9(0x190))),0x1;if(_0x86cea[_0x2edda9(0x198)][_0x2edda9(0x1ac)]!==_0x4b430e[_0x2edda9(0x1ac)])return console['log'](a5_0x38cb53[_0x2edda9(0x1f8)]('Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22'+_0x86cea[_0x2edda9(0x198)]['agentName']+'\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22'+_0x4b430e[_0x2edda9(0x1ac)]+'\x22.')),console[_0x2edda9(0x182)](a5_0x38cb53[_0x2edda9(0x19e)](_0x2edda9(0x177))),0x1;const _0x4138df=new Set(_0x86cea['conversations'][_0x2edda9(0x17e)](_0x3cb518=>_0x3cb518[_0x2edda9(0x16a)])),_0x56d391=_0x5f8749[_0x2edda9(0x1c9)][_0x2edda9(0x174)](_0x513b09=>!_0x4138df[_0x2edda9(0x17b)](_0x513b09[_0x2edda9(0x1eb)]));if(_0x56d391['length']>0x0&&_0x86cea['site']!==_0x2b4ceb)return console[_0x2edda9(0x182)](a5_0x38cb53['red'](_0x2edda9(0x1d3))),console[_0x2edda9(0x182)](a5_0x38cb53[_0x2edda9(0x19e)]('Cached\x20run\x20is\x20from\x20site\x20\x22'+_0x86cea['site']+_0x2edda9(0x188)+_0x2b4ceb+'\x22.')),console[_0x2edda9(0x182)](a5_0x38cb53['dim'](_0x2edda9(0x172)+_0x86cea[_0x2edda9(0x18f)]+'\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.')),0x1;const _0x3e8010=_0x5f8749[_0x2edda9(0x1c9)][_0x2edda9(0x174)](_0xa4edcd=>_0x4138df[_0x2edda9(0x17b)](_0xa4edcd[_0x2edda9(0x1eb)])),_0x3bafa7=_0x56d391;let _0x247cdd;try{_0x247cdd=await setupEvaluatorAgent(_0x16ab15[_0x2edda9(0x187)],_0x201950[_0x2edda9(0x1f4)]);}catch(_0x3a2a4b){const _0x400bd8=_0x3a2a4b instanceof Error?_0x3a2a4b[_0x2edda9(0x1c1)]:String(_0x3a2a4b);return console[_0x2edda9(0x182)](a5_0x38cb53['red']('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x400bd8)),0x1;}console[_0x2edda9(0x182)](a5_0x38cb53[_0x2edda9(0x1ef)](_0x2edda9(0x18b))),console[_0x2edda9(0x182)](_0x2edda9(0x18d)+a5_0x38cb53['white'](_0x86cea[_0x2edda9(0x1e9)])),console['log'](_0x2edda9(0x1bc)+a5_0x38cb53[_0x2edda9(0x18e)](_0x86cea[_0x2edda9(0x198)][_0x2edda9(0x16d)]+'/'+_0x86cea[_0x2edda9(0x198)][_0x2edda9(0x1ac)]));_0x3bafa7[_0x2edda9(0x1e4)]>0x0&&console['log'](_0x2edda9(0x193)+a5_0x38cb53[_0x2edda9(0x16b)](_0x3bafa7['length']));console[_0x2edda9(0x182)]();const _0x5388d3=[],_0x1eedcd=Date[_0x2edda9(0x169)](),_0x179bdd=createCommandSpinner(_0x2edda9(0x1e6));if(_0x3e8010['length']>0x0)try{const _0x962e6e=await reevaluateFromCache(_0x16ab15['llm'],_0x86cea,{'tests':_0x3e8010},{'evaluatorId':_0x247cdd,'onTestStart':(_0x3f3505,_0x434b35,_0x50355c)=>{const _0x2ebc5d=_0x2edda9;_0x179bdd['text']=_0x2ebc5d(0x1c3)+(_0x434b35+0x1)+'/'+_0x50355c+':\x20'+_0x3f3505+_0x2ebc5d(0x1e1);if(!_0x179bdd['isSpinning'])_0x179bdd[_0x2ebc5d(0x1ed)]();},'onTestComplete':(_0x2542af,_0x4dcaa2)=>{const _0x399d94=_0x2edda9;_0x179bdd[_0x399d94(0x168)]();if(_0x4dcaa2[_0x399d94(0x1ec)]===_0x399d94(0x186))console['log'](a5_0x38cb53['green'](_0x399d94(0x1b9)+_0x2542af)+a5_0x38cb53[_0x399d94(0x19e)](_0x399d94(0x1bf)));else _0x4dcaa2[_0x399d94(0x1ec)]==='FAIL'?console[_0x399d94(0x182)](a5_0x38cb53[_0x399d94(0x1f8)](_0x399d94(0x1ff)+_0x2542af+_0x399d94(0x1cd)+_0x4dcaa2['reason'])+a5_0x38cb53[_0x399d94(0x19e)](_0x399d94(0x1bf))):console['log'](a5_0x38cb53[_0x399d94(0x1f8)](_0x399d94(0x1a8)+_0x2542af+'\x20-\x20'+_0x4dcaa2[_0x399d94(0x1e2)]));_0x4dcaa2[_0x399d94(0x17f)]&&console[_0x399d94(0x182)](a5_0x38cb53[_0x399d94(0x19e)](_0x399d94(0x1df)+_0x4dcaa2[_0x399d94(0x17f)])),_0x5388d3[_0x399d94(0x1bb)](_0x4dcaa2);},'onTestSkipped':(_0x333dad,_0x2bf4df)=>{const _0x5e1bd3=_0x2edda9;_0x179bdd['stop'](),console['log'](a5_0x38cb53[_0x5e1bd3(0x16b)](_0x5e1bd3(0x1cc)+_0x333dad+'\x20-\x20'+_0x2bf4df));}});for(const _0x2c63fb of _0x962e6e){!_0x5388d3[_0x2edda9(0x1db)](_0x3265d2=>_0x3265d2['name']===_0x2c63fb[_0x2edda9(0x1eb)])&&_0x5388d3[_0x2edda9(0x1bb)](_0x2c63fb);}}catch(_0x1e1620){_0x179bdd['stop']();const _0x1be167=_0x1e1620 instanceof Error?_0x1e1620['message']:String(_0x1e1620);return console[_0x2edda9(0x182)](a5_0x38cb53[_0x2edda9(0x1f8)](_0x2edda9(0x199)+_0x1be167)),0x1;}_0x179bdd[_0x2edda9(0x168)]();if(_0x3bafa7[_0x2edda9(0x1e4)]>0x0){console[_0x2edda9(0x182)](),console[_0x2edda9(0x182)](a5_0x38cb53[_0x2edda9(0x1ef)](_0x2edda9(0x1a3)));const {projectId:_0x5b117e,agentId:_0x2891ba}=_0x86cea[_0x2edda9(0x198)];for(const _0x5913f6 of _0x3bafa7){console[_0x2edda9(0x182)](_0x2edda9(0x1c8)+a5_0x38cb53[_0x2edda9(0x18e)](_0x5913f6[_0x2edda9(0x1eb)]));const _0x19b058=createCommandSpinner('Round\x201/'+_0x5913f6[_0x2edda9(0x1f0)]['length']+':\x20Sending\x20user\x20input...');_0x19b058[_0x2edda9(0x1ed)]();try{const {result:_0x588130}=await runTest(_0x16ab15[_0x2edda9(0x187)],_0x5913f6,{'agentId':_0x2891ba,'projectId':_0x5b117e,'site':_0x86cea[_0x2edda9(0x18f)],'noEval':![],'evaluatorId':_0x247cdd,'onRoundStart':(_0x106130,_0x40ca65)=>{const _0x40d801=_0x2edda9;_0x19b058[_0x40d801(0x1cb)]=_0x40d801(0x1ce)+(_0x106130+0x1)+'/'+_0x40ca65+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x2423bd,_0x19a784,_0x495cfc)=>{const _0x5a2a48=_0x2edda9,_0x40fa44=formatElapsed(_0x19a784);_0x495cfc?console[_0x5a2a48(0x182)]('\x20\x20Round\x20'+(_0x2423bd+0x1)+'/'+_0x5913f6[_0x5a2a48(0x1f0)][_0x5a2a48(0x1e4)]+'...\x20'+a5_0x38cb53[_0x5a2a48(0x1c2)]('✓')+'\x20('+_0x40fa44+')'):console[_0x5a2a48(0x182)](_0x5a2a48(0x185)+(_0x2423bd+0x1)+'/'+_0x5913f6['rounds'][_0x5a2a48(0x1e4)]+_0x5a2a48(0x1a5)+a5_0x38cb53[_0x5a2a48(0x1f8)]('✗'));},'onEvaluationStart':()=>{const _0x26a878=_0x2edda9;_0x19b058[_0x26a878(0x1cb)]='Evaluating\x20response...';},'onEvaluationComplete':_0x533bb3=>{const _0x94187d=_0x2edda9,_0x2eeea4=formatElapsed(_0x533bb3);console[_0x94187d(0x182)](_0x94187d(0x1dc)+a5_0x38cb53['green']('✓')+'\x20('+_0x2eeea4+')');}});_0x19b058[_0x2edda9(0x168)](),_0x5388d3['push'](_0x588130);if(_0x588130[_0x2edda9(0x1ec)]===_0x2edda9(0x186))console['log'](a5_0x38cb53[_0x2edda9(0x1c2)](_0x2edda9(0x1b9)+_0x588130[_0x2edda9(0x1e2)])+a5_0x38cb53[_0x2edda9(0x19e)](_0x2edda9(0x175)));else _0x588130[_0x2edda9(0x1ec)]===_0x2edda9(0x1d8)?console[_0x2edda9(0x182)](a5_0x38cb53['red'](_0x2edda9(0x1ff)+_0x588130['reason'])+a5_0x38cb53['dim'](_0x2edda9(0x175))):console[_0x2edda9(0x182)](a5_0x38cb53[_0x2edda9(0x1f8)]('✗\x20ERROR:\x20'+_0x588130[_0x2edda9(0x1e2)]));_0x588130[_0x2edda9(0x17f)]&&console[_0x2edda9(0x182)](a5_0x38cb53['dim'](_0x2edda9(0x1df)+_0x588130[_0x2edda9(0x17f)]));}catch(_0x4ded10){_0x19b058[_0x2edda9(0x168)]();const _0x57907b=_0x4ded10 instanceof Error?_0x4ded10[_0x2edda9(0x1c1)]:String(_0x4ded10);console[_0x2edda9(0x182)](a5_0x38cb53[_0x2edda9(0x1f8)](_0x2edda9(0x1a8)+_0x57907b)),_0x5388d3[_0x2edda9(0x1bb)]({'name':_0x5913f6[_0x2edda9(0x1eb)],'status':_0x2edda9(0x176),'reason':_0x57907b,'timestamp':new Date()[_0x2edda9(0x196)](),'duration_ms':0x0});}}}console['log']();const _0x54144b=Date[_0x2edda9(0x169)]()-_0x1eedcd,_0x525740=_0x5388d3[_0x2edda9(0x174)](_0x454a73=>_0x454a73[_0x2edda9(0x1ec)]===_0x2edda9(0x186))[_0x2edda9(0x1e4)],_0x5d0cf7=_0x5388d3[_0x2edda9(0x174)](_0x52ee9b=>_0x52ee9b['status']==='FAIL')[_0x2edda9(0x1e4)],_0x33518a=_0x5388d3['filter'](_0x407731=>_0x407731[_0x2edda9(0x1ec)]===_0x2edda9(0x176))[_0x2edda9(0x1e4)];console['log']('━'[_0x2edda9(0x1f2)](0x3c)),console[_0x2edda9(0x182)]('Re-evaluation\x20Summary'),console['log']('━'[_0x2edda9(0x1f2)](0x3c)),console[_0x2edda9(0x182)](_0x2edda9(0x18c)+_0x5388d3[_0x2edda9(0x1e4)]),console[_0x2edda9(0x182)](_0x2edda9(0x184)+a5_0x38cb53[_0x2edda9(0x1c2)](_0x525740)),console[_0x2edda9(0x182)](_0x2edda9(0x1b7)+a5_0x38cb53[_0x2edda9(0x1f8)](_0x5d0cf7));_0x33518a>0x0&&console[_0x2edda9(0x182)](_0x2edda9(0x1d9)+a5_0x38cb53[_0x2edda9(0x1f8)](_0x33518a));console[_0x2edda9(0x182)](_0x2edda9(0x1f3)+formatElapsed(_0x54144b)),console[_0x2edda9(0x182)]('━'[_0x2edda9(0x1f2)](0x3c));const _0x470d9c={'summary':{'total':_0x5388d3[_0x2edda9(0x1e4)],'passed':_0x525740,'failed':_0x5d0cf7,'errors':_0x33518a>0x0?_0x33518a:undefined,'duration_ms':_0x54144b},'tests':_0x5388d3,'agent':{'project':_0x4b430e['projectName'],'name':_0x4b430e[_0x2edda9(0x1ac)],'site':_0x2b4ceb},'timestamp':new Date(_0x1eedcd)[_0x2edda9(0x196)]()};if(_0x3d9dc4!==_0x2edda9(0x1a0)||_0x45747f){const _0x207853=formatResults(_0x470d9c,_0x3d9dc4);if(_0x45747f)try{a5_0x90e4db[_0x2edda9(0x1b0)](_0x45747f,_0x207853,_0x2edda9(0x1cf)),console[_0x2edda9(0x182)](),console[_0x2edda9(0x182)](a5_0x38cb53[_0x2edda9(0x19e)](_0x2edda9(0x1f9)+_0x45747f));}catch(_0x301996){return console[_0x2edda9(0x182)](),console['log'](a5_0x38cb53[_0x2edda9(0x1f8)](_0x2edda9(0x1a2)+_0x301996)),0x1;}else console[_0x2edda9(0x182)](),console['log'](_0x207853);}const _0x52fc2f=_0x5388d3[_0x2edda9(0x174)](_0x11d0c0=>_0x11d0c0[_0x2edda9(0x1ec)]!==_0x2edda9(0x186));return _0x52fc2f[_0x2edda9(0x1e4)]>0x0?0x1:0x0;}}
@@ -1 +1 @@
1
- const a6_0x16936a=a6_0x4624;function a6_0x1233(){const _0x53e556=['includes','file','keys','cas','cookie','25549614vpDpVp','body','api','indexOf','GET','authorization','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','Error:\x20','output','headers','verbose','set-cookie2','description','3345496OeGTgS','\x0aStack\x20trace:\x0a','Invalid\x20header\x20format:\x20\x22','llm','set-cookie','error','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','substring','status','3333534zBZlif','890770tCgDaP','log','Invalid\x20HTTP\x20method:\x20','message','noColor','stack','.\x20Valid\x20methods:\x20','join','isArray','PUT','proxy-authorization','trim','1243827lWVvFD','llm-proxy','1169264wxCWaT','Results\x20saved\x20to\x20','startsWith','x-trino-user','14YJRSgg','length','Endpoint\x20must\x20start\x20with\x20/:\x20','toUpperCase','request','name','validate','PATCH','10715XsTrXZ','data','x-auth-token','method','\x22.\x20','x-xsrf-token','3792dwEaYV','has','site','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','entries','trino','header'];a6_0x1233=function(){return _0x53e556;};return a6_0x1233();}(function(_0x4f08dc,_0x5a9cfc){const _0x176921=a6_0x4624,_0x33f181=_0x4f08dc();while(!![]){try{const _0xd3fb14=-parseInt(_0x176921(0xe4))/0x1+parseInt(_0x176921(0xd8))/0x2+-parseInt(_0x176921(0xd7))/0x3+parseInt(_0x176921(0xce))/0x4+parseInt(_0x176921(0xaf))/0x5*(-parseInt(_0x176921(0xb5))/0x6)+-parseInt(_0x176921(0xea))/0x7*(-parseInt(_0x176921(0xe6))/0x8)+parseInt(_0x176921(0xc1))/0x9;if(_0xd3fb14===_0x5a9cfc)break;else _0x33f181['push'](_0x33f181['shift']());}catch(_0x45a620){_0x33f181['push'](_0x33f181['shift']());}}}(a6_0x1233,0xabc34));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';function a6_0x4624(_0x117acc,_0x49f743){_0x117acc=_0x117acc-0xaf;const _0x12337b=a6_0x1233();let _0x46244a=_0x12337b[_0x117acc];return _0x46244a;}import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a6_0x16936a(0xc6),a6_0x16936a(0xe2),a6_0x16936a(0xc0),a6_0x16936a(0xd2),a6_0x16936a(0xcc),a6_0x16936a(0xb4),a6_0x16936a(0xb1),a6_0x16936a(0xe9)]);function isSensitiveHeader(_0x5a134b){const _0x27bd35=a6_0x16936a;return SENSITIVE_HEADERS[_0x27bd35(0xb6)](_0x5a134b['toLowerCase']());}function parseHeader(_0x5a18bc){const _0x4315b9=a6_0x16936a,_0xa6bddd=_0x5a18bc[_0x4315b9(0xc4)](':');if(_0xa6bddd===-0x1)throw new Error(_0x4315b9(0xd0)+_0x5a18bc+_0x4315b9(0xb3)+'Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22');const _0x30f63d=_0x5a18bc['substring'](0x0,_0xa6bddd)['trim'](),_0x2e54d3=_0x5a18bc[_0x4315b9(0xd5)](_0xa6bddd+0x1)[_0x4315b9(0xe3)]();if(!_0x30f63d)throw new Error(_0x4315b9(0xd4)+_0x5a18bc+'\x22');return[_0x30f63d,_0x2e54d3];}export class ApiCommand extends BaseCommand{[a6_0x16936a(0xef)]=a6_0x16936a(0xc3);[a6_0x16936a(0xcd)]=a6_0x16936a(0xb8);[a6_0x16936a(0xf0)](_0x578385){const _0x28520c=a6_0x16936a,{args:_0x542701,options:_0x2a0a8e}=_0x578385,_0x4922a5=_0x2a0a8e;if(_0x542701[_0x28520c(0xeb)]===0x0)return'Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list';const _0x4e0fbc=_0x542701[0x0];if(!_0x4e0fbc[_0x28520c(0xe8)]('/'))return _0x28520c(0xec)+_0x4e0fbc;const _0x554cba=_0x4922a5[_0x28520c(0xb0)],_0x4c638d=_0x4922a5['file'];if(_0x554cba&&_0x4c638d)return _0x28520c(0xc7);const _0x342edd=_0x4922a5[_0x28520c(0xb2)]||_0x28520c(0xc5),_0x2e10a6=['GET','POST',_0x28520c(0xe1),'DELETE',_0x28520c(0xf1)];if(!_0x2e10a6[_0x28520c(0xbc)](_0x342edd[_0x28520c(0xed)]()))return _0x28520c(0xda)+_0x342edd+_0x28520c(0xde)+_0x2e10a6[_0x28520c(0xdf)](',\x20');const _0x4dfb84=_0x4922a5['type']||'td',_0x452e75=['td','cdp','workflow',_0x28520c(0xba),_0x28520c(0xd1),_0x28520c(0xe5),_0x28520c(0xbf)];if(!_0x452e75[_0x28520c(0xbc)](_0x4dfb84))return'Invalid\x20API\x20type:\x20'+_0x4dfb84+'.\x20Valid\x20types:\x20'+_0x452e75[_0x28520c(0xdf)](',\x20');return undefined;}async['execute'](_0x2e79ba){const _0x245606=a6_0x16936a,{options:_0x4f8b9d,args:_0x339b0e,tdx:_0x2c78a1}=_0x2e79ba,_0x26a818=_0x4f8b9d,_0x38bb70=_0x339b0e[0x0],_0x56fc5e=(_0x26a818[_0x245606(0xb2)]||_0x245606(0xc5))['toUpperCase'](),_0x462201=_0x26a818['data'],_0x47213f=_0x26a818[_0x245606(0xbd)],_0x4ae89b=_0x26a818[_0x245606(0xbb)],_0x3eb0fa=_0x26a818['type']||'td';try{const _0x3fede3={};if(_0x4ae89b){const _0x2ae02f=Array[_0x245606(0xe0)](_0x4ae89b)?_0x4ae89b:[_0x4ae89b];for(const _0x393eec of _0x2ae02f){const [_0x251bfc,_0x44e65f]=parseHeader(_0x393eec);_0x3fede3[_0x251bfc]=_0x44e65f;}}let _0x461dfe;if(_0x462201)_0x461dfe=_0x462201;else{if(_0x47213f)try{_0x461dfe=RawAPI['readBodyFromFile'](_0x47213f);}catch(_0x2d7073){return console[_0x245606(0xd3)](_0x245606(0xc8)+(_0x2d7073 instanceof Error?_0x2d7073[_0x245606(0xdb)]:String(_0x2d7073))),0x1;}}const _0x182d79={'method':_0x56fc5e,'apiType':_0x3eb0fa,'includeHeaders':_0x4f8b9d['verbose']};_0x461dfe&&(_0x182d79[_0x245606(0xc2)]=_0x461dfe);Object[_0x245606(0xbe)](_0x3fede3)['length']>0x0&&(_0x182d79['headers']=_0x3fede3);if(_0x4f8b9d[_0x245606(0xcb)]){const _0x1785df=resolveSite(_0x4f8b9d[_0x245606(0xb7)]),_0xa727f6=getEndpoint(_0x1785df,_0x3eb0fa),_0x2aa66b=''+_0xa727f6+_0x38bb70;console[_0x245606(0xd3)]('>\x20'+_0x56fc5e+'\x20'+_0x2aa66b);const _0x2af403=getAuthHeaders(_0x1785df),_0x45446e={..._0x2af403,..._0x3fede3};for(const [_0x263c5e,_0x4e4cae]of Object[_0x245606(0xb9)](_0x45446e)){!isSensitiveHeader(_0x263c5e)&&console[_0x245606(0xd3)]('>\x20'+_0x263c5e+':\x20'+_0x4e4cae);}_0x461dfe&&console[_0x245606(0xd3)]('>'),console['error']('');}const _0x35e42b=await _0x2c78a1[_0x245606(0xc3)][_0x245606(0xee)](_0x38bb70,_0x182d79);if(_0x4f8b9d[_0x245606(0xcb)]&&_0x35e42b[_0x245606(0xca)]){console[_0x245606(0xd3)]('<\x20HTTP/1.1\x20'+_0x35e42b[_0x245606(0xd6)]);for(const [_0x47ca33,_0x56c6b5]of Object[_0x245606(0xb9)](_0x35e42b['headers'])){!isSensitiveHeader(_0x47ca33)&&console['error']('<\x20'+_0x47ca33+':\x20'+_0x56c6b5);}console[_0x245606(0xd3)]('');}const _0x1c0e99=Boolean(_0x4f8b9d[_0x245606(0xc9)]),_0x5bc249={'color':_0x4f8b9d['color'],'noColor':_0x4f8b9d[_0x245606(0xdc)]||_0x1c0e99&&!_0x4f8b9d['color']},_0x3fadac=colorizeJSON(_0x35e42b[_0x245606(0xb0)],_0x5bc249);return _0x4f8b9d[_0x245606(0xc9)]?(writeFileSync(_0x4f8b9d[_0x245606(0xc9)],_0x3fadac),console[_0x245606(0xd3)](_0x245606(0xe7)+_0x4f8b9d[_0x245606(0xc9)])):console[_0x245606(0xd9)](_0x3fadac),0x0;}catch(_0x2539cb){return _0x2539cb instanceof Error?(console[_0x245606(0xd3)](_0x245606(0xc8)+_0x2539cb[_0x245606(0xdb)]),_0x4f8b9d[_0x245606(0xcb)]&&_0x2539cb['stack']&&console[_0x245606(0xd3)](_0x245606(0xcf)+_0x2539cb[_0x245606(0xdd)])):console[_0x245606(0xd3)](_0x245606(0xc8)+String(_0x2539cb)),0x1;}}}
1
+ const a6_0x52880d=a6_0x1a4a;(function(_0x2a4bf0,_0x35e822){const _0x4b6a14=a6_0x1a4a,_0xb1b935=_0x2a4bf0();while(!![]){try{const _0xeede29=parseInt(_0x4b6a14(0x1e9))/0x1*(parseInt(_0x4b6a14(0x211))/0x2)+parseInt(_0x4b6a14(0x218))/0x3*(parseInt(_0x4b6a14(0x1eb))/0x4)+parseInt(_0x4b6a14(0x1da))/0x5*(-parseInt(_0x4b6a14(0x215))/0x6)+parseInt(_0x4b6a14(0x1fc))/0x7*(parseInt(_0x4b6a14(0x1f0))/0x8)+-parseInt(_0x4b6a14(0x1f1))/0x9+-parseInt(_0x4b6a14(0x1d2))/0xa+-parseInt(_0x4b6a14(0x1ff))/0xb*(-parseInt(_0x4b6a14(0x1df))/0xc);if(_0xeede29===_0x35e822)break;else _0xb1b935['push'](_0xb1b935['shift']());}catch(_0x52e6dc){_0xb1b935['push'](_0xb1b935['shift']());}}}(a6_0x1c83,0xaa05e));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';function a6_0x1a4a(_0x47e917,_0x14efe0){_0x47e917=_0x47e917-0x1d2;const _0x1c8384=a6_0x1c83();let _0x1a4aa6=_0x1c8384[_0x47e917];return _0x1a4aa6;}import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';function a6_0x1c83(){const _0x196227=['status','x-trino-user','cookie','1FHzsCE','color','764qqhTai','Error:\x20','file','set-cookie2','error','32pYwras','10841895gkgFUk','toUpperCase','execute','Results\x20saved\x20to\x20','body','PUT','substring','x-xsrf-token','headers','cas','entries','490301jPJdyI','toLowerCase','Invalid\x20HTTP\x20method:\x20','77XHteOI','isArray','verbose','set-cookie','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','llm','keys','noColor','startsWith','cdp','output','data','<\x20HTTP/1.1\x20','authorization','has','header','DELETE','POST','2631638OLrSQD','proxy-authorization','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','site','6RihyYD','length','method','8334PohKZL','11421660KBChRX','message','GET','api','stack','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','Invalid\x20API\x20type:\x20','trim','1005115NkkHcF','description','request','type','join','1916004tnWZkG','trino','llm-proxy','includes','name','.\x20Valid\x20methods:\x20','\x0aStack\x20trace:\x0a'];a6_0x1c83=function(){return _0x196227;};return a6_0x1c83();}import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a6_0x52880d(0x20c),a6_0x52880d(0x212),a6_0x52880d(0x1e8),a6_0x52880d(0x202),a6_0x52880d(0x1ee),a6_0x52880d(0x1f8),'x-auth-token',a6_0x52880d(0x1e7)]);function isSensitiveHeader(_0x50f74b){const _0x4be07f=a6_0x52880d;return SENSITIVE_HEADERS[_0x4be07f(0x20d)](_0x50f74b[_0x4be07f(0x1fd)]());}function parseHeader(_0x269edd){const _0x1b7a3b=a6_0x52880d,_0x589c7d=_0x269edd['indexOf'](':');if(_0x589c7d===-0x1)throw new Error('Invalid\x20header\x20format:\x20\x22'+_0x269edd+'\x22.\x20'+'Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22');const _0x2f4d26=_0x269edd[_0x1b7a3b(0x1f7)](0x0,_0x589c7d)[_0x1b7a3b(0x1d9)](),_0x19c989=_0x269edd['substring'](_0x589c7d+0x1)[_0x1b7a3b(0x1d9)]();if(!_0x2f4d26)throw new Error('Header\x20key\x20cannot\x20be\x20empty:\x20\x22'+_0x269edd+'\x22');return[_0x2f4d26,_0x19c989];}export class ApiCommand extends BaseCommand{[a6_0x52880d(0x1e3)]=a6_0x52880d(0x1d5);[a6_0x52880d(0x1db)]=a6_0x52880d(0x203);['validate'](_0x3b6eab){const _0x3c3798=a6_0x52880d,{args:_0x36e8de,options:_0x109bb0}=_0x3b6eab,_0x30b8f0=_0x109bb0;if(_0x36e8de[_0x3c3798(0x216)]===0x0)return _0x3c3798(0x1d7);const _0x43c8ff=_0x36e8de[0x0];if(!_0x43c8ff[_0x3c3798(0x207)]('/'))return'Endpoint\x20must\x20start\x20with\x20/:\x20'+_0x43c8ff;const _0x518143=_0x30b8f0['data'],_0x21431d=_0x30b8f0[_0x3c3798(0x1ed)];if(_0x518143&&_0x21431d)return _0x3c3798(0x213);const _0xc44ce8=_0x30b8f0['method']||_0x3c3798(0x1d4),_0x503aec=[_0x3c3798(0x1d4),_0x3c3798(0x210),_0x3c3798(0x1f6),_0x3c3798(0x20f),'PATCH'];if(!_0x503aec[_0x3c3798(0x1e2)](_0xc44ce8[_0x3c3798(0x1f2)]()))return _0x3c3798(0x1fe)+_0xc44ce8+_0x3c3798(0x1e4)+_0x503aec[_0x3c3798(0x1de)](',\x20');const _0x531624=_0x30b8f0[_0x3c3798(0x1dd)]||'td',_0x2df98a=['td',_0x3c3798(0x208),'workflow',_0x3c3798(0x1e0),_0x3c3798(0x204),_0x3c3798(0x1e1),_0x3c3798(0x1fa)];if(!_0x2df98a[_0x3c3798(0x1e2)](_0x531624))return _0x3c3798(0x1d8)+_0x531624+'.\x20Valid\x20types:\x20'+_0x2df98a[_0x3c3798(0x1de)](',\x20');return undefined;}async[a6_0x52880d(0x1f3)](_0xa013c7){const _0x5f5da8=a6_0x52880d,{options:_0x3f6540,args:_0x2fd540,tdx:_0x148e74}=_0xa013c7,_0x23a5d8=_0x3f6540,_0x39af6e=_0x2fd540[0x0],_0x28199f=(_0x23a5d8[_0x5f5da8(0x217)]||'GET')[_0x5f5da8(0x1f2)](),_0x3187d8=_0x23a5d8[_0x5f5da8(0x20a)],_0x52e9f8=_0x23a5d8[_0x5f5da8(0x1ed)],_0x4d07ca=_0x23a5d8[_0x5f5da8(0x20e)],_0x4ed20d=_0x23a5d8[_0x5f5da8(0x1dd)]||'td';try{const _0x4c4c49={};if(_0x4d07ca){const _0x1be1e4=Array[_0x5f5da8(0x200)](_0x4d07ca)?_0x4d07ca:[_0x4d07ca];for(const _0x1fbfb4 of _0x1be1e4){const [_0x5d9c02,_0x21bb56]=parseHeader(_0x1fbfb4);_0x4c4c49[_0x5d9c02]=_0x21bb56;}}let _0x404f72;if(_0x3187d8)_0x404f72=_0x3187d8;else{if(_0x52e9f8)try{_0x404f72=RawAPI['readBodyFromFile'](_0x52e9f8);}catch(_0x3489e2){return console['error']('Error:\x20'+(_0x3489e2 instanceof Error?_0x3489e2[_0x5f5da8(0x1d3)]:String(_0x3489e2))),0x1;}}const _0x3c2ca2={'method':_0x28199f,'apiType':_0x4ed20d,'includeHeaders':_0x3f6540[_0x5f5da8(0x201)]};_0x404f72&&(_0x3c2ca2[_0x5f5da8(0x1f5)]=_0x404f72);Object[_0x5f5da8(0x205)](_0x4c4c49)[_0x5f5da8(0x216)]>0x0&&(_0x3c2ca2[_0x5f5da8(0x1f9)]=_0x4c4c49);if(_0x3f6540[_0x5f5da8(0x201)]){const _0x569e94=resolveSite(_0x3f6540[_0x5f5da8(0x214)]),_0x196ce4=getEndpoint(_0x569e94,_0x4ed20d),_0x3c1195=''+_0x196ce4+_0x39af6e;console[_0x5f5da8(0x1ef)]('>\x20'+_0x28199f+'\x20'+_0x3c1195);const _0x551362=getAuthHeaders(_0x569e94),_0x206acd={..._0x551362,..._0x4c4c49};for(const [_0x1210e7,_0x2d25d3]of Object['entries'](_0x206acd)){!isSensitiveHeader(_0x1210e7)&&console[_0x5f5da8(0x1ef)]('>\x20'+_0x1210e7+':\x20'+_0x2d25d3);}_0x404f72&&console['error']('>'),console[_0x5f5da8(0x1ef)]('');}const _0x1ce0b0=await _0x148e74['api'][_0x5f5da8(0x1dc)](_0x39af6e,_0x3c2ca2);if(_0x3f6540[_0x5f5da8(0x201)]&&_0x1ce0b0[_0x5f5da8(0x1f9)]){console['error'](_0x5f5da8(0x20b)+_0x1ce0b0[_0x5f5da8(0x1e6)]);for(const [_0x57f800,_0x505d2f]of Object[_0x5f5da8(0x1fb)](_0x1ce0b0[_0x5f5da8(0x1f9)])){!isSensitiveHeader(_0x57f800)&&console[_0x5f5da8(0x1ef)]('<\x20'+_0x57f800+':\x20'+_0x505d2f);}console[_0x5f5da8(0x1ef)]('');}const _0x4d307d=Boolean(_0x3f6540[_0x5f5da8(0x209)]),_0x2c3f9b={'color':_0x3f6540[_0x5f5da8(0x1ea)],'noColor':_0x3f6540[_0x5f5da8(0x206)]||_0x4d307d&&!_0x3f6540['color']},_0x2061e4=colorizeJSON(_0x1ce0b0[_0x5f5da8(0x20a)],_0x2c3f9b);return _0x3f6540['output']?(writeFileSync(_0x3f6540['output'],_0x2061e4),console[_0x5f5da8(0x1ef)](_0x5f5da8(0x1f4)+_0x3f6540[_0x5f5da8(0x209)])):console['log'](_0x2061e4),0x0;}catch(_0x3985fd){return _0x3985fd instanceof Error?(console[_0x5f5da8(0x1ef)](_0x5f5da8(0x1ec)+_0x3985fd[_0x5f5da8(0x1d3)]),_0x3f6540['verbose']&&_0x3985fd['stack']&&console[_0x5f5da8(0x1ef)](_0x5f5da8(0x1e5)+_0x3985fd[_0x5f5da8(0x1d6)])):console[_0x5f5da8(0x1ef)](_0x5f5da8(0x1ec)+String(_0x3985fd)),0x1;}}}
@@ -1 +1 @@
1
- const a7_0x2c0928=a7_0x7ddb;(function(_0x7983ff,_0x5f3179){const _0x3057d7=a7_0x7ddb,_0x40df29=_0x7983ff();while(!![]){try{const _0x2d88f2=parseInt(_0x3057d7(0x1f8))/0x1*(parseInt(_0x3057d7(0x1ba))/0x2)+-parseInt(_0x3057d7(0x1c8))/0x3*(parseInt(_0x3057d7(0x1e5))/0x4)+parseInt(_0x3057d7(0x1bb))/0x5*(-parseInt(_0x3057d7(0x1ea))/0x6)+-parseInt(_0x3057d7(0x1d9))/0x7+-parseInt(_0x3057d7(0x205))/0x8+parseInt(_0x3057d7(0x202))/0x9+parseInt(_0x3057d7(0x20f))/0xa;if(_0x2d88f2===_0x5f3179)break;else _0x40df29['push'](_0x40df29['shift']());}catch(_0x455c6a){_0x40df29['push'](_0x40df29['shift']());}}}(a7_0xb8b3,0xb3bee));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens,saveOAuthTokens}from'../core/oauth-keychain.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{deleteOAuthTokens}from'../core/oauth-keychain.js';function a7_0xb8b3(){const _0x4bdf2d=['System\x20keychain\x20is\x20not\x20available','\x20\x20(','9957120gTrFHN','tdx:\x20auth\x20clear','You\x20can\x20find\x20your\x20API\x20key\x20at:','Read\x20credential\x20from\x20','Validating\x20OAuth\x20tokens...','yellow','\x20\x20\x20\x202.\x20Or\x20use\x20a\x20different\x20browser\x20profile\x20to\x20avoid\x20cached\x20sessions','method','\x20for\x20profile:\x20','email','\x0aSetup\x20cancelled','\x27\x20registered','error','Credential\x20type:\x20OAuth','No\x20credential\x20found','profile','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','2748404ttdvpI','1809295dfweez','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','Name:\x20','filter','auth:setup','jobs','Setup\x20API\x20key\x20authentication\x20interactively','tdx\x20profile:\x20','✓\x20Default\x20site\x20set\x20to\x20','API\x20key\x20cannot\x20be\x20empty','warn','OAuth\x20tokens','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','110943EZSSUg','✗\x20Validation\x20failed:\x20','Remove\x20API\x20key\x20from\x20system\x20keychain','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','Setting\x20up\x20authentication\x20for\x20site:\x20','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','logLevel','site','name','Account\x20name\x20for\x20SSO\x20(press\x20Enter\x20to\x20skip):','/app/mp/ak','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','ERROR','getUserInfo','Read\x20credential\x20from\x20keychain','auth','red','1041180EILYmC','\x20(profile:\x20','green','\x20(site:\x20','access_token','auth:clear','User:\x20','✓\x20Signed\x20in\x20successfully','join','/users/initiate_sso\x20(account:\x20','Enter\x20your\x20TD\x20API\x20key:','description','12rsBeGc','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain','\x20\x20tdx','create','last_name','24ZjKccl','apikey','text','Sign\x20in\x20with\x20browser\x20(recommended)','Opening\x20browser\x20for\x20authentication...','first_name','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','status','trim','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','/oauth/authorize','Choose\x20how\x20to\x20sign\x20in:','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','1IoJIou','accountName','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','message','log','tdx:\x20auth\x20setup','password','\x20\x20\x20\x201.\x20Run:\x20tdx\x20auth\x20setup\x20--account-name\x20<name>','bold','\x20and\x20','821520NjcGrE','\x20removed\x20from\x20keychain','us01','142696KzJkuz','\x20--profile\x20','For\x20scripts\x20or\x20headless\x20servers','oauth','Setup\x20cancelled','apiKey','dim','execute'];a7_0xb8b3=function(){return _0x4bdf2d;};return a7_0xb8b3();}import{clearCredentialCache}from'../core/credential-cache.js';import{startOAuthFlow}from'../core/oauth.js';import{promptSiteSelection}from'../core/constants.js';import a7_0x55a2d6 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_0x47d18e from'chalk';export async function runOAuthLoginFlow(_0x193732,_0x2555c9,_0x4a4b0,_0x26106a){const _0x53ac58=a7_0x7ddb,_0x28f2da=await isKeychainAvailable();if(!_0x28f2da)throw new Error(_0x53ac58(0x1bc)+_0x53ac58(0x1d3));let _0x1e568f=_0x26106a?.[_0x53ac58(0x1f9)];if(!_0x1e568f){const _0x244200=await a7_0x55a2d6({'type':_0x53ac58(0x1ec),'name':_0x53ac58(0x1f9),'message':_0x53ac58(0x1d1)});if(_0x244200['accountName']===undefined)throw new Error(_0x53ac58(0x209));_0x1e568f=_0x244200['accountName'][_0x53ac58(0x1f3)]()||undefined;}const _0x4f4c79=getConsoleUrl(_0x193732);console[_0x53ac58(0x1fc)](_0x53ac58(0x1ee));_0x1e568f?console['log']('\x20\x20'+_0x4f4c79+_0x53ac58(0x1e2)+_0x1e568f+')'):console['log']('\x20\x20'+_0x4f4c79+_0x53ac58(0x1f5));console['log'](_0x53ac58(0x1fa));const _0x3ca154=await startOAuthFlow(_0x193732,{'accountName':_0x1e568f});console[_0x53ac58(0x1fc)](_0x53ac58(0x213));const _0x500140=TDX[_0x53ac58(0x1e8)]({'site':_0x193732,'accessToken':_0x3ca154[_0x53ac58(0x1dd)],'logLevel':_0x4a4b0??LogLevel[_0x53ac58(0x1d4)]}),_0x1a45d4=await _0x500140[_0x53ac58(0x1c0)][_0x53ac58(0x1d5)]();console[_0x53ac58(0x1fc)](a7_0x47d18e[_0x53ac58(0x1db)](_0x53ac58(0x1e0))),console[_0x53ac58(0x1fc)]('\x20\x20'+a7_0x47d18e['cyan'](_0x193732+':'+_0x1a45d4['account_id'])+'\x20\x20user_id:'+_0x1a45d4['id']+_0x53ac58(0x20e)+_0x1a45d4['email']+')');!_0x1e568f&&(console[_0x53ac58(0x1fc)](a7_0x47d18e['dim']('\x20\x20If\x20this\x20is\x20not\x20the\x20expected\x20account:')),console[_0x53ac58(0x1fc)](a7_0x47d18e[_0x53ac58(0x20b)](_0x53ac58(0x1ff))),console['log'](a7_0x47d18e[_0x53ac58(0x20b)](_0x53ac58(0x1af))));await saveOAuthTokens(_0x3ca154,_0x2555c9),console['log'](_0x53ac58(0x1e6)+(_0x2555c9?_0x53ac58(0x1da)+_0x2555c9+')':''));if(_0x2555c9){const _0x615429={'site':_0x193732};saveProfileToUserConfig(_0x2555c9,_0x615429),console[_0x53ac58(0x1fc)]('✓\x20Profile\x20\x27'+_0x2555c9+_0x53ac58(0x1b4));}else saveDefaultSiteToUserConfig(_0x193732),console[_0x53ac58(0x1fc)](_0x53ac58(0x1c3)+_0x193732);const _0x8c80b3=_0x2555c9?'\x20--profile\x20'+_0x2555c9:'';console[_0x53ac58(0x1fc)](),console[_0x53ac58(0x1fc)]('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console[_0x53ac58(0x1fc)](_0x53ac58(0x1e7)+_0x8c80b3+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console['log']('\x20\x20tdx'+_0x8c80b3+_0x53ac58(0x1b9));}function a7_0x7ddb(_0x3425e2,_0x2f146a){_0x3425e2=_0x3425e2-0x1af;const _0xb8b3cf=a7_0xb8b3();let _0x7ddb14=_0xb8b3cf[_0x3425e2];return _0x7ddb14;}export async function promptAuthMethod(){const _0x36af77=a7_0x7ddb,_0x5b4c9b=await a7_0x55a2d6({'type':'select','name':_0x36af77(0x1b0),'message':_0x36af77(0x1f6),'choices':[{'title':_0x36af77(0x1ed),'description':'Opens\x20your\x20browser\x20to\x20sign\x20in\x20with\x20SSO','value':_0x36af77(0x208)},{'title':'Use\x20an\x20API\x20key','description':_0x36af77(0x207),'value':_0x36af77(0x1eb)}]});return _0x5b4c9b[_0x36af77(0x1b0)]||null;}export class AuthSetupCommand extends BaseCommand{['name']=a7_0x2c0928(0x1bf);[a7_0x2c0928(0x1e4)]=a7_0x2c0928(0x1c1);async[a7_0x2c0928(0x20c)](_0x5b464e){const _0x554804=a7_0x2c0928,{options:_0x3a34f2}=_0x5b464e,_0x4c68bf=_0x3a34f2[_0x554804(0x1b8)];console[_0x554804(0x1fc)](a7_0x47d18e[_0x554804(0x200)](_0x554804(0x1fd)));const _0x47dc84=_0x3a34f2[_0x554804(0x1cf)]||_0x554804(0x204),_0x508a14=await promptSiteSelection(_0x47dc84,_0x4c68bf,_0x554804(0x209));if(!_0x508a14)return 0x1;const _0x2440e2=resolveSite(_0x508a14),_0x14369f=await promptAuthMethod();if(!_0x14369f)return console[_0x554804(0x1fc)](_0x554804(0x1b3)),0x1;if(_0x14369f===_0x554804(0x208)){const {accountName:_0x12aa74}=_0x3a34f2;return await runOAuthLoginFlow(_0x2440e2,_0x4c68bf,_0x3a34f2[_0x554804(0x1ce)]??LogLevel[_0x554804(0x1d4)],{'accountName':_0x12aa74}),0x0;}console[_0x554804(0x1fc)](_0x554804(0x1cc)+_0x2440e2),console[_0x554804(0x1fc)](_0x554804(0x211)),console[_0x554804(0x1fc)]('\x20\x20'+getConsoleUrl(_0x2440e2,_0x554804(0x1d2)));const _0x5b552b=await a7_0x55a2d6({'type':_0x554804(0x1fe),'name':_0x554804(0x20a),'message':_0x554804(0x1e3),'validate':_0x1fc6c1=>{const _0x15e95e=_0x554804;if(!_0x1fc6c1||!_0x1fc6c1[_0x15e95e(0x1f3)]())return _0x15e95e(0x1c4);return!![];}});if(!_0x5b552b['apiKey'])return console[_0x554804(0x1fc)](_0x554804(0x1b3)),0x1;const _0xe57ca6=_0x5b552b['apiKey'];console[_0x554804(0x1fc)]('Validating\x20API\x20key...');try{const _0x40239e=TDX['create']({'site':_0x2440e2,'apiKey':_0xe57ca6[_0x554804(0x1f3)](),'logLevel':_0x3a34f2[_0x554804(0x1ce)]??LogLevel[_0x554804(0x1d4)]}),_0x3ff0ff=await _0x40239e[_0x554804(0x1c0)]['getUserInfo']();console[_0x554804(0x1fc)](_0x554804(0x1f1)+_0x3ff0ff[_0x554804(0x1b2)]+')');const _0x4a02c4=await isKeychainAvailable();_0x4a02c4?(await saveAPIKeyAsync(_0xe57ca6[_0x554804(0x1f3)](),_0x2440e2,_0x4c68bf),console[_0x554804(0x1fc)]('✓\x20API\x20key\x20saved\x20to\x20system\x20keychain'+(_0x4c68bf?_0x554804(0x1da)+_0x4c68bf+')':''))):(console[_0x554804(0x1c5)](a7_0x47d18e[_0x554804(0x214)](_0x554804(0x1cb))),console['warn'](a7_0x47d18e['yellow'](_0x554804(0x1cd))));if(_0x4c68bf){const _0x42c405={'site':_0x2440e2};saveProfileToUserConfig(_0x4c68bf,_0x42c405),console['log']('✓\x20Profile\x20\x27'+_0x4c68bf+_0x554804(0x1b4));}else saveDefaultSiteToUserConfig(_0x2440e2),console[_0x554804(0x1fc)]('✓\x20Default\x20site\x20set\x20to\x20'+_0x2440e2);const _0x3cdd08=_0x4c68bf?_0x554804(0x206)+_0x4c68bf:'';return console[_0x554804(0x1fc)](),console[_0x554804(0x1fc)](_0x554804(0x1f0)),console[_0x554804(0x1fc)](_0x554804(0x1e7)+_0x3cdd08+_0x554804(0x1c7)),console[_0x554804(0x1fc)](_0x554804(0x1e7)+_0x3cdd08+_0x554804(0x1b9)),0x0;}catch(_0x95d9f0){if(_0x95d9f0 instanceof HTTPClientError&&_0x95d9f0[_0x554804(0x1f2)]===0x191)return printAuthError(_0x95d9f0),0x1;return console[_0x554804(0x1b5)](a7_0x47d18e[_0x554804(0x1d8)]('✗\x20Validation\x20failed:\x20'+(_0x95d9f0 instanceof Error?_0x95d9f0[_0x554804(0x1fb)]:String(_0x95d9f0)))),console[_0x554804(0x1b5)](_0x554804(0x1f4)),0x1;}}}export class AuthStatusCommand extends BaseCommand{['name']=a7_0x2c0928(0x1d7);[a7_0x2c0928(0x1e4)]=a7_0x2c0928(0x1f7);async[a7_0x2c0928(0x20c)](_0x5837f2){const _0x9789f8=a7_0x2c0928,{options:_0x11a294,tdx:_0x45dd75}=_0x5837f2,_0x705504=_0x11a294[_0x9789f8(0x1cf)],_0xeb6323=_0x11a294[_0x9789f8(0x1b8)],_0x220c65=_0xeb6323?_0xeb6323:'N/A';console[_0x9789f8(0x1fc)](_0x9789f8(0x1c2)+_0x220c65+_0x9789f8(0x1dc)+_0x705504+')');const _0x1c1cf9=await getOAuthTokens(_0xeb6323);if(_0x1c1cf9)console[_0x9789f8(0x1fc)](_0x9789f8(0x1b6)),console[_0x9789f8(0x1fc)](_0x9789f8(0x1d6)+(_0xeb6323?'\x20(profile:\x20'+_0xeb6323+')':''));else{const _0x55bdc0=await resolveAPIKeyAsync(_0x705504,_0xeb6323);if(_0x55bdc0){const {source:_0x1290fd,isDeprecated:_0x474c5f}=_0x55bdc0,_0x3a1253=_0x9789f8(0x212)+_0x1290fd;console[_0x9789f8(0x1fc)](_0x474c5f?a7_0x47d18e[_0x9789f8(0x214)](_0x3a1253):_0x3a1253);}else console[_0x9789f8(0x1fc)](a7_0x47d18e['yellow'](_0x9789f8(0x1b7)));}try{const _0x5e9a7f=await _0x45dd75[_0x9789f8(0x1c0)]['getUserInfo']();return console[_0x9789f8(0x1fc)](a7_0x47d18e[_0x9789f8(0x1db)]('✓\x20Authentication\x20successful\x0a')),console[_0x9789f8(0x1fc)](_0x9789f8(0x1df)+_0x5e9a7f[_0x9789f8(0x1b2)]),(_0x5e9a7f['first_name']||_0x5e9a7f[_0x9789f8(0x1e9)])&&console[_0x9789f8(0x1fc)](_0x9789f8(0x1bd)+[_0x5e9a7f[_0x9789f8(0x1ef)],_0x5e9a7f[_0x9789f8(0x1e9)]][_0x9789f8(0x1be)](Boolean)[_0x9789f8(0x1e1)]('\x20')),0x0;}catch(_0x250623){return _0x250623 instanceof HTTPClientError&&_0x250623[_0x9789f8(0x1f2)]===0x191?printAuthError(_0x250623,!![],_0xeb6323):console[_0x9789f8(0x1b5)](a7_0x47d18e['red'](_0x9789f8(0x1c9)+(_0x250623 instanceof Error?_0x250623[_0x9789f8(0x1fb)]:String(_0x250623)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x2c0928(0x1d0)]=a7_0x2c0928(0x1de);[a7_0x2c0928(0x1e4)]=a7_0x2c0928(0x1ca);async[a7_0x2c0928(0x20c)](_0xafb3c8){const _0x5c5af0=a7_0x2c0928,{options:_0x33088d}=_0xafb3c8,_0x11512d=_0x33088d['profile'];console[_0x5c5af0(0x1fc)](a7_0x47d18e[_0x5c5af0(0x200)](_0x5c5af0(0x210)));const _0x352752=await isKeychainAvailable();if(!_0x352752)return console[_0x5c5af0(0x1b5)](a7_0x47d18e[_0x5c5af0(0x1d8)](_0x5c5af0(0x20d))),0x1;const [_0x1ce178,_0x529416]=await Promise['all']([deleteKeychainAPIKey(_0x11512d),deleteOAuthTokens(_0x11512d)]);if(_0x1ce178||_0x529416){clearCredentialCache();const _0x5651c5=[_0x1ce178&&'API\x20key',_0x529416&&_0x5c5af0(0x1c6)]['filter'](Boolean)['join'](_0x5c5af0(0x201));return console[_0x5c5af0(0x1fc)]('✓\x20'+_0x5651c5+_0x5c5af0(0x203)+(_0x11512d?_0x5c5af0(0x1da)+_0x11512d+')':'')),0x0;}else return console[_0x5c5af0(0x1fc)]('No\x20credentials\x20found\x20in\x20keychain'+(_0x11512d?_0x5c5af0(0x1b1)+_0x11512d:'')),0x1;}}
1
+ const a7_0x5eb460=a7_0x3938;(function(_0x1ab310,_0x74b01b){const _0x2c783c=a7_0x3938,_0x489b3f=_0x1ab310();while(!![]){try{const _0x557c3b=-parseInt(_0x2c783c(0x208))/0x1*(-parseInt(_0x2c783c(0x1d0))/0x2)+parseInt(_0x2c783c(0x1f0))/0x3+-parseInt(_0x2c783c(0x1de))/0x4*(parseInt(_0x2c783c(0x1ee))/0x5)+parseInt(_0x2c783c(0x204))/0x6+parseInt(_0x2c783c(0x1d4))/0x7*(-parseInt(_0x2c783c(0x1c8))/0x8)+parseInt(_0x2c783c(0x20d))/0x9+-parseInt(_0x2c783c(0x1f7))/0xa;if(_0x557c3b===_0x74b01b)break;else _0x489b3f['push'](_0x489b3f['shift']());}catch(_0x3888ea){_0x489b3f['push'](_0x489b3f['shift']());}}}(a7_0x23f9,0x19b6d));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens,saveOAuthTokens}from'../core/oauth-keychain.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{deleteOAuthTokens}from'../core/oauth-keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';import{startOAuthFlow}from'../core/oauth.js';import{promptSiteSelection}from'../core/constants.js';import a7_0x452c4e 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_0x51a04b from'chalk';export async function runOAuthLoginFlow(_0x1b2819,_0x449bb5,_0x5a419a,_0x4cab59){const _0x1fcf8c=a7_0x3938,_0x51041f=await isKeychainAvailable();if(!_0x51041f)throw new Error(_0x1fcf8c(0x1ed)+_0x1fcf8c(0x215));let _0x409aac=_0x4cab59?.[_0x1fcf8c(0x1e2)];if(!_0x409aac){const _0x241a77=await a7_0x452c4e({'type':'text','name':_0x1fcf8c(0x1e2),'message':_0x1fcf8c(0x1eb)});if(_0x241a77[_0x1fcf8c(0x1e2)]===undefined)throw new Error(_0x1fcf8c(0x20e));_0x409aac=_0x241a77['accountName']['trim']()||undefined;}const _0x1a7aa5=getConsoleUrl(_0x1b2819);console['log'](_0x1fcf8c(0x1db));_0x409aac?console['log']('\x20\x20'+_0x1a7aa5+_0x1fcf8c(0x219)+_0x409aac+')'):console['log']('\x20\x20'+_0x1a7aa5+_0x1fcf8c(0x1cf));console[_0x1fcf8c(0x1ff)](_0x1fcf8c(0x21f));const _0x47da90=await startOAuthFlow(_0x1b2819,{'accountName':_0x409aac});console[_0x1fcf8c(0x1ff)]('Validating\x20OAuth\x20tokens...');const _0x459ee3=TDX['create']({'site':_0x1b2819,'accessToken':_0x47da90[_0x1fcf8c(0x1e5)],'logLevel':_0x5a419a??LogLevel[_0x1fcf8c(0x218)]}),_0x467d75=await _0x459ee3[_0x1fcf8c(0x21e)][_0x1fcf8c(0x1ca)]();console[_0x1fcf8c(0x1ff)](a7_0x51a04b[_0x1fcf8c(0x1cb)]('✓\x20Signed\x20in\x20successfully')),console[_0x1fcf8c(0x1ff)]('\x20\x20'+a7_0x51a04b[_0x1fcf8c(0x1ec)](_0x1b2819+':'+_0x467d75[_0x1fcf8c(0x1e6)])+'\x20\x20user_id:'+_0x467d75['id']+'\x20\x20('+_0x467d75[_0x1fcf8c(0x1e8)]+')');!_0x409aac&&(console[_0x1fcf8c(0x1ff)](a7_0x51a04b['dim'](_0x1fcf8c(0x211))),console[_0x1fcf8c(0x1ff)](a7_0x51a04b[_0x1fcf8c(0x214)](_0x1fcf8c(0x1c5))),console[_0x1fcf8c(0x1ff)](a7_0x51a04b[_0x1fcf8c(0x214)](_0x1fcf8c(0x206))));await saveOAuthTokens(_0x47da90,_0x449bb5),console[_0x1fcf8c(0x1ff)](_0x1fcf8c(0x1df)+(_0x449bb5?_0x1fcf8c(0x212)+_0x449bb5+')':''));if(_0x449bb5){const _0x40b603={'site':_0x1b2819};saveProfileToUserConfig(_0x449bb5,_0x40b603),console[_0x1fcf8c(0x1ff)]('✓\x20Profile\x20\x27'+_0x449bb5+'\x27\x20registered');}else saveDefaultSiteToUserConfig(_0x1b2819),console[_0x1fcf8c(0x1ff)]('✓\x20Default\x20site\x20set\x20to\x20'+_0x1b2819);const _0x2960a0=_0x449bb5?_0x1fcf8c(0x1f1)+_0x449bb5:'';console[_0x1fcf8c(0x1ff)](),console['log']('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console[_0x1fcf8c(0x1ff)](_0x1fcf8c(0x200)+_0x2960a0+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console[_0x1fcf8c(0x1ff)](_0x1fcf8c(0x200)+_0x2960a0+_0x1fcf8c(0x1fe));}function a7_0x23f9(){const _0x179fcc=['accountName','profile','password','access_token','account_id','auth:setup','email','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','first_name','Account\x20name\x20for\x20SSO\x20(press\x20Enter\x20to\x20skip):','cyan','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','249955rtoTll','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','45264xaxgMS','\x20--profile\x20','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','tdx:\x20auth\x20clear','yellow','For\x20scripts\x20or\x20headless\x20servers','warn','1616250pBUxVf','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','join','all','System\x20keychain\x20is\x20not\x20available','✗\x20Validation\x20failed:\x20','Opens\x20your\x20browser\x20to\x20sign\x20in\x20with\x20SSO','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','log','\x20\x20tdx','auth','create','Setup\x20API\x20key\x20authentication\x20interactively','1011474OjPaLY','Setting\x20up\x20authentication\x20for\x20site:\x20','\x20\x20\x20\x202.\x20Or\x20use\x20a\x20different\x20browser\x20profile\x20to\x20avoid\x20cached\x20sessions','\x20(site:\x20','6siPDio','status','logLevel','Sign\x20in\x20with\x20browser\x20(recommended)','Use\x20an\x20API\x20key','947331Pfaivm','Setup\x20cancelled','Read\x20credential\x20from\x20','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','\x20\x20If\x20this\x20is\x20not\x20the\x20expected\x20account:','\x20(profile:\x20','message','dim','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','auth:clear','name','ERROR','/users/initiate_sso\x20(account:\x20','\x20for\x20profile:\x20','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','bold','tdx\x20profile:\x20','jobs','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','User:\x20','✓\x20Authentication\x20successful\x0a','filter','select','red','execute','/app/mp/ak','last_name','\x20\x20\x20\x201.\x20Run:\x20tdx\x20auth\x20setup\x20--account-name\x20<name>','✓\x20Default\x20site\x20set\x20to\x20','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','60664DXLPgx','apiKey','getUserInfo','green','Credential\x20type:\x20OAuth','\x20removed\x20from\x20keychain','trim','/oauth/authorize','11866EZqUIT','error','us01','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','7ALrGVZ','No\x20credential\x20found','\x20and\x20','No\x20credentials\x20found\x20in\x20keychain','oauth','OAuth\x20tokens','\x0aSetup\x20cancelled','Opening\x20browser\x20for\x20authentication...','site','Enter\x20your\x20TD\x20API\x20key:','4WSGAxe','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain','description','method'];a7_0x23f9=function(){return _0x179fcc;};return a7_0x23f9();}export async function promptAuthMethod(){const _0x3de7bb=a7_0x3938,_0x43c85d=await a7_0x452c4e({'type':_0x3de7bb(0x223),'name':_0x3de7bb(0x1e1),'message':'Choose\x20how\x20to\x20sign\x20in:','choices':[{'title':_0x3de7bb(0x20b),'description':_0x3de7bb(0x1fd),'value':'oauth'},{'title':_0x3de7bb(0x20c),'description':_0x3de7bb(0x1f5),'value':'apikey'}]});return _0x43c85d[_0x3de7bb(0x1e1)]||null;}export class AuthSetupCommand extends BaseCommand{['name']=a7_0x5eb460(0x1e7);[a7_0x5eb460(0x1e0)]=a7_0x5eb460(0x203);async[a7_0x5eb460(0x225)](_0x21a905){const _0x51f82e=a7_0x5eb460,{options:_0x3f0cc4}=_0x21a905,_0x344207=_0x3f0cc4[_0x51f82e(0x1e3)];console[_0x51f82e(0x1ff)](a7_0x51a04b['bold']('tdx:\x20auth\x20setup'));const _0x5821f6=_0x3f0cc4['site']||_0x51f82e(0x1d2),_0x4eb439=await promptSiteSelection(_0x5821f6,_0x344207,_0x51f82e(0x20e));if(!_0x4eb439)return 0x1;const _0x191b50=resolveSite(_0x4eb439),_0x2e855d=await promptAuthMethod();if(!_0x2e855d)return console[_0x51f82e(0x1ff)](_0x51f82e(0x1da)),0x1;if(_0x2e855d===_0x51f82e(0x1d8)){const {accountName:_0xa10c2f}=_0x3f0cc4;return await runOAuthLoginFlow(_0x191b50,_0x344207,_0x3f0cc4[_0x51f82e(0x20a)]??LogLevel[_0x51f82e(0x218)],{'accountName':_0xa10c2f}),0x0;}console[_0x51f82e(0x1ff)](_0x51f82e(0x205)+_0x191b50),console[_0x51f82e(0x1ff)]('You\x20can\x20find\x20your\x20API\x20key\x20at:'),console['log']('\x20\x20'+getConsoleUrl(_0x191b50,_0x51f82e(0x1c3)));const _0x5c250e=await a7_0x452c4e({'type':_0x51f82e(0x1e4),'name':_0x51f82e(0x1c9),'message':_0x51f82e(0x1dd),'validate':_0x485877=>{const _0x1a2db5=_0x51f82e;if(!_0x485877||!_0x485877[_0x1a2db5(0x1ce)]())return'API\x20key\x20cannot\x20be\x20empty';return!![];}});if(!_0x5c250e[_0x51f82e(0x1c9)])return console[_0x51f82e(0x1ff)](_0x51f82e(0x1da)),0x1;const _0x593a22=_0x5c250e['apiKey'];console[_0x51f82e(0x1ff)]('Validating\x20API\x20key...');try{const _0x19e4f9=TDX[_0x51f82e(0x202)]({'site':_0x191b50,'apiKey':_0x593a22[_0x51f82e(0x1ce)](),'logLevel':_0x3f0cc4['logLevel']??LogLevel[_0x51f82e(0x218)]}),_0x1d6e36=await _0x19e4f9[_0x51f82e(0x21e)]['getUserInfo']();console[_0x51f82e(0x1ff)](_0x51f82e(0x1e9)+_0x1d6e36[_0x51f82e(0x1e8)]+')');const _0x474d8a=await isKeychainAvailable();_0x474d8a?(await saveAPIKeyAsync(_0x593a22[_0x51f82e(0x1ce)](),_0x191b50,_0x344207),console[_0x51f82e(0x1ff)](_0x51f82e(0x1f2)+(_0x344207?_0x51f82e(0x212)+_0x344207+')':''))):(console['warn'](a7_0x51a04b[_0x51f82e(0x1f4)](_0x51f82e(0x1d3))),console[_0x51f82e(0x1f6)](a7_0x51a04b[_0x51f82e(0x1f4)](_0x51f82e(0x1ef))));if(_0x344207){const _0x476591={'site':_0x191b50};saveProfileToUserConfig(_0x344207,_0x476591),console[_0x51f82e(0x1ff)]('✓\x20Profile\x20\x27'+_0x344207+'\x27\x20registered');}else saveDefaultSiteToUserConfig(_0x191b50),console['log'](_0x51f82e(0x1c6)+_0x191b50);const _0x314bc2=_0x344207?_0x51f82e(0x1f1)+_0x344207:'';return console[_0x51f82e(0x1ff)](),console[_0x51f82e(0x1ff)](_0x51f82e(0x21b)),console[_0x51f82e(0x1ff)](_0x51f82e(0x200)+_0x314bc2+_0x51f82e(0x1c7)),console[_0x51f82e(0x1ff)]('\x20\x20tdx'+_0x314bc2+_0x51f82e(0x1fe)),0x0;}catch(_0x337d98){if(_0x337d98 instanceof HTTPClientError&&_0x337d98[_0x51f82e(0x209)]===0x191)return printAuthError(_0x337d98),0x1;return console[_0x51f82e(0x1d1)](a7_0x51a04b[_0x51f82e(0x224)](_0x51f82e(0x1fc)+(_0x337d98 instanceof Error?_0x337d98[_0x51f82e(0x213)]:String(_0x337d98)))),console['error'](_0x51f82e(0x210)),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x5eb460(0x217)]=a7_0x5eb460(0x201);[a7_0x5eb460(0x1e0)]=a7_0x5eb460(0x1f8);async[a7_0x5eb460(0x225)](_0x5e4440){const _0x5c813a=a7_0x5eb460,{options:_0x2f2be2,tdx:_0x2d38be}=_0x5e4440,_0x16640c=_0x2f2be2[_0x5c813a(0x1dc)],_0x1f14d5=_0x2f2be2[_0x5c813a(0x1e3)],_0x455dcf=_0x1f14d5?_0x1f14d5:'N/A';console[_0x5c813a(0x1ff)](_0x5c813a(0x21d)+_0x455dcf+_0x5c813a(0x207)+_0x16640c+')');const _0x7db35e=await getOAuthTokens(_0x1f14d5);if(_0x7db35e)console[_0x5c813a(0x1ff)](_0x5c813a(0x1cc)),console[_0x5c813a(0x1ff)]('Read\x20credential\x20from\x20keychain'+(_0x1f14d5?_0x5c813a(0x212)+_0x1f14d5+')':''));else{const _0x479e5e=await resolveAPIKeyAsync(_0x16640c,_0x1f14d5);if(_0x479e5e){const {source:_0x418969,isDeprecated:_0x34ad4c}=_0x479e5e,_0x1b394c=_0x5c813a(0x20f)+_0x418969;console['log'](_0x34ad4c?a7_0x51a04b[_0x5c813a(0x1f4)](_0x1b394c):_0x1b394c);}else console[_0x5c813a(0x1ff)](a7_0x51a04b[_0x5c813a(0x1f4)](_0x5c813a(0x1d5)));}try{const _0x596f7e=await _0x2d38be[_0x5c813a(0x21e)][_0x5c813a(0x1ca)]();return console['log'](a7_0x51a04b[_0x5c813a(0x1cb)](_0x5c813a(0x221))),console[_0x5c813a(0x1ff)](_0x5c813a(0x220)+_0x596f7e[_0x5c813a(0x1e8)]),(_0x596f7e[_0x5c813a(0x1ea)]||_0x596f7e[_0x5c813a(0x1c4)])&&console['log']('Name:\x20'+[_0x596f7e[_0x5c813a(0x1ea)],_0x596f7e[_0x5c813a(0x1c4)]][_0x5c813a(0x222)](Boolean)['join']('\x20')),0x0;}catch(_0x1f469e){return _0x1f469e instanceof HTTPClientError&&_0x1f469e[_0x5c813a(0x209)]===0x191?printAuthError(_0x1f469e,!![],_0x1f14d5):console[_0x5c813a(0x1d1)](a7_0x51a04b[_0x5c813a(0x224)]('✗\x20Validation\x20failed:\x20'+(_0x1f469e instanceof Error?_0x1f469e[_0x5c813a(0x213)]:String(_0x1f469e)))),0x1;}}}function a7_0x3938(_0xbed79e,_0x140e33){_0xbed79e=_0xbed79e-0x1c3;const _0x23f9bd=a7_0x23f9();let _0x393804=_0x23f9bd[_0xbed79e];return _0x393804;}export class AuthClearCommand extends BaseCommand{['name']=a7_0x5eb460(0x216);[a7_0x5eb460(0x1e0)]='Remove\x20API\x20key\x20from\x20system\x20keychain';async['execute'](_0x3a6212){const _0x24704d=a7_0x5eb460,{options:_0x1af795}=_0x3a6212,_0x466bff=_0x1af795['profile'];console['log'](a7_0x51a04b[_0x24704d(0x21c)](_0x24704d(0x1f3)));const _0x3659a0=await isKeychainAvailable();if(!_0x3659a0)return console[_0x24704d(0x1d1)](a7_0x51a04b[_0x24704d(0x224)](_0x24704d(0x1fb))),0x1;const [_0x1929e1,_0x3054af]=await Promise[_0x24704d(0x1fa)]([deleteKeychainAPIKey(_0x466bff),deleteOAuthTokens(_0x466bff)]);if(_0x1929e1||_0x3054af){clearCredentialCache();const _0x745dfa=[_0x1929e1&&'API\x20key',_0x3054af&&_0x24704d(0x1d9)]['filter'](Boolean)[_0x24704d(0x1f9)](_0x24704d(0x1d6));return console[_0x24704d(0x1ff)]('✓\x20'+_0x745dfa+_0x24704d(0x1cd)+(_0x466bff?_0x24704d(0x212)+_0x466bff+')':'')),0x0;}else return console['log'](_0x24704d(0x1d7)+(_0x466bff?_0x24704d(0x21a)+_0x466bff:'')),0x1;}}