@treasuredata/tdx 2026.4.7 → 2026.4.9

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 (232) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/cas-command.js +1 -1
  11. package/dist/commands/cas-segment-command.js +1 -1
  12. package/dist/commands/chat-command.js +1 -1
  13. package/dist/commands/claude-command.js +1 -1
  14. package/dist/commands/claude-statusline-command.js +1 -1
  15. package/dist/commands/claude-usage-command.js +1 -1
  16. package/dist/commands/command.js +1 -1
  17. package/dist/commands/connection-command.js +1 -1
  18. package/dist/commands/databases.js +1 -1
  19. package/dist/commands/delivery-command.js +1 -1
  20. package/dist/commands/describe.js +1 -1
  21. package/dist/commands/engage-campaign-pull-command.js +1 -1
  22. package/dist/commands/engage-campaign-push-command.js +1 -1
  23. package/dist/commands/engage-campaign-validate-command.js +1 -1
  24. package/dist/commands/engage-command.js +1 -1
  25. package/dist/commands/engage-template-pull-command.js +1 -1
  26. package/dist/commands/engage-template-push-command.js +1 -1
  27. package/dist/commands/engage-template-validate-command.js +1 -1
  28. package/dist/commands/job-command.js +1 -1
  29. package/dist/commands/journey-command.js +1 -1
  30. package/dist/commands/journey-validate-command.js +1 -1
  31. package/dist/commands/llm-command.js +1 -1
  32. package/dist/commands/mcp-command.js +1 -1
  33. package/dist/commands/parent-segment-command.js +1 -1
  34. package/dist/commands/policy-command.js +1 -1
  35. package/dist/commands/profile-command.js +1 -1
  36. package/dist/commands/profiles-command.js +1 -1
  37. package/dist/commands/query-command.js +1 -1
  38. package/dist/commands/schedule-command.js +1 -1
  39. package/dist/commands/segment-command.js +1 -1
  40. package/dist/commands/segment-create-command.js +1 -1
  41. package/dist/commands/segment-fields-command.js +1 -1
  42. package/dist/commands/segment-pull-command.js +1 -1
  43. package/dist/commands/segment-push-command.js +1 -1
  44. package/dist/commands/segment-update-command.js +1 -1
  45. package/dist/commands/segment-use-command.js +1 -1
  46. package/dist/commands/segment-validate-command.js +1 -1
  47. package/dist/commands/segments.js +1 -1
  48. package/dist/commands/show.js +1 -1
  49. package/dist/commands/status-command.js +1 -1
  50. package/dist/commands/tables.js +1 -1
  51. package/dist/commands/unset-command.js +1 -1
  52. package/dist/commands/upgrade-command.js +1 -1
  53. package/dist/commands/use-command.js +1 -1
  54. package/dist/commands/user-command.js +1 -1
  55. package/dist/commands/work-command.js +1 -1
  56. package/dist/commands/workflow-command.js +1 -1
  57. package/dist/core/auth.js +1 -1
  58. package/dist/core/command-output.js +1 -1
  59. package/dist/core/config.js +1 -1
  60. package/dist/core/connection-cache.js +1 -1
  61. package/dist/core/constants.js +1 -1
  62. package/dist/core/credential-cache.js +1 -1
  63. package/dist/core/global-context.js +1 -1
  64. package/dist/core/keychain.js +1 -1
  65. package/dist/core/oauth-keychain.js +1 -1
  66. package/dist/core/oauth.js +1 -1
  67. package/dist/core/profile.js +1 -1
  68. package/dist/core/project-config.js +1 -1
  69. package/dist/core/session.js +1 -1
  70. package/dist/core/user-cache.js +1 -1
  71. package/dist/core/version.js +1 -1
  72. package/dist/index.js +1 -1
  73. package/dist/mcp/server.js +1 -1
  74. package/dist/mcp/tools/index.js +1 -1
  75. package/dist/mcp/tools/tdx-run.js +1 -1
  76. package/dist/mcp/tools/tdx-search.js +1 -1
  77. package/dist/mcp/tools/work-create-item.js +1 -1
  78. package/dist/mcp/utils.js +1 -1
  79. package/dist/proxy/claude-usage-tracker.js +1 -1
  80. package/dist/proxy/passthrough-server.js +1 -1
  81. package/dist/proxy/sse-usage-parser.js +1 -1
  82. package/dist/sdk/agent/agent-config.js +1 -1
  83. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  84. package/dist/sdk/agent/agent-yaml.js +1 -1
  85. package/dist/sdk/agent/test/evaluator.js +1 -1
  86. package/dist/sdk/agent/test/executor.js +1 -1
  87. package/dist/sdk/agent/test/index.js +1 -1
  88. package/dist/sdk/agent/test/output.js +1 -1
  89. package/dist/sdk/agent/test/parser.js +1 -1
  90. package/dist/sdk/agent/tool-target-registry.js +1 -1
  91. package/dist/sdk/api.js +1 -1
  92. package/dist/sdk/cas/cas-api-client.js +1 -1
  93. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  94. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  95. package/dist/sdk/cas/index.js +1 -1
  96. package/dist/sdk/cas/pull-workflow.js +1 -1
  97. package/dist/sdk/cas/push-workflow.js +1 -1
  98. package/dist/sdk/client/cdp-api-client.js +1 -1
  99. package/dist/sdk/client/delivery-api-client.js +1 -1
  100. package/dist/sdk/client/endpoints.js +1 -1
  101. package/dist/sdk/client/engage-api-client.js +1 -1
  102. package/dist/sdk/client/http-client.js +1 -1
  103. package/dist/sdk/client/llm-api-client.js +1 -1
  104. package/dist/sdk/client/oauth-refresh.js +1 -1
  105. package/dist/sdk/client/rate-limiter.js +1 -1
  106. package/dist/sdk/client/td-api-client.js +1 -1
  107. package/dist/sdk/client/trino-api-client.js +1 -1
  108. package/dist/sdk/client/workflow-client.js +1 -1
  109. package/dist/sdk/connection-validator.js +1 -1
  110. package/dist/sdk/connection.js +1 -1
  111. package/dist/sdk/delivery.js +1 -1
  112. package/dist/sdk/engage/campaign-pull.js +1 -1
  113. package/dist/sdk/engage/campaign-push.js +1 -1
  114. package/dist/sdk/engage/campaign-validator.js +1 -1
  115. package/dist/sdk/engage/campaign-yaml.js +1 -1
  116. package/dist/sdk/engage/template-pull.js +1 -1
  117. package/dist/sdk/engage/template-push.js +1 -1
  118. package/dist/sdk/engage/template-validator.js +1 -1
  119. package/dist/sdk/engage/template-yaml.js +1 -1
  120. package/dist/sdk/engage/types/campaign-def.js +1 -1
  121. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  122. package/dist/sdk/engage/types/template-schema.js +1 -1
  123. package/dist/sdk/engage.js +1 -1
  124. package/dist/sdk/errors.js +1 -1
  125. package/dist/sdk/index.js +1 -1
  126. package/dist/sdk/io/index.js +1 -1
  127. package/dist/sdk/io/node-filesystem.js +1 -1
  128. package/dist/sdk/job.js +1 -1
  129. package/dist/sdk/journey.js +1 -1
  130. package/dist/sdk/llm/chat-cache.js +1 -1
  131. package/dist/sdk/llm/index.js +1 -1
  132. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  133. package/dist/sdk/llm/model-factors.js +1 -1
  134. package/dist/sdk/personalization.js +1 -1
  135. package/dist/sdk/policy.js +1 -1
  136. package/dist/sdk/query/index.js +1 -1
  137. package/dist/sdk/query/sql-parser.js +1 -1
  138. package/dist/sdk/realtime.js +1 -1
  139. package/dist/sdk/schedule.js +1 -1
  140. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  141. package/dist/sdk/segment/fields-display.js +1 -1
  142. package/dist/sdk/segment/file-discovery.js +1 -1
  143. package/dist/sdk/segment/journey-utils.js +1 -1
  144. package/dist/sdk/segment/journey-validator.js +1 -1
  145. package/dist/sdk/segment/journey-yaml.js +1 -1
  146. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  147. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  148. package/dist/sdk/segment/pull-workflow.js +1 -1
  149. package/dist/sdk/segment/push-recovery.js +1 -1
  150. package/dist/sdk/segment/push-workflow.js +1 -1
  151. package/dist/sdk/segment/resolution-context.js +1 -1
  152. package/dist/sdk/segment/segment-path-parser.js +1 -1
  153. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  154. package/dist/sdk/segment/segment-validator.js +1 -1
  155. package/dist/sdk/segment/target-resolution.js +1 -1
  156. package/dist/sdk/segment/tdx-config.js +1 -1
  157. package/dist/sdk/segment/types/activation-schema.js +1 -1
  158. package/dist/sdk/segment/types/journey-def.js +1 -1
  159. package/dist/sdk/segment/types/journey-schema.js +1 -1
  160. package/dist/sdk/segment/types/segment-def.js +1 -1
  161. package/dist/sdk/segment/types/segment-schema.js +1 -1
  162. package/dist/sdk/segment/validate-files.js +1 -1
  163. package/dist/sdk/segment/yaml-validator.js +1 -1
  164. package/dist/sdk/segment.js +1 -1
  165. package/dist/sdk/types/index.js +1 -1
  166. package/dist/sdk/types/progress.js +1 -1
  167. package/dist/sdk/types/workspace.js +1 -1
  168. package/dist/sdk/user.js +1 -1
  169. package/dist/sdk/util/format-detector.js +1 -1
  170. package/dist/sdk/util/formatters.js +1 -1
  171. package/dist/sdk/util/index.js +1 -1
  172. package/dist/sdk/util/paginate.js +1 -1
  173. package/dist/sdk/util/tree-formatter.js +1 -1
  174. package/dist/sdk/workflow/archive-validation.js +1 -1
  175. package/dist/sdk/workflow/clone-workflow.js +1 -1
  176. package/dist/sdk/workflow/index.js +1 -1
  177. package/dist/sdk/workflow/pull-workflow.js +1 -1
  178. package/dist/sdk/workflow/push-workflow.js +1 -1
  179. package/dist/sdk/workflow/tdx-config.js +1 -1
  180. package/dist/sdk/workflow/workflow-utils.js +1 -1
  181. package/dist/sdk/workspace/access-tracker.d.ts +2 -0
  182. package/dist/sdk/workspace/access-tracker.d.ts.map +1 -1
  183. package/dist/sdk/workspace/access-tracker.js +1 -1
  184. package/dist/sdk/workspace/access-tracker.js.map +1 -1
  185. package/dist/sdk/workspace/frontmatter.js +1 -1
  186. package/dist/sdk/workspace/git.js +1 -1
  187. package/dist/sdk/workspace/index.d.ts +2 -0
  188. package/dist/sdk/workspace/index.d.ts.map +1 -1
  189. package/dist/sdk/workspace/index.js +1 -1
  190. package/dist/sdk/workspace/index.js.map +1 -1
  191. package/dist/sdk/workspace/templates.js +1 -1
  192. package/dist/sdk/workspace/weekly.js +1 -1
  193. package/dist/sdk/workspace/wikilinks.js +1 -1
  194. package/dist/test-utils/command-runner.js +1 -1
  195. package/dist/test-utils/factories.js +1 -1
  196. package/dist/test-utils/fixtures.js +1 -1
  197. package/dist/test-utils/http-mock.js +1 -1
  198. package/dist/test-utils/index.js +1 -1
  199. package/dist/utils/async.js +1 -1
  200. package/dist/utils/colors.js +1 -1
  201. package/dist/utils/diff.js +1 -1
  202. package/dist/utils/file-permissions.js +1 -1
  203. package/dist/utils/file-reader.js +1 -1
  204. package/dist/utils/github-releases.js +1 -1
  205. package/dist/utils/global-cache.js +1 -1
  206. package/dist/utils/json-loader.js +1 -1
  207. package/dist/utils/local-cache.js +1 -1
  208. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  209. package/dist/utils/logger/formatters/index.js +1 -1
  210. package/dist/utils/logger/handlers/console-handler.js +1 -1
  211. package/dist/utils/logger/handlers/file-handler.js +1 -1
  212. package/dist/utils/logger/handlers/index.js +1 -1
  213. package/dist/utils/logger/handlers/null-handler.js +1 -1
  214. package/dist/utils/logger/index.js +1 -1
  215. package/dist/utils/logger/logger.js +1 -1
  216. package/dist/utils/logger/types.js +1 -1
  217. package/dist/utils/option-validation.js +1 -1
  218. package/dist/utils/process.d.ts +3 -0
  219. package/dist/utils/process.d.ts.map +1 -1
  220. package/dist/utils/process.js +1 -1
  221. package/dist/utils/process.js.map +1 -1
  222. package/dist/utils/prompt.js +1 -1
  223. package/dist/utils/spinner.js +1 -1
  224. package/dist/utils/sse-parser.js +1 -1
  225. package/dist/utils/string-utils.js +1 -1
  226. package/dist/utils/table-ref-parser.js +1 -1
  227. package/dist/utils/tdx-logger.js +1 -1
  228. package/dist/utils/version-check.d.ts +10 -2
  229. package/dist/utils/version-check.d.ts.map +1 -1
  230. package/dist/utils/version-check.js +1 -1
  231. package/dist/utils/version-check.js.map +1 -1
  232. package/package.json +1 -1
@@ -1 +1 @@
1
- const a3_0x54b9c1=a3_0x5400;function a3_0x1910(){const _0x1fa737=['site','Error:\x20Segment\x20name\x20is\x20required','segment','execute','listActivations','Resolving\x20parent\x20segment\x20\x27','13748lWvSAg','910152uWLnaw','error','resolveParentId','verbose','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','2759530qEPVMG','Listing\x20activations\x20for\x20segment\x20\x27','742773peXeUq','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','Site:\x20','779139UPmczV','List\x20activations\x20for\x20a\x20segment','resolveSegmentId','9418836cvLJIN','\x27...','data','Resolved\x20child\x20ID:\x20','\x20\x20Cause:\x20','activations','6213336ZrJwAB','Resolved\x20parent\x20ID:\x20','cause','Error:\x20','Parent\x20name:\x20','Resolving\x20child\x20segment\x20\x27','\x20activation','Child\x20name:\x20','name','length'];a3_0x1910=function(){return _0x1fa737;};return a3_0x1910();}function a3_0x5400(_0x6c3ec4,_0x422dad){_0x6c3ec4=_0x6c3ec4-0x73;const _0x191087=a3_0x1910();let _0x540061=_0x191087[_0x6c3ec4];return _0x540061;}(function(_0x197ea6,_0x50d831){const _0x53262b=a3_0x5400,_0x54585f=_0x197ea6();while(!![]){try{const _0x456e8e=parseInt(_0x53262b(0x7a))/0x1+-parseInt(_0x53262b(0x73))/0x2+-parseInt(_0x53262b(0x7d))/0x3+parseInt(_0x53262b(0x96))/0x4+parseInt(_0x53262b(0x78))/0x5+-parseInt(_0x53262b(0x86))/0x6+parseInt(_0x53262b(0x80))/0x7;if(_0x456e8e===_0x50d831)break;else _0x54585f['push'](_0x54585f['shift']());}catch(_0x3dec47){_0x54585f['push'](_0x54585f['shift']());}}}(a3_0x1910,0xda187));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';export class ActivationsCommand extends BaseCommand{[a3_0x54b9c1(0x8e)]=a3_0x54b9c1(0x85);['description']=a3_0x54b9c1(0x7e);async[a3_0x54b9c1(0x93)](_0x73f8a1){const _0x15301d=a3_0x54b9c1,{options:_0x16108f,args:_0x36caf9,tdx:_0x378156}=_0x73f8a1;if(_0x36caf9['length']===0x0)return console[_0x15301d(0x74)](_0x15301d(0x91)),console[_0x15301d(0x74)](_0x15301d(0x7b)),0x1;try{const {parentId:_0xb1e9df,childId:_0x23f2ff}=parseSegmentRef(_0x36caf9[0x0]);if(!_0x23f2ff)return console[_0x15301d(0x74)](_0x15301d(0x77)),console['error'](_0x15301d(0x7b)),0x1;_0x16108f[_0x15301d(0x76)]&&(console['error'](_0x15301d(0x7c)+_0x16108f[_0x15301d(0x90)]),console['error'](_0x15301d(0x8a)+_0xb1e9df),console[_0x15301d(0x74)](_0x15301d(0x8d)+_0x23f2ff));const _0x5ead74=await withSpinner(_0x15301d(0x95)+_0xb1e9df+_0x15301d(0x81),()=>_0x378156[_0x15301d(0x92)][_0x15301d(0x75)](_0xb1e9df),{'verbose':_0x16108f['verbose']}),_0x285ebd=_0x5ead74[_0x15301d(0x82)];_0x16108f[_0x15301d(0x76)]&&console[_0x15301d(0x74)](_0x15301d(0x87)+_0x285ebd);const _0x4e3725=await withSpinner(_0x15301d(0x8b)+_0x23f2ff+_0x15301d(0x81),()=>_0x378156[_0x15301d(0x92)][_0x15301d(0x7f)](_0x285ebd,_0x23f2ff),{'verbose':_0x16108f[_0x15301d(0x76)]}),_0x114a3e=_0x4e3725[_0x15301d(0x82)];_0x16108f[_0x15301d(0x76)]&&console['error'](_0x15301d(0x83)+_0x114a3e);const _0x3663ad=await withSpinner(_0x15301d(0x79)+_0x23f2ff+_0x15301d(0x81),()=>_0x378156['segment'][_0x15301d(0x94)](_0x285ebd,_0x114a3e),{'verbose':_0x16108f[_0x15301d(0x76)]}),_0x3223f5=_0x3663ad[_0x15301d(0x82)];return console[_0x15301d(0x74)]('✔\x20Found\x20'+_0x3223f5[_0x15301d(0x8f)]+_0x15301d(0x8c)+(_0x3223f5[_0x15301d(0x8f)]!==0x1?'s':'')),await handleSDKOutput(_0x3223f5,_0x16108f),0x0;}catch(_0x1836dc){if(_0x1836dc instanceof SDKError)return console[_0x15301d(0x74)](_0x15301d(0x89)+_0x1836dc['message']),_0x1836dc['cause']&&console[_0x15301d(0x74)](_0x15301d(0x84)+_0x1836dc[_0x15301d(0x88)]),0x1;throw _0x1836dc;}}}
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 +1 @@
1
- const a4_0x1b42db=a4_0x4977;(function(_0x4c455b,_0x322d70){const _0x5ef4be=a4_0x4977,_0x2b888a=_0x4c455b();while(!![]){try{const _0x576fbb=-parseInt(_0x5ef4be(0x18b))/0x1*(parseInt(_0x5ef4be(0x13f))/0x2)+parseInt(_0x5ef4be(0x129))/0x3*(-parseInt(_0x5ef4be(0xe2))/0x4)+-parseInt(_0x5ef4be(0x10f))/0x5+parseInt(_0x5ef4be(0xd9))/0x6*(parseInt(_0x5ef4be(0x14b))/0x7)+-parseInt(_0x5ef4be(0xe4))/0x8+parseInt(_0x5ef4be(0xde))/0x9*(-parseInt(_0x5ef4be(0x128))/0xa)+parseInt(_0x5ef4be(0x191))/0xb;if(_0x576fbb===_0x322d70)break;else _0x2b888a['push'](_0x2b888a['shift']());}catch(_0x3c1ad2){_0x2b888a['push'](_0x2b888a['shift']());}}}(a4_0x49f9,0xad0fc));import a4_0x387251 from'chalk';import a4_0x64301b from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a4_0x49f9(){const _0x5e60b8=['Using\x20project\x20from\x20','\x22:\x20','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','\x20\x20Text\x20Knowledge\x20Bases:\x20','push','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','\x20|\x20','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','\x20total','pullAgent','updated','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','\x22\x20from\x20project\x20\x22','message','<new-name>','\x0a✔\x20Pushed\x20','\x0aPush\x20','283EESfiL','cyan','Output\x20path:\x20','-\x20nothing\x20pushed','Dry\x20run\x20-\x20no\x20files\x20written','new','44002728tLYyLE','projectName','experimentalKnowledgeBases','Agent\x20pulled\x20successfully','\x20=\x20','\x20\x20tdx\x20agent\x20clone\x20--name\x20<new-name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clone\x20from\x20context\x20(llm_project)','red','\x20\x20Text\x20Knowledge\x20Base\x20\x22','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','Project\x20cloned\x20successfully','4837398dJNAby','cwd-config','error','description','dirname','1197954lPODLI','diff','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','llmProject','4wxYfGZ','tdx.json','3764992iDLgez','profile','Analyzing\x20changes\x20to\x20push...','yes','hasChanges','\x0aErrors\x20found:','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)','Project:\x20','session','gray','context','Dry\x20run\x20-\x20no\x20changes\x20made','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','arg-dir','cwd','\x20errors','\x20created','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','\x20\x20Source:\x20','repeat','Writing\x20files...','textKnowledgeBases','total','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','action','\x20resources\x20to\x20\x27','\x20\x20Chat\x20Interface\x20\x22','Source:\x20','\x22...','pushProject','projectId','created','output','pushAgent','agentName','join','Using\x20project\x20from\x20context:\x20','\x20\x20Agents:\x20','log','\x0aChanges\x20to\x20agent\x20\x27','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','No\x20tdx.json\x20found\x20in\x20','6993095wapVqd','Pushing\x20agent\x20from\x20\x22','agent:pull','no_context','Cancelled','\x20\x20Knowledge\x20Base\x20\x22','formInterfaces','prompts','New\x20project\x20name\x20is\x20required','Would\x20push\x20agent:\x20','\x20files?','Project\x20cloned\x20with\x20errors','agent:clone','\x0aProject\x20pushed\x20with\x20errors','llm_project','New\x20project:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory','execute','experimentalArtifacts','dryRun','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','\x22\x20to\x20\x22','sourceProjectName','\x20successfully','newProjectId','10lFOHQz','3520623PaGXAk','utf-8','\x20\x20Form\x20Interface\x20\x22','Pulling\x20agent\x20\x22','Analyzing\x20project\x20\x22','source','agent.yml','\x0aChanges\x20to\x20form\x20interface\x20\x27','\x20\x20Integrations:\x20','newProjectName','no_local_folder','dim','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','outputPath','\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','\x0aChanges:','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20new','pullProject','\x20--name\x20','agent:push','✔\x20Context\x20set:\x20','6514DXNHqI','\x0aPull\x20summary\x20for\x20\x27','\x20\x20Agent\x20\x22','knowledgeBases','\x20unchanged','agent','Errors:','Clone\x20\x22','Output:\x20','\x20\x20Prompt\x20\x22','\x0aPush\x20summary\x20for\x20\x27','Would\x20pull\x20agent:\x20','7iJSTBt','\x20resources?','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','chatInterfaces','Pushing\x20to\x20project...','Status:\x20','\x20changed','integrations','\x22\x20to\x20a\x20different\x20profile','\x20\x20Chat\x20Interfaces:\x20','Would\x20clone:','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','parse','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','outputDir','Using\x20project:\x20','errors','\x0a✔\x20Pulled\x20','green','projectDir','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','\x20files\x20to\x20','reason','Using\x20local\x20project:\x20','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','\x20\x20Integration\x20\x22','force','\x20\x20Target:\x20','\x20--profile\x20','name','counts','INVALID_ARGUMENT','llm','\x20\x20Prompts:\x20','unchanged','yellow','Agent:\x20','\x20\x20Form\x20Interfaces:\x20','\x20\x20Knowledge\x20Bases:\x20','agentId','\x0aChanges\x20to\x20prompt\x20\x27','\x20\x20tdx\x20agent\x20clone\x20agents/','\x0aError:','site','agents'];a4_0x49f9=function(){return _0x5e60b8;};return a4_0x49f9();}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';function a4_0x4977(_0x13ae4c,_0x1bb71d){_0x13ae4c=_0x13ae4c-0xd0;const _0x49f940=a4_0x49f9();let _0x4977f0=_0x49f940[_0x13ae4c];return _0x4977f0;}import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x366fb2){const _0x330ec6=a4_0x4977,_0x91f669=[];if(_0x366fb2[_0x330ec6(0xfb)]!==undefined)_0x91f669['push'](_0x366fb2[_0x330ec6(0xfb)]+_0x330ec6(0x182));if(_0x366fb2[_0x330ec6(0x190)]!==undefined&&_0x366fb2['new']>0x0)_0x91f669[_0x330ec6(0x17e)](a4_0x387251['green'](_0x366fb2[_0x330ec6(0x190)]+_0x330ec6(0x13a)));if(_0x366fb2[_0x330ec6(0x104)]!==undefined&&_0x366fb2[_0x330ec6(0x104)]>0x0)_0x91f669[_0x330ec6(0x17e)](a4_0x387251[_0x330ec6(0x15e)](_0x366fb2['created']+_0x330ec6(0xf5)));if(_0x366fb2[_0x330ec6(0x184)]!==undefined&&_0x366fb2[_0x330ec6(0x184)]>0x0)_0x91f669[_0x330ec6(0x17e)](a4_0x387251[_0x330ec6(0x16f)](_0x366fb2['updated']+'\x20updated'));if(_0x366fb2[_0x330ec6(0x16e)]!==undefined&&_0x366fb2[_0x330ec6(0x16e)]>0x0)_0x91f669[_0x330ec6(0x17e)](a4_0x387251[_0x330ec6(0xed)](_0x366fb2[_0x330ec6(0x16e)]+_0x330ec6(0x143)));if(_0x366fb2[_0x330ec6(0x15c)]!==undefined&&_0x366fb2[_0x330ec6(0x15c)]>0x0)_0x91f669[_0x330ec6(0x17e)](a4_0x387251['red'](_0x366fb2[_0x330ec6(0x15c)]+_0x330ec6(0xf4)));return _0x91f669[_0x330ec6(0x108)](',\x20');}function displayDiffs(_0x4a5eea,_0x33fae3,_0x31c0cc,_0x54846d,_0x444a79,_0x5f4644,_0x2795bd,_0x16bd26,_0x597aa8){const _0x581a39=a4_0x4977;for(const _0x1f99e7 of _0x4a5eea){if(_0x1f99e7['diff']){const _0x4e0968=_0x1f99e7[_0x581a39(0x107)]||_0x1f99e7[_0x581a39(0x169)];console[_0x581a39(0x10b)](_0x581a39(0x10c)+_0x4e0968+'\x27:'),console['log']('─'['repeat'](0x3c)),console[_0x581a39(0x10b)](_0x1f99e7[_0x581a39(0xdf)]),console['log']('─'[_0x581a39(0xf8)](0x3c));}}for(const _0x54e08f of _0x33fae3){_0x54e08f[_0x581a39(0xdf)]&&(console[_0x581a39(0x10b)](_0x581a39(0x10d)+_0x54e08f[_0x581a39(0x169)]+'\x27:'),console[_0x581a39(0x10b)]('─'[_0x581a39(0xf8)](0x3c)),console[_0x581a39(0x10b)](_0x54e08f[_0x581a39(0xdf)]),console[_0x581a39(0x10b)]('─'[_0x581a39(0xf8)](0x3c)));}for(const _0x5ef9a6 of _0x31c0cc){_0x5ef9a6[_0x581a39(0xdf)]&&(console[_0x581a39(0x10b)](_0x581a39(0xf6)+_0x5ef9a6['name']+'\x27:'),console[_0x581a39(0x10b)]('─'[_0x581a39(0xf8)](0x3c)),console[_0x581a39(0x10b)](_0x5ef9a6[_0x581a39(0xdf)]),console[_0x581a39(0x10b)]('─'[_0x581a39(0xf8)](0x3c)));}for(const _0x205283 of _0x54846d){_0x205283[_0x581a39(0xdf)]&&(console[_0x581a39(0x10b)](_0x581a39(0x174)+_0x205283['name']+'\x27:'),console[_0x581a39(0x10b)]('─'[_0x581a39(0xf8)](0x3c)),console[_0x581a39(0x10b)](_0x205283['diff']),console[_0x581a39(0x10b)]('─'[_0x581a39(0xf8)](0x3c)));}for(const _0x280765 of _0x444a79){_0x280765[_0x581a39(0xdf)]&&(console[_0x581a39(0x10b)]('\x0aChanges\x20to\x20integration\x20\x27'+_0x280765[_0x581a39(0x169)]+'\x27:'),console[_0x581a39(0x10b)]('─'[_0x581a39(0xf8)](0x3c)),console['log'](_0x280765[_0x581a39(0xdf)]),console[_0x581a39(0x10b)]('─'[_0x581a39(0xf8)](0x3c)));}for(const _0x41c6d1 of _0x5f4644){_0x41c6d1[_0x581a39(0xdf)]&&(console[_0x581a39(0x10b)]('\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27'+_0x41c6d1[_0x581a39(0x169)]+'\x27:'),console[_0x581a39(0x10b)]('─'['repeat'](0x3c)),console[_0x581a39(0x10b)](_0x41c6d1[_0x581a39(0xdf)]),console[_0x581a39(0x10b)]('─'[_0x581a39(0xf8)](0x3c)));}for(const _0x41b97f of _0x2795bd){_0x41b97f['diff']&&(console[_0x581a39(0x10b)](_0x581a39(0x156)+_0x41b97f['name']+'\x27:'),console[_0x581a39(0x10b)]('─'[_0x581a39(0xf8)](0x3c)),console['log'](_0x41b97f['diff']),console['log']('─'['repeat'](0x3c)));}for(const _0x1059cf of _0x16bd26){_0x1059cf[_0x581a39(0xdf)]&&(console['log'](_0x581a39(0x130)+_0x1059cf['name']+'\x27:'),console[_0x581a39(0x10b)]('─'[_0x581a39(0xf8)](0x3c)),console[_0x581a39(0x10b)](_0x1059cf[_0x581a39(0xdf)]),console[_0x581a39(0x10b)]('─'[_0x581a39(0xf8)](0x3c)));}for(const _0x3ffa63 of _0x597aa8){_0x3ffa63[_0x581a39(0xdf)]&&(console[_0x581a39(0x10b)]('\x0aChanges\x20to\x20chat\x20interface\x20\x27'+_0x3ffa63[_0x581a39(0x169)]+'\x27:'),console['log']('─'[_0x581a39(0xf8)](0x3c)),console[_0x581a39(0x10b)](_0x3ffa63[_0x581a39(0xdf)]),console[_0x581a39(0x10b)]('─'['repeat'](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x1b42db(0x169)]=a4_0x1b42db(0x111);['description']=a4_0x1b42db(0xe0);async['execute'](_0xde40b7){const _0x75e1a6=a4_0x1b42db,{options:_0x59167c,args:_0x14655e,tdx:_0x5a1102}=_0xde40b7,_0x24e158=_0x14655e[0x0],_0x466346=_0x14655e[0x1],_0x572c95=_0x59167c[_0x75e1a6(0x105)],_0x1c4f0e=_0x59167c[_0x75e1a6(0x122)],_0x4c5d45=_0x59167c[_0x75e1a6(0x166)],_0x519676=_0x59167c[_0x75e1a6(0xe7)],_0xcb2ba2=_0x59167c[_0x75e1a6(0xe1)],_0x557a0e=_0x59167c[_0x75e1a6(0x144)];let _0x69635f;if(_0x24e158){const _0x4dc1f8=a4_0x64301b[_0x75e1a6(0x108)](_0x24e158,_0x75e1a6(0xe3));if(existsSync(_0x4dc1f8))try{const _0x4e99b9=JSON[_0x75e1a6(0x158)](readFileSync(_0x4dc1f8,_0x75e1a6(0x12a)));_0x4e99b9[_0x75e1a6(0x11d)]&&(_0x69635f={'llm_project':_0x4e99b9[_0x75e1a6(0x11d)]});}catch{}}const _0x3f58eb=findAgentConfigPath(process[_0x75e1a6(0xf3)]());let _0x38b398;if(_0x3f58eb)try{const _0x4d5081=JSON['parse'](readFileSync(_0x3f58eb,_0x75e1a6(0x12a)));_0x4d5081[_0x75e1a6(0x11d)]&&(_0x38b398={'llm_project':_0x4d5081[_0x75e1a6(0x11d)]});}catch{}const _0x166adc=resolveAgentPullArgs({'arg':_0x24e158,'agentNameArg':_0x466346,'agentFlag':_0x557a0e,'contextProject':_0xcb2ba2,'argDirConfig':_0x69635f,'cwdConfigPath':_0x3f58eb||undefined,'cwdConfig':_0x38b398}),{projectNameOrId:_0x47fd09,targetAgentName:_0x57f2a3,existingOutputDir:_0x1e9299,source:_0x50c284}=_0x166adc;if(_0x50c284===_0x75e1a6(0xf2))console['log'](a4_0x387251['dim'](_0x75e1a6(0x179)+a4_0x64301b[_0x75e1a6(0x108)](_0x24e158,_0x75e1a6(0xe3))+':\x20'+_0x47fd09));else{if(_0x50c284===_0x75e1a6(0xda))console[_0x75e1a6(0x10b)](a4_0x387251['dim'](_0x75e1a6(0x15b)+_0x47fd09));else _0x50c284===_0x75e1a6(0xee)&&console[_0x75e1a6(0x10b)](a4_0x387251[_0x75e1a6(0x134)](_0x75e1a6(0x109)+_0x47fd09));}if(!_0x47fd09)return _0x557a0e?(console[_0x75e1a6(0x10b)](a4_0x387251[_0x75e1a6(0x16f)]('The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a')),console[_0x75e1a6(0x10b)]('Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>'),console[_0x75e1a6(0x10b)](_0x75e1a6(0xf1))):(console[_0x75e1a6(0x10b)](a4_0x387251['yellow']('llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a')),console[_0x75e1a6(0x10b)](_0x75e1a6(0xea)),console[_0x75e1a6(0x10b)](_0x75e1a6(0xf0)),console['log'](_0x75e1a6(0x11f)),console[_0x75e1a6(0x10b)](_0x75e1a6(0x137)),console[_0x75e1a6(0x10b)]('\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(_0x57f2a3){const {data:_0x921764}=await withSpinner(_0x75e1a6(0x12c)+_0x57f2a3+_0x75e1a6(0x186)+_0x47fd09+_0x75e1a6(0x101),()=>_0x5a1102[_0x75e1a6(0x16c)][_0x75e1a6(0x183)](_0x47fd09,_0x57f2a3,_0x572c95,{'dryRun':_0x1c4f0e,'force':_0x4c5d45}));if(_0x1c4f0e)return console[_0x75e1a6(0x10b)](a4_0x387251['yellow'](_0x75e1a6(0x18f))),console[_0x75e1a6(0x10b)](_0x75e1a6(0x14a)+_0x921764['agentName']),console['log'](_0x75e1a6(0x18d)+_0x921764[_0x75e1a6(0x136)]),_0x921764['diff']&&(console[_0x75e1a6(0x10b)](_0x75e1a6(0x138)),console[_0x75e1a6(0x10b)]('─'['repeat'](0x3c)),console['log'](_0x921764[_0x75e1a6(0xdf)]),console['log']('─'[_0x75e1a6(0xf8)](0x3c))),0x0;return console['log'](a4_0x387251[_0x75e1a6(0x15e)](_0x75e1a6(0xd2))),console[_0x75e1a6(0x10b)](_0x75e1a6(0x170)+_0x921764[_0x75e1a6(0x107)]),console[_0x75e1a6(0x10b)](_0x75e1a6(0x147)+_0x921764[_0x75e1a6(0x136)]),console[_0x75e1a6(0x10b)](_0x75e1a6(0x150)+(_0x921764['isNew']?a4_0x387251[_0x75e1a6(0x15e)](_0x75e1a6(0x190)):_0x921764[_0x75e1a6(0xe8)]?a4_0x387251[_0x75e1a6(0x16f)](_0x75e1a6(0x184)):a4_0x387251[_0x75e1a6(0xed)](_0x75e1a6(0x16e)))),0x0;}const _0x48a885=_0x1e9299||_0x572c95,{data:_0x5576de}=await withSpinner(_0x75e1a6(0x12d)+_0x47fd09+_0x75e1a6(0x101),()=>_0x5a1102['llm']['pullProject'](_0x47fd09,_0x48a885,{'dryRun':!![]})),_0x46713a=_0x5576de[_0x75e1a6(0x16a)][_0x75e1a6(0x178)]['new']+_0x5576de[_0x75e1a6(0x16a)][_0x75e1a6(0x142)][_0x75e1a6(0x190)]+_0x5576de[_0x75e1a6(0x16a)][_0x75e1a6(0xfa)][_0x75e1a6(0x190)]+_0x5576de[_0x75e1a6(0x16a)]['prompts'][_0x75e1a6(0x190)]+_0x5576de[_0x75e1a6(0x16a)][_0x75e1a6(0x152)][_0x75e1a6(0x190)]+_0x5576de['counts']['experimentalKnowledgeBases']['new']+_0x5576de[_0x75e1a6(0x16a)][_0x75e1a6(0x121)][_0x75e1a6(0x190)]+_0x5576de[_0x75e1a6(0x16a)][_0x75e1a6(0x115)][_0x75e1a6(0x190)]+_0x5576de[_0x75e1a6(0x16a)]['chatInterfaces'][_0x75e1a6(0x190)],_0x1d3be7=_0x5576de['counts'][_0x75e1a6(0x178)][_0x75e1a6(0x184)]+_0x5576de[_0x75e1a6(0x16a)][_0x75e1a6(0x142)]['updated']+_0x5576de['counts'][_0x75e1a6(0xfa)][_0x75e1a6(0x184)]+_0x5576de['counts'][_0x75e1a6(0x116)]['updated']+_0x5576de[_0x75e1a6(0x16a)][_0x75e1a6(0x152)][_0x75e1a6(0x184)]+_0x5576de['counts']['experimentalKnowledgeBases'][_0x75e1a6(0x184)]+_0x5576de[_0x75e1a6(0x16a)][_0x75e1a6(0x121)]['updated']+_0x5576de['counts'][_0x75e1a6(0x115)][_0x75e1a6(0x184)]+_0x5576de[_0x75e1a6(0x16a)][_0x75e1a6(0x14e)][_0x75e1a6(0x184)],_0x313676=_0x5576de[_0x75e1a6(0x16a)]['agents'][_0x75e1a6(0x16e)]+_0x5576de[_0x75e1a6(0x16a)][_0x75e1a6(0x142)]['unchanged']+_0x5576de[_0x75e1a6(0x16a)][_0x75e1a6(0xfa)]['unchanged']+_0x5576de[_0x75e1a6(0x16a)]['prompts'][_0x75e1a6(0x16e)]+_0x5576de[_0x75e1a6(0x16a)][_0x75e1a6(0x152)][_0x75e1a6(0x16e)]+_0x5576de[_0x75e1a6(0x16a)][_0x75e1a6(0xd1)]['unchanged']+_0x5576de[_0x75e1a6(0x16a)][_0x75e1a6(0x121)][_0x75e1a6(0x16e)]+_0x5576de[_0x75e1a6(0x16a)][_0x75e1a6(0x115)][_0x75e1a6(0x16e)]+_0x5576de[_0x75e1a6(0x16a)][_0x75e1a6(0x14e)][_0x75e1a6(0x16e)];console[_0x75e1a6(0x10b)](_0x75e1a6(0x140)+_0x5576de[_0x75e1a6(0xd0)]+'\x27:'),console['log']('\x20\x20'+a4_0x387251[_0x75e1a6(0x15e)]('+\x20'+_0x46713a+_0x75e1a6(0x13a))+'\x20|\x20'+a4_0x387251[_0x75e1a6(0x16f)]('~\x20'+_0x1d3be7+_0x75e1a6(0x151))+_0x75e1a6(0x180)+a4_0x387251[_0x75e1a6(0x134)]('=\x20'+_0x313676+_0x75e1a6(0x143))),console[_0x75e1a6(0x10b)](_0x75e1a6(0x10a)+formatCountSummary(_0x5576de[_0x75e1a6(0x16a)]['agents'])),console[_0x75e1a6(0x10b)](_0x75e1a6(0x172)+formatCountSummary(_0x5576de[_0x75e1a6(0x16a)]['knowledgeBases'])),console[_0x75e1a6(0x10b)](_0x75e1a6(0x17d)+formatCountSummary(_0x5576de[_0x75e1a6(0x16a)][_0x75e1a6(0xfa)])),console[_0x75e1a6(0x10b)](_0x75e1a6(0x16d)+formatCountSummary(_0x5576de[_0x75e1a6(0x16a)][_0x75e1a6(0x116)])),console[_0x75e1a6(0x10b)](_0x75e1a6(0x131)+formatCountSummary(_0x5576de['counts'][_0x75e1a6(0x152)])),console[_0x75e1a6(0x10b)]('\x20\x20Form\x20Interfaces:\x20'+formatCountSummary(_0x5576de[_0x75e1a6(0x16a)][_0x75e1a6(0x115)])),console['log'](_0x75e1a6(0x154)+formatCountSummary(_0x5576de[_0x75e1a6(0x16a)][_0x75e1a6(0x14e)]));const _0x28b055=_0x5576de[_0x75e1a6(0x16a)][_0x75e1a6(0xd1)][_0x75e1a6(0xfb)]>0x0||_0x5576de[_0x75e1a6(0x16a)][_0x75e1a6(0x121)]['total']>0x0;_0x28b055&&(console['log']('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x5576de[_0x75e1a6(0x16a)][_0x75e1a6(0xd1)])),console['log']('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x5576de['counts'][_0x75e1a6(0x121)])));console[_0x75e1a6(0x10b)](_0x75e1a6(0x167)+a4_0x387251['cyan'](_0x5576de[_0x75e1a6(0x15a)])),displayDiffs(_0x5576de[_0x75e1a6(0x178)],_0x5576de[_0x75e1a6(0x142)],_0x5576de[_0x75e1a6(0xfa)],_0x5576de['prompts'],_0x5576de['integrations'],_0x5576de[_0x75e1a6(0xd1)],_0x5576de[_0x75e1a6(0x121)],_0x5576de[_0x75e1a6(0x115)],_0x5576de[_0x75e1a6(0x14e)]);if(_0x1c4f0e)return console[_0x75e1a6(0x10b)](a4_0x387251[_0x75e1a6(0x16f)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x46713a===0x0&&_0x1d3be7===0x0)return console[_0x75e1a6(0x10b)](a4_0x387251[_0x75e1a6(0x15e)](_0x75e1a6(0x160))),saveSessionContext({'llm_project':_0x5576de['projectName']},_0x59167c[_0x75e1a6(0xec)]),console[_0x75e1a6(0x10b)](a4_0x387251['green'](_0x75e1a6(0x13e)+a4_0x387251[_0x75e1a6(0x134)]('llm_project')+_0x75e1a6(0xd3)+a4_0x387251['cyan'](_0x5576de[_0x75e1a6(0xd0)]))),0x0;if(!_0x519676&&!_0x4c5d45){if(!isInteractive())return console[_0x75e1a6(0xdb)](a4_0x387251['red']('\x0aError:'),_0x75e1a6(0x135)),console['error'](a4_0x387251['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x4d6866=await confirmKey('\x0aWrite\x20'+(_0x46713a+_0x1d3be7)+_0x75e1a6(0x119));if(!_0x4d6866)return console['log'](a4_0x387251[_0x75e1a6(0x16f)](_0x75e1a6(0x113)),'-\x20no\x20files\x20written'),0x1;}const {data:_0x1ebc54}=await withSpinner(_0x75e1a6(0xf9),()=>_0x5a1102['llm'][_0x75e1a6(0x13b)](_0x47fd09,_0x48a885,{'force':_0x4c5d45}));return console['log'](a4_0x387251[_0x75e1a6(0x15e)](_0x75e1a6(0x15d)+(_0x46713a+_0x1d3be7)+_0x75e1a6(0x161)+_0x1ebc54['outputDir'])),saveSessionContext({'llm_project':_0x1ebc54[_0x75e1a6(0xd0)]},_0x59167c[_0x75e1a6(0xec)]),console['log'](a4_0x387251['green'](_0x75e1a6(0x13e)+a4_0x387251['dim'](_0x75e1a6(0x11d))+'\x20=\x20'+a4_0x387251[_0x75e1a6(0x18c)](_0x1ebc54[_0x75e1a6(0xd0)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{['name']=a4_0x1b42db(0x11b);[a4_0x1b42db(0xdc)]='Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project';async[a4_0x1b42db(0x120)](_0x59b56f){const _0xcd6ad8=a4_0x1b42db,{options:_0x361d06,args:_0x4d27bc,tdx:_0x38f245}=_0x59b56f,_0x5dc733=_0x4d27bc[0x0],_0x222f25=_0x361d06[_0xcd6ad8(0x169)],_0x255c85=_0x361d06['dryRun'],_0x4f7db7=_0x361d06[_0xcd6ad8(0xe7)],_0x4b56d4=_0x361d06[_0xcd6ad8(0x177)],_0x930230=_0x361d06[_0xcd6ad8(0xe1)];let _0x5aaa88;const _0x421bb6=findAgentConfigPath(process[_0xcd6ad8(0xf3)]());if(_0x5dc733){const _0x898a49=a4_0x64301b['join'](_0x5dc733,_0xcd6ad8(0xe3));existsSync(_0x898a49)?(_0x5aaa88=_0x5dc733,console[_0xcd6ad8(0x10b)](a4_0x387251[_0xcd6ad8(0x134)](_0xcd6ad8(0x163)+_0x5dc733))):_0x5aaa88=_0x5dc733;}else{if(_0x421bb6)_0x5aaa88=a4_0x64301b[_0xcd6ad8(0xdd)](_0x421bb6),console['log'](a4_0x387251[_0xcd6ad8(0x134)]('Using\x20current\x20project:\x20'+_0x5aaa88));else{if(_0x930230){const _0x141fc0=sanitizeForFilesystem(_0x930230);let _0xa57b=_0x141fc0,_0x11238c=a4_0x64301b[_0xcd6ad8(0x108)](process['cwd'](),_0xcd6ad8(0x178),_0x141fc0,_0xcd6ad8(0xe3));if(!existsSync(_0x11238c)){const _0x9e5991=normalizeName(_0x930230),_0x5da4ad=a4_0x64301b[_0xcd6ad8(0x108)](process['cwd'](),_0xcd6ad8(0x178),_0x9e5991,_0xcd6ad8(0xe3));existsSync(_0x5da4ad)&&(_0xa57b=_0x9e5991,_0x11238c=_0x5da4ad);}if(existsSync(_0x11238c))_0x5aaa88=a4_0x64301b[_0xcd6ad8(0xdd)](_0x11238c),console[_0xcd6ad8(0x10b)](a4_0x387251[_0xcd6ad8(0x134)](_0xcd6ad8(0x163)+_0x5aaa88));else{const _0x15760a=_0x361d06[_0xcd6ad8(0xe5)];if(_0x15760a)throw new SDKError(ErrorCode[_0xcd6ad8(0x16b)],'Cannot\x20clone\x20from\x20context\x20project\x20\x22'+_0x930230+_0xcd6ad8(0x153),undefined,{'helpText':_0xcd6ad8(0xfc)+_0xcd6ad8(0x123)+(_0xcd6ad8(0x17c)+_0x930230+'\x0a')+(_0xcd6ad8(0x175)+_0xa57b+_0xcd6ad8(0x13c)+(_0x222f25||_0xcd6ad8(0x188))+_0xcd6ad8(0x168)+_0x15760a)});_0x5aaa88=_0x930230,console[_0xcd6ad8(0x10b)](a4_0x387251[_0xcd6ad8(0x134)]('Using\x20context\x20project:\x20'+_0x930230));}}}}if(!_0x5aaa88)return console[_0xcd6ad8(0x10b)](a4_0x387251[_0xcd6ad8(0x16f)]('No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a')),console['log']('\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project'),console['log'](_0xcd6ad8(0x181)),console[_0xcd6ad8(0x10b)](_0xcd6ad8(0xd4)),console[_0xcd6ad8(0x10b)](_0xcd6ad8(0x164)),0x1;if(!_0x222f25)throw new SDKError(ErrorCode['MISSING_ARGUMENT'],_0xcd6ad8(0x117),undefined,{'helpText':_0xcd6ad8(0x17f)});if(!_0x4f7db7&&!_0x255c85){if(!isInteractive())return console[_0xcd6ad8(0xdb)](a4_0x387251[_0xcd6ad8(0xd5)](_0xcd6ad8(0x176)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0xcd6ad8(0xdb)](a4_0x387251[_0xcd6ad8(0x134)](_0xcd6ad8(0x139))),0x1;const _0x53b65e=await confirmKey(_0xcd6ad8(0x146)+_0x5aaa88+'\x22\x20to\x20new\x20project\x20\x22'+_0x222f25+'\x22?');if(!_0x53b65e)return console[_0xcd6ad8(0x10b)](a4_0x387251[_0xcd6ad8(0x16f)]('Cancelled')),0x1;}const {data:_0x169afc}=await withSpinner('Cloning\x20\x22'+_0x5aaa88+_0xcd6ad8(0x124)+_0x222f25+_0xcd6ad8(0x101),()=>_0x38f245['llm']['cloneProject'](_0x5aaa88,_0x222f25,{'dryRun':_0x255c85}));if(_0x255c85){console[_0xcd6ad8(0x10b)](a4_0x387251[_0xcd6ad8(0x16f)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0xcd6ad8(0x10b)](_0xcd6ad8(0x100)+_0x169afc[_0xcd6ad8(0x125)]),console['log']('New\x20project:\x20'+_0x222f25),console[_0xcd6ad8(0x10b)](_0xcd6ad8(0x155)),console['log']('\x20\x20Agents:\x20'+_0x169afc[_0xcd6ad8(0x16a)][_0xcd6ad8(0x178)][_0xcd6ad8(0x104)]),console[_0xcd6ad8(0x10b)](_0xcd6ad8(0x172)+_0x169afc[_0xcd6ad8(0x16a)][_0xcd6ad8(0x142)][_0xcd6ad8(0x104)]),console[_0xcd6ad8(0x10b)]('\x20\x20Prompts:\x20'+_0x169afc[_0xcd6ad8(0x16a)][_0xcd6ad8(0x116)][_0xcd6ad8(0x104)]),console[_0xcd6ad8(0x10b)]('\x20\x20Form\x20Interfaces:\x20'+_0x169afc[_0xcd6ad8(0x16a)][_0xcd6ad8(0x115)][_0xcd6ad8(0x104)]),console['log'](_0xcd6ad8(0x154)+_0x169afc[_0xcd6ad8(0x16a)][_0xcd6ad8(0x14e)][_0xcd6ad8(0x104)]);const _0xf5fb0a=_0x169afc['counts'][_0xcd6ad8(0xd1)][_0xcd6ad8(0x104)]>0x0||_0x169afc['counts'][_0xcd6ad8(0x121)][_0xcd6ad8(0x104)]>0x0;return _0xf5fb0a&&(console['log'](_0xcd6ad8(0xd7)+_0x169afc[_0xcd6ad8(0x16a)][_0xcd6ad8(0xd1)][_0xcd6ad8(0x104)]),console[_0xcd6ad8(0x10b)]('\x20\x20Experimental\x20Artifacts:\x20'+_0x169afc[_0xcd6ad8(0x16a)][_0xcd6ad8(0x121)][_0xcd6ad8(0x104)])),0x0;}const _0x374d04=_0x169afc[_0xcd6ad8(0x16a)][_0xcd6ad8(0x178)][_0xcd6ad8(0x15c)]>0x0||_0x169afc['counts'][_0xcd6ad8(0x142)][_0xcd6ad8(0x15c)]>0x0||_0x169afc[_0xcd6ad8(0x16a)][_0xcd6ad8(0x116)]['errors']>0x0||_0x169afc[_0xcd6ad8(0x16a)][_0xcd6ad8(0x115)][_0xcd6ad8(0x15c)]>0x0||_0x169afc['counts'][_0xcd6ad8(0x14e)][_0xcd6ad8(0x15c)]>0x0||_0x169afc[_0xcd6ad8(0x16a)][_0xcd6ad8(0xd1)][_0xcd6ad8(0x15c)]>0x0||_0x169afc[_0xcd6ad8(0x16a)][_0xcd6ad8(0x121)][_0xcd6ad8(0x15c)]>0x0;_0x374d04?console[_0xcd6ad8(0x10b)](a4_0x387251[_0xcd6ad8(0x16f)](_0xcd6ad8(0x11a))):console[_0xcd6ad8(0x10b)](a4_0x387251['green'](_0xcd6ad8(0xd8)));console['log'](_0xcd6ad8(0x100)+_0x169afc[_0xcd6ad8(0x125)]),console[_0xcd6ad8(0x10b)](_0xcd6ad8(0x11e)+_0x169afc[_0xcd6ad8(0x132)]),console[_0xcd6ad8(0x10b)]('New\x20project\x20ID:\x20'+_0x169afc[_0xcd6ad8(0x127)]),console['log'](),console['log']('Summary:'),console[_0xcd6ad8(0x10b)](_0xcd6ad8(0x10a)+formatCountSummary(_0x169afc[_0xcd6ad8(0x16a)]['agents'])),console[_0xcd6ad8(0x10b)](_0xcd6ad8(0x172)+formatCountSummary(_0x169afc[_0xcd6ad8(0x16a)][_0xcd6ad8(0x142)])),console[_0xcd6ad8(0x10b)](_0xcd6ad8(0x16d)+formatCountSummary(_0x169afc[_0xcd6ad8(0x16a)][_0xcd6ad8(0x116)])),console[_0xcd6ad8(0x10b)](_0xcd6ad8(0x131)+formatCountSummary(_0x169afc[_0xcd6ad8(0x16a)][_0xcd6ad8(0x152)])),console[_0xcd6ad8(0x10b)](_0xcd6ad8(0x171)+formatCountSummary(_0x169afc['counts'][_0xcd6ad8(0x115)])),console['log'](_0xcd6ad8(0x154)+formatCountSummary(_0x169afc[_0xcd6ad8(0x16a)]['chatInterfaces']));const _0x278132=_0x169afc[_0xcd6ad8(0x16a)][_0xcd6ad8(0xd1)][_0xcd6ad8(0x104)]>0x0||_0x169afc['counts']['experimentalKnowledgeBases'][_0xcd6ad8(0x184)]>0x0||_0x169afc['counts']['experimentalKnowledgeBases'][_0xcd6ad8(0x16e)]>0x0||_0x169afc[_0xcd6ad8(0x16a)][_0xcd6ad8(0x121)][_0xcd6ad8(0x104)]>0x0||_0x169afc[_0xcd6ad8(0x16a)]['experimentalArtifacts'][_0xcd6ad8(0x184)]>0x0||_0x169afc[_0xcd6ad8(0x16a)][_0xcd6ad8(0x121)][_0xcd6ad8(0x16e)]>0x0;_0x278132&&(console[_0xcd6ad8(0x10b)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x169afc[_0xcd6ad8(0x16a)][_0xcd6ad8(0xd1)])),console['log']('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x169afc[_0xcd6ad8(0x16a)][_0xcd6ad8(0x121)])));if(_0x374d04){console[_0xcd6ad8(0x10b)](),console[_0xcd6ad8(0x10b)](a4_0x387251['red'](_0xcd6ad8(0x145)));for(const _0x3d0cf9 of _0x169afc[_0xcd6ad8(0x178)]){_0x3d0cf9[_0xcd6ad8(0xfd)]==='error'&&console['log'](a4_0x387251['red'](_0xcd6ad8(0x141)+_0x3d0cf9[_0xcd6ad8(0x107)]+_0xcd6ad8(0x17a)+_0x3d0cf9['error']));}for(const _0x5496e3 of _0x169afc['knowledgeBases']){_0x5496e3[_0xcd6ad8(0xfd)]===_0xcd6ad8(0xdb)&&console['log'](a4_0x387251['red'](_0xcd6ad8(0x114)+_0x5496e3[_0xcd6ad8(0x169)]+_0xcd6ad8(0x17a)+_0x5496e3['error']));}for(const _0x205f73 of _0x169afc[_0xcd6ad8(0x116)]){_0x205f73['action']===_0xcd6ad8(0xdb)&&console[_0xcd6ad8(0x10b)](a4_0x387251[_0xcd6ad8(0xd5)](_0xcd6ad8(0x148)+_0x205f73[_0xcd6ad8(0x169)]+_0xcd6ad8(0x17a)+_0x205f73['error']));}for(const _0x3452db of _0x169afc[_0xcd6ad8(0x152)]){_0x3452db[_0xcd6ad8(0xfd)]===_0xcd6ad8(0xdb)&&console[_0xcd6ad8(0x10b)](a4_0x387251[_0xcd6ad8(0xd5)](_0xcd6ad8(0x165)+_0x3452db[_0xcd6ad8(0x169)]+_0xcd6ad8(0x17a)+_0x3452db[_0xcd6ad8(0xdb)]));}for(const _0x4c224d of _0x169afc['formInterfaces']){_0x4c224d[_0xcd6ad8(0xfd)]===_0xcd6ad8(0xdb)&&console[_0xcd6ad8(0x10b)](a4_0x387251[_0xcd6ad8(0xd5)]('\x20\x20Form\x20Interface\x20\x22'+_0x4c224d['name']+'\x22:\x20'+_0x4c224d[_0xcd6ad8(0xdb)]));}for(const _0x2fd62f of _0x169afc[_0xcd6ad8(0x14e)]){_0x2fd62f[_0xcd6ad8(0xfd)]===_0xcd6ad8(0xdb)&&console[_0xcd6ad8(0x10b)](a4_0x387251['red']('\x20\x20Chat\x20Interface\x20\x22'+_0x2fd62f[_0xcd6ad8(0x169)]+_0xcd6ad8(0x17a)+_0x2fd62f[_0xcd6ad8(0xdb)]));}for(const _0x44dde8 of _0x169afc[_0xcd6ad8(0xd1)]){_0x44dde8[_0xcd6ad8(0xfd)]===_0xcd6ad8(0xdb)&&console['log'](a4_0x387251[_0xcd6ad8(0xd5)](_0xcd6ad8(0x159)+_0x44dde8[_0xcd6ad8(0x169)]+_0xcd6ad8(0x17a)+_0x44dde8[_0xcd6ad8(0xdb)]));}for(const _0x550b11 of _0x169afc[_0xcd6ad8(0x121)]){_0x550b11[_0xcd6ad8(0xfd)]===_0xcd6ad8(0xdb)&&console['log'](a4_0x387251[_0xcd6ad8(0xd5)]('\x20\x20Experimental\x20Artifact\x20\x22'+_0x550b11[_0xcd6ad8(0x169)]+'\x22:\x20'+_0x550b11[_0xcd6ad8(0xdb)]));}return 0x1;}console[_0xcd6ad8(0x10b)]();const _0x23a9f7=getLLMProjectUrl(_0x4b56d4,_0x169afc[_0xcd6ad8(0x127)]);return console[_0xcd6ad8(0x10b)](_0xcd6ad8(0xeb)+a4_0x387251[_0xcd6ad8(0x18c)](_0x23a9f7)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x1b42db(0x169)]=a4_0x1b42db(0x13d);[a4_0x1b42db(0xdc)]=a4_0x1b42db(0x14d);async['execute'](_0x1f3033){const _0x283a0b=a4_0x1b42db,{options:_0x4b863b,args:_0x157804,tdx:_0x57248b}=_0x1f3033;let _0x1f3f52=_0x157804[0x0]||process[_0x283a0b(0xf3)]();const _0x411cf2=_0x4b863b[_0x283a0b(0x122)],_0x11f322=_0x4b863b['force'],_0x34f0fc=_0x4b863b['yes'],_0x5c5289=_0x4b863b[_0x283a0b(0x177)],_0x3468a7=a4_0x64301b['join'](_0x1f3f52,_0x283a0b(0x12f)),_0x979b91=existsSync(_0x3468a7);if(_0x979b91){const {data:_0x27586e}=await withSpinner(_0x283a0b(0x110)+_0x1f3f52+'\x22...',()=>_0x57248b['llm'][_0x283a0b(0x106)](_0x1f3f52,{'dryRun':_0x411cf2,'force':_0x11f322}));if(_0x411cf2)return console[_0x283a0b(0x10b)](a4_0x387251[_0x283a0b(0x16f)](_0x283a0b(0xef))),console[_0x283a0b(0x10b)](_0x283a0b(0x118)+_0x27586e[_0x283a0b(0x107)]),0x0;if(_0x27586e[_0x283a0b(0xfd)]==='error')return console['log'](a4_0x387251[_0x283a0b(0xd5)]('Failed\x20to\x20push\x20agent:\x20'+_0x27586e[_0x283a0b(0xdb)])),0x1;console[_0x283a0b(0x10b)](a4_0x387251['green']('Agent\x20'+_0x27586e['action']+_0x283a0b(0x126))),console[_0x283a0b(0x10b)]('Agent:\x20'+_0x27586e[_0x283a0b(0x107)]);if(_0x27586e[_0x283a0b(0x173)]&&_0x27586e[_0x283a0b(0x103)]){const _0x53dbc9=getLLMAgentChatUrl(_0x5c5289,_0x27586e[_0x283a0b(0x103)],_0x27586e[_0x283a0b(0x173)]);console[_0x283a0b(0x10b)]('Chat:\x20'+a4_0x387251[_0x283a0b(0x18c)](_0x53dbc9));}return 0x0;}const _0x44307e=_0x4b863b[_0x283a0b(0xe1)],_0x22cce0=resolveProjectFromContext(_0x1f3f52,_0x44307e);if(_0x22cce0['found'])_0x1f3f52=_0x22cce0[_0x283a0b(0x15f)],_0x22cce0[_0x283a0b(0x12e)]===_0x283a0b(0xee)&&console[_0x283a0b(0x10b)](a4_0x387251[_0x283a0b(0x134)](_0x283a0b(0x15b)+_0x1f3f52));else{let _0x525fb5=_0x283a0b(0x17b);_0x22cce0[_0x283a0b(0x162)]===_0x283a0b(0x133)&&(_0x525fb5=_0x22cce0['message']+_0x283a0b(0x185)+_0x22cce0[_0x283a0b(0xe1)]+'\x27\x20to\x20create\x20the\x20folder\x20structure.');throw new SDKError(ErrorCode[_0x283a0b(0x16b)],_0x22cce0[_0x283a0b(0x162)]===_0x283a0b(0x112)?_0x22cce0[_0x283a0b(0x187)]:_0x283a0b(0x10e)+_0x1f3f52,undefined,{'helpText':_0x525fb5});}const {data:_0x6e817e}=await withSpinner(_0x283a0b(0xe6),()=>_0x57248b[_0x283a0b(0x16c)][_0x283a0b(0x102)](_0x1f3f52,{'dryRun':!![]})),_0x4103fd=_0x6e817e[_0x283a0b(0x16a)][_0x283a0b(0x178)]['errors']>0x0;if(_0x4103fd){console[_0x283a0b(0x10b)](a4_0x387251[_0x283a0b(0xd5)](_0x283a0b(0xe9)));for(const _0x13dfd4 of _0x6e817e[_0x283a0b(0x178)]){_0x13dfd4[_0x283a0b(0xfd)]===_0x283a0b(0xdb)&&console[_0x283a0b(0x10b)](a4_0x387251['red']('\x20\x20Agent\x20\x22'+_0x13dfd4[_0x283a0b(0x107)]+_0x283a0b(0x17a)+_0x13dfd4[_0x283a0b(0xdb)]));}return 0x1;}const _0x40339e=_0x6e817e[_0x283a0b(0x16a)][_0x283a0b(0x178)][_0x283a0b(0x104)]+_0x6e817e[_0x283a0b(0x16a)][_0x283a0b(0x142)]['created']+_0x6e817e[_0x283a0b(0x16a)][_0x283a0b(0xfa)][_0x283a0b(0x104)]+_0x6e817e[_0x283a0b(0x16a)][_0x283a0b(0x116)]['created']+_0x6e817e[_0x283a0b(0x16a)]['integrations'][_0x283a0b(0x104)]+_0x6e817e[_0x283a0b(0x16a)][_0x283a0b(0xd1)][_0x283a0b(0x104)]+_0x6e817e[_0x283a0b(0x16a)][_0x283a0b(0x121)][_0x283a0b(0x104)]+_0x6e817e[_0x283a0b(0x16a)][_0x283a0b(0x115)][_0x283a0b(0x104)]+_0x6e817e[_0x283a0b(0x16a)][_0x283a0b(0x14e)][_0x283a0b(0x104)],_0x4abb56=_0x6e817e['counts']['agents'][_0x283a0b(0x184)]+_0x6e817e[_0x283a0b(0x16a)][_0x283a0b(0x142)][_0x283a0b(0x184)]+_0x6e817e['counts'][_0x283a0b(0xfa)][_0x283a0b(0x184)]+_0x6e817e['counts'][_0x283a0b(0x116)]['updated']+_0x6e817e[_0x283a0b(0x16a)][_0x283a0b(0x152)][_0x283a0b(0x184)]+_0x6e817e[_0x283a0b(0x16a)][_0x283a0b(0xd1)][_0x283a0b(0x184)]+_0x6e817e['counts']['experimentalArtifacts'][_0x283a0b(0x184)]+_0x6e817e[_0x283a0b(0x16a)][_0x283a0b(0x115)][_0x283a0b(0x184)]+_0x6e817e['counts'][_0x283a0b(0x14e)][_0x283a0b(0x184)],_0x3bc497=_0x6e817e[_0x283a0b(0x16a)]['agents'][_0x283a0b(0x16e)]+_0x6e817e[_0x283a0b(0x16a)][_0x283a0b(0x142)]['unchanged']+_0x6e817e['counts']['textKnowledgeBases'][_0x283a0b(0x16e)]+_0x6e817e['counts']['prompts'][_0x283a0b(0x16e)]+_0x6e817e['counts'][_0x283a0b(0x152)][_0x283a0b(0x16e)]+_0x6e817e[_0x283a0b(0x16a)][_0x283a0b(0xd1)][_0x283a0b(0x16e)]+_0x6e817e[_0x283a0b(0x16a)][_0x283a0b(0x121)][_0x283a0b(0x16e)]+_0x6e817e['counts']['formInterfaces'][_0x283a0b(0x16e)]+_0x6e817e['counts']['chatInterfaces'][_0x283a0b(0x16e)];console[_0x283a0b(0x10b)](_0x283a0b(0x149)+_0x6e817e[_0x283a0b(0xd0)]+'\x27:'),console[_0x283a0b(0x10b)]('\x20\x20'+a4_0x387251[_0x283a0b(0x15e)]('+\x20'+_0x40339e+_0x283a0b(0x13a))+_0x283a0b(0x180)+a4_0x387251['yellow']('~\x20'+_0x4abb56+_0x283a0b(0x151))+_0x283a0b(0x180)+a4_0x387251[_0x283a0b(0x134)]('=\x20'+_0x3bc497+_0x283a0b(0x143))),console[_0x283a0b(0x10b)]('\x20\x20Agents:\x20'+formatCountSummary(_0x6e817e[_0x283a0b(0x16a)][_0x283a0b(0x178)])),console[_0x283a0b(0x10b)](_0x283a0b(0x172)+formatCountSummary(_0x6e817e[_0x283a0b(0x16a)][_0x283a0b(0x142)])),console['log'](_0x283a0b(0x17d)+formatCountSummary(_0x6e817e[_0x283a0b(0x16a)][_0x283a0b(0xfa)])),console[_0x283a0b(0x10b)](_0x283a0b(0x16d)+formatCountSummary(_0x6e817e[_0x283a0b(0x16a)]['prompts'])),console[_0x283a0b(0x10b)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x6e817e[_0x283a0b(0x16a)][_0x283a0b(0x152)])),console[_0x283a0b(0x10b)](_0x283a0b(0x171)+formatCountSummary(_0x6e817e[_0x283a0b(0x16a)][_0x283a0b(0x115)])),console['log'](_0x283a0b(0x154)+formatCountSummary(_0x6e817e['counts'][_0x283a0b(0x14e)]));const _0x65c5db=_0x6e817e[_0x283a0b(0x16a)][_0x283a0b(0xd1)]['created']>0x0||_0x6e817e[_0x283a0b(0x16a)][_0x283a0b(0xd1)][_0x283a0b(0x184)]>0x0||_0x6e817e[_0x283a0b(0x16a)][_0x283a0b(0xd1)][_0x283a0b(0x16e)]>0x0||_0x6e817e['counts'][_0x283a0b(0x121)][_0x283a0b(0x104)]>0x0||_0x6e817e[_0x283a0b(0x16a)][_0x283a0b(0x121)][_0x283a0b(0x184)]>0x0||_0x6e817e['counts'][_0x283a0b(0x121)]['unchanged']>0x0;_0x65c5db&&(console[_0x283a0b(0x10b)](_0x283a0b(0xd7)+formatCountSummary(_0x6e817e[_0x283a0b(0x16a)]['experimentalKnowledgeBases'])),console[_0x283a0b(0x10b)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x6e817e[_0x283a0b(0x16a)][_0x283a0b(0x121)])));console[_0x283a0b(0x10b)](_0x283a0b(0xf7)+a4_0x387251[_0x283a0b(0x18c)](_0x1f3f52)),displayDiffs(_0x6e817e[_0x283a0b(0x178)],_0x6e817e['knowledgeBases'],_0x6e817e[_0x283a0b(0xfa)],_0x6e817e[_0x283a0b(0x116)],_0x6e817e[_0x283a0b(0x152)],_0x6e817e[_0x283a0b(0xd1)],_0x6e817e[_0x283a0b(0x121)],_0x6e817e['formInterfaces'],_0x6e817e[_0x283a0b(0x14e)]);if(_0x411cf2)return console[_0x283a0b(0x10b)](a4_0x387251['yellow'](_0x283a0b(0x157))),0x0;if(_0x40339e===0x0&&_0x4abb56===0x0){console[_0x283a0b(0x10b)](a4_0x387251[_0x283a0b(0x15e)]('\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date'));const _0x64a74b=getLLMProjectUrl(_0x5c5289,_0x6e817e[_0x283a0b(0x103)]);return console['log'](_0x283a0b(0xeb)+a4_0x387251[_0x283a0b(0x18c)](_0x64a74b)),0x0;}if(!_0x34f0fc&&!_0x11f322){if(!isInteractive())return console[_0x283a0b(0xdb)](a4_0x387251[_0x283a0b(0xd5)]('\x0aError:'),_0x283a0b(0x135)),console['error'](a4_0x387251[_0x283a0b(0x134)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x15da2e=await confirmKey(_0x283a0b(0x18a)+(_0x40339e+_0x4abb56)+_0x283a0b(0x14c));if(!_0x15da2e)return console[_0x283a0b(0x10b)](a4_0x387251[_0x283a0b(0x16f)]('Cancelled'),_0x283a0b(0x18e)),0x1;}const {data:_0x24f00b}=await withSpinner(_0x283a0b(0x14f),()=>_0x57248b[_0x283a0b(0x16c)][_0x283a0b(0x102)](_0x1f3f52,{'force':_0x11f322})),_0x1478e1=_0x24f00b[_0x283a0b(0x16a)][_0x283a0b(0x178)]['errors']>0x0||_0x24f00b[_0x283a0b(0x16a)][_0x283a0b(0x142)][_0x283a0b(0x15c)]>0x0||_0x24f00b[_0x283a0b(0x16a)][_0x283a0b(0xfa)]['errors']>0x0||_0x24f00b[_0x283a0b(0x16a)]['prompts'][_0x283a0b(0x15c)]>0x0||_0x24f00b[_0x283a0b(0x16a)]['formInterfaces'][_0x283a0b(0x15c)]>0x0||_0x24f00b['counts'][_0x283a0b(0x14e)][_0x283a0b(0x15c)]>0x0;if(_0x1478e1){console[_0x283a0b(0x10b)](a4_0x387251[_0x283a0b(0x16f)](_0x283a0b(0x11c))),console[_0x283a0b(0x10b)](),console[_0x283a0b(0x10b)](a4_0x387251[_0x283a0b(0xd5)]('Errors:'));for(const _0x293625 of _0x24f00b[_0x283a0b(0x178)]){_0x293625[_0x283a0b(0xfd)]===_0x283a0b(0xdb)&&console[_0x283a0b(0x10b)](a4_0x387251['red'](_0x283a0b(0x141)+_0x293625['agentName']+_0x283a0b(0x17a)+_0x293625[_0x283a0b(0xdb)]));}for(const _0x4b3607 of _0x24f00b[_0x283a0b(0x142)]){_0x4b3607[_0x283a0b(0xfd)]===_0x283a0b(0xdb)&&console[_0x283a0b(0x10b)](a4_0x387251[_0x283a0b(0xd5)](_0x283a0b(0x114)+_0x4b3607[_0x283a0b(0x169)]+_0x283a0b(0x17a)+_0x4b3607['error']));}for(const _0x469b02 of _0x24f00b[_0x283a0b(0xfa)]){_0x469b02['action']===_0x283a0b(0xdb)&&console['log'](a4_0x387251[_0x283a0b(0xd5)](_0x283a0b(0xd6)+_0x469b02[_0x283a0b(0x169)]+_0x283a0b(0x17a)+_0x469b02[_0x283a0b(0xdb)]));}for(const _0x5c735b of _0x24f00b[_0x283a0b(0x116)]){_0x5c735b[_0x283a0b(0xfd)]==='error'&&console['log'](a4_0x387251['red']('\x20\x20Prompt\x20\x22'+_0x5c735b[_0x283a0b(0x169)]+'\x22:\x20'+_0x5c735b['error']));}for(const _0x1246b of _0x24f00b[_0x283a0b(0x152)]){_0x1246b[_0x283a0b(0xfd)]===_0x283a0b(0xdb)&&console[_0x283a0b(0x10b)](a4_0x387251[_0x283a0b(0xd5)](_0x283a0b(0x165)+_0x1246b['name']+'\x22:\x20'+_0x1246b['error']));}for(const _0x6a19c of _0x24f00b['formInterfaces']){_0x6a19c['action']===_0x283a0b(0xdb)&&console[_0x283a0b(0x10b)](a4_0x387251[_0x283a0b(0xd5)](_0x283a0b(0x12b)+_0x6a19c[_0x283a0b(0x169)]+_0x283a0b(0x17a)+_0x6a19c[_0x283a0b(0xdb)]));}for(const _0x4316cc of _0x24f00b[_0x283a0b(0x14e)]){_0x4316cc[_0x283a0b(0xfd)]==='error'&&console[_0x283a0b(0x10b)](a4_0x387251['red'](_0x283a0b(0xff)+_0x4316cc[_0x283a0b(0x169)]+_0x283a0b(0x17a)+_0x4316cc[_0x283a0b(0xdb)]));}return 0x1;}console['log'](a4_0x387251['green'](_0x283a0b(0x189)+(_0x40339e+_0x4abb56)+_0x283a0b(0xfe)+_0x24f00b[_0x283a0b(0xd0)]+'\x27'));const _0x376d2d=getLLMProjectUrl(_0x5c5289,_0x24f00b[_0x283a0b(0x103)]);return console[_0x283a0b(0x10b)](_0x283a0b(0xeb)+a4_0x387251[_0x283a0b(0x18c)](_0x376d2d)),0x0;}}
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 +1 @@
1
- const a5_0x435ffc=a5_0x2d2e;function a5_0x40d7(){const _0xa7b7ed=['Tests\x20found:\x20','Using\x20agent:\x20','some','log','95244Rflubr','Available\x20tests:\x20','tags','\x20(new)','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','no_tests','description','PASS','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','trim','/<agent-name>','Test\x20Configuration:','llm','Cached\x20run\x20is\x20from\x20site\x20\x22','reason','context','Output\x20written\x20to:\x20','9fvDDKk','llmProject','Project\x20path:\x20','red','tests','no_context','...\x20','ERROR','resolveAgentId','executeReeval','has','Re-evaluating\x20cached\x20test\x20run...','projectDir','green','381650CdOJsp','Test\x20','1059564OatCGd','224gOiYUn','execute','repeat','add','toLowerCase','conversations','agentDirs','Run\x20\x27tdx\x20agent\x20pull\x20','No\x20tests\x20have\x20tags\x20defined.','reeval','verbose','Test\x20Summary','push','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','test.yml','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','No\x20tests\x20found\x20with\x20tags:\x20','✗\x20FAIL:\x20','✗\x20ERROR:\x20Project\x20not\x20found:\x20','Duration:\x20','timestamp','Available\x20tags:\x20','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','\x20\x20Project:\x20','agentName','Failed\x20Tests:','\x20(cached)','Usage:','Error:\x20No\x20previous\x20test\x20run\x20found.','dim','map','\x20\x20-\x20','site','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','includes','utf-8','split','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','Site:\x20','yellow','cyan','agent','stop','88354XzFavF','length','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20',':\x20Sending\x20user\x20input...','dryRun','No\x20tests\x20found\x20matching:\x20','Running:\x20','start','json','\x20-\x20','\x20\x20Conversation:\x20','\x22:\x20','\x20\x20Evaluating...\x20','Agent:\x20','forEach','output','Total:\x20\x20\x20\x20','FAIL','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','resolve','tsv','find','eval','1720410dThTbS','Re-evaluating...','\x22,\x20but\x20current\x20site\x20is\x20\x22','basename','\x20\x20Round\x20','\x20\x20Agent:\x20','Round\x201/','Cached\x20run\x20from:\x20','join','Re-evaluation\x20Summary','white','rounds','110BApTcX','✗\x20ERROR:\x20','Error\x20writing\x20output\x20file:\x20','toISOString','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','filter','writeFileSync','536741aljYoO','table','status','Errors:\x20\x20\x20','New\x20tests\x20to\x20execute:\x20','Round\x20','Either\x20switch\x20to\x20the\x20\x22','existsSync','isSpinning','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','conversation_url','message','text','jsonl','name','source','Conversation\x20URL:\x20','projectName','no_local_folder','Passed:\x20\x20\x20','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','...','now','not\x20found','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','Evaluating\x20response...','\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','Failed:\x20\x20\x20','1213839tFsFlF','Running\x20test:\x20','✓\x20PASS:\x20','testYmlPath','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','\x20\x20Site:\x20'];a5_0x40d7=function(){return _0xa7b7ed;};return a5_0x40d7();}(function(_0x359bc,_0x420817){const _0x36ea22=a5_0x2d2e,_0x3fa173=_0x359bc();while(!![]){try{const _0x35e23f=-parseInt(_0x36ea22(0x214))/0x1+-parseInt(_0x36ea22(0x1bb))/0x2+parseInt(_0x36ea22(0x192))/0x3+-parseInt(_0x36ea22(0x1bd))/0x4+parseInt(_0x36ea22(0x20d))/0x5*(parseInt(_0x36ea22(0x19c))/0x6)+-parseInt(_0x36ea22(0x1ea))/0x7*(-parseInt(_0x36ea22(0x1be))/0x8)+-parseInt(_0x36ea22(0x1ad))/0x9*(-parseInt(_0x36ea22(0x201))/0xa);if(_0x35e23f===_0x420817)break;else _0x3fa173['push'](_0x3fa173['shift']());}catch(_0x5a7597){_0x3fa173['push'](_0x3fa173['shift']());}}}(a5_0x40d7,0x46079));import*as a5_0x57126d from'node:fs';import*as a5_0x5967c4 from'node:path';import a5_0x4fc242 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_0x2d2e(_0x1845a6,_0x4a406b){_0x1845a6=_0x1845a6-0x182;const _0x40d78b=a5_0x40d7();let _0x2d2e84=_0x40d78b[_0x1845a6];return _0x2d2e84;}export class AgentTestCommand extends BaseCommand{['name']='agent:test';[a5_0x435ffc(0x1a2)]='Run\x20tests\x20for\x20an\x20LLM\x20agent';async[a5_0x435ffc(0x1bf)](_0x4f98fa){const _0x16c062=a5_0x435ffc,{options:_0x4a2455,args:_0x14c316,tdx:_0x43b646}=_0x4f98fa,_0x4f8654=_0x14c316[0x0]||'.',_0x595969=_0x4a2455[_0x16c062(0x1ee)],_0x532f37=_0x4a2455,_0x7b5ebd=_0x532f37[_0x16c062(0x200)]===![],_0x1aa56e=_0x532f37[_0x16c062(0x1c7)],_0x53e2f6=_0x532f37[_0x16c062(0x184)],_0x198065=_0x532f37[_0x16c062(0x19e)],_0x461c55=_0x4a2455['site'],_0x3e3e80=_0x532f37[_0x16c062(0x1f9)];if(_0x1aa56e&&_0x7b5ebd)return console[_0x16c062(0x19b)](a5_0x4fc242['red'](_0x16c062(0x1cb))),0x1;let _0x13f8e3=_0x16c062(0x215);if(_0x532f37[_0x16c062(0x1f2)])_0x13f8e3=_0x16c062(0x1f2);else{if(_0x532f37[_0x16c062(0x183)])_0x13f8e3=_0x16c062(0x183);else{if(_0x532f37['tsv'])_0x13f8e3=_0x16c062(0x1fe);else{if(_0x532f37[_0x16c062(0x215)])_0x13f8e3='table';}}}const _0x2634df=_0x532f37[_0x16c062(0x1ae)];let _0x3e4c0e=_0x4f8654;const _0x15c493=a5_0x57126d[_0x16c062(0x21b)](_0x4f8654),_0x509eff=_0x4f8654==='.';if(!_0x15c493||_0x509eff){const _0x4820eb=resolveProjectFromContext(_0x4f8654,_0x2634df,{'requireFile':_0x16c062(0x1cc)});if(_0x4820eb['found'])_0x3e4c0e=_0x4820eb[_0x16c062(0x1b9)],_0x4820eb[_0x16c062(0x185)]===_0x16c062(0x1ab)&&console[_0x16c062(0x19b)](a5_0x4fc242[_0x16c062(0x1dc)](_0x16c062(0x199)+_0x3e4c0e));else switch(_0x4820eb[_0x16c062(0x1aa)]){case _0x16c062(0x1b2):console['log'](a5_0x4fc242[_0x16c062(0x1e6)](_0x4820eb[_0x16c062(0x21f)])),console[_0x16c062(0x19b)](),console[_0x16c062(0x19b)](_0x16c062(0x1da)),console['log'](_0x16c062(0x190)),console['log']('\x20\x20tdx\x20agent\x20test\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20(requires\x20context\x20or\x20tdx.json)'),console[_0x16c062(0x19b)](),console['log'](_0x16c062(0x1a4));return 0x1;case _0x16c062(0x188):console[_0x16c062(0x19b)](a5_0x4fc242[_0x16c062(0x1e6)](_0x4820eb[_0x16c062(0x21f)])),console[_0x16c062(0x19b)](),console[_0x16c062(0x19b)](_0x16c062(0x1c5)+_0x4820eb[_0x16c062(0x1ae)]+'\x27\x20to\x20create\x20the\x20folder\x20structure.');return 0x1;case'multiple_agents':{const _0x56eb4d=a5_0x5967c4[_0x16c062(0x204)](_0x4820eb[_0x16c062(0x1b9)]);console[_0x16c062(0x19b)](a5_0x4fc242[_0x16c062(0x1e6)]('Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22'+_0x4820eb[_0x16c062(0x1ae)]+'\x22:'));for(const _0x321299 of _0x4820eb[_0x16c062(0x1c4)]){console['log'](_0x16c062(0x1de)+_0x321299);}return console[_0x16c062(0x19b)](),console[_0x16c062(0x19b)](_0x16c062(0x1e4)+_0x56eb4d+_0x16c062(0x1a6)),0x1;}case _0x16c062(0x1a1):console[_0x16c062(0x19b)](a5_0x4fc242[_0x16c062(0x1e6)](_0x16c062(0x196)+_0x4820eb[_0x16c062(0x1ae)]+'\x22.')),console['log'](a5_0x4fc242[_0x16c062(0x1dc)](_0x16c062(0x1af)+_0x4820eb[_0x16c062(0x1b9)])),console[_0x16c062(0x19b)](),console['log'](_0x16c062(0x1fc));return 0x1;}}const {definition:_0x36d557,agentInfo:_0x12e469}=parseTestFile(_0x3e4c0e);let _0x55a1c1=_0x36d557[_0x16c062(0x1b1)];if(_0x53e2f6){const _0x10ec49=_0x53e2f6[_0x16c062(0x1e3)](',')[_0x16c062(0x1dd)](_0x39f864=>_0x39f864[_0x16c062(0x1a5)]());_0x55a1c1=_0x36d557[_0x16c062(0x1b1)][_0x16c062(0x212)](_0x19bef0=>_0x10ec49[_0x16c062(0x1e1)](_0x19bef0[_0x16c062(0x184)]));if(_0x55a1c1[_0x16c062(0x1eb)]===0x0)return console[_0x16c062(0x19b)](a5_0x4fc242[_0x16c062(0x1e6)](_0x16c062(0x1ef)+_0x53e2f6)),console['log'](a5_0x4fc242['dim'](_0x16c062(0x19d)+_0x36d557[_0x16c062(0x1b1)][_0x16c062(0x1dd)](_0x40b5ed=>_0x40b5ed['name'])[_0x16c062(0x209)](',\x20'))),0x1;}if(_0x198065){const _0x1d7de3=_0x198065[_0x16c062(0x1e3)](',')[_0x16c062(0x1dd)](_0x13f020=>_0x13f020[_0x16c062(0x1a5)]()[_0x16c062(0x1c2)]());_0x55a1c1=_0x55a1c1['filter'](_0x388ca5=>_0x388ca5[_0x16c062(0x19e)]?.[_0x16c062(0x19a)](_0x2c5a18=>_0x1d7de3[_0x16c062(0x1e1)](_0x2c5a18[_0x16c062(0x1c2)]())));if(_0x55a1c1[_0x16c062(0x1eb)]===0x0){console[_0x16c062(0x19b)](a5_0x4fc242['yellow'](_0x16c062(0x1ce)+_0x198065));const _0x3db038=new Set();return _0x36d557[_0x16c062(0x1b1)][_0x16c062(0x1f8)](_0x3e6a5f=>_0x3e6a5f[_0x16c062(0x19e)]?.['forEach'](_0x248862=>_0x3db038[_0x16c062(0x1c1)](_0x248862))),_0x3db038['size']>0x0?console[_0x16c062(0x19b)](a5_0x4fc242[_0x16c062(0x1dc)](_0x16c062(0x1d3)+[..._0x3db038]['join'](',\x20'))):console[_0x16c062(0x19b)](a5_0x4fc242[_0x16c062(0x1dc)](_0x16c062(0x1c6))),0x1;}}if(_0x1aa56e)return this[_0x16c062(0x1b6)](_0x4f98fa,{'definition':{'tests':_0x55a1c1},'agentInfo':_0x12e469,'outputFormat':_0x13f8e3,'outputFile':_0x3e3e80,'testNames':_0x53e2f6});if(_0x595969){console['log'](a5_0x4fc242['cyan'](_0x16c062(0x1a7))),console[_0x16c062(0x19b)](_0x16c062(0x197)+a5_0x4fc242[_0x16c062(0x20b)](_0x461c55)),console[_0x16c062(0x19b)](_0x16c062(0x1d6)+a5_0x4fc242['white'](_0x12e469['projectName'])),console[_0x16c062(0x19b)](_0x16c062(0x206)+a5_0x4fc242[_0x16c062(0x20b)](_0x12e469[_0x16c062(0x1d7)])),console[_0x16c062(0x19b)](),console[_0x16c062(0x19b)](_0x16c062(0x198)+a5_0x4fc242[_0x16c062(0x20b)](_0x55a1c1[_0x16c062(0x1eb)]));for(let _0x1b1cbd=0x0;_0x1b1cbd<_0x55a1c1['length'];_0x1b1cbd++){const _0x5236d8=_0x55a1c1[_0x1b1cbd],_0x347deb=_0x5236d8['rounds'][_0x16c062(0x1eb)]===0x1?'round':_0x16c062(0x20c),_0x4ccf20=_0x5236d8['tags']?.['length']?'\x20['+_0x5236d8['tags'][_0x16c062(0x209)](',\x20')+']':'';console[_0x16c062(0x19b)]('\x20\x20'+(_0x1b1cbd+0x1)+'.\x20'+a5_0x4fc242['white'](_0x5236d8[_0x16c062(0x184)])+'\x20('+_0x5236d8[_0x16c062(0x20c)][_0x16c062(0x1eb)]+'\x20'+_0x347deb+')'+a5_0x4fc242['dim'](_0x4ccf20));}return 0x0;}let _0x2e94d1,_0x523310;try{_0x2e94d1=await _0x43b646[_0x16c062(0x1a8)]['resolveProjectId'](_0x12e469[_0x16c062(0x187)]);}catch(_0x5a7b09){const _0x1caf47=_0x5a7b09 instanceof Error?_0x5a7b09[_0x16c062(0x21f)]:String(_0x5a7b09);return _0x1caf47[_0x16c062(0x1e1)]('404')||_0x1caf47[_0x16c062(0x1c2)]()[_0x16c062(0x1e1)](_0x16c062(0x18d))?console['log'](a5_0x4fc242[_0x16c062(0x1b0)](_0x16c062(0x1d0)+_0x12e469[_0x16c062(0x187)])):console[_0x16c062(0x19b)](a5_0x4fc242[_0x16c062(0x1b0)](_0x16c062(0x21d)+_0x12e469[_0x16c062(0x187)]+_0x16c062(0x1f5)+_0x1caf47)),0x1;}try{_0x523310=await _0x43b646[_0x16c062(0x1a8)][_0x16c062(0x1b5)](_0x12e469[_0x16c062(0x1d7)],_0x2e94d1);}catch(_0x3cb251){const _0x456276=_0x3cb251 instanceof Error?_0x3cb251[_0x16c062(0x21f)]:String(_0x3cb251);return _0x456276['includes']('404')||_0x456276['toLowerCase']()[_0x16c062(0x1e1)](_0x16c062(0x18d))?console[_0x16c062(0x19b)](a5_0x4fc242[_0x16c062(0x1b0)](_0x16c062(0x1cd)+_0x12e469[_0x16c062(0x1d7)])):console[_0x16c062(0x19b)](a5_0x4fc242[_0x16c062(0x1b0)](_0x16c062(0x211)+_0x12e469[_0x16c062(0x1d7)]+_0x16c062(0x1f5)+_0x456276)),0x1;}let _0x12b450;if(!_0x7b5ebd)try{_0x12b450=await setupEvaluatorAgent(_0x43b646['llm'],_0x4a2455[_0x16c062(0x1c8)]);}catch(_0x5c0268){const _0x389398=_0x5c0268 instanceof Error?_0x5c0268[_0x16c062(0x21f)]:String(_0x5c0268);return console[_0x16c062(0x19b)](a5_0x4fc242[_0x16c062(0x1b0)](_0x16c062(0x1ec)+_0x389398)),0x1;}console['log'](a5_0x4fc242[_0x16c062(0x1e7)]('Running\x20agent\x20tests...')),console[_0x16c062(0x19b)](_0x16c062(0x1e5)+a5_0x4fc242[_0x16c062(0x20b)](_0x461c55)),console[_0x16c062(0x19b)](_0x16c062(0x1f7)+a5_0x4fc242[_0x16c062(0x20b)](_0x12e469[_0x16c062(0x187)]+'/'+_0x12e469[_0x16c062(0x1d7)])),console[_0x16c062(0x19b)]();const _0x151c6e=[],_0x38f6eb=[],_0x111eb6=Date[_0x16c062(0x18c)]();for(let _0x32c443=0x0;_0x32c443<_0x55a1c1[_0x16c062(0x1eb)];_0x32c443++){const _0x9a6dcd=_0x55a1c1[_0x32c443];_0x55a1c1[_0x16c062(0x1eb)]>0x1?console['log'](_0x16c062(0x1bc)+(_0x32c443+0x1)+'/'+_0x55a1c1[_0x16c062(0x1eb)]+':\x20'+a5_0x4fc242[_0x16c062(0x20b)](_0x9a6dcd[_0x16c062(0x184)])):console[_0x16c062(0x19b)](_0x16c062(0x193)+a5_0x4fc242[_0x16c062(0x20b)](_0x9a6dcd['name']));const _0xac4a72=createCommandSpinner(_0x16c062(0x207)+_0x9a6dcd[_0x16c062(0x20c)][_0x16c062(0x1eb)]+_0x16c062(0x1ed));_0xac4a72[_0x16c062(0x1f1)]();try{const {result:_0xc246dc,conversation:_0x34750f}=await runTest(_0x43b646[_0x16c062(0x1a8)],_0x9a6dcd,{'agentId':_0x523310,'projectId':_0x2e94d1,'site':_0x461c55,'noEval':_0x7b5ebd,'evaluatorId':_0x12b450,'onRoundStart':(_0x22a6db,_0x4d3437)=>{const _0x3b24ba=_0x16c062;_0xac4a72[_0x3b24ba(0x182)]=_0x3b24ba(0x219)+(_0x22a6db+0x1)+'/'+_0x4d3437+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x362f77,_0x50670e,_0x409e47)=>{const _0x45c78a=_0x16c062,_0x595131=formatElapsed(_0x50670e);_0x409e47?console[_0x45c78a(0x19b)](_0x45c78a(0x205)+(_0x362f77+0x1)+'/'+_0x9a6dcd[_0x45c78a(0x20c)][_0x45c78a(0x1eb)]+_0x45c78a(0x1b3)+a5_0x4fc242[_0x45c78a(0x1ba)]('✓')+'\x20('+_0x595131+')'):console[_0x45c78a(0x19b)](_0x45c78a(0x205)+(_0x362f77+0x1)+'/'+_0x9a6dcd[_0x45c78a(0x20c)][_0x45c78a(0x1eb)]+_0x45c78a(0x1b3)+a5_0x4fc242['red']('✗'));},'onEvaluationStart':()=>{const _0x45f77d=_0x16c062;_0xac4a72['text']=_0x45f77d(0x18f);},'onEvaluationComplete':_0x578d17=>{const _0x1ed9a7=_0x16c062,_0xf79330=formatElapsed(_0x578d17);console[_0x1ed9a7(0x19b)]('\x20\x20Evaluating...\x20'+a5_0x4fc242['green']('✓')+'\x20('+_0xf79330+')');}});_0xac4a72[_0x16c062(0x1e9)](),_0x151c6e[_0x16c062(0x1ca)](_0xc246dc),_0x38f6eb[_0x16c062(0x1ca)](_0x34750f);if(_0xc246dc[_0x16c062(0x216)]===_0x16c062(0x1a3))console[_0x16c062(0x19b)](a5_0x4fc242['green']('✓\x20PASS:\x20'+_0xc246dc[_0x16c062(0x1aa)]));else _0xc246dc[_0x16c062(0x216)]===_0x16c062(0x1fb)?console[_0x16c062(0x19b)](a5_0x4fc242[_0x16c062(0x1b0)](_0x16c062(0x1cf)+_0xc246dc['reason'])):console['log'](a5_0x4fc242[_0x16c062(0x1b0)](_0x16c062(0x20e)+_0xc246dc[_0x16c062(0x1aa)]));_0xc246dc['conversation_url']&&console[_0x16c062(0x19b)](a5_0x4fc242[_0x16c062(0x1dc)](_0x16c062(0x186)+_0xc246dc[_0x16c062(0x21e)])),console[_0x16c062(0x19b)]();}catch(_0x36ac89){_0xac4a72[_0x16c062(0x1e9)]();const _0x232872=_0x36ac89 instanceof Error?_0x36ac89[_0x16c062(0x21f)]:String(_0x36ac89);console[_0x16c062(0x19b)](a5_0x4fc242[_0x16c062(0x1b0)]('✗\x20ERROR:\x20'+_0x232872)),console[_0x16c062(0x19b)](),_0x151c6e[_0x16c062(0x1ca)]({'name':_0x9a6dcd['name'],'status':'ERROR','reason':_0x232872,'timestamp':new Date()[_0x16c062(0x210)](),'duration_ms':0x0});}}const _0x26303f=Date[_0x16c062(0x18c)]()-_0x111eb6,_0x162424=_0x151c6e[_0x16c062(0x212)](_0x57d68a=>_0x57d68a[_0x16c062(0x216)]===_0x16c062(0x1a3))[_0x16c062(0x1eb)],_0x800d31=_0x151c6e[_0x16c062(0x212)](_0x3a39d5=>_0x3a39d5[_0x16c062(0x216)]===_0x16c062(0x1fb))[_0x16c062(0x1eb)],_0x33f3d3=_0x151c6e[_0x16c062(0x212)](_0x5e6aa7=>_0x5e6aa7[_0x16c062(0x216)]===_0x16c062(0x1b4))[_0x16c062(0x1eb)];console['log']('━'['repeat'](0x3c)),console[_0x16c062(0x19b)](_0x16c062(0x1c9)),console[_0x16c062(0x19b)]('━'[_0x16c062(0x1c0)](0x3c)),console['log'](_0x16c062(0x1fa)+_0x151c6e[_0x16c062(0x1eb)]),console[_0x16c062(0x19b)](_0x16c062(0x189)+a5_0x4fc242['green'](_0x162424)),console['log']('Failed:\x20\x20\x20'+a5_0x4fc242[_0x16c062(0x1b0)](_0x800d31));_0x33f3d3>0x0&&console[_0x16c062(0x19b)](_0x16c062(0x217)+a5_0x4fc242[_0x16c062(0x1b0)](_0x33f3d3));console['log'](_0x16c062(0x1d1)+formatElapsed(_0x26303f)),console[_0x16c062(0x19b)]('━'[_0x16c062(0x1c0)](0x3c));const _0x2acfca=_0x151c6e['filter'](_0x195b30=>_0x195b30[_0x16c062(0x216)]!==_0x16c062(0x1a3));if(_0x2acfca['length']>0x0){console['log'](),console[_0x16c062(0x19b)](_0x16c062(0x1d8));for(const _0x156503 of _0x2acfca){const _0x1711c1=a5_0x4fc242[_0x16c062(0x1b0)]('✗'),_0x32acc7=_0x156503[_0x16c062(0x1aa)][_0x16c062(0x1eb)]>0x32?_0x156503['reason']['substring'](0x0,0x32)+_0x16c062(0x18b):_0x156503[_0x16c062(0x1aa)];console[_0x16c062(0x19b)]('\x20\x20'+_0x1711c1+'\x20'+_0x156503[_0x16c062(0x184)]+':\x20'+_0x32acc7);}}const _0x12e3ea={'summary':{'total':_0x151c6e['length'],'passed':_0x162424,'failed':_0x800d31,'errors':_0x33f3d3>0x0?_0x33f3d3:undefined,'duration_ms':_0x26303f},'tests':_0x151c6e,'agent':{'project':_0x12e469['projectName'],'name':_0x12e469['agentName'],'site':_0x461c55},'timestamp':new Date(_0x111eb6)[_0x16c062(0x210)]()};try{const _0x4b7d14=buildCachedTestRun(_0x38f6eb,{'site':_0x461c55,'projectId':_0x2e94d1,'projectName':_0x12e469[_0x16c062(0x187)],'agentId':_0x523310,'agentName':_0x12e469[_0x16c062(0x1d7)],'testYmlPath':a5_0x5967c4[_0x16c062(0x1fd)](_0x12e469[_0x16c062(0x195)])});saveLastTestRun(_0x4b7d14);}catch{}if(_0x13f8e3!==_0x16c062(0x215)||_0x3e3e80){const _0x45a3b4=formatResults(_0x12e3ea,_0x13f8e3);if(_0x3e3e80)try{a5_0x57126d['writeFileSync'](_0x3e3e80,_0x45a3b4,_0x16c062(0x1e2)),console[_0x16c062(0x19b)](),console[_0x16c062(0x19b)](a5_0x4fc242['dim'](_0x16c062(0x1ac)+_0x3e3e80));}catch(_0x2d8eb0){return console[_0x16c062(0x19b)](),console[_0x16c062(0x19b)](a5_0x4fc242['red']('Error\x20writing\x20output\x20file:\x20'+_0x2d8eb0)),0x1;}else console[_0x16c062(0x19b)](),console[_0x16c062(0x19b)](_0x45a3b4);}return _0x2acfca[_0x16c062(0x1eb)]>0x0?0x1:0x0;}async[a5_0x435ffc(0x1b6)](_0x4c3e1e,_0x56be50){const _0x531ac2=a5_0x435ffc,{options:_0x292636,tdx:_0x11d175}=_0x4c3e1e,{definition:_0xfcd04,agentInfo:_0x2f876c,outputFormat:_0x22cad8,outputFile:_0x4acca2}=_0x56be50,_0x367f6b=_0x292636[_0x531ac2(0x1df)],_0x585731=loadLastTestRun();if(!_0x585731)return console[_0x531ac2(0x19b)](a5_0x4fc242[_0x531ac2(0x1b0)](_0x531ac2(0x1db))),console[_0x531ac2(0x19b)](a5_0x4fc242[_0x531ac2(0x1dc)](_0x531ac2(0x18e))),0x1;if(_0x585731[_0x531ac2(0x1e8)][_0x531ac2(0x1d7)]!==_0x2f876c[_0x531ac2(0x1d7)])return console[_0x531ac2(0x19b)](a5_0x4fc242[_0x531ac2(0x1b0)]('Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22'+_0x585731[_0x531ac2(0x1e8)][_0x531ac2(0x1d7)]+_0x531ac2(0x1d4)+_0x2f876c[_0x531ac2(0x1d7)]+'\x22.')),console[_0x531ac2(0x19b)](a5_0x4fc242[_0x531ac2(0x1dc)](_0x531ac2(0x1a0))),0x1;const _0x5a3297=new Set(_0x585731[_0x531ac2(0x1c3)][_0x531ac2(0x1dd)](_0x1d40f1=>_0x1d40f1['testName'])),_0x49f446=_0xfcd04[_0x531ac2(0x1b1)][_0x531ac2(0x212)](_0x1e02db=>!_0x5a3297['has'](_0x1e02db[_0x531ac2(0x184)]));if(_0x49f446[_0x531ac2(0x1eb)]>0x0&&_0x585731[_0x531ac2(0x1df)]!==_0x367f6b)return console['log'](a5_0x4fc242[_0x531ac2(0x1b0)](_0x531ac2(0x18a))),console['log'](a5_0x4fc242[_0x531ac2(0x1dc)](_0x531ac2(0x1a9)+_0x585731[_0x531ac2(0x1df)]+_0x531ac2(0x203)+_0x367f6b+'\x22.')),console[_0x531ac2(0x19b)](a5_0x4fc242['dim'](_0x531ac2(0x21a)+_0x585731[_0x531ac2(0x1df)]+_0x531ac2(0x1e0))),0x1;const _0x4d55d8=_0xfcd04[_0x531ac2(0x1b1)][_0x531ac2(0x212)](_0x8096db=>_0x5a3297[_0x531ac2(0x1b7)](_0x8096db[_0x531ac2(0x184)])),_0x25aa1d=_0x49f446;let _0x4e008a;try{_0x4e008a=await setupEvaluatorAgent(_0x11d175[_0x531ac2(0x1a8)],_0x292636[_0x531ac2(0x1c8)]);}catch(_0x975824){const _0x8b3878=_0x975824 instanceof Error?_0x975824[_0x531ac2(0x21f)]:String(_0x975824);return console[_0x531ac2(0x19b)](a5_0x4fc242[_0x531ac2(0x1b0)]('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x8b3878)),0x1;}console[_0x531ac2(0x19b)](a5_0x4fc242['cyan'](_0x531ac2(0x1b8))),console[_0x531ac2(0x19b)](_0x531ac2(0x208)+a5_0x4fc242[_0x531ac2(0x20b)](_0x585731[_0x531ac2(0x1d2)])),console[_0x531ac2(0x19b)](_0x531ac2(0x1f7)+a5_0x4fc242['white'](_0x585731[_0x531ac2(0x1e8)][_0x531ac2(0x187)]+'/'+_0x585731['agent']['agentName']));_0x25aa1d['length']>0x0&&console['log'](_0x531ac2(0x218)+a5_0x4fc242[_0x531ac2(0x1e6)](_0x25aa1d['length']));console[_0x531ac2(0x19b)]();const _0x1468d3=[],_0x1a4a08=Date['now'](),_0x5bc8b8=createCommandSpinner(_0x531ac2(0x202));if(_0x4d55d8['length']>0x0)try{const _0x2dc29f=await reevaluateFromCache(_0x11d175[_0x531ac2(0x1a8)],_0x585731,{'tests':_0x4d55d8},{'evaluatorId':_0x4e008a,'onTestStart':(_0x25df56,_0x519651,_0x3a8bb0)=>{const _0x1ff592=_0x531ac2;_0x5bc8b8['text']='Re-evaluating\x20'+(_0x519651+0x1)+'/'+_0x3a8bb0+':\x20'+_0x25df56+_0x1ff592(0x18b);if(!_0x5bc8b8[_0x1ff592(0x21c)])_0x5bc8b8[_0x1ff592(0x1f1)]();},'onTestComplete':(_0x2431dc,_0x225d0f)=>{const _0x57c116=_0x531ac2;_0x5bc8b8[_0x57c116(0x1e9)]();if(_0x225d0f[_0x57c116(0x216)]===_0x57c116(0x1a3))console[_0x57c116(0x19b)](a5_0x4fc242[_0x57c116(0x1ba)](_0x57c116(0x194)+_0x2431dc)+a5_0x4fc242['dim']('\x20(cached)'));else _0x225d0f[_0x57c116(0x216)]===_0x57c116(0x1fb)?console[_0x57c116(0x19b)](a5_0x4fc242[_0x57c116(0x1b0)]('✗\x20FAIL:\x20'+_0x2431dc+'\x20-\x20'+_0x225d0f[_0x57c116(0x1aa)])+a5_0x4fc242['dim'](_0x57c116(0x1d9))):console[_0x57c116(0x19b)](a5_0x4fc242[_0x57c116(0x1b0)]('✗\x20ERROR:\x20'+_0x2431dc+_0x57c116(0x1f3)+_0x225d0f['reason']));_0x225d0f['conversation_url']&&console[_0x57c116(0x19b)](a5_0x4fc242[_0x57c116(0x1dc)](_0x57c116(0x1f4)+_0x225d0f['conversation_url'])),_0x1468d3[_0x57c116(0x1ca)](_0x225d0f);},'onTestSkipped':(_0x371210,_0x537bda)=>{const _0x175eb0=_0x531ac2;_0x5bc8b8[_0x175eb0(0x1e9)](),console[_0x175eb0(0x19b)](a5_0x4fc242['yellow']('⚠\x20SKIPPED:\x20'+_0x371210+'\x20-\x20'+_0x537bda));}});for(const _0x1b6616 of _0x2dc29f){!_0x1468d3[_0x531ac2(0x1ff)](_0x555ba2=>_0x555ba2[_0x531ac2(0x184)]===_0x1b6616[_0x531ac2(0x184)])&&_0x1468d3[_0x531ac2(0x1ca)](_0x1b6616);}}catch(_0x276105){_0x5bc8b8[_0x531ac2(0x1e9)]();const _0x2e30fd=_0x276105 instanceof Error?_0x276105['message']:String(_0x276105);return console[_0x531ac2(0x19b)](a5_0x4fc242[_0x531ac2(0x1b0)](_0x531ac2(0x1d5)+_0x2e30fd)),0x1;}_0x5bc8b8[_0x531ac2(0x1e9)]();if(_0x25aa1d[_0x531ac2(0x1eb)]>0x0){console[_0x531ac2(0x19b)](),console['log'](a5_0x4fc242[_0x531ac2(0x1e7)]('Executing\x20new\x20tests...'));const {projectId:_0x19ed1f,agentId:_0x34d9cc}=_0x585731['agent'];for(const _0x1c520f of _0x25aa1d){console[_0x531ac2(0x19b)](_0x531ac2(0x1f0)+a5_0x4fc242[_0x531ac2(0x20b)](_0x1c520f[_0x531ac2(0x184)]));const _0x51bafc=createCommandSpinner('Round\x201/'+_0x1c520f['rounds'][_0x531ac2(0x1eb)]+':\x20Sending\x20user\x20input...');_0x51bafc['start']();try{const {result:_0x5c5c70}=await runTest(_0x11d175[_0x531ac2(0x1a8)],_0x1c520f,{'agentId':_0x34d9cc,'projectId':_0x19ed1f,'site':_0x585731[_0x531ac2(0x1df)],'noEval':![],'evaluatorId':_0x4e008a,'onRoundStart':(_0x170ebf,_0x2c924b)=>{const _0x397e7e=_0x531ac2;_0x51bafc[_0x397e7e(0x182)]=_0x397e7e(0x219)+(_0x170ebf+0x1)+'/'+_0x2c924b+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x5d453a,_0xa2116d,_0x58b216)=>{const _0x2d319e=_0x531ac2,_0x4e3459=formatElapsed(_0xa2116d);_0x58b216?console[_0x2d319e(0x19b)](_0x2d319e(0x205)+(_0x5d453a+0x1)+'/'+_0x1c520f[_0x2d319e(0x20c)][_0x2d319e(0x1eb)]+_0x2d319e(0x1b3)+a5_0x4fc242[_0x2d319e(0x1ba)]('✓')+'\x20('+_0x4e3459+')'):console['log'](_0x2d319e(0x205)+(_0x5d453a+0x1)+'/'+_0x1c520f['rounds'][_0x2d319e(0x1eb)]+_0x2d319e(0x1b3)+a5_0x4fc242[_0x2d319e(0x1b0)]('✗'));},'onEvaluationStart':()=>{const _0x535343=_0x531ac2;_0x51bafc[_0x535343(0x182)]=_0x535343(0x18f);},'onEvaluationComplete':_0x4ea3e5=>{const _0x29b41e=_0x531ac2,_0x537ee3=formatElapsed(_0x4ea3e5);console[_0x29b41e(0x19b)](_0x29b41e(0x1f6)+a5_0x4fc242['green']('✓')+'\x20('+_0x537ee3+')');}});_0x51bafc[_0x531ac2(0x1e9)](),_0x1468d3[_0x531ac2(0x1ca)](_0x5c5c70);if(_0x5c5c70[_0x531ac2(0x216)]===_0x531ac2(0x1a3))console[_0x531ac2(0x19b)](a5_0x4fc242[_0x531ac2(0x1ba)](_0x531ac2(0x194)+_0x5c5c70[_0x531ac2(0x1aa)])+a5_0x4fc242[_0x531ac2(0x1dc)](_0x531ac2(0x19f)));else _0x5c5c70[_0x531ac2(0x216)]===_0x531ac2(0x1fb)?console['log'](a5_0x4fc242['red'](_0x531ac2(0x1cf)+_0x5c5c70[_0x531ac2(0x1aa)])+a5_0x4fc242['dim'](_0x531ac2(0x19f))):console[_0x531ac2(0x19b)](a5_0x4fc242[_0x531ac2(0x1b0)](_0x531ac2(0x20e)+_0x5c5c70['reason']));_0x5c5c70[_0x531ac2(0x21e)]&&console[_0x531ac2(0x19b)](a5_0x4fc242[_0x531ac2(0x1dc)](_0x531ac2(0x1f4)+_0x5c5c70[_0x531ac2(0x21e)]));}catch(_0x168f08){_0x51bafc[_0x531ac2(0x1e9)]();const _0x927a3c=_0x168f08 instanceof Error?_0x168f08['message']:String(_0x168f08);console[_0x531ac2(0x19b)](a5_0x4fc242[_0x531ac2(0x1b0)](_0x531ac2(0x20e)+_0x927a3c)),_0x1468d3[_0x531ac2(0x1ca)]({'name':_0x1c520f[_0x531ac2(0x184)],'status':_0x531ac2(0x1b4),'reason':_0x927a3c,'timestamp':new Date()[_0x531ac2(0x210)](),'duration_ms':0x0});}}}console['log']();const _0x529419=Date[_0x531ac2(0x18c)]()-_0x1a4a08,_0x1e404a=_0x1468d3[_0x531ac2(0x212)](_0x18e6aa=>_0x18e6aa[_0x531ac2(0x216)]==='PASS')['length'],_0x4bdf5a=_0x1468d3[_0x531ac2(0x212)](_0x58b059=>_0x58b059['status']===_0x531ac2(0x1fb))['length'],_0x1312eb=_0x1468d3['filter'](_0x3b7c0a=>_0x3b7c0a[_0x531ac2(0x216)]===_0x531ac2(0x1b4))[_0x531ac2(0x1eb)];console[_0x531ac2(0x19b)]('━'[_0x531ac2(0x1c0)](0x3c)),console[_0x531ac2(0x19b)](_0x531ac2(0x20a)),console['log']('━'['repeat'](0x3c)),console[_0x531ac2(0x19b)]('Total:\x20\x20\x20\x20'+_0x1468d3['length']),console[_0x531ac2(0x19b)](_0x531ac2(0x189)+a5_0x4fc242[_0x531ac2(0x1ba)](_0x1e404a)),console[_0x531ac2(0x19b)](_0x531ac2(0x191)+a5_0x4fc242[_0x531ac2(0x1b0)](_0x4bdf5a));_0x1312eb>0x0&&console[_0x531ac2(0x19b)](_0x531ac2(0x217)+a5_0x4fc242[_0x531ac2(0x1b0)](_0x1312eb));console[_0x531ac2(0x19b)](_0x531ac2(0x1d1)+formatElapsed(_0x529419)),console['log']('━'[_0x531ac2(0x1c0)](0x3c));const _0x48dc70={'summary':{'total':_0x1468d3[_0x531ac2(0x1eb)],'passed':_0x1e404a,'failed':_0x4bdf5a,'errors':_0x1312eb>0x0?_0x1312eb:undefined,'duration_ms':_0x529419},'tests':_0x1468d3,'agent':{'project':_0x2f876c['projectName'],'name':_0x2f876c[_0x531ac2(0x1d7)],'site':_0x367f6b},'timestamp':new Date(_0x1a4a08)[_0x531ac2(0x210)]()};if(_0x22cad8!==_0x531ac2(0x215)||_0x4acca2){const _0xf7ab31=formatResults(_0x48dc70,_0x22cad8);if(_0x4acca2)try{a5_0x57126d[_0x531ac2(0x213)](_0x4acca2,_0xf7ab31,_0x531ac2(0x1e2)),console['log'](),console[_0x531ac2(0x19b)](a5_0x4fc242[_0x531ac2(0x1dc)]('Output\x20written\x20to:\x20'+_0x4acca2));}catch(_0x33e9e6){return console[_0x531ac2(0x19b)](),console[_0x531ac2(0x19b)](a5_0x4fc242[_0x531ac2(0x1b0)](_0x531ac2(0x20f)+_0x33e9e6)),0x1;}else console[_0x531ac2(0x19b)](),console['log'](_0xf7ab31);}const _0x1749f7=_0x1468d3['filter'](_0x123c40=>_0x123c40[_0x531ac2(0x216)]!==_0x531ac2(0x1a3));return _0x1749f7['length']>0x0?0x1:0x0;}}
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 +1 @@
1
- const a6_0x3cfae5=a6_0x4e5f;(function(_0x47704e,_0x407b07){const _0x373e4f=a6_0x4e5f,_0x32a99c=_0x47704e();while(!![]){try{const _0xd24b3a=-parseInt(_0x373e4f(0x79))/0x1*(parseInt(_0x373e4f(0x81))/0x2)+-parseInt(_0x373e4f(0x64))/0x3+-parseInt(_0x373e4f(0x94))/0x4+-parseInt(_0x373e4f(0x9a))/0x5+parseInt(_0x373e4f(0x99))/0x6*(parseInt(_0x373e4f(0xa2))/0x7)+-parseInt(_0x373e4f(0x71))/0x8*(-parseInt(_0x373e4f(0x7d))/0x9)+parseInt(_0x373e4f(0x78))/0xa;if(_0xd24b3a===_0x407b07)break;else _0x32a99c['push'](_0x32a99c['shift']());}catch(_0x1b9243){_0x32a99c['push'](_0x32a99c['shift']());}}}(a6_0x4724,0xdd702));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';function a6_0x4724(){const _0x1b5225=['headers','x-xsrf-token','workflow','includes','api','.\x20Valid\x20methods:\x20','Error:\x20','header','proxy-authorization','method','body','2967492MagkJm','PUT','x-auth-token','length','join','1398ffcPHa','7035265QUcIUO','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','llm','substring','name','toUpperCase','output','llm-proxy','38101dqQEdC','Endpoint\x20must\x20start\x20with\x20/:\x20','readBodyFromFile','request','Results\x20saved\x20to\x20','description','1168593JOsMAI','<\x20HTTP/1.1\x20','error','cas','log','set-cookie','data','toLowerCase','execute','keys','message','stack','x-trino-user','2082368nWPqHv','GET','trino','status','isArray','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','type','21200620MxHqVN','101555CjDioC','entries','file','noColor','9RQIvTm','set-cookie2','PATCH','trim','4BTQmsk','Invalid\x20header\x20format:\x20\x22','POST','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','verbose','Invalid\x20API\x20type:\x20','\x22.\x20','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list'];a6_0x4724=function(){return _0x1b5225;};return a6_0x4724();}const SENSITIVE_HEADERS=new Set(['authorization',a6_0x3cfae5(0x91),'cookie',a6_0x3cfae5(0x69),a6_0x3cfae5(0x7e),a6_0x3cfae5(0x8a),a6_0x3cfae5(0x96),a6_0x3cfae5(0x70)]);function a6_0x4e5f(_0x49e14f,_0x33cc4b){_0x49e14f=_0x49e14f-0x64;const _0x47242d=a6_0x4724();let _0x4e5f78=_0x47242d[_0x49e14f];return _0x4e5f78;}function isSensitiveHeader(_0x4ad421){const _0x54121f=a6_0x3cfae5;return SENSITIVE_HEADERS['has'](_0x4ad421[_0x54121f(0x6b)]());}function parseHeader(_0xb02826){const _0x54920b=a6_0x3cfae5,_0x8f5083=_0xb02826['indexOf'](':');if(_0x8f5083===-0x1)throw new Error(_0x54920b(0x82)+_0xb02826+_0x54920b(0x87)+_0x54920b(0x76));const _0x48c3f9=_0xb02826[_0x54920b(0x9d)](0x0,_0x8f5083)['trim'](),_0x22d162=_0xb02826[_0x54920b(0x9d)](_0x8f5083+0x1)[_0x54920b(0x80)]();if(!_0x48c3f9)throw new Error(_0x54920b(0x9b)+_0xb02826+'\x22');return[_0x48c3f9,_0x22d162];}export class ApiCommand extends BaseCommand{[a6_0x3cfae5(0x9e)]=a6_0x3cfae5(0x8d);[a6_0x3cfae5(0xa7)]='Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs';['validate'](_0x2fa8c9){const _0x357918=a6_0x3cfae5,{args:_0x4d50b4,options:_0x2428b7}=_0x2fa8c9,_0x3120ad=_0x2428b7;if(_0x4d50b4[_0x357918(0x97)]===0x0)return _0x357918(0x88);const _0x44d4a1=_0x4d50b4[0x0];if(!_0x44d4a1['startsWith']('/'))return _0x357918(0xa3)+_0x44d4a1;const _0x4162ef=_0x3120ad[_0x357918(0x6a)],_0x32b926=_0x3120ad[_0x357918(0x7b)];if(_0x4162ef&&_0x32b926)return _0x357918(0x84);const _0x5e9910=_0x3120ad[_0x357918(0x92)]||_0x357918(0x72),_0x51105a=[_0x357918(0x72),_0x357918(0x83),_0x357918(0x95),'DELETE',_0x357918(0x7f)];if(!_0x51105a[_0x357918(0x8c)](_0x5e9910[_0x357918(0x9f)]()))return'Invalid\x20HTTP\x20method:\x20'+_0x5e9910+_0x357918(0x8e)+_0x51105a[_0x357918(0x98)](',\x20');const _0x32ef60=_0x3120ad[_0x357918(0x77)]||'td',_0x3741b9=['td','cdp',_0x357918(0x8b),_0x357918(0x73),_0x357918(0x9c),_0x357918(0xa1),_0x357918(0x67)];if(!_0x3741b9[_0x357918(0x8c)](_0x32ef60))return _0x357918(0x86)+_0x32ef60+'.\x20Valid\x20types:\x20'+_0x3741b9[_0x357918(0x98)](',\x20');return undefined;}async[a6_0x3cfae5(0x6c)](_0x59d41d){const _0x51d131=a6_0x3cfae5,{options:_0x27f90f,args:_0xc581e1,tdx:_0x16ff90}=_0x59d41d,_0x1259eb=_0x27f90f,_0x39b456=_0xc581e1[0x0],_0x2581f3=(_0x1259eb['method']||_0x51d131(0x72))['toUpperCase'](),_0x336263=_0x1259eb['data'],_0x39da9f=_0x1259eb['file'],_0x2cc167=_0x1259eb[_0x51d131(0x90)],_0x382a8d=_0x1259eb[_0x51d131(0x77)]||'td';try{const _0x2a5b3c={};if(_0x2cc167){const _0x4c613b=Array[_0x51d131(0x75)](_0x2cc167)?_0x2cc167:[_0x2cc167];for(const _0x3e3b74 of _0x4c613b){const [_0x3f5ee2,_0x58a3c1]=parseHeader(_0x3e3b74);_0x2a5b3c[_0x3f5ee2]=_0x58a3c1;}}let _0x5449a1;if(_0x336263)_0x5449a1=_0x336263;else{if(_0x39da9f)try{_0x5449a1=RawAPI[_0x51d131(0xa4)](_0x39da9f);}catch(_0x6c889a){return console['error'](_0x51d131(0x8f)+(_0x6c889a instanceof Error?_0x6c889a[_0x51d131(0x6e)]:String(_0x6c889a))),0x1;}}const _0x22a474={'method':_0x2581f3,'apiType':_0x382a8d,'includeHeaders':_0x27f90f['verbose']};_0x5449a1&&(_0x22a474[_0x51d131(0x93)]=_0x5449a1);Object[_0x51d131(0x6d)](_0x2a5b3c)[_0x51d131(0x97)]>0x0&&(_0x22a474['headers']=_0x2a5b3c);if(_0x27f90f[_0x51d131(0x85)]){const _0x41a506=resolveSite(_0x27f90f['site']),_0x2c0c5f=getEndpoint(_0x41a506,_0x382a8d),_0x3c2fb9=''+_0x2c0c5f+_0x39b456;console['error']('>\x20'+_0x2581f3+'\x20'+_0x3c2fb9);const _0x56c841=getAuthHeaders(_0x41a506),_0x4bc70c={..._0x56c841,..._0x2a5b3c};for(const [_0x22acdc,_0x56e365]of Object[_0x51d131(0x7a)](_0x4bc70c)){!isSensitiveHeader(_0x22acdc)&&console['error']('>\x20'+_0x22acdc+':\x20'+_0x56e365);}_0x5449a1&&console[_0x51d131(0x66)]('>'),console['error']('');}const _0xe5e1bb=await _0x16ff90['api'][_0x51d131(0xa5)](_0x39b456,_0x22a474);if(_0x27f90f['verbose']&&_0xe5e1bb['headers']){console[_0x51d131(0x66)](_0x51d131(0x65)+_0xe5e1bb[_0x51d131(0x74)]);for(const [_0x392679,_0x3cca04]of Object[_0x51d131(0x7a)](_0xe5e1bb[_0x51d131(0x89)])){!isSensitiveHeader(_0x392679)&&console[_0x51d131(0x66)]('<\x20'+_0x392679+':\x20'+_0x3cca04);}console[_0x51d131(0x66)]('');}const _0x2bc282=Boolean(_0x27f90f[_0x51d131(0xa0)]),_0x4ea675={'color':_0x27f90f['color'],'noColor':_0x27f90f[_0x51d131(0x7c)]||_0x2bc282&&!_0x27f90f['color']},_0x519fe4=colorizeJSON(_0xe5e1bb[_0x51d131(0x6a)],_0x4ea675);return _0x27f90f[_0x51d131(0xa0)]?(writeFileSync(_0x27f90f['output'],_0x519fe4),console[_0x51d131(0x66)](_0x51d131(0xa6)+_0x27f90f[_0x51d131(0xa0)])):console[_0x51d131(0x68)](_0x519fe4),0x0;}catch(_0x47da75){return _0x47da75 instanceof Error?(console['error']('Error:\x20'+_0x47da75['message']),_0x27f90f[_0x51d131(0x85)]&&_0x47da75['stack']&&console[_0x51d131(0x66)]('\x0aStack\x20trace:\x0a'+_0x47da75[_0x51d131(0x6f)])):console[_0x51d131(0x66)](_0x51d131(0x8f)+String(_0x47da75)),0x1;}}}
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 +1 @@
1
- const a7_0x41ca4f=a7_0x5aad;(function(_0x535099,_0x503e8e){const _0x49c3f2=a7_0x5aad,_0xd69513=_0x535099();while(!![]){try{const _0x553418=parseInt(_0x49c3f2(0x193))/0x1+parseInt(_0x49c3f2(0x16d))/0x2+-parseInt(_0x49c3f2(0x1cb))/0x3*(-parseInt(_0x49c3f2(0x177))/0x4)+parseInt(_0x49c3f2(0x172))/0x5+parseInt(_0x49c3f2(0x194))/0x6*(-parseInt(_0x49c3f2(0x1c5))/0x7)+-parseInt(_0x49c3f2(0x1b5))/0x8*(parseInt(_0x49c3f2(0x1b9))/0x9)+-parseInt(_0x49c3f2(0x17d))/0xa;if(_0x553418===_0x503e8e)break;else _0xd69513['push'](_0xd69513['shift']());}catch(_0x3e0924){_0xd69513['push'](_0xd69513['shift']());}}}(a7_0x5836,0xdc626));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens,saveOAuthTokens}from'../core/oauth-keychain.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{deleteOAuthTokens}from'../core/oauth-keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';import{startOAuthFlow}from'../core/oauth.js';function a7_0x5aad(_0xd59353,_0x5f43d4){_0xd59353=_0xd59353-0x166;const _0x583670=a7_0x5836();let _0x5aad24=_0x583670[_0xd59353];return _0x5aad24;}import{promptSiteSelection}from'../core/constants.js';import a7_0x44fd47 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_0x26c0eb from'chalk';export async function runOAuthLoginFlow(_0x1f8b18,_0x184dae,_0x24af67,_0x35bd1e){const _0x33cd61=a7_0x5aad,_0x19ce32=await isKeychainAvailable();if(!_0x19ce32)throw new Error(_0x33cd61(0x190)+_0x33cd61(0x191));let _0x2a6ca1=_0x35bd1e?.[_0x33cd61(0x1a8)];if(!_0x2a6ca1){const _0x599144=await a7_0x44fd47({'type':'text','name':_0x33cd61(0x1a8),'message':_0x33cd61(0x18b)});if(_0x599144['accountName']===undefined)throw new Error(_0x33cd61(0x184));_0x2a6ca1=_0x599144[_0x33cd61(0x1a8)][_0x33cd61(0x17c)]()||undefined;}const _0x537ae3=getConsoleUrl(_0x1f8b18);console['log']('Opening\x20browser\x20for\x20authentication...');_0x2a6ca1?console['log']('\x20\x20'+_0x537ae3+'/users/initiate_sso\x20(account:\x20'+_0x2a6ca1+')'):console[_0x33cd61(0x176)]('\x20\x20'+_0x537ae3+_0x33cd61(0x1b7));console[_0x33cd61(0x176)]('Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...');const _0xda4455=await startOAuthFlow(_0x1f8b18,{'accountName':_0x2a6ca1});console[_0x33cd61(0x176)](_0x33cd61(0x187));const _0x29911d=TDX['create']({'site':_0x1f8b18,'accessToken':_0xda4455[_0x33cd61(0x1ad)],'logLevel':_0x24af67??LogLevel[_0x33cd61(0x199)]}),_0x5c1942=await _0x29911d['jobs']['getUserInfo']();console['log'](a7_0x26c0eb[_0x33cd61(0x197)](_0x33cd61(0x1a5))),console[_0x33cd61(0x176)]('\x20\x20'+a7_0x26c0eb[_0x33cd61(0x19c)](_0x1f8b18+':'+_0x5c1942[_0x33cd61(0x1af)])+_0x33cd61(0x17a)+_0x5c1942['id']+_0x33cd61(0x181)+_0x5c1942[_0x33cd61(0x185)]+')');!_0x2a6ca1&&(console[_0x33cd61(0x176)](a7_0x26c0eb[_0x33cd61(0x16b)]('\x20\x20If\x20this\x20is\x20not\x20the\x20expected\x20account:')),console[_0x33cd61(0x176)](a7_0x26c0eb[_0x33cd61(0x16b)](_0x33cd61(0x1c7))),console[_0x33cd61(0x176)](a7_0x26c0eb[_0x33cd61(0x16b)](_0x33cd61(0x19d))));await saveOAuthTokens(_0xda4455,_0x184dae),console[_0x33cd61(0x176)]('✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain'+(_0x184dae?_0x33cd61(0x1bc)+_0x184dae+')':''));if(_0x184dae){const _0x2d5f70={'site':_0x1f8b18};saveProfileToUserConfig(_0x184dae,_0x2d5f70),console[_0x33cd61(0x176)]('✓\x20Profile\x20\x27'+_0x184dae+_0x33cd61(0x1b4));}else saveDefaultSiteToUserConfig(_0x1f8b18),console[_0x33cd61(0x176)](_0x33cd61(0x195)+_0x1f8b18);const _0x2dbbab=_0x184dae?_0x33cd61(0x1a3)+_0x184dae:'';console['log'](),console[_0x33cd61(0x176)]('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console[_0x33cd61(0x176)]('\x20\x20tdx'+_0x2dbbab+_0x33cd61(0x1ae)),console[_0x33cd61(0x176)](_0x33cd61(0x19e)+_0x2dbbab+_0x33cd61(0x167));}export async function promptAuthMethod(){const _0x358997=a7_0x5aad,_0x2969fe=await a7_0x44fd47({'type':_0x358997(0x1a6),'name':_0x358997(0x1ac),'message':_0x358997(0x16c),'choices':[{'title':_0x358997(0x1ca),'description':_0x358997(0x198),'value':_0x358997(0x1c3)},{'title':'Use\x20an\x20API\x20key','description':_0x358997(0x18c),'value':_0x358997(0x19b)}]});return _0x2969fe[_0x358997(0x1ac)]||null;}export class AuthSetupCommand extends BaseCommand{['name']=a7_0x41ca4f(0x183);[a7_0x41ca4f(0x1a9)]=a7_0x41ca4f(0x1a2);async[a7_0x41ca4f(0x1ba)](_0x226ca4){const _0x47a991=a7_0x41ca4f,{options:_0x2d6466}=_0x226ca4,_0xe79db6=_0x2d6466[_0x47a991(0x175)];console[_0x47a991(0x176)](a7_0x26c0eb[_0x47a991(0x166)](_0x47a991(0x170)));const _0x4b762f=_0x2d6466[_0x47a991(0x1a7)]||_0x47a991(0x17e),_0x3c41df=await promptSiteSelection(_0x4b762f,_0xe79db6,_0x47a991(0x184));if(!_0x3c41df)return 0x1;const _0x1c9426=resolveSite(_0x3c41df),_0x10704d=await promptAuthMethod();if(!_0x10704d)return console[_0x47a991(0x176)](_0x47a991(0x19f)),0x1;if(_0x10704d==='oauth'){const {accountName:_0x1ee35f}=_0x2d6466;return await runOAuthLoginFlow(_0x1c9426,_0xe79db6,_0x2d6466['logLevel']??LogLevel[_0x47a991(0x199)],{'accountName':_0x1ee35f}),0x0;}console[_0x47a991(0x176)](_0x47a991(0x1c1)+_0x1c9426),console[_0x47a991(0x176)](_0x47a991(0x1bd)),console[_0x47a991(0x176)]('\x20\x20'+getConsoleUrl(_0x1c9426,_0x47a991(0x189)));const _0x467eca=await a7_0x44fd47({'type':_0x47a991(0x1a1),'name':_0x47a991(0x19a),'message':_0x47a991(0x188),'validate':_0x23f658=>{const _0x3fc122=_0x47a991;if(!_0x23f658||!_0x23f658[_0x3fc122(0x17c)]())return _0x3fc122(0x1a0);return!![];}});if(!_0x467eca[_0x47a991(0x19a)])return console['log']('\x0aSetup\x20cancelled'),0x1;const _0x1b7268=_0x467eca[_0x47a991(0x19a)];console[_0x47a991(0x176)](_0x47a991(0x1c4));try{const _0x36d3a1=TDX[_0x47a991(0x18d)]({'site':_0x1c9426,'apiKey':_0x1b7268['trim'](),'logLevel':_0x2d6466[_0x47a991(0x16a)]??LogLevel['ERROR']}),_0x52cee5=await _0x36d3a1[_0x47a991(0x1b1)][_0x47a991(0x178)]();console['log'](_0x47a991(0x18a)+_0x52cee5[_0x47a991(0x185)]+')');const _0x21c1e5=await isKeychainAvailable();_0x21c1e5?(await saveAPIKeyAsync(_0x1b7268[_0x47a991(0x17c)](),_0x1c9426,_0xe79db6),console['log']('✓\x20API\x20key\x20saved\x20to\x20system\x20keychain'+(_0xe79db6?_0x47a991(0x1bc)+_0xe79db6+')':''))):(console['warn'](a7_0x26c0eb[_0x47a991(0x180)](_0x47a991(0x1be))),console[_0x47a991(0x1ab)](a7_0x26c0eb[_0x47a991(0x180)](_0x47a991(0x182))));if(_0xe79db6){const _0x589abf={'site':_0x1c9426};saveProfileToUserConfig(_0xe79db6,_0x589abf),console[_0x47a991(0x176)](_0x47a991(0x168)+_0xe79db6+'\x27\x20registered');}else saveDefaultSiteToUserConfig(_0x1c9426),console[_0x47a991(0x176)](_0x47a991(0x195)+_0x1c9426);const _0xfd24f9=_0xe79db6?_0x47a991(0x1a3)+_0xe79db6:'';return console[_0x47a991(0x176)](),console[_0x47a991(0x176)]('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console[_0x47a991(0x176)]('\x20\x20tdx'+_0xfd24f9+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console[_0x47a991(0x176)](_0x47a991(0x19e)+_0xfd24f9+_0x47a991(0x167)),0x0;}catch(_0x61cfd6){if(_0x61cfd6 instanceof HTTPClientError&&_0x61cfd6[_0x47a991(0x1c2)]===0x191)return printAuthError(_0x61cfd6),0x1;return console['error'](a7_0x26c0eb[_0x47a991(0x1b0)]('✗\x20Validation\x20failed:\x20'+(_0x61cfd6 instanceof Error?_0x61cfd6[_0x47a991(0x1c9)]:String(_0x61cfd6)))),console[_0x47a991(0x1aa)](_0x47a991(0x179)),0x1;}}}function a7_0x5836(){const _0x58541d=['dim','Choose\x20how\x20to\x20sign\x20in:','2793212KkhXUu','join','first_name','tdx:\x20auth\x20setup','\x20and\x20','3885525JWaOkw','Remove\x20API\x20key\x20from\x20system\x20keychain','auth:clear','profile','log','385156JiWrEM','getUserInfo','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','\x20\x20user_id:','✓\x20Authentication\x20successful\x0a','trim','4758910XMEvzc','us01','\x20removed\x20from\x20keychain','yellow','\x20\x20(','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','auth:setup','Setup\x20cancelled','email','API\x20key','Validating\x20OAuth\x20tokens...','Enter\x20your\x20TD\x20API\x20key:','/app/mp/ak','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','Account\x20name\x20for\x20SSO\x20(press\x20Enter\x20to\x20skip):','For\x20scripts\x20or\x20headless\x20servers','create','No\x20credential\x20found','N/A','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','last_name','334389puGZOT','6pSuBuE','✓\x20Default\x20site\x20set\x20to\x20','auth','green','Opens\x20your\x20browser\x20to\x20sign\x20in\x20with\x20SSO','ERROR','apiKey','apikey','cyan','\x20\x20\x20\x202.\x20Or\x20use\x20a\x20different\x20browser\x20profile\x20to\x20avoid\x20cached\x20sessions','\x20\x20tdx','\x0aSetup\x20cancelled','API\x20key\x20cannot\x20be\x20empty','password','Setup\x20API\x20key\x20authentication\x20interactively','\x20--profile\x20','✗\x20Validation\x20failed:\x20','✓\x20Signed\x20in\x20successfully','select','site','accountName','description','error','warn','method','access_token','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','account_id','red','jobs','\x20(site:\x20','No\x20credentials\x20found\x20in\x20keychain','\x27\x20registered','1368aLmylE','name','/oauth/authorize','filter','74871qZRULp','execute','OAuth\x20tokens','\x20(profile:\x20','You\x20can\x20find\x20your\x20API\x20key\x20at:','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','Read\x20credential\x20from\x20keychain','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','Setting\x20up\x20authentication\x20for\x20site:\x20','status','oauth','Validating\x20API\x20key...','6711061ZAGxXO','tdx:\x20auth\x20clear','\x20\x20\x20\x201.\x20Run:\x20tdx\x20auth\x20setup\x20--account-name\x20<name>','Read\x20credential\x20from\x20','message','Sign\x20in\x20with\x20browser\x20(recommended)','39xNPTLR','bold','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','✓\x20Profile\x20\x27','tdx\x20profile:\x20','logLevel'];a7_0x5836=function(){return _0x58541d;};return a7_0x5836();}export class AuthStatusCommand extends BaseCommand{['name']=a7_0x41ca4f(0x196);[a7_0x41ca4f(0x1a9)]=a7_0x41ca4f(0x1c0);async[a7_0x41ca4f(0x1ba)](_0x4b7f81){const _0x5a5792=a7_0x41ca4f,{options:_0x2f27d8,tdx:_0x541cee}=_0x4b7f81,_0x183f37=_0x2f27d8[_0x5a5792(0x1a7)],_0x4fb948=_0x2f27d8[_0x5a5792(0x175)],_0x2097a3=_0x4fb948?_0x4fb948:_0x5a5792(0x18f);console[_0x5a5792(0x176)](_0x5a5792(0x169)+_0x2097a3+_0x5a5792(0x1b2)+_0x183f37+')');const _0x3d9696=await getOAuthTokens(_0x4fb948);if(_0x3d9696)console[_0x5a5792(0x176)]('Credential\x20type:\x20OAuth'),console[_0x5a5792(0x176)](_0x5a5792(0x1bf)+(_0x4fb948?_0x5a5792(0x1bc)+_0x4fb948+')':''));else{const _0x3c8288=await resolveAPIKeyAsync(_0x183f37,_0x4fb948);if(_0x3c8288){const {source:_0x19d621,isDeprecated:_0x20c80c}=_0x3c8288,_0x5363b2=_0x5a5792(0x1c8)+_0x19d621;console[_0x5a5792(0x176)](_0x20c80c?a7_0x26c0eb['yellow'](_0x5363b2):_0x5363b2);}else console[_0x5a5792(0x176)](a7_0x26c0eb[_0x5a5792(0x180)](_0x5a5792(0x18e)));}try{const _0x337720=await _0x541cee[_0x5a5792(0x1b1)][_0x5a5792(0x178)]();return console[_0x5a5792(0x176)](a7_0x26c0eb[_0x5a5792(0x197)](_0x5a5792(0x17b))),console['log']('User:\x20'+_0x337720[_0x5a5792(0x185)]),(_0x337720[_0x5a5792(0x16f)]||_0x337720[_0x5a5792(0x192)])&&console[_0x5a5792(0x176)]('Name:\x20'+[_0x337720[_0x5a5792(0x16f)],_0x337720[_0x5a5792(0x192)]][_0x5a5792(0x1b8)](Boolean)[_0x5a5792(0x16e)]('\x20')),0x0;}catch(_0x4f491a){return _0x4f491a instanceof HTTPClientError&&_0x4f491a[_0x5a5792(0x1c2)]===0x191?printAuthError(_0x4f491a,!![],_0x4fb948):console[_0x5a5792(0x1aa)](a7_0x26c0eb[_0x5a5792(0x1b0)](_0x5a5792(0x1a4)+(_0x4f491a instanceof Error?_0x4f491a[_0x5a5792(0x1c9)]:String(_0x4f491a)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x41ca4f(0x1b6)]=a7_0x41ca4f(0x174);['description']=a7_0x41ca4f(0x173);async[a7_0x41ca4f(0x1ba)](_0x397931){const _0x5af5a4=a7_0x41ca4f,{options:_0x5da7d9}=_0x397931,_0x36bb95=_0x5da7d9[_0x5af5a4(0x175)];console['log'](a7_0x26c0eb['bold'](_0x5af5a4(0x1c6)));const _0x10929b=await isKeychainAvailable();if(!_0x10929b)return console[_0x5af5a4(0x1aa)](a7_0x26c0eb['red']('System\x20keychain\x20is\x20not\x20available')),0x1;const [_0x561c8d,_0x1cfb81]=await Promise['all']([deleteKeychainAPIKey(_0x36bb95),deleteOAuthTokens(_0x36bb95)]);if(_0x561c8d||_0x1cfb81){clearCredentialCache();const _0x2d534f=[_0x561c8d&&_0x5af5a4(0x186),_0x1cfb81&&_0x5af5a4(0x1bb)][_0x5af5a4(0x1b8)](Boolean)[_0x5af5a4(0x16e)](_0x5af5a4(0x171));return console[_0x5af5a4(0x176)]('✓\x20'+_0x2d534f+_0x5af5a4(0x17f)+(_0x36bb95?_0x5af5a4(0x1bc)+_0x36bb95+')':'')),0x0;}else return console[_0x5af5a4(0x176)](_0x5af5a4(0x1b3)+(_0x36bb95?'\x20for\x20profile:\x20'+_0x36bb95:'')),0x1;}}
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;}}