@treasuredata/tdx 2026.5.1 → 2026.6.0

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 (228) 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/table-deleted.js +1 -1
  51. package/dist/commands/tables.js +1 -1
  52. package/dist/commands/unset-command.js +1 -1
  53. package/dist/commands/upgrade-command.js +1 -1
  54. package/dist/commands/use-command.js +1 -1
  55. package/dist/commands/user-command.js +1 -1
  56. package/dist/commands/work-command.js +1 -1
  57. package/dist/commands/workflow-command.js +1 -1
  58. package/dist/core/auth.js +1 -1
  59. package/dist/core/command-output.js +1 -1
  60. package/dist/core/config.js +1 -1
  61. package/dist/core/connection-cache.js +1 -1
  62. package/dist/core/constants.js +1 -1
  63. package/dist/core/credential-cache.js +1 -1
  64. package/dist/core/global-context.js +1 -1
  65. package/dist/core/keychain.js +1 -1
  66. package/dist/core/oauth-keychain.js +1 -1
  67. package/dist/core/oauth.js +1 -1
  68. package/dist/core/profile.js +1 -1
  69. package/dist/core/project-config.js +1 -1
  70. package/dist/core/session.js +1 -1
  71. package/dist/core/user-cache.js +1 -1
  72. package/dist/core/version.js +1 -1
  73. package/dist/index.js +1 -1
  74. package/dist/mcp/server.js +1 -1
  75. package/dist/mcp/tools/index.js +1 -1
  76. package/dist/mcp/tools/tdx-run.js +1 -1
  77. package/dist/mcp/tools/tdx-search.js +1 -1
  78. package/dist/mcp/tools/work-create-item.js +1 -1
  79. package/dist/mcp/utils.js +1 -1
  80. package/dist/proxy/claude-usage-tracker.js +1 -1
  81. package/dist/proxy/passthrough-server.js +1 -1
  82. package/dist/proxy/sse-usage-parser.js +1 -1
  83. package/dist/sdk/agent/agent-config.js +1 -1
  84. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  85. package/dist/sdk/agent/agent-yaml.js +1 -1
  86. package/dist/sdk/agent/test/evaluator.js +1 -1
  87. package/dist/sdk/agent/test/executor.js +1 -1
  88. package/dist/sdk/agent/test/index.js +1 -1
  89. package/dist/sdk/agent/test/output.js +1 -1
  90. package/dist/sdk/agent/test/parser.js +1 -1
  91. package/dist/sdk/agent/tool-target-registry.js +1 -1
  92. package/dist/sdk/api.js +1 -1
  93. package/dist/sdk/cas/cas-api-client.js +1 -1
  94. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  95. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  96. package/dist/sdk/cas/index.js +1 -1
  97. package/dist/sdk/cas/pull-workflow.js +1 -1
  98. package/dist/sdk/cas/push-workflow.js +1 -1
  99. package/dist/sdk/client/cdp-api-client.js +1 -1
  100. package/dist/sdk/client/delivery-api-client.js +1 -1
  101. package/dist/sdk/client/endpoints.js +1 -1
  102. package/dist/sdk/client/engage-api-client.js +1 -1
  103. package/dist/sdk/client/http-client.js +1 -1
  104. package/dist/sdk/client/llm-api-client.js +1 -1
  105. package/dist/sdk/client/oauth-refresh.js +1 -1
  106. package/dist/sdk/client/rate-limiter.js +1 -1
  107. package/dist/sdk/client/td-api-client.js +1 -1
  108. package/dist/sdk/client/trino-api-client.js +1 -1
  109. package/dist/sdk/client/workflow-client.js +1 -1
  110. package/dist/sdk/connection-validator.js +1 -1
  111. package/dist/sdk/connection.js +1 -1
  112. package/dist/sdk/delivery.js +1 -1
  113. package/dist/sdk/engage/campaign-pull.js +1 -1
  114. package/dist/sdk/engage/campaign-push.js +1 -1
  115. package/dist/sdk/engage/campaign-validator.js +1 -1
  116. package/dist/sdk/engage/campaign-yaml.js +1 -1
  117. package/dist/sdk/engage/template-pull.js +1 -1
  118. package/dist/sdk/engage/template-push.js +1 -1
  119. package/dist/sdk/engage/template-validator.js +1 -1
  120. package/dist/sdk/engage/template-yaml.js +1 -1
  121. package/dist/sdk/engage/types/campaign-def.js +1 -1
  122. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  123. package/dist/sdk/engage/types/template-schema.js +1 -1
  124. package/dist/sdk/engage.js +1 -1
  125. package/dist/sdk/errors.js +1 -1
  126. package/dist/sdk/index.js +1 -1
  127. package/dist/sdk/io/index.js +1 -1
  128. package/dist/sdk/io/node-filesystem.js +1 -1
  129. package/dist/sdk/job.js +1 -1
  130. package/dist/sdk/journey.js +1 -1
  131. package/dist/sdk/llm/chat-cache.js +1 -1
  132. package/dist/sdk/llm/index.js +1 -1
  133. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  134. package/dist/sdk/llm/model-factors.js +1 -1
  135. package/dist/sdk/llm/user-settings.js +1 -1
  136. package/dist/sdk/personalization.js +1 -1
  137. package/dist/sdk/policy.js +1 -1
  138. package/dist/sdk/query/deleted-table-validation.js +1 -1
  139. package/dist/sdk/query/index.js +1 -1
  140. package/dist/sdk/query/sql-parser.js +1 -1
  141. package/dist/sdk/realtime.js +1 -1
  142. package/dist/sdk/schedule.js +1 -1
  143. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  144. package/dist/sdk/segment/fields-display.js +1 -1
  145. package/dist/sdk/segment/file-discovery.js +1 -1
  146. package/dist/sdk/segment/journey-utils.js +1 -1
  147. package/dist/sdk/segment/journey-validator.js +1 -1
  148. package/dist/sdk/segment/journey-yaml.js +1 -1
  149. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  150. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  151. package/dist/sdk/segment/pull-workflow.js +1 -1
  152. package/dist/sdk/segment/push-recovery.js +1 -1
  153. package/dist/sdk/segment/push-workflow.js +1 -1
  154. package/dist/sdk/segment/resolution-context.js +1 -1
  155. package/dist/sdk/segment/segment-path-parser.js +1 -1
  156. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  157. package/dist/sdk/segment/segment-validator.js +1 -1
  158. package/dist/sdk/segment/segment-validator.js.map +1 -1
  159. package/dist/sdk/segment/target-resolution.js +1 -1
  160. package/dist/sdk/segment/tdx-config.js +1 -1
  161. package/dist/sdk/segment/types/activation-schema.js +1 -1
  162. package/dist/sdk/segment/types/journey-def.js +1 -1
  163. package/dist/sdk/segment/types/journey-schema.js +1 -1
  164. package/dist/sdk/segment/types/segment-def.js +1 -1
  165. package/dist/sdk/segment/types/segment-schema.js +1 -1
  166. package/dist/sdk/segment/validate-files.js +1 -1
  167. package/dist/sdk/segment/yaml-validator.d.ts +1 -1
  168. package/dist/sdk/segment/yaml-validator.d.ts.map +1 -1
  169. package/dist/sdk/segment/yaml-validator.js +1 -1
  170. package/dist/sdk/segment/yaml-validator.js.map +1 -1
  171. package/dist/sdk/segment.js +1 -1
  172. package/dist/sdk/types/index.js +1 -1
  173. package/dist/sdk/types/progress.js +1 -1
  174. package/dist/sdk/types/workspace.js +1 -1
  175. package/dist/sdk/user.js +1 -1
  176. package/dist/sdk/util/format-detector.js +1 -1
  177. package/dist/sdk/util/formatters.js +1 -1
  178. package/dist/sdk/util/index.js +1 -1
  179. package/dist/sdk/util/paginate.js +1 -1
  180. package/dist/sdk/util/tree-formatter.js +1 -1
  181. package/dist/sdk/workflow/archive-validation.js +1 -1
  182. package/dist/sdk/workflow/clone-workflow.js +1 -1
  183. package/dist/sdk/workflow/index.js +1 -1
  184. package/dist/sdk/workflow/pull-workflow.js +1 -1
  185. package/dist/sdk/workflow/push-workflow.js +1 -1
  186. package/dist/sdk/workflow/task-graph.js +1 -1
  187. package/dist/sdk/workflow/tdx-config.js +1 -1
  188. package/dist/sdk/workflow/workflow-utils.js +1 -1
  189. package/dist/sdk/workspace/access-tracker.js +1 -1
  190. package/dist/sdk/workspace/frontmatter.js +1 -1
  191. package/dist/sdk/workspace/git.js +1 -1
  192. package/dist/sdk/workspace/index.js +1 -1
  193. package/dist/sdk/workspace/templates.js +1 -1
  194. package/dist/sdk/workspace/weekly.js +1 -1
  195. package/dist/sdk/workspace/wikilinks.js +1 -1
  196. package/dist/test-utils/command-runner.js +1 -1
  197. package/dist/test-utils/factories.js +1 -1
  198. package/dist/test-utils/fixtures.js +1 -1
  199. package/dist/test-utils/http-mock.js +1 -1
  200. package/dist/test-utils/index.js +1 -1
  201. package/dist/utils/async.js +1 -1
  202. package/dist/utils/colors.js +1 -1
  203. package/dist/utils/diff.js +1 -1
  204. package/dist/utils/file-permissions.js +1 -1
  205. package/dist/utils/file-reader.js +1 -1
  206. package/dist/utils/github-releases.js +1 -1
  207. package/dist/utils/global-cache.js +1 -1
  208. package/dist/utils/json-loader.js +1 -1
  209. package/dist/utils/local-cache.js +1 -1
  210. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  211. package/dist/utils/logger/formatters/index.js +1 -1
  212. package/dist/utils/logger/handlers/console-handler.js +1 -1
  213. package/dist/utils/logger/handlers/file-handler.js +1 -1
  214. package/dist/utils/logger/handlers/index.js +1 -1
  215. package/dist/utils/logger/handlers/null-handler.js +1 -1
  216. package/dist/utils/logger/index.js +1 -1
  217. package/dist/utils/logger/logger.js +1 -1
  218. package/dist/utils/logger/types.js +1 -1
  219. package/dist/utils/option-validation.js +1 -1
  220. package/dist/utils/process.js +1 -1
  221. package/dist/utils/prompt.js +1 -1
  222. package/dist/utils/spinner.js +1 -1
  223. package/dist/utils/sse-parser.js +1 -1
  224. package/dist/utils/string-utils.js +1 -1
  225. package/dist/utils/table-ref-parser.js +1 -1
  226. package/dist/utils/tdx-logger.js +1 -1
  227. package/dist/utils/version-check.js +1 -1
  228. package/package.json +1 -1
@@ -1 +1 @@
1
- const a3_0x32cb5d=a3_0x57a6;(function(_0x47b04c,_0x1705c4){const _0x33254f=a3_0x57a6,_0x3f1925=_0x47b04c();while(!![]){try{const _0xd74725=-parseInt(_0x33254f(0x15b))/0x1*(-parseInt(_0x33254f(0x171))/0x2)+parseInt(_0x33254f(0x158))/0x3*(parseInt(_0x33254f(0x162))/0x4)+parseInt(_0x33254f(0x170))/0x5*(parseInt(_0x33254f(0x16b))/0x6)+-parseInt(_0x33254f(0x164))/0x7+-parseInt(_0x33254f(0x173))/0x8*(parseInt(_0x33254f(0x159))/0x9)+parseInt(_0x33254f(0x15f))/0xa*(parseInt(_0x33254f(0x160))/0xb)+-parseInt(_0x33254f(0x15d))/0xc*(parseInt(_0x33254f(0x155))/0xd);if(_0xd74725===_0x1705c4)break;else _0x3f1925['push'](_0x3f1925['shift']());}catch(_0x41855e){_0x3f1925['push'](_0x3f1925['shift']());}}}(a3_0x4e9a,0xe8a25));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_0x57a6(_0x40afa7,_0x4ff883){_0x40afa7=_0x40afa7-0x14f;const _0x4e9a0d=a3_0x4e9a();let _0x57a648=_0x4e9a0d[_0x40afa7];return _0x57a648;}import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';function a3_0x4e9a(){const _0x291e53=['description','length','Child\x20name:\x20','\x20\x20Cause:\x20','List\x20activations\x20for\x20a\x20segment','data','258vcshLJ','Error:\x20','listActivations','Error:\x20Segment\x20name\x20is\x20required','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','36690qzNnSs','634uVDSRq','site','3961352WDWquE','verbose','segment','execute','message','error','activations','988VHCJTf','cause','Listing\x20activations\x20for\x20segment\x20\x27','4523979RTiFUv','9ppCsqU','\x20activation','1oBYORz','\x27...','98232qoMLOi','Resolved\x20child\x20ID:\x20','1490xwmoaq','130394nqwRxK','Resolving\x20parent\x20segment\x20\x27','4uyHlXj','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','10639412qzIKiF'];a3_0x4e9a=function(){return _0x291e53;};return a3_0x4e9a();}export class ActivationsCommand extends BaseCommand{['name']=a3_0x32cb5d(0x154);[a3_0x32cb5d(0x165)]=a3_0x32cb5d(0x169);async[a3_0x32cb5d(0x151)](_0x4e4956){const _0x148686=a3_0x32cb5d,{options:_0x314682,args:_0x59bcd5,tdx:_0x1d6b4a}=_0x4e4956;if(_0x59bcd5[_0x148686(0x166)]===0x0)return console['error'](_0x148686(0x16e)),console[_0x148686(0x153)](_0x148686(0x163)),0x1;try{const {parentId:_0x3b4789,childId:_0x2dd000}=parseSegmentRef(_0x59bcd5[0x0]);if(!_0x2dd000)return console[_0x148686(0x153)](_0x148686(0x16f)),console[_0x148686(0x153)](_0x148686(0x163)),0x1;_0x314682[_0x148686(0x14f)]&&(console[_0x148686(0x153)]('Site:\x20'+_0x314682[_0x148686(0x172)]),console[_0x148686(0x153)]('Parent\x20name:\x20'+_0x3b4789),console['error'](_0x148686(0x167)+_0x2dd000));const _0xf6e9a2=await withSpinner(_0x148686(0x161)+_0x3b4789+'\x27...',()=>_0x1d6b4a[_0x148686(0x150)]['resolveParentId'](_0x3b4789),{'verbose':_0x314682['verbose']}),_0x5220fa=_0xf6e9a2['data'];_0x314682['verbose']&&console[_0x148686(0x153)]('Resolved\x20parent\x20ID:\x20'+_0x5220fa);const _0x43e634=await withSpinner('Resolving\x20child\x20segment\x20\x27'+_0x2dd000+'\x27...',()=>_0x1d6b4a[_0x148686(0x150)]['resolveSegmentId'](_0x5220fa,_0x2dd000),{'verbose':_0x314682[_0x148686(0x14f)]}),_0x31354c=_0x43e634[_0x148686(0x16a)];_0x314682[_0x148686(0x14f)]&&console[_0x148686(0x153)](_0x148686(0x15e)+_0x31354c);const _0x57c98a=await withSpinner(_0x148686(0x157)+_0x2dd000+_0x148686(0x15c),()=>_0x1d6b4a[_0x148686(0x150)][_0x148686(0x16d)](_0x5220fa,_0x31354c),{'verbose':_0x314682['verbose']}),_0x269313=_0x57c98a[_0x148686(0x16a)];return console['error']('✔\x20Found\x20'+_0x269313[_0x148686(0x166)]+_0x148686(0x15a)+(_0x269313[_0x148686(0x166)]!==0x1?'s':'')),await handleSDKOutput(_0x269313,_0x314682),0x0;}catch(_0x4ce697){if(_0x4ce697 instanceof SDKError)return console[_0x148686(0x153)](_0x148686(0x16c)+_0x4ce697[_0x148686(0x152)]),_0x4ce697[_0x148686(0x156)]&&console[_0x148686(0x153)](_0x148686(0x168)+_0x4ce697[_0x148686(0x156)]),0x1;throw _0x4ce697;}}}
1
+ const a3_0x3666ef=a3_0x483f;(function(_0x5a013a,_0x4e0a2b){const _0x52f2b6=a3_0x483f,_0x149189=_0x5a013a();while(!![]){try{const _0xd50913=-parseInt(_0x52f2b6(0x125))/0x1*(-parseInt(_0x52f2b6(0x103))/0x2)+parseInt(_0x52f2b6(0x106))/0x3+-parseInt(_0x52f2b6(0x114))/0x4+-parseInt(_0x52f2b6(0xfe))/0x5*(-parseInt(_0x52f2b6(0x11b))/0x6)+parseInt(_0x52f2b6(0x113))/0x7*(parseInt(_0x52f2b6(0x105))/0x8)+parseInt(_0x52f2b6(0x111))/0x9*(-parseInt(_0x52f2b6(0x10d))/0xa)+parseInt(_0x52f2b6(0x11d))/0xb*(-parseInt(_0x52f2b6(0x121))/0xc);if(_0xd50913===_0x4e0a2b)break;else _0x149189['push'](_0x149189['shift']());}catch(_0x573601){_0x149189['push'](_0x149189['shift']());}}}(a3_0x29be,0x3c203));function a3_0x29be(){const _0x327bad=['activations','Resolving\x20parent\x20segment\x20\x27','\x20activation','name','resolveSegmentId','Site:\x20','120NinLuq','Child\x20name:\x20','message','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','170217oTKfkC','List\x20activations\x20for\x20a\x20segment','7QVICuG','1093780VXUYHZ','\x27...','data','Resolved\x20child\x20ID:\x20','\x20\x20Cause:\x20','execute','Error:\x20Segment\x20name\x20is\x20required','1835814poQusX','segment','11XZvYYf','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','✔\x20Found\x20','cause','176004arNmzK','error','description','length','2hELNdo','5yaOipM','site','Parent\x20name:\x20','resolveParentId','Resolved\x20parent\x20ID:\x20','91090LjBgTP','verbose','1354632nHCnOa','584865BYmTIA'];a3_0x29be=function(){return _0x327bad;};return a3_0x29be();}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';function a3_0x483f(_0x48bfce,_0x2d72ed){_0x48bfce=_0x48bfce-0xfe;const _0x29be99=a3_0x29be();let _0x483f0d=_0x29be99[_0x48bfce];return _0x483f0d;}export class ActivationsCommand extends BaseCommand{[a3_0x3666ef(0x10a)]=a3_0x3666ef(0x107);[a3_0x3666ef(0x123)]=a3_0x3666ef(0x112);async[a3_0x3666ef(0x119)](_0x23e55e){const _0x672195=a3_0x3666ef,{options:_0x25346b,args:_0x560406,tdx:_0x5c8a80}=_0x23e55e;if(_0x560406[_0x672195(0x124)]===0x0)return console['error'](_0x672195(0x11a)),console[_0x672195(0x122)](_0x672195(0x11e)),0x1;try{const {parentId:_0x3497d4,childId:_0x42e0a1}=parseSegmentRef(_0x560406[0x0]);if(!_0x42e0a1)return console[_0x672195(0x122)](_0x672195(0x110)),console[_0x672195(0x122)](_0x672195(0x11e)),0x1;_0x25346b[_0x672195(0x104)]&&(console['error'](_0x672195(0x10c)+_0x25346b[_0x672195(0xff)]),console[_0x672195(0x122)](_0x672195(0x100)+_0x3497d4),console[_0x672195(0x122)](_0x672195(0x10e)+_0x42e0a1));const _0x1eead8=await withSpinner(_0x672195(0x108)+_0x3497d4+_0x672195(0x115),()=>_0x5c8a80[_0x672195(0x11c)][_0x672195(0x101)](_0x3497d4),{'verbose':_0x25346b[_0x672195(0x104)]}),_0x429ffb=_0x1eead8['data'];_0x25346b[_0x672195(0x104)]&&console[_0x672195(0x122)](_0x672195(0x102)+_0x429ffb);const _0x18044d=await withSpinner('Resolving\x20child\x20segment\x20\x27'+_0x42e0a1+'\x27...',()=>_0x5c8a80['segment'][_0x672195(0x10b)](_0x429ffb,_0x42e0a1),{'verbose':_0x25346b[_0x672195(0x104)]}),_0x543126=_0x18044d[_0x672195(0x116)];_0x25346b[_0x672195(0x104)]&&console[_0x672195(0x122)](_0x672195(0x117)+_0x543126);const _0x1da45d=await withSpinner('Listing\x20activations\x20for\x20segment\x20\x27'+_0x42e0a1+_0x672195(0x115),()=>_0x5c8a80[_0x672195(0x11c)]['listActivations'](_0x429ffb,_0x543126),{'verbose':_0x25346b[_0x672195(0x104)]}),_0x5933ad=_0x1da45d[_0x672195(0x116)];return console[_0x672195(0x122)](_0x672195(0x11f)+_0x5933ad[_0x672195(0x124)]+_0x672195(0x109)+(_0x5933ad['length']!==0x1?'s':'')),await handleSDKOutput(_0x5933ad,_0x25346b),0x0;}catch(_0x1665c3){if(_0x1665c3 instanceof SDKError)return console[_0x672195(0x122)]('Error:\x20'+_0x1665c3[_0x672195(0x10f)]),_0x1665c3[_0x672195(0x120)]&&console[_0x672195(0x122)](_0x672195(0x118)+_0x1665c3[_0x672195(0x120)]),0x1;throw _0x1665c3;}}}
@@ -1 +1 @@
1
- const a4_0x16622d=a4_0x5a68;(function(_0xdcb112,_0x4b816a){const _0x1f01e2=a4_0x5a68,_0x55818=_0xdcb112();while(!![]){try{const _0xe23534=parseInt(_0x1f01e2(0xdf))/0x1*(parseInt(_0x1f01e2(0xbf))/0x2)+parseInt(_0x1f01e2(0xfc))/0x3*(-parseInt(_0x1f01e2(0x100))/0x4)+-parseInt(_0x1f01e2(0xb4))/0x5+-parseInt(_0x1f01e2(0xe4))/0x6+parseInt(_0x1f01e2(0xab))/0x7*(-parseInt(_0x1f01e2(0xd0))/0x8)+parseInt(_0x1f01e2(0x88))/0x9+parseInt(_0x1f01e2(0xe6))/0xa;if(_0xe23534===_0x4b816a)break;else _0x55818['push'](_0x55818['shift']());}catch(_0x44e979){_0x55818['push'](_0x55818['shift']());}}}(a4_0x8c10,0xe6c2b));function a4_0x8c10(){const _0x3c2c28=['Analyzing\x20project\x20\x22','3GBpKAi','yes','Pulling\x20agent\x20\x22','diff','5693748pXSmlh','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','push','\x27\x20to\x20create\x20the\x20folder\x20structure.','\x0aError:','chatInterfaces','<new-name>','cyan','\x20\x20Experimental\x20Artifacts:\x20','session','\x0a✔\x20Pulled\x20','New\x20project\x20ID:\x20','\x0aChanges\x20to\x20chat\x20interface\x20\x27','context','agent:clone','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','\x20\x20Knowledge\x20Base\x20\x22','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','New\x20project:\x20','counts','\x22:\x20','-\x20no\x20files\x20written','Errors:','description','Cannot\x20clone\x20from\x20context\x20project\x20\x22','experimentalKnowledgeBases','errors','\x20\x20Integrations:\x20','Analyzing\x20changes\x20to\x20push...','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','Dry\x20run\x20-\x20no\x20changes\x20made','Project:\x20','experimentalArtifacts','outputDir','projectId','prompts','join','✔\x20Context\x20set:\x20','\x22...','agent:pull','Status:\x20','\x20\x20tdx\x20agent\x20pull\x20','No\x20tdx.json\x20found\x20in\x20','projectName','tdx.json','\x20--profile\x20','execute','\x20\x20Source:\x20','error','\x0aChanges\x20to\x20agent\x20\x27','\x20\x20Agent\x20\x22','cloneProject','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','agentName','\x20\x20Chat\x20Interfaces:\x20','\x20successfully','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','Agent:\x20','Agent\x20pulled\x20successfully','\x0a✔\x20Pushed\x20','\x0aPush\x20summary\x20for\x20\x27','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','integrations','newProjectName','\x20unchanged','\x0aPush\x20','Cancelled','\x20\x20Text\x20Knowledge\x20Bases:\x20','agent','\x20|\x20','10387188bNNjAY','textKnowledgeBases','gray','\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','llm','MISSING_ARGUMENT','found','\x0aProject\x20pushed\x20with\x20errors','no_context','sourceProjectName','Using\x20current\x20project:\x20','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','\x20=\x20','\x20--name\x20','\x20\x20Form\x20Interfaces:\x20','Would\x20clone:','formInterfaces','knowledgeBases','agent:push','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','\x20\x20Integration\x20\x22','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','Pushing\x20agent\x20from\x20\x22','\x20\x20Prompts:\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)','Using\x20context\x20project:\x20','pushProject','site','INVALID_ARGUMENT','cwd-config','\x0aErrors\x20found:','llmProject','Output:\x20','Agent\x20','\x20\x20Experimental\x20Artifact\x20\x22','2151527hxmyMD','\x20resources?','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','\x0aChanges\x20to\x20form\x20interface\x20\x27','yellow','agents','red','\x22\x20to\x20a\x20different\x20profile','message','1718195TjmOkO','\x20\x20Knowledge\x20Bases:\x20','cwd','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','pullProject','dim','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','repeat','\x22\x20to\x20new\x20project\x20\x22','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','3222224USQGhw','\x20created','dryRun','Would\x20push\x20agent:\x20','Chat:\x20','outputPath','\x20\x20Chat\x20Interface\x20\x22','Dry\x20run\x20-\x20no\x20files\x20written','Pushing\x20to\x20project...','\x20\x20Prompt\x20\x22','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','updated','\x0aChanges\x20to\x20integration\x20\x27','created','source','\x20\x20Text\x20Knowledge\x20Base\x20\x22','Would\x20pull\x20agent:\x20','16jcQeLA','unchanged','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','Output\x20path:\x20','\x20\x20Target:\x20','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','\x20\x20Form\x20Interface\x20\x22','action','parse','total','pushAgent','Source:\x20','\x0aPull\x20summary\x20for\x20\x27','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','1gYGGnF','hasChanges','llm_project','\x20updated','profile','3629370Xvykgq','\x0aWrite\x20','11666440eaJhlC','\x20\x20Agents:\x20','newProjectId','\x20new','\x22\x20to\x20\x22','name','agentId','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','log','new','\x0aChanges\x20to\x20prompt\x20\x27','pullAgent','dirname','utf-8','reason','Summary:','-\x20nothing\x20pushed','Using\x20project:\x20','Using\x20local\x20project:\x20','\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','green'];a4_0x8c10=function(){return _0x3c2c28;};return a4_0x8c10();}import a4_0x18d530 from'chalk';function a4_0x5a68(_0x3a929e,_0x4d409b){_0x3a929e=_0x3a929e-0x85;const _0x8c1002=a4_0x8c10();let _0x5a681e=_0x8c1002[_0x3a929e];return _0x5a681e;}import a4_0x1b3042 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(_0x2c2579){const _0x3849ba=a4_0x5a68,_0xfc9d6a=[];if(_0x2c2579[_0x3849ba(0xda)]!==undefined)_0xfc9d6a[_0x3849ba(0x102)](_0x2c2579['total']+'\x20total');if(_0x2c2579[_0x3849ba(0xef)]!==undefined&&_0x2c2579['new']>0x0)_0xfc9d6a[_0x3849ba(0x102)](a4_0x18d530[_0x3849ba(0xfa)](_0x2c2579['new']+_0x3849ba(0xe9)));if(_0x2c2579['created']!==undefined&&_0x2c2579['created']>0x0)_0xfc9d6a[_0x3849ba(0x102)](a4_0x18d530[_0x3849ba(0xfa)](_0x2c2579[_0x3849ba(0xcc)]+_0x3849ba(0xc0)));if(_0x2c2579['updated']!==undefined&&_0x2c2579[_0x3849ba(0xca)]>0x0)_0xfc9d6a['push'](a4_0x18d530[_0x3849ba(0xaf)](_0x2c2579['updated']+_0x3849ba(0xe2)));if(_0x2c2579[_0x3849ba(0xd1)]!==undefined&&_0x2c2579[_0x3849ba(0xd1)]>0x0)_0xfc9d6a[_0x3849ba(0x102)](a4_0x18d530[_0x3849ba(0x8a)](_0x2c2579[_0x3849ba(0xd1)]+_0x3849ba(0x141)));if(_0x2c2579[_0x3849ba(0x11a)]!==undefined&&_0x2c2579[_0x3849ba(0x11a)]>0x0)_0xfc9d6a[_0x3849ba(0x102)](a4_0x18d530['red'](_0x2c2579[_0x3849ba(0x11a)]+'\x20errors'));return _0xfc9d6a[_0x3849ba(0x124)](',\x20');}function displayDiffs(_0x2a8064,_0x59f8d4,_0x204161,_0x4a9771,_0x553223,_0x4d23c8,_0x37ccfc,_0x1ef68b,_0x2dec61){const _0x359ee9=a4_0x5a68;for(const _0x193f0e of _0x2a8064){if(_0x193f0e['diff']){const _0x36e94b=_0x193f0e[_0x359ee9(0x135)]||_0x193f0e[_0x359ee9(0xeb)];console[_0x359ee9(0xee)](_0x359ee9(0x131)+_0x36e94b+'\x27:'),console['log']('─'[_0x359ee9(0xbc)](0x3c)),console['log'](_0x193f0e[_0x359ee9(0xff)]),console[_0x359ee9(0xee)]('─'[_0x359ee9(0xbc)](0x3c));}}for(const _0x5d2663 of _0x59f8d4){_0x5d2663[_0x359ee9(0xff)]&&(console['log'](_0x359ee9(0xd2)+_0x5d2663[_0x359ee9(0xeb)]+'\x27:'),console['log']('─'[_0x359ee9(0xbc)](0x3c)),console[_0x359ee9(0xee)](_0x5d2663[_0x359ee9(0xff)]),console[_0x359ee9(0xee)]('─'[_0x359ee9(0xbc)](0x3c)));}for(const _0x3fe51c of _0x204161){_0x3fe51c[_0x359ee9(0xff)]&&(console[_0x359ee9(0xee)]('\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27'+_0x3fe51c['name']+'\x27:'),console[_0x359ee9(0xee)]('─'[_0x359ee9(0xbc)](0x3c)),console[_0x359ee9(0xee)](_0x3fe51c[_0x359ee9(0xff)]),console['log']('─'['repeat'](0x3c)));}for(const _0x510331 of _0x4a9771){_0x510331[_0x359ee9(0xff)]&&(console[_0x359ee9(0xee)](_0x359ee9(0xf0)+_0x510331['name']+'\x27:'),console['log']('─'[_0x359ee9(0xbc)](0x3c)),console[_0x359ee9(0xee)](_0x510331[_0x359ee9(0xff)]),console[_0x359ee9(0xee)]('─'[_0x359ee9(0xbc)](0x3c)));}for(const _0x5475d0 of _0x553223){_0x5475d0[_0x359ee9(0xff)]&&(console[_0x359ee9(0xee)](_0x359ee9(0xcb)+_0x5475d0[_0x359ee9(0xeb)]+'\x27:'),console[_0x359ee9(0xee)]('─'[_0x359ee9(0xbc)](0x3c)),console[_0x359ee9(0xee)](_0x5475d0[_0x359ee9(0xff)]),console['log']('─'['repeat'](0x3c)));}for(const _0x3ddfc7 of _0x4d23c8){_0x3ddfc7[_0x359ee9(0xff)]&&(console[_0x359ee9(0xee)](_0x359ee9(0x9b)+_0x3ddfc7[_0x359ee9(0xeb)]+'\x27:'),console[_0x359ee9(0xee)]('─'[_0x359ee9(0xbc)](0x3c)),console[_0x359ee9(0xee)](_0x3ddfc7[_0x359ee9(0xff)]),console[_0x359ee9(0xee)]('─'[_0x359ee9(0xbc)](0x3c)));}for(const _0x1bdb0d of _0x37ccfc){_0x1bdb0d[_0x359ee9(0xff)]&&(console['log'](_0x359ee9(0xad)+_0x1bdb0d[_0x359ee9(0xeb)]+'\x27:'),console[_0x359ee9(0xee)]('─'[_0x359ee9(0xbc)](0x3c)),console[_0x359ee9(0xee)](_0x1bdb0d[_0x359ee9(0xff)]),console[_0x359ee9(0xee)]('─'[_0x359ee9(0xbc)](0x3c)));}for(const _0x26d79a of _0x1ef68b){_0x26d79a[_0x359ee9(0xff)]&&(console[_0x359ee9(0xee)](_0x359ee9(0xae)+_0x26d79a[_0x359ee9(0xeb)]+'\x27:'),console[_0x359ee9(0xee)]('─'[_0x359ee9(0xbc)](0x3c)),console[_0x359ee9(0xee)](_0x26d79a[_0x359ee9(0xff)]),console[_0x359ee9(0xee)]('─'[_0x359ee9(0xbc)](0x3c)));}for(const _0x168ea0 of _0x2dec61){_0x168ea0[_0x359ee9(0xff)]&&(console[_0x359ee9(0xee)](_0x359ee9(0x10c)+_0x168ea0[_0x359ee9(0xeb)]+'\x27:'),console[_0x359ee9(0xee)]('─'['repeat'](0x3c)),console[_0x359ee9(0xee)](_0x168ea0[_0x359ee9(0xff)]),console[_0x359ee9(0xee)]('─'[_0x359ee9(0xbc)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x16622d(0xeb)]=a4_0x16622d(0x127);[a4_0x16622d(0x117)]=a4_0x16622d(0xb7);async[a4_0x16622d(0x12e)](_0x552421){const _0x32c37e=a4_0x16622d,{options:_0x98d5e5,args:_0x575b3b,tdx:_0x1fa5ea}=_0x552421,_0x557dda=_0x575b3b[0x0],_0x3d6187=_0x575b3b[0x1],_0x12d48f=_0x98d5e5['output'],_0x1387e5=_0x98d5e5[_0x32c37e(0xc1)],_0x287ee7=_0x98d5e5['force'],_0xbad98d=_0x98d5e5[_0x32c37e(0xfd)],_0x5ce7c0=_0x98d5e5[_0x32c37e(0xa7)],_0x36f080=_0x98d5e5[_0x32c37e(0x86)];let _0x2123d9;if(_0x557dda){const _0x569708=a4_0x1b3042[_0x32c37e(0x124)](_0x557dda,_0x32c37e(0x12c));if(existsSync(_0x569708))try{const _0x5ae09e=JSON['parse'](readFileSync(_0x569708,_0x32c37e(0xf3)));_0x5ae09e[_0x32c37e(0xe1)]&&(_0x2123d9={'llm_project':_0x5ae09e[_0x32c37e(0xe1)]});}catch{}}const _0x5f48a7=findAgentConfigPath(process[_0x32c37e(0xb6)]());let _0x1c8bd3;if(_0x5f48a7)try{const _0x21100e=JSON[_0x32c37e(0xd9)](readFileSync(_0x5f48a7,_0x32c37e(0xf3)));_0x21100e[_0x32c37e(0xe1)]&&(_0x1c8bd3={'llm_project':_0x21100e[_0x32c37e(0xe1)]});}catch{}const _0x5f1d50=resolveAgentPullArgs({'arg':_0x557dda,'agentNameArg':_0x3d6187,'agentFlag':_0x36f080,'contextProject':_0x5ce7c0,'argDirConfig':_0x2123d9,'cwdConfigPath':_0x5f48a7||undefined,'cwdConfig':_0x1c8bd3}),{projectNameOrId:_0x42e4cd,targetAgentName:_0x6b2ed8,existingOutputDir:_0xf72d84,source:_0x48d519}=_0x5f1d50;if(_0x48d519==='arg-dir')console[_0x32c37e(0xee)](a4_0x18d530[_0x32c37e(0xb9)]('Using\x20project\x20from\x20'+a4_0x1b3042[_0x32c37e(0x124)](_0x557dda,_0x32c37e(0x12c))+':\x20'+_0x42e4cd));else{if(_0x48d519===_0x32c37e(0xa5))console[_0x32c37e(0xee)](a4_0x18d530[_0x32c37e(0xb9)](_0x32c37e(0xf7)+_0x42e4cd));else _0x48d519===_0x32c37e(0x10d)&&console[_0x32c37e(0xee)](a4_0x18d530[_0x32c37e(0xb9)]('Using\x20project\x20from\x20context:\x20'+_0x42e4cd));}if(!_0x42e4cd)return _0x36f080?(console[_0x32c37e(0xee)](a4_0x18d530[_0x32c37e(0xaf)](_0x32c37e(0x11d))),console[_0x32c37e(0xee)]('Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>'),console[_0x32c37e(0xee)](_0x32c37e(0xde))):(console[_0x32c37e(0xee)](a4_0x18d530[_0x32c37e(0xaf)](_0x32c37e(0xd3))),console[_0x32c37e(0xee)]('Usage:\x20tdx\x20agent\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20project\x20(requires\x20context\x20or\x20tdx.json)'),console[_0x32c37e(0xee)]('\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[_0x32c37e(0xee)](_0x32c37e(0xf9)),console['log'](_0x32c37e(0x8b)),console['log']('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20project')),0x1;if(_0x6b2ed8){const {data:_0x4b18d5}=await withSpinner(_0x32c37e(0xfe)+_0x6b2ed8+'\x22\x20from\x20project\x20\x22'+_0x42e4cd+'\x22...',()=>_0x1fa5ea[_0x32c37e(0x8c)][_0x32c37e(0xf1)](_0x42e4cd,_0x6b2ed8,_0x12d48f,{'dryRun':_0x1387e5,'force':_0x287ee7}));if(_0x1387e5)return console[_0x32c37e(0xee)](a4_0x18d530[_0x32c37e(0xaf)](_0x32c37e(0xc6))),console[_0x32c37e(0xee)](_0x32c37e(0xcf)+_0x4b18d5[_0x32c37e(0x135)]),console['log'](_0x32c37e(0xd4)+_0x4b18d5[_0x32c37e(0xc4)]),_0x4b18d5[_0x32c37e(0xff)]&&(console['log']('\x0aChanges:'),console[_0x32c37e(0xee)]('─'['repeat'](0x3c)),console[_0x32c37e(0xee)](_0x4b18d5[_0x32c37e(0xff)]),console[_0x32c37e(0xee)]('─'[_0x32c37e(0xbc)](0x3c))),0x0;return console[_0x32c37e(0xee)](a4_0x18d530[_0x32c37e(0xfa)](_0x32c37e(0x13b))),console[_0x32c37e(0xee)](_0x32c37e(0x13a)+_0x4b18d5['agentName']),console[_0x32c37e(0xee)](_0x32c37e(0xa8)+_0x4b18d5[_0x32c37e(0xc4)]),console[_0x32c37e(0xee)](_0x32c37e(0x128)+(_0x4b18d5['isNew']?a4_0x18d530['green']('new'):_0x4b18d5[_0x32c37e(0xe0)]?a4_0x18d530[_0x32c37e(0xaf)](_0x32c37e(0xca)):a4_0x18d530[_0x32c37e(0x8a)]('unchanged'))),0x0;}const _0x3b8e09=_0xf72d84||_0x12d48f,{data:_0x1a3af7}=await withSpinner(_0x32c37e(0xfb)+_0x42e4cd+'\x22...',()=>_0x1fa5ea[_0x32c37e(0x8c)][_0x32c37e(0xb8)](_0x42e4cd,_0x3b8e09,{'dryRun':!![]})),_0x1fe2b9=_0x1a3af7[_0x32c37e(0x113)][_0x32c37e(0xb0)]['new']+_0x1a3af7[_0x32c37e(0x113)][_0x32c37e(0x99)]['new']+_0x1a3af7[_0x32c37e(0x113)][_0x32c37e(0x89)][_0x32c37e(0xef)]+_0x1a3af7[_0x32c37e(0x113)][_0x32c37e(0x123)][_0x32c37e(0xef)]+_0x1a3af7[_0x32c37e(0x113)]['integrations']['new']+_0x1a3af7[_0x32c37e(0x113)][_0x32c37e(0x119)][_0x32c37e(0xef)]+_0x1a3af7[_0x32c37e(0x113)][_0x32c37e(0x120)][_0x32c37e(0xef)]+_0x1a3af7[_0x32c37e(0x113)][_0x32c37e(0x98)][_0x32c37e(0xef)]+_0x1a3af7[_0x32c37e(0x113)]['chatInterfaces'][_0x32c37e(0xef)],_0x181322=_0x1a3af7[_0x32c37e(0x113)][_0x32c37e(0xb0)][_0x32c37e(0xca)]+_0x1a3af7['counts'][_0x32c37e(0x99)]['updated']+_0x1a3af7[_0x32c37e(0x113)][_0x32c37e(0x89)][_0x32c37e(0xca)]+_0x1a3af7[_0x32c37e(0x113)]['prompts'][_0x32c37e(0xca)]+_0x1a3af7[_0x32c37e(0x113)][_0x32c37e(0x13f)][_0x32c37e(0xca)]+_0x1a3af7[_0x32c37e(0x113)]['experimentalKnowledgeBases'][_0x32c37e(0xca)]+_0x1a3af7[_0x32c37e(0x113)][_0x32c37e(0x120)][_0x32c37e(0xca)]+_0x1a3af7['counts'][_0x32c37e(0x98)][_0x32c37e(0xca)]+_0x1a3af7[_0x32c37e(0x113)][_0x32c37e(0x105)]['updated'],_0x183d73=_0x1a3af7[_0x32c37e(0x113)]['agents']['unchanged']+_0x1a3af7[_0x32c37e(0x113)][_0x32c37e(0x99)][_0x32c37e(0xd1)]+_0x1a3af7[_0x32c37e(0x113)][_0x32c37e(0x89)]['unchanged']+_0x1a3af7[_0x32c37e(0x113)][_0x32c37e(0x123)][_0x32c37e(0xd1)]+_0x1a3af7[_0x32c37e(0x113)][_0x32c37e(0x13f)]['unchanged']+_0x1a3af7[_0x32c37e(0x113)]['experimentalKnowledgeBases']['unchanged']+_0x1a3af7['counts'][_0x32c37e(0x120)]['unchanged']+_0x1a3af7[_0x32c37e(0x113)][_0x32c37e(0x98)][_0x32c37e(0xd1)]+_0x1a3af7[_0x32c37e(0x113)]['chatInterfaces'][_0x32c37e(0xd1)];console[_0x32c37e(0xee)](_0x32c37e(0xdd)+_0x1a3af7[_0x32c37e(0x12b)]+'\x27:'),console[_0x32c37e(0xee)]('\x20\x20'+a4_0x18d530[_0x32c37e(0xfa)]('+\x20'+_0x1fe2b9+_0x32c37e(0xe9))+'\x20|\x20'+a4_0x18d530[_0x32c37e(0xaf)]('~\x20'+_0x181322+'\x20changed')+_0x32c37e(0x87)+a4_0x18d530['dim']('=\x20'+_0x183d73+'\x20unchanged')),console[_0x32c37e(0xee)](_0x32c37e(0xe7)+formatCountSummary(_0x1a3af7['counts'][_0x32c37e(0xb0)])),console[_0x32c37e(0xee)](_0x32c37e(0xb5)+formatCountSummary(_0x1a3af7[_0x32c37e(0x113)][_0x32c37e(0x99)])),console[_0x32c37e(0xee)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x1a3af7[_0x32c37e(0x113)][_0x32c37e(0x89)])),console[_0x32c37e(0xee)](_0x32c37e(0x9f)+formatCountSummary(_0x1a3af7[_0x32c37e(0x113)]['prompts'])),console['log'](_0x32c37e(0x11b)+formatCountSummary(_0x1a3af7[_0x32c37e(0x113)][_0x32c37e(0x13f)])),console[_0x32c37e(0xee)]('\x20\x20Form\x20Interfaces:\x20'+formatCountSummary(_0x1a3af7[_0x32c37e(0x113)][_0x32c37e(0x98)])),console[_0x32c37e(0xee)]('\x20\x20Chat\x20Interfaces:\x20'+formatCountSummary(_0x1a3af7[_0x32c37e(0x113)]['chatInterfaces']));const _0x58237c=_0x1a3af7[_0x32c37e(0x113)][_0x32c37e(0x119)][_0x32c37e(0xda)]>0x0||_0x1a3af7[_0x32c37e(0x113)][_0x32c37e(0x120)][_0x32c37e(0xda)]>0x0;_0x58237c&&(console[_0x32c37e(0xee)](_0x32c37e(0x134)+formatCountSummary(_0x1a3af7['counts'][_0x32c37e(0x119)])),console[_0x32c37e(0xee)](_0x32c37e(0x108)+formatCountSummary(_0x1a3af7[_0x32c37e(0x113)][_0x32c37e(0x120)])));console[_0x32c37e(0xee)](_0x32c37e(0xd5)+a4_0x18d530[_0x32c37e(0x107)](_0x1a3af7[_0x32c37e(0x121)])),displayDiffs(_0x1a3af7['agents'],_0x1a3af7['knowledgeBases'],_0x1a3af7[_0x32c37e(0x89)],_0x1a3af7[_0x32c37e(0x123)],_0x1a3af7[_0x32c37e(0x13f)],_0x1a3af7[_0x32c37e(0x119)],_0x1a3af7[_0x32c37e(0x120)],_0x1a3af7[_0x32c37e(0x98)],_0x1a3af7['chatInterfaces']);if(_0x1387e5)return console[_0x32c37e(0xee)](a4_0x18d530[_0x32c37e(0xaf)](_0x32c37e(0x9d))),0x0;if(_0x1fe2b9===0x0&&_0x181322===0x0)return console[_0x32c37e(0xee)](a4_0x18d530[_0x32c37e(0xfa)]('\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'llm_project':_0x1a3af7[_0x32c37e(0x12b)]},_0x98d5e5[_0x32c37e(0x109)]),console[_0x32c37e(0xee)](a4_0x18d530['green']('✔\x20Context\x20set:\x20'+a4_0x18d530[_0x32c37e(0xb9)](_0x32c37e(0xe1))+'\x20=\x20'+a4_0x18d530['cyan'](_0x1a3af7['projectName']))),0x0;if(!_0xbad98d&&!_0x287ee7){if(!isInteractive())return console[_0x32c37e(0x130)](a4_0x18d530['red']('\x0aError:'),_0x32c37e(0x13e)),console[_0x32c37e(0x130)](a4_0x18d530['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x2d6aca=await confirmKey(_0x32c37e(0xe5)+(_0x1fe2b9+_0x181322)+'\x20files?');if(!_0x2d6aca)return console[_0x32c37e(0xee)](a4_0x18d530[_0x32c37e(0xaf)]('Cancelled'),_0x32c37e(0x115)),0x1;}const {data:_0x3ad760}=await withSpinner('Writing\x20files...',()=>_0x1fa5ea[_0x32c37e(0x8c)]['pullProject'](_0x42e4cd,_0x3b8e09,{'force':_0x287ee7}));return console[_0x32c37e(0xee)](a4_0x18d530['green'](_0x32c37e(0x10a)+(_0x1fe2b9+_0x181322)+'\x20files\x20to\x20'+_0x3ad760[_0x32c37e(0x121)])),saveSessionContext({'llm_project':_0x3ad760['projectName']},_0x98d5e5['session']),console[_0x32c37e(0xee)](a4_0x18d530[_0x32c37e(0xfa)](_0x32c37e(0x125)+a4_0x18d530['dim'](_0x32c37e(0xe1))+_0x32c37e(0x94)+a4_0x18d530[_0x32c37e(0x107)](_0x3ad760['projectName']))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x16622d(0xeb)]=a4_0x16622d(0x10e);['description']=a4_0x16622d(0x111);async['execute'](_0x37db0d){const _0x49e495=a4_0x16622d,{options:_0x3e3c3d,args:_0x445148,tdx:_0x2a9e19}=_0x37db0d,_0x523ee1=_0x445148[0x0],_0x238416=_0x3e3c3d[_0x49e495(0xeb)],_0x34bb63=_0x3e3c3d[_0x49e495(0xc1)],_0x2373bd=_0x3e3c3d[_0x49e495(0xfd)],_0x51fc3c=_0x3e3c3d[_0x49e495(0xa3)],_0x503cf4=_0x3e3c3d[_0x49e495(0xa7)];let _0x1ff5f0;const _0x3d89db=findAgentConfigPath(process[_0x49e495(0xb6)]());if(_0x523ee1){const _0x5caa91=a4_0x1b3042[_0x49e495(0x124)](_0x523ee1,'tdx.json');existsSync(_0x5caa91)?(_0x1ff5f0=_0x523ee1,console[_0x49e495(0xee)](a4_0x18d530['dim'](_0x49e495(0xf8)+_0x523ee1))):_0x1ff5f0=_0x523ee1;}else{if(_0x3d89db)_0x1ff5f0=a4_0x1b3042[_0x49e495(0xf2)](_0x3d89db),console[_0x49e495(0xee)](a4_0x18d530[_0x49e495(0xb9)](_0x49e495(0x92)+_0x1ff5f0));else{if(_0x503cf4){const _0x3671df=sanitizeForFilesystem(_0x503cf4);let _0x1056bd=_0x3671df,_0x5e558c=a4_0x1b3042[_0x49e495(0x124)](process[_0x49e495(0xb6)](),_0x49e495(0xb0),_0x3671df,_0x49e495(0x12c));if(!existsSync(_0x5e558c)){const _0x54c634=normalizeName(_0x503cf4),_0x5e73bc=a4_0x1b3042[_0x49e495(0x124)](process[_0x49e495(0xb6)](),_0x49e495(0xb0),_0x54c634,_0x49e495(0x12c));existsSync(_0x5e73bc)&&(_0x1056bd=_0x54c634,_0x5e558c=_0x5e73bc);}if(existsSync(_0x5e558c))_0x1ff5f0=a4_0x1b3042[_0x49e495(0xf2)](_0x5e558c),console['log'](a4_0x18d530[_0x49e495(0xb9)](_0x49e495(0xf8)+_0x1ff5f0));else{const _0x48c904=_0x3e3c3d[_0x49e495(0xe3)];if(_0x48c904)throw new SDKError(ErrorCode[_0x49e495(0xa4)],_0x49e495(0x118)+_0x503cf4+_0x49e495(0xb2),undefined,{'helpText':_0x49e495(0xbe)+_0x49e495(0xed)+(_0x49e495(0x129)+_0x503cf4+'\x0a')+('\x20\x20tdx\x20agent\x20clone\x20agents/'+_0x1056bd+_0x49e495(0x95)+(_0x238416||_0x49e495(0x106))+_0x49e495(0x12d)+_0x48c904)});_0x1ff5f0=_0x503cf4,console['log'](a4_0x18d530[_0x49e495(0xb9)](_0x49e495(0xa1)+_0x503cf4));}}}}if(!_0x1ff5f0)return console[_0x49e495(0xee)](a4_0x18d530[_0x49e495(0xaf)]('No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a')),console[_0x49e495(0xee)](_0x49e495(0xba)),console[_0x49e495(0xee)](_0x49e495(0x10f)),console[_0x49e495(0xee)](_0x49e495(0xa0)),console[_0x49e495(0xee)](_0x49e495(0xbb)),0x1;if(!_0x238416)throw new SDKError(ErrorCode[_0x49e495(0x8d)],'New\x20project\x20name\x20is\x20required',undefined,{'helpText':_0x49e495(0x139)});if(!_0x2373bd&&!_0x34bb63){if(!isInteractive())return console['error'](a4_0x18d530[_0x49e495(0xb1)]('\x0aError:'),_0x49e495(0x13e)),console['error'](a4_0x18d530['dim'](_0x49e495(0xc9))),0x1;const _0x448e92=await confirmKey('Clone\x20\x22'+_0x1ff5f0+_0x49e495(0xbd)+_0x238416+'\x22?');if(!_0x448e92)return console['log'](a4_0x18d530[_0x49e495(0xaf)]('Cancelled')),0x1;}const {data:_0x24c459}=await withSpinner('Cloning\x20\x22'+_0x1ff5f0+_0x49e495(0xea)+_0x238416+'\x22...',()=>_0x2a9e19[_0x49e495(0x8c)][_0x49e495(0x133)](_0x1ff5f0,_0x238416,{'dryRun':_0x34bb63}));if(_0x34bb63){console['log'](a4_0x18d530[_0x49e495(0xaf)](_0x49e495(0x11e))),console['log'](_0x49e495(0xdc)+_0x24c459[_0x49e495(0x91)]),console[_0x49e495(0xee)](_0x49e495(0x112)+_0x238416),console[_0x49e495(0xee)](_0x49e495(0x97)),console[_0x49e495(0xee)](_0x49e495(0xe7)+_0x24c459['counts']['agents'][_0x49e495(0xcc)]),console[_0x49e495(0xee)](_0x49e495(0xb5)+_0x24c459['counts']['knowledgeBases']['created']),console[_0x49e495(0xee)]('\x20\x20Prompts:\x20'+_0x24c459['counts'][_0x49e495(0x123)][_0x49e495(0xcc)]),console[_0x49e495(0xee)](_0x49e495(0x96)+_0x24c459[_0x49e495(0x113)][_0x49e495(0x98)][_0x49e495(0xcc)]),console['log']('\x20\x20Chat\x20Interfaces:\x20'+_0x24c459[_0x49e495(0x113)]['chatInterfaces'][_0x49e495(0xcc)]);const _0xbd05ad=_0x24c459[_0x49e495(0x113)][_0x49e495(0x119)][_0x49e495(0xcc)]>0x0||_0x24c459[_0x49e495(0x113)][_0x49e495(0x120)]['created']>0x0;return _0xbd05ad&&(console[_0x49e495(0xee)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+_0x24c459[_0x49e495(0x113)]['experimentalKnowledgeBases']['created']),console['log'](_0x49e495(0x108)+_0x24c459[_0x49e495(0x113)][_0x49e495(0x120)][_0x49e495(0xcc)])),0x0;}const _0x53ce7a=_0x24c459['counts'][_0x49e495(0xb0)]['errors']>0x0||_0x24c459[_0x49e495(0x113)][_0x49e495(0x99)][_0x49e495(0x11a)]>0x0||_0x24c459[_0x49e495(0x113)][_0x49e495(0x123)][_0x49e495(0x11a)]>0x0||_0x24c459[_0x49e495(0x113)][_0x49e495(0x98)][_0x49e495(0x11a)]>0x0||_0x24c459[_0x49e495(0x113)][_0x49e495(0x105)][_0x49e495(0x11a)]>0x0||_0x24c459[_0x49e495(0x113)][_0x49e495(0x119)][_0x49e495(0x11a)]>0x0||_0x24c459['counts'][_0x49e495(0x120)][_0x49e495(0x11a)]>0x0;_0x53ce7a?console[_0x49e495(0xee)](a4_0x18d530[_0x49e495(0xaf)]('Project\x20cloned\x20with\x20errors')):console['log'](a4_0x18d530[_0x49e495(0xfa)]('Project\x20cloned\x20successfully'));console[_0x49e495(0xee)](_0x49e495(0xdc)+_0x24c459[_0x49e495(0x91)]),console['log'](_0x49e495(0x112)+_0x24c459[_0x49e495(0x140)]),console['log'](_0x49e495(0x10b)+_0x24c459[_0x49e495(0xe8)]),console[_0x49e495(0xee)](),console[_0x49e495(0xee)](_0x49e495(0xf5)),console[_0x49e495(0xee)](_0x49e495(0xe7)+formatCountSummary(_0x24c459['counts'][_0x49e495(0xb0)])),console[_0x49e495(0xee)](_0x49e495(0xb5)+formatCountSummary(_0x24c459[_0x49e495(0x113)][_0x49e495(0x99)])),console[_0x49e495(0xee)](_0x49e495(0x9f)+formatCountSummary(_0x24c459[_0x49e495(0x113)][_0x49e495(0x123)])),console[_0x49e495(0xee)](_0x49e495(0x11b)+formatCountSummary(_0x24c459[_0x49e495(0x113)][_0x49e495(0x13f)])),console[_0x49e495(0xee)](_0x49e495(0x96)+formatCountSummary(_0x24c459[_0x49e495(0x113)][_0x49e495(0x98)])),console[_0x49e495(0xee)]('\x20\x20Chat\x20Interfaces:\x20'+formatCountSummary(_0x24c459[_0x49e495(0x113)]['chatInterfaces']));const _0x5ae70e=_0x24c459[_0x49e495(0x113)][_0x49e495(0x119)][_0x49e495(0xcc)]>0x0||_0x24c459[_0x49e495(0x113)][_0x49e495(0x119)][_0x49e495(0xca)]>0x0||_0x24c459['counts'][_0x49e495(0x119)][_0x49e495(0xd1)]>0x0||_0x24c459[_0x49e495(0x113)][_0x49e495(0x120)]['created']>0x0||_0x24c459[_0x49e495(0x113)][_0x49e495(0x120)][_0x49e495(0xca)]>0x0||_0x24c459[_0x49e495(0x113)][_0x49e495(0x120)][_0x49e495(0xd1)]>0x0;_0x5ae70e&&(console[_0x49e495(0xee)](_0x49e495(0x134)+formatCountSummary(_0x24c459['counts'][_0x49e495(0x119)])),console[_0x49e495(0xee)](_0x49e495(0x108)+formatCountSummary(_0x24c459[_0x49e495(0x113)][_0x49e495(0x120)])));if(_0x53ce7a){console['log'](),console[_0x49e495(0xee)](a4_0x18d530['red'](_0x49e495(0x116)));for(const _0x4a6429 of _0x24c459[_0x49e495(0xb0)]){_0x4a6429['action']===_0x49e495(0x130)&&console[_0x49e495(0xee)](a4_0x18d530[_0x49e495(0xb1)](_0x49e495(0x132)+_0x4a6429[_0x49e495(0x135)]+_0x49e495(0x114)+_0x4a6429[_0x49e495(0x130)]));}for(const _0x29e349 of _0x24c459[_0x49e495(0x99)]){_0x29e349[_0x49e495(0xd8)]==='error'&&console[_0x49e495(0xee)](a4_0x18d530[_0x49e495(0xb1)](_0x49e495(0x110)+_0x29e349['name']+_0x49e495(0x114)+_0x29e349[_0x49e495(0x130)]));}for(const _0x584e83 of _0x24c459[_0x49e495(0x123)]){_0x584e83[_0x49e495(0xd8)]===_0x49e495(0x130)&&console[_0x49e495(0xee)](a4_0x18d530[_0x49e495(0xb1)](_0x49e495(0xc8)+_0x584e83[_0x49e495(0xeb)]+'\x22:\x20'+_0x584e83[_0x49e495(0x130)]));}for(const _0x516846 of _0x24c459['integrations']){_0x516846[_0x49e495(0xd8)]==='error'&&console[_0x49e495(0xee)](a4_0x18d530['red'](_0x49e495(0x9c)+_0x516846[_0x49e495(0xeb)]+_0x49e495(0x114)+_0x516846[_0x49e495(0x130)]));}for(const _0x262568 of _0x24c459[_0x49e495(0x98)]){_0x262568[_0x49e495(0xd8)]===_0x49e495(0x130)&&console[_0x49e495(0xee)](a4_0x18d530[_0x49e495(0xb1)](_0x49e495(0xd7)+_0x262568['name']+_0x49e495(0x114)+_0x262568[_0x49e495(0x130)]));}for(const _0x8df475 of _0x24c459[_0x49e495(0x105)]){_0x8df475['action']===_0x49e495(0x130)&&console[_0x49e495(0xee)](a4_0x18d530[_0x49e495(0xb1)](_0x49e495(0xc5)+_0x8df475[_0x49e495(0xeb)]+_0x49e495(0x114)+_0x8df475['error']));}for(const _0x3a093a of _0x24c459[_0x49e495(0x119)]){_0x3a093a[_0x49e495(0xd8)]===_0x49e495(0x130)&&console[_0x49e495(0xee)](a4_0x18d530[_0x49e495(0xb1)](_0x49e495(0x93)+_0x3a093a['name']+_0x49e495(0x114)+_0x3a093a[_0x49e495(0x130)]));}for(const _0x1fc13b of _0x24c459[_0x49e495(0x120)]){_0x1fc13b[_0x49e495(0xd8)]==='error'&&console[_0x49e495(0xee)](a4_0x18d530[_0x49e495(0xb1)](_0x49e495(0xaa)+_0x1fc13b['name']+_0x49e495(0x114)+_0x1fc13b[_0x49e495(0x130)]));}return 0x1;}console[_0x49e495(0xee)]();const _0x1c44b3=getLLMProjectUrl(_0x51fc3c,_0x24c459[_0x49e495(0xe8)]);return console[_0x49e495(0xee)](_0x49e495(0x11f)+a4_0x18d530['cyan'](_0x1c44b3)),0x0;}}export class AgentPushCommand extends BaseCommand{['name']=a4_0x16622d(0x9a);[a4_0x16622d(0x117)]='Push\x20local\x20agent\x20files\x20to\x20LLM\x20project';async[a4_0x16622d(0x12e)](_0x2f6229){const _0x3e1f49=a4_0x16622d,{options:_0x8f5d8b,args:_0x41b9cc,tdx:_0x5def8e}=_0x2f6229;let _0x19e52f=_0x41b9cc[0x0]||process[_0x3e1f49(0xb6)]();const _0x3713f6=_0x8f5d8b['dryRun'],_0xaf0f2a=_0x8f5d8b['force'],_0x48428e=_0x8f5d8b[_0x3e1f49(0xfd)],_0x59a532=_0x8f5d8b[_0x3e1f49(0xa3)],_0xc90c33=a4_0x1b3042[_0x3e1f49(0x124)](_0x19e52f,'agent.yml'),_0x4ed578=existsSync(_0xc90c33);if(_0x4ed578){const {data:_0x2c000b}=await withSpinner(_0x3e1f49(0x9e)+_0x19e52f+_0x3e1f49(0x126),()=>_0x5def8e[_0x3e1f49(0x8c)][_0x3e1f49(0xdb)](_0x19e52f,{'dryRun':_0x3713f6,'force':_0xaf0f2a}));if(_0x3713f6)return console[_0x3e1f49(0xee)](a4_0x18d530[_0x3e1f49(0xaf)](_0x3e1f49(0x11e))),console[_0x3e1f49(0xee)](_0x3e1f49(0xc2)+_0x2c000b[_0x3e1f49(0x135)]),0x0;if(_0x2c000b[_0x3e1f49(0xd8)]==='error')return console[_0x3e1f49(0xee)](a4_0x18d530[_0x3e1f49(0xb1)]('Failed\x20to\x20push\x20agent:\x20'+_0x2c000b[_0x3e1f49(0x130)])),0x1;console[_0x3e1f49(0xee)](a4_0x18d530['green'](_0x3e1f49(0xa9)+_0x2c000b['action']+_0x3e1f49(0x137))),console[_0x3e1f49(0xee)](_0x3e1f49(0x13a)+_0x2c000b[_0x3e1f49(0x135)]);if(_0x2c000b[_0x3e1f49(0xec)]&&_0x2c000b[_0x3e1f49(0x122)]){const _0x14acc7=getLLMAgentChatUrl(_0x59a532,_0x2c000b[_0x3e1f49(0x122)],_0x2c000b[_0x3e1f49(0xec)]);console[_0x3e1f49(0xee)](_0x3e1f49(0xc3)+a4_0x18d530[_0x3e1f49(0x107)](_0x14acc7));}return 0x0;}const _0x4fe01d=_0x8f5d8b['llmProject'],_0x55c74e=resolveProjectFromContext(_0x19e52f,_0x4fe01d);if(_0x55c74e[_0x3e1f49(0x8e)])_0x19e52f=_0x55c74e['projectDir'],_0x55c74e[_0x3e1f49(0xcd)]===_0x3e1f49(0x10d)&&console[_0x3e1f49(0xee)](a4_0x18d530['dim'](_0x3e1f49(0xf7)+_0x19e52f));else{let _0x25e3e4=_0x3e1f49(0x138);_0x55c74e[_0x3e1f49(0xf4)]==='no_local_folder'&&(_0x25e3e4=_0x55c74e['message']+'\x0aRun\x20\x27tdx\x20agent\x20pull\x20'+_0x55c74e[_0x3e1f49(0xa7)]+_0x3e1f49(0x103));throw new SDKError(ErrorCode[_0x3e1f49(0xa4)],_0x55c74e['reason']===_0x3e1f49(0x90)?_0x55c74e[_0x3e1f49(0xb3)]:_0x3e1f49(0x12a)+_0x19e52f,undefined,{'helpText':_0x25e3e4});}const {data:_0x11f4c5}=await withSpinner(_0x3e1f49(0x11c),()=>_0x5def8e[_0x3e1f49(0x8c)][_0x3e1f49(0xa2)](_0x19e52f,{'dryRun':!![]})),_0x3476d6=_0x11f4c5[_0x3e1f49(0x113)][_0x3e1f49(0xb0)][_0x3e1f49(0x11a)]>0x0;if(_0x3476d6){console[_0x3e1f49(0xee)](a4_0x18d530[_0x3e1f49(0xb1)](_0x3e1f49(0xa6)));for(const _0x3a8420 of _0x11f4c5[_0x3e1f49(0xb0)]){_0x3a8420[_0x3e1f49(0xd8)]===_0x3e1f49(0x130)&&console['log'](a4_0x18d530[_0x3e1f49(0xb1)](_0x3e1f49(0x132)+_0x3a8420[_0x3e1f49(0x135)]+_0x3e1f49(0x114)+_0x3a8420['error']));}return 0x1;}const _0x261697=_0x11f4c5[_0x3e1f49(0x113)][_0x3e1f49(0xb0)][_0x3e1f49(0xcc)]+_0x11f4c5[_0x3e1f49(0x113)][_0x3e1f49(0x99)]['created']+_0x11f4c5[_0x3e1f49(0x113)][_0x3e1f49(0x89)][_0x3e1f49(0xcc)]+_0x11f4c5['counts'][_0x3e1f49(0x123)]['created']+_0x11f4c5[_0x3e1f49(0x113)]['integrations'][_0x3e1f49(0xcc)]+_0x11f4c5['counts'][_0x3e1f49(0x119)][_0x3e1f49(0xcc)]+_0x11f4c5[_0x3e1f49(0x113)][_0x3e1f49(0x120)][_0x3e1f49(0xcc)]+_0x11f4c5['counts'][_0x3e1f49(0x98)]['created']+_0x11f4c5['counts'][_0x3e1f49(0x105)]['created'],_0x2a8f4c=_0x11f4c5['counts']['agents']['updated']+_0x11f4c5[_0x3e1f49(0x113)][_0x3e1f49(0x99)][_0x3e1f49(0xca)]+_0x11f4c5[_0x3e1f49(0x113)]['textKnowledgeBases'][_0x3e1f49(0xca)]+_0x11f4c5[_0x3e1f49(0x113)][_0x3e1f49(0x123)][_0x3e1f49(0xca)]+_0x11f4c5[_0x3e1f49(0x113)]['integrations'][_0x3e1f49(0xca)]+_0x11f4c5['counts'][_0x3e1f49(0x119)]['updated']+_0x11f4c5['counts'][_0x3e1f49(0x120)][_0x3e1f49(0xca)]+_0x11f4c5[_0x3e1f49(0x113)][_0x3e1f49(0x98)][_0x3e1f49(0xca)]+_0x11f4c5[_0x3e1f49(0x113)][_0x3e1f49(0x105)]['updated'],_0x3145e0=_0x11f4c5[_0x3e1f49(0x113)][_0x3e1f49(0xb0)][_0x3e1f49(0xd1)]+_0x11f4c5[_0x3e1f49(0x113)]['knowledgeBases'][_0x3e1f49(0xd1)]+_0x11f4c5[_0x3e1f49(0x113)][_0x3e1f49(0x89)]['unchanged']+_0x11f4c5[_0x3e1f49(0x113)][_0x3e1f49(0x123)]['unchanged']+_0x11f4c5['counts']['integrations'][_0x3e1f49(0xd1)]+_0x11f4c5[_0x3e1f49(0x113)][_0x3e1f49(0x119)]['unchanged']+_0x11f4c5[_0x3e1f49(0x113)][_0x3e1f49(0x120)][_0x3e1f49(0xd1)]+_0x11f4c5['counts'][_0x3e1f49(0x98)][_0x3e1f49(0xd1)]+_0x11f4c5[_0x3e1f49(0x113)]['chatInterfaces']['unchanged'];console[_0x3e1f49(0xee)](_0x3e1f49(0x13d)+_0x11f4c5['projectName']+'\x27:'),console['log']('\x20\x20'+a4_0x18d530['green']('+\x20'+_0x261697+'\x20new')+'\x20|\x20'+a4_0x18d530['yellow']('~\x20'+_0x2a8f4c+'\x20changed')+_0x3e1f49(0x87)+a4_0x18d530['dim']('=\x20'+_0x3145e0+_0x3e1f49(0x141))),console[_0x3e1f49(0xee)]('\x20\x20Agents:\x20'+formatCountSummary(_0x11f4c5[_0x3e1f49(0x113)]['agents'])),console['log'](_0x3e1f49(0xb5)+formatCountSummary(_0x11f4c5[_0x3e1f49(0x113)][_0x3e1f49(0x99)])),console[_0x3e1f49(0xee)](_0x3e1f49(0x85)+formatCountSummary(_0x11f4c5[_0x3e1f49(0x113)]['textKnowledgeBases'])),console[_0x3e1f49(0xee)](_0x3e1f49(0x9f)+formatCountSummary(_0x11f4c5[_0x3e1f49(0x113)][_0x3e1f49(0x123)])),console[_0x3e1f49(0xee)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x11f4c5[_0x3e1f49(0x113)][_0x3e1f49(0x13f)])),console[_0x3e1f49(0xee)](_0x3e1f49(0x96)+formatCountSummary(_0x11f4c5['counts'][_0x3e1f49(0x98)])),console[_0x3e1f49(0xee)](_0x3e1f49(0x136)+formatCountSummary(_0x11f4c5[_0x3e1f49(0x113)][_0x3e1f49(0x105)]));const _0x1bd1ae=_0x11f4c5['counts'][_0x3e1f49(0x119)]['created']>0x0||_0x11f4c5[_0x3e1f49(0x113)][_0x3e1f49(0x119)][_0x3e1f49(0xca)]>0x0||_0x11f4c5[_0x3e1f49(0x113)][_0x3e1f49(0x119)][_0x3e1f49(0xd1)]>0x0||_0x11f4c5['counts'][_0x3e1f49(0x120)][_0x3e1f49(0xcc)]>0x0||_0x11f4c5[_0x3e1f49(0x113)][_0x3e1f49(0x120)][_0x3e1f49(0xca)]>0x0||_0x11f4c5['counts'][_0x3e1f49(0x120)][_0x3e1f49(0xd1)]>0x0;_0x1bd1ae&&(console['log'](_0x3e1f49(0x134)+formatCountSummary(_0x11f4c5[_0x3e1f49(0x113)][_0x3e1f49(0x119)])),console[_0x3e1f49(0xee)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x11f4c5['counts'][_0x3e1f49(0x120)])));console['log'](_0x3e1f49(0x12f)+a4_0x18d530[_0x3e1f49(0x107)](_0x19e52f)),displayDiffs(_0x11f4c5[_0x3e1f49(0xb0)],_0x11f4c5[_0x3e1f49(0x99)],_0x11f4c5[_0x3e1f49(0x89)],_0x11f4c5['prompts'],_0x11f4c5[_0x3e1f49(0x13f)],_0x11f4c5[_0x3e1f49(0x119)],_0x11f4c5[_0x3e1f49(0x120)],_0x11f4c5[_0x3e1f49(0x98)],_0x11f4c5[_0x3e1f49(0x105)]);if(_0x3713f6)return console[_0x3e1f49(0xee)](a4_0x18d530[_0x3e1f49(0xaf)](_0x3e1f49(0x101))),0x0;if(_0x261697===0x0&&_0x2a8f4c===0x0){console[_0x3e1f49(0xee)](a4_0x18d530[_0x3e1f49(0xfa)](_0x3e1f49(0xd6)));const _0x4c2ef0=getLLMProjectUrl(_0x59a532,_0x11f4c5['projectId']);return console[_0x3e1f49(0xee)](_0x3e1f49(0x11f)+a4_0x18d530['cyan'](_0x4c2ef0)),0x0;}if(!_0x48428e&&!_0xaf0f2a){if(!isInteractive())return console['error'](a4_0x18d530[_0x3e1f49(0xb1)](_0x3e1f49(0x104)),_0x3e1f49(0x13e)),console[_0x3e1f49(0x130)](a4_0x18d530[_0x3e1f49(0xb9)](_0x3e1f49(0xc9))),0x1;const _0x535ec4=await confirmKey(_0x3e1f49(0x142)+(_0x261697+_0x2a8f4c)+_0x3e1f49(0xac));if(!_0x535ec4)return console[_0x3e1f49(0xee)](a4_0x18d530[_0x3e1f49(0xaf)](_0x3e1f49(0x143)),_0x3e1f49(0xf6)),0x1;}const {data:_0x2bedf5}=await withSpinner(_0x3e1f49(0xc7),()=>_0x5def8e[_0x3e1f49(0x8c)][_0x3e1f49(0xa2)](_0x19e52f,{'force':_0xaf0f2a})),_0x23acb4=_0x2bedf5[_0x3e1f49(0x113)][_0x3e1f49(0xb0)][_0x3e1f49(0x11a)]>0x0||_0x2bedf5[_0x3e1f49(0x113)][_0x3e1f49(0x99)]['errors']>0x0||_0x2bedf5[_0x3e1f49(0x113)][_0x3e1f49(0x89)][_0x3e1f49(0x11a)]>0x0||_0x2bedf5[_0x3e1f49(0x113)][_0x3e1f49(0x123)]['errors']>0x0||_0x2bedf5[_0x3e1f49(0x113)][_0x3e1f49(0x98)][_0x3e1f49(0x11a)]>0x0||_0x2bedf5[_0x3e1f49(0x113)][_0x3e1f49(0x105)][_0x3e1f49(0x11a)]>0x0;if(_0x23acb4){console[_0x3e1f49(0xee)](a4_0x18d530[_0x3e1f49(0xaf)](_0x3e1f49(0x8f))),console[_0x3e1f49(0xee)](),console[_0x3e1f49(0xee)](a4_0x18d530[_0x3e1f49(0xb1)](_0x3e1f49(0x116)));for(const _0x3e179 of _0x2bedf5[_0x3e1f49(0xb0)]){_0x3e179[_0x3e1f49(0xd8)]===_0x3e1f49(0x130)&&console[_0x3e1f49(0xee)](a4_0x18d530[_0x3e1f49(0xb1)](_0x3e1f49(0x132)+_0x3e179[_0x3e1f49(0x135)]+_0x3e1f49(0x114)+_0x3e179[_0x3e1f49(0x130)]));}for(const _0x78fcad of _0x2bedf5[_0x3e1f49(0x99)]){_0x78fcad['action']===_0x3e1f49(0x130)&&console[_0x3e1f49(0xee)](a4_0x18d530[_0x3e1f49(0xb1)](_0x3e1f49(0x110)+_0x78fcad['name']+_0x3e1f49(0x114)+_0x78fcad[_0x3e1f49(0x130)]));}for(const _0x3e33df of _0x2bedf5[_0x3e1f49(0x89)]){_0x3e33df[_0x3e1f49(0xd8)]===_0x3e1f49(0x130)&&console[_0x3e1f49(0xee)](a4_0x18d530[_0x3e1f49(0xb1)](_0x3e1f49(0xce)+_0x3e33df['name']+_0x3e1f49(0x114)+_0x3e33df['error']));}for(const _0x323859 of _0x2bedf5[_0x3e1f49(0x123)]){_0x323859[_0x3e1f49(0xd8)]===_0x3e1f49(0x130)&&console['log'](a4_0x18d530[_0x3e1f49(0xb1)]('\x20\x20Prompt\x20\x22'+_0x323859[_0x3e1f49(0xeb)]+'\x22:\x20'+_0x323859[_0x3e1f49(0x130)]));}for(const _0x138639 of _0x2bedf5[_0x3e1f49(0x13f)]){_0x138639[_0x3e1f49(0xd8)]===_0x3e1f49(0x130)&&console['log'](a4_0x18d530[_0x3e1f49(0xb1)](_0x3e1f49(0x9c)+_0x138639['name']+_0x3e1f49(0x114)+_0x138639['error']));}for(const _0x2a8774 of _0x2bedf5['formInterfaces']){_0x2a8774['action']===_0x3e1f49(0x130)&&console[_0x3e1f49(0xee)](a4_0x18d530[_0x3e1f49(0xb1)]('\x20\x20Form\x20Interface\x20\x22'+_0x2a8774[_0x3e1f49(0xeb)]+_0x3e1f49(0x114)+_0x2a8774['error']));}for(const _0x2dd3c1 of _0x2bedf5[_0x3e1f49(0x105)]){_0x2dd3c1[_0x3e1f49(0xd8)]===_0x3e1f49(0x130)&&console[_0x3e1f49(0xee)](a4_0x18d530[_0x3e1f49(0xb1)](_0x3e1f49(0xc5)+_0x2dd3c1['name']+_0x3e1f49(0x114)+_0x2dd3c1[_0x3e1f49(0x130)]));}return 0x1;}console[_0x3e1f49(0xee)](a4_0x18d530[_0x3e1f49(0xfa)](_0x3e1f49(0x13c)+(_0x261697+_0x2a8f4c)+'\x20resources\x20to\x20\x27'+_0x2bedf5[_0x3e1f49(0x12b)]+'\x27'));const _0x291db4=getLLMProjectUrl(_0x59a532,_0x2bedf5[_0x3e1f49(0x122)]);return console[_0x3e1f49(0xee)](_0x3e1f49(0x11f)+a4_0x18d530[_0x3e1f49(0x107)](_0x291db4)),0x0;}}
1
+ const a4_0x1d189c=a4_0x4b5b;function a4_0xda3c(){const _0x220df3=['tdx.json','\x0a✔\x20Pushed\x20','agent.yml','errors','\x20\x20Chat\x20Interfaces:\x20','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','updated','knowledgeBases','force','agentId','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','textKnowledgeBases','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','counts','total','Would\x20clone:','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','1599138zShgFQ','Output\x20path:\x20','No\x20tdx.json\x20found\x20in\x20','Cancelled','\x20\x20Form\x20Interface\x20\x22','projectDir','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20files\x20to\x20','20jAgHaS','\x20changed','gray','Agent\x20','\x20new','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','\x20\x20Form\x20Interfaces:\x20','log','\x20\x20Experimental\x20Artifact\x20\x22','Status:\x20','Analyzing\x20project\x20\x22','parse','created','\x20\x20Text\x20Knowledge\x20Bases:\x20','\x20\x20Prompts:\x20','pushAgent','projectId','utf-8','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','\x20successfully','Agent:\x20','2026744HGDtsv','New\x20project\x20ID:\x20','New\x20project\x20name\x20is\x20required','Pushing\x20to\x20project...','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','yellow','\x20unchanged','Cloning\x20\x22','\x20\x20Agents:\x20','\x20|\x20','Summary:','12VQjyxs','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','Project\x20cloned\x20with\x20errors','projectName','\x20\x20tdx\x20agent\x20clone\x20agents/','agent','green','pushProject','\x20\x20Integrations:\x20','\x0aError:','error','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','6032850TxOHtf','\x0aPush\x20','isNew','context','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','cwd-config','\x20\x20Experimental\x20Artifacts:\x20','description','\x20\x20Text\x20Knowledge\x20Base\x20\x22','\x20--name\x20','MISSING_ARGUMENT','pullProject','llm_project','Dry\x20run\x20-\x20no\x20changes\x20made','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','Writing\x20files...','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','agents','cwd','\x20\x20Knowledge\x20Bases:\x20','push','experimentalArtifacts','new','no_context','newProjectId','action','\x0aChanges\x20to\x20integration\x20\x27','\x20\x20Target:\x20','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)','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','Clone\x20\x22','\x0aPull\x20summary\x20for\x20\x27','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','red','INVALID_ARGUMENT','\x20\x20Knowledge\x20Base\x20\x22','\x20\x20Source:\x20','dryRun','no_local_folder','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','Failed\x20to\x20push\x20agent:\x20','\x22:\x20','Agent\x20pulled\x20successfully','\x20resources\x20to\x20\x27','chatInterfaces','Project:\x20','Errors:','\x20--profile\x20','\x22\x20to\x20new\x20project\x20\x22','agent:pull','-\x20no\x20files\x20written','dirname','Using\x20context\x20project:\x20','join','\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','\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','formInterfaces','agentName','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','outputDir','26939110gQPGVU','✔\x20Context\x20set:\x20','\x27\x20to\x20create\x20the\x20folder\x20structure.','pullAgent','\x20=\x20','\x20\x20Agent\x20\x22','5017767HSwgiI','8BHeifO','unchanged','site','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','Using\x20project:\x20','Chat:\x20','execute','4243974whTRME','profile','integrations','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','\x20\x20tdx\x20agent\x20pull\x20','\x20errors','\x22...','\x20\x20Prompt\x20\x22','Using\x20local\x20project:\x20','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','\x20\x20Chat\x20Interface\x20\x22','experimentalKnowledgeBases','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory','Pulling\x20agent\x20\x22','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','hasChanges','cloneProject','llm','repeat','\x20resources?','1FLcCAF','cyan','Source:\x20','prompts','\x20created','Using\x20project\x20from\x20context:\x20','name','diff','2039896zcLmkn','\x0aChanges\x20to\x20form\x20interface\x20\x27','session','llmProject','sourceProjectName','\x0aWrite\x20','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','\x20total','Using\x20project\x20from\x20','newProjectName','found','\x20files?','message','dim','\x0aChanges\x20to\x20agent\x20\x27','Would\x20pull\x20agent:\x20','outputPath','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','\x20\x20Integration\x20\x22','reason'];a4_0xda3c=function(){return _0x220df3;};return a4_0xda3c();}(function(_0x2c1960,_0x2bcb48){const _0x1710ff=a4_0x4b5b,_0x423640=_0x2c1960();while(!![]){try{const _0x2aabd4=-parseInt(_0x1710ff(0x167))/0x1*(-parseInt(_0x1710ff(0x16f))/0x2)+parseInt(_0x1710ff(0x14b))/0x3+parseInt(_0x1710ff(0xf1))/0x4+parseInt(_0x1710ff(0x108))/0x5+-parseInt(_0x1710ff(0xfc))/0x6*(-parseInt(_0x1710ff(0x153))/0x7)+parseInt(_0x1710ff(0x14c))/0x8*(parseInt(_0x1710ff(0x194))/0x9)+parseInt(_0x1710ff(0x19c))/0xa*(-parseInt(_0x1710ff(0x145))/0xb);if(_0x2aabd4===_0x2bcb48)break;else _0x423640['push'](_0x423640['shift']());}catch(_0x1ee2f6){_0x423640['push'](_0x423640['shift']());}}}(a4_0xda3c,0xdb3e3));import a4_0x194488 from'chalk';import a4_0x299deb from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext,resolveAgentPullArgs}from'../sdk/agent/agent-config.js';function a4_0x4b5b(_0x5b4d2e,_0x5ba599){_0x5b4d2e=_0x5b4d2e-0xf1;const _0xda3c2f=a4_0xda3c();let _0x4b5bd9=_0xda3c2f[_0x5b4d2e];return _0x4b5bd9;}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(_0x3f3c83){const _0x583b37=a4_0x4b5b,_0x34c812=[];if(_0x3f3c83[_0x583b37(0x191)]!==undefined)_0x34c812['push'](_0x3f3c83['total']+_0x583b37(0x176));if(_0x3f3c83[_0x583b37(0x11f)]!==undefined&&_0x3f3c83[_0x583b37(0x11f)]>0x0)_0x34c812['push'](a4_0x194488['green'](_0x3f3c83[_0x583b37(0x11f)]+_0x583b37(0x1a0)));if(_0x3f3c83[_0x583b37(0x1a8)]!==undefined&&_0x3f3c83[_0x583b37(0x1a8)]>0x0)_0x34c812[_0x583b37(0x11d)](a4_0x194488[_0x583b37(0x102)](_0x3f3c83[_0x583b37(0x1a8)]+_0x583b37(0x16b)));if(_0x3f3c83[_0x583b37(0x189)]!==undefined&&_0x3f3c83[_0x583b37(0x189)]>0x0)_0x34c812['push'](a4_0x194488['yellow'](_0x3f3c83[_0x583b37(0x189)]+'\x20updated'));if(_0x3f3c83[_0x583b37(0x14d)]!==undefined&&_0x3f3c83[_0x583b37(0x14d)]>0x0)_0x34c812[_0x583b37(0x11d)](a4_0x194488['gray'](_0x3f3c83[_0x583b37(0x14d)]+_0x583b37(0xf7)));if(_0x3f3c83[_0x583b37(0x186)]!==undefined&&_0x3f3c83[_0x583b37(0x186)]>0x0)_0x34c812['push'](a4_0x194488[_0x583b37(0x12a)](_0x3f3c83[_0x583b37(0x186)]+_0x583b37(0x158)));return _0x34c812[_0x583b37(0x13e)](',\x20');}function displayDiffs(_0x1d8459,_0x43bea4,_0x48863a,_0x4d972d,_0x34813b,_0x51a85c,_0x35bd28,_0x4e5d33,_0x3ca97c){const _0x330687=a4_0x4b5b;for(const _0x2d4b48 of _0x1d8459){if(_0x2d4b48[_0x330687(0x16e)]){const _0x18d0f9=_0x2d4b48[_0x330687(0x142)]||_0x2d4b48[_0x330687(0x16d)];console[_0x330687(0x1a3)](_0x330687(0x17d)+_0x18d0f9+'\x27:'),console[_0x330687(0x1a3)]('─'[_0x330687(0x165)](0x3c)),console[_0x330687(0x1a3)](_0x2d4b48[_0x330687(0x16e)]),console['log']('─'[_0x330687(0x165)](0x3c));}}for(const _0x6843b5 of _0x43bea4){_0x6843b5[_0x330687(0x16e)]&&(console[_0x330687(0x1a3)](_0x330687(0x107)+_0x6843b5['name']+'\x27:'),console['log']('─'[_0x330687(0x165)](0x3c)),console[_0x330687(0x1a3)](_0x6843b5['diff']),console['log']('─'[_0x330687(0x165)](0x3c)));}for(const _0x3014f0 of _0x48863a){_0x3014f0['diff']&&(console['log'](_0x330687(0x130)+_0x3014f0['name']+'\x27:'),console[_0x330687(0x1a3)]('─'[_0x330687(0x165)](0x3c)),console['log'](_0x3014f0[_0x330687(0x16e)]),console[_0x330687(0x1a3)]('─'['repeat'](0x3c)));}for(const _0x54baa9 of _0x4d972d){_0x54baa9[_0x330687(0x16e)]&&(console['log']('\x0aChanges\x20to\x20prompt\x20\x27'+_0x54baa9[_0x330687(0x16d)]+'\x27:'),console['log']('─'[_0x330687(0x165)](0x3c)),console['log'](_0x54baa9[_0x330687(0x16e)]),console[_0x330687(0x1a3)]('─'[_0x330687(0x165)](0x3c)));}for(const _0xf33995 of _0x34813b){_0xf33995[_0x330687(0x16e)]&&(console['log'](_0x330687(0x123)+_0xf33995['name']+'\x27:'),console[_0x330687(0x1a3)]('─'[_0x330687(0x165)](0x3c)),console[_0x330687(0x1a3)](_0xf33995['diff']),console[_0x330687(0x1a3)]('─'['repeat'](0x3c)));}for(const _0x47cfb5 of _0x51a85c){_0x47cfb5['diff']&&(console['log'](_0x330687(0x10c)+_0x47cfb5[_0x330687(0x16d)]+'\x27:'),console['log']('─'[_0x330687(0x165)](0x3c)),console[_0x330687(0x1a3)](_0x47cfb5[_0x330687(0x16e)]),console['log']('─'[_0x330687(0x165)](0x3c)));}for(const _0xa1bedb of _0x35bd28){_0xa1bedb['diff']&&(console[_0x330687(0x1a3)](_0x330687(0x116)+_0xa1bedb['name']+'\x27:'),console[_0x330687(0x1a3)]('─'[_0x330687(0x165)](0x3c)),console[_0x330687(0x1a3)](_0xa1bedb[_0x330687(0x16e)]),console['log']('─'['repeat'](0x3c)));}for(const _0x6c405e of _0x4e5d33){_0x6c405e[_0x330687(0x16e)]&&(console[_0x330687(0x1a3)](_0x330687(0x170)+_0x6c405e[_0x330687(0x16d)]+'\x27:'),console[_0x330687(0x1a3)]('─'['repeat'](0x3c)),console[_0x330687(0x1a3)](_0x6c405e[_0x330687(0x16e)]),console[_0x330687(0x1a3)]('─'[_0x330687(0x165)](0x3c)));}for(const _0x6d8865 of _0x3ca97c){_0x6d8865['diff']&&(console[_0x330687(0x1a3)]('\x0aChanges\x20to\x20chat\x20interface\x20\x27'+_0x6d8865[_0x330687(0x16d)]+'\x27:'),console['log']('─'[_0x330687(0x165)](0x3c)),console['log'](_0x6d8865['diff']),console[_0x330687(0x1a3)]('─'[_0x330687(0x165)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x1d189c(0x16d)]=a4_0x1d189c(0x13a);[a4_0x1d189c(0x10f)]=a4_0x1d189c(0x180);async['execute'](_0x546b58){const _0x324393=a4_0x1d189c,{options:_0x3381f2,args:_0x5252d4,tdx:_0x3a5632}=_0x546b58,_0x26be83=_0x5252d4[0x0],_0x300ea1=_0x5252d4[0x1],_0x4201c2=_0x3381f2['output'],_0x3bfff5=_0x3381f2[_0x324393(0x12e)],_0x3cf0fb=_0x3381f2[_0x324393(0x18b)],_0x388201=_0x3381f2['yes'],_0xc6f113=_0x3381f2[_0x324393(0x172)],_0x375585=_0x3381f2[_0x324393(0x101)];let _0x4db662;if(_0x26be83){const _0x3be1f0=a4_0x299deb[_0x324393(0x13e)](_0x26be83,_0x324393(0x183));if(existsSync(_0x3be1f0))try{const _0x3a02af=JSON[_0x324393(0x1a7)](readFileSync(_0x3be1f0,_0x324393(0x1ad)));_0x3a02af['llm_project']&&(_0x4db662={'llm_project':_0x3a02af[_0x324393(0x114)]});}catch{}}const _0xd7a7d9=findAgentConfigPath(process[_0x324393(0x11b)]());let _0x24cfae;if(_0xd7a7d9)try{const _0x234609=JSON[_0x324393(0x1a7)](readFileSync(_0xd7a7d9,'utf-8'));_0x234609[_0x324393(0x114)]&&(_0x24cfae={'llm_project':_0x234609[_0x324393(0x114)]});}catch{}const _0x4e7a8f=resolveAgentPullArgs({'arg':_0x26be83,'agentNameArg':_0x300ea1,'agentFlag':_0x375585,'contextProject':_0xc6f113,'argDirConfig':_0x4db662,'cwdConfigPath':_0xd7a7d9||undefined,'cwdConfig':_0x24cfae}),{projectNameOrId:_0x4a3c08,targetAgentName:_0x103520,existingOutputDir:_0x3b57da,source:_0x34e1a4}=_0x4e7a8f;if(_0x34e1a4==='arg-dir')console[_0x324393(0x1a3)](a4_0x194488['dim'](_0x324393(0x177)+a4_0x299deb['join'](_0x26be83,_0x324393(0x183))+':\x20'+_0x4a3c08));else{if(_0x34e1a4===_0x324393(0x10d))console[_0x324393(0x1a3)](a4_0x194488['dim']('Using\x20project:\x20'+_0x4a3c08));else _0x34e1a4==='context'&&console['log'](a4_0x194488['dim'](_0x324393(0x16c)+_0x4a3c08));}if(!_0x4a3c08)return _0x375585?(console[_0x324393(0x1a3)](a4_0x194488[_0x324393(0xf6)](_0x324393(0x188))),console['log'](_0x324393(0x193)),console['log']('Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>')):(console['log'](a4_0x194488[_0x324393(0xf6)](_0x324393(0x143))),console['log'](_0x324393(0x125)),console['log'](_0x324393(0x140)),console[_0x324393(0x1a3)](_0x324393(0x15f)),console[_0x324393(0x1a3)](_0x324393(0x13f)),console[_0x324393(0x1a3)]('\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(_0x103520){const {data:_0x3a568c}=await withSpinner(_0x324393(0x160)+_0x103520+'\x22\x20from\x20project\x20\x22'+_0x4a3c08+'\x22...',()=>_0x3a5632[_0x324393(0x164)][_0x324393(0x148)](_0x4a3c08,_0x103520,_0x4201c2,{'dryRun':_0x3bfff5,'force':_0x3cf0fb}));if(_0x3bfff5)return console[_0x324393(0x1a3)](a4_0x194488[_0x324393(0xf6)]('Dry\x20run\x20-\x20no\x20files\x20written')),console[_0x324393(0x1a3)](_0x324393(0x17e)+_0x3a568c[_0x324393(0x142)]),console[_0x324393(0x1a3)](_0x324393(0x195)+_0x3a568c[_0x324393(0x17f)]),_0x3a568c[_0x324393(0x16e)]&&(console['log']('\x0aChanges:'),console['log']('─'[_0x324393(0x165)](0x3c)),console[_0x324393(0x1a3)](_0x3a568c[_0x324393(0x16e)]),console['log']('─'['repeat'](0x3c))),0x0;return console[_0x324393(0x1a3)](a4_0x194488[_0x324393(0x102)](_0x324393(0x133))),console[_0x324393(0x1a3)](_0x324393(0x1b0)+_0x3a568c['agentName']),console[_0x324393(0x1a3)]('Output:\x20'+_0x3a568c[_0x324393(0x17f)]),console['log'](_0x324393(0x1a5)+(_0x3a568c[_0x324393(0x10a)]?a4_0x194488[_0x324393(0x102)](_0x324393(0x11f)):_0x3a568c[_0x324393(0x162)]?a4_0x194488['yellow'](_0x324393(0x189)):a4_0x194488[_0x324393(0x19e)](_0x324393(0x14d)))),0x0;}const _0xab1504=_0x3b57da||_0x4201c2,{data:_0x23f465}=await withSpinner(_0x324393(0x1a6)+_0x4a3c08+_0x324393(0x159),()=>_0x3a5632[_0x324393(0x164)]['pullProject'](_0x4a3c08,_0xab1504,{'dryRun':!![]})),_0x3d3e2c=_0x23f465[_0x324393(0x190)][_0x324393(0x11a)]['new']+_0x23f465[_0x324393(0x190)]['knowledgeBases'][_0x324393(0x11f)]+_0x23f465[_0x324393(0x190)][_0x324393(0x18e)]['new']+_0x23f465[_0x324393(0x190)]['prompts'][_0x324393(0x11f)]+_0x23f465['counts'][_0x324393(0x155)][_0x324393(0x11f)]+_0x23f465['counts'][_0x324393(0x15e)]['new']+_0x23f465['counts'][_0x324393(0x11e)][_0x324393(0x11f)]+_0x23f465[_0x324393(0x190)]['formInterfaces'][_0x324393(0x11f)]+_0x23f465[_0x324393(0x190)][_0x324393(0x135)][_0x324393(0x11f)],_0x34754d=_0x23f465['counts']['agents'][_0x324393(0x189)]+_0x23f465[_0x324393(0x190)][_0x324393(0x18a)][_0x324393(0x189)]+_0x23f465[_0x324393(0x190)][_0x324393(0x18e)]['updated']+_0x23f465['counts'][_0x324393(0x16a)]['updated']+_0x23f465['counts'][_0x324393(0x155)][_0x324393(0x189)]+_0x23f465['counts'][_0x324393(0x15e)]['updated']+_0x23f465[_0x324393(0x190)]['experimentalArtifacts']['updated']+_0x23f465['counts'][_0x324393(0x141)][_0x324393(0x189)]+_0x23f465[_0x324393(0x190)][_0x324393(0x135)]['updated'],_0x5e26fb=_0x23f465[_0x324393(0x190)][_0x324393(0x11a)]['unchanged']+_0x23f465['counts'][_0x324393(0x18a)][_0x324393(0x14d)]+_0x23f465[_0x324393(0x190)][_0x324393(0x18e)][_0x324393(0x14d)]+_0x23f465[_0x324393(0x190)][_0x324393(0x16a)]['unchanged']+_0x23f465[_0x324393(0x190)][_0x324393(0x155)][_0x324393(0x14d)]+_0x23f465['counts'][_0x324393(0x15e)]['unchanged']+_0x23f465[_0x324393(0x190)][_0x324393(0x11e)][_0x324393(0x14d)]+_0x23f465[_0x324393(0x190)]['formInterfaces'][_0x324393(0x14d)]+_0x23f465['counts'][_0x324393(0x135)][_0x324393(0x14d)];console[_0x324393(0x1a3)](_0x324393(0x128)+_0x23f465[_0x324393(0xff)]+'\x27:'),console[_0x324393(0x1a3)]('\x20\x20'+a4_0x194488[_0x324393(0x102)]('+\x20'+_0x3d3e2c+_0x324393(0x1a0))+_0x324393(0xfa)+a4_0x194488[_0x324393(0xf6)]('~\x20'+_0x34754d+_0x324393(0x19d))+_0x324393(0xfa)+a4_0x194488[_0x324393(0x17c)]('=\x20'+_0x5e26fb+'\x20unchanged')),console[_0x324393(0x1a3)](_0x324393(0xf9)+formatCountSummary(_0x23f465['counts'][_0x324393(0x11a)])),console[_0x324393(0x1a3)](_0x324393(0x11c)+formatCountSummary(_0x23f465[_0x324393(0x190)][_0x324393(0x18a)])),console[_0x324393(0x1a3)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x23f465[_0x324393(0x190)][_0x324393(0x18e)])),console[_0x324393(0x1a3)](_0x324393(0x1aa)+formatCountSummary(_0x23f465[_0x324393(0x190)][_0x324393(0x16a)])),console['log']('\x20\x20Integrations:\x20'+formatCountSummary(_0x23f465[_0x324393(0x190)][_0x324393(0x155)])),console[_0x324393(0x1a3)](_0x324393(0x1a2)+formatCountSummary(_0x23f465[_0x324393(0x190)][_0x324393(0x141)])),console[_0x324393(0x1a3)](_0x324393(0x187)+formatCountSummary(_0x23f465[_0x324393(0x190)][_0x324393(0x135)]));const _0x438b2e=_0x23f465[_0x324393(0x190)][_0x324393(0x15e)][_0x324393(0x191)]>0x0||_0x23f465[_0x324393(0x190)][_0x324393(0x11e)][_0x324393(0x191)]>0x0;_0x438b2e&&(console[_0x324393(0x1a3)](_0x324393(0x175)+formatCountSummary(_0x23f465['counts'][_0x324393(0x15e)])),console['log'](_0x324393(0x10e)+formatCountSummary(_0x23f465['counts']['experimentalArtifacts'])));console[_0x324393(0x1a3)](_0x324393(0x124)+a4_0x194488[_0x324393(0x168)](_0x23f465[_0x324393(0x144)])),displayDiffs(_0x23f465['agents'],_0x23f465[_0x324393(0x18a)],_0x23f465[_0x324393(0x18e)],_0x23f465['prompts'],_0x23f465['integrations'],_0x23f465['experimentalKnowledgeBases'],_0x23f465[_0x324393(0x11e)],_0x23f465['formInterfaces'],_0x23f465[_0x324393(0x135)]);if(_0x3bfff5)return console[_0x324393(0x1a3)](a4_0x194488[_0x324393(0xf6)](_0x324393(0x1a1))),0x0;if(_0x3d3e2c===0x0&&_0x34754d===0x0)return console[_0x324393(0x1a3)](a4_0x194488[_0x324393(0x102)]('\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'llm_project':_0x23f465[_0x324393(0xff)]},_0x3381f2[_0x324393(0x171)]),console[_0x324393(0x1a3)](a4_0x194488[_0x324393(0x102)](_0x324393(0x146)+a4_0x194488['dim'](_0x324393(0x114))+'\x20=\x20'+a4_0x194488[_0x324393(0x168)](_0x23f465[_0x324393(0xff)]))),0x0;if(!_0x388201&&!_0x3cf0fb){if(!isInteractive())return console['error'](a4_0x194488[_0x324393(0x12a)](_0x324393(0x105)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x324393(0x106)](a4_0x194488['dim'](_0x324393(0x118))),0x1;const _0x252a15=await confirmKey(_0x324393(0x174)+(_0x3d3e2c+_0x34754d)+_0x324393(0x17a));if(!_0x252a15)return console[_0x324393(0x1a3)](a4_0x194488[_0x324393(0xf6)]('Cancelled'),_0x324393(0x13b)),0x1;}const {data:_0x4de680}=await withSpinner(_0x324393(0x117),()=>_0x3a5632[_0x324393(0x164)][_0x324393(0x113)](_0x4a3c08,_0xab1504,{'force':_0x3cf0fb}));return console[_0x324393(0x1a3)](a4_0x194488[_0x324393(0x102)]('\x0a✔\x20Pulled\x20'+(_0x3d3e2c+_0x34754d)+_0x324393(0x19b)+_0x4de680['outputDir'])),saveSessionContext({'llm_project':_0x4de680[_0x324393(0xff)]},_0x3381f2[_0x324393(0x171)]),console[_0x324393(0x1a3)](a4_0x194488[_0x324393(0x102)](_0x324393(0x146)+a4_0x194488[_0x324393(0x17c)](_0x324393(0x114))+_0x324393(0x149)+a4_0x194488['cyan'](_0x4de680[_0x324393(0xff)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x1d189c(0x16d)]='agent:clone';[a4_0x1d189c(0x10f)]=a4_0x1d189c(0x14f);async['execute'](_0x578b47){const _0x329f7a=a4_0x1d189c,{options:_0x48fe22,args:_0xbdc0a7,tdx:_0x4c795a}=_0x578b47,_0x3053de=_0xbdc0a7[0x0],_0x18dbe8=_0x48fe22['name'],_0xd6a33d=_0x48fe22[_0x329f7a(0x12e)],_0x243d1a=_0x48fe22['yes'],_0x37bbc7=_0x48fe22[_0x329f7a(0x14e)],_0x4906e3=_0x48fe22[_0x329f7a(0x172)];let _0x2007f7;const _0x453f9e=findAgentConfigPath(process[_0x329f7a(0x11b)]());if(_0x3053de){const _0x1b579f=a4_0x299deb[_0x329f7a(0x13e)](_0x3053de,'tdx.json');existsSync(_0x1b579f)?(_0x2007f7=_0x3053de,console[_0x329f7a(0x1a3)](a4_0x194488[_0x329f7a(0x17c)]('Using\x20local\x20project:\x20'+_0x3053de))):_0x2007f7=_0x3053de;}else{if(_0x453f9e)_0x2007f7=a4_0x299deb['dirname'](_0x453f9e),console[_0x329f7a(0x1a3)](a4_0x194488['dim']('Using\x20current\x20project:\x20'+_0x2007f7));else{if(_0x4906e3){const _0x554664=sanitizeForFilesystem(_0x4906e3);let _0x2c3639=_0x554664,_0x438f0b=a4_0x299deb[_0x329f7a(0x13e)](process[_0x329f7a(0x11b)](),_0x329f7a(0x11a),_0x554664,_0x329f7a(0x183));if(!existsSync(_0x438f0b)){const _0x3a3f93=normalizeName(_0x4906e3),_0x1131e0=a4_0x299deb[_0x329f7a(0x13e)](process[_0x329f7a(0x11b)](),_0x329f7a(0x11a),_0x3a3f93,_0x329f7a(0x183));existsSync(_0x1131e0)&&(_0x2c3639=_0x3a3f93,_0x438f0b=_0x1131e0);}if(existsSync(_0x438f0b))_0x2007f7=a4_0x299deb[_0x329f7a(0x13c)](_0x438f0b),console[_0x329f7a(0x1a3)](a4_0x194488[_0x329f7a(0x17c)](_0x329f7a(0x15b)+_0x2007f7));else{const _0x68a453=_0x48fe22[_0x329f7a(0x154)];if(_0x68a453)throw new SDKError(ErrorCode[_0x329f7a(0x12b)],'Cannot\x20clone\x20from\x20context\x20project\x20\x22'+_0x4906e3+'\x22\x20to\x20a\x20different\x20profile',undefined,{'helpText':_0x329f7a(0x129)+_0x329f7a(0x126)+(_0x329f7a(0x157)+_0x4906e3+'\x0a')+(_0x329f7a(0x100)+_0x2c3639+_0x329f7a(0x111)+(_0x18dbe8||'<new-name>')+_0x329f7a(0x138)+_0x68a453)});_0x2007f7=_0x4906e3,console[_0x329f7a(0x1a3)](a4_0x194488['dim'](_0x329f7a(0x13d)+_0x4906e3));}}}}if(!_0x2007f7)return console[_0x329f7a(0x1a3)](a4_0x194488[_0x329f7a(0xf6)](_0x329f7a(0x18d))),console[_0x329f7a(0x1a3)](_0x329f7a(0x15c)),console[_0x329f7a(0x1a3)](_0x329f7a(0xfd)),console['log']('\x20\x20tdx\x20agent\x20clone\x20--name\x20<new-name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clone\x20from\x20context\x20(llm_project)'),console[_0x329f7a(0x1a3)](_0x329f7a(0x161)),0x1;if(!_0x18dbe8)throw new SDKError(ErrorCode[_0x329f7a(0x112)],_0x329f7a(0xf3),undefined,{'helpText':_0x329f7a(0x18f)});if(!_0x243d1a&&!_0xd6a33d){if(!isInteractive())return console[_0x329f7a(0x106)](a4_0x194488['red']('\x0aError:'),_0x329f7a(0x19a)),console['error'](a4_0x194488[_0x329f7a(0x17c)](_0x329f7a(0x118))),0x1;const _0x2d5f28=await confirmKey(_0x329f7a(0x127)+_0x2007f7+_0x329f7a(0x139)+_0x18dbe8+'\x22?');if(!_0x2d5f28)return console['log'](a4_0x194488[_0x329f7a(0xf6)](_0x329f7a(0x197))),0x1;}const {data:_0x5c1f72}=await withSpinner(_0x329f7a(0xf8)+_0x2007f7+'\x22\x20to\x20\x22'+_0x18dbe8+_0x329f7a(0x159),()=>_0x4c795a[_0x329f7a(0x164)][_0x329f7a(0x163)](_0x2007f7,_0x18dbe8,{'dryRun':_0xd6a33d}));if(_0xd6a33d){console[_0x329f7a(0x1a3)](a4_0x194488['yellow'](_0x329f7a(0x115))),console[_0x329f7a(0x1a3)](_0x329f7a(0x169)+_0x5c1f72[_0x329f7a(0x173)]),console[_0x329f7a(0x1a3)]('New\x20project:\x20'+_0x18dbe8),console['log'](_0x329f7a(0x192)),console[_0x329f7a(0x1a3)](_0x329f7a(0xf9)+_0x5c1f72['counts']['agents'][_0x329f7a(0x1a8)]),console[_0x329f7a(0x1a3)](_0x329f7a(0x11c)+_0x5c1f72[_0x329f7a(0x190)][_0x329f7a(0x18a)]['created']),console[_0x329f7a(0x1a3)]('\x20\x20Prompts:\x20'+_0x5c1f72['counts'][_0x329f7a(0x16a)][_0x329f7a(0x1a8)]),console[_0x329f7a(0x1a3)]('\x20\x20Form\x20Interfaces:\x20'+_0x5c1f72[_0x329f7a(0x190)][_0x329f7a(0x141)][_0x329f7a(0x1a8)]),console[_0x329f7a(0x1a3)](_0x329f7a(0x187)+_0x5c1f72[_0x329f7a(0x190)]['chatInterfaces']['created']);const _0x9b736d=_0x5c1f72[_0x329f7a(0x190)][_0x329f7a(0x15e)][_0x329f7a(0x1a8)]>0x0||_0x5c1f72[_0x329f7a(0x190)][_0x329f7a(0x11e)][_0x329f7a(0x1a8)]>0x0;return _0x9b736d&&(console[_0x329f7a(0x1a3)](_0x329f7a(0x175)+_0x5c1f72[_0x329f7a(0x190)][_0x329f7a(0x15e)][_0x329f7a(0x1a8)]),console['log']('\x20\x20Experimental\x20Artifacts:\x20'+_0x5c1f72['counts'][_0x329f7a(0x11e)][_0x329f7a(0x1a8)])),0x0;}const _0x437e3c=_0x5c1f72[_0x329f7a(0x190)]['agents'][_0x329f7a(0x186)]>0x0||_0x5c1f72[_0x329f7a(0x190)]['knowledgeBases'][_0x329f7a(0x186)]>0x0||_0x5c1f72[_0x329f7a(0x190)][_0x329f7a(0x16a)][_0x329f7a(0x186)]>0x0||_0x5c1f72[_0x329f7a(0x190)][_0x329f7a(0x141)]['errors']>0x0||_0x5c1f72[_0x329f7a(0x190)][_0x329f7a(0x135)][_0x329f7a(0x186)]>0x0||_0x5c1f72[_0x329f7a(0x190)][_0x329f7a(0x15e)][_0x329f7a(0x186)]>0x0||_0x5c1f72[_0x329f7a(0x190)][_0x329f7a(0x11e)][_0x329f7a(0x186)]>0x0;_0x437e3c?console[_0x329f7a(0x1a3)](a4_0x194488[_0x329f7a(0xf6)](_0x329f7a(0xfe))):console[_0x329f7a(0x1a3)](a4_0x194488[_0x329f7a(0x102)]('Project\x20cloned\x20successfully'));console[_0x329f7a(0x1a3)](_0x329f7a(0x169)+_0x5c1f72[_0x329f7a(0x173)]),console[_0x329f7a(0x1a3)]('New\x20project:\x20'+_0x5c1f72[_0x329f7a(0x178)]),console[_0x329f7a(0x1a3)](_0x329f7a(0xf2)+_0x5c1f72[_0x329f7a(0x121)]),console[_0x329f7a(0x1a3)](),console[_0x329f7a(0x1a3)](_0x329f7a(0xfb)),console[_0x329f7a(0x1a3)](_0x329f7a(0xf9)+formatCountSummary(_0x5c1f72[_0x329f7a(0x190)][_0x329f7a(0x11a)])),console[_0x329f7a(0x1a3)](_0x329f7a(0x11c)+formatCountSummary(_0x5c1f72[_0x329f7a(0x190)][_0x329f7a(0x18a)])),console['log'](_0x329f7a(0x1aa)+formatCountSummary(_0x5c1f72[_0x329f7a(0x190)][_0x329f7a(0x16a)])),console[_0x329f7a(0x1a3)](_0x329f7a(0x104)+formatCountSummary(_0x5c1f72[_0x329f7a(0x190)][_0x329f7a(0x155)])),console[_0x329f7a(0x1a3)](_0x329f7a(0x1a2)+formatCountSummary(_0x5c1f72[_0x329f7a(0x190)][_0x329f7a(0x141)])),console[_0x329f7a(0x1a3)](_0x329f7a(0x187)+formatCountSummary(_0x5c1f72['counts'][_0x329f7a(0x135)]));const _0x17630b=_0x5c1f72['counts']['experimentalKnowledgeBases']['created']>0x0||_0x5c1f72[_0x329f7a(0x190)][_0x329f7a(0x15e)]['updated']>0x0||_0x5c1f72['counts'][_0x329f7a(0x15e)]['unchanged']>0x0||_0x5c1f72[_0x329f7a(0x190)]['experimentalArtifacts']['created']>0x0||_0x5c1f72[_0x329f7a(0x190)][_0x329f7a(0x11e)]['updated']>0x0||_0x5c1f72[_0x329f7a(0x190)]['experimentalArtifacts'][_0x329f7a(0x14d)]>0x0;_0x17630b&&(console['log'](_0x329f7a(0x175)+formatCountSummary(_0x5c1f72['counts'][_0x329f7a(0x15e)])),console[_0x329f7a(0x1a3)](_0x329f7a(0x10e)+formatCountSummary(_0x5c1f72[_0x329f7a(0x190)]['experimentalArtifacts'])));if(_0x437e3c){console[_0x329f7a(0x1a3)](),console[_0x329f7a(0x1a3)](a4_0x194488['red'](_0x329f7a(0x137)));for(const _0x3d13bb of _0x5c1f72[_0x329f7a(0x11a)]){_0x3d13bb[_0x329f7a(0x122)]==='error'&&console['log'](a4_0x194488[_0x329f7a(0x12a)](_0x329f7a(0x14a)+_0x3d13bb[_0x329f7a(0x142)]+_0x329f7a(0x132)+_0x3d13bb[_0x329f7a(0x106)]));}for(const _0xaa0816 of _0x5c1f72[_0x329f7a(0x18a)]){_0xaa0816[_0x329f7a(0x122)]===_0x329f7a(0x106)&&console[_0x329f7a(0x1a3)](a4_0x194488[_0x329f7a(0x12a)](_0x329f7a(0x12c)+_0xaa0816[_0x329f7a(0x16d)]+_0x329f7a(0x132)+_0xaa0816[_0x329f7a(0x106)]));}for(const _0x51e044 of _0x5c1f72['prompts']){_0x51e044[_0x329f7a(0x122)]==='error'&&console[_0x329f7a(0x1a3)](a4_0x194488['red'](_0x329f7a(0x15a)+_0x51e044[_0x329f7a(0x16d)]+_0x329f7a(0x132)+_0x51e044[_0x329f7a(0x106)]));}for(const _0x2b085f of _0x5c1f72[_0x329f7a(0x155)]){_0x2b085f[_0x329f7a(0x122)]==='error'&&console[_0x329f7a(0x1a3)](a4_0x194488['red'](_0x329f7a(0x181)+_0x2b085f[_0x329f7a(0x16d)]+_0x329f7a(0x132)+_0x2b085f[_0x329f7a(0x106)]));}for(const _0x75f7f of _0x5c1f72['formInterfaces']){_0x75f7f[_0x329f7a(0x122)]===_0x329f7a(0x106)&&console[_0x329f7a(0x1a3)](a4_0x194488[_0x329f7a(0x12a)]('\x20\x20Form\x20Interface\x20\x22'+_0x75f7f[_0x329f7a(0x16d)]+_0x329f7a(0x132)+_0x75f7f[_0x329f7a(0x106)]));}for(const _0x27b8b0 of _0x5c1f72[_0x329f7a(0x135)]){_0x27b8b0[_0x329f7a(0x122)]===_0x329f7a(0x106)&&console[_0x329f7a(0x1a3)](a4_0x194488['red'](_0x329f7a(0x15d)+_0x27b8b0['name']+_0x329f7a(0x132)+_0x27b8b0[_0x329f7a(0x106)]));}for(const _0x22dbdf of _0x5c1f72[_0x329f7a(0x15e)]){_0x22dbdf['action']==='error'&&console['log'](a4_0x194488['red']('\x20\x20Experimental\x20Knowledge\x20Base\x20\x22'+_0x22dbdf[_0x329f7a(0x16d)]+_0x329f7a(0x132)+_0x22dbdf[_0x329f7a(0x106)]));}for(const _0x1aaeaf of _0x5c1f72['experimentalArtifacts']){_0x1aaeaf[_0x329f7a(0x122)]==='error'&&console[_0x329f7a(0x1a3)](a4_0x194488[_0x329f7a(0x12a)](_0x329f7a(0x1a4)+_0x1aaeaf[_0x329f7a(0x16d)]+_0x329f7a(0x132)+_0x1aaeaf[_0x329f7a(0x106)]));}return 0x1;}console[_0x329f7a(0x1a3)]();const _0x436af7=getLLMProjectUrl(_0x37bbc7,_0x5c1f72[_0x329f7a(0x121)]);return console[_0x329f7a(0x1a3)](_0x329f7a(0x136)+a4_0x194488['cyan'](_0x436af7)),0x0;}}export class AgentPushCommand extends BaseCommand{['name']='agent:push';[a4_0x1d189c(0x10f)]=a4_0x1d189c(0x119);async[a4_0x1d189c(0x152)](_0x62769f){const _0x594b25=a4_0x1d189c,{options:_0x32e7cc,args:_0x17dd94,tdx:_0xcd98b0}=_0x62769f;let _0x374212=_0x17dd94[0x0]||process[_0x594b25(0x11b)]();const _0xde53b=_0x32e7cc[_0x594b25(0x12e)],_0x14b17=_0x32e7cc[_0x594b25(0x18b)],_0x2a37ee=_0x32e7cc['yes'],_0x33a140=_0x32e7cc['site'],_0x255b80=a4_0x299deb['join'](_0x374212,_0x594b25(0x185)),_0x499697=existsSync(_0x255b80);if(_0x499697){const {data:_0x4f1a2f}=await withSpinner('Pushing\x20agent\x20from\x20\x22'+_0x374212+_0x594b25(0x159),()=>_0xcd98b0[_0x594b25(0x164)][_0x594b25(0x1ab)](_0x374212,{'dryRun':_0xde53b,'force':_0x14b17}));if(_0xde53b)return console['log'](a4_0x194488[_0x594b25(0xf6)](_0x594b25(0x115))),console[_0x594b25(0x1a3)]('Would\x20push\x20agent:\x20'+_0x4f1a2f['agentName']),0x0;if(_0x4f1a2f[_0x594b25(0x122)]==='error')return console[_0x594b25(0x1a3)](a4_0x194488[_0x594b25(0x12a)](_0x594b25(0x131)+_0x4f1a2f['error'])),0x1;console[_0x594b25(0x1a3)](a4_0x194488['green'](_0x594b25(0x19f)+_0x4f1a2f['action']+_0x594b25(0x1af))),console['log'](_0x594b25(0x1b0)+_0x4f1a2f['agentName']);if(_0x4f1a2f[_0x594b25(0x18c)]&&_0x4f1a2f['projectId']){const _0x2fba02=getLLMAgentChatUrl(_0x33a140,_0x4f1a2f['projectId'],_0x4f1a2f[_0x594b25(0x18c)]);console[_0x594b25(0x1a3)](_0x594b25(0x151)+a4_0x194488[_0x594b25(0x168)](_0x2fba02));}return 0x0;}const _0x425e4a=_0x32e7cc['llmProject'],_0x321b40=resolveProjectFromContext(_0x374212,_0x425e4a);if(_0x321b40[_0x594b25(0x179)])_0x374212=_0x321b40[_0x594b25(0x199)],_0x321b40['source']===_0x594b25(0x10b)&&console[_0x594b25(0x1a3)](a4_0x194488[_0x594b25(0x17c)](_0x594b25(0x150)+_0x374212));else{let _0x3e6fb1=_0x594b25(0xf5);_0x321b40[_0x594b25(0x182)]===_0x594b25(0x12f)&&(_0x3e6fb1=_0x321b40[_0x594b25(0x17b)]+_0x594b25(0x156)+_0x321b40[_0x594b25(0x172)]+_0x594b25(0x147));throw new SDKError(ErrorCode[_0x594b25(0x12b)],_0x321b40[_0x594b25(0x182)]===_0x594b25(0x120)?_0x321b40[_0x594b25(0x17b)]:_0x594b25(0x196)+_0x374212,undefined,{'helpText':_0x3e6fb1});}const {data:_0x66bfd1}=await withSpinner('Analyzing\x20changes\x20to\x20push...',()=>_0xcd98b0[_0x594b25(0x164)]['pushProject'](_0x374212,{'dryRun':!![]})),_0x94fbfb=_0x66bfd1[_0x594b25(0x190)]['agents'][_0x594b25(0x186)]>0x0;if(_0x94fbfb){console[_0x594b25(0x1a3)](a4_0x194488[_0x594b25(0x12a)]('\x0aErrors\x20found:'));for(const _0x2b61c8 of _0x66bfd1[_0x594b25(0x11a)]){_0x2b61c8[_0x594b25(0x122)]===_0x594b25(0x106)&&console[_0x594b25(0x1a3)](a4_0x194488[_0x594b25(0x12a)](_0x594b25(0x14a)+_0x2b61c8[_0x594b25(0x142)]+'\x22:\x20'+_0x2b61c8[_0x594b25(0x106)]));}return 0x1;}const _0x467e6c=_0x66bfd1[_0x594b25(0x190)][_0x594b25(0x11a)][_0x594b25(0x1a8)]+_0x66bfd1[_0x594b25(0x190)][_0x594b25(0x18a)]['created']+_0x66bfd1['counts'][_0x594b25(0x18e)][_0x594b25(0x1a8)]+_0x66bfd1[_0x594b25(0x190)][_0x594b25(0x16a)][_0x594b25(0x1a8)]+_0x66bfd1[_0x594b25(0x190)][_0x594b25(0x155)][_0x594b25(0x1a8)]+_0x66bfd1[_0x594b25(0x190)][_0x594b25(0x15e)][_0x594b25(0x1a8)]+_0x66bfd1[_0x594b25(0x190)][_0x594b25(0x11e)]['created']+_0x66bfd1[_0x594b25(0x190)]['formInterfaces'][_0x594b25(0x1a8)]+_0x66bfd1[_0x594b25(0x190)][_0x594b25(0x135)][_0x594b25(0x1a8)],_0x5de2ba=_0x66bfd1[_0x594b25(0x190)][_0x594b25(0x11a)][_0x594b25(0x189)]+_0x66bfd1[_0x594b25(0x190)]['knowledgeBases']['updated']+_0x66bfd1[_0x594b25(0x190)][_0x594b25(0x18e)][_0x594b25(0x189)]+_0x66bfd1[_0x594b25(0x190)]['prompts'][_0x594b25(0x189)]+_0x66bfd1['counts'][_0x594b25(0x155)][_0x594b25(0x189)]+_0x66bfd1[_0x594b25(0x190)]['experimentalKnowledgeBases']['updated']+_0x66bfd1[_0x594b25(0x190)][_0x594b25(0x11e)][_0x594b25(0x189)]+_0x66bfd1['counts'][_0x594b25(0x141)][_0x594b25(0x189)]+_0x66bfd1[_0x594b25(0x190)][_0x594b25(0x135)]['updated'],_0x50e074=_0x66bfd1[_0x594b25(0x190)][_0x594b25(0x11a)][_0x594b25(0x14d)]+_0x66bfd1[_0x594b25(0x190)]['knowledgeBases'][_0x594b25(0x14d)]+_0x66bfd1[_0x594b25(0x190)][_0x594b25(0x18e)][_0x594b25(0x14d)]+_0x66bfd1['counts'][_0x594b25(0x16a)][_0x594b25(0x14d)]+_0x66bfd1[_0x594b25(0x190)]['integrations'][_0x594b25(0x14d)]+_0x66bfd1['counts'][_0x594b25(0x15e)]['unchanged']+_0x66bfd1[_0x594b25(0x190)]['experimentalArtifacts'][_0x594b25(0x14d)]+_0x66bfd1[_0x594b25(0x190)][_0x594b25(0x141)]['unchanged']+_0x66bfd1[_0x594b25(0x190)][_0x594b25(0x135)][_0x594b25(0x14d)];console['log']('\x0aPush\x20summary\x20for\x20\x27'+_0x66bfd1[_0x594b25(0xff)]+'\x27:'),console[_0x594b25(0x1a3)]('\x20\x20'+a4_0x194488[_0x594b25(0x102)]('+\x20'+_0x467e6c+_0x594b25(0x1a0))+'\x20|\x20'+a4_0x194488[_0x594b25(0xf6)]('~\x20'+_0x5de2ba+_0x594b25(0x19d))+_0x594b25(0xfa)+a4_0x194488['dim']('=\x20'+_0x50e074+'\x20unchanged')),console[_0x594b25(0x1a3)](_0x594b25(0xf9)+formatCountSummary(_0x66bfd1[_0x594b25(0x190)][_0x594b25(0x11a)])),console[_0x594b25(0x1a3)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x66bfd1[_0x594b25(0x190)][_0x594b25(0x18a)])),console[_0x594b25(0x1a3)](_0x594b25(0x1a9)+formatCountSummary(_0x66bfd1[_0x594b25(0x190)][_0x594b25(0x18e)])),console[_0x594b25(0x1a3)](_0x594b25(0x1aa)+formatCountSummary(_0x66bfd1[_0x594b25(0x190)][_0x594b25(0x16a)])),console[_0x594b25(0x1a3)](_0x594b25(0x104)+formatCountSummary(_0x66bfd1[_0x594b25(0x190)][_0x594b25(0x155)])),console[_0x594b25(0x1a3)](_0x594b25(0x1a2)+formatCountSummary(_0x66bfd1[_0x594b25(0x190)][_0x594b25(0x141)])),console['log'](_0x594b25(0x187)+formatCountSummary(_0x66bfd1['counts'][_0x594b25(0x135)]));const _0x3e01f3=_0x66bfd1[_0x594b25(0x190)][_0x594b25(0x15e)][_0x594b25(0x1a8)]>0x0||_0x66bfd1[_0x594b25(0x190)][_0x594b25(0x15e)]['updated']>0x0||_0x66bfd1[_0x594b25(0x190)][_0x594b25(0x15e)][_0x594b25(0x14d)]>0x0||_0x66bfd1['counts'][_0x594b25(0x11e)][_0x594b25(0x1a8)]>0x0||_0x66bfd1['counts']['experimentalArtifacts'][_0x594b25(0x189)]>0x0||_0x66bfd1[_0x594b25(0x190)]['experimentalArtifacts'][_0x594b25(0x14d)]>0x0;_0x3e01f3&&(console[_0x594b25(0x1a3)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x66bfd1[_0x594b25(0x190)][_0x594b25(0x15e)])),console[_0x594b25(0x1a3)](_0x594b25(0x10e)+formatCountSummary(_0x66bfd1[_0x594b25(0x190)]['experimentalArtifacts'])));console[_0x594b25(0x1a3)](_0x594b25(0x12d)+a4_0x194488[_0x594b25(0x168)](_0x374212)),displayDiffs(_0x66bfd1[_0x594b25(0x11a)],_0x66bfd1[_0x594b25(0x18a)],_0x66bfd1['textKnowledgeBases'],_0x66bfd1[_0x594b25(0x16a)],_0x66bfd1[_0x594b25(0x155)],_0x66bfd1[_0x594b25(0x15e)],_0x66bfd1[_0x594b25(0x11e)],_0x66bfd1['formInterfaces'],_0x66bfd1[_0x594b25(0x135)]);if(_0xde53b)return console['log'](a4_0x194488[_0x594b25(0xf6)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed')),0x0;if(_0x467e6c===0x0&&_0x5de2ba===0x0){console[_0x594b25(0x1a3)](a4_0x194488['green'](_0x594b25(0x1ae)));const _0x31920f=getLLMProjectUrl(_0x33a140,_0x66bfd1[_0x594b25(0x1ac)]);return console[_0x594b25(0x1a3)](_0x594b25(0x136)+a4_0x194488[_0x594b25(0x168)](_0x31920f)),0x0;}if(!_0x2a37ee&&!_0x14b17){if(!isInteractive())return console[_0x594b25(0x106)](a4_0x194488[_0x594b25(0x12a)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a4_0x194488[_0x594b25(0x17c)](_0x594b25(0x118))),0x1;const _0x4a2d89=await confirmKey(_0x594b25(0x109)+(_0x467e6c+_0x5de2ba)+_0x594b25(0x166));if(!_0x4a2d89)return console[_0x594b25(0x1a3)](a4_0x194488[_0x594b25(0xf6)]('Cancelled'),'-\x20nothing\x20pushed'),0x1;}const {data:_0x1f3167}=await withSpinner(_0x594b25(0xf4),()=>_0xcd98b0[_0x594b25(0x164)][_0x594b25(0x103)](_0x374212,{'force':_0x14b17})),_0x3ba88a=_0x1f3167[_0x594b25(0x190)][_0x594b25(0x11a)][_0x594b25(0x186)]>0x0||_0x1f3167[_0x594b25(0x190)]['knowledgeBases'][_0x594b25(0x186)]>0x0||_0x1f3167[_0x594b25(0x190)][_0x594b25(0x18e)]['errors']>0x0||_0x1f3167[_0x594b25(0x190)][_0x594b25(0x16a)][_0x594b25(0x186)]>0x0||_0x1f3167[_0x594b25(0x190)][_0x594b25(0x141)][_0x594b25(0x186)]>0x0||_0x1f3167['counts'][_0x594b25(0x135)][_0x594b25(0x186)]>0x0;if(_0x3ba88a){console[_0x594b25(0x1a3)](a4_0x194488[_0x594b25(0xf6)]('\x0aProject\x20pushed\x20with\x20errors')),console[_0x594b25(0x1a3)](),console['log'](a4_0x194488[_0x594b25(0x12a)](_0x594b25(0x137)));for(const _0x3f8fed of _0x1f3167[_0x594b25(0x11a)]){_0x3f8fed['action']===_0x594b25(0x106)&&console[_0x594b25(0x1a3)](a4_0x194488['red'](_0x594b25(0x14a)+_0x3f8fed['agentName']+_0x594b25(0x132)+_0x3f8fed[_0x594b25(0x106)]));}for(const _0x5cdd92 of _0x1f3167['knowledgeBases']){_0x5cdd92[_0x594b25(0x122)]===_0x594b25(0x106)&&console[_0x594b25(0x1a3)](a4_0x194488[_0x594b25(0x12a)]('\x20\x20Knowledge\x20Base\x20\x22'+_0x5cdd92['name']+'\x22:\x20'+_0x5cdd92['error']));}for(const _0x51e94a of _0x1f3167[_0x594b25(0x18e)]){_0x51e94a[_0x594b25(0x122)]===_0x594b25(0x106)&&console[_0x594b25(0x1a3)](a4_0x194488[_0x594b25(0x12a)](_0x594b25(0x110)+_0x51e94a['name']+_0x594b25(0x132)+_0x51e94a[_0x594b25(0x106)]));}for(const _0x2eb53c of _0x1f3167[_0x594b25(0x16a)]){_0x2eb53c[_0x594b25(0x122)]===_0x594b25(0x106)&&console[_0x594b25(0x1a3)](a4_0x194488[_0x594b25(0x12a)](_0x594b25(0x15a)+_0x2eb53c['name']+'\x22:\x20'+_0x2eb53c[_0x594b25(0x106)]));}for(const _0x582158 of _0x1f3167[_0x594b25(0x155)]){_0x582158[_0x594b25(0x122)]===_0x594b25(0x106)&&console[_0x594b25(0x1a3)](a4_0x194488[_0x594b25(0x12a)](_0x594b25(0x181)+_0x582158[_0x594b25(0x16d)]+'\x22:\x20'+_0x582158[_0x594b25(0x106)]));}for(const _0x2317a7 of _0x1f3167[_0x594b25(0x141)]){_0x2317a7['action']===_0x594b25(0x106)&&console['log'](a4_0x194488[_0x594b25(0x12a)](_0x594b25(0x198)+_0x2317a7[_0x594b25(0x16d)]+_0x594b25(0x132)+_0x2317a7[_0x594b25(0x106)]));}for(const _0x38a200 of _0x1f3167[_0x594b25(0x135)]){_0x38a200[_0x594b25(0x122)]===_0x594b25(0x106)&&console[_0x594b25(0x1a3)](a4_0x194488[_0x594b25(0x12a)](_0x594b25(0x15d)+_0x38a200[_0x594b25(0x16d)]+_0x594b25(0x132)+_0x38a200[_0x594b25(0x106)]));}return 0x1;}console[_0x594b25(0x1a3)](a4_0x194488[_0x594b25(0x102)](_0x594b25(0x184)+(_0x467e6c+_0x5de2ba)+_0x594b25(0x134)+_0x1f3167[_0x594b25(0xff)]+'\x27'));const _0x19babd=getLLMProjectUrl(_0x33a140,_0x1f3167[_0x594b25(0x1ac)]);return console[_0x594b25(0x1a3)]('Project:\x20'+a4_0x194488['cyan'](_0x19babd)),0x0;}}
@@ -1 +1 @@
1
- const a5_0x30b425=a5_0x1e33;function a5_0x1e33(_0x56fa02,_0x274aa7){_0x56fa02=_0x56fa02-0x96;const _0xeb8c46=a5_0xeb8c();let _0x1e336=_0xeb8c46[_0x56fa02];return _0x1e336;}function a5_0xeb8c(){const _0x284967=['\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','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','push','red','Round\x20',':\x20Sending\x20user\x20input...','Duration:\x20','toLowerCase','ERROR','Re-evaluating...','Error:\x20No\x20previous\x20test\x20run\x20found.','basename','resolve','...\x20','✗\x20ERROR:\x20Project\x20not\x20found:\x20','output','No\x20tests\x20found\x20matching:\x20','Test\x20Summary','found','101705wzpRyZ','rounds','\x20\x20Round\x20','No\x20tests\x20have\x20tags\x20defined.','executeReeval','message','\x22:\x20','Test\x20Configuration:','\x20\x20Evaluating...\x20','start','FAIL','agent:test','Re-evaluation\x20Summary','add','table','site','now','text','cyan','multiple_agents','✗\x20FAIL:\x20','4553368meGFDS','tags','No\x20tests\x20found\x20with\x20tags:\x20','projectDir','split','llm','6408143SwfBhW','744ltNKvb','Agent:\x20','toISOString','forEach','description','Total:\x20\x20\x20\x20','850226PEyxrq','agentName','find','\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)','Available\x20tags:\x20','\x20\x20Project:\x20','execute','dim','⚠\x20SKIPPED:\x20','✗\x20ERROR:\x20','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','trim','llmProject','timestamp','\x20\x20Agent:\x20','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','stop','Executing\x20new\x20tests...','reason','✓\x20PASS:\x20','no_context','Failed\x20Tests:','Tests\x20found:\x20','status','Usage:','\x20(cached)','Site:\x20','Error\x20writing\x20output\x20file:\x20','no_tests','\x20\x20Site:\x20','isSpinning','Cached\x20run\x20is\x20from\x20site\x20\x22','Project\x20path:\x20','conversation_url','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','yellow','eval','PASS','tests','conversations','Conversation\x20URL:\x20','name','\x20\x20-\x20','log','projectName','\x20(new)','Cached\x20run\x20from:\x20','Running\x20test:\x20','...','Run\x20\x27tdx\x20agent\x20pull\x20','round','Evaluating\x20response...','Run\x20tests\x20for\x20an\x20LLM\x20agent','json','utf-8','dryRun','length','\x20\x20Conversation:\x20','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','Output\x20written\x20to:\x20','5655240hxPRBP','white','tsv','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','repeat','jsonl','filter','resolveAgentId','join','substring','404','has','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','Failed:\x20\x20\x20','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','7870930IXuPrd','Errors:\x20\x20\x20','18iRbkin','not\x20found','green','63atKOEQ','6576XwHtHn','writeFileSync','\x27\x20to\x20create\x20the\x20folder\x20structure.','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','Available\x20tests:\x20','includes','Test\x20','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','some','Either\x20switch\x20to\x20the\x20\x22','Passed:\x20\x20\x20','map','agent'];a5_0xeb8c=function(){return _0x284967;};return a5_0xeb8c();}(function(_0x1de714,_0x2f8fd5){const _0xafcf83=a5_0x1e33,_0x515b0a=_0x1de714();while(!![]){try{const _0x2ba2ae=-parseInt(_0xafcf83(0xae))/0x1+-parseInt(_0xafcf83(0xa8))/0x2*(parseInt(_0xafcf83(0xff))/0x3)+-parseInt(_0xafcf83(0xea))/0x4+parseInt(_0xafcf83(0x120))/0x5*(-parseInt(_0xafcf83(0xfb))/0x6)+-parseInt(_0xafcf83(0xa7))/0x7+-parseInt(_0xafcf83(0xa1))/0x8+parseInt(_0xafcf83(0xfe))/0x9*(parseInt(_0xafcf83(0xf9))/0xa);if(_0x2ba2ae===_0x2f8fd5)break;else _0x515b0a['push'](_0x515b0a['shift']());}catch(_0x37a161){_0x515b0a['push'](_0x515b0a['shift']());}}}(a5_0xeb8c,0xd7f44));import*as a5_0x51a7a4 from'node:fs';import*as a5_0x579d10 from'node:path';import a5_0x197687 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{['name']=a5_0x30b425(0x97);[a5_0x30b425(0xac)]=a5_0x30b425(0xe2);async[a5_0x30b425(0xb4)](_0x6c5d1c){const _0x24e0d4=a5_0x30b425,{options:_0x26b904,args:_0x30b25e,tdx:_0x23f329}=_0x6c5d1c,_0x44efef=_0x30b25e[0x0]||'.',_0xa9ea90=_0x26b904[_0x24e0d4(0xe5)],_0xea21b1=_0x26b904,_0x3e74e0=_0xea21b1[_0x24e0d4(0xd2)]===![],_0x33ec18=_0xea21b1['reeval'],_0x2182fa=_0xea21b1[_0x24e0d4(0xd7)],_0x3c245d=_0xea21b1[_0x24e0d4(0xa2)],_0x368b48=_0x26b904[_0x24e0d4(0x9b)],_0x346496=_0xea21b1[_0x24e0d4(0x11c)];if(_0x33ec18&&_0x3e74e0)return console[_0x24e0d4(0xd9)](a5_0x197687[_0x24e0d4(0x110)]('Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval')),0x1;let _0x561d99=_0x24e0d4(0x9a);if(_0xea21b1['json'])_0x561d99=_0x24e0d4(0xe3);else{if(_0xea21b1[_0x24e0d4(0xef)])_0x561d99=_0x24e0d4(0xef);else{if(_0xea21b1['tsv'])_0x561d99=_0x24e0d4(0xec);else{if(_0xea21b1['table'])_0x561d99=_0x24e0d4(0x9a);}}}const _0x5d2ca3=_0xea21b1[_0x24e0d4(0xba)];let _0x1a4b43=_0x44efef;const _0x2a2e57=a5_0x51a7a4['existsSync'](_0x44efef),_0x5e7351=_0x44efef==='.';if(!_0x2a2e57||_0x5e7351){const _0x1a73a2=resolveProjectFromContext(_0x44efef,_0x5d2ca3,{'requireFile':'test.yml'});if(_0x1a73a2[_0x24e0d4(0x11f)])_0x1a4b43=_0x1a73a2[_0x24e0d4(0xa4)],_0x1a73a2['source']==='context'&&console[_0x24e0d4(0xd9)](a5_0x197687[_0x24e0d4(0xb5)]('Using\x20agent:\x20'+_0x1a4b43));else switch(_0x1a73a2[_0x24e0d4(0xc0)]){case _0x24e0d4(0xc2):console[_0x24e0d4(0xd9)](a5_0x197687[_0x24e0d4(0xd1)](_0x1a73a2[_0x24e0d4(0x125)])),console[_0x24e0d4(0xd9)](),console['log'](_0x24e0d4(0xc6)),console[_0x24e0d4(0xd9)](_0x24e0d4(0x10d)),console[_0x24e0d4(0xd9)](_0x24e0d4(0xb1)),console[_0x24e0d4(0xd9)](),console[_0x24e0d4(0xd9)](_0x24e0d4(0x102));return 0x1;case'no_local_folder':console[_0x24e0d4(0xd9)](a5_0x197687[_0x24e0d4(0xd1)](_0x1a73a2[_0x24e0d4(0x125)])),console[_0x24e0d4(0xd9)](),console[_0x24e0d4(0xd9)](_0x24e0d4(0xdf)+_0x1a73a2[_0x24e0d4(0xba)]+_0x24e0d4(0x101));return 0x1;case _0x24e0d4(0x9f):{const _0x411582=a5_0x579d10[_0x24e0d4(0x118)](_0x1a73a2['projectDir']);console[_0x24e0d4(0xd9)](a5_0x197687[_0x24e0d4(0xd1)](_0x24e0d4(0x107)+_0x1a73a2[_0x24e0d4(0xba)]+'\x22:'));for(const _0x5bff80 of _0x1a73a2['agentDirs']){console[_0x24e0d4(0xd9)](_0x24e0d4(0xd8)+_0x5bff80);}return console[_0x24e0d4(0xd9)](),console['log'](_0x24e0d4(0xf8)+_0x411582+'/<agent-name>'),0x1;}case _0x24e0d4(0xca):console[_0x24e0d4(0xd9)](a5_0x197687['yellow'](_0x24e0d4(0xb8)+_0x1a73a2[_0x24e0d4(0xba)]+'\x22.')),console[_0x24e0d4(0xd9)](a5_0x197687['dim'](_0x24e0d4(0xce)+_0x1a73a2[_0x24e0d4(0xa4)])),console['log'](),console[_0x24e0d4(0xd9)](_0x24e0d4(0xbd));return 0x1;}}const {definition:_0x2eb841,agentInfo:_0xb52b90}=parseTestFile(_0x1a4b43);let _0x4a6d4e=_0x2eb841[_0x24e0d4(0xd4)];if(_0x2182fa){const _0x468c51=_0x2182fa['split'](',')[_0x24e0d4(0x10b)](_0x4083d1=>_0x4083d1[_0x24e0d4(0xb9)]());_0x4a6d4e=_0x2eb841[_0x24e0d4(0xd4)][_0x24e0d4(0xf0)](_0x5bfa15=>_0x468c51['includes'](_0x5bfa15[_0x24e0d4(0xd7)]));if(_0x4a6d4e['length']===0x0)return console[_0x24e0d4(0xd9)](a5_0x197687[_0x24e0d4(0xd1)](_0x24e0d4(0x11d)+_0x2182fa)),console['log'](a5_0x197687[_0x24e0d4(0xb5)](_0x24e0d4(0x103)+_0x2eb841[_0x24e0d4(0xd4)]['map'](_0x3fe4e0=>_0x3fe4e0[_0x24e0d4(0xd7)])[_0x24e0d4(0xf2)](',\x20'))),0x1;}if(_0x3c245d){const _0x411eeb=_0x3c245d[_0x24e0d4(0xa5)](',')[_0x24e0d4(0x10b)](_0x472398=>_0x472398['trim']()['toLowerCase']());_0x4a6d4e=_0x4a6d4e[_0x24e0d4(0xf0)](_0x3b6487=>_0x3b6487[_0x24e0d4(0xa2)]?.[_0x24e0d4(0x108)](_0x3e0b20=>_0x411eeb[_0x24e0d4(0x104)](_0x3e0b20['toLowerCase']())));if(_0x4a6d4e[_0x24e0d4(0xe6)]===0x0){console[_0x24e0d4(0xd9)](a5_0x197687['yellow'](_0x24e0d4(0xa3)+_0x3c245d));const _0x39c76f=new Set();return _0x2eb841['tests'][_0x24e0d4(0xab)](_0x2d5944=>_0x2d5944[_0x24e0d4(0xa2)]?.['forEach'](_0x44b2b9=>_0x39c76f[_0x24e0d4(0x99)](_0x44b2b9))),_0x39c76f['size']>0x0?console['log'](a5_0x197687[_0x24e0d4(0xb5)](_0x24e0d4(0xb2)+[..._0x39c76f][_0x24e0d4(0xf2)](',\x20'))):console[_0x24e0d4(0xd9)](a5_0x197687[_0x24e0d4(0xb5)](_0x24e0d4(0x123))),0x1;}}if(_0x33ec18)return this[_0x24e0d4(0x124)](_0x6c5d1c,{'definition':{'tests':_0x4a6d4e},'agentInfo':_0xb52b90,'outputFormat':_0x561d99,'outputFile':_0x346496,'testNames':_0x2182fa});if(_0xa9ea90){console[_0x24e0d4(0xd9)](a5_0x197687[_0x24e0d4(0x9e)](_0x24e0d4(0x127))),console[_0x24e0d4(0xd9)](_0x24e0d4(0xcb)+a5_0x197687[_0x24e0d4(0xeb)](_0x368b48)),console[_0x24e0d4(0xd9)](_0x24e0d4(0xb3)+a5_0x197687[_0x24e0d4(0xeb)](_0xb52b90[_0x24e0d4(0xda)])),console[_0x24e0d4(0xd9)](_0x24e0d4(0xbc)+a5_0x197687['white'](_0xb52b90['agentName'])),console[_0x24e0d4(0xd9)](),console[_0x24e0d4(0xd9)](_0x24e0d4(0xc4)+a5_0x197687[_0x24e0d4(0xeb)](_0x4a6d4e[_0x24e0d4(0xe6)]));for(let _0x6e5c25=0x0;_0x6e5c25<_0x4a6d4e[_0x24e0d4(0xe6)];_0x6e5c25++){const _0x49d16f=_0x4a6d4e[_0x6e5c25],_0x1194f6=_0x49d16f[_0x24e0d4(0x121)][_0x24e0d4(0xe6)]===0x1?_0x24e0d4(0xe0):'rounds',_0x355759=_0x49d16f[_0x24e0d4(0xa2)]?.['length']?'\x20['+_0x49d16f[_0x24e0d4(0xa2)]['join'](',\x20')+']':'';console[_0x24e0d4(0xd9)]('\x20\x20'+(_0x6e5c25+0x1)+'.\x20'+a5_0x197687['white'](_0x49d16f['name'])+'\x20('+_0x49d16f[_0x24e0d4(0x121)][_0x24e0d4(0xe6)]+'\x20'+_0x1194f6+')'+a5_0x197687['dim'](_0x355759));}return 0x0;}let _0x3ae213,_0x47d79e;try{_0x3ae213=await _0x23f329['llm']['resolveProjectId'](_0xb52b90['projectName']);}catch(_0x102f83){const _0x26126b=_0x102f83 instanceof Error?_0x102f83[_0x24e0d4(0x125)]:String(_0x102f83);return _0x26126b[_0x24e0d4(0x104)](_0x24e0d4(0xf4))||_0x26126b[_0x24e0d4(0x114)]()[_0x24e0d4(0x104)](_0x24e0d4(0xfc))?console[_0x24e0d4(0xd9)](a5_0x197687['red'](_0x24e0d4(0x11b)+_0xb52b90['projectName'])):console[_0x24e0d4(0xd9)](a5_0x197687[_0x24e0d4(0x110)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22'+_0xb52b90[_0x24e0d4(0xda)]+'\x22:\x20'+_0x26126b)),0x1;}try{_0x47d79e=await _0x23f329[_0x24e0d4(0xa6)][_0x24e0d4(0xf1)](_0xb52b90[_0x24e0d4(0xaf)],_0x3ae213);}catch(_0x19101e){const _0x4e0c01=_0x19101e instanceof Error?_0x19101e[_0x24e0d4(0x125)]:String(_0x19101e);return _0x4e0c01[_0x24e0d4(0x104)](_0x24e0d4(0xf4))||_0x4e0c01[_0x24e0d4(0x114)]()['includes']('not\x20found')?console[_0x24e0d4(0xd9)](a5_0x197687[_0x24e0d4(0x110)]('✗\x20ERROR:\x20Agent\x20not\x20found:\x20'+_0xb52b90['agentName'])):console[_0x24e0d4(0xd9)](a5_0x197687[_0x24e0d4(0x110)](_0x24e0d4(0xed)+_0xb52b90[_0x24e0d4(0xaf)]+_0x24e0d4(0x126)+_0x4e0c01)),0x1;}let _0x4b3b74;if(!_0x3e74e0)try{_0x4b3b74=await setupEvaluatorAgent(_0x23f329[_0x24e0d4(0xa6)],_0x26b904['verbose']);}catch(_0x2aa967){const _0x79237b=_0x2aa967 instanceof Error?_0x2aa967[_0x24e0d4(0x125)]:String(_0x2aa967);return console[_0x24e0d4(0xd9)](a5_0x197687[_0x24e0d4(0x110)](_0x24e0d4(0xd0)+_0x79237b)),0x1;}console[_0x24e0d4(0xd9)](a5_0x197687[_0x24e0d4(0x9e)]('Running\x20agent\x20tests...')),console[_0x24e0d4(0xd9)](_0x24e0d4(0xc8)+a5_0x197687[_0x24e0d4(0xeb)](_0x368b48)),console[_0x24e0d4(0xd9)]('Agent:\x20'+a5_0x197687[_0x24e0d4(0xeb)](_0xb52b90[_0x24e0d4(0xda)]+'/'+_0xb52b90[_0x24e0d4(0xaf)])),console['log']();const _0x1cd6bf=[],_0x436269=[],_0x363a4b=Date[_0x24e0d4(0x9c)]();for(let _0x49eadd=0x0;_0x49eadd<_0x4a6d4e[_0x24e0d4(0xe6)];_0x49eadd++){const _0x4859fa=_0x4a6d4e[_0x49eadd];_0x4a6d4e[_0x24e0d4(0xe6)]>0x1?console[_0x24e0d4(0xd9)](_0x24e0d4(0x105)+(_0x49eadd+0x1)+'/'+_0x4a6d4e[_0x24e0d4(0xe6)]+':\x20'+a5_0x197687[_0x24e0d4(0xeb)](_0x4859fa[_0x24e0d4(0xd7)])):console[_0x24e0d4(0xd9)](_0x24e0d4(0xdd)+a5_0x197687[_0x24e0d4(0xeb)](_0x4859fa[_0x24e0d4(0xd7)]));const _0x4fa77b=createCommandSpinner('Round\x201/'+_0x4859fa['rounds'][_0x24e0d4(0xe6)]+_0x24e0d4(0x112));_0x4fa77b[_0x24e0d4(0x129)]();try{const {result:_0x50f6e9,conversation:_0x11e7ef}=await runTest(_0x23f329[_0x24e0d4(0xa6)],_0x4859fa,{'agentId':_0x47d79e,'projectId':_0x3ae213,'site':_0x368b48,'noEval':_0x3e74e0,'evaluatorId':_0x4b3b74,'onRoundStart':(_0x57da92,_0x2f00af)=>{const _0x50f356=_0x24e0d4;_0x4fa77b[_0x50f356(0x9d)]=_0x50f356(0x111)+(_0x57da92+0x1)+'/'+_0x2f00af+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x5c515c,_0x583e2a,_0x827329)=>{const _0x3acc1f=_0x24e0d4,_0xdcfe51=formatElapsed(_0x583e2a);_0x827329?console[_0x3acc1f(0xd9)](_0x3acc1f(0x122)+(_0x5c515c+0x1)+'/'+_0x4859fa[_0x3acc1f(0x121)]['length']+'...\x20'+a5_0x197687[_0x3acc1f(0xfd)]('✓')+'\x20('+_0xdcfe51+')'):console[_0x3acc1f(0xd9)](_0x3acc1f(0x122)+(_0x5c515c+0x1)+'/'+_0x4859fa[_0x3acc1f(0x121)][_0x3acc1f(0xe6)]+_0x3acc1f(0x11a)+a5_0x197687[_0x3acc1f(0x110)]('✗'));},'onEvaluationStart':()=>{const _0x1fb3ff=_0x24e0d4;_0x4fa77b[_0x1fb3ff(0x9d)]=_0x1fb3ff(0xe1);},'onEvaluationComplete':_0x55c24b=>{const _0x2c55c2=_0x24e0d4,_0x4213a0=formatElapsed(_0x55c24b);console['log'](_0x2c55c2(0x128)+a5_0x197687[_0x2c55c2(0xfd)]('✓')+'\x20('+_0x4213a0+')');}});_0x4fa77b['stop'](),_0x1cd6bf[_0x24e0d4(0x10f)](_0x50f6e9),_0x436269[_0x24e0d4(0x10f)](_0x11e7ef);if(_0x50f6e9['status']===_0x24e0d4(0xd3))console['log'](a5_0x197687['green']('✓\x20PASS:\x20'+_0x50f6e9[_0x24e0d4(0xc0)]));else _0x50f6e9[_0x24e0d4(0xc5)]===_0x24e0d4(0x96)?console['log'](a5_0x197687[_0x24e0d4(0x110)](_0x24e0d4(0xa0)+_0x50f6e9['reason'])):console[_0x24e0d4(0xd9)](a5_0x197687[_0x24e0d4(0x110)]('✗\x20ERROR:\x20'+_0x50f6e9['reason']));_0x50f6e9['conversation_url']&&console[_0x24e0d4(0xd9)](a5_0x197687[_0x24e0d4(0xb5)](_0x24e0d4(0xd6)+_0x50f6e9['conversation_url'])),console[_0x24e0d4(0xd9)]();}catch(_0x413166){_0x4fa77b[_0x24e0d4(0xbe)]();const _0x5c3181=_0x413166 instanceof Error?_0x413166['message']:String(_0x413166);console[_0x24e0d4(0xd9)](a5_0x197687[_0x24e0d4(0x110)]('✗\x20ERROR:\x20'+_0x5c3181)),console[_0x24e0d4(0xd9)](),_0x1cd6bf['push']({'name':_0x4859fa[_0x24e0d4(0xd7)],'status':_0x24e0d4(0x115),'reason':_0x5c3181,'timestamp':new Date()[_0x24e0d4(0xaa)](),'duration_ms':0x0});}}const _0x138eef=Date[_0x24e0d4(0x9c)]()-_0x363a4b,_0x36c570=_0x1cd6bf[_0x24e0d4(0xf0)](_0x5adf95=>_0x5adf95[_0x24e0d4(0xc5)]===_0x24e0d4(0xd3))[_0x24e0d4(0xe6)],_0x3274be=_0x1cd6bf[_0x24e0d4(0xf0)](_0x3ce826=>_0x3ce826[_0x24e0d4(0xc5)]===_0x24e0d4(0x96))['length'],_0x229845=_0x1cd6bf['filter'](_0x4c56ac=>_0x4c56ac[_0x24e0d4(0xc5)]===_0x24e0d4(0x115))[_0x24e0d4(0xe6)];console[_0x24e0d4(0xd9)]('━'[_0x24e0d4(0xee)](0x3c)),console[_0x24e0d4(0xd9)](_0x24e0d4(0x11e)),console[_0x24e0d4(0xd9)]('━'[_0x24e0d4(0xee)](0x3c)),console['log'](_0x24e0d4(0xad)+_0x1cd6bf[_0x24e0d4(0xe6)]),console[_0x24e0d4(0xd9)]('Passed:\x20\x20\x20'+a5_0x197687[_0x24e0d4(0xfd)](_0x36c570)),console[_0x24e0d4(0xd9)](_0x24e0d4(0xf7)+a5_0x197687[_0x24e0d4(0x110)](_0x3274be));_0x229845>0x0&&console[_0x24e0d4(0xd9)](_0x24e0d4(0xfa)+a5_0x197687[_0x24e0d4(0x110)](_0x229845));console[_0x24e0d4(0xd9)](_0x24e0d4(0x113)+formatElapsed(_0x138eef)),console[_0x24e0d4(0xd9)]('━'[_0x24e0d4(0xee)](0x3c));const _0x33762e=_0x1cd6bf['filter'](_0x1edad2=>_0x1edad2['status']!==_0x24e0d4(0xd3));if(_0x33762e[_0x24e0d4(0xe6)]>0x0){console[_0x24e0d4(0xd9)](),console['log'](_0x24e0d4(0xc3));for(const _0x285156 of _0x33762e){const _0x13acb5=a5_0x197687[_0x24e0d4(0x110)]('✗'),_0x40c871=_0x285156[_0x24e0d4(0xc0)][_0x24e0d4(0xe6)]>0x32?_0x285156['reason'][_0x24e0d4(0xf3)](0x0,0x32)+'...':_0x285156['reason'];console[_0x24e0d4(0xd9)]('\x20\x20'+_0x13acb5+'\x20'+_0x285156[_0x24e0d4(0xd7)]+':\x20'+_0x40c871);}}const _0x317447={'summary':{'total':_0x1cd6bf[_0x24e0d4(0xe6)],'passed':_0x36c570,'failed':_0x3274be,'errors':_0x229845>0x0?_0x229845:undefined,'duration_ms':_0x138eef},'tests':_0x1cd6bf,'agent':{'project':_0xb52b90[_0x24e0d4(0xda)],'name':_0xb52b90[_0x24e0d4(0xaf)],'site':_0x368b48},'timestamp':new Date(_0x363a4b)[_0x24e0d4(0xaa)]()};try{const _0xe3f975=buildCachedTestRun(_0x436269,{'site':_0x368b48,'projectId':_0x3ae213,'projectName':_0xb52b90[_0x24e0d4(0xda)],'agentId':_0x47d79e,'agentName':_0xb52b90[_0x24e0d4(0xaf)],'testYmlPath':a5_0x579d10[_0x24e0d4(0x119)](_0xb52b90['testYmlPath'])});saveLastTestRun(_0xe3f975);}catch{}if(_0x561d99!==_0x24e0d4(0x9a)||_0x346496){const _0x473f80=formatResults(_0x317447,_0x561d99);if(_0x346496)try{a5_0x51a7a4[_0x24e0d4(0x100)](_0x346496,_0x473f80,_0x24e0d4(0xe4)),console[_0x24e0d4(0xd9)](),console[_0x24e0d4(0xd9)](a5_0x197687['dim'](_0x24e0d4(0xe9)+_0x346496));}catch(_0x2df67a){return console[_0x24e0d4(0xd9)](),console['log'](a5_0x197687[_0x24e0d4(0x110)](_0x24e0d4(0xc9)+_0x2df67a)),0x1;}else console[_0x24e0d4(0xd9)](),console['log'](_0x473f80);}return _0x33762e[_0x24e0d4(0xe6)]>0x0?0x1:0x0;}async[a5_0x30b425(0x124)](_0x28d54b,_0x4bbe4c){const _0x5f030b=a5_0x30b425,{options:_0x2896d0,tdx:_0x36f93a}=_0x28d54b,{definition:_0x5c2942,agentInfo:_0x21123b,outputFormat:_0x1ee023,outputFile:_0x418051}=_0x4bbe4c,_0x552467=_0x2896d0['site'],_0x419223=loadLastTestRun();if(!_0x419223)return console[_0x5f030b(0xd9)](a5_0x197687[_0x5f030b(0x110)](_0x5f030b(0x117))),console[_0x5f030b(0xd9)](a5_0x197687['dim']('Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.')),0x1;if(_0x419223[_0x5f030b(0x10c)][_0x5f030b(0xaf)]!==_0x21123b['agentName'])return console['log'](a5_0x197687[_0x5f030b(0x110)](_0x5f030b(0xe8)+_0x419223[_0x5f030b(0x10c)][_0x5f030b(0xaf)]+'\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22'+_0x21123b[_0x5f030b(0xaf)]+'\x22.')),console['log'](a5_0x197687['dim']('Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.')),0x1;const _0x27af3a=new Set(_0x419223[_0x5f030b(0xd5)]['map'](_0x500e8e=>_0x500e8e['testName'])),_0x18341b=_0x5c2942[_0x5f030b(0xd4)][_0x5f030b(0xf0)](_0x5b694b=>!_0x27af3a[_0x5f030b(0xf5)](_0x5b694b['name']));if(_0x18341b[_0x5f030b(0xe6)]>0x0&&_0x419223[_0x5f030b(0x9b)]!==_0x552467)return console['log'](a5_0x197687[_0x5f030b(0x110)](_0x5f030b(0xf6))),console[_0x5f030b(0xd9)](a5_0x197687['dim'](_0x5f030b(0xcd)+_0x419223['site']+'\x22,\x20but\x20current\x20site\x20is\x20\x22'+_0x552467+'\x22.')),console[_0x5f030b(0xd9)](a5_0x197687[_0x5f030b(0xb5)](_0x5f030b(0x109)+_0x419223['site']+_0x5f030b(0x10e))),0x1;const _0x4f9fe8=_0x5c2942[_0x5f030b(0xd4)]['filter'](_0x560504=>_0x27af3a[_0x5f030b(0xf5)](_0x560504[_0x5f030b(0xd7)])),_0xebc96c=_0x18341b;let _0x54cec0;try{_0x54cec0=await setupEvaluatorAgent(_0x36f93a[_0x5f030b(0xa6)],_0x2896d0['verbose']);}catch(_0x3adde7){const _0x68cf3=_0x3adde7 instanceof Error?_0x3adde7['message']:String(_0x3adde7);return console[_0x5f030b(0xd9)](a5_0x197687[_0x5f030b(0x110)](_0x5f030b(0xd0)+_0x68cf3)),0x1;}console['log'](a5_0x197687['cyan']('Re-evaluating\x20cached\x20test\x20run...')),console[_0x5f030b(0xd9)](_0x5f030b(0xdc)+a5_0x197687[_0x5f030b(0xeb)](_0x419223[_0x5f030b(0xbb)])),console[_0x5f030b(0xd9)](_0x5f030b(0xa9)+a5_0x197687[_0x5f030b(0xeb)](_0x419223['agent'][_0x5f030b(0xda)]+'/'+_0x419223[_0x5f030b(0x10c)][_0x5f030b(0xaf)]));_0xebc96c[_0x5f030b(0xe6)]>0x0&&console[_0x5f030b(0xd9)]('New\x20tests\x20to\x20execute:\x20'+a5_0x197687[_0x5f030b(0xd1)](_0xebc96c[_0x5f030b(0xe6)]));console[_0x5f030b(0xd9)]();const _0x4eeb78=[],_0x52d0db=Date[_0x5f030b(0x9c)](),_0x47689d=createCommandSpinner(_0x5f030b(0x116));if(_0x4f9fe8[_0x5f030b(0xe6)]>0x0)try{const _0x223173=await reevaluateFromCache(_0x36f93a['llm'],_0x419223,{'tests':_0x4f9fe8},{'evaluatorId':_0x54cec0,'onTestStart':(_0x19723e,_0x4b5e32,_0xdbe4bd)=>{const _0x2b6de7=_0x5f030b;_0x47689d['text']='Re-evaluating\x20'+(_0x4b5e32+0x1)+'/'+_0xdbe4bd+':\x20'+_0x19723e+_0x2b6de7(0xde);if(!_0x47689d[_0x2b6de7(0xcc)])_0x47689d[_0x2b6de7(0x129)]();},'onTestComplete':(_0x58d25c,_0x422644)=>{const _0x510254=_0x5f030b;_0x47689d['stop']();if(_0x422644['status']===_0x510254(0xd3))console['log'](a5_0x197687[_0x510254(0xfd)](_0x510254(0xc1)+_0x58d25c)+a5_0x197687[_0x510254(0xb5)](_0x510254(0xc7)));else _0x422644[_0x510254(0xc5)]===_0x510254(0x96)?console[_0x510254(0xd9)](a5_0x197687['red'](_0x510254(0xa0)+_0x58d25c+'\x20-\x20'+_0x422644[_0x510254(0xc0)])+a5_0x197687[_0x510254(0xb5)]('\x20(cached)')):console[_0x510254(0xd9)](a5_0x197687['red'](_0x510254(0xb7)+_0x58d25c+'\x20-\x20'+_0x422644[_0x510254(0xc0)]));_0x422644[_0x510254(0xcf)]&&console[_0x510254(0xd9)](a5_0x197687[_0x510254(0xb5)](_0x510254(0xe7)+_0x422644['conversation_url'])),_0x4eeb78[_0x510254(0x10f)](_0x422644);},'onTestSkipped':(_0x342d36,_0x4fff0f)=>{const _0x4bdb2a=_0x5f030b;_0x47689d[_0x4bdb2a(0xbe)](),console[_0x4bdb2a(0xd9)](a5_0x197687[_0x4bdb2a(0xd1)](_0x4bdb2a(0xb6)+_0x342d36+'\x20-\x20'+_0x4fff0f));}});for(const _0x281d74 of _0x223173){!_0x4eeb78[_0x5f030b(0xb0)](_0x43c3ca=>_0x43c3ca[_0x5f030b(0xd7)]===_0x281d74[_0x5f030b(0xd7)])&&_0x4eeb78['push'](_0x281d74);}}catch(_0xa3fa11){_0x47689d[_0x5f030b(0xbe)]();const _0x2d14ad=_0xa3fa11 instanceof Error?_0xa3fa11['message']:String(_0xa3fa11);return console[_0x5f030b(0xd9)](a5_0x197687[_0x5f030b(0x110)](_0x5f030b(0x106)+_0x2d14ad)),0x1;}_0x47689d[_0x5f030b(0xbe)]();if(_0xebc96c[_0x5f030b(0xe6)]>0x0){console[_0x5f030b(0xd9)](),console[_0x5f030b(0xd9)](a5_0x197687[_0x5f030b(0x9e)](_0x5f030b(0xbf)));const {projectId:_0x49f36a,agentId:_0x372323}=_0x419223[_0x5f030b(0x10c)];for(const _0x177f70 of _0xebc96c){console[_0x5f030b(0xd9)]('Running:\x20'+a5_0x197687['white'](_0x177f70['name']));const _0x56bfe4=createCommandSpinner('Round\x201/'+_0x177f70[_0x5f030b(0x121)][_0x5f030b(0xe6)]+_0x5f030b(0x112));_0x56bfe4[_0x5f030b(0x129)]();try{const {result:_0x566cfd}=await runTest(_0x36f93a[_0x5f030b(0xa6)],_0x177f70,{'agentId':_0x372323,'projectId':_0x49f36a,'site':_0x419223[_0x5f030b(0x9b)],'noEval':![],'evaluatorId':_0x54cec0,'onRoundStart':(_0x233a53,_0x13c0fb)=>{const _0x39e249=_0x5f030b;_0x56bfe4[_0x39e249(0x9d)]=_0x39e249(0x111)+(_0x233a53+0x1)+'/'+_0x13c0fb+_0x39e249(0x112);},'onRoundComplete':(_0x422dd5,_0x30fa97,_0x11c6e4)=>{const _0x460fe7=_0x5f030b,_0x7cb6db=formatElapsed(_0x30fa97);_0x11c6e4?console[_0x460fe7(0xd9)](_0x460fe7(0x122)+(_0x422dd5+0x1)+'/'+_0x177f70[_0x460fe7(0x121)]['length']+'...\x20'+a5_0x197687[_0x460fe7(0xfd)]('✓')+'\x20('+_0x7cb6db+')'):console[_0x460fe7(0xd9)](_0x460fe7(0x122)+(_0x422dd5+0x1)+'/'+_0x177f70[_0x460fe7(0x121)][_0x460fe7(0xe6)]+_0x460fe7(0x11a)+a5_0x197687['red']('✗'));},'onEvaluationStart':()=>{const _0xa0dab2=_0x5f030b;_0x56bfe4[_0xa0dab2(0x9d)]=_0xa0dab2(0xe1);},'onEvaluationComplete':_0x52e0e9=>{const _0x3d02a5=_0x5f030b,_0x450aa8=formatElapsed(_0x52e0e9);console[_0x3d02a5(0xd9)]('\x20\x20Evaluating...\x20'+a5_0x197687[_0x3d02a5(0xfd)]('✓')+'\x20('+_0x450aa8+')');}});_0x56bfe4[_0x5f030b(0xbe)](),_0x4eeb78[_0x5f030b(0x10f)](_0x566cfd);if(_0x566cfd[_0x5f030b(0xc5)]==='PASS')console['log'](a5_0x197687[_0x5f030b(0xfd)]('✓\x20PASS:\x20'+_0x566cfd[_0x5f030b(0xc0)])+a5_0x197687['dim'](_0x5f030b(0xdb)));else _0x566cfd[_0x5f030b(0xc5)]===_0x5f030b(0x96)?console[_0x5f030b(0xd9)](a5_0x197687[_0x5f030b(0x110)](_0x5f030b(0xa0)+_0x566cfd['reason'])+a5_0x197687[_0x5f030b(0xb5)](_0x5f030b(0xdb))):console[_0x5f030b(0xd9)](a5_0x197687[_0x5f030b(0x110)](_0x5f030b(0xb7)+_0x566cfd[_0x5f030b(0xc0)]));_0x566cfd[_0x5f030b(0xcf)]&&console[_0x5f030b(0xd9)](a5_0x197687[_0x5f030b(0xb5)](_0x5f030b(0xe7)+_0x566cfd[_0x5f030b(0xcf)]));}catch(_0x25a65d){_0x56bfe4[_0x5f030b(0xbe)]();const _0x554e81=_0x25a65d instanceof Error?_0x25a65d[_0x5f030b(0x125)]:String(_0x25a65d);console[_0x5f030b(0xd9)](a5_0x197687[_0x5f030b(0x110)](_0x5f030b(0xb7)+_0x554e81)),_0x4eeb78[_0x5f030b(0x10f)]({'name':_0x177f70[_0x5f030b(0xd7)],'status':'ERROR','reason':_0x554e81,'timestamp':new Date()[_0x5f030b(0xaa)](),'duration_ms':0x0});}}}console[_0x5f030b(0xd9)]();const _0xfa1f01=Date['now']()-_0x52d0db,_0x26e235=_0x4eeb78['filter'](_0x17a53f=>_0x17a53f[_0x5f030b(0xc5)]==='PASS')[_0x5f030b(0xe6)],_0x487197=_0x4eeb78['filter'](_0x2d6de1=>_0x2d6de1[_0x5f030b(0xc5)]==='FAIL')[_0x5f030b(0xe6)],_0x4098ef=_0x4eeb78[_0x5f030b(0xf0)](_0x197618=>_0x197618[_0x5f030b(0xc5)]===_0x5f030b(0x115))[_0x5f030b(0xe6)];console[_0x5f030b(0xd9)]('━'[_0x5f030b(0xee)](0x3c)),console['log'](_0x5f030b(0x98)),console[_0x5f030b(0xd9)]('━'['repeat'](0x3c)),console[_0x5f030b(0xd9)](_0x5f030b(0xad)+_0x4eeb78[_0x5f030b(0xe6)]),console[_0x5f030b(0xd9)](_0x5f030b(0x10a)+a5_0x197687[_0x5f030b(0xfd)](_0x26e235)),console[_0x5f030b(0xd9)](_0x5f030b(0xf7)+a5_0x197687[_0x5f030b(0x110)](_0x487197));_0x4098ef>0x0&&console[_0x5f030b(0xd9)]('Errors:\x20\x20\x20'+a5_0x197687[_0x5f030b(0x110)](_0x4098ef));console[_0x5f030b(0xd9)](_0x5f030b(0x113)+formatElapsed(_0xfa1f01)),console[_0x5f030b(0xd9)]('━'['repeat'](0x3c));const _0x268801={'summary':{'total':_0x4eeb78[_0x5f030b(0xe6)],'passed':_0x26e235,'failed':_0x487197,'errors':_0x4098ef>0x0?_0x4098ef:undefined,'duration_ms':_0xfa1f01},'tests':_0x4eeb78,'agent':{'project':_0x21123b[_0x5f030b(0xda)],'name':_0x21123b[_0x5f030b(0xaf)],'site':_0x552467},'timestamp':new Date(_0x52d0db)['toISOString']()};if(_0x1ee023!==_0x5f030b(0x9a)||_0x418051){const _0x23760f=formatResults(_0x268801,_0x1ee023);if(_0x418051)try{a5_0x51a7a4[_0x5f030b(0x100)](_0x418051,_0x23760f,_0x5f030b(0xe4)),console['log'](),console[_0x5f030b(0xd9)](a5_0x197687[_0x5f030b(0xb5)]('Output\x20written\x20to:\x20'+_0x418051));}catch(_0xfb54f2){return console['log'](),console[_0x5f030b(0xd9)](a5_0x197687['red']('Error\x20writing\x20output\x20file:\x20'+_0xfb54f2)),0x1;}else console[_0x5f030b(0xd9)](),console[_0x5f030b(0xd9)](_0x23760f);}const _0x53650e=_0x4eeb78[_0x5f030b(0xf0)](_0x74a6=>_0x74a6[_0x5f030b(0xc5)]!==_0x5f030b(0xd3));return _0x53650e[_0x5f030b(0xe6)]>0x0?0x1:0x0;}}
1
+ const a5_0x20e6e0=a5_0xaf1c;(function(_0x16d17c,_0x156560){const _0x54c7fe=a5_0xaf1c,_0x368a9f=_0x16d17c();while(!![]){try{const _0x2dc7a8=parseInt(_0x54c7fe(0x23c))/0x1*(-parseInt(_0x54c7fe(0x1f6))/0x2)+-parseInt(_0x54c7fe(0x255))/0x3+-parseInt(_0x54c7fe(0x24c))/0x4*(parseInt(_0x54c7fe(0x207))/0x5)+parseInt(_0x54c7fe(0x202))/0x6*(-parseInt(_0x54c7fe(0x266))/0x7)+parseInt(_0x54c7fe(0x218))/0x8*(parseInt(_0x54c7fe(0x20c))/0x9)+-parseInt(_0x54c7fe(0x26b))/0xa*(-parseInt(_0x54c7fe(0x1f2))/0xb)+parseInt(_0x54c7fe(0x25c))/0xc;if(_0x2dc7a8===_0x156560)break;else _0x368a9f['push'](_0x368a9f['shift']());}catch(_0x1d60da){_0x368a9f['push'](_0x368a9f['shift']());}}}(a5_0x1677,0x50cf6));import*as a5_0x3028ca from'node:fs';import*as a5_0x24c59d from'node:path';import a5_0x43a431 from'chalk';function a5_0xaf1c(_0x26d5f3,_0x1eb219){_0x26d5f3=_0x26d5f3-0x1ed;const _0x1677bb=a5_0x1677();let _0xaf1c84=_0x1677bb[_0x26d5f3];return _0xaf1c84;}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';function a5_0x1677(){const _0x557c85=['repeat','white','\x22,\x20but\x20current\x20site\x20is\x20\x22','534410dukhcn','rounds','Re-evaluating\x20','\x20\x20Evaluating...\x20','resolveAgentId','Agent:\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','writeFileSync',':\x20Sending\x20user\x20input...','Error\x20writing\x20output\x20file:\x20','not\x20found','Error:\x20No\x20previous\x20test\x20run\x20found.','2238PHbbEY','includes','reason','Passed:\x20\x20\x20','Cached\x20run\x20is\x20from\x20site\x20\x22','335IpGtle','site','dim','testYmlPath','Output\x20written\x20to:\x20','9rpShQu','...','Using\x20agent:\x20','found','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','Running:\x20','Failed:\x20\x20\x20','split','verbose','no_local_folder','Errors:\x20\x20\x20','ERROR','2078672LLHkCp','Tests\x20found:\x20','PASS','\x27\x20to\x20create\x20the\x20folder\x20structure.','tsv','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','start','Re-evaluating\x20cached\x20test\x20run...','testName','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','add','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','agent:test','eval','executeReeval','tags','push','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','Running\x20test:\x20','Re-evaluation\x20Summary','no_tests','resolveProjectId','✗\x20ERROR:\x20','size','no_context','Round\x20','toISOString','Evaluating\x20response...','map','some','message','Re-evaluating...','Run\x20tests\x20for\x20an\x20LLM\x20agent','Total:\x20\x20\x20\x20','tests','\x20(cached)','1HklHpO','red','yellow','conversations','isSpinning','projectDir','\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','description','...\x20','Cached\x20run\x20from:\x20','agent','toLowerCase','Test\x20','\x20\x20Round\x20','\x20\x20Conversation:\x20','llm','28972fvLuWO','/<agent-name>','jsonl','Available\x20tests:\x20','name','\x22:\x20','✗\x20ERROR:\x20Project\x20not\x20found:\x20','\x20\x20Agent:\x20','llmProject','515436KuTgjB','conversation_url','utf-8','404','No\x20tests\x20found\x20matching:\x20','table','join','17408052UHsDnE','✗\x20FAIL:\x20','length','No\x20tests\x20found\x20with\x20tags:\x20','New\x20tests\x20to\x20execute:\x20','\x20\x20-\x20','FAIL','timestamp','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','⚠\x20SKIPPED:\x20','11109vNNWrM','round','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','status','log','20yElGgU','resolve','Running\x20agent\x20tests...','Project\x20path:\x20','Duration:\x20','multiple_agents','source','output','green','\x20\x20tdx\x20agent\x20test\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20(requires\x20context\x20or\x20tdx.json)','\x20\x20Site:\x20','filter','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','trim','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','text','forEach','dryRun','now','projectName','Site:\x20','\x20-\x20','reeval','agentDirs','cyan','Executing\x20new\x20tests...','\x20(new)','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','agentName','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','find','✓\x20PASS:\x20','Round\x201/','stop','Run\x20\x27tdx\x20agent\x20pull\x20','752081yFXiYZ'];a5_0x1677=function(){return _0x557c85;};return a5_0x1677();}import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x20e6e0(0x250)]=a5_0x20e6e0(0x224);[a5_0x20e6e0(0x243)]=a5_0x20e6e0(0x238);async['execute'](_0x1cbca1){const _0x18e24b=a5_0x20e6e0,{options:_0x11bf7b,args:_0x4880a8,tdx:_0xdeaef1}=_0x1cbca1,_0xa5a1f8=_0x4880a8[0x0]||'.',_0x1a3752=_0x11bf7b[_0x18e24b(0x27c)],_0x3b9a9c=_0x11bf7b,_0xf0c9b6=_0x3b9a9c[_0x18e24b(0x225)]===![],_0xe35349=_0x3b9a9c[_0x18e24b(0x281)],_0x121da2=_0x3b9a9c['name'],_0xbac2b3=_0x3b9a9c[_0x18e24b(0x227)],_0x2649c0=_0x11bf7b[_0x18e24b(0x208)],_0x1526b9=_0x3b9a9c[_0x18e24b(0x272)];if(_0xe35349&&_0xf0c9b6)return console[_0x18e24b(0x26a)](a5_0x43a431[_0x18e24b(0x23d)](_0x18e24b(0x286))),0x1;let _0x11fd1b=_0x18e24b(0x25a);if(_0x3b9a9c['json'])_0x11fd1b='json';else{if(_0x3b9a9c[_0x18e24b(0x24e)])_0x11fd1b='jsonl';else{if(_0x3b9a9c[_0x18e24b(0x21c)])_0x11fd1b=_0x18e24b(0x21c);else{if(_0x3b9a9c[_0x18e24b(0x25a)])_0x11fd1b=_0x18e24b(0x25a);}}}const _0x45216d=_0x3b9a9c[_0x18e24b(0x254)];let _0xba5ed9=_0xa5a1f8;const _0x179073=a5_0x3028ca['existsSync'](_0xa5a1f8),_0x2ef7cd=_0xa5a1f8==='.';if(!_0x179073||_0x2ef7cd){const _0x5f5dda=resolveProjectFromContext(_0xa5a1f8,_0x45216d,{'requireFile':'test.yml'});if(_0x5f5dda[_0x18e24b(0x20f)])_0xba5ed9=_0x5f5dda[_0x18e24b(0x241)],_0x5f5dda[_0x18e24b(0x271)]==='context'&&console['log'](a5_0x43a431[_0x18e24b(0x209)](_0x18e24b(0x20e)+_0xba5ed9));else switch(_0x5f5dda[_0x18e24b(0x204)]){case _0x18e24b(0x230):console[_0x18e24b(0x26a)](a5_0x43a431['yellow'](_0x5f5dda[_0x18e24b(0x236)])),console['log'](),console[_0x18e24b(0x26a)]('Usage:'),console[_0x18e24b(0x26a)](_0x18e24b(0x242)),console['log'](_0x18e24b(0x274)),console['log'](),console[_0x18e24b(0x26a)]('Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>');return 0x1;case _0x18e24b(0x215):console[_0x18e24b(0x26a)](a5_0x43a431[_0x18e24b(0x23e)](_0x5f5dda[_0x18e24b(0x236)])),console[_0x18e24b(0x26a)](),console[_0x18e24b(0x26a)](_0x18e24b(0x1f1)+_0x5f5dda[_0x18e24b(0x254)]+_0x18e24b(0x21b));return 0x1;case _0x18e24b(0x270):{const _0xf162a5=a5_0x24c59d['basename'](_0x5f5dda[_0x18e24b(0x241)]);console['log'](a5_0x43a431['yellow']('Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22'+_0x5f5dda[_0x18e24b(0x254)]+'\x22:'));for(const _0x187278 of _0x5f5dda[_0x18e24b(0x282)]){console[_0x18e24b(0x26a)](_0x18e24b(0x261)+_0x187278);}return console['log'](),console[_0x18e24b(0x26a)](_0x18e24b(0x279)+_0xf162a5+_0x18e24b(0x24d)),0x1;}case _0x18e24b(0x22c):console[_0x18e24b(0x26a)](a5_0x43a431[_0x18e24b(0x23e)]('No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22'+_0x5f5dda[_0x18e24b(0x254)]+'\x22.')),console[_0x18e24b(0x26a)](a5_0x43a431[_0x18e24b(0x209)](_0x18e24b(0x26e)+_0x5f5dda[_0x18e24b(0x241)])),console['log'](),console[_0x18e24b(0x26a)](_0x18e24b(0x221));return 0x1;}}const {definition:_0x4e4de5,agentInfo:_0x25d7ba}=parseTestFile(_0xba5ed9);let _0x54b1ea=_0x4e4de5['tests'];if(_0x121da2){const _0x1530a4=_0x121da2[_0x18e24b(0x213)](',')[_0x18e24b(0x234)](_0x3e520e=>_0x3e520e['trim']());_0x54b1ea=_0x4e4de5['tests'][_0x18e24b(0x276)](_0x552506=>_0x1530a4[_0x18e24b(0x203)](_0x552506[_0x18e24b(0x250)]));if(_0x54b1ea[_0x18e24b(0x25e)]===0x0)return console[_0x18e24b(0x26a)](a5_0x43a431['yellow'](_0x18e24b(0x259)+_0x121da2)),console['log'](a5_0x43a431[_0x18e24b(0x209)](_0x18e24b(0x24f)+_0x4e4de5['tests'][_0x18e24b(0x234)](_0x2d4f37=>_0x2d4f37[_0x18e24b(0x250)])[_0x18e24b(0x25b)](',\x20'))),0x1;}if(_0xbac2b3){const _0x471378=_0xbac2b3[_0x18e24b(0x213)](',')[_0x18e24b(0x234)](_0x3cb5eb=>_0x3cb5eb[_0x18e24b(0x278)]()['toLowerCase']());_0x54b1ea=_0x54b1ea[_0x18e24b(0x276)](_0x3b7338=>_0x3b7338[_0x18e24b(0x227)]?.[_0x18e24b(0x235)](_0x40515a=>_0x471378[_0x18e24b(0x203)](_0x40515a[_0x18e24b(0x247)]())));if(_0x54b1ea[_0x18e24b(0x25e)]===0x0){console['log'](a5_0x43a431[_0x18e24b(0x23e)](_0x18e24b(0x25f)+_0xbac2b3));const _0x149a7a=new Set();return _0x4e4de5[_0x18e24b(0x23a)][_0x18e24b(0x27b)](_0x320dfa=>_0x320dfa[_0x18e24b(0x227)]?.[_0x18e24b(0x27b)](_0x2fc03e=>_0x149a7a[_0x18e24b(0x222)](_0x2fc03e))),_0x149a7a[_0x18e24b(0x22f)]>0x0?console[_0x18e24b(0x26a)](a5_0x43a431['dim']('Available\x20tags:\x20'+[..._0x149a7a][_0x18e24b(0x25b)](',\x20'))):console[_0x18e24b(0x26a)](a5_0x43a431[_0x18e24b(0x209)]('No\x20tests\x20have\x20tags\x20defined.')),0x1;}}if(_0xe35349)return this[_0x18e24b(0x226)](_0x1cbca1,{'definition':{'tests':_0x54b1ea},'agentInfo':_0x25d7ba,'outputFormat':_0x11fd1b,'outputFile':_0x1526b9,'testNames':_0x121da2});if(_0x1a3752){console[_0x18e24b(0x26a)](a5_0x43a431[_0x18e24b(0x283)]('Test\x20Configuration:')),console['log'](_0x18e24b(0x275)+a5_0x43a431[_0x18e24b(0x1f4)](_0x2649c0)),console[_0x18e24b(0x26a)]('\x20\x20Project:\x20'+a5_0x43a431[_0x18e24b(0x1f4)](_0x25d7ba[_0x18e24b(0x27e)])),console['log'](_0x18e24b(0x253)+a5_0x43a431['white'](_0x25d7ba[_0x18e24b(0x287)])),console['log'](),console[_0x18e24b(0x26a)](_0x18e24b(0x219)+a5_0x43a431[_0x18e24b(0x1f4)](_0x54b1ea['length']));for(let _0x585b0e=0x0;_0x585b0e<_0x54b1ea[_0x18e24b(0x25e)];_0x585b0e++){const _0x497444=_0x54b1ea[_0x585b0e],_0x4b598a=_0x497444[_0x18e24b(0x1f7)][_0x18e24b(0x25e)]===0x1?_0x18e24b(0x267):_0x18e24b(0x1f7),_0x289df6=_0x497444[_0x18e24b(0x227)]?.[_0x18e24b(0x25e)]?'\x20['+_0x497444['tags']['join'](',\x20')+']':'';console['log']('\x20\x20'+(_0x585b0e+0x1)+'.\x20'+a5_0x43a431['white'](_0x497444[_0x18e24b(0x250)])+'\x20('+_0x497444[_0x18e24b(0x1f7)]['length']+'\x20'+_0x4b598a+')'+a5_0x43a431['dim'](_0x289df6));}return 0x0;}let _0x189320,_0x12c047;try{_0x189320=await _0xdeaef1['llm'][_0x18e24b(0x22d)](_0x25d7ba[_0x18e24b(0x27e)]);}catch(_0x53450a){const _0xce263d=_0x53450a instanceof Error?_0x53450a[_0x18e24b(0x236)]:String(_0x53450a);return _0xce263d[_0x18e24b(0x203)](_0x18e24b(0x258))||_0xce263d['toLowerCase']()[_0x18e24b(0x203)]('not\x20found')?console[_0x18e24b(0x26a)](a5_0x43a431[_0x18e24b(0x23d)](_0x18e24b(0x252)+_0x25d7ba[_0x18e24b(0x27e)])):console[_0x18e24b(0x26a)](a5_0x43a431[_0x18e24b(0x23d)](_0x18e24b(0x264)+_0x25d7ba[_0x18e24b(0x27e)]+_0x18e24b(0x251)+_0xce263d)),0x1;}try{_0x12c047=await _0xdeaef1[_0x18e24b(0x24b)][_0x18e24b(0x1fa)](_0x25d7ba[_0x18e24b(0x287)],_0x189320);}catch(_0x27a2b2){const _0x218f5c=_0x27a2b2 instanceof Error?_0x27a2b2['message']:String(_0x27a2b2);return _0x218f5c['includes'](_0x18e24b(0x258))||_0x218f5c[_0x18e24b(0x247)]()[_0x18e24b(0x203)](_0x18e24b(0x200))?console['log'](a5_0x43a431['red'](_0x18e24b(0x277)+_0x25d7ba[_0x18e24b(0x287)])):console[_0x18e24b(0x26a)](a5_0x43a431[_0x18e24b(0x23d)](_0x18e24b(0x1fc)+_0x25d7ba['agentName']+'\x22:\x20'+_0x218f5c)),0x1;}let _0xabf68f;if(!_0xf0c9b6)try{_0xabf68f=await setupEvaluatorAgent(_0xdeaef1[_0x18e24b(0x24b)],_0x11bf7b[_0x18e24b(0x214)]);}catch(_0x5ccbd8){const _0xe6b936=_0x5ccbd8 instanceof Error?_0x5ccbd8[_0x18e24b(0x236)]:String(_0x5ccbd8);return console['log'](a5_0x43a431[_0x18e24b(0x23d)]('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0xe6b936)),0x1;}console[_0x18e24b(0x26a)](a5_0x43a431['cyan'](_0x18e24b(0x26d))),console[_0x18e24b(0x26a)](_0x18e24b(0x27f)+a5_0x43a431[_0x18e24b(0x1f4)](_0x2649c0)),console['log'](_0x18e24b(0x1fb)+a5_0x43a431[_0x18e24b(0x1f4)](_0x25d7ba[_0x18e24b(0x27e)]+'/'+_0x25d7ba['agentName'])),console[_0x18e24b(0x26a)]();const _0x122fc4=[],_0x5f263=[],_0x4db81d=Date[_0x18e24b(0x27d)]();for(let _0x3b12b7=0x0;_0x3b12b7<_0x54b1ea[_0x18e24b(0x25e)];_0x3b12b7++){const _0x5bb6a5=_0x54b1ea[_0x3b12b7];_0x54b1ea['length']>0x1?console[_0x18e24b(0x26a)](_0x18e24b(0x248)+(_0x3b12b7+0x1)+'/'+_0x54b1ea[_0x18e24b(0x25e)]+':\x20'+a5_0x43a431[_0x18e24b(0x1f4)](_0x5bb6a5[_0x18e24b(0x250)])):console[_0x18e24b(0x26a)](_0x18e24b(0x22a)+a5_0x43a431[_0x18e24b(0x1f4)](_0x5bb6a5['name']));const _0x4fe83d=createCommandSpinner(_0x18e24b(0x1ef)+_0x5bb6a5['rounds'][_0x18e24b(0x25e)]+_0x18e24b(0x1fe));_0x4fe83d[_0x18e24b(0x21e)]();try{const {result:_0x320258,conversation:_0xb7eb85}=await runTest(_0xdeaef1[_0x18e24b(0x24b)],_0x5bb6a5,{'agentId':_0x12c047,'projectId':_0x189320,'site':_0x2649c0,'noEval':_0xf0c9b6,'evaluatorId':_0xabf68f,'onRoundStart':(_0x3a9d8a,_0x297a31)=>{const _0x1b1107=_0x18e24b;_0x4fe83d[_0x1b1107(0x27a)]=_0x1b1107(0x231)+(_0x3a9d8a+0x1)+'/'+_0x297a31+_0x1b1107(0x1fe);},'onRoundComplete':(_0x5bc13f,_0x5a9f18,_0x504d91)=>{const _0xbc110d=_0x18e24b,_0x353d39=formatElapsed(_0x5a9f18);_0x504d91?console[_0xbc110d(0x26a)]('\x20\x20Round\x20'+(_0x5bc13f+0x1)+'/'+_0x5bb6a5[_0xbc110d(0x1f7)][_0xbc110d(0x25e)]+_0xbc110d(0x244)+a5_0x43a431[_0xbc110d(0x273)]('✓')+'\x20('+_0x353d39+')'):console['log'](_0xbc110d(0x249)+(_0x5bc13f+0x1)+'/'+_0x5bb6a5['rounds'][_0xbc110d(0x25e)]+_0xbc110d(0x244)+a5_0x43a431[_0xbc110d(0x23d)]('✗'));},'onEvaluationStart':()=>{const _0x2f885d=_0x18e24b;_0x4fe83d[_0x2f885d(0x27a)]=_0x2f885d(0x233);},'onEvaluationComplete':_0x31e471=>{const _0x3cd3e5=_0x18e24b,_0x12befe=formatElapsed(_0x31e471);console[_0x3cd3e5(0x26a)](_0x3cd3e5(0x1f9)+a5_0x43a431[_0x3cd3e5(0x273)]('✓')+'\x20('+_0x12befe+')');}});_0x4fe83d['stop'](),_0x122fc4['push'](_0x320258),_0x5f263[_0x18e24b(0x228)](_0xb7eb85);if(_0x320258[_0x18e24b(0x269)]==='PASS')console['log'](a5_0x43a431[_0x18e24b(0x273)](_0x18e24b(0x1ee)+_0x320258[_0x18e24b(0x204)]));else _0x320258[_0x18e24b(0x269)]===_0x18e24b(0x262)?console[_0x18e24b(0x26a)](a5_0x43a431[_0x18e24b(0x23d)](_0x18e24b(0x25d)+_0x320258[_0x18e24b(0x204)])):console[_0x18e24b(0x26a)](a5_0x43a431[_0x18e24b(0x23d)](_0x18e24b(0x22e)+_0x320258[_0x18e24b(0x204)]));_0x320258['conversation_url']&&console[_0x18e24b(0x26a)](a5_0x43a431[_0x18e24b(0x209)]('Conversation\x20URL:\x20'+_0x320258[_0x18e24b(0x256)])),console[_0x18e24b(0x26a)]();}catch(_0x38836e){_0x4fe83d[_0x18e24b(0x1f0)]();const _0x40ca42=_0x38836e instanceof Error?_0x38836e['message']:String(_0x38836e);console['log'](a5_0x43a431[_0x18e24b(0x23d)](_0x18e24b(0x22e)+_0x40ca42)),console[_0x18e24b(0x26a)](),_0x122fc4[_0x18e24b(0x228)]({'name':_0x5bb6a5['name'],'status':_0x18e24b(0x217),'reason':_0x40ca42,'timestamp':new Date()[_0x18e24b(0x232)](),'duration_ms':0x0});}}const _0x1976e9=Date['now']()-_0x4db81d,_0x592d9b=_0x122fc4[_0x18e24b(0x276)](_0xc3da03=>_0xc3da03['status']===_0x18e24b(0x21a))[_0x18e24b(0x25e)],_0x8b108d=_0x122fc4['filter'](_0x143318=>_0x143318['status']==='FAIL')['length'],_0x279527=_0x122fc4['filter'](_0x2c6847=>_0x2c6847[_0x18e24b(0x269)]===_0x18e24b(0x217))[_0x18e24b(0x25e)];console[_0x18e24b(0x26a)]('━'['repeat'](0x3c)),console['log']('Test\x20Summary'),console[_0x18e24b(0x26a)]('━'[_0x18e24b(0x1f3)](0x3c)),console[_0x18e24b(0x26a)](_0x18e24b(0x239)+_0x122fc4['length']),console[_0x18e24b(0x26a)](_0x18e24b(0x205)+a5_0x43a431['green'](_0x592d9b)),console[_0x18e24b(0x26a)](_0x18e24b(0x212)+a5_0x43a431[_0x18e24b(0x23d)](_0x8b108d));_0x279527>0x0&&console[_0x18e24b(0x26a)](_0x18e24b(0x216)+a5_0x43a431['red'](_0x279527));console[_0x18e24b(0x26a)](_0x18e24b(0x26f)+formatElapsed(_0x1976e9)),console[_0x18e24b(0x26a)]('━'[_0x18e24b(0x1f3)](0x3c));const _0x5d9925=_0x122fc4[_0x18e24b(0x276)](_0x27d583=>_0x27d583[_0x18e24b(0x269)]!==_0x18e24b(0x21a));if(_0x5d9925['length']>0x0){console[_0x18e24b(0x26a)](),console[_0x18e24b(0x26a)]('Failed\x20Tests:');for(const _0x47e613 of _0x5d9925){const _0x288673=a5_0x43a431[_0x18e24b(0x23d)]('✗'),_0x21e4ae=_0x47e613[_0x18e24b(0x204)][_0x18e24b(0x25e)]>0x32?_0x47e613[_0x18e24b(0x204)]['substring'](0x0,0x32)+'...':_0x47e613[_0x18e24b(0x204)];console[_0x18e24b(0x26a)]('\x20\x20'+_0x288673+'\x20'+_0x47e613[_0x18e24b(0x250)]+':\x20'+_0x21e4ae);}}const _0x131f6a={'summary':{'total':_0x122fc4[_0x18e24b(0x25e)],'passed':_0x592d9b,'failed':_0x8b108d,'errors':_0x279527>0x0?_0x279527:undefined,'duration_ms':_0x1976e9},'tests':_0x122fc4,'agent':{'project':_0x25d7ba[_0x18e24b(0x27e)],'name':_0x25d7ba[_0x18e24b(0x287)],'site':_0x2649c0},'timestamp':new Date(_0x4db81d)[_0x18e24b(0x232)]()};try{const _0x3b3544=buildCachedTestRun(_0x5f263,{'site':_0x2649c0,'projectId':_0x189320,'projectName':_0x25d7ba[_0x18e24b(0x27e)],'agentId':_0x12c047,'agentName':_0x25d7ba[_0x18e24b(0x287)],'testYmlPath':a5_0x24c59d[_0x18e24b(0x26c)](_0x25d7ba[_0x18e24b(0x20a)])});saveLastTestRun(_0x3b3544);}catch{}if(_0x11fd1b!==_0x18e24b(0x25a)||_0x1526b9){const _0x5e0b23=formatResults(_0x131f6a,_0x11fd1b);if(_0x1526b9)try{a5_0x3028ca[_0x18e24b(0x1fd)](_0x1526b9,_0x5e0b23,_0x18e24b(0x257)),console[_0x18e24b(0x26a)](),console[_0x18e24b(0x26a)](a5_0x43a431[_0x18e24b(0x209)]('Output\x20written\x20to:\x20'+_0x1526b9));}catch(_0x1cbbc0){return console[_0x18e24b(0x26a)](),console[_0x18e24b(0x26a)](a5_0x43a431[_0x18e24b(0x23d)]('Error\x20writing\x20output\x20file:\x20'+_0x1cbbc0)),0x1;}else console[_0x18e24b(0x26a)](),console['log'](_0x5e0b23);}return _0x5d9925['length']>0x0?0x1:0x0;}async['executeReeval'](_0x2a92a0,_0x949f10){const _0x5ecd6e=a5_0x20e6e0,{options:_0x1b934c,tdx:_0x1b183e}=_0x2a92a0,{definition:_0x1bdf07,agentInfo:_0xf4794b,outputFormat:_0x440d58,outputFile:_0xc7a2df}=_0x949f10,_0x56cb46=_0x1b934c[_0x5ecd6e(0x208)],_0x4ff9da=loadLastTestRun();if(!_0x4ff9da)return console[_0x5ecd6e(0x26a)](a5_0x43a431['red'](_0x5ecd6e(0x201))),console[_0x5ecd6e(0x26a)](a5_0x43a431[_0x5ecd6e(0x209)](_0x5ecd6e(0x268))),0x1;if(_0x4ff9da[_0x5ecd6e(0x246)]['agentName']!==_0xf4794b['agentName'])return console[_0x5ecd6e(0x26a)](a5_0x43a431[_0x5ecd6e(0x23d)](_0x5ecd6e(0x223)+_0x4ff9da[_0x5ecd6e(0x246)]['agentName']+'\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22'+_0xf4794b[_0x5ecd6e(0x287)]+'\x22.')),console[_0x5ecd6e(0x26a)](a5_0x43a431[_0x5ecd6e(0x209)](_0x5ecd6e(0x210))),0x1;const _0x38e232=new Set(_0x4ff9da[_0x5ecd6e(0x23f)][_0x5ecd6e(0x234)](_0x4f8f5b=>_0x4f8f5b[_0x5ecd6e(0x220)])),_0x310cec=_0x1bdf07[_0x5ecd6e(0x23a)][_0x5ecd6e(0x276)](_0x496154=>!_0x38e232['has'](_0x496154[_0x5ecd6e(0x250)]));if(_0x310cec[_0x5ecd6e(0x25e)]>0x0&&_0x4ff9da['site']!==_0x56cb46)return console[_0x5ecd6e(0x26a)](a5_0x43a431[_0x5ecd6e(0x23d)](_0x5ecd6e(0x288))),console[_0x5ecd6e(0x26a)](a5_0x43a431[_0x5ecd6e(0x209)](_0x5ecd6e(0x206)+_0x4ff9da[_0x5ecd6e(0x208)]+_0x5ecd6e(0x1f5)+_0x56cb46+'\x22.')),console[_0x5ecd6e(0x26a)](a5_0x43a431[_0x5ecd6e(0x209)]('Either\x20switch\x20to\x20the\x20\x22'+_0x4ff9da[_0x5ecd6e(0x208)]+'\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.')),0x1;const _0x25816e=_0x1bdf07['tests']['filter'](_0x4874d0=>_0x38e232['has'](_0x4874d0[_0x5ecd6e(0x250)])),_0x1fb377=_0x310cec;let _0x1500b2;try{_0x1500b2=await setupEvaluatorAgent(_0x1b183e[_0x5ecd6e(0x24b)],_0x1b934c[_0x5ecd6e(0x214)]);}catch(_0x1e7821){const _0x4a15f8=_0x1e7821 instanceof Error?_0x1e7821[_0x5ecd6e(0x236)]:String(_0x1e7821);return console[_0x5ecd6e(0x26a)](a5_0x43a431['red'](_0x5ecd6e(0x229)+_0x4a15f8)),0x1;}console[_0x5ecd6e(0x26a)](a5_0x43a431[_0x5ecd6e(0x283)](_0x5ecd6e(0x21f))),console['log'](_0x5ecd6e(0x245)+a5_0x43a431['white'](_0x4ff9da[_0x5ecd6e(0x263)])),console[_0x5ecd6e(0x26a)](_0x5ecd6e(0x1fb)+a5_0x43a431[_0x5ecd6e(0x1f4)](_0x4ff9da['agent'][_0x5ecd6e(0x27e)]+'/'+_0x4ff9da[_0x5ecd6e(0x246)][_0x5ecd6e(0x287)]));_0x1fb377['length']>0x0&&console['log'](_0x5ecd6e(0x260)+a5_0x43a431['yellow'](_0x1fb377[_0x5ecd6e(0x25e)]));console[_0x5ecd6e(0x26a)]();const _0xbf0e05=[],_0x153ae7=Date[_0x5ecd6e(0x27d)](),_0xf905fd=createCommandSpinner(_0x5ecd6e(0x237));if(_0x25816e[_0x5ecd6e(0x25e)]>0x0)try{const _0x5a9c03=await reevaluateFromCache(_0x1b183e['llm'],_0x4ff9da,{'tests':_0x25816e},{'evaluatorId':_0x1500b2,'onTestStart':(_0x70d84c,_0x1d2e25,_0x4b55f3)=>{const _0x3b5c4e=_0x5ecd6e;_0xf905fd[_0x3b5c4e(0x27a)]=_0x3b5c4e(0x1f8)+(_0x1d2e25+0x1)+'/'+_0x4b55f3+':\x20'+_0x70d84c+_0x3b5c4e(0x20d);if(!_0xf905fd[_0x3b5c4e(0x240)])_0xf905fd[_0x3b5c4e(0x21e)]();},'onTestComplete':(_0x54b28d,_0x40f640)=>{const _0x429ba6=_0x5ecd6e;_0xf905fd[_0x429ba6(0x1f0)]();if(_0x40f640[_0x429ba6(0x269)]===_0x429ba6(0x21a))console[_0x429ba6(0x26a)](a5_0x43a431['green'](_0x429ba6(0x1ee)+_0x54b28d)+a5_0x43a431[_0x429ba6(0x209)](_0x429ba6(0x23b)));else _0x40f640[_0x429ba6(0x269)]===_0x429ba6(0x262)?console[_0x429ba6(0x26a)](a5_0x43a431[_0x429ba6(0x23d)]('✗\x20FAIL:\x20'+_0x54b28d+_0x429ba6(0x280)+_0x40f640['reason'])+a5_0x43a431[_0x429ba6(0x209)]('\x20(cached)')):console[_0x429ba6(0x26a)](a5_0x43a431[_0x429ba6(0x23d)](_0x429ba6(0x22e)+_0x54b28d+_0x429ba6(0x280)+_0x40f640[_0x429ba6(0x204)]));_0x40f640['conversation_url']&&console[_0x429ba6(0x26a)](a5_0x43a431['dim'](_0x429ba6(0x24a)+_0x40f640['conversation_url'])),_0xbf0e05['push'](_0x40f640);},'onTestSkipped':(_0x24bad7,_0x30197a)=>{const _0x2bba09=_0x5ecd6e;_0xf905fd[_0x2bba09(0x1f0)](),console[_0x2bba09(0x26a)](a5_0x43a431[_0x2bba09(0x23e)](_0x2bba09(0x265)+_0x24bad7+'\x20-\x20'+_0x30197a));}});for(const _0x22dc85 of _0x5a9c03){!_0xbf0e05[_0x5ecd6e(0x1ed)](_0xf86325=>_0xf86325['name']===_0x22dc85[_0x5ecd6e(0x250)])&&_0xbf0e05['push'](_0x22dc85);}}catch(_0x46c13f){_0xf905fd[_0x5ecd6e(0x1f0)]();const _0x36caeb=_0x46c13f instanceof Error?_0x46c13f[_0x5ecd6e(0x236)]:String(_0x46c13f);return console['log'](a5_0x43a431[_0x5ecd6e(0x23d)](_0x5ecd6e(0x21d)+_0x36caeb)),0x1;}_0xf905fd[_0x5ecd6e(0x1f0)]();if(_0x1fb377[_0x5ecd6e(0x25e)]>0x0){console[_0x5ecd6e(0x26a)](),console[_0x5ecd6e(0x26a)](a5_0x43a431[_0x5ecd6e(0x283)](_0x5ecd6e(0x284)));const {projectId:_0x279450,agentId:_0xbdd2ed}=_0x4ff9da[_0x5ecd6e(0x246)];for(const _0x1a0884 of _0x1fb377){console[_0x5ecd6e(0x26a)](_0x5ecd6e(0x211)+a5_0x43a431[_0x5ecd6e(0x1f4)](_0x1a0884['name']));const _0x24b62f=createCommandSpinner(_0x5ecd6e(0x1ef)+_0x1a0884[_0x5ecd6e(0x1f7)][_0x5ecd6e(0x25e)]+':\x20Sending\x20user\x20input...');_0x24b62f[_0x5ecd6e(0x21e)]();try{const {result:_0x1771ef}=await runTest(_0x1b183e[_0x5ecd6e(0x24b)],_0x1a0884,{'agentId':_0xbdd2ed,'projectId':_0x279450,'site':_0x4ff9da[_0x5ecd6e(0x208)],'noEval':![],'evaluatorId':_0x1500b2,'onRoundStart':(_0x2375f4,_0x4a5f74)=>{const _0x9f6ec3=_0x5ecd6e;_0x24b62f[_0x9f6ec3(0x27a)]=_0x9f6ec3(0x231)+(_0x2375f4+0x1)+'/'+_0x4a5f74+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x4b5381,_0x5c5ff9,_0x26dc14)=>{const _0x35000e=_0x5ecd6e,_0x7d9ee8=formatElapsed(_0x5c5ff9);_0x26dc14?console['log'](_0x35000e(0x249)+(_0x4b5381+0x1)+'/'+_0x1a0884['rounds'][_0x35000e(0x25e)]+'...\x20'+a5_0x43a431[_0x35000e(0x273)]('✓')+'\x20('+_0x7d9ee8+')'):console[_0x35000e(0x26a)](_0x35000e(0x249)+(_0x4b5381+0x1)+'/'+_0x1a0884[_0x35000e(0x1f7)][_0x35000e(0x25e)]+_0x35000e(0x244)+a5_0x43a431[_0x35000e(0x23d)]('✗'));},'onEvaluationStart':()=>{const _0x5056ab=_0x5ecd6e;_0x24b62f[_0x5056ab(0x27a)]=_0x5056ab(0x233);},'onEvaluationComplete':_0x5be416=>{const _0x29e3cd=_0x5ecd6e,_0x392a1b=formatElapsed(_0x5be416);console[_0x29e3cd(0x26a)]('\x20\x20Evaluating...\x20'+a5_0x43a431[_0x29e3cd(0x273)]('✓')+'\x20('+_0x392a1b+')');}});_0x24b62f[_0x5ecd6e(0x1f0)](),_0xbf0e05[_0x5ecd6e(0x228)](_0x1771ef);if(_0x1771ef[_0x5ecd6e(0x269)]===_0x5ecd6e(0x21a))console[_0x5ecd6e(0x26a)](a5_0x43a431['green'](_0x5ecd6e(0x1ee)+_0x1771ef[_0x5ecd6e(0x204)])+a5_0x43a431[_0x5ecd6e(0x209)](_0x5ecd6e(0x285)));else _0x1771ef[_0x5ecd6e(0x269)]===_0x5ecd6e(0x262)?console['log'](a5_0x43a431[_0x5ecd6e(0x23d)](_0x5ecd6e(0x25d)+_0x1771ef[_0x5ecd6e(0x204)])+a5_0x43a431[_0x5ecd6e(0x209)](_0x5ecd6e(0x285))):console[_0x5ecd6e(0x26a)](a5_0x43a431[_0x5ecd6e(0x23d)](_0x5ecd6e(0x22e)+_0x1771ef[_0x5ecd6e(0x204)]));_0x1771ef[_0x5ecd6e(0x256)]&&console['log'](a5_0x43a431['dim'](_0x5ecd6e(0x24a)+_0x1771ef[_0x5ecd6e(0x256)]));}catch(_0x5e819d){_0x24b62f[_0x5ecd6e(0x1f0)]();const _0x14d4e7=_0x5e819d instanceof Error?_0x5e819d[_0x5ecd6e(0x236)]:String(_0x5e819d);console[_0x5ecd6e(0x26a)](a5_0x43a431['red']('✗\x20ERROR:\x20'+_0x14d4e7)),_0xbf0e05['push']({'name':_0x1a0884['name'],'status':_0x5ecd6e(0x217),'reason':_0x14d4e7,'timestamp':new Date()[_0x5ecd6e(0x232)](),'duration_ms':0x0});}}}console[_0x5ecd6e(0x26a)]();const _0x128974=Date[_0x5ecd6e(0x27d)]()-_0x153ae7,_0x4e4803=_0xbf0e05[_0x5ecd6e(0x276)](_0x5e3107=>_0x5e3107['status']===_0x5ecd6e(0x21a))[_0x5ecd6e(0x25e)],_0x50e364=_0xbf0e05[_0x5ecd6e(0x276)](_0x10b4bb=>_0x10b4bb[_0x5ecd6e(0x269)]==='FAIL')[_0x5ecd6e(0x25e)],_0x2e759=_0xbf0e05[_0x5ecd6e(0x276)](_0x553eef=>_0x553eef['status']===_0x5ecd6e(0x217))['length'];console['log']('━'[_0x5ecd6e(0x1f3)](0x3c)),console[_0x5ecd6e(0x26a)](_0x5ecd6e(0x22b)),console[_0x5ecd6e(0x26a)]('━'['repeat'](0x3c)),console['log'](_0x5ecd6e(0x239)+_0xbf0e05['length']),console['log'](_0x5ecd6e(0x205)+a5_0x43a431[_0x5ecd6e(0x273)](_0x4e4803)),console[_0x5ecd6e(0x26a)]('Failed:\x20\x20\x20'+a5_0x43a431[_0x5ecd6e(0x23d)](_0x50e364));_0x2e759>0x0&&console[_0x5ecd6e(0x26a)](_0x5ecd6e(0x216)+a5_0x43a431['red'](_0x2e759));console[_0x5ecd6e(0x26a)](_0x5ecd6e(0x26f)+formatElapsed(_0x128974)),console['log']('━'[_0x5ecd6e(0x1f3)](0x3c));const _0x1b885c={'summary':{'total':_0xbf0e05['length'],'passed':_0x4e4803,'failed':_0x50e364,'errors':_0x2e759>0x0?_0x2e759:undefined,'duration_ms':_0x128974},'tests':_0xbf0e05,'agent':{'project':_0xf4794b[_0x5ecd6e(0x27e)],'name':_0xf4794b['agentName'],'site':_0x56cb46},'timestamp':new Date(_0x153ae7)[_0x5ecd6e(0x232)]()};if(_0x440d58!=='table'||_0xc7a2df){const _0x3f1cae=formatResults(_0x1b885c,_0x440d58);if(_0xc7a2df)try{a5_0x3028ca['writeFileSync'](_0xc7a2df,_0x3f1cae,'utf-8'),console['log'](),console['log'](a5_0x43a431[_0x5ecd6e(0x209)](_0x5ecd6e(0x20b)+_0xc7a2df));}catch(_0x55525d){return console[_0x5ecd6e(0x26a)](),console[_0x5ecd6e(0x26a)](a5_0x43a431['red'](_0x5ecd6e(0x1ff)+_0x55525d)),0x1;}else console[_0x5ecd6e(0x26a)](),console['log'](_0x3f1cae);}const _0x1f1aa3=_0xbf0e05[_0x5ecd6e(0x276)](_0x1bb91a=>_0x1bb91a[_0x5ecd6e(0x269)]!==_0x5ecd6e(0x21a));return _0x1f1aa3['length']>0x0?0x1:0x0;}}
@@ -1 +1 @@
1
- const a6_0x52222c=a6_0x3cdb;(function(_0x3d65f6,_0x54675f){const _0xa99b1f=a6_0x3cdb,_0x4b7be3=_0x3d65f6();while(!![]){try{const _0x366960=-parseInt(_0xa99b1f(0xf1))/0x1*(parseInt(_0xa99b1f(0xd3))/0x2)+parseInt(_0xa99b1f(0x101))/0x3*(parseInt(_0xa99b1f(0x102))/0x4)+parseInt(_0xa99b1f(0xe7))/0x5*(parseInt(_0xa99b1f(0xf5))/0x6)+parseInt(_0xa99b1f(0x107))/0x7+-parseInt(_0xa99b1f(0xdb))/0x8+-parseInt(_0xa99b1f(0xda))/0x9+-parseInt(_0xa99b1f(0xed))/0xa*(-parseInt(_0xa99b1f(0xf0))/0xb);if(_0x366960===_0x54675f)break;else _0x4b7be3['push'](_0x4b7be3['shift']());}catch(_0x4c5120){_0x4b7be3['push'](_0x4b7be3['shift']());}}}(a6_0x22f9,0x1e1bd));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';function a6_0x22f9(){const _0x41fe2b=['697032gNXNUc','1594208KJbTaX','x-xsrf-token','validate','cookie','method','PUT','llm-proxy','cas','<\x20HTTP/1.1\x20','\x0aStack\x20trace:\x0a','noColor','startsWith','15YSINAa','toUpperCase','join','length','trino','PATCH','245120rlaTMd','type','indexOf','143RLruia','44483ohquQp','api','GET','proxy-authorization','103002zYyuGu','error','substring','output','x-trino-user','llm','toLowerCase','verbose','status','isArray','entries','description','261NwXtge','3452scdOVt','execute','\x22.\x20','Endpoint\x20must\x20start\x20with\x20/:\x20','.\x20Valid\x20methods:\x20','1240582EQbfQF','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','file','POST','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','message','has','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','keys','authorization','stack','site','DELETE','Invalid\x20API\x20type:\x20','Invalid\x20header\x20format:\x20\x22','cdp','color','.\x20Valid\x20types:\x20','10ZSBoIV','log','readBodyFromFile','Error:\x20','data','headers','trim'];a6_0x22f9=function(){return _0x41fe2b;};return a6_0x22f9();}function a6_0x3cdb(_0x42a5bb,_0x50e89a){_0x42a5bb=_0x42a5bb-0xcf;const _0x22f919=a6_0x22f9();let _0x3cdb13=_0x22f919[_0x42a5bb];return _0x3cdb13;}import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a6_0x52222c(0x110),a6_0x52222c(0xf4),a6_0x52222c(0xde),'set-cookie','set-cookie2',a6_0x52222c(0xdc),'x-auth-token',a6_0x52222c(0xf9)]);function isSensitiveHeader(_0xb3eab1){const _0x3e8176=a6_0x52222c;return SENSITIVE_HEADERS[_0x3e8176(0x10d)](_0xb3eab1[_0x3e8176(0xfb)]());}function parseHeader(_0x209945){const _0x4e1422=a6_0x52222c,_0xda5ed9=_0x209945[_0x4e1422(0xef)](':');if(_0xda5ed9===-0x1)throw new Error(_0x4e1422(0xcf)+_0x209945+_0x4e1422(0x104)+_0x4e1422(0x10b));const _0x1eea31=_0x209945['substring'](0x0,_0xda5ed9)[_0x4e1422(0xd9)](),_0x32cddb=_0x209945[_0x4e1422(0xf7)](_0xda5ed9+0x1)['trim']();if(!_0x1eea31)throw new Error(_0x4e1422(0x10e)+_0x209945+'\x22');return[_0x1eea31,_0x32cddb];}export class ApiCommand extends BaseCommand{['name']=a6_0x52222c(0xf2);[a6_0x52222c(0x100)]='Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs';[a6_0x52222c(0xdd)](_0x2ec1cf){const _0x4bc36a=a6_0x52222c,{args:_0x2e4af2,options:_0x4caa26}=_0x2ec1cf,_0x39596a=_0x4caa26;if(_0x2e4af2[_0x4bc36a(0xea)]===0x0)return _0x4bc36a(0x108);const _0x146cf6=_0x2e4af2[0x0];if(!_0x146cf6[_0x4bc36a(0xe6)]('/'))return _0x4bc36a(0x105)+_0x146cf6;const _0x3504c8=_0x39596a[_0x4bc36a(0xd7)],_0xf5eb11=_0x39596a[_0x4bc36a(0x109)];if(_0x3504c8&&_0xf5eb11)return'Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.';const _0x10a986=_0x39596a[_0x4bc36a(0xdf)]||_0x4bc36a(0xf3),_0x456ed3=[_0x4bc36a(0xf3),_0x4bc36a(0x10a),_0x4bc36a(0xe0),_0x4bc36a(0x113),_0x4bc36a(0xec)];if(!_0x456ed3['includes'](_0x10a986[_0x4bc36a(0xe8)]()))return'Invalid\x20HTTP\x20method:\x20'+_0x10a986+_0x4bc36a(0x106)+_0x456ed3[_0x4bc36a(0xe9)](',\x20');const _0x300a60=_0x39596a[_0x4bc36a(0xee)]||'td',_0x1eeaea=['td',_0x4bc36a(0xd0),'workflow',_0x4bc36a(0xeb),_0x4bc36a(0xfa),_0x4bc36a(0xe1),_0x4bc36a(0xe2)];if(!_0x1eeaea['includes'](_0x300a60))return _0x4bc36a(0x114)+_0x300a60+_0x4bc36a(0xd2)+_0x1eeaea[_0x4bc36a(0xe9)](',\x20');return undefined;}async[a6_0x52222c(0x103)](_0x415328){const _0x31e875=a6_0x52222c,{options:_0x41b1f0,args:_0x4acbf4,tdx:_0xdb170}=_0x415328,_0x1f1c57=_0x41b1f0,_0x8c4926=_0x4acbf4[0x0],_0x1b0b8b=(_0x1f1c57[_0x31e875(0xdf)]||'GET')[_0x31e875(0xe8)](),_0x388662=_0x1f1c57['data'],_0x2f102e=_0x1f1c57[_0x31e875(0x109)],_0x37cfa4=_0x1f1c57['header'],_0x56421a=_0x1f1c57[_0x31e875(0xee)]||'td';try{const _0x4b295d={};if(_0x37cfa4){const _0x3e21fd=Array[_0x31e875(0xfe)](_0x37cfa4)?_0x37cfa4:[_0x37cfa4];for(const _0x62279c of _0x3e21fd){const [_0x281066,_0x53d0f2]=parseHeader(_0x62279c);_0x4b295d[_0x281066]=_0x53d0f2;}}let _0x457fc0;if(_0x388662)_0x457fc0=_0x388662;else{if(_0x2f102e)try{_0x457fc0=RawAPI[_0x31e875(0xd5)](_0x2f102e);}catch(_0x3cbef9){return console[_0x31e875(0xf6)](_0x31e875(0xd6)+(_0x3cbef9 instanceof Error?_0x3cbef9[_0x31e875(0x10c)]:String(_0x3cbef9))),0x1;}}const _0x48f275={'method':_0x1b0b8b,'apiType':_0x56421a,'includeHeaders':_0x41b1f0[_0x31e875(0xfc)]};_0x457fc0&&(_0x48f275['body']=_0x457fc0);Object[_0x31e875(0x10f)](_0x4b295d)['length']>0x0&&(_0x48f275[_0x31e875(0xd8)]=_0x4b295d);if(_0x41b1f0[_0x31e875(0xfc)]){const _0x560568=resolveSite(_0x41b1f0[_0x31e875(0x112)]),_0x48748e=getEndpoint(_0x560568,_0x56421a),_0x57519a=''+_0x48748e+_0x8c4926;console[_0x31e875(0xf6)]('>\x20'+_0x1b0b8b+'\x20'+_0x57519a);const _0x224285=getAuthHeaders(_0x560568),_0x526b76={..._0x224285,..._0x4b295d};for(const [_0x36e2a5,_0x53e66c]of Object[_0x31e875(0xff)](_0x526b76)){!isSensitiveHeader(_0x36e2a5)&&console[_0x31e875(0xf6)]('>\x20'+_0x36e2a5+':\x20'+_0x53e66c);}_0x457fc0&&console['error']('>'),console[_0x31e875(0xf6)]('');}const _0x49c073=await _0xdb170[_0x31e875(0xf2)]['request'](_0x8c4926,_0x48f275);if(_0x41b1f0[_0x31e875(0xfc)]&&_0x49c073[_0x31e875(0xd8)]){console[_0x31e875(0xf6)](_0x31e875(0xe3)+_0x49c073[_0x31e875(0xfd)]);for(const [_0x2d8dc5,_0x110873]of Object['entries'](_0x49c073[_0x31e875(0xd8)])){!isSensitiveHeader(_0x2d8dc5)&&console[_0x31e875(0xf6)]('<\x20'+_0x2d8dc5+':\x20'+_0x110873);}console[_0x31e875(0xf6)]('');}const _0x3a9b5f=Boolean(_0x41b1f0[_0x31e875(0xf8)]),_0x719cb6={'color':_0x41b1f0[_0x31e875(0xd1)],'noColor':_0x41b1f0[_0x31e875(0xe5)]||_0x3a9b5f&&!_0x41b1f0['color']},_0x511882=colorizeJSON(_0x49c073[_0x31e875(0xd7)],_0x719cb6);return _0x41b1f0[_0x31e875(0xf8)]?(writeFileSync(_0x41b1f0['output'],_0x511882),console[_0x31e875(0xf6)]('Results\x20saved\x20to\x20'+_0x41b1f0[_0x31e875(0xf8)])):console[_0x31e875(0xd4)](_0x511882),0x0;}catch(_0x14224b){return _0x14224b instanceof Error?(console['error'](_0x31e875(0xd6)+_0x14224b['message']),_0x41b1f0['verbose']&&_0x14224b[_0x31e875(0x111)]&&console['error'](_0x31e875(0xe4)+_0x14224b[_0x31e875(0x111)])):console[_0x31e875(0xf6)](_0x31e875(0xd6)+String(_0x14224b)),0x1;}}}
1
+ function a6_0x53ff(_0x3c547f,_0x4f0819){_0x3c547f=_0x3c547f-0x13b;const _0x12ec23=a6_0x12ec();let _0x53ffd7=_0x12ec23[_0x3c547f];return _0x53ffd7;}const a6_0x467964=a6_0x53ff;(function(_0x34d088,_0x120dbe){const _0x19e74c=a6_0x53ff,_0x33e6f9=_0x34d088();while(!![]){try{const _0x724041=parseInt(_0x19e74c(0x17e))/0x1+parseInt(_0x19e74c(0x153))/0x2+parseInt(_0x19e74c(0x17d))/0x3*(-parseInt(_0x19e74c(0x144))/0x4)+parseInt(_0x19e74c(0x15c))/0x5+parseInt(_0x19e74c(0x164))/0x6*(parseInt(_0x19e74c(0x150))/0x7)+parseInt(_0x19e74c(0x14a))/0x8*(parseInt(_0x19e74c(0x17c))/0x9)+-parseInt(_0x19e74c(0x13c))/0xa;if(_0x724041===_0x120dbe)break;else _0x33e6f9['push'](_0x33e6f9['shift']());}catch(_0x371661){_0x33e6f9['push'](_0x33e6f9['shift']());}}}(a6_0x12ec,0x356ee));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';function a6_0x12ec(){const _0x76a525=['9134330URuhvR','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','includes','startsWith','toUpperCase','error','output','cdp','35384MJrvBR','set-cookie','method','workflow','name','readBodyFromFile','8GpLOEs','stack','.\x20Valid\x20types:\x20','verbose','Endpoint\x20must\x20start\x20with\x20/:\x20','noColor','21fsNIvC','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','GET','520522dwtmuV','keys','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','.\x20Valid\x20methods:\x20','data','type','indexOf','x-xsrf-token','Results\x20saved\x20to\x20','574150YjMlgE','color','body','trim','description','api','header','toLowerCase','394026imsOuL','authorization','Invalid\x20HTTP\x20method:\x20','execute','length','file','status','set-cookie2','headers','cookie','join','PUT','request','log','\x0aStack\x20trace:\x0a','DELETE','entries','has','message','Invalid\x20API\x20type:\x20','validate','Error:\x20','site','cas','3094605tToVLp','9qHPHyI','242884eXrXnQ','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','x-trino-user'];a6_0x12ec=function(){return _0x76a525;};return a6_0x12ec();}import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a6_0x467964(0x165),'proxy-authorization',a6_0x467964(0x16d),a6_0x467964(0x145),a6_0x467964(0x16b),a6_0x467964(0x15a),'x-auth-token',a6_0x467964(0x13b)]);function isSensitiveHeader(_0x30b6f5){const _0x31d284=a6_0x467964;return SENSITIVE_HEADERS[_0x31d284(0x175)](_0x30b6f5[_0x31d284(0x163)]());}function parseHeader(_0x3a476b){const _0x250456=a6_0x467964,_0x51a836=_0x3a476b[_0x250456(0x159)](':');if(_0x51a836===-0x1)throw new Error('Invalid\x20header\x20format:\x20\x22'+_0x3a476b+'\x22.\x20'+_0x250456(0x17f));const _0x319f6c=_0x3a476b['substring'](0x0,_0x51a836)[_0x250456(0x15f)](),_0x1de056=_0x3a476b['substring'](_0x51a836+0x1)['trim']();if(!_0x319f6c)throw new Error(_0x250456(0x13d)+_0x3a476b+'\x22');return[_0x319f6c,_0x1de056];}export class ApiCommand extends BaseCommand{[a6_0x467964(0x148)]=a6_0x467964(0x161);[a6_0x467964(0x160)]=a6_0x467964(0x151);[a6_0x467964(0x178)](_0x239dba){const _0x3668f2=a6_0x467964,{args:_0x32490b,options:_0x4917a8}=_0x239dba,_0x409ce1=_0x4917a8;if(_0x32490b['length']===0x0)return _0x3668f2(0x155);const _0x408cb3=_0x32490b[0x0];if(!_0x408cb3[_0x3668f2(0x13f)]('/'))return _0x3668f2(0x14e)+_0x408cb3;const _0x3adc8e=_0x409ce1[_0x3668f2(0x157)],_0x443691=_0x409ce1[_0x3668f2(0x169)];if(_0x3adc8e&&_0x443691)return'Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.';const _0x1491cb=_0x409ce1[_0x3668f2(0x146)]||_0x3668f2(0x152),_0x13c3c7=['GET','POST',_0x3668f2(0x16f),_0x3668f2(0x173),'PATCH'];if(!_0x13c3c7[_0x3668f2(0x13e)](_0x1491cb[_0x3668f2(0x140)]()))return _0x3668f2(0x166)+_0x1491cb+_0x3668f2(0x156)+_0x13c3c7[_0x3668f2(0x16e)](',\x20');const _0x4b6e38=_0x409ce1[_0x3668f2(0x158)]||'td',_0x4c0439=['td',_0x3668f2(0x143),_0x3668f2(0x147),'trino','llm','llm-proxy',_0x3668f2(0x17b)];if(!_0x4c0439[_0x3668f2(0x13e)](_0x4b6e38))return _0x3668f2(0x177)+_0x4b6e38+_0x3668f2(0x14c)+_0x4c0439[_0x3668f2(0x16e)](',\x20');return undefined;}async[a6_0x467964(0x167)](_0x4815b8){const _0x1ccfad=a6_0x467964,{options:_0x5942ea,args:_0x16c73f,tdx:_0x5c4d4f}=_0x4815b8,_0x22308d=_0x5942ea,_0x278658=_0x16c73f[0x0],_0x1517b0=(_0x22308d['method']||'GET')[_0x1ccfad(0x140)](),_0x43e3c2=_0x22308d[_0x1ccfad(0x157)],_0x218010=_0x22308d[_0x1ccfad(0x169)],_0x4d1b1c=_0x22308d[_0x1ccfad(0x162)],_0x16a696=_0x22308d['type']||'td';try{const _0x1fffa1={};if(_0x4d1b1c){const _0xac51d3=Array['isArray'](_0x4d1b1c)?_0x4d1b1c:[_0x4d1b1c];for(const _0x4fa5c5 of _0xac51d3){const [_0x4dea39,_0x111d6e]=parseHeader(_0x4fa5c5);_0x1fffa1[_0x4dea39]=_0x111d6e;}}let _0x4b634b;if(_0x43e3c2)_0x4b634b=_0x43e3c2;else{if(_0x218010)try{_0x4b634b=RawAPI[_0x1ccfad(0x149)](_0x218010);}catch(_0x28b29d){return console[_0x1ccfad(0x141)](_0x1ccfad(0x179)+(_0x28b29d instanceof Error?_0x28b29d['message']:String(_0x28b29d))),0x1;}}const _0x2feb39={'method':_0x1517b0,'apiType':_0x16a696,'includeHeaders':_0x5942ea['verbose']};_0x4b634b&&(_0x2feb39[_0x1ccfad(0x15e)]=_0x4b634b);Object[_0x1ccfad(0x154)](_0x1fffa1)[_0x1ccfad(0x168)]>0x0&&(_0x2feb39['headers']=_0x1fffa1);if(_0x5942ea[_0x1ccfad(0x14d)]){const _0x8900bd=resolveSite(_0x5942ea[_0x1ccfad(0x17a)]),_0x233280=getEndpoint(_0x8900bd,_0x16a696),_0xc6b637=''+_0x233280+_0x278658;console[_0x1ccfad(0x141)]('>\x20'+_0x1517b0+'\x20'+_0xc6b637);const _0x125024=getAuthHeaders(_0x8900bd),_0x1c98de={..._0x125024,..._0x1fffa1};for(const [_0x150e77,_0x344be5]of Object[_0x1ccfad(0x174)](_0x1c98de)){!isSensitiveHeader(_0x150e77)&&console[_0x1ccfad(0x141)]('>\x20'+_0x150e77+':\x20'+_0x344be5);}_0x4b634b&&console[_0x1ccfad(0x141)]('>'),console['error']('');}const _0x4edfd7=await _0x5c4d4f[_0x1ccfad(0x161)][_0x1ccfad(0x170)](_0x278658,_0x2feb39);if(_0x5942ea[_0x1ccfad(0x14d)]&&_0x4edfd7['headers']){console[_0x1ccfad(0x141)]('<\x20HTTP/1.1\x20'+_0x4edfd7[_0x1ccfad(0x16a)]);for(const [_0x4d4cfe,_0x467751]of Object[_0x1ccfad(0x174)](_0x4edfd7[_0x1ccfad(0x16c)])){!isSensitiveHeader(_0x4d4cfe)&&console['error']('<\x20'+_0x4d4cfe+':\x20'+_0x467751);}console[_0x1ccfad(0x141)]('');}const _0x4d9d6a=Boolean(_0x5942ea['output']),_0x26a1d6={'color':_0x5942ea[_0x1ccfad(0x15d)],'noColor':_0x5942ea[_0x1ccfad(0x14f)]||_0x4d9d6a&&!_0x5942ea[_0x1ccfad(0x15d)]},_0x1d359d=colorizeJSON(_0x4edfd7['data'],_0x26a1d6);return _0x5942ea[_0x1ccfad(0x142)]?(writeFileSync(_0x5942ea[_0x1ccfad(0x142)],_0x1d359d),console['error'](_0x1ccfad(0x15b)+_0x5942ea[_0x1ccfad(0x142)])):console[_0x1ccfad(0x171)](_0x1d359d),0x0;}catch(_0xec500a){return _0xec500a instanceof Error?(console[_0x1ccfad(0x141)](_0x1ccfad(0x179)+_0xec500a[_0x1ccfad(0x176)]),_0x5942ea[_0x1ccfad(0x14d)]&&_0xec500a[_0x1ccfad(0x14b)]&&console[_0x1ccfad(0x141)](_0x1ccfad(0x172)+_0xec500a[_0x1ccfad(0x14b)])):console[_0x1ccfad(0x141)](_0x1ccfad(0x179)+String(_0xec500a)),0x1;}}}
@@ -1 +1 @@
1
- const a7_0x475d4f=a7_0x2558;(function(_0x327d68,_0x25c10e){const _0x4b672f=a7_0x2558,_0x2edbf4=_0x327d68();while(!![]){try{const _0x2bbce1=-parseInt(_0x4b672f(0x1f7))/0x1+parseInt(_0x4b672f(0x1f8))/0x2+-parseInt(_0x4b672f(0x1fa))/0x3*(-parseInt(_0x4b672f(0x1de))/0x4)+-parseInt(_0x4b672f(0x220))/0x5*(-parseInt(_0x4b672f(0x1ee))/0x6)+-parseInt(_0x4b672f(0x207))/0x7+parseInt(_0x4b672f(0x1ea))/0x8*(parseInt(_0x4b672f(0x20d))/0x9)+-parseInt(_0x4b672f(0x213))/0xa*(parseInt(_0x4b672f(0x1f3))/0xb);if(_0x2bbce1===_0x25c10e)break;else _0x2edbf4['push'](_0x2edbf4['shift']());}catch(_0x36d5b3){_0x2edbf4['push'](_0x2edbf4['shift']());}}}(a7_0x2744,0x57b05));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';function a7_0x2558(_0xda8ffe,_0x49df0d){_0xda8ffe=_0xda8ffe-0x1d0;const _0x2744f4=a7_0x2744();let _0x25586f=_0x2744f4[_0xda8ffe];return _0x25586f;}import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{deleteOAuthTokens}from'../core/oauth-keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';function a7_0x2744(){const _0x6bbde3=['No\x20credential\x20found','logLevel','\x27\x20registered','site','execute','720nbTxSm','Validating\x20API\x20key...','Setup\x20cancelled','warn','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','7657730kJheJA','email','\x20\x20tdx','Choose\x20how\x20to\x20sign\x20in:','message','status','N/A','filter','✓\x20Authentication\x20successful\x0a','text','API\x20key\x20cannot\x20be\x20empty','bold','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','10rTHcAX','jobs','password','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','\x20\x20If\x20this\x20is\x20not\x20the\x20expected\x20account:','\x20\x20(','System\x20keychain\x20is\x20not\x20available','✓\x20Default\x20site\x20set\x20to\x20','green','method','tdx:\x20auth\x20setup','join','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','\x20\x20\x20\x202.\x20Or\x20use\x20a\x20different\x20browser\x20profile\x20to\x20avoid\x20cached\x20sessions','✓\x20Profile\x20\x27','us01','You\x20can\x20find\x20your\x20API\x20key\x20at:','error','oauth','red','cyan','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','ERROR','✓\x20Signed\x20in\x20successfully','\x20(site:\x20','/users/initiate_sso\x20(account:\x20','first_name','auth:clear','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','Sign\x20in\x20with\x20browser\x20(recommended)','accountName','Validating\x20OAuth\x20tokens...','tdx:\x20auth\x20clear','56HKrUPJ','trim','all','\x20(profile:\x20','Credential\x20type:\x20OAuth','description','select','profile','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','\x20\x20user_id:','yellow','Setup\x20API\x20key\x20authentication\x20interactively','46616vJlQib','dim','No\x20credentials\x20found\x20in\x20keychain','Setting\x20up\x20authentication\x20for\x20site:\x20','1998114zJdIkw','last_name','\x20and\x20','apiKey','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain','11ZgrKwH','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','\x20--profile\x20','623104yLdESO','343878bKIjKE','account_id','107721HJNujq','create','\x20removed\x20from\x20keychain','Name:\x20','Read\x20credential\x20from\x20keychain','User:\x20','name','\x20for\x20profile:\x20','log','Enter\x20your\x20TD\x20API\x20key:','\x20\x20\x20\x201.\x20Run:\x20tdx\x20auth\x20setup\x20--account-name\x20<name>','access_token','auth','411495CtiNly'];a7_0x2744=function(){return _0x6bbde3;};return a7_0x2744();}import{startOAuthFlow}from'../core/oauth.js';import{promptSiteSelection}from'../core/constants.js';import a7_0x37d02e 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_0x4b17a6 from'chalk';export async function runOAuthLoginFlow(_0xfefa72,_0x7f0d17,_0x346ce4,_0x32f74f){const _0x59159c=a7_0x2558,_0x20ee35=await isKeychainAvailable();if(!_0x20ee35)throw new Error(_0x59159c(0x1f4)+_0x59159c(0x1f5));let _0x5d4053=_0x32f74f?.[_0x59159c(0x1db)];if(!_0x5d4053){const _0x50c152=await a7_0x37d02e({'type':_0x59159c(0x21c),'name':_0x59159c(0x1db),'message':'Account\x20name\x20for\x20SSO\x20(press\x20Enter\x20to\x20skip):'});if(_0x50c152[_0x59159c(0x1db)]===undefined)throw new Error('Setup\x20cancelled');_0x5d4053=_0x50c152[_0x59159c(0x1db)]['trim']()||undefined;}const _0x194395=getConsoleUrl(_0xfefa72);console[_0x59159c(0x202)]('Opening\x20browser\x20for\x20authentication...');_0x5d4053?console['log']('\x20\x20'+_0x194395+_0x59159c(0x1d6)+_0x5d4053+')'):console[_0x59159c(0x202)]('\x20\x20'+_0x194395+'/oauth/authorize');console[_0x59159c(0x202)](_0x59159c(0x1d2));const _0x3da531=await startOAuthFlow(_0xfefa72,{'accountName':_0x5d4053});console['log'](_0x59159c(0x1dc));const _0x8017f=TDX[_0x59159c(0x1fb)]({'site':_0xfefa72,'accessToken':_0x3da531[_0x59159c(0x205)],'logLevel':_0x346ce4??LogLevel[_0x59159c(0x1d3)]}),_0x346bf6=await _0x8017f[_0x59159c(0x221)]['getUserInfo']();console['log'](a7_0x4b17a6[_0x59159c(0x228)](_0x59159c(0x1d4))),console[_0x59159c(0x202)]('\x20\x20'+a7_0x4b17a6[_0x59159c(0x1d1)](_0xfefa72+':'+_0x346bf6[_0x59159c(0x1f9)])+_0x59159c(0x1e7)+_0x346bf6['id']+_0x59159c(0x225)+_0x346bf6['email']+')');!_0x5d4053&&(console[_0x59159c(0x202)](a7_0x4b17a6[_0x59159c(0x1eb)](_0x59159c(0x224))),console[_0x59159c(0x202)](a7_0x4b17a6[_0x59159c(0x1eb)](_0x59159c(0x204))),console[_0x59159c(0x202)](a7_0x4b17a6[_0x59159c(0x1eb)](_0x59159c(0x22d))));await saveOAuthTokens(_0x3da531,_0x7f0d17),console[_0x59159c(0x202)](_0x59159c(0x1f2)+(_0x7f0d17?'\x20(profile:\x20'+_0x7f0d17+')':''));if(_0x7f0d17){const _0x470a6a={'site':_0xfefa72};saveProfileToUserConfig(_0x7f0d17,_0x470a6a),console[_0x59159c(0x202)](_0x59159c(0x22e)+_0x7f0d17+_0x59159c(0x20a));}else saveDefaultSiteToUserConfig(_0xfefa72),console[_0x59159c(0x202)](_0x59159c(0x227)+_0xfefa72);const _0x1576c0=_0x7f0d17?'\x20--profile\x20'+_0x7f0d17:'';console['log'](),console['log']('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console[_0x59159c(0x202)]('\x20\x20tdx'+_0x1576c0+_0x59159c(0x211)),console[_0x59159c(0x202)](_0x59159c(0x215)+_0x1576c0+_0x59159c(0x22c));}export async function promptAuthMethod(){const _0x37aaed=a7_0x2558,_0xf9a4a6=await a7_0x37d02e({'type':_0x37aaed(0x1e4),'name':'method','message':_0x37aaed(0x216),'choices':[{'title':_0x37aaed(0x1da),'description':'Opens\x20your\x20browser\x20to\x20sign\x20in\x20with\x20SSO','value':_0x37aaed(0x232)},{'title':'Use\x20an\x20API\x20key','description':'For\x20scripts\x20or\x20headless\x20servers','value':'apikey'}]});return _0xf9a4a6[_0x37aaed(0x229)]||null;}export class AuthSetupCommand extends BaseCommand{[a7_0x475d4f(0x200)]='auth:setup';[a7_0x475d4f(0x1e3)]=a7_0x475d4f(0x1e9);async[a7_0x475d4f(0x20c)](_0xc5c122){const _0x50fd3b=a7_0x475d4f,{options:_0xf6b221}=_0xc5c122,_0x2c2c9b=_0xf6b221[_0x50fd3b(0x1e5)];console[_0x50fd3b(0x202)](a7_0x4b17a6['bold'](_0x50fd3b(0x22a)));const _0x54070b=_0xf6b221[_0x50fd3b(0x20b)]||_0x50fd3b(0x22f),_0x223c25=await promptSiteSelection(_0x54070b,_0x2c2c9b,_0x50fd3b(0x20f));if(!_0x223c25)return 0x1;const _0x19ac9d=resolveSite(_0x223c25),_0x2664ab=await promptAuthMethod();if(!_0x2664ab)return console[_0x50fd3b(0x202)]('\x0aSetup\x20cancelled'),0x1;if(_0x2664ab===_0x50fd3b(0x232)){const {accountName:_0x179a30}=_0xf6b221;return await runOAuthLoginFlow(_0x19ac9d,_0x2c2c9b,_0xf6b221[_0x50fd3b(0x209)]??LogLevel[_0x50fd3b(0x1d3)],{'accountName':_0x179a30}),0x0;}console['log'](_0x50fd3b(0x1ed)+_0x19ac9d),console['log'](_0x50fd3b(0x230)),console[_0x50fd3b(0x202)]('\x20\x20'+getConsoleUrl(_0x19ac9d,'/app/mp/ak'));const _0x4c2fc1=await a7_0x37d02e({'type':_0x50fd3b(0x222),'name':_0x50fd3b(0x1f1),'message':_0x50fd3b(0x203),'validate':_0xd789b8=>{const _0x10ebef=_0x50fd3b;if(!_0xd789b8||!_0xd789b8[_0x10ebef(0x1df)]())return _0x10ebef(0x21d);return!![];}});if(!_0x4c2fc1['apiKey'])return console[_0x50fd3b(0x202)]('\x0aSetup\x20cancelled'),0x1;const _0x4f783a=_0x4c2fc1[_0x50fd3b(0x1f1)];console[_0x50fd3b(0x202)](_0x50fd3b(0x20e));try{const _0x491c1c=TDX[_0x50fd3b(0x1fb)]({'site':_0x19ac9d,'apiKey':_0x4f783a[_0x50fd3b(0x1df)](),'logLevel':_0xf6b221['logLevel']??LogLevel[_0x50fd3b(0x1d3)]}),_0x4008ad=await _0x491c1c[_0x50fd3b(0x221)]['getUserInfo']();console[_0x50fd3b(0x202)]('✓\x20API\x20key\x20is\x20valid\x20(User:\x20'+_0x4008ad[_0x50fd3b(0x214)]+')');const _0x691a33=await isKeychainAvailable();_0x691a33?(await saveAPIKeyAsync(_0x4f783a[_0x50fd3b(0x1df)](),_0x19ac9d,_0x2c2c9b),console['log'](_0x50fd3b(0x212)+(_0x2c2c9b?'\x20(profile:\x20'+_0x2c2c9b+')':''))):(console[_0x50fd3b(0x210)](a7_0x4b17a6[_0x50fd3b(0x1e8)]('⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.')),console['warn'](a7_0x4b17a6[_0x50fd3b(0x1e8)](_0x50fd3b(0x1e6))));if(_0x2c2c9b){const _0x1fff5c={'site':_0x19ac9d};saveProfileToUserConfig(_0x2c2c9b,_0x1fff5c),console[_0x50fd3b(0x202)](_0x50fd3b(0x22e)+_0x2c2c9b+_0x50fd3b(0x20a));}else saveDefaultSiteToUserConfig(_0x19ac9d),console[_0x50fd3b(0x202)](_0x50fd3b(0x227)+_0x19ac9d);const _0x2a5be6=_0x2c2c9b?_0x50fd3b(0x1f6)+_0x2c2c9b:'';return console[_0x50fd3b(0x202)](),console['log'](_0x50fd3b(0x223)),console[_0x50fd3b(0x202)](_0x50fd3b(0x215)+_0x2a5be6+_0x50fd3b(0x211)),console['log'](_0x50fd3b(0x215)+_0x2a5be6+_0x50fd3b(0x22c)),0x0;}catch(_0x54fa38){if(_0x54fa38 instanceof HTTPClientError&&_0x54fa38[_0x50fd3b(0x218)]===0x191)return printAuthError(_0x54fa38),0x1;return console[_0x50fd3b(0x231)](a7_0x4b17a6['red']('✗\x20Validation\x20failed:\x20'+(_0x54fa38 instanceof Error?_0x54fa38[_0x50fd3b(0x217)]:String(_0x54fa38)))),console[_0x50fd3b(0x231)](_0x50fd3b(0x21f)),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x475d4f(0x200)]=a7_0x475d4f(0x206);[a7_0x475d4f(0x1e3)]=a7_0x475d4f(0x1d9);async[a7_0x475d4f(0x20c)](_0x4f7c70){const _0xad0ec8=a7_0x475d4f,{options:_0x208707,tdx:_0x588c33}=_0x4f7c70,_0x4d2eb6=_0x208707['site'],_0x210935=_0x208707['profile'],_0x348b29=_0x210935?_0x210935:_0xad0ec8(0x219);console[_0xad0ec8(0x202)]('tdx\x20profile:\x20'+_0x348b29+_0xad0ec8(0x1d5)+_0x4d2eb6+')');const _0x26754a=await getOAuthTokens(_0x210935);if(_0x26754a)console[_0xad0ec8(0x202)](_0xad0ec8(0x1e2)),console[_0xad0ec8(0x202)](_0xad0ec8(0x1fe)+(_0x210935?_0xad0ec8(0x1e1)+_0x210935+')':''));else{const _0x4f69e3=await resolveAPIKeyAsync(_0x4d2eb6,_0x210935);if(_0x4f69e3){const {source:_0x132712,isDeprecated:_0x156180}=_0x4f69e3,_0x15453a='Read\x20credential\x20from\x20'+_0x132712;console['log'](_0x156180?a7_0x4b17a6[_0xad0ec8(0x1e8)](_0x15453a):_0x15453a);}else console['log'](a7_0x4b17a6[_0xad0ec8(0x1e8)](_0xad0ec8(0x208)));}try{const _0xaac622=await _0x588c33[_0xad0ec8(0x221)]['getUserInfo']();return console[_0xad0ec8(0x202)](a7_0x4b17a6[_0xad0ec8(0x228)](_0xad0ec8(0x21b))),console['log'](_0xad0ec8(0x1ff)+_0xaac622['email']),(_0xaac622[_0xad0ec8(0x1d7)]||_0xaac622[_0xad0ec8(0x1ef)])&&console[_0xad0ec8(0x202)](_0xad0ec8(0x1fd)+[_0xaac622[_0xad0ec8(0x1d7)],_0xaac622[_0xad0ec8(0x1ef)]]['filter'](Boolean)['join']('\x20')),0x0;}catch(_0x2e72e6){return _0x2e72e6 instanceof HTTPClientError&&_0x2e72e6['status']===0x191?printAuthError(_0x2e72e6,!![],_0x210935):console[_0xad0ec8(0x231)](a7_0x4b17a6[_0xad0ec8(0x1d0)]('✗\x20Validation\x20failed:\x20'+(_0x2e72e6 instanceof Error?_0x2e72e6[_0xad0ec8(0x217)]:String(_0x2e72e6)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x475d4f(0x200)]=a7_0x475d4f(0x1d8);[a7_0x475d4f(0x1e3)]='Remove\x20API\x20key\x20from\x20system\x20keychain';async[a7_0x475d4f(0x20c)](_0x355fc7){const _0x442b1f=a7_0x475d4f,{options:_0x4ee10c}=_0x355fc7,_0x20c585=_0x4ee10c[_0x442b1f(0x1e5)];console[_0x442b1f(0x202)](a7_0x4b17a6[_0x442b1f(0x21e)](_0x442b1f(0x1dd)));const _0x4d3098=await isKeychainAvailable();if(!_0x4d3098)return console[_0x442b1f(0x231)](a7_0x4b17a6[_0x442b1f(0x1d0)](_0x442b1f(0x226))),0x1;const [_0x1eab71,_0x13fd04]=await Promise[_0x442b1f(0x1e0)]([deleteKeychainAPIKey(_0x20c585),deleteOAuthTokens(_0x20c585)]);if(_0x1eab71||_0x13fd04){clearCredentialCache();const _0x36e621=[_0x1eab71&&'API\x20key',_0x13fd04&&'OAuth\x20tokens'][_0x442b1f(0x21a)](Boolean)[_0x442b1f(0x22b)](_0x442b1f(0x1f0));return console[_0x442b1f(0x202)]('✓\x20'+_0x36e621+_0x442b1f(0x1fc)+(_0x20c585?_0x442b1f(0x1e1)+_0x20c585+')':'')),0x0;}else return console['log'](_0x442b1f(0x1ec)+(_0x20c585?_0x442b1f(0x201)+_0x20c585:'')),0x1;}}
1
+ const a7_0x1802ff=a7_0x2a69;(function(_0x318e3c,_0x3a2ac2){const _0x217d5b=a7_0x2a69,_0x12458f=_0x318e3c();while(!![]){try{const _0x23828d=-parseInt(_0x217d5b(0x191))/0x1*(parseInt(_0x217d5b(0x18d))/0x2)+parseInt(_0x217d5b(0x1aa))/0x3+-parseInt(_0x217d5b(0x192))/0x4*(-parseInt(_0x217d5b(0x1a6))/0x5)+-parseInt(_0x217d5b(0x188))/0x6*(parseInt(_0x217d5b(0x184))/0x7)+-parseInt(_0x217d5b(0x18c))/0x8*(parseInt(_0x217d5b(0x183))/0x9)+-parseInt(_0x217d5b(0x1c7))/0xa+parseInt(_0x217d5b(0x17c))/0xb;if(_0x23828d===_0x3a2ac2)break;else _0x12458f['push'](_0x12458f['shift']());}catch(_0x25277d){_0x12458f['push'](_0x12458f['shift']());}}}(a7_0x18a8,0xd4a3a));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';function a7_0x18a8(){const _0x2bcb64=['email','28568ogKkvC','10dTPBEE','\x20(profile:\x20','ERROR','✓\x20Profile\x20\x27','58831VKIbjZ','92yYdkAp','log','/app/mp/ak','auth:clear','create','logLevel','Setup\x20cancelled','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','Account\x20name\x20for\x20SSO\x20(press\x20Enter\x20to\x20skip):','\x20\x20\x20\x202.\x20Or\x20use\x20a\x20different\x20browser\x20profile\x20to\x20avoid\x20cached\x20sessions','trim','last_name','tdx:\x20auth\x20clear','No\x20credentials\x20found\x20in\x20keychain','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','dim','status','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','Credential\x20type:\x20OAuth','accountName','141065xeDlfS','✗\x20Validation\x20failed:\x20','For\x20scripts\x20or\x20headless\x20servers','\x20\x20tdx','1012734XuPTFL','apiKey','filter','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','Setting\x20up\x20authentication\x20for\x20site:\x20','✓\x20Authentication\x20successful\x0a','Read\x20credential\x20from\x20','Use\x20an\x20API\x20key','apikey','getUserInfo','auth','Opening\x20browser\x20for\x20authentication...','\x27\x20registered','✓\x20Default\x20site\x20set\x20to\x20','access_token','Sign\x20in\x20with\x20browser\x20(recommended)','jobs','Validating\x20API\x20key...','No\x20credential\x20found','method','cyan','\x20\x20\x20\x201.\x20Run:\x20tdx\x20auth\x20setup\x20--account-name\x20<name>','/oauth/authorize','\x20(site:\x20','Validating\x20OAuth\x20tokens...','red','tdx:\x20auth\x20setup','\x20\x20(','description','15806910SxpqlD','warn','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','us01','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','profile','Opens\x20your\x20browser\x20to\x20sign\x20in\x20with\x20SSO','User:\x20','error','auth:setup','green','name','✓\x20Signed\x20in\x20successfully','System\x20keychain\x20is\x20not\x20available','Read\x20credential\x20from\x20keychain','account_id','\x20and\x20','execute','\x20--profile\x20','yellow','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain','/users/initiate_sso\x20(account:\x20','oauth','bold','You\x20can\x20find\x20your\x20API\x20key\x20at:','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','33136719OwOtTv','text','\x0aSetup\x20cancelled','\x20removed\x20from\x20keychain','Choose\x20how\x20to\x20sign\x20in:','message','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','2655sbqNEV','279503jYsQvG','Setup\x20API\x20key\x20authentication\x20interactively','API\x20key\x20cannot\x20be\x20empty','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','30YwJhWs','join','all'];a7_0x18a8=function(){return _0x2bcb64;};return a7_0x18a8();}import{promptSiteSelection}from'../core/constants.js';import a7_0x2b8c31 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_0x21ba7b from'chalk';function a7_0x2a69(_0x13ff61,_0x16f999){_0x13ff61=_0x13ff61-0x16e;const _0x18a83a=a7_0x18a8();let _0x2a6995=_0x18a83a[_0x13ff61];return _0x2a6995;}export async function runOAuthLoginFlow(_0x163c9d,_0x194cf1,_0x36d58b,_0x2c52cb){const _0x44bac9=a7_0x2a69,_0xd8441e=await isKeychainAvailable();if(!_0xd8441e)throw new Error(_0x44bac9(0x199)+_0x44bac9(0x1ad));let _0x507518=_0x2c52cb?.['accountName'];if(!_0x507518){const _0x5860bd=await a7_0x2b8c31({'type':_0x44bac9(0x17d),'name':_0x44bac9(0x1a5),'message':_0x44bac9(0x19a)});if(_0x5860bd[_0x44bac9(0x1a5)]===undefined)throw new Error('Setup\x20cancelled');_0x507518=_0x5860bd[_0x44bac9(0x1a5)][_0x44bac9(0x19c)]()||undefined;}const _0x3c3d69=getConsoleUrl(_0x163c9d);console['log'](_0x44bac9(0x1b5));_0x507518?console[_0x44bac9(0x193)]('\x20\x20'+_0x3c3d69+_0x44bac9(0x177)+_0x507518+')'):console[_0x44bac9(0x193)]('\x20\x20'+_0x3c3d69+_0x44bac9(0x1c0));console['log'](_0x44bac9(0x1c9));const _0x5c1b10=await startOAuthFlow(_0x163c9d,{'accountName':_0x507518});console[_0x44bac9(0x193)](_0x44bac9(0x1c2));const _0x58b041=TDX[_0x44bac9(0x196)]({'site':_0x163c9d,'accessToken':_0x5c1b10[_0x44bac9(0x1b8)],'logLevel':_0x36d58b??LogLevel[_0x44bac9(0x18f)]}),_0x319a5f=await _0x58b041[_0x44bac9(0x1ba)][_0x44bac9(0x1b3)]();console['log'](a7_0x21ba7b[_0x44bac9(0x1d1)](_0x44bac9(0x16e))),console[_0x44bac9(0x193)]('\x20\x20'+a7_0x21ba7b[_0x44bac9(0x1be)](_0x163c9d+':'+_0x319a5f[_0x44bac9(0x171)])+'\x20\x20user_id:'+_0x319a5f['id']+_0x44bac9(0x1c5)+_0x319a5f[_0x44bac9(0x18b)]+')');!_0x507518&&(console[_0x44bac9(0x193)](a7_0x21ba7b[_0x44bac9(0x1a1)]('\x20\x20If\x20this\x20is\x20not\x20the\x20expected\x20account:')),console['log'](a7_0x21ba7b[_0x44bac9(0x1a1)](_0x44bac9(0x1bf))),console['log'](a7_0x21ba7b[_0x44bac9(0x1a1)](_0x44bac9(0x19b))));await saveOAuthTokens(_0x5c1b10,_0x194cf1),console[_0x44bac9(0x193)](_0x44bac9(0x176)+(_0x194cf1?_0x44bac9(0x18e)+_0x194cf1+')':''));if(_0x194cf1){const _0x3d2000={'site':_0x163c9d};saveProfileToUserConfig(_0x194cf1,_0x3d2000),console[_0x44bac9(0x193)](_0x44bac9(0x190)+_0x194cf1+_0x44bac9(0x1b6));}else saveDefaultSiteToUserConfig(_0x163c9d),console[_0x44bac9(0x193)](_0x44bac9(0x1b7)+_0x163c9d);const _0x4774f1=_0x194cf1?_0x44bac9(0x174)+_0x194cf1:'';console['log'](),console[_0x44bac9(0x193)]('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console[_0x44bac9(0x193)](_0x44bac9(0x1a9)+_0x4774f1+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console['log'](_0x44bac9(0x1a9)+_0x4774f1+_0x44bac9(0x1cb));}export async function promptAuthMethod(){const _0x1a5559=a7_0x2a69,_0x2d3df7=await a7_0x2b8c31({'type':'select','name':_0x1a5559(0x1bd),'message':_0x1a5559(0x180),'choices':[{'title':_0x1a5559(0x1b9),'description':_0x1a5559(0x1cd),'value':_0x1a5559(0x178)},{'title':_0x1a5559(0x1b1),'description':_0x1a5559(0x1a8),'value':_0x1a5559(0x1b2)}]});return _0x2d3df7[_0x1a5559(0x1bd)]||null;}export class AuthSetupCommand extends BaseCommand{[a7_0x1802ff(0x1d2)]=a7_0x1802ff(0x1d0);[a7_0x1802ff(0x1c6)]=a7_0x1802ff(0x185);async[a7_0x1802ff(0x173)](_0x3b0b04){const _0x16c687=a7_0x1802ff,{options:_0x3de23d}=_0x3b0b04,_0x5d66b1=_0x3de23d[_0x16c687(0x1cc)];console[_0x16c687(0x193)](a7_0x21ba7b['bold'](_0x16c687(0x1c4)));const _0x3af1f2=_0x3de23d['site']||_0x16c687(0x1ca),_0x5cbeff=await promptSiteSelection(_0x3af1f2,_0x5d66b1,_0x16c687(0x198));if(!_0x5cbeff)return 0x1;const _0x5439c3=resolveSite(_0x5cbeff),_0x1d7fc7=await promptAuthMethod();if(!_0x1d7fc7)return console[_0x16c687(0x193)]('\x0aSetup\x20cancelled'),0x1;if(_0x1d7fc7==='oauth'){const {accountName:_0x36347f}=_0x3de23d;return await runOAuthLoginFlow(_0x5439c3,_0x5d66b1,_0x3de23d[_0x16c687(0x197)]??LogLevel[_0x16c687(0x18f)],{'accountName':_0x36347f}),0x0;}console[_0x16c687(0x193)](_0x16c687(0x1ae)+_0x5439c3),console[_0x16c687(0x193)](_0x16c687(0x17a)),console[_0x16c687(0x193)]('\x20\x20'+getConsoleUrl(_0x5439c3,_0x16c687(0x194)));const _0x2f864b=await a7_0x2b8c31({'type':'password','name':'apiKey','message':'Enter\x20your\x20TD\x20API\x20key:','validate':_0x29f625=>{const _0xc46fb7=_0x16c687;if(!_0x29f625||!_0x29f625[_0xc46fb7(0x19c)]())return _0xc46fb7(0x186);return!![];}});if(!_0x2f864b[_0x16c687(0x1ab)])return console[_0x16c687(0x193)](_0x16c687(0x17e)),0x1;const _0x23adcb=_0x2f864b[_0x16c687(0x1ab)];console[_0x16c687(0x193)](_0x16c687(0x1bb));try{const _0x404b1a=TDX['create']({'site':_0x5439c3,'apiKey':_0x23adcb['trim'](),'logLevel':_0x3de23d[_0x16c687(0x197)]??LogLevel['ERROR']}),_0x46aced=await _0x404b1a[_0x16c687(0x1ba)]['getUserInfo']();console['log'](_0x16c687(0x1a0)+_0x46aced[_0x16c687(0x18b)]+')');const _0x175f04=await isKeychainAvailable();_0x175f04?(await saveAPIKeyAsync(_0x23adcb[_0x16c687(0x19c)](),_0x5439c3,_0x5d66b1),console[_0x16c687(0x193)](_0x16c687(0x182)+(_0x5d66b1?'\x20(profile:\x20'+_0x5d66b1+')':''))):(console[_0x16c687(0x1c8)](a7_0x21ba7b[_0x16c687(0x175)]('⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.')),console['warn'](a7_0x21ba7b[_0x16c687(0x175)](_0x16c687(0x1a3))));if(_0x5d66b1){const _0x1043df={'site':_0x5439c3};saveProfileToUserConfig(_0x5d66b1,_0x1043df),console['log'](_0x16c687(0x190)+_0x5d66b1+'\x27\x20registered');}else saveDefaultSiteToUserConfig(_0x5439c3),console[_0x16c687(0x193)]('✓\x20Default\x20site\x20set\x20to\x20'+_0x5439c3);const _0x5770e8=_0x5d66b1?_0x16c687(0x174)+_0x5d66b1:'';return console[_0x16c687(0x193)](),console[_0x16c687(0x193)]('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console['log'](_0x16c687(0x1a9)+_0x5770e8+_0x16c687(0x17b)),console[_0x16c687(0x193)](_0x16c687(0x1a9)+_0x5770e8+_0x16c687(0x1cb)),0x0;}catch(_0x3768fb){if(_0x3768fb instanceof HTTPClientError&&_0x3768fb[_0x16c687(0x1a2)]===0x191)return printAuthError(_0x3768fb),0x1;return console['error'](a7_0x21ba7b[_0x16c687(0x1c3)](_0x16c687(0x1a7)+(_0x3768fb instanceof Error?_0x3768fb['message']:String(_0x3768fb)))),console[_0x16c687(0x1cf)](_0x16c687(0x187)),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x1802ff(0x1d2)]=a7_0x1802ff(0x1b4);[a7_0x1802ff(0x1c6)]='Show\x20authentication\x20status\x20and\x20validate\x20API\x20key';async[a7_0x1802ff(0x173)](_0x3823de){const _0x200512=a7_0x1802ff,{options:_0x11e3c2,tdx:_0x1e964f}=_0x3823de,_0x18f2e3=_0x11e3c2['site'],_0x2ce238=_0x11e3c2[_0x200512(0x1cc)],_0x107eb9=_0x2ce238?_0x2ce238:'N/A';console[_0x200512(0x193)]('tdx\x20profile:\x20'+_0x107eb9+_0x200512(0x1c1)+_0x18f2e3+')');const _0x3d5148=await getOAuthTokens(_0x2ce238);if(_0x3d5148)console['log'](_0x200512(0x1a4)),console[_0x200512(0x193)](_0x200512(0x170)+(_0x2ce238?_0x200512(0x18e)+_0x2ce238+')':''));else{const _0x3c3b08=await resolveAPIKeyAsync(_0x18f2e3,_0x2ce238);if(_0x3c3b08){const {source:_0x3199b2,isDeprecated:_0x4a2622}=_0x3c3b08,_0x108db6=_0x200512(0x1b0)+_0x3199b2;console[_0x200512(0x193)](_0x4a2622?a7_0x21ba7b[_0x200512(0x175)](_0x108db6):_0x108db6);}else console['log'](a7_0x21ba7b[_0x200512(0x175)](_0x200512(0x1bc)));}try{const _0x206117=await _0x1e964f[_0x200512(0x1ba)][_0x200512(0x1b3)]();return console[_0x200512(0x193)](a7_0x21ba7b[_0x200512(0x1d1)](_0x200512(0x1af))),console[_0x200512(0x193)](_0x200512(0x1ce)+_0x206117['email']),(_0x206117['first_name']||_0x206117[_0x200512(0x19d)])&&console['log']('Name:\x20'+[_0x206117['first_name'],_0x206117[_0x200512(0x19d)]][_0x200512(0x1ac)](Boolean)[_0x200512(0x189)]('\x20')),0x0;}catch(_0x5e22a2){return _0x5e22a2 instanceof HTTPClientError&&_0x5e22a2[_0x200512(0x1a2)]===0x191?printAuthError(_0x5e22a2,!![],_0x2ce238):console[_0x200512(0x1cf)](a7_0x21ba7b[_0x200512(0x1c3)](_0x200512(0x1a7)+(_0x5e22a2 instanceof Error?_0x5e22a2[_0x200512(0x181)]:String(_0x5e22a2)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x1802ff(0x1d2)]=a7_0x1802ff(0x195);[a7_0x1802ff(0x1c6)]='Remove\x20API\x20key\x20from\x20system\x20keychain';async[a7_0x1802ff(0x173)](_0x5178cd){const _0x446272=a7_0x1802ff,{options:_0x30784b}=_0x5178cd,_0x5e0670=_0x30784b[_0x446272(0x1cc)];console['log'](a7_0x21ba7b[_0x446272(0x179)](_0x446272(0x19e)));const _0x415bc0=await isKeychainAvailable();if(!_0x415bc0)return console[_0x446272(0x1cf)](a7_0x21ba7b['red'](_0x446272(0x16f))),0x1;const [_0x5c5637,_0x2b0fdf]=await Promise[_0x446272(0x18a)]([deleteKeychainAPIKey(_0x5e0670),deleteOAuthTokens(_0x5e0670)]);if(_0x5c5637||_0x2b0fdf){clearCredentialCache();const _0x399d03=[_0x5c5637&&'API\x20key',_0x2b0fdf&&'OAuth\x20tokens'][_0x446272(0x1ac)](Boolean)[_0x446272(0x189)](_0x446272(0x172));return console['log']('✓\x20'+_0x399d03+_0x446272(0x17f)+(_0x5e0670?_0x446272(0x18e)+_0x5e0670+')':'')),0x0;}else return console[_0x446272(0x193)](_0x446272(0x19f)+(_0x5e0670?'\x20for\x20profile:\x20'+_0x5e0670:'')),0x1;}}