@treasuredata/tdx 2026.4.9 → 2026.4.10

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.d.ts.map +1 -1
  14. package/dist/commands/claude-command.js +1 -1
  15. package/dist/commands/claude-command.js.map +1 -1
  16. package/dist/commands/claude-statusline-command.js +1 -1
  17. package/dist/commands/claude-usage-command.js +1 -1
  18. package/dist/commands/command.js +1 -1
  19. package/dist/commands/connection-command.js +1 -1
  20. package/dist/commands/databases.js +1 -1
  21. package/dist/commands/delivery-command.js +1 -1
  22. package/dist/commands/describe.js +1 -1
  23. package/dist/commands/engage-campaign-pull-command.js +1 -1
  24. package/dist/commands/engage-campaign-push-command.js +1 -1
  25. package/dist/commands/engage-campaign-validate-command.js +1 -1
  26. package/dist/commands/engage-command.js +1 -1
  27. package/dist/commands/engage-template-pull-command.js +1 -1
  28. package/dist/commands/engage-template-push-command.js +1 -1
  29. package/dist/commands/engage-template-validate-command.js +1 -1
  30. package/dist/commands/job-command.js +1 -1
  31. package/dist/commands/journey-command.js +1 -1
  32. package/dist/commands/journey-validate-command.js +1 -1
  33. package/dist/commands/llm-command.js +1 -1
  34. package/dist/commands/mcp-command.js +1 -1
  35. package/dist/commands/parent-segment-command.js +1 -1
  36. package/dist/commands/policy-command.js +1 -1
  37. package/dist/commands/profile-command.js +1 -1
  38. package/dist/commands/profiles-command.js +1 -1
  39. package/dist/commands/query-command.js +1 -1
  40. package/dist/commands/schedule-command.js +1 -1
  41. package/dist/commands/segment-command.js +1 -1
  42. package/dist/commands/segment-create-command.js +1 -1
  43. package/dist/commands/segment-fields-command.js +1 -1
  44. package/dist/commands/segment-pull-command.js +1 -1
  45. package/dist/commands/segment-push-command.js +1 -1
  46. package/dist/commands/segment-update-command.js +1 -1
  47. package/dist/commands/segment-use-command.js +1 -1
  48. package/dist/commands/segment-validate-command.js +1 -1
  49. package/dist/commands/segments.js +1 -1
  50. package/dist/commands/show.js +1 -1
  51. package/dist/commands/status-command.js +1 -1
  52. package/dist/commands/tables.js +1 -1
  53. package/dist/commands/unset-command.js +1 -1
  54. package/dist/commands/upgrade-command.js +1 -1
  55. package/dist/commands/use-command.js +1 -1
  56. package/dist/commands/user-command.js +1 -1
  57. package/dist/commands/work-command.js +1 -1
  58. package/dist/commands/workflow-command.js +1 -1
  59. package/dist/core/auth.js +1 -1
  60. package/dist/core/command-output.js +1 -1
  61. package/dist/core/config.js +1 -1
  62. package/dist/core/connection-cache.js +1 -1
  63. package/dist/core/constants.js +1 -1
  64. package/dist/core/credential-cache.js +1 -1
  65. package/dist/core/global-context.js +1 -1
  66. package/dist/core/keychain.js +1 -1
  67. package/dist/core/oauth-keychain.js +1 -1
  68. package/dist/core/oauth.js +1 -1
  69. package/dist/core/profile.js +1 -1
  70. package/dist/core/project-config.js +1 -1
  71. package/dist/core/session.js +1 -1
  72. package/dist/core/user-cache.js +1 -1
  73. package/dist/core/version.js +1 -1
  74. package/dist/index.js +1 -1
  75. package/dist/mcp/server.js +1 -1
  76. package/dist/mcp/tools/index.js +1 -1
  77. package/dist/mcp/tools/tdx-run.js +1 -1
  78. package/dist/mcp/tools/tdx-search.js +1 -1
  79. package/dist/mcp/tools/work-create-item.js +1 -1
  80. package/dist/mcp/utils.js +1 -1
  81. package/dist/proxy/claude-usage-tracker.js +1 -1
  82. package/dist/proxy/passthrough-server.js +1 -1
  83. package/dist/proxy/sse-usage-parser.js +1 -1
  84. package/dist/sdk/agent/agent-config.js +1 -1
  85. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  86. package/dist/sdk/agent/agent-yaml.js +1 -1
  87. package/dist/sdk/agent/test/evaluator.js +1 -1
  88. package/dist/sdk/agent/test/executor.js +1 -1
  89. package/dist/sdk/agent/test/index.js +1 -1
  90. package/dist/sdk/agent/test/output.js +1 -1
  91. package/dist/sdk/agent/test/parser.js +1 -1
  92. package/dist/sdk/agent/tool-target-registry.js +1 -1
  93. package/dist/sdk/api.js +1 -1
  94. package/dist/sdk/cas/cas-api-client.js +1 -1
  95. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  96. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  97. package/dist/sdk/cas/index.js +1 -1
  98. package/dist/sdk/cas/pull-workflow.js +1 -1
  99. package/dist/sdk/cas/push-workflow.js +1 -1
  100. package/dist/sdk/client/cdp-api-client.js +1 -1
  101. package/dist/sdk/client/delivery-api-client.js +1 -1
  102. package/dist/sdk/client/endpoints.js +1 -1
  103. package/dist/sdk/client/engage-api-client.js +1 -1
  104. package/dist/sdk/client/http-client.js +1 -1
  105. package/dist/sdk/client/llm-api-client.js +1 -1
  106. package/dist/sdk/client/oauth-refresh.js +1 -1
  107. package/dist/sdk/client/rate-limiter.js +1 -1
  108. package/dist/sdk/client/td-api-client.js +1 -1
  109. package/dist/sdk/client/trino-api-client.js +1 -1
  110. package/dist/sdk/client/workflow-client.js +1 -1
  111. package/dist/sdk/connection-validator.js +1 -1
  112. package/dist/sdk/connection.js +1 -1
  113. package/dist/sdk/delivery.js +1 -1
  114. package/dist/sdk/engage/campaign-pull.js +1 -1
  115. package/dist/sdk/engage/campaign-push.js +1 -1
  116. package/dist/sdk/engage/campaign-validator.js +1 -1
  117. package/dist/sdk/engage/campaign-yaml.js +1 -1
  118. package/dist/sdk/engage/template-pull.js +1 -1
  119. package/dist/sdk/engage/template-push.js +1 -1
  120. package/dist/sdk/engage/template-validator.js +1 -1
  121. package/dist/sdk/engage/template-yaml.js +1 -1
  122. package/dist/sdk/engage/types/campaign-def.js +1 -1
  123. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  124. package/dist/sdk/engage/types/template-schema.js +1 -1
  125. package/dist/sdk/engage.js +1 -1
  126. package/dist/sdk/errors.js +1 -1
  127. package/dist/sdk/index.js +1 -1
  128. package/dist/sdk/io/index.js +1 -1
  129. package/dist/sdk/io/node-filesystem.js +1 -1
  130. package/dist/sdk/job.js +1 -1
  131. package/dist/sdk/journey.js +1 -1
  132. package/dist/sdk/llm/chat-cache.js +1 -1
  133. package/dist/sdk/llm/index.js +1 -1
  134. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  135. package/dist/sdk/llm/model-factors.js +1 -1
  136. package/dist/sdk/personalization.js +1 -1
  137. package/dist/sdk/policy.js +1 -1
  138. package/dist/sdk/query/index.js +1 -1
  139. package/dist/sdk/query/sql-parser.js +1 -1
  140. package/dist/sdk/realtime.js +1 -1
  141. package/dist/sdk/schedule.js +1 -1
  142. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  143. package/dist/sdk/segment/fields-display.js +1 -1
  144. package/dist/sdk/segment/file-discovery.js +1 -1
  145. package/dist/sdk/segment/journey-utils.js +1 -1
  146. package/dist/sdk/segment/journey-validator.js +1 -1
  147. package/dist/sdk/segment/journey-yaml.js +1 -1
  148. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  149. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  150. package/dist/sdk/segment/pull-workflow.js +1 -1
  151. package/dist/sdk/segment/push-recovery.js +1 -1
  152. package/dist/sdk/segment/push-workflow.js +1 -1
  153. package/dist/sdk/segment/resolution-context.js +1 -1
  154. package/dist/sdk/segment/segment-path-parser.js +1 -1
  155. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  156. package/dist/sdk/segment/segment-validator.js +1 -1
  157. package/dist/sdk/segment/target-resolution.js +1 -1
  158. package/dist/sdk/segment/tdx-config.js +1 -1
  159. package/dist/sdk/segment/types/activation-schema.js +1 -1
  160. package/dist/sdk/segment/types/journey-def.js +1 -1
  161. package/dist/sdk/segment/types/journey-schema.js +1 -1
  162. package/dist/sdk/segment/types/segment-def.js +1 -1
  163. package/dist/sdk/segment/types/segment-schema.js +1 -1
  164. package/dist/sdk/segment/validate-files.js +1 -1
  165. package/dist/sdk/segment/yaml-validator.js +1 -1
  166. package/dist/sdk/segment.js +1 -1
  167. package/dist/sdk/types/index.js +1 -1
  168. package/dist/sdk/types/progress.js +1 -1
  169. package/dist/sdk/types/workspace.js +1 -1
  170. package/dist/sdk/user.js +1 -1
  171. package/dist/sdk/util/format-detector.js +1 -1
  172. package/dist/sdk/util/formatters.js +1 -1
  173. package/dist/sdk/util/index.js +1 -1
  174. package/dist/sdk/util/paginate.js +1 -1
  175. package/dist/sdk/util/tree-formatter.js +1 -1
  176. package/dist/sdk/workflow/archive-validation.js +1 -1
  177. package/dist/sdk/workflow/clone-workflow.js +1 -1
  178. package/dist/sdk/workflow/index.js +1 -1
  179. package/dist/sdk/workflow/pull-workflow.js +1 -1
  180. package/dist/sdk/workflow/push-workflow.js +1 -1
  181. package/dist/sdk/workflow/tdx-config.js +1 -1
  182. package/dist/sdk/workflow/workflow-utils.js +1 -1
  183. package/dist/sdk/workspace/access-tracker.js +1 -1
  184. package/dist/sdk/workspace/frontmatter.js +1 -1
  185. package/dist/sdk/workspace/git.d.ts +52 -0
  186. package/dist/sdk/workspace/git.d.ts.map +1 -1
  187. package/dist/sdk/workspace/git.js +1 -1
  188. package/dist/sdk/workspace/git.js.map +1 -1
  189. package/dist/sdk/workspace/index.d.ts +14 -0
  190. package/dist/sdk/workspace/index.d.ts.map +1 -1
  191. package/dist/sdk/workspace/index.js +1 -1
  192. package/dist/sdk/workspace/index.js.map +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 +2 -1
@@ -1 +1 @@
1
- const a3_0x31edc1=a3_0xa739;(function(_0x409e36,_0x3a9e8b){const _0x3e021c=a3_0xa739,_0x541ec8=_0x409e36();while(!![]){try{const _0x5bc411=parseInt(_0x3e021c(0xff))/0x1*(parseInt(_0x3e021c(0x108))/0x2)+-parseInt(_0x3e021c(0x10c))/0x3+-parseInt(_0x3e021c(0x106))/0x4+-parseInt(_0x3e021c(0x11a))/0x5+-parseInt(_0x3e021c(0xfc))/0x6+-parseInt(_0x3e021c(0x10b))/0x7+-parseInt(_0x3e021c(0x10e))/0x8*(-parseInt(_0x3e021c(0xfe))/0x9);if(_0x5bc411===_0x3a9e8b)break;else _0x541ec8['push'](_0x541ec8['shift']());}catch(_0x31796e){_0x541ec8['push'](_0x541ec8['shift']());}}}(a3_0x21d5,0x57949));function a3_0x21d5(){const _0x12c14e=['site','execute','verbose','\x27...','length','message','2165550OJqlCi','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','Error:\x20','✔\x20Found\x20','\x20\x20Cause:\x20','1011168oVvkjr','data','5673213RDhuMm','2FPZfzh','resolveParentId','activations','\x20activation','Resolved\x20parent\x20ID:\x20','resolveSegmentId','error','475756oQZmcE','name','586086fSKLUG','Error:\x20Segment\x20name\x20is\x20required','Listing\x20activations\x20for\x20segment\x20\x27','319130hrIVUc','274641jTrYLI','Resolving\x20child\x20segment\x20\x27','8euSIcV','cause','Resolved\x20child\x20ID:\x20','segment','listActivations','description'];a3_0x21d5=function(){return _0x12c14e;};return a3_0x21d5();}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_0xa739(_0x59dcba,_0x11da5b){_0x59dcba=_0x59dcba-0xfc;const _0x21d5fa=a3_0x21d5();let _0xa7396f=_0x21d5fa[_0x59dcba];return _0xa7396f;}export class ActivationsCommand extends BaseCommand{[a3_0x31edc1(0x107)]=a3_0x31edc1(0x101);[a3_0x31edc1(0x113)]='List\x20activations\x20for\x20a\x20segment';async[a3_0x31edc1(0x115)](_0xc622d3){const _0x1e9574=a3_0x31edc1,{options:_0x428316,args:_0x20b46e,tdx:_0x127e2a}=_0xc622d3;if(_0x20b46e[_0x1e9574(0x118)]===0x0)return console['error'](_0x1e9574(0x109)),console['error'](_0x1e9574(0x11b)),0x1;try{const {parentId:_0x24f776,childId:_0x46d315}=parseSegmentRef(_0x20b46e[0x0]);if(!_0x46d315)return console[_0x1e9574(0x105)](_0x1e9574(0x11c)),console['error'](_0x1e9574(0x11b)),0x1;_0x428316[_0x1e9574(0x116)]&&(console[_0x1e9574(0x105)]('Site:\x20'+_0x428316[_0x1e9574(0x114)]),console[_0x1e9574(0x105)]('Parent\x20name:\x20'+_0x24f776),console[_0x1e9574(0x105)]('Child\x20name:\x20'+_0x46d315));const _0x4a89b8=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x24f776+_0x1e9574(0x117),()=>_0x127e2a[_0x1e9574(0x111)][_0x1e9574(0x100)](_0x24f776),{'verbose':_0x428316[_0x1e9574(0x116)]}),_0xede24e=_0x4a89b8[_0x1e9574(0xfd)];_0x428316[_0x1e9574(0x116)]&&console[_0x1e9574(0x105)](_0x1e9574(0x103)+_0xede24e);const _0x23409a=await withSpinner(_0x1e9574(0x10d)+_0x46d315+_0x1e9574(0x117),()=>_0x127e2a[_0x1e9574(0x111)][_0x1e9574(0x104)](_0xede24e,_0x46d315),{'verbose':_0x428316['verbose']}),_0x26722f=_0x23409a[_0x1e9574(0xfd)];_0x428316[_0x1e9574(0x116)]&&console[_0x1e9574(0x105)](_0x1e9574(0x110)+_0x26722f);const _0x126b51=await withSpinner(_0x1e9574(0x10a)+_0x46d315+_0x1e9574(0x117),()=>_0x127e2a['segment'][_0x1e9574(0x112)](_0xede24e,_0x26722f),{'verbose':_0x428316['verbose']}),_0x5dba93=_0x126b51[_0x1e9574(0xfd)];return console['error'](_0x1e9574(0x11e)+_0x5dba93['length']+_0x1e9574(0x102)+(_0x5dba93['length']!==0x1?'s':'')),await handleSDKOutput(_0x5dba93,_0x428316),0x0;}catch(_0x155974){if(_0x155974 instanceof SDKError)return console[_0x1e9574(0x105)](_0x1e9574(0x11d)+_0x155974[_0x1e9574(0x119)]),_0x155974[_0x1e9574(0x10f)]&&console[_0x1e9574(0x105)](_0x1e9574(0x11f)+_0x155974['cause']),0x1;throw _0x155974;}}}
1
+ const a3_0x5b56f8=a3_0x5206;(function(_0x41e8de,_0x128d03){const _0x433b24=a3_0x5206,_0x104818=_0x41e8de();while(!![]){try{const _0x380cd6=parseInt(_0x433b24(0x147))/0x1*(-parseInt(_0x433b24(0x146))/0x2)+parseInt(_0x433b24(0x145))/0x3+parseInt(_0x433b24(0x15b))/0x4*(-parseInt(_0x433b24(0x14f))/0x5)+-parseInt(_0x433b24(0x15c))/0x6+-parseInt(_0x433b24(0x14d))/0x7*(-parseInt(_0x433b24(0x15d))/0x8)+-parseInt(_0x433b24(0x14c))/0x9+parseInt(_0x433b24(0x15f))/0xa;if(_0x380cd6===_0x128d03)break;else _0x104818['push'](_0x104818['shift']());}catch(_0x1d3da4){_0x104818['push'](_0x104818['shift']());}}}(a3_0xdcdc,0xa17b3));import{BaseCommand}from'./command.js';function a3_0x5206(_0x396541,_0x3ac27d){_0x396541=_0x396541-0x144;const _0xdcdc13=a3_0xdcdc();let _0x5206b5=_0xdcdc13[_0x396541];return _0x5206b5;}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_0xdcdc(){const _0x7bba1e=['Resolving\x20child\x20segment\x20\x27','Resolved\x20child\x20ID:\x20','data','verbose','Child\x20name:\x20','resolveSegmentId','segment','\x27...','12tGLtzL','2539422HrqHNP','4089784EeRoBa','cause','20833000JvadEx','resolveParentId','\x20activation','List\x20activations\x20for\x20a\x20segment','\x20\x20Cause:\x20','2019336JHbYtQ','2QDPNqg','1232702GNBsEX','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','length','error','activations','3805569SJlYFu','14CcZfok','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','1731085lkSQZC','Resolved\x20parent\x20ID:\x20','description','Resolving\x20parent\x20segment\x20\x27'];a3_0xdcdc=function(){return _0x7bba1e;};return a3_0xdcdc();}export class ActivationsCommand extends BaseCommand{['name']=a3_0x5b56f8(0x14b);[a3_0x5b56f8(0x151)]=a3_0x5b56f8(0x162);async['execute'](_0x248398){const _0x3414fd=a3_0x5b56f8,{options:_0x35e031,args:_0x55c8aa,tdx:_0x53428e}=_0x248398;if(_0x55c8aa[_0x3414fd(0x149)]===0x0)return console[_0x3414fd(0x14a)]('Error:\x20Segment\x20name\x20is\x20required'),console[_0x3414fd(0x14a)](_0x3414fd(0x148)),0x1;try{const {parentId:_0x448274,childId:_0x45900f}=parseSegmentRef(_0x55c8aa[0x0]);if(!_0x45900f)return console['error'](_0x3414fd(0x14e)),console[_0x3414fd(0x14a)](_0x3414fd(0x148)),0x1;_0x35e031[_0x3414fd(0x156)]&&(console[_0x3414fd(0x14a)]('Site:\x20'+_0x35e031['site']),console[_0x3414fd(0x14a)]('Parent\x20name:\x20'+_0x448274),console['error'](_0x3414fd(0x157)+_0x45900f));const _0x1293c6=await withSpinner(_0x3414fd(0x152)+_0x448274+_0x3414fd(0x15a),()=>_0x53428e['segment'][_0x3414fd(0x160)](_0x448274),{'verbose':_0x35e031[_0x3414fd(0x156)]}),_0x1a078f=_0x1293c6[_0x3414fd(0x155)];_0x35e031[_0x3414fd(0x156)]&&console[_0x3414fd(0x14a)](_0x3414fd(0x150)+_0x1a078f);const _0x21c4dd=await withSpinner(_0x3414fd(0x153)+_0x45900f+_0x3414fd(0x15a),()=>_0x53428e[_0x3414fd(0x159)][_0x3414fd(0x158)](_0x1a078f,_0x45900f),{'verbose':_0x35e031[_0x3414fd(0x156)]}),_0x131402=_0x21c4dd[_0x3414fd(0x155)];_0x35e031[_0x3414fd(0x156)]&&console['error'](_0x3414fd(0x154)+_0x131402);const _0x1fc50f=await withSpinner('Listing\x20activations\x20for\x20segment\x20\x27'+_0x45900f+_0x3414fd(0x15a),()=>_0x53428e[_0x3414fd(0x159)]['listActivations'](_0x1a078f,_0x131402),{'verbose':_0x35e031[_0x3414fd(0x156)]}),_0x303075=_0x1fc50f[_0x3414fd(0x155)];return console[_0x3414fd(0x14a)]('✔\x20Found\x20'+_0x303075[_0x3414fd(0x149)]+_0x3414fd(0x161)+(_0x303075[_0x3414fd(0x149)]!==0x1?'s':'')),await handleSDKOutput(_0x303075,_0x35e031),0x0;}catch(_0x5c1edc){if(_0x5c1edc instanceof SDKError)return console['error']('Error:\x20'+_0x5c1edc['message']),_0x5c1edc[_0x3414fd(0x15e)]&&console[_0x3414fd(0x14a)](_0x3414fd(0x144)+_0x5c1edc[_0x3414fd(0x15e)]),0x1;throw _0x5c1edc;}}}
@@ -1 +1 @@
1
- const a4_0x46749d=a4_0x12a5;(function(_0x1688f8,_0x26c246){const _0x3211e0=a4_0x12a5,_0xaa7872=_0x1688f8();while(!![]){try{const _0xcc4ac=-parseInt(_0x3211e0(0x165))/0x1+parseInt(_0x3211e0(0x21d))/0x2+parseInt(_0x3211e0(0x194))/0x3*(parseInt(_0x3211e0(0x1ea))/0x4)+-parseInt(_0x3211e0(0x1fc))/0x5*(parseInt(_0x3211e0(0x1f3))/0x6)+parseInt(_0x3211e0(0x220))/0x7*(parseInt(_0x3211e0(0x1e8))/0x8)+parseInt(_0x3211e0(0x1bf))/0x9*(-parseInt(_0x3211e0(0x19d))/0xa)+parseInt(_0x3211e0(0x1bb))/0xb;if(_0xcc4ac===_0x26c246)break;else _0xaa7872['push'](_0xaa7872['shift']());}catch(_0x2be626){_0xaa7872['push'](_0xaa7872['shift']());}}}(a4_0x4128,0xe2c67));import a4_0x528486 from'chalk';import a4_0x15ba78 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 a4_0x12a5(_0x746dd4,_0x133035){_0x746dd4=_0x746dd4-0x165;const _0x412878=a4_0x4128();let _0x12a595=_0x412878[_0x746dd4];return _0x12a595;}function a4_0x4128(){const _0x24adff=['session','unchanged','chatInterfaces','4693833eUQoBu','prompts','join','updated','\x20resources?','tdx.json','source','\x20\x20Integration\x20\x22','Cloning\x20\x22','Using\x20project:\x20','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','dim','cloneProject','Cancelled','✔\x20Context\x20set:\x20','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','\x22:\x20','yellow','\x20\x20Text\x20Knowledge\x20Bases:\x20','Status:\x20','\x0aChanges:','\x20changed','description','New\x20project:\x20','diff','Would\x20clone:','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','Output\x20path:\x20','Output:\x20','Using\x20local\x20project:\x20','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','Using\x20project\x20from\x20','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','Agent\x20','found','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','new','\x20\x20Knowledge\x20Bases:\x20','\x20=\x20','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','24MMvdrR','\x20\x20Text\x20Knowledge\x20Base\x20\x22','2568aPHyRR','\x20\x20Chat\x20Interface\x20\x22','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','Agent:\x20','counts','Project\x20cloned\x20successfully','action','INVALID_ARGUMENT','dryRun','23442NSKhoO','projectId','outputPath','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','-\x20no\x20files\x20written','agent:clone','agents','\x27\x20to\x20create\x20the\x20folder\x20structure.','Clone\x20\x22','1115KXrMIK','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20created','\x22...','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','\x20\x20tdx\x20agent\x20clone\x20agents/','\x20updated','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','\x0aWrite\x20','Using\x20project\x20from\x20context:\x20','cyan','site','execute','push','force','\x20unchanged','errors','\x0aProject\x20pushed\x20with\x20errors','\x20\x20Target:\x20','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','Using\x20current\x20project:\x20','agentId','created','\x20errors','\x0aPush\x20','newProjectName','outputDir','\x20files?','message','arg-dir','\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','\x20\x20Experimental\x20Artifact\x20\x22','504824LdBXnw','llm','Project\x20cloned\x20with\x20errors','957887SilGab','<new-name>','1693047bgJPUB','\x20\x20Prompts:\x20','Source:\x20','\x0a✔\x20Pulled\x20','yes','Pushing\x20to\x20project...','total','Analyzing\x20changes\x20to\x20push...','formInterfaces','\x20\x20Agent\x20\x22','\x0aChanges\x20to\x20form\x20interface\x20\x27','agentName','\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)','Would\x20push\x20agent:\x20','\x20new','\x20\x20Form\x20Interface\x20\x22','dirname','agent:push','pushAgent','repeat','name','\x0aPush\x20summary\x20for\x20\x27','knowledgeBases','context','\x0aChanges\x20to\x20integration\x20\x27','agent','experimentalKnowledgeBases','no_context','Dry\x20run\x20-\x20no\x20changes\x20made','log','\x20resources\x20to\x20\x27','newProjectId','\x20\x20Chat\x20Interfaces:\x20','\x20\x20Experimental\x20Artifacts:\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)','\x20|\x20','\x20\x20tdx\x20agent\x20pull\x20','\x20\x20Form\x20Interfaces:\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Errors:','\x0aError:','Chat:\x20','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','\x20\x20Agents:\x20','isNew','\x20total','\x22\x20from\x20project\x20\x22','3351nBdsmS','cwd-config','\x20\x20Knowledge\x20Base\x20\x22','projectName','gray','textKnowledgeBases','\x0a✔\x20Pushed\x20','llm_project','Cannot\x20clone\x20from\x20context\x20project\x20\x22','10eQEKFR','Writing\x20files...','agent.yml','green','\x20--name\x20','pullAgent','\x0aChanges\x20to\x20prompt\x20\x27','\x20\x20Integrations:\x20','llmProject','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory','New\x20project\x20name\x20is\x20required','Summary:','no_local_folder','reason','pullProject','experimentalArtifacts','Project:\x20','agent:pull','integrations','hasChanges','cwd','Pushing\x20agent\x20from\x20\x22','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','red','\x20files\x20to\x20','error','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','-\x20nothing\x20pushed','\x20\x20Prompt\x20\x22','\x0aPull\x20summary\x20for\x20\x27','28981337MKUkbs'];a4_0x4128=function(){return _0x24adff;};return a4_0x4128();}function formatCountSummary(_0x55ca27){const _0x129ba1=a4_0x12a5,_0x49491e=[];if(_0x55ca27[_0x129ba1(0x16b)]!==undefined)_0x49491e[_0x129ba1(0x20a)](_0x55ca27['total']+_0x129ba1(0x192));if(_0x55ca27[_0x129ba1(0x1e4)]!==undefined&&_0x55ca27[_0x129ba1(0x1e4)]>0x0)_0x49491e['push'](a4_0x528486[_0x129ba1(0x1a0)](_0x55ca27[_0x129ba1(0x1e4)]+_0x129ba1(0x173)));if(_0x55ca27[_0x129ba1(0x213)]!==undefined&&_0x55ca27[_0x129ba1(0x213)]>0x0)_0x49491e['push'](a4_0x528486[_0x129ba1(0x1a0)](_0x55ca27['created']+_0x129ba1(0x1fe)));if(_0x55ca27[_0x129ba1(0x1c2)]!==undefined&&_0x55ca27[_0x129ba1(0x1c2)]>0x0)_0x49491e[_0x129ba1(0x20a)](a4_0x528486[_0x129ba1(0x1d0)](_0x55ca27[_0x129ba1(0x1c2)]+_0x129ba1(0x202)));if(_0x55ca27[_0x129ba1(0x1bd)]!==undefined&&_0x55ca27[_0x129ba1(0x1bd)]>0x0)_0x49491e[_0x129ba1(0x20a)](a4_0x528486[_0x129ba1(0x198)](_0x55ca27[_0x129ba1(0x1bd)]+_0x129ba1(0x20c)));if(_0x55ca27[_0x129ba1(0x20d)]!==undefined&&_0x55ca27[_0x129ba1(0x20d)]>0x0)_0x49491e[_0x129ba1(0x20a)](a4_0x528486[_0x129ba1(0x1b4)](_0x55ca27[_0x129ba1(0x20d)]+_0x129ba1(0x214)));return _0x49491e[_0x129ba1(0x1c1)](',\x20');}function displayDiffs(_0x2ac7c0,_0x4eb864,_0x5e996f,_0x3a842d,_0x5d9f35,_0x491cc6,_0x317acf,_0x5b8e10,_0x1be111){const _0x54ec49=a4_0x12a5;for(const _0x3c4074 of _0x2ac7c0){if(_0x3c4074[_0x54ec49(0x1d7)]){const _0x56052a=_0x3c4074['agentName']||_0x3c4074[_0x54ec49(0x179)];console['log']('\x0aChanges\x20to\x20agent\x20\x27'+_0x56052a+'\x27:'),console[_0x54ec49(0x182)]('─'[_0x54ec49(0x178)](0x3c)),console[_0x54ec49(0x182)](_0x3c4074[_0x54ec49(0x1d7)]),console[_0x54ec49(0x182)]('─'[_0x54ec49(0x178)](0x3c));}}for(const _0x3a0943 of _0x4eb864){_0x3a0943[_0x54ec49(0x1d7)]&&(console['log'](_0x54ec49(0x1f6)+_0x3a0943[_0x54ec49(0x179)]+'\x27:'),console[_0x54ec49(0x182)]('─'[_0x54ec49(0x178)](0x3c)),console[_0x54ec49(0x182)](_0x3a0943[_0x54ec49(0x1d7)]),console['log']('─'['repeat'](0x3c)));}for(const _0x15ff0b of _0x5e996f){_0x15ff0b[_0x54ec49(0x1d7)]&&(console['log']('\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27'+_0x15ff0b[_0x54ec49(0x179)]+'\x27:'),console[_0x54ec49(0x182)]('─'[_0x54ec49(0x178)](0x3c)),console[_0x54ec49(0x182)](_0x15ff0b[_0x54ec49(0x1d7)]),console[_0x54ec49(0x182)]('─'[_0x54ec49(0x178)](0x3c)));}for(const _0x2bbcee of _0x3a842d){_0x2bbcee[_0x54ec49(0x1d7)]&&(console['log'](_0x54ec49(0x1a3)+_0x2bbcee[_0x54ec49(0x179)]+'\x27:'),console[_0x54ec49(0x182)]('─'['repeat'](0x3c)),console[_0x54ec49(0x182)](_0x2bbcee['diff']),console[_0x54ec49(0x182)]('─'[_0x54ec49(0x178)](0x3c)));}for(const _0x32232d of _0x5d9f35){_0x32232d[_0x54ec49(0x1d7)]&&(console['log'](_0x54ec49(0x17d)+_0x32232d[_0x54ec49(0x179)]+'\x27:'),console[_0x54ec49(0x182)]('─'['repeat'](0x3c)),console[_0x54ec49(0x182)](_0x32232d[_0x54ec49(0x1d7)]),console[_0x54ec49(0x182)]('─'[_0x54ec49(0x178)](0x3c)));}for(const _0x542453 of _0x491cc6){_0x542453[_0x54ec49(0x1d7)]&&(console[_0x54ec49(0x182)]('\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27'+_0x542453['name']+'\x27:'),console[_0x54ec49(0x182)]('─'[_0x54ec49(0x178)](0x3c)),console[_0x54ec49(0x182)](_0x542453[_0x54ec49(0x1d7)]),console[_0x54ec49(0x182)]('─'[_0x54ec49(0x178)](0x3c)));}for(const _0x3f5fe6 of _0x317acf){_0x3f5fe6[_0x54ec49(0x1d7)]&&(console[_0x54ec49(0x182)](_0x54ec49(0x1b7)+_0x3f5fe6['name']+'\x27:'),console[_0x54ec49(0x182)]('─'[_0x54ec49(0x178)](0x3c)),console[_0x54ec49(0x182)](_0x3f5fe6[_0x54ec49(0x1d7)]),console[_0x54ec49(0x182)]('─'['repeat'](0x3c)));}for(const _0x3cab56 of _0x5b8e10){_0x3cab56[_0x54ec49(0x1d7)]&&(console['log'](_0x54ec49(0x16f)+_0x3cab56[_0x54ec49(0x179)]+'\x27:'),console[_0x54ec49(0x182)]('─'[_0x54ec49(0x178)](0x3c)),console[_0x54ec49(0x182)](_0x3cab56[_0x54ec49(0x1d7)]),console[_0x54ec49(0x182)]('─'['repeat'](0x3c)));}for(const _0xb75f33 of _0x1be111){_0xb75f33[_0x54ec49(0x1d7)]&&(console[_0x54ec49(0x182)]('\x0aChanges\x20to\x20chat\x20interface\x20\x27'+_0xb75f33[_0x54ec49(0x179)]+'\x27:'),console[_0x54ec49(0x182)]('─'[_0x54ec49(0x178)](0x3c)),console[_0x54ec49(0x182)](_0xb75f33[_0x54ec49(0x1d7)]),console[_0x54ec49(0x182)]('─'['repeat'](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x46749d(0x179)]=a4_0x46749d(0x1ae);[a4_0x46749d(0x1d5)]=a4_0x46749d(0x1d9);async[a4_0x46749d(0x209)](_0x403ca4){const _0x5d7391=a4_0x46749d,{options:_0x1a4640,args:_0x38bbe6,tdx:_0x858c1c}=_0x403ca4,_0x265a40=_0x38bbe6[0x0],_0x495e3a=_0x38bbe6[0x1],_0x53503b=_0x1a4640['output'],_0x507f2e=_0x1a4640['dryRun'],_0x3fc9f9=_0x1a4640['force'],_0x2f1f9d=_0x1a4640[_0x5d7391(0x169)],_0x1220eb=_0x1a4640[_0x5d7391(0x1a5)],_0x5c2d9a=_0x1a4640[_0x5d7391(0x17e)];let _0x4e4d90;if(_0x265a40){const _0xcf1f83=a4_0x15ba78['join'](_0x265a40,'tdx.json');if(existsSync(_0xcf1f83))try{const _0x5d459b=JSON['parse'](readFileSync(_0xcf1f83,'utf-8'));_0x5d459b[_0x5d7391(0x19b)]&&(_0x4e4d90={'llm_project':_0x5d459b['llm_project']});}catch{}}const _0x345fd5=findAgentConfigPath(process[_0x5d7391(0x1b1)]());let _0x2a03dd;if(_0x345fd5)try{const _0x58c00b=JSON['parse'](readFileSync(_0x345fd5,'utf-8'));_0x58c00b[_0x5d7391(0x19b)]&&(_0x2a03dd={'llm_project':_0x58c00b[_0x5d7391(0x19b)]});}catch{}const _0x5d6401=resolveAgentPullArgs({'arg':_0x265a40,'agentNameArg':_0x495e3a,'agentFlag':_0x5c2d9a,'contextProject':_0x1220eb,'argDirConfig':_0x4e4d90,'cwdConfigPath':_0x345fd5||undefined,'cwdConfig':_0x2a03dd}),{projectNameOrId:_0xc4e5b1,targetAgentName:_0x150498,existingOutputDir:_0x4ba945,source:_0xfd688f}=_0x5d6401;if(_0xfd688f===_0x5d7391(0x21a))console['log'](a4_0x528486[_0x5d7391(0x1ca)](_0x5d7391(0x1de)+a4_0x15ba78[_0x5d7391(0x1c1)](_0x265a40,_0x5d7391(0x1c4))+':\x20'+_0xc4e5b1));else{if(_0xfd688f===_0x5d7391(0x195))console[_0x5d7391(0x182)](a4_0x528486[_0x5d7391(0x1ca)](_0x5d7391(0x1c8)+_0xc4e5b1));else _0xfd688f===_0x5d7391(0x17c)&&console[_0x5d7391(0x182)](a4_0x528486[_0x5d7391(0x1ca)](_0x5d7391(0x206)+_0xc4e5b1));}if(!_0xc4e5b1)return _0x5c2d9a?(console[_0x5d7391(0x182)](a4_0x528486[_0x5d7391(0x1d0)]('The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a')),console[_0x5d7391(0x182)](_0x5d7391(0x1e3)),console[_0x5d7391(0x182)](_0x5d7391(0x1ce))):(console[_0x5d7391(0x182)](a4_0x528486['yellow']('llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a')),console[_0x5d7391(0x182)](_0x5d7391(0x187)),console[_0x5d7391(0x182)](_0x5d7391(0x21b)),console[_0x5d7391(0x182)](_0x5d7391(0x1a6)),console[_0x5d7391(0x182)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20--agent\x20<name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20context\x20project'),console[_0x5d7391(0x182)]('\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(_0x150498){const {data:_0x27af96}=await withSpinner('Pulling\x20agent\x20\x22'+_0x150498+_0x5d7391(0x193)+_0xc4e5b1+_0x5d7391(0x1ff),()=>_0x858c1c['llm'][_0x5d7391(0x1a2)](_0xc4e5b1,_0x150498,_0x53503b,{'dryRun':_0x507f2e,'force':_0x3fc9f9}));if(_0x507f2e)return console[_0x5d7391(0x182)](a4_0x528486[_0x5d7391(0x1d0)]('Dry\x20run\x20-\x20no\x20files\x20written')),console[_0x5d7391(0x182)]('Would\x20pull\x20agent:\x20'+_0x27af96[_0x5d7391(0x170)]),console[_0x5d7391(0x182)](_0x5d7391(0x1da)+_0x27af96[_0x5d7391(0x1f5)]),_0x27af96[_0x5d7391(0x1d7)]&&(console[_0x5d7391(0x182)](_0x5d7391(0x1d3)),console[_0x5d7391(0x182)]('─'['repeat'](0x3c)),console[_0x5d7391(0x182)](_0x27af96[_0x5d7391(0x1d7)]),console[_0x5d7391(0x182)]('─'[_0x5d7391(0x178)](0x3c))),0x0;return console[_0x5d7391(0x182)](a4_0x528486[_0x5d7391(0x1a0)]('Agent\x20pulled\x20successfully')),console['log'](_0x5d7391(0x1ed)+_0x27af96[_0x5d7391(0x170)]),console['log'](_0x5d7391(0x1db)+_0x27af96[_0x5d7391(0x1f5)]),console[_0x5d7391(0x182)](_0x5d7391(0x1d2)+(_0x27af96[_0x5d7391(0x191)]?a4_0x528486[_0x5d7391(0x1a0)](_0x5d7391(0x1e4)):_0x27af96[_0x5d7391(0x1b0)]?a4_0x528486[_0x5d7391(0x1d0)](_0x5d7391(0x1c2)):a4_0x528486['gray'](_0x5d7391(0x1bd)))),0x0;}const _0x2efb0b=_0x4ba945||_0x53503b,{data:_0x2019f1}=await withSpinner('Analyzing\x20project\x20\x22'+_0xc4e5b1+_0x5d7391(0x1ff),()=>_0x858c1c[_0x5d7391(0x21e)][_0x5d7391(0x1ab)](_0xc4e5b1,_0x2efb0b,{'dryRun':!![]})),_0x566f9f=_0x2019f1[_0x5d7391(0x1ee)][_0x5d7391(0x1f9)][_0x5d7391(0x1e4)]+_0x2019f1['counts'][_0x5d7391(0x17b)][_0x5d7391(0x1e4)]+_0x2019f1[_0x5d7391(0x1ee)]['textKnowledgeBases'][_0x5d7391(0x1e4)]+_0x2019f1['counts']['prompts'][_0x5d7391(0x1e4)]+_0x2019f1[_0x5d7391(0x1ee)]['integrations']['new']+_0x2019f1[_0x5d7391(0x1ee)][_0x5d7391(0x17f)]['new']+_0x2019f1[_0x5d7391(0x1ee)][_0x5d7391(0x1ac)][_0x5d7391(0x1e4)]+_0x2019f1[_0x5d7391(0x1ee)]['formInterfaces'][_0x5d7391(0x1e4)]+_0x2019f1[_0x5d7391(0x1ee)]['chatInterfaces'][_0x5d7391(0x1e4)],_0x56b8cb=_0x2019f1[_0x5d7391(0x1ee)]['agents'][_0x5d7391(0x1c2)]+_0x2019f1['counts'][_0x5d7391(0x17b)][_0x5d7391(0x1c2)]+_0x2019f1['counts'][_0x5d7391(0x199)][_0x5d7391(0x1c2)]+_0x2019f1[_0x5d7391(0x1ee)][_0x5d7391(0x1c0)][_0x5d7391(0x1c2)]+_0x2019f1[_0x5d7391(0x1ee)]['integrations'][_0x5d7391(0x1c2)]+_0x2019f1[_0x5d7391(0x1ee)]['experimentalKnowledgeBases'][_0x5d7391(0x1c2)]+_0x2019f1[_0x5d7391(0x1ee)]['experimentalArtifacts'][_0x5d7391(0x1c2)]+_0x2019f1[_0x5d7391(0x1ee)][_0x5d7391(0x16d)][_0x5d7391(0x1c2)]+_0x2019f1[_0x5d7391(0x1ee)]['chatInterfaces'][_0x5d7391(0x1c2)],_0x5f05fc=_0x2019f1[_0x5d7391(0x1ee)][_0x5d7391(0x1f9)]['unchanged']+_0x2019f1['counts'][_0x5d7391(0x17b)][_0x5d7391(0x1bd)]+_0x2019f1[_0x5d7391(0x1ee)]['textKnowledgeBases'][_0x5d7391(0x1bd)]+_0x2019f1[_0x5d7391(0x1ee)]['prompts'][_0x5d7391(0x1bd)]+_0x2019f1[_0x5d7391(0x1ee)][_0x5d7391(0x1af)][_0x5d7391(0x1bd)]+_0x2019f1[_0x5d7391(0x1ee)][_0x5d7391(0x17f)][_0x5d7391(0x1bd)]+_0x2019f1['counts'][_0x5d7391(0x1ac)][_0x5d7391(0x1bd)]+_0x2019f1[_0x5d7391(0x1ee)]['formInterfaces'][_0x5d7391(0x1bd)]+_0x2019f1['counts']['chatInterfaces'][_0x5d7391(0x1bd)];console[_0x5d7391(0x182)](_0x5d7391(0x1ba)+_0x2019f1['projectName']+'\x27:'),console[_0x5d7391(0x182)]('\x20\x20'+a4_0x528486[_0x5d7391(0x1a0)]('+\x20'+_0x566f9f+_0x5d7391(0x173))+_0x5d7391(0x188)+a4_0x528486[_0x5d7391(0x1d0)]('~\x20'+_0x56b8cb+_0x5d7391(0x1d4))+_0x5d7391(0x188)+a4_0x528486[_0x5d7391(0x1ca)]('=\x20'+_0x5f05fc+_0x5d7391(0x20c))),console['log'](_0x5d7391(0x190)+formatCountSummary(_0x2019f1[_0x5d7391(0x1ee)][_0x5d7391(0x1f9)])),console[_0x5d7391(0x182)](_0x5d7391(0x1e5)+formatCountSummary(_0x2019f1[_0x5d7391(0x1ee)][_0x5d7391(0x17b)])),console[_0x5d7391(0x182)](_0x5d7391(0x1d1)+formatCountSummary(_0x2019f1[_0x5d7391(0x1ee)][_0x5d7391(0x199)])),console[_0x5d7391(0x182)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x2019f1[_0x5d7391(0x1ee)][_0x5d7391(0x1c0)])),console[_0x5d7391(0x182)](_0x5d7391(0x1a4)+formatCountSummary(_0x2019f1[_0x5d7391(0x1ee)][_0x5d7391(0x1af)])),console[_0x5d7391(0x182)](_0x5d7391(0x18a)+formatCountSummary(_0x2019f1[_0x5d7391(0x1ee)][_0x5d7391(0x16d)])),console[_0x5d7391(0x182)](_0x5d7391(0x185)+formatCountSummary(_0x2019f1[_0x5d7391(0x1ee)][_0x5d7391(0x1be)]));const _0x57162c=_0x2019f1[_0x5d7391(0x1ee)][_0x5d7391(0x17f)][_0x5d7391(0x16b)]>0x0||_0x2019f1[_0x5d7391(0x1ee)]['experimentalArtifacts']['total']>0x0;_0x57162c&&(console[_0x5d7391(0x182)](_0x5d7391(0x1e7)+formatCountSummary(_0x2019f1['counts'][_0x5d7391(0x17f)])),console[_0x5d7391(0x182)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x2019f1[_0x5d7391(0x1ee)][_0x5d7391(0x1ac)])));console[_0x5d7391(0x182)](_0x5d7391(0x20f)+a4_0x528486[_0x5d7391(0x207)](_0x2019f1[_0x5d7391(0x217)])),displayDiffs(_0x2019f1[_0x5d7391(0x1f9)],_0x2019f1['knowledgeBases'],_0x2019f1['textKnowledgeBases'],_0x2019f1[_0x5d7391(0x1c0)],_0x2019f1['integrations'],_0x2019f1[_0x5d7391(0x17f)],_0x2019f1[_0x5d7391(0x1ac)],_0x2019f1['formInterfaces'],_0x2019f1[_0x5d7391(0x1be)]);if(_0x507f2e)return console[_0x5d7391(0x182)](a4_0x528486['yellow'](_0x5d7391(0x18f))),0x0;if(_0x566f9f===0x0&&_0x56b8cb===0x0)return console['log'](a4_0x528486[_0x5d7391(0x1a0)]('\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'llm_project':_0x2019f1[_0x5d7391(0x197)]},_0x1a4640[_0x5d7391(0x1bc)]),console[_0x5d7391(0x182)](a4_0x528486[_0x5d7391(0x1a0)](_0x5d7391(0x1cd)+a4_0x528486[_0x5d7391(0x1ca)]('llm_project')+_0x5d7391(0x1e6)+a4_0x528486[_0x5d7391(0x207)](_0x2019f1['projectName']))),0x0;if(!_0x2f1f9d&&!_0x3fc9f9){if(!isInteractive())return console[_0x5d7391(0x1b6)](a4_0x528486['red']('\x0aError:'),_0x5d7391(0x18b)),console[_0x5d7391(0x1b6)](a4_0x528486[_0x5d7391(0x1ca)](_0x5d7391(0x1fd))),0x1;const _0xc7fb82=await confirmKey(_0x5d7391(0x205)+(_0x566f9f+_0x56b8cb)+_0x5d7391(0x218));if(!_0xc7fb82)return console['log'](a4_0x528486['yellow'](_0x5d7391(0x1cc)),_0x5d7391(0x1f7)),0x1;}const {data:_0x9033ed}=await withSpinner(_0x5d7391(0x19e),()=>_0x858c1c[_0x5d7391(0x21e)]['pullProject'](_0xc4e5b1,_0x2efb0b,{'force':_0x3fc9f9}));return console[_0x5d7391(0x182)](a4_0x528486[_0x5d7391(0x1a0)](_0x5d7391(0x168)+(_0x566f9f+_0x56b8cb)+_0x5d7391(0x1b5)+_0x9033ed[_0x5d7391(0x217)])),saveSessionContext({'llm_project':_0x9033ed['projectName']},_0x1a4640[_0x5d7391(0x1bc)]),console['log'](a4_0x528486[_0x5d7391(0x1a0)](_0x5d7391(0x1cd)+a4_0x528486[_0x5d7391(0x1ca)](_0x5d7391(0x19b))+_0x5d7391(0x1e6)+a4_0x528486[_0x5d7391(0x207)](_0x9033ed['projectName']))),0x0;}}export class AgentCloneCommand extends BaseCommand{['name']=a4_0x46749d(0x1f8);[a4_0x46749d(0x1d5)]='Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project';async[a4_0x46749d(0x209)](_0x60d05f){const _0x291ee1=a4_0x46749d,{options:_0x627241,args:_0x529479,tdx:_0x59ae74}=_0x60d05f,_0x53caf4=_0x529479[0x0],_0x152997=_0x627241[_0x291ee1(0x179)],_0x4895bb=_0x627241[_0x291ee1(0x1f2)],_0x599b0f=_0x627241['yes'],_0x56deb7=_0x627241[_0x291ee1(0x208)],_0x5a877d=_0x627241['llmProject'];let _0xf60d81;const _0x4cb1ef=findAgentConfigPath(process[_0x291ee1(0x1b1)]());if(_0x53caf4){const _0x597da2=a4_0x15ba78[_0x291ee1(0x1c1)](_0x53caf4,_0x291ee1(0x1c4));existsSync(_0x597da2)?(_0xf60d81=_0x53caf4,console[_0x291ee1(0x182)](a4_0x528486[_0x291ee1(0x1ca)](_0x291ee1(0x1dc)+_0x53caf4))):_0xf60d81=_0x53caf4;}else{if(_0x4cb1ef)_0xf60d81=a4_0x15ba78[_0x291ee1(0x175)](_0x4cb1ef),console['log'](a4_0x528486['dim'](_0x291ee1(0x211)+_0xf60d81));else{if(_0x5a877d){const _0x1517b7=sanitizeForFilesystem(_0x5a877d);let _0x356062=_0x1517b7,_0x55a07c=a4_0x15ba78[_0x291ee1(0x1c1)](process[_0x291ee1(0x1b1)](),_0x291ee1(0x1f9),_0x1517b7,_0x291ee1(0x1c4));if(!existsSync(_0x55a07c)){const _0xd1e8f8=normalizeName(_0x5a877d),_0x4d7a1a=a4_0x15ba78['join'](process[_0x291ee1(0x1b1)](),_0x291ee1(0x1f9),_0xd1e8f8,'tdx.json');existsSync(_0x4d7a1a)&&(_0x356062=_0xd1e8f8,_0x55a07c=_0x4d7a1a);}if(existsSync(_0x55a07c))_0xf60d81=a4_0x15ba78[_0x291ee1(0x175)](_0x55a07c),console[_0x291ee1(0x182)](a4_0x528486['dim'](_0x291ee1(0x1dc)+_0xf60d81));else{const _0x5a8ed4=_0x627241['profile'];if(_0x5a8ed4)throw new SDKError(ErrorCode[_0x291ee1(0x1f1)],_0x291ee1(0x19c)+_0x5a877d+'\x22\x20to\x20a\x20different\x20profile',undefined,{'helpText':_0x291ee1(0x1df)+_0x291ee1(0x204)+(_0x291ee1(0x189)+_0x5a877d+'\x0a')+(_0x291ee1(0x201)+_0x356062+_0x291ee1(0x1a1)+(_0x152997||_0x291ee1(0x221))+'\x20--profile\x20'+_0x5a8ed4)});_0xf60d81=_0x5a877d,console['log'](a4_0x528486[_0x291ee1(0x1ca)]('Using\x20context\x20project:\x20'+_0x5a877d));}}}}if(!_0xf60d81)return console[_0x291ee1(0x182)](a4_0x528486[_0x291ee1(0x1d0)]('No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a')),console['log'](_0x291ee1(0x1b3)),console[_0x291ee1(0x182)](_0x291ee1(0x210)),console[_0x291ee1(0x182)](_0x291ee1(0x171)),console[_0x291ee1(0x182)](_0x291ee1(0x1dd)),0x1;if(!_0x152997)throw new SDKError(ErrorCode['MISSING_ARGUMENT'],_0x291ee1(0x1a7),undefined,{'helpText':_0x291ee1(0x200)});if(!_0x599b0f&&!_0x4895bb){if(!isInteractive())return console[_0x291ee1(0x1b6)](a4_0x528486[_0x291ee1(0x1b4)](_0x291ee1(0x18d)),_0x291ee1(0x18b)),console[_0x291ee1(0x1b6)](a4_0x528486[_0x291ee1(0x1ca)](_0x291ee1(0x1fd))),0x1;const _0x559ffc=await confirmKey(_0x291ee1(0x1fb)+_0xf60d81+'\x22\x20to\x20new\x20project\x20\x22'+_0x152997+'\x22?');if(!_0x559ffc)return console[_0x291ee1(0x182)](a4_0x528486[_0x291ee1(0x1d0)]('Cancelled')),0x1;}const {data:_0x1645ac}=await withSpinner(_0x291ee1(0x1c7)+_0xf60d81+'\x22\x20to\x20\x22'+_0x152997+_0x291ee1(0x1ff),()=>_0x59ae74['llm'][_0x291ee1(0x1cb)](_0xf60d81,_0x152997,{'dryRun':_0x4895bb}));if(_0x4895bb){console[_0x291ee1(0x182)](a4_0x528486[_0x291ee1(0x1d0)](_0x291ee1(0x181))),console['log'](_0x291ee1(0x167)+_0x1645ac['sourceProjectName']),console[_0x291ee1(0x182)](_0x291ee1(0x1d6)+_0x152997),console[_0x291ee1(0x182)](_0x291ee1(0x1d8)),console[_0x291ee1(0x182)]('\x20\x20Agents:\x20'+_0x1645ac[_0x291ee1(0x1ee)]['agents'][_0x291ee1(0x213)]),console[_0x291ee1(0x182)](_0x291ee1(0x1e5)+_0x1645ac[_0x291ee1(0x1ee)][_0x291ee1(0x17b)]['created']),console['log'](_0x291ee1(0x166)+_0x1645ac[_0x291ee1(0x1ee)][_0x291ee1(0x1c0)]['created']),console['log'](_0x291ee1(0x18a)+_0x1645ac[_0x291ee1(0x1ee)][_0x291ee1(0x16d)][_0x291ee1(0x213)]),console['log'](_0x291ee1(0x185)+_0x1645ac[_0x291ee1(0x1ee)]['chatInterfaces']['created']);const _0x4b3585=_0x1645ac['counts'][_0x291ee1(0x17f)]['created']>0x0||_0x1645ac[_0x291ee1(0x1ee)][_0x291ee1(0x1ac)]['created']>0x0;return _0x4b3585&&(console[_0x291ee1(0x182)](_0x291ee1(0x1e7)+_0x1645ac[_0x291ee1(0x1ee)]['experimentalKnowledgeBases'][_0x291ee1(0x213)]),console['log'](_0x291ee1(0x186)+_0x1645ac['counts'][_0x291ee1(0x1ac)][_0x291ee1(0x213)])),0x0;}const _0x18645d=_0x1645ac[_0x291ee1(0x1ee)][_0x291ee1(0x1f9)][_0x291ee1(0x20d)]>0x0||_0x1645ac[_0x291ee1(0x1ee)][_0x291ee1(0x17b)][_0x291ee1(0x20d)]>0x0||_0x1645ac[_0x291ee1(0x1ee)][_0x291ee1(0x1c0)][_0x291ee1(0x20d)]>0x0||_0x1645ac[_0x291ee1(0x1ee)]['formInterfaces']['errors']>0x0||_0x1645ac['counts'][_0x291ee1(0x1be)]['errors']>0x0||_0x1645ac[_0x291ee1(0x1ee)][_0x291ee1(0x17f)][_0x291ee1(0x20d)]>0x0||_0x1645ac[_0x291ee1(0x1ee)][_0x291ee1(0x1ac)][_0x291ee1(0x20d)]>0x0;_0x18645d?console[_0x291ee1(0x182)](a4_0x528486['yellow'](_0x291ee1(0x21f))):console[_0x291ee1(0x182)](a4_0x528486[_0x291ee1(0x1a0)](_0x291ee1(0x1ef)));console['log'](_0x291ee1(0x167)+_0x1645ac['sourceProjectName']),console[_0x291ee1(0x182)](_0x291ee1(0x1d6)+_0x1645ac[_0x291ee1(0x216)]),console['log']('New\x20project\x20ID:\x20'+_0x1645ac['newProjectId']),console[_0x291ee1(0x182)](),console[_0x291ee1(0x182)](_0x291ee1(0x1a8)),console['log'](_0x291ee1(0x190)+formatCountSummary(_0x1645ac[_0x291ee1(0x1ee)][_0x291ee1(0x1f9)])),console['log'](_0x291ee1(0x1e5)+formatCountSummary(_0x1645ac['counts'][_0x291ee1(0x17b)])),console['log'](_0x291ee1(0x166)+formatCountSummary(_0x1645ac[_0x291ee1(0x1ee)][_0x291ee1(0x1c0)])),console['log']('\x20\x20Integrations:\x20'+formatCountSummary(_0x1645ac[_0x291ee1(0x1ee)][_0x291ee1(0x1af)])),console['log']('\x20\x20Form\x20Interfaces:\x20'+formatCountSummary(_0x1645ac['counts'][_0x291ee1(0x16d)])),console['log']('\x20\x20Chat\x20Interfaces:\x20'+formatCountSummary(_0x1645ac[_0x291ee1(0x1ee)][_0x291ee1(0x1be)]));const _0x14b168=_0x1645ac[_0x291ee1(0x1ee)]['experimentalKnowledgeBases'][_0x291ee1(0x213)]>0x0||_0x1645ac[_0x291ee1(0x1ee)]['experimentalKnowledgeBases']['updated']>0x0||_0x1645ac[_0x291ee1(0x1ee)][_0x291ee1(0x17f)][_0x291ee1(0x1bd)]>0x0||_0x1645ac[_0x291ee1(0x1ee)][_0x291ee1(0x1ac)][_0x291ee1(0x213)]>0x0||_0x1645ac[_0x291ee1(0x1ee)][_0x291ee1(0x1ac)][_0x291ee1(0x1c2)]>0x0||_0x1645ac['counts'][_0x291ee1(0x1ac)][_0x291ee1(0x1bd)]>0x0;_0x14b168&&(console['log'](_0x291ee1(0x1e7)+formatCountSummary(_0x1645ac[_0x291ee1(0x1ee)][_0x291ee1(0x17f)])),console[_0x291ee1(0x182)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x1645ac[_0x291ee1(0x1ee)][_0x291ee1(0x1ac)])));if(_0x18645d){console[_0x291ee1(0x182)](),console['log'](a4_0x528486[_0x291ee1(0x1b4)](_0x291ee1(0x18c)));for(const _0x115525 of _0x1645ac[_0x291ee1(0x1f9)]){_0x115525['action']==='error'&&console[_0x291ee1(0x182)](a4_0x528486[_0x291ee1(0x1b4)]('\x20\x20Agent\x20\x22'+_0x115525[_0x291ee1(0x170)]+'\x22:\x20'+_0x115525['error']));}for(const _0x39302a of _0x1645ac[_0x291ee1(0x17b)]){_0x39302a[_0x291ee1(0x1f0)]==='error'&&console['log'](a4_0x528486[_0x291ee1(0x1b4)](_0x291ee1(0x196)+_0x39302a[_0x291ee1(0x179)]+_0x291ee1(0x1cf)+_0x39302a[_0x291ee1(0x1b6)]));}for(const _0x1d7dae of _0x1645ac[_0x291ee1(0x1c0)]){_0x1d7dae['action']==='error'&&console[_0x291ee1(0x182)](a4_0x528486['red'](_0x291ee1(0x1b9)+_0x1d7dae[_0x291ee1(0x179)]+_0x291ee1(0x1cf)+_0x1d7dae[_0x291ee1(0x1b6)]));}for(const _0x10dc13 of _0x1645ac[_0x291ee1(0x1af)]){_0x10dc13[_0x291ee1(0x1f0)]==='error'&&console[_0x291ee1(0x182)](a4_0x528486[_0x291ee1(0x1b4)](_0x291ee1(0x1c6)+_0x10dc13[_0x291ee1(0x179)]+_0x291ee1(0x1cf)+_0x10dc13['error']));}for(const _0x482047 of _0x1645ac[_0x291ee1(0x16d)]){_0x482047['action']==='error'&&console[_0x291ee1(0x182)](a4_0x528486[_0x291ee1(0x1b4)](_0x291ee1(0x174)+_0x482047[_0x291ee1(0x179)]+'\x22:\x20'+_0x482047[_0x291ee1(0x1b6)]));}for(const _0x327502 of _0x1645ac[_0x291ee1(0x1be)]){_0x327502[_0x291ee1(0x1f0)]===_0x291ee1(0x1b6)&&console[_0x291ee1(0x182)](a4_0x528486[_0x291ee1(0x1b4)](_0x291ee1(0x1eb)+_0x327502[_0x291ee1(0x179)]+'\x22:\x20'+_0x327502[_0x291ee1(0x1b6)]));}for(const _0x27bfc9 of _0x1645ac['experimentalKnowledgeBases']){_0x27bfc9['action']==='error'&&console[_0x291ee1(0x182)](a4_0x528486[_0x291ee1(0x1b4)](_0x291ee1(0x1ec)+_0x27bfc9[_0x291ee1(0x179)]+_0x291ee1(0x1cf)+_0x27bfc9[_0x291ee1(0x1b6)]));}for(const _0x3d8e6f of _0x1645ac[_0x291ee1(0x1ac)]){_0x3d8e6f['action']===_0x291ee1(0x1b6)&&console[_0x291ee1(0x182)](a4_0x528486[_0x291ee1(0x1b4)](_0x291ee1(0x21c)+_0x3d8e6f[_0x291ee1(0x179)]+_0x291ee1(0x1cf)+_0x3d8e6f[_0x291ee1(0x1b6)]));}return 0x1;}console[_0x291ee1(0x182)]();const _0x3819ac=getLLMProjectUrl(_0x56deb7,_0x1645ac[_0x291ee1(0x184)]);return console[_0x291ee1(0x182)](_0x291ee1(0x1ad)+a4_0x528486['cyan'](_0x3819ac)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x46749d(0x179)]=a4_0x46749d(0x176);[a4_0x46749d(0x1d5)]=a4_0x46749d(0x1c9);async['execute'](_0x384f94){const _0x5740c8=a4_0x46749d,{options:_0x153164,args:_0x2cc9c2,tdx:_0x1245ea}=_0x384f94;let _0x533441=_0x2cc9c2[0x0]||process[_0x5740c8(0x1b1)]();const _0x3451df=_0x153164[_0x5740c8(0x1f2)],_0x2e71ed=_0x153164[_0x5740c8(0x20b)],_0x33738c=_0x153164[_0x5740c8(0x169)],_0x44a4b2=_0x153164[_0x5740c8(0x208)],_0x42c42c=a4_0x15ba78[_0x5740c8(0x1c1)](_0x533441,_0x5740c8(0x19f)),_0x2478b1=existsSync(_0x42c42c);if(_0x2478b1){const {data:_0x13e2f1}=await withSpinner(_0x5740c8(0x1b2)+_0x533441+'\x22...',()=>_0x1245ea['llm'][_0x5740c8(0x177)](_0x533441,{'dryRun':_0x3451df,'force':_0x2e71ed}));if(_0x3451df)return console[_0x5740c8(0x182)](a4_0x528486[_0x5740c8(0x1d0)](_0x5740c8(0x181))),console[_0x5740c8(0x182)](_0x5740c8(0x172)+_0x13e2f1[_0x5740c8(0x170)]),0x0;if(_0x13e2f1[_0x5740c8(0x1f0)]==='error')return console[_0x5740c8(0x182)](a4_0x528486[_0x5740c8(0x1b4)]('Failed\x20to\x20push\x20agent:\x20'+_0x13e2f1[_0x5740c8(0x1b6)])),0x1;console[_0x5740c8(0x182)](a4_0x528486['green'](_0x5740c8(0x1e1)+_0x13e2f1[_0x5740c8(0x1f0)]+'\x20successfully')),console[_0x5740c8(0x182)](_0x5740c8(0x1ed)+_0x13e2f1['agentName']);if(_0x13e2f1[_0x5740c8(0x212)]&&_0x13e2f1[_0x5740c8(0x1f4)]){const _0x5e1eea=getLLMAgentChatUrl(_0x44a4b2,_0x13e2f1[_0x5740c8(0x1f4)],_0x13e2f1[_0x5740c8(0x212)]);console[_0x5740c8(0x182)](_0x5740c8(0x18e)+a4_0x528486[_0x5740c8(0x207)](_0x5e1eea));}return 0x0;}const _0x1417c7=_0x153164[_0x5740c8(0x1a5)],_0x1b7452=resolveProjectFromContext(_0x533441,_0x1417c7);if(_0x1b7452[_0x5740c8(0x1e2)])_0x533441=_0x1b7452['projectDir'],_0x1b7452[_0x5740c8(0x1c5)]===_0x5740c8(0x17c)&&console[_0x5740c8(0x182)](a4_0x528486[_0x5740c8(0x1ca)](_0x5740c8(0x1c8)+_0x533441));else{let _0x4a2d08='Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.';_0x1b7452[_0x5740c8(0x1aa)]===_0x5740c8(0x1a9)&&(_0x4a2d08=_0x1b7452[_0x5740c8(0x219)]+_0x5740c8(0x203)+_0x1b7452[_0x5740c8(0x1a5)]+_0x5740c8(0x1fa));throw new SDKError(ErrorCode[_0x5740c8(0x1f1)],_0x1b7452[_0x5740c8(0x1aa)]===_0x5740c8(0x180)?_0x1b7452['message']:'No\x20tdx.json\x20found\x20in\x20'+_0x533441,undefined,{'helpText':_0x4a2d08});}const {data:_0x50d0e1}=await withSpinner(_0x5740c8(0x16c),()=>_0x1245ea[_0x5740c8(0x21e)]['pushProject'](_0x533441,{'dryRun':!![]})),_0x54f82f=_0x50d0e1[_0x5740c8(0x1ee)][_0x5740c8(0x1f9)]['errors']>0x0;if(_0x54f82f){console[_0x5740c8(0x182)](a4_0x528486['red']('\x0aErrors\x20found:'));for(const _0x2e4b95 of _0x50d0e1[_0x5740c8(0x1f9)]){_0x2e4b95['action']===_0x5740c8(0x1b6)&&console[_0x5740c8(0x182)](a4_0x528486[_0x5740c8(0x1b4)](_0x5740c8(0x16e)+_0x2e4b95['agentName']+_0x5740c8(0x1cf)+_0x2e4b95[_0x5740c8(0x1b6)]));}return 0x1;}const _0x2cdc29=_0x50d0e1[_0x5740c8(0x1ee)][_0x5740c8(0x1f9)][_0x5740c8(0x213)]+_0x50d0e1[_0x5740c8(0x1ee)][_0x5740c8(0x17b)][_0x5740c8(0x213)]+_0x50d0e1['counts'][_0x5740c8(0x199)][_0x5740c8(0x213)]+_0x50d0e1[_0x5740c8(0x1ee)]['prompts'][_0x5740c8(0x213)]+_0x50d0e1[_0x5740c8(0x1ee)]['integrations'][_0x5740c8(0x213)]+_0x50d0e1[_0x5740c8(0x1ee)][_0x5740c8(0x17f)]['created']+_0x50d0e1['counts'][_0x5740c8(0x1ac)][_0x5740c8(0x213)]+_0x50d0e1['counts'][_0x5740c8(0x16d)][_0x5740c8(0x213)]+_0x50d0e1[_0x5740c8(0x1ee)][_0x5740c8(0x1be)][_0x5740c8(0x213)],_0x5b640a=_0x50d0e1[_0x5740c8(0x1ee)][_0x5740c8(0x1f9)][_0x5740c8(0x1c2)]+_0x50d0e1[_0x5740c8(0x1ee)]['knowledgeBases'][_0x5740c8(0x1c2)]+_0x50d0e1[_0x5740c8(0x1ee)][_0x5740c8(0x199)]['updated']+_0x50d0e1[_0x5740c8(0x1ee)][_0x5740c8(0x1c0)][_0x5740c8(0x1c2)]+_0x50d0e1[_0x5740c8(0x1ee)][_0x5740c8(0x1af)][_0x5740c8(0x1c2)]+_0x50d0e1[_0x5740c8(0x1ee)][_0x5740c8(0x17f)][_0x5740c8(0x1c2)]+_0x50d0e1[_0x5740c8(0x1ee)][_0x5740c8(0x1ac)][_0x5740c8(0x1c2)]+_0x50d0e1['counts']['formInterfaces'][_0x5740c8(0x1c2)]+_0x50d0e1['counts'][_0x5740c8(0x1be)][_0x5740c8(0x1c2)],_0xcb3e3e=_0x50d0e1[_0x5740c8(0x1ee)][_0x5740c8(0x1f9)][_0x5740c8(0x1bd)]+_0x50d0e1[_0x5740c8(0x1ee)][_0x5740c8(0x17b)][_0x5740c8(0x1bd)]+_0x50d0e1[_0x5740c8(0x1ee)][_0x5740c8(0x199)]['unchanged']+_0x50d0e1[_0x5740c8(0x1ee)]['prompts'][_0x5740c8(0x1bd)]+_0x50d0e1[_0x5740c8(0x1ee)][_0x5740c8(0x1af)][_0x5740c8(0x1bd)]+_0x50d0e1['counts'][_0x5740c8(0x17f)][_0x5740c8(0x1bd)]+_0x50d0e1[_0x5740c8(0x1ee)][_0x5740c8(0x1ac)][_0x5740c8(0x1bd)]+_0x50d0e1[_0x5740c8(0x1ee)]['formInterfaces']['unchanged']+_0x50d0e1[_0x5740c8(0x1ee)][_0x5740c8(0x1be)][_0x5740c8(0x1bd)];console['log'](_0x5740c8(0x17a)+_0x50d0e1['projectName']+'\x27:'),console[_0x5740c8(0x182)]('\x20\x20'+a4_0x528486['green']('+\x20'+_0x2cdc29+_0x5740c8(0x173))+_0x5740c8(0x188)+a4_0x528486['yellow']('~\x20'+_0x5b640a+_0x5740c8(0x1d4))+'\x20|\x20'+a4_0x528486[_0x5740c8(0x1ca)]('=\x20'+_0xcb3e3e+_0x5740c8(0x20c))),console[_0x5740c8(0x182)]('\x20\x20Agents:\x20'+formatCountSummary(_0x50d0e1[_0x5740c8(0x1ee)][_0x5740c8(0x1f9)])),console['log']('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x50d0e1[_0x5740c8(0x1ee)][_0x5740c8(0x17b)])),console['log'](_0x5740c8(0x1d1)+formatCountSummary(_0x50d0e1[_0x5740c8(0x1ee)][_0x5740c8(0x199)])),console[_0x5740c8(0x182)](_0x5740c8(0x166)+formatCountSummary(_0x50d0e1['counts'][_0x5740c8(0x1c0)])),console[_0x5740c8(0x182)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x50d0e1[_0x5740c8(0x1ee)][_0x5740c8(0x1af)])),console[_0x5740c8(0x182)](_0x5740c8(0x18a)+formatCountSummary(_0x50d0e1[_0x5740c8(0x1ee)][_0x5740c8(0x16d)])),console['log']('\x20\x20Chat\x20Interfaces:\x20'+formatCountSummary(_0x50d0e1[_0x5740c8(0x1ee)]['chatInterfaces']));const _0x2aa1c4=_0x50d0e1[_0x5740c8(0x1ee)][_0x5740c8(0x17f)][_0x5740c8(0x213)]>0x0||_0x50d0e1[_0x5740c8(0x1ee)][_0x5740c8(0x17f)][_0x5740c8(0x1c2)]>0x0||_0x50d0e1[_0x5740c8(0x1ee)][_0x5740c8(0x17f)][_0x5740c8(0x1bd)]>0x0||_0x50d0e1[_0x5740c8(0x1ee)]['experimentalArtifacts'][_0x5740c8(0x213)]>0x0||_0x50d0e1[_0x5740c8(0x1ee)][_0x5740c8(0x1ac)][_0x5740c8(0x1c2)]>0x0||_0x50d0e1['counts']['experimentalArtifacts'][_0x5740c8(0x1bd)]>0x0;_0x2aa1c4&&(console[_0x5740c8(0x182)](_0x5740c8(0x1e7)+formatCountSummary(_0x50d0e1[_0x5740c8(0x1ee)]['experimentalKnowledgeBases'])),console[_0x5740c8(0x182)](_0x5740c8(0x186)+formatCountSummary(_0x50d0e1[_0x5740c8(0x1ee)][_0x5740c8(0x1ac)])));console[_0x5740c8(0x182)]('\x20\x20Source:\x20'+a4_0x528486[_0x5740c8(0x207)](_0x533441)),displayDiffs(_0x50d0e1[_0x5740c8(0x1f9)],_0x50d0e1['knowledgeBases'],_0x50d0e1[_0x5740c8(0x199)],_0x50d0e1['prompts'],_0x50d0e1['integrations'],_0x50d0e1['experimentalKnowledgeBases'],_0x50d0e1[_0x5740c8(0x1ac)],_0x50d0e1[_0x5740c8(0x16d)],_0x50d0e1['chatInterfaces']);if(_0x3451df)return console['log'](a4_0x528486[_0x5740c8(0x1d0)](_0x5740c8(0x1e0))),0x0;if(_0x2cdc29===0x0&&_0x5b640a===0x0){console[_0x5740c8(0x182)](a4_0x528486[_0x5740c8(0x1a0)]('\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date'));const _0x3407ec=getLLMProjectUrl(_0x44a4b2,_0x50d0e1[_0x5740c8(0x1f4)]);return console[_0x5740c8(0x182)](_0x5740c8(0x1ad)+a4_0x528486[_0x5740c8(0x207)](_0x3407ec)),0x0;}if(!_0x33738c&&!_0x2e71ed){if(!isInteractive())return console['error'](a4_0x528486[_0x5740c8(0x1b4)](_0x5740c8(0x18d)),_0x5740c8(0x18b)),console[_0x5740c8(0x1b6)](a4_0x528486[_0x5740c8(0x1ca)](_0x5740c8(0x1fd))),0x1;const _0x3d08bb=await confirmKey(_0x5740c8(0x215)+(_0x2cdc29+_0x5b640a)+_0x5740c8(0x1c3));if(!_0x3d08bb)return console[_0x5740c8(0x182)](a4_0x528486['yellow'](_0x5740c8(0x1cc)),_0x5740c8(0x1b8)),0x1;}const {data:_0x5190cb}=await withSpinner(_0x5740c8(0x16a),()=>_0x1245ea['llm']['pushProject'](_0x533441,{'force':_0x2e71ed})),_0x436880=_0x5190cb[_0x5740c8(0x1ee)]['agents']['errors']>0x0||_0x5190cb[_0x5740c8(0x1ee)][_0x5740c8(0x17b)][_0x5740c8(0x20d)]>0x0||_0x5190cb['counts'][_0x5740c8(0x199)][_0x5740c8(0x20d)]>0x0||_0x5190cb[_0x5740c8(0x1ee)][_0x5740c8(0x1c0)][_0x5740c8(0x20d)]>0x0||_0x5190cb[_0x5740c8(0x1ee)][_0x5740c8(0x16d)][_0x5740c8(0x20d)]>0x0||_0x5190cb[_0x5740c8(0x1ee)][_0x5740c8(0x1be)][_0x5740c8(0x20d)]>0x0;if(_0x436880){console[_0x5740c8(0x182)](a4_0x528486['yellow'](_0x5740c8(0x20e))),console[_0x5740c8(0x182)](),console['log'](a4_0x528486[_0x5740c8(0x1b4)](_0x5740c8(0x18c)));for(const _0x76a8b6 of _0x5190cb[_0x5740c8(0x1f9)]){_0x76a8b6['action']==='error'&&console[_0x5740c8(0x182)](a4_0x528486[_0x5740c8(0x1b4)]('\x20\x20Agent\x20\x22'+_0x76a8b6['agentName']+_0x5740c8(0x1cf)+_0x76a8b6[_0x5740c8(0x1b6)]));}for(const _0x49cca2 of _0x5190cb['knowledgeBases']){_0x49cca2[_0x5740c8(0x1f0)]===_0x5740c8(0x1b6)&&console['log'](a4_0x528486['red'](_0x5740c8(0x196)+_0x49cca2['name']+'\x22:\x20'+_0x49cca2[_0x5740c8(0x1b6)]));}for(const _0x3ca191 of _0x5190cb['textKnowledgeBases']){_0x3ca191[_0x5740c8(0x1f0)]===_0x5740c8(0x1b6)&&console[_0x5740c8(0x182)](a4_0x528486[_0x5740c8(0x1b4)](_0x5740c8(0x1e9)+_0x3ca191['name']+_0x5740c8(0x1cf)+_0x3ca191[_0x5740c8(0x1b6)]));}for(const _0x22d81e of _0x5190cb[_0x5740c8(0x1c0)]){_0x22d81e[_0x5740c8(0x1f0)]===_0x5740c8(0x1b6)&&console[_0x5740c8(0x182)](a4_0x528486[_0x5740c8(0x1b4)](_0x5740c8(0x1b9)+_0x22d81e['name']+'\x22:\x20'+_0x22d81e['error']));}for(const _0x20b5b7 of _0x5190cb[_0x5740c8(0x1af)]){_0x20b5b7[_0x5740c8(0x1f0)]==='error'&&console[_0x5740c8(0x182)](a4_0x528486[_0x5740c8(0x1b4)](_0x5740c8(0x1c6)+_0x20b5b7[_0x5740c8(0x179)]+_0x5740c8(0x1cf)+_0x20b5b7[_0x5740c8(0x1b6)]));}for(const _0x5ee3a2 of _0x5190cb[_0x5740c8(0x16d)]){_0x5ee3a2[_0x5740c8(0x1f0)]===_0x5740c8(0x1b6)&&console[_0x5740c8(0x182)](a4_0x528486[_0x5740c8(0x1b4)]('\x20\x20Form\x20Interface\x20\x22'+_0x5ee3a2[_0x5740c8(0x179)]+'\x22:\x20'+_0x5ee3a2[_0x5740c8(0x1b6)]));}for(const _0x20e663 of _0x5190cb['chatInterfaces']){_0x20e663[_0x5740c8(0x1f0)]===_0x5740c8(0x1b6)&&console[_0x5740c8(0x182)](a4_0x528486['red']('\x20\x20Chat\x20Interface\x20\x22'+_0x20e663[_0x5740c8(0x179)]+_0x5740c8(0x1cf)+_0x20e663[_0x5740c8(0x1b6)]));}return 0x1;}console[_0x5740c8(0x182)](a4_0x528486[_0x5740c8(0x1a0)](_0x5740c8(0x19a)+(_0x2cdc29+_0x5b640a)+_0x5740c8(0x183)+_0x5190cb[_0x5740c8(0x197)]+'\x27'));const _0x470a7d=getLLMProjectUrl(_0x44a4b2,_0x5190cb[_0x5740c8(0x1f4)]);return console[_0x5740c8(0x182)](_0x5740c8(0x1ad)+a4_0x528486[_0x5740c8(0x207)](_0x470a7d)),0x0;}}
1
+ function a4_0x3c74(){const _0x24876d=['repeat','Analyzing\x20project\x20\x22','\x0a✔\x20Pulled\x20','llm_project','Using\x20project\x20from\x20','arg-dir','\x20\x20Text\x20Knowledge\x20Base\x20\x22','projectName','\x0aChanges\x20to\x20agent\x20\x27','\x0aChanges\x20to\x20form\x20interface\x20\x27','Source:\x20','128793YeORsC','Using\x20project\x20from\x20context:\x20','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','Dry\x20run\x20-\x20no\x20changes\x20made','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','4961NakOii','191050BsxhJl','\x22...','tdx.json','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','profile','\x0aChanges\x20to\x20integration\x20\x27','283230nETFfr','\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)','\x20\x20Form\x20Interfaces:\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','diff','MISSING_ARGUMENT','Pushing\x20to\x20project...','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Using\x20local\x20project:\x20','\x20\x20Source:\x20','no_local_folder','\x22\x20from\x20project\x20\x22','\x20changed','28ogkDrC','error','\x20\x20Experimental\x20Artifacts:\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20total','\x22\x20to\x20new\x20project\x20\x22','knowledgeBases','\x20--profile\x20','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','site','\x20new','agents','no_context','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','output','-\x20nothing\x20pushed','hasChanges','Pulling\x20agent\x20\x22','\x20\x20Integration\x20\x22','New\x20project:\x20','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','Cannot\x20clone\x20from\x20context\x20project\x20\x22','\x20files?','\x20resources?','Status:\x20','\x22\x20to\x20\x22','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20project','Agent:\x20','isNew','\x20\x20Text\x20Knowledge\x20Bases:\x20','session','dirname','✔\x20Context\x20set:\x20','\x20files\x20to\x20','\x20\x20Experimental\x20Artifact\x20\x22','dim','\x22:\x20','\x20\x20Prompts:\x20','New\x20project\x20name\x20is\x20required','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','context','Would\x20push\x20agent:\x20','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','agent:push','\x27\x20to\x20create\x20the\x20folder\x20structure.','action','2305359cUZWiD','chatInterfaces','red','reason','Using\x20current\x20project:\x20','yes','agentName','Agent\x20pulled\x20successfully','green','\x20\x20Knowledge\x20Bases:\x20','\x20=\x20','agent','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','errors','integrations','1256nADybI','\x20--name\x20','\x0aChanges\x20to\x20prompt\x20\x27','outputDir','outputPath','New\x20project\x20ID:\x20','cwd','Failed\x20to\x20push\x20agent:\x20','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','prompts','Analyzing\x20changes\x20to\x20push...','push','7950kmWAzp','Cancelled','<new-name>','\x0aError:','updated','pullProject','Clone\x20\x22','Cloning\x20\x22','utf-8','pushProject','\x20|\x20','INVALID_ARGUMENT','\x20\x20tdx\x20agent\x20pull\x20','\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','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','new','llm','\x20errors','1873374JNYcpa','name','Errors:','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','projectId','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','\x0a✔\x20Pushed\x20','description','experimentalArtifacts','Using\x20context\x20project:\x20','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','\x0aPush\x20summary\x20for\x20\x27','Would\x20pull\x20agent:\x20','experimentalKnowledgeBases','\x20\x20Target:\x20','cyan','-\x20no\x20files\x20written','agentId','\x20unchanged','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','5LyuGrq','9793abYLBk','No\x20tdx.json\x20found\x20in\x20','dryRun','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','Project\x20cloned\x20with\x20errors','Chat:\x20','\x20\x20Chat\x20Interface\x20\x22','parse','Using\x20project:\x20','found','message','\x20created','unchanged','log','newProjectId','gray','yellow','\x20\x20Knowledge\x20Base\x20\x22','textKnowledgeBases','\x20\x20Prompt\x20\x22','execute','\x0aChanges\x20to\x20chat\x20interface\x20\x27','created','\x20\x20Chat\x20Interfaces:\x20','llmProject','join','\x20\x20Form\x20Interface\x20\x22','counts','Dry\x20run\x20-\x20no\x20files\x20written','Output:\x20','\x0aPush\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','Project:\x20','sourceProjectName','\x20\x20Integrations:\x20','\x0aChanges:','\x20\x20Agent\x20\x22','\x20\x20Agents:\x20','Pushing\x20agent\x20from\x20\x22','total','cloneProject','formInterfaces','Summary:'];a4_0x3c74=function(){return _0x24876d;};return a4_0x3c74();}const a4_0x1f9977=a4_0x1da7;(function(_0x4abae6,_0x2f5b77){const _0x56fe72=a4_0x1da7,_0x390225=_0x4abae6();while(!![]){try{const _0x39aea8=parseInt(_0x56fe72(0x203))/0x1+parseInt(_0x56fe72(0x209))/0x2+parseInt(_0x56fe72(0x1fd))/0x3*(-parseInt(_0x56fe72(0x216))/0x4)+parseInt(_0x56fe72(0x1c5))/0x5*(parseInt(_0x56fe72(0x1b1))/0x6)+-parseInt(_0x56fe72(0x1c6))/0x7*(parseInt(_0x56fe72(0x193))/0x8)+-parseInt(_0x56fe72(0x184))/0x9+parseInt(_0x56fe72(0x19f))/0xa*(parseInt(_0x56fe72(0x202))/0xb);if(_0x39aea8===_0x2f5b77)break;else _0x390225['push'](_0x390225['shift']());}catch(_0x3d5417){_0x390225['push'](_0x390225['shift']());}}}(a4_0x3c74,0x37738));import a4_0xe874cd from'chalk';import a4_0x5303ac 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 a4_0x1da7(_0x591388,_0x2e62cc){_0x591388=_0x591388-0x16e;const _0x3c74ff=a4_0x3c74();let _0x1da769=_0x3c74ff[_0x591388];return _0x1da769;}function formatCountSummary(_0x482d62){const _0x139628=a4_0x1da7,_0x4cd888=[];if(_0x482d62[_0x139628(0x1ee)]!==undefined)_0x4cd888[_0x139628(0x19e)](_0x482d62[_0x139628(0x1ee)]+_0x139628(0x21a));if(_0x482d62[_0x139628(0x1ae)]!==undefined&&_0x482d62[_0x139628(0x1ae)]>0x0)_0x4cd888[_0x139628(0x19e)](a4_0xe874cd[_0x139628(0x18c)](_0x482d62[_0x139628(0x1ae)]+_0x139628(0x220)));if(_0x482d62[_0x139628(0x1dc)]!==undefined&&_0x482d62['created']>0x0)_0x4cd888[_0x139628(0x19e)](a4_0xe874cd[_0x139628(0x18c)](_0x482d62['created']+_0x139628(0x1d1)));if(_0x482d62[_0x139628(0x1a3)]!==undefined&&_0x482d62[_0x139628(0x1a3)]>0x0)_0x4cd888[_0x139628(0x19e)](a4_0xe874cd['yellow'](_0x482d62[_0x139628(0x1a3)]+'\x20updated'));if(_0x482d62[_0x139628(0x1d2)]!==undefined&&_0x482d62['unchanged']>0x0)_0x4cd888[_0x139628(0x19e)](a4_0xe874cd[_0x139628(0x1d5)](_0x482d62['unchanged']+_0x139628(0x1c3)));if(_0x482d62[_0x139628(0x191)]!==undefined&&_0x482d62[_0x139628(0x191)]>0x0)_0x4cd888[_0x139628(0x19e)](a4_0xe874cd[_0x139628(0x186)](_0x482d62[_0x139628(0x191)]+_0x139628(0x1b0)));return _0x4cd888[_0x139628(0x1df)](',\x20');}function displayDiffs(_0xeadab4,_0x5dbaae,_0x367c63,_0x22e2fc,_0x4c23f4,_0x485707,_0x30f2ad,_0x4b16b6,_0x480b68){const _0x378447=a4_0x1da7;for(const _0x5ec2fc of _0xeadab4){if(_0x5ec2fc['diff']){const _0x271e48=_0x5ec2fc[_0x378447(0x18a)]||_0x5ec2fc['name'];console[_0x378447(0x1d3)](_0x378447(0x1fa)+_0x271e48+'\x27:'),console[_0x378447(0x1d3)]('─'[_0x378447(0x1f2)](0x3c)),console[_0x378447(0x1d3)](_0x5ec2fc['diff']),console[_0x378447(0x1d3)]('─'[_0x378447(0x1f2)](0x3c));}}for(const _0x5df9f6 of _0x5dbaae){_0x5df9f6[_0x378447(0x20d)]&&(console[_0x378447(0x1d3)](_0x378447(0x1b4)+_0x5df9f6['name']+'\x27:'),console[_0x378447(0x1d3)]('─'['repeat'](0x3c)),console[_0x378447(0x1d3)](_0x5df9f6['diff']),console[_0x378447(0x1d3)]('─'[_0x378447(0x1f2)](0x3c)));}for(const _0x2fa77e of _0x367c63){_0x2fa77e[_0x378447(0x20d)]&&(console['log'](_0x378447(0x1c9)+_0x2fa77e[_0x378447(0x1b2)]+'\x27:'),console['log']('─'[_0x378447(0x1f2)](0x3c)),console[_0x378447(0x1d3)](_0x2fa77e[_0x378447(0x20d)]),console[_0x378447(0x1d3)]('─'[_0x378447(0x1f2)](0x3c)));}for(const _0x54acd6 of _0x22e2fc){_0x54acd6[_0x378447(0x20d)]&&(console[_0x378447(0x1d3)](_0x378447(0x195)+_0x54acd6[_0x378447(0x1b2)]+'\x27:'),console[_0x378447(0x1d3)]('─'[_0x378447(0x1f2)](0x3c)),console['log'](_0x54acd6['diff']),console[_0x378447(0x1d3)]('─'[_0x378447(0x1f2)](0x3c)));}for(const _0x527bae of _0x4c23f4){_0x527bae[_0x378447(0x20d)]&&(console[_0x378447(0x1d3)](_0x378447(0x208)+_0x527bae[_0x378447(0x1b2)]+'\x27:'),console[_0x378447(0x1d3)]('─'[_0x378447(0x1f2)](0x3c)),console[_0x378447(0x1d3)](_0x527bae[_0x378447(0x20d)]),console[_0x378447(0x1d3)]('─'[_0x378447(0x1f2)](0x3c)));}for(const _0x56ba52 of _0x485707){_0x56ba52[_0x378447(0x20d)]&&(console['log'](_0x378447(0x180)+_0x56ba52[_0x378447(0x1b2)]+'\x27:'),console[_0x378447(0x1d3)]('─'[_0x378447(0x1f2)](0x3c)),console[_0x378447(0x1d3)](_0x56ba52[_0x378447(0x20d)]),console[_0x378447(0x1d3)]('─'[_0x378447(0x1f2)](0x3c)));}for(const _0x56c5c3 of _0x30f2ad){_0x56c5c3[_0x378447(0x20d)]&&(console[_0x378447(0x1d3)](_0x378447(0x223)+_0x56c5c3[_0x378447(0x1b2)]+'\x27:'),console[_0x378447(0x1d3)]('─'[_0x378447(0x1f2)](0x3c)),console['log'](_0x56c5c3[_0x378447(0x20d)]),console['log']('─'[_0x378447(0x1f2)](0x3c)));}for(const _0x18b150 of _0x4b16b6){_0x18b150[_0x378447(0x20d)]&&(console[_0x378447(0x1d3)](_0x378447(0x1fb)+_0x18b150[_0x378447(0x1b2)]+'\x27:'),console['log']('─'[_0x378447(0x1f2)](0x3c)),console[_0x378447(0x1d3)](_0x18b150['diff']),console['log']('─'[_0x378447(0x1f2)](0x3c)));}for(const _0x1d097c of _0x480b68){_0x1d097c[_0x378447(0x20d)]&&(console[_0x378447(0x1d3)](_0x378447(0x1db)+_0x1d097c[_0x378447(0x1b2)]+'\x27:'),console[_0x378447(0x1d3)]('─'[_0x378447(0x1f2)](0x3c)),console[_0x378447(0x1d3)](_0x1d097c[_0x378447(0x20d)]),console['log']('─'[_0x378447(0x1f2)](0x3c)));}}export class AgentPullCommand extends BaseCommand{['name']='agent:pull';[a4_0x1f9977(0x1b8)]='Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files';async[a4_0x1f9977(0x1da)](_0x277455){const _0xbefb34=a4_0x1f9977,{options:_0x35a769,args:_0x3171ed,tdx:_0x50558a}=_0x277455,_0x12e282=_0x3171ed[0x0],_0x250ad1=_0x3171ed[0x1],_0x49c83f=_0x35a769[_0xbefb34(0x224)],_0x453e87=_0x35a769['dryRun'],_0x1f5893=_0x35a769['force'],_0x4b3ae9=_0x35a769['yes'],_0x3f98d0=_0x35a769[_0xbefb34(0x1de)],_0x4cf414=_0x35a769[_0xbefb34(0x18f)];let _0x4fed24;if(_0x12e282){const _0x412357=a4_0x5303ac['join'](_0x12e282,'tdx.json');if(existsSync(_0x412357))try{const _0x3ffc98=JSON[_0xbefb34(0x1cd)](readFileSync(_0x412357,_0xbefb34(0x1a7)));_0x3ffc98[_0xbefb34(0x1f5)]&&(_0x4fed24={'llm_project':_0x3ffc98[_0xbefb34(0x1f5)]});}catch{}}const _0x1feb4d=findAgentConfigPath(process[_0xbefb34(0x199)]());let _0xdbf453;if(_0x1feb4d)try{const _0x27483b=JSON[_0xbefb34(0x1cd)](readFileSync(_0x1feb4d,_0xbefb34(0x1a7)));_0x27483b[_0xbefb34(0x1f5)]&&(_0xdbf453={'llm_project':_0x27483b['llm_project']});}catch{}const _0x19bd97=resolveAgentPullArgs({'arg':_0x12e282,'agentNameArg':_0x250ad1,'agentFlag':_0x4cf414,'contextProject':_0x3f98d0,'argDirConfig':_0x4fed24,'cwdConfigPath':_0x1feb4d||undefined,'cwdConfig':_0xdbf453}),{projectNameOrId:_0x2528ab,targetAgentName:_0x4255e6,existingOutputDir:_0x39615b,source:_0x1a10e5}=_0x19bd97;if(_0x1a10e5===_0xbefb34(0x1f7))console[_0xbefb34(0x1d3)](a4_0xe874cd[_0xbefb34(0x179)](_0xbefb34(0x1f6)+a4_0x5303ac[_0xbefb34(0x1df)](_0x12e282,_0xbefb34(0x205))+':\x20'+_0x2528ab));else{if(_0x1a10e5==='cwd-config')console[_0xbefb34(0x1d3)](a4_0xe874cd[_0xbefb34(0x179)]('Using\x20project:\x20'+_0x2528ab));else _0x1a10e5==='context'&&console[_0xbefb34(0x1d3)](a4_0xe874cd[_0xbefb34(0x179)](_0xbefb34(0x1fe)+_0x2528ab));}if(!_0x2528ab)return _0x4cf414?(console['log'](a4_0xe874cd[_0xbefb34(0x1d6)](_0xbefb34(0x1b6))),console[_0xbefb34(0x1d3)](_0xbefb34(0x22a)),console[_0xbefb34(0x1d3)](_0xbefb34(0x1bb))):(console[_0xbefb34(0x1d3)](a4_0xe874cd[_0xbefb34(0x1d6)](_0xbefb34(0x19b))),console[_0xbefb34(0x1d3)]('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[_0xbefb34(0x1d3)](_0xbefb34(0x1e5)),console[_0xbefb34(0x1d3)](_0xbefb34(0x20c)),console[_0xbefb34(0x1d3)](_0xbefb34(0x1ac)),console[_0xbefb34(0x1d3)](_0xbefb34(0x170))),0x1;if(_0x4255e6){const {data:_0xdb5fa0}=await withSpinner(_0xbefb34(0x227)+_0x4255e6+_0xbefb34(0x214)+_0x2528ab+_0xbefb34(0x204),()=>_0x50558a[_0xbefb34(0x1af)]['pullAgent'](_0x2528ab,_0x4255e6,_0x49c83f,{'dryRun':_0x453e87,'force':_0x1f5893}));if(_0x453e87)return console[_0xbefb34(0x1d3)](a4_0xe874cd[_0xbefb34(0x1d6)](_0xbefb34(0x1e2))),console[_0xbefb34(0x1d3)](_0xbefb34(0x1bd)+_0xdb5fa0['agentName']),console['log']('Output\x20path:\x20'+_0xdb5fa0[_0xbefb34(0x197)]),_0xdb5fa0[_0xbefb34(0x20d)]&&(console[_0xbefb34(0x1d3)](_0xbefb34(0x1ea)),console[_0xbefb34(0x1d3)]('─'[_0xbefb34(0x1f2)](0x3c)),console[_0xbefb34(0x1d3)](_0xdb5fa0[_0xbefb34(0x20d)]),console[_0xbefb34(0x1d3)]('─'[_0xbefb34(0x1f2)](0x3c))),0x0;return console[_0xbefb34(0x1d3)](a4_0xe874cd['green'](_0xbefb34(0x18b))),console['log']('Agent:\x20'+_0xdb5fa0[_0xbefb34(0x18a)]),console[_0xbefb34(0x1d3)](_0xbefb34(0x1e3)+_0xdb5fa0['outputPath']),console[_0xbefb34(0x1d3)](_0xbefb34(0x16e)+(_0xdb5fa0[_0xbefb34(0x172)]?a4_0xe874cd[_0xbefb34(0x18c)](_0xbefb34(0x1ae)):_0xdb5fa0[_0xbefb34(0x226)]?a4_0xe874cd['yellow'](_0xbefb34(0x1a3)):a4_0xe874cd[_0xbefb34(0x1d5)]('unchanged'))),0x0;}const _0x3cc875=_0x39615b||_0x49c83f,{data:_0x4ebf7b}=await withSpinner(_0xbefb34(0x1f3)+_0x2528ab+_0xbefb34(0x204),()=>_0x50558a[_0xbefb34(0x1af)][_0xbefb34(0x1a4)](_0x2528ab,_0x3cc875,{'dryRun':!![]})),_0x19ecda=_0x4ebf7b[_0xbefb34(0x1e1)][_0xbefb34(0x221)]['new']+_0x4ebf7b[_0xbefb34(0x1e1)][_0xbefb34(0x21c)][_0xbefb34(0x1ae)]+_0x4ebf7b[_0xbefb34(0x1e1)][_0xbefb34(0x1d8)][_0xbefb34(0x1ae)]+_0x4ebf7b[_0xbefb34(0x1e1)][_0xbefb34(0x19c)][_0xbefb34(0x1ae)]+_0x4ebf7b[_0xbefb34(0x1e1)][_0xbefb34(0x192)][_0xbefb34(0x1ae)]+_0x4ebf7b[_0xbefb34(0x1e1)]['experimentalKnowledgeBases'][_0xbefb34(0x1ae)]+_0x4ebf7b[_0xbefb34(0x1e1)][_0xbefb34(0x1b9)][_0xbefb34(0x1ae)]+_0x4ebf7b['counts'][_0xbefb34(0x1f0)][_0xbefb34(0x1ae)]+_0x4ebf7b[_0xbefb34(0x1e1)]['chatInterfaces'][_0xbefb34(0x1ae)],_0x409d82=_0x4ebf7b[_0xbefb34(0x1e1)]['agents'][_0xbefb34(0x1a3)]+_0x4ebf7b[_0xbefb34(0x1e1)][_0xbefb34(0x21c)][_0xbefb34(0x1a3)]+_0x4ebf7b[_0xbefb34(0x1e1)]['textKnowledgeBases'][_0xbefb34(0x1a3)]+_0x4ebf7b[_0xbefb34(0x1e1)][_0xbefb34(0x19c)][_0xbefb34(0x1a3)]+_0x4ebf7b['counts']['integrations'][_0xbefb34(0x1a3)]+_0x4ebf7b[_0xbefb34(0x1e1)][_0xbefb34(0x1be)][_0xbefb34(0x1a3)]+_0x4ebf7b[_0xbefb34(0x1e1)]['experimentalArtifacts'][_0xbefb34(0x1a3)]+_0x4ebf7b[_0xbefb34(0x1e1)][_0xbefb34(0x1f0)][_0xbefb34(0x1a3)]+_0x4ebf7b[_0xbefb34(0x1e1)][_0xbefb34(0x185)][_0xbefb34(0x1a3)],_0x1b841a=_0x4ebf7b[_0xbefb34(0x1e1)]['agents'][_0xbefb34(0x1d2)]+_0x4ebf7b[_0xbefb34(0x1e1)][_0xbefb34(0x21c)][_0xbefb34(0x1d2)]+_0x4ebf7b[_0xbefb34(0x1e1)][_0xbefb34(0x1d8)][_0xbefb34(0x1d2)]+_0x4ebf7b[_0xbefb34(0x1e1)]['prompts']['unchanged']+_0x4ebf7b[_0xbefb34(0x1e1)][_0xbefb34(0x192)]['unchanged']+_0x4ebf7b[_0xbefb34(0x1e1)][_0xbefb34(0x1be)][_0xbefb34(0x1d2)]+_0x4ebf7b[_0xbefb34(0x1e1)][_0xbefb34(0x1b9)]['unchanged']+_0x4ebf7b[_0xbefb34(0x1e1)][_0xbefb34(0x1f0)]['unchanged']+_0x4ebf7b[_0xbefb34(0x1e1)]['chatInterfaces'][_0xbefb34(0x1d2)];console[_0xbefb34(0x1d3)]('\x0aPull\x20summary\x20for\x20\x27'+_0x4ebf7b[_0xbefb34(0x1f9)]+'\x27:'),console[_0xbefb34(0x1d3)]('\x20\x20'+a4_0xe874cd[_0xbefb34(0x18c)]('+\x20'+_0x19ecda+_0xbefb34(0x220))+'\x20|\x20'+a4_0xe874cd[_0xbefb34(0x1d6)]('~\x20'+_0x409d82+_0xbefb34(0x215))+_0xbefb34(0x1a9)+a4_0xe874cd['dim']('=\x20'+_0x1b841a+_0xbefb34(0x1c3))),console['log'](_0xbefb34(0x1ec)+formatCountSummary(_0x4ebf7b[_0xbefb34(0x1e1)][_0xbefb34(0x221)])),console[_0xbefb34(0x1d3)](_0xbefb34(0x18d)+formatCountSummary(_0x4ebf7b[_0xbefb34(0x1e1)][_0xbefb34(0x21c)])),console[_0xbefb34(0x1d3)](_0xbefb34(0x173)+formatCountSummary(_0x4ebf7b[_0xbefb34(0x1e1)][_0xbefb34(0x1d8)])),console[_0xbefb34(0x1d3)](_0xbefb34(0x17b)+formatCountSummary(_0x4ebf7b[_0xbefb34(0x1e1)]['prompts'])),console[_0xbefb34(0x1d3)](_0xbefb34(0x1e9)+formatCountSummary(_0x4ebf7b[_0xbefb34(0x1e1)]['integrations'])),console[_0xbefb34(0x1d3)]('\x20\x20Form\x20Interfaces:\x20'+formatCountSummary(_0x4ebf7b[_0xbefb34(0x1e1)]['formInterfaces'])),console[_0xbefb34(0x1d3)](_0xbefb34(0x1dd)+formatCountSummary(_0x4ebf7b[_0xbefb34(0x1e1)]['chatInterfaces']));const _0x29d042=_0x4ebf7b[_0xbefb34(0x1e1)][_0xbefb34(0x1be)][_0xbefb34(0x1ee)]>0x0||_0x4ebf7b['counts'][_0xbefb34(0x1b9)][_0xbefb34(0x1ee)]>0x0;_0x29d042&&(console[_0xbefb34(0x1d3)](_0xbefb34(0x206)+formatCountSummary(_0x4ebf7b[_0xbefb34(0x1e1)][_0xbefb34(0x1be)])),console[_0xbefb34(0x1d3)](_0xbefb34(0x218)+formatCountSummary(_0x4ebf7b[_0xbefb34(0x1e1)][_0xbefb34(0x1b9)])));console['log'](_0xbefb34(0x1bf)+a4_0xe874cd[_0xbefb34(0x1c0)](_0x4ebf7b['outputDir'])),displayDiffs(_0x4ebf7b['agents'],_0x4ebf7b['knowledgeBases'],_0x4ebf7b['textKnowledgeBases'],_0x4ebf7b[_0xbefb34(0x19c)],_0x4ebf7b[_0xbefb34(0x192)],_0x4ebf7b[_0xbefb34(0x1be)],_0x4ebf7b[_0xbefb34(0x1b9)],_0x4ebf7b[_0xbefb34(0x1f0)],_0x4ebf7b[_0xbefb34(0x185)]);if(_0x453e87)return console['log'](a4_0xe874cd[_0xbefb34(0x1d6)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x19ecda===0x0&&_0x409d82===0x0)return console['log'](a4_0xe874cd['green'](_0xbefb34(0x17d))),saveSessionContext({'llm_project':_0x4ebf7b[_0xbefb34(0x1f9)]},_0x35a769[_0xbefb34(0x174)]),console['log'](a4_0xe874cd[_0xbefb34(0x18c)](_0xbefb34(0x176)+a4_0xe874cd[_0xbefb34(0x179)](_0xbefb34(0x1f5))+_0xbefb34(0x18e)+a4_0xe874cd[_0xbefb34(0x1c0)](_0x4ebf7b['projectName']))),0x0;if(!_0x4b3ae9&&!_0x1f5893){if(!isInteractive())return console['error'](a4_0xe874cd[_0xbefb34(0x186)](_0xbefb34(0x1a2)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0xbefb34(0x217)](a4_0xe874cd[_0xbefb34(0x179)](_0xbefb34(0x219))),0x1;const _0x175d70=await confirmKey('\x0aWrite\x20'+(_0x19ecda+_0x409d82)+_0xbefb34(0x22d));if(!_0x175d70)return console[_0xbefb34(0x1d3)](a4_0xe874cd[_0xbefb34(0x1d6)](_0xbefb34(0x1a0)),_0xbefb34(0x1c1)),0x1;}const {data:_0x4b8b3c}=await withSpinner('Writing\x20files...',()=>_0x50558a[_0xbefb34(0x1af)][_0xbefb34(0x1a4)](_0x2528ab,_0x3cc875,{'force':_0x1f5893}));return console[_0xbefb34(0x1d3)](a4_0xe874cd['green'](_0xbefb34(0x1f4)+(_0x19ecda+_0x409d82)+_0xbefb34(0x177)+_0x4b8b3c[_0xbefb34(0x196)])),saveSessionContext({'llm_project':_0x4b8b3c['projectName']},_0x35a769[_0xbefb34(0x174)]),console[_0xbefb34(0x1d3)](a4_0xe874cd[_0xbefb34(0x18c)](_0xbefb34(0x176)+a4_0xe874cd[_0xbefb34(0x179)](_0xbefb34(0x1f5))+_0xbefb34(0x18e)+a4_0xe874cd[_0xbefb34(0x1c0)](_0x4b8b3c[_0xbefb34(0x1f9)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x1f9977(0x1b2)]='agent:clone';['description']=a4_0x1f9977(0x201);async[a4_0x1f9977(0x1da)](_0x2d5766){const _0x2749d3=a4_0x1f9977,{options:_0x59bcba,args:_0x107ad7,tdx:_0x507f21}=_0x2d5766,_0x37e216=_0x107ad7[0x0],_0x115380=_0x59bcba['name'],_0xff63a3=_0x59bcba[_0x2749d3(0x1c8)],_0x2bc007=_0x59bcba['yes'],_0x352ce0=_0x59bcba['site'],_0x47c62c=_0x59bcba[_0x2749d3(0x1de)];let _0x240d4b;const _0x4b0893=findAgentConfigPath(process['cwd']());if(_0x37e216){const _0x4a212b=a4_0x5303ac[_0x2749d3(0x1df)](_0x37e216,'tdx.json');existsSync(_0x4a212b)?(_0x240d4b=_0x37e216,console['log'](a4_0xe874cd[_0x2749d3(0x179)](_0x2749d3(0x211)+_0x37e216))):_0x240d4b=_0x37e216;}else{if(_0x4b0893)_0x240d4b=a4_0x5303ac[_0x2749d3(0x175)](_0x4b0893),console['log'](a4_0xe874cd[_0x2749d3(0x179)](_0x2749d3(0x188)+_0x240d4b));else{if(_0x47c62c){const _0x4b24fb=sanitizeForFilesystem(_0x47c62c);let _0x164a08=_0x4b24fb,_0x7e7093=a4_0x5303ac[_0x2749d3(0x1df)](process[_0x2749d3(0x199)](),_0x2749d3(0x221),_0x4b24fb,_0x2749d3(0x205));if(!existsSync(_0x7e7093)){const _0x56eb2d=normalizeName(_0x47c62c),_0x57931a=a4_0x5303ac['join'](process[_0x2749d3(0x199)](),_0x2749d3(0x221),_0x56eb2d,_0x2749d3(0x205));existsSync(_0x57931a)&&(_0x164a08=_0x56eb2d,_0x7e7093=_0x57931a);}if(existsSync(_0x7e7093))_0x240d4b=a4_0x5303ac[_0x2749d3(0x175)](_0x7e7093),console['log'](a4_0xe874cd[_0x2749d3(0x179)](_0x2749d3(0x211)+_0x240d4b));else{const _0x50edbd=_0x59bcba[_0x2749d3(0x207)];if(_0x50edbd)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x2749d3(0x22c)+_0x47c62c+'\x22\x20to\x20a\x20different\x20profile',undefined,{'helpText':_0x2749d3(0x22b)+_0x2749d3(0x1ad)+(_0x2749d3(0x1ab)+_0x47c62c+'\x0a')+('\x20\x20tdx\x20agent\x20clone\x20agents/'+_0x164a08+_0x2749d3(0x194)+(_0x115380||_0x2749d3(0x1a1))+_0x2749d3(0x21d)+_0x50edbd)});_0x240d4b=_0x47c62c,console[_0x2749d3(0x1d3)](a4_0xe874cd[_0x2749d3(0x179)](_0x2749d3(0x1ba)+_0x47c62c));}}}}if(!_0x240d4b)return console[_0x2749d3(0x1d3)](a4_0xe874cd[_0x2749d3(0x1d6)]('No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a')),console[_0x2749d3(0x1d3)](_0x2749d3(0x1e6)),console['log'](_0x2749d3(0x190)),console[_0x2749d3(0x1d3)](_0x2749d3(0x20a)),console[_0x2749d3(0x1d3)]('\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>'),0x1;if(!_0x115380)throw new SDKError(ErrorCode[_0x2749d3(0x20e)],_0x2749d3(0x17c),undefined,{'helpText':'Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>'});if(!_0x2bc007&&!_0xff63a3){if(!isInteractive())return console[_0x2749d3(0x217)](a4_0xe874cd['red'](_0x2749d3(0x1a2)),_0x2749d3(0x210)),console[_0x2749d3(0x217)](a4_0xe874cd[_0x2749d3(0x179)](_0x2749d3(0x219))),0x1;const _0x14c5d6=await confirmKey(_0x2749d3(0x1a5)+_0x240d4b+_0x2749d3(0x21b)+_0x115380+'\x22?');if(!_0x14c5d6)return console[_0x2749d3(0x1d3)](a4_0xe874cd[_0x2749d3(0x1d6)](_0x2749d3(0x1a0))),0x1;}const {data:_0x1a4c17}=await withSpinner(_0x2749d3(0x1a6)+_0x240d4b+_0x2749d3(0x16f)+_0x115380+_0x2749d3(0x204),()=>_0x507f21[_0x2749d3(0x1af)][_0x2749d3(0x1ef)](_0x240d4b,_0x115380,{'dryRun':_0xff63a3}));if(_0xff63a3){console[_0x2749d3(0x1d3)](a4_0xe874cd[_0x2749d3(0x1d6)](_0x2749d3(0x200))),console[_0x2749d3(0x1d3)](_0x2749d3(0x1fc)+_0x1a4c17[_0x2749d3(0x1e8)]),console[_0x2749d3(0x1d3)](_0x2749d3(0x229)+_0x115380),console[_0x2749d3(0x1d3)]('Would\x20clone:'),console[_0x2749d3(0x1d3)](_0x2749d3(0x1ec)+_0x1a4c17[_0x2749d3(0x1e1)][_0x2749d3(0x221)]['created']),console['log'](_0x2749d3(0x18d)+_0x1a4c17['counts'][_0x2749d3(0x21c)][_0x2749d3(0x1dc)]),console[_0x2749d3(0x1d3)](_0x2749d3(0x17b)+_0x1a4c17['counts'][_0x2749d3(0x19c)][_0x2749d3(0x1dc)]),console['log'](_0x2749d3(0x20b)+_0x1a4c17[_0x2749d3(0x1e1)][_0x2749d3(0x1f0)][_0x2749d3(0x1dc)]),console[_0x2749d3(0x1d3)](_0x2749d3(0x1dd)+_0x1a4c17[_0x2749d3(0x1e1)][_0x2749d3(0x185)][_0x2749d3(0x1dc)]);const _0x4dbc8f=_0x1a4c17['counts'][_0x2749d3(0x1be)][_0x2749d3(0x1dc)]>0x0||_0x1a4c17['counts'][_0x2749d3(0x1b9)][_0x2749d3(0x1dc)]>0x0;return _0x4dbc8f&&(console[_0x2749d3(0x1d3)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+_0x1a4c17[_0x2749d3(0x1e1)]['experimentalKnowledgeBases'][_0x2749d3(0x1dc)]),console['log'](_0x2749d3(0x218)+_0x1a4c17[_0x2749d3(0x1e1)][_0x2749d3(0x1b9)][_0x2749d3(0x1dc)])),0x0;}const _0x23594e=_0x1a4c17[_0x2749d3(0x1e1)][_0x2749d3(0x221)][_0x2749d3(0x191)]>0x0||_0x1a4c17['counts'][_0x2749d3(0x21c)][_0x2749d3(0x191)]>0x0||_0x1a4c17['counts'][_0x2749d3(0x19c)]['errors']>0x0||_0x1a4c17[_0x2749d3(0x1e1)][_0x2749d3(0x1f0)][_0x2749d3(0x191)]>0x0||_0x1a4c17['counts'][_0x2749d3(0x185)][_0x2749d3(0x191)]>0x0||_0x1a4c17['counts']['experimentalKnowledgeBases'][_0x2749d3(0x191)]>0x0||_0x1a4c17[_0x2749d3(0x1e1)][_0x2749d3(0x1b9)][_0x2749d3(0x191)]>0x0;_0x23594e?console[_0x2749d3(0x1d3)](a4_0xe874cd[_0x2749d3(0x1d6)](_0x2749d3(0x1ca))):console[_0x2749d3(0x1d3)](a4_0xe874cd[_0x2749d3(0x18c)]('Project\x20cloned\x20successfully'));console[_0x2749d3(0x1d3)](_0x2749d3(0x1fc)+_0x1a4c17[_0x2749d3(0x1e8)]),console[_0x2749d3(0x1d3)]('New\x20project:\x20'+_0x1a4c17['newProjectName']),console[_0x2749d3(0x1d3)](_0x2749d3(0x198)+_0x1a4c17[_0x2749d3(0x1d4)]),console[_0x2749d3(0x1d3)](),console[_0x2749d3(0x1d3)](_0x2749d3(0x1f1)),console['log'](_0x2749d3(0x1ec)+formatCountSummary(_0x1a4c17[_0x2749d3(0x1e1)][_0x2749d3(0x221)])),console[_0x2749d3(0x1d3)](_0x2749d3(0x18d)+formatCountSummary(_0x1a4c17[_0x2749d3(0x1e1)]['knowledgeBases'])),console[_0x2749d3(0x1d3)](_0x2749d3(0x17b)+formatCountSummary(_0x1a4c17[_0x2749d3(0x1e1)][_0x2749d3(0x19c)])),console[_0x2749d3(0x1d3)](_0x2749d3(0x1e9)+formatCountSummary(_0x1a4c17[_0x2749d3(0x1e1)][_0x2749d3(0x192)])),console[_0x2749d3(0x1d3)]('\x20\x20Form\x20Interfaces:\x20'+formatCountSummary(_0x1a4c17['counts'][_0x2749d3(0x1f0)])),console[_0x2749d3(0x1d3)](_0x2749d3(0x1dd)+formatCountSummary(_0x1a4c17[_0x2749d3(0x1e1)][_0x2749d3(0x185)]));const _0x406ce2=_0x1a4c17['counts'][_0x2749d3(0x1be)][_0x2749d3(0x1dc)]>0x0||_0x1a4c17['counts'][_0x2749d3(0x1be)]['updated']>0x0||_0x1a4c17[_0x2749d3(0x1e1)][_0x2749d3(0x1be)]['unchanged']>0x0||_0x1a4c17[_0x2749d3(0x1e1)][_0x2749d3(0x1b9)][_0x2749d3(0x1dc)]>0x0||_0x1a4c17[_0x2749d3(0x1e1)]['experimentalArtifacts']['updated']>0x0||_0x1a4c17['counts']['experimentalArtifacts'][_0x2749d3(0x1d2)]>0x0;_0x406ce2&&(console[_0x2749d3(0x1d3)](_0x2749d3(0x206)+formatCountSummary(_0x1a4c17['counts'][_0x2749d3(0x1be)])),console[_0x2749d3(0x1d3)](_0x2749d3(0x218)+formatCountSummary(_0x1a4c17[_0x2749d3(0x1e1)][_0x2749d3(0x1b9)])));if(_0x23594e){console[_0x2749d3(0x1d3)](),console['log'](a4_0xe874cd[_0x2749d3(0x186)](_0x2749d3(0x1b3)));for(const _0x27d3cb of _0x1a4c17[_0x2749d3(0x221)]){_0x27d3cb[_0x2749d3(0x183)]===_0x2749d3(0x217)&&console[_0x2749d3(0x1d3)](a4_0xe874cd[_0x2749d3(0x186)]('\x20\x20Agent\x20\x22'+_0x27d3cb[_0x2749d3(0x18a)]+_0x2749d3(0x17a)+_0x27d3cb[_0x2749d3(0x217)]));}for(const _0x2b9563 of _0x1a4c17[_0x2749d3(0x21c)]){_0x2b9563[_0x2749d3(0x183)]==='error'&&console[_0x2749d3(0x1d3)](a4_0xe874cd['red']('\x20\x20Knowledge\x20Base\x20\x22'+_0x2b9563[_0x2749d3(0x1b2)]+_0x2749d3(0x17a)+_0x2b9563[_0x2749d3(0x217)]));}for(const _0x31be05 of _0x1a4c17[_0x2749d3(0x19c)]){_0x31be05[_0x2749d3(0x183)]===_0x2749d3(0x217)&&console['log'](a4_0xe874cd[_0x2749d3(0x186)]('\x20\x20Prompt\x20\x22'+_0x31be05[_0x2749d3(0x1b2)]+_0x2749d3(0x17a)+_0x31be05[_0x2749d3(0x217)]));}for(const _0x1d241d of _0x1a4c17[_0x2749d3(0x192)]){_0x1d241d[_0x2749d3(0x183)]===_0x2749d3(0x217)&&console[_0x2749d3(0x1d3)](a4_0xe874cd[_0x2749d3(0x186)]('\x20\x20Integration\x20\x22'+_0x1d241d[_0x2749d3(0x1b2)]+'\x22:\x20'+_0x1d241d['error']));}for(const _0x3f7266 of _0x1a4c17[_0x2749d3(0x1f0)]){_0x3f7266[_0x2749d3(0x183)]===_0x2749d3(0x217)&&console['log'](a4_0xe874cd[_0x2749d3(0x186)]('\x20\x20Form\x20Interface\x20\x22'+_0x3f7266['name']+_0x2749d3(0x17a)+_0x3f7266[_0x2749d3(0x217)]));}for(const _0xb53fc9 of _0x1a4c17[_0x2749d3(0x185)]){_0xb53fc9[_0x2749d3(0x183)]===_0x2749d3(0x217)&&console['log'](a4_0xe874cd['red'](_0x2749d3(0x1cc)+_0xb53fc9['name']+_0x2749d3(0x17a)+_0xb53fc9[_0x2749d3(0x217)]));}for(const _0x4f9ce8 of _0x1a4c17[_0x2749d3(0x1be)]){_0x4f9ce8[_0x2749d3(0x183)]===_0x2749d3(0x217)&&console[_0x2749d3(0x1d3)](a4_0xe874cd['red']('\x20\x20Experimental\x20Knowledge\x20Base\x20\x22'+_0x4f9ce8[_0x2749d3(0x1b2)]+_0x2749d3(0x17a)+_0x4f9ce8[_0x2749d3(0x217)]));}for(const _0x10653e of _0x1a4c17[_0x2749d3(0x1b9)]){_0x10653e[_0x2749d3(0x183)]===_0x2749d3(0x217)&&console[_0x2749d3(0x1d3)](a4_0xe874cd[_0x2749d3(0x186)](_0x2749d3(0x178)+_0x10653e['name']+_0x2749d3(0x17a)+_0x10653e[_0x2749d3(0x217)]));}return 0x1;}console[_0x2749d3(0x1d3)]();const _0x1f7951=getLLMProjectUrl(_0x352ce0,_0x1a4c17[_0x2749d3(0x1d4)]);return console[_0x2749d3(0x1d3)](_0x2749d3(0x1e7)+a4_0xe874cd[_0x2749d3(0x1c0)](_0x1f7951)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x1f9977(0x1b2)]=a4_0x1f9977(0x181);[a4_0x1f9977(0x1b8)]=a4_0x1f9977(0x1c4);async['execute'](_0x426e26){const _0x2dcf7b=a4_0x1f9977,{options:_0x2c962e,args:_0x543da4,tdx:_0x2d61cf}=_0x426e26;let _0x2c02e4=_0x543da4[0x0]||process[_0x2dcf7b(0x199)]();const _0x406e80=_0x2c962e[_0x2dcf7b(0x1c8)],_0x3126de=_0x2c962e['force'],_0x46fd42=_0x2c962e[_0x2dcf7b(0x189)],_0x660154=_0x2c962e[_0x2dcf7b(0x21f)],_0x25df65=a4_0x5303ac[_0x2dcf7b(0x1df)](_0x2c02e4,'agent.yml'),_0x38bf14=existsSync(_0x25df65);if(_0x38bf14){const {data:_0x33529f}=await withSpinner(_0x2dcf7b(0x1ed)+_0x2c02e4+_0x2dcf7b(0x204),()=>_0x2d61cf[_0x2dcf7b(0x1af)]['pushAgent'](_0x2c02e4,{'dryRun':_0x406e80,'force':_0x3126de}));if(_0x406e80)return console[_0x2dcf7b(0x1d3)](a4_0xe874cd['yellow']('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x2dcf7b(0x1d3)](_0x2dcf7b(0x17f)+_0x33529f['agentName']),0x0;if(_0x33529f[_0x2dcf7b(0x183)]===_0x2dcf7b(0x217))return console[_0x2dcf7b(0x1d3)](a4_0xe874cd[_0x2dcf7b(0x186)](_0x2dcf7b(0x19a)+_0x33529f[_0x2dcf7b(0x217)])),0x1;console['log'](a4_0xe874cd[_0x2dcf7b(0x18c)]('Agent\x20'+_0x33529f['action']+'\x20successfully')),console['log'](_0x2dcf7b(0x171)+_0x33529f[_0x2dcf7b(0x18a)]);if(_0x33529f['agentId']&&_0x33529f[_0x2dcf7b(0x1b5)]){const _0x56ba53=getLLMAgentChatUrl(_0x660154,_0x33529f[_0x2dcf7b(0x1b5)],_0x33529f[_0x2dcf7b(0x1c2)]);console[_0x2dcf7b(0x1d3)](_0x2dcf7b(0x1cb)+a4_0xe874cd[_0x2dcf7b(0x1c0)](_0x56ba53));}return 0x0;}const _0x2f9a3d=_0x2c962e[_0x2dcf7b(0x1de)],_0x1e385a=resolveProjectFromContext(_0x2c02e4,_0x2f9a3d);if(_0x1e385a[_0x2dcf7b(0x1cf)])_0x2c02e4=_0x1e385a['projectDir'],_0x1e385a['source']===_0x2dcf7b(0x17e)&&console[_0x2dcf7b(0x1d3)](a4_0xe874cd['dim'](_0x2dcf7b(0x1ce)+_0x2c02e4));else{let _0x1f20e7=_0x2dcf7b(0x1ff);_0x1e385a[_0x2dcf7b(0x187)]===_0x2dcf7b(0x213)&&(_0x1f20e7=_0x1e385a[_0x2dcf7b(0x1d0)]+'\x0aRun\x20\x27tdx\x20agent\x20pull\x20'+_0x1e385a['llmProject']+_0x2dcf7b(0x182));throw new SDKError(ErrorCode[_0x2dcf7b(0x1aa)],_0x1e385a[_0x2dcf7b(0x187)]===_0x2dcf7b(0x222)?_0x1e385a[_0x2dcf7b(0x1d0)]:_0x2dcf7b(0x1c7)+_0x2c02e4,undefined,{'helpText':_0x1f20e7});}const {data:_0x22df4a}=await withSpinner(_0x2dcf7b(0x19d),()=>_0x2d61cf[_0x2dcf7b(0x1af)][_0x2dcf7b(0x1a8)](_0x2c02e4,{'dryRun':!![]})),_0x47a766=_0x22df4a[_0x2dcf7b(0x1e1)]['agents'][_0x2dcf7b(0x191)]>0x0;if(_0x47a766){console['log'](a4_0xe874cd[_0x2dcf7b(0x186)]('\x0aErrors\x20found:'));for(const _0x518c52 of _0x22df4a[_0x2dcf7b(0x221)]){_0x518c52['action']==='error'&&console[_0x2dcf7b(0x1d3)](a4_0xe874cd[_0x2dcf7b(0x186)](_0x2dcf7b(0x1eb)+_0x518c52['agentName']+_0x2dcf7b(0x17a)+_0x518c52[_0x2dcf7b(0x217)]));}return 0x1;}const _0x3afc27=_0x22df4a[_0x2dcf7b(0x1e1)][_0x2dcf7b(0x221)]['created']+_0x22df4a[_0x2dcf7b(0x1e1)][_0x2dcf7b(0x21c)][_0x2dcf7b(0x1dc)]+_0x22df4a[_0x2dcf7b(0x1e1)][_0x2dcf7b(0x1d8)][_0x2dcf7b(0x1dc)]+_0x22df4a[_0x2dcf7b(0x1e1)]['prompts'][_0x2dcf7b(0x1dc)]+_0x22df4a[_0x2dcf7b(0x1e1)][_0x2dcf7b(0x192)][_0x2dcf7b(0x1dc)]+_0x22df4a[_0x2dcf7b(0x1e1)][_0x2dcf7b(0x1be)][_0x2dcf7b(0x1dc)]+_0x22df4a['counts']['experimentalArtifacts'][_0x2dcf7b(0x1dc)]+_0x22df4a[_0x2dcf7b(0x1e1)][_0x2dcf7b(0x1f0)][_0x2dcf7b(0x1dc)]+_0x22df4a['counts']['chatInterfaces']['created'],_0x119bd2=_0x22df4a[_0x2dcf7b(0x1e1)][_0x2dcf7b(0x221)][_0x2dcf7b(0x1a3)]+_0x22df4a[_0x2dcf7b(0x1e1)][_0x2dcf7b(0x21c)][_0x2dcf7b(0x1a3)]+_0x22df4a[_0x2dcf7b(0x1e1)][_0x2dcf7b(0x1d8)][_0x2dcf7b(0x1a3)]+_0x22df4a[_0x2dcf7b(0x1e1)]['prompts'][_0x2dcf7b(0x1a3)]+_0x22df4a['counts'][_0x2dcf7b(0x192)][_0x2dcf7b(0x1a3)]+_0x22df4a[_0x2dcf7b(0x1e1)][_0x2dcf7b(0x1be)][_0x2dcf7b(0x1a3)]+_0x22df4a['counts'][_0x2dcf7b(0x1b9)][_0x2dcf7b(0x1a3)]+_0x22df4a[_0x2dcf7b(0x1e1)]['formInterfaces'][_0x2dcf7b(0x1a3)]+_0x22df4a[_0x2dcf7b(0x1e1)][_0x2dcf7b(0x185)][_0x2dcf7b(0x1a3)],_0x1ce19e=_0x22df4a[_0x2dcf7b(0x1e1)]['agents']['unchanged']+_0x22df4a[_0x2dcf7b(0x1e1)][_0x2dcf7b(0x21c)][_0x2dcf7b(0x1d2)]+_0x22df4a[_0x2dcf7b(0x1e1)][_0x2dcf7b(0x1d8)]['unchanged']+_0x22df4a[_0x2dcf7b(0x1e1)]['prompts'][_0x2dcf7b(0x1d2)]+_0x22df4a[_0x2dcf7b(0x1e1)][_0x2dcf7b(0x192)]['unchanged']+_0x22df4a[_0x2dcf7b(0x1e1)][_0x2dcf7b(0x1be)]['unchanged']+_0x22df4a[_0x2dcf7b(0x1e1)]['experimentalArtifacts'][_0x2dcf7b(0x1d2)]+_0x22df4a['counts']['formInterfaces'][_0x2dcf7b(0x1d2)]+_0x22df4a[_0x2dcf7b(0x1e1)][_0x2dcf7b(0x185)][_0x2dcf7b(0x1d2)];console[_0x2dcf7b(0x1d3)](_0x2dcf7b(0x1bc)+_0x22df4a[_0x2dcf7b(0x1f9)]+'\x27:'),console[_0x2dcf7b(0x1d3)]('\x20\x20'+a4_0xe874cd[_0x2dcf7b(0x18c)]('+\x20'+_0x3afc27+_0x2dcf7b(0x220))+_0x2dcf7b(0x1a9)+a4_0xe874cd['yellow']('~\x20'+_0x119bd2+_0x2dcf7b(0x215))+_0x2dcf7b(0x1a9)+a4_0xe874cd[_0x2dcf7b(0x179)]('=\x20'+_0x1ce19e+_0x2dcf7b(0x1c3))),console[_0x2dcf7b(0x1d3)](_0x2dcf7b(0x1ec)+formatCountSummary(_0x22df4a[_0x2dcf7b(0x1e1)][_0x2dcf7b(0x221)])),console[_0x2dcf7b(0x1d3)](_0x2dcf7b(0x18d)+formatCountSummary(_0x22df4a[_0x2dcf7b(0x1e1)][_0x2dcf7b(0x21c)])),console[_0x2dcf7b(0x1d3)](_0x2dcf7b(0x173)+formatCountSummary(_0x22df4a[_0x2dcf7b(0x1e1)][_0x2dcf7b(0x1d8)])),console[_0x2dcf7b(0x1d3)](_0x2dcf7b(0x17b)+formatCountSummary(_0x22df4a[_0x2dcf7b(0x1e1)]['prompts'])),console[_0x2dcf7b(0x1d3)](_0x2dcf7b(0x1e9)+formatCountSummary(_0x22df4a[_0x2dcf7b(0x1e1)][_0x2dcf7b(0x192)])),console[_0x2dcf7b(0x1d3)](_0x2dcf7b(0x20b)+formatCountSummary(_0x22df4a['counts'][_0x2dcf7b(0x1f0)])),console[_0x2dcf7b(0x1d3)](_0x2dcf7b(0x1dd)+formatCountSummary(_0x22df4a['counts'][_0x2dcf7b(0x185)]));const _0x332f87=_0x22df4a[_0x2dcf7b(0x1e1)][_0x2dcf7b(0x1be)][_0x2dcf7b(0x1dc)]>0x0||_0x22df4a['counts'][_0x2dcf7b(0x1be)]['updated']>0x0||_0x22df4a[_0x2dcf7b(0x1e1)][_0x2dcf7b(0x1be)][_0x2dcf7b(0x1d2)]>0x0||_0x22df4a[_0x2dcf7b(0x1e1)][_0x2dcf7b(0x1b9)][_0x2dcf7b(0x1dc)]>0x0||_0x22df4a[_0x2dcf7b(0x1e1)][_0x2dcf7b(0x1b9)]['updated']>0x0||_0x22df4a[_0x2dcf7b(0x1e1)][_0x2dcf7b(0x1b9)][_0x2dcf7b(0x1d2)]>0x0;_0x332f87&&(console[_0x2dcf7b(0x1d3)](_0x2dcf7b(0x206)+formatCountSummary(_0x22df4a[_0x2dcf7b(0x1e1)]['experimentalKnowledgeBases'])),console[_0x2dcf7b(0x1d3)](_0x2dcf7b(0x218)+formatCountSummary(_0x22df4a['counts']['experimentalArtifacts'])));console[_0x2dcf7b(0x1d3)](_0x2dcf7b(0x212)+a4_0xe874cd[_0x2dcf7b(0x1c0)](_0x2c02e4)),displayDiffs(_0x22df4a[_0x2dcf7b(0x221)],_0x22df4a[_0x2dcf7b(0x21c)],_0x22df4a[_0x2dcf7b(0x1d8)],_0x22df4a[_0x2dcf7b(0x19c)],_0x22df4a['integrations'],_0x22df4a['experimentalKnowledgeBases'],_0x22df4a[_0x2dcf7b(0x1b9)],_0x22df4a[_0x2dcf7b(0x1f0)],_0x22df4a[_0x2dcf7b(0x185)]);if(_0x406e80)return console[_0x2dcf7b(0x1d3)](a4_0xe874cd[_0x2dcf7b(0x1d6)](_0x2dcf7b(0x21e))),0x0;if(_0x3afc27===0x0&&_0x119bd2===0x0){console[_0x2dcf7b(0x1d3)](a4_0xe874cd[_0x2dcf7b(0x18c)]('\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date'));const _0x1d0c70=getLLMProjectUrl(_0x660154,_0x22df4a[_0x2dcf7b(0x1b5)]);return console['log'](_0x2dcf7b(0x1e7)+a4_0xe874cd[_0x2dcf7b(0x1c0)](_0x1d0c70)),0x0;}if(!_0x46fd42&&!_0x3126de){if(!isInteractive())return console['error'](a4_0xe874cd[_0x2dcf7b(0x186)](_0x2dcf7b(0x1a2)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x2dcf7b(0x217)](a4_0xe874cd[_0x2dcf7b(0x179)](_0x2dcf7b(0x219))),0x1;const _0x16825a=await confirmKey(_0x2dcf7b(0x1e4)+(_0x3afc27+_0x119bd2)+_0x2dcf7b(0x22e));if(!_0x16825a)return console['log'](a4_0xe874cd[_0x2dcf7b(0x1d6)](_0x2dcf7b(0x1a0)),_0x2dcf7b(0x225)),0x1;}const {data:_0xa4e099}=await withSpinner(_0x2dcf7b(0x20f),()=>_0x2d61cf['llm']['pushProject'](_0x2c02e4,{'force':_0x3126de})),_0x428d4c=_0xa4e099[_0x2dcf7b(0x1e1)][_0x2dcf7b(0x221)][_0x2dcf7b(0x191)]>0x0||_0xa4e099[_0x2dcf7b(0x1e1)][_0x2dcf7b(0x21c)][_0x2dcf7b(0x191)]>0x0||_0xa4e099[_0x2dcf7b(0x1e1)][_0x2dcf7b(0x1d8)][_0x2dcf7b(0x191)]>0x0||_0xa4e099['counts'][_0x2dcf7b(0x19c)][_0x2dcf7b(0x191)]>0x0||_0xa4e099[_0x2dcf7b(0x1e1)][_0x2dcf7b(0x1f0)][_0x2dcf7b(0x191)]>0x0||_0xa4e099[_0x2dcf7b(0x1e1)][_0x2dcf7b(0x185)][_0x2dcf7b(0x191)]>0x0;if(_0x428d4c){console[_0x2dcf7b(0x1d3)](a4_0xe874cd[_0x2dcf7b(0x1d6)]('\x0aProject\x20pushed\x20with\x20errors')),console[_0x2dcf7b(0x1d3)](),console[_0x2dcf7b(0x1d3)](a4_0xe874cd[_0x2dcf7b(0x186)]('Errors:'));for(const _0xb8cbc9 of _0xa4e099[_0x2dcf7b(0x221)]){_0xb8cbc9['action']==='error'&&console['log'](a4_0xe874cd[_0x2dcf7b(0x186)]('\x20\x20Agent\x20\x22'+_0xb8cbc9[_0x2dcf7b(0x18a)]+_0x2dcf7b(0x17a)+_0xb8cbc9['error']));}for(const _0x20ab53 of _0xa4e099[_0x2dcf7b(0x21c)]){_0x20ab53['action']==='error'&&console['log'](a4_0xe874cd['red'](_0x2dcf7b(0x1d7)+_0x20ab53[_0x2dcf7b(0x1b2)]+_0x2dcf7b(0x17a)+_0x20ab53[_0x2dcf7b(0x217)]));}for(const _0x1897d6 of _0xa4e099[_0x2dcf7b(0x1d8)]){_0x1897d6[_0x2dcf7b(0x183)]==='error'&&console[_0x2dcf7b(0x1d3)](a4_0xe874cd[_0x2dcf7b(0x186)](_0x2dcf7b(0x1f8)+_0x1897d6['name']+_0x2dcf7b(0x17a)+_0x1897d6[_0x2dcf7b(0x217)]));}for(const _0x468740 of _0xa4e099[_0x2dcf7b(0x19c)]){_0x468740[_0x2dcf7b(0x183)]===_0x2dcf7b(0x217)&&console[_0x2dcf7b(0x1d3)](a4_0xe874cd[_0x2dcf7b(0x186)](_0x2dcf7b(0x1d9)+_0x468740['name']+_0x2dcf7b(0x17a)+_0x468740[_0x2dcf7b(0x217)]));}for(const _0x59056d of _0xa4e099[_0x2dcf7b(0x192)]){_0x59056d[_0x2dcf7b(0x183)]===_0x2dcf7b(0x217)&&console['log'](a4_0xe874cd['red'](_0x2dcf7b(0x228)+_0x59056d[_0x2dcf7b(0x1b2)]+_0x2dcf7b(0x17a)+_0x59056d[_0x2dcf7b(0x217)]));}for(const _0x721aa8 of _0xa4e099['formInterfaces']){_0x721aa8[_0x2dcf7b(0x183)]===_0x2dcf7b(0x217)&&console['log'](a4_0xe874cd['red'](_0x2dcf7b(0x1e0)+_0x721aa8['name']+_0x2dcf7b(0x17a)+_0x721aa8[_0x2dcf7b(0x217)]));}for(const _0x16897c of _0xa4e099[_0x2dcf7b(0x185)]){_0x16897c['action']==='error'&&console[_0x2dcf7b(0x1d3)](a4_0xe874cd[_0x2dcf7b(0x186)]('\x20\x20Chat\x20Interface\x20\x22'+_0x16897c[_0x2dcf7b(0x1b2)]+_0x2dcf7b(0x17a)+_0x16897c[_0x2dcf7b(0x217)]));}return 0x1;}console[_0x2dcf7b(0x1d3)](a4_0xe874cd[_0x2dcf7b(0x18c)](_0x2dcf7b(0x1b7)+(_0x3afc27+_0x119bd2)+'\x20resources\x20to\x20\x27'+_0xa4e099[_0x2dcf7b(0x1f9)]+'\x27'));const _0x56c4ee=getLLMProjectUrl(_0x660154,_0xa4e099[_0x2dcf7b(0x1b5)]);return console[_0x2dcf7b(0x1d3)]('Project:\x20'+a4_0xe874cd[_0x2dcf7b(0x1c0)](_0x56c4ee)),0x0;}}
@@ -1 +1 @@
1
- const a5_0x4a31ba=a5_0x4dfa;(function(_0xfef7c9,_0x592ed2){const _0x1da624=a5_0x4dfa,_0x509dab=_0xfef7c9();while(!![]){try{const _0x17036d=-parseInt(_0x1da624(0x1ec))/0x1*(-parseInt(_0x1da624(0x1f3))/0x2)+parseInt(_0x1da624(0x1d2))/0x3+parseInt(_0x1da624(0x1cb))/0x4+-parseInt(_0x1da624(0x193))/0x5+parseInt(_0x1da624(0x1ce))/0x6+-parseInt(_0x1da624(0x1aa))/0x7*(-parseInt(_0x1da624(0x1c6))/0x8)+-parseInt(_0x1da624(0x1ea))/0x9;if(_0x17036d===_0x592ed2)break;else _0x509dab['push'](_0x509dab['shift']());}catch(_0x491431){_0x509dab['push'](_0x509dab['shift']());}}}(a5_0x364a,0x40b1d));import*as a5_0x106f34 from'node:fs';import*as a5_0x542869 from'node:path';import a5_0x64d003 from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';function a5_0x4dfa(_0x40c029,_0x218e63){_0x40c029=_0x40c029-0x18f;const _0x364a97=a5_0x364a();let _0x4dfaca=_0x364a97[_0x40c029];return _0x4dfaca;}export class AgentTestCommand extends BaseCommand{['name']=a5_0x4a31ba(0x1ac);['description']='Run\x20tests\x20for\x20an\x20LLM\x20agent';async[a5_0x4a31ba(0x1ff)](_0x32f90c){const _0x490164=a5_0x4a31ba,{options:_0x2e15bb,args:_0x12da37,tdx:_0x52b54a}=_0x32f90c,_0x190148=_0x12da37[0x0]||'.',_0x5511f1=_0x2e15bb[_0x490164(0x20e)],_0x417482=_0x2e15bb,_0x17b5ef=_0x417482[_0x490164(0x1cd)]===![],_0xec201b=_0x417482['reeval'],_0x31065c=_0x417482[_0x490164(0x1b6)],_0x4b0652=_0x417482['tags'],_0x3cdc95=_0x2e15bb[_0x490164(0x1f4)],_0x4fcf63=_0x417482[_0x490164(0x220)];if(_0xec201b&&_0x17b5ef)return console[_0x490164(0x1fe)](a5_0x64d003[_0x490164(0x206)](_0x490164(0x190))),0x1;let _0x1ca5c2=_0x490164(0x192);if(_0x417482['json'])_0x1ca5c2=_0x490164(0x216);else{if(_0x417482[_0x490164(0x1fa)])_0x1ca5c2=_0x490164(0x1fa);else{if(_0x417482[_0x490164(0x1f1)])_0x1ca5c2=_0x490164(0x1f1);else{if(_0x417482[_0x490164(0x192)])_0x1ca5c2=_0x490164(0x192);}}}const _0x3cd311=_0x417482[_0x490164(0x1a0)];let _0x109c37=_0x190148;const _0x265fa2=a5_0x106f34[_0x490164(0x1ed)](_0x190148),_0x1818a3=_0x190148==='.';if(!_0x265fa2||_0x1818a3){const _0x13159e=resolveProjectFromContext(_0x190148,_0x3cd311,{'requireFile':_0x490164(0x1c0)});if(_0x13159e['found'])_0x109c37=_0x13159e[_0x490164(0x215)],_0x13159e['source']===_0x490164(0x1b5)&&console['log'](a5_0x64d003[_0x490164(0x1ad)](_0x490164(0x19a)+_0x109c37));else switch(_0x13159e[_0x490164(0x19f)]){case _0x490164(0x1ee):console[_0x490164(0x1fe)](a5_0x64d003[_0x490164(0x1d3)](_0x13159e['message'])),console[_0x490164(0x1fe)](),console[_0x490164(0x1fe)](_0x490164(0x1d4)),console[_0x490164(0x1fe)]('\x20\x20tdx\x20agent\x20test\x20<path>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20from\x20path'),console[_0x490164(0x1fe)](_0x490164(0x1e7)),console[_0x490164(0x1fe)](),console[_0x490164(0x1fe)](_0x490164(0x1c7));return 0x1;case _0x490164(0x1b8):console[_0x490164(0x1fe)](a5_0x64d003[_0x490164(0x1d3)](_0x13159e['message'])),console[_0x490164(0x1fe)](),console[_0x490164(0x1fe)](_0x490164(0x1b1)+_0x13159e[_0x490164(0x1a0)]+_0x490164(0x1b3));return 0x1;case _0x490164(0x1d6):{const _0x7caf42=a5_0x542869[_0x490164(0x1d5)](_0x13159e[_0x490164(0x215)]);console[_0x490164(0x1fe)](a5_0x64d003[_0x490164(0x1d3)]('Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22'+_0x13159e[_0x490164(0x1a0)]+'\x22:'));for(const _0x1bf5ca of _0x13159e['agentDirs']){console[_0x490164(0x1fe)]('\x20\x20-\x20'+_0x1bf5ca);}return console[_0x490164(0x1fe)](),console['log'](_0x490164(0x199)+_0x7caf42+_0x490164(0x213)),0x1;}case _0x490164(0x196):console[_0x490164(0x1fe)](a5_0x64d003[_0x490164(0x1d3)](_0x490164(0x20b)+_0x13159e[_0x490164(0x1a0)]+'\x22.')),console['log'](a5_0x64d003[_0x490164(0x1ad)](_0x490164(0x1d7)+_0x13159e[_0x490164(0x215)])),console['log'](),console[_0x490164(0x1fe)]('Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.');return 0x1;}}const {definition:_0x3b28d9,agentInfo:_0x3be2ad}=parseTestFile(_0x109c37);let _0x22dea1=_0x3b28d9[_0x490164(0x1d1)];if(_0x31065c){const _0x3b42f8=_0x31065c[_0x490164(0x208)](',')[_0x490164(0x195)](_0x484925=>_0x484925[_0x490164(0x1a3)]());_0x22dea1=_0x3b28d9[_0x490164(0x1d1)]['filter'](_0xfe2082=>_0x3b42f8[_0x490164(0x20f)](_0xfe2082[_0x490164(0x1b6)]));if(_0x22dea1['length']===0x0)return console[_0x490164(0x1fe)](a5_0x64d003[_0x490164(0x1d3)](_0x490164(0x198)+_0x31065c)),console[_0x490164(0x1fe)](a5_0x64d003[_0x490164(0x1ad)](_0x490164(0x205)+_0x3b28d9[_0x490164(0x1d1)]['map'](_0x3f9ad6=>_0x3f9ad6[_0x490164(0x1b6)])[_0x490164(0x20c)](',\x20'))),0x1;}if(_0x4b0652){const _0x585b2f=_0x4b0652[_0x490164(0x208)](',')[_0x490164(0x195)](_0x280fb8=>_0x280fb8[_0x490164(0x1a3)]()[_0x490164(0x1c3)]());_0x22dea1=_0x22dea1[_0x490164(0x1f2)](_0x529b23=>_0x529b23[_0x490164(0x1c2)]?.[_0x490164(0x1e8)](_0x34a05a=>_0x585b2f[_0x490164(0x20f)](_0x34a05a[_0x490164(0x1c3)]())));if(_0x22dea1['length']===0x0){console[_0x490164(0x1fe)](a5_0x64d003['yellow']('No\x20tests\x20found\x20with\x20tags:\x20'+_0x4b0652));const _0x394d70=new Set();return _0x3b28d9['tests'][_0x490164(0x1dc)](_0x57b3e7=>_0x57b3e7['tags']?.[_0x490164(0x1dc)](_0x53c61f=>_0x394d70[_0x490164(0x1fd)](_0x53c61f))),_0x394d70[_0x490164(0x1db)]>0x0?console['log'](a5_0x64d003['dim']('Available\x20tags:\x20'+[..._0x394d70][_0x490164(0x20c)](',\x20'))):console[_0x490164(0x1fe)](a5_0x64d003[_0x490164(0x1ad)](_0x490164(0x18f))),0x1;}}if(_0xec201b)return this[_0x490164(0x223)](_0x32f90c,{'definition':{'tests':_0x22dea1},'agentInfo':_0x3be2ad,'outputFormat':_0x1ca5c2,'outputFile':_0x4fcf63,'testNames':_0x31065c});if(_0x5511f1){console['log'](a5_0x64d003[_0x490164(0x1d9)]('Test\x20Configuration:')),console[_0x490164(0x1fe)]('\x20\x20Site:\x20'+a5_0x64d003[_0x490164(0x1c4)](_0x3cdc95)),console[_0x490164(0x1fe)]('\x20\x20Project:\x20'+a5_0x64d003[_0x490164(0x1c4)](_0x3be2ad[_0x490164(0x19d)])),console[_0x490164(0x1fe)](_0x490164(0x1c5)+a5_0x64d003[_0x490164(0x1c4)](_0x3be2ad[_0x490164(0x1e4)])),console[_0x490164(0x1fe)](),console[_0x490164(0x1fe)](_0x490164(0x1e2)+a5_0x64d003[_0x490164(0x1c4)](_0x22dea1[_0x490164(0x21b)]));for(let _0x24bfac=0x0;_0x24bfac<_0x22dea1[_0x490164(0x21b)];_0x24bfac++){const _0x4908f2=_0x22dea1[_0x24bfac],_0x5ba7bb=_0x4908f2['rounds'][_0x490164(0x21b)]===0x1?'round':_0x490164(0x1ae),_0x2de6e5=_0x4908f2[_0x490164(0x1c2)]?.[_0x490164(0x21b)]?'\x20['+_0x4908f2['tags'][_0x490164(0x20c)](',\x20')+']':'';console[_0x490164(0x1fe)]('\x20\x20'+(_0x24bfac+0x1)+'.\x20'+a5_0x64d003[_0x490164(0x1c4)](_0x4908f2[_0x490164(0x1b6)])+'\x20('+_0x4908f2[_0x490164(0x1ae)][_0x490164(0x21b)]+'\x20'+_0x5ba7bb+')'+a5_0x64d003[_0x490164(0x1ad)](_0x2de6e5));}return 0x0;}let _0x40e6bc,_0x4d0cb3;try{_0x40e6bc=await _0x52b54a[_0x490164(0x1d0)][_0x490164(0x1f8)](_0x3be2ad[_0x490164(0x19d)]);}catch(_0x14bcc2){const _0x447a0e=_0x14bcc2 instanceof Error?_0x14bcc2['message']:String(_0x14bcc2);return _0x447a0e[_0x490164(0x20f)](_0x490164(0x1cc))||_0x447a0e[_0x490164(0x1c3)]()[_0x490164(0x20f)]('not\x20found')?console[_0x490164(0x1fe)](a5_0x64d003[_0x490164(0x206)](_0x490164(0x1eb)+_0x3be2ad[_0x490164(0x19d)])):console[_0x490164(0x1fe)](a5_0x64d003[_0x490164(0x206)](_0x490164(0x20d)+_0x3be2ad[_0x490164(0x19d)]+_0x490164(0x1a5)+_0x447a0e)),0x1;}try{_0x4d0cb3=await _0x52b54a[_0x490164(0x1d0)][_0x490164(0x1f6)](_0x3be2ad[_0x490164(0x1e4)],_0x40e6bc);}catch(_0x2139ac){const _0x125692=_0x2139ac instanceof Error?_0x2139ac[_0x490164(0x197)]:String(_0x2139ac);return _0x125692[_0x490164(0x20f)](_0x490164(0x1cc))||_0x125692[_0x490164(0x1c3)]()[_0x490164(0x20f)]('not\x20found')?console['log'](a5_0x64d003[_0x490164(0x206)](_0x490164(0x1f5)+_0x3be2ad[_0x490164(0x1e4)])):console['log'](a5_0x64d003[_0x490164(0x206)](_0x490164(0x1bb)+_0x3be2ad[_0x490164(0x1e4)]+_0x490164(0x1a5)+_0x125692)),0x1;}let _0x351b83;if(!_0x17b5ef)try{_0x351b83=await setupEvaluatorAgent(_0x52b54a['llm'],_0x2e15bb['verbose']);}catch(_0x3e045d){const _0x1db309=_0x3e045d instanceof Error?_0x3e045d['message']:String(_0x3e045d);return console[_0x490164(0x1fe)](a5_0x64d003[_0x490164(0x206)]('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x1db309)),0x1;}console[_0x490164(0x1fe)](a5_0x64d003[_0x490164(0x1d9)](_0x490164(0x219))),console['log'](_0x490164(0x1a6)+a5_0x64d003[_0x490164(0x1c4)](_0x3cdc95)),console[_0x490164(0x1fe)](_0x490164(0x1dd)+a5_0x64d003[_0x490164(0x1c4)](_0x3be2ad[_0x490164(0x19d)]+'/'+_0x3be2ad['agentName'])),console[_0x490164(0x1fe)]();const _0x58a599=[],_0x25c2ae=[],_0x5d06f1=Date[_0x490164(0x207)]();for(let _0x285b6a=0x0;_0x285b6a<_0x22dea1[_0x490164(0x21b)];_0x285b6a++){const _0x589d13=_0x22dea1[_0x285b6a];_0x22dea1[_0x490164(0x21b)]>0x1?console[_0x490164(0x1fe)](_0x490164(0x210)+(_0x285b6a+0x1)+'/'+_0x22dea1[_0x490164(0x21b)]+':\x20'+a5_0x64d003[_0x490164(0x1c4)](_0x589d13[_0x490164(0x1b6)])):console['log'](_0x490164(0x1ba)+a5_0x64d003['white'](_0x589d13[_0x490164(0x1b6)]));const _0x23817f=createCommandSpinner('Round\x201/'+_0x589d13[_0x490164(0x1ae)][_0x490164(0x21b)]+':\x20Sending\x20user\x20input...');_0x23817f[_0x490164(0x214)]();try{const {result:_0x1f41fb,conversation:_0x71756f}=await runTest(_0x52b54a['llm'],_0x589d13,{'agentId':_0x4d0cb3,'projectId':_0x40e6bc,'site':_0x3cdc95,'noEval':_0x17b5ef,'evaluatorId':_0x351b83,'onRoundStart':(_0x16001a,_0x57a458)=>{_0x23817f['text']='Round\x20'+(_0x16001a+0x1)+'/'+_0x57a458+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x213cb1,_0x9a3559,_0x11b141)=>{const _0x35edc8=_0x490164,_0x3f60ea=formatElapsed(_0x9a3559);_0x11b141?console[_0x35edc8(0x1fe)]('\x20\x20Round\x20'+(_0x213cb1+0x1)+'/'+_0x589d13['rounds'][_0x35edc8(0x21b)]+_0x35edc8(0x218)+a5_0x64d003[_0x35edc8(0x204)]('✓')+'\x20('+_0x3f60ea+')'):console[_0x35edc8(0x1fe)](_0x35edc8(0x19e)+(_0x213cb1+0x1)+'/'+_0x589d13[_0x35edc8(0x1ae)]['length']+_0x35edc8(0x218)+a5_0x64d003[_0x35edc8(0x206)]('✗'));},'onEvaluationStart':()=>{_0x23817f['text']='Evaluating\x20response...';},'onEvaluationComplete':_0x388a0f=>{const _0x3989ee=_0x490164,_0x39777c=formatElapsed(_0x388a0f);console['log']('\x20\x20Evaluating...\x20'+a5_0x64d003[_0x3989ee(0x204)]('✓')+'\x20('+_0x39777c+')');}});_0x23817f[_0x490164(0x209)](),_0x58a599[_0x490164(0x1a9)](_0x1f41fb),_0x25c2ae['push'](_0x71756f);if(_0x1f41fb[_0x490164(0x1fb)]===_0x490164(0x1ab))console[_0x490164(0x1fe)](a5_0x64d003[_0x490164(0x204)](_0x490164(0x191)+_0x1f41fb[_0x490164(0x19f)]));else _0x1f41fb['status']==='FAIL'?console[_0x490164(0x1fe)](a5_0x64d003[_0x490164(0x206)](_0x490164(0x21f)+_0x1f41fb[_0x490164(0x19f)])):console[_0x490164(0x1fe)](a5_0x64d003['red']('✗\x20ERROR:\x20'+_0x1f41fb[_0x490164(0x19f)]));_0x1f41fb[_0x490164(0x1ca)]&&console[_0x490164(0x1fe)](a5_0x64d003[_0x490164(0x1ad)](_0x490164(0x1e5)+_0x1f41fb[_0x490164(0x1ca)])),console[_0x490164(0x1fe)]();}catch(_0x57978e){_0x23817f[_0x490164(0x209)]();const _0x4ad9a3=_0x57978e instanceof Error?_0x57978e[_0x490164(0x197)]:String(_0x57978e);console[_0x490164(0x1fe)](a5_0x64d003[_0x490164(0x206)](_0x490164(0x221)+_0x4ad9a3)),console['log'](),_0x58a599['push']({'name':_0x589d13[_0x490164(0x1b6)],'status':_0x490164(0x1e3),'reason':_0x4ad9a3,'timestamp':new Date()[_0x490164(0x1b4)](),'duration_ms':0x0});}}const _0x3ea8e2=Date[_0x490164(0x207)]()-_0x5d06f1,_0x1f01ea=_0x58a599[_0x490164(0x1f2)](_0x279ba6=>_0x279ba6['status']===_0x490164(0x1ab))['length'],_0x6904a7=_0x58a599[_0x490164(0x1f2)](_0x22fad4=>_0x22fad4['status']===_0x490164(0x1a4))[_0x490164(0x21b)],_0x31fb8e=_0x58a599[_0x490164(0x1f2)](_0x1bd3da=>_0x1bd3da[_0x490164(0x1fb)]===_0x490164(0x1e3))[_0x490164(0x21b)];console[_0x490164(0x1fe)]('━'[_0x490164(0x217)](0x3c)),console[_0x490164(0x1fe)]('Test\x20Summary'),console[_0x490164(0x1fe)]('━'['repeat'](0x3c)),console['log'](_0x490164(0x1c9)+_0x58a599[_0x490164(0x21b)]),console[_0x490164(0x1fe)](_0x490164(0x212)+a5_0x64d003[_0x490164(0x204)](_0x1f01ea)),console['log'](_0x490164(0x1c1)+a5_0x64d003[_0x490164(0x206)](_0x6904a7));_0x31fb8e>0x0&&console['log']('Errors:\x20\x20\x20'+a5_0x64d003[_0x490164(0x206)](_0x31fb8e));console[_0x490164(0x1fe)](_0x490164(0x1e0)+formatElapsed(_0x3ea8e2)),console[_0x490164(0x1fe)]('━'[_0x490164(0x217)](0x3c));const _0x5859cd=_0x58a599[_0x490164(0x1f2)](_0x1ba618=>_0x1ba618['status']!==_0x490164(0x1ab));if(_0x5859cd['length']>0x0){console[_0x490164(0x1fe)](),console[_0x490164(0x1fe)](_0x490164(0x21c));for(const _0x29557a of _0x5859cd){const _0x43252c=a5_0x64d003[_0x490164(0x206)]('✗'),_0x44f9c1=_0x29557a[_0x490164(0x19f)][_0x490164(0x21b)]>0x32?_0x29557a[_0x490164(0x19f)][_0x490164(0x1bf)](0x0,0x32)+_0x490164(0x1be):_0x29557a[_0x490164(0x19f)];console[_0x490164(0x1fe)]('\x20\x20'+_0x43252c+'\x20'+_0x29557a[_0x490164(0x1b6)]+':\x20'+_0x44f9c1);}}const _0x4b7f6e={'summary':{'total':_0x58a599[_0x490164(0x21b)],'passed':_0x1f01ea,'failed':_0x6904a7,'errors':_0x31fb8e>0x0?_0x31fb8e:undefined,'duration_ms':_0x3ea8e2},'tests':_0x58a599,'agent':{'project':_0x3be2ad[_0x490164(0x19d)],'name':_0x3be2ad[_0x490164(0x1e4)],'site':_0x3cdc95},'timestamp':new Date(_0x5d06f1)[_0x490164(0x1b4)]()};try{const _0x1520e3=buildCachedTestRun(_0x25c2ae,{'site':_0x3cdc95,'projectId':_0x40e6bc,'projectName':_0x3be2ad[_0x490164(0x19d)],'agentId':_0x4d0cb3,'agentName':_0x3be2ad['agentName'],'testYmlPath':a5_0x542869[_0x490164(0x202)](_0x3be2ad[_0x490164(0x1a8)])});saveLastTestRun(_0x1520e3);}catch{}if(_0x1ca5c2!=='table'||_0x4fcf63){const _0x38b0cc=formatResults(_0x4b7f6e,_0x1ca5c2);if(_0x4fcf63)try{a5_0x106f34[_0x490164(0x1ef)](_0x4fcf63,_0x38b0cc,_0x490164(0x21e)),console['log'](),console[_0x490164(0x1fe)](a5_0x64d003[_0x490164(0x1ad)](_0x490164(0x211)+_0x4fcf63));}catch(_0x46cadb){return console['log'](),console['log'](a5_0x64d003[_0x490164(0x206)](_0x490164(0x1e1)+_0x46cadb)),0x1;}else console[_0x490164(0x1fe)](),console['log'](_0x38b0cc);}return _0x5859cd[_0x490164(0x21b)]>0x0?0x1:0x0;}async[a5_0x4a31ba(0x223)](_0x2b4dda,_0x3d32b8){const _0x21b5f0=a5_0x4a31ba,{options:_0x53ad03,tdx:_0x1707ad}=_0x2b4dda,{definition:_0x294f6b,agentInfo:_0x1300b6,outputFormat:_0x3fdd7c,outputFile:_0x3b29ff}=_0x3d32b8,_0x3582aa=_0x53ad03[_0x21b5f0(0x1f4)],_0x3280b4=loadLastTestRun();if(!_0x3280b4)return console[_0x21b5f0(0x1fe)](a5_0x64d003['red'](_0x21b5f0(0x222))),console[_0x21b5f0(0x1fe)](a5_0x64d003[_0x21b5f0(0x1ad)](_0x21b5f0(0x1a7))),0x1;if(_0x3280b4['agent'][_0x21b5f0(0x1e4)]!==_0x1300b6[_0x21b5f0(0x1e4)])return console[_0x21b5f0(0x1fe)](a5_0x64d003[_0x21b5f0(0x206)]('Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22'+_0x3280b4[_0x21b5f0(0x1e6)][_0x21b5f0(0x1e4)]+'\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22'+_0x1300b6[_0x21b5f0(0x1e4)]+'\x22.')),console['log'](a5_0x64d003[_0x21b5f0(0x1ad)](_0x21b5f0(0x1c8))),0x1;const _0x5531f9=new Set(_0x3280b4[_0x21b5f0(0x1b2)]['map'](_0x16d588=>_0x16d588[_0x21b5f0(0x21d)])),_0x44aea3=_0x294f6b[_0x21b5f0(0x1d1)][_0x21b5f0(0x1f2)](_0x1a3dc5=>!_0x5531f9['has'](_0x1a3dc5[_0x21b5f0(0x1b6)]));if(_0x44aea3[_0x21b5f0(0x21b)]>0x0&&_0x3280b4[_0x21b5f0(0x1f4)]!==_0x3582aa)return console[_0x21b5f0(0x1fe)](a5_0x64d003['red'](_0x21b5f0(0x1f0))),console[_0x21b5f0(0x1fe)](a5_0x64d003['dim'](_0x21b5f0(0x200)+_0x3280b4[_0x21b5f0(0x1f4)]+_0x21b5f0(0x1de)+_0x3582aa+'\x22.')),console['log'](a5_0x64d003[_0x21b5f0(0x1ad)](_0x21b5f0(0x1e9)+_0x3280b4[_0x21b5f0(0x1f4)]+'\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.')),0x1;const _0x346182=_0x294f6b[_0x21b5f0(0x1d1)][_0x21b5f0(0x1f2)](_0x1d04da=>_0x5531f9[_0x21b5f0(0x1b9)](_0x1d04da['name'])),_0x8830c0=_0x44aea3;let _0x1ea5f9;try{_0x1ea5f9=await setupEvaluatorAgent(_0x1707ad[_0x21b5f0(0x1d0)],_0x53ad03[_0x21b5f0(0x1af)]);}catch(_0x1aec6e){const _0xe952b8=_0x1aec6e instanceof Error?_0x1aec6e[_0x21b5f0(0x197)]:String(_0x1aec6e);return console[_0x21b5f0(0x1fe)](a5_0x64d003[_0x21b5f0(0x206)](_0x21b5f0(0x1fc)+_0xe952b8)),0x1;}console[_0x21b5f0(0x1fe)](a5_0x64d003[_0x21b5f0(0x1d9)]('Re-evaluating\x20cached\x20test\x20run...')),console[_0x21b5f0(0x1fe)](_0x21b5f0(0x1a1)+a5_0x64d003[_0x21b5f0(0x1c4)](_0x3280b4['timestamp'])),console[_0x21b5f0(0x1fe)](_0x21b5f0(0x1dd)+a5_0x64d003['white'](_0x3280b4['agent'][_0x21b5f0(0x19d)]+'/'+_0x3280b4[_0x21b5f0(0x1e6)]['agentName']));_0x8830c0[_0x21b5f0(0x21b)]>0x0&&console['log'](_0x21b5f0(0x194)+a5_0x64d003[_0x21b5f0(0x1d3)](_0x8830c0[_0x21b5f0(0x21b)]));console[_0x21b5f0(0x1fe)]();const _0x25752f=[],_0x54ef94=Date[_0x21b5f0(0x207)](),_0x47e3e9=createCommandSpinner(_0x21b5f0(0x1da));if(_0x346182[_0x21b5f0(0x21b)]>0x0)try{const _0x522cac=await reevaluateFromCache(_0x1707ad[_0x21b5f0(0x1d0)],_0x3280b4,{'tests':_0x346182},{'evaluatorId':_0x1ea5f9,'onTestStart':(_0x5ae233,_0x477998,_0x4205c8)=>{const _0x1e7321=_0x21b5f0;_0x47e3e9['text']=_0x1e7321(0x1f7)+(_0x477998+0x1)+'/'+_0x4205c8+':\x20'+_0x5ae233+_0x1e7321(0x1be);if(!_0x47e3e9[_0x1e7321(0x1f9)])_0x47e3e9[_0x1e7321(0x214)]();},'onTestComplete':(_0xeaea89,_0x3e1a45)=>{const _0x2292f2=_0x21b5f0;_0x47e3e9[_0x2292f2(0x209)]();if(_0x3e1a45[_0x2292f2(0x1fb)]==='PASS')console['log'](a5_0x64d003[_0x2292f2(0x204)](_0x2292f2(0x191)+_0xeaea89)+a5_0x64d003[_0x2292f2(0x1ad)](_0x2292f2(0x201)));else _0x3e1a45['status']===_0x2292f2(0x1a4)?console['log'](a5_0x64d003[_0x2292f2(0x206)]('✗\x20FAIL:\x20'+_0xeaea89+_0x2292f2(0x1a2)+_0x3e1a45[_0x2292f2(0x19f)])+a5_0x64d003[_0x2292f2(0x1ad)](_0x2292f2(0x201))):console[_0x2292f2(0x1fe)](a5_0x64d003[_0x2292f2(0x206)](_0x2292f2(0x221)+_0xeaea89+_0x2292f2(0x1a2)+_0x3e1a45[_0x2292f2(0x19f)]));_0x3e1a45[_0x2292f2(0x1ca)]&&console[_0x2292f2(0x1fe)](a5_0x64d003[_0x2292f2(0x1ad)](_0x2292f2(0x203)+_0x3e1a45[_0x2292f2(0x1ca)])),_0x25752f[_0x2292f2(0x1a9)](_0x3e1a45);},'onTestSkipped':(_0x77555,_0x345231)=>{const _0x3b30a4=_0x21b5f0;_0x47e3e9[_0x3b30a4(0x209)](),console[_0x3b30a4(0x1fe)](a5_0x64d003[_0x3b30a4(0x1d3)](_0x3b30a4(0x1bd)+_0x77555+_0x3b30a4(0x1a2)+_0x345231));}});for(const _0xa01d80 of _0x522cac){!_0x25752f[_0x21b5f0(0x1b0)](_0x1758b5=>_0x1758b5[_0x21b5f0(0x1b6)]===_0xa01d80['name'])&&_0x25752f['push'](_0xa01d80);}}catch(_0x1d8fa8){_0x47e3e9['stop']();const _0x1c0624=_0x1d8fa8 instanceof Error?_0x1d8fa8['message']:String(_0x1d8fa8);return console[_0x21b5f0(0x1fe)](a5_0x64d003[_0x21b5f0(0x206)]('✗\x20ERROR:\x20Re-evaluation\x20failed:\x20'+_0x1c0624)),0x1;}_0x47e3e9[_0x21b5f0(0x209)]();if(_0x8830c0[_0x21b5f0(0x21b)]>0x0){console[_0x21b5f0(0x1fe)](),console[_0x21b5f0(0x1fe)](a5_0x64d003[_0x21b5f0(0x1d9)](_0x21b5f0(0x1bc)));const {projectId:_0x4aeb78,agentId:_0x5e2bef}=_0x3280b4['agent'];for(const _0x18596d of _0x8830c0){console[_0x21b5f0(0x1fe)]('Running:\x20'+a5_0x64d003[_0x21b5f0(0x1c4)](_0x18596d[_0x21b5f0(0x1b6)]));const _0x277632=createCommandSpinner(_0x21b5f0(0x1cf)+_0x18596d['rounds'][_0x21b5f0(0x21b)]+':\x20Sending\x20user\x20input...');_0x277632['start']();try{const {result:_0x274e41}=await runTest(_0x1707ad[_0x21b5f0(0x1d0)],_0x18596d,{'agentId':_0x5e2bef,'projectId':_0x4aeb78,'site':_0x3280b4[_0x21b5f0(0x1f4)],'noEval':![],'evaluatorId':_0x1ea5f9,'onRoundStart':(_0x12712b,_0xdefb25)=>{const _0x5f48c8=_0x21b5f0;_0x277632[_0x5f48c8(0x1df)]=_0x5f48c8(0x1d8)+(_0x12712b+0x1)+'/'+_0xdefb25+_0x5f48c8(0x20a);},'onRoundComplete':(_0x1163dc,_0x4cc3d8,_0x32940d)=>{const _0x2f6560=_0x21b5f0,_0xe67477=formatElapsed(_0x4cc3d8);_0x32940d?console[_0x2f6560(0x1fe)](_0x2f6560(0x19e)+(_0x1163dc+0x1)+'/'+_0x18596d[_0x2f6560(0x1ae)][_0x2f6560(0x21b)]+_0x2f6560(0x218)+a5_0x64d003[_0x2f6560(0x204)]('✓')+'\x20('+_0xe67477+')'):console[_0x2f6560(0x1fe)]('\x20\x20Round\x20'+(_0x1163dc+0x1)+'/'+_0x18596d[_0x2f6560(0x1ae)]['length']+'...\x20'+a5_0x64d003[_0x2f6560(0x206)]('✗'));},'onEvaluationStart':()=>{_0x277632['text']='Evaluating\x20response...';},'onEvaluationComplete':_0x7e3da6=>{const _0x467d8c=_0x21b5f0,_0x9b9c8e=formatElapsed(_0x7e3da6);console[_0x467d8c(0x1fe)](_0x467d8c(0x19b)+a5_0x64d003['green']('✓')+'\x20('+_0x9b9c8e+')');}});_0x277632['stop'](),_0x25752f[_0x21b5f0(0x1a9)](_0x274e41);if(_0x274e41[_0x21b5f0(0x1fb)]==='PASS')console[_0x21b5f0(0x1fe)](a5_0x64d003[_0x21b5f0(0x204)]('✓\x20PASS:\x20'+_0x274e41[_0x21b5f0(0x19f)])+a5_0x64d003[_0x21b5f0(0x1ad)](_0x21b5f0(0x19c)));else _0x274e41[_0x21b5f0(0x1fb)]==='FAIL'?console[_0x21b5f0(0x1fe)](a5_0x64d003['red'](_0x21b5f0(0x21f)+_0x274e41[_0x21b5f0(0x19f)])+a5_0x64d003[_0x21b5f0(0x1ad)]('\x20(new)')):console[_0x21b5f0(0x1fe)](a5_0x64d003['red'](_0x21b5f0(0x221)+_0x274e41[_0x21b5f0(0x19f)]));_0x274e41[_0x21b5f0(0x1ca)]&&console['log'](a5_0x64d003[_0x21b5f0(0x1ad)](_0x21b5f0(0x203)+_0x274e41[_0x21b5f0(0x1ca)]));}catch(_0xd0e387){_0x277632['stop']();const _0x2ce041=_0xd0e387 instanceof Error?_0xd0e387[_0x21b5f0(0x197)]:String(_0xd0e387);console[_0x21b5f0(0x1fe)](a5_0x64d003['red'](_0x21b5f0(0x221)+_0x2ce041)),_0x25752f[_0x21b5f0(0x1a9)]({'name':_0x18596d[_0x21b5f0(0x1b6)],'status':'ERROR','reason':_0x2ce041,'timestamp':new Date()[_0x21b5f0(0x1b4)](),'duration_ms':0x0});}}}console[_0x21b5f0(0x1fe)]();const _0x1ac333=Date['now']()-_0x54ef94,_0x3a7721=_0x25752f[_0x21b5f0(0x1f2)](_0x254c10=>_0x254c10[_0x21b5f0(0x1fb)]==='PASS')[_0x21b5f0(0x21b)],_0xc9227f=_0x25752f[_0x21b5f0(0x1f2)](_0x5b5da0=>_0x5b5da0[_0x21b5f0(0x1fb)]===_0x21b5f0(0x1a4))[_0x21b5f0(0x21b)],_0x3a22d5=_0x25752f[_0x21b5f0(0x1f2)](_0x4c2a8e=>_0x4c2a8e[_0x21b5f0(0x1fb)]===_0x21b5f0(0x1e3))[_0x21b5f0(0x21b)];console[_0x21b5f0(0x1fe)]('━'[_0x21b5f0(0x217)](0x3c)),console[_0x21b5f0(0x1fe)](_0x21b5f0(0x1b7)),console['log']('━'[_0x21b5f0(0x217)](0x3c)),console[_0x21b5f0(0x1fe)](_0x21b5f0(0x1c9)+_0x25752f[_0x21b5f0(0x21b)]),console[_0x21b5f0(0x1fe)](_0x21b5f0(0x212)+a5_0x64d003['green'](_0x3a7721)),console['log'](_0x21b5f0(0x1c1)+a5_0x64d003['red'](_0xc9227f));_0x3a22d5>0x0&&console[_0x21b5f0(0x1fe)](_0x21b5f0(0x21a)+a5_0x64d003[_0x21b5f0(0x206)](_0x3a22d5));console[_0x21b5f0(0x1fe)](_0x21b5f0(0x1e0)+formatElapsed(_0x1ac333)),console['log']('━'[_0x21b5f0(0x217)](0x3c));const _0x25361e={'summary':{'total':_0x25752f['length'],'passed':_0x3a7721,'failed':_0xc9227f,'errors':_0x3a22d5>0x0?_0x3a22d5:undefined,'duration_ms':_0x1ac333},'tests':_0x25752f,'agent':{'project':_0x1300b6[_0x21b5f0(0x19d)],'name':_0x1300b6[_0x21b5f0(0x1e4)],'site':_0x3582aa},'timestamp':new Date(_0x54ef94)[_0x21b5f0(0x1b4)]()};if(_0x3fdd7c!==_0x21b5f0(0x192)||_0x3b29ff){const _0x58b51b=formatResults(_0x25361e,_0x3fdd7c);if(_0x3b29ff)try{a5_0x106f34[_0x21b5f0(0x1ef)](_0x3b29ff,_0x58b51b,_0x21b5f0(0x21e)),console[_0x21b5f0(0x1fe)](),console['log'](a5_0x64d003[_0x21b5f0(0x1ad)](_0x21b5f0(0x211)+_0x3b29ff));}catch(_0x57cc49){return console['log'](),console['log'](a5_0x64d003['red'](_0x21b5f0(0x1e1)+_0x57cc49)),0x1;}else console[_0x21b5f0(0x1fe)](),console[_0x21b5f0(0x1fe)](_0x58b51b);}const _0x5e2df9=_0x25752f[_0x21b5f0(0x1f2)](_0x30465f=>_0x30465f[_0x21b5f0(0x1fb)]!==_0x21b5f0(0x1ab));return _0x5e2df9[_0x21b5f0(0x21b)]>0x0?0x1:0x0;}}function a5_0x364a(){const _0x3a450f=['\x20-\x20','trim','FAIL','\x22:\x20','Site:\x20','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','testYmlPath','push','7zfMovj','PASS','agent:test','dim','rounds','verbose','find','Run\x20\x27tdx\x20agent\x20pull\x20','conversations','\x27\x20to\x20create\x20the\x20folder\x20structure.','toISOString','context','name','Re-evaluation\x20Summary','no_local_folder','has','Running\x20test:\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','Executing\x20new\x20tests...','⚠\x20SKIPPED:\x20','...','substring','test.yml','Failed:\x20\x20\x20','tags','toLowerCase','white','\x20\x20Agent:\x20','3099896FtqaIL','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','Total:\x20\x20\x20\x20','conversation_url','1833708uRcsJs','404','eval','132600HJPRur','Round\x201/','llm','tests','293643kmNDtB','yellow','Usage:','basename','multiple_agents','Project\x20path:\x20','Round\x20','cyan','Re-evaluating...','size','forEach','Agent:\x20','\x22,\x20but\x20current\x20site\x20is\x20\x22','text','Duration:\x20','Error\x20writing\x20output\x20file:\x20','Tests\x20found:\x20','ERROR','agentName','Conversation\x20URL:\x20','agent','\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)','some','Either\x20switch\x20to\x20the\x20\x22','7755993yiYGoH','✗\x20ERROR:\x20Project\x20not\x20found:\x20','224041PkwQel','existsSync','no_context','writeFileSync','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','tsv','filter','2Fsmqvu','site','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','resolveAgentId','Re-evaluating\x20','resolveProjectId','isSpinning','jsonl','status','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','add','log','execute','Cached\x20run\x20is\x20from\x20site\x20\x22','\x20(cached)','resolve','\x20\x20Conversation:\x20','green','Available\x20tests:\x20','red','now','split','stop',':\x20Sending\x20user\x20input...','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','join','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','dryRun','includes','Test\x20','Output\x20written\x20to:\x20','Passed:\x20\x20\x20','/<agent-name>','start','projectDir','json','repeat','...\x20','Running\x20agent\x20tests...','Errors:\x20\x20\x20','length','Failed\x20Tests:','testName','utf-8','✗\x20FAIL:\x20','output','✗\x20ERROR:\x20','Error:\x20No\x20previous\x20test\x20run\x20found.','executeReeval','No\x20tests\x20have\x20tags\x20defined.','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','✓\x20PASS:\x20','table','315850HBEkEl','New\x20tests\x20to\x20execute:\x20','map','no_tests','message','No\x20tests\x20found\x20matching:\x20','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','Using\x20agent:\x20','\x20\x20Evaluating...\x20','\x20(new)','projectName','\x20\x20Round\x20','reason','llmProject','Cached\x20run\x20from:\x20'];a5_0x364a=function(){return _0x3a450f;};return a5_0x364a();}
1
+ const a5_0x2c5f76=a5_0x1123;(function(_0x2a2d92,_0x1bf019){const _0x4e473a=a5_0x1123,_0x49b7c0=_0x2a2d92();while(!![]){try{const _0x1d7e09=parseInt(_0x4e473a(0x1e1))/0x1*(-parseInt(_0x4e473a(0x212))/0x2)+-parseInt(_0x4e473a(0x208))/0x3+-parseInt(_0x4e473a(0x1d0))/0x4+-parseInt(_0x4e473a(0x1b9))/0x5*(-parseInt(_0x4e473a(0x1be))/0x6)+parseInt(_0x4e473a(0x1ec))/0x7+-parseInt(_0x4e473a(0x1c3))/0x8+-parseInt(_0x4e473a(0x1a0))/0x9*(-parseInt(_0x4e473a(0x1c0))/0xa);if(_0x1d7e09===_0x1bf019)break;else _0x49b7c0['push'](_0x49b7c0['shift']());}catch(_0x1835e8){_0x49b7c0['push'](_0x49b7c0['shift']());}}}(a5_0x2168,0x27bf1));import*as a5_0x1ea400 from'node:fs';import*as a5_0x15ad3a from'node:path';import a5_0x1a9c86 from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';function a5_0x2168(){const _0x1af78f=['\x20\x20-\x20','push','✗\x20ERROR:\x20','\x20\x20tdx\x20agent\x20test\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20(requires\x20context\x20or\x20tdx.json)','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','start','length','white','conversation_url','581682mvjTmc','verbose','\x22,\x20but\x20current\x20site\x20is\x20\x22','\x20\x20Round\x20','writeFileSync','New\x20tests\x20to\x20execute:\x20','Usage:','✗\x20FAIL:\x20','utf-8','no_tests','PASS','\x20(cached)','Error\x20writing\x20output\x20file:\x20','Agent:\x20','execute','reason','description','find','green','round','yellow','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','has','status','Error:\x20No\x20previous\x20test\x20run\x20found.','some','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','projectName','Run\x20tests\x20for\x20an\x20LLM\x20agent','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','resolveAgentId','No\x20tests\x20found\x20with\x20tags:\x20','text','json','No\x20tests\x20found\x20matching:\x20','test.yml','1920087XPZjiQ','Errors:\x20\x20\x20','Running\x20test:\x20','executeReeval','Failed\x20Tests:','substring','Run\x20\x27tdx\x20agent\x20pull\x20','\x20\x20Site:\x20','Evaluating\x20response...','no_context','table','message','size','\x20\x20Evaluating...\x20','projectDir','log','tests','agent','not\x20found','rounds','now','Passed:\x20\x20\x20','\x22:\x20','llm','tags','61055SdPsnP',':\x20Sending\x20user\x20input...','\x20\x20Agent:\x20','forEach','red','84uykfxC','Re-evaluation\x20Summary','30tOjjeU','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','basename','723376jJpWdD','\x20\x20Project:\x20','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','\x20\x20Conversation:\x20','\x20-\x20','404','timestamp','agentDirs','Using\x20agent:\x20','ERROR','repeat','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','791852wotPUi','Site:\x20','Executing\x20new\x20tests...','multiple_agents','Test\x20Configuration:','resolve','llmProject','Output\x20written\x20to:\x20','toISOString','agent:test','Project\x20path:\x20','✗\x20ERROR:\x20Project\x20not\x20found:\x20','Cached\x20run\x20from:\x20','dryRun','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','FAIL','name','1oZoDKX','site','\x20(new)','/<agent-name>','Failed:\x20\x20\x20','cyan','Either\x20switch\x20to\x20the\x20\x22','join','conversations','No\x20tests\x20have\x20tags\x20defined.','Test\x20Summary','33467TQJxSR','...','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','filter','dim','Re-evaluating\x20cached\x20test\x20run...','Cached\x20run\x20is\x20from\x20site\x20\x22','toLowerCase','split','...\x20','\x27\x20to\x20create\x20the\x20folder\x20structure.','trim','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','reeval','add','Total:\x20\x20\x20\x20','testYmlPath','includes','stop','isSpinning','Duration:\x20','✓\x20PASS:\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','map','eval','jsonl','agentName','no_local_folder','221211CzQQJj'];a5_0x2168=function(){return _0x1af78f;};return a5_0x2168();}import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';function a5_0x1123(_0x338da0,_0x55efb2){_0x338da0=_0x338da0-0x193;const _0x21684e=a5_0x2168();let _0x112372=_0x21684e[_0x338da0];return _0x112372;}export class AgentTestCommand extends BaseCommand{[a5_0x2c5f76(0x1e0)]=a5_0x2c5f76(0x1d9);[a5_0x2c5f76(0x222)]=a5_0x2c5f76(0x198);async[a5_0x2c5f76(0x220)](_0x549629){const _0x4e6d52=a5_0x2c5f76,{options:_0x1b8edd,args:_0x247e1a,tdx:_0x521cee}=_0x549629,_0x217fd1=_0x247e1a[0x0]||'.',_0x34023c=_0x1b8edd[_0x4e6d52(0x1dd)],_0xa6818=_0x1b8edd,_0x4fdb5b=_0xa6818[_0x4e6d52(0x204)]===![],_0x291010=_0xa6818[_0x4e6d52(0x1f9)],_0x465083=_0xa6818[_0x4e6d52(0x1e0)],_0x2e5fdc=_0xa6818[_0x4e6d52(0x1b8)],_0x477dd2=_0x1b8edd['site'],_0x28159a=_0xa6818['output'];if(_0x291010&&_0x4fdb5b)return console[_0x4e6d52(0x1af)](a5_0x1a9c86[_0x4e6d52(0x1bd)](_0x4e6d52(0x196))),0x1;let _0x2e6b2b=_0x4e6d52(0x1aa);if(_0xa6818['json'])_0x2e6b2b=_0x4e6d52(0x19d);else{if(_0xa6818[_0x4e6d52(0x205)])_0x2e6b2b=_0x4e6d52(0x205);else{if(_0xa6818['tsv'])_0x2e6b2b='tsv';else{if(_0xa6818['table'])_0x2e6b2b='table';}}}const _0x59876f=_0xa6818[_0x4e6d52(0x1d6)];let _0x59fc09=_0x217fd1;const _0x5e8293=a5_0x1ea400['existsSync'](_0x217fd1),_0x8428a5=_0x217fd1==='.';if(!_0x5e8293||_0x8428a5){const _0x5dbb4f=resolveProjectFromContext(_0x217fd1,_0x59876f,{'requireFile':_0x4e6d52(0x19f)});if(_0x5dbb4f['found'])_0x59fc09=_0x5dbb4f['projectDir'],_0x5dbb4f['source']==='context'&&console['log'](a5_0x1a9c86[_0x4e6d52(0x1f0)](_0x4e6d52(0x1cc)+_0x59fc09));else switch(_0x5dbb4f[_0x4e6d52(0x221)]){case _0x4e6d52(0x1a9):console[_0x4e6d52(0x1af)](a5_0x1a9c86[_0x4e6d52(0x226)](_0x5dbb4f[_0x4e6d52(0x1ab)])),console[_0x4e6d52(0x1af)](),console[_0x4e6d52(0x1af)](_0x4e6d52(0x218)),console['log']('\x20\x20tdx\x20agent\x20test\x20<path>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20from\x20path'),console[_0x4e6d52(0x1af)](_0x4e6d52(0x20c)),console[_0x4e6d52(0x1af)](),console[_0x4e6d52(0x1af)](_0x4e6d52(0x1c1));return 0x1;case _0x4e6d52(0x207):console[_0x4e6d52(0x1af)](a5_0x1a9c86[_0x4e6d52(0x226)](_0x5dbb4f[_0x4e6d52(0x1ab)])),console[_0x4e6d52(0x1af)](),console[_0x4e6d52(0x1af)](_0x4e6d52(0x1a6)+_0x5dbb4f[_0x4e6d52(0x1d6)]+_0x4e6d52(0x1f6));return 0x1;case _0x4e6d52(0x1d3):{const _0x3c8e30=a5_0x15ad3a[_0x4e6d52(0x1c2)](_0x5dbb4f[_0x4e6d52(0x1ae)]);console[_0x4e6d52(0x1af)](a5_0x1a9c86['yellow']('Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22'+_0x5dbb4f[_0x4e6d52(0x1d6)]+'\x22:'));for(const _0x22e22d of _0x5dbb4f[_0x4e6d52(0x1cb)]){console[_0x4e6d52(0x1af)](_0x4e6d52(0x209)+_0x22e22d);}return console['log'](),console[_0x4e6d52(0x1af)]('Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/'+_0x3c8e30+_0x4e6d52(0x1e4)),0x1;}case _0x4e6d52(0x21b):console[_0x4e6d52(0x1af)](a5_0x1a9c86['yellow'](_0x4e6d52(0x1de)+_0x5dbb4f['llmProject']+'\x22.')),console[_0x4e6d52(0x1af)](a5_0x1a9c86[_0x4e6d52(0x1f0)](_0x4e6d52(0x1da)+_0x5dbb4f[_0x4e6d52(0x1ae)])),console[_0x4e6d52(0x1af)](),console[_0x4e6d52(0x1af)](_0x4e6d52(0x227));return 0x1;}}const {definition:_0x1b1eae,agentInfo:_0x4cb5c0}=parseTestFile(_0x59fc09);let _0x14ecc6=_0x1b1eae[_0x4e6d52(0x1b0)];if(_0x465083){const _0x282764=_0x465083[_0x4e6d52(0x1f4)](',')['map'](_0x418f90=>_0x418f90[_0x4e6d52(0x1f7)]());_0x14ecc6=_0x1b1eae[_0x4e6d52(0x1b0)][_0x4e6d52(0x1ef)](_0x56a005=>_0x282764['includes'](_0x56a005[_0x4e6d52(0x1e0)]));if(_0x14ecc6[_0x4e6d52(0x20f)]===0x0)return console[_0x4e6d52(0x1af)](a5_0x1a9c86[_0x4e6d52(0x226)](_0x4e6d52(0x19e)+_0x465083)),console[_0x4e6d52(0x1af)](a5_0x1a9c86[_0x4e6d52(0x1f0)]('Available\x20tests:\x20'+_0x1b1eae[_0x4e6d52(0x1b0)][_0x4e6d52(0x203)](_0x3a3448=>_0x3a3448[_0x4e6d52(0x1e0)])['join'](',\x20'))),0x1;}if(_0x2e5fdc){const _0x7515eb=_0x2e5fdc[_0x4e6d52(0x1f4)](',')[_0x4e6d52(0x203)](_0x316cb4=>_0x316cb4[_0x4e6d52(0x1f7)]()[_0x4e6d52(0x1f3)]());_0x14ecc6=_0x14ecc6[_0x4e6d52(0x1ef)](_0x57e6d0=>_0x57e6d0['tags']?.[_0x4e6d52(0x195)](_0x19962f=>_0x7515eb[_0x4e6d52(0x1fd)](_0x19962f[_0x4e6d52(0x1f3)]())));if(_0x14ecc6[_0x4e6d52(0x20f)]===0x0){console[_0x4e6d52(0x1af)](a5_0x1a9c86[_0x4e6d52(0x226)](_0x4e6d52(0x19b)+_0x2e5fdc));const _0x1418cc=new Set();return _0x1b1eae[_0x4e6d52(0x1b0)][_0x4e6d52(0x1bc)](_0x4da2db=>_0x4da2db[_0x4e6d52(0x1b8)]?.[_0x4e6d52(0x1bc)](_0x38cfad=>_0x1418cc[_0x4e6d52(0x1fa)](_0x38cfad))),_0x1418cc[_0x4e6d52(0x1ac)]>0x0?console['log'](a5_0x1a9c86[_0x4e6d52(0x1f0)]('Available\x20tags:\x20'+[..._0x1418cc][_0x4e6d52(0x1e8)](',\x20'))):console[_0x4e6d52(0x1af)](a5_0x1a9c86[_0x4e6d52(0x1f0)](_0x4e6d52(0x1ea))),0x1;}}if(_0x291010)return this['executeReeval'](_0x549629,{'definition':{'tests':_0x14ecc6},'agentInfo':_0x4cb5c0,'outputFormat':_0x2e6b2b,'outputFile':_0x28159a,'testNames':_0x465083});if(_0x34023c){console[_0x4e6d52(0x1af)](a5_0x1a9c86[_0x4e6d52(0x1e6)](_0x4e6d52(0x1d4))),console[_0x4e6d52(0x1af)](_0x4e6d52(0x1a7)+a5_0x1a9c86[_0x4e6d52(0x210)](_0x477dd2)),console[_0x4e6d52(0x1af)](_0x4e6d52(0x1c4)+a5_0x1a9c86[_0x4e6d52(0x210)](_0x4cb5c0[_0x4e6d52(0x197)])),console[_0x4e6d52(0x1af)](_0x4e6d52(0x1bb)+a5_0x1a9c86[_0x4e6d52(0x210)](_0x4cb5c0['agentName'])),console[_0x4e6d52(0x1af)](),console[_0x4e6d52(0x1af)]('Tests\x20found:\x20'+a5_0x1a9c86['white'](_0x14ecc6[_0x4e6d52(0x20f)]));for(let _0x1f2025=0x0;_0x1f2025<_0x14ecc6['length'];_0x1f2025++){const _0x2ebf13=_0x14ecc6[_0x1f2025],_0x5021a3=_0x2ebf13[_0x4e6d52(0x1b3)][_0x4e6d52(0x20f)]===0x1?_0x4e6d52(0x225):'rounds',_0x41b3ae=_0x2ebf13[_0x4e6d52(0x1b8)]?.[_0x4e6d52(0x20f)]?'\x20['+_0x2ebf13['tags'][_0x4e6d52(0x1e8)](',\x20')+']':'';console[_0x4e6d52(0x1af)]('\x20\x20'+(_0x1f2025+0x1)+'.\x20'+a5_0x1a9c86[_0x4e6d52(0x210)](_0x2ebf13[_0x4e6d52(0x1e0)])+'\x20('+_0x2ebf13[_0x4e6d52(0x1b3)][_0x4e6d52(0x20f)]+'\x20'+_0x5021a3+')'+a5_0x1a9c86[_0x4e6d52(0x1f0)](_0x41b3ae));}return 0x0;}let _0x66f5c2,_0x2dea37;try{_0x66f5c2=await _0x521cee[_0x4e6d52(0x1b7)]['resolveProjectId'](_0x4cb5c0[_0x4e6d52(0x197)]);}catch(_0x582277){const _0xd69a38=_0x582277 instanceof Error?_0x582277['message']:String(_0x582277);return _0xd69a38['includes'](_0x4e6d52(0x1c9))||_0xd69a38['toLowerCase']()[_0x4e6d52(0x1fd)](_0x4e6d52(0x1b2))?console['log'](a5_0x1a9c86[_0x4e6d52(0x1bd)](_0x4e6d52(0x1db)+_0x4cb5c0[_0x4e6d52(0x197)])):console[_0x4e6d52(0x1af)](a5_0x1a9c86[_0x4e6d52(0x1bd)](_0x4e6d52(0x202)+_0x4cb5c0['projectName']+'\x22:\x20'+_0xd69a38)),0x1;}try{_0x2dea37=await _0x521cee[_0x4e6d52(0x1b7)][_0x4e6d52(0x19a)](_0x4cb5c0[_0x4e6d52(0x206)],_0x66f5c2);}catch(_0x1633ff){const _0x4c1037=_0x1633ff instanceof Error?_0x1633ff[_0x4e6d52(0x1ab)]:String(_0x1633ff);return _0x4c1037['includes'](_0x4e6d52(0x1c9))||_0x4c1037[_0x4e6d52(0x1f3)]()['includes'](_0x4e6d52(0x1b2))?console[_0x4e6d52(0x1af)](a5_0x1a9c86['red']('✗\x20ERROR:\x20Agent\x20not\x20found:\x20'+_0x4cb5c0[_0x4e6d52(0x206)])):console[_0x4e6d52(0x1af)](a5_0x1a9c86[_0x4e6d52(0x1bd)](_0x4e6d52(0x199)+_0x4cb5c0[_0x4e6d52(0x206)]+_0x4e6d52(0x1b6)+_0x4c1037)),0x1;}let _0x206972;if(!_0x4fdb5b)try{_0x206972=await setupEvaluatorAgent(_0x521cee[_0x4e6d52(0x1b7)],_0x1b8edd[_0x4e6d52(0x213)]);}catch(_0xf44828){const _0x53ddf3=_0xf44828 instanceof Error?_0xf44828[_0x4e6d52(0x1ab)]:String(_0xf44828);return console[_0x4e6d52(0x1af)](a5_0x1a9c86['red']('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x53ddf3)),0x1;}console['log'](a5_0x1a9c86[_0x4e6d52(0x1e6)]('Running\x20agent\x20tests...')),console['log'](_0x4e6d52(0x1d1)+a5_0x1a9c86[_0x4e6d52(0x210)](_0x477dd2)),console[_0x4e6d52(0x1af)](_0x4e6d52(0x21f)+a5_0x1a9c86[_0x4e6d52(0x210)](_0x4cb5c0[_0x4e6d52(0x197)]+'/'+_0x4cb5c0[_0x4e6d52(0x206)])),console['log']();const _0x52b6b1=[],_0x16d2cb=[],_0x42d5d5=Date['now']();for(let _0x2c96cf=0x0;_0x2c96cf<_0x14ecc6[_0x4e6d52(0x20f)];_0x2c96cf++){const _0x3f172f=_0x14ecc6[_0x2c96cf];_0x14ecc6[_0x4e6d52(0x20f)]>0x1?console[_0x4e6d52(0x1af)]('Test\x20'+(_0x2c96cf+0x1)+'/'+_0x14ecc6[_0x4e6d52(0x20f)]+':\x20'+a5_0x1a9c86['white'](_0x3f172f[_0x4e6d52(0x1e0)])):console['log'](_0x4e6d52(0x1a2)+a5_0x1a9c86[_0x4e6d52(0x210)](_0x3f172f[_0x4e6d52(0x1e0)]));const _0x3106cc=createCommandSpinner('Round\x201/'+_0x3f172f[_0x4e6d52(0x1b3)][_0x4e6d52(0x20f)]+_0x4e6d52(0x1ba));_0x3106cc[_0x4e6d52(0x20e)]();try{const {result:_0x432438,conversation:_0x44a3a4}=await runTest(_0x521cee[_0x4e6d52(0x1b7)],_0x3f172f,{'agentId':_0x2dea37,'projectId':_0x66f5c2,'site':_0x477dd2,'noEval':_0x4fdb5b,'evaluatorId':_0x206972,'onRoundStart':(_0x223b47,_0x97743b)=>{const _0x4288e6=_0x4e6d52;_0x3106cc['text']='Round\x20'+(_0x223b47+0x1)+'/'+_0x97743b+_0x4288e6(0x1ba);},'onRoundComplete':(_0x2d1ccd,_0x164482,_0x557558)=>{const _0x3b2e1c=_0x4e6d52,_0x48b126=formatElapsed(_0x164482);_0x557558?console[_0x3b2e1c(0x1af)](_0x3b2e1c(0x215)+(_0x2d1ccd+0x1)+'/'+_0x3f172f[_0x3b2e1c(0x1b3)][_0x3b2e1c(0x20f)]+_0x3b2e1c(0x1f5)+a5_0x1a9c86[_0x3b2e1c(0x224)]('✓')+'\x20('+_0x48b126+')'):console[_0x3b2e1c(0x1af)](_0x3b2e1c(0x215)+(_0x2d1ccd+0x1)+'/'+_0x3f172f['rounds'][_0x3b2e1c(0x20f)]+_0x3b2e1c(0x1f5)+a5_0x1a9c86[_0x3b2e1c(0x1bd)]('✗'));},'onEvaluationStart':()=>{const _0x3870a3=_0x4e6d52;_0x3106cc[_0x3870a3(0x19c)]='Evaluating\x20response...';},'onEvaluationComplete':_0x4bd504=>{const _0x567cb7=_0x4e6d52,_0x5c8932=formatElapsed(_0x4bd504);console['log']('\x20\x20Evaluating...\x20'+a5_0x1a9c86[_0x567cb7(0x224)]('✓')+'\x20('+_0x5c8932+')');}});_0x3106cc[_0x4e6d52(0x1fe)](),_0x52b6b1[_0x4e6d52(0x20a)](_0x432438),_0x16d2cb['push'](_0x44a3a4);if(_0x432438['status']===_0x4e6d52(0x21c))console[_0x4e6d52(0x1af)](a5_0x1a9c86[_0x4e6d52(0x224)](_0x4e6d52(0x201)+_0x432438[_0x4e6d52(0x221)]));else _0x432438[_0x4e6d52(0x193)]===_0x4e6d52(0x1df)?console['log'](a5_0x1a9c86[_0x4e6d52(0x1bd)](_0x4e6d52(0x219)+_0x432438[_0x4e6d52(0x221)])):console[_0x4e6d52(0x1af)](a5_0x1a9c86[_0x4e6d52(0x1bd)](_0x4e6d52(0x20b)+_0x432438[_0x4e6d52(0x221)]));_0x432438[_0x4e6d52(0x211)]&&console[_0x4e6d52(0x1af)](a5_0x1a9c86['dim']('Conversation\x20URL:\x20'+_0x432438[_0x4e6d52(0x211)])),console[_0x4e6d52(0x1af)]();}catch(_0x37dc59){_0x3106cc[_0x4e6d52(0x1fe)]();const _0x8a762=_0x37dc59 instanceof Error?_0x37dc59[_0x4e6d52(0x1ab)]:String(_0x37dc59);console['log'](a5_0x1a9c86[_0x4e6d52(0x1bd)]('✗\x20ERROR:\x20'+_0x8a762)),console['log'](),_0x52b6b1[_0x4e6d52(0x20a)]({'name':_0x3f172f[_0x4e6d52(0x1e0)],'status':_0x4e6d52(0x1cd),'reason':_0x8a762,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}const _0x4bce7b=Date[_0x4e6d52(0x1b4)]()-_0x42d5d5,_0x40f222=_0x52b6b1['filter'](_0x12fd34=>_0x12fd34[_0x4e6d52(0x193)]===_0x4e6d52(0x21c))[_0x4e6d52(0x20f)],_0x1e0f03=_0x52b6b1[_0x4e6d52(0x1ef)](_0x2ca7ba=>_0x2ca7ba[_0x4e6d52(0x193)]===_0x4e6d52(0x1df))[_0x4e6d52(0x20f)],_0x1fcf45=_0x52b6b1['filter'](_0x201329=>_0x201329[_0x4e6d52(0x193)]==='ERROR')[_0x4e6d52(0x20f)];console[_0x4e6d52(0x1af)]('━'[_0x4e6d52(0x1ce)](0x3c)),console['log'](_0x4e6d52(0x1eb)),console[_0x4e6d52(0x1af)]('━'[_0x4e6d52(0x1ce)](0x3c)),console[_0x4e6d52(0x1af)](_0x4e6d52(0x1fb)+_0x52b6b1[_0x4e6d52(0x20f)]),console['log'](_0x4e6d52(0x1b5)+a5_0x1a9c86[_0x4e6d52(0x224)](_0x40f222)),console[_0x4e6d52(0x1af)](_0x4e6d52(0x1e5)+a5_0x1a9c86['red'](_0x1e0f03));_0x1fcf45>0x0&&console['log'](_0x4e6d52(0x1a1)+a5_0x1a9c86['red'](_0x1fcf45));console[_0x4e6d52(0x1af)](_0x4e6d52(0x200)+formatElapsed(_0x4bce7b)),console[_0x4e6d52(0x1af)]('━'[_0x4e6d52(0x1ce)](0x3c));const _0x544e4e=_0x52b6b1[_0x4e6d52(0x1ef)](_0x12b0ac=>_0x12b0ac['status']!=='PASS');if(_0x544e4e[_0x4e6d52(0x20f)]>0x0){console[_0x4e6d52(0x1af)](),console[_0x4e6d52(0x1af)](_0x4e6d52(0x1a4));for(const _0x359397 of _0x544e4e){const _0x403721=a5_0x1a9c86[_0x4e6d52(0x1bd)]('✗'),_0x27a6a5=_0x359397[_0x4e6d52(0x221)][_0x4e6d52(0x20f)]>0x32?_0x359397['reason'][_0x4e6d52(0x1a5)](0x0,0x32)+_0x4e6d52(0x1ed):_0x359397[_0x4e6d52(0x221)];console[_0x4e6d52(0x1af)]('\x20\x20'+_0x403721+'\x20'+_0x359397[_0x4e6d52(0x1e0)]+':\x20'+_0x27a6a5);}}const _0x5a0a90={'summary':{'total':_0x52b6b1[_0x4e6d52(0x20f)],'passed':_0x40f222,'failed':_0x1e0f03,'errors':_0x1fcf45>0x0?_0x1fcf45:undefined,'duration_ms':_0x4bce7b},'tests':_0x52b6b1,'agent':{'project':_0x4cb5c0['projectName'],'name':_0x4cb5c0[_0x4e6d52(0x206)],'site':_0x477dd2},'timestamp':new Date(_0x42d5d5)['toISOString']()};try{const _0x3724eb=buildCachedTestRun(_0x16d2cb,{'site':_0x477dd2,'projectId':_0x66f5c2,'projectName':_0x4cb5c0[_0x4e6d52(0x197)],'agentId':_0x2dea37,'agentName':_0x4cb5c0[_0x4e6d52(0x206)],'testYmlPath':a5_0x15ad3a[_0x4e6d52(0x1d5)](_0x4cb5c0[_0x4e6d52(0x1fc)])});saveLastTestRun(_0x3724eb);}catch{}if(_0x2e6b2b!=='table'||_0x28159a){const _0x21ed3e=formatResults(_0x5a0a90,_0x2e6b2b);if(_0x28159a)try{a5_0x1ea400['writeFileSync'](_0x28159a,_0x21ed3e,_0x4e6d52(0x21a)),console['log'](),console['log'](a5_0x1a9c86[_0x4e6d52(0x1f0)](_0x4e6d52(0x1d7)+_0x28159a));}catch(_0x10f10d){return console['log'](),console['log'](a5_0x1a9c86[_0x4e6d52(0x1bd)](_0x4e6d52(0x21e)+_0x10f10d)),0x1;}else console[_0x4e6d52(0x1af)](),console[_0x4e6d52(0x1af)](_0x21ed3e);}return _0x544e4e[_0x4e6d52(0x20f)]>0x0?0x1:0x0;}async[a5_0x2c5f76(0x1a3)](_0x5b0e11,_0x964201){const _0xe7c8e7=a5_0x2c5f76,{options:_0x5deff2,tdx:_0x11305d}=_0x5b0e11,{definition:_0x1575cc,agentInfo:_0x315fe9,outputFormat:_0x4f47da,outputFile:_0x24bea1}=_0x964201,_0xc03b56=_0x5deff2['site'],_0x4aeecb=loadLastTestRun();if(!_0x4aeecb)return console[_0xe7c8e7(0x1af)](a5_0x1a9c86[_0xe7c8e7(0x1bd)](_0xe7c8e7(0x194))),console[_0xe7c8e7(0x1af)](a5_0x1a9c86[_0xe7c8e7(0x1f0)](_0xe7c8e7(0x1cf))),0x1;if(_0x4aeecb[_0xe7c8e7(0x1b1)][_0xe7c8e7(0x206)]!==_0x315fe9[_0xe7c8e7(0x206)])return console[_0xe7c8e7(0x1af)](a5_0x1a9c86['red']('Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22'+_0x4aeecb[_0xe7c8e7(0x1b1)]['agentName']+_0xe7c8e7(0x1c6)+_0x315fe9[_0xe7c8e7(0x206)]+'\x22.')),console[_0xe7c8e7(0x1af)](a5_0x1a9c86[_0xe7c8e7(0x1f0)](_0xe7c8e7(0x1ee))),0x1;const _0x5e29b9=new Set(_0x4aeecb[_0xe7c8e7(0x1e9)][_0xe7c8e7(0x203)](_0x2d5540=>_0x2d5540['testName'])),_0x469563=_0x1575cc[_0xe7c8e7(0x1b0)]['filter'](_0x2b7316=>!_0x5e29b9[_0xe7c8e7(0x228)](_0x2b7316[_0xe7c8e7(0x1e0)]));if(_0x469563[_0xe7c8e7(0x20f)]>0x0&&_0x4aeecb['site']!==_0xc03b56)return console[_0xe7c8e7(0x1af)](a5_0x1a9c86[_0xe7c8e7(0x1bd)](_0xe7c8e7(0x1f8))),console[_0xe7c8e7(0x1af)](a5_0x1a9c86[_0xe7c8e7(0x1f0)](_0xe7c8e7(0x1f2)+_0x4aeecb[_0xe7c8e7(0x1e2)]+_0xe7c8e7(0x214)+_0xc03b56+'\x22.')),console['log'](a5_0x1a9c86[_0xe7c8e7(0x1f0)](_0xe7c8e7(0x1e7)+_0x4aeecb['site']+'\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.')),0x1;const _0x354a54=_0x1575cc['tests'][_0xe7c8e7(0x1ef)](_0x408989=>_0x5e29b9[_0xe7c8e7(0x228)](_0x408989['name'])),_0xd55dd1=_0x469563;let _0x463bbb;try{_0x463bbb=await setupEvaluatorAgent(_0x11305d[_0xe7c8e7(0x1b7)],_0x5deff2[_0xe7c8e7(0x213)]);}catch(_0x5a79a0){const _0x458218=_0x5a79a0 instanceof Error?_0x5a79a0[_0xe7c8e7(0x1ab)]:String(_0x5a79a0);return console[_0xe7c8e7(0x1af)](a5_0x1a9c86['red'](_0xe7c8e7(0x20d)+_0x458218)),0x1;}console[_0xe7c8e7(0x1af)](a5_0x1a9c86[_0xe7c8e7(0x1e6)](_0xe7c8e7(0x1f1))),console[_0xe7c8e7(0x1af)](_0xe7c8e7(0x1dc)+a5_0x1a9c86[_0xe7c8e7(0x210)](_0x4aeecb[_0xe7c8e7(0x1ca)])),console['log']('Agent:\x20'+a5_0x1a9c86[_0xe7c8e7(0x210)](_0x4aeecb[_0xe7c8e7(0x1b1)][_0xe7c8e7(0x197)]+'/'+_0x4aeecb[_0xe7c8e7(0x1b1)][_0xe7c8e7(0x206)]));_0xd55dd1[_0xe7c8e7(0x20f)]>0x0&&console[_0xe7c8e7(0x1af)](_0xe7c8e7(0x217)+a5_0x1a9c86[_0xe7c8e7(0x226)](_0xd55dd1[_0xe7c8e7(0x20f)]));console[_0xe7c8e7(0x1af)]();const _0x443ba3=[],_0x4070c8=Date[_0xe7c8e7(0x1b4)](),_0x331c3c=createCommandSpinner('Re-evaluating...');if(_0x354a54[_0xe7c8e7(0x20f)]>0x0)try{const _0x43cdb0=await reevaluateFromCache(_0x11305d[_0xe7c8e7(0x1b7)],_0x4aeecb,{'tests':_0x354a54},{'evaluatorId':_0x463bbb,'onTestStart':(_0x2de842,_0x38f816,_0x30b72d)=>{const _0xfb87b2=_0xe7c8e7;_0x331c3c[_0xfb87b2(0x19c)]='Re-evaluating\x20'+(_0x38f816+0x1)+'/'+_0x30b72d+':\x20'+_0x2de842+_0xfb87b2(0x1ed);if(!_0x331c3c[_0xfb87b2(0x1ff)])_0x331c3c[_0xfb87b2(0x20e)]();},'onTestComplete':(_0x546b33,_0x2cf474)=>{const _0x52c942=_0xe7c8e7;_0x331c3c[_0x52c942(0x1fe)]();if(_0x2cf474[_0x52c942(0x193)]===_0x52c942(0x21c))console['log'](a5_0x1a9c86[_0x52c942(0x224)](_0x52c942(0x201)+_0x546b33)+a5_0x1a9c86['dim']('\x20(cached)'));else _0x2cf474[_0x52c942(0x193)]===_0x52c942(0x1df)?console[_0x52c942(0x1af)](a5_0x1a9c86[_0x52c942(0x1bd)](_0x52c942(0x219)+_0x546b33+_0x52c942(0x1c8)+_0x2cf474[_0x52c942(0x221)])+a5_0x1a9c86[_0x52c942(0x1f0)](_0x52c942(0x21d))):console['log'](a5_0x1a9c86['red'](_0x52c942(0x20b)+_0x546b33+_0x52c942(0x1c8)+_0x2cf474['reason']));_0x2cf474[_0x52c942(0x211)]&&console['log'](a5_0x1a9c86[_0x52c942(0x1f0)]('\x20\x20Conversation:\x20'+_0x2cf474['conversation_url'])),_0x443ba3[_0x52c942(0x20a)](_0x2cf474);},'onTestSkipped':(_0x35b673,_0x33898a)=>{const _0x4c2de5=_0xe7c8e7;_0x331c3c[_0x4c2de5(0x1fe)](),console[_0x4c2de5(0x1af)](a5_0x1a9c86[_0x4c2de5(0x226)]('⚠\x20SKIPPED:\x20'+_0x35b673+_0x4c2de5(0x1c8)+_0x33898a));}});for(const _0x1a2d07 of _0x43cdb0){!_0x443ba3[_0xe7c8e7(0x223)](_0x42e41c=>_0x42e41c['name']===_0x1a2d07['name'])&&_0x443ba3['push'](_0x1a2d07);}}catch(_0x587284){_0x331c3c[_0xe7c8e7(0x1fe)]();const _0x12c107=_0x587284 instanceof Error?_0x587284[_0xe7c8e7(0x1ab)]:String(_0x587284);return console[_0xe7c8e7(0x1af)](a5_0x1a9c86[_0xe7c8e7(0x1bd)](_0xe7c8e7(0x1c5)+_0x12c107)),0x1;}_0x331c3c[_0xe7c8e7(0x1fe)]();if(_0xd55dd1[_0xe7c8e7(0x20f)]>0x0){console[_0xe7c8e7(0x1af)](),console['log'](a5_0x1a9c86[_0xe7c8e7(0x1e6)](_0xe7c8e7(0x1d2)));const {projectId:_0x2bbe45,agentId:_0x41685e}=_0x4aeecb['agent'];for(const _0x37705d of _0xd55dd1){console[_0xe7c8e7(0x1af)]('Running:\x20'+a5_0x1a9c86['white'](_0x37705d[_0xe7c8e7(0x1e0)]));const _0x3fb5c5=createCommandSpinner('Round\x201/'+_0x37705d['rounds'][_0xe7c8e7(0x20f)]+_0xe7c8e7(0x1ba));_0x3fb5c5[_0xe7c8e7(0x20e)]();try{const {result:_0x18c936}=await runTest(_0x11305d[_0xe7c8e7(0x1b7)],_0x37705d,{'agentId':_0x41685e,'projectId':_0x2bbe45,'site':_0x4aeecb[_0xe7c8e7(0x1e2)],'noEval':![],'evaluatorId':_0x463bbb,'onRoundStart':(_0x514fc7,_0x5f7e95)=>{const _0x48e66a=_0xe7c8e7;_0x3fb5c5[_0x48e66a(0x19c)]='Round\x20'+(_0x514fc7+0x1)+'/'+_0x5f7e95+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x3ad35d,_0x353c7f,_0x323984)=>{const _0x1d6fbd=_0xe7c8e7,_0x1097ef=formatElapsed(_0x353c7f);_0x323984?console[_0x1d6fbd(0x1af)](_0x1d6fbd(0x215)+(_0x3ad35d+0x1)+'/'+_0x37705d['rounds'][_0x1d6fbd(0x20f)]+_0x1d6fbd(0x1f5)+a5_0x1a9c86[_0x1d6fbd(0x224)]('✓')+'\x20('+_0x1097ef+')'):console[_0x1d6fbd(0x1af)](_0x1d6fbd(0x215)+(_0x3ad35d+0x1)+'/'+_0x37705d[_0x1d6fbd(0x1b3)]['length']+_0x1d6fbd(0x1f5)+a5_0x1a9c86['red']('✗'));},'onEvaluationStart':()=>{const _0x47f9e1=_0xe7c8e7;_0x3fb5c5['text']=_0x47f9e1(0x1a8);},'onEvaluationComplete':_0x1f7049=>{const _0xe0d08=_0xe7c8e7,_0x1db27c=formatElapsed(_0x1f7049);console[_0xe0d08(0x1af)](_0xe0d08(0x1ad)+a5_0x1a9c86[_0xe0d08(0x224)]('✓')+'\x20('+_0x1db27c+')');}});_0x3fb5c5[_0xe7c8e7(0x1fe)](),_0x443ba3['push'](_0x18c936);if(_0x18c936[_0xe7c8e7(0x193)]===_0xe7c8e7(0x21c))console[_0xe7c8e7(0x1af)](a5_0x1a9c86[_0xe7c8e7(0x224)](_0xe7c8e7(0x201)+_0x18c936['reason'])+a5_0x1a9c86[_0xe7c8e7(0x1f0)](_0xe7c8e7(0x1e3)));else _0x18c936[_0xe7c8e7(0x193)]===_0xe7c8e7(0x1df)?console[_0xe7c8e7(0x1af)](a5_0x1a9c86[_0xe7c8e7(0x1bd)](_0xe7c8e7(0x219)+_0x18c936[_0xe7c8e7(0x221)])+a5_0x1a9c86[_0xe7c8e7(0x1f0)](_0xe7c8e7(0x1e3))):console[_0xe7c8e7(0x1af)](a5_0x1a9c86[_0xe7c8e7(0x1bd)]('✗\x20ERROR:\x20'+_0x18c936[_0xe7c8e7(0x221)]));_0x18c936[_0xe7c8e7(0x211)]&&console[_0xe7c8e7(0x1af)](a5_0x1a9c86['dim'](_0xe7c8e7(0x1c7)+_0x18c936[_0xe7c8e7(0x211)]));}catch(_0x4e2f84){_0x3fb5c5[_0xe7c8e7(0x1fe)]();const _0x42a48c=_0x4e2f84 instanceof Error?_0x4e2f84['message']:String(_0x4e2f84);console['log'](a5_0x1a9c86[_0xe7c8e7(0x1bd)](_0xe7c8e7(0x20b)+_0x42a48c)),_0x443ba3['push']({'name':_0x37705d['name'],'status':_0xe7c8e7(0x1cd),'reason':_0x42a48c,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}}console[_0xe7c8e7(0x1af)]();const _0x5d76f4=Date[_0xe7c8e7(0x1b4)]()-_0x4070c8,_0x300bf6=_0x443ba3[_0xe7c8e7(0x1ef)](_0x3eb032=>_0x3eb032['status']===_0xe7c8e7(0x21c))[_0xe7c8e7(0x20f)],_0x3c79a6=_0x443ba3['filter'](_0x5f019a=>_0x5f019a[_0xe7c8e7(0x193)]===_0xe7c8e7(0x1df))[_0xe7c8e7(0x20f)],_0x56c247=_0x443ba3[_0xe7c8e7(0x1ef)](_0x38ac1a=>_0x38ac1a[_0xe7c8e7(0x193)]===_0xe7c8e7(0x1cd))[_0xe7c8e7(0x20f)];console['log']('━'[_0xe7c8e7(0x1ce)](0x3c)),console[_0xe7c8e7(0x1af)](_0xe7c8e7(0x1bf)),console[_0xe7c8e7(0x1af)]('━'['repeat'](0x3c)),console[_0xe7c8e7(0x1af)](_0xe7c8e7(0x1fb)+_0x443ba3['length']),console[_0xe7c8e7(0x1af)](_0xe7c8e7(0x1b5)+a5_0x1a9c86[_0xe7c8e7(0x224)](_0x300bf6)),console[_0xe7c8e7(0x1af)](_0xe7c8e7(0x1e5)+a5_0x1a9c86[_0xe7c8e7(0x1bd)](_0x3c79a6));_0x56c247>0x0&&console['log']('Errors:\x20\x20\x20'+a5_0x1a9c86[_0xe7c8e7(0x1bd)](_0x56c247));console[_0xe7c8e7(0x1af)](_0xe7c8e7(0x200)+formatElapsed(_0x5d76f4)),console[_0xe7c8e7(0x1af)]('━'[_0xe7c8e7(0x1ce)](0x3c));const _0x1cff1b={'summary':{'total':_0x443ba3[_0xe7c8e7(0x20f)],'passed':_0x300bf6,'failed':_0x3c79a6,'errors':_0x56c247>0x0?_0x56c247:undefined,'duration_ms':_0x5d76f4},'tests':_0x443ba3,'agent':{'project':_0x315fe9[_0xe7c8e7(0x197)],'name':_0x315fe9[_0xe7c8e7(0x206)],'site':_0xc03b56},'timestamp':new Date(_0x4070c8)[_0xe7c8e7(0x1d8)]()};if(_0x4f47da!==_0xe7c8e7(0x1aa)||_0x24bea1){const _0x239722=formatResults(_0x1cff1b,_0x4f47da);if(_0x24bea1)try{a5_0x1ea400[_0xe7c8e7(0x216)](_0x24bea1,_0x239722,_0xe7c8e7(0x21a)),console[_0xe7c8e7(0x1af)](),console[_0xe7c8e7(0x1af)](a5_0x1a9c86[_0xe7c8e7(0x1f0)](_0xe7c8e7(0x1d7)+_0x24bea1));}catch(_0x59e5f5){return console['log'](),console[_0xe7c8e7(0x1af)](a5_0x1a9c86[_0xe7c8e7(0x1bd)](_0xe7c8e7(0x21e)+_0x59e5f5)),0x1;}else console[_0xe7c8e7(0x1af)](),console[_0xe7c8e7(0x1af)](_0x239722);}const _0x18fe4e=_0x443ba3[_0xe7c8e7(0x1ef)](_0x1d6659=>_0x1d6659[_0xe7c8e7(0x193)]!==_0xe7c8e7(0x21c));return _0x18fe4e[_0xe7c8e7(0x20f)]>0x0?0x1:0x0;}}
@@ -1 +1 @@
1
- const a6_0x2fe3fd=a6_0x4b94;(function(_0x1de0cc,_0x169cd9){const _0x137ac2=a6_0x4b94,_0x48da94=_0x1de0cc();while(!![]){try{const _0x290b79=parseInt(_0x137ac2(0x1b7))/0x1*(parseInt(_0x137ac2(0x1d0))/0x2)+parseInt(_0x137ac2(0x1c8))/0x3*(-parseInt(_0x137ac2(0x1bf))/0x4)+parseInt(_0x137ac2(0x1c3))/0x5+-parseInt(_0x137ac2(0x1b2))/0x6+parseInt(_0x137ac2(0x1ba))/0x7+parseInt(_0x137ac2(0x1a9))/0x8+parseInt(_0x137ac2(0x1b3))/0x9;if(_0x290b79===_0x169cd9)break;else _0x48da94['push'](_0x48da94['shift']());}catch(_0x55e44c){_0x48da94['push'](_0x48da94['shift']());}}}(a6_0x50db,0xdca99));function a6_0x50db(){const _0x47cf7f=['authorization','x-xsrf-token','method','description','type','76366hVVLeV','cas','PUT','join','headers','entries','verbose','proxy-authorization','PATCH','api','data','isArray','request','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','message','POST','body','error','color','Error:\x20','workflow','substring','execute','includes','<\x20HTTP/1.1\x20','llm','set-cookie','.\x20Valid\x20types:\x20','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','10290552GbVPpC','Results\x20saved\x20to\x20','\x22.\x20','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','length','toLowerCase','log','startsWith','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','10112784lrpylk','84069ioAsgg','validate','site','status','7BuEAwL','readBodyFromFile','stack','10059427mXMYwK','output','GET','indexOf','llm-proxy','5444876ZaGEkK','file','set-cookie2','trino','4752570XDHAOC','keys','Invalid\x20API\x20type:\x20','name','has','3wDWSOf','toUpperCase','x-trino-user'];a6_0x50db=function(){return _0x47cf7f;};return a6_0x50db();}import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';function a6_0x4b94(_0x343462,_0x497263){_0x343462=_0x343462-0x18d;const _0x50db6b=a6_0x50db();let _0x4b9459=_0x50db6b[_0x343462];return _0x4b9459;}import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a6_0x2fe3fd(0x1cb),a6_0x2fe3fd(0x193),'cookie',a6_0x2fe3fd(0x1a6),a6_0x2fe3fd(0x1c1),a6_0x2fe3fd(0x1cc),'x-auth-token',a6_0x2fe3fd(0x1ca)]);function isSensitiveHeader(_0x355772){const _0x5eaccb=a6_0x2fe3fd;return SENSITIVE_HEADERS[_0x5eaccb(0x1c7)](_0x355772[_0x5eaccb(0x1ae)]());}function parseHeader(_0x5791b9){const _0x5e5b59=a6_0x2fe3fd,_0x9cbb3f=_0x5791b9[_0x5e5b59(0x1bd)](':');if(_0x9cbb3f===-0x1)throw new Error('Invalid\x20header\x20format:\x20\x22'+_0x5791b9+_0x5e5b59(0x1ab)+_0x5e5b59(0x1b1));const _0x22d925=_0x5791b9[_0x5e5b59(0x1a1)](0x0,_0x9cbb3f)['trim'](),_0x2699b2=_0x5791b9[_0x5e5b59(0x1a1)](_0x9cbb3f+0x1)['trim']();if(!_0x22d925)throw new Error(_0x5e5b59(0x1ac)+_0x5791b9+'\x22');return[_0x22d925,_0x2699b2];}export class ApiCommand extends BaseCommand{[a6_0x2fe3fd(0x1c6)]=a6_0x2fe3fd(0x195);[a6_0x2fe3fd(0x1ce)]=a6_0x2fe3fd(0x199);[a6_0x2fe3fd(0x1b4)](_0x3ead73){const _0x136996=a6_0x2fe3fd,{args:_0x5c4629,options:_0x433a0c}=_0x3ead73,_0x57f05a=_0x433a0c;if(_0x5c4629[_0x136996(0x1ad)]===0x0)return'Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list';const _0x559b84=_0x5c4629[0x0];if(!_0x559b84[_0x136996(0x1b0)]('/'))return'Endpoint\x20must\x20start\x20with\x20/:\x20'+_0x559b84;const _0x3e53f7=_0x57f05a['data'],_0x432ea6=_0x57f05a[_0x136996(0x1c0)];if(_0x3e53f7&&_0x432ea6)return _0x136996(0x1a8);const _0x32800f=_0x57f05a[_0x136996(0x1cd)]||'GET',_0x352086=[_0x136996(0x1bc),_0x136996(0x19b),_0x136996(0x18e),'DELETE',_0x136996(0x194)];if(!_0x352086[_0x136996(0x1a3)](_0x32800f[_0x136996(0x1c9)]()))return'Invalid\x20HTTP\x20method:\x20'+_0x32800f+'.\x20Valid\x20methods:\x20'+_0x352086['join'](',\x20');const _0x3b44ae=_0x57f05a[_0x136996(0x1cf)]||'td',_0x2470af=['td','cdp',_0x136996(0x1a0),_0x136996(0x1c2),_0x136996(0x1a5),_0x136996(0x1be),_0x136996(0x18d)];if(!_0x2470af[_0x136996(0x1a3)](_0x3b44ae))return _0x136996(0x1c5)+_0x3b44ae+_0x136996(0x1a7)+_0x2470af[_0x136996(0x18f)](',\x20');return undefined;}async[a6_0x2fe3fd(0x1a2)](_0x536ff5){const _0x50cabe=a6_0x2fe3fd,{options:_0x54c4db,args:_0x15db1e,tdx:_0x1b6aba}=_0x536ff5,_0x4deadc=_0x54c4db,_0x4cf099=_0x15db1e[0x0],_0x1dce16=(_0x4deadc['method']||_0x50cabe(0x1bc))[_0x50cabe(0x1c9)](),_0x24d239=_0x4deadc[_0x50cabe(0x196)],_0x370731=_0x4deadc[_0x50cabe(0x1c0)],_0x23c8b0=_0x4deadc['header'],_0x74f5d=_0x4deadc[_0x50cabe(0x1cf)]||'td';try{const _0x33c577={};if(_0x23c8b0){const _0x5bad61=Array[_0x50cabe(0x197)](_0x23c8b0)?_0x23c8b0:[_0x23c8b0];for(const _0x1d9576 of _0x5bad61){const [_0x3f8dea,_0x308139]=parseHeader(_0x1d9576);_0x33c577[_0x3f8dea]=_0x308139;}}let _0x51ddda;if(_0x24d239)_0x51ddda=_0x24d239;else{if(_0x370731)try{_0x51ddda=RawAPI[_0x50cabe(0x1b8)](_0x370731);}catch(_0x4614b0){return console['error'](_0x50cabe(0x19f)+(_0x4614b0 instanceof Error?_0x4614b0['message']:String(_0x4614b0))),0x1;}}const _0x30d6c3={'method':_0x1dce16,'apiType':_0x74f5d,'includeHeaders':_0x54c4db[_0x50cabe(0x192)]};_0x51ddda&&(_0x30d6c3[_0x50cabe(0x19c)]=_0x51ddda);Object[_0x50cabe(0x1c4)](_0x33c577)[_0x50cabe(0x1ad)]>0x0&&(_0x30d6c3[_0x50cabe(0x190)]=_0x33c577);if(_0x54c4db[_0x50cabe(0x192)]){const _0x40e25c=resolveSite(_0x54c4db[_0x50cabe(0x1b5)]),_0xc427e5=getEndpoint(_0x40e25c,_0x74f5d),_0x3c148f=''+_0xc427e5+_0x4cf099;console['error']('>\x20'+_0x1dce16+'\x20'+_0x3c148f);const _0x4347b9=getAuthHeaders(_0x40e25c),_0x402dab={..._0x4347b9,..._0x33c577};for(const [_0x47eb9a,_0x3170c7]of Object['entries'](_0x402dab)){!isSensitiveHeader(_0x47eb9a)&&console['error']('>\x20'+_0x47eb9a+':\x20'+_0x3170c7);}_0x51ddda&&console[_0x50cabe(0x19d)]('>'),console['error']('');}const _0x8d1cc0=await _0x1b6aba[_0x50cabe(0x195)][_0x50cabe(0x198)](_0x4cf099,_0x30d6c3);if(_0x54c4db['verbose']&&_0x8d1cc0['headers']){console['error'](_0x50cabe(0x1a4)+_0x8d1cc0[_0x50cabe(0x1b6)]);for(const [_0x50e524,_0x507f63]of Object[_0x50cabe(0x191)](_0x8d1cc0[_0x50cabe(0x190)])){!isSensitiveHeader(_0x50e524)&&console[_0x50cabe(0x19d)]('<\x20'+_0x50e524+':\x20'+_0x507f63);}console[_0x50cabe(0x19d)]('');}const _0x410e45=Boolean(_0x54c4db['output']),_0x26b3bc={'color':_0x54c4db[_0x50cabe(0x19e)],'noColor':_0x54c4db['noColor']||_0x410e45&&!_0x54c4db[_0x50cabe(0x19e)]},_0x1ebb6d=colorizeJSON(_0x8d1cc0[_0x50cabe(0x196)],_0x26b3bc);return _0x54c4db[_0x50cabe(0x1bb)]?(writeFileSync(_0x54c4db['output'],_0x1ebb6d),console[_0x50cabe(0x19d)](_0x50cabe(0x1aa)+_0x54c4db[_0x50cabe(0x1bb)])):console[_0x50cabe(0x1af)](_0x1ebb6d),0x0;}catch(_0x53600d){return _0x53600d instanceof Error?(console['error'](_0x50cabe(0x19f)+_0x53600d[_0x50cabe(0x19a)]),_0x54c4db[_0x50cabe(0x192)]&&_0x53600d[_0x50cabe(0x1b9)]&&console[_0x50cabe(0x19d)]('\x0aStack\x20trace:\x0a'+_0x53600d[_0x50cabe(0x1b9)])):console[_0x50cabe(0x19d)](_0x50cabe(0x19f)+String(_0x53600d)),0x1;}}}
1
+ const a6_0x36469d=a6_0x1862;(function(_0x59598b,_0x12b931){const _0xdca2f5=a6_0x1862,_0x589fd8=_0x59598b();while(!![]){try{const _0x4c36c4=-parseInt(_0xdca2f5(0x10a))/0x1*(-parseInt(_0xdca2f5(0x10b))/0x2)+-parseInt(_0xdca2f5(0xe3))/0x3+-parseInt(_0xdca2f5(0xde))/0x4+-parseInt(_0xdca2f5(0x104))/0x5*(-parseInt(_0xdca2f5(0xe6))/0x6)+parseInt(_0xdca2f5(0xdb))/0x7*(parseInt(_0xdca2f5(0x113))/0x8)+-parseInt(_0xdca2f5(0x10d))/0x9*(parseInt(_0xdca2f5(0xdd))/0xa)+parseInt(_0xdca2f5(0x117))/0xb;if(_0x4c36c4===_0x12b931)break;else _0x589fd8['push'](_0x589fd8['shift']());}catch(_0x39de03){_0x589fd8['push'](_0x589fd8['shift']());}}}(a6_0x4212,0x5558f));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';function a6_0x1862(_0x3d2936,_0x29e466){_0x3d2936=_0x3d2936-0xd2;const _0x4212ce=a6_0x4212();let _0x186203=_0x4212ce[_0x3d2936];return _0x186203;}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_0x36469d(0x10f),a6_0x36469d(0xf8),a6_0x36469d(0x103),a6_0x36469d(0x10c),a6_0x36469d(0x11c),'x-xsrf-token','x-auth-token',a6_0x36469d(0xe4)]);function isSensitiveHeader(_0x3782c4){const _0x144520=a6_0x36469d;return SENSITIVE_HEADERS['has'](_0x3782c4[_0x144520(0x100)]());}function parseHeader(_0x1e69a3){const _0x2027b6=a6_0x36469d,_0x382863=_0x1e69a3[_0x2027b6(0x101)](':');if(_0x382863===-0x1)throw new Error('Invalid\x20header\x20format:\x20\x22'+_0x1e69a3+_0x2027b6(0xfd)+_0x2027b6(0xeb));const _0x2e4b80=_0x1e69a3[_0x2027b6(0x110)](0x0,_0x382863)[_0x2027b6(0xd5)](),_0x424af4=_0x1e69a3[_0x2027b6(0x110)](_0x382863+0x1)[_0x2027b6(0xd5)]();if(!_0x2e4b80)throw new Error(_0x2027b6(0xf9)+_0x1e69a3+'\x22');return[_0x2e4b80,_0x424af4];}function a6_0x4212(){const _0x126b6b=['x-trino-user','noColor','9480lJvNWT','status','body','POST','readBodyFromFile','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','data','headers','api','workflow','color','\x0aStack\x20trace:\x0a','type','site','trino','llm-proxy','keys','join','proxy-authorization','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','toUpperCase','error','verbose','\x22.\x20','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','output','toLowerCase','indexOf','Endpoint\x20must\x20start\x20with\x20/:\x20','cookie','1420wuOOsR','DELETE','includes','stack','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','.\x20Valid\x20types:\x20','1HBvmyG','1110278lncvpl','set-cookie','9RujHpc','Error:\x20','authorization','substring','cdp','GET','1113608TeSvtE','startsWith','PATCH','llm','4250180PaSvFg','message','Results\x20saved\x20to\x20','.\x20Valid\x20methods:\x20','entries','set-cookie2','Invalid\x20API\x20type:\x20','file','isArray','trim','name','Invalid\x20HTTP\x20method:\x20','length','method','request','7CjaXrg','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','6671710JcUCeO','1528276Wtecog','header','description','execute','validate','391851oKQyzr'];a6_0x4212=function(){return _0x126b6b;};return a6_0x4212();}export class ApiCommand extends BaseCommand{[a6_0x36469d(0xd6)]=a6_0x36469d(0xee);[a6_0x36469d(0xe0)]=a6_0x36469d(0xfe);[a6_0x36469d(0xe2)](_0x39eceb){const _0x2af099=a6_0x36469d,{args:_0x49480e,options:_0x5cbfb4}=_0x39eceb,_0x4da227=_0x5cbfb4;if(_0x49480e[_0x2af099(0xd8)]===0x0)return _0x2af099(0x108);const _0x18fa2c=_0x49480e[0x0];if(!_0x18fa2c[_0x2af099(0x114)]('/'))return _0x2af099(0x102)+_0x18fa2c;const _0x11e87d=_0x4da227[_0x2af099(0xec)],_0x487ea5=_0x4da227[_0x2af099(0xd3)];if(_0x11e87d&&_0x487ea5)return _0x2af099(0xdc);const _0x5a244a=_0x4da227[_0x2af099(0xd9)]||_0x2af099(0x112),_0x351aa3=['GET',_0x2af099(0xe9),'PUT',_0x2af099(0x105),_0x2af099(0x115)];if(!_0x351aa3['includes'](_0x5a244a[_0x2af099(0xfa)]()))return _0x2af099(0xd7)+_0x5a244a+_0x2af099(0x11a)+_0x351aa3[_0x2af099(0xf7)](',\x20');const _0x6e6f2=_0x4da227[_0x2af099(0xf2)]||'td',_0x4914d4=['td',_0x2af099(0x111),_0x2af099(0xef),_0x2af099(0xf4),_0x2af099(0x116),_0x2af099(0xf5),'cas'];if(!_0x4914d4[_0x2af099(0x106)](_0x6e6f2))return _0x2af099(0xd2)+_0x6e6f2+_0x2af099(0x109)+_0x4914d4[_0x2af099(0xf7)](',\x20');return undefined;}async[a6_0x36469d(0xe1)](_0x4f0a71){const _0x2993a5=a6_0x36469d,{options:_0x4b5ca4,args:_0x420998,tdx:_0x4c6230}=_0x4f0a71,_0x442a6c=_0x4b5ca4,_0x35a9c5=_0x420998[0x0],_0xeef9ba=(_0x442a6c[_0x2993a5(0xd9)]||'GET')[_0x2993a5(0xfa)](),_0x51d0f9=_0x442a6c['data'],_0x2f4294=_0x442a6c['file'],_0x3219e2=_0x442a6c[_0x2993a5(0xdf)],_0x1c7441=_0x442a6c[_0x2993a5(0xf2)]||'td';try{const _0xea7e3c={};if(_0x3219e2){const _0x1f54fb=Array[_0x2993a5(0xd4)](_0x3219e2)?_0x3219e2:[_0x3219e2];for(const _0x1e5260 of _0x1f54fb){const [_0x53c7c9,_0x5f3132]=parseHeader(_0x1e5260);_0xea7e3c[_0x53c7c9]=_0x5f3132;}}let _0x224e4e;if(_0x51d0f9)_0x224e4e=_0x51d0f9;else{if(_0x2f4294)try{_0x224e4e=RawAPI[_0x2993a5(0xea)](_0x2f4294);}catch(_0x80d8cc){return console[_0x2993a5(0xfb)](_0x2993a5(0x10e)+(_0x80d8cc instanceof Error?_0x80d8cc[_0x2993a5(0x118)]:String(_0x80d8cc))),0x1;}}const _0x5d3d3e={'method':_0xeef9ba,'apiType':_0x1c7441,'includeHeaders':_0x4b5ca4[_0x2993a5(0xfc)]};_0x224e4e&&(_0x5d3d3e[_0x2993a5(0xe8)]=_0x224e4e);Object[_0x2993a5(0xf6)](_0xea7e3c)['length']>0x0&&(_0x5d3d3e['headers']=_0xea7e3c);if(_0x4b5ca4[_0x2993a5(0xfc)]){const _0x217645=resolveSite(_0x4b5ca4[_0x2993a5(0xf3)]),_0x5ad69f=getEndpoint(_0x217645,_0x1c7441),_0x5cb5b7=''+_0x5ad69f+_0x35a9c5;console[_0x2993a5(0xfb)]('>\x20'+_0xeef9ba+'\x20'+_0x5cb5b7);const _0x54d993=getAuthHeaders(_0x217645),_0x3211f5={..._0x54d993,..._0xea7e3c};for(const [_0x49b427,_0xfe42c7]of Object[_0x2993a5(0x11b)](_0x3211f5)){!isSensitiveHeader(_0x49b427)&&console[_0x2993a5(0xfb)]('>\x20'+_0x49b427+':\x20'+_0xfe42c7);}_0x224e4e&&console[_0x2993a5(0xfb)]('>'),console['error']('');}const _0x2546aa=await _0x4c6230[_0x2993a5(0xee)][_0x2993a5(0xda)](_0x35a9c5,_0x5d3d3e);if(_0x4b5ca4[_0x2993a5(0xfc)]&&_0x2546aa[_0x2993a5(0xed)]){console[_0x2993a5(0xfb)]('<\x20HTTP/1.1\x20'+_0x2546aa[_0x2993a5(0xe7)]);for(const [_0x493b99,_0x5a2e62]of Object[_0x2993a5(0x11b)](_0x2546aa[_0x2993a5(0xed)])){!isSensitiveHeader(_0x493b99)&&console[_0x2993a5(0xfb)]('<\x20'+_0x493b99+':\x20'+_0x5a2e62);}console[_0x2993a5(0xfb)]('');}const _0xd1df2e=Boolean(_0x4b5ca4[_0x2993a5(0xff)]),_0x2b1bd1={'color':_0x4b5ca4[_0x2993a5(0xf0)],'noColor':_0x4b5ca4[_0x2993a5(0xe5)]||_0xd1df2e&&!_0x4b5ca4[_0x2993a5(0xf0)]},_0x11daeb=colorizeJSON(_0x2546aa[_0x2993a5(0xec)],_0x2b1bd1);return _0x4b5ca4[_0x2993a5(0xff)]?(writeFileSync(_0x4b5ca4['output'],_0x11daeb),console[_0x2993a5(0xfb)](_0x2993a5(0x119)+_0x4b5ca4[_0x2993a5(0xff)])):console['log'](_0x11daeb),0x0;}catch(_0x5697f4){return _0x5697f4 instanceof Error?(console[_0x2993a5(0xfb)](_0x2993a5(0x10e)+_0x5697f4[_0x2993a5(0x118)]),_0x4b5ca4[_0x2993a5(0xfc)]&&_0x5697f4['stack']&&console['error'](_0x2993a5(0xf1)+_0x5697f4[_0x2993a5(0x107)])):console[_0x2993a5(0xfb)](_0x2993a5(0x10e)+String(_0x5697f4)),0x1;}}}
@@ -1 +1 @@
1
- const a7_0x2470f9=a7_0x1a94;(function(_0x54527b,_0x5db3e1){const _0x3f7288=a7_0x1a94,_0x463ed0=_0x54527b();while(!![]){try{const _0x3cc2f1=parseInt(_0x3f7288(0x106))/0x1+parseInt(_0x3f7288(0x131))/0x2+-parseInt(_0x3f7288(0x130))/0x3*(-parseInt(_0x3f7288(0x12f))/0x4)+parseInt(_0x3f7288(0x132))/0x5*(parseInt(_0x3f7288(0x12a))/0x6)+-parseInt(_0x3f7288(0x137))/0x7+-parseInt(_0x3f7288(0xfb))/0x8*(parseInt(_0x3f7288(0xf3))/0x9)+-parseInt(_0x3f7288(0x111))/0xa;if(_0x3cc2f1===_0x5db3e1)break;else _0x463ed0['push'](_0x463ed0['shift']());}catch(_0x22d533){_0x463ed0['push'](_0x463ed0['shift']());}}}(a7_0x2786,0x4bbd0));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens,saveOAuthTokens}from'../core/oauth-keychain.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{deleteOAuthTokens}from'../core/oauth-keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';import{startOAuthFlow}from'../core/oauth.js';import{promptSiteSelection}from'../core/constants.js';function a7_0x2786(){const _0x59b5cc=['3703686RDBeEU','all','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','Opens\x20your\x20browser\x20to\x20sign\x20in\x20with\x20SSO','tdx:\x20auth\x20setup','warn','select','apiKey','Read\x20credential\x20from\x20','message','User:\x20','trim','Read\x20credential\x20from\x20keychain','create','password','yellow','dim','jobs','accountName','\x20--profile\x20','join','System\x20keychain\x20is\x20not\x20available','\x20and\x20','green','execute','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain','site','1359vgifNR','✗\x20Validation\x20failed:\x20','getUserInfo','\x27\x20registered','Name:\x20','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','apikey','log','23096FkTZXt','Account\x20name\x20for\x20SSO\x20(press\x20Enter\x20to\x20skip):','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','\x20(site:\x20','Enter\x20your\x20TD\x20API\x20key:','/oauth/authorize','✓\x20Default\x20site\x20set\x20to\x20','status','last_name','✓\x20Authentication\x20successful\x0a','oauth','369993nqYLrj','auth:clear','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','/app/mp/ak','/users/initiate_sso\x20(account:\x20','Setup\x20cancelled','profile','red','\x20(profile:\x20','\x20\x20user_id:','ERROR','1331650yMcJFF','No\x20credential\x20found','text','method','first_name','API\x20key\x20cannot\x20be\x20empty','\x0aSetup\x20cancelled','\x20\x20\x20\x202.\x20Or\x20use\x20a\x20different\x20browser\x20profile\x20to\x20avoid\x20cached\x20sessions','filter','name','OAuth\x20tokens','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','Sign\x20in\x20with\x20browser\x20(recommended)','\x20\x20\x20\x201.\x20Run:\x20tdx\x20auth\x20setup\x20--account-name\x20<name>','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','auth','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','logLevel','tdx:\x20auth\x20clear','Use\x20an\x20API\x20key','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','\x20\x20tdx','✓\x20Profile\x20\x27','Setup\x20API\x20key\x20authentication\x20interactively','error','44658DBTHom','us01','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','Validating\x20OAuth\x20tokens...','You\x20can\x20find\x20your\x20API\x20key\x20at:','8vahfKf','138252ZUulJN','984480PkRtVv','305xTQuvD','description','Setting\x20up\x20authentication\x20for\x20site:\x20','Validating\x20API\x20key...','✓\x20Signed\x20in\x20successfully'];a7_0x2786=function(){return _0x59b5cc;};return a7_0x2786();}import a7_0x3849cd from'prompts';import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';function a7_0x1a94(_0xd17bf4,_0x3e1ccc){_0xd17bf4=_0xd17bf4-0xf2;const _0x27862d=a7_0x2786();let _0x1a94fa=_0x27862d[_0xd17bf4];return _0x1a94fa;}import a7_0x2397ae from'chalk';export async function runOAuthLoginFlow(_0xb67da2,_0x599e3d,_0x417735,_0x5a6682){const _0x1d21a6=a7_0x1a94,_0x37b68f=await isKeychainAvailable();if(!_0x37b68f)throw new Error(_0x1d21a6(0x121)+_0x1d21a6(0x139));let _0x2cc757=_0x5a6682?.[_0x1d21a6(0x14a)];if(!_0x2cc757){const _0x577046=await a7_0x3849cd({'type':_0x1d21a6(0x113),'name':_0x1d21a6(0x14a),'message':_0x1d21a6(0xfc)});if(_0x577046[_0x1d21a6(0x14a)]===undefined)throw new Error(_0x1d21a6(0x10b));_0x2cc757=_0x577046[_0x1d21a6(0x14a)]['trim']()||undefined;}const _0x36d4e2=getConsoleUrl(_0xb67da2);console[_0x1d21a6(0xfa)]('Opening\x20browser\x20for\x20authentication...');_0x2cc757?console['log']('\x20\x20'+_0x36d4e2+_0x1d21a6(0x10a)+_0x2cc757+')'):console[_0x1d21a6(0xfa)]('\x20\x20'+_0x36d4e2+_0x1d21a6(0x100));console[_0x1d21a6(0xfa)](_0x1d21a6(0x108));const _0x17c0e8=await startOAuthFlow(_0xb67da2,{'accountName':_0x2cc757});console[_0x1d21a6(0xfa)](_0x1d21a6(0x12d));const _0x241207=TDX[_0x1d21a6(0x145)]({'site':_0xb67da2,'accessToken':_0x17c0e8['access_token'],'logLevel':_0x417735??LogLevel[_0x1d21a6(0x110)]}),_0x794770=await _0x241207[_0x1d21a6(0x149)]['getUserInfo']();console[_0x1d21a6(0xfa)](a7_0x2397ae[_0x1d21a6(0x14f)](_0x1d21a6(0x136))),console[_0x1d21a6(0xfa)]('\x20\x20'+a7_0x2397ae['cyan'](_0xb67da2+':'+_0x794770['account_id'])+_0x1d21a6(0x10f)+_0x794770['id']+'\x20\x20('+_0x794770['email']+')');!_0x2cc757&&(console[_0x1d21a6(0xfa)](a7_0x2397ae[_0x1d21a6(0x148)]('\x20\x20If\x20this\x20is\x20not\x20the\x20expected\x20account:')),console['log'](a7_0x2397ae[_0x1d21a6(0x148)](_0x1d21a6(0x11e))),console[_0x1d21a6(0xfa)](a7_0x2397ae[_0x1d21a6(0x148)](_0x1d21a6(0x118))));await saveOAuthTokens(_0x17c0e8,_0x599e3d),console[_0x1d21a6(0xfa)](_0x1d21a6(0x151)+(_0x599e3d?_0x1d21a6(0x10e)+_0x599e3d+')':''));if(_0x599e3d){const _0x20d1a3={'site':_0xb67da2};saveProfileToUserConfig(_0x599e3d,_0x20d1a3),console['log'](_0x1d21a6(0x127)+_0x599e3d+_0x1d21a6(0xf6));}else saveDefaultSiteToUserConfig(_0xb67da2),console[_0x1d21a6(0xfa)]('✓\x20Default\x20site\x20set\x20to\x20'+_0xb67da2);const _0x42aa06=_0x599e3d?_0x1d21a6(0x14b)+_0x599e3d:'';console[_0x1d21a6(0xfa)](),console[_0x1d21a6(0xfa)](_0x1d21a6(0x12c)),console['log']('\x20\x20tdx'+_0x42aa06+_0x1d21a6(0x13a)),console[_0x1d21a6(0xfa)](_0x1d21a6(0x126)+_0x42aa06+_0x1d21a6(0xfd));}export async function promptAuthMethod(){const _0x17bdf5=a7_0x1a94,_0x35edc7=await a7_0x3849cd({'type':_0x17bdf5(0x13e),'name':_0x17bdf5(0x114),'message':'Choose\x20how\x20to\x20sign\x20in:','choices':[{'title':_0x17bdf5(0x11d),'description':_0x17bdf5(0x13b),'value':_0x17bdf5(0x105)},{'title':_0x17bdf5(0x124),'description':'For\x20scripts\x20or\x20headless\x20servers','value':_0x17bdf5(0xf9)}]});return _0x35edc7[_0x17bdf5(0x114)]||null;}export class AuthSetupCommand extends BaseCommand{[a7_0x2470f9(0x11a)]='auth:setup';[a7_0x2470f9(0x133)]=a7_0x2470f9(0x128);async[a7_0x2470f9(0x150)](_0x2ae9d2){const _0x438162=a7_0x2470f9,{options:_0x35e893}=_0x2ae9d2,_0x4267e4=_0x35e893['profile'];console[_0x438162(0xfa)](a7_0x2397ae['bold'](_0x438162(0x13c)));const _0x1929f0=_0x35e893[_0x438162(0xf2)]||_0x438162(0x12b),_0x224f9e=await promptSiteSelection(_0x1929f0,_0x4267e4,_0x438162(0x10b));if(!_0x224f9e)return 0x1;const _0x1d67d1=resolveSite(_0x224f9e),_0x28609e=await promptAuthMethod();if(!_0x28609e)return console[_0x438162(0xfa)](_0x438162(0x117)),0x1;if(_0x28609e===_0x438162(0x105)){const {accountName:_0x34b216}=_0x35e893;return await runOAuthLoginFlow(_0x1d67d1,_0x4267e4,_0x35e893[_0x438162(0x122)]??LogLevel[_0x438162(0x110)],{'accountName':_0x34b216}),0x0;}console['log'](_0x438162(0x134)+_0x1d67d1),console['log'](_0x438162(0x12e)),console['log']('\x20\x20'+getConsoleUrl(_0x1d67d1,_0x438162(0x109)));const _0x14dabe=await a7_0x3849cd({'type':_0x438162(0x146),'name':_0x438162(0x13f),'message':_0x438162(0xff),'validate':_0x5acd9c=>{const _0x8b2ef4=_0x438162;if(!_0x5acd9c||!_0x5acd9c[_0x8b2ef4(0x143)]())return _0x8b2ef4(0x116);return!![];}});if(!_0x14dabe['apiKey'])return console['log'](_0x438162(0x117)),0x1;const _0x3a05e9=_0x14dabe[_0x438162(0x13f)];console[_0x438162(0xfa)](_0x438162(0x135));try{const _0x199c0b=TDX[_0x438162(0x145)]({'site':_0x1d67d1,'apiKey':_0x3a05e9[_0x438162(0x143)](),'logLevel':_0x35e893[_0x438162(0x122)]??LogLevel['ERROR']}),_0x2c9802=await _0x199c0b[_0x438162(0x149)][_0x438162(0xf5)]();console[_0x438162(0xfa)](_0x438162(0x11f)+_0x2c9802['email']+')');const _0x368442=await isKeychainAvailable();_0x368442?(await saveAPIKeyAsync(_0x3a05e9['trim'](),_0x1d67d1,_0x4267e4),console[_0x438162(0xfa)](_0x438162(0x125)+(_0x4267e4?_0x438162(0x10e)+_0x4267e4+')':''))):(console['warn'](a7_0x2397ae['yellow']('⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.')),console[_0x438162(0x13d)](a7_0x2397ae['yellow']('\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.')));if(_0x4267e4){const _0x202f83={'site':_0x1d67d1};saveProfileToUserConfig(_0x4267e4,_0x202f83),console[_0x438162(0xfa)](_0x438162(0x127)+_0x4267e4+_0x438162(0xf6));}else saveDefaultSiteToUserConfig(_0x1d67d1),console[_0x438162(0xfa)](_0x438162(0x101)+_0x1d67d1);const _0x49acb5=_0x4267e4?'\x20--profile\x20'+_0x4267e4:'';return console[_0x438162(0xfa)](),console[_0x438162(0xfa)](_0x438162(0x12c)),console[_0x438162(0xfa)]('\x20\x20tdx'+_0x49acb5+_0x438162(0x13a)),console[_0x438162(0xfa)](_0x438162(0x126)+_0x49acb5+_0x438162(0xfd)),0x0;}catch(_0x3d43c3){if(_0x3d43c3 instanceof HTTPClientError&&_0x3d43c3[_0x438162(0x102)]===0x191)return printAuthError(_0x3d43c3),0x1;return console['error'](a7_0x2397ae[_0x438162(0x10d)](_0x438162(0xf4)+(_0x3d43c3 instanceof Error?_0x3d43c3[_0x438162(0x141)]:String(_0x3d43c3)))),console[_0x438162(0x129)](_0x438162(0x11c)),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x2470f9(0x11a)]=a7_0x2470f9(0x120);[a7_0x2470f9(0x133)]=a7_0x2470f9(0xf8);async[a7_0x2470f9(0x150)](_0x4e83e4){const _0x1df21d=a7_0x2470f9,{options:_0x1d6766,tdx:_0x19440b}=_0x4e83e4,_0x3c836c=_0x1d6766[_0x1df21d(0xf2)],_0x2222a1=_0x1d6766[_0x1df21d(0x10c)],_0x16d95d=_0x2222a1?_0x2222a1:'N/A';console[_0x1df21d(0xfa)]('tdx\x20profile:\x20'+_0x16d95d+_0x1df21d(0xfe)+_0x3c836c+')');const _0x3e235f=await getOAuthTokens(_0x2222a1);if(_0x3e235f)console[_0x1df21d(0xfa)]('Credential\x20type:\x20OAuth'),console[_0x1df21d(0xfa)](_0x1df21d(0x144)+(_0x2222a1?'\x20(profile:\x20'+_0x2222a1+')':''));else{const _0x3dd8dd=await resolveAPIKeyAsync(_0x3c836c,_0x2222a1);if(_0x3dd8dd){const {source:_0x4a07db,isDeprecated:_0x25123a}=_0x3dd8dd,_0x4e9acc=_0x1df21d(0x140)+_0x4a07db;console['log'](_0x25123a?a7_0x2397ae[_0x1df21d(0x147)](_0x4e9acc):_0x4e9acc);}else console['log'](a7_0x2397ae[_0x1df21d(0x147)](_0x1df21d(0x112)));}try{const _0x2d5b22=await _0x19440b['jobs'][_0x1df21d(0xf5)]();return console['log'](a7_0x2397ae['green'](_0x1df21d(0x104))),console['log'](_0x1df21d(0x142)+_0x2d5b22['email']),(_0x2d5b22[_0x1df21d(0x115)]||_0x2d5b22[_0x1df21d(0x103)])&&console[_0x1df21d(0xfa)](_0x1df21d(0xf7)+[_0x2d5b22[_0x1df21d(0x115)],_0x2d5b22[_0x1df21d(0x103)]][_0x1df21d(0x119)](Boolean)[_0x1df21d(0x14c)]('\x20')),0x0;}catch(_0x465a67){return _0x465a67 instanceof HTTPClientError&&_0x465a67['status']===0x191?printAuthError(_0x465a67,!![],_0x2222a1):console[_0x1df21d(0x129)](a7_0x2397ae['red'](_0x1df21d(0xf4)+(_0x465a67 instanceof Error?_0x465a67[_0x1df21d(0x141)]:String(_0x465a67)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x2470f9(0x11a)]=a7_0x2470f9(0x107);[a7_0x2470f9(0x133)]='Remove\x20API\x20key\x20from\x20system\x20keychain';async[a7_0x2470f9(0x150)](_0x2d4a82){const _0x5a678e=a7_0x2470f9,{options:_0x2e8013}=_0x2d4a82,_0x1ad896=_0x2e8013['profile'];console[_0x5a678e(0xfa)](a7_0x2397ae['bold'](_0x5a678e(0x123)));const _0x531a0f=await isKeychainAvailable();if(!_0x531a0f)return console['error'](a7_0x2397ae['red'](_0x5a678e(0x14d))),0x1;const [_0x256085,_0xd861da]=await Promise[_0x5a678e(0x138)]([deleteKeychainAPIKey(_0x1ad896),deleteOAuthTokens(_0x1ad896)]);if(_0x256085||_0xd861da){clearCredentialCache();const _0x3e2c12=[_0x256085&&'API\x20key',_0xd861da&&_0x5a678e(0x11b)]['filter'](Boolean)[_0x5a678e(0x14c)](_0x5a678e(0x14e));return console[_0x5a678e(0xfa)]('✓\x20'+_0x3e2c12+'\x20removed\x20from\x20keychain'+(_0x1ad896?_0x5a678e(0x10e)+_0x1ad896+')':'')),0x0;}else return console[_0x5a678e(0xfa)]('No\x20credentials\x20found\x20in\x20keychain'+(_0x1ad896?'\x20for\x20profile:\x20'+_0x1ad896:'')),0x1;}}
1
+ const a7_0x31d31d=a7_0x26b1;(function(_0x2a4290,_0x58b237){const _0xf92c5=a7_0x26b1,_0x82357c=_0x2a4290();while(!![]){try{const _0x40e8a2=-parseInt(_0xf92c5(0x17e))/0x1+parseInt(_0xf92c5(0x191))/0x2+-parseInt(_0xf92c5(0x1c5))/0x3*(-parseInt(_0xf92c5(0x18b))/0x4)+-parseInt(_0xf92c5(0x171))/0x5*(-parseInt(_0xf92c5(0x17a))/0x6)+parseInt(_0xf92c5(0x1c6))/0x7+-parseInt(_0xf92c5(0x1cc))/0x8*(-parseInt(_0xf92c5(0x194))/0x9)+-parseInt(_0xf92c5(0x189))/0xa*(parseInt(_0xf92c5(0x18e))/0xb);if(_0x40e8a2===_0x58b237)break;else _0x82357c['push'](_0x82357c['shift']());}catch(_0x2bf6d3){_0x82357c['push'](_0x82357c['shift']());}}}(a7_0x8422,0x74922));import{BaseCommand,printAuthError}from'./command.js';function a7_0x8422(){const _0x534ab9=['\x20\x20\x20\x201.\x20Run:\x20tdx\x20auth\x20setup\x20--account-name\x20<name>','method','Opens\x20your\x20browser\x20to\x20sign\x20in\x20with\x20SSO','ERROR','Read\x20credential\x20from\x20','error','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','Account\x20name\x20for\x20SSO\x20(press\x20Enter\x20to\x20skip):','Validating\x20API\x20key...','Setup\x20cancelled','Credential\x20type:\x20OAuth','System\x20keychain\x20is\x20not\x20available','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','\x20(site:\x20','bold','Opening\x20browser\x20for\x20authentication...','\x20for\x20profile:\x20','\x20\x20(','filter','Remove\x20API\x20key\x20from\x20system\x20keychain','✓\x20Authentication\x20successful\x0a','description','log','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','last_name','dim','status','email','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain','red','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','✓\x20Profile\x20\x27','all','create','User:\x20','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','Setup\x20API\x20key\x20authentication\x20interactively','green','✓\x20Default\x20site\x20set\x20to\x20','/app/mp/ak','85497MxzYgm','2238971LjWCxK','auth:setup','account_id','Choose\x20how\x20to\x20sign\x20in:','apiKey','jobs','1056072wBUtPC','tdx:\x20auth\x20clear','us01','\x20removed\x20from\x20keychain','✗\x20Validation\x20failed:\x20','\x0aSetup\x20cancelled','2610KoCgcS','yellow','N/A','logLevel','No\x20credentials\x20found\x20in\x20keychain','/users/initiate_sso\x20(account:\x20','\x20\x20user_id:','name','\x20and\x20','2424TKyETw','trim','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','getUserInfo','137720gzUnDI','password','select','\x20\x20If\x20this\x20is\x20not\x20the\x20expected\x20account:','accountName','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','access_token','Sign\x20in\x20with\x20browser\x20(recommended)','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','/oauth/authorize','1080Naawte','warn','92spGSFz','\x20\x20tdx','For\x20scripts\x20or\x20headless\x20servers','72138fajWVu','oauth','auth:clear','10462TBQRmU','profile','\x20\x20\x20\x202.\x20Or\x20use\x20a\x20different\x20browser\x20profile\x20to\x20avoid\x20cached\x20sessions','9dVzGIS','tdx\x20profile:\x20','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','OAuth\x20tokens','✓\x20Signed\x20in\x20successfully','site','\x20(profile:\x20','Validating\x20OAuth\x20tokens...','\x27\x20registered'];a7_0x8422=function(){return _0x534ab9;};return a7_0x8422();}import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens,saveOAuthTokens}from'../core/oauth-keychain.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{deleteOAuthTokens}from'../core/oauth-keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';import{startOAuthFlow}from'../core/oauth.js';import{promptSiteSelection}from'../core/constants.js';import a7_0x4d5ff3 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_0x26bf08 from'chalk';export async function runOAuthLoginFlow(_0x50d1bd,_0x9f155a,_0x3272a7,_0x570dc7){const _0x16ca04=a7_0x26b1,_0x5d059e=await isKeychainAvailable();if(!_0x5d059e)throw new Error(_0x16ca04(0x1a3)+_0x16ca04(0x187));let _0x4db57a=_0x570dc7?.[_0x16ca04(0x182)];if(!_0x4db57a){const _0x2ef08a=await a7_0x4d5ff3({'type':'text','name':'accountName','message':_0x16ca04(0x1a4)});if(_0x2ef08a[_0x16ca04(0x182)]===undefined)throw new Error(_0x16ca04(0x1a6));_0x4db57a=_0x2ef08a[_0x16ca04(0x182)][_0x16ca04(0x17b)]()||undefined;}const _0x44e143=getConsoleUrl(_0x50d1bd);console['log'](_0x16ca04(0x1ac));_0x4db57a?console[_0x16ca04(0x1b3)]('\x20\x20'+_0x44e143+_0x16ca04(0x176)+_0x4db57a+')'):console['log']('\x20\x20'+_0x44e143+_0x16ca04(0x188));console[_0x16ca04(0x1b3)](_0x16ca04(0x1bb));const _0x2b52e0=await startOAuthFlow(_0x50d1bd,{'accountName':_0x4db57a});console[_0x16ca04(0x1b3)](_0x16ca04(0x19b));const _0x3deba2=TDX['create']({'site':_0x50d1bd,'accessToken':_0x2b52e0[_0x16ca04(0x184)],'logLevel':_0x3272a7??LogLevel[_0x16ca04(0x1a0)]}),_0x3de530=await _0x3deba2['jobs'][_0x16ca04(0x17d)]();console[_0x16ca04(0x1b3)](a7_0x26bf08[_0x16ca04(0x1c2)](_0x16ca04(0x198))),console['log']('\x20\x20'+a7_0x26bf08['cyan'](_0x50d1bd+':'+_0x3de530[_0x16ca04(0x1c8)])+_0x16ca04(0x177)+_0x3de530['id']+_0x16ca04(0x1ae)+_0x3de530[_0x16ca04(0x1b8)]+')');!_0x4db57a&&(console[_0x16ca04(0x1b3)](a7_0x26bf08[_0x16ca04(0x1b6)](_0x16ca04(0x181))),console[_0x16ca04(0x1b3)](a7_0x26bf08[_0x16ca04(0x1b6)](_0x16ca04(0x19d))),console[_0x16ca04(0x1b3)](a7_0x26bf08[_0x16ca04(0x1b6)](_0x16ca04(0x193))));await saveOAuthTokens(_0x2b52e0,_0x9f155a),console[_0x16ca04(0x1b3)](_0x16ca04(0x1b9)+(_0x9f155a?'\x20(profile:\x20'+_0x9f155a+')':''));if(_0x9f155a){const _0x41aafe={'site':_0x50d1bd};saveProfileToUserConfig(_0x9f155a,_0x41aafe),console[_0x16ca04(0x1b3)](_0x16ca04(0x1bc)+_0x9f155a+'\x27\x20registered');}else saveDefaultSiteToUserConfig(_0x50d1bd),console[_0x16ca04(0x1b3)](_0x16ca04(0x1c3)+_0x50d1bd);const _0x286c70=_0x9f155a?'\x20--profile\x20'+_0x9f155a:'';console[_0x16ca04(0x1b3)](),console[_0x16ca04(0x1b3)]('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console[_0x16ca04(0x1b3)](_0x16ca04(0x18c)+_0x286c70+_0x16ca04(0x196)),console[_0x16ca04(0x1b3)](_0x16ca04(0x18c)+_0x286c70+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases');}function a7_0x26b1(_0x468169,_0x53d80f){_0x468169=_0x468169-0x16e;const _0x842299=a7_0x8422();let _0x26b1cf=_0x842299[_0x468169];return _0x26b1cf;}export async function promptAuthMethod(){const _0x332982=a7_0x26b1,_0x32ceab=await a7_0x4d5ff3({'type':_0x332982(0x180),'name':_0x332982(0x19e),'message':_0x332982(0x1c9),'choices':[{'title':_0x332982(0x185),'description':_0x332982(0x19f),'value':_0x332982(0x18f)},{'title':'Use\x20an\x20API\x20key','description':_0x332982(0x18d),'value':'apikey'}]});return _0x32ceab[_0x332982(0x19e)]||null;}export class AuthSetupCommand extends BaseCommand{[a7_0x31d31d(0x178)]=a7_0x31d31d(0x1c7);[a7_0x31d31d(0x1b2)]=a7_0x31d31d(0x1c1);async['execute'](_0xfd9993){const _0xbf3fe9=a7_0x31d31d,{options:_0x3a9160}=_0xfd9993,_0x47d1fb=_0x3a9160[_0xbf3fe9(0x192)];console[_0xbf3fe9(0x1b3)](a7_0x26bf08[_0xbf3fe9(0x1ab)]('tdx:\x20auth\x20setup'));const _0x3f110d=_0x3a9160['site']||_0xbf3fe9(0x1ce),_0x43d3b7=await promptSiteSelection(_0x3f110d,_0x47d1fb,'Setup\x20cancelled');if(!_0x43d3b7)return 0x1;const _0x3f9b0e=resolveSite(_0x43d3b7),_0x77c25b=await promptAuthMethod();if(!_0x77c25b)return console[_0xbf3fe9(0x1b3)](_0xbf3fe9(0x170)),0x1;if(_0x77c25b==='oauth'){const {accountName:_0x42ac28}=_0x3a9160;return await runOAuthLoginFlow(_0x3f9b0e,_0x47d1fb,_0x3a9160[_0xbf3fe9(0x174)]??LogLevel[_0xbf3fe9(0x1a0)],{'accountName':_0x42ac28}),0x0;}console['log']('Setting\x20up\x20authentication\x20for\x20site:\x20'+_0x3f9b0e),console[_0xbf3fe9(0x1b3)]('You\x20can\x20find\x20your\x20API\x20key\x20at:'),console['log']('\x20\x20'+getConsoleUrl(_0x3f9b0e,_0xbf3fe9(0x1c4)));const _0x46cfaf=await a7_0x4d5ff3({'type':_0xbf3fe9(0x17f),'name':_0xbf3fe9(0x1ca),'message':'Enter\x20your\x20TD\x20API\x20key:','validate':_0x546c2=>{const _0xf7a836=_0xbf3fe9;if(!_0x546c2||!_0x546c2[_0xf7a836(0x17b)]())return'API\x20key\x20cannot\x20be\x20empty';return!![];}});if(!_0x46cfaf[_0xbf3fe9(0x1ca)])return console['log'](_0xbf3fe9(0x170)),0x1;const _0x5c892d=_0x46cfaf[_0xbf3fe9(0x1ca)];console['log'](_0xbf3fe9(0x1a5));try{const _0x58116a=TDX[_0xbf3fe9(0x1be)]({'site':_0x3f9b0e,'apiKey':_0x5c892d[_0xbf3fe9(0x17b)](),'logLevel':_0x3a9160[_0xbf3fe9(0x174)]??LogLevel[_0xbf3fe9(0x1a0)]}),_0x3400a5=await _0x58116a[_0xbf3fe9(0x1cb)][_0xbf3fe9(0x17d)]();console[_0xbf3fe9(0x1b3)](_0xbf3fe9(0x186)+_0x3400a5[_0xbf3fe9(0x1b8)]+')');const _0x18b785=await isKeychainAvailable();_0x18b785?(await saveAPIKeyAsync(_0x5c892d[_0xbf3fe9(0x17b)](),_0x3f9b0e,_0x47d1fb),console[_0xbf3fe9(0x1b3)](_0xbf3fe9(0x1b4)+(_0x47d1fb?_0xbf3fe9(0x19a)+_0x47d1fb+')':''))):(console[_0xbf3fe9(0x18a)](a7_0x26bf08[_0xbf3fe9(0x172)]('⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.')),console[_0xbf3fe9(0x18a)](a7_0x26bf08[_0xbf3fe9(0x172)]('\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.')));if(_0x47d1fb){const _0x76dbb7={'site':_0x3f9b0e};saveProfileToUserConfig(_0x47d1fb,_0x76dbb7),console[_0xbf3fe9(0x1b3)](_0xbf3fe9(0x1bc)+_0x47d1fb+_0xbf3fe9(0x19c));}else saveDefaultSiteToUserConfig(_0x3f9b0e),console[_0xbf3fe9(0x1b3)](_0xbf3fe9(0x1c3)+_0x3f9b0e);const _0x302bae=_0x47d1fb?'\x20--profile\x20'+_0x47d1fb:'';return console[_0xbf3fe9(0x1b3)](),console[_0xbf3fe9(0x1b3)](_0xbf3fe9(0x1c0)),console['log']('\x20\x20tdx'+_0x302bae+_0xbf3fe9(0x196)),console[_0xbf3fe9(0x1b3)](_0xbf3fe9(0x18c)+_0x302bae+_0xbf3fe9(0x17c)),0x0;}catch(_0x222c17){if(_0x222c17 instanceof HTTPClientError&&_0x222c17['status']===0x191)return printAuthError(_0x222c17),0x1;return console[_0xbf3fe9(0x1a2)](a7_0x26bf08[_0xbf3fe9(0x1ba)](_0xbf3fe9(0x16f)+(_0x222c17 instanceof Error?_0x222c17['message']:String(_0x222c17)))),console[_0xbf3fe9(0x1a2)](_0xbf3fe9(0x1a9)),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x31d31d(0x178)]='auth';[a7_0x31d31d(0x1b2)]=a7_0x31d31d(0x183);async['execute'](_0x3696c3){const _0x48f688=a7_0x31d31d,{options:_0x4f5e8c,tdx:_0x3eaabb}=_0x3696c3,_0x54e2ec=_0x4f5e8c[_0x48f688(0x199)],_0x5f3911=_0x4f5e8c[_0x48f688(0x192)],_0x107d28=_0x5f3911?_0x5f3911:_0x48f688(0x173);console['log'](_0x48f688(0x195)+_0x107d28+_0x48f688(0x1aa)+_0x54e2ec+')');const _0x2fe4b9=await getOAuthTokens(_0x5f3911);if(_0x2fe4b9)console[_0x48f688(0x1b3)](_0x48f688(0x1a7)),console[_0x48f688(0x1b3)]('Read\x20credential\x20from\x20keychain'+(_0x5f3911?_0x48f688(0x19a)+_0x5f3911+')':''));else{const _0xa2c55b=await resolveAPIKeyAsync(_0x54e2ec,_0x5f3911);if(_0xa2c55b){const {source:_0x5f135d,isDeprecated:_0xcdf241}=_0xa2c55b,_0x20bf73=_0x48f688(0x1a1)+_0x5f135d;console['log'](_0xcdf241?a7_0x26bf08[_0x48f688(0x172)](_0x20bf73):_0x20bf73);}else console[_0x48f688(0x1b3)](a7_0x26bf08[_0x48f688(0x172)]('No\x20credential\x20found'));}try{const _0x147e34=await _0x3eaabb[_0x48f688(0x1cb)][_0x48f688(0x17d)]();return console[_0x48f688(0x1b3)](a7_0x26bf08[_0x48f688(0x1c2)](_0x48f688(0x1b1))),console['log'](_0x48f688(0x1bf)+_0x147e34[_0x48f688(0x1b8)]),(_0x147e34['first_name']||_0x147e34['last_name'])&&console[_0x48f688(0x1b3)]('Name:\x20'+[_0x147e34['first_name'],_0x147e34[_0x48f688(0x1b5)]][_0x48f688(0x1af)](Boolean)['join']('\x20')),0x0;}catch(_0x59a204){return _0x59a204 instanceof HTTPClientError&&_0x59a204[_0x48f688(0x1b7)]===0x191?printAuthError(_0x59a204,!![],_0x5f3911):console[_0x48f688(0x1a2)](a7_0x26bf08[_0x48f688(0x1ba)](_0x48f688(0x16f)+(_0x59a204 instanceof Error?_0x59a204['message']:String(_0x59a204)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x31d31d(0x178)]=a7_0x31d31d(0x190);[a7_0x31d31d(0x1b2)]=a7_0x31d31d(0x1b0);async['execute'](_0x2d8187){const _0xc34504=a7_0x31d31d,{options:_0x3564d4}=_0x2d8187,_0x424c2a=_0x3564d4[_0xc34504(0x192)];console['log'](a7_0x26bf08[_0xc34504(0x1ab)](_0xc34504(0x1cd)));const _0x5309aa=await isKeychainAvailable();if(!_0x5309aa)return console[_0xc34504(0x1a2)](a7_0x26bf08[_0xc34504(0x1ba)](_0xc34504(0x1a8))),0x1;const [_0x2c4c8b,_0x5ebb60]=await Promise[_0xc34504(0x1bd)]([deleteKeychainAPIKey(_0x424c2a),deleteOAuthTokens(_0x424c2a)]);if(_0x2c4c8b||_0x5ebb60){clearCredentialCache();const _0x4c5dfc=[_0x2c4c8b&&'API\x20key',_0x5ebb60&&_0xc34504(0x197)]['filter'](Boolean)['join'](_0xc34504(0x179));return console['log']('✓\x20'+_0x4c5dfc+_0xc34504(0x16e)+(_0x424c2a?_0xc34504(0x19a)+_0x424c2a+')':'')),0x0;}else return console['log'](_0xc34504(0x175)+(_0x424c2a?_0xc34504(0x1ad)+_0x424c2a:'')),0x1;}}