@treasuredata/tdx 0.29.0 → 0.29.2

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 (239) 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.d.ts.map +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/cli.js.map +1 -1
  7. package/dist/commands/activations.js +1 -1
  8. package/dist/commands/agent-command.js +1 -1
  9. package/dist/commands/agent-test-command.js +1 -1
  10. package/dist/commands/api-command.js +1 -1
  11. package/dist/commands/auth-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/job-command.js +1 -1
  26. package/dist/commands/journey-command.js +1 -1
  27. package/dist/commands/journey-validate-command.js +1 -1
  28. package/dist/commands/llm-command.js +1 -1
  29. package/dist/commands/mcp-command.js +1 -1
  30. package/dist/commands/parent-segment-command.js +1 -1
  31. package/dist/commands/profile-command.js +1 -1
  32. package/dist/commands/profiles-command.js +1 -1
  33. package/dist/commands/query-command.js +1 -1
  34. package/dist/commands/schedule-command.js +1 -1
  35. package/dist/commands/segment-command.d.ts +8 -0
  36. package/dist/commands/segment-command.d.ts.map +1 -1
  37. package/dist/commands/segment-command.js +1 -1
  38. package/dist/commands/segment-command.js.map +1 -1
  39. package/dist/commands/segment-create-command.js +1 -1
  40. package/dist/commands/segment-fields-command.js +1 -1
  41. package/dist/commands/segment-pull-command.js +1 -1
  42. package/dist/commands/segment-push-command.js +1 -1
  43. package/dist/commands/segment-update-command.js +1 -1
  44. package/dist/commands/segment-use-command.js +1 -1
  45. package/dist/commands/segment-validate-command.js +1 -1
  46. package/dist/commands/segments.js +1 -1
  47. package/dist/commands/show.js +1 -1
  48. package/dist/commands/status-command.js +1 -1
  49. package/dist/commands/tables.js +1 -1
  50. package/dist/commands/unset-command.js +1 -1
  51. package/dist/commands/upgrade-command.js +1 -1
  52. package/dist/commands/use-command.js +1 -1
  53. package/dist/commands/user-command.js +1 -1
  54. package/dist/commands/workflow-command.js +1 -1
  55. package/dist/core/auth.d.ts +2 -2
  56. package/dist/core/auth.js +1 -1
  57. package/dist/core/command-output.js +1 -1
  58. package/dist/core/config.js +1 -1
  59. package/dist/core/connection-cache.js +1 -1
  60. package/dist/core/constants.js +1 -1
  61. package/dist/core/credential-cache.js +1 -1
  62. package/dist/core/global-context.js +1 -1
  63. package/dist/core/keychain.js +1 -1
  64. package/dist/core/profile.js +1 -1
  65. package/dist/core/project-config.js +1 -1
  66. package/dist/core/session.js +1 -1
  67. package/dist/core/user-cache.js +1 -1
  68. package/dist/core/version.js +1 -1
  69. package/dist/index.js +1 -1
  70. package/dist/mcp/server.js +1 -1
  71. package/dist/mcp/tools/index.js +1 -1
  72. package/dist/mcp/tools/tdx-run.js +1 -1
  73. package/dist/mcp/tools/tdx-search.js +1 -1
  74. package/dist/mcp/utils.js +1 -1
  75. package/dist/proxy/claude-usage-tracker.js +1 -1
  76. package/dist/proxy/passthrough-server.js +1 -1
  77. package/dist/proxy/sse-usage-parser.js +1 -1
  78. package/dist/sdk/agent/agent-config.js +1 -1
  79. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  80. package/dist/sdk/agent/agent-yaml.js +1 -1
  81. package/dist/sdk/agent/test/evaluator.js +1 -1
  82. package/dist/sdk/agent/test/executor.js +1 -1
  83. package/dist/sdk/agent/test/index.js +1 -1
  84. package/dist/sdk/agent/test/output.js +1 -1
  85. package/dist/sdk/agent/test/parser.js +1 -1
  86. package/dist/sdk/agent/tool-target-registry.js +1 -1
  87. package/dist/sdk/api.js +1 -1
  88. package/dist/sdk/client/cdp-api-client.d.ts +15 -0
  89. package/dist/sdk/client/cdp-api-client.d.ts.map +1 -1
  90. package/dist/sdk/client/cdp-api-client.js +1 -1
  91. package/dist/sdk/client/cdp-api-client.js.map +1 -1
  92. package/dist/sdk/client/delivery-api-client.js +1 -1
  93. package/dist/sdk/client/endpoints.d.ts +5 -5
  94. package/dist/sdk/client/endpoints.js +1 -1
  95. package/dist/sdk/client/engage-api-client.js +1 -1
  96. package/dist/sdk/client/http-client.js +1 -1
  97. package/dist/sdk/client/llm-api-client.js +1 -1
  98. package/dist/sdk/client/rate-limiter.js +1 -1
  99. package/dist/sdk/client/td-api-client.js +1 -1
  100. package/dist/sdk/client/trino-api-client.js +1 -1
  101. package/dist/sdk/client/workflow-client.js +1 -1
  102. package/dist/sdk/connection-validator.js +1 -1
  103. package/dist/sdk/connection.js +1 -1
  104. package/dist/sdk/delivery.js +1 -1
  105. package/dist/sdk/engage/campaign-pull.js +1 -1
  106. package/dist/sdk/engage/campaign-push.js +1 -1
  107. package/dist/sdk/engage/campaign-validator.js +1 -1
  108. package/dist/sdk/engage/campaign-yaml.js +1 -1
  109. package/dist/sdk/engage/types/campaign-def.js +1 -1
  110. package/dist/sdk/engage/types/campaign-schema.d.ts +1 -2
  111. package/dist/sdk/engage/types/campaign-schema.d.ts.map +1 -1
  112. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  113. package/dist/sdk/engage/types/campaign-schema.js.map +1 -1
  114. package/dist/sdk/engage.js +1 -1
  115. package/dist/sdk/errors.js +1 -1
  116. package/dist/sdk/index.d.ts +2 -2
  117. package/dist/sdk/index.d.ts.map +1 -1
  118. package/dist/sdk/index.js +1 -1
  119. package/dist/sdk/index.js.map +1 -1
  120. package/dist/sdk/io/index.js +1 -1
  121. package/dist/sdk/io/node-filesystem.js +1 -1
  122. package/dist/sdk/job.js +1 -1
  123. package/dist/sdk/journey.js +1 -1
  124. package/dist/sdk/llm/chat-cache.js +1 -1
  125. package/dist/sdk/llm/index.js +1 -1
  126. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  127. package/dist/sdk/llm/model-factors.js +1 -1
  128. package/dist/sdk/personalization.js +1 -1
  129. package/dist/sdk/query/index.js +1 -1
  130. package/dist/sdk/query/sql-parser.js +1 -1
  131. package/dist/sdk/realtime.js +1 -1
  132. package/dist/sdk/schedule.js +1 -1
  133. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  134. package/dist/sdk/segment/fields-display.js +1 -1
  135. package/dist/sdk/segment/file-discovery.js +1 -1
  136. package/dist/sdk/segment/journey-utils.js +1 -1
  137. package/dist/sdk/segment/journey-validator.d.ts +13 -6
  138. package/dist/sdk/segment/journey-validator.d.ts.map +1 -1
  139. package/dist/sdk/segment/journey-validator.js +1 -1
  140. package/dist/sdk/segment/journey-validator.js.map +1 -1
  141. package/dist/sdk/segment/journey-yaml.d.ts.map +1 -1
  142. package/dist/sdk/segment/journey-yaml.js +1 -1
  143. package/dist/sdk/segment/journey-yaml.js.map +1 -1
  144. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  145. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  146. package/dist/sdk/segment/pull-workflow.js +1 -1
  147. package/dist/sdk/segment/push-recovery.js +1 -1
  148. package/dist/sdk/segment/push-workflow.js +1 -1
  149. package/dist/sdk/segment/push-workflow.js.map +1 -1
  150. package/dist/sdk/segment/resolution-context.js +1 -1
  151. package/dist/sdk/segment/segment-path-parser.d.ts +2 -0
  152. package/dist/sdk/segment/segment-path-parser.d.ts.map +1 -1
  153. package/dist/sdk/segment/segment-path-parser.js +1 -1
  154. package/dist/sdk/segment/segment-path-parser.js.map +1 -1
  155. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  156. package/dist/sdk/segment/segment-validator.d.ts.map +1 -1
  157. package/dist/sdk/segment/segment-validator.js +1 -1
  158. package/dist/sdk/segment/segment-validator.js.map +1 -1
  159. package/dist/sdk/segment/target-resolution.js +1 -1
  160. package/dist/sdk/segment/tdx-config.js +1 -1
  161. package/dist/sdk/segment/types/activation-schema.d.ts +184 -0
  162. package/dist/sdk/segment/types/activation-schema.d.ts.map +1 -0
  163. package/dist/sdk/segment/types/activation-schema.js +1 -0
  164. package/dist/sdk/segment/types/activation-schema.js.map +1 -0
  165. package/dist/sdk/segment/types/journey-def.d.ts +5 -0
  166. package/dist/sdk/segment/types/journey-def.d.ts.map +1 -1
  167. package/dist/sdk/segment/types/journey-def.js +1 -1
  168. package/dist/sdk/segment/types/journey-def.js.map +1 -1
  169. package/dist/sdk/segment/types/journey-schema.d.ts +419 -0
  170. package/dist/sdk/segment/types/journey-schema.d.ts.map +1 -0
  171. package/dist/sdk/segment/types/journey-schema.js +1 -0
  172. package/dist/sdk/segment/types/journey-schema.js.map +1 -0
  173. package/dist/sdk/segment/types/segment-def.d.ts +4 -87
  174. package/dist/sdk/segment/types/segment-def.d.ts.map +1 -1
  175. package/dist/sdk/segment/types/segment-def.js +1 -1
  176. package/dist/sdk/segment/types/segment-def.js.map +1 -1
  177. package/dist/sdk/segment/types/segment-schema.js +1 -1
  178. package/dist/sdk/segment/validate-files.js +1 -1
  179. package/dist/sdk/segment/validate-files.js.map +1 -1
  180. package/dist/sdk/segment/yaml-validator.d.ts +14 -1
  181. package/dist/sdk/segment/yaml-validator.d.ts.map +1 -1
  182. package/dist/sdk/segment/yaml-validator.js +1 -1
  183. package/dist/sdk/segment/yaml-validator.js.map +1 -1
  184. package/dist/sdk/segment.d.ts +20 -1
  185. package/dist/sdk/segment.d.ts.map +1 -1
  186. package/dist/sdk/segment.js +1 -1
  187. package/dist/sdk/segment.js.map +1 -1
  188. package/dist/sdk/types/cdp.d.ts +3 -3
  189. package/dist/sdk/types/cdp.d.ts.map +1 -1
  190. package/dist/sdk/types/index.d.ts +3 -3
  191. package/dist/sdk/types/index.d.ts.map +1 -1
  192. package/dist/sdk/types/index.js +1 -1
  193. package/dist/sdk/types/index.js.map +1 -1
  194. package/dist/sdk/types/progress.js +1 -1
  195. package/dist/sdk/user.js +1 -1
  196. package/dist/sdk/util/format-detector.js +1 -1
  197. package/dist/sdk/util/formatters.js +1 -1
  198. package/dist/sdk/util/index.js +1 -1
  199. package/dist/sdk/util/tree-formatter.js +1 -1
  200. package/dist/sdk/workflow/archive-validation.js +1 -1
  201. package/dist/sdk/workflow/clone-workflow.js +1 -1
  202. package/dist/sdk/workflow/index.js +1 -1
  203. package/dist/sdk/workflow/pull-workflow.js +1 -1
  204. package/dist/sdk/workflow/push-workflow.js +1 -1
  205. package/dist/sdk/workflow/tdx-config.js +1 -1
  206. package/dist/sdk/workflow/workflow-utils.js +1 -1
  207. package/dist/test-utils/command-runner.js +1 -1
  208. package/dist/test-utils/factories.d.ts +1 -1
  209. package/dist/test-utils/factories.js +1 -1
  210. package/dist/test-utils/fixtures.js +1 -1
  211. package/dist/test-utils/http-mock.js +1 -1
  212. package/dist/test-utils/index.js +1 -1
  213. package/dist/utils/async.js +1 -1
  214. package/dist/utils/colors.js +1 -1
  215. package/dist/utils/diff.js +1 -1
  216. package/dist/utils/file-permissions.js +1 -1
  217. package/dist/utils/file-reader.js +1 -1
  218. package/dist/utils/global-cache.js +1 -1
  219. package/dist/utils/json-loader.js +1 -1
  220. package/dist/utils/local-cache.js +1 -1
  221. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  222. package/dist/utils/logger/formatters/index.js +1 -1
  223. package/dist/utils/logger/handlers/console-handler.js +1 -1
  224. package/dist/utils/logger/handlers/file-handler.js +1 -1
  225. package/dist/utils/logger/handlers/index.js +1 -1
  226. package/dist/utils/logger/handlers/null-handler.js +1 -1
  227. package/dist/utils/logger/index.js +1 -1
  228. package/dist/utils/logger/logger.js +1 -1
  229. package/dist/utils/logger/types.js +1 -1
  230. package/dist/utils/option-validation.js +1 -1
  231. package/dist/utils/process.js +1 -1
  232. package/dist/utils/prompt.js +1 -1
  233. package/dist/utils/spinner.js +1 -1
  234. package/dist/utils/sse-parser.js +1 -1
  235. package/dist/utils/string-utils.js +1 -1
  236. package/dist/utils/table-ref-parser.js +1 -1
  237. package/dist/utils/tdx-logger.js +1 -1
  238. package/dist/utils/version-check.js +1 -1
  239. package/package.json +1 -1
@@ -1 +1 @@
1
- const a4_0x80e2a5=a4_0x27f9;(function(_0x5992e3,_0x40fbce){const _0x584ae0=a4_0x27f9,_0x2006ef=_0x5992e3();while(!![]){try{const _0x4aa4ec=parseInt(_0x584ae0(0x9c))/0x1+-parseInt(_0x584ae0(0x98))/0x2+-parseInt(_0x584ae0(0xc0))/0x3+-parseInt(_0x584ae0(0x74))/0x4+-parseInt(_0x584ae0(0xda))/0x5+parseInt(_0x584ae0(0xcc))/0x6+parseInt(_0x584ae0(0xbe))/0x7;if(_0x4aa4ec===_0x40fbce)break;else _0x2006ef['push'](_0x2006ef['shift']());}catch(_0x29a9f5){_0x2006ef['push'](_0x2006ef['shift']());}}}(a4_0x50d2,0x83db1));import a4_0x2e9eea from'chalk';import a4_0x53f2df from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';function a4_0x27f9(_0x3468ed,_0x4b7a6d){_0x3468ed=_0x3468ed-0x72;const _0x50d2e7=a4_0x50d2();let _0x27f99d=_0x50d2e7[_0x3468ed];return _0x27f99d;}import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext,resolveAgentPullArgs}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x550d35){const _0x1a250e=a4_0x27f9,_0x1e915e=[];if(_0x550d35['total']!==undefined)_0x1e915e['push'](_0x550d35['total']+'\x20total');if(_0x550d35[_0x1a250e(0xf0)]!==undefined&&_0x550d35[_0x1a250e(0xf0)]>0x0)_0x1e915e[_0x1a250e(0x102)](a4_0x2e9eea[_0x1a250e(0x109)](_0x550d35[_0x1a250e(0xf0)]+_0x1a250e(0xe4)));if(_0x550d35[_0x1a250e(0xc9)]!==undefined&&_0x550d35['created']>0x0)_0x1e915e[_0x1a250e(0x102)](a4_0x2e9eea[_0x1a250e(0x109)](_0x550d35[_0x1a250e(0xc9)]+'\x20created'));if(_0x550d35[_0x1a250e(0x106)]!==undefined&&_0x550d35[_0x1a250e(0x106)]>0x0)_0x1e915e[_0x1a250e(0x102)](a4_0x2e9eea[_0x1a250e(0x9d)](_0x550d35[_0x1a250e(0x106)]+_0x1a250e(0x100)));if(_0x550d35[_0x1a250e(0x119)]!==undefined&&_0x550d35[_0x1a250e(0x119)]>0x0)_0x1e915e['push'](a4_0x2e9eea['gray'](_0x550d35[_0x1a250e(0x119)]+'\x20unchanged'));if(_0x550d35[_0x1a250e(0x108)]!==undefined&&_0x550d35[_0x1a250e(0x108)]>0x0)_0x1e915e[_0x1a250e(0x102)](a4_0x2e9eea[_0x1a250e(0x11d)](_0x550d35['errors']+_0x1a250e(0x80)));return _0x1e915e[_0x1a250e(0xc2)](',\x20');}function displayDiffs(_0x1e64a7,_0x4e8bb9,_0xe5318a,_0x1f7e4d,_0x51d6b5,_0x40448,_0x10d85b){const _0x380cbd=a4_0x27f9;for(const _0x19a1af of _0x1e64a7){if(_0x19a1af[_0x380cbd(0x123)]){const _0x2391bd=_0x19a1af[_0x380cbd(0xb3)]||_0x19a1af[_0x380cbd(0xba)];console['log']('\x0aChanges\x20to\x20agent\x20\x27'+_0x2391bd+'\x27:'),console[_0x380cbd(0x105)]('─'[_0x380cbd(0xe6)](0x3c)),console[_0x380cbd(0x105)](_0x19a1af['diff']),console[_0x380cbd(0x105)]('─'[_0x380cbd(0xe6)](0x3c));}}for(const _0x47cdbe of _0x4e8bb9){_0x47cdbe[_0x380cbd(0x123)]&&(console[_0x380cbd(0x105)](_0x380cbd(0x94)+_0x47cdbe[_0x380cbd(0xba)]+'\x27:'),console['log']('─'[_0x380cbd(0xe6)](0x3c)),console[_0x380cbd(0x105)](_0x47cdbe[_0x380cbd(0x123)]),console['log']('─'[_0x380cbd(0xe6)](0x3c)));}for(const _0x47af9b of _0xe5318a){_0x47af9b[_0x380cbd(0x123)]&&(console['log'](_0x380cbd(0x78)+_0x47af9b[_0x380cbd(0xba)]+'\x27:'),console[_0x380cbd(0x105)]('─'[_0x380cbd(0xe6)](0x3c)),console[_0x380cbd(0x105)](_0x47af9b[_0x380cbd(0x123)]),console['log']('─'['repeat'](0x3c)));}for(const _0xd673a8 of _0x1f7e4d){_0xd673a8['diff']&&(console[_0x380cbd(0x105)](_0x380cbd(0x8c)+_0xd673a8[_0x380cbd(0xba)]+'\x27:'),console[_0x380cbd(0x105)]('─'[_0x380cbd(0xe6)](0x3c)),console[_0x380cbd(0x105)](_0xd673a8[_0x380cbd(0x123)]),console[_0x380cbd(0x105)]('─'[_0x380cbd(0xe6)](0x3c)));}for(const _0x1681bb of _0x51d6b5){_0x1681bb[_0x380cbd(0x123)]&&(console[_0x380cbd(0x105)](_0x380cbd(0x72)+_0x1681bb[_0x380cbd(0xba)]+'\x27:'),console[_0x380cbd(0x105)]('─'[_0x380cbd(0xe6)](0x3c)),console[_0x380cbd(0x105)](_0x1681bb['diff']),console['log']('─'[_0x380cbd(0xe6)](0x3c)));}for(const _0x47d0c6 of _0x40448){_0x47d0c6[_0x380cbd(0x123)]&&(console[_0x380cbd(0x105)](_0x380cbd(0xfa)+_0x47d0c6[_0x380cbd(0xba)]+'\x27:'),console[_0x380cbd(0x105)]('─'['repeat'](0x3c)),console[_0x380cbd(0x105)](_0x47d0c6[_0x380cbd(0x123)]),console[_0x380cbd(0x105)]('─'[_0x380cbd(0xe6)](0x3c)));}for(const _0x15301c of _0x10d85b){_0x15301c[_0x380cbd(0x123)]&&(console[_0x380cbd(0x105)](_0x380cbd(0xf9)+_0x15301c[_0x380cbd(0xba)]+'\x27:'),console[_0x380cbd(0x105)]('─'['repeat'](0x3c)),console[_0x380cbd(0x105)](_0x15301c['diff']),console['log']('─'['repeat'](0x3c)));}}function a4_0x50d2(){const _0x3239d0=['found','dirname','reason','yes','\x20errors','newProjectId','llmProject','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','Agent:\x20','Using\x20project\x20from\x20context:\x20','sourceProjectName','outputDir','site','New\x20project\x20name\x20is\x20required','Using\x20local\x20project:\x20','\x20=\x20','\x0aChanges\x20to\x20prompt\x20\x27','\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','\x0aPush\x20summary\x20for\x20\x27','No\x20tdx.json\x20found\x20in\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','pullAgent','\x20\x20Text\x20Knowledge\x20Bases:\x20','\x22...','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','cwd','Using\x20project:\x20','integrations','1959492ZNibhA','\x0a✔\x20Pushed\x20','agent:clone','\x20--profile\x20','778352nAqOXJ','yellow','prompts','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','experimentalKnowledgeBases','agents','\x20\x20Experimental\x20Artifacts:\x20','\x22\x20to\x20\x22','\x20\x20Knowledge\x20Base\x20\x22','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','projectDir','Errors:','-\x20nothing\x20pushed','no_local_folder','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','\x20|\x20','\x0aError:','cyan','\x20changed','Dry\x20run\x20-\x20no\x20changes\x20made','execute','llm_project','\x0aPush\x20','agentName','✔\x20Context\x20set:\x20','llm','pullProject','\x20\x20Agents:\x20','projectName','Project\x20cloned\x20successfully','name','dryRun','Clone\x20\x22','Project\x20cloned\x20with\x20errors','18471810kSXBEa','\x20\x20tdx\x20agent\x20pull\x20','2244024bYwgoS','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','join','newProjectName','description','\x0a✔\x20Pulled\x20','no_context','dim','Using\x20context\x20project:\x20','created','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','Pulling\x20agent\x20\x22','1371966ySAWTK','Cancelled','outputPath','New\x20project:\x20','\x20resources\x20to\x20\x27','output','\x20\x20Prompts:\x20','parse','cloneProject','Agent\x20pulled\x20successfully','knowledgeBases','Project:\x20','Would\x20clone:','error','2240135RTUiWm','total','isNew','agentId','Analyzing\x20project\x20\x22','\x0aWrite\x20','\x20successfully','tdx.json','textKnowledgeBases','agent:pull','\x20new','profile','repeat','Status:\x20','agent.yml','Chat:\x20','\x20files\x20to\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)','\x20\x20Integrations:\x20','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','INVALID_ARGUMENT','new','agent','\x20\x20Agent\x20\x22','\x20unchanged','arg-dir','counts','\x22\x20from\x20project\x20\x22','\x20\x20Knowledge\x20Bases:\x20','<new-name>','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','\x20\x20Integration\x20\x22','experimentalArtifacts','Output:\x20','Using\x20project\x20from\x20','Pushing\x20to\x20project...','\x20updated','\x20\x20Target:\x20','push','action','\x20\x20Prompt\x20\x22','log','updated','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)','errors','green','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','Would\x20pull\x20agent:\x20','Pushing\x20agent\x20from\x20\x22','pushProject','Summary:','pushAgent','session','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','Agent\x20','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','\x22\x20to\x20a\x20different\x20profile','Using\x20current\x20project:\x20','projectId','Would\x20push\x20agent:\x20','message','unchanged','\x20resources?','\x20\x20Text\x20Knowledge\x20Base\x20\x22','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','red','Cloning\x20\x22','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','\x20--name\x20','utf-8','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','diff','\x27\x20to\x20create\x20the\x20folder\x20structure.','\x0aChanges\x20to\x20integration\x20\x27','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','3719924GgaQjS','\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','\x0aErrors\x20found:','\x22:\x20','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','hasChanges','Writing\x20files...','\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'];a4_0x50d2=function(){return _0x3239d0;};return a4_0x50d2();}export class AgentPullCommand extends BaseCommand{[a4_0x80e2a5(0xba)]=a4_0x80e2a5(0xe3);[a4_0x80e2a5(0xc4)]='Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files';async[a4_0x80e2a5(0xb0)](_0x3b2e93){const _0xa33dcb=a4_0x80e2a5,{options:_0x39ee11,args:_0x9b17c,tdx:_0x3ed2c1}=_0x3b2e93,_0x158a63=_0x9b17c[0x0],_0x13e67f=_0x9b17c[0x1],_0xf9ab53=_0x39ee11[_0xa33dcb(0xd1)],_0x27a890=_0x39ee11[_0xa33dcb(0xbb)],_0x59a05c=_0x39ee11['force'],_0x247a14=_0x39ee11['yes'],_0x58f437=_0x39ee11[_0xa33dcb(0x82)],_0x1deea6=_0x39ee11[_0xa33dcb(0xf1)];let _0x4a6394;if(_0x158a63){const _0x1f0430=a4_0x53f2df[_0xa33dcb(0xc2)](_0x158a63,_0xa33dcb(0xe1));if(existsSync(_0x1f0430))try{const _0x467d39=JSON[_0xa33dcb(0xd3)](readFileSync(_0x1f0430,_0xa33dcb(0x121)));_0x467d39[_0xa33dcb(0xb1)]&&(_0x4a6394={'llm_project':_0x467d39[_0xa33dcb(0xb1)]});}catch{}}const _0x53e2c2=findAgentConfigPath(process['cwd']());let _0x5e293e;if(_0x53e2c2)try{const _0x4ef0e2=JSON['parse'](readFileSync(_0x53e2c2,_0xa33dcb(0x121)));_0x4ef0e2[_0xa33dcb(0xb1)]&&(_0x5e293e={'llm_project':_0x4ef0e2[_0xa33dcb(0xb1)]});}catch{}const _0x51c9bf=resolveAgentPullArgs({'arg':_0x158a63,'agentNameArg':_0x13e67f,'agentFlag':_0x1deea6,'contextProject':_0x58f437,'argDirConfig':_0x4a6394,'cwdConfigPath':_0x53e2c2||undefined,'cwdConfig':_0x5e293e}),{projectNameOrId:_0xaacbb8,targetAgentName:_0xed6402,existingOutputDir:_0x322795,source:_0x102c22}=_0x51c9bf;if(_0x102c22===_0xa33dcb(0xf4))console[_0xa33dcb(0x105)](a4_0x2e9eea[_0xa33dcb(0xc7)](_0xa33dcb(0xfe)+a4_0x53f2df['join'](_0x158a63,_0xa33dcb(0xe1))+':\x20'+_0xaacbb8));else{if(_0x102c22==='cwd-config')console[_0xa33dcb(0x105)](a4_0x2e9eea[_0xa33dcb(0xc7)](_0xa33dcb(0x96)+_0xaacbb8));else _0x102c22==='context'&&console[_0xa33dcb(0x105)](a4_0x2e9eea[_0xa33dcb(0xc7)](_0xa33dcb(0x85)+_0xaacbb8));}if(!_0xaacbb8)return _0x1deea6?(console[_0xa33dcb(0x105)](a4_0x2e9eea[_0xa33dcb(0x9d)](_0xa33dcb(0x111))),console[_0xa33dcb(0x105)](_0xa33dcb(0x10a)),console[_0xa33dcb(0x105)](_0xa33dcb(0x122))):(console['log'](a4_0x2e9eea['yellow'](_0xa33dcb(0xee))),console[_0xa33dcb(0x105)](_0xa33dcb(0x107)),console[_0xa33dcb(0x105)](_0xa33dcb(0x8d)),console[_0xa33dcb(0x105)](_0xa33dcb(0x90)),console[_0xa33dcb(0x105)](_0xa33dcb(0x75)),console[_0xa33dcb(0x105)](_0xa33dcb(0x7b))),0x1;if(_0xed6402){const {data:_0x531201}=await withSpinner(_0xa33dcb(0xcb)+_0xed6402+_0xa33dcb(0xf6)+_0xaacbb8+_0xa33dcb(0x93),()=>_0x3ed2c1['llm'][_0xa33dcb(0x91)](_0xaacbb8,_0xed6402,_0xf9ab53,{'dryRun':_0x27a890,'force':_0x59a05c}));if(_0x27a890)return console[_0xa33dcb(0x105)](a4_0x2e9eea['yellow']('Dry\x20run\x20-\x20no\x20files\x20written')),console['log'](_0xa33dcb(0x10b)+_0x531201[_0xa33dcb(0xb3)]),console[_0xa33dcb(0x105)]('Output\x20path:\x20'+_0x531201[_0xa33dcb(0xce)]),_0x531201[_0xa33dcb(0x123)]&&(console['log']('\x0aChanges:'),console[_0xa33dcb(0x105)]('─'[_0xa33dcb(0xe6)](0x3c)),console[_0xa33dcb(0x105)](_0x531201[_0xa33dcb(0x123)]),console[_0xa33dcb(0x105)]('─'[_0xa33dcb(0xe6)](0x3c))),0x0;return console[_0xa33dcb(0x105)](a4_0x2e9eea['green'](_0xa33dcb(0xd5))),console['log']('Agent:\x20'+_0x531201[_0xa33dcb(0xb3)]),console[_0xa33dcb(0x105)](_0xa33dcb(0xfd)+_0x531201[_0xa33dcb(0xce)]),console[_0xa33dcb(0x105)](_0xa33dcb(0xe7)+(_0x531201[_0xa33dcb(0xdc)]?a4_0x2e9eea[_0xa33dcb(0x109)]('new'):_0x531201[_0xa33dcb(0x79)]?a4_0x2e9eea[_0xa33dcb(0x9d)](_0xa33dcb(0x106)):a4_0x2e9eea['gray'](_0xa33dcb(0x119)))),0x0;}const _0x7df378=_0x322795||_0xf9ab53,{data:_0x1cd3d2}=await withSpinner(_0xa33dcb(0xde)+_0xaacbb8+_0xa33dcb(0x93),()=>_0x3ed2c1[_0xa33dcb(0xb5)]['pullProject'](_0xaacbb8,_0x7df378,{'dryRun':!![]})),_0x3889ec=_0x1cd3d2['counts'][_0xa33dcb(0xa1)]['new']+_0x1cd3d2[_0xa33dcb(0xf5)][_0xa33dcb(0xd6)]['new']+_0x1cd3d2[_0xa33dcb(0xf5)][_0xa33dcb(0xe2)]['new']+_0x1cd3d2[_0xa33dcb(0xf5)]['prompts'][_0xa33dcb(0xf0)]+_0x1cd3d2[_0xa33dcb(0xf5)]['integrations'][_0xa33dcb(0xf0)]+_0x1cd3d2[_0xa33dcb(0xf5)][_0xa33dcb(0xa0)][_0xa33dcb(0xf0)]+_0x1cd3d2['counts'][_0xa33dcb(0xfc)][_0xa33dcb(0xf0)],_0x32e9b0=_0x1cd3d2[_0xa33dcb(0xf5)][_0xa33dcb(0xa1)][_0xa33dcb(0x106)]+_0x1cd3d2['counts']['knowledgeBases']['updated']+_0x1cd3d2[_0xa33dcb(0xf5)][_0xa33dcb(0xe2)]['updated']+_0x1cd3d2[_0xa33dcb(0xf5)][_0xa33dcb(0x9e)][_0xa33dcb(0x106)]+_0x1cd3d2['counts']['integrations'][_0xa33dcb(0x106)]+_0x1cd3d2['counts'][_0xa33dcb(0xa0)][_0xa33dcb(0x106)]+_0x1cd3d2[_0xa33dcb(0xf5)][_0xa33dcb(0xfc)]['updated'],_0x59b51e=_0x1cd3d2[_0xa33dcb(0xf5)][_0xa33dcb(0xa1)][_0xa33dcb(0x119)]+_0x1cd3d2[_0xa33dcb(0xf5)][_0xa33dcb(0xd6)][_0xa33dcb(0x119)]+_0x1cd3d2[_0xa33dcb(0xf5)][_0xa33dcb(0xe2)]['unchanged']+_0x1cd3d2[_0xa33dcb(0xf5)]['prompts'][_0xa33dcb(0x119)]+_0x1cd3d2[_0xa33dcb(0xf5)][_0xa33dcb(0x97)][_0xa33dcb(0x119)]+_0x1cd3d2[_0xa33dcb(0xf5)]['experimentalKnowledgeBases']['unchanged']+_0x1cd3d2[_0xa33dcb(0xf5)]['experimentalArtifacts']['unchanged'];console[_0xa33dcb(0x105)]('\x0aPull\x20summary\x20for\x20\x27'+_0x1cd3d2['projectName']+'\x27:'),console['log']('\x20\x20'+a4_0x2e9eea[_0xa33dcb(0x109)]('+\x20'+_0x3889ec+_0xa33dcb(0xe4))+_0xa33dcb(0xab)+a4_0x2e9eea[_0xa33dcb(0x9d)]('~\x20'+_0x32e9b0+_0xa33dcb(0xae))+_0xa33dcb(0xab)+a4_0x2e9eea[_0xa33dcb(0xc7)]('=\x20'+_0x59b51e+_0xa33dcb(0xf3))),console[_0xa33dcb(0x105)](_0xa33dcb(0xb7)+formatCountSummary(_0x1cd3d2[_0xa33dcb(0xf5)][_0xa33dcb(0xa1)])),console['log'](_0xa33dcb(0xf7)+formatCountSummary(_0x1cd3d2[_0xa33dcb(0xf5)][_0xa33dcb(0xd6)])),console['log'](_0xa33dcb(0x92)+formatCountSummary(_0x1cd3d2['counts'][_0xa33dcb(0xe2)])),console[_0xa33dcb(0x105)](_0xa33dcb(0xd2)+formatCountSummary(_0x1cd3d2[_0xa33dcb(0xf5)]['prompts'])),console[_0xa33dcb(0x105)](_0xa33dcb(0xec)+formatCountSummary(_0x1cd3d2[_0xa33dcb(0xf5)][_0xa33dcb(0x97)]));const _0x4d16e9=_0x1cd3d2[_0xa33dcb(0xf5)][_0xa33dcb(0xa0)]['total']>0x0||_0x1cd3d2['counts'][_0xa33dcb(0xfc)][_0xa33dcb(0xdb)]>0x0;_0x4d16e9&&(console[_0xa33dcb(0x105)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x1cd3d2[_0xa33dcb(0xf5)]['experimentalKnowledgeBases'])),console[_0xa33dcb(0x105)](_0xa33dcb(0xa2)+formatCountSummary(_0x1cd3d2[_0xa33dcb(0xf5)][_0xa33dcb(0xfc)])));console[_0xa33dcb(0x105)](_0xa33dcb(0x101)+a4_0x2e9eea[_0xa33dcb(0xad)](_0x1cd3d2[_0xa33dcb(0x87)])),displayDiffs(_0x1cd3d2['agents'],_0x1cd3d2['knowledgeBases'],_0x1cd3d2['textKnowledgeBases'],_0x1cd3d2['prompts'],_0x1cd3d2[_0xa33dcb(0x97)],_0x1cd3d2[_0xa33dcb(0xa0)],_0x1cd3d2[_0xa33dcb(0xfc)]);if(_0x27a890)return console[_0xa33dcb(0x105)](a4_0x2e9eea[_0xa33dcb(0x9d)](_0xa33dcb(0xa5))),0x0;if(_0x3889ec===0x0&&_0x32e9b0===0x0)return console[_0xa33dcb(0x105)](a4_0x2e9eea[_0xa33dcb(0x109)]('\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'llm_project':_0x1cd3d2[_0xa33dcb(0xb8)]},_0x39ee11['session']),console['log'](a4_0x2e9eea[_0xa33dcb(0x109)](_0xa33dcb(0xb4)+a4_0x2e9eea[_0xa33dcb(0xc7)](_0xa33dcb(0xb1))+_0xa33dcb(0x8b)+a4_0x2e9eea[_0xa33dcb(0xad)](_0x1cd3d2[_0xa33dcb(0xb8)]))),0x0;if(!_0x247a14&&!_0x59a05c){if(!isInteractive())return console[_0xa33dcb(0xd9)](a4_0x2e9eea[_0xa33dcb(0x11d)](_0xa33dcb(0xac)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0xa33dcb(0xd9)](a4_0x2e9eea[_0xa33dcb(0xc7)](_0xa33dcb(0x73))),0x1;const _0x1b0860=await confirmKey(_0xa33dcb(0xdf)+(_0x3889ec+_0x32e9b0)+'\x20files?');if(!_0x1b0860)return console[_0xa33dcb(0x105)](a4_0x2e9eea[_0xa33dcb(0x9d)](_0xa33dcb(0xcd)),'-\x20no\x20files\x20written'),0x1;}const {data:_0x59982c}=await withSpinner(_0xa33dcb(0x7a),()=>_0x3ed2c1[_0xa33dcb(0xb5)][_0xa33dcb(0xb6)](_0xaacbb8,_0x7df378,{'force':_0x59a05c}));return console['log'](a4_0x2e9eea[_0xa33dcb(0x109)](_0xa33dcb(0xc5)+(_0x3889ec+_0x32e9b0)+_0xa33dcb(0xea)+_0x59982c[_0xa33dcb(0x87)])),saveSessionContext({'llm_project':_0x59982c[_0xa33dcb(0xb8)]},_0x39ee11[_0xa33dcb(0x110)]),console[_0xa33dcb(0x105)](a4_0x2e9eea[_0xa33dcb(0x109)](_0xa33dcb(0xb4)+a4_0x2e9eea['dim']('llm_project')+_0xa33dcb(0x8b)+a4_0x2e9eea[_0xa33dcb(0xad)](_0x59982c[_0xa33dcb(0xb8)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x80e2a5(0xba)]=a4_0x80e2a5(0x9a);[a4_0x80e2a5(0xc4)]='Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project';async[a4_0x80e2a5(0xb0)](_0x485edc){const _0x5e94cd=a4_0x80e2a5,{options:_0x645c49,args:_0x42e772,tdx:_0x568143}=_0x485edc,_0x247008=_0x42e772[0x0],_0x3d18a9=_0x645c49['name'],_0x13af08=_0x645c49['dryRun'],_0x23ab33=_0x645c49[_0x5e94cd(0x7f)],_0x4adbe1=_0x645c49[_0x5e94cd(0x88)],_0x15182e=_0x645c49[_0x5e94cd(0x82)];let _0xa122f3;const _0x228d42=findAgentConfigPath(process[_0x5e94cd(0x95)]());if(_0x247008){const _0x2f86cc=a4_0x53f2df[_0x5e94cd(0xc2)](_0x247008,'tdx.json');existsSync(_0x2f86cc)?(_0xa122f3=_0x247008,console[_0x5e94cd(0x105)](a4_0x2e9eea['dim'](_0x5e94cd(0x8a)+_0x247008))):_0xa122f3=_0x247008;}else{if(_0x228d42)_0xa122f3=a4_0x53f2df[_0x5e94cd(0x7d)](_0x228d42),console[_0x5e94cd(0x105)](a4_0x2e9eea['dim'](_0x5e94cd(0x115)+_0xa122f3));else{if(_0x15182e){const _0x1d279f=sanitizeForFilesystem(_0x15182e);let _0x3b6224=_0x1d279f,_0x38011a=a4_0x53f2df['join'](process['cwd'](),_0x5e94cd(0xa1),_0x1d279f,_0x5e94cd(0xe1));if(!existsSync(_0x38011a)){const _0x4e723c=normalizeName(_0x15182e),_0xdbdad4=a4_0x53f2df[_0x5e94cd(0xc2)](process[_0x5e94cd(0x95)](),_0x5e94cd(0xa1),_0x4e723c,_0x5e94cd(0xe1));existsSync(_0xdbdad4)&&(_0x3b6224=_0x4e723c,_0x38011a=_0xdbdad4);}if(existsSync(_0x38011a))_0xa122f3=a4_0x53f2df['dirname'](_0x38011a),console[_0x5e94cd(0x105)](a4_0x2e9eea[_0x5e94cd(0xc7)](_0x5e94cd(0x8a)+_0xa122f3));else{const _0x4b8d53=_0x645c49[_0x5e94cd(0xe5)];if(_0x4b8d53)throw new SDKError(ErrorCode[_0x5e94cd(0xef)],'Cannot\x20clone\x20from\x20context\x20project\x20\x22'+_0x15182e+_0x5e94cd(0x114),undefined,{'helpText':_0x5e94cd(0xca)+_0x5e94cd(0xc1)+(_0x5e94cd(0xbf)+_0x15182e+'\x0a')+('\x20\x20tdx\x20agent\x20clone\x20agents/'+_0x3b6224+_0x5e94cd(0x120)+(_0x3d18a9||_0x5e94cd(0xf8))+_0x5e94cd(0x9b)+_0x4b8d53)});_0xa122f3=_0x15182e,console['log'](a4_0x2e9eea[_0x5e94cd(0xc7)](_0x5e94cd(0xc8)+_0x15182e));}}}}if(!_0xa122f3)return console[_0x5e94cd(0x105)](a4_0x2e9eea['yellow'](_0x5e94cd(0x83))),console[_0x5e94cd(0x105)](_0x5e94cd(0x11c)),console['log']('\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory'),console[_0x5e94cd(0x105)](_0x5e94cd(0xeb)),console['log']('\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>'),0x1;if(!_0x3d18a9)throw new SDKError(ErrorCode['MISSING_ARGUMENT'],_0x5e94cd(0x89),undefined,{'helpText':_0x5e94cd(0x113)});if(!_0x23ab33&&!_0x13af08){if(!isInteractive())return console[_0x5e94cd(0xd9)](a4_0x2e9eea[_0x5e94cd(0x11d)](_0x5e94cd(0xac)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x5e94cd(0xd9)](a4_0x2e9eea[_0x5e94cd(0xc7)](_0x5e94cd(0x73))),0x1;const _0xc22e53=await confirmKey(_0x5e94cd(0xbc)+_0xa122f3+'\x22\x20to\x20new\x20project\x20\x22'+_0x3d18a9+'\x22?');if(!_0xc22e53)return console[_0x5e94cd(0x105)](a4_0x2e9eea[_0x5e94cd(0x9d)](_0x5e94cd(0xcd))),0x1;}const {data:_0xa16218}=await withSpinner(_0x5e94cd(0x11e)+_0xa122f3+_0x5e94cd(0xa3)+_0x3d18a9+'\x22...',()=>_0x568143[_0x5e94cd(0xb5)][_0x5e94cd(0xd4)](_0xa122f3,_0x3d18a9,{'dryRun':_0x13af08}));if(_0x13af08){console[_0x5e94cd(0x105)](a4_0x2e9eea['yellow'](_0x5e94cd(0xaf))),console[_0x5e94cd(0x105)]('Source:\x20'+_0xa16218[_0x5e94cd(0x86)]),console['log'](_0x5e94cd(0xcf)+_0x3d18a9),console[_0x5e94cd(0x105)](_0x5e94cd(0xd8)),console[_0x5e94cd(0x105)](_0x5e94cd(0xb7)+_0xa16218[_0x5e94cd(0xf5)][_0x5e94cd(0xa1)][_0x5e94cd(0xc9)]),console[_0x5e94cd(0x105)](_0x5e94cd(0xf7)+_0xa16218[_0x5e94cd(0xf5)][_0x5e94cd(0xd6)]['created']),console[_0x5e94cd(0x105)]('\x20\x20Prompts:\x20'+_0xa16218[_0x5e94cd(0xf5)]['prompts'][_0x5e94cd(0xc9)]);const _0x3bcde8=_0xa16218[_0x5e94cd(0xf5)][_0x5e94cd(0xa0)][_0x5e94cd(0xc9)]>0x0||_0xa16218['counts'][_0x5e94cd(0xfc)][_0x5e94cd(0xc9)]>0x0;return _0x3bcde8&&(console[_0x5e94cd(0x105)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+_0xa16218[_0x5e94cd(0xf5)]['experimentalKnowledgeBases'][_0x5e94cd(0xc9)]),console[_0x5e94cd(0x105)](_0x5e94cd(0xa2)+_0xa16218[_0x5e94cd(0xf5)][_0x5e94cd(0xfc)][_0x5e94cd(0xc9)])),0x0;}const _0x310929=_0xa16218[_0x5e94cd(0xf5)]['agents'][_0x5e94cd(0x108)]>0x0||_0xa16218['counts']['knowledgeBases'][_0x5e94cd(0x108)]>0x0||_0xa16218[_0x5e94cd(0xf5)]['prompts'][_0x5e94cd(0x108)]>0x0||_0xa16218[_0x5e94cd(0xf5)][_0x5e94cd(0xa0)][_0x5e94cd(0x108)]>0x0||_0xa16218['counts'][_0x5e94cd(0xfc)][_0x5e94cd(0x108)]>0x0;_0x310929?console[_0x5e94cd(0x105)](a4_0x2e9eea[_0x5e94cd(0x9d)](_0x5e94cd(0xbd))):console[_0x5e94cd(0x105)](a4_0x2e9eea[_0x5e94cd(0x109)](_0x5e94cd(0xb9)));console[_0x5e94cd(0x105)]('Source:\x20'+_0xa16218[_0x5e94cd(0x86)]),console[_0x5e94cd(0x105)](_0x5e94cd(0xcf)+_0xa16218[_0x5e94cd(0xc3)]),console['log']('New\x20project\x20ID:\x20'+_0xa16218[_0x5e94cd(0x81)]),console[_0x5e94cd(0x105)](),console[_0x5e94cd(0x105)](_0x5e94cd(0x10e)),console['log'](_0x5e94cd(0xb7)+formatCountSummary(_0xa16218['counts'][_0x5e94cd(0xa1)])),console[_0x5e94cd(0x105)](_0x5e94cd(0xf7)+formatCountSummary(_0xa16218['counts'][_0x5e94cd(0xd6)])),console['log'](_0x5e94cd(0xd2)+formatCountSummary(_0xa16218[_0x5e94cd(0xf5)][_0x5e94cd(0x9e)])),console[_0x5e94cd(0x105)](_0x5e94cd(0xec)+formatCountSummary(_0xa16218[_0x5e94cd(0xf5)][_0x5e94cd(0x97)]));const _0x5e13cc=_0xa16218[_0x5e94cd(0xf5)][_0x5e94cd(0xa0)]['created']>0x0||_0xa16218[_0x5e94cd(0xf5)][_0x5e94cd(0xa0)][_0x5e94cd(0x106)]>0x0||_0xa16218[_0x5e94cd(0xf5)][_0x5e94cd(0xa0)][_0x5e94cd(0x119)]>0x0||_0xa16218[_0x5e94cd(0xf5)]['experimentalArtifacts'][_0x5e94cd(0xc9)]>0x0||_0xa16218[_0x5e94cd(0xf5)][_0x5e94cd(0xfc)][_0x5e94cd(0x106)]>0x0||_0xa16218['counts'][_0x5e94cd(0xfc)][_0x5e94cd(0x119)]>0x0;_0x5e13cc&&(console['log'](_0x5e94cd(0xaa)+formatCountSummary(_0xa16218['counts'][_0x5e94cd(0xa0)])),console[_0x5e94cd(0x105)](_0x5e94cd(0xa2)+formatCountSummary(_0xa16218[_0x5e94cd(0xf5)]['experimentalArtifacts'])));if(_0x310929){console['log'](),console[_0x5e94cd(0x105)](a4_0x2e9eea[_0x5e94cd(0x11d)](_0x5e94cd(0xa7)));for(const _0x580d51 of _0xa16218[_0x5e94cd(0xa1)]){_0x580d51[_0x5e94cd(0x103)]==='error'&&console[_0x5e94cd(0x105)](a4_0x2e9eea['red'](_0x5e94cd(0xf2)+_0x580d51[_0x5e94cd(0xb3)]+_0x5e94cd(0x77)+_0x580d51[_0x5e94cd(0xd9)]));}for(const _0x495174 of _0xa16218[_0x5e94cd(0xd6)]){_0x495174['action']===_0x5e94cd(0xd9)&&console[_0x5e94cd(0x105)](a4_0x2e9eea[_0x5e94cd(0x11d)](_0x5e94cd(0xa4)+_0x495174[_0x5e94cd(0xba)]+_0x5e94cd(0x77)+_0x495174[_0x5e94cd(0xd9)]));}for(const _0x29ad12 of _0xa16218[_0x5e94cd(0x9e)]){_0x29ad12[_0x5e94cd(0x103)]===_0x5e94cd(0xd9)&&console[_0x5e94cd(0x105)](a4_0x2e9eea[_0x5e94cd(0x11d)](_0x5e94cd(0x104)+_0x29ad12[_0x5e94cd(0xba)]+_0x5e94cd(0x77)+_0x29ad12[_0x5e94cd(0xd9)]));}for(const _0x304dc1 of _0xa16218[_0x5e94cd(0x97)]){_0x304dc1[_0x5e94cd(0x103)]===_0x5e94cd(0xd9)&&console[_0x5e94cd(0x105)](a4_0x2e9eea[_0x5e94cd(0x11d)](_0x5e94cd(0xfb)+_0x304dc1[_0x5e94cd(0xba)]+_0x5e94cd(0x77)+_0x304dc1[_0x5e94cd(0xd9)]));}for(const _0x28fe5f of _0xa16218['experimentalKnowledgeBases']){_0x28fe5f[_0x5e94cd(0x103)]===_0x5e94cd(0xd9)&&console[_0x5e94cd(0x105)](a4_0x2e9eea[_0x5e94cd(0x11d)]('\x20\x20Experimental\x20Knowledge\x20Base\x20\x22'+_0x28fe5f[_0x5e94cd(0xba)]+_0x5e94cd(0x77)+_0x28fe5f['error']));}for(const _0x488e06 of _0xa16218[_0x5e94cd(0xfc)]){_0x488e06[_0x5e94cd(0x103)]===_0x5e94cd(0xd9)&&console[_0x5e94cd(0x105)](a4_0x2e9eea[_0x5e94cd(0x11d)]('\x20\x20Experimental\x20Artifact\x20\x22'+_0x488e06['name']+_0x5e94cd(0x77)+_0x488e06['error']));}return 0x1;}console['log']();const _0x5b27a2=getLLMProjectUrl(_0x4adbe1,_0xa16218[_0x5e94cd(0x81)]);return console[_0x5e94cd(0x105)](_0x5e94cd(0xd7)+a4_0x2e9eea[_0x5e94cd(0xad)](_0x5b27a2)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x80e2a5(0xba)]='agent:push';[a4_0x80e2a5(0xc4)]=a4_0x80e2a5(0x11f);async[a4_0x80e2a5(0xb0)](_0x3f0514){const _0xb8deb5=a4_0x80e2a5,{options:_0x408f8e,args:_0x2385e1,tdx:_0xcd068e}=_0x3f0514;let _0x41edcf=_0x2385e1[0x0]||process['cwd']();const _0x27d135=_0x408f8e['dryRun'],_0x392e50=_0x408f8e['force'],_0x45bc56=_0x408f8e[_0xb8deb5(0x7f)],_0x544fe4=_0x408f8e[_0xb8deb5(0x88)],_0x265259=a4_0x53f2df[_0xb8deb5(0xc2)](_0x41edcf,_0xb8deb5(0xe8)),_0x45bc13=existsSync(_0x265259);if(_0x45bc13){const {data:_0x3e03fb}=await withSpinner(_0xb8deb5(0x10c)+_0x41edcf+_0xb8deb5(0x93),()=>_0xcd068e['llm'][_0xb8deb5(0x10f)](_0x41edcf,{'dryRun':_0x27d135,'force':_0x392e50}));if(_0x27d135)return console[_0xb8deb5(0x105)](a4_0x2e9eea['yellow'](_0xb8deb5(0xaf))),console[_0xb8deb5(0x105)](_0xb8deb5(0x117)+_0x3e03fb['agentName']),0x0;if(_0x3e03fb[_0xb8deb5(0x103)]==='error')return console[_0xb8deb5(0x105)](a4_0x2e9eea[_0xb8deb5(0x11d)]('Failed\x20to\x20push\x20agent:\x20'+_0x3e03fb['error'])),0x1;console[_0xb8deb5(0x105)](a4_0x2e9eea[_0xb8deb5(0x109)](_0xb8deb5(0x112)+_0x3e03fb[_0xb8deb5(0x103)]+_0xb8deb5(0xe0))),console[_0xb8deb5(0x105)](_0xb8deb5(0x84)+_0x3e03fb[_0xb8deb5(0xb3)]);if(_0x3e03fb[_0xb8deb5(0xdd)]&&_0x3e03fb[_0xb8deb5(0x116)]){const _0x88c344=getLLMAgentChatUrl(_0x544fe4,_0x3e03fb[_0xb8deb5(0x116)],_0x3e03fb[_0xb8deb5(0xdd)]);console['log'](_0xb8deb5(0xe9)+a4_0x2e9eea[_0xb8deb5(0xad)](_0x88c344));}return 0x0;}const _0x22aadf=_0x408f8e['llmProject'],_0x2feb20=resolveProjectFromContext(_0x41edcf,_0x22aadf);if(_0x2feb20[_0xb8deb5(0x7c)])_0x41edcf=_0x2feb20[_0xb8deb5(0xa6)],_0x2feb20['source']==='context'&&console[_0xb8deb5(0x105)](a4_0x2e9eea[_0xb8deb5(0xc7)](_0xb8deb5(0x96)+_0x41edcf));else{let _0x3bbde3='Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.';_0x2feb20[_0xb8deb5(0x7e)]===_0xb8deb5(0xa9)&&(_0x3bbde3=_0x2feb20[_0xb8deb5(0x118)]+_0xb8deb5(0x9f)+_0x2feb20[_0xb8deb5(0x82)]+_0xb8deb5(0x124));throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x2feb20[_0xb8deb5(0x7e)]===_0xb8deb5(0xc6)?_0x2feb20['message']:_0xb8deb5(0x8f)+_0x41edcf,undefined,{'helpText':_0x3bbde3});}const {data:_0x169380}=await withSpinner('Analyzing\x20changes\x20to\x20push...',()=>_0xcd068e[_0xb8deb5(0xb5)][_0xb8deb5(0x10d)](_0x41edcf,{'dryRun':!![]})),_0x5a67ff=_0x169380[_0xb8deb5(0xf5)][_0xb8deb5(0xa1)]['errors']>0x0;if(_0x5a67ff){console[_0xb8deb5(0x105)](a4_0x2e9eea['red'](_0xb8deb5(0x76)));for(const _0x20a2d1 of _0x169380[_0xb8deb5(0xa1)]){_0x20a2d1[_0xb8deb5(0x103)]===_0xb8deb5(0xd9)&&console[_0xb8deb5(0x105)](a4_0x2e9eea[_0xb8deb5(0x11d)](_0xb8deb5(0xf2)+_0x20a2d1[_0xb8deb5(0xb3)]+_0xb8deb5(0x77)+_0x20a2d1[_0xb8deb5(0xd9)]));}return 0x1;}const _0x482646=_0x169380[_0xb8deb5(0xf5)][_0xb8deb5(0xa1)][_0xb8deb5(0xc9)]+_0x169380['counts'][_0xb8deb5(0xd6)][_0xb8deb5(0xc9)]+_0x169380[_0xb8deb5(0xf5)][_0xb8deb5(0xe2)][_0xb8deb5(0xc9)]+_0x169380[_0xb8deb5(0xf5)]['prompts'][_0xb8deb5(0xc9)]+_0x169380['counts'][_0xb8deb5(0x97)][_0xb8deb5(0xc9)]+_0x169380[_0xb8deb5(0xf5)][_0xb8deb5(0xa0)][_0xb8deb5(0xc9)]+_0x169380[_0xb8deb5(0xf5)][_0xb8deb5(0xfc)][_0xb8deb5(0xc9)],_0x4625d4=_0x169380[_0xb8deb5(0xf5)][_0xb8deb5(0xa1)][_0xb8deb5(0x106)]+_0x169380[_0xb8deb5(0xf5)][_0xb8deb5(0xd6)]['updated']+_0x169380[_0xb8deb5(0xf5)][_0xb8deb5(0xe2)]['updated']+_0x169380[_0xb8deb5(0xf5)]['prompts'][_0xb8deb5(0x106)]+_0x169380['counts']['integrations']['updated']+_0x169380['counts'][_0xb8deb5(0xa0)][_0xb8deb5(0x106)]+_0x169380[_0xb8deb5(0xf5)]['experimentalArtifacts'][_0xb8deb5(0x106)],_0x308cd4=_0x169380[_0xb8deb5(0xf5)]['agents']['unchanged']+_0x169380['counts'][_0xb8deb5(0xd6)][_0xb8deb5(0x119)]+_0x169380[_0xb8deb5(0xf5)][_0xb8deb5(0xe2)][_0xb8deb5(0x119)]+_0x169380[_0xb8deb5(0xf5)][_0xb8deb5(0x9e)][_0xb8deb5(0x119)]+_0x169380[_0xb8deb5(0xf5)][_0xb8deb5(0x97)]['unchanged']+_0x169380['counts'][_0xb8deb5(0xa0)][_0xb8deb5(0x119)]+_0x169380[_0xb8deb5(0xf5)][_0xb8deb5(0xfc)][_0xb8deb5(0x119)];console['log'](_0xb8deb5(0x8e)+_0x169380[_0xb8deb5(0xb8)]+'\x27:'),console[_0xb8deb5(0x105)]('\x20\x20'+a4_0x2e9eea[_0xb8deb5(0x109)]('+\x20'+_0x482646+'\x20new')+'\x20|\x20'+a4_0x2e9eea[_0xb8deb5(0x9d)]('~\x20'+_0x4625d4+_0xb8deb5(0xae))+_0xb8deb5(0xab)+a4_0x2e9eea[_0xb8deb5(0xc7)]('=\x20'+_0x308cd4+_0xb8deb5(0xf3))),console['log']('\x20\x20Agents:\x20'+formatCountSummary(_0x169380[_0xb8deb5(0xf5)][_0xb8deb5(0xa1)])),console['log'](_0xb8deb5(0xf7)+formatCountSummary(_0x169380[_0xb8deb5(0xf5)][_0xb8deb5(0xd6)])),console[_0xb8deb5(0x105)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x169380[_0xb8deb5(0xf5)][_0xb8deb5(0xe2)])),console[_0xb8deb5(0x105)](_0xb8deb5(0xd2)+formatCountSummary(_0x169380['counts'][_0xb8deb5(0x9e)])),console[_0xb8deb5(0x105)](_0xb8deb5(0xec)+formatCountSummary(_0x169380[_0xb8deb5(0xf5)]['integrations']));const _0x293d9c=_0x169380['counts'][_0xb8deb5(0xa0)][_0xb8deb5(0xc9)]>0x0||_0x169380[_0xb8deb5(0xf5)][_0xb8deb5(0xa0)][_0xb8deb5(0x106)]>0x0||_0x169380[_0xb8deb5(0xf5)]['experimentalKnowledgeBases'][_0xb8deb5(0x119)]>0x0||_0x169380['counts'][_0xb8deb5(0xfc)][_0xb8deb5(0xc9)]>0x0||_0x169380[_0xb8deb5(0xf5)][_0xb8deb5(0xfc)][_0xb8deb5(0x106)]>0x0||_0x169380[_0xb8deb5(0xf5)]['experimentalArtifacts'][_0xb8deb5(0x119)]>0x0;_0x293d9c&&(console[_0xb8deb5(0x105)](_0xb8deb5(0xaa)+formatCountSummary(_0x169380['counts'][_0xb8deb5(0xa0)])),console[_0xb8deb5(0x105)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x169380[_0xb8deb5(0xf5)][_0xb8deb5(0xfc)])));console[_0xb8deb5(0x105)]('\x20\x20Source:\x20'+a4_0x2e9eea['cyan'](_0x41edcf)),displayDiffs(_0x169380[_0xb8deb5(0xa1)],_0x169380['knowledgeBases'],_0x169380[_0xb8deb5(0xe2)],_0x169380[_0xb8deb5(0x9e)],_0x169380[_0xb8deb5(0x97)],_0x169380[_0xb8deb5(0xa0)],_0x169380[_0xb8deb5(0xfc)]);if(_0x27d135)return console[_0xb8deb5(0x105)](a4_0x2e9eea[_0xb8deb5(0x9d)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed')),0x0;if(_0x482646===0x0&&_0x4625d4===0x0){console['log'](a4_0x2e9eea[_0xb8deb5(0x109)](_0xb8deb5(0xed)));const _0x5dcebf=getLLMProjectUrl(_0x544fe4,_0x169380[_0xb8deb5(0x116)]);return console[_0xb8deb5(0x105)](_0xb8deb5(0xd7)+a4_0x2e9eea['cyan'](_0x5dcebf)),0x0;}if(!_0x45bc56&&!_0x392e50){if(!isInteractive())return console['error'](a4_0x2e9eea[_0xb8deb5(0x11d)](_0xb8deb5(0xac)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0xb8deb5(0xd9)](a4_0x2e9eea[_0xb8deb5(0xc7)](_0xb8deb5(0x73))),0x1;const _0x7cff3b=await confirmKey(_0xb8deb5(0xb2)+(_0x482646+_0x4625d4)+_0xb8deb5(0x11a));if(!_0x7cff3b)return console['log'](a4_0x2e9eea[_0xb8deb5(0x9d)]('Cancelled'),_0xb8deb5(0xa8)),0x1;}const {data:_0xbf55f9}=await withSpinner(_0xb8deb5(0xff),()=>_0xcd068e[_0xb8deb5(0xb5)][_0xb8deb5(0x10d)](_0x41edcf,{'force':_0x392e50})),_0x4a12e0=_0xbf55f9['counts'][_0xb8deb5(0xa1)][_0xb8deb5(0x108)]>0x0||_0xbf55f9[_0xb8deb5(0xf5)][_0xb8deb5(0xd6)][_0xb8deb5(0x108)]>0x0||_0xbf55f9[_0xb8deb5(0xf5)]['textKnowledgeBases']['errors']>0x0||_0xbf55f9[_0xb8deb5(0xf5)][_0xb8deb5(0x9e)][_0xb8deb5(0x108)]>0x0;if(_0x4a12e0){console[_0xb8deb5(0x105)](a4_0x2e9eea[_0xb8deb5(0x9d)]('\x0aProject\x20pushed\x20with\x20errors')),console['log'](),console[_0xb8deb5(0x105)](a4_0x2e9eea['red'](_0xb8deb5(0xa7)));for(const _0xf6411c of _0xbf55f9[_0xb8deb5(0xa1)]){_0xf6411c['action']==='error'&&console[_0xb8deb5(0x105)](a4_0x2e9eea[_0xb8deb5(0x11d)](_0xb8deb5(0xf2)+_0xf6411c[_0xb8deb5(0xb3)]+_0xb8deb5(0x77)+_0xf6411c[_0xb8deb5(0xd9)]));}for(const _0x18e12f of _0xbf55f9['knowledgeBases']){_0x18e12f['action']===_0xb8deb5(0xd9)&&console[_0xb8deb5(0x105)](a4_0x2e9eea['red']('\x20\x20Knowledge\x20Base\x20\x22'+_0x18e12f[_0xb8deb5(0xba)]+_0xb8deb5(0x77)+_0x18e12f[_0xb8deb5(0xd9)]));}for(const _0x5d481d of _0xbf55f9[_0xb8deb5(0xe2)]){_0x5d481d[_0xb8deb5(0x103)]==='error'&&console[_0xb8deb5(0x105)](a4_0x2e9eea['red'](_0xb8deb5(0x11b)+_0x5d481d[_0xb8deb5(0xba)]+_0xb8deb5(0x77)+_0x5d481d[_0xb8deb5(0xd9)]));}for(const _0x292f7b of _0xbf55f9['prompts']){_0x292f7b[_0xb8deb5(0x103)]===_0xb8deb5(0xd9)&&console[_0xb8deb5(0x105)](a4_0x2e9eea[_0xb8deb5(0x11d)]('\x20\x20Prompt\x20\x22'+_0x292f7b[_0xb8deb5(0xba)]+_0xb8deb5(0x77)+_0x292f7b[_0xb8deb5(0xd9)]));}for(const _0x41d621 of _0xbf55f9[_0xb8deb5(0x97)]){_0x41d621['action']===_0xb8deb5(0xd9)&&console[_0xb8deb5(0x105)](a4_0x2e9eea[_0xb8deb5(0x11d)](_0xb8deb5(0xfb)+_0x41d621['name']+_0xb8deb5(0x77)+_0x41d621[_0xb8deb5(0xd9)]));}return 0x1;}console[_0xb8deb5(0x105)](a4_0x2e9eea[_0xb8deb5(0x109)](_0xb8deb5(0x99)+(_0x482646+_0x4625d4)+_0xb8deb5(0xd0)+_0xbf55f9[_0xb8deb5(0xb8)]+'\x27'));const _0x384ab4=getLLMProjectUrl(_0x544fe4,_0xbf55f9['projectId']);return console[_0xb8deb5(0x105)](_0xb8deb5(0xd7)+a4_0x2e9eea[_0xb8deb5(0xad)](_0x384ab4)),0x0;}}
1
+ function a4_0x11f7(){const _0x51d6e2=['Clone\x20\x22','arg-dir','\x22\x20to\x20a\x20different\x20profile','295AVmtom','description','28011emUjoW','\x0aChanges:','cwd-config','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','11UwXqzN','\x20--profile\x20','Analyzing\x20project\x20\x22','context','\x0aError:','session','Cannot\x20clone\x20from\x20context\x20project\x20\x22','4YhjpCQ','knowledgeBases','agentName','Would\x20push\x20agent:\x20','unchanged','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','projectDir','\x22\x20to\x20new\x20project\x20\x22','new','join','prompts','\x20\x20Agent\x20\x22','\x0aPush\x20summary\x20for\x20\x27','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','agent.yml','Using\x20project\x20from\x20context:\x20','Failed\x20to\x20push\x20agent:\x20','red','\x27\x20to\x20create\x20the\x20folder\x20structure.','no_local_folder','llm','\x20\x20Integration\x20\x22','\x20|\x20','\x20\x20tdx\x20agent\x20pull\x20','\x20resources?','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','\x0a✔\x20Pushed\x20','\x20changed','site','\x22\x20to\x20\x22','\x0aProject\x20pushed\x20with\x20errors','error','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','Agent\x20pulled\x20successfully','\x0aPull\x20summary\x20for\x20\x27','Pulling\x20agent\x20\x22','total','force','llm_project','newProjectId','52602TINAzY','<new-name>','counts','Would\x20pull\x20agent:\x20','Dry\x20run\x20-\x20no\x20files\x20written','86748nuKaRP','errors','\x20\x20Knowledge\x20Base\x20\x22','Would\x20clone:','cloneProject','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','\x20=\x20','\x0a✔\x20Pulled\x20','Writing\x20files...','agents','New\x20project\x20name\x20is\x20required','550812pmFfEr','pullProject','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','\x20\x20Text\x20Knowledge\x20Bases:\x20','reason','-\x20nothing\x20pushed','dim','\x20updated','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','log','yellow','message','parse','\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','created','dryRun','cyan','Cancelled','newProjectName','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','push','projectName','Using\x20context\x20project:\x20','\x20unchanged','Project\x20cloned\x20successfully','MISSING_ARGUMENT','outputDir','\x0aWrite\x20','\x20\x20Target:\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','output','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','tdx.json','\x20\x20Prompts:\x20','\x22:\x20','Using\x20local\x20project:\x20','yes','\x20\x20tdx\x20agent\x20clone\x20agents/','Chat:\x20','pushAgent','llmProject','\x0aPush\x20','sourceProjectName','-\x20no\x20files\x20written','action','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','\x0aChanges\x20to\x20integration\x20\x27','agent','36wxIQXv','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)','integrations','\x20\x20Integrations:\x20','Output\x20path:\x20','\x20\x20Experimental\x20Artifact\x20\x22','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','Pushing\x20to\x20project...','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','source','Cloning\x20\x22','Agent:\x20','experimentalArtifacts','Project:\x20','agent:pull','\x20\x20Agents:\x20','outputPath','Using\x20project:\x20','\x20\x20Knowledge\x20Bases:\x20','diff','Using\x20project\x20from\x20','\x22\x20from\x20project\x20\x22','375856OPCDOU','\x20new','name','\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','experimentalKnowledgeBases','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','\x0aErrors\x20found:','\x20\x20Prompt\x20\x22','Using\x20current\x20project:\x20','agentId','\x0aChanges\x20to\x20agent\x20\x27','New\x20project\x20ID:\x20','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','repeat','\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)','pushProject','628902EaYeVi','\x20total','projectId','\x22...','INVALID_ARGUMENT','✔\x20Context\x20set:\x20','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','cwd','updated','New\x20project:\x20','dirname','Dry\x20run\x20-\x20no\x20changes\x20made','execute','\x20\x20Experimental\x20Artifacts:\x20','green','utf-8','20PDxewP','\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','textKnowledgeBases','Pushing\x20agent\x20from\x20\x22','1335306sFQgpk','Errors:','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written'];a4_0x11f7=function(){return _0x51d6e2;};return a4_0x11f7();}function a4_0x11d8(_0x4b09d2,_0x342b66){_0x4b09d2=_0x4b09d2-0x1e1;const _0x11f771=a4_0x11f7();let _0x11d8cc=_0x11f771[_0x4b09d2];return _0x11d8cc;}const a4_0x49b511=a4_0x11d8;(function(_0x429190,_0x127dca){const _0x4d93ca=a4_0x11d8,_0x5e7789=_0x429190();while(!![]){try{const _0x5d0331=parseInt(_0x4d93ca(0x290))/0x1*(-parseInt(_0x4d93ca(0x24c))/0x2)+parseInt(_0x4d93ca(0x210))/0x3*(parseInt(_0x4d93ca(0x1e2))/0x4)+-parseInt(_0x4d93ca(0x28e))/0x5*(-parseInt(_0x4d93ca(0x20b))/0x6)+parseInt(_0x4d93ca(0x288))/0x7+-parseInt(_0x4d93ca(0x262))/0x8+parseInt(_0x4d93ca(0x274))/0x9*(parseInt(_0x4d93ca(0x284))/0xa)+-parseInt(_0x4d93ca(0x294))/0xb*(parseInt(_0x4d93ca(0x21c))/0xc);if(_0x5d0331===_0x127dca)break;else _0x5e7789['push'](_0x5e7789['shift']());}catch(_0x5482af){_0x5e7789['push'](_0x5e7789['shift']());}}}(a4_0x11f7,0x44432));import a4_0x43a6ab from'chalk';import a4_0x36be1b from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext,resolveAgentPullArgs}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0xa0e520){const _0x1ed485=a4_0x11d8,_0xc4f05c=[];if(_0xa0e520[_0x1ed485(0x207)]!==undefined)_0xc4f05c[_0x1ed485(0x230)](_0xa0e520[_0x1ed485(0x207)]+_0x1ed485(0x275));if(_0xa0e520[_0x1ed485(0x1ea)]!==undefined&&_0xa0e520[_0x1ed485(0x1ea)]>0x0)_0xc4f05c[_0x1ed485(0x230)](a4_0x43a6ab[_0x1ed485(0x282)](_0xa0e520[_0x1ed485(0x1ea)]+_0x1ed485(0x263)));if(_0xa0e520['created']!==undefined&&_0xa0e520[_0x1ed485(0x22a)]>0x0)_0xc4f05c[_0x1ed485(0x230)](a4_0x43a6ab['green'](_0xa0e520[_0x1ed485(0x22a)]+'\x20created'));if(_0xa0e520[_0x1ed485(0x27c)]!==undefined&&_0xa0e520[_0x1ed485(0x27c)]>0x0)_0xc4f05c[_0x1ed485(0x230)](a4_0x43a6ab[_0x1ed485(0x226)](_0xa0e520[_0x1ed485(0x27c)]+_0x1ed485(0x223)));if(_0xa0e520[_0x1ed485(0x1e6)]!==undefined&&_0xa0e520[_0x1ed485(0x1e6)]>0x0)_0xc4f05c['push'](a4_0x43a6ab['gray'](_0xa0e520[_0x1ed485(0x1e6)]+_0x1ed485(0x233)));if(_0xa0e520[_0x1ed485(0x211)]!==undefined&&_0xa0e520[_0x1ed485(0x211)]>0x0)_0xc4f05c[_0x1ed485(0x230)](a4_0x43a6ab[_0x1ed485(0x1f3)](_0xa0e520['errors']+'\x20errors'));return _0xc4f05c[_0x1ed485(0x1eb)](',\x20');}function displayDiffs(_0x26065b,_0x15aeaf,_0x66d838,_0xffb6a2,_0x139f46,_0x462f32,_0x1b7abb){const _0x417340=a4_0x11d8;for(const _0x59b073 of _0x26065b){if(_0x59b073[_0x417340(0x25f)]){const _0x2c7c6e=_0x59b073[_0x417340(0x1e4)]||_0x59b073[_0x417340(0x264)];console[_0x417340(0x225)](_0x417340(0x26e)+_0x2c7c6e+'\x27:'),console['log']('─'[_0x417340(0x271)](0x3c)),console['log'](_0x59b073['diff']),console[_0x417340(0x225)]('─'[_0x417340(0x271)](0x3c));}}for(const _0x44d950 of _0x15aeaf){_0x44d950[_0x417340(0x25f)]&&(console['log'](_0x417340(0x1ef)+_0x44d950['name']+'\x27:'),console[_0x417340(0x225)]('─'[_0x417340(0x271)](0x3c)),console[_0x417340(0x225)](_0x44d950[_0x417340(0x25f)]),console[_0x417340(0x225)]('─'[_0x417340(0x271)](0x3c)));}for(const _0x3fe235 of _0x66d838){_0x3fe235['diff']&&(console[_0x417340(0x225)]('\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27'+_0x3fe235[_0x417340(0x264)]+'\x27:'),console['log']('─'[_0x417340(0x271)](0x3c)),console[_0x417340(0x225)](_0x3fe235[_0x417340(0x25f)]),console[_0x417340(0x225)]('─'[_0x417340(0x271)](0x3c)));}for(const _0x561ec4 of _0xffb6a2){_0x561ec4[_0x417340(0x25f)]&&(console[_0x417340(0x225)]('\x0aChanges\x20to\x20prompt\x20\x27'+_0x561ec4['name']+'\x27:'),console[_0x417340(0x225)]('─'[_0x417340(0x271)](0x3c)),console['log'](_0x561ec4[_0x417340(0x25f)]),console[_0x417340(0x225)]('─'[_0x417340(0x271)](0x3c)));}for(const _0x5296db of _0x139f46){_0x5296db['diff']&&(console['log'](_0x417340(0x24a)+_0x5296db[_0x417340(0x264)]+'\x27:'),console[_0x417340(0x225)]('─'[_0x417340(0x271)](0x3c)),console[_0x417340(0x225)](_0x5296db[_0x417340(0x25f)]),console['log']('─'[_0x417340(0x271)](0x3c)));}for(const _0x36d14f of _0x462f32){_0x36d14f['diff']&&(console['log'](_0x417340(0x22f)+_0x36d14f[_0x417340(0x264)]+'\x27:'),console[_0x417340(0x225)]('─'[_0x417340(0x271)](0x3c)),console[_0x417340(0x225)](_0x36d14f[_0x417340(0x25f)]),console[_0x417340(0x225)]('─'[_0x417340(0x271)](0x3c)));}for(const _0x2b7b4a of _0x1b7abb){_0x2b7b4a[_0x417340(0x25f)]&&(console[_0x417340(0x225)](_0x417340(0x249)+_0x2b7b4a['name']+'\x27:'),console[_0x417340(0x225)]('─'[_0x417340(0x271)](0x3c)),console[_0x417340(0x225)](_0x2b7b4a[_0x417340(0x25f)]),console[_0x417340(0x225)]('─'['repeat'](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x49b511(0x264)]=a4_0x49b511(0x25a);[a4_0x49b511(0x28f)]=a4_0x49b511(0x203);async[a4_0x49b511(0x280)](_0x1704ac){const _0x293f25=a4_0x49b511,{options:_0x4f435b,args:_0x2c9d4d,tdx:_0x366d4f}=_0x1704ac,_0x32d457=_0x2c9d4d[0x0],_0xda81d7=_0x2c9d4d[0x1],_0x2ffb4e=_0x4f435b[_0x293f25(0x23a)],_0x1f0361=_0x4f435b[_0x293f25(0x22b)],_0x1818ef=_0x4f435b['force'],_0x3adee1=_0x4f435b['yes'],_0x1762c0=_0x4f435b[_0x293f25(0x244)],_0x101655=_0x4f435b[_0x293f25(0x24b)];let _0xee782a;if(_0x32d457){const _0x489734=a4_0x36be1b[_0x293f25(0x1eb)](_0x32d457,'tdx.json');if(existsSync(_0x489734))try{const _0x6ad9a9=JSON[_0x293f25(0x228)](readFileSync(_0x489734,_0x293f25(0x283)));_0x6ad9a9[_0x293f25(0x209)]&&(_0xee782a={'llm_project':_0x6ad9a9['llm_project']});}catch{}}const _0x21a44a=findAgentConfigPath(process[_0x293f25(0x27b)]());let _0x13ade0;if(_0x21a44a)try{const _0xe9432c=JSON[_0x293f25(0x228)](readFileSync(_0x21a44a,_0x293f25(0x283)));_0xe9432c[_0x293f25(0x209)]&&(_0x13ade0={'llm_project':_0xe9432c[_0x293f25(0x209)]});}catch{}const _0x55c481=resolveAgentPullArgs({'arg':_0x32d457,'agentNameArg':_0xda81d7,'agentFlag':_0x101655,'contextProject':_0x1762c0,'argDirConfig':_0xee782a,'cwdConfigPath':_0x21a44a||undefined,'cwdConfig':_0x13ade0}),{projectNameOrId:_0x1a7a33,targetAgentName:_0x417393,existingOutputDir:_0x49e663,source:_0x5b99ea}=_0x55c481;if(_0x5b99ea===_0x293f25(0x28c))console[_0x293f25(0x225)](a4_0x43a6ab[_0x293f25(0x222)](_0x293f25(0x260)+a4_0x36be1b[_0x293f25(0x1eb)](_0x32d457,'tdx.json')+':\x20'+_0x1a7a33));else{if(_0x5b99ea===_0x293f25(0x292))console[_0x293f25(0x225)](a4_0x43a6ab[_0x293f25(0x222)](_0x293f25(0x25d)+_0x1a7a33));else _0x5b99ea===_0x293f25(0x297)&&console[_0x293f25(0x225)](a4_0x43a6ab[_0x293f25(0x222)](_0x293f25(0x1f1)+_0x1a7a33));}if(!_0x1a7a33)return _0x101655?(console[_0x293f25(0x225)](a4_0x43a6ab['yellow']('The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a')),console[_0x293f25(0x225)](_0x293f25(0x252)),console[_0x293f25(0x225)](_0x293f25(0x1fb))):(console['log'](a4_0x43a6ab['yellow'](_0x293f25(0x267))),console[_0x293f25(0x225)](_0x293f25(0x24d)),console[_0x293f25(0x225)](_0x293f25(0x265)),console[_0x293f25(0x225)](_0x293f25(0x285)),console[_0x293f25(0x225)]('\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['log'](_0x293f25(0x229))),0x1;if(_0x417393){const {data:_0x1fb241}=await withSpinner(_0x293f25(0x206)+_0x417393+_0x293f25(0x261)+_0x1a7a33+_0x293f25(0x277),()=>_0x366d4f[_0x293f25(0x1f6)]['pullAgent'](_0x1a7a33,_0x417393,_0x2ffb4e,{'dryRun':_0x1f0361,'force':_0x1818ef}));if(_0x1f0361)return console['log'](a4_0x43a6ab[_0x293f25(0x226)](_0x293f25(0x20f))),console[_0x293f25(0x225)](_0x293f25(0x20e)+_0x1fb241[_0x293f25(0x1e4)]),console[_0x293f25(0x225)](_0x293f25(0x250)+_0x1fb241[_0x293f25(0x25c)]),_0x1fb241[_0x293f25(0x25f)]&&(console[_0x293f25(0x225)](_0x293f25(0x291)),console[_0x293f25(0x225)]('─'[_0x293f25(0x271)](0x3c)),console[_0x293f25(0x225)](_0x1fb241[_0x293f25(0x25f)]),console[_0x293f25(0x225)]('─'[_0x293f25(0x271)](0x3c))),0x0;return console['log'](a4_0x43a6ab[_0x293f25(0x282)](_0x293f25(0x204))),console['log'](_0x293f25(0x257)+_0x1fb241[_0x293f25(0x1e4)]),console['log']('Output:\x20'+_0x1fb241[_0x293f25(0x25c)]),console[_0x293f25(0x225)]('Status:\x20'+(_0x1fb241['isNew']?a4_0x43a6ab[_0x293f25(0x282)](_0x293f25(0x1ea)):_0x1fb241['hasChanges']?a4_0x43a6ab[_0x293f25(0x226)](_0x293f25(0x27c)):a4_0x43a6ab['gray'](_0x293f25(0x1e6)))),0x0;}const _0x547942=_0x49e663||_0x2ffb4e,{data:_0x3e5790}=await withSpinner(_0x293f25(0x296)+_0x1a7a33+_0x293f25(0x277),()=>_0x366d4f[_0x293f25(0x1f6)][_0x293f25(0x21d)](_0x1a7a33,_0x547942,{'dryRun':!![]})),_0x25e768=_0x3e5790[_0x293f25(0x20d)][_0x293f25(0x21a)][_0x293f25(0x1ea)]+_0x3e5790[_0x293f25(0x20d)]['knowledgeBases']['new']+_0x3e5790[_0x293f25(0x20d)][_0x293f25(0x286)][_0x293f25(0x1ea)]+_0x3e5790[_0x293f25(0x20d)][_0x293f25(0x1ec)][_0x293f25(0x1ea)]+_0x3e5790[_0x293f25(0x20d)][_0x293f25(0x24e)][_0x293f25(0x1ea)]+_0x3e5790['counts'][_0x293f25(0x266)][_0x293f25(0x1ea)]+_0x3e5790[_0x293f25(0x20d)]['experimentalArtifacts']['new'],_0x361291=_0x3e5790['counts'][_0x293f25(0x21a)][_0x293f25(0x27c)]+_0x3e5790[_0x293f25(0x20d)][_0x293f25(0x1e3)][_0x293f25(0x27c)]+_0x3e5790['counts']['textKnowledgeBases'][_0x293f25(0x27c)]+_0x3e5790[_0x293f25(0x20d)][_0x293f25(0x1ec)][_0x293f25(0x27c)]+_0x3e5790['counts'][_0x293f25(0x24e)][_0x293f25(0x27c)]+_0x3e5790[_0x293f25(0x20d)]['experimentalKnowledgeBases'][_0x293f25(0x27c)]+_0x3e5790[_0x293f25(0x20d)][_0x293f25(0x258)][_0x293f25(0x27c)],_0x171f1c=_0x3e5790[_0x293f25(0x20d)]['agents'][_0x293f25(0x1e6)]+_0x3e5790[_0x293f25(0x20d)]['knowledgeBases'][_0x293f25(0x1e6)]+_0x3e5790['counts'][_0x293f25(0x286)]['unchanged']+_0x3e5790[_0x293f25(0x20d)][_0x293f25(0x1ec)]['unchanged']+_0x3e5790[_0x293f25(0x20d)]['integrations'][_0x293f25(0x1e6)]+_0x3e5790[_0x293f25(0x20d)][_0x293f25(0x266)]['unchanged']+_0x3e5790[_0x293f25(0x20d)]['experimentalArtifacts'][_0x293f25(0x1e6)];console[_0x293f25(0x225)](_0x293f25(0x205)+_0x3e5790[_0x293f25(0x231)]+'\x27:'),console[_0x293f25(0x225)]('\x20\x20'+a4_0x43a6ab[_0x293f25(0x282)]('+\x20'+_0x25e768+_0x293f25(0x263))+_0x293f25(0x1f8)+a4_0x43a6ab['yellow']('~\x20'+_0x361291+_0x293f25(0x1fe))+'\x20|\x20'+a4_0x43a6ab[_0x293f25(0x222)]('=\x20'+_0x171f1c+_0x293f25(0x233))),console['log'](_0x293f25(0x25b)+formatCountSummary(_0x3e5790[_0x293f25(0x20d)][_0x293f25(0x21a)])),console[_0x293f25(0x225)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x3e5790[_0x293f25(0x20d)][_0x293f25(0x1e3)])),console[_0x293f25(0x225)](_0x293f25(0x21f)+formatCountSummary(_0x3e5790[_0x293f25(0x20d)][_0x293f25(0x286)])),console['log'](_0x293f25(0x23d)+formatCountSummary(_0x3e5790[_0x293f25(0x20d)]['prompts'])),console[_0x293f25(0x225)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x3e5790[_0x293f25(0x20d)]['integrations']));const _0xcb86d=_0x3e5790['counts']['experimentalKnowledgeBases']['total']>0x0||_0x3e5790[_0x293f25(0x20d)][_0x293f25(0x258)]['total']>0x0;_0xcb86d&&(console[_0x293f25(0x225)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x3e5790[_0x293f25(0x20d)][_0x293f25(0x266)])),console[_0x293f25(0x225)](_0x293f25(0x281)+formatCountSummary(_0x3e5790['counts'][_0x293f25(0x258)])));console[_0x293f25(0x225)](_0x293f25(0x238)+a4_0x43a6ab['cyan'](_0x3e5790[_0x293f25(0x236)])),displayDiffs(_0x3e5790[_0x293f25(0x21a)],_0x3e5790[_0x293f25(0x1e3)],_0x3e5790[_0x293f25(0x286)],_0x3e5790[_0x293f25(0x1ec)],_0x3e5790[_0x293f25(0x24e)],_0x3e5790[_0x293f25(0x266)],_0x3e5790['experimentalArtifacts']);if(_0x1f0361)return console['log'](a4_0x43a6ab[_0x293f25(0x226)](_0x293f25(0x28a))),0x0;if(_0x25e768===0x0&&_0x361291===0x0)return console[_0x293f25(0x225)](a4_0x43a6ab[_0x293f25(0x282)](_0x293f25(0x21e))),saveSessionContext({'llm_project':_0x3e5790[_0x293f25(0x231)]},_0x4f435b['session']),console[_0x293f25(0x225)](a4_0x43a6ab[_0x293f25(0x282)](_0x293f25(0x279)+a4_0x43a6ab[_0x293f25(0x222)](_0x293f25(0x209))+'\x20=\x20'+a4_0x43a6ab['cyan'](_0x3e5790[_0x293f25(0x231)]))),0x0;if(!_0x3adee1&&!_0x1818ef){if(!isInteractive())return console[_0x293f25(0x202)](a4_0x43a6ab[_0x293f25(0x1f3)]('\x0aError:'),_0x293f25(0x239)),console[_0x293f25(0x202)](a4_0x43a6ab[_0x293f25(0x222)](_0x293f25(0x268))),0x1;const _0x57e36f=await confirmKey(_0x293f25(0x237)+(_0x25e768+_0x361291)+'\x20files?');if(!_0x57e36f)return console[_0x293f25(0x225)](a4_0x43a6ab['yellow'](_0x293f25(0x22d)),_0x293f25(0x247)),0x1;}const {data:_0x2b0c37}=await withSpinner(_0x293f25(0x219),()=>_0x366d4f[_0x293f25(0x1f6)]['pullProject'](_0x1a7a33,_0x547942,{'force':_0x1818ef}));return console['log'](a4_0x43a6ab[_0x293f25(0x282)](_0x293f25(0x218)+(_0x25e768+_0x361291)+'\x20files\x20to\x20'+_0x2b0c37['outputDir'])),saveSessionContext({'llm_project':_0x2b0c37[_0x293f25(0x231)]},_0x4f435b[_0x293f25(0x299)]),console[_0x293f25(0x225)](a4_0x43a6ab[_0x293f25(0x282)](_0x293f25(0x279)+a4_0x43a6ab[_0x293f25(0x222)](_0x293f25(0x209))+_0x293f25(0x217)+a4_0x43a6ab[_0x293f25(0x22c)](_0x2b0c37[_0x293f25(0x231)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{['name']='agent:clone';[a4_0x49b511(0x28f)]='Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project';async[a4_0x49b511(0x280)](_0x288567){const _0xdedd01=a4_0x49b511,{options:_0xbb351e,args:_0x592ac7,tdx:_0x4c6bac}=_0x288567,_0x1f3633=_0x592ac7[0x0],_0x1800c5=_0xbb351e[_0xdedd01(0x264)],_0x5f3b72=_0xbb351e['dryRun'],_0x5a8b9f=_0xbb351e[_0xdedd01(0x240)],_0x4c6a9b=_0xbb351e['site'],_0x5bb2c9=_0xbb351e[_0xdedd01(0x244)];let _0x59bf96;const _0x11e0fa=findAgentConfigPath(process[_0xdedd01(0x27b)]());if(_0x1f3633){const _0xd2a77c=a4_0x36be1b[_0xdedd01(0x1eb)](_0x1f3633,_0xdedd01(0x23c));existsSync(_0xd2a77c)?(_0x59bf96=_0x1f3633,console['log'](a4_0x43a6ab[_0xdedd01(0x222)](_0xdedd01(0x23f)+_0x1f3633))):_0x59bf96=_0x1f3633;}else{if(_0x11e0fa)_0x59bf96=a4_0x36be1b[_0xdedd01(0x27e)](_0x11e0fa),console[_0xdedd01(0x225)](a4_0x43a6ab[_0xdedd01(0x222)](_0xdedd01(0x26c)+_0x59bf96));else{if(_0x5bb2c9){const _0x282acf=sanitizeForFilesystem(_0x5bb2c9);let _0xb4cc75=_0x282acf,_0x3159a3=a4_0x36be1b[_0xdedd01(0x1eb)](process[_0xdedd01(0x27b)](),_0xdedd01(0x21a),_0x282acf,_0xdedd01(0x23c));if(!existsSync(_0x3159a3)){const _0x269852=normalizeName(_0x5bb2c9),_0x40aec1=a4_0x36be1b['join'](process['cwd'](),_0xdedd01(0x21a),_0x269852,_0xdedd01(0x23c));existsSync(_0x40aec1)&&(_0xb4cc75=_0x269852,_0x3159a3=_0x40aec1);}if(existsSync(_0x3159a3))_0x59bf96=a4_0x36be1b['dirname'](_0x3159a3),console[_0xdedd01(0x225)](a4_0x43a6ab[_0xdedd01(0x222)](_0xdedd01(0x23f)+_0x59bf96));else{const _0x422f63=_0xbb351e['profile'];if(_0x422f63)throw new SDKError(ErrorCode[_0xdedd01(0x278)],_0xdedd01(0x1e1)+_0x5bb2c9+_0xdedd01(0x28d),undefined,{'helpText':'When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a'+_0xdedd01(0x254)+(_0xdedd01(0x1f9)+_0x5bb2c9+'\x0a')+(_0xdedd01(0x241)+_0xb4cc75+'\x20--name\x20'+(_0x1800c5||_0xdedd01(0x20c))+_0xdedd01(0x295)+_0x422f63)});_0x59bf96=_0x5bb2c9,console[_0xdedd01(0x225)](a4_0x43a6ab[_0xdedd01(0x222)](_0xdedd01(0x232)+_0x5bb2c9));}}}}if(!_0x59bf96)return console[_0xdedd01(0x225)](a4_0x43a6ab[_0xdedd01(0x226)](_0xdedd01(0x23b))),console[_0xdedd01(0x225)](_0xdedd01(0x270)),console['log']('\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory'),console[_0xdedd01(0x225)](_0xdedd01(0x272)),console[_0xdedd01(0x225)](_0xdedd01(0x215)),0x1;if(!_0x1800c5)throw new SDKError(ErrorCode[_0xdedd01(0x235)],_0xdedd01(0x21b),undefined,{'helpText':_0xdedd01(0x216)});if(!_0x5a8b9f&&!_0x5f3b72){if(!isInteractive())return console[_0xdedd01(0x202)](a4_0x43a6ab[_0xdedd01(0x1f3)](_0xdedd01(0x298)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0xdedd01(0x202)](a4_0x43a6ab[_0xdedd01(0x222)](_0xdedd01(0x268))),0x1;const _0x434554=await confirmKey(_0xdedd01(0x28b)+_0x59bf96+_0xdedd01(0x1e9)+_0x1800c5+'\x22?');if(!_0x434554)return console[_0xdedd01(0x225)](a4_0x43a6ab[_0xdedd01(0x226)](_0xdedd01(0x22d))),0x1;}const {data:_0x4965bc}=await withSpinner(_0xdedd01(0x256)+_0x59bf96+_0xdedd01(0x200)+_0x1800c5+_0xdedd01(0x277),()=>_0x4c6bac['llm'][_0xdedd01(0x214)](_0x59bf96,_0x1800c5,{'dryRun':_0x5f3b72}));if(_0x5f3b72){console[_0xdedd01(0x225)](a4_0x43a6ab[_0xdedd01(0x226)](_0xdedd01(0x27f))),console[_0xdedd01(0x225)]('Source:\x20'+_0x4965bc[_0xdedd01(0x246)]),console['log'](_0xdedd01(0x27d)+_0x1800c5),console[_0xdedd01(0x225)](_0xdedd01(0x213)),console[_0xdedd01(0x225)]('\x20\x20Agents:\x20'+_0x4965bc[_0xdedd01(0x20d)][_0xdedd01(0x21a)][_0xdedd01(0x22a)]),console[_0xdedd01(0x225)](_0xdedd01(0x25e)+_0x4965bc[_0xdedd01(0x20d)][_0xdedd01(0x1e3)][_0xdedd01(0x22a)]),console[_0xdedd01(0x225)](_0xdedd01(0x23d)+_0x4965bc[_0xdedd01(0x20d)][_0xdedd01(0x1ec)][_0xdedd01(0x22a)]);const _0x7a3b12=_0x4965bc[_0xdedd01(0x20d)][_0xdedd01(0x266)][_0xdedd01(0x22a)]>0x0||_0x4965bc[_0xdedd01(0x20d)][_0xdedd01(0x258)][_0xdedd01(0x22a)]>0x0;return _0x7a3b12&&(console['log'](_0xdedd01(0x1e7)+_0x4965bc[_0xdedd01(0x20d)][_0xdedd01(0x266)][_0xdedd01(0x22a)]),console[_0xdedd01(0x225)]('\x20\x20Experimental\x20Artifacts:\x20'+_0x4965bc[_0xdedd01(0x20d)][_0xdedd01(0x258)][_0xdedd01(0x22a)])),0x0;}const _0x778c4f=_0x4965bc['counts']['agents'][_0xdedd01(0x211)]>0x0||_0x4965bc['counts']['knowledgeBases'][_0xdedd01(0x211)]>0x0||_0x4965bc['counts'][_0xdedd01(0x1ec)][_0xdedd01(0x211)]>0x0||_0x4965bc['counts'][_0xdedd01(0x266)][_0xdedd01(0x211)]>0x0||_0x4965bc[_0xdedd01(0x20d)][_0xdedd01(0x258)][_0xdedd01(0x211)]>0x0;_0x778c4f?console[_0xdedd01(0x225)](a4_0x43a6ab[_0xdedd01(0x226)]('Project\x20cloned\x20with\x20errors')):console['log'](a4_0x43a6ab[_0xdedd01(0x282)](_0xdedd01(0x234)));console[_0xdedd01(0x225)]('Source:\x20'+_0x4965bc['sourceProjectName']),console['log'](_0xdedd01(0x27d)+_0x4965bc[_0xdedd01(0x22e)]),console['log'](_0xdedd01(0x26f)+_0x4965bc[_0xdedd01(0x20a)]),console['log'](),console[_0xdedd01(0x225)]('Summary:'),console['log'](_0xdedd01(0x25b)+formatCountSummary(_0x4965bc[_0xdedd01(0x20d)][_0xdedd01(0x21a)])),console['log'](_0xdedd01(0x25e)+formatCountSummary(_0x4965bc[_0xdedd01(0x20d)][_0xdedd01(0x1e3)])),console[_0xdedd01(0x225)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x4965bc['counts']['prompts'])),console[_0xdedd01(0x225)](_0xdedd01(0x24f)+formatCountSummary(_0x4965bc[_0xdedd01(0x20d)][_0xdedd01(0x24e)]));const _0x51eb5b=_0x4965bc[_0xdedd01(0x20d)][_0xdedd01(0x266)]['created']>0x0||_0x4965bc[_0xdedd01(0x20d)][_0xdedd01(0x266)][_0xdedd01(0x27c)]>0x0||_0x4965bc['counts'][_0xdedd01(0x266)][_0xdedd01(0x1e6)]>0x0||_0x4965bc[_0xdedd01(0x20d)]['experimentalArtifacts'][_0xdedd01(0x22a)]>0x0||_0x4965bc['counts'][_0xdedd01(0x258)][_0xdedd01(0x27c)]>0x0||_0x4965bc['counts'][_0xdedd01(0x258)][_0xdedd01(0x1e6)]>0x0;_0x51eb5b&&(console[_0xdedd01(0x225)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x4965bc['counts'][_0xdedd01(0x266)])),console[_0xdedd01(0x225)](_0xdedd01(0x281)+formatCountSummary(_0x4965bc[_0xdedd01(0x20d)][_0xdedd01(0x258)])));if(_0x778c4f){console[_0xdedd01(0x225)](),console[_0xdedd01(0x225)](a4_0x43a6ab[_0xdedd01(0x1f3)]('Errors:'));for(const _0x714b3f of _0x4965bc[_0xdedd01(0x21a)]){_0x714b3f[_0xdedd01(0x248)]==='error'&&console[_0xdedd01(0x225)](a4_0x43a6ab[_0xdedd01(0x1f3)](_0xdedd01(0x1ed)+_0x714b3f[_0xdedd01(0x1e4)]+'\x22:\x20'+_0x714b3f[_0xdedd01(0x202)]));}for(const _0x593bfe of _0x4965bc[_0xdedd01(0x1e3)]){_0x593bfe[_0xdedd01(0x248)]==='error'&&console[_0xdedd01(0x225)](a4_0x43a6ab[_0xdedd01(0x1f3)](_0xdedd01(0x212)+_0x593bfe['name']+_0xdedd01(0x23e)+_0x593bfe['error']));}for(const _0x3b87da of _0x4965bc['prompts']){_0x3b87da[_0xdedd01(0x248)]===_0xdedd01(0x202)&&console[_0xdedd01(0x225)](a4_0x43a6ab[_0xdedd01(0x1f3)](_0xdedd01(0x26b)+_0x3b87da['name']+_0xdedd01(0x23e)+_0x3b87da['error']));}for(const _0xc8856b of _0x4965bc[_0xdedd01(0x24e)]){_0xc8856b[_0xdedd01(0x248)]===_0xdedd01(0x202)&&console['log'](a4_0x43a6ab[_0xdedd01(0x1f3)]('\x20\x20Integration\x20\x22'+_0xc8856b['name']+_0xdedd01(0x23e)+_0xc8856b['error']));}for(const _0x5d41b2 of _0x4965bc[_0xdedd01(0x266)]){_0x5d41b2[_0xdedd01(0x248)]===_0xdedd01(0x202)&&console[_0xdedd01(0x225)](a4_0x43a6ab[_0xdedd01(0x1f3)]('\x20\x20Experimental\x20Knowledge\x20Base\x20\x22'+_0x5d41b2['name']+'\x22:\x20'+_0x5d41b2['error']));}for(const _0x3f32c3 of _0x4965bc[_0xdedd01(0x258)]){_0x3f32c3[_0xdedd01(0x248)]===_0xdedd01(0x202)&&console[_0xdedd01(0x225)](a4_0x43a6ab[_0xdedd01(0x1f3)](_0xdedd01(0x251)+_0x3f32c3['name']+_0xdedd01(0x23e)+_0x3f32c3[_0xdedd01(0x202)]));}return 0x1;}console[_0xdedd01(0x225)]();const _0x42a576=getLLMProjectUrl(_0x4c6a9b,_0x4965bc[_0xdedd01(0x20a)]);return console[_0xdedd01(0x225)]('Project:\x20'+a4_0x43a6ab[_0xdedd01(0x22c)](_0x42a576)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x49b511(0x264)]='agent:push';[a4_0x49b511(0x28f)]=a4_0x49b511(0x1fc);async['execute'](_0x83f232){const _0x53efe8=a4_0x49b511,{options:_0x167942,args:_0x5e24b2,tdx:_0x3644cf}=_0x83f232;let _0x2af0c6=_0x5e24b2[0x0]||process[_0x53efe8(0x27b)]();const _0x1b6b1f=_0x167942[_0x53efe8(0x22b)],_0x1118f0=_0x167942[_0x53efe8(0x208)],_0x444803=_0x167942[_0x53efe8(0x240)],_0x699cc9=_0x167942[_0x53efe8(0x1ff)],_0x5a2bed=a4_0x36be1b[_0x53efe8(0x1eb)](_0x2af0c6,_0x53efe8(0x1f0)),_0x19b9f8=existsSync(_0x5a2bed);if(_0x19b9f8){const {data:_0x5ccb1d}=await withSpinner(_0x53efe8(0x287)+_0x2af0c6+_0x53efe8(0x277),()=>_0x3644cf[_0x53efe8(0x1f6)][_0x53efe8(0x243)](_0x2af0c6,{'dryRun':_0x1b6b1f,'force':_0x1118f0}));if(_0x1b6b1f)return console[_0x53efe8(0x225)](a4_0x43a6ab[_0x53efe8(0x226)](_0x53efe8(0x27f))),console[_0x53efe8(0x225)](_0x53efe8(0x1e5)+_0x5ccb1d['agentName']),0x0;if(_0x5ccb1d[_0x53efe8(0x248)]==='error')return console[_0x53efe8(0x225)](a4_0x43a6ab[_0x53efe8(0x1f3)](_0x53efe8(0x1f2)+_0x5ccb1d['error'])),0x1;console[_0x53efe8(0x225)](a4_0x43a6ab['green']('Agent\x20'+_0x5ccb1d[_0x53efe8(0x248)]+'\x20successfully')),console[_0x53efe8(0x225)](_0x53efe8(0x257)+_0x5ccb1d['agentName']);if(_0x5ccb1d[_0x53efe8(0x26d)]&&_0x5ccb1d[_0x53efe8(0x276)]){const _0x19ac63=getLLMAgentChatUrl(_0x699cc9,_0x5ccb1d[_0x53efe8(0x276)],_0x5ccb1d[_0x53efe8(0x26d)]);console[_0x53efe8(0x225)](_0x53efe8(0x242)+a4_0x43a6ab[_0x53efe8(0x22c)](_0x19ac63));}return 0x0;}const _0x57b003=_0x167942[_0x53efe8(0x244)],_0x1a0c1a=resolveProjectFromContext(_0x2af0c6,_0x57b003);if(_0x1a0c1a['found'])_0x2af0c6=_0x1a0c1a[_0x53efe8(0x1e8)],_0x1a0c1a[_0x53efe8(0x255)]===_0x53efe8(0x297)&&console[_0x53efe8(0x225)](a4_0x43a6ab['dim'](_0x53efe8(0x25d)+_0x2af0c6));else{let _0x3c507d=_0x53efe8(0x27a);_0x1a0c1a[_0x53efe8(0x220)]===_0x53efe8(0x1f5)&&(_0x3c507d=_0x1a0c1a['message']+_0x53efe8(0x224)+_0x1a0c1a[_0x53efe8(0x244)]+_0x53efe8(0x1f4));throw new SDKError(ErrorCode[_0x53efe8(0x278)],_0x1a0c1a[_0x53efe8(0x220)]==='no_context'?_0x1a0c1a[_0x53efe8(0x227)]:'No\x20tdx.json\x20found\x20in\x20'+_0x2af0c6,undefined,{'helpText':_0x3c507d});}const {data:_0x357659}=await withSpinner('Analyzing\x20changes\x20to\x20push...',()=>_0x3644cf[_0x53efe8(0x1f6)]['pushProject'](_0x2af0c6,{'dryRun':!![]})),_0x5115c5=_0x357659[_0x53efe8(0x20d)][_0x53efe8(0x21a)][_0x53efe8(0x211)]>0x0;if(_0x5115c5){console['log'](a4_0x43a6ab[_0x53efe8(0x1f3)](_0x53efe8(0x26a)));for(const _0x5f01a0 of _0x357659['agents']){_0x5f01a0[_0x53efe8(0x248)]===_0x53efe8(0x202)&&console[_0x53efe8(0x225)](a4_0x43a6ab[_0x53efe8(0x1f3)](_0x53efe8(0x1ed)+_0x5f01a0['agentName']+_0x53efe8(0x23e)+_0x5f01a0['error']));}return 0x1;}const _0x424bc8=_0x357659[_0x53efe8(0x20d)][_0x53efe8(0x21a)][_0x53efe8(0x22a)]+_0x357659['counts'][_0x53efe8(0x1e3)][_0x53efe8(0x22a)]+_0x357659[_0x53efe8(0x20d)]['textKnowledgeBases']['created']+_0x357659['counts'][_0x53efe8(0x1ec)][_0x53efe8(0x22a)]+_0x357659[_0x53efe8(0x20d)][_0x53efe8(0x24e)][_0x53efe8(0x22a)]+_0x357659[_0x53efe8(0x20d)]['experimentalKnowledgeBases'][_0x53efe8(0x22a)]+_0x357659[_0x53efe8(0x20d)][_0x53efe8(0x258)][_0x53efe8(0x22a)],_0x25d823=_0x357659[_0x53efe8(0x20d)][_0x53efe8(0x21a)][_0x53efe8(0x27c)]+_0x357659[_0x53efe8(0x20d)][_0x53efe8(0x1e3)][_0x53efe8(0x27c)]+_0x357659[_0x53efe8(0x20d)][_0x53efe8(0x286)][_0x53efe8(0x27c)]+_0x357659[_0x53efe8(0x20d)][_0x53efe8(0x1ec)][_0x53efe8(0x27c)]+_0x357659['counts']['integrations'][_0x53efe8(0x27c)]+_0x357659[_0x53efe8(0x20d)][_0x53efe8(0x266)][_0x53efe8(0x27c)]+_0x357659[_0x53efe8(0x20d)][_0x53efe8(0x258)][_0x53efe8(0x27c)],_0x5f1237=_0x357659[_0x53efe8(0x20d)][_0x53efe8(0x21a)]['unchanged']+_0x357659[_0x53efe8(0x20d)]['knowledgeBases'][_0x53efe8(0x1e6)]+_0x357659[_0x53efe8(0x20d)][_0x53efe8(0x286)][_0x53efe8(0x1e6)]+_0x357659[_0x53efe8(0x20d)]['prompts'][_0x53efe8(0x1e6)]+_0x357659['counts'][_0x53efe8(0x24e)][_0x53efe8(0x1e6)]+_0x357659[_0x53efe8(0x20d)][_0x53efe8(0x266)]['unchanged']+_0x357659[_0x53efe8(0x20d)][_0x53efe8(0x258)][_0x53efe8(0x1e6)];console['log'](_0x53efe8(0x1ee)+_0x357659['projectName']+'\x27:'),console[_0x53efe8(0x225)]('\x20\x20'+a4_0x43a6ab[_0x53efe8(0x282)]('+\x20'+_0x424bc8+_0x53efe8(0x263))+'\x20|\x20'+a4_0x43a6ab['yellow']('~\x20'+_0x25d823+'\x20changed')+_0x53efe8(0x1f8)+a4_0x43a6ab[_0x53efe8(0x222)]('=\x20'+_0x5f1237+'\x20unchanged')),console['log'](_0x53efe8(0x25b)+formatCountSummary(_0x357659[_0x53efe8(0x20d)][_0x53efe8(0x21a)])),console[_0x53efe8(0x225)](_0x53efe8(0x25e)+formatCountSummary(_0x357659[_0x53efe8(0x20d)][_0x53efe8(0x1e3)])),console['log'](_0x53efe8(0x21f)+formatCountSummary(_0x357659['counts'][_0x53efe8(0x286)])),console[_0x53efe8(0x225)](_0x53efe8(0x23d)+formatCountSummary(_0x357659[_0x53efe8(0x20d)][_0x53efe8(0x1ec)])),console[_0x53efe8(0x225)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x357659['counts']['integrations']));const _0x3bcd62=_0x357659['counts']['experimentalKnowledgeBases'][_0x53efe8(0x22a)]>0x0||_0x357659['counts']['experimentalKnowledgeBases'][_0x53efe8(0x27c)]>0x0||_0x357659[_0x53efe8(0x20d)]['experimentalKnowledgeBases'][_0x53efe8(0x1e6)]>0x0||_0x357659[_0x53efe8(0x20d)][_0x53efe8(0x258)]['created']>0x0||_0x357659[_0x53efe8(0x20d)][_0x53efe8(0x258)][_0x53efe8(0x27c)]>0x0||_0x357659[_0x53efe8(0x20d)][_0x53efe8(0x258)][_0x53efe8(0x1e6)]>0x0;_0x3bcd62&&(console[_0x53efe8(0x225)](_0x53efe8(0x1e7)+formatCountSummary(_0x357659[_0x53efe8(0x20d)][_0x53efe8(0x266)])),console['log'](_0x53efe8(0x281)+formatCountSummary(_0x357659['counts'][_0x53efe8(0x258)])));console[_0x53efe8(0x225)]('\x20\x20Source:\x20'+a4_0x43a6ab[_0x53efe8(0x22c)](_0x2af0c6)),displayDiffs(_0x357659['agents'],_0x357659[_0x53efe8(0x1e3)],_0x357659['textKnowledgeBases'],_0x357659[_0x53efe8(0x1ec)],_0x357659[_0x53efe8(0x24e)],_0x357659['experimentalKnowledgeBases'],_0x357659[_0x53efe8(0x258)]);if(_0x1b6b1f)return console[_0x53efe8(0x225)](a4_0x43a6ab[_0x53efe8(0x226)](_0x53efe8(0x293))),0x0;if(_0x424bc8===0x0&&_0x25d823===0x0){console[_0x53efe8(0x225)](a4_0x43a6ab[_0x53efe8(0x282)](_0x53efe8(0x269)));const _0x426aa4=getLLMProjectUrl(_0x699cc9,_0x357659[_0x53efe8(0x276)]);return console[_0x53efe8(0x225)](_0x53efe8(0x259)+a4_0x43a6ab['cyan'](_0x426aa4)),0x0;}if(!_0x444803&&!_0x1118f0){if(!isInteractive())return console[_0x53efe8(0x202)](a4_0x43a6ab[_0x53efe8(0x1f3)](_0x53efe8(0x298)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x53efe8(0x202)](a4_0x43a6ab[_0x53efe8(0x222)](_0x53efe8(0x268))),0x1;const _0x3297d8=await confirmKey(_0x53efe8(0x245)+(_0x424bc8+_0x25d823)+_0x53efe8(0x1fa));if(!_0x3297d8)return console[_0x53efe8(0x225)](a4_0x43a6ab[_0x53efe8(0x226)](_0x53efe8(0x22d)),_0x53efe8(0x221)),0x1;}const {data:_0x4bf8e6}=await withSpinner(_0x53efe8(0x253),()=>_0x3644cf[_0x53efe8(0x1f6)][_0x53efe8(0x273)](_0x2af0c6,{'force':_0x1118f0})),_0x3a16f9=_0x4bf8e6[_0x53efe8(0x20d)][_0x53efe8(0x21a)][_0x53efe8(0x211)]>0x0||_0x4bf8e6['counts'][_0x53efe8(0x1e3)]['errors']>0x0||_0x4bf8e6[_0x53efe8(0x20d)][_0x53efe8(0x286)][_0x53efe8(0x211)]>0x0||_0x4bf8e6[_0x53efe8(0x20d)]['prompts'][_0x53efe8(0x211)]>0x0;if(_0x3a16f9){console[_0x53efe8(0x225)](a4_0x43a6ab[_0x53efe8(0x226)](_0x53efe8(0x201))),console[_0x53efe8(0x225)](),console[_0x53efe8(0x225)](a4_0x43a6ab[_0x53efe8(0x1f3)](_0x53efe8(0x289)));for(const _0x392d74 of _0x4bf8e6[_0x53efe8(0x21a)]){_0x392d74[_0x53efe8(0x248)]===_0x53efe8(0x202)&&console['log'](a4_0x43a6ab[_0x53efe8(0x1f3)](_0x53efe8(0x1ed)+_0x392d74['agentName']+_0x53efe8(0x23e)+_0x392d74[_0x53efe8(0x202)]));}for(const _0x3bf9ab of _0x4bf8e6['knowledgeBases']){_0x3bf9ab[_0x53efe8(0x248)]===_0x53efe8(0x202)&&console[_0x53efe8(0x225)](a4_0x43a6ab[_0x53efe8(0x1f3)]('\x20\x20Knowledge\x20Base\x20\x22'+_0x3bf9ab[_0x53efe8(0x264)]+'\x22:\x20'+_0x3bf9ab[_0x53efe8(0x202)]));}for(const _0x144805 of _0x4bf8e6[_0x53efe8(0x286)]){_0x144805[_0x53efe8(0x248)]===_0x53efe8(0x202)&&console['log'](a4_0x43a6ab[_0x53efe8(0x1f3)]('\x20\x20Text\x20Knowledge\x20Base\x20\x22'+_0x144805[_0x53efe8(0x264)]+_0x53efe8(0x23e)+_0x144805[_0x53efe8(0x202)]));}for(const _0x4e39a4 of _0x4bf8e6[_0x53efe8(0x1ec)]){_0x4e39a4[_0x53efe8(0x248)]==='error'&&console[_0x53efe8(0x225)](a4_0x43a6ab['red']('\x20\x20Prompt\x20\x22'+_0x4e39a4[_0x53efe8(0x264)]+_0x53efe8(0x23e)+_0x4e39a4[_0x53efe8(0x202)]));}for(const _0x20312e of _0x4bf8e6[_0x53efe8(0x24e)]){_0x20312e[_0x53efe8(0x248)]===_0x53efe8(0x202)&&console['log'](a4_0x43a6ab[_0x53efe8(0x1f3)](_0x53efe8(0x1f7)+_0x20312e[_0x53efe8(0x264)]+_0x53efe8(0x23e)+_0x20312e[_0x53efe8(0x202)]));}return 0x1;}console[_0x53efe8(0x225)](a4_0x43a6ab[_0x53efe8(0x282)](_0x53efe8(0x1fd)+(_0x424bc8+_0x25d823)+'\x20resources\x20to\x20\x27'+_0x4bf8e6[_0x53efe8(0x231)]+'\x27'));const _0x52e0ff=getLLMProjectUrl(_0x699cc9,_0x4bf8e6[_0x53efe8(0x276)]);return console[_0x53efe8(0x225)](_0x53efe8(0x259)+a4_0x43a6ab['cyan'](_0x52e0ff)),0x0;}}
@@ -1 +1 @@
1
- const a5_0x4514ba=a5_0x3409;(function(_0x167e7a,_0xf7756c){const _0xd824a0=a5_0x3409,_0x1ef276=_0x167e7a();while(!![]){try{const _0x434738=parseInt(_0xd824a0(0x141))/0x1*(-parseInt(_0xd824a0(0x1a2))/0x2)+parseInt(_0xd824a0(0x162))/0x3*(parseInt(_0xd824a0(0x14e))/0x4)+-parseInt(_0xd824a0(0x169))/0x5+-parseInt(_0xd824a0(0x19a))/0x6*(parseInt(_0xd824a0(0x1b7))/0x7)+-parseInt(_0xd824a0(0x1a0))/0x8+parseInt(_0xd824a0(0x1c8))/0x9+parseInt(_0xd824a0(0x190))/0xa*(parseInt(_0xd824a0(0x1c5))/0xb);if(_0x434738===_0xf7756c)break;else _0x1ef276['push'](_0x1ef276['shift']());}catch(_0x4e41d2){_0x1ef276['push'](_0x1ef276['shift']());}}}(a5_0xfcd3,0x62b34));function a5_0xfcd3(){const _0x1aecbf=['Run\x20tests\x20for\x20an\x20LLM\x20agent','white','\x20\x20tdx\x20agent\x20test\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20(requires\x20context\x20or\x20tdx.json)','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','\x20(cached)','jsonl','resolveProjectId','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','\x20\x20Evaluating...\x20','\x20\x20Agent:\x20','Test\x20Summary','has','resolveAgentId','16217377eFCIdf','log','some','2763729MJnNBb','repeat','Available\x20tests:\x20','test.yml','Running\x20agent\x20tests...','executeReeval','✓\x20PASS:\x20','Error\x20writing\x20output\x20file:\x20','Agent:\x20','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','utf-8','ERROR','round','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','llmProject','No\x20tests\x20have\x20tags\x20defined.','231XIzXUq','find','/<agent-name>','writeFileSync','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','trim','FAIL','Errors:\x20\x20\x20','Either\x20switch\x20to\x20the\x20\x22','tags','agentDirs','Failed\x20Tests:','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','76432pQOuGo','dim','name','stop','Test\x20','conversation_url','reason','Error:\x20No\x20previous\x20test\x20run\x20found.','now','agent:test','message','table','tsv','timestamp','✗\x20FAIL:\x20','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','\x20-\x20','\x22:\x20','tests','Output\x20written\x20to:\x20','111tRNcKs','found','includes','red','verbose','Round\x20','agentName','3961435BkmVLp','Site:\x20','text','push','Evaluating\x20response...','output','no_tests','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','llm','\x20\x20Project:\x20','New\x20tests\x20to\x20execute:\x20','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','start','Round\x201/','dryRun','execute','Total:\x20\x20\x20\x20','join','\x20\x20Site:\x20','toISOString','length','cyan',':\x20Sending\x20user\x20input...','description','Cached\x20run\x20is\x20from\x20site\x20\x22','agent','Duration:\x20','projectName','conversations','\x20\x20Round\x20','\x27\x20to\x20create\x20the\x20folder\x20structure.','testName','status','projectDir','add','resolve','Running\x20test:\x20','✗\x20ERROR:\x20Project\x20not\x20found:\x20','Failed:\x20\x20\x20','10jCUDVH','split','Re-evaluating\x20','Passed:\x20\x20\x20','✗\x20ERROR:\x20','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','not\x20found','map','Tests\x20found:\x20','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','1103634mrjBNq','green','\x20\x20Conversation:\x20','Running:\x20','PASS','context','1239552faUxKz','404','6658FzjgqC','filter','⚠\x20SKIPPED:\x20','yellow','toLowerCase','reeval','site','forEach','substring','rounds','Available\x20tags:\x20','Re-evaluating...','\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','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','Project\x20path:\x20','multiple_agents','Run\x20\x27tdx\x20agent\x20pull\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','basename','eval','...\x20','14rSlTVD'];a5_0xfcd3=function(){return _0x1aecbf;};return a5_0xfcd3();}import*as a5_0xa4fb5d from'node:fs';import*as a5_0x5dfda6 from'node:path';function a5_0x3409(_0x14ed45,_0x143523){_0x14ed45=_0x14ed45-0x137;const _0xfcd3d6=a5_0xfcd3();let _0x340926=_0xfcd3d6[_0x14ed45];return _0x340926;}import a5_0x1d553d from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x4514ba(0x150)]=a5_0x4514ba(0x157);[a5_0x4514ba(0x180)]=a5_0x4514ba(0x1b8);async[a5_0x4514ba(0x178)](_0x26d33d){const _0x417548=a5_0x4514ba,{options:_0x4387d6,args:_0x4e7e39,tdx:_0x43143c}=_0x26d33d,_0x45467d=_0x4e7e39[0x0]||'.',_0x543870=_0x4387d6[_0x417548(0x177)],_0x413956=_0x4387d6,_0x57f4ea=_0x413956[_0x417548(0x1b5)]===![],_0x5867bb=_0x413956[_0x417548(0x1a7)],_0x483fd0=_0x413956[_0x417548(0x150)],_0x4caab9=_0x413956[_0x417548(0x14a)],_0x56167a=_0x4387d6[_0x417548(0x1a8)],_0x5c25e4=_0x413956[_0x417548(0x16e)];if(_0x5867bb&&_0x57f4ea)return console[_0x417548(0x1c6)](a5_0x1d553d['red'](_0x417548(0x195))),0x1;let _0x18455a='table';if(_0x413956['json'])_0x18455a='json';else{if(_0x413956['jsonl'])_0x18455a=_0x417548(0x1bd);else{if(_0x413956[_0x417548(0x15a)])_0x18455a='tsv';else{if(_0x413956['table'])_0x18455a=_0x417548(0x159);}}}const _0x2c9f6b=_0x413956[_0x417548(0x13f)];let _0x3ccbcf=_0x45467d;const _0x3b4313=a5_0xa4fb5d['existsSync'](_0x45467d),_0x307ebe=_0x45467d==='.';if(!_0x3b4313||_0x307ebe){const _0x2f8349=resolveProjectFromContext(_0x45467d,_0x2c9f6b,{'requireFile':_0x417548(0x1cb)});if(_0x2f8349[_0x417548(0x163)])_0x3ccbcf=_0x2f8349[_0x417548(0x18a)],_0x2f8349['source']===_0x417548(0x19f)&&console[_0x417548(0x1c6)](a5_0x1d553d[_0x417548(0x14f)]('Using\x20agent:\x20'+_0x3ccbcf));else switch(_0x2f8349[_0x417548(0x154)]){case'no_context':console['log'](a5_0x1d553d[_0x417548(0x1a5)](_0x2f8349['message'])),console[_0x417548(0x1c6)](),console[_0x417548(0x1c6)]('Usage:'),console['log'](_0x417548(0x1ae)),console['log'](_0x417548(0x1ba)),console[_0x417548(0x1c6)](),console[_0x417548(0x1c6)](_0x417548(0x1bf));return 0x1;case'no_local_folder':console['log'](a5_0x1d553d[_0x417548(0x1a5)](_0x2f8349[_0x417548(0x158)])),console[_0x417548(0x1c6)](),console[_0x417548(0x1c6)](_0x417548(0x1b2)+_0x2f8349[_0x417548(0x13f)]+_0x417548(0x187));return 0x1;case _0x417548(0x1b1):{const _0x388c54=a5_0x5dfda6[_0x417548(0x1b4)](_0x2f8349[_0x417548(0x18a)]);console['log'](a5_0x1d553d['yellow'](_0x417548(0x13a)+_0x2f8349['llmProject']+'\x22:'));for(const _0xc202a7 of _0x2f8349[_0x417548(0x14b)]){console[_0x417548(0x1c6)]('\x20\x20-\x20'+_0xc202a7);}return console[_0x417548(0x1c6)](),console[_0x417548(0x1c6)](_0x417548(0x174)+_0x388c54+_0x417548(0x143)),0x1;}case _0x417548(0x16f):console[_0x417548(0x1c6)](a5_0x1d553d[_0x417548(0x1a5)](_0x417548(0x199)+_0x2f8349['llmProject']+'\x22.')),console[_0x417548(0x1c6)](a5_0x1d553d[_0x417548(0x14f)](_0x417548(0x1b0)+_0x2f8349[_0x417548(0x18a)])),console['log'](),console[_0x417548(0x1c6)](_0x417548(0x15d));return 0x1;}}const {definition:_0x3cbd8b,agentInfo:_0x3720c5}=parseTestFile(_0x3ccbcf);let _0x58bc38=_0x3cbd8b[_0x417548(0x160)];if(_0x483fd0){const _0x252ba4=_0x483fd0[_0x417548(0x191)](',')[_0x417548(0x197)](_0x3ee16c=>_0x3ee16c[_0x417548(0x146)]());_0x58bc38=_0x3cbd8b[_0x417548(0x160)][_0x417548(0x1a3)](_0x441e19=>_0x252ba4[_0x417548(0x164)](_0x441e19[_0x417548(0x150)]));if(_0x58bc38['length']===0x0)return console[_0x417548(0x1c6)](a5_0x1d553d['yellow']('No\x20tests\x20found\x20matching:\x20'+_0x483fd0)),console[_0x417548(0x1c6)](a5_0x1d553d[_0x417548(0x14f)](_0x417548(0x1ca)+_0x3cbd8b[_0x417548(0x160)][_0x417548(0x197)](_0x5e2daf=>_0x5e2daf[_0x417548(0x150)])[_0x417548(0x17a)](',\x20'))),0x1;}if(_0x4caab9){const _0x10b918=_0x4caab9[_0x417548(0x191)](',')['map'](_0x19fe7d=>_0x19fe7d[_0x417548(0x146)]()[_0x417548(0x1a6)]());_0x58bc38=_0x58bc38['filter'](_0x5b00bb=>_0x5b00bb[_0x417548(0x14a)]?.[_0x417548(0x1c7)](_0x5df7a1=>_0x10b918[_0x417548(0x164)](_0x5df7a1[_0x417548(0x1a6)]())));if(_0x58bc38[_0x417548(0x17d)]===0x0){console[_0x417548(0x1c6)](a5_0x1d553d['yellow']('No\x20tests\x20found\x20with\x20tags:\x20'+_0x4caab9));const _0x55197a=new Set();return _0x3cbd8b[_0x417548(0x160)][_0x417548(0x1a9)](_0x1cbd0e=>_0x1cbd0e[_0x417548(0x14a)]?.[_0x417548(0x1a9)](_0x10d695=>_0x55197a[_0x417548(0x18b)](_0x10d695))),_0x55197a['size']>0x0?console['log'](a5_0x1d553d[_0x417548(0x14f)](_0x417548(0x1ac)+[..._0x55197a][_0x417548(0x17a)](',\x20'))):console[_0x417548(0x1c6)](a5_0x1d553d[_0x417548(0x14f)](_0x417548(0x140))),0x1;}}if(_0x5867bb)return this['executeReeval'](_0x26d33d,{'definition':{'tests':_0x58bc38},'agentInfo':_0x3720c5,'outputFormat':_0x18455a,'outputFile':_0x5c25e4,'testNames':_0x483fd0});if(_0x543870){console['log'](a5_0x1d553d[_0x417548(0x17e)]('Test\x20Configuration:')),console[_0x417548(0x1c6)](_0x417548(0x17b)+a5_0x1d553d[_0x417548(0x1b9)](_0x56167a)),console['log'](_0x417548(0x172)+a5_0x1d553d[_0x417548(0x1b9)](_0x3720c5[_0x417548(0x184)])),console[_0x417548(0x1c6)](_0x417548(0x1c1)+a5_0x1d553d['white'](_0x3720c5[_0x417548(0x168)])),console['log'](),console['log'](_0x417548(0x198)+a5_0x1d553d[_0x417548(0x1b9)](_0x58bc38['length']));for(let _0x10a12e=0x0;_0x10a12e<_0x58bc38[_0x417548(0x17d)];_0x10a12e++){const _0x2b990d=_0x58bc38[_0x10a12e],_0x739ee4=_0x2b990d[_0x417548(0x1ab)][_0x417548(0x17d)]===0x1?_0x417548(0x13d):_0x417548(0x1ab),_0xa11a3c=_0x2b990d[_0x417548(0x14a)]?.[_0x417548(0x17d)]?'\x20['+_0x2b990d[_0x417548(0x14a)][_0x417548(0x17a)](',\x20')+']':'';console[_0x417548(0x1c6)]('\x20\x20'+(_0x10a12e+0x1)+'.\x20'+a5_0x1d553d['white'](_0x2b990d['name'])+'\x20('+_0x2b990d[_0x417548(0x1ab)][_0x417548(0x17d)]+'\x20'+_0x739ee4+')'+a5_0x1d553d[_0x417548(0x14f)](_0xa11a3c));}return 0x0;}let _0x5a48ab,_0x4fe523;try{_0x5a48ab=await _0x43143c[_0x417548(0x171)][_0x417548(0x1be)](_0x3720c5[_0x417548(0x184)]);}catch(_0x2811fc){const _0x5f5acf=_0x2811fc instanceof Error?_0x2811fc[_0x417548(0x158)]:String(_0x2811fc);return _0x5f5acf['includes'](_0x417548(0x1a1))||_0x5f5acf[_0x417548(0x1a6)]()['includes'](_0x417548(0x196))?console[_0x417548(0x1c6)](a5_0x1d553d[_0x417548(0x165)](_0x417548(0x18e)+_0x3720c5[_0x417548(0x184)])):console[_0x417548(0x1c6)](a5_0x1d553d[_0x417548(0x165)](_0x417548(0x1b3)+_0x3720c5['projectName']+_0x417548(0x15f)+_0x5f5acf)),0x1;}try{_0x4fe523=await _0x43143c[_0x417548(0x171)][_0x417548(0x1c4)](_0x3720c5[_0x417548(0x168)],_0x5a48ab);}catch(_0x37aee3){const _0x5954f6=_0x37aee3 instanceof Error?_0x37aee3[_0x417548(0x158)]:String(_0x37aee3);return _0x5954f6[_0x417548(0x164)](_0x417548(0x1a1))||_0x5954f6[_0x417548(0x1a6)]()[_0x417548(0x164)]('not\x20found')?console['log'](a5_0x1d553d[_0x417548(0x165)]('✗\x20ERROR:\x20Agent\x20not\x20found:\x20'+_0x3720c5['agentName'])):console[_0x417548(0x1c6)](a5_0x1d553d['red'](_0x417548(0x1bb)+_0x3720c5[_0x417548(0x168)]+'\x22:\x20'+_0x5954f6)),0x1;}let _0x57c19c;if(!_0x57f4ea)try{_0x57c19c=await setupEvaluatorAgent(_0x43143c[_0x417548(0x171)],_0x4387d6['verbose']);}catch(_0x45db3a){const _0x14208a=_0x45db3a instanceof Error?_0x45db3a[_0x417548(0x158)]:String(_0x45db3a);return console[_0x417548(0x1c6)](a5_0x1d553d['red'](_0x417548(0x14d)+_0x14208a)),0x1;}console[_0x417548(0x1c6)](a5_0x1d553d['cyan'](_0x417548(0x1cc))),console[_0x417548(0x1c6)](_0x417548(0x16a)+a5_0x1d553d[_0x417548(0x1b9)](_0x56167a)),console['log'](_0x417548(0x139)+a5_0x1d553d[_0x417548(0x1b9)](_0x3720c5['projectName']+'/'+_0x3720c5['agentName'])),console[_0x417548(0x1c6)]();const _0x3231c7=[],_0x46af1d=[],_0x3cadd4=Date['now']();for(let _0x2d69bd=0x0;_0x2d69bd<_0x58bc38[_0x417548(0x17d)];_0x2d69bd++){const _0x17548c=_0x58bc38[_0x2d69bd];_0x58bc38[_0x417548(0x17d)]>0x1?console['log'](_0x417548(0x152)+(_0x2d69bd+0x1)+'/'+_0x58bc38[_0x417548(0x17d)]+':\x20'+a5_0x1d553d[_0x417548(0x1b9)](_0x17548c['name'])):console['log'](_0x417548(0x18d)+a5_0x1d553d['white'](_0x17548c[_0x417548(0x150)]));const _0x24989b=createCommandSpinner(_0x417548(0x176)+_0x17548c['rounds'][_0x417548(0x17d)]+_0x417548(0x17f));_0x24989b[_0x417548(0x175)]();try{const {result:_0xd7cfc1,conversation:_0xe0c72f}=await runTest(_0x43143c[_0x417548(0x171)],_0x17548c,{'agentId':_0x4fe523,'projectId':_0x5a48ab,'site':_0x56167a,'noEval':_0x57f4ea,'evaluatorId':_0x57c19c,'onRoundStart':(_0x92d72c,_0x12a7db)=>{const _0x2fa90f=_0x417548;_0x24989b[_0x2fa90f(0x16b)]='Round\x20'+(_0x92d72c+0x1)+'/'+_0x12a7db+_0x2fa90f(0x17f);},'onRoundComplete':(_0x5e16f1,_0x14a562,_0x369a63)=>{const _0x1ba593=_0x417548,_0x56e97e=formatElapsed(_0x14a562);_0x369a63?console[_0x1ba593(0x1c6)]('\x20\x20Round\x20'+(_0x5e16f1+0x1)+'/'+_0x17548c[_0x1ba593(0x1ab)][_0x1ba593(0x17d)]+_0x1ba593(0x1b6)+a5_0x1d553d['green']('✓')+'\x20('+_0x56e97e+')'):console['log']('\x20\x20Round\x20'+(_0x5e16f1+0x1)+'/'+_0x17548c[_0x1ba593(0x1ab)][_0x1ba593(0x17d)]+_0x1ba593(0x1b6)+a5_0x1d553d[_0x1ba593(0x165)]('✗'));},'onEvaluationStart':()=>{const _0x35e515=_0x417548;_0x24989b[_0x35e515(0x16b)]=_0x35e515(0x16d);},'onEvaluationComplete':_0x28bcc5=>{const _0x277ea0=_0x417548,_0x2c6ada=formatElapsed(_0x28bcc5);console['log'](_0x277ea0(0x1c0)+a5_0x1d553d['green']('✓')+'\x20('+_0x2c6ada+')');}});_0x24989b[_0x417548(0x151)](),_0x3231c7[_0x417548(0x16c)](_0xd7cfc1),_0x46af1d['push'](_0xe0c72f);if(_0xd7cfc1['status']===_0x417548(0x19e))console['log'](a5_0x1d553d[_0x417548(0x19b)](_0x417548(0x137)+_0xd7cfc1[_0x417548(0x154)]));else _0xd7cfc1[_0x417548(0x189)]===_0x417548(0x147)?console['log'](a5_0x1d553d[_0x417548(0x165)]('✗\x20FAIL:\x20'+_0xd7cfc1['reason'])):console[_0x417548(0x1c6)](a5_0x1d553d[_0x417548(0x165)](_0x417548(0x194)+_0xd7cfc1[_0x417548(0x154)]));_0xd7cfc1['conversation_url']&&console[_0x417548(0x1c6)](a5_0x1d553d[_0x417548(0x14f)]('Conversation\x20URL:\x20'+_0xd7cfc1[_0x417548(0x153)])),console['log']();}catch(_0xfbf53c){_0x24989b['stop']();const _0x3e16d0=_0xfbf53c instanceof Error?_0xfbf53c['message']:String(_0xfbf53c);console['log'](a5_0x1d553d['red'](_0x417548(0x194)+_0x3e16d0)),console[_0x417548(0x1c6)](),_0x3231c7['push']({'name':_0x17548c['name'],'status':_0x417548(0x13c),'reason':_0x3e16d0,'timestamp':new Date()[_0x417548(0x17c)](),'duration_ms':0x0});}}const _0x3f71e7=Date[_0x417548(0x156)]()-_0x3cadd4,_0x3434d6=_0x3231c7[_0x417548(0x1a3)](_0x4b14e4=>_0x4b14e4[_0x417548(0x189)]===_0x417548(0x19e))[_0x417548(0x17d)],_0x125fe5=_0x3231c7['filter'](_0x142af7=>_0x142af7[_0x417548(0x189)]===_0x417548(0x147))[_0x417548(0x17d)],_0x562067=_0x3231c7[_0x417548(0x1a3)](_0x322c87=>_0x322c87[_0x417548(0x189)]===_0x417548(0x13c))[_0x417548(0x17d)];console[_0x417548(0x1c6)]('━'[_0x417548(0x1c9)](0x3c)),console[_0x417548(0x1c6)](_0x417548(0x1c2)),console[_0x417548(0x1c6)]('━'[_0x417548(0x1c9)](0x3c)),console['log']('Total:\x20\x20\x20\x20'+_0x3231c7['length']),console['log'](_0x417548(0x193)+a5_0x1d553d[_0x417548(0x19b)](_0x3434d6)),console['log'](_0x417548(0x18f)+a5_0x1d553d[_0x417548(0x165)](_0x125fe5));_0x562067>0x0&&console[_0x417548(0x1c6)](_0x417548(0x148)+a5_0x1d553d[_0x417548(0x165)](_0x562067));console['log'](_0x417548(0x183)+formatElapsed(_0x3f71e7)),console['log']('━'[_0x417548(0x1c9)](0x3c));const _0x403e26=_0x3231c7['filter'](_0x3f72cd=>_0x3f72cd['status']!==_0x417548(0x19e));if(_0x403e26[_0x417548(0x17d)]>0x0){console['log'](),console[_0x417548(0x1c6)](_0x417548(0x14c));for(const _0x8f6cb9 of _0x403e26){const _0x608665=a5_0x1d553d['red']('✗'),_0x134129=_0x8f6cb9[_0x417548(0x154)][_0x417548(0x17d)]>0x32?_0x8f6cb9[_0x417548(0x154)][_0x417548(0x1aa)](0x0,0x32)+'...':_0x8f6cb9['reason'];console[_0x417548(0x1c6)]('\x20\x20'+_0x608665+'\x20'+_0x8f6cb9[_0x417548(0x150)]+':\x20'+_0x134129);}}const _0x4b213c={'summary':{'total':_0x3231c7[_0x417548(0x17d)],'passed':_0x3434d6,'failed':_0x125fe5,'errors':_0x562067>0x0?_0x562067:undefined,'duration_ms':_0x3f71e7},'tests':_0x3231c7,'agent':{'project':_0x3720c5[_0x417548(0x184)],'name':_0x3720c5[_0x417548(0x168)],'site':_0x56167a},'timestamp':new Date(_0x3cadd4)['toISOString']()};try{const _0x1d1691=buildCachedTestRun(_0x46af1d,{'site':_0x56167a,'projectId':_0x5a48ab,'projectName':_0x3720c5['projectName'],'agentId':_0x4fe523,'agentName':_0x3720c5[_0x417548(0x168)],'testYmlPath':a5_0x5dfda6[_0x417548(0x18c)](_0x3720c5['testYmlPath'])});saveLastTestRun(_0x1d1691);}catch{}if(_0x18455a!==_0x417548(0x159)||_0x5c25e4){const _0x1baaf0=formatResults(_0x4b213c,_0x18455a);if(_0x5c25e4)try{a5_0xa4fb5d[_0x417548(0x144)](_0x5c25e4,_0x1baaf0,_0x417548(0x13b)),console['log'](),console[_0x417548(0x1c6)](a5_0x1d553d[_0x417548(0x14f)](_0x417548(0x161)+_0x5c25e4));}catch(_0x54191e){return console['log'](),console[_0x417548(0x1c6)](a5_0x1d553d[_0x417548(0x165)](_0x417548(0x138)+_0x54191e)),0x1;}else console['log'](),console[_0x417548(0x1c6)](_0x1baaf0);}return _0x403e26['length']>0x0?0x1:0x0;}async[a5_0x4514ba(0x1cd)](_0x57ede6,_0x168e54){const _0x40290a=a5_0x4514ba,{options:_0xf2d922,tdx:_0x7fdb1a}=_0x57ede6,{definition:_0x2b257d,agentInfo:_0x38ef12,outputFormat:_0x39a7a5,outputFile:_0x5135c8}=_0x168e54,_0x4da138=_0xf2d922[_0x40290a(0x1a8)],_0x157cbd=loadLastTestRun();if(!_0x157cbd)return console[_0x40290a(0x1c6)](a5_0x1d553d[_0x40290a(0x165)](_0x40290a(0x155))),console[_0x40290a(0x1c6)](a5_0x1d553d[_0x40290a(0x14f)](_0x40290a(0x13e))),0x1;if(_0x157cbd[_0x40290a(0x182)][_0x40290a(0x168)]!==_0x38ef12[_0x40290a(0x168)])return console[_0x40290a(0x1c6)](a5_0x1d553d[_0x40290a(0x165)]('Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22'+_0x157cbd[_0x40290a(0x182)]['agentName']+_0x40290a(0x170)+_0x38ef12['agentName']+'\x22.')),console[_0x40290a(0x1c6)](a5_0x1d553d['dim']('Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.')),0x1;const _0xa254ae=new Set(_0x157cbd[_0x40290a(0x185)][_0x40290a(0x197)](_0x4dbbeb=>_0x4dbbeb[_0x40290a(0x188)])),_0x55992f=_0x2b257d[_0x40290a(0x160)][_0x40290a(0x1a3)](_0x397b83=>!_0xa254ae[_0x40290a(0x1c3)](_0x397b83[_0x40290a(0x150)]));if(_0x55992f[_0x40290a(0x17d)]>0x0&&_0x157cbd[_0x40290a(0x1a8)]!==_0x4da138)return console[_0x40290a(0x1c6)](a5_0x1d553d[_0x40290a(0x165)](_0x40290a(0x145))),console[_0x40290a(0x1c6)](a5_0x1d553d[_0x40290a(0x14f)](_0x40290a(0x181)+_0x157cbd[_0x40290a(0x1a8)]+'\x22,\x20but\x20current\x20site\x20is\x20\x22'+_0x4da138+'\x22.')),console[_0x40290a(0x1c6)](a5_0x1d553d[_0x40290a(0x14f)](_0x40290a(0x149)+_0x157cbd['site']+'\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.')),0x1;const _0x224f14=_0x2b257d['tests'][_0x40290a(0x1a3)](_0x3d992b=>_0xa254ae['has'](_0x3d992b[_0x40290a(0x150)])),_0x36390b=_0x55992f;let _0x32a2c0;try{_0x32a2c0=await setupEvaluatorAgent(_0x7fdb1a[_0x40290a(0x171)],_0xf2d922[_0x40290a(0x166)]);}catch(_0x57e8fd){const _0xfe436f=_0x57e8fd instanceof Error?_0x57e8fd[_0x40290a(0x158)]:String(_0x57e8fd);return console['log'](a5_0x1d553d['red'](_0x40290a(0x14d)+_0xfe436f)),0x1;}console[_0x40290a(0x1c6)](a5_0x1d553d['cyan']('Re-evaluating\x20cached\x20test\x20run...')),console[_0x40290a(0x1c6)]('Cached\x20run\x20from:\x20'+a5_0x1d553d['white'](_0x157cbd[_0x40290a(0x15b)])),console[_0x40290a(0x1c6)](_0x40290a(0x139)+a5_0x1d553d[_0x40290a(0x1b9)](_0x157cbd[_0x40290a(0x182)][_0x40290a(0x184)]+'/'+_0x157cbd[_0x40290a(0x182)][_0x40290a(0x168)]));_0x36390b[_0x40290a(0x17d)]>0x0&&console[_0x40290a(0x1c6)](_0x40290a(0x173)+a5_0x1d553d[_0x40290a(0x1a5)](_0x36390b[_0x40290a(0x17d)]));console['log']();const _0x3ffa58=[],_0x1669a8=Date['now'](),_0xa1fee1=createCommandSpinner(_0x40290a(0x1ad));if(_0x224f14[_0x40290a(0x17d)]>0x0)try{const _0x2622b3=await reevaluateFromCache(_0x7fdb1a[_0x40290a(0x171)],_0x157cbd,{'tests':_0x224f14},{'evaluatorId':_0x32a2c0,'onTestStart':(_0x2fb45b,_0x502a3a,_0x2e5b99)=>{const _0xf142dc=_0x40290a;_0xa1fee1[_0xf142dc(0x16b)]=_0xf142dc(0x192)+(_0x502a3a+0x1)+'/'+_0x2e5b99+':\x20'+_0x2fb45b+'...';if(!_0xa1fee1['isSpinning'])_0xa1fee1[_0xf142dc(0x175)]();},'onTestComplete':(_0x4a5f56,_0x266f6d)=>{const _0x2c3477=_0x40290a;_0xa1fee1[_0x2c3477(0x151)]();if(_0x266f6d[_0x2c3477(0x189)]===_0x2c3477(0x19e))console[_0x2c3477(0x1c6)](a5_0x1d553d[_0x2c3477(0x19b)](_0x2c3477(0x137)+_0x4a5f56)+a5_0x1d553d[_0x2c3477(0x14f)](_0x2c3477(0x1bc)));else _0x266f6d[_0x2c3477(0x189)]===_0x2c3477(0x147)?console['log'](a5_0x1d553d[_0x2c3477(0x165)](_0x2c3477(0x15c)+_0x4a5f56+_0x2c3477(0x15e)+_0x266f6d[_0x2c3477(0x154)])+a5_0x1d553d[_0x2c3477(0x14f)](_0x2c3477(0x1bc))):console[_0x2c3477(0x1c6)](a5_0x1d553d[_0x2c3477(0x165)](_0x2c3477(0x194)+_0x4a5f56+_0x2c3477(0x15e)+_0x266f6d[_0x2c3477(0x154)]));_0x266f6d[_0x2c3477(0x153)]&&console[_0x2c3477(0x1c6)](a5_0x1d553d[_0x2c3477(0x14f)](_0x2c3477(0x19c)+_0x266f6d['conversation_url'])),_0x3ffa58['push'](_0x266f6d);},'onTestSkipped':(_0x3b62dc,_0x4f7b78)=>{const _0x338cf9=_0x40290a;_0xa1fee1['stop'](),console[_0x338cf9(0x1c6)](a5_0x1d553d[_0x338cf9(0x1a5)](_0x338cf9(0x1a4)+_0x3b62dc+_0x338cf9(0x15e)+_0x4f7b78));}});for(const _0x3f8b8f of _0x2622b3){!_0x3ffa58[_0x40290a(0x142)](_0x4b6ae5=>_0x4b6ae5[_0x40290a(0x150)]===_0x3f8b8f['name'])&&_0x3ffa58[_0x40290a(0x16c)](_0x3f8b8f);}}catch(_0x7032b){_0xa1fee1['stop']();const _0xc20c37=_0x7032b instanceof Error?_0x7032b[_0x40290a(0x158)]:String(_0x7032b);return console['log'](a5_0x1d553d[_0x40290a(0x165)](_0x40290a(0x1af)+_0xc20c37)),0x1;}_0xa1fee1[_0x40290a(0x151)]();if(_0x36390b[_0x40290a(0x17d)]>0x0){console[_0x40290a(0x1c6)](),console[_0x40290a(0x1c6)](a5_0x1d553d['cyan']('Executing\x20new\x20tests...'));const {projectId:_0x24a81b,agentId:_0x2f8c7a}=_0x157cbd[_0x40290a(0x182)];for(const _0x3812c2 of _0x36390b){console[_0x40290a(0x1c6)](_0x40290a(0x19d)+a5_0x1d553d[_0x40290a(0x1b9)](_0x3812c2[_0x40290a(0x150)]));const _0x4168ad=createCommandSpinner('Round\x201/'+_0x3812c2[_0x40290a(0x1ab)][_0x40290a(0x17d)]+':\x20Sending\x20user\x20input...');_0x4168ad[_0x40290a(0x175)]();try{const {result:_0x59506e}=await runTest(_0x7fdb1a[_0x40290a(0x171)],_0x3812c2,{'agentId':_0x2f8c7a,'projectId':_0x24a81b,'site':_0x157cbd[_0x40290a(0x1a8)],'noEval':![],'evaluatorId':_0x32a2c0,'onRoundStart':(_0x2dbfd6,_0x4538bb)=>{const _0x123d03=_0x40290a;_0x4168ad[_0x123d03(0x16b)]=_0x123d03(0x167)+(_0x2dbfd6+0x1)+'/'+_0x4538bb+_0x123d03(0x17f);},'onRoundComplete':(_0x10274a,_0x569dd9,_0x4f61c4)=>{const _0x4f1df8=_0x40290a,_0x598566=formatElapsed(_0x569dd9);_0x4f61c4?console[_0x4f1df8(0x1c6)]('\x20\x20Round\x20'+(_0x10274a+0x1)+'/'+_0x3812c2[_0x4f1df8(0x1ab)][_0x4f1df8(0x17d)]+'...\x20'+a5_0x1d553d[_0x4f1df8(0x19b)]('✓')+'\x20('+_0x598566+')'):console[_0x4f1df8(0x1c6)](_0x4f1df8(0x186)+(_0x10274a+0x1)+'/'+_0x3812c2[_0x4f1df8(0x1ab)][_0x4f1df8(0x17d)]+_0x4f1df8(0x1b6)+a5_0x1d553d[_0x4f1df8(0x165)]('✗'));},'onEvaluationStart':()=>{const _0x593ec8=_0x40290a;_0x4168ad[_0x593ec8(0x16b)]=_0x593ec8(0x16d);},'onEvaluationComplete':_0x3d4172=>{const _0x1b856a=_0x40290a,_0xbc6560=formatElapsed(_0x3d4172);console[_0x1b856a(0x1c6)](_0x1b856a(0x1c0)+a5_0x1d553d[_0x1b856a(0x19b)]('✓')+'\x20('+_0xbc6560+')');}});_0x4168ad['stop'](),_0x3ffa58[_0x40290a(0x16c)](_0x59506e);if(_0x59506e[_0x40290a(0x189)]===_0x40290a(0x19e))console[_0x40290a(0x1c6)](a5_0x1d553d[_0x40290a(0x19b)](_0x40290a(0x137)+_0x59506e['reason'])+a5_0x1d553d['dim']('\x20(new)'));else _0x59506e[_0x40290a(0x189)]===_0x40290a(0x147)?console[_0x40290a(0x1c6)](a5_0x1d553d[_0x40290a(0x165)]('✗\x20FAIL:\x20'+_0x59506e[_0x40290a(0x154)])+a5_0x1d553d[_0x40290a(0x14f)]('\x20(new)')):console[_0x40290a(0x1c6)](a5_0x1d553d[_0x40290a(0x165)](_0x40290a(0x194)+_0x59506e[_0x40290a(0x154)]));_0x59506e[_0x40290a(0x153)]&&console[_0x40290a(0x1c6)](a5_0x1d553d[_0x40290a(0x14f)](_0x40290a(0x19c)+_0x59506e[_0x40290a(0x153)]));}catch(_0x338d83){_0x4168ad[_0x40290a(0x151)]();const _0x40dc60=_0x338d83 instanceof Error?_0x338d83['message']:String(_0x338d83);console[_0x40290a(0x1c6)](a5_0x1d553d[_0x40290a(0x165)]('✗\x20ERROR:\x20'+_0x40dc60)),_0x3ffa58['push']({'name':_0x3812c2[_0x40290a(0x150)],'status':_0x40290a(0x13c),'reason':_0x40dc60,'timestamp':new Date()[_0x40290a(0x17c)](),'duration_ms':0x0});}}}console['log']();const _0x5cc7c0=Date[_0x40290a(0x156)]()-_0x1669a8,_0x17f2bc=_0x3ffa58[_0x40290a(0x1a3)](_0x2f8027=>_0x2f8027[_0x40290a(0x189)]===_0x40290a(0x19e))[_0x40290a(0x17d)],_0x23efb0=_0x3ffa58[_0x40290a(0x1a3)](_0x1375ae=>_0x1375ae[_0x40290a(0x189)]===_0x40290a(0x147))[_0x40290a(0x17d)],_0x219288=_0x3ffa58['filter'](_0x5791fc=>_0x5791fc['status']===_0x40290a(0x13c))[_0x40290a(0x17d)];console[_0x40290a(0x1c6)]('━'['repeat'](0x3c)),console[_0x40290a(0x1c6)]('Re-evaluation\x20Summary'),console[_0x40290a(0x1c6)]('━'[_0x40290a(0x1c9)](0x3c)),console[_0x40290a(0x1c6)](_0x40290a(0x179)+_0x3ffa58[_0x40290a(0x17d)]),console['log']('Passed:\x20\x20\x20'+a5_0x1d553d[_0x40290a(0x19b)](_0x17f2bc)),console[_0x40290a(0x1c6)]('Failed:\x20\x20\x20'+a5_0x1d553d[_0x40290a(0x165)](_0x23efb0));_0x219288>0x0&&console[_0x40290a(0x1c6)](_0x40290a(0x148)+a5_0x1d553d[_0x40290a(0x165)](_0x219288));console['log'](_0x40290a(0x183)+formatElapsed(_0x5cc7c0)),console[_0x40290a(0x1c6)]('━'[_0x40290a(0x1c9)](0x3c));const _0x3583a9={'summary':{'total':_0x3ffa58[_0x40290a(0x17d)],'passed':_0x17f2bc,'failed':_0x23efb0,'errors':_0x219288>0x0?_0x219288:undefined,'duration_ms':_0x5cc7c0},'tests':_0x3ffa58,'agent':{'project':_0x38ef12['projectName'],'name':_0x38ef12[_0x40290a(0x168)],'site':_0x4da138},'timestamp':new Date(_0x1669a8)[_0x40290a(0x17c)]()};if(_0x39a7a5!==_0x40290a(0x159)||_0x5135c8){const _0xabb19e=formatResults(_0x3583a9,_0x39a7a5);if(_0x5135c8)try{a5_0xa4fb5d[_0x40290a(0x144)](_0x5135c8,_0xabb19e,_0x40290a(0x13b)),console[_0x40290a(0x1c6)](),console[_0x40290a(0x1c6)](a5_0x1d553d[_0x40290a(0x14f)](_0x40290a(0x161)+_0x5135c8));}catch(_0x28d409){return console[_0x40290a(0x1c6)](),console[_0x40290a(0x1c6)](a5_0x1d553d[_0x40290a(0x165)](_0x40290a(0x138)+_0x28d409)),0x1;}else console[_0x40290a(0x1c6)](),console['log'](_0xabb19e);}const _0x57c762=_0x3ffa58[_0x40290a(0x1a3)](_0xe9327e=>_0xe9327e['status']!==_0x40290a(0x19e));return _0x57c762[_0x40290a(0x17d)]>0x0?0x1:0x0;}}
1
+ const a5_0x40e23d=a5_0x27af;(function(_0x47e190,_0x2e318c){const _0x299862=a5_0x27af,_0x94e745=_0x47e190();while(!![]){try{const _0x5df7f4=parseInt(_0x299862(0x27c))/0x1+-parseInt(_0x299862(0x271))/0x2+parseInt(_0x299862(0x26e))/0x3+-parseInt(_0x299862(0x216))/0x4*(parseInt(_0x299862(0x25c))/0x5)+parseInt(_0x299862(0x25a))/0x6*(parseInt(_0x299862(0x24b))/0x7)+parseInt(_0x299862(0x20e))/0x8+-parseInt(_0x299862(0x1fa))/0x9*(-parseInt(_0x299862(0x264))/0xa);if(_0x5df7f4===_0x2e318c)break;else _0x94e745['push'](_0x94e745['shift']());}catch(_0x46dff4){_0x94e745['push'](_0x94e745['shift']());}}}(a5_0x2fbf,0x493c2));import*as a5_0x5838fa from'node:fs';import*as a5_0x40667c from'node:path';import a5_0x2eb618 from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';function a5_0x2fbf(){const _0x4fe648=['context','110550GtIcpy','Cached\x20run\x20from:\x20','...','/<agent-name>','site','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','tags','\x20\x20Round\x20','404','ERROR','517599mvUjif','New\x20tests\x20to\x20execute:\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','219000DSJzNd','\x20\x20Agent:\x20','Error:\x20No\x20previous\x20test\x20run\x20found.','length','toISOString','conversations','projectDir','tests','Failed\x20Tests:','found','Agent:\x20','251747cmrlhs','writeFileSync','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','FAIL','reason','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','⚠\x20SKIPPED:\x20','some','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','llmProject','projectName','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','Re-evaluating...','Duration:\x20','18jpmUEa','verbose','Round\x201/','No\x20tests\x20found\x20matching:\x20','yellow','jsonl','✗\x20ERROR:\x20','push','green','No\x20tests\x20have\x20tags\x20defined.','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.',':\x20Sending\x20user\x20input...','Errors:\x20\x20\x20','llm','\x20(cached)','forEach','message','Re-evaluation\x20Summary','Evaluating\x20response...','Running\x20test:\x20','1630872lDnnsx','start','Executing\x20new\x20tests...','basename','json','description','dim','PASS','4WVAdKv','find','\x20\x20Site:\x20','Re-evaluating\x20cached\x20test\x20run...','Test\x20','no_context','Error\x20writing\x20output\x20file:\x20','conversation_url','Cached\x20run\x20is\x20from\x20site\x20\x22','Passed:\x20\x20\x20','stop','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','agentDirs','trim','add','filter','substring','Conversation\x20URL:\x20','agent','repeat','\x20-\x20','size','isSpinning','executeReeval','✗\x20ERROR:\x20Project\x20not\x20found:\x20','agent:test','\x20\x20-\x20','utf-8','\x27\x20to\x20create\x20the\x20folder\x20structure.','source','Tests\x20found:\x20','...\x20','cyan','resolve','timestamp','name','not\x20found','now','resolveAgentId','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','status','table','no_tests','Run\x20tests\x20for\x20an\x20LLM\x20agent','join','includes','testName','\x20(new)','red','Site:\x20','agentName','white','log','991459UsqQlU','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','existsSync','Output\x20written\x20to:\x20','test.yml','\x20\x20Evaluating...\x20','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','\x22:\x20','✓\x20PASS:\x20','text','Either\x20switch\x20to\x20the\x20\x22','rounds','map','dryRun','toLowerCase','12UHRdBB','Running:\x20','2620265IjRfyg','\x22,\x20but\x20current\x20site\x20is\x20\x22','✗\x20FAIL:\x20','Round\x20','\x20\x20Conversation:\x20','Usage:','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22'];a5_0x2fbf=function(){return _0x4fe648;};return a5_0x2fbf();}import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';function a5_0x27af(_0x4f6c4d,_0x3b8928){_0x4f6c4d=_0x4f6c4d-0x1f0;const _0x2fbfb8=a5_0x2fbf();let _0x27af7a=_0x2fbfb8[_0x4f6c4d];return _0x27af7a;}import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{['name']=a5_0x40e23d(0x22f);[a5_0x40e23d(0x213)]=a5_0x40e23d(0x241);async['execute'](_0x20753b){const _0x3cfcb6=a5_0x40e23d,{options:_0x43e78d,args:_0xf99e93,tdx:_0x2fbd61}=_0x20753b,_0x2631c2=_0xf99e93[0x0]||'.',_0x385b27=_0x43e78d[_0x3cfcb6(0x258)],_0x57138c=_0x43e78d,_0x103f6b=_0x57138c['eval']===![],_0x348b74=_0x57138c['reeval'],_0x3cf340=_0x57138c[_0x3cfcb6(0x239)],_0x41eb51=_0x57138c[_0x3cfcb6(0x26a)],_0x179348=_0x43e78d[_0x3cfcb6(0x268)],_0x139122=_0x57138c['output'];if(_0x348b74&&_0x103f6b)return console[_0x3cfcb6(0x24a)](a5_0x2eb618[_0x3cfcb6(0x246)](_0x3cfcb6(0x251))),0x1;let _0x422b09=_0x3cfcb6(0x23f);if(_0x57138c[_0x3cfcb6(0x212)])_0x422b09=_0x3cfcb6(0x212);else{if(_0x57138c[_0x3cfcb6(0x1ff)])_0x422b09='jsonl';else{if(_0x57138c['tsv'])_0x422b09='tsv';else{if(_0x57138c[_0x3cfcb6(0x23f)])_0x422b09=_0x3cfcb6(0x23f);}}}const _0x430836=_0x57138c[_0x3cfcb6(0x1f5)];let _0x4ed4a0=_0x2631c2;const _0x1bc76c=a5_0x5838fa[_0x3cfcb6(0x24d)](_0x2631c2),_0x5433ac=_0x2631c2==='.';if(!_0x1bc76c||_0x5433ac){const _0x2f11de=resolveProjectFromContext(_0x2631c2,_0x430836,{'requireFile':_0x3cfcb6(0x24f)});if(_0x2f11de[_0x3cfcb6(0x27a)])_0x4ed4a0=_0x2f11de[_0x3cfcb6(0x277)],_0x2f11de[_0x3cfcb6(0x233)]===_0x3cfcb6(0x263)&&console[_0x3cfcb6(0x24a)](a5_0x2eb618[_0x3cfcb6(0x214)]('Using\x20agent:\x20'+_0x4ed4a0));else switch(_0x2f11de[_0x3cfcb6(0x1f0)]){case _0x3cfcb6(0x21b):console[_0x3cfcb6(0x24a)](a5_0x2eb618[_0x3cfcb6(0x1fe)](_0x2f11de[_0x3cfcb6(0x20a)])),console[_0x3cfcb6(0x24a)](),console['log'](_0x3cfcb6(0x261)),console[_0x3cfcb6(0x24a)]('\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[_0x3cfcb6(0x24a)]('\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[_0x3cfcb6(0x24a)](),console[_0x3cfcb6(0x24a)](_0x3cfcb6(0x221));return 0x1;case'no_local_folder':console[_0x3cfcb6(0x24a)](a5_0x2eb618[_0x3cfcb6(0x1fe)](_0x2f11de[_0x3cfcb6(0x20a)])),console['log'](),console[_0x3cfcb6(0x24a)]('Run\x20\x27tdx\x20agent\x20pull\x20'+_0x2f11de[_0x3cfcb6(0x1f5)]+_0x3cfcb6(0x232));return 0x1;case'multiple_agents':{const _0x189f64=a5_0x40667c[_0x3cfcb6(0x211)](_0x2f11de['projectDir']);console['log'](a5_0x2eb618['yellow'](_0x3cfcb6(0x262)+_0x2f11de[_0x3cfcb6(0x1f5)]+'\x22:'));for(const _0x4fc488 of _0x2f11de[_0x3cfcb6(0x222)]){console[_0x3cfcb6(0x24a)](_0x3cfcb6(0x230)+_0x4fc488);}return console['log'](),console[_0x3cfcb6(0x24a)](_0x3cfcb6(0x27e)+_0x189f64+_0x3cfcb6(0x267)),0x1;}case _0x3cfcb6(0x240):console[_0x3cfcb6(0x24a)](a5_0x2eb618[_0x3cfcb6(0x1fe)]('No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22'+_0x2f11de[_0x3cfcb6(0x1f5)]+'\x22.')),console['log'](a5_0x2eb618[_0x3cfcb6(0x214)]('Project\x20path:\x20'+_0x2f11de[_0x3cfcb6(0x277)])),console[_0x3cfcb6(0x24a)](),console[_0x3cfcb6(0x24a)](_0x3cfcb6(0x23d));return 0x1;}}const {definition:_0x122f46,agentInfo:_0x1ac151}=parseTestFile(_0x4ed4a0);let _0x2b296c=_0x122f46['tests'];if(_0x3cf340){const _0x409f6d=_0x3cf340['split'](',')[_0x3cfcb6(0x257)](_0x5a0aec=>_0x5a0aec[_0x3cfcb6(0x223)]());_0x2b296c=_0x122f46[_0x3cfcb6(0x278)][_0x3cfcb6(0x225)](_0x409527=>_0x409f6d[_0x3cfcb6(0x243)](_0x409527[_0x3cfcb6(0x239)]));if(_0x2b296c[_0x3cfcb6(0x274)]===0x0)return console[_0x3cfcb6(0x24a)](a5_0x2eb618[_0x3cfcb6(0x1fe)](_0x3cfcb6(0x1fd)+_0x3cf340)),console[_0x3cfcb6(0x24a)](a5_0x2eb618[_0x3cfcb6(0x214)]('Available\x20tests:\x20'+_0x122f46[_0x3cfcb6(0x278)][_0x3cfcb6(0x257)](_0x1e2d37=>_0x1e2d37['name'])[_0x3cfcb6(0x242)](',\x20'))),0x1;}if(_0x41eb51){const _0x58bf68=_0x41eb51['split'](',')['map'](_0x1a7c0c=>_0x1a7c0c[_0x3cfcb6(0x223)]()['toLowerCase']());_0x2b296c=_0x2b296c[_0x3cfcb6(0x225)](_0x25cb82=>_0x25cb82[_0x3cfcb6(0x26a)]?.[_0x3cfcb6(0x1f3)](_0x11251c=>_0x58bf68[_0x3cfcb6(0x243)](_0x11251c[_0x3cfcb6(0x259)]())));if(_0x2b296c[_0x3cfcb6(0x274)]===0x0){console[_0x3cfcb6(0x24a)](a5_0x2eb618[_0x3cfcb6(0x1fe)]('No\x20tests\x20found\x20with\x20tags:\x20'+_0x41eb51));const _0xb774ab=new Set();return _0x122f46[_0x3cfcb6(0x278)][_0x3cfcb6(0x209)](_0x385550=>_0x385550[_0x3cfcb6(0x26a)]?.[_0x3cfcb6(0x209)](_0x1b53f7=>_0xb774ab[_0x3cfcb6(0x224)](_0x1b53f7))),_0xb774ab[_0x3cfcb6(0x22b)]>0x0?console[_0x3cfcb6(0x24a)](a5_0x2eb618[_0x3cfcb6(0x214)]('Available\x20tags:\x20'+[..._0xb774ab][_0x3cfcb6(0x242)](',\x20'))):console[_0x3cfcb6(0x24a)](a5_0x2eb618[_0x3cfcb6(0x214)](_0x3cfcb6(0x203))),0x1;}}if(_0x348b74)return this[_0x3cfcb6(0x22d)](_0x20753b,{'definition':{'tests':_0x2b296c},'agentInfo':_0x1ac151,'outputFormat':_0x422b09,'outputFile':_0x139122,'testNames':_0x3cf340});if(_0x385b27){console[_0x3cfcb6(0x24a)](a5_0x2eb618[_0x3cfcb6(0x236)]('Test\x20Configuration:')),console[_0x3cfcb6(0x24a)](_0x3cfcb6(0x218)+a5_0x2eb618['white'](_0x179348)),console[_0x3cfcb6(0x24a)]('\x20\x20Project:\x20'+a5_0x2eb618[_0x3cfcb6(0x249)](_0x1ac151[_0x3cfcb6(0x1f6)])),console[_0x3cfcb6(0x24a)](_0x3cfcb6(0x272)+a5_0x2eb618['white'](_0x1ac151[_0x3cfcb6(0x248)])),console[_0x3cfcb6(0x24a)](),console[_0x3cfcb6(0x24a)](_0x3cfcb6(0x234)+a5_0x2eb618['white'](_0x2b296c[_0x3cfcb6(0x274)]));for(let _0x4e2042=0x0;_0x4e2042<_0x2b296c[_0x3cfcb6(0x274)];_0x4e2042++){const _0x6417f8=_0x2b296c[_0x4e2042],_0x369098=_0x6417f8['rounds'][_0x3cfcb6(0x274)]===0x1?'round':'rounds',_0x375606=_0x6417f8[_0x3cfcb6(0x26a)]?.[_0x3cfcb6(0x274)]?'\x20['+_0x6417f8[_0x3cfcb6(0x26a)][_0x3cfcb6(0x242)](',\x20')+']':'';console['log']('\x20\x20'+(_0x4e2042+0x1)+'.\x20'+a5_0x2eb618[_0x3cfcb6(0x249)](_0x6417f8[_0x3cfcb6(0x239)])+'\x20('+_0x6417f8[_0x3cfcb6(0x256)][_0x3cfcb6(0x274)]+'\x20'+_0x369098+')'+a5_0x2eb618['dim'](_0x375606));}return 0x0;}let _0xe4fa1d,_0x22d45e;try{_0xe4fa1d=await _0x2fbd61[_0x3cfcb6(0x207)]['resolveProjectId'](_0x1ac151['projectName']);}catch(_0x29732f){const _0x52c6c4=_0x29732f instanceof Error?_0x29732f[_0x3cfcb6(0x20a)]:String(_0x29732f);return _0x52c6c4[_0x3cfcb6(0x243)]('404')||_0x52c6c4[_0x3cfcb6(0x259)]()['includes']('not\x20found')?console['log'](a5_0x2eb618[_0x3cfcb6(0x246)](_0x3cfcb6(0x22e)+_0x1ac151[_0x3cfcb6(0x1f6)])):console[_0x3cfcb6(0x24a)](a5_0x2eb618[_0x3cfcb6(0x246)](_0x3cfcb6(0x270)+_0x1ac151[_0x3cfcb6(0x1f6)]+_0x3cfcb6(0x252)+_0x52c6c4)),0x1;}try{_0x22d45e=await _0x2fbd61[_0x3cfcb6(0x207)][_0x3cfcb6(0x23c)](_0x1ac151[_0x3cfcb6(0x248)],_0xe4fa1d);}catch(_0x3f8740){const _0x51ba08=_0x3f8740 instanceof Error?_0x3f8740[_0x3cfcb6(0x20a)]:String(_0x3f8740);return _0x51ba08[_0x3cfcb6(0x243)](_0x3cfcb6(0x26c))||_0x51ba08[_0x3cfcb6(0x259)]()[_0x3cfcb6(0x243)](_0x3cfcb6(0x23a))?console[_0x3cfcb6(0x24a)](a5_0x2eb618[_0x3cfcb6(0x246)]('✗\x20ERROR:\x20Agent\x20not\x20found:\x20'+_0x1ac151[_0x3cfcb6(0x248)])):console[_0x3cfcb6(0x24a)](a5_0x2eb618['red'](_0x3cfcb6(0x1f1)+_0x1ac151[_0x3cfcb6(0x248)]+_0x3cfcb6(0x252)+_0x51ba08)),0x1;}let _0x365a93;if(!_0x103f6b)try{_0x365a93=await setupEvaluatorAgent(_0x2fbd61[_0x3cfcb6(0x207)],_0x43e78d[_0x3cfcb6(0x1fb)]);}catch(_0x536009){const _0x2fa40e=_0x536009 instanceof Error?_0x536009[_0x3cfcb6(0x20a)]:String(_0x536009);return console[_0x3cfcb6(0x24a)](a5_0x2eb618['red'](_0x3cfcb6(0x1f7)+_0x2fa40e)),0x1;}console[_0x3cfcb6(0x24a)](a5_0x2eb618['cyan']('Running\x20agent\x20tests...')),console[_0x3cfcb6(0x24a)](_0x3cfcb6(0x247)+a5_0x2eb618[_0x3cfcb6(0x249)](_0x179348)),console['log'](_0x3cfcb6(0x27b)+a5_0x2eb618[_0x3cfcb6(0x249)](_0x1ac151[_0x3cfcb6(0x1f6)]+'/'+_0x1ac151['agentName'])),console[_0x3cfcb6(0x24a)]();const _0x30d021=[],_0x416786=[],_0x4d3ca5=Date[_0x3cfcb6(0x23b)]();for(let _0x54e8ce=0x0;_0x54e8ce<_0x2b296c[_0x3cfcb6(0x274)];_0x54e8ce++){const _0x42952c=_0x2b296c[_0x54e8ce];_0x2b296c[_0x3cfcb6(0x274)]>0x1?console[_0x3cfcb6(0x24a)](_0x3cfcb6(0x21a)+(_0x54e8ce+0x1)+'/'+_0x2b296c[_0x3cfcb6(0x274)]+':\x20'+a5_0x2eb618[_0x3cfcb6(0x249)](_0x42952c['name'])):console[_0x3cfcb6(0x24a)](_0x3cfcb6(0x20d)+a5_0x2eb618[_0x3cfcb6(0x249)](_0x42952c[_0x3cfcb6(0x239)]));const _0x6879ac=createCommandSpinner(_0x3cfcb6(0x1fc)+_0x42952c[_0x3cfcb6(0x256)][_0x3cfcb6(0x274)]+_0x3cfcb6(0x205));_0x6879ac[_0x3cfcb6(0x20f)]();try{const {result:_0x4f046c,conversation:_0x3e9a94}=await runTest(_0x2fbd61[_0x3cfcb6(0x207)],_0x42952c,{'agentId':_0x22d45e,'projectId':_0xe4fa1d,'site':_0x179348,'noEval':_0x103f6b,'evaluatorId':_0x365a93,'onRoundStart':(_0x4abaf4,_0x217426)=>{const _0x4b4939=_0x3cfcb6;_0x6879ac[_0x4b4939(0x254)]='Round\x20'+(_0x4abaf4+0x1)+'/'+_0x217426+_0x4b4939(0x205);},'onRoundComplete':(_0x55d828,_0x2a298f,_0x5c1eb4)=>{const _0xf3a59a=_0x3cfcb6,_0x4246c6=formatElapsed(_0x2a298f);_0x5c1eb4?console['log'](_0xf3a59a(0x26b)+(_0x55d828+0x1)+'/'+_0x42952c[_0xf3a59a(0x256)][_0xf3a59a(0x274)]+'...\x20'+a5_0x2eb618[_0xf3a59a(0x202)]('✓')+'\x20('+_0x4246c6+')'):console[_0xf3a59a(0x24a)](_0xf3a59a(0x26b)+(_0x55d828+0x1)+'/'+_0x42952c[_0xf3a59a(0x256)]['length']+_0xf3a59a(0x235)+a5_0x2eb618[_0xf3a59a(0x246)]('✗'));},'onEvaluationStart':()=>{const _0x24c7de=_0x3cfcb6;_0x6879ac['text']=_0x24c7de(0x20c);},'onEvaluationComplete':_0x412a57=>{const _0x55d9bd=_0x3cfcb6,_0x4a0140=formatElapsed(_0x412a57);console[_0x55d9bd(0x24a)]('\x20\x20Evaluating...\x20'+a5_0x2eb618[_0x55d9bd(0x202)]('✓')+'\x20('+_0x4a0140+')');}});_0x6879ac['stop'](),_0x30d021['push'](_0x4f046c),_0x416786['push'](_0x3e9a94);if(_0x4f046c[_0x3cfcb6(0x23e)]===_0x3cfcb6(0x215))console[_0x3cfcb6(0x24a)](a5_0x2eb618[_0x3cfcb6(0x202)](_0x3cfcb6(0x253)+_0x4f046c['reason']));else _0x4f046c['status']===_0x3cfcb6(0x27f)?console[_0x3cfcb6(0x24a)](a5_0x2eb618['red'](_0x3cfcb6(0x25e)+_0x4f046c[_0x3cfcb6(0x1f0)])):console[_0x3cfcb6(0x24a)](a5_0x2eb618[_0x3cfcb6(0x246)]('✗\x20ERROR:\x20'+_0x4f046c[_0x3cfcb6(0x1f0)]));_0x4f046c[_0x3cfcb6(0x21d)]&&console[_0x3cfcb6(0x24a)](a5_0x2eb618[_0x3cfcb6(0x214)](_0x3cfcb6(0x227)+_0x4f046c[_0x3cfcb6(0x21d)])),console[_0x3cfcb6(0x24a)]();}catch(_0x1d3450){_0x6879ac[_0x3cfcb6(0x220)]();const _0x580b6a=_0x1d3450 instanceof Error?_0x1d3450[_0x3cfcb6(0x20a)]:String(_0x1d3450);console['log'](a5_0x2eb618[_0x3cfcb6(0x246)](_0x3cfcb6(0x200)+_0x580b6a)),console[_0x3cfcb6(0x24a)](),_0x30d021[_0x3cfcb6(0x201)]({'name':_0x42952c['name'],'status':_0x3cfcb6(0x26d),'reason':_0x580b6a,'timestamp':new Date()[_0x3cfcb6(0x275)](),'duration_ms':0x0});}}const _0x3ba96d=Date[_0x3cfcb6(0x23b)]()-_0x4d3ca5,_0x5699eb=_0x30d021[_0x3cfcb6(0x225)](_0x3f0dd8=>_0x3f0dd8[_0x3cfcb6(0x23e)]===_0x3cfcb6(0x215))[_0x3cfcb6(0x274)],_0x2e2e5e=_0x30d021[_0x3cfcb6(0x225)](_0x43f65c=>_0x43f65c[_0x3cfcb6(0x23e)]==='FAIL')[_0x3cfcb6(0x274)],_0x3eee64=_0x30d021['filter'](_0x1787c2=>_0x1787c2['status']===_0x3cfcb6(0x26d))['length'];console['log']('━'[_0x3cfcb6(0x229)](0x3c)),console[_0x3cfcb6(0x24a)]('Test\x20Summary'),console[_0x3cfcb6(0x24a)]('━'[_0x3cfcb6(0x229)](0x3c)),console['log']('Total:\x20\x20\x20\x20'+_0x30d021['length']),console[_0x3cfcb6(0x24a)](_0x3cfcb6(0x21f)+a5_0x2eb618[_0x3cfcb6(0x202)](_0x5699eb)),console[_0x3cfcb6(0x24a)]('Failed:\x20\x20\x20'+a5_0x2eb618['red'](_0x2e2e5e));_0x3eee64>0x0&&console[_0x3cfcb6(0x24a)](_0x3cfcb6(0x206)+a5_0x2eb618[_0x3cfcb6(0x246)](_0x3eee64));console[_0x3cfcb6(0x24a)](_0x3cfcb6(0x1f9)+formatElapsed(_0x3ba96d)),console[_0x3cfcb6(0x24a)]('━'['repeat'](0x3c));const _0x22a75e=_0x30d021[_0x3cfcb6(0x225)](_0x483da2=>_0x483da2['status']!=='PASS');if(_0x22a75e['length']>0x0){console[_0x3cfcb6(0x24a)](),console['log'](_0x3cfcb6(0x279));for(const _0x25795a of _0x22a75e){const _0x1c8567=a5_0x2eb618['red']('✗'),_0x1ba482=_0x25795a[_0x3cfcb6(0x1f0)]['length']>0x32?_0x25795a[_0x3cfcb6(0x1f0)][_0x3cfcb6(0x226)](0x0,0x32)+_0x3cfcb6(0x266):_0x25795a[_0x3cfcb6(0x1f0)];console['log']('\x20\x20'+_0x1c8567+'\x20'+_0x25795a[_0x3cfcb6(0x239)]+':\x20'+_0x1ba482);}}const _0x5e72a1={'summary':{'total':_0x30d021[_0x3cfcb6(0x274)],'passed':_0x5699eb,'failed':_0x2e2e5e,'errors':_0x3eee64>0x0?_0x3eee64:undefined,'duration_ms':_0x3ba96d},'tests':_0x30d021,'agent':{'project':_0x1ac151[_0x3cfcb6(0x1f6)],'name':_0x1ac151['agentName'],'site':_0x179348},'timestamp':new Date(_0x4d3ca5)[_0x3cfcb6(0x275)]()};try{const _0x3da781=buildCachedTestRun(_0x416786,{'site':_0x179348,'projectId':_0xe4fa1d,'projectName':_0x1ac151[_0x3cfcb6(0x1f6)],'agentId':_0x22d45e,'agentName':_0x1ac151['agentName'],'testYmlPath':a5_0x40667c[_0x3cfcb6(0x237)](_0x1ac151['testYmlPath'])});saveLastTestRun(_0x3da781);}catch{}if(_0x422b09!==_0x3cfcb6(0x23f)||_0x139122){const _0x275ea8=formatResults(_0x5e72a1,_0x422b09);if(_0x139122)try{a5_0x5838fa[_0x3cfcb6(0x27d)](_0x139122,_0x275ea8,_0x3cfcb6(0x231)),console[_0x3cfcb6(0x24a)](),console[_0x3cfcb6(0x24a)](a5_0x2eb618['dim']('Output\x20written\x20to:\x20'+_0x139122));}catch(_0x26f43d){return console[_0x3cfcb6(0x24a)](),console[_0x3cfcb6(0x24a)](a5_0x2eb618[_0x3cfcb6(0x246)](_0x3cfcb6(0x21c)+_0x26f43d)),0x1;}else console[_0x3cfcb6(0x24a)](),console['log'](_0x275ea8);}return _0x22a75e['length']>0x0?0x1:0x0;}async[a5_0x40e23d(0x22d)](_0x31b951,_0x2b63d8){const _0x3bd33d=a5_0x40e23d,{options:_0x41a6d8,tdx:_0x46632b}=_0x31b951,{definition:_0x1f7348,agentInfo:_0x49e647,outputFormat:_0x3b0abb,outputFile:_0x12d65b}=_0x2b63d8,_0x260392=_0x41a6d8[_0x3bd33d(0x268)],_0x567465=loadLastTestRun();if(!_0x567465)return console['log'](a5_0x2eb618[_0x3bd33d(0x246)](_0x3bd33d(0x273))),console['log'](a5_0x2eb618['dim'](_0x3bd33d(0x269))),0x1;if(_0x567465[_0x3bd33d(0x228)][_0x3bd33d(0x248)]!==_0x49e647['agentName'])return console[_0x3bd33d(0x24a)](a5_0x2eb618[_0x3bd33d(0x246)]('Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22'+_0x567465[_0x3bd33d(0x228)]['agentName']+_0x3bd33d(0x24c)+_0x49e647['agentName']+'\x22.')),console[_0x3bd33d(0x24a)](a5_0x2eb618['dim']('Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.')),0x1;const _0x4718b8=new Set(_0x567465[_0x3bd33d(0x276)][_0x3bd33d(0x257)](_0x21a2d1=>_0x21a2d1[_0x3bd33d(0x244)])),_0x3c1edd=_0x1f7348[_0x3bd33d(0x278)][_0x3bd33d(0x225)](_0x5b0b08=>!_0x4718b8['has'](_0x5b0b08[_0x3bd33d(0x239)]));if(_0x3c1edd[_0x3bd33d(0x274)]>0x0&&_0x567465[_0x3bd33d(0x268)]!==_0x260392)return console[_0x3bd33d(0x24a)](a5_0x2eb618['red']('Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.')),console[_0x3bd33d(0x24a)](a5_0x2eb618[_0x3bd33d(0x214)](_0x3bd33d(0x21e)+_0x567465[_0x3bd33d(0x268)]+_0x3bd33d(0x25d)+_0x260392+'\x22.')),console[_0x3bd33d(0x24a)](a5_0x2eb618['dim'](_0x3bd33d(0x255)+_0x567465['site']+_0x3bd33d(0x204))),0x1;const _0xb0e369=_0x1f7348['tests']['filter'](_0x158523=>_0x4718b8['has'](_0x158523[_0x3bd33d(0x239)])),_0x3ee880=_0x3c1edd;let _0x29ec76;try{_0x29ec76=await setupEvaluatorAgent(_0x46632b[_0x3bd33d(0x207)],_0x41a6d8[_0x3bd33d(0x1fb)]);}catch(_0x22129b){const _0x79fcc4=_0x22129b instanceof Error?_0x22129b[_0x3bd33d(0x20a)]:String(_0x22129b);return console[_0x3bd33d(0x24a)](a5_0x2eb618[_0x3bd33d(0x246)]('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x79fcc4)),0x1;}console['log'](a5_0x2eb618[_0x3bd33d(0x236)](_0x3bd33d(0x219))),console[_0x3bd33d(0x24a)](_0x3bd33d(0x265)+a5_0x2eb618['white'](_0x567465[_0x3bd33d(0x238)])),console[_0x3bd33d(0x24a)](_0x3bd33d(0x27b)+a5_0x2eb618[_0x3bd33d(0x249)](_0x567465[_0x3bd33d(0x228)][_0x3bd33d(0x1f6)]+'/'+_0x567465[_0x3bd33d(0x228)][_0x3bd33d(0x248)]));_0x3ee880[_0x3bd33d(0x274)]>0x0&&console[_0x3bd33d(0x24a)](_0x3bd33d(0x26f)+a5_0x2eb618[_0x3bd33d(0x1fe)](_0x3ee880['length']));console[_0x3bd33d(0x24a)]();const _0x183890=[],_0x4e477b=Date['now'](),_0x5f4be0=createCommandSpinner(_0x3bd33d(0x1f8));if(_0xb0e369[_0x3bd33d(0x274)]>0x0)try{const _0x416eb1=await reevaluateFromCache(_0x46632b[_0x3bd33d(0x207)],_0x567465,{'tests':_0xb0e369},{'evaluatorId':_0x29ec76,'onTestStart':(_0x4c62e3,_0x1f7742,_0x3d6698)=>{const _0x577331=_0x3bd33d;_0x5f4be0[_0x577331(0x254)]='Re-evaluating\x20'+(_0x1f7742+0x1)+'/'+_0x3d6698+':\x20'+_0x4c62e3+_0x577331(0x266);if(!_0x5f4be0[_0x577331(0x22c)])_0x5f4be0[_0x577331(0x20f)]();},'onTestComplete':(_0x1adbc9,_0xf75c)=>{const _0x200f71=_0x3bd33d;_0x5f4be0[_0x200f71(0x220)]();if(_0xf75c[_0x200f71(0x23e)]===_0x200f71(0x215))console[_0x200f71(0x24a)](a5_0x2eb618[_0x200f71(0x202)]('✓\x20PASS:\x20'+_0x1adbc9)+a5_0x2eb618['dim'](_0x200f71(0x208)));else _0xf75c['status']==='FAIL'?console[_0x200f71(0x24a)](a5_0x2eb618['red'](_0x200f71(0x25e)+_0x1adbc9+'\x20-\x20'+_0xf75c[_0x200f71(0x1f0)])+a5_0x2eb618['dim'](_0x200f71(0x208))):console[_0x200f71(0x24a)](a5_0x2eb618['red'](_0x200f71(0x200)+_0x1adbc9+_0x200f71(0x22a)+_0xf75c[_0x200f71(0x1f0)]));_0xf75c['conversation_url']&&console[_0x200f71(0x24a)](a5_0x2eb618[_0x200f71(0x214)](_0x200f71(0x260)+_0xf75c['conversation_url'])),_0x183890['push'](_0xf75c);},'onTestSkipped':(_0x57c941,_0xb4d721)=>{const _0x1fcaf9=_0x3bd33d;_0x5f4be0[_0x1fcaf9(0x220)](),console[_0x1fcaf9(0x24a)](a5_0x2eb618[_0x1fcaf9(0x1fe)](_0x1fcaf9(0x1f2)+_0x57c941+_0x1fcaf9(0x22a)+_0xb4d721));}});for(const _0x26a054 of _0x416eb1){!_0x183890[_0x3bd33d(0x217)](_0x3458cc=>_0x3458cc[_0x3bd33d(0x239)]===_0x26a054[_0x3bd33d(0x239)])&&_0x183890[_0x3bd33d(0x201)](_0x26a054);}}catch(_0x160985){_0x5f4be0[_0x3bd33d(0x220)]();const _0x2301f2=_0x160985 instanceof Error?_0x160985[_0x3bd33d(0x20a)]:String(_0x160985);return console[_0x3bd33d(0x24a)](a5_0x2eb618[_0x3bd33d(0x246)](_0x3bd33d(0x1f4)+_0x2301f2)),0x1;}_0x5f4be0[_0x3bd33d(0x220)]();if(_0x3ee880[_0x3bd33d(0x274)]>0x0){console[_0x3bd33d(0x24a)](),console[_0x3bd33d(0x24a)](a5_0x2eb618[_0x3bd33d(0x236)](_0x3bd33d(0x210)));const {projectId:_0x176f78,agentId:_0x28caf1}=_0x567465[_0x3bd33d(0x228)];for(const _0x34bb45 of _0x3ee880){console[_0x3bd33d(0x24a)](_0x3bd33d(0x25b)+a5_0x2eb618[_0x3bd33d(0x249)](_0x34bb45['name']));const _0x33ff2d=createCommandSpinner('Round\x201/'+_0x34bb45[_0x3bd33d(0x256)][_0x3bd33d(0x274)]+_0x3bd33d(0x205));_0x33ff2d[_0x3bd33d(0x20f)]();try{const {result:_0x33c842}=await runTest(_0x46632b['llm'],_0x34bb45,{'agentId':_0x28caf1,'projectId':_0x176f78,'site':_0x567465[_0x3bd33d(0x268)],'noEval':![],'evaluatorId':_0x29ec76,'onRoundStart':(_0xd64796,_0x29e153)=>{const _0x55250a=_0x3bd33d;_0x33ff2d[_0x55250a(0x254)]=_0x55250a(0x25f)+(_0xd64796+0x1)+'/'+_0x29e153+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x3b90b4,_0x146fdb,_0x9ef4f7)=>{const _0x420e87=_0x3bd33d,_0x53313a=formatElapsed(_0x146fdb);_0x9ef4f7?console[_0x420e87(0x24a)](_0x420e87(0x26b)+(_0x3b90b4+0x1)+'/'+_0x34bb45['rounds'][_0x420e87(0x274)]+_0x420e87(0x235)+a5_0x2eb618[_0x420e87(0x202)]('✓')+'\x20('+_0x53313a+')'):console[_0x420e87(0x24a)](_0x420e87(0x26b)+(_0x3b90b4+0x1)+'/'+_0x34bb45[_0x420e87(0x256)][_0x420e87(0x274)]+_0x420e87(0x235)+a5_0x2eb618[_0x420e87(0x246)]('✗'));},'onEvaluationStart':()=>{const _0x45e48c=_0x3bd33d;_0x33ff2d[_0x45e48c(0x254)]='Evaluating\x20response...';},'onEvaluationComplete':_0x4a1019=>{const _0x39d57c=_0x3bd33d,_0xaebb7a=formatElapsed(_0x4a1019);console[_0x39d57c(0x24a)](_0x39d57c(0x250)+a5_0x2eb618[_0x39d57c(0x202)]('✓')+'\x20('+_0xaebb7a+')');}});_0x33ff2d[_0x3bd33d(0x220)](),_0x183890['push'](_0x33c842);if(_0x33c842[_0x3bd33d(0x23e)]===_0x3bd33d(0x215))console[_0x3bd33d(0x24a)](a5_0x2eb618['green']('✓\x20PASS:\x20'+_0x33c842[_0x3bd33d(0x1f0)])+a5_0x2eb618['dim'](_0x3bd33d(0x245)));else _0x33c842[_0x3bd33d(0x23e)]===_0x3bd33d(0x27f)?console['log'](a5_0x2eb618[_0x3bd33d(0x246)](_0x3bd33d(0x25e)+_0x33c842[_0x3bd33d(0x1f0)])+a5_0x2eb618[_0x3bd33d(0x214)](_0x3bd33d(0x245))):console[_0x3bd33d(0x24a)](a5_0x2eb618['red'](_0x3bd33d(0x200)+_0x33c842['reason']));_0x33c842[_0x3bd33d(0x21d)]&&console[_0x3bd33d(0x24a)](a5_0x2eb618[_0x3bd33d(0x214)](_0x3bd33d(0x260)+_0x33c842['conversation_url']));}catch(_0x555517){_0x33ff2d[_0x3bd33d(0x220)]();const _0x131ba0=_0x555517 instanceof Error?_0x555517[_0x3bd33d(0x20a)]:String(_0x555517);console[_0x3bd33d(0x24a)](a5_0x2eb618[_0x3bd33d(0x246)](_0x3bd33d(0x200)+_0x131ba0)),_0x183890[_0x3bd33d(0x201)]({'name':_0x34bb45['name'],'status':_0x3bd33d(0x26d),'reason':_0x131ba0,'timestamp':new Date()[_0x3bd33d(0x275)](),'duration_ms':0x0});}}}console['log']();const _0x40a8a4=Date[_0x3bd33d(0x23b)]()-_0x4e477b,_0x27d39b=_0x183890[_0x3bd33d(0x225)](_0x1d0ace=>_0x1d0ace[_0x3bd33d(0x23e)]==='PASS')['length'],_0x59391f=_0x183890[_0x3bd33d(0x225)](_0x58a057=>_0x58a057['status']===_0x3bd33d(0x27f))['length'],_0x3aa359=_0x183890['filter'](_0x361373=>_0x361373[_0x3bd33d(0x23e)]===_0x3bd33d(0x26d))['length'];console[_0x3bd33d(0x24a)]('━'[_0x3bd33d(0x229)](0x3c)),console[_0x3bd33d(0x24a)](_0x3bd33d(0x20b)),console[_0x3bd33d(0x24a)]('━'[_0x3bd33d(0x229)](0x3c)),console['log']('Total:\x20\x20\x20\x20'+_0x183890['length']),console[_0x3bd33d(0x24a)](_0x3bd33d(0x21f)+a5_0x2eb618[_0x3bd33d(0x202)](_0x27d39b)),console[_0x3bd33d(0x24a)]('Failed:\x20\x20\x20'+a5_0x2eb618[_0x3bd33d(0x246)](_0x59391f));_0x3aa359>0x0&&console[_0x3bd33d(0x24a)](_0x3bd33d(0x206)+a5_0x2eb618['red'](_0x3aa359));console[_0x3bd33d(0x24a)](_0x3bd33d(0x1f9)+formatElapsed(_0x40a8a4)),console[_0x3bd33d(0x24a)]('━'[_0x3bd33d(0x229)](0x3c));const _0xd15760={'summary':{'total':_0x183890[_0x3bd33d(0x274)],'passed':_0x27d39b,'failed':_0x59391f,'errors':_0x3aa359>0x0?_0x3aa359:undefined,'duration_ms':_0x40a8a4},'tests':_0x183890,'agent':{'project':_0x49e647[_0x3bd33d(0x1f6)],'name':_0x49e647[_0x3bd33d(0x248)],'site':_0x260392},'timestamp':new Date(_0x4e477b)['toISOString']()};if(_0x3b0abb!==_0x3bd33d(0x23f)||_0x12d65b){const _0x199922=formatResults(_0xd15760,_0x3b0abb);if(_0x12d65b)try{a5_0x5838fa[_0x3bd33d(0x27d)](_0x12d65b,_0x199922,_0x3bd33d(0x231)),console[_0x3bd33d(0x24a)](),console[_0x3bd33d(0x24a)](a5_0x2eb618[_0x3bd33d(0x214)](_0x3bd33d(0x24e)+_0x12d65b));}catch(_0x514de6){return console['log'](),console['log'](a5_0x2eb618[_0x3bd33d(0x246)](_0x3bd33d(0x21c)+_0x514de6)),0x1;}else console[_0x3bd33d(0x24a)](),console['log'](_0x199922);}const _0x168276=_0x183890[_0x3bd33d(0x225)](_0x517dee=>_0x517dee['status']!==_0x3bd33d(0x215));return _0x168276[_0x3bd33d(0x274)]>0x0?0x1:0x0;}}
@@ -1 +1 @@
1
- const a6_0x5b6fb0=a6_0x4f19;(function(_0x72c7bb,_0x3bb951){const _0x3a7b38=a6_0x4f19,_0x3abba7=_0x72c7bb();while(!![]){try{const _0x17c87c=-parseInt(_0x3a7b38(0x1bf))/0x1*(parseInt(_0x3a7b38(0x1ab))/0x2)+parseInt(_0x3a7b38(0x1bb))/0x3*(-parseInt(_0x3a7b38(0x1df))/0x4)+-parseInt(_0x3a7b38(0x1bc))/0x5+parseInt(_0x3a7b38(0x1af))/0x6*(-parseInt(_0x3a7b38(0x1bd))/0x7)+-parseInt(_0x3a7b38(0x1b8))/0x8*(-parseInt(_0x3a7b38(0x1a8))/0x9)+-parseInt(_0x3a7b38(0x1c3))/0xa+parseInt(_0x3a7b38(0x1cc))/0xb;if(_0x17c87c===_0x3bb951)break;else _0x3abba7['push'](_0x3abba7['shift']());}catch(_0x1c8c29){_0x3abba7['push'](_0x3abba7['shift']());}}}(a6_0x3adc,0x46875));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';function a6_0x4f19(_0x4da496,_0x531497){_0x4da496=_0x4da496-0x19e;const _0x3adc60=a6_0x3adc();let _0x4f19e2=_0x3adc60[_0x4da496];return _0x4f19e2;}import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';function a6_0x3adc(){const _0x495ba8=['PATCH','PUT','request','x-trino-user','color','message','10277410iCnBua','\x22.\x20','GET','length','headers','.\x20Valid\x20methods:\x20','validate','log','Invalid\x20API\x20type:\x20','api','method','isArray','join','name','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','substring','startsWith','workflow','file','1121156GGXIvf','description','x-xsrf-token','proxy-authorization','entries','type','toUpperCase','\x0aStack\x20trace:\x0a','site','keys','DELETE','cookie','1634445ctBsbP','execute','Error:\x20','17764qWvXaH','body','<\x20HTTP/1.1\x20','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','60zEycgw','verbose','trim','indexOf','x-auth-token','noColor','data','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','readBodyFromFile','24fiOFDd','.\x20Valid\x20types:\x20','Results\x20saved\x20to\x20','3mDUsyK','797825JpGRcw','14028myJwtH','includes','61hJJCLI','header','authorization','output','1885440lzkPUW','llm-proxy','error'];a6_0x3adc=function(){return _0x495ba8;};return a6_0x3adc();}import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a6_0x5b6fb0(0x1c1),a6_0x5b6fb0(0x19f),a6_0x5b6fb0(0x1a7),'set-cookie','set-cookie2',a6_0x5b6fb0(0x19e),a6_0x5b6fb0(0x1b3),a6_0x5b6fb0(0x1c9)]);function isSensitiveHeader(_0x4986be){return SENSITIVE_HEADERS['has'](_0x4986be['toLowerCase']());}function parseHeader(_0x58019c){const _0x18f8b1=a6_0x5b6fb0,_0x1ac3e8=_0x58019c[_0x18f8b1(0x1b2)](':');if(_0x1ac3e8===-0x1)throw new Error('Invalid\x20header\x20format:\x20\x22'+_0x58019c+_0x18f8b1(0x1cd)+'Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22');const _0xb60125=_0x58019c[_0x18f8b1(0x1db)](0x0,_0x1ac3e8)[_0x18f8b1(0x1b1)](),_0x510567=_0x58019c[_0x18f8b1(0x1db)](_0x1ac3e8+0x1)[_0x18f8b1(0x1b1)]();if(!_0xb60125)throw new Error(_0x18f8b1(0x1b6)+_0x58019c+'\x22');return[_0xb60125,_0x510567];}export class ApiCommand extends BaseCommand{[a6_0x5b6fb0(0x1d9)]=a6_0x5b6fb0(0x1d5);[a6_0x5b6fb0(0x1e0)]='Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs';[a6_0x5b6fb0(0x1d2)](_0x5e03ea){const _0xb7e878=a6_0x5b6fb0,{args:_0x3c4187,options:_0x1064a8}=_0x5e03ea,_0x5767da=_0x1064a8;if(_0x3c4187[_0xb7e878(0x1cf)]===0x0)return _0xb7e878(0x1da);const _0x49d7a0=_0x3c4187[0x0];if(!_0x49d7a0[_0xb7e878(0x1dc)]('/'))return'Endpoint\x20must\x20start\x20with\x20/:\x20'+_0x49d7a0;const _0xe11793=_0x5767da['data'],_0x30a7c3=_0x5767da[_0xb7e878(0x1de)];if(_0xe11793&&_0x30a7c3)return _0xb7e878(0x1ae);const _0x868d2e=_0x5767da['method']||_0xb7e878(0x1ce),_0x10afdc=[_0xb7e878(0x1ce),'POST',_0xb7e878(0x1c7),_0xb7e878(0x1a6),_0xb7e878(0x1c6)];if(!_0x10afdc[_0xb7e878(0x1be)](_0x868d2e['toUpperCase']()))return'Invalid\x20HTTP\x20method:\x20'+_0x868d2e+_0xb7e878(0x1d1)+_0x10afdc[_0xb7e878(0x1d8)](',\x20');const _0x48dd8c=_0x5767da['type']||'td',_0x2ebce0=['td','cdp',_0xb7e878(0x1dd),'trino','llm',_0xb7e878(0x1c4)];if(!_0x2ebce0[_0xb7e878(0x1be)](_0x48dd8c))return _0xb7e878(0x1d4)+_0x48dd8c+_0xb7e878(0x1b9)+_0x2ebce0[_0xb7e878(0x1d8)](',\x20');return undefined;}async[a6_0x5b6fb0(0x1a9)](_0x124374){const _0x3fd139=a6_0x5b6fb0,{options:_0x11dd9d,args:_0xe7d6d1,tdx:_0x58b81d}=_0x124374,_0x1fe891=_0x11dd9d,_0x3a2271=_0xe7d6d1[0x0],_0x159c9b=(_0x1fe891[_0x3fd139(0x1d6)]||'GET')[_0x3fd139(0x1a2)](),_0x5c0d69=_0x1fe891[_0x3fd139(0x1b5)],_0x428126=_0x1fe891[_0x3fd139(0x1de)],_0x2a3c7b=_0x1fe891[_0x3fd139(0x1c0)],_0x15cdb8=_0x1fe891[_0x3fd139(0x1a1)]||'td';try{const _0x3f52d5={};if(_0x2a3c7b){const _0x1d0591=Array[_0x3fd139(0x1d7)](_0x2a3c7b)?_0x2a3c7b:[_0x2a3c7b];for(const _0x36d87b of _0x1d0591){const [_0x198d40,_0x1d26d3]=parseHeader(_0x36d87b);_0x3f52d5[_0x198d40]=_0x1d26d3;}}let _0xd933cd;if(_0x5c0d69)_0xd933cd=_0x5c0d69;else{if(_0x428126)try{_0xd933cd=RawAPI[_0x3fd139(0x1b7)](_0x428126);}catch(_0x240793){return console[_0x3fd139(0x1c5)](_0x3fd139(0x1aa)+(_0x240793 instanceof Error?_0x240793[_0x3fd139(0x1cb)]:String(_0x240793))),0x1;}}const _0x576ef0={'method':_0x159c9b,'apiType':_0x15cdb8,'includeHeaders':_0x11dd9d[_0x3fd139(0x1b0)]};_0xd933cd&&(_0x576ef0[_0x3fd139(0x1ac)]=_0xd933cd);Object[_0x3fd139(0x1a5)](_0x3f52d5)['length']>0x0&&(_0x576ef0['headers']=_0x3f52d5);if(_0x11dd9d[_0x3fd139(0x1b0)]){const _0x376f23=resolveSite(_0x11dd9d[_0x3fd139(0x1a4)]),_0x250b91=getEndpoint(_0x376f23,_0x15cdb8),_0x1a6c42=''+_0x250b91+_0x3a2271;console[_0x3fd139(0x1c5)]('>\x20'+_0x159c9b+'\x20'+_0x1a6c42);const _0x11fcb8=getAuthHeaders(_0x376f23),_0x9ec28a={..._0x11fcb8,..._0x3f52d5};for(const [_0x335484,_0x2424e5]of Object[_0x3fd139(0x1a0)](_0x9ec28a)){!isSensitiveHeader(_0x335484)&&console[_0x3fd139(0x1c5)]('>\x20'+_0x335484+':\x20'+_0x2424e5);}_0xd933cd&&console[_0x3fd139(0x1c5)]('>'),console['error']('');}const _0x4e809a=await _0x58b81d[_0x3fd139(0x1d5)][_0x3fd139(0x1c8)](_0x3a2271,_0x576ef0);if(_0x11dd9d[_0x3fd139(0x1b0)]&&_0x4e809a[_0x3fd139(0x1d0)]){console[_0x3fd139(0x1c5)](_0x3fd139(0x1ad)+_0x4e809a['status']);for(const [_0x3c9c05,_0x5ed11e]of Object[_0x3fd139(0x1a0)](_0x4e809a[_0x3fd139(0x1d0)])){!isSensitiveHeader(_0x3c9c05)&&console[_0x3fd139(0x1c5)]('<\x20'+_0x3c9c05+':\x20'+_0x5ed11e);}console[_0x3fd139(0x1c5)]('');}const _0x3ab828=Boolean(_0x11dd9d[_0x3fd139(0x1c2)]),_0x3969c1={'color':_0x11dd9d['color'],'noColor':_0x11dd9d[_0x3fd139(0x1b4)]||_0x3ab828&&!_0x11dd9d[_0x3fd139(0x1ca)]},_0x5ac4ee=colorizeJSON(_0x4e809a['data'],_0x3969c1);return _0x11dd9d[_0x3fd139(0x1c2)]?(writeFileSync(_0x11dd9d['output'],_0x5ac4ee),console[_0x3fd139(0x1c5)](_0x3fd139(0x1ba)+_0x11dd9d[_0x3fd139(0x1c2)])):console[_0x3fd139(0x1d3)](_0x5ac4ee),0x0;}catch(_0x3b87de){return _0x3b87de instanceof Error?(console[_0x3fd139(0x1c5)](_0x3fd139(0x1aa)+_0x3b87de[_0x3fd139(0x1cb)]),_0x11dd9d[_0x3fd139(0x1b0)]&&_0x3b87de['stack']&&console['error'](_0x3fd139(0x1a3)+_0x3b87de['stack'])):console['error'](_0x3fd139(0x1aa)+String(_0x3b87de)),0x1;}}}
1
+ const a6_0x457731=a6_0x2f5e;function a6_0x2f5e(_0x437e19,_0x20d126){_0x437e19=_0x437e19-0xa2;const _0x41ada8=a6_0x41ad();let _0x2f5e62=_0x41ada8[_0x437e19];return _0x2f5e62;}(function(_0x3f35bb,_0x21908b){const _0x3bbbba=a6_0x2f5e,_0x16b872=_0x3f35bb();while(!![]){try{const _0x266449=-parseInt(_0x3bbbba(0xbd))/0x1*(-parseInt(_0x3bbbba(0xcf))/0x2)+-parseInt(_0x3bbbba(0xce))/0x3+parseInt(_0x3bbbba(0xb6))/0x4+parseInt(_0x3bbbba(0xd3))/0x5*(parseInt(_0x3bbbba(0xca))/0x6)+parseInt(_0x3bbbba(0xc0))/0x7*(parseInt(_0x3bbbba(0xd4))/0x8)+-parseInt(_0x3bbbba(0xde))/0x9+parseInt(_0x3bbbba(0xaa))/0xa*(-parseInt(_0x3bbbba(0xe0))/0xb);if(_0x266449===_0x21908b)break;else _0x16b872['push'](_0x16b872['shift']());}catch(_0x32c3b1){_0x16b872['push'](_0x16b872['shift']());}}}(a6_0x41ad,0x99366));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';const SENSITIVE_HEADERS=new Set([a6_0x457731(0xc4),a6_0x457731(0xd9),a6_0x457731(0xc7),a6_0x457731(0xd2),'set-cookie2','x-xsrf-token',a6_0x457731(0xc9),'x-trino-user']);function isSensitiveHeader(_0x1856a4){const _0x47cb65=a6_0x457731;return SENSITIVE_HEADERS[_0x47cb65(0xd5)](_0x1856a4[_0x47cb65(0xcb)]());}function parseHeader(_0x3c3c37){const _0x47720a=a6_0x457731,_0x51eea1=_0x3c3c37[_0x47720a(0xc1)](':');if(_0x51eea1===-0x1)throw new Error(_0x47720a(0xac)+_0x3c3c37+_0x47720a(0xbb)+_0x47720a(0xc6));const _0x34c960=_0x3c3c37[_0x47720a(0xc3)](0x0,_0x51eea1)[_0x47720a(0xe6)](),_0x1cd599=_0x3c3c37[_0x47720a(0xc3)](_0x51eea1+0x1)[_0x47720a(0xe6)]();if(!_0x34c960)throw new Error(_0x47720a(0xe3)+_0x3c3c37+'\x22');return[_0x34c960,_0x1cd599];}export class ApiCommand extends BaseCommand{[a6_0x457731(0xab)]=a6_0x457731(0xa6);[a6_0x457731(0xe5)]=a6_0x457731(0xb4);[a6_0x457731(0xa2)](_0x29e5bb){const _0x5ee66c=a6_0x457731,{args:_0x4a5ab5,options:_0x450393}=_0x29e5bb,_0x299a21=_0x450393;if(_0x4a5ab5[_0x5ee66c(0xdb)]===0x0)return'Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list';const _0x2812c5=_0x4a5ab5[0x0];if(!_0x2812c5['startsWith']('/'))return _0x5ee66c(0xa3)+_0x2812c5;const _0x43dbf7=_0x299a21[_0x5ee66c(0xe4)],_0x5cbfce=_0x299a21[_0x5ee66c(0xb3)];if(_0x43dbf7&&_0x5cbfce)return'Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.';const _0x130b6c=_0x299a21[_0x5ee66c(0xbc)]||_0x5ee66c(0xc5),_0x3eff6d=[_0x5ee66c(0xc5),_0x5ee66c(0xaf),_0x5ee66c(0xd0),'DELETE',_0x5ee66c(0xbe)];if(!_0x3eff6d[_0x5ee66c(0xad)](_0x130b6c[_0x5ee66c(0xda)]()))return'Invalid\x20HTTP\x20method:\x20'+_0x130b6c+'.\x20Valid\x20methods:\x20'+_0x3eff6d[_0x5ee66c(0xb7)](',\x20');const _0xa24066=_0x299a21[_0x5ee66c(0xa9)]||'td',_0x3cd8df=['td',_0x5ee66c(0xd1),_0x5ee66c(0xdc),_0x5ee66c(0xa7),_0x5ee66c(0xe7),_0x5ee66c(0xb5)];if(!_0x3cd8df[_0x5ee66c(0xad)](_0xa24066))return _0x5ee66c(0xe8)+_0xa24066+'.\x20Valid\x20types:\x20'+_0x3cd8df['join'](',\x20');return undefined;}async[a6_0x457731(0xcc)](_0x276c7c){const _0x2752d9=a6_0x457731,{options:_0x2ec1c3,args:_0x31beae,tdx:_0x113a56}=_0x276c7c,_0x22ad99=_0x2ec1c3,_0x4a347f=_0x31beae[0x0],_0x17b2bc=(_0x22ad99[_0x2752d9(0xbc)]||_0x2752d9(0xc5))[_0x2752d9(0xda)](),_0x1b029e=_0x22ad99[_0x2752d9(0xe4)],_0x361353=_0x22ad99[_0x2752d9(0xb3)],_0x233e8a=_0x22ad99[_0x2752d9(0xbf)],_0x83688d=_0x22ad99['type']||'td';try{const _0x43ac0b={};if(_0x233e8a){const _0x2b5732=Array[_0x2752d9(0xe1)](_0x233e8a)?_0x233e8a:[_0x233e8a];for(const _0x3220b3 of _0x2b5732){const [_0xe40ba4,_0x142435]=parseHeader(_0x3220b3);_0x43ac0b[_0xe40ba4]=_0x142435;}}let _0x335573;if(_0x1b029e)_0x335573=_0x1b029e;else{if(_0x361353)try{_0x335573=RawAPI[_0x2752d9(0xd6)](_0x361353);}catch(_0xa458f0){return console['error'](_0x2752d9(0xd7)+(_0xa458f0 instanceof Error?_0xa458f0[_0x2752d9(0xe2)]:String(_0xa458f0))),0x1;}}const _0x139338={'method':_0x17b2bc,'apiType':_0x83688d,'includeHeaders':_0x2ec1c3[_0x2752d9(0xba)]};_0x335573&&(_0x139338[_0x2752d9(0xd8)]=_0x335573);Object[_0x2752d9(0xb2)](_0x43ac0b)[_0x2752d9(0xdb)]>0x0&&(_0x139338[_0x2752d9(0xa5)]=_0x43ac0b);if(_0x2ec1c3[_0x2752d9(0xba)]){const _0x12de46=resolveSite(_0x2ec1c3[_0x2752d9(0xa8)]),_0x5465eb=getEndpoint(_0x12de46,_0x83688d),_0x504613=''+_0x5465eb+_0x4a347f;console[_0x2752d9(0xae)]('>\x20'+_0x17b2bc+'\x20'+_0x504613);const _0x1a6cdf=getAuthHeaders(_0x12de46),_0x5b7d3e={..._0x1a6cdf,..._0x43ac0b};for(const [_0x71b6af,_0x2a6851]of Object[_0x2752d9(0xcd)](_0x5b7d3e)){!isSensitiveHeader(_0x71b6af)&&console[_0x2752d9(0xae)]('>\x20'+_0x71b6af+':\x20'+_0x2a6851);}_0x335573&&console[_0x2752d9(0xae)]('>'),console[_0x2752d9(0xae)]('');}const _0x31c7ac=await _0x113a56[_0x2752d9(0xa6)]['request'](_0x4a347f,_0x139338);if(_0x2ec1c3['verbose']&&_0x31c7ac[_0x2752d9(0xa5)]){console['error'](_0x2752d9(0xc8)+_0x31c7ac[_0x2752d9(0xb1)]);for(const [_0x1b0d84,_0x3c13fc]of Object[_0x2752d9(0xcd)](_0x31c7ac[_0x2752d9(0xa5)])){!isSensitiveHeader(_0x1b0d84)&&console[_0x2752d9(0xae)]('<\x20'+_0x1b0d84+':\x20'+_0x3c13fc);}console['error']('');}const _0x3d78b6=Boolean(_0x2ec1c3['output']),_0x43176f={'color':_0x2ec1c3['color'],'noColor':_0x2ec1c3[_0x2752d9(0xb0)]||_0x3d78b6&&!_0x2ec1c3[_0x2752d9(0xdd)]},_0x35035f=colorizeJSON(_0x31c7ac[_0x2752d9(0xe4)],_0x43176f);return _0x2ec1c3[_0x2752d9(0xc2)]?(writeFileSync(_0x2ec1c3[_0x2752d9(0xc2)],_0x35035f),console[_0x2752d9(0xae)](_0x2752d9(0xb9)+_0x2ec1c3[_0x2752d9(0xc2)])):console[_0x2752d9(0xa4)](_0x35035f),0x0;}catch(_0x3708e4){return _0x3708e4 instanceof Error?(console[_0x2752d9(0xae)](_0x2752d9(0xd7)+_0x3708e4[_0x2752d9(0xe2)]),_0x2ec1c3['verbose']&&_0x3708e4[_0x2752d9(0xb8)]&&console[_0x2752d9(0xae)](_0x2752d9(0xdf)+_0x3708e4['stack'])):console[_0x2752d9(0xae)](_0x2752d9(0xd7)+String(_0x3708e4)),0x1;}}}function a6_0x41ad(){const _0x3b84d0=['length','workflow','color','1206306tJyuNy','\x0aStack\x20trace:\x0a','147697wmZdCT','isArray','message','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','data','description','trim','llm','Invalid\x20API\x20type:\x20','validate','Endpoint\x20must\x20start\x20with\x20/:\x20','log','headers','api','trino','site','type','990KBdwrJ','name','Invalid\x20header\x20format:\x20\x22','includes','error','POST','noColor','status','keys','file','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','llm-proxy','2956040iiRCRT','join','stack','Results\x20saved\x20to\x20','verbose','\x22.\x20','method','2dlYBmQ','PATCH','header','28PvmPyP','indexOf','output','substring','authorization','GET','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','cookie','<\x20HTTP/1.1\x20','x-auth-token','394428NqmIdu','toLowerCase','execute','entries','642735MxbtiM','1199782yTtPTP','PUT','cdp','set-cookie','25MsQFcx','75256BzyDKX','has','readBodyFromFile','Error:\x20','body','proxy-authorization','toUpperCase'];a6_0x41ad=function(){return _0x3b84d0;};return a6_0x41ad();}
@@ -1 +1 @@
1
- const a7_0x5e6974=a7_0x6009;(function(_0x53535d,_0x4989e5){const _0x38ac7b=a7_0x6009,_0x57b328=_0x53535d();while(!![]){try{const _0x5bb190=parseInt(_0x38ac7b(0x134))/0x1*(parseInt(_0x38ac7b(0x155))/0x2)+-parseInt(_0x38ac7b(0x14d))/0x3+parseInt(_0x38ac7b(0x15f))/0x4*(parseInt(_0x38ac7b(0x140))/0x5)+parseInt(_0x38ac7b(0x172))/0x6+parseInt(_0x38ac7b(0x146))/0x7+-parseInt(_0x38ac7b(0x13f))/0x8*(parseInt(_0x38ac7b(0x165))/0x9)+-parseInt(_0x38ac7b(0x15b))/0xa*(parseInt(_0x38ac7b(0x16d))/0xb);if(_0x5bb190===_0x4989e5)break;else _0x57b328['push'](_0x57b328['shift']());}catch(_0x579e78){_0x57b328['push'](_0x57b328['shift']());}}}(a7_0x1d6f,0x60ac0));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';function a7_0x1d6f(){const _0x2200de=['\x20--profile\x20','password','198FlcmOh','Name:\x20','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','profile','Site\x20name\x20cannot\x20be\x20empty','701958ROintb','name','Read\x20credential\x20from\x20','warn','/app/mp/ak','error','message','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','\x20\x20tdx','customSite','description','Setup\x20API\x20key\x20authentication\x20interactively','email','\x20(profile:\x20','You\x20can\x20find\x20your\x20API\x20key\x20at:','tdx:\x20auth\x20setup','create','API\x20key\x20cannot\x20be\x20empty','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','site','277SrUnZc','\x20for\x20profile:\x20','\x0aSetup\x20cancelled','tdx\x20profile:\x20','green','No\x20credential\x20found','\x27\x20registered','N/A','apiKey','red','last_name','9592GHMOeh','30435RutktQ','other','Enter\x20your\x20TD\x20API\x20key:','trim','auth:clear','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','4145190xaacYc','status','Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20','log','User:\x20','✓\x20Default\x20site\x20set\x20to\x20','first_name','1487514PVgRNi','tdx:\x20auth\x20clear','bold','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','✗\x20Validation\x20failed:\x20','Select\x20your\x20Treasure\x20Data\x20site:','No\x20API\x20key\x20found\x20in\x20keychain','yellow','1832alFSph','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','getUserInfo','auth','✓\x20Authentication\x20successful\x0a','Enter\x20site\x20name:','198320YlKOls','test','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','492iPklSK','✓\x20Profile\x20\x27','Setting\x20up\x20authentication\x20for\x20site:\x20','join','execute','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','3474QXoYGU','text','logLevel','\x20(site:\x20','select','us01'];a7_0x1d6f=function(){return _0x2200de;};return a7_0x1d6f();}import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';import{buildSiteChoices}from'../core/constants.js';import a7_0x36091f 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_0xf81f00 from'chalk';function a7_0x6009(_0x4b8089,_0x15b02b){_0x4b8089=_0x4b8089-0x125;const _0x1d6f73=a7_0x1d6f();let _0x600986=_0x1d6f73[_0x4b8089];return _0x600986;}export class AuthSetupCommand extends BaseCommand{[a7_0x5e6974(0x173)]='auth:setup';[a7_0x5e6974(0x12a)]=a7_0x5e6974(0x12b);async[a7_0x5e6974(0x163)](_0xc89252){const _0x1dbd6f=a7_0x5e6974,{options:_0x303fbe}=_0xc89252,_0x5a5d37=_0x303fbe['profile'];console[_0x1dbd6f(0x149)](a7_0xf81f00[_0x1dbd6f(0x14f)](_0x1dbd6f(0x12f)));const _0x5a514a=_0x303fbe[_0x1dbd6f(0x133)]||_0x1dbd6f(0x16a),{choices:_0x370de7,initialIndex:_0x5af016}=buildSiteChoices(_0x5a514a),_0x1bcb99=_0x5a5d37?_0x1dbd6f(0x148)+_0x5a5d37+'):':_0x1dbd6f(0x152),_0xb559e6=await a7_0x36091f({'type':_0x1dbd6f(0x169),'name':_0x1dbd6f(0x133),'message':_0x1bcb99,'choices':_0x370de7,'initial':_0x5af016});if(!_0xb559e6[_0x1dbd6f(0x133)])return console[_0x1dbd6f(0x149)](_0x1dbd6f(0x136)),0x1;let _0x140006;if(_0xb559e6[_0x1dbd6f(0x133)]===_0x1dbd6f(0x141)){const _0x17c6c3=await a7_0x36091f({'type':_0x1dbd6f(0x166),'name':'customSite','message':_0x1dbd6f(0x15a),'initial':_0x1dbd6f(0x16a),'validate':_0x1d9fe2=>{const _0x444114=_0x1dbd6f;if(!_0x1d9fe2||!_0x1d9fe2[_0x444114(0x143)]())return _0x444114(0x171);if(!/^[a-z0-9-]+$/[_0x444114(0x15c)](_0x1d9fe2['trim']()))return'Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens';return!![];}});if(!_0x17c6c3[_0x1dbd6f(0x129)])return console['log']('\x0aSetup\x20cancelled'),0x1;_0x140006=_0x17c6c3[_0x1dbd6f(0x129)];}else _0x140006=_0xb559e6[_0x1dbd6f(0x133)];const _0x2153dd=resolveSite(_0x140006);console[_0x1dbd6f(0x149)](_0x1dbd6f(0x161)+_0x2153dd),console[_0x1dbd6f(0x149)](_0x1dbd6f(0x12e)),console[_0x1dbd6f(0x149)]('\x20\x20'+getConsoleUrl(_0x2153dd,_0x1dbd6f(0x176)));const _0x36953a=await a7_0x36091f({'type':_0x1dbd6f(0x16c),'name':'apiKey','message':_0x1dbd6f(0x142),'validate':_0x7e41e3=>{const _0x346d4c=_0x1dbd6f;if(!_0x7e41e3||!_0x7e41e3[_0x346d4c(0x143)]())return _0x346d4c(0x131);return!![];}});if(!_0x36953a[_0x1dbd6f(0x13c)])return console['log'](_0x1dbd6f(0x136)),0x1;const _0x255799=_0x36953a[_0x1dbd6f(0x13c)];console[_0x1dbd6f(0x149)]('Validating\x20API\x20key...');try{const _0x44235d=TDX[_0x1dbd6f(0x130)]({'site':_0x2153dd,'apiKey':_0x255799[_0x1dbd6f(0x143)](),'logLevel':_0x303fbe[_0x1dbd6f(0x167)]??LogLevel['ERROR']}),_0x5dba9a=await _0x44235d['jobs'][_0x1dbd6f(0x157)]();console[_0x1dbd6f(0x149)](_0x1dbd6f(0x15e)+_0x5dba9a[_0x1dbd6f(0x12c)]+')');const _0x252a7f=await isKeychainAvailable();_0x252a7f?(await saveAPIKeyAsync(_0x255799[_0x1dbd6f(0x143)](),_0x2153dd,_0x5a5d37),console[_0x1dbd6f(0x149)](_0x1dbd6f(0x164)+(_0x5a5d37?_0x1dbd6f(0x12d)+_0x5a5d37+')':''))):(console[_0x1dbd6f(0x175)](a7_0xf81f00[_0x1dbd6f(0x154)](_0x1dbd6f(0x15d))),console[_0x1dbd6f(0x175)](a7_0xf81f00['yellow'](_0x1dbd6f(0x156))));if(_0x5a5d37){const _0x4f7e6e={'site':_0x2153dd};saveProfileToUserConfig(_0x5a5d37,_0x4f7e6e),console['log'](_0x1dbd6f(0x160)+_0x5a5d37+_0x1dbd6f(0x13a));}else saveDefaultSiteToUserConfig(_0x2153dd),console[_0x1dbd6f(0x149)](_0x1dbd6f(0x14b)+_0x2153dd);const _0x371377=_0x5a5d37?_0x1dbd6f(0x16b)+_0x5a5d37:'';return console[_0x1dbd6f(0x149)](),console[_0x1dbd6f(0x149)](_0x1dbd6f(0x16f)),console[_0x1dbd6f(0x149)](_0x1dbd6f(0x128)+_0x371377+_0x1dbd6f(0x127)),console[_0x1dbd6f(0x149)]('\x20\x20tdx'+_0x371377+_0x1dbd6f(0x132)),0x0;}catch(_0x22ff21){if(_0x22ff21 instanceof HTTPClientError&&_0x22ff21[_0x1dbd6f(0x147)]===0x191)return printAuthError(_0x22ff21),0x1;return console[_0x1dbd6f(0x125)](a7_0xf81f00[_0x1dbd6f(0x13d)](_0x1dbd6f(0x151)+(_0x22ff21 instanceof Error?_0x22ff21[_0x1dbd6f(0x126)]:String(_0x22ff21)))),console[_0x1dbd6f(0x125)](_0x1dbd6f(0x150)),0x1;}}}export class AuthStatusCommand extends BaseCommand{['name']=a7_0x5e6974(0x158);[a7_0x5e6974(0x12a)]=a7_0x5e6974(0x145);async['execute'](_0x103f83){const _0x507da6=a7_0x5e6974,{options:_0x328593,tdx:_0x417718}=_0x103f83,_0x4d4af8=_0x328593[_0x507da6(0x133)],_0x46a537=_0x328593[_0x507da6(0x170)],_0x3d84d4=_0x46a537?_0x46a537:_0x507da6(0x13b);console['log'](_0x507da6(0x137)+_0x3d84d4+_0x507da6(0x168)+_0x4d4af8+')');const _0x38b0df=await resolveAPIKeyAsync(_0x4d4af8,_0x46a537);if(_0x38b0df){const {source:_0xbb8f45,isDeprecated:_0x1e589}=_0x38b0df,_0xe5e171=_0x507da6(0x174)+_0xbb8f45;console[_0x507da6(0x149)](_0x1e589?a7_0xf81f00[_0x507da6(0x154)](_0xe5e171):_0xe5e171);}else console[_0x507da6(0x149)](a7_0xf81f00[_0x507da6(0x154)](_0x507da6(0x139)));try{const _0xbf9d76=await _0x417718['jobs']['getUserInfo']();return console[_0x507da6(0x149)](a7_0xf81f00[_0x507da6(0x138)](_0x507da6(0x159))),console[_0x507da6(0x149)](_0x507da6(0x14a)+_0xbf9d76['email']),(_0xbf9d76[_0x507da6(0x14c)]||_0xbf9d76[_0x507da6(0x13e)])&&console['log'](_0x507da6(0x16e)+[_0xbf9d76[_0x507da6(0x14c)],_0xbf9d76['last_name']]['filter'](Boolean)[_0x507da6(0x162)]('\x20')),0x0;}catch(_0x5fca6e){return _0x5fca6e instanceof HTTPClientError&&_0x5fca6e[_0x507da6(0x147)]===0x191?printAuthError(_0x5fca6e,!![],_0x46a537):console[_0x507da6(0x125)](a7_0xf81f00['red'](_0x507da6(0x151)+(_0x5fca6e instanceof Error?_0x5fca6e[_0x507da6(0x126)]:String(_0x5fca6e)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x5e6974(0x173)]=a7_0x5e6974(0x144);['description']='Remove\x20API\x20key\x20from\x20system\x20keychain';async['execute'](_0x1213a4){const _0x39a932=a7_0x5e6974,{options:_0x14159b}=_0x1213a4,_0x4f8908=_0x14159b[_0x39a932(0x170)];console['log'](a7_0xf81f00[_0x39a932(0x14f)](_0x39a932(0x14e)));const _0x3ebfbe=await isKeychainAvailable();if(!_0x3ebfbe)return console[_0x39a932(0x125)](a7_0xf81f00[_0x39a932(0x13d)]('System\x20keychain\x20is\x20not\x20available')),0x1;const _0x5ebcc7=await deleteKeychainAPIKey(_0x4f8908);return _0x5ebcc7?(clearCredentialCache(),console[_0x39a932(0x149)]('✓\x20API\x20key\x20removed\x20from\x20keychain'+(_0x4f8908?_0x39a932(0x12d)+_0x4f8908+')':'')),0x0):(console['log'](_0x39a932(0x153)+(_0x4f8908?_0x39a932(0x135)+_0x4f8908:'')),0x1);}}
1
+ const a7_0x39afe3=a7_0x527e;(function(_0xf68f83,_0x39a6c6){const _0x3ecfc2=a7_0x527e,_0x25b32d=_0xf68f83();while(!![]){try{const _0x34ea5f=parseInt(_0x3ecfc2(0x1fc))/0x1+parseInt(_0x3ecfc2(0x221))/0x2+-parseInt(_0x3ecfc2(0x1ec))/0x3+parseInt(_0x3ecfc2(0x20d))/0x4+parseInt(_0x3ecfc2(0x1fe))/0x5+parseInt(_0x3ecfc2(0x21d))/0x6+-parseInt(_0x3ecfc2(0x1e5))/0x7*(parseInt(_0x3ecfc2(0x228))/0x8);if(_0x34ea5f===_0x39a6c6)break;else _0x25b32d['push'](_0x25b32d['shift']());}catch(_0x29ef95){_0x25b32d['push'](_0x25b32d['shift']());}}}(a7_0x2cd6,0x608ab));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';function a7_0x527e(_0x1ee31e,_0x5eafdf){_0x1ee31e=_0x1ee31e-0x1df;const _0x2cd62d=a7_0x2cd6();let _0x527e69=_0x2cd62d[_0x1ee31e];return _0x527e69;}import{buildSiteChoices}from'../core/constants.js';import a7_0xbbc1b4 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_0x2cd6(){const _0x217283=['Name:\x20','message','auth:clear','Validating\x20API\x20key...','✓\x20Authentication\x20successful\x0a','filter','API\x20key\x20cannot\x20be\x20empty','N/A','Enter\x20site\x20name:','Remove\x20API\x20key\x20from\x20system\x20keychain','\x20for\x20profile:\x20','warn','first_name','2975DzkYkz','trim','Read\x20credential\x20from\x20','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','description','tdx\x20profile:\x20','1121073MglQVK','\x20(site:\x20','test','profile','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','\x27\x20registered','✓\x20Default\x20site\x20set\x20to\x20','/app/mp/ak','Setup\x20API\x20key\x20authentication\x20interactively','ERROR','getUserInfo','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','execute','customSite','✓\x20Profile\x20\x27','No\x20credential\x20found','124099AEfuNT','✗\x20Validation\x20failed:\x20','2071030cBwChe','You\x20can\x20find\x20your\x20API\x20key\x20at:','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','status','last_name','jobs','create','us01','name','email','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','select','yellow','\x20\x20tdx','auth','665696IMRSyj','logLevel','auth:setup','Site\x20name\x20cannot\x20be\x20empty','System\x20keychain\x20is\x20not\x20available','site','Setting\x20up\x20authentication\x20for\x20site:\x20','\x0aSetup\x20cancelled','password','join','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','green','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','apiKey','error','\x20(profile:\x20','4228578HCcIaL','tdx:\x20auth\x20setup','red','bold','1553168VkkyHP','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','log','Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20','\x20--profile\x20','other','Select\x20your\x20Treasure\x20Data\x20site:','26672VmzACY','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key'];a7_0x2cd6=function(){return _0x217283;};return a7_0x2cd6();}import a7_0x3c9dec from'chalk';export class AuthSetupCommand extends BaseCommand{[a7_0x39afe3(0x206)]=a7_0x39afe3(0x20f);[a7_0x39afe3(0x1ea)]=a7_0x39afe3(0x1f4);async[a7_0x39afe3(0x1f8)](_0x28990f){const _0x5b3462=a7_0x39afe3,{options:_0x45aa36}=_0x28990f,_0x561c84=_0x45aa36[_0x5b3462(0x1ef)];console[_0x5b3462(0x223)](a7_0x3c9dec[_0x5b3462(0x220)](_0x5b3462(0x21e)));const _0x1c27b2=_0x45aa36[_0x5b3462(0x212)]||_0x5b3462(0x205),{choices:_0x4a5de0,initialIndex:_0x12ca66}=buildSiteChoices(_0x1c27b2),_0xac7174=_0x561c84?_0x5b3462(0x224)+_0x561c84+'):':_0x5b3462(0x227),_0x588280=await a7_0xbbc1b4({'type':_0x5b3462(0x209),'name':_0x5b3462(0x212),'message':_0xac7174,'choices':_0x4a5de0,'initial':_0x12ca66});if(!_0x588280[_0x5b3462(0x212)])return console[_0x5b3462(0x223)](_0x5b3462(0x214)),0x1;let _0x1aff19;if(_0x588280[_0x5b3462(0x212)]===_0x5b3462(0x226)){const _0xf2ba8f=await a7_0xbbc1b4({'type':'text','name':_0x5b3462(0x1f9),'message':_0x5b3462(0x1e0),'initial':_0x5b3462(0x205),'validate':_0x26d6b0=>{const _0x35fc5e=_0x5b3462;if(!_0x26d6b0||!_0x26d6b0[_0x35fc5e(0x1e6)]())return _0x35fc5e(0x210);if(!/^[a-z0-9-]+$/[_0x35fc5e(0x1ee)](_0x26d6b0[_0x35fc5e(0x1e6)]()))return _0x35fc5e(0x1f0);return!![];}});if(!_0xf2ba8f[_0x5b3462(0x1f9)])return console[_0x5b3462(0x223)]('\x0aSetup\x20cancelled'),0x1;_0x1aff19=_0xf2ba8f['customSite'];}else _0x1aff19=_0x588280[_0x5b3462(0x212)];const _0x3103a7=resolveSite(_0x1aff19);console[_0x5b3462(0x223)](_0x5b3462(0x213)+_0x3103a7),console[_0x5b3462(0x223)](_0x5b3462(0x1ff)),console[_0x5b3462(0x223)]('\x20\x20'+getConsoleUrl(_0x3103a7,_0x5b3462(0x1f3)));const _0x4c1272=await a7_0xbbc1b4({'type':_0x5b3462(0x215),'name':'apiKey','message':'Enter\x20your\x20TD\x20API\x20key:','validate':_0x31f137=>{const _0x44e5ac=_0x5b3462;if(!_0x31f137||!_0x31f137['trim']())return _0x44e5ac(0x230);return!![];}});if(!_0x4c1272[_0x5b3462(0x21a)])return console['log']('\x0aSetup\x20cancelled'),0x1;const _0x21fd8a=_0x4c1272['apiKey'];console[_0x5b3462(0x223)](_0x5b3462(0x22d));try{const _0x53117c=TDX[_0x5b3462(0x204)]({'site':_0x3103a7,'apiKey':_0x21fd8a[_0x5b3462(0x1e6)](),'logLevel':_0x45aa36[_0x5b3462(0x20e)]??LogLevel[_0x5b3462(0x1f5)]}),_0x1903ff=await _0x53117c[_0x5b3462(0x203)][_0x5b3462(0x1f6)]();console[_0x5b3462(0x223)](_0x5b3462(0x200)+_0x1903ff[_0x5b3462(0x207)]+')');const _0x164679=await isKeychainAvailable();_0x164679?(await saveAPIKeyAsync(_0x21fd8a['trim'](),_0x3103a7,_0x561c84),console[_0x5b3462(0x223)](_0x5b3462(0x1f7)+(_0x561c84?_0x5b3462(0x21c)+_0x561c84+')':''))):(console[_0x5b3462(0x1e3)](a7_0x3c9dec[_0x5b3462(0x20a)](_0x5b3462(0x222))),console[_0x5b3462(0x1e3)](a7_0x3c9dec[_0x5b3462(0x20a)](_0x5b3462(0x208))));if(_0x561c84){const _0x2f5d6c={'site':_0x3103a7};saveProfileToUserConfig(_0x561c84,_0x2f5d6c),console[_0x5b3462(0x223)](_0x5b3462(0x1fa)+_0x561c84+_0x5b3462(0x1f1));}else saveDefaultSiteToUserConfig(_0x3103a7),console['log'](_0x5b3462(0x1f2)+_0x3103a7);const _0x222fe9=_0x561c84?_0x5b3462(0x225)+_0x561c84:'';return console[_0x5b3462(0x223)](),console[_0x5b3462(0x223)](_0x5b3462(0x1e8)),console[_0x5b3462(0x223)](_0x5b3462(0x20b)+_0x222fe9+_0x5b3462(0x219)),console[_0x5b3462(0x223)](_0x5b3462(0x20b)+_0x222fe9+_0x5b3462(0x1e9)),0x0;}catch(_0x298db0){if(_0x298db0 instanceof HTTPClientError&&_0x298db0[_0x5b3462(0x201)]===0x191)return printAuthError(_0x298db0),0x1;return console[_0x5b3462(0x21b)](a7_0x3c9dec[_0x5b3462(0x21f)]('✗\x20Validation\x20failed:\x20'+(_0x298db0 instanceof Error?_0x298db0[_0x5b3462(0x22b)]:String(_0x298db0)))),console['error'](_0x5b3462(0x217)),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x39afe3(0x206)]=a7_0x39afe3(0x20c);[a7_0x39afe3(0x1ea)]=a7_0x39afe3(0x229);async[a7_0x39afe3(0x1f8)](_0x3f7b4d){const _0x41cd43=a7_0x39afe3,{options:_0x1cd093,tdx:_0x19fc83}=_0x3f7b4d,_0x3ea6fe=_0x1cd093[_0x41cd43(0x212)],_0x2112f2=_0x1cd093[_0x41cd43(0x1ef)],_0x231882=_0x2112f2?_0x2112f2:_0x41cd43(0x1df);console[_0x41cd43(0x223)](_0x41cd43(0x1eb)+_0x231882+_0x41cd43(0x1ed)+_0x3ea6fe+')');const _0x27265e=await resolveAPIKeyAsync(_0x3ea6fe,_0x2112f2);if(_0x27265e){const {source:_0x2b4678,isDeprecated:_0x59bc12}=_0x27265e,_0x4fc6f6=_0x41cd43(0x1e7)+_0x2b4678;console['log'](_0x59bc12?a7_0x3c9dec['yellow'](_0x4fc6f6):_0x4fc6f6);}else console[_0x41cd43(0x223)](a7_0x3c9dec[_0x41cd43(0x20a)](_0x41cd43(0x1fb)));try{const _0x582065=await _0x19fc83[_0x41cd43(0x203)][_0x41cd43(0x1f6)]();return console['log'](a7_0x3c9dec[_0x41cd43(0x218)](_0x41cd43(0x22e))),console[_0x41cd43(0x223)]('User:\x20'+_0x582065[_0x41cd43(0x207)]),(_0x582065[_0x41cd43(0x1e4)]||_0x582065[_0x41cd43(0x202)])&&console[_0x41cd43(0x223)](_0x41cd43(0x22a)+[_0x582065['first_name'],_0x582065[_0x41cd43(0x202)]][_0x41cd43(0x22f)](Boolean)[_0x41cd43(0x216)]('\x20')),0x0;}catch(_0x2eb73e){return _0x2eb73e instanceof HTTPClientError&&_0x2eb73e[_0x41cd43(0x201)]===0x191?printAuthError(_0x2eb73e,!![],_0x2112f2):console[_0x41cd43(0x21b)](a7_0x3c9dec[_0x41cd43(0x21f)](_0x41cd43(0x1fd)+(_0x2eb73e instanceof Error?_0x2eb73e[_0x41cd43(0x22b)]:String(_0x2eb73e)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x39afe3(0x206)]=a7_0x39afe3(0x22c);[a7_0x39afe3(0x1ea)]=a7_0x39afe3(0x1e1);async[a7_0x39afe3(0x1f8)](_0x2a73e2){const _0x949b09=a7_0x39afe3,{options:_0x35e7ce}=_0x2a73e2,_0x3e5627=_0x35e7ce[_0x949b09(0x1ef)];console['log'](a7_0x3c9dec['bold']('tdx:\x20auth\x20clear'));const _0x12a59b=await isKeychainAvailable();if(!_0x12a59b)return console[_0x949b09(0x21b)](a7_0x3c9dec[_0x949b09(0x21f)](_0x949b09(0x211))),0x1;const _0x2cac6d=await deleteKeychainAPIKey(_0x3e5627);return _0x2cac6d?(clearCredentialCache(),console[_0x949b09(0x223)]('✓\x20API\x20key\x20removed\x20from\x20keychain'+(_0x3e5627?_0x949b09(0x21c)+_0x3e5627+')':'')),0x0):(console[_0x949b09(0x223)]('No\x20API\x20key\x20found\x20in\x20keychain'+(_0x3e5627?_0x949b09(0x1e2)+_0x3e5627:'')),0x1);}}
@@ -1 +1 @@
1
- function a8_0x4d56(){const _0xd0c25b=['session\x20context','1796uUaPAH','args','metadata','916792UwLJCc','verbose','llm','projectId','\x20\x20Cause:\x20','targetAgent','Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22','Getting\x20default\x20agent...','cause','stringify','description','site','2787955rPuDog','error','handleChatEvent','tool_result','\x27\x20not\x20found','options','Resolving\x20project\x20\x27','404','tool_call','Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together','Error:\x20','Error:\x20Chat\x20session\x20\x27','chat','event','context','6096231abGulR','getOrCreateDefaultAgent','startChat','Continuing\x20chat:\x20','8522502uVZQeB','6236ZVgrAh','agent','targetKnowledgeBase','targetWebSearchTool','llmAgent','20rLsYks','stream','511TPDyoW','slice','join','Chat\x20session:\x20','stack','Resolving\x20agent\x20\x27','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','stdout','10618580PgzxVb','code','message','3336UtULGn','content','log','tool','name','chatId','llmProject','functionName','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','claude-4.5-haiku','string','type','resolveAgentId','\x0aError:\x20','getDefaultAgent','new','includes','chat-create','\x27...','agentId','CHAT_NOT_FOUND','streamChat','data','No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22','resolveProjectId','\x0aStack\x20trace:'];a8_0x4d56=function(){return _0xd0c25b;};return a8_0x4d56();}const a8_0x4d893e=a8_0x187f;(function(_0xb0261,_0xc5d543){const _0xe38adc=a8_0x187f,_0x519e72=_0xb0261();while(!![]){try{const _0x56233a=parseInt(_0xe38adc(0xd9))/0x1*(-parseInt(_0xe38adc(0xd2))/0x2)+-parseInt(_0xe38adc(0x94))/0x3*(-parseInt(_0xe38adc(0xaf))/0x4)+parseInt(_0xe38adc(0xbe))/0x5+-parseInt(_0xe38adc(0xd1))/0x6+parseInt(_0xe38adc(0x91))/0x7+-parseInt(_0xe38adc(0xb2))/0x8+-parseInt(_0xe38adc(0xcd))/0x9*(-parseInt(_0xe38adc(0xd7))/0xa);if(_0x56233a===_0xc5d543)break;else _0x519e72['push'](_0x519e72['shift']());}catch(_0x37e8c5){_0x519e72['push'](_0x519e72['shift']());}}}(a8_0x4d56,0xc35df));function a8_0x187f(_0x3863d0,_0x4bbd51){_0x3863d0=_0x3863d0-0x8c;const _0x4d5657=a8_0x4d56();let _0x187fe9=_0x4d5657[_0x3863d0];return _0x187fe9;}import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{withSpinner}from'../utils/spinner.js';import{parseAgentRef}from'../sdk/agent/agent-ref-parser.js';import{saveLastChatId,loadLastChatId}from'../sdk/llm/chat-cache.js';import{getLLMConversationUrl}from'../sdk/client/endpoints.js';function handleSDKError(_0x58e23e,_0x22d427){const _0x8fd1a1=a8_0x187f;if(_0x58e23e instanceof SDKError)console[_0x8fd1a1(0xbf)](_0x8fd1a1(0xc8)+_0x58e23e[_0x8fd1a1(0x93)]),_0x22d427[_0x8fd1a1(0xb3)]&&(_0x58e23e['cause']&&console[_0x8fd1a1(0xbf)](_0x8fd1a1(0xb6)+_0x58e23e[_0x8fd1a1(0xba)]),_0x58e23e[_0x8fd1a1(0x8d)]&&(console[_0x8fd1a1(0xbf)](_0x8fd1a1(0xad)),console[_0x8fd1a1(0xbf)](_0x58e23e[_0x8fd1a1(0x8d)])));else throw _0x58e23e;}async function resolveAgentId(_0x50a952,_0x43ffd2,_0x4cdaf7,_0x3977f4,_0x5bc794){const _0x5b2dcf=a8_0x187f,_0x49a881=_0x43ffd2||_0x4cdaf7;if(_0x49a881){const {projectName:_0x34855a,agentName:_0x98a7}=parseAgentRef(_0x49a881),_0x51bd9a=_0x98a7||_0x49a881,_0x280fc3=_0x98a7?_0x34855a:_0x3977f4;if(!_0x280fc3)throw new Error(_0x5b2dcf(0xab));if(_0x5bc794){const _0x2f6e1c=_0x43ffd2?'--agent\x20flag':_0x5b2dcf(0xae);console['error']('Using\x20agent\x20from\x20'+_0x2f6e1c+':\x20'+_0x280fc3+'/'+_0x51bd9a);}const _0x53090e=await withSpinner(_0x5b2dcf(0xc4)+_0x280fc3+_0x5b2dcf(0xa6),()=>_0x50a952[_0x5b2dcf(0xb4)][_0x5b2dcf(0xac)](_0x280fc3),{'verbose':_0x5bc794}),_0x1a2741=await withSpinner(_0x5b2dcf(0x8e)+_0x51bd9a+'\x27...',()=>_0x50a952[_0x5b2dcf(0xb4)][_0x5b2dcf(0xa0)](_0x51bd9a,_0x53090e['data']),{'verbose':_0x5bc794});return _0x1a2741[_0x5b2dcf(0xaa)];}else{const _0xb7e128=_0x50a952['llm'][_0x5b2dcf(0xa2)]();if(_0xb7e128)return _0x5bc794&&console['error']('Using\x20cached\x20default\x20agent:\x20'+_0xb7e128[_0x5b2dcf(0x98)]),_0xb7e128['id'];const _0xa292b1=await withSpinner(_0x5b2dcf(0xb9),()=>_0x50a952[_0x5b2dcf(0xb4)][_0x5b2dcf(0xce)](_0x5b2dcf(0x9d),0x0),{'verbose':_0x5bc794});return _0xa292b1[_0x5b2dcf(0xaa)]['id'];}}export class ChatCommand extends BaseCommand{[a8_0x4d893e(0x98)]=a8_0x4d893e(0xca);[a8_0x4d893e(0xbc)]=a8_0x4d893e(0x9c);['validate'](_0x2d0624){const _0x4d7a49=a8_0x4d893e,_0x18075a=_0x2d0624[_0x4d7a49(0xb0)][_0x4d7a49(0xdb)]('\x20');if(!_0x18075a)return'Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options';return undefined;}async['streamChat'](_0x4d55e3,_0x3bfd12,_0x43618b,_0x18d0d8,_0x1045a8){const _0x2f09f8=a8_0x4d893e;for await(const _0x1af17b of _0x4d55e3[_0x2f09f8(0xb4)]['chat'](_0x3bfd12,{'agentId':_0x43618b,'chatId':_0x18d0d8})){if(_0x1af17b[_0x2f09f8(0x9f)]===_0x2f09f8(0xb1)){const _0x2e0bdf=_0x1af17b[_0x2f09f8(0xaa)][_0x2f09f8(0x99)];saveLastChatId(_0x2e0bdf),_0x1045a8&&console[_0x2f09f8(0xbf)](_0x2f09f8(0x8c)+_0x2e0bdf);}else _0x1af17b[_0x2f09f8(0x9f)]===_0x2f09f8(0xcb)&&this['handleChatEvent'](_0x1af17b[_0x2f09f8(0xaa)]);}}async['streamChatJsonl'](_0x244ab2,_0x147baf,_0x14fc87,_0xf8a36d){const _0xb5b196=a8_0x4d893e,_0x1807a6=_0x244ab2[_0xb5b196(0xcc)][_0xb5b196(0xbd)];let _0x4d48a1=![];for await(const _0x4067d5 of _0x244ab2[_0xb5b196(0xb4)][_0xb5b196(0xca)](_0x147baf,{'agentId':_0x14fc87,'chatId':_0xf8a36d})){if(_0x4067d5[_0xb5b196(0x9f)]===_0xb5b196(0xb1)){const _0x29bec7=_0x4067d5[_0xb5b196(0xaa)];saveLastChatId(_0x29bec7[_0xb5b196(0x99)]);const _0x3f45b8=_0x29bec7[_0xb5b196(0xb5)]&&_0x29bec7[_0xb5b196(0xa7)]?getLLMConversationUrl(_0x1807a6,_0x29bec7['projectId'],_0x29bec7[_0xb5b196(0xa7)],_0x29bec7[_0xb5b196(0x99)]):undefined;console[_0xb5b196(0x96)](JSON[_0xb5b196(0xbb)]({'type':_0xb5b196(0xb1),'data':{'chatId':_0x29bec7['chatId'],'agentId':_0x29bec7[_0xb5b196(0xa7)],'consoleUrl':_0x3f45b8}})),_0x4d48a1=!![];}else{if(_0x4067d5['type']===_0xb5b196(0xcb)){!_0x4d48a1&&_0xf8a36d&&(console[_0xb5b196(0x96)](JSON['stringify']({'type':_0xb5b196(0xb1),'data':{'chatId':_0xf8a36d}})),_0x4d48a1=!![]);const _0xb35869=_0x4067d5['data'];if('content'in _0xb35869)console[_0xb5b196(0x96)](JSON[_0xb5b196(0xbb)]({'type':_0xb5b196(0x95),'data':{'content':_0xb35869[_0xb5b196(0x95)]}}));else{if(_0xb5b196(0xc6)in _0xb35869){const _0x5d878d=_0xb35869['tool_call'];console['log'](JSON[_0xb5b196(0xbb)]({'type':_0xb5b196(0xc6),'data':{'id':_0x5d878d['id'],'name':_0x5d878d[_0xb5b196(0x9b)],'target':_0x5d878d[_0xb5b196(0xd4)]?.['name']||_0x5d878d[_0xb5b196(0xb7)]?.[_0xb5b196(0x98)]||_0x5d878d[_0xb5b196(0xd5)]?.[_0xb5b196(0x98)]||_0x5d878d['targetFunction']}}));}else{if(_0xb5b196(0x97)in _0xb35869)console['log'](JSON[_0xb5b196(0xbb)]({'type':_0xb5b196(0xc1),'data':{'id':_0xb35869[_0xb5b196(0x97)]['id'],'name':_0xb35869[_0xb5b196(0x97)]['functionName'],'result':typeof _0xb35869[_0xb5b196(0x97)][_0xb5b196(0x95)]===_0xb5b196(0x9e)?_0xb35869[_0xb5b196(0x97)][_0xb5b196(0x95)][_0xb5b196(0xda)](0x0,0x1f4):''}}));else'error'in _0xb35869&&console[_0xb5b196(0x96)](JSON[_0xb5b196(0xbb)]({'type':_0xb5b196(0xbf),'data':{'error':_0xb35869[_0xb5b196(0xbf)]}}));}}}}}console[_0xb5b196(0x96)](JSON[_0xb5b196(0xbb)]({'type':'done'}));}async['execute'](_0x366d73){const _0x5552e7=a8_0x4d893e,{options:_0x2b7114,args:_0x1656f2,tdx:_0x5cd40f}=_0x366d73,_0x1f7a07=_0x1656f2[_0x5552e7(0xdb)]('\x20'),_0x5524f6=_0x2b7114,_0x2f21f1=_0x5524f6[_0x5552e7(0xd3)],_0x17088f=_0x5524f6[_0x5552e7(0xd6)],_0xc31988=_0x5524f6['llmProject'],_0x4cd2f7=_0x5524f6[_0x5552e7(0xa3)],_0xc64141=_0x5524f6[_0x5552e7(0x99)],_0x98f28e=_0x5524f6[_0x5552e7(0xd8)];if(_0x4cd2f7&&_0xc64141)return console['error'](_0x5552e7(0xc7)),0x1;try{let _0x4c8683,_0xf002e4;if(_0xc64141)_0xf002e4=_0xc64141;else!_0x4cd2f7&&(_0xf002e4=loadLastChatId(),_0xf002e4&&_0x2b7114[_0x5552e7(0xb3)]&&console[_0x5552e7(0xbf)](_0x5552e7(0xd0)+_0xf002e4));!_0xc64141&&(_0x4cd2f7||!_0xf002e4)&&(_0x4c8683=await resolveAgentId(_0x5cd40f,_0x2f21f1,_0x17088f,_0xc31988,_0x2b7114[_0x5552e7(0xb3)]));const _0x299c84=_0x98f28e?(_0x24e2a1,_0x191478,_0x2e2c84)=>this['streamChatJsonl'](_0x5cd40f,_0x24e2a1,_0x191478,_0x2e2c84):(_0x36c96a,_0x2c00e0,_0x2175fd)=>this[_0x5552e7(0xa9)](_0x5cd40f,_0x36c96a,_0x2c00e0,_0x2175fd,_0x2b7114[_0x5552e7(0xb3)]);try{await _0x299c84(_0x1f7a07,_0x4c8683,_0xf002e4);}catch(_0x19e993){const _0x3ffb75=_0x19e993 instanceof SDKError&&_0x19e993[_0x5552e7(0x92)]===ErrorCode[_0x5552e7(0xa8)]||_0x19e993 instanceof Error&&_0x19e993[_0x5552e7(0x93)][_0x5552e7(0xa4)](_0x5552e7(0xc5));if(_0x3ffb75&&_0xc64141)return console['error'](_0x5552e7(0xc9)+_0xc64141+_0x5552e7(0xc2)),0x1;if(_0x3ffb75)_0x2b7114[_0x5552e7(0xb3)]&&console[_0x5552e7(0xbf)](_0x5552e7(0x8f)),!_0x4c8683&&(_0x4c8683=await resolveAgentId(_0x5cd40f,_0x2f21f1,_0x17088f,_0xc31988,_0x2b7114[_0x5552e7(0xb3)])),await _0x299c84(_0x1f7a07,_0x4c8683,undefined);else throw _0x19e993;}return!_0x98f28e&&console[_0x5552e7(0x96)](),0x0;}catch(_0x211602){return console['error'](),handleSDKError(_0x211602,_0x2b7114),0x1;}}[a8_0x4d893e(0xc0)](_0x57104e){const _0x4a13b4=a8_0x4d893e;if(_0x4a13b4(0x95)in _0x57104e)process[_0x4a13b4(0x90)]['write'](_0x57104e[_0x4a13b4(0x95)]);else _0x4a13b4(0xbf)in _0x57104e&&console['error'](_0x4a13b4(0xa1)+_0x57104e[_0x4a13b4(0xbf)]);}}export class ChatCreateCommand extends BaseCommand{[a8_0x4d893e(0x98)]=a8_0x4d893e(0xa5);['description']='Create\x20a\x20new\x20chat\x20session';['validate'](_0x32f423){const _0x54f72e=a8_0x4d893e,_0x613107=_0x32f423[_0x54f72e(0xc3)],_0x1decd9=_0x613107[_0x54f72e(0xd3)],_0x2f0f45=_0x613107[_0x54f72e(0xd6)];if(!_0x1decd9&&!_0x2f0f45)return _0x54f72e(0xb8);return undefined;}async['execute'](_0x57ce8b){const _0xfd4869=a8_0x4d893e,{options:_0x342ceb,tdx:_0x16acf1}=_0x57ce8b,_0x1e60c4=_0x342ceb,_0x36a91c=_0x1e60c4[_0xfd4869(0xd3)],_0x569627=_0x1e60c4[_0xfd4869(0xd6)],_0x57c0f5=_0x1e60c4[_0xfd4869(0x9a)];try{const _0x305236=await resolveAgentId(_0x16acf1,_0x36a91c,_0x569627,_0x57c0f5,_0x342ceb[_0xfd4869(0xb3)]),_0x131064=await _0x16acf1[_0xfd4869(0xb4)][_0xfd4869(0xcf)](_0x305236);return saveLastChatId(_0x131064['id']),console[_0xfd4869(0x96)](JSON['stringify']({'chatId':_0x131064['id'],'agentId':_0x305236})),0x0;}catch(_0x4d1e24){return handleSDKError(_0x4d1e24,_0x342ceb),0x1;}}}
1
+ const a8_0x25ad96=a8_0x2df6;(function(_0x3c0b43,_0x1971ec){const _0xdf85d8=a8_0x2df6,_0x63e782=_0x3c0b43();while(!![]){try{const _0x152bd9=-parseInt(_0xdf85d8(0xd8))/0x1+-parseInt(_0xdf85d8(0xe8))/0x2*(-parseInt(_0xdf85d8(0xcb))/0x3)+-parseInt(_0xdf85d8(0xd0))/0x4+-parseInt(_0xdf85d8(0x10a))/0x5+parseInt(_0xdf85d8(0xce))/0x6+-parseInt(_0xdf85d8(0xf7))/0x7*(-parseInt(_0xdf85d8(0xde))/0x8)+parseInt(_0xdf85d8(0x108))/0x9*(parseInt(_0xdf85d8(0xf8))/0xa);if(_0x152bd9===_0x1971ec)break;else _0x63e782['push'](_0x63e782['shift']());}catch(_0x57da51){_0x63e782['push'](_0x63e782['shift']());}}}(a8_0x3c73,0x42330));import{BaseCommand}from'./command.js';function a8_0x3c73(){const _0x40b85e=['\x20\x20Cause:\x20','llmProject','7nkYWoX','10RORRRX','targetAgent','slice','Resolving\x20project\x20\x27','\x0aError:\x20','getOrCreateDefaultAgent','llmAgent','Create\x20a\x20new\x20chat\x20session','error','type','--agent\x20flag','message','event','site','targetWebSearchTool','streamChatJsonl','3866661Rlbzcg','cause','2204335UEnEGi','llm','Using\x20agent\x20from\x20','stringify','metadata','Continuing\x20chat:\x20','stdout','content','functionName','tool_call','Error:\x20Chat\x20session\x20\x27','resolveProjectId','12knUyLj','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','join','1708140DeLBaR','resolveAgentId','1828532qFtNSF','args','options','targetFunction','new','log','execute','handleChatEvent','398839WzktqW','Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together','name','context','chat','getDefaultAgent','4103552GWbRGN','tool_result','validate','code','data','CHAT_NOT_FOUND','description','verbose','chatId','Getting\x20default\x20agent...','170364Zxznyc','agentId','Error:\x20','write','Using\x20cached\x20default\x20agent:\x20','Resolving\x20agent\x20\x27','done','agent','streamChat','projectId','\x27...','tool','stack'];a8_0x3c73=function(){return _0x40b85e;};return a8_0x3c73();}import{SDKError,ErrorCode}from'../sdk/errors.js';function a8_0x2df6(_0x35a4e7,_0x2ba599){_0x35a4e7=_0x35a4e7-0xca;const _0x3c731a=a8_0x3c73();let _0x2df6a7=_0x3c731a[_0x35a4e7];return _0x2df6a7;}import{withSpinner}from'../utils/spinner.js';import{parseAgentRef}from'../sdk/agent/agent-ref-parser.js';import{saveLastChatId,loadLastChatId}from'../sdk/llm/chat-cache.js';import{getLLMConversationUrl}from'../sdk/client/endpoints.js';function handleSDKError(_0x1b4e8c,_0x32be55){const _0x4059c8=a8_0x2df6;if(_0x1b4e8c instanceof SDKError)console[_0x4059c8(0x100)](_0x4059c8(0xea)+_0x1b4e8c[_0x4059c8(0x103)]),_0x32be55[_0x4059c8(0xe5)]&&(_0x1b4e8c[_0x4059c8(0x109)]&&console[_0x4059c8(0x100)](_0x4059c8(0xf5)+_0x1b4e8c[_0x4059c8(0x109)]),_0x1b4e8c[_0x4059c8(0xf4)]&&(console[_0x4059c8(0x100)]('\x0aStack\x20trace:'),console[_0x4059c8(0x100)](_0x1b4e8c['stack'])));else throw _0x1b4e8c;}async function resolveAgentId(_0x254400,_0x5eea76,_0x189012,_0x5bb096,_0x12872a){const _0x2e5d31=a8_0x2df6,_0x27d59c=_0x5eea76||_0x189012;if(_0x27d59c){const {projectName:_0x483097,agentName:_0x3e74e7}=parseAgentRef(_0x27d59c),_0x39dfb2=_0x3e74e7||_0x27d59c,_0x3ae9fe=_0x3e74e7?_0x483097:_0x5bb096;if(!_0x3ae9fe)throw new Error('No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22');if(_0x12872a){const _0x4fe4b2=_0x5eea76?_0x2e5d31(0x102):'session\x20context';console[_0x2e5d31(0x100)](_0x2e5d31(0x10c)+_0x4fe4b2+':\x20'+_0x3ae9fe+'/'+_0x39dfb2);}const _0x42cf92=await withSpinner(_0x2e5d31(0xfb)+_0x3ae9fe+_0x2e5d31(0xf2),()=>_0x254400['llm'][_0x2e5d31(0xca)](_0x3ae9fe),{'verbose':_0x12872a}),_0x54c417=await withSpinner(_0x2e5d31(0xed)+_0x39dfb2+_0x2e5d31(0xf2),()=>_0x254400[_0x2e5d31(0x10b)][_0x2e5d31(0xcf)](_0x39dfb2,_0x42cf92[_0x2e5d31(0xe2)]),{'verbose':_0x12872a});return _0x54c417[_0x2e5d31(0xe2)];}else{const _0x236696=_0x254400[_0x2e5d31(0x10b)][_0x2e5d31(0xdd)]();if(_0x236696)return _0x12872a&&console[_0x2e5d31(0x100)](_0x2e5d31(0xec)+_0x236696[_0x2e5d31(0xda)]),_0x236696['id'];const _0x47e453=await withSpinner(_0x2e5d31(0xe7),()=>_0x254400[_0x2e5d31(0x10b)][_0x2e5d31(0xfd)]('claude-4.5-haiku',0x0),{'verbose':_0x12872a});return _0x47e453[_0x2e5d31(0xe2)]['id'];}}export class ChatCommand extends BaseCommand{['name']='chat';[a8_0x25ad96(0xe4)]='Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)';[a8_0x25ad96(0xe0)](_0x417918){const _0x165b94=a8_0x25ad96,_0x3297f1=_0x417918[_0x165b94(0xd1)][_0x165b94(0xcd)]('\x20');if(!_0x3297f1)return'Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options';return undefined;}async[a8_0x25ad96(0xf0)](_0x2b13d4,_0x54cca3,_0x32c44d,_0x367c99,_0x57a5c6){const _0x1993b7=a8_0x25ad96;for await(const _0x206e99 of _0x2b13d4[_0x1993b7(0x10b)][_0x1993b7(0xdc)](_0x54cca3,{'agentId':_0x32c44d,'chatId':_0x367c99})){if(_0x206e99[_0x1993b7(0x101)]===_0x1993b7(0x10e)){const _0x112641=_0x206e99[_0x1993b7(0xe2)][_0x1993b7(0xe6)];saveLastChatId(_0x112641),_0x57a5c6&&console[_0x1993b7(0x100)]('Chat\x20session:\x20'+_0x112641);}else _0x206e99[_0x1993b7(0x101)]===_0x1993b7(0x104)&&this[_0x1993b7(0xd7)](_0x206e99['data']);}}async[a8_0x25ad96(0x107)](_0x553ac8,_0xc96690,_0x557f3a,_0x3ca654){const _0xb211f8=a8_0x25ad96,_0x3b8b54=_0x553ac8[_0xb211f8(0xdb)][_0xb211f8(0x105)];let _0x1419d8=![];for await(const _0x4e37a8 of _0x553ac8[_0xb211f8(0x10b)][_0xb211f8(0xdc)](_0xc96690,{'agentId':_0x557f3a,'chatId':_0x3ca654})){if(_0x4e37a8[_0xb211f8(0x101)]===_0xb211f8(0x10e)){const _0x2d5a72=_0x4e37a8[_0xb211f8(0xe2)];saveLastChatId(_0x2d5a72[_0xb211f8(0xe6)]);const _0xa31d4a=_0x2d5a72[_0xb211f8(0xf1)]&&_0x2d5a72[_0xb211f8(0xe9)]?getLLMConversationUrl(_0x3b8b54,_0x2d5a72[_0xb211f8(0xf1)],_0x2d5a72['agentId'],_0x2d5a72['chatId']):undefined;console['log'](JSON['stringify']({'type':_0xb211f8(0x10e),'data':{'chatId':_0x2d5a72[_0xb211f8(0xe6)],'agentId':_0x2d5a72['agentId'],'consoleUrl':_0xa31d4a}})),_0x1419d8=!![];}else{if(_0x4e37a8['type']===_0xb211f8(0x104)){!_0x1419d8&&_0x3ca654&&(console[_0xb211f8(0xd5)](JSON[_0xb211f8(0x10d)]({'type':_0xb211f8(0x10e),'data':{'chatId':_0x3ca654}})),_0x1419d8=!![]);const _0x6266a0=_0x4e37a8[_0xb211f8(0xe2)];if('content'in _0x6266a0)console[_0xb211f8(0xd5)](JSON[_0xb211f8(0x10d)]({'type':_0xb211f8(0x111),'data':{'content':_0x6266a0[_0xb211f8(0x111)]}}));else{if(_0xb211f8(0x113)in _0x6266a0){const _0xea9fbc=_0x6266a0[_0xb211f8(0x113)];console['log'](JSON['stringify']({'type':_0xb211f8(0x113),'data':{'id':_0xea9fbc['id'],'name':_0xea9fbc[_0xb211f8(0x112)],'target':_0xea9fbc['targetKnowledgeBase']?.['name']||_0xea9fbc[_0xb211f8(0xf9)]?.[_0xb211f8(0xda)]||_0xea9fbc[_0xb211f8(0x106)]?.[_0xb211f8(0xda)]||_0xea9fbc[_0xb211f8(0xd3)]}}));}else{if(_0xb211f8(0xf3)in _0x6266a0)console['log'](JSON[_0xb211f8(0x10d)]({'type':_0xb211f8(0xdf),'data':{'id':_0x6266a0[_0xb211f8(0xf3)]['id'],'name':_0x6266a0[_0xb211f8(0xf3)]['functionName'],'result':typeof _0x6266a0[_0xb211f8(0xf3)]['content']==='string'?_0x6266a0['tool'][_0xb211f8(0x111)][_0xb211f8(0xfa)](0x0,0x1f4):''}}));else _0xb211f8(0x100)in _0x6266a0&&console['log'](JSON[_0xb211f8(0x10d)]({'type':_0xb211f8(0x100),'data':{'error':_0x6266a0[_0xb211f8(0x100)]}}));}}}}}console[_0xb211f8(0xd5)](JSON[_0xb211f8(0x10d)]({'type':_0xb211f8(0xee)}));}async[a8_0x25ad96(0xd6)](_0x5c2c17){const _0x455b25=a8_0x25ad96,{options:_0x2cc304,args:_0x46c1f4,tdx:_0x287775}=_0x5c2c17,_0x40a3d2=_0x46c1f4[_0x455b25(0xcd)]('\x20'),_0x116d3f=_0x2cc304,_0x3ed8d0=_0x116d3f[_0x455b25(0xef)],_0x1645cd=_0x116d3f[_0x455b25(0xfe)],_0x466337=_0x116d3f[_0x455b25(0xf6)],_0x1ff2c4=_0x116d3f[_0x455b25(0xd4)],_0x29cf8f=_0x116d3f[_0x455b25(0xe6)],_0x6c8dd=_0x116d3f['stream'];if(_0x1ff2c4&&_0x29cf8f)return console[_0x455b25(0x100)](_0x455b25(0xd9)),0x1;try{let _0x329de7,_0x2e731b;if(_0x29cf8f)_0x2e731b=_0x29cf8f;else!_0x1ff2c4&&(_0x2e731b=loadLastChatId(),_0x2e731b&&_0x2cc304['verbose']&&console[_0x455b25(0x100)](_0x455b25(0x10f)+_0x2e731b));!_0x29cf8f&&(_0x1ff2c4||!_0x2e731b)&&(_0x329de7=await resolveAgentId(_0x287775,_0x3ed8d0,_0x1645cd,_0x466337,_0x2cc304[_0x455b25(0xe5)]));const _0x5f2f32=_0x6c8dd?(_0x2c5261,_0x2806b2,_0x31f8d8)=>this[_0x455b25(0x107)](_0x287775,_0x2c5261,_0x2806b2,_0x31f8d8):(_0x2ef476,_0x2fa046,_0x489603)=>this[_0x455b25(0xf0)](_0x287775,_0x2ef476,_0x2fa046,_0x489603,_0x2cc304[_0x455b25(0xe5)]);try{await _0x5f2f32(_0x40a3d2,_0x329de7,_0x2e731b);}catch(_0x53db25){const _0x2829db=_0x53db25 instanceof SDKError&&_0x53db25[_0x455b25(0xe1)]===ErrorCode[_0x455b25(0xe3)]||_0x53db25 instanceof Error&&_0x53db25[_0x455b25(0x103)]['includes']('404');if(_0x2829db&&_0x29cf8f)return console[_0x455b25(0x100)](_0x455b25(0x114)+_0x29cf8f+'\x27\x20not\x20found'),0x1;if(_0x2829db)_0x2cc304[_0x455b25(0xe5)]&&console['error'](_0x455b25(0xcc)),!_0x329de7&&(_0x329de7=await resolveAgentId(_0x287775,_0x3ed8d0,_0x1645cd,_0x466337,_0x2cc304['verbose'])),await _0x5f2f32(_0x40a3d2,_0x329de7,undefined);else throw _0x53db25;}return!_0x6c8dd&&console[_0x455b25(0xd5)](),0x0;}catch(_0x987f4e){return console['error'](),handleSDKError(_0x987f4e,_0x2cc304),0x1;}}[a8_0x25ad96(0xd7)](_0x432295){const _0xd6acf8=a8_0x25ad96;if(_0xd6acf8(0x111)in _0x432295)process[_0xd6acf8(0x110)][_0xd6acf8(0xeb)](_0x432295[_0xd6acf8(0x111)]);else _0xd6acf8(0x100)in _0x432295&&console[_0xd6acf8(0x100)](_0xd6acf8(0xfc)+_0x432295[_0xd6acf8(0x100)]);}}export class ChatCreateCommand extends BaseCommand{[a8_0x25ad96(0xda)]='chat-create';['description']=a8_0x25ad96(0xff);['validate'](_0x4e41b6){const _0x2b9786=a8_0x25ad96,_0x43928a=_0x4e41b6[_0x2b9786(0xd2)],_0x50a199=_0x43928a[_0x2b9786(0xef)],_0x1a375d=_0x43928a[_0x2b9786(0xfe)];if(!_0x50a199&&!_0x1a375d)return'Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22';return undefined;}async[a8_0x25ad96(0xd6)](_0x4ee188){const _0x12d17c=a8_0x25ad96,{options:_0x239338,tdx:_0x3e6c95}=_0x4ee188,_0x216056=_0x239338,_0x2cac3a=_0x216056[_0x12d17c(0xef)],_0x424c81=_0x216056['llmAgent'],_0x37870f=_0x216056['llmProject'];try{const _0x3465e9=await resolveAgentId(_0x3e6c95,_0x2cac3a,_0x424c81,_0x37870f,_0x239338['verbose']),_0x28b6cc=await _0x3e6c95['llm']['startChat'](_0x3465e9);return saveLastChatId(_0x28b6cc['id']),console['log'](JSON[_0x12d17c(0x10d)]({'chatId':_0x28b6cc['id'],'agentId':_0x3465e9})),0x0;}catch(_0x5b7778){return handleSDKError(_0x5b7778,_0x239338),0x1;}}}