@treasuredata/tdx 2026.4.9 → 2026.4.11

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_0x297b4c=a3_0xe324;(function(_0x3b5bcb,_0x35bcb1){const _0x511eeb=a3_0xe324,_0x5e8fd=_0x3b5bcb();while(!![]){try{const _0x507ed2=parseInt(_0x511eeb(0xf9))/0x1*(-parseInt(_0x511eeb(0x10a))/0x2)+parseInt(_0x511eeb(0x109))/0x3+-parseInt(_0x511eeb(0xfa))/0x4*(-parseInt(_0x511eeb(0xfb))/0x5)+-parseInt(_0x511eeb(0x11b))/0x6+parseInt(_0x511eeb(0x117))/0x7*(parseInt(_0x511eeb(0xfe))/0x8)+-parseInt(_0x511eeb(0x104))/0x9*(-parseInt(_0x511eeb(0x108))/0xa)+parseInt(_0x511eeb(0x10b))/0xb*(parseInt(_0x511eeb(0x11a))/0xc);if(_0x507ed2===_0x35bcb1)break;else _0x5e8fd['push'](_0x5e8fd['shift']());}catch(_0x999861){_0x5e8fd['push'](_0x5e8fd['shift']());}}}(a3_0x4ba0,0xb1efc));function a3_0xe324(_0x550af9,_0x3e927d){_0x550af9=_0x550af9-0xf8;const _0x4ba01b=a3_0x4ba0();let _0xe32432=_0x4ba01b[_0x550af9];return _0xe32432;}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';function a3_0x4ba0(){const _0xde8ffe=['execute','description','1077OQkrJA','1413188fcJQXa','5sgTjgU','site','\x27...','5080FDmlrw','\x20\x20Cause:\x20','Error:\x20Segment\x20name\x20is\x20required','data','List\x20activations\x20for\x20a\x20segment','listActivations','198IkvKJa','Site:\x20','message','Child\x20name:\x20','117400ifOYqq','2594268lgsbFY','772oZmoll','341KtLVqF','activations','Resolved\x20parent\x20ID:\x20','Listing\x20activations\x20for\x20segment\x20\x27','resolveParentId','Resolved\x20child\x20ID:\x20','✔\x20Found\x20','segment','\x20activation','length','Resolving\x20child\x20segment\x20\x27','error','4137NuplCK','cause','name','199596pgsgqr','7336146PcNKeP','Parent\x20name:\x20','verbose','resolveSegmentId'];a3_0x4ba0=function(){return _0xde8ffe;};return a3_0x4ba0();}import{withSpinner}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';export class ActivationsCommand extends BaseCommand{[a3_0x297b4c(0x119)]=a3_0x297b4c(0x10c);[a3_0x297b4c(0xf8)]=a3_0x297b4c(0x102);async[a3_0x297b4c(0x11f)](_0x157015){const _0x582e8f=a3_0x297b4c,{options:_0x285872,args:_0x57b6fd,tdx:_0x17fde4}=_0x157015;if(_0x57b6fd[_0x582e8f(0x114)]===0x0)return console['error'](_0x582e8f(0x100)),console[_0x582e8f(0x116)]('Usage:\x20tdx\x20activations\x20<parent_name/child_name>'),0x1;try{const {parentId:_0x57c62e,childId:_0x46dd31}=parseSegmentRef(_0x57b6fd[0x0]);if(!_0x46dd31)return console['error']('Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations'),console[_0x582e8f(0x116)]('Usage:\x20tdx\x20activations\x20<parent_name/child_name>'),0x1;_0x285872[_0x582e8f(0x11d)]&&(console[_0x582e8f(0x116)](_0x582e8f(0x105)+_0x285872[_0x582e8f(0xfc)]),console[_0x582e8f(0x116)](_0x582e8f(0x11c)+_0x57c62e),console['error'](_0x582e8f(0x107)+_0x46dd31));const _0xf07a52=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x57c62e+_0x582e8f(0xfd),()=>_0x17fde4[_0x582e8f(0x112)][_0x582e8f(0x10f)](_0x57c62e),{'verbose':_0x285872['verbose']}),_0x4d6533=_0xf07a52['data'];_0x285872['verbose']&&console[_0x582e8f(0x116)](_0x582e8f(0x10d)+_0x4d6533);const _0x45bdf6=await withSpinner(_0x582e8f(0x115)+_0x46dd31+_0x582e8f(0xfd),()=>_0x17fde4[_0x582e8f(0x112)][_0x582e8f(0x11e)](_0x4d6533,_0x46dd31),{'verbose':_0x285872[_0x582e8f(0x11d)]}),_0x39957c=_0x45bdf6['data'];_0x285872[_0x582e8f(0x11d)]&&console[_0x582e8f(0x116)](_0x582e8f(0x110)+_0x39957c);const _0x31df3d=await withSpinner(_0x582e8f(0x10e)+_0x46dd31+_0x582e8f(0xfd),()=>_0x17fde4[_0x582e8f(0x112)][_0x582e8f(0x103)](_0x4d6533,_0x39957c),{'verbose':_0x285872[_0x582e8f(0x11d)]}),_0x1c2302=_0x31df3d[_0x582e8f(0x101)];return console[_0x582e8f(0x116)](_0x582e8f(0x111)+_0x1c2302[_0x582e8f(0x114)]+_0x582e8f(0x113)+(_0x1c2302['length']!==0x1?'s':'')),await handleSDKOutput(_0x1c2302,_0x285872),0x0;}catch(_0x114597){if(_0x114597 instanceof SDKError)return console['error']('Error:\x20'+_0x114597[_0x582e8f(0x106)]),_0x114597[_0x582e8f(0x118)]&&console[_0x582e8f(0x116)](_0x582e8f(0xff)+_0x114597['cause']),0x1;throw _0x114597;}}}
@@ -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
+ const a4_0x4e85d1=a4_0x35e5;(function(_0x1ee4fe,_0x10e81a){const _0x18d610=a4_0x35e5,_0x705e00=_0x1ee4fe();while(!![]){try{const _0x1de0f2=-parseInt(_0x18d610(0x1c8))/0x1+parseInt(_0x18d610(0x162))/0x2+parseInt(_0x18d610(0x1c5))/0x3+-parseInt(_0x18d610(0x180))/0x4+parseInt(_0x18d610(0x18a))/0x5+-parseInt(_0x18d610(0x175))/0x6+parseInt(_0x18d610(0x161))/0x7;if(_0x1de0f2===_0x10e81a)break;else _0x705e00['push'](_0x705e00['shift']());}catch(_0x3053fa){_0x705e00['push'](_0x705e00['shift']());}}}(a4_0x358c,0x74018));import a4_0x584ae5 from'chalk';import a4_0xb9399 from'path';import{existsSync,readFileSync}from'fs';function a4_0x35e5(_0x10c590,_0x57c72f){_0x10c590=_0x10c590-0x151;const _0x358cfc=a4_0x358c();let _0x35e577=_0x358cfc[_0x10c590];return _0x35e577;}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';function a4_0x358c(){const _0x101daf=['agentId','INVALID_ARGUMENT','execute','<new-name>','push','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','\x20\x20tdx\x20agent\x20pull\x20','\x0aChanges\x20to\x20integration\x20\x27','agents','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','\x20files\x20to\x20','force','dryRun','projectId','-\x20no\x20files\x20written','created','llm','Analyzing\x20project\x20\x22','\x20updated','description','pushProject','parse','\x0a✔\x20Pulled\x20','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','\x20changed','Dry\x20run\x20-\x20no\x20changes\x20made','output','Project\x20cloned\x20with\x20errors','Using\x20local\x20project:\x20','message','Output:\x20','\x0aChanges\x20to\x20chat\x20interface\x20\x27','Using\x20current\x20project:\x20','green','isNew','\x22\x20to\x20a\x20different\x20profile','Using\x20project\x20from\x20','539070XUlpPn','New\x20project\x20ID:\x20','integrations','406316HXmcYq','textKnowledgeBases','\x20new','dim','\x20\x20Prompt\x20\x22','\x20\x20tdx\x20agent\x20clone\x20agents/','outputPath','New\x20project\x20name\x20is\x20required','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','Source:\x20','updated','errors','\x20resources\x20to\x20\x27','sourceProjectName','utf-8','Output\x20path:\x20','\x20errors','cwd','no_local_folder','\x0aPull\x20summary\x20for\x20\x27','repeat','\x20\x20Form\x20Interface\x20\x22','-\x20nothing\x20pushed','formInterfaces','\x20\x20Form\x20Interfaces:\x20','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','\x0aProject\x20pushed\x20with\x20errors','Using\x20project\x20from\x20context:\x20','New\x20project:\x20','\x22\x20to\x20new\x20project\x20\x22','Errors:','unchanged','Cloning\x20\x22','agentName','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','\x20\x20Prompts:\x20','\x20resources?','\x0aPush\x20summary\x20for\x20\x27','Project\x20cloned\x20successfully','cloneProject','reason','site','\x20successfully','dirname','Writing\x20files...','prompts','\x20\x20tdx\x20agent\x20clone\x20--name\x20<new-name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clone\x20from\x20context\x20(llm_project)','\x0a✔\x20Pushed\x20','\x0aWrite\x20','Project:\x20','projectName','experimentalKnowledgeBases','\x0aError:','\x20=\x20','newProjectId','pullProject','\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','\x22:\x20','\x22\x20from\x20project\x20\x22','log','No\x20tdx.json\x20found\x20in\x20','Failed\x20to\x20push\x20agent:\x20','context','\x20|\x20','\x20\x20Integrations:\x20','\x20\x20Chat\x20Interfaces:\x20','Agent\x20','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','tdx.json','\x20--name\x20','\x20\x20Target:\x20','arg-dir','\x27\x20to\x20create\x20the\x20folder\x20structure.','llmProject','counts','agent:push','\x22...','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','experimentalArtifacts','\x20\x20Chat\x20Interface\x20\x22','new','action','knowledgeBases','Would\x20clone:','Analyzing\x20changes\x20to\x20push...','Chat:\x20','\x20\x20Integration\x20\x22','3538766hqQxvr','274700yBrUrQ','diff','Pushing\x20agent\x20from\x20\x22','\x0aChanges:','\x20\x20Agent\x20\x22','\x22\x20to\x20\x22','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','chatInterfaces','found','Pulling\x20agent\x20\x22','Would\x20push\x20agent:\x20','\x0aErrors\x20found:','\x20\x20Source:\x20','cyan','yellow','llm_project','\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','join','\x0aPush\x20','373266eHXJTP','pushAgent','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','Agent:\x20','profile','\x20\x20Experimental\x20Artifacts:\x20','total','pullAgent','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','Pushing\x20to\x20project...','\x20\x20Text\x20Knowledge\x20Bases:\x20','546364XVqVop','newProjectName','\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','source','hasChanges','\x20unchanged','Using\x20context\x20project:\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Cannot\x20clone\x20from\x20context\x20project\x20\x22','cwd-config','1288500zZZOeE','error','\x20\x20Agents:\x20','Using\x20project:\x20','outputDir','\x20\x20Text\x20Knowledge\x20Base\x20\x22','\x0aChanges\x20to\x20agent\x20\x27','red','\x20\x20Knowledge\x20Bases:\x20','session','name','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','gray','✔\x20Context\x20set:\x20','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','\x20files?','Dry\x20run\x20-\x20no\x20files\x20written','agent:pull','yes','Cancelled'];a4_0x358c=function(){return _0x101daf;};return a4_0x358c();}import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x4099ba){const _0x2291a4=a4_0x35e5,_0x5d6bd4=[];if(_0x4099ba[_0x2291a4(0x17b)]!==undefined)_0x5d6bd4[_0x2291a4(0x1a4)](_0x4099ba['total']+'\x20total');if(_0x4099ba['new']!==undefined&&_0x4099ba[_0x2291a4(0x15a)]>0x0)_0x5d6bd4['push'](a4_0x584ae5[_0x2291a4(0x1c1)](_0x4099ba[_0x2291a4(0x15a)]+_0x2291a4(0x1ca)));if(_0x4099ba[_0x2291a4(0x1af)]!==undefined&&_0x4099ba[_0x2291a4(0x1af)]>0x0)_0x5d6bd4[_0x2291a4(0x1a4)](a4_0x584ae5[_0x2291a4(0x1c1)](_0x4099ba[_0x2291a4(0x1af)]+'\x20created'));if(_0x4099ba['updated']!==undefined&&_0x4099ba[_0x2291a4(0x1d2)]>0x0)_0x5d6bd4[_0x2291a4(0x1a4)](a4_0x584ae5[_0x2291a4(0x170)](_0x4099ba[_0x2291a4(0x1d2)]+_0x2291a4(0x1b2)));if(_0x4099ba['unchanged']!==undefined&&_0x4099ba[_0x2291a4(0x1e7)]>0x0)_0x5d6bd4[_0x2291a4(0x1a4)](a4_0x584ae5[_0x2291a4(0x196)](_0x4099ba[_0x2291a4(0x1e7)]+_0x2291a4(0x185)));if(_0x4099ba['errors']!==undefined&&_0x4099ba[_0x2291a4(0x1d3)]>0x0)_0x5d6bd4[_0x2291a4(0x1a4)](a4_0x584ae5[_0x2291a4(0x191)](_0x4099ba[_0x2291a4(0x1d3)]+_0x2291a4(0x1d8)));return _0x5d6bd4[_0x2291a4(0x173)](',\x20');}function displayDiffs(_0x4fa5b5,_0x3a3b01,_0x5f207d,_0x25c6f0,_0x37ce88,_0x1167b3,_0x436765,_0x2af8e1,_0x95ca2e){const _0x517fa0=a4_0x35e5;for(const _0xf32ff of _0x4fa5b5){if(_0xf32ff[_0x517fa0(0x163)]){const _0x4dd7a9=_0xf32ff['agentName']||_0xf32ff[_0x517fa0(0x194)];console['log'](_0x517fa0(0x190)+_0x4dd7a9+'\x27:'),console[_0x517fa0(0x203)]('─'['repeat'](0x3c)),console[_0x517fa0(0x203)](_0xf32ff[_0x517fa0(0x163)]),console[_0x517fa0(0x203)]('─'[_0x517fa0(0x1dc)](0x3c));}}for(const _0x5de3e0 of _0x3a3b01){_0x5de3e0[_0x517fa0(0x163)]&&(console[_0x517fa0(0x203)](_0x517fa0(0x19a)+_0x5de3e0[_0x517fa0(0x194)]+'\x27:'),console[_0x517fa0(0x203)]('─'[_0x517fa0(0x1dc)](0x3c)),console[_0x517fa0(0x203)](_0x5de3e0[_0x517fa0(0x163)]),console[_0x517fa0(0x203)]('─'[_0x517fa0(0x1dc)](0x3c)));}for(const _0x82bb0c of _0x5f207d){_0x82bb0c[_0x517fa0(0x163)]&&(console['log'](_0x517fa0(0x199)+_0x82bb0c[_0x517fa0(0x194)]+'\x27:'),console['log']('─'[_0x517fa0(0x1dc)](0x3c)),console[_0x517fa0(0x203)](_0x82bb0c[_0x517fa0(0x163)]),console[_0x517fa0(0x203)]('─'[_0x517fa0(0x1dc)](0x3c)));}for(const _0x2a7817 of _0x25c6f0){_0x2a7817['diff']&&(console[_0x517fa0(0x203)]('\x0aChanges\x20to\x20prompt\x20\x27'+_0x2a7817[_0x517fa0(0x194)]+'\x27:'),console[_0x517fa0(0x203)]('─'[_0x517fa0(0x1dc)](0x3c)),console[_0x517fa0(0x203)](_0x2a7817[_0x517fa0(0x163)]),console[_0x517fa0(0x203)]('─'[_0x517fa0(0x1dc)](0x3c)));}for(const _0x2f1b18 of _0x37ce88){_0x2f1b18['diff']&&(console[_0x517fa0(0x203)](_0x517fa0(0x1a7)+_0x2f1b18[_0x517fa0(0x194)]+'\x27:'),console[_0x517fa0(0x203)]('─'[_0x517fa0(0x1dc)](0x3c)),console[_0x517fa0(0x203)](_0x2f1b18['diff']),console['log']('─'[_0x517fa0(0x1dc)](0x3c)));}for(const _0x48aafe of _0x1167b3){_0x48aafe[_0x517fa0(0x163)]&&(console[_0x517fa0(0x203)](_0x517fa0(0x1ea)+_0x48aafe[_0x517fa0(0x194)]+'\x27:'),console['log']('─'[_0x517fa0(0x1dc)](0x3c)),console[_0x517fa0(0x203)](_0x48aafe['diff']),console['log']('─'[_0x517fa0(0x1dc)](0x3c)));}for(const _0x19407c of _0x436765){_0x19407c['diff']&&(console['log'](_0x517fa0(0x1a9)+_0x19407c['name']+'\x27:'),console['log']('─'[_0x517fa0(0x1dc)](0x3c)),console[_0x517fa0(0x203)](_0x19407c['diff']),console[_0x517fa0(0x203)]('─'[_0x517fa0(0x1dc)](0x3c)));}for(const _0x4d0d9c of _0x2af8e1){_0x4d0d9c['diff']&&(console[_0x517fa0(0x203)]('\x0aChanges\x20to\x20form\x20interface\x20\x27'+_0x4d0d9c[_0x517fa0(0x194)]+'\x27:'),console[_0x517fa0(0x203)]('─'[_0x517fa0(0x1dc)](0x3c)),console[_0x517fa0(0x203)](_0x4d0d9c[_0x517fa0(0x163)]),console[_0x517fa0(0x203)]('─'[_0x517fa0(0x1dc)](0x3c)));}for(const _0x15bdc3 of _0x95ca2e){_0x15bdc3[_0x517fa0(0x163)]&&(console['log'](_0x517fa0(0x1bf)+_0x15bdc3[_0x517fa0(0x194)]+'\x27:'),console[_0x517fa0(0x203)]('─'[_0x517fa0(0x1dc)](0x3c)),console[_0x517fa0(0x203)](_0x15bdc3[_0x517fa0(0x163)]),console[_0x517fa0(0x203)]('─'[_0x517fa0(0x1dc)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x4e85d1(0x194)]=a4_0x4e85d1(0x19d);[a4_0x4e85d1(0x1b3)]='Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files';async['execute'](_0x495339){const _0x12e6fc=a4_0x4e85d1,{options:_0x136068,args:_0x22dfc8,tdx:_0x5d5126}=_0x495339,_0x52ba78=_0x22dfc8[0x0],_0x18fc02=_0x22dfc8[0x1],_0x2fc601=_0x136068[_0x12e6fc(0x1ba)],_0x5d548a=_0x136068[_0x12e6fc(0x1ac)],_0x472513=_0x136068[_0x12e6fc(0x1ab)],_0x2abceb=_0x136068[_0x12e6fc(0x19e)],_0x34b64b=_0x136068[_0x12e6fc(0x153)],_0x19614c=_0x136068['agent'];let _0x539b32;if(_0x52ba78){const _0x443471=a4_0xb9399[_0x12e6fc(0x173)](_0x52ba78,_0x12e6fc(0x20d));if(existsSync(_0x443471))try{const _0x3e13ae=JSON[_0x12e6fc(0x1b5)](readFileSync(_0x443471,_0x12e6fc(0x1d6)));_0x3e13ae[_0x12e6fc(0x171)]&&(_0x539b32={'llm_project':_0x3e13ae[_0x12e6fc(0x171)]});}catch{}}const _0x55e1cc=findAgentConfigPath(process[_0x12e6fc(0x1d9)]());let _0x2fe8ba;if(_0x55e1cc)try{const _0xcc33af=JSON['parse'](readFileSync(_0x55e1cc,_0x12e6fc(0x1d6)));_0xcc33af[_0x12e6fc(0x171)]&&(_0x2fe8ba={'llm_project':_0xcc33af[_0x12e6fc(0x171)]});}catch{}const _0x3c0c6f=resolveAgentPullArgs({'arg':_0x52ba78,'agentNameArg':_0x18fc02,'agentFlag':_0x19614c,'contextProject':_0x34b64b,'argDirConfig':_0x539b32,'cwdConfigPath':_0x55e1cc||undefined,'cwdConfig':_0x2fe8ba}),{projectNameOrId:_0x109af8,targetAgentName:_0x4e959e,existingOutputDir:_0x113734,source:_0x2a40c5}=_0x3c0c6f;if(_0x2a40c5===_0x12e6fc(0x151))console[_0x12e6fc(0x203)](a4_0x584ae5[_0x12e6fc(0x1cb)](_0x12e6fc(0x1c4)+a4_0xb9399[_0x12e6fc(0x173)](_0x52ba78,_0x12e6fc(0x20d))+':\x20'+_0x109af8));else{if(_0x2a40c5===_0x12e6fc(0x189))console[_0x12e6fc(0x203)](a4_0x584ae5[_0x12e6fc(0x1cb)](_0x12e6fc(0x18d)+_0x109af8));else _0x2a40c5===_0x12e6fc(0x206)&&console[_0x12e6fc(0x203)](a4_0x584ae5[_0x12e6fc(0x1cb)](_0x12e6fc(0x1e3)+_0x109af8));}if(!_0x109af8)return _0x19614c?(console[_0x12e6fc(0x203)](a4_0x584ae5['yellow']('The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a')),console['log'](_0x12e6fc(0x1d0)),console[_0x12e6fc(0x203)]('Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>')):(console[_0x12e6fc(0x203)](a4_0x584ae5[_0x12e6fc(0x170)]('llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a')),console[_0x12e6fc(0x203)]('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[_0x12e6fc(0x203)](_0x12e6fc(0x200)),console[_0x12e6fc(0x203)](_0x12e6fc(0x182)),console[_0x12e6fc(0x203)]('\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[_0x12e6fc(0x203)](_0x12e6fc(0x172))),0x1;if(_0x4e959e){const {data:_0x1042b9}=await withSpinner(_0x12e6fc(0x16b)+_0x4e959e+_0x12e6fc(0x202)+_0x109af8+_0x12e6fc(0x156),()=>_0x5d5126[_0x12e6fc(0x1b0)][_0x12e6fc(0x17c)](_0x109af8,_0x4e959e,_0x2fc601,{'dryRun':_0x5d548a,'force':_0x472513}));if(_0x5d548a)return console[_0x12e6fc(0x203)](a4_0x584ae5[_0x12e6fc(0x170)](_0x12e6fc(0x19c))),console[_0x12e6fc(0x203)]('Would\x20pull\x20agent:\x20'+_0x1042b9['agentName']),console[_0x12e6fc(0x203)](_0x12e6fc(0x1d7)+_0x1042b9[_0x12e6fc(0x1ce)]),_0x1042b9[_0x12e6fc(0x163)]&&(console['log'](_0x12e6fc(0x165)),console[_0x12e6fc(0x203)]('─'[_0x12e6fc(0x1dc)](0x3c)),console[_0x12e6fc(0x203)](_0x1042b9[_0x12e6fc(0x163)]),console[_0x12e6fc(0x203)]('─'[_0x12e6fc(0x1dc)](0x3c))),0x0;return console[_0x12e6fc(0x203)](a4_0x584ae5['green']('Agent\x20pulled\x20successfully')),console[_0x12e6fc(0x203)](_0x12e6fc(0x178)+_0x1042b9[_0x12e6fc(0x1e9)]),console[_0x12e6fc(0x203)](_0x12e6fc(0x1be)+_0x1042b9['outputPath']),console['log']('Status:\x20'+(_0x1042b9[_0x12e6fc(0x1c2)]?a4_0x584ae5['green']('new'):_0x1042b9[_0x12e6fc(0x184)]?a4_0x584ae5[_0x12e6fc(0x170)](_0x12e6fc(0x1d2)):a4_0x584ae5['gray']('unchanged'))),0x0;}const _0x34352b=_0x113734||_0x2fc601,{data:_0x57b648}=await withSpinner(_0x12e6fc(0x1b1)+_0x109af8+'\x22...',()=>_0x5d5126['llm']['pullProject'](_0x109af8,_0x34352b,{'dryRun':!![]})),_0x4cc555=_0x57b648[_0x12e6fc(0x154)][_0x12e6fc(0x1a8)][_0x12e6fc(0x15a)]+_0x57b648['counts'][_0x12e6fc(0x15c)][_0x12e6fc(0x15a)]+_0x57b648['counts'][_0x12e6fc(0x1c9)][_0x12e6fc(0x15a)]+_0x57b648['counts'][_0x12e6fc(0x1f5)][_0x12e6fc(0x15a)]+_0x57b648[_0x12e6fc(0x154)]['integrations']['new']+_0x57b648[_0x12e6fc(0x154)][_0x12e6fc(0x1fb)][_0x12e6fc(0x15a)]+_0x57b648[_0x12e6fc(0x154)][_0x12e6fc(0x158)][_0x12e6fc(0x15a)]+_0x57b648[_0x12e6fc(0x154)]['formInterfaces']['new']+_0x57b648[_0x12e6fc(0x154)][_0x12e6fc(0x169)][_0x12e6fc(0x15a)],_0x4810f6=_0x57b648['counts']['agents'][_0x12e6fc(0x1d2)]+_0x57b648['counts']['knowledgeBases'][_0x12e6fc(0x1d2)]+_0x57b648[_0x12e6fc(0x154)]['textKnowledgeBases']['updated']+_0x57b648['counts'][_0x12e6fc(0x1f5)][_0x12e6fc(0x1d2)]+_0x57b648[_0x12e6fc(0x154)]['integrations']['updated']+_0x57b648[_0x12e6fc(0x154)][_0x12e6fc(0x1fb)][_0x12e6fc(0x1d2)]+_0x57b648['counts'][_0x12e6fc(0x158)][_0x12e6fc(0x1d2)]+_0x57b648['counts'][_0x12e6fc(0x1df)][_0x12e6fc(0x1d2)]+_0x57b648[_0x12e6fc(0x154)][_0x12e6fc(0x169)][_0x12e6fc(0x1d2)],_0x5e8698=_0x57b648[_0x12e6fc(0x154)][_0x12e6fc(0x1a8)][_0x12e6fc(0x1e7)]+_0x57b648[_0x12e6fc(0x154)][_0x12e6fc(0x15c)][_0x12e6fc(0x1e7)]+_0x57b648[_0x12e6fc(0x154)][_0x12e6fc(0x1c9)][_0x12e6fc(0x1e7)]+_0x57b648[_0x12e6fc(0x154)][_0x12e6fc(0x1f5)]['unchanged']+_0x57b648[_0x12e6fc(0x154)][_0x12e6fc(0x1c7)]['unchanged']+_0x57b648[_0x12e6fc(0x154)]['experimentalKnowledgeBases'][_0x12e6fc(0x1e7)]+_0x57b648['counts'][_0x12e6fc(0x158)][_0x12e6fc(0x1e7)]+_0x57b648[_0x12e6fc(0x154)][_0x12e6fc(0x1df)][_0x12e6fc(0x1e7)]+_0x57b648[_0x12e6fc(0x154)][_0x12e6fc(0x169)][_0x12e6fc(0x1e7)];console[_0x12e6fc(0x203)](_0x12e6fc(0x1db)+_0x57b648[_0x12e6fc(0x1fa)]+'\x27:'),console['log']('\x20\x20'+a4_0x584ae5[_0x12e6fc(0x1c1)]('+\x20'+_0x4cc555+_0x12e6fc(0x1ca))+_0x12e6fc(0x207)+a4_0x584ae5['yellow']('~\x20'+_0x4810f6+'\x20changed')+_0x12e6fc(0x207)+a4_0x584ae5[_0x12e6fc(0x1cb)]('=\x20'+_0x5e8698+_0x12e6fc(0x185))),console[_0x12e6fc(0x203)](_0x12e6fc(0x18c)+formatCountSummary(_0x57b648[_0x12e6fc(0x154)][_0x12e6fc(0x1a8)])),console[_0x12e6fc(0x203)](_0x12e6fc(0x192)+formatCountSummary(_0x57b648[_0x12e6fc(0x154)]['knowledgeBases'])),console[_0x12e6fc(0x203)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x57b648['counts'][_0x12e6fc(0x1c9)])),console['log']('\x20\x20Prompts:\x20'+formatCountSummary(_0x57b648[_0x12e6fc(0x154)][_0x12e6fc(0x1f5)])),console['log'](_0x12e6fc(0x208)+formatCountSummary(_0x57b648[_0x12e6fc(0x154)]['integrations'])),console[_0x12e6fc(0x203)](_0x12e6fc(0x1e0)+formatCountSummary(_0x57b648['counts'][_0x12e6fc(0x1df)])),console[_0x12e6fc(0x203)](_0x12e6fc(0x209)+formatCountSummary(_0x57b648[_0x12e6fc(0x154)][_0x12e6fc(0x169)]));const _0x5bc1d3=_0x57b648[_0x12e6fc(0x154)][_0x12e6fc(0x1fb)][_0x12e6fc(0x17b)]>0x0||_0x57b648['counts'][_0x12e6fc(0x158)][_0x12e6fc(0x17b)]>0x0;_0x5bc1d3&&(console[_0x12e6fc(0x203)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x57b648[_0x12e6fc(0x154)]['experimentalKnowledgeBases'])),console[_0x12e6fc(0x203)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x57b648[_0x12e6fc(0x154)][_0x12e6fc(0x158)])));console[_0x12e6fc(0x203)](_0x12e6fc(0x20f)+a4_0x584ae5[_0x12e6fc(0x16f)](_0x57b648[_0x12e6fc(0x18e)])),displayDiffs(_0x57b648[_0x12e6fc(0x1a8)],_0x57b648['knowledgeBases'],_0x57b648[_0x12e6fc(0x1c9)],_0x57b648[_0x12e6fc(0x1f5)],_0x57b648['integrations'],_0x57b648[_0x12e6fc(0x1fb)],_0x57b648[_0x12e6fc(0x158)],_0x57b648[_0x12e6fc(0x1df)],_0x57b648[_0x12e6fc(0x169)]);if(_0x5d548a)return console['log'](a4_0x584ae5['yellow'](_0x12e6fc(0x198))),0x0;if(_0x4cc555===0x0&&_0x4810f6===0x0)return console[_0x12e6fc(0x203)](a4_0x584ae5[_0x12e6fc(0x1c1)]('\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'llm_project':_0x57b648[_0x12e6fc(0x1fa)]},_0x136068[_0x12e6fc(0x193)]),console[_0x12e6fc(0x203)](a4_0x584ae5[_0x12e6fc(0x1c1)](_0x12e6fc(0x197)+a4_0x584ae5['dim'](_0x12e6fc(0x171))+_0x12e6fc(0x1fd)+a4_0x584ae5[_0x12e6fc(0x16f)](_0x57b648[_0x12e6fc(0x1fa)]))),0x0;if(!_0x2abceb&&!_0x472513){if(!isInteractive())return console['error'](a4_0x584ae5['red'](_0x12e6fc(0x1fc)),_0x12e6fc(0x187)),console[_0x12e6fc(0x18b)](a4_0x584ae5[_0x12e6fc(0x1cb)](_0x12e6fc(0x195))),0x1;const _0x615c9f=await confirmKey(_0x12e6fc(0x1f8)+(_0x4cc555+_0x4810f6)+_0x12e6fc(0x19b));if(!_0x615c9f)return console[_0x12e6fc(0x203)](a4_0x584ae5[_0x12e6fc(0x170)](_0x12e6fc(0x19f)),_0x12e6fc(0x1ae)),0x1;}const {data:_0x54ca95}=await withSpinner(_0x12e6fc(0x1f4),()=>_0x5d5126['llm'][_0x12e6fc(0x1ff)](_0x109af8,_0x34352b,{'force':_0x472513}));return console[_0x12e6fc(0x203)](a4_0x584ae5[_0x12e6fc(0x1c1)](_0x12e6fc(0x1b6)+(_0x4cc555+_0x4810f6)+_0x12e6fc(0x1aa)+_0x54ca95[_0x12e6fc(0x18e)])),saveSessionContext({'llm_project':_0x54ca95[_0x12e6fc(0x1fa)]},_0x136068[_0x12e6fc(0x193)]),console['log'](a4_0x584ae5[_0x12e6fc(0x1c1)](_0x12e6fc(0x197)+a4_0x584ae5['dim'](_0x12e6fc(0x171))+_0x12e6fc(0x1fd)+a4_0x584ae5[_0x12e6fc(0x16f)](_0x54ca95['projectName']))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x4e85d1(0x194)]='agent:clone';[a4_0x4e85d1(0x1b3)]='Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project';async[a4_0x4e85d1(0x1a2)](_0x54bac1){const _0x23d90a=a4_0x4e85d1,{options:_0x39f3c7,args:_0x2f184b,tdx:_0x10cc78}=_0x54bac1,_0x38a444=_0x2f184b[0x0],_0x25391b=_0x39f3c7[_0x23d90a(0x194)],_0x31aef3=_0x39f3c7[_0x23d90a(0x1ac)],_0x469402=_0x39f3c7[_0x23d90a(0x19e)],_0x34b9a3=_0x39f3c7[_0x23d90a(0x1f1)],_0x4f5faf=_0x39f3c7[_0x23d90a(0x153)];let _0x4f604e;const _0x22081d=findAgentConfigPath(process[_0x23d90a(0x1d9)]());if(_0x38a444){const _0x998087=a4_0xb9399['join'](_0x38a444,_0x23d90a(0x20d));existsSync(_0x998087)?(_0x4f604e=_0x38a444,console[_0x23d90a(0x203)](a4_0x584ae5[_0x23d90a(0x1cb)](_0x23d90a(0x1bc)+_0x38a444))):_0x4f604e=_0x38a444;}else{if(_0x22081d)_0x4f604e=a4_0xb9399['dirname'](_0x22081d),console['log'](a4_0x584ae5[_0x23d90a(0x1cb)](_0x23d90a(0x1c0)+_0x4f604e));else{if(_0x4f5faf){const _0x341cec=sanitizeForFilesystem(_0x4f5faf);let _0x152bf4=_0x341cec,_0x21e899=a4_0xb9399['join'](process[_0x23d90a(0x1d9)](),_0x23d90a(0x1a8),_0x341cec,_0x23d90a(0x20d));if(!existsSync(_0x21e899)){const _0x3ba8d9=normalizeName(_0x4f5faf),_0x54f5e3=a4_0xb9399[_0x23d90a(0x173)](process['cwd'](),'agents',_0x3ba8d9,_0x23d90a(0x20d));existsSync(_0x54f5e3)&&(_0x152bf4=_0x3ba8d9,_0x21e899=_0x54f5e3);}if(existsSync(_0x21e899))_0x4f604e=a4_0xb9399[_0x23d90a(0x1f3)](_0x21e899),console[_0x23d90a(0x203)](a4_0x584ae5[_0x23d90a(0x1cb)](_0x23d90a(0x1bc)+_0x4f604e));else{const _0x18ac40=_0x39f3c7[_0x23d90a(0x179)];if(_0x18ac40)throw new SDKError(ErrorCode[_0x23d90a(0x1a1)],_0x23d90a(0x188)+_0x4f5faf+_0x23d90a(0x1c3),undefined,{'helpText':_0x23d90a(0x20c)+'First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a'+(_0x23d90a(0x1a6)+_0x4f5faf+'\x0a')+(_0x23d90a(0x1cd)+_0x152bf4+_0x23d90a(0x20e)+(_0x25391b||_0x23d90a(0x1a3))+'\x20--profile\x20'+_0x18ac40)});_0x4f604e=_0x4f5faf,console['log'](a4_0x584ae5['dim'](_0x23d90a(0x186)+_0x4f5faf));}}}}if(!_0x4f604e)return console[_0x23d90a(0x203)](a4_0x584ae5[_0x23d90a(0x170)]('No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a')),console[_0x23d90a(0x203)](_0x23d90a(0x17d)),console[_0x23d90a(0x203)](_0x23d90a(0x157)),console['log'](_0x23d90a(0x1f6)),console[_0x23d90a(0x203)]('\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>'),0x1;if(!_0x25391b)throw new SDKError(ErrorCode['MISSING_ARGUMENT'],_0x23d90a(0x1cf),undefined,{'helpText':'Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>'});if(!_0x469402&&!_0x31aef3){if(!isInteractive())return console[_0x23d90a(0x18b)](a4_0x584ae5[_0x23d90a(0x191)](_0x23d90a(0x1fc)),_0x23d90a(0x187)),console[_0x23d90a(0x18b)](a4_0x584ae5[_0x23d90a(0x1cb)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x29f59b=await confirmKey('Clone\x20\x22'+_0x4f604e+_0x23d90a(0x1e5)+_0x25391b+'\x22?');if(!_0x29f59b)return console[_0x23d90a(0x203)](a4_0x584ae5[_0x23d90a(0x170)](_0x23d90a(0x19f))),0x1;}const {data:_0x3eee0f}=await withSpinner(_0x23d90a(0x1e8)+_0x4f604e+_0x23d90a(0x167)+_0x25391b+_0x23d90a(0x156),()=>_0x10cc78[_0x23d90a(0x1b0)][_0x23d90a(0x1ef)](_0x4f604e,_0x25391b,{'dryRun':_0x31aef3}));if(_0x31aef3){console[_0x23d90a(0x203)](a4_0x584ae5['yellow'](_0x23d90a(0x1b9))),console[_0x23d90a(0x203)](_0x23d90a(0x1d1)+_0x3eee0f[_0x23d90a(0x1d5)]),console[_0x23d90a(0x203)](_0x23d90a(0x1e4)+_0x25391b),console[_0x23d90a(0x203)](_0x23d90a(0x15d)),console['log'](_0x23d90a(0x18c)+_0x3eee0f['counts']['agents'][_0x23d90a(0x1af)]),console[_0x23d90a(0x203)](_0x23d90a(0x192)+_0x3eee0f[_0x23d90a(0x154)][_0x23d90a(0x15c)][_0x23d90a(0x1af)]),console['log'](_0x23d90a(0x1eb)+_0x3eee0f[_0x23d90a(0x154)][_0x23d90a(0x1f5)]['created']),console[_0x23d90a(0x203)](_0x23d90a(0x1e0)+_0x3eee0f['counts'][_0x23d90a(0x1df)]['created']),console['log']('\x20\x20Chat\x20Interfaces:\x20'+_0x3eee0f[_0x23d90a(0x154)][_0x23d90a(0x169)]['created']);const _0x151163=_0x3eee0f[_0x23d90a(0x154)][_0x23d90a(0x1fb)]['created']>0x0||_0x3eee0f[_0x23d90a(0x154)][_0x23d90a(0x158)][_0x23d90a(0x1af)]>0x0;return _0x151163&&(console[_0x23d90a(0x203)](_0x23d90a(0x177)+_0x3eee0f[_0x23d90a(0x154)][_0x23d90a(0x1fb)][_0x23d90a(0x1af)]),console[_0x23d90a(0x203)]('\x20\x20Experimental\x20Artifacts:\x20'+_0x3eee0f[_0x23d90a(0x154)][_0x23d90a(0x158)][_0x23d90a(0x1af)])),0x0;}const _0x3d8f25=_0x3eee0f[_0x23d90a(0x154)][_0x23d90a(0x1a8)][_0x23d90a(0x1d3)]>0x0||_0x3eee0f[_0x23d90a(0x154)]['knowledgeBases']['errors']>0x0||_0x3eee0f[_0x23d90a(0x154)][_0x23d90a(0x1f5)][_0x23d90a(0x1d3)]>0x0||_0x3eee0f[_0x23d90a(0x154)][_0x23d90a(0x1df)][_0x23d90a(0x1d3)]>0x0||_0x3eee0f['counts'][_0x23d90a(0x169)][_0x23d90a(0x1d3)]>0x0||_0x3eee0f[_0x23d90a(0x154)][_0x23d90a(0x1fb)][_0x23d90a(0x1d3)]>0x0||_0x3eee0f[_0x23d90a(0x154)][_0x23d90a(0x158)][_0x23d90a(0x1d3)]>0x0;_0x3d8f25?console['log'](a4_0x584ae5['yellow'](_0x23d90a(0x1bb))):console[_0x23d90a(0x203)](a4_0x584ae5[_0x23d90a(0x1c1)](_0x23d90a(0x1ee)));console[_0x23d90a(0x203)]('Source:\x20'+_0x3eee0f[_0x23d90a(0x1d5)]),console[_0x23d90a(0x203)](_0x23d90a(0x1e4)+_0x3eee0f[_0x23d90a(0x181)]),console[_0x23d90a(0x203)](_0x23d90a(0x1c6)+_0x3eee0f[_0x23d90a(0x1fe)]),console['log'](),console[_0x23d90a(0x203)]('Summary:'),console['log'](_0x23d90a(0x18c)+formatCountSummary(_0x3eee0f[_0x23d90a(0x154)][_0x23d90a(0x1a8)])),console[_0x23d90a(0x203)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x3eee0f[_0x23d90a(0x154)]['knowledgeBases'])),console[_0x23d90a(0x203)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x3eee0f[_0x23d90a(0x154)][_0x23d90a(0x1f5)])),console['log']('\x20\x20Integrations:\x20'+formatCountSummary(_0x3eee0f[_0x23d90a(0x154)][_0x23d90a(0x1c7)])),console[_0x23d90a(0x203)](_0x23d90a(0x1e0)+formatCountSummary(_0x3eee0f[_0x23d90a(0x154)][_0x23d90a(0x1df)])),console['log'](_0x23d90a(0x209)+formatCountSummary(_0x3eee0f[_0x23d90a(0x154)][_0x23d90a(0x169)]));const _0x58bf41=_0x3eee0f[_0x23d90a(0x154)][_0x23d90a(0x1fb)][_0x23d90a(0x1af)]>0x0||_0x3eee0f[_0x23d90a(0x154)]['experimentalKnowledgeBases'][_0x23d90a(0x1d2)]>0x0||_0x3eee0f[_0x23d90a(0x154)][_0x23d90a(0x1fb)][_0x23d90a(0x1e7)]>0x0||_0x3eee0f[_0x23d90a(0x154)][_0x23d90a(0x158)][_0x23d90a(0x1af)]>0x0||_0x3eee0f[_0x23d90a(0x154)]['experimentalArtifacts'][_0x23d90a(0x1d2)]>0x0||_0x3eee0f[_0x23d90a(0x154)][_0x23d90a(0x158)][_0x23d90a(0x1e7)]>0x0;_0x58bf41&&(console['log'](_0x23d90a(0x177)+formatCountSummary(_0x3eee0f[_0x23d90a(0x154)][_0x23d90a(0x1fb)])),console[_0x23d90a(0x203)](_0x23d90a(0x17a)+formatCountSummary(_0x3eee0f[_0x23d90a(0x154)]['experimentalArtifacts'])));if(_0x3d8f25){console[_0x23d90a(0x203)](),console['log'](a4_0x584ae5['red'](_0x23d90a(0x1e6)));for(const _0x34c9f0 of _0x3eee0f[_0x23d90a(0x1a8)]){_0x34c9f0[_0x23d90a(0x15b)]===_0x23d90a(0x18b)&&console[_0x23d90a(0x203)](a4_0x584ae5[_0x23d90a(0x191)](_0x23d90a(0x166)+_0x34c9f0[_0x23d90a(0x1e9)]+_0x23d90a(0x201)+_0x34c9f0[_0x23d90a(0x18b)]));}for(const _0x5bd708 of _0x3eee0f['knowledgeBases']){_0x5bd708[_0x23d90a(0x15b)]===_0x23d90a(0x18b)&&console[_0x23d90a(0x203)](a4_0x584ae5['red']('\x20\x20Knowledge\x20Base\x20\x22'+_0x5bd708[_0x23d90a(0x194)]+'\x22:\x20'+_0x5bd708['error']));}for(const _0x154f1b of _0x3eee0f['prompts']){_0x154f1b[_0x23d90a(0x15b)]===_0x23d90a(0x18b)&&console['log'](a4_0x584ae5[_0x23d90a(0x191)](_0x23d90a(0x1cc)+_0x154f1b['name']+_0x23d90a(0x201)+_0x154f1b[_0x23d90a(0x18b)]));}for(const _0xe85486 of _0x3eee0f[_0x23d90a(0x1c7)]){_0xe85486[_0x23d90a(0x15b)]===_0x23d90a(0x18b)&&console[_0x23d90a(0x203)](a4_0x584ae5[_0x23d90a(0x191)]('\x20\x20Integration\x20\x22'+_0xe85486[_0x23d90a(0x194)]+_0x23d90a(0x201)+_0xe85486['error']));}for(const _0x55287d of _0x3eee0f[_0x23d90a(0x1df)]){_0x55287d[_0x23d90a(0x15b)]===_0x23d90a(0x18b)&&console['log'](a4_0x584ae5[_0x23d90a(0x191)](_0x23d90a(0x1dd)+_0x55287d[_0x23d90a(0x194)]+'\x22:\x20'+_0x55287d[_0x23d90a(0x18b)]));}for(const _0x20fd88 of _0x3eee0f[_0x23d90a(0x169)]){_0x20fd88[_0x23d90a(0x15b)]==='error'&&console[_0x23d90a(0x203)](a4_0x584ae5[_0x23d90a(0x191)]('\x20\x20Chat\x20Interface\x20\x22'+_0x20fd88[_0x23d90a(0x194)]+_0x23d90a(0x201)+_0x20fd88[_0x23d90a(0x18b)]));}for(const _0x377fec of _0x3eee0f[_0x23d90a(0x1fb)]){_0x377fec[_0x23d90a(0x15b)]===_0x23d90a(0x18b)&&console[_0x23d90a(0x203)](a4_0x584ae5[_0x23d90a(0x191)](_0x23d90a(0x1e1)+_0x377fec[_0x23d90a(0x194)]+'\x22:\x20'+_0x377fec['error']));}for(const _0xd055eb of _0x3eee0f['experimentalArtifacts']){_0xd055eb['action']===_0x23d90a(0x18b)&&console[_0x23d90a(0x203)](a4_0x584ae5[_0x23d90a(0x191)]('\x20\x20Experimental\x20Artifact\x20\x22'+_0xd055eb[_0x23d90a(0x194)]+_0x23d90a(0x201)+_0xd055eb[_0x23d90a(0x18b)]));}return 0x1;}console[_0x23d90a(0x203)]();const _0x4d5b3b=getLLMProjectUrl(_0x34b9a3,_0x3eee0f[_0x23d90a(0x1fe)]);return console[_0x23d90a(0x203)](_0x23d90a(0x1f9)+a4_0x584ae5['cyan'](_0x4d5b3b)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x4e85d1(0x194)]=a4_0x4e85d1(0x155);['description']=a4_0x4e85d1(0x20b);async[a4_0x4e85d1(0x1a2)](_0xee2229){const _0x2d6379=a4_0x4e85d1,{options:_0x5bfdc2,args:_0x5d1957,tdx:_0x12ed4e}=_0xee2229;let _0x73de72=_0x5d1957[0x0]||process['cwd']();const _0x16687b=_0x5bfdc2[_0x2d6379(0x1ac)],_0x35dd33=_0x5bfdc2[_0x2d6379(0x1ab)],_0x3b5ae2=_0x5bfdc2['yes'],_0xaace85=_0x5bfdc2['site'],_0x3b83fc=a4_0xb9399[_0x2d6379(0x173)](_0x73de72,'agent.yml'),_0xf4ac48=existsSync(_0x3b83fc);if(_0xf4ac48){const {data:_0x44cfa9}=await withSpinner(_0x2d6379(0x164)+_0x73de72+_0x2d6379(0x156),()=>_0x12ed4e[_0x2d6379(0x1b0)][_0x2d6379(0x176)](_0x73de72,{'dryRun':_0x16687b,'force':_0x35dd33}));if(_0x16687b)return console[_0x2d6379(0x203)](a4_0x584ae5[_0x2d6379(0x170)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x2d6379(0x203)](_0x2d6379(0x16c)+_0x44cfa9[_0x2d6379(0x1e9)]),0x0;if(_0x44cfa9[_0x2d6379(0x15b)]===_0x2d6379(0x18b))return console[_0x2d6379(0x203)](a4_0x584ae5[_0x2d6379(0x191)](_0x2d6379(0x205)+_0x44cfa9[_0x2d6379(0x18b)])),0x1;console[_0x2d6379(0x203)](a4_0x584ae5['green'](_0x2d6379(0x20a)+_0x44cfa9[_0x2d6379(0x15b)]+_0x2d6379(0x1f2))),console[_0x2d6379(0x203)](_0x2d6379(0x178)+_0x44cfa9[_0x2d6379(0x1e9)]);if(_0x44cfa9[_0x2d6379(0x1a0)]&&_0x44cfa9['projectId']){const _0x247b54=getLLMAgentChatUrl(_0xaace85,_0x44cfa9[_0x2d6379(0x1ad)],_0x44cfa9[_0x2d6379(0x1a0)]);console['log'](_0x2d6379(0x15f)+a4_0x584ae5[_0x2d6379(0x16f)](_0x247b54));}return 0x0;}const _0x4f36e2=_0x5bfdc2['llmProject'],_0x4d6714=resolveProjectFromContext(_0x73de72,_0x4f36e2);if(_0x4d6714[_0x2d6379(0x16a)])_0x73de72=_0x4d6714['projectDir'],_0x4d6714[_0x2d6379(0x183)]===_0x2d6379(0x206)&&console[_0x2d6379(0x203)](a4_0x584ae5[_0x2d6379(0x1cb)](_0x2d6379(0x18d)+_0x73de72));else{let _0x164aad=_0x2d6379(0x1a5);_0x4d6714[_0x2d6379(0x1f0)]===_0x2d6379(0x1da)&&(_0x164aad=_0x4d6714[_0x2d6379(0x1bd)]+_0x2d6379(0x168)+_0x4d6714[_0x2d6379(0x153)]+_0x2d6379(0x152));throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x4d6714['reason']==='no_context'?_0x4d6714[_0x2d6379(0x1bd)]:_0x2d6379(0x204)+_0x73de72,undefined,{'helpText':_0x164aad});}const {data:_0x4692d6}=await withSpinner(_0x2d6379(0x15e),()=>_0x12ed4e[_0x2d6379(0x1b0)][_0x2d6379(0x1b4)](_0x73de72,{'dryRun':!![]})),_0x2cb7a3=_0x4692d6[_0x2d6379(0x154)][_0x2d6379(0x1a8)]['errors']>0x0;if(_0x2cb7a3){console[_0x2d6379(0x203)](a4_0x584ae5[_0x2d6379(0x191)](_0x2d6379(0x16d)));for(const _0x3b06ee of _0x4692d6[_0x2d6379(0x1a8)]){_0x3b06ee[_0x2d6379(0x15b)]===_0x2d6379(0x18b)&&console[_0x2d6379(0x203)](a4_0x584ae5[_0x2d6379(0x191)](_0x2d6379(0x166)+_0x3b06ee[_0x2d6379(0x1e9)]+'\x22:\x20'+_0x3b06ee[_0x2d6379(0x18b)]));}return 0x1;}const _0x335234=_0x4692d6[_0x2d6379(0x154)][_0x2d6379(0x1a8)][_0x2d6379(0x1af)]+_0x4692d6[_0x2d6379(0x154)][_0x2d6379(0x15c)][_0x2d6379(0x1af)]+_0x4692d6[_0x2d6379(0x154)][_0x2d6379(0x1c9)][_0x2d6379(0x1af)]+_0x4692d6[_0x2d6379(0x154)][_0x2d6379(0x1f5)][_0x2d6379(0x1af)]+_0x4692d6[_0x2d6379(0x154)][_0x2d6379(0x1c7)][_0x2d6379(0x1af)]+_0x4692d6[_0x2d6379(0x154)]['experimentalKnowledgeBases'][_0x2d6379(0x1af)]+_0x4692d6[_0x2d6379(0x154)][_0x2d6379(0x158)][_0x2d6379(0x1af)]+_0x4692d6[_0x2d6379(0x154)][_0x2d6379(0x1df)]['created']+_0x4692d6[_0x2d6379(0x154)][_0x2d6379(0x169)][_0x2d6379(0x1af)],_0x29c2e4=_0x4692d6['counts'][_0x2d6379(0x1a8)][_0x2d6379(0x1d2)]+_0x4692d6[_0x2d6379(0x154)][_0x2d6379(0x15c)]['updated']+_0x4692d6[_0x2d6379(0x154)]['textKnowledgeBases'][_0x2d6379(0x1d2)]+_0x4692d6['counts']['prompts'][_0x2d6379(0x1d2)]+_0x4692d6[_0x2d6379(0x154)][_0x2d6379(0x1c7)]['updated']+_0x4692d6[_0x2d6379(0x154)]['experimentalKnowledgeBases'][_0x2d6379(0x1d2)]+_0x4692d6[_0x2d6379(0x154)]['experimentalArtifacts'][_0x2d6379(0x1d2)]+_0x4692d6[_0x2d6379(0x154)][_0x2d6379(0x1df)][_0x2d6379(0x1d2)]+_0x4692d6[_0x2d6379(0x154)]['chatInterfaces']['updated'],_0x5c66d1=_0x4692d6[_0x2d6379(0x154)][_0x2d6379(0x1a8)][_0x2d6379(0x1e7)]+_0x4692d6[_0x2d6379(0x154)][_0x2d6379(0x15c)][_0x2d6379(0x1e7)]+_0x4692d6[_0x2d6379(0x154)][_0x2d6379(0x1c9)]['unchanged']+_0x4692d6[_0x2d6379(0x154)][_0x2d6379(0x1f5)][_0x2d6379(0x1e7)]+_0x4692d6[_0x2d6379(0x154)][_0x2d6379(0x1c7)][_0x2d6379(0x1e7)]+_0x4692d6['counts'][_0x2d6379(0x1fb)][_0x2d6379(0x1e7)]+_0x4692d6[_0x2d6379(0x154)][_0x2d6379(0x158)]['unchanged']+_0x4692d6[_0x2d6379(0x154)][_0x2d6379(0x1df)][_0x2d6379(0x1e7)]+_0x4692d6[_0x2d6379(0x154)][_0x2d6379(0x169)]['unchanged'];console[_0x2d6379(0x203)](_0x2d6379(0x1ed)+_0x4692d6[_0x2d6379(0x1fa)]+'\x27:'),console[_0x2d6379(0x203)]('\x20\x20'+a4_0x584ae5[_0x2d6379(0x1c1)]('+\x20'+_0x335234+_0x2d6379(0x1ca))+'\x20|\x20'+a4_0x584ae5[_0x2d6379(0x170)]('~\x20'+_0x29c2e4+_0x2d6379(0x1b8))+'\x20|\x20'+a4_0x584ae5[_0x2d6379(0x1cb)]('=\x20'+_0x5c66d1+'\x20unchanged')),console['log'](_0x2d6379(0x18c)+formatCountSummary(_0x4692d6[_0x2d6379(0x154)][_0x2d6379(0x1a8)])),console[_0x2d6379(0x203)](_0x2d6379(0x192)+formatCountSummary(_0x4692d6[_0x2d6379(0x154)][_0x2d6379(0x15c)])),console[_0x2d6379(0x203)](_0x2d6379(0x17f)+formatCountSummary(_0x4692d6['counts'][_0x2d6379(0x1c9)])),console[_0x2d6379(0x203)](_0x2d6379(0x1eb)+formatCountSummary(_0x4692d6['counts'][_0x2d6379(0x1f5)])),console[_0x2d6379(0x203)](_0x2d6379(0x208)+formatCountSummary(_0x4692d6[_0x2d6379(0x154)][_0x2d6379(0x1c7)])),console[_0x2d6379(0x203)]('\x20\x20Form\x20Interfaces:\x20'+formatCountSummary(_0x4692d6[_0x2d6379(0x154)][_0x2d6379(0x1df)])),console[_0x2d6379(0x203)]('\x20\x20Chat\x20Interfaces:\x20'+formatCountSummary(_0x4692d6[_0x2d6379(0x154)][_0x2d6379(0x169)]));const _0x366260=_0x4692d6['counts']['experimentalKnowledgeBases'][_0x2d6379(0x1af)]>0x0||_0x4692d6['counts'][_0x2d6379(0x1fb)][_0x2d6379(0x1d2)]>0x0||_0x4692d6['counts'][_0x2d6379(0x1fb)]['unchanged']>0x0||_0x4692d6[_0x2d6379(0x154)][_0x2d6379(0x158)][_0x2d6379(0x1af)]>0x0||_0x4692d6[_0x2d6379(0x154)]['experimentalArtifacts']['updated']>0x0||_0x4692d6['counts'][_0x2d6379(0x158)]['unchanged']>0x0;_0x366260&&(console[_0x2d6379(0x203)](_0x2d6379(0x177)+formatCountSummary(_0x4692d6['counts'][_0x2d6379(0x1fb)])),console[_0x2d6379(0x203)](_0x2d6379(0x17a)+formatCountSummary(_0x4692d6[_0x2d6379(0x154)][_0x2d6379(0x158)])));console[_0x2d6379(0x203)](_0x2d6379(0x16e)+a4_0x584ae5[_0x2d6379(0x16f)](_0x73de72)),displayDiffs(_0x4692d6[_0x2d6379(0x1a8)],_0x4692d6[_0x2d6379(0x15c)],_0x4692d6[_0x2d6379(0x1c9)],_0x4692d6['prompts'],_0x4692d6[_0x2d6379(0x1c7)],_0x4692d6[_0x2d6379(0x1fb)],_0x4692d6[_0x2d6379(0x158)],_0x4692d6[_0x2d6379(0x1df)],_0x4692d6[_0x2d6379(0x169)]);if(_0x16687b)return console[_0x2d6379(0x203)](a4_0x584ae5[_0x2d6379(0x170)](_0x2d6379(0x1b7))),0x0;if(_0x335234===0x0&&_0x29c2e4===0x0){console[_0x2d6379(0x203)](a4_0x584ae5[_0x2d6379(0x1c1)]('\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date'));const _0x3d90b2=getLLMProjectUrl(_0xaace85,_0x4692d6[_0x2d6379(0x1ad)]);return console[_0x2d6379(0x203)](_0x2d6379(0x1f9)+a4_0x584ae5[_0x2d6379(0x16f)](_0x3d90b2)),0x0;}if(!_0x3b5ae2&&!_0x35dd33){if(!isInteractive())return console['error'](a4_0x584ae5[_0x2d6379(0x191)](_0x2d6379(0x1fc)),_0x2d6379(0x187)),console['error'](a4_0x584ae5[_0x2d6379(0x1cb)](_0x2d6379(0x195))),0x1;const _0x38b2ce=await confirmKey(_0x2d6379(0x174)+(_0x335234+_0x29c2e4)+_0x2d6379(0x1ec));if(!_0x38b2ce)return console[_0x2d6379(0x203)](a4_0x584ae5['yellow'](_0x2d6379(0x19f)),_0x2d6379(0x1de)),0x1;}const {data:_0xb88828}=await withSpinner(_0x2d6379(0x17e),()=>_0x12ed4e[_0x2d6379(0x1b0)][_0x2d6379(0x1b4)](_0x73de72,{'force':_0x35dd33})),_0x1e83a0=_0xb88828[_0x2d6379(0x154)][_0x2d6379(0x1a8)]['errors']>0x0||_0xb88828[_0x2d6379(0x154)]['knowledgeBases'][_0x2d6379(0x1d3)]>0x0||_0xb88828[_0x2d6379(0x154)][_0x2d6379(0x1c9)][_0x2d6379(0x1d3)]>0x0||_0xb88828[_0x2d6379(0x154)][_0x2d6379(0x1f5)]['errors']>0x0||_0xb88828[_0x2d6379(0x154)][_0x2d6379(0x1df)][_0x2d6379(0x1d3)]>0x0||_0xb88828[_0x2d6379(0x154)]['chatInterfaces'][_0x2d6379(0x1d3)]>0x0;if(_0x1e83a0){console['log'](a4_0x584ae5['yellow'](_0x2d6379(0x1e2))),console[_0x2d6379(0x203)](),console[_0x2d6379(0x203)](a4_0x584ae5['red']('Errors:'));for(const _0x282b79 of _0xb88828['agents']){_0x282b79['action']===_0x2d6379(0x18b)&&console['log'](a4_0x584ae5[_0x2d6379(0x191)]('\x20\x20Agent\x20\x22'+_0x282b79[_0x2d6379(0x1e9)]+_0x2d6379(0x201)+_0x282b79[_0x2d6379(0x18b)]));}for(const _0x40c3cd of _0xb88828[_0x2d6379(0x15c)]){_0x40c3cd[_0x2d6379(0x15b)]==='error'&&console[_0x2d6379(0x203)](a4_0x584ae5[_0x2d6379(0x191)]('\x20\x20Knowledge\x20Base\x20\x22'+_0x40c3cd[_0x2d6379(0x194)]+_0x2d6379(0x201)+_0x40c3cd['error']));}for(const _0x14d448 of _0xb88828['textKnowledgeBases']){_0x14d448[_0x2d6379(0x15b)]==='error'&&console[_0x2d6379(0x203)](a4_0x584ae5['red'](_0x2d6379(0x18f)+_0x14d448[_0x2d6379(0x194)]+_0x2d6379(0x201)+_0x14d448['error']));}for(const _0x42f106 of _0xb88828[_0x2d6379(0x1f5)]){_0x42f106[_0x2d6379(0x15b)]===_0x2d6379(0x18b)&&console[_0x2d6379(0x203)](a4_0x584ae5[_0x2d6379(0x191)](_0x2d6379(0x1cc)+_0x42f106[_0x2d6379(0x194)]+'\x22:\x20'+_0x42f106[_0x2d6379(0x18b)]));}for(const _0x4acbb4 of _0xb88828[_0x2d6379(0x1c7)]){_0x4acbb4['action']==='error'&&console[_0x2d6379(0x203)](a4_0x584ae5['red'](_0x2d6379(0x160)+_0x4acbb4['name']+_0x2d6379(0x201)+_0x4acbb4[_0x2d6379(0x18b)]));}for(const _0x1df98b of _0xb88828['formInterfaces']){_0x1df98b[_0x2d6379(0x15b)]===_0x2d6379(0x18b)&&console[_0x2d6379(0x203)](a4_0x584ae5['red']('\x20\x20Form\x20Interface\x20\x22'+_0x1df98b[_0x2d6379(0x194)]+'\x22:\x20'+_0x1df98b[_0x2d6379(0x18b)]));}for(const _0x3ae24c of _0xb88828[_0x2d6379(0x169)]){_0x3ae24c[_0x2d6379(0x15b)]===_0x2d6379(0x18b)&&console[_0x2d6379(0x203)](a4_0x584ae5[_0x2d6379(0x191)](_0x2d6379(0x159)+_0x3ae24c[_0x2d6379(0x194)]+'\x22:\x20'+_0x3ae24c[_0x2d6379(0x18b)]));}return 0x1;}console[_0x2d6379(0x203)](a4_0x584ae5[_0x2d6379(0x1c1)](_0x2d6379(0x1f7)+(_0x335234+_0x29c2e4)+_0x2d6379(0x1d4)+_0xb88828[_0x2d6379(0x1fa)]+'\x27'));const _0x1753b6=getLLMProjectUrl(_0xaace85,_0xb88828[_0x2d6379(0x1ad)]);return console['log'](_0x2d6379(0x1f9)+a4_0x584ae5[_0x2d6379(0x16f)](_0x1753b6)),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_0x3f0b29=a5_0x58d7;(function(_0x792dff,_0x95bf72){const _0x370ee6=a5_0x58d7,_0x28de38=_0x792dff();while(!![]){try{const _0x5711b4=parseInt(_0x370ee6(0x1a3))/0x1*(parseInt(_0x370ee6(0x1f6))/0x2)+-parseInt(_0x370ee6(0x1e9))/0x3*(parseInt(_0x370ee6(0x17e))/0x4)+-parseInt(_0x370ee6(0x1db))/0x5+parseInt(_0x370ee6(0x1b1))/0x6+parseInt(_0x370ee6(0x172))/0x7*(-parseInt(_0x370ee6(0x178))/0x8)+parseInt(_0x370ee6(0x173))/0x9+parseInt(_0x370ee6(0x1ca))/0xa*(parseInt(_0x370ee6(0x16f))/0xb);if(_0x5711b4===_0x95bf72)break;else _0x28de38['push'](_0x28de38['shift']());}catch(_0x240403){_0x28de38['push'](_0x28de38['shift']());}}}(a5_0x1187,0x6d17e));import*as a5_0x2a94c5 from'node:fs';import*as a5_0x439b96 from'node:path';function a5_0x58d7(_0x1563b4,_0x2cdf4a){_0x1563b4=_0x1563b4-0x162;const _0x11874d=a5_0x1187();let _0x58d7f6=_0x11874d[_0x1563b4];return _0x58d7f6;}import a5_0x809fd0 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_0x1187(){const _0x57691f=['projectDir','tests','\x20\x20Agent:\x20','rounds','\x20-\x20','Re-evaluation\x20Summary','json','\x20\x20Project:\x20','message','agent','start','some','\x20\x20Site:\x20',':\x20Sending\x20user\x20input...','Re-evaluating\x20cached\x20test\x20run...','writeFileSync','substring','No\x20tests\x20found\x20matching:\x20','Error\x20writing\x20output\x20file:\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','587807IjodAS','Running:\x20','agentDirs','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','No\x20tests\x20found\x20with\x20tags:\x20','stop','Cached\x20run\x20from:\x20','toLowerCase','Errors:\x20\x20\x20','basename','✗\x20ERROR:\x20','white','testYmlPath','isSpinning','859260LxNkEV','\x20\x20Conversation:\x20','llm','name','Executing\x20new\x20tests...','now','not\x20found','dryRun','red','eval','resolveAgentId','tags','join','size','PASS','projectName','...\x20','404','\x20(new)','Output\x20written\x20to:\x20','Conversation\x20URL:\x20','reeval','has','Failed\x20Tests:','utf-8','270oeMgDT','conversations','find','\x20\x20Round\x20','Run\x20tests\x20for\x20an\x20LLM\x20agent','status','Evaluating\x20response...','\x20\x20-\x20','agent:test','FAIL','\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','Running\x20agent\x20tests...','...','toISOString','existsSync','resolveProjectId','Available\x20tags:\x20','2874990hzPFvt','Error:\x20No\x20previous\x20test\x20run\x20found.','\x20\x20Evaluating...\x20','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','agentName','Test\x20Summary','length','Usage:','Re-evaluating...','verbose','no_local_folder','ERROR','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','Test\x20Configuration:','8097MZmwkm','✓\x20PASS:\x20','New\x20tests\x20to\x20execute:\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)','green','jsonl','conversation_url','Agent:\x20','Round\x20','reason','output','✗\x20ERROR:\x20Project\x20not\x20found:\x20','\x22:\x20','2ztyokv','timestamp','cyan','llmProject','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','map','resolve','✗\x20FAIL:\x20','table','\x27\x20to\x20create\x20the\x20folder\x20structure.','log','no_tests','Site:\x20','execute','test.yml','\x20(cached)','Passed:\x20\x20\x20','filter','push','Running\x20test:\x20','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','354827vDVHEW','/<agent-name>','Available\x20tests:\x20','7mNVoip','6861006FzbHOF','includes','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','multiple_agents','split','5773408AIeBEf','found','Re-evaluating\x20','Round\x201/','site','description','920tGVLhb','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','dim','context','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','Test\x20','add','Total:\x20\x20\x20\x20','repeat','No\x20tests\x20have\x20tags\x20defined.','Duration:\x20','yellow','executeReeval','text','source'];a5_0x1187=function(){return _0x57691f;};return a5_0x1187();}export class AgentTestCommand extends BaseCommand{[a5_0x3f0b29(0x1b4)]=a5_0x3f0b29(0x1d2);[a5_0x3f0b29(0x17d)]=a5_0x3f0b29(0x1ce);async[a5_0x3f0b29(0x167)](_0x3d37bf){const _0x30576c=a5_0x3f0b29,{options:_0x26664c,args:_0x3a1eaa,tdx:_0x1f1d77}=_0x3d37bf,_0x5f2b1a=_0x3a1eaa[0x0]||'.',_0x29f628=_0x26664c[_0x30576c(0x1b8)],_0x21a43d=_0x26664c,_0x484cc9=_0x21a43d[_0x30576c(0x1ba)]===![],_0x161d23=_0x21a43d[_0x30576c(0x1c6)],_0x257a4a=_0x21a43d['name'],_0x336b04=_0x21a43d['tags'],_0x4f7359=_0x26664c[_0x30576c(0x17c)],_0x3f55bf=_0x21a43d[_0x30576c(0x1f3)];if(_0x161d23&&_0x484cc9)return console['log'](a5_0x809fd0[_0x30576c(0x1b9)](_0x30576c(0x1fa))),0x1;let _0x1305ca=_0x30576c(0x162);if(_0x21a43d['json'])_0x1305ca=_0x30576c(0x193);else{if(_0x21a43d[_0x30576c(0x1ee)])_0x1305ca=_0x30576c(0x1ee);else{if(_0x21a43d['tsv'])_0x1305ca='tsv';else{if(_0x21a43d[_0x30576c(0x162)])_0x1305ca='table';}}}const _0x5ddb1e=_0x21a43d['llmProject'];let _0x324ac7=_0x5f2b1a;const _0x2c8286=a5_0x2a94c5[_0x30576c(0x1d8)](_0x5f2b1a),_0xc45613=_0x5f2b1a==='.';if(!_0x2c8286||_0xc45613){const _0xe87cfb=resolveProjectFromContext(_0x5f2b1a,_0x5ddb1e,{'requireFile':_0x30576c(0x168)});if(_0xe87cfb[_0x30576c(0x179)])_0x324ac7=_0xe87cfb['projectDir'],_0xe87cfb[_0x30576c(0x18c)]===_0x30576c(0x181)&&console[_0x30576c(0x164)](a5_0x809fd0[_0x30576c(0x180)]('Using\x20agent:\x20'+_0x324ac7));else switch(_0xe87cfb[_0x30576c(0x1f2)]){case'no_context':console[_0x30576c(0x164)](a5_0x809fd0[_0x30576c(0x189)](_0xe87cfb[_0x30576c(0x195)])),console['log'](),console['log'](_0x30576c(0x1e2)),console[_0x30576c(0x164)](_0x30576c(0x1d4)),console[_0x30576c(0x164)](_0x30576c(0x1ec)),console[_0x30576c(0x164)](),console[_0x30576c(0x164)](_0x30576c(0x1a1));return 0x1;case _0x30576c(0x1e5):console[_0x30576c(0x164)](a5_0x809fd0[_0x30576c(0x189)](_0xe87cfb[_0x30576c(0x195)])),console['log'](),console[_0x30576c(0x164)]('Run\x20\x27tdx\x20agent\x20pull\x20'+_0xe87cfb['llmProject']+_0x30576c(0x163));return 0x1;case _0x30576c(0x176):{const _0x5dc075=a5_0x439b96[_0x30576c(0x1ac)](_0xe87cfb[_0x30576c(0x18d)]);console[_0x30576c(0x164)](a5_0x809fd0[_0x30576c(0x189)]('Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22'+_0xe87cfb[_0x30576c(0x1f9)]+'\x22:'));for(const _0x73df1a of _0xe87cfb[_0x30576c(0x1a5)]){console[_0x30576c(0x164)](_0x30576c(0x1d1)+_0x73df1a);}return console[_0x30576c(0x164)](),console[_0x30576c(0x164)](_0x30576c(0x16e)+_0x5dc075+_0x30576c(0x170)),0x1;}case _0x30576c(0x165):console['log'](a5_0x809fd0[_0x30576c(0x189)](_0x30576c(0x175)+_0xe87cfb[_0x30576c(0x1f9)]+'\x22.')),console[_0x30576c(0x164)](a5_0x809fd0['dim']('Project\x20path:\x20'+_0xe87cfb['projectDir'])),console[_0x30576c(0x164)](),console[_0x30576c(0x164)](_0x30576c(0x1e7));return 0x1;}}const {definition:_0x6939a5,agentInfo:_0x4d67ad}=parseTestFile(_0x324ac7);let _0x483b22=_0x6939a5[_0x30576c(0x18e)];if(_0x257a4a){const _0x31ee7e=_0x257a4a[_0x30576c(0x177)](',')[_0x30576c(0x1fb)](_0x2fe466=>_0x2fe466['trim']());_0x483b22=_0x6939a5[_0x30576c(0x18e)][_0x30576c(0x16b)](_0x4edac6=>_0x31ee7e[_0x30576c(0x174)](_0x4edac6[_0x30576c(0x1b4)]));if(_0x483b22[_0x30576c(0x1e1)]===0x0)return console[_0x30576c(0x164)](a5_0x809fd0[_0x30576c(0x189)](_0x30576c(0x19e)+_0x257a4a)),console['log'](a5_0x809fd0[_0x30576c(0x180)](_0x30576c(0x171)+_0x6939a5[_0x30576c(0x18e)][_0x30576c(0x1fb)](_0x158354=>_0x158354['name'])[_0x30576c(0x1bd)](',\x20'))),0x1;}if(_0x336b04){const _0x2f4518=_0x336b04[_0x30576c(0x177)](',')[_0x30576c(0x1fb)](_0x15fb67=>_0x15fb67['trim']()['toLowerCase']());_0x483b22=_0x483b22[_0x30576c(0x16b)](_0x321299=>_0x321299[_0x30576c(0x1bc)]?.[_0x30576c(0x198)](_0xa8feff=>_0x2f4518[_0x30576c(0x174)](_0xa8feff[_0x30576c(0x1aa)]())));if(_0x483b22[_0x30576c(0x1e1)]===0x0){console['log'](a5_0x809fd0[_0x30576c(0x189)](_0x30576c(0x1a7)+_0x336b04));const _0x374bf6=new Set();return _0x6939a5['tests']['forEach'](_0x1cbede=>_0x1cbede['tags']?.['forEach'](_0x283e57=>_0x374bf6[_0x30576c(0x184)](_0x283e57))),_0x374bf6[_0x30576c(0x1be)]>0x0?console[_0x30576c(0x164)](a5_0x809fd0[_0x30576c(0x180)](_0x30576c(0x1da)+[..._0x374bf6][_0x30576c(0x1bd)](',\x20'))):console['log'](a5_0x809fd0[_0x30576c(0x180)](_0x30576c(0x187))),0x1;}}if(_0x161d23)return this[_0x30576c(0x18a)](_0x3d37bf,{'definition':{'tests':_0x483b22},'agentInfo':_0x4d67ad,'outputFormat':_0x1305ca,'outputFile':_0x3f55bf,'testNames':_0x257a4a});if(_0x29f628){console[_0x30576c(0x164)](a5_0x809fd0['cyan'](_0x30576c(0x1e8))),console[_0x30576c(0x164)](_0x30576c(0x199)+a5_0x809fd0[_0x30576c(0x1ae)](_0x4f7359)),console[_0x30576c(0x164)](_0x30576c(0x194)+a5_0x809fd0[_0x30576c(0x1ae)](_0x4d67ad[_0x30576c(0x1c0)])),console[_0x30576c(0x164)](_0x30576c(0x18f)+a5_0x809fd0[_0x30576c(0x1ae)](_0x4d67ad['agentName'])),console[_0x30576c(0x164)](),console[_0x30576c(0x164)]('Tests\x20found:\x20'+a5_0x809fd0[_0x30576c(0x1ae)](_0x483b22['length']));for(let _0x3ed139=0x0;_0x3ed139<_0x483b22[_0x30576c(0x1e1)];_0x3ed139++){const _0x181c2e=_0x483b22[_0x3ed139],_0x152127=_0x181c2e['rounds'][_0x30576c(0x1e1)]===0x1?'round':_0x30576c(0x190),_0x359dcf=_0x181c2e[_0x30576c(0x1bc)]?.['length']?'\x20['+_0x181c2e[_0x30576c(0x1bc)]['join'](',\x20')+']':'';console[_0x30576c(0x164)]('\x20\x20'+(_0x3ed139+0x1)+'.\x20'+a5_0x809fd0[_0x30576c(0x1ae)](_0x181c2e[_0x30576c(0x1b4)])+'\x20('+_0x181c2e[_0x30576c(0x190)]['length']+'\x20'+_0x152127+')'+a5_0x809fd0[_0x30576c(0x180)](_0x359dcf));}return 0x0;}let _0x293a31,_0x439653;try{_0x293a31=await _0x1f1d77[_0x30576c(0x1b3)][_0x30576c(0x1d9)](_0x4d67ad['projectName']);}catch(_0x3b1305){const _0x3c50df=_0x3b1305 instanceof Error?_0x3b1305['message']:String(_0x3b1305);return _0x3c50df[_0x30576c(0x174)](_0x30576c(0x1c2))||_0x3c50df[_0x30576c(0x1aa)]()[_0x30576c(0x174)](_0x30576c(0x1b7))?console['log'](a5_0x809fd0[_0x30576c(0x1b9)](_0x30576c(0x1f4)+_0x4d67ad[_0x30576c(0x1c0)])):console[_0x30576c(0x164)](a5_0x809fd0[_0x30576c(0x1b9)](_0x30576c(0x1a0)+_0x4d67ad[_0x30576c(0x1c0)]+_0x30576c(0x1f5)+_0x3c50df)),0x1;}try{_0x439653=await _0x1f1d77[_0x30576c(0x1b3)][_0x30576c(0x1bb)](_0x4d67ad[_0x30576c(0x1df)],_0x293a31);}catch(_0x2d2f61){const _0x2c0024=_0x2d2f61 instanceof Error?_0x2d2f61[_0x30576c(0x195)]:String(_0x2d2f61);return _0x2c0024['includes']('404')||_0x2c0024[_0x30576c(0x1aa)]()['includes'](_0x30576c(0x1b7))?console['log'](a5_0x809fd0[_0x30576c(0x1b9)]('✗\x20ERROR:\x20Agent\x20not\x20found:\x20'+_0x4d67ad['agentName'])):console['log'](a5_0x809fd0[_0x30576c(0x1b9)](_0x30576c(0x1a6)+_0x4d67ad['agentName']+_0x30576c(0x1f5)+_0x2c0024)),0x1;}let _0x260687;if(!_0x484cc9)try{_0x260687=await setupEvaluatorAgent(_0x1f1d77[_0x30576c(0x1b3)],_0x26664c[_0x30576c(0x1e4)]);}catch(_0x473a96){const _0x5cbc15=_0x473a96 instanceof Error?_0x473a96[_0x30576c(0x195)]:String(_0x473a96);return console['log'](a5_0x809fd0[_0x30576c(0x1b9)](_0x30576c(0x17f)+_0x5cbc15)),0x1;}console[_0x30576c(0x164)](a5_0x809fd0[_0x30576c(0x1f8)](_0x30576c(0x1d5))),console['log'](_0x30576c(0x166)+a5_0x809fd0[_0x30576c(0x1ae)](_0x4f7359)),console[_0x30576c(0x164)]('Agent:\x20'+a5_0x809fd0[_0x30576c(0x1ae)](_0x4d67ad[_0x30576c(0x1c0)]+'/'+_0x4d67ad['agentName'])),console[_0x30576c(0x164)]();const _0x5288c7=[],_0x4db4c8=[],_0x4c6ad4=Date[_0x30576c(0x1b6)]();for(let _0xf56221=0x0;_0xf56221<_0x483b22[_0x30576c(0x1e1)];_0xf56221++){const _0x1b25f8=_0x483b22[_0xf56221];_0x483b22[_0x30576c(0x1e1)]>0x1?console[_0x30576c(0x164)](_0x30576c(0x183)+(_0xf56221+0x1)+'/'+_0x483b22['length']+':\x20'+a5_0x809fd0[_0x30576c(0x1ae)](_0x1b25f8[_0x30576c(0x1b4)])):console[_0x30576c(0x164)](_0x30576c(0x16d)+a5_0x809fd0[_0x30576c(0x1ae)](_0x1b25f8[_0x30576c(0x1b4)]));const _0x34b29c=createCommandSpinner(_0x30576c(0x17b)+_0x1b25f8[_0x30576c(0x190)][_0x30576c(0x1e1)]+_0x30576c(0x19a));_0x34b29c[_0x30576c(0x197)]();try{const {result:_0x19f29d,conversation:_0x259c76}=await runTest(_0x1f1d77['llm'],_0x1b25f8,{'agentId':_0x439653,'projectId':_0x293a31,'site':_0x4f7359,'noEval':_0x484cc9,'evaluatorId':_0x260687,'onRoundStart':(_0x4b59de,_0x2c51c6)=>{const _0x21e425=_0x30576c;_0x34b29c['text']='Round\x20'+(_0x4b59de+0x1)+'/'+_0x2c51c6+_0x21e425(0x19a);},'onRoundComplete':(_0x47dbd6,_0xd415ad,_0x307eed)=>{const _0xf8441d=_0x30576c,_0x466b14=formatElapsed(_0xd415ad);_0x307eed?console[_0xf8441d(0x164)](_0xf8441d(0x1cd)+(_0x47dbd6+0x1)+'/'+_0x1b25f8[_0xf8441d(0x190)][_0xf8441d(0x1e1)]+_0xf8441d(0x1c1)+a5_0x809fd0[_0xf8441d(0x1ed)]('✓')+'\x20('+_0x466b14+')'):console['log'](_0xf8441d(0x1cd)+(_0x47dbd6+0x1)+'/'+_0x1b25f8[_0xf8441d(0x190)]['length']+_0xf8441d(0x1c1)+a5_0x809fd0['red']('✗'));},'onEvaluationStart':()=>{const _0x2e240c=_0x30576c;_0x34b29c['text']=_0x2e240c(0x1d0);},'onEvaluationComplete':_0x488582=>{const _0x2eca8d=_0x30576c,_0x5def32=formatElapsed(_0x488582);console['log'](_0x2eca8d(0x1dd)+a5_0x809fd0[_0x2eca8d(0x1ed)]('✓')+'\x20('+_0x5def32+')');}});_0x34b29c[_0x30576c(0x1a8)](),_0x5288c7[_0x30576c(0x16c)](_0x19f29d),_0x4db4c8[_0x30576c(0x16c)](_0x259c76);if(_0x19f29d[_0x30576c(0x1cf)]==='PASS')console[_0x30576c(0x164)](a5_0x809fd0['green'](_0x30576c(0x1ea)+_0x19f29d[_0x30576c(0x1f2)]));else _0x19f29d[_0x30576c(0x1cf)]===_0x30576c(0x1d3)?console[_0x30576c(0x164)](a5_0x809fd0[_0x30576c(0x1b9)](_0x30576c(0x1fd)+_0x19f29d['reason'])):console[_0x30576c(0x164)](a5_0x809fd0['red'](_0x30576c(0x1ad)+_0x19f29d[_0x30576c(0x1f2)]));_0x19f29d[_0x30576c(0x1ef)]&&console['log'](a5_0x809fd0[_0x30576c(0x180)](_0x30576c(0x1c5)+_0x19f29d[_0x30576c(0x1ef)])),console[_0x30576c(0x164)]();}catch(_0x54fb17){_0x34b29c['stop']();const _0x551bab=_0x54fb17 instanceof Error?_0x54fb17[_0x30576c(0x195)]:String(_0x54fb17);console['log'](a5_0x809fd0[_0x30576c(0x1b9)]('✗\x20ERROR:\x20'+_0x551bab)),console[_0x30576c(0x164)](),_0x5288c7[_0x30576c(0x16c)]({'name':_0x1b25f8[_0x30576c(0x1b4)],'status':_0x30576c(0x1e6),'reason':_0x551bab,'timestamp':new Date()[_0x30576c(0x1d7)](),'duration_ms':0x0});}}const _0x55657e=Date[_0x30576c(0x1b6)]()-_0x4c6ad4,_0x3fc24e=_0x5288c7['filter'](_0x3bcfda=>_0x3bcfda[_0x30576c(0x1cf)]===_0x30576c(0x1bf))[_0x30576c(0x1e1)],_0x4f4590=_0x5288c7['filter'](_0x4893e6=>_0x4893e6[_0x30576c(0x1cf)]==='FAIL')['length'],_0x4653b=_0x5288c7['filter'](_0x4bffc8=>_0x4bffc8[_0x30576c(0x1cf)]===_0x30576c(0x1e6))[_0x30576c(0x1e1)];console[_0x30576c(0x164)]('━'[_0x30576c(0x186)](0x3c)),console[_0x30576c(0x164)](_0x30576c(0x1e0)),console[_0x30576c(0x164)]('━'[_0x30576c(0x186)](0x3c)),console[_0x30576c(0x164)](_0x30576c(0x185)+_0x5288c7['length']),console[_0x30576c(0x164)](_0x30576c(0x16a)+a5_0x809fd0['green'](_0x3fc24e)),console['log']('Failed:\x20\x20\x20'+a5_0x809fd0['red'](_0x4f4590));_0x4653b>0x0&&console[_0x30576c(0x164)](_0x30576c(0x1ab)+a5_0x809fd0[_0x30576c(0x1b9)](_0x4653b));console[_0x30576c(0x164)](_0x30576c(0x188)+formatElapsed(_0x55657e)),console[_0x30576c(0x164)]('━'[_0x30576c(0x186)](0x3c));const _0x221403=_0x5288c7[_0x30576c(0x16b)](_0x3e4e4e=>_0x3e4e4e[_0x30576c(0x1cf)]!=='PASS');if(_0x221403['length']>0x0){console[_0x30576c(0x164)](),console['log'](_0x30576c(0x1c8));for(const _0x9ea1d5 of _0x221403){const _0x4ccb7f=a5_0x809fd0[_0x30576c(0x1b9)]('✗'),_0x3df8b3=_0x9ea1d5[_0x30576c(0x1f2)][_0x30576c(0x1e1)]>0x32?_0x9ea1d5[_0x30576c(0x1f2)][_0x30576c(0x19d)](0x0,0x32)+_0x30576c(0x1d6):_0x9ea1d5[_0x30576c(0x1f2)];console[_0x30576c(0x164)]('\x20\x20'+_0x4ccb7f+'\x20'+_0x9ea1d5['name']+':\x20'+_0x3df8b3);}}const _0x44e875={'summary':{'total':_0x5288c7[_0x30576c(0x1e1)],'passed':_0x3fc24e,'failed':_0x4f4590,'errors':_0x4653b>0x0?_0x4653b:undefined,'duration_ms':_0x55657e},'tests':_0x5288c7,'agent':{'project':_0x4d67ad[_0x30576c(0x1c0)],'name':_0x4d67ad[_0x30576c(0x1df)],'site':_0x4f7359},'timestamp':new Date(_0x4c6ad4)[_0x30576c(0x1d7)]()};try{const _0x58b170=buildCachedTestRun(_0x4db4c8,{'site':_0x4f7359,'projectId':_0x293a31,'projectName':_0x4d67ad[_0x30576c(0x1c0)],'agentId':_0x439653,'agentName':_0x4d67ad[_0x30576c(0x1df)],'testYmlPath':a5_0x439b96[_0x30576c(0x1fc)](_0x4d67ad[_0x30576c(0x1af)])});saveLastTestRun(_0x58b170);}catch{}if(_0x1305ca!=='table'||_0x3f55bf){const _0x20f441=formatResults(_0x44e875,_0x1305ca);if(_0x3f55bf)try{a5_0x2a94c5[_0x30576c(0x19c)](_0x3f55bf,_0x20f441,_0x30576c(0x1c9)),console['log'](),console['log'](a5_0x809fd0['dim'](_0x30576c(0x1c4)+_0x3f55bf));}catch(_0x1d9c7c){return console[_0x30576c(0x164)](),console[_0x30576c(0x164)](a5_0x809fd0[_0x30576c(0x1b9)]('Error\x20writing\x20output\x20file:\x20'+_0x1d9c7c)),0x1;}else console[_0x30576c(0x164)](),console[_0x30576c(0x164)](_0x20f441);}return _0x221403[_0x30576c(0x1e1)]>0x0?0x1:0x0;}async[a5_0x3f0b29(0x18a)](_0x5c6e02,_0x98b6e1){const _0x4dd8b9=a5_0x3f0b29,{options:_0x2e27da,tdx:_0x579122}=_0x5c6e02,{definition:_0x3577d5,agentInfo:_0x118bd2,outputFormat:_0x328f46,outputFile:_0x2c2182}=_0x98b6e1,_0x47fe31=_0x2e27da['site'],_0x3a0b64=loadLastTestRun();if(!_0x3a0b64)return console['log'](a5_0x809fd0['red'](_0x4dd8b9(0x1dc))),console[_0x4dd8b9(0x164)](a5_0x809fd0[_0x4dd8b9(0x180)](_0x4dd8b9(0x1de))),0x1;if(_0x3a0b64[_0x4dd8b9(0x196)][_0x4dd8b9(0x1df)]!==_0x118bd2[_0x4dd8b9(0x1df)])return console['log'](a5_0x809fd0['red']('Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22'+_0x3a0b64[_0x4dd8b9(0x196)]['agentName']+_0x4dd8b9(0x182)+_0x118bd2['agentName']+'\x22.')),console[_0x4dd8b9(0x164)](a5_0x809fd0[_0x4dd8b9(0x180)](_0x4dd8b9(0x1a2))),0x1;const _0x15f693=new Set(_0x3a0b64[_0x4dd8b9(0x1cb)]['map'](_0x151747=>_0x151747['testName'])),_0x35f4b3=_0x3577d5[_0x4dd8b9(0x18e)][_0x4dd8b9(0x16b)](_0x5926b5=>!_0x15f693[_0x4dd8b9(0x1c7)](_0x5926b5[_0x4dd8b9(0x1b4)]));if(_0x35f4b3[_0x4dd8b9(0x1e1)]>0x0&&_0x3a0b64['site']!==_0x47fe31)return console[_0x4dd8b9(0x164)](a5_0x809fd0[_0x4dd8b9(0x1b9)]('Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.')),console[_0x4dd8b9(0x164)](a5_0x809fd0[_0x4dd8b9(0x180)]('Cached\x20run\x20is\x20from\x20site\x20\x22'+_0x3a0b64[_0x4dd8b9(0x17c)]+'\x22,\x20but\x20current\x20site\x20is\x20\x22'+_0x47fe31+'\x22.')),console[_0x4dd8b9(0x164)](a5_0x809fd0['dim']('Either\x20switch\x20to\x20the\x20\x22'+_0x3a0b64['site']+'\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.')),0x1;const _0x1086b5=_0x3577d5['tests'][_0x4dd8b9(0x16b)](_0x496655=>_0x15f693['has'](_0x496655['name'])),_0x241a2a=_0x35f4b3;let _0xd19f03;try{_0xd19f03=await setupEvaluatorAgent(_0x579122[_0x4dd8b9(0x1b3)],_0x2e27da[_0x4dd8b9(0x1e4)]);}catch(_0x17f81d){const _0xeeb73=_0x17f81d instanceof Error?_0x17f81d['message']:String(_0x17f81d);return console[_0x4dd8b9(0x164)](a5_0x809fd0[_0x4dd8b9(0x1b9)](_0x4dd8b9(0x17f)+_0xeeb73)),0x1;}console[_0x4dd8b9(0x164)](a5_0x809fd0[_0x4dd8b9(0x1f8)](_0x4dd8b9(0x19b))),console[_0x4dd8b9(0x164)](_0x4dd8b9(0x1a9)+a5_0x809fd0['white'](_0x3a0b64[_0x4dd8b9(0x1f7)])),console['log'](_0x4dd8b9(0x1f0)+a5_0x809fd0[_0x4dd8b9(0x1ae)](_0x3a0b64[_0x4dd8b9(0x196)][_0x4dd8b9(0x1c0)]+'/'+_0x3a0b64[_0x4dd8b9(0x196)][_0x4dd8b9(0x1df)]));_0x241a2a[_0x4dd8b9(0x1e1)]>0x0&&console[_0x4dd8b9(0x164)](_0x4dd8b9(0x1eb)+a5_0x809fd0['yellow'](_0x241a2a['length']));console[_0x4dd8b9(0x164)]();const _0xec4570=[],_0x2819fd=Date[_0x4dd8b9(0x1b6)](),_0x1da302=createCommandSpinner(_0x4dd8b9(0x1e3));if(_0x1086b5['length']>0x0)try{const _0x53ed0f=await reevaluateFromCache(_0x579122['llm'],_0x3a0b64,{'tests':_0x1086b5},{'evaluatorId':_0xd19f03,'onTestStart':(_0x3a0de3,_0x52bd94,_0x296a83)=>{const _0x176d0a=_0x4dd8b9;_0x1da302[_0x176d0a(0x18b)]=_0x176d0a(0x17a)+(_0x52bd94+0x1)+'/'+_0x296a83+':\x20'+_0x3a0de3+_0x176d0a(0x1d6);if(!_0x1da302[_0x176d0a(0x1b0)])_0x1da302[_0x176d0a(0x197)]();},'onTestComplete':(_0x325b27,_0x286a2c)=>{const _0x22715c=_0x4dd8b9;_0x1da302[_0x22715c(0x1a8)]();if(_0x286a2c['status']===_0x22715c(0x1bf))console[_0x22715c(0x164)](a5_0x809fd0[_0x22715c(0x1ed)]('✓\x20PASS:\x20'+_0x325b27)+a5_0x809fd0['dim'](_0x22715c(0x169)));else _0x286a2c[_0x22715c(0x1cf)]===_0x22715c(0x1d3)?console[_0x22715c(0x164)](a5_0x809fd0[_0x22715c(0x1b9)](_0x22715c(0x1fd)+_0x325b27+_0x22715c(0x191)+_0x286a2c[_0x22715c(0x1f2)])+a5_0x809fd0['dim'](_0x22715c(0x169))):console[_0x22715c(0x164)](a5_0x809fd0[_0x22715c(0x1b9)](_0x22715c(0x1ad)+_0x325b27+'\x20-\x20'+_0x286a2c[_0x22715c(0x1f2)]));_0x286a2c['conversation_url']&&console[_0x22715c(0x164)](a5_0x809fd0[_0x22715c(0x180)](_0x22715c(0x1b2)+_0x286a2c['conversation_url'])),_0xec4570[_0x22715c(0x16c)](_0x286a2c);},'onTestSkipped':(_0x5158f3,_0x1f3822)=>{const _0x4d3272=_0x4dd8b9;_0x1da302['stop'](),console[_0x4d3272(0x164)](a5_0x809fd0[_0x4d3272(0x189)]('⚠\x20SKIPPED:\x20'+_0x5158f3+_0x4d3272(0x191)+_0x1f3822));}});for(const _0x2306a6 of _0x53ed0f){!_0xec4570[_0x4dd8b9(0x1cc)](_0x37de69=>_0x37de69['name']===_0x2306a6[_0x4dd8b9(0x1b4)])&&_0xec4570['push'](_0x2306a6);}}catch(_0x250386){_0x1da302['stop']();const _0x4d9608=_0x250386 instanceof Error?_0x250386[_0x4dd8b9(0x195)]:String(_0x250386);return console['log'](a5_0x809fd0[_0x4dd8b9(0x1b9)]('✗\x20ERROR:\x20Re-evaluation\x20failed:\x20'+_0x4d9608)),0x1;}_0x1da302[_0x4dd8b9(0x1a8)]();if(_0x241a2a[_0x4dd8b9(0x1e1)]>0x0){console[_0x4dd8b9(0x164)](),console['log'](a5_0x809fd0[_0x4dd8b9(0x1f8)](_0x4dd8b9(0x1b5)));const {projectId:_0x50630b,agentId:_0x4c377a}=_0x3a0b64['agent'];for(const _0x24f326 of _0x241a2a){console[_0x4dd8b9(0x164)](_0x4dd8b9(0x1a4)+a5_0x809fd0[_0x4dd8b9(0x1ae)](_0x24f326[_0x4dd8b9(0x1b4)]));const _0x14aee2=createCommandSpinner(_0x4dd8b9(0x17b)+_0x24f326[_0x4dd8b9(0x190)]['length']+_0x4dd8b9(0x19a));_0x14aee2[_0x4dd8b9(0x197)]();try{const {result:_0x3beee5}=await runTest(_0x579122[_0x4dd8b9(0x1b3)],_0x24f326,{'agentId':_0x4c377a,'projectId':_0x50630b,'site':_0x3a0b64['site'],'noEval':![],'evaluatorId':_0xd19f03,'onRoundStart':(_0x1f10ac,_0x2d0852)=>{const _0x2ff675=_0x4dd8b9;_0x14aee2[_0x2ff675(0x18b)]=_0x2ff675(0x1f1)+(_0x1f10ac+0x1)+'/'+_0x2d0852+_0x2ff675(0x19a);},'onRoundComplete':(_0x30765a,_0x481263,_0x59edd6)=>{const _0x3e91a1=_0x4dd8b9,_0x1db375=formatElapsed(_0x481263);_0x59edd6?console[_0x3e91a1(0x164)](_0x3e91a1(0x1cd)+(_0x30765a+0x1)+'/'+_0x24f326['rounds'][_0x3e91a1(0x1e1)]+_0x3e91a1(0x1c1)+a5_0x809fd0[_0x3e91a1(0x1ed)]('✓')+'\x20('+_0x1db375+')'):console[_0x3e91a1(0x164)](_0x3e91a1(0x1cd)+(_0x30765a+0x1)+'/'+_0x24f326['rounds'][_0x3e91a1(0x1e1)]+'...\x20'+a5_0x809fd0['red']('✗'));},'onEvaluationStart':()=>{const _0x2b2b28=_0x4dd8b9;_0x14aee2[_0x2b2b28(0x18b)]=_0x2b2b28(0x1d0);},'onEvaluationComplete':_0x138940=>{const _0x4124a2=_0x4dd8b9,_0x397c1e=formatElapsed(_0x138940);console[_0x4124a2(0x164)](_0x4124a2(0x1dd)+a5_0x809fd0[_0x4124a2(0x1ed)]('✓')+'\x20('+_0x397c1e+')');}});_0x14aee2[_0x4dd8b9(0x1a8)](),_0xec4570[_0x4dd8b9(0x16c)](_0x3beee5);if(_0x3beee5[_0x4dd8b9(0x1cf)]==='PASS')console[_0x4dd8b9(0x164)](a5_0x809fd0[_0x4dd8b9(0x1ed)](_0x4dd8b9(0x1ea)+_0x3beee5[_0x4dd8b9(0x1f2)])+a5_0x809fd0[_0x4dd8b9(0x180)](_0x4dd8b9(0x1c3)));else _0x3beee5['status']===_0x4dd8b9(0x1d3)?console[_0x4dd8b9(0x164)](a5_0x809fd0['red']('✗\x20FAIL:\x20'+_0x3beee5[_0x4dd8b9(0x1f2)])+a5_0x809fd0[_0x4dd8b9(0x180)](_0x4dd8b9(0x1c3))):console['log'](a5_0x809fd0[_0x4dd8b9(0x1b9)]('✗\x20ERROR:\x20'+_0x3beee5[_0x4dd8b9(0x1f2)]));_0x3beee5[_0x4dd8b9(0x1ef)]&&console[_0x4dd8b9(0x164)](a5_0x809fd0[_0x4dd8b9(0x180)](_0x4dd8b9(0x1b2)+_0x3beee5[_0x4dd8b9(0x1ef)]));}catch(_0x2fb8cf){_0x14aee2[_0x4dd8b9(0x1a8)]();const _0x40820b=_0x2fb8cf instanceof Error?_0x2fb8cf[_0x4dd8b9(0x195)]:String(_0x2fb8cf);console[_0x4dd8b9(0x164)](a5_0x809fd0[_0x4dd8b9(0x1b9)](_0x4dd8b9(0x1ad)+_0x40820b)),_0xec4570[_0x4dd8b9(0x16c)]({'name':_0x24f326[_0x4dd8b9(0x1b4)],'status':_0x4dd8b9(0x1e6),'reason':_0x40820b,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}}console['log']();const _0x1a88f7=Date['now']()-_0x2819fd,_0x14f481=_0xec4570['filter'](_0x4accb3=>_0x4accb3[_0x4dd8b9(0x1cf)]===_0x4dd8b9(0x1bf))['length'],_0x129e0f=_0xec4570['filter'](_0x327f78=>_0x327f78[_0x4dd8b9(0x1cf)]===_0x4dd8b9(0x1d3))[_0x4dd8b9(0x1e1)],_0x14c2bc=_0xec4570[_0x4dd8b9(0x16b)](_0x4db3e3=>_0x4db3e3[_0x4dd8b9(0x1cf)]===_0x4dd8b9(0x1e6))[_0x4dd8b9(0x1e1)];console[_0x4dd8b9(0x164)]('━'[_0x4dd8b9(0x186)](0x3c)),console[_0x4dd8b9(0x164)](_0x4dd8b9(0x192)),console[_0x4dd8b9(0x164)]('━'[_0x4dd8b9(0x186)](0x3c)),console[_0x4dd8b9(0x164)](_0x4dd8b9(0x185)+_0xec4570['length']),console[_0x4dd8b9(0x164)]('Passed:\x20\x20\x20'+a5_0x809fd0['green'](_0x14f481)),console[_0x4dd8b9(0x164)]('Failed:\x20\x20\x20'+a5_0x809fd0[_0x4dd8b9(0x1b9)](_0x129e0f));_0x14c2bc>0x0&&console[_0x4dd8b9(0x164)](_0x4dd8b9(0x1ab)+a5_0x809fd0['red'](_0x14c2bc));console['log']('Duration:\x20'+formatElapsed(_0x1a88f7)),console[_0x4dd8b9(0x164)]('━'[_0x4dd8b9(0x186)](0x3c));const _0x523ba1={'summary':{'total':_0xec4570['length'],'passed':_0x14f481,'failed':_0x129e0f,'errors':_0x14c2bc>0x0?_0x14c2bc:undefined,'duration_ms':_0x1a88f7},'tests':_0xec4570,'agent':{'project':_0x118bd2['projectName'],'name':_0x118bd2[_0x4dd8b9(0x1df)],'site':_0x47fe31},'timestamp':new Date(_0x2819fd)['toISOString']()};if(_0x328f46!==_0x4dd8b9(0x162)||_0x2c2182){const _0x26b329=formatResults(_0x523ba1,_0x328f46);if(_0x2c2182)try{a5_0x2a94c5[_0x4dd8b9(0x19c)](_0x2c2182,_0x26b329,_0x4dd8b9(0x1c9)),console[_0x4dd8b9(0x164)](),console['log'](a5_0x809fd0[_0x4dd8b9(0x180)]('Output\x20written\x20to:\x20'+_0x2c2182));}catch(_0x438299){return console['log'](),console['log'](a5_0x809fd0[_0x4dd8b9(0x1b9)](_0x4dd8b9(0x19f)+_0x438299)),0x1;}else console[_0x4dd8b9(0x164)](),console[_0x4dd8b9(0x164)](_0x26b329);}const _0x3305b4=_0xec4570[_0x4dd8b9(0x16b)](_0x70b784=>_0x70b784['status']!==_0x4dd8b9(0x1bf));return _0x3305b4['length']>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_0x37d9f4=a6_0x5001;(function(_0x35a725,_0x440c8e){const _0x4b49a1=a6_0x5001,_0x361909=_0x35a725();while(!![]){try{const _0x2f038e=parseInt(_0x4b49a1(0x1fb))/0x1*(parseInt(_0x4b49a1(0x205))/0x2)+-parseInt(_0x4b49a1(0x1d5))/0x3+-parseInt(_0x4b49a1(0x1d3))/0x4*(parseInt(_0x4b49a1(0x1ee))/0x5)+parseInt(_0x4b49a1(0x1fc))/0x6+-parseInt(_0x4b49a1(0x1f2))/0x7+parseInt(_0x4b49a1(0x214))/0x8+-parseInt(_0x4b49a1(0x1f4))/0x9;if(_0x2f038e===_0x440c8e)break;else _0x361909['push'](_0x361909['shift']());}catch(_0x5c92bb){_0x361909['push'](_0x361909['shift']());}}}(a6_0x436e,0xd00c7));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_0x436e(){const _0x808cd1=['trim','error','Error:\x20','<\x20HTTP/1.1\x20','status','stack','substring','execute','authorization','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','header','color','startsWith','llm-proxy','file','api','noColor','Endpoint\x20must\x20start\x20with\x20/:\x20','DELETE','name','x-auth-token','13970oiQXDL','set-cookie','body','data','6959316dxZbKf','toUpperCase','9916389VjOhbw','proxy-authorization','entries','Invalid\x20API\x20type:\x20','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','includes','join','56rVuJkA','1923216bYxEFx','verbose','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','output','PUT','indexOf','.\x20Valid\x20types:\x20','.\x20Valid\x20methods:\x20','Invalid\x20HTTP\x20method:\x20','56998XSzyVg','keys','POST','Invalid\x20header\x20format:\x20\x22','length','isArray','cas','headers','type','has','message','description','validate','readBodyFromFile','GET','12896520KGQNfz','x-trino-user','toLowerCase','trino','site','method','328bDBrad','cdp','1053783MBwJmW','workflow','cookie','set-cookie2'];a6_0x436e=function(){return _0x808cd1;};return a6_0x436e();}import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a6_0x37d9f4(0x1e1),a6_0x37d9f4(0x1f5),a6_0x37d9f4(0x1d7),a6_0x37d9f4(0x1ef),a6_0x37d9f4(0x1d8),'x-xsrf-token',a6_0x37d9f4(0x1ed),a6_0x37d9f4(0x215)]);function a6_0x5001(_0x764039,_0x2f7689){_0x764039=_0x764039-0x1cf;const _0x436e9e=a6_0x436e();let _0x5001bf=_0x436e9e[_0x764039];return _0x5001bf;}function isSensitiveHeader(_0x6b4214){const _0x252497=a6_0x37d9f4;return SENSITIVE_HEADERS[_0x252497(0x20e)](_0x6b4214[_0x252497(0x1cf)]());}function parseHeader(_0x103a71){const _0x56640b=a6_0x37d9f4,_0x1485a0=_0x103a71[_0x56640b(0x201)](':');if(_0x1485a0===-0x1)throw new Error(_0x56640b(0x208)+_0x103a71+'\x22.\x20'+'Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22');const _0x4a3a16=_0x103a71[_0x56640b(0x1df)](0x0,_0x1485a0)[_0x56640b(0x1d9)](),_0x3b5063=_0x103a71[_0x56640b(0x1df)](_0x1485a0+0x1)['trim']();if(!_0x4a3a16)throw new Error('Header\x20key\x20cannot\x20be\x20empty:\x20\x22'+_0x103a71+'\x22');return[_0x4a3a16,_0x3b5063];}export class ApiCommand extends BaseCommand{[a6_0x37d9f4(0x1ec)]=a6_0x37d9f4(0x1e8);[a6_0x37d9f4(0x210)]=a6_0x37d9f4(0x1fe);[a6_0x37d9f4(0x211)](_0x17c57a){const _0x421852=a6_0x37d9f4,{args:_0xb7208f,options:_0x24c2b4}=_0x17c57a,_0x407dc0=_0x24c2b4;if(_0xb7208f[_0x421852(0x209)]===0x0)return _0x421852(0x1f8);const _0x4e4eed=_0xb7208f[0x0];if(!_0x4e4eed[_0x421852(0x1e5)]('/'))return _0x421852(0x1ea)+_0x4e4eed;const _0x20f554=_0x407dc0['data'],_0xe08855=_0x407dc0['file'];if(_0x20f554&&_0xe08855)return _0x421852(0x1e2);const _0x112f30=_0x407dc0[_0x421852(0x1d2)]||'GET',_0x3f994f=[_0x421852(0x213),_0x421852(0x207),_0x421852(0x200),_0x421852(0x1eb),'PATCH'];if(!_0x3f994f['includes'](_0x112f30[_0x421852(0x1f3)]()))return _0x421852(0x204)+_0x112f30+_0x421852(0x203)+_0x3f994f[_0x421852(0x1fa)](',\x20');const _0x4562b4=_0x407dc0[_0x421852(0x20d)]||'td',_0x36e353=['td',_0x421852(0x1d4),_0x421852(0x1d6),_0x421852(0x1d0),'llm',_0x421852(0x1e6),_0x421852(0x20b)];if(!_0x36e353[_0x421852(0x1f9)](_0x4562b4))return _0x421852(0x1f7)+_0x4562b4+_0x421852(0x202)+_0x36e353[_0x421852(0x1fa)](',\x20');return undefined;}async[a6_0x37d9f4(0x1e0)](_0x4d813c){const _0x41085c=a6_0x37d9f4,{options:_0x40cf3e,args:_0x1cc354,tdx:_0x2f7538}=_0x4d813c,_0xbd3955=_0x40cf3e,_0x395e14=_0x1cc354[0x0],_0x45a9f3=(_0xbd3955[_0x41085c(0x1d2)]||'GET')['toUpperCase'](),_0x2be955=_0xbd3955[_0x41085c(0x1f1)],_0x12fa15=_0xbd3955[_0x41085c(0x1e7)],_0x64a747=_0xbd3955[_0x41085c(0x1e3)],_0x24c23a=_0xbd3955[_0x41085c(0x20d)]||'td';try{const _0x3bcb14={};if(_0x64a747){const _0x21c5ff=Array[_0x41085c(0x20a)](_0x64a747)?_0x64a747:[_0x64a747];for(const _0x212877 of _0x21c5ff){const [_0xd18dba,_0x14ba7a]=parseHeader(_0x212877);_0x3bcb14[_0xd18dba]=_0x14ba7a;}}let _0x26452f;if(_0x2be955)_0x26452f=_0x2be955;else{if(_0x12fa15)try{_0x26452f=RawAPI[_0x41085c(0x212)](_0x12fa15);}catch(_0x4428e1){return console[_0x41085c(0x1da)](_0x41085c(0x1db)+(_0x4428e1 instanceof Error?_0x4428e1[_0x41085c(0x20f)]:String(_0x4428e1))),0x1;}}const _0x592ce9={'method':_0x45a9f3,'apiType':_0x24c23a,'includeHeaders':_0x40cf3e['verbose']};_0x26452f&&(_0x592ce9[_0x41085c(0x1f0)]=_0x26452f);Object[_0x41085c(0x206)](_0x3bcb14)[_0x41085c(0x209)]>0x0&&(_0x592ce9[_0x41085c(0x20c)]=_0x3bcb14);if(_0x40cf3e[_0x41085c(0x1fd)]){const _0x22ddc2=resolveSite(_0x40cf3e[_0x41085c(0x1d1)]),_0x5aabc8=getEndpoint(_0x22ddc2,_0x24c23a),_0x530cce=''+_0x5aabc8+_0x395e14;console['error']('>\x20'+_0x45a9f3+'\x20'+_0x530cce);const _0x1f8436=getAuthHeaders(_0x22ddc2),_0x26bb99={..._0x1f8436,..._0x3bcb14};for(const [_0x1dcd7c,_0x250531]of Object[_0x41085c(0x1f6)](_0x26bb99)){!isSensitiveHeader(_0x1dcd7c)&&console[_0x41085c(0x1da)]('>\x20'+_0x1dcd7c+':\x20'+_0x250531);}_0x26452f&&console[_0x41085c(0x1da)]('>'),console[_0x41085c(0x1da)]('');}const _0x56ae2f=await _0x2f7538[_0x41085c(0x1e8)]['request'](_0x395e14,_0x592ce9);if(_0x40cf3e['verbose']&&_0x56ae2f[_0x41085c(0x20c)]){console[_0x41085c(0x1da)](_0x41085c(0x1dc)+_0x56ae2f[_0x41085c(0x1dd)]);for(const [_0x30289f,_0xb592c6]of Object[_0x41085c(0x1f6)](_0x56ae2f['headers'])){!isSensitiveHeader(_0x30289f)&&console[_0x41085c(0x1da)]('<\x20'+_0x30289f+':\x20'+_0xb592c6);}console[_0x41085c(0x1da)]('');}const _0x4a430b=Boolean(_0x40cf3e['output']),_0x2c7f9a={'color':_0x40cf3e[_0x41085c(0x1e4)],'noColor':_0x40cf3e[_0x41085c(0x1e9)]||_0x4a430b&&!_0x40cf3e[_0x41085c(0x1e4)]},_0x3af26d=colorizeJSON(_0x56ae2f[_0x41085c(0x1f1)],_0x2c7f9a);return _0x40cf3e[_0x41085c(0x1ff)]?(writeFileSync(_0x40cf3e[_0x41085c(0x1ff)],_0x3af26d),console[_0x41085c(0x1da)]('Results\x20saved\x20to\x20'+_0x40cf3e[_0x41085c(0x1ff)])):console['log'](_0x3af26d),0x0;}catch(_0x4d66e9){return _0x4d66e9 instanceof Error?(console[_0x41085c(0x1da)](_0x41085c(0x1db)+_0x4d66e9['message']),_0x40cf3e[_0x41085c(0x1fd)]&&_0x4d66e9[_0x41085c(0x1de)]&&console[_0x41085c(0x1da)]('\x0aStack\x20trace:\x0a'+_0x4d66e9[_0x41085c(0x1de)])):console[_0x41085c(0x1da)](_0x41085c(0x1db)+String(_0x4d66e9)),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_0x1c3326=a7_0xc00d;(function(_0x23e948,_0x4af7d5){const _0x13c1bb=a7_0xc00d,_0x538c92=_0x23e948();while(!![]){try{const _0x482f2f=parseInt(_0x13c1bb(0x124))/0x1+-parseInt(_0x13c1bb(0x127))/0x2+-parseInt(_0x13c1bb(0x139))/0x3+-parseInt(_0x13c1bb(0x122))/0x4*(parseInt(_0x13c1bb(0x113))/0x5)+-parseInt(_0x13c1bb(0x120))/0x6*(-parseInt(_0x13c1bb(0x143))/0x7)+parseInt(_0x13c1bb(0x13f))/0x8+parseInt(_0x13c1bb(0x121))/0x9;if(_0x482f2f===_0x4af7d5)break;else _0x538c92['push'](_0x538c92['shift']());}catch(_0x2b68fb){_0x538c92['push'](_0x538c92['shift']());}}}(a7_0x194b,0x58a86));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';function a7_0x194b(){const _0x39c0af=['bold','accountName','jobs','status','API\x20key\x20cannot\x20be\x20empty','logLevel','create','filter','Enter\x20your\x20TD\x20API\x20key:','error','✓\x20Authentication\x20successful\x0a','Choose\x20how\x20to\x20sign\x20in:','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','yellow','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','tdx:\x20auth\x20setup','dim','profile','name','Credential\x20type:\x20OAuth','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','160ODHiaV','No\x20credential\x20found','apiKey','/app/mp/ak','For\x20scripts\x20or\x20headless\x20servers','site','\x20\x20\x20\x202.\x20Or\x20use\x20a\x20different\x20browser\x20profile\x20to\x20avoid\x20cached\x20sessions','Read\x20credential\x20from\x20','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain','email','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','\x20(site:\x20','13254iYqMaR','7634205oDphNg','76644mOzxrW','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','212392ZvzrKO','text','\x20(profile:\x20','727162kKocAH','first_name','apikey','No\x20credentials\x20found\x20in\x20keychain','\x20\x20user_id:','Sign\x20in\x20with\x20browser\x20(recommended)','last_name','ERROR','tdx\x20profile:\x20','Setup\x20cancelled','\x20--profile\x20','You\x20can\x20find\x20your\x20API\x20key\x20at:','✓\x20Default\x20site\x20set\x20to\x20','account_id','warn','Read\x20credential\x20from\x20keychain','User:\x20','access_token','1624521OqwzqM','✗\x20Validation\x20failed:\x20','\x20\x20tdx','Remove\x20API\x20key\x20from\x20system\x20keychain','green','getUserInfo','963936CFUUmf','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','auth','2219nSVUzf','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','all','log','\x20\x20If\x20this\x20is\x20not\x20the\x20expected\x20account:','method','auth:clear','oauth','N/A','Validating\x20API\x20key...','\x20and\x20','✓\x20Profile\x20\x27','Account\x20name\x20for\x20SSO\x20(press\x20Enter\x20to\x20skip):','trim','Use\x20an\x20API\x20key','/oauth/authorize','\x20removed\x20from\x20keychain','execute','description','red','\x27\x20registered'];a7_0x194b=function(){return _0x39c0af;};return a7_0x194b();}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_0x5ef294 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_0x13f29f from'chalk';export async function runOAuthLoginFlow(_0x5f0703,_0x2b3bbe,_0x259eaf,_0x2d624c){const _0x2a203f=a7_0xc00d,_0x19a2d6=await isKeychainAvailable();if(!_0x19a2d6)throw new Error(_0x2a203f(0x141)+_0x2a203f(0x123));let _0x3d7f34=_0x2d624c?.[_0x2a203f(0xff)];if(!_0x3d7f34){const _0x6ccaf3=await a7_0x5ef294({'type':_0x2a203f(0x125),'name':_0x2a203f(0xff),'message':_0x2a203f(0xf5)});if(_0x6ccaf3[_0x2a203f(0xff)]===undefined)throw new Error(_0x2a203f(0x130));_0x3d7f34=_0x6ccaf3[_0x2a203f(0xff)][_0x2a203f(0xf6)]()||undefined;}const _0x2e7db0=getConsoleUrl(_0x5f0703);console[_0x2a203f(0x146)]('Opening\x20browser\x20for\x20authentication...');_0x3d7f34?console[_0x2a203f(0x146)]('\x20\x20'+_0x2e7db0+'/users/initiate_sso\x20(account:\x20'+_0x3d7f34+')'):console[_0x2a203f(0x146)]('\x20\x20'+_0x2e7db0+_0x2a203f(0xf8));console[_0x2a203f(0x146)]('Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...');const _0x1d85fd=await startOAuthFlow(_0x5f0703,{'accountName':_0x3d7f34});console[_0x2a203f(0x146)]('Validating\x20OAuth\x20tokens...');const _0x42d1c9=TDX[_0x2a203f(0x104)]({'site':_0x5f0703,'accessToken':_0x1d85fd[_0x2a203f(0x138)],'logLevel':_0x259eaf??LogLevel[_0x2a203f(0x12e)]}),_0x36eb4c=await _0x42d1c9['jobs']['getUserInfo']();console[_0x2a203f(0x146)](a7_0x13f29f[_0x2a203f(0x13d)]('✓\x20Signed\x20in\x20successfully')),console[_0x2a203f(0x146)]('\x20\x20'+a7_0x13f29f['cyan'](_0x5f0703+':'+_0x36eb4c[_0x2a203f(0x134)])+_0x2a203f(0x12b)+_0x36eb4c['id']+'\x20\x20('+_0x36eb4c[_0x2a203f(0x11c)]+')');!_0x3d7f34&&(console['log'](a7_0x13f29f[_0x2a203f(0x10e)](_0x2a203f(0x147))),console[_0x2a203f(0x146)](a7_0x13f29f[_0x2a203f(0x10e)]('\x20\x20\x20\x201.\x20Run:\x20tdx\x20auth\x20setup\x20--account-name\x20<name>')),console['log'](a7_0x13f29f['dim'](_0x2a203f(0x119))));await saveOAuthTokens(_0x1d85fd,_0x2b3bbe),console[_0x2a203f(0x146)](_0x2a203f(0x11b)+(_0x2b3bbe?_0x2a203f(0x126)+_0x2b3bbe+')':''));if(_0x2b3bbe){const _0x231a30={'site':_0x5f0703};saveProfileToUserConfig(_0x2b3bbe,_0x231a30),console[_0x2a203f(0x146)](_0x2a203f(0xf4)+_0x2b3bbe+_0x2a203f(0xfd));}else saveDefaultSiteToUserConfig(_0x5f0703),console[_0x2a203f(0x146)](_0x2a203f(0x133)+_0x5f0703);const _0x36d7d6=_0x2b3bbe?_0x2a203f(0x131)+_0x2b3bbe:'';console['log'](),console[_0x2a203f(0x146)](_0x2a203f(0x10c)),console['log'](_0x2a203f(0x13b)+_0x36d7d6+_0x2a203f(0x10a)),console[_0x2a203f(0x146)]('\x20\x20tdx'+_0x36d7d6+_0x2a203f(0x140));}export async function promptAuthMethod(){const _0x1f6a7d=a7_0xc00d,_0x139537=await a7_0x5ef294({'type':'select','name':_0x1f6a7d(0x148),'message':_0x1f6a7d(0x109),'choices':[{'title':_0x1f6a7d(0x12c),'description':'Opens\x20your\x20browser\x20to\x20sign\x20in\x20with\x20SSO','value':_0x1f6a7d(0x14a)},{'title':_0x1f6a7d(0xf7),'description':_0x1f6a7d(0x117),'value':_0x1f6a7d(0x129)}]});return _0x139537['method']||null;}export class AuthSetupCommand extends BaseCommand{['name']='auth:setup';[a7_0x1c3326(0xfb)]='Setup\x20API\x20key\x20authentication\x20interactively';async[a7_0x1c3326(0xfa)](_0x476730){const _0x262dbe=a7_0x1c3326,{options:_0x373a07}=_0x476730,_0x5dfa74=_0x373a07[_0x262dbe(0x10f)];console[_0x262dbe(0x146)](a7_0x13f29f[_0x262dbe(0xfe)](_0x262dbe(0x10d)));const _0xda6aec=_0x373a07[_0x262dbe(0x118)]||'us01',_0x20d855=await promptSiteSelection(_0xda6aec,_0x5dfa74,'Setup\x20cancelled');if(!_0x20d855)return 0x1;const _0x29e87f=resolveSite(_0x20d855),_0x47732a=await promptAuthMethod();if(!_0x47732a)return console[_0x262dbe(0x146)]('\x0aSetup\x20cancelled'),0x1;if(_0x47732a===_0x262dbe(0x14a)){const {accountName:_0x719ef}=_0x373a07;return await runOAuthLoginFlow(_0x29e87f,_0x5dfa74,_0x373a07[_0x262dbe(0x103)]??LogLevel[_0x262dbe(0x12e)],{'accountName':_0x719ef}),0x0;}console[_0x262dbe(0x146)]('Setting\x20up\x20authentication\x20for\x20site:\x20'+_0x29e87f),console[_0x262dbe(0x146)](_0x262dbe(0x132)),console['log']('\x20\x20'+getConsoleUrl(_0x29e87f,_0x262dbe(0x116)));const _0xa51d33=await a7_0x5ef294({'type':'password','name':_0x262dbe(0x115),'message':_0x262dbe(0x106),'validate':_0x5e7922=>{const _0x1a0038=_0x262dbe;if(!_0x5e7922||!_0x5e7922[_0x1a0038(0xf6)]())return _0x1a0038(0x102);return!![];}});if(!_0xa51d33['apiKey'])return console[_0x262dbe(0x146)]('\x0aSetup\x20cancelled'),0x1;const _0x127acb=_0xa51d33[_0x262dbe(0x115)];console[_0x262dbe(0x146)](_0x262dbe(0x14c));try{const _0x2da5c9=TDX['create']({'site':_0x29e87f,'apiKey':_0x127acb[_0x262dbe(0xf6)](),'logLevel':_0x373a07[_0x262dbe(0x103)]??LogLevel['ERROR']}),_0x401023=await _0x2da5c9[_0x262dbe(0x100)][_0x262dbe(0x13e)]();console['log'](_0x262dbe(0x112)+_0x401023['email']+')');const _0x3e8a52=await isKeychainAvailable();_0x3e8a52?(await saveAPIKeyAsync(_0x127acb[_0x262dbe(0xf6)](),_0x29e87f,_0x5dfa74),console[_0x262dbe(0x146)](_0x262dbe(0x144)+(_0x5dfa74?_0x262dbe(0x126)+_0x5dfa74+')':''))):(console[_0x262dbe(0x135)](a7_0x13f29f['yellow'](_0x262dbe(0x11e))),console[_0x262dbe(0x135)](a7_0x13f29f[_0x262dbe(0x10b)](_0x262dbe(0x11d))));if(_0x5dfa74){const _0x50161b={'site':_0x29e87f};saveProfileToUserConfig(_0x5dfa74,_0x50161b),console['log'](_0x262dbe(0xf4)+_0x5dfa74+_0x262dbe(0xfd));}else saveDefaultSiteToUserConfig(_0x29e87f),console[_0x262dbe(0x146)](_0x262dbe(0x133)+_0x29e87f);const _0x3639ca=_0x5dfa74?'\x20--profile\x20'+_0x5dfa74:'';return console[_0x262dbe(0x146)](),console[_0x262dbe(0x146)](_0x262dbe(0x10c)),console['log'](_0x262dbe(0x13b)+_0x3639ca+_0x262dbe(0x10a)),console[_0x262dbe(0x146)]('\x20\x20tdx'+_0x3639ca+_0x262dbe(0x140)),0x0;}catch(_0x3a8557){if(_0x3a8557 instanceof HTTPClientError&&_0x3a8557[_0x262dbe(0x101)]===0x191)return printAuthError(_0x3a8557),0x1;return console[_0x262dbe(0x107)](a7_0x13f29f['red'](_0x262dbe(0x13a)+(_0x3a8557 instanceof Error?_0x3a8557['message']:String(_0x3a8557)))),console['error']('API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.'),0x1;}}}function a7_0xc00d(_0x1bf3c2,_0x2e11d9){_0x1bf3c2=_0x1bf3c2-0xf3;const _0x194bf9=a7_0x194b();let _0xc00d87=_0x194bf9[_0x1bf3c2];return _0xc00d87;}export class AuthStatusCommand extends BaseCommand{[a7_0x1c3326(0x110)]=a7_0x1c3326(0x142);['description']='Show\x20authentication\x20status\x20and\x20validate\x20API\x20key';async[a7_0x1c3326(0xfa)](_0x55512f){const _0x502cf8=a7_0x1c3326,{options:_0x3886a5,tdx:_0x1670a2}=_0x55512f,_0x34db80=_0x3886a5[_0x502cf8(0x118)],_0x274488=_0x3886a5[_0x502cf8(0x10f)],_0x11304a=_0x274488?_0x274488:_0x502cf8(0x14b);console[_0x502cf8(0x146)](_0x502cf8(0x12f)+_0x11304a+_0x502cf8(0x11f)+_0x34db80+')');const _0x2d2bc1=await getOAuthTokens(_0x274488);if(_0x2d2bc1)console[_0x502cf8(0x146)](_0x502cf8(0x111)),console[_0x502cf8(0x146)](_0x502cf8(0x136)+(_0x274488?_0x502cf8(0x126)+_0x274488+')':''));else{const _0x4f3021=await resolveAPIKeyAsync(_0x34db80,_0x274488);if(_0x4f3021){const {source:_0x5adbac,isDeprecated:_0x266067}=_0x4f3021,_0x45b58c=_0x502cf8(0x11a)+_0x5adbac;console[_0x502cf8(0x146)](_0x266067?a7_0x13f29f['yellow'](_0x45b58c):_0x45b58c);}else console[_0x502cf8(0x146)](a7_0x13f29f[_0x502cf8(0x10b)](_0x502cf8(0x114)));}try{const _0x3a007d=await _0x1670a2[_0x502cf8(0x100)][_0x502cf8(0x13e)]();return console[_0x502cf8(0x146)](a7_0x13f29f['green'](_0x502cf8(0x108))),console[_0x502cf8(0x146)](_0x502cf8(0x137)+_0x3a007d[_0x502cf8(0x11c)]),(_0x3a007d[_0x502cf8(0x128)]||_0x3a007d[_0x502cf8(0x12d)])&&console[_0x502cf8(0x146)]('Name:\x20'+[_0x3a007d[_0x502cf8(0x128)],_0x3a007d[_0x502cf8(0x12d)]][_0x502cf8(0x105)](Boolean)['join']('\x20')),0x0;}catch(_0x384559){return _0x384559 instanceof HTTPClientError&&_0x384559['status']===0x191?printAuthError(_0x384559,!![],_0x274488):console[_0x502cf8(0x107)](a7_0x13f29f[_0x502cf8(0xfc)](_0x502cf8(0x13a)+(_0x384559 instanceof Error?_0x384559['message']:String(_0x384559)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x1c3326(0x110)]=a7_0x1c3326(0x149);['description']=a7_0x1c3326(0x13c);async['execute'](_0x403127){const _0x5eb2a3=a7_0x1c3326,{options:_0x327b87}=_0x403127,_0x26e577=_0x327b87[_0x5eb2a3(0x10f)];console[_0x5eb2a3(0x146)](a7_0x13f29f[_0x5eb2a3(0xfe)]('tdx:\x20auth\x20clear'));const _0x119b7a=await isKeychainAvailable();if(!_0x119b7a)return console[_0x5eb2a3(0x107)](a7_0x13f29f[_0x5eb2a3(0xfc)]('System\x20keychain\x20is\x20not\x20available')),0x1;const [_0x2f78bf,_0x5b57f2]=await Promise[_0x5eb2a3(0x145)]([deleteKeychainAPIKey(_0x26e577),deleteOAuthTokens(_0x26e577)]);if(_0x2f78bf||_0x5b57f2){clearCredentialCache();const _0x5831d9=[_0x2f78bf&&'API\x20key',_0x5b57f2&&'OAuth\x20tokens'][_0x5eb2a3(0x105)](Boolean)['join'](_0x5eb2a3(0xf3));return console[_0x5eb2a3(0x146)]('✓\x20'+_0x5831d9+_0x5eb2a3(0xf9)+(_0x26e577?_0x5eb2a3(0x126)+_0x26e577+')':'')),0x0;}else return console['log'](_0x5eb2a3(0x12a)+(_0x26e577?'\x20for\x20profile:\x20'+_0x26e577:'')),0x1;}}