@treasuredata/tdx 0.29.4 → 2026.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (292) 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 +1 -0
  5. package/dist/cli.d.ts.map +1 -1
  6. package/dist/cli.js +1 -1
  7. package/dist/cli.js.map +1 -1
  8. package/dist/commands/activations.js +1 -1
  9. package/dist/commands/agent-command.js +1 -1
  10. package/dist/commands/agent-test-command.js +1 -1
  11. package/dist/commands/api-command.js +1 -1
  12. package/dist/commands/auth-command.js +1 -1
  13. package/dist/commands/chat-command.js +1 -1
  14. package/dist/commands/claude-command.js +1 -1
  15. package/dist/commands/claude-statusline-command.js +1 -1
  16. package/dist/commands/claude-usage-command.js +1 -1
  17. package/dist/commands/command.js +1 -1
  18. package/dist/commands/connection-command.js +1 -1
  19. package/dist/commands/databases.d.ts.map +1 -1
  20. package/dist/commands/databases.js +1 -1
  21. package/dist/commands/databases.js.map +1 -1
  22. package/dist/commands/delivery-command.js +1 -1
  23. package/dist/commands/describe.js +1 -1
  24. package/dist/commands/engage-campaign-pull-command.js +1 -1
  25. package/dist/commands/engage-campaign-push-command.js +1 -1
  26. package/dist/commands/engage-campaign-validate-command.js +1 -1
  27. package/dist/commands/engage-command.d.ts +97 -1
  28. package/dist/commands/engage-command.d.ts.map +1 -1
  29. package/dist/commands/engage-command.js +1 -1
  30. package/dist/commands/engage-command.js.map +1 -1
  31. package/dist/commands/engage-template-pull-command.d.ts +15 -0
  32. package/dist/commands/engage-template-pull-command.d.ts.map +1 -0
  33. package/dist/commands/engage-template-pull-command.js +1 -0
  34. package/dist/commands/engage-template-pull-command.js.map +1 -0
  35. package/dist/commands/engage-template-push-command.d.ts +16 -0
  36. package/dist/commands/engage-template-push-command.d.ts.map +1 -0
  37. package/dist/commands/engage-template-push-command.js +1 -0
  38. package/dist/commands/engage-template-push-command.js.map +1 -0
  39. package/dist/commands/engage-template-validate-command.d.ts +19 -0
  40. package/dist/commands/engage-template-validate-command.d.ts.map +1 -0
  41. package/dist/commands/engage-template-validate-command.js +1 -0
  42. package/dist/commands/engage-template-validate-command.js.map +1 -0
  43. package/dist/commands/job-command.d.ts.map +1 -1
  44. package/dist/commands/job-command.js +1 -1
  45. package/dist/commands/job-command.js.map +1 -1
  46. package/dist/commands/journey-command.js +1 -1
  47. package/dist/commands/journey-validate-command.js +1 -1
  48. package/dist/commands/llm-command.js +1 -1
  49. package/dist/commands/mcp-command.js +1 -1
  50. package/dist/commands/parent-segment-command.js +1 -1
  51. package/dist/commands/profile-command.js +1 -1
  52. package/dist/commands/profiles-command.js +1 -1
  53. package/dist/commands/query-command.d.ts.map +1 -1
  54. package/dist/commands/query-command.js +1 -1
  55. package/dist/commands/query-command.js.map +1 -1
  56. package/dist/commands/schedule-command.js +1 -1
  57. package/dist/commands/segment-command.js +1 -1
  58. package/dist/commands/segment-create-command.js +1 -1
  59. package/dist/commands/segment-fields-command.js +1 -1
  60. package/dist/commands/segment-pull-command.js +1 -1
  61. package/dist/commands/segment-push-command.js +1 -1
  62. package/dist/commands/segment-update-command.js +1 -1
  63. package/dist/commands/segment-use-command.js +1 -1
  64. package/dist/commands/segment-validate-command.js +1 -1
  65. package/dist/commands/segments.js +1 -1
  66. package/dist/commands/show.js +1 -1
  67. package/dist/commands/status-command.js +1 -1
  68. package/dist/commands/tables.d.ts.map +1 -1
  69. package/dist/commands/tables.js +1 -1
  70. package/dist/commands/tables.js.map +1 -1
  71. package/dist/commands/unset-command.js +1 -1
  72. package/dist/commands/upgrade-command.js +1 -1
  73. package/dist/commands/use-command.js +1 -1
  74. package/dist/commands/user-command.js +1 -1
  75. package/dist/commands/workflow-command.js +1 -1
  76. package/dist/core/auth.d.ts +8 -5
  77. package/dist/core/auth.d.ts.map +1 -1
  78. package/dist/core/auth.js +1 -1
  79. package/dist/core/auth.js.map +1 -1
  80. package/dist/core/command-output.d.ts +6 -0
  81. package/dist/core/command-output.d.ts.map +1 -1
  82. package/dist/core/command-output.js +1 -1
  83. package/dist/core/command-output.js.map +1 -1
  84. package/dist/core/config.d.ts +38 -6
  85. package/dist/core/config.d.ts.map +1 -1
  86. package/dist/core/config.js +1 -1
  87. package/dist/core/config.js.map +1 -1
  88. package/dist/core/connection-cache.js +1 -1
  89. package/dist/core/constants.js +1 -1
  90. package/dist/core/credential-cache.js +1 -1
  91. package/dist/core/global-context.d.ts +1 -0
  92. package/dist/core/global-context.d.ts.map +1 -1
  93. package/dist/core/global-context.js +1 -1
  94. package/dist/core/global-context.js.map +1 -1
  95. package/dist/core/keychain.js +1 -1
  96. package/dist/core/profile.js +1 -1
  97. package/dist/core/project-config.js +1 -1
  98. package/dist/core/session.js +1 -1
  99. package/dist/core/user-cache.js +1 -1
  100. package/dist/core/version.d.ts +3 -3
  101. package/dist/core/version.js +1 -1
  102. package/dist/index.js +1 -1
  103. package/dist/mcp/server.js +1 -1
  104. package/dist/mcp/tools/index.js +1 -1
  105. package/dist/mcp/tools/tdx-run.js +1 -1
  106. package/dist/mcp/tools/tdx-search.js +1 -1
  107. package/dist/mcp/utils.js +1 -1
  108. package/dist/proxy/claude-usage-tracker.js +1 -1
  109. package/dist/proxy/passthrough-server.js +1 -1
  110. package/dist/proxy/sse-usage-parser.js +1 -1
  111. package/dist/sdk/agent/agent-config.js +1 -1
  112. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  113. package/dist/sdk/agent/agent-yaml.js +1 -1
  114. package/dist/sdk/agent/test/evaluator.js +1 -1
  115. package/dist/sdk/agent/test/executor.js +1 -1
  116. package/dist/sdk/agent/test/index.js +1 -1
  117. package/dist/sdk/agent/test/output.js +1 -1
  118. package/dist/sdk/agent/test/parser.js +1 -1
  119. package/dist/sdk/agent/tool-target-registry.js +1 -1
  120. package/dist/sdk/api.js +1 -1
  121. package/dist/sdk/api.js.map +1 -1
  122. package/dist/sdk/client/cdp-api-client.js +1 -1
  123. package/dist/sdk/client/cdp-api-client.js.map +1 -1
  124. package/dist/sdk/client/delivery-api-client.js +1 -1
  125. package/dist/sdk/client/delivery-api-client.js.map +1 -1
  126. package/dist/sdk/client/endpoints.d.ts +25 -0
  127. package/dist/sdk/client/endpoints.d.ts.map +1 -1
  128. package/dist/sdk/client/endpoints.js +1 -1
  129. package/dist/sdk/client/endpoints.js.map +1 -1
  130. package/dist/sdk/client/engage-api-client.d.ts +47 -1
  131. package/dist/sdk/client/engage-api-client.d.ts.map +1 -1
  132. package/dist/sdk/client/engage-api-client.js +1 -1
  133. package/dist/sdk/client/engage-api-client.js.map +1 -1
  134. package/dist/sdk/client/http-client.js +1 -1
  135. package/dist/sdk/client/llm-api-client.js +1 -1
  136. package/dist/sdk/client/llm-api-client.js.map +1 -1
  137. package/dist/sdk/client/rate-limiter.js +1 -1
  138. package/dist/sdk/client/td-api-client.js +1 -1
  139. package/dist/sdk/client/td-api-client.js.map +1 -1
  140. package/dist/sdk/client/trino-api-client.js +1 -1
  141. package/dist/sdk/client/trino-api-client.js.map +1 -1
  142. package/dist/sdk/client/workflow-client.js +1 -1
  143. package/dist/sdk/client/workflow-client.js.map +1 -1
  144. package/dist/sdk/connection-validator.js +1 -1
  145. package/dist/sdk/connection.js +1 -1
  146. package/dist/sdk/delivery.js +1 -1
  147. package/dist/sdk/engage/campaign-pull.js +1 -1
  148. package/dist/sdk/engage/campaign-push.js +1 -1
  149. package/dist/sdk/engage/campaign-validator.js +1 -1
  150. package/dist/sdk/engage/campaign-yaml.js +1 -1
  151. package/dist/sdk/engage/template-pull.d.ts +73 -0
  152. package/dist/sdk/engage/template-pull.d.ts.map +1 -0
  153. package/dist/sdk/engage/template-pull.js +1 -0
  154. package/dist/sdk/engage/template-pull.js.map +1 -0
  155. package/dist/sdk/engage/template-push.d.ts +99 -0
  156. package/dist/sdk/engage/template-push.d.ts.map +1 -0
  157. package/dist/sdk/engage/template-push.js +1 -0
  158. package/dist/sdk/engage/template-push.js.map +1 -0
  159. package/dist/sdk/engage/template-validator.d.ts +18 -0
  160. package/dist/sdk/engage/template-validator.d.ts.map +1 -0
  161. package/dist/sdk/engage/template-validator.js +1 -0
  162. package/dist/sdk/engage/template-validator.js.map +1 -0
  163. package/dist/sdk/engage/template-yaml.d.ts +69 -0
  164. package/dist/sdk/engage/template-yaml.d.ts.map +1 -0
  165. package/dist/sdk/engage/template-yaml.js +1 -0
  166. package/dist/sdk/engage/template-yaml.js.map +1 -0
  167. package/dist/sdk/engage/types/campaign-def.js +1 -1
  168. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  169. package/dist/sdk/engage/types/template-schema.d.ts +33 -0
  170. package/dist/sdk/engage/types/template-schema.d.ts.map +1 -0
  171. package/dist/sdk/engage/types/template-schema.js +1 -0
  172. package/dist/sdk/engage/types/template-schema.js.map +1 -0
  173. package/dist/sdk/engage.d.ts +96 -4
  174. package/dist/sdk/engage.d.ts.map +1 -1
  175. package/dist/sdk/engage.js +1 -1
  176. package/dist/sdk/engage.js.map +1 -1
  177. package/dist/sdk/errors.js +1 -1
  178. package/dist/sdk/index.d.ts +10 -0
  179. package/dist/sdk/index.d.ts.map +1 -1
  180. package/dist/sdk/index.js +1 -1
  181. package/dist/sdk/index.js.map +1 -1
  182. package/dist/sdk/io/index.js +1 -1
  183. package/dist/sdk/io/node-filesystem.js +1 -1
  184. package/dist/sdk/job.js +1 -1
  185. package/dist/sdk/journey.d.ts +2 -0
  186. package/dist/sdk/journey.d.ts.map +1 -1
  187. package/dist/sdk/journey.js +1 -1
  188. package/dist/sdk/journey.js.map +1 -1
  189. package/dist/sdk/llm/chat-cache.js +1 -1
  190. package/dist/sdk/llm/index.js +1 -1
  191. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  192. package/dist/sdk/llm/model-factors.js +1 -1
  193. package/dist/sdk/personalization.js +1 -1
  194. package/dist/sdk/personalization.js.map +1 -1
  195. package/dist/sdk/query/index.js +1 -1
  196. package/dist/sdk/query/sql-parser.js +1 -1
  197. package/dist/sdk/realtime.js +1 -1
  198. package/dist/sdk/realtime.js.map +1 -1
  199. package/dist/sdk/schedule.js +1 -1
  200. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  201. package/dist/sdk/segment/fields-display.js +1 -1
  202. package/dist/sdk/segment/file-discovery.js +1 -1
  203. package/dist/sdk/segment/journey-utils.js +1 -1
  204. package/dist/sdk/segment/journey-validator.js +1 -1
  205. package/dist/sdk/segment/journey-yaml.js +1 -1
  206. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  207. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  208. package/dist/sdk/segment/parent-segment-yaml.js.map +1 -1
  209. package/dist/sdk/segment/pull-workflow.js +1 -1
  210. package/dist/sdk/segment/push-recovery.js +1 -1
  211. package/dist/sdk/segment/push-workflow.js +1 -1
  212. package/dist/sdk/segment/resolution-context.js +1 -1
  213. package/dist/sdk/segment/segment-path-parser.js +1 -1
  214. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  215. package/dist/sdk/segment/segment-validator.js +1 -1
  216. package/dist/sdk/segment/target-resolution.js +1 -1
  217. package/dist/sdk/segment/tdx-config.js +1 -1
  218. package/dist/sdk/segment/types/activation-schema.js +1 -1
  219. package/dist/sdk/segment/types/journey-def.js +1 -1
  220. package/dist/sdk/segment/types/journey-schema.js +1 -1
  221. package/dist/sdk/segment/types/segment-def.js +1 -1
  222. package/dist/sdk/segment/types/segment-schema.js +1 -1
  223. package/dist/sdk/segment/validate-files.d.ts +6 -1
  224. package/dist/sdk/segment/validate-files.d.ts.map +1 -1
  225. package/dist/sdk/segment/validate-files.js +1 -1
  226. package/dist/sdk/segment/validate-files.js.map +1 -1
  227. package/dist/sdk/segment/yaml-validator.d.ts +1 -1
  228. package/dist/sdk/segment/yaml-validator.d.ts.map +1 -1
  229. package/dist/sdk/segment/yaml-validator.js +1 -1
  230. package/dist/sdk/segment/yaml-validator.js.map +1 -1
  231. package/dist/sdk/segment.js +1 -1
  232. package/dist/sdk/types/engage.d.ts +121 -0
  233. package/dist/sdk/types/engage.d.ts.map +1 -1
  234. package/dist/sdk/types/index.d.ts +1 -1
  235. package/dist/sdk/types/index.d.ts.map +1 -1
  236. package/dist/sdk/types/index.js +1 -1
  237. package/dist/sdk/types/index.js.map +1 -1
  238. package/dist/sdk/types/progress.js +1 -1
  239. package/dist/sdk/user.js +1 -1
  240. package/dist/sdk/util/format-detector.js +1 -1
  241. package/dist/sdk/util/formatters.js +1 -1
  242. package/dist/sdk/util/index.d.ts +1 -0
  243. package/dist/sdk/util/index.d.ts.map +1 -1
  244. package/dist/sdk/util/index.js +1 -1
  245. package/dist/sdk/util/index.js.map +1 -1
  246. package/dist/sdk/util/paginate.d.ts +18 -0
  247. package/dist/sdk/util/paginate.d.ts.map +1 -0
  248. package/dist/sdk/util/paginate.js +1 -0
  249. package/dist/sdk/util/paginate.js.map +1 -0
  250. package/dist/sdk/util/tree-formatter.js +1 -1
  251. package/dist/sdk/workflow/archive-validation.js +1 -1
  252. package/dist/sdk/workflow/clone-workflow.js +1 -1
  253. package/dist/sdk/workflow/index.d.ts.map +1 -1
  254. package/dist/sdk/workflow/index.js +1 -1
  255. package/dist/sdk/workflow/index.js.map +1 -1
  256. package/dist/sdk/workflow/pull-workflow.js +1 -1
  257. package/dist/sdk/workflow/push-workflow.js +1 -1
  258. package/dist/sdk/workflow/tdx-config.js +1 -1
  259. package/dist/sdk/workflow/workflow-utils.js +1 -1
  260. package/dist/test-utils/command-runner.js +1 -1
  261. package/dist/test-utils/factories.js +1 -1
  262. package/dist/test-utils/fixtures.js +1 -1
  263. package/dist/test-utils/http-mock.js +1 -1
  264. package/dist/test-utils/index.js +1 -1
  265. package/dist/utils/async.js +1 -1
  266. package/dist/utils/colors.js +1 -1
  267. package/dist/utils/diff.js +1 -1
  268. package/dist/utils/file-permissions.js +1 -1
  269. package/dist/utils/file-reader.js +1 -1
  270. package/dist/utils/github-releases.js +1 -1
  271. package/dist/utils/global-cache.js +1 -1
  272. package/dist/utils/json-loader.js +1 -1
  273. package/dist/utils/local-cache.js +1 -1
  274. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  275. package/dist/utils/logger/formatters/index.js +1 -1
  276. package/dist/utils/logger/handlers/console-handler.js +1 -1
  277. package/dist/utils/logger/handlers/file-handler.js +1 -1
  278. package/dist/utils/logger/handlers/index.js +1 -1
  279. package/dist/utils/logger/handlers/null-handler.js +1 -1
  280. package/dist/utils/logger/index.js +1 -1
  281. package/dist/utils/logger/logger.js +1 -1
  282. package/dist/utils/logger/types.js +1 -1
  283. package/dist/utils/option-validation.js +1 -1
  284. package/dist/utils/process.js +1 -1
  285. package/dist/utils/prompt.js +1 -1
  286. package/dist/utils/spinner.js +1 -1
  287. package/dist/utils/sse-parser.js +1 -1
  288. package/dist/utils/string-utils.js +1 -1
  289. package/dist/utils/table-ref-parser.js +1 -1
  290. package/dist/utils/tdx-logger.js +1 -1
  291. package/dist/utils/version-check.js +1 -1
  292. package/package.json +2 -1
@@ -1 +1 @@
1
- const a4_0x235a3c=a4_0x2a06;function a4_0x32b5(){const _0x3bafb1=['experimentalKnowledgeBases','\x20\x20Prompts:\x20','7PJNqdX','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','4563010WnppXR','pushProject','\x0aError:','newProjectName','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','\x20=\x20','\x22\x20to\x20new\x20project\x20\x22','Summary:','\x20\x20Integrations:\x20','pushAgent','diff','llm_project','Writing\x20files...','Agent:\x20','Usage:\x20tdx\x20agent\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20project\x20(requires\x20context\x20or\x20tdx.json)','llm','dirname','no_local_folder','Using\x20local\x20project:\x20','\x20\x20Knowledge\x20Base\x20\x22','unchanged','Output:\x20','\x20--profile\x20','name','green','\x20\x20Text\x20Knowledge\x20Bases:\x20','Analyzing\x20changes\x20to\x20push...','Cancelled','Source:\x20','agent','agents','Project\x20cloned\x20with\x20errors','\x20\x20Text\x20Knowledge\x20Base\x20\x22','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','profile','773346OWBJmX','4cuzLQq','\x20\x20Target:\x20','877570xJFADS','Using\x20project:\x20','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','repeat','created','agent:push','39077100HPhcLG','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','red','9aTyzLM','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','\x20resources\x20to\x20\x27','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','\x0aPull\x20summary\x20for\x20\x27','Using\x20project\x20from\x20context:\x20','8BKlaBE','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','New\x20project\x20ID:\x20','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','total','\x20unchanged','Agent\x20','outputDir','counts','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','-\x20nothing\x20pushed','cyan','Using\x20current\x20project:\x20','Pushing\x20to\x20project...','Chat:\x20','3752742PVudpT','errors','-\x20no\x20files\x20written','\x20changed','context','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','projectId','\x20resources?','\x22:\x20','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','\x0aChanges\x20to\x20agent\x20\x27','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','INVALID_ARGUMENT','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','\x0aErrors\x20found:','push','Cannot\x20clone\x20from\x20context\x20project\x20\x22','\x20|\x20','\x0aWrite\x20','Dry\x20run\x20-\x20no\x20changes\x20made','Project\x20cloned\x20successfully','✔\x20Context\x20set:\x20','\x0aChanges:','tdx.json','Would\x20pull\x20agent:\x20','yellow','Would\x20push\x20agent:\x20','\x20\x20Experimental\x20Artifact\x20\x22','\x20created','agentId','message','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','agent.yml','Dry\x20run\x20-\x20no\x20files\x20written','\x20\x20Experimental\x20Artifacts:\x20','Pushing\x20agent\x20from\x20\x22','hasChanges','\x0a✔\x20Pulled\x20','\x0aChanges\x20to\x20integration\x20\x27','pullProject','\x20errors','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','yes','Status:\x20','\x0aPush\x20summary\x20for\x20\x27','newProjectId','execute','<new-name>','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','found','\x20\x20Integration\x20\x22','Failed\x20to\x20push\x20agent:\x20','Output\x20path:\x20','Project:\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','2838gSkGRo','projectName','textKnowledgeBases','gray','new','Using\x20project\x20from\x20','experimentalArtifacts','\x22...','12113802IVftmB','join','\x22\x20to\x20a\x20different\x20profile','agent:pull','agentName','updated','\x20\x20Agents:\x20','source','Agent\x20pulled\x20successfully','\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','integrations','\x20new','\x20files\x20to\x20','New\x20project:\x20','parse','force','dim','description','prompts','error','\x20\x20Prompt\x20\x22','\x20successfully','10320MemRlI','knowledgeBases','dryRun','\x20\x20Agent\x20\x22','llmProject','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','No\x20tdx.json\x20found\x20in\x20','Pulling\x20agent\x20\x22','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x0aPush\x20','Clone\x20\x22','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','\x20\x20Knowledge\x20Bases:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20--agent\x20<name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20context\x20project','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','\x22\x20to\x20\x22','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','agent:clone','Cloning\x20\x22','log','sourceProjectName','New\x20project\x20name\x20is\x20required','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','cloneProject','Would\x20clone:','\x20\x20tdx\x20agent\x20clone\x20agents/','cwd','Errors:','action'];a4_0x32b5=function(){return _0x3bafb1;};return a4_0x32b5();}(function(_0x31c3b4,_0x3289f6){const _0x3fdaa9=a4_0x2a06,_0x2bc759=_0x31c3b4();while(!![]){try{const _0x43108c=parseInt(_0x3fdaa9(0x201))/0x1+parseInt(_0x3fdaa9(0x1fe))/0x2*(parseInt(_0x3fdaa9(0x20a))/0x3)+-parseInt(_0x3fdaa9(0x1ff))/0x4*(-parseInt(_0x3fdaa9(0x1da))/0x5)+parseInt(_0x3fdaa9(0x21f))/0x6*(-parseInt(_0x3fdaa9(0x1d8))/0x7)+parseInt(_0x3fdaa9(0x210))/0x8*(parseInt(_0x3fdaa9(0x1a2))/0x9)+parseInt(_0x3fdaa9(0x1b9))/0xa*(parseInt(_0x3fdaa9(0x19a))/0xb)+-parseInt(_0x3fdaa9(0x207))/0xc;if(_0x43108c===_0x3289f6)break;else _0x2bc759['push'](_0x2bc759['shift']());}catch(_0x33f581){_0x2bc759['push'](_0x2bc759['shift']());}}}(a4_0x32b5,0xa625f));import a4_0x2afdb2 from'chalk';import a4_0x45bdbd from'path';function a4_0x2a06(_0x587e41,_0x3d93d4){_0x587e41=_0x587e41-0x16c;const _0x32b516=a4_0x32b5();let _0x2a06be=_0x32b516[_0x587e41];return _0x2a06be;}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(_0xdda7f8){const _0x45e81a=a4_0x2a06,_0x59855b=[];if(_0xdda7f8[_0x45e81a(0x214)]!==undefined)_0x59855b['push'](_0xdda7f8[_0x45e81a(0x214)]+'\x20total');if(_0xdda7f8['new']!==undefined&&_0xdda7f8[_0x45e81a(0x19e)]>0x0)_0x59855b[_0x45e81a(0x172)](a4_0x2afdb2[_0x45e81a(0x1f2)](_0xdda7f8[_0x45e81a(0x19e)]+_0x45e81a(0x1ae)));if(_0xdda7f8[_0x45e81a(0x205)]!==undefined&&_0xdda7f8[_0x45e81a(0x205)]>0x0)_0x59855b[_0x45e81a(0x172)](a4_0x2afdb2[_0x45e81a(0x1f2)](_0xdda7f8[_0x45e81a(0x205)]+_0x45e81a(0x17f)));if(_0xdda7f8[_0x45e81a(0x1a7)]!==undefined&&_0xdda7f8[_0x45e81a(0x1a7)]>0x0)_0x59855b['push'](a4_0x2afdb2[_0x45e81a(0x17c)](_0xdda7f8[_0x45e81a(0x1a7)]+'\x20updated'));if(_0xdda7f8[_0x45e81a(0x1ee)]!==undefined&&_0xdda7f8[_0x45e81a(0x1ee)]>0x0)_0x59855b[_0x45e81a(0x172)](a4_0x2afdb2[_0x45e81a(0x19d)](_0xdda7f8[_0x45e81a(0x1ee)]+_0x45e81a(0x215)));if(_0xdda7f8[_0x45e81a(0x220)]!==undefined&&_0xdda7f8[_0x45e81a(0x220)]>0x0)_0x59855b[_0x45e81a(0x172)](a4_0x2afdb2[_0x45e81a(0x209)](_0xdda7f8['errors']+_0x45e81a(0x18b)));return _0x59855b[_0x45e81a(0x1a3)](',\x20');}function displayDiffs(_0x3058af,_0x5d97b7,_0x53e886,_0x5f18a4,_0x24dd22,_0x58f2d4,_0xddc6eb){const _0x612aaa=a4_0x2a06;for(const _0x13808b of _0x3058af){if(_0x13808b[_0x612aaa(0x1e4)]){const _0x43c136=_0x13808b[_0x612aaa(0x1a6)]||_0x13808b[_0x612aaa(0x1f1)];console[_0x612aaa(0x1cc)](_0x612aaa(0x16d)+_0x43c136+'\x27:'),console[_0x612aaa(0x1cc)]('─'[_0x612aaa(0x204)](0x3c)),console[_0x612aaa(0x1cc)](_0x13808b[_0x612aaa(0x1e4)]),console[_0x612aaa(0x1cc)]('─'['repeat'](0x3c));}}for(const _0x29dc4f of _0x5d97b7){_0x29dc4f['diff']&&(console['log'](_0x612aaa(0x182)+_0x29dc4f[_0x612aaa(0x1f1)]+'\x27:'),console[_0x612aaa(0x1cc)]('─'[_0x612aaa(0x204)](0x3c)),console['log'](_0x29dc4f[_0x612aaa(0x1e4)]),console[_0x612aaa(0x1cc)]('─'[_0x612aaa(0x204)](0x3c)));}for(const _0x46453b of _0x53e886){_0x46453b['diff']&&(console['log']('\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27'+_0x46453b[_0x612aaa(0x1f1)]+'\x27:'),console[_0x612aaa(0x1cc)]('─'['repeat'](0x3c)),console[_0x612aaa(0x1cc)](_0x46453b[_0x612aaa(0x1e4)]),console['log']('─'[_0x612aaa(0x204)](0x3c)));}for(const _0x574cfd of _0x5f18a4){_0x574cfd['diff']&&(console[_0x612aaa(0x1cc)]('\x0aChanges\x20to\x20prompt\x20\x27'+_0x574cfd[_0x612aaa(0x1f1)]+'\x27:'),console['log']('─'[_0x612aaa(0x204)](0x3c)),console[_0x612aaa(0x1cc)](_0x574cfd[_0x612aaa(0x1e4)]),console[_0x612aaa(0x1cc)]('─'[_0x612aaa(0x204)](0x3c)));}for(const _0x568ec4 of _0x24dd22){_0x568ec4[_0x612aaa(0x1e4)]&&(console[_0x612aaa(0x1cc)](_0x612aaa(0x189)+_0x568ec4[_0x612aaa(0x1f1)]+'\x27:'),console[_0x612aaa(0x1cc)]('─'['repeat'](0x3c)),console['log'](_0x568ec4['diff']),console[_0x612aaa(0x1cc)]('─'[_0x612aaa(0x204)](0x3c)));}for(const _0x56895b of _0x58f2d4){_0x56895b[_0x612aaa(0x1e4)]&&(console[_0x612aaa(0x1cc)]('\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27'+_0x56895b[_0x612aaa(0x1f1)]+'\x27:'),console['log']('─'[_0x612aaa(0x204)](0x3c)),console[_0x612aaa(0x1cc)](_0x56895b[_0x612aaa(0x1e4)]),console[_0x612aaa(0x1cc)]('─'[_0x612aaa(0x204)](0x3c)));}for(const _0x5aa5ec of _0xddc6eb){_0x5aa5ec[_0x612aaa(0x1e4)]&&(console[_0x612aaa(0x1cc)](_0x612aaa(0x20b)+_0x5aa5ec[_0x612aaa(0x1f1)]+'\x27:'),console['log']('─'[_0x612aaa(0x204)](0x3c)),console[_0x612aaa(0x1cc)](_0x5aa5ec[_0x612aaa(0x1e4)]),console[_0x612aaa(0x1cc)]('─'[_0x612aaa(0x204)](0x3c)));}}export class AgentPullCommand extends BaseCommand{['name']=a4_0x235a3c(0x1a5);[a4_0x235a3c(0x1b4)]=a4_0x235a3c(0x1de);async['execute'](_0xe7c700){const _0x644ac0=a4_0x235a3c,{options:_0x5e5b62,args:_0x11e6b0,tdx:_0xe1b87d}=_0xe7c700,_0x2183dc=_0x11e6b0[0x0],_0x59892a=_0x11e6b0[0x1],_0x533f39=_0x5e5b62['output'],_0x3e9cab=_0x5e5b62[_0x644ac0(0x1bb)],_0x5a32b8=_0x5e5b62[_0x644ac0(0x1b2)],_0x641c98=_0x5e5b62['yes'],_0x26d5ad=_0x5e5b62[_0x644ac0(0x1bd)],_0x1a5438=_0x5e5b62[_0x644ac0(0x1f7)];let _0x3d889c;if(_0x2183dc){const _0x3eb45b=a4_0x45bdbd[_0x644ac0(0x1a3)](_0x2183dc,_0x644ac0(0x17a));if(existsSync(_0x3eb45b))try{const _0x1469b=JSON[_0x644ac0(0x1b1)](readFileSync(_0x3eb45b,'utf-8'));_0x1469b[_0x644ac0(0x1e5)]&&(_0x3d889c={'llm_project':_0x1469b['llm_project']});}catch{}}const _0x1bee9f=findAgentConfigPath(process[_0x644ac0(0x1d3)]());let _0x112a8d;if(_0x1bee9f)try{const _0x34cf8f=JSON[_0x644ac0(0x1b1)](readFileSync(_0x1bee9f,'utf-8'));_0x34cf8f[_0x644ac0(0x1e5)]&&(_0x112a8d={'llm_project':_0x34cf8f[_0x644ac0(0x1e5)]});}catch{}const _0x23edb6=resolveAgentPullArgs({'arg':_0x2183dc,'agentNameArg':_0x59892a,'agentFlag':_0x1a5438,'contextProject':_0x26d5ad,'argDirConfig':_0x3d889c,'cwdConfigPath':_0x1bee9f||undefined,'cwdConfig':_0x112a8d}),{projectNameOrId:_0x20a4d,targetAgentName:_0x50c754,existingOutputDir:_0x57ba82,source:_0x367598}=_0x23edb6;if(_0x367598==='arg-dir')console[_0x644ac0(0x1cc)](a4_0x2afdb2['dim'](_0x644ac0(0x19f)+a4_0x45bdbd[_0x644ac0(0x1a3)](_0x2183dc,_0x644ac0(0x17a))+':\x20'+_0x20a4d));else{if(_0x367598==='cwd-config')console[_0x644ac0(0x1cc)](a4_0x2afdb2[_0x644ac0(0x1b3)](_0x644ac0(0x202)+_0x20a4d));else _0x367598==='context'&&console['log'](a4_0x2afdb2['dim'](_0x644ac0(0x20f)+_0x20a4d));}if(!_0x20a4d)return _0x1a5438?(console['log'](a4_0x2afdb2[_0x644ac0(0x17c)](_0x644ac0(0x16c))),console[_0x644ac0(0x1cc)](_0x644ac0(0x18c)),console[_0x644ac0(0x1cc)]('Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>')):(console[_0x644ac0(0x1cc)](a4_0x2afdb2[_0x644ac0(0x17c)]('llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a')),console[_0x644ac0(0x1cc)](_0x644ac0(0x1e8)),console[_0x644ac0(0x1cc)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project'),console['log'](_0x644ac0(0x199)),console[_0x644ac0(0x1cc)](_0x644ac0(0x1c6)),console[_0x644ac0(0x1cc)](_0x644ac0(0x1ac))),0x1;if(_0x50c754){const {data:_0x4e42e1}=await withSpinner(_0x644ac0(0x1c0)+_0x50c754+'\x22\x20from\x20project\x20\x22'+_0x20a4d+_0x644ac0(0x1a1),()=>_0xe1b87d[_0x644ac0(0x1e9)]['pullAgent'](_0x20a4d,_0x50c754,_0x533f39,{'dryRun':_0x3e9cab,'force':_0x5a32b8}));if(_0x3e9cab)return console[_0x644ac0(0x1cc)](a4_0x2afdb2['yellow'](_0x644ac0(0x184))),console['log'](_0x644ac0(0x17b)+_0x4e42e1[_0x644ac0(0x1a6)]),console[_0x644ac0(0x1cc)](_0x644ac0(0x197)+_0x4e42e1['outputPath']),_0x4e42e1[_0x644ac0(0x1e4)]&&(console[_0x644ac0(0x1cc)](_0x644ac0(0x179)),console[_0x644ac0(0x1cc)]('─'[_0x644ac0(0x204)](0x3c)),console[_0x644ac0(0x1cc)](_0x4e42e1[_0x644ac0(0x1e4)]),console[_0x644ac0(0x1cc)]('─'[_0x644ac0(0x204)](0x3c))),0x0;return console['log'](a4_0x2afdb2[_0x644ac0(0x1f2)](_0x644ac0(0x1aa))),console['log'](_0x644ac0(0x1e7)+_0x4e42e1['agentName']),console[_0x644ac0(0x1cc)](_0x644ac0(0x1ef)+_0x4e42e1['outputPath']),console[_0x644ac0(0x1cc)](_0x644ac0(0x18e)+(_0x4e42e1['isNew']?a4_0x2afdb2[_0x644ac0(0x1f2)](_0x644ac0(0x19e)):_0x4e42e1[_0x644ac0(0x187)]?a4_0x2afdb2[_0x644ac0(0x17c)]('updated'):a4_0x2afdb2[_0x644ac0(0x19d)](_0x644ac0(0x1ee)))),0x0;}const _0x2da6af=_0x57ba82||_0x533f39,{data:_0x3df237}=await withSpinner('Analyzing\x20project\x20\x22'+_0x20a4d+'\x22...',()=>_0xe1b87d['llm'][_0x644ac0(0x18a)](_0x20a4d,_0x2da6af,{'dryRun':!![]})),_0x1e0cf5=_0x3df237['counts'][_0x644ac0(0x1f8)][_0x644ac0(0x19e)]+_0x3df237[_0x644ac0(0x218)][_0x644ac0(0x1ba)]['new']+_0x3df237[_0x644ac0(0x218)][_0x644ac0(0x19c)][_0x644ac0(0x19e)]+_0x3df237[_0x644ac0(0x218)][_0x644ac0(0x1b5)]['new']+_0x3df237[_0x644ac0(0x218)][_0x644ac0(0x1ad)][_0x644ac0(0x19e)]+_0x3df237[_0x644ac0(0x218)][_0x644ac0(0x1d6)][_0x644ac0(0x19e)]+_0x3df237[_0x644ac0(0x218)]['experimentalArtifacts'][_0x644ac0(0x19e)],_0x7bdc7e=_0x3df237[_0x644ac0(0x218)][_0x644ac0(0x1f8)][_0x644ac0(0x1a7)]+_0x3df237[_0x644ac0(0x218)][_0x644ac0(0x1ba)][_0x644ac0(0x1a7)]+_0x3df237['counts'][_0x644ac0(0x19c)]['updated']+_0x3df237[_0x644ac0(0x218)][_0x644ac0(0x1b5)][_0x644ac0(0x1a7)]+_0x3df237[_0x644ac0(0x218)][_0x644ac0(0x1ad)][_0x644ac0(0x1a7)]+_0x3df237[_0x644ac0(0x218)]['experimentalKnowledgeBases'][_0x644ac0(0x1a7)]+_0x3df237['counts']['experimentalArtifacts']['updated'],_0x20799b=_0x3df237[_0x644ac0(0x218)][_0x644ac0(0x1f8)]['unchanged']+_0x3df237[_0x644ac0(0x218)]['knowledgeBases']['unchanged']+_0x3df237[_0x644ac0(0x218)][_0x644ac0(0x19c)]['unchanged']+_0x3df237['counts'][_0x644ac0(0x1b5)]['unchanged']+_0x3df237[_0x644ac0(0x218)][_0x644ac0(0x1ad)][_0x644ac0(0x1ee)]+_0x3df237[_0x644ac0(0x218)][_0x644ac0(0x1d6)][_0x644ac0(0x1ee)]+_0x3df237[_0x644ac0(0x218)][_0x644ac0(0x1a0)][_0x644ac0(0x1ee)];console[_0x644ac0(0x1cc)](_0x644ac0(0x20e)+_0x3df237[_0x644ac0(0x19b)]+'\x27:'),console[_0x644ac0(0x1cc)]('\x20\x20'+a4_0x2afdb2[_0x644ac0(0x1f2)]('+\x20'+_0x1e0cf5+_0x644ac0(0x1ae))+'\x20|\x20'+a4_0x2afdb2[_0x644ac0(0x17c)]('~\x20'+_0x7bdc7e+_0x644ac0(0x222))+_0x644ac0(0x174)+a4_0x2afdb2[_0x644ac0(0x1b3)]('=\x20'+_0x20799b+_0x644ac0(0x215))),console['log'](_0x644ac0(0x1a8)+formatCountSummary(_0x3df237[_0x644ac0(0x218)][_0x644ac0(0x1f8)])),console[_0x644ac0(0x1cc)](_0x644ac0(0x1c5)+formatCountSummary(_0x3df237[_0x644ac0(0x218)][_0x644ac0(0x1ba)])),console[_0x644ac0(0x1cc)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x3df237['counts']['textKnowledgeBases'])),console[_0x644ac0(0x1cc)](_0x644ac0(0x1d7)+formatCountSummary(_0x3df237[_0x644ac0(0x218)][_0x644ac0(0x1b5)])),console[_0x644ac0(0x1cc)](_0x644ac0(0x1e2)+formatCountSummary(_0x3df237[_0x644ac0(0x218)][_0x644ac0(0x1ad)]));const _0x3304b4=_0x3df237[_0x644ac0(0x218)][_0x644ac0(0x1d6)][_0x644ac0(0x214)]>0x0||_0x3df237[_0x644ac0(0x218)]['experimentalArtifacts'][_0x644ac0(0x214)]>0x0;_0x3304b4&&(console[_0x644ac0(0x1cc)](_0x644ac0(0x170)+formatCountSummary(_0x3df237['counts'][_0x644ac0(0x1d6)])),console[_0x644ac0(0x1cc)](_0x644ac0(0x185)+formatCountSummary(_0x3df237[_0x644ac0(0x218)][_0x644ac0(0x1a0)])));console[_0x644ac0(0x1cc)](_0x644ac0(0x200)+a4_0x2afdb2[_0x644ac0(0x21b)](_0x3df237[_0x644ac0(0x217)])),displayDiffs(_0x3df237[_0x644ac0(0x1f8)],_0x3df237[_0x644ac0(0x1ba)],_0x3df237[_0x644ac0(0x19c)],_0x3df237[_0x644ac0(0x1b5)],_0x3df237[_0x644ac0(0x1ad)],_0x3df237[_0x644ac0(0x1d6)],_0x3df237[_0x644ac0(0x1a0)]);if(_0x3e9cab)return console[_0x644ac0(0x1cc)](a4_0x2afdb2[_0x644ac0(0x17c)](_0x644ac0(0x16e))),0x0;if(_0x1e0cf5===0x0&&_0x7bdc7e===0x0)return console[_0x644ac0(0x1cc)](a4_0x2afdb2[_0x644ac0(0x1f2)](_0x644ac0(0x208))),saveSessionContext({'llm_project':_0x3df237['projectName']},_0x5e5b62['session']),console['log'](a4_0x2afdb2[_0x644ac0(0x1f2)](_0x644ac0(0x178)+a4_0x2afdb2[_0x644ac0(0x1b3)](_0x644ac0(0x1e5))+_0x644ac0(0x1df)+a4_0x2afdb2['cyan'](_0x3df237[_0x644ac0(0x19b)]))),0x0;if(!_0x641c98&&!_0x5a32b8){if(!isInteractive())return console[_0x644ac0(0x1b6)](a4_0x2afdb2[_0x644ac0(0x209)](_0x644ac0(0x1dc)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x644ac0(0x1b6)](a4_0x2afdb2[_0x644ac0(0x1b3)](_0x644ac0(0x1c1))),0x1;const _0x9c4272=await confirmKey(_0x644ac0(0x175)+(_0x1e0cf5+_0x7bdc7e)+_0x644ac0(0x1ab));if(!_0x9c4272)return console[_0x644ac0(0x1cc)](a4_0x2afdb2['yellow'](_0x644ac0(0x1f5)),_0x644ac0(0x221)),0x1;}const {data:_0x37f648}=await withSpinner(_0x644ac0(0x1e6),()=>_0xe1b87d[_0x644ac0(0x1e9)][_0x644ac0(0x18a)](_0x20a4d,_0x2da6af,{'force':_0x5a32b8}));return console[_0x644ac0(0x1cc)](a4_0x2afdb2[_0x644ac0(0x1f2)](_0x644ac0(0x188)+(_0x1e0cf5+_0x7bdc7e)+_0x644ac0(0x1af)+_0x37f648[_0x644ac0(0x217)])),saveSessionContext({'llm_project':_0x37f648[_0x644ac0(0x19b)]},_0x5e5b62['session']),console[_0x644ac0(0x1cc)](a4_0x2afdb2[_0x644ac0(0x1f2)](_0x644ac0(0x178)+a4_0x2afdb2['dim'](_0x644ac0(0x1e5))+_0x644ac0(0x1df)+a4_0x2afdb2['cyan'](_0x37f648[_0x644ac0(0x19b)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x235a3c(0x1f1)]=a4_0x235a3c(0x1ca);[a4_0x235a3c(0x1b4)]=a4_0x235a3c(0x1d9);async[a4_0x235a3c(0x191)](_0x3e2e5b){const _0xeb3823=a4_0x235a3c,{options:_0x200733,args:_0x2ac02f,tdx:_0x1e5a7c}=_0x3e2e5b,_0x16bcb0=_0x2ac02f[0x0],_0x572abc=_0x200733['name'],_0x309630=_0x200733[_0xeb3823(0x1bb)],_0x1eb092=_0x200733[_0xeb3823(0x18d)],_0x370e9d=_0x200733['site'],_0x595833=_0x200733[_0xeb3823(0x1bd)];let _0x27ad13;const _0x3c34d2=findAgentConfigPath(process[_0xeb3823(0x1d3)]());if(_0x16bcb0){const _0x5d7b22=a4_0x45bdbd[_0xeb3823(0x1a3)](_0x16bcb0,_0xeb3823(0x17a));existsSync(_0x5d7b22)?(_0x27ad13=_0x16bcb0,console['log'](a4_0x2afdb2[_0xeb3823(0x1b3)](_0xeb3823(0x1ec)+_0x16bcb0))):_0x27ad13=_0x16bcb0;}else{if(_0x3c34d2)_0x27ad13=a4_0x45bdbd[_0xeb3823(0x1ea)](_0x3c34d2),console[_0xeb3823(0x1cc)](a4_0x2afdb2[_0xeb3823(0x1b3)](_0xeb3823(0x21c)+_0x27ad13));else{if(_0x595833){const _0x2495ed=sanitizeForFilesystem(_0x595833);let _0x236000=_0x2495ed,_0x4d76b0=a4_0x45bdbd[_0xeb3823(0x1a3)](process[_0xeb3823(0x1d3)](),_0xeb3823(0x1f8),_0x2495ed,_0xeb3823(0x17a));if(!existsSync(_0x4d76b0)){const _0x40ff22=normalizeName(_0x595833),_0x35f6f1=a4_0x45bdbd['join'](process[_0xeb3823(0x1d3)](),_0xeb3823(0x1f8),_0x40ff22,_0xeb3823(0x17a));existsSync(_0x35f6f1)&&(_0x236000=_0x40ff22,_0x4d76b0=_0x35f6f1);}if(existsSync(_0x4d76b0))_0x27ad13=a4_0x45bdbd[_0xeb3823(0x1ea)](_0x4d76b0),console[_0xeb3823(0x1cc)](a4_0x2afdb2[_0xeb3823(0x1b3)]('Using\x20local\x20project:\x20'+_0x27ad13));else{const _0x242842=_0x200733[_0xeb3823(0x1fd)];if(_0x242842)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0xeb3823(0x173)+_0x595833+_0xeb3823(0x1a4),undefined,{'helpText':_0xeb3823(0x1fb)+_0xeb3823(0x1c9)+('\x20\x20tdx\x20agent\x20pull\x20'+_0x595833+'\x0a')+(_0xeb3823(0x1d2)+_0x236000+'\x20--name\x20'+(_0x572abc||_0xeb3823(0x192))+_0xeb3823(0x1f0)+_0x242842)});_0x27ad13=_0x595833,console[_0xeb3823(0x1cc)](a4_0x2afdb2[_0xeb3823(0x1b3)]('Using\x20context\x20project:\x20'+_0x595833));}}}}if(!_0x27ad13)return console[_0xeb3823(0x1cc)](a4_0x2afdb2['yellow'](_0xeb3823(0x20d))),console[_0xeb3823(0x1cc)](_0xeb3823(0x224)),console[_0xeb3823(0x1cc)](_0xeb3823(0x203)),console[_0xeb3823(0x1cc)]('\x20\x20tdx\x20agent\x20clone\x20--name\x20<new-name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clone\x20from\x20context\x20(llm_project)'),console[_0xeb3823(0x1cc)](_0xeb3823(0x1cf)),0x1;if(!_0x572abc)throw new SDKError(ErrorCode['MISSING_ARGUMENT'],_0xeb3823(0x1ce),undefined,{'helpText':_0xeb3823(0x213)});if(!_0x1eb092&&!_0x309630){if(!isInteractive())return console[_0xeb3823(0x1b6)](a4_0x2afdb2[_0xeb3823(0x209)](_0xeb3823(0x1dc)),_0xeb3823(0x1be)),console['error'](a4_0x2afdb2[_0xeb3823(0x1b3)](_0xeb3823(0x1c1))),0x1;const _0x2bbfd8=await confirmKey(_0xeb3823(0x1c3)+_0x27ad13+_0xeb3823(0x1e0)+_0x572abc+'\x22?');if(!_0x2bbfd8)return console['log'](a4_0x2afdb2[_0xeb3823(0x17c)](_0xeb3823(0x1f5))),0x1;}const {data:_0x5b52f9}=await withSpinner(_0xeb3823(0x1cb)+_0x27ad13+_0xeb3823(0x1c8)+_0x572abc+_0xeb3823(0x1a1),()=>_0x1e5a7c[_0xeb3823(0x1e9)][_0xeb3823(0x1d0)](_0x27ad13,_0x572abc,{'dryRun':_0x309630}));if(_0x309630){console[_0xeb3823(0x1cc)](a4_0x2afdb2[_0xeb3823(0x17c)](_0xeb3823(0x176))),console[_0xeb3823(0x1cc)]('Source:\x20'+_0x5b52f9['sourceProjectName']),console[_0xeb3823(0x1cc)](_0xeb3823(0x1b0)+_0x572abc),console[_0xeb3823(0x1cc)](_0xeb3823(0x1d1)),console['log'](_0xeb3823(0x1a8)+_0x5b52f9[_0xeb3823(0x218)][_0xeb3823(0x1f8)][_0xeb3823(0x205)]),console[_0xeb3823(0x1cc)](_0xeb3823(0x1c5)+_0x5b52f9[_0xeb3823(0x218)][_0xeb3823(0x1ba)][_0xeb3823(0x205)]),console[_0xeb3823(0x1cc)](_0xeb3823(0x1d7)+_0x5b52f9[_0xeb3823(0x218)][_0xeb3823(0x1b5)]['created']);const _0x51701b=_0x5b52f9['counts'][_0xeb3823(0x1d6)][_0xeb3823(0x205)]>0x0||_0x5b52f9[_0xeb3823(0x218)][_0xeb3823(0x1a0)][_0xeb3823(0x205)]>0x0;return _0x51701b&&(console[_0xeb3823(0x1cc)](_0xeb3823(0x170)+_0x5b52f9[_0xeb3823(0x218)][_0xeb3823(0x1d6)][_0xeb3823(0x205)]),console['log'](_0xeb3823(0x185)+_0x5b52f9[_0xeb3823(0x218)][_0xeb3823(0x1a0)][_0xeb3823(0x205)])),0x0;}const _0xdea7cc=_0x5b52f9[_0xeb3823(0x218)][_0xeb3823(0x1f8)][_0xeb3823(0x220)]>0x0||_0x5b52f9[_0xeb3823(0x218)][_0xeb3823(0x1ba)][_0xeb3823(0x220)]>0x0||_0x5b52f9[_0xeb3823(0x218)][_0xeb3823(0x1b5)]['errors']>0x0||_0x5b52f9[_0xeb3823(0x218)][_0xeb3823(0x1d6)]['errors']>0x0||_0x5b52f9[_0xeb3823(0x218)]['experimentalArtifacts'][_0xeb3823(0x220)]>0x0;_0xdea7cc?console[_0xeb3823(0x1cc)](a4_0x2afdb2['yellow'](_0xeb3823(0x1f9))):console[_0xeb3823(0x1cc)](a4_0x2afdb2[_0xeb3823(0x1f2)](_0xeb3823(0x177)));console[_0xeb3823(0x1cc)](_0xeb3823(0x1f6)+_0x5b52f9[_0xeb3823(0x1cd)]),console[_0xeb3823(0x1cc)](_0xeb3823(0x1b0)+_0x5b52f9[_0xeb3823(0x1dd)]),console[_0xeb3823(0x1cc)](_0xeb3823(0x212)+_0x5b52f9['newProjectId']),console[_0xeb3823(0x1cc)](),console['log'](_0xeb3823(0x1e1)),console['log'](_0xeb3823(0x1a8)+formatCountSummary(_0x5b52f9['counts'][_0xeb3823(0x1f8)])),console[_0xeb3823(0x1cc)](_0xeb3823(0x1c5)+formatCountSummary(_0x5b52f9['counts'][_0xeb3823(0x1ba)])),console[_0xeb3823(0x1cc)](_0xeb3823(0x1d7)+formatCountSummary(_0x5b52f9[_0xeb3823(0x218)][_0xeb3823(0x1b5)])),console[_0xeb3823(0x1cc)](_0xeb3823(0x1e2)+formatCountSummary(_0x5b52f9[_0xeb3823(0x218)]['integrations']));const _0x1c173a=_0x5b52f9[_0xeb3823(0x218)][_0xeb3823(0x1d6)][_0xeb3823(0x205)]>0x0||_0x5b52f9[_0xeb3823(0x218)][_0xeb3823(0x1d6)][_0xeb3823(0x1a7)]>0x0||_0x5b52f9['counts']['experimentalKnowledgeBases']['unchanged']>0x0||_0x5b52f9[_0xeb3823(0x218)][_0xeb3823(0x1a0)][_0xeb3823(0x205)]>0x0||_0x5b52f9[_0xeb3823(0x218)][_0xeb3823(0x1a0)][_0xeb3823(0x1a7)]>0x0||_0x5b52f9['counts'][_0xeb3823(0x1a0)][_0xeb3823(0x1ee)]>0x0;_0x1c173a&&(console[_0xeb3823(0x1cc)](_0xeb3823(0x170)+formatCountSummary(_0x5b52f9[_0xeb3823(0x218)][_0xeb3823(0x1d6)])),console[_0xeb3823(0x1cc)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x5b52f9[_0xeb3823(0x218)][_0xeb3823(0x1a0)])));if(_0xdea7cc){console[_0xeb3823(0x1cc)](),console[_0xeb3823(0x1cc)](a4_0x2afdb2[_0xeb3823(0x209)]('Errors:'));for(const _0x8ae4e7 of _0x5b52f9['agents']){_0x8ae4e7[_0xeb3823(0x1d5)]===_0xeb3823(0x1b6)&&console[_0xeb3823(0x1cc)](a4_0x2afdb2[_0xeb3823(0x209)]('\x20\x20Agent\x20\x22'+_0x8ae4e7[_0xeb3823(0x1a6)]+_0xeb3823(0x227)+_0x8ae4e7[_0xeb3823(0x1b6)]));}for(const _0x4a8e21 of _0x5b52f9['knowledgeBases']){_0x4a8e21[_0xeb3823(0x1d5)]==='error'&&console[_0xeb3823(0x1cc)](a4_0x2afdb2[_0xeb3823(0x209)](_0xeb3823(0x1ed)+_0x4a8e21[_0xeb3823(0x1f1)]+_0xeb3823(0x227)+_0x4a8e21[_0xeb3823(0x1b6)]));}for(const _0x1562ae of _0x5b52f9[_0xeb3823(0x1b5)]){_0x1562ae['action']==='error'&&console['log'](a4_0x2afdb2[_0xeb3823(0x209)]('\x20\x20Prompt\x20\x22'+_0x1562ae['name']+_0xeb3823(0x227)+_0x1562ae['error']));}for(const _0x277e13 of _0x5b52f9[_0xeb3823(0x1ad)]){_0x277e13[_0xeb3823(0x1d5)]===_0xeb3823(0x1b6)&&console['log'](a4_0x2afdb2[_0xeb3823(0x209)]('\x20\x20Integration\x20\x22'+_0x277e13[_0xeb3823(0x1f1)]+_0xeb3823(0x227)+_0x277e13[_0xeb3823(0x1b6)]));}for(const _0x1bea90 of _0x5b52f9[_0xeb3823(0x1d6)]){_0x1bea90['action']===_0xeb3823(0x1b6)&&console[_0xeb3823(0x1cc)](a4_0x2afdb2[_0xeb3823(0x209)](_0xeb3823(0x211)+_0x1bea90[_0xeb3823(0x1f1)]+_0xeb3823(0x227)+_0x1bea90['error']));}for(const _0x13976e of _0x5b52f9[_0xeb3823(0x1a0)]){_0x13976e[_0xeb3823(0x1d5)]===_0xeb3823(0x1b6)&&console['log'](a4_0x2afdb2[_0xeb3823(0x209)](_0xeb3823(0x17e)+_0x13976e[_0xeb3823(0x1f1)]+_0xeb3823(0x227)+_0x13976e[_0xeb3823(0x1b6)]));}return 0x1;}console[_0xeb3823(0x1cc)]();const _0x469121=getLLMProjectUrl(_0x370e9d,_0x5b52f9[_0xeb3823(0x190)]);return console[_0xeb3823(0x1cc)](_0xeb3823(0x198)+a4_0x2afdb2[_0xeb3823(0x21b)](_0x469121)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x235a3c(0x1f1)]=a4_0x235a3c(0x206);['description']=a4_0x235a3c(0x1c7);async[a4_0x235a3c(0x191)](_0x3ac623){const _0x2a82f2=a4_0x235a3c,{options:_0xa3eca1,args:_0xc4d201,tdx:_0x38c681}=_0x3ac623;let _0x53ce87=_0xc4d201[0x0]||process[_0x2a82f2(0x1d3)]();const _0x3ba0b5=_0xa3eca1['dryRun'],_0x5ab167=_0xa3eca1[_0x2a82f2(0x1b2)],_0x4a40c1=_0xa3eca1['yes'],_0x2e29d=_0xa3eca1['site'],_0x499098=a4_0x45bdbd[_0x2a82f2(0x1a3)](_0x53ce87,_0x2a82f2(0x183)),_0x470214=existsSync(_0x499098);if(_0x470214){const {data:_0x1223da}=await withSpinner(_0x2a82f2(0x186)+_0x53ce87+_0x2a82f2(0x1a1),()=>_0x38c681['llm'][_0x2a82f2(0x1e3)](_0x53ce87,{'dryRun':_0x3ba0b5,'force':_0x5ab167}));if(_0x3ba0b5)return console[_0x2a82f2(0x1cc)](a4_0x2afdb2[_0x2a82f2(0x17c)](_0x2a82f2(0x176))),console[_0x2a82f2(0x1cc)](_0x2a82f2(0x17d)+_0x1223da[_0x2a82f2(0x1a6)]),0x0;if(_0x1223da[_0x2a82f2(0x1d5)]===_0x2a82f2(0x1b6))return console[_0x2a82f2(0x1cc)](a4_0x2afdb2[_0x2a82f2(0x209)](_0x2a82f2(0x196)+_0x1223da['error'])),0x1;console[_0x2a82f2(0x1cc)](a4_0x2afdb2[_0x2a82f2(0x1f2)](_0x2a82f2(0x216)+_0x1223da[_0x2a82f2(0x1d5)]+_0x2a82f2(0x1b8))),console[_0x2a82f2(0x1cc)](_0x2a82f2(0x1e7)+_0x1223da[_0x2a82f2(0x1a6)]);if(_0x1223da[_0x2a82f2(0x180)]&&_0x1223da[_0x2a82f2(0x225)]){const _0x6855d2=getLLMAgentChatUrl(_0x2e29d,_0x1223da['projectId'],_0x1223da[_0x2a82f2(0x180)]);console[_0x2a82f2(0x1cc)](_0x2a82f2(0x21e)+a4_0x2afdb2['cyan'](_0x6855d2));}return 0x0;}const _0x127754=_0xa3eca1[_0x2a82f2(0x1bd)],_0x57e500=resolveProjectFromContext(_0x53ce87,_0x127754);if(_0x57e500[_0x2a82f2(0x194)])_0x53ce87=_0x57e500['projectDir'],_0x57e500[_0x2a82f2(0x1a9)]===_0x2a82f2(0x223)&&console[_0x2a82f2(0x1cc)](a4_0x2afdb2['dim']('Using\x20project:\x20'+_0x53ce87));else{let _0x2d26b6=_0x2a82f2(0x1c4);_0x57e500['reason']===_0x2a82f2(0x1eb)&&(_0x2d26b6=_0x57e500[_0x2a82f2(0x181)]+_0x2a82f2(0x1fc)+_0x57e500[_0x2a82f2(0x1bd)]+'\x27\x20to\x20create\x20the\x20folder\x20structure.');throw new SDKError(ErrorCode[_0x2a82f2(0x16f)],_0x57e500['reason']==='no_context'?_0x57e500[_0x2a82f2(0x181)]:_0x2a82f2(0x1bf)+_0x53ce87,undefined,{'helpText':_0x2d26b6});}const {data:_0x2b5987}=await withSpinner(_0x2a82f2(0x1f4),()=>_0x38c681[_0x2a82f2(0x1e9)][_0x2a82f2(0x1db)](_0x53ce87,{'dryRun':!![]})),_0x4c54c0=_0x2b5987[_0x2a82f2(0x218)][_0x2a82f2(0x1f8)][_0x2a82f2(0x220)]>0x0;if(_0x4c54c0){console[_0x2a82f2(0x1cc)](a4_0x2afdb2[_0x2a82f2(0x209)](_0x2a82f2(0x171)));for(const _0x4d626a of _0x2b5987[_0x2a82f2(0x1f8)]){_0x4d626a[_0x2a82f2(0x1d5)]===_0x2a82f2(0x1b6)&&console[_0x2a82f2(0x1cc)](a4_0x2afdb2[_0x2a82f2(0x209)](_0x2a82f2(0x1bc)+_0x4d626a['agentName']+'\x22:\x20'+_0x4d626a['error']));}return 0x1;}const _0x54dd80=_0x2b5987[_0x2a82f2(0x218)][_0x2a82f2(0x1f8)][_0x2a82f2(0x205)]+_0x2b5987[_0x2a82f2(0x218)]['knowledgeBases'][_0x2a82f2(0x205)]+_0x2b5987[_0x2a82f2(0x218)][_0x2a82f2(0x19c)]['created']+_0x2b5987[_0x2a82f2(0x218)][_0x2a82f2(0x1b5)]['created']+_0x2b5987[_0x2a82f2(0x218)]['integrations'][_0x2a82f2(0x205)]+_0x2b5987[_0x2a82f2(0x218)][_0x2a82f2(0x1d6)][_0x2a82f2(0x205)]+_0x2b5987[_0x2a82f2(0x218)]['experimentalArtifacts'][_0x2a82f2(0x205)],_0x29bc9e=_0x2b5987[_0x2a82f2(0x218)][_0x2a82f2(0x1f8)]['updated']+_0x2b5987['counts'][_0x2a82f2(0x1ba)]['updated']+_0x2b5987['counts'][_0x2a82f2(0x19c)][_0x2a82f2(0x1a7)]+_0x2b5987['counts'][_0x2a82f2(0x1b5)]['updated']+_0x2b5987['counts']['integrations']['updated']+_0x2b5987['counts'][_0x2a82f2(0x1d6)][_0x2a82f2(0x1a7)]+_0x2b5987[_0x2a82f2(0x218)]['experimentalArtifacts'][_0x2a82f2(0x1a7)],_0x1589eb=_0x2b5987[_0x2a82f2(0x218)][_0x2a82f2(0x1f8)][_0x2a82f2(0x1ee)]+_0x2b5987[_0x2a82f2(0x218)][_0x2a82f2(0x1ba)][_0x2a82f2(0x1ee)]+_0x2b5987['counts'][_0x2a82f2(0x19c)][_0x2a82f2(0x1ee)]+_0x2b5987[_0x2a82f2(0x218)]['prompts']['unchanged']+_0x2b5987['counts'][_0x2a82f2(0x1ad)][_0x2a82f2(0x1ee)]+_0x2b5987[_0x2a82f2(0x218)][_0x2a82f2(0x1d6)][_0x2a82f2(0x1ee)]+_0x2b5987['counts'][_0x2a82f2(0x1a0)][_0x2a82f2(0x1ee)];console['log'](_0x2a82f2(0x18f)+_0x2b5987[_0x2a82f2(0x19b)]+'\x27:'),console[_0x2a82f2(0x1cc)]('\x20\x20'+a4_0x2afdb2['green']('+\x20'+_0x54dd80+_0x2a82f2(0x1ae))+'\x20|\x20'+a4_0x2afdb2['yellow']('~\x20'+_0x29bc9e+'\x20changed')+_0x2a82f2(0x174)+a4_0x2afdb2[_0x2a82f2(0x1b3)]('=\x20'+_0x1589eb+_0x2a82f2(0x215))),console['log']('\x20\x20Agents:\x20'+formatCountSummary(_0x2b5987[_0x2a82f2(0x218)][_0x2a82f2(0x1f8)])),console[_0x2a82f2(0x1cc)](_0x2a82f2(0x1c5)+formatCountSummary(_0x2b5987['counts']['knowledgeBases'])),console[_0x2a82f2(0x1cc)](_0x2a82f2(0x1f3)+formatCountSummary(_0x2b5987[_0x2a82f2(0x218)][_0x2a82f2(0x19c)])),console[_0x2a82f2(0x1cc)](_0x2a82f2(0x1d7)+formatCountSummary(_0x2b5987['counts'][_0x2a82f2(0x1b5)])),console[_0x2a82f2(0x1cc)](_0x2a82f2(0x1e2)+formatCountSummary(_0x2b5987[_0x2a82f2(0x218)]['integrations']));const _0x340176=_0x2b5987[_0x2a82f2(0x218)]['experimentalKnowledgeBases']['created']>0x0||_0x2b5987[_0x2a82f2(0x218)][_0x2a82f2(0x1d6)][_0x2a82f2(0x1a7)]>0x0||_0x2b5987[_0x2a82f2(0x218)][_0x2a82f2(0x1d6)][_0x2a82f2(0x1ee)]>0x0||_0x2b5987[_0x2a82f2(0x218)]['experimentalArtifacts'][_0x2a82f2(0x205)]>0x0||_0x2b5987[_0x2a82f2(0x218)][_0x2a82f2(0x1a0)][_0x2a82f2(0x1a7)]>0x0||_0x2b5987[_0x2a82f2(0x218)]['experimentalArtifacts'][_0x2a82f2(0x1ee)]>0x0;_0x340176&&(console['log'](_0x2a82f2(0x170)+formatCountSummary(_0x2b5987[_0x2a82f2(0x218)][_0x2a82f2(0x1d6)])),console[_0x2a82f2(0x1cc)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x2b5987[_0x2a82f2(0x218)]['experimentalArtifacts'])));console[_0x2a82f2(0x1cc)]('\x20\x20Source:\x20'+a4_0x2afdb2[_0x2a82f2(0x21b)](_0x53ce87)),displayDiffs(_0x2b5987[_0x2a82f2(0x1f8)],_0x2b5987[_0x2a82f2(0x1ba)],_0x2b5987['textKnowledgeBases'],_0x2b5987[_0x2a82f2(0x1b5)],_0x2b5987['integrations'],_0x2b5987[_0x2a82f2(0x1d6)],_0x2b5987[_0x2a82f2(0x1a0)]);if(_0x3ba0b5)return console[_0x2a82f2(0x1cc)](a4_0x2afdb2[_0x2a82f2(0x17c)](_0x2a82f2(0x193))),0x0;if(_0x54dd80===0x0&&_0x29bc9e===0x0){console[_0x2a82f2(0x1cc)](a4_0x2afdb2[_0x2a82f2(0x1f2)](_0x2a82f2(0x219)));const _0x4a5449=getLLMProjectUrl(_0x2e29d,_0x2b5987[_0x2a82f2(0x225)]);return console[_0x2a82f2(0x1cc)](_0x2a82f2(0x198)+a4_0x2afdb2[_0x2a82f2(0x21b)](_0x4a5449)),0x0;}if(!_0x4a40c1&&!_0x5ab167){if(!isInteractive())return console[_0x2a82f2(0x1b6)](a4_0x2afdb2[_0x2a82f2(0x209)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a4_0x2afdb2[_0x2a82f2(0x1b3)](_0x2a82f2(0x1c1))),0x1;const _0x529572=await confirmKey(_0x2a82f2(0x1c2)+(_0x54dd80+_0x29bc9e)+_0x2a82f2(0x226));if(!_0x529572)return console[_0x2a82f2(0x1cc)](a4_0x2afdb2[_0x2a82f2(0x17c)]('Cancelled'),_0x2a82f2(0x21a)),0x1;}const {data:_0x4d4280}=await withSpinner(_0x2a82f2(0x21d),()=>_0x38c681['llm'][_0x2a82f2(0x1db)](_0x53ce87,{'force':_0x5ab167})),_0x4656f2=_0x4d4280['counts'][_0x2a82f2(0x1f8)][_0x2a82f2(0x220)]>0x0||_0x4d4280[_0x2a82f2(0x218)][_0x2a82f2(0x1ba)]['errors']>0x0||_0x4d4280[_0x2a82f2(0x218)][_0x2a82f2(0x19c)][_0x2a82f2(0x220)]>0x0||_0x4d4280[_0x2a82f2(0x218)][_0x2a82f2(0x1b5)]['errors']>0x0;if(_0x4656f2){console['log'](a4_0x2afdb2['yellow']('\x0aProject\x20pushed\x20with\x20errors')),console[_0x2a82f2(0x1cc)](),console[_0x2a82f2(0x1cc)](a4_0x2afdb2[_0x2a82f2(0x209)](_0x2a82f2(0x1d4)));for(const _0x5e3215 of _0x4d4280[_0x2a82f2(0x1f8)]){_0x5e3215[_0x2a82f2(0x1d5)]===_0x2a82f2(0x1b6)&&console[_0x2a82f2(0x1cc)](a4_0x2afdb2[_0x2a82f2(0x209)]('\x20\x20Agent\x20\x22'+_0x5e3215['agentName']+_0x2a82f2(0x227)+_0x5e3215['error']));}for(const _0x536556 of _0x4d4280['knowledgeBases']){_0x536556[_0x2a82f2(0x1d5)]===_0x2a82f2(0x1b6)&&console[_0x2a82f2(0x1cc)](a4_0x2afdb2[_0x2a82f2(0x209)](_0x2a82f2(0x1ed)+_0x536556[_0x2a82f2(0x1f1)]+_0x2a82f2(0x227)+_0x536556[_0x2a82f2(0x1b6)]));}for(const _0x4001c9 of _0x4d4280['textKnowledgeBases']){_0x4001c9['action']===_0x2a82f2(0x1b6)&&console[_0x2a82f2(0x1cc)](a4_0x2afdb2[_0x2a82f2(0x209)](_0x2a82f2(0x1fa)+_0x4001c9[_0x2a82f2(0x1f1)]+_0x2a82f2(0x227)+_0x4001c9[_0x2a82f2(0x1b6)]));}for(const _0x1b3b43 of _0x4d4280['prompts']){_0x1b3b43[_0x2a82f2(0x1d5)]===_0x2a82f2(0x1b6)&&console[_0x2a82f2(0x1cc)](a4_0x2afdb2[_0x2a82f2(0x209)](_0x2a82f2(0x1b7)+_0x1b3b43[_0x2a82f2(0x1f1)]+_0x2a82f2(0x227)+_0x1b3b43[_0x2a82f2(0x1b6)]));}for(const _0x591e46 of _0x4d4280['integrations']){_0x591e46['action']===_0x2a82f2(0x1b6)&&console[_0x2a82f2(0x1cc)](a4_0x2afdb2[_0x2a82f2(0x209)](_0x2a82f2(0x195)+_0x591e46[_0x2a82f2(0x1f1)]+_0x2a82f2(0x227)+_0x591e46[_0x2a82f2(0x1b6)]));}return 0x1;}console['log'](a4_0x2afdb2[_0x2a82f2(0x1f2)]('\x0a✔\x20Pushed\x20'+(_0x54dd80+_0x29bc9e)+_0x2a82f2(0x20c)+_0x4d4280[_0x2a82f2(0x19b)]+'\x27'));const _0x5a49f1=getLLMProjectUrl(_0x2e29d,_0x4d4280[_0x2a82f2(0x225)]);return console['log'](_0x2a82f2(0x198)+a4_0x2afdb2[_0x2a82f2(0x21b)](_0x5a49f1)),0x0;}}
1
+ const a4_0x35fc9a=a4_0x2d4b;(function(_0x3d93a1,_0x1243b1){const _0xd96f18=a4_0x2d4b,_0x2dffa1=_0x3d93a1();while(!![]){try{const _0x1a53be=-parseInt(_0xd96f18(0x1a0))/0x1+parseInt(_0xd96f18(0x18c))/0x2+parseInt(_0xd96f18(0x19d))/0x3+parseInt(_0xd96f18(0x1ba))/0x4*(parseInt(_0xd96f18(0x1be))/0x5)+parseInt(_0xd96f18(0x1b0))/0x6*(-parseInt(_0xd96f18(0x12c))/0x7)+-parseInt(_0xd96f18(0x181))/0x8*(-parseInt(_0xd96f18(0x171))/0x9)+-parseInt(_0xd96f18(0x1b4))/0xa*(parseInt(_0xd96f18(0x172))/0xb);if(_0x1a53be===_0x1243b1)break;else _0x2dffa1['push'](_0x2dffa1['shift']());}catch(_0xe038b8){_0x2dffa1['push'](_0x2dffa1['shift']());}}}(a4_0x1dca,0x91f7c));import a4_0x2d01e3 from'chalk';import a4_0x3cc5ff 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';function a4_0x1dca(){const _0x53440f=['projectId','\x20\x20Agent\x20\x22','\x0aPush\x20','agent:clone','\x0aPush\x20summary\x20for\x20\x27','\x20new','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','\x20files?','Pulling\x20agent\x20\x22','New\x20project\x20name\x20is\x20required','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','sourceProjectName','new','integrations','pullAgent','repeat','Using\x20local\x20project:\x20','newProjectName','\x0aErrors\x20found:','cwd','log','Using\x20project\x20from\x20','New\x20project:\x20','\x20\x20Prompts:\x20','green','Agent\x20','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','Using\x20current\x20project:\x20','Cloning\x20\x22','pushProject','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','\x20|\x20','Chat:\x20','\x0a✔\x20Pushed\x20','\x20\x20Target:\x20','prompts','Would\x20pull\x20agent:\x20','action','Output\x20path:\x20','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','message','experimentalKnowledgeBases','knowledgeBases','\x20--profile\x20','dryRun','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','output','\x20errors','description','context','\x0aChanges\x20to\x20prompt\x20\x27','\x20\x20Experimental\x20Artifacts:\x20','Cancelled','Using\x20project:\x20','\x20resources\x20to\x20\x27','projectDir','\x20\x20Prompt\x20\x22','total','utf-8','arg-dir','Clone\x20\x22','Analyzing\x20changes\x20to\x20push...','733923BueJUh','7514045MGvUzX','INVALID_ARGUMENT','red','\x20\x20Agents:\x20','yes','\x22\x20to\x20a\x20different\x20profile','\x20\x20Source:\x20','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','\x20\x20Knowledge\x20Bases:\x20','\x0aWrite\x20','Analyzing\x20project\x20\x22','tdx.json','pushAgent','agent:pull','diff','104DFDHFN','Source:\x20','Failed\x20to\x20push\x20agent:\x20','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','\x0aPull\x20summary\x20for\x20\x27','\x20files\x20to\x20','\x22\x20to\x20\x22','dim','Using\x20project\x20from\x20context:\x20','isNew','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','983982lXYcNj','Status:\x20','cwd-config','site','✔\x20Context\x20set:\x20','\x22:\x20','agent.yml','Agent:\x20','Would\x20push\x20agent:\x20','Agent\x20pulled\x20successfully','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','pullProject','counts','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','execute','Pushing\x20agent\x20from\x20\x22','Pushing\x20to\x20project...','1471563PfcDJj','\x0aChanges\x20to\x20agent\x20\x27','reason','842605kinztw','errors','\x20\x20Experimental\x20Artifact\x20\x22','Errors:','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','\x20=\x20','\x20updated','projectName','Would\x20clone:','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)','parse','gray','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','MISSING_ARGUMENT','\x0aError:','\x20\x20tdx\x20agent\x20pull\x20','5698074XkWxkb','\x20\x20Integrations:\x20','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','Using\x20context\x20project:\x20','10NwdyGs','textKnowledgeBases','\x20\x20Text\x20Knowledge\x20Bases:\x20','llm_project','agents','Summary:','4160sKDHLa','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','source','yellow','4955cOhdwo','hasChanges','cyan','agentId','\x20created','New\x20project\x20ID:\x20','\x20\x20Text\x20Knowledge\x20Base\x20\x22','experimentalArtifacts','\x20successfully','no_context','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','updated','error','<new-name>','\x22...','\x20unchanged','outputDir','Project:\x20','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','\x20\x20Integration\x20\x22','Dry\x20run\x20-\x20no\x20files\x20written','push','created','Writing\x20files...','\x20changed','\x20\x20Knowledge\x20Base\x20\x22','dirname','Dry\x20run\x20-\x20no\x20changes\x20made','-\x20nothing\x20pushed','agentName','llm','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','unchanged','\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','newProjectId','join','Project\x20cloned\x20successfully','\x0aChanges:','\x20\x20tdx\x20agent\x20clone\x20agents/','\x20resources?','cloneProject','llmProject','no_local_folder','-\x20no\x20files\x20written','outputPath','7UasmLJ','force','agent:push','name'];a4_0x1dca=function(){return _0x53440f;};return a4_0x1dca();}import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext,resolveAgentPullArgs}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';function a4_0x2d4b(_0x272124,_0x22e446){_0x272124=_0x272124-0x112;const _0x1dcae0=a4_0x1dca();let _0x2d4b73=_0x1dcae0[_0x272124];return _0x2d4b73;}import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x4a7b17){const _0x29c354=a4_0x2d4b,_0x22f5eb=[];if(_0x4a7b17['total']!==undefined)_0x22f5eb[_0x29c354(0x113)](_0x4a7b17[_0x29c354(0x16c)]+'\x20total');if(_0x4a7b17[_0x29c354(0x13c)]!==undefined&&_0x4a7b17[_0x29c354(0x13c)]>0x0)_0x22f5eb[_0x29c354(0x113)](a4_0x2d01e3[_0x29c354(0x148)](_0x4a7b17[_0x29c354(0x13c)]+_0x29c354(0x135)));if(_0x4a7b17['created']!==undefined&&_0x4a7b17[_0x29c354(0x114)]>0x0)_0x22f5eb['push'](a4_0x2d01e3[_0x29c354(0x148)](_0x4a7b17[_0x29c354(0x114)]+_0x29c354(0x1c2)));if(_0x4a7b17[_0x29c354(0x1c9)]!==undefined&&_0x4a7b17[_0x29c354(0x1c9)]>0x0)_0x22f5eb['push'](a4_0x2d01e3['yellow'](_0x4a7b17['updated']+_0x29c354(0x1a6)));if(_0x4a7b17['unchanged']!==undefined&&_0x4a7b17[_0x29c354(0x11f)]>0x0)_0x22f5eb[_0x29c354(0x113)](a4_0x2d01e3[_0x29c354(0x1ab)](_0x4a7b17['unchanged']+_0x29c354(0x1cd)));if(_0x4a7b17['errors']!==undefined&&_0x4a7b17[_0x29c354(0x1a1)]>0x0)_0x22f5eb[_0x29c354(0x113)](a4_0x2d01e3['red'](_0x4a7b17[_0x29c354(0x1a1)]+_0x29c354(0x162)));return _0x22f5eb[_0x29c354(0x122)](',\x20');}function displayDiffs(_0x5561b5,_0x1d22cf,_0x489093,_0x4d5012,_0x460429,_0x3ceb5e,_0xad0a0c){const _0x239da0=a4_0x2d4b;for(const _0x206c74 of _0x5561b5){if(_0x206c74[_0x239da0(0x180)]){const _0x365128=_0x206c74[_0x239da0(0x11b)]||_0x206c74[_0x239da0(0x12f)];console[_0x239da0(0x144)](_0x239da0(0x19e)+_0x365128+'\x27:'),console[_0x239da0(0x144)]('─'[_0x239da0(0x13f)](0x3c)),console[_0x239da0(0x144)](_0x206c74[_0x239da0(0x180)]),console[_0x239da0(0x144)]('─'[_0x239da0(0x13f)](0x3c));}}for(const _0x2a9d72 of _0x1d22cf){_0x2a9d72[_0x239da0(0x180)]&&(console['log'](_0x239da0(0x160)+_0x2a9d72[_0x239da0(0x12f)]+'\x27:'),console[_0x239da0(0x144)]('─'[_0x239da0(0x13f)](0x3c)),console[_0x239da0(0x144)](_0x2a9d72[_0x239da0(0x180)]),console['log']('─'[_0x239da0(0x13f)](0x3c)));}for(const _0x13c450 of _0x489093){_0x13c450['diff']&&(console[_0x239da0(0x144)](_0x239da0(0x1b2)+_0x13c450[_0x239da0(0x12f)]+'\x27:'),console[_0x239da0(0x144)]('─'['repeat'](0x3c)),console[_0x239da0(0x144)](_0x13c450[_0x239da0(0x180)]),console[_0x239da0(0x144)]('─'[_0x239da0(0x13f)](0x3c)));}for(const _0x2b4cdf of _0x4d5012){_0x2b4cdf[_0x239da0(0x180)]&&(console[_0x239da0(0x144)](_0x239da0(0x165)+_0x2b4cdf['name']+'\x27:'),console[_0x239da0(0x144)]('─'['repeat'](0x3c)),console['log'](_0x2b4cdf[_0x239da0(0x180)]),console['log']('─'[_0x239da0(0x13f)](0x3c)));}for(const _0x5d0864 of _0x460429){_0x5d0864[_0x239da0(0x180)]&&(console[_0x239da0(0x144)]('\x0aChanges\x20to\x20integration\x20\x27'+_0x5d0864[_0x239da0(0x12f)]+'\x27:'),console[_0x239da0(0x144)]('─'[_0x239da0(0x13f)](0x3c)),console[_0x239da0(0x144)](_0x5d0864['diff']),console['log']('─'['repeat'](0x3c)));}for(const _0x76a7d of _0x3ceb5e){_0x76a7d[_0x239da0(0x180)]&&(console[_0x239da0(0x144)]('\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27'+_0x76a7d[_0x239da0(0x12f)]+'\x27:'),console[_0x239da0(0x144)]('─'[_0x239da0(0x13f)](0x3c)),console[_0x239da0(0x144)](_0x76a7d['diff']),console['log']('─'[_0x239da0(0x13f)](0x3c)));}for(const _0x155333 of _0xad0a0c){_0x155333[_0x239da0(0x180)]&&(console[_0x239da0(0x144)](_0x239da0(0x199)+_0x155333['name']+'\x27:'),console[_0x239da0(0x144)]('─'['repeat'](0x3c)),console[_0x239da0(0x144)](_0x155333['diff']),console[_0x239da0(0x144)]('─'['repeat'](0x3c)));}}export class AgentPullCommand extends BaseCommand{['name']=a4_0x35fc9a(0x17f);[a4_0x35fc9a(0x163)]=a4_0x35fc9a(0x14a);async[a4_0x35fc9a(0x19a)](_0x57bab9){const _0x1a576f=a4_0x35fc9a,{options:_0x47a8b2,args:_0xf5ab0b,tdx:_0x1c9466}=_0x57bab9,_0x3e1a07=_0xf5ab0b[0x0],_0x33b784=_0xf5ab0b[0x1],_0x3b36d4=_0x47a8b2[_0x1a576f(0x161)],_0x3d6d85=_0x47a8b2[_0x1a576f(0x15f)],_0x2ebf53=_0x47a8b2[_0x1a576f(0x12d)],_0x1b92ba=_0x47a8b2[_0x1a576f(0x176)],_0x5c37bc=_0x47a8b2[_0x1a576f(0x128)],_0x2b1844=_0x47a8b2['agent'];let _0x3157dd;if(_0x3e1a07){const _0x83e64=a4_0x3cc5ff['join'](_0x3e1a07,_0x1a576f(0x17d));if(existsSync(_0x83e64))try{const _0x4773da=JSON[_0x1a576f(0x1aa)](readFileSync(_0x83e64,_0x1a576f(0x16d)));_0x4773da[_0x1a576f(0x1b7)]&&(_0x3157dd={'llm_project':_0x4773da[_0x1a576f(0x1b7)]});}catch{}}const _0xcdca96=findAgentConfigPath(process[_0x1a576f(0x143)]());let _0x173516;if(_0xcdca96)try{const _0x220807=JSON[_0x1a576f(0x1aa)](readFileSync(_0xcdca96,_0x1a576f(0x16d)));_0x220807[_0x1a576f(0x1b7)]&&(_0x173516={'llm_project':_0x220807[_0x1a576f(0x1b7)]});}catch{}const _0x38c936=resolveAgentPullArgs({'arg':_0x3e1a07,'agentNameArg':_0x33b784,'agentFlag':_0x2b1844,'contextProject':_0x5c37bc,'argDirConfig':_0x3157dd,'cwdConfigPath':_0xcdca96||undefined,'cwdConfig':_0x173516}),{projectNameOrId:_0x39c6d7,targetAgentName:_0x48ed53,existingOutputDir:_0x2123c8,source:_0x166b37}=_0x38c936;if(_0x166b37===_0x1a576f(0x16e))console['log'](a4_0x2d01e3[_0x1a576f(0x188)](_0x1a576f(0x145)+a4_0x3cc5ff[_0x1a576f(0x122)](_0x3e1a07,_0x1a576f(0x17d))+':\x20'+_0x39c6d7));else{if(_0x166b37===_0x1a576f(0x18e))console[_0x1a576f(0x144)](a4_0x2d01e3[_0x1a576f(0x188)](_0x1a576f(0x168)+_0x39c6d7));else _0x166b37===_0x1a576f(0x164)&&console[_0x1a576f(0x144)](a4_0x2d01e3[_0x1a576f(0x188)](_0x1a576f(0x189)+_0x39c6d7));}if(!_0x39c6d7)return _0x2b1844?(console[_0x1a576f(0x144)](a4_0x2d01e3['yellow']('The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a')),console[_0x1a576f(0x144)](_0x1a576f(0x14d)),console[_0x1a576f(0x144)](_0x1a576f(0x136))):(console[_0x1a576f(0x144)](a4_0x2d01e3['yellow'](_0x1a576f(0x18b))),console[_0x1a576f(0x144)](_0x1a576f(0x1a9)),console[_0x1a576f(0x144)](_0x1a576f(0x120)),console[_0x1a576f(0x144)]('\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'),console[_0x1a576f(0x144)]('\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[_0x1a576f(0x144)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20project')),0x1;if(_0x48ed53){const {data:_0x11959b}=await withSpinner(_0x1a576f(0x138)+_0x48ed53+'\x22\x20from\x20project\x20\x22'+_0x39c6d7+_0x1a576f(0x1cc),()=>_0x1c9466[_0x1a576f(0x11c)][_0x1a576f(0x13e)](_0x39c6d7,_0x48ed53,_0x3b36d4,{'dryRun':_0x3d6d85,'force':_0x2ebf53}));if(_0x3d6d85)return console[_0x1a576f(0x144)](a4_0x2d01e3[_0x1a576f(0x1bd)](_0x1a576f(0x112))),console[_0x1a576f(0x144)](_0x1a576f(0x157)+_0x11959b[_0x1a576f(0x11b)]),console[_0x1a576f(0x144)](_0x1a576f(0x159)+_0x11959b[_0x1a576f(0x12b)]),_0x11959b[_0x1a576f(0x180)]&&(console['log'](_0x1a576f(0x124)),console['log']('─'[_0x1a576f(0x13f)](0x3c)),console[_0x1a576f(0x144)](_0x11959b['diff']),console[_0x1a576f(0x144)]('─'[_0x1a576f(0x13f)](0x3c))),0x0;return console[_0x1a576f(0x144)](a4_0x2d01e3[_0x1a576f(0x148)](_0x1a576f(0x195))),console[_0x1a576f(0x144)](_0x1a576f(0x193)+_0x11959b[_0x1a576f(0x11b)]),console[_0x1a576f(0x144)]('Output:\x20'+_0x11959b['outputPath']),console['log'](_0x1a576f(0x18d)+(_0x11959b[_0x1a576f(0x18a)]?a4_0x2d01e3['green'](_0x1a576f(0x13c)):_0x11959b[_0x1a576f(0x1bf)]?a4_0x2d01e3[_0x1a576f(0x1bd)](_0x1a576f(0x1c9)):a4_0x2d01e3['gray'](_0x1a576f(0x11f)))),0x0;}const _0x37f351=_0x2123c8||_0x3b36d4,{data:_0x364bbf}=await withSpinner(_0x1a576f(0x17c)+_0x39c6d7+_0x1a576f(0x1cc),()=>_0x1c9466['llm'][_0x1a576f(0x197)](_0x39c6d7,_0x37f351,{'dryRun':!![]})),_0x280c29=_0x364bbf[_0x1a576f(0x198)][_0x1a576f(0x1b8)][_0x1a576f(0x13c)]+_0x364bbf['counts'][_0x1a576f(0x15d)]['new']+_0x364bbf[_0x1a576f(0x198)][_0x1a576f(0x1b5)][_0x1a576f(0x13c)]+_0x364bbf['counts'][_0x1a576f(0x156)]['new']+_0x364bbf['counts'][_0x1a576f(0x13d)]['new']+_0x364bbf['counts']['experimentalKnowledgeBases'][_0x1a576f(0x13c)]+_0x364bbf[_0x1a576f(0x198)][_0x1a576f(0x1c5)]['new'],_0x26a36e=_0x364bbf[_0x1a576f(0x198)][_0x1a576f(0x1b8)][_0x1a576f(0x1c9)]+_0x364bbf['counts'][_0x1a576f(0x15d)][_0x1a576f(0x1c9)]+_0x364bbf[_0x1a576f(0x198)]['textKnowledgeBases'][_0x1a576f(0x1c9)]+_0x364bbf[_0x1a576f(0x198)][_0x1a576f(0x156)][_0x1a576f(0x1c9)]+_0x364bbf[_0x1a576f(0x198)][_0x1a576f(0x13d)][_0x1a576f(0x1c9)]+_0x364bbf[_0x1a576f(0x198)][_0x1a576f(0x15c)][_0x1a576f(0x1c9)]+_0x364bbf[_0x1a576f(0x198)][_0x1a576f(0x1c5)][_0x1a576f(0x1c9)],_0x111cac=_0x364bbf[_0x1a576f(0x198)][_0x1a576f(0x1b8)][_0x1a576f(0x11f)]+_0x364bbf[_0x1a576f(0x198)][_0x1a576f(0x15d)][_0x1a576f(0x11f)]+_0x364bbf[_0x1a576f(0x198)][_0x1a576f(0x1b5)][_0x1a576f(0x11f)]+_0x364bbf[_0x1a576f(0x198)][_0x1a576f(0x156)][_0x1a576f(0x11f)]+_0x364bbf[_0x1a576f(0x198)][_0x1a576f(0x13d)][_0x1a576f(0x11f)]+_0x364bbf[_0x1a576f(0x198)][_0x1a576f(0x15c)][_0x1a576f(0x11f)]+_0x364bbf[_0x1a576f(0x198)][_0x1a576f(0x1c5)][_0x1a576f(0x11f)];console[_0x1a576f(0x144)](_0x1a576f(0x185)+_0x364bbf[_0x1a576f(0x1a7)]+'\x27:'),console[_0x1a576f(0x144)]('\x20\x20'+a4_0x2d01e3[_0x1a576f(0x148)]('+\x20'+_0x280c29+'\x20new')+_0x1a576f(0x152)+a4_0x2d01e3[_0x1a576f(0x1bd)]('~\x20'+_0x26a36e+'\x20changed')+_0x1a576f(0x152)+a4_0x2d01e3[_0x1a576f(0x188)]('=\x20'+_0x111cac+_0x1a576f(0x1cd))),console[_0x1a576f(0x144)](_0x1a576f(0x175)+formatCountSummary(_0x364bbf[_0x1a576f(0x198)][_0x1a576f(0x1b8)])),console['log'](_0x1a576f(0x17a)+formatCountSummary(_0x364bbf[_0x1a576f(0x198)][_0x1a576f(0x15d)])),console[_0x1a576f(0x144)](_0x1a576f(0x1b6)+formatCountSummary(_0x364bbf['counts'][_0x1a576f(0x1b5)])),console['log']('\x20\x20Prompts:\x20'+formatCountSummary(_0x364bbf[_0x1a576f(0x198)][_0x1a576f(0x156)])),console[_0x1a576f(0x144)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x364bbf[_0x1a576f(0x198)][_0x1a576f(0x13d)]));const _0x3f993e=_0x364bbf['counts'][_0x1a576f(0x15c)]['total']>0x0||_0x364bbf[_0x1a576f(0x198)][_0x1a576f(0x1c5)]['total']>0x0;_0x3f993e&&(console[_0x1a576f(0x144)](_0x1a576f(0x14b)+formatCountSummary(_0x364bbf[_0x1a576f(0x198)]['experimentalKnowledgeBases'])),console[_0x1a576f(0x144)](_0x1a576f(0x166)+formatCountSummary(_0x364bbf['counts'][_0x1a576f(0x1c5)])));console[_0x1a576f(0x144)](_0x1a576f(0x155)+a4_0x2d01e3[_0x1a576f(0x1c0)](_0x364bbf[_0x1a576f(0x1ce)])),displayDiffs(_0x364bbf[_0x1a576f(0x1b8)],_0x364bbf[_0x1a576f(0x15d)],_0x364bbf['textKnowledgeBases'],_0x364bbf[_0x1a576f(0x156)],_0x364bbf[_0x1a576f(0x13d)],_0x364bbf[_0x1a576f(0x15c)],_0x364bbf[_0x1a576f(0x1c5)]);if(_0x3d6d85)return console[_0x1a576f(0x144)](a4_0x2d01e3[_0x1a576f(0x1bd)](_0x1a576f(0x13a))),0x0;if(_0x280c29===0x0&&_0x26a36e===0x0)return console[_0x1a576f(0x144)](a4_0x2d01e3['green'](_0x1a576f(0x1c8))),saveSessionContext({'llm_project':_0x364bbf['projectName']},_0x47a8b2['session']),console[_0x1a576f(0x144)](a4_0x2d01e3[_0x1a576f(0x148)](_0x1a576f(0x190)+a4_0x2d01e3[_0x1a576f(0x188)](_0x1a576f(0x1b7))+_0x1a576f(0x1a5)+a4_0x2d01e3['cyan'](_0x364bbf[_0x1a576f(0x1a7)]))),0x0;if(!_0x1b92ba&&!_0x2ebf53){if(!isInteractive())return console['error'](a4_0x2d01e3['red'](_0x1a576f(0x1ae)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a4_0x2d01e3['dim'](_0x1a576f(0x1ac))),0x1;const _0x496f7c=await confirmKey(_0x1a576f(0x17b)+(_0x280c29+_0x26a36e)+_0x1a576f(0x137));if(!_0x496f7c)return console[_0x1a576f(0x144)](a4_0x2d01e3[_0x1a576f(0x1bd)](_0x1a576f(0x167)),_0x1a576f(0x12a)),0x1;}const {data:_0x2c728d}=await withSpinner(_0x1a576f(0x115),()=>_0x1c9466[_0x1a576f(0x11c)]['pullProject'](_0x39c6d7,_0x37f351,{'force':_0x2ebf53}));return console['log'](a4_0x2d01e3[_0x1a576f(0x148)]('\x0a✔\x20Pulled\x20'+(_0x280c29+_0x26a36e)+_0x1a576f(0x186)+_0x2c728d[_0x1a576f(0x1ce)])),saveSessionContext({'llm_project':_0x2c728d[_0x1a576f(0x1a7)]},_0x47a8b2['session']),console['log'](a4_0x2d01e3[_0x1a576f(0x148)]('✔\x20Context\x20set:\x20'+a4_0x2d01e3[_0x1a576f(0x188)](_0x1a576f(0x1b7))+_0x1a576f(0x1a5)+a4_0x2d01e3['cyan'](_0x2c728d['projectName']))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x35fc9a(0x12f)]=a4_0x35fc9a(0x133);['description']=a4_0x35fc9a(0x1d0);async[a4_0x35fc9a(0x19a)](_0x1b2f53){const _0x36b020=a4_0x35fc9a,{options:_0x40423d,args:_0x185d79,tdx:_0x480cbf}=_0x1b2f53,_0x4c4909=_0x185d79[0x0],_0x556539=_0x40423d[_0x36b020(0x12f)],_0x274108=_0x40423d[_0x36b020(0x15f)],_0xb328ad=_0x40423d[_0x36b020(0x176)],_0x100f03=_0x40423d[_0x36b020(0x18f)],_0x5bcb3c=_0x40423d[_0x36b020(0x128)];let _0x8de5f3;const _0x5645cc=findAgentConfigPath(process[_0x36b020(0x143)]());if(_0x4c4909){const _0x4f6a33=a4_0x3cc5ff[_0x36b020(0x122)](_0x4c4909,_0x36b020(0x17d));existsSync(_0x4f6a33)?(_0x8de5f3=_0x4c4909,console[_0x36b020(0x144)](a4_0x2d01e3[_0x36b020(0x188)](_0x36b020(0x140)+_0x4c4909))):_0x8de5f3=_0x4c4909;}else{if(_0x5645cc)_0x8de5f3=a4_0x3cc5ff[_0x36b020(0x118)](_0x5645cc),console[_0x36b020(0x144)](a4_0x2d01e3['dim'](_0x36b020(0x14e)+_0x8de5f3));else{if(_0x5bcb3c){const _0x41806c=sanitizeForFilesystem(_0x5bcb3c);let _0x51ea21=_0x41806c,_0x234dc4=a4_0x3cc5ff['join'](process[_0x36b020(0x143)](),'agents',_0x41806c,'tdx.json');if(!existsSync(_0x234dc4)){const _0x3c8695=normalizeName(_0x5bcb3c),_0x47eb72=a4_0x3cc5ff[_0x36b020(0x122)](process['cwd'](),_0x36b020(0x1b8),_0x3c8695,_0x36b020(0x17d));existsSync(_0x47eb72)&&(_0x51ea21=_0x3c8695,_0x234dc4=_0x47eb72);}if(existsSync(_0x234dc4))_0x8de5f3=a4_0x3cc5ff[_0x36b020(0x118)](_0x234dc4),console[_0x36b020(0x144)](a4_0x2d01e3[_0x36b020(0x188)](_0x36b020(0x140)+_0x8de5f3));else{const _0x53ff77=_0x40423d['profile'];if(_0x53ff77)throw new SDKError(ErrorCode[_0x36b020(0x173)],'Cannot\x20clone\x20from\x20context\x20project\x20\x22'+_0x5bcb3c+_0x36b020(0x177),undefined,{'helpText':_0x36b020(0x196)+_0x36b020(0x11e)+(_0x36b020(0x1af)+_0x5bcb3c+'\x0a')+(_0x36b020(0x125)+_0x51ea21+'\x20--name\x20'+(_0x556539||_0x36b020(0x1cb))+_0x36b020(0x15e)+_0x53ff77)});_0x8de5f3=_0x5bcb3c,console[_0x36b020(0x144)](a4_0x2d01e3[_0x36b020(0x188)](_0x36b020(0x1b3)+_0x5bcb3c));}}}}if(!_0x8de5f3)return console[_0x36b020(0x144)](a4_0x2d01e3[_0x36b020(0x1bd)](_0x36b020(0x1a4))),console[_0x36b020(0x144)]('\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project'),console[_0x36b020(0x144)](_0x36b020(0x184)),console['log']('\x20\x20tdx\x20agent\x20clone\x20--name\x20<new-name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clone\x20from\x20context\x20(llm_project)'),console[_0x36b020(0x144)]('\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>'),0x1;if(!_0x556539)throw new SDKError(ErrorCode[_0x36b020(0x1ad)],_0x36b020(0x139),undefined,{'helpText':_0x36b020(0x14c)});if(!_0xb328ad&&!_0x274108){if(!isInteractive())return console['error'](a4_0x2d01e3[_0x36b020(0x174)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x36b020(0x1ca)](a4_0x2d01e3[_0x36b020(0x188)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x66e76a=await confirmKey(_0x36b020(0x16f)+_0x8de5f3+'\x22\x20to\x20new\x20project\x20\x22'+_0x556539+'\x22?');if(!_0x66e76a)return console[_0x36b020(0x144)](a4_0x2d01e3[_0x36b020(0x1bd)](_0x36b020(0x167))),0x1;}const {data:_0x12f4c5}=await withSpinner(_0x36b020(0x14f)+_0x8de5f3+_0x36b020(0x187)+_0x556539+_0x36b020(0x1cc),()=>_0x480cbf[_0x36b020(0x11c)][_0x36b020(0x127)](_0x8de5f3,_0x556539,{'dryRun':_0x274108}));if(_0x274108){console['log'](a4_0x2d01e3[_0x36b020(0x1bd)](_0x36b020(0x119))),console[_0x36b020(0x144)](_0x36b020(0x182)+_0x12f4c5['sourceProjectName']),console[_0x36b020(0x144)](_0x36b020(0x146)+_0x556539),console['log'](_0x36b020(0x1a8)),console[_0x36b020(0x144)](_0x36b020(0x175)+_0x12f4c5[_0x36b020(0x198)][_0x36b020(0x1b8)][_0x36b020(0x114)]),console[_0x36b020(0x144)](_0x36b020(0x17a)+_0x12f4c5['counts']['knowledgeBases']['created']),console[_0x36b020(0x144)](_0x36b020(0x147)+_0x12f4c5['counts']['prompts'][_0x36b020(0x114)]);const _0x166862=_0x12f4c5[_0x36b020(0x198)]['experimentalKnowledgeBases'][_0x36b020(0x114)]>0x0||_0x12f4c5[_0x36b020(0x198)]['experimentalArtifacts'][_0x36b020(0x114)]>0x0;return _0x166862&&(console[_0x36b020(0x144)](_0x36b020(0x14b)+_0x12f4c5[_0x36b020(0x198)][_0x36b020(0x15c)][_0x36b020(0x114)]),console[_0x36b020(0x144)](_0x36b020(0x166)+_0x12f4c5[_0x36b020(0x198)][_0x36b020(0x1c5)][_0x36b020(0x114)])),0x0;}const _0x47ba06=_0x12f4c5[_0x36b020(0x198)][_0x36b020(0x1b8)][_0x36b020(0x1a1)]>0x0||_0x12f4c5[_0x36b020(0x198)][_0x36b020(0x15d)][_0x36b020(0x1a1)]>0x0||_0x12f4c5['counts']['prompts'][_0x36b020(0x1a1)]>0x0||_0x12f4c5[_0x36b020(0x198)][_0x36b020(0x15c)]['errors']>0x0||_0x12f4c5[_0x36b020(0x198)]['experimentalArtifacts'][_0x36b020(0x1a1)]>0x0;_0x47ba06?console[_0x36b020(0x144)](a4_0x2d01e3[_0x36b020(0x1bd)]('Project\x20cloned\x20with\x20errors')):console['log'](a4_0x2d01e3[_0x36b020(0x148)](_0x36b020(0x123)));console[_0x36b020(0x144)](_0x36b020(0x182)+_0x12f4c5[_0x36b020(0x13b)]),console[_0x36b020(0x144)]('New\x20project:\x20'+_0x12f4c5[_0x36b020(0x141)]),console[_0x36b020(0x144)](_0x36b020(0x1c3)+_0x12f4c5[_0x36b020(0x121)]),console['log'](),console[_0x36b020(0x144)](_0x36b020(0x1b9)),console[_0x36b020(0x144)](_0x36b020(0x175)+formatCountSummary(_0x12f4c5[_0x36b020(0x198)][_0x36b020(0x1b8)])),console['log'](_0x36b020(0x17a)+formatCountSummary(_0x12f4c5[_0x36b020(0x198)]['knowledgeBases'])),console[_0x36b020(0x144)](_0x36b020(0x147)+formatCountSummary(_0x12f4c5[_0x36b020(0x198)]['prompts'])),console[_0x36b020(0x144)](_0x36b020(0x1b1)+formatCountSummary(_0x12f4c5['counts'][_0x36b020(0x13d)]));const _0x382d5b=_0x12f4c5[_0x36b020(0x198)]['experimentalKnowledgeBases'][_0x36b020(0x114)]>0x0||_0x12f4c5[_0x36b020(0x198)][_0x36b020(0x15c)][_0x36b020(0x1c9)]>0x0||_0x12f4c5['counts'][_0x36b020(0x15c)][_0x36b020(0x11f)]>0x0||_0x12f4c5[_0x36b020(0x198)]['experimentalArtifacts'][_0x36b020(0x114)]>0x0||_0x12f4c5[_0x36b020(0x198)][_0x36b020(0x1c5)]['updated']>0x0||_0x12f4c5['counts']['experimentalArtifacts'][_0x36b020(0x11f)]>0x0;_0x382d5b&&(console['log'](_0x36b020(0x14b)+formatCountSummary(_0x12f4c5[_0x36b020(0x198)]['experimentalKnowledgeBases'])),console['log']('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x12f4c5[_0x36b020(0x198)][_0x36b020(0x1c5)])));if(_0x47ba06){console[_0x36b020(0x144)](),console['log'](a4_0x2d01e3[_0x36b020(0x174)]('Errors:'));for(const _0x1772b0 of _0x12f4c5['agents']){_0x1772b0[_0x36b020(0x158)]===_0x36b020(0x1ca)&&console['log'](a4_0x2d01e3[_0x36b020(0x174)]('\x20\x20Agent\x20\x22'+_0x1772b0[_0x36b020(0x11b)]+_0x36b020(0x191)+_0x1772b0[_0x36b020(0x1ca)]));}for(const _0x4c8f60 of _0x12f4c5[_0x36b020(0x15d)]){_0x4c8f60[_0x36b020(0x158)]===_0x36b020(0x1ca)&&console[_0x36b020(0x144)](a4_0x2d01e3[_0x36b020(0x174)](_0x36b020(0x117)+_0x4c8f60[_0x36b020(0x12f)]+_0x36b020(0x191)+_0x4c8f60[_0x36b020(0x1ca)]));}for(const _0x156934 of _0x12f4c5[_0x36b020(0x156)]){_0x156934[_0x36b020(0x158)]==='error'&&console[_0x36b020(0x144)](a4_0x2d01e3['red'](_0x36b020(0x16b)+_0x156934['name']+_0x36b020(0x191)+_0x156934[_0x36b020(0x1ca)]));}for(const _0x444c7d of _0x12f4c5[_0x36b020(0x13d)]){_0x444c7d[_0x36b020(0x158)]==='error'&&console['log'](a4_0x2d01e3[_0x36b020(0x174)](_0x36b020(0x1d1)+_0x444c7d['name']+_0x36b020(0x191)+_0x444c7d['error']));}for(const _0x39a8cf of _0x12f4c5['experimentalKnowledgeBases']){_0x39a8cf[_0x36b020(0x158)]===_0x36b020(0x1ca)&&console[_0x36b020(0x144)](a4_0x2d01e3[_0x36b020(0x174)]('\x20\x20Experimental\x20Knowledge\x20Base\x20\x22'+_0x39a8cf[_0x36b020(0x12f)]+_0x36b020(0x191)+_0x39a8cf[_0x36b020(0x1ca)]));}for(const _0x23b6dc of _0x12f4c5[_0x36b020(0x1c5)]){_0x23b6dc['action']===_0x36b020(0x1ca)&&console[_0x36b020(0x144)](a4_0x2d01e3['red'](_0x36b020(0x1a2)+_0x23b6dc[_0x36b020(0x12f)]+_0x36b020(0x191)+_0x23b6dc[_0x36b020(0x1ca)]));}return 0x1;}console[_0x36b020(0x144)]();const _0x274e26=getLLMProjectUrl(_0x100f03,_0x12f4c5[_0x36b020(0x121)]);return console['log'](_0x36b020(0x1cf)+a4_0x2d01e3[_0x36b020(0x1c0)](_0x274e26)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x35fc9a(0x12f)]=a4_0x35fc9a(0x12e);[a4_0x35fc9a(0x163)]=a4_0x35fc9a(0x11d);async[a4_0x35fc9a(0x19a)](_0x286df6){const _0x4d5ec8=a4_0x35fc9a,{options:_0x49fb33,args:_0x3cfddd,tdx:_0x2ab5c2}=_0x286df6;let _0x509b9a=_0x3cfddd[0x0]||process[_0x4d5ec8(0x143)]();const _0x5b239b=_0x49fb33[_0x4d5ec8(0x15f)],_0x1a5dff=_0x49fb33[_0x4d5ec8(0x12d)],_0x2856ac=_0x49fb33[_0x4d5ec8(0x176)],_0x1bef77=_0x49fb33['site'],_0x2d58f2=a4_0x3cc5ff[_0x4d5ec8(0x122)](_0x509b9a,_0x4d5ec8(0x192)),_0x365786=existsSync(_0x2d58f2);if(_0x365786){const {data:_0x2e7c6e}=await withSpinner(_0x4d5ec8(0x19b)+_0x509b9a+_0x4d5ec8(0x1cc),()=>_0x2ab5c2[_0x4d5ec8(0x11c)][_0x4d5ec8(0x17e)](_0x509b9a,{'dryRun':_0x5b239b,'force':_0x1a5dff}));if(_0x5b239b)return console[_0x4d5ec8(0x144)](a4_0x2d01e3[_0x4d5ec8(0x1bd)](_0x4d5ec8(0x119))),console[_0x4d5ec8(0x144)](_0x4d5ec8(0x194)+_0x2e7c6e['agentName']),0x0;if(_0x2e7c6e[_0x4d5ec8(0x158)]===_0x4d5ec8(0x1ca))return console['log'](a4_0x2d01e3[_0x4d5ec8(0x174)](_0x4d5ec8(0x183)+_0x2e7c6e[_0x4d5ec8(0x1ca)])),0x1;console[_0x4d5ec8(0x144)](a4_0x2d01e3[_0x4d5ec8(0x148)](_0x4d5ec8(0x149)+_0x2e7c6e[_0x4d5ec8(0x158)]+_0x4d5ec8(0x1c6))),console[_0x4d5ec8(0x144)](_0x4d5ec8(0x193)+_0x2e7c6e[_0x4d5ec8(0x11b)]);if(_0x2e7c6e['agentId']&&_0x2e7c6e[_0x4d5ec8(0x130)]){const _0x515ec5=getLLMAgentChatUrl(_0x1bef77,_0x2e7c6e[_0x4d5ec8(0x130)],_0x2e7c6e[_0x4d5ec8(0x1c1)]);console[_0x4d5ec8(0x144)](_0x4d5ec8(0x153)+a4_0x2d01e3[_0x4d5ec8(0x1c0)](_0x515ec5));}return 0x0;}const _0x5a7508=_0x49fb33[_0x4d5ec8(0x128)],_0x5d9ffb=resolveProjectFromContext(_0x509b9a,_0x5a7508);if(_0x5d9ffb['found'])_0x509b9a=_0x5d9ffb[_0x4d5ec8(0x16a)],_0x5d9ffb[_0x4d5ec8(0x1bc)]===_0x4d5ec8(0x164)&&console[_0x4d5ec8(0x144)](a4_0x2d01e3['dim']('Using\x20project:\x20'+_0x509b9a));else{let _0x34247b=_0x4d5ec8(0x179);_0x5d9ffb[_0x4d5ec8(0x19f)]===_0x4d5ec8(0x129)&&(_0x34247b=_0x5d9ffb[_0x4d5ec8(0x15b)]+_0x4d5ec8(0x15a)+_0x5d9ffb[_0x4d5ec8(0x128)]+'\x27\x20to\x20create\x20the\x20folder\x20structure.');throw new SDKError(ErrorCode[_0x4d5ec8(0x173)],_0x5d9ffb['reason']===_0x4d5ec8(0x1c7)?_0x5d9ffb[_0x4d5ec8(0x15b)]:'No\x20tdx.json\x20found\x20in\x20'+_0x509b9a,undefined,{'helpText':_0x34247b});}const {data:_0x114440}=await withSpinner(_0x4d5ec8(0x170),()=>_0x2ab5c2[_0x4d5ec8(0x11c)]['pushProject'](_0x509b9a,{'dryRun':!![]})),_0x121b7f=_0x114440[_0x4d5ec8(0x198)]['agents'][_0x4d5ec8(0x1a1)]>0x0;if(_0x121b7f){console[_0x4d5ec8(0x144)](a4_0x2d01e3[_0x4d5ec8(0x174)](_0x4d5ec8(0x142)));for(const _0x568502 of _0x114440[_0x4d5ec8(0x1b8)]){_0x568502[_0x4d5ec8(0x158)]==='error'&&console[_0x4d5ec8(0x144)](a4_0x2d01e3[_0x4d5ec8(0x174)]('\x20\x20Agent\x20\x22'+_0x568502[_0x4d5ec8(0x11b)]+'\x22:\x20'+_0x568502[_0x4d5ec8(0x1ca)]));}return 0x1;}const _0x132a2f=_0x114440[_0x4d5ec8(0x198)][_0x4d5ec8(0x1b8)][_0x4d5ec8(0x114)]+_0x114440[_0x4d5ec8(0x198)][_0x4d5ec8(0x15d)][_0x4d5ec8(0x114)]+_0x114440[_0x4d5ec8(0x198)][_0x4d5ec8(0x1b5)][_0x4d5ec8(0x114)]+_0x114440[_0x4d5ec8(0x198)]['prompts'][_0x4d5ec8(0x114)]+_0x114440[_0x4d5ec8(0x198)][_0x4d5ec8(0x13d)][_0x4d5ec8(0x114)]+_0x114440[_0x4d5ec8(0x198)][_0x4d5ec8(0x15c)][_0x4d5ec8(0x114)]+_0x114440[_0x4d5ec8(0x198)][_0x4d5ec8(0x1c5)][_0x4d5ec8(0x114)],_0x275384=_0x114440['counts'][_0x4d5ec8(0x1b8)][_0x4d5ec8(0x1c9)]+_0x114440[_0x4d5ec8(0x198)][_0x4d5ec8(0x15d)][_0x4d5ec8(0x1c9)]+_0x114440[_0x4d5ec8(0x198)]['textKnowledgeBases']['updated']+_0x114440[_0x4d5ec8(0x198)][_0x4d5ec8(0x156)]['updated']+_0x114440[_0x4d5ec8(0x198)][_0x4d5ec8(0x13d)][_0x4d5ec8(0x1c9)]+_0x114440[_0x4d5ec8(0x198)][_0x4d5ec8(0x15c)][_0x4d5ec8(0x1c9)]+_0x114440[_0x4d5ec8(0x198)][_0x4d5ec8(0x1c5)]['updated'],_0x4c4c47=_0x114440[_0x4d5ec8(0x198)][_0x4d5ec8(0x1b8)][_0x4d5ec8(0x11f)]+_0x114440['counts'][_0x4d5ec8(0x15d)][_0x4d5ec8(0x11f)]+_0x114440[_0x4d5ec8(0x198)][_0x4d5ec8(0x1b5)][_0x4d5ec8(0x11f)]+_0x114440['counts'][_0x4d5ec8(0x156)][_0x4d5ec8(0x11f)]+_0x114440['counts'][_0x4d5ec8(0x13d)][_0x4d5ec8(0x11f)]+_0x114440['counts']['experimentalKnowledgeBases'][_0x4d5ec8(0x11f)]+_0x114440[_0x4d5ec8(0x198)][_0x4d5ec8(0x1c5)][_0x4d5ec8(0x11f)];console[_0x4d5ec8(0x144)](_0x4d5ec8(0x134)+_0x114440[_0x4d5ec8(0x1a7)]+'\x27:'),console['log']('\x20\x20'+a4_0x2d01e3[_0x4d5ec8(0x148)]('+\x20'+_0x132a2f+_0x4d5ec8(0x135))+_0x4d5ec8(0x152)+a4_0x2d01e3[_0x4d5ec8(0x1bd)]('~\x20'+_0x275384+_0x4d5ec8(0x116))+'\x20|\x20'+a4_0x2d01e3[_0x4d5ec8(0x188)]('=\x20'+_0x4c4c47+_0x4d5ec8(0x1cd))),console[_0x4d5ec8(0x144)]('\x20\x20Agents:\x20'+formatCountSummary(_0x114440['counts']['agents'])),console[_0x4d5ec8(0x144)](_0x4d5ec8(0x17a)+formatCountSummary(_0x114440[_0x4d5ec8(0x198)][_0x4d5ec8(0x15d)])),console['log'](_0x4d5ec8(0x1b6)+formatCountSummary(_0x114440[_0x4d5ec8(0x198)][_0x4d5ec8(0x1b5)])),console[_0x4d5ec8(0x144)](_0x4d5ec8(0x147)+formatCountSummary(_0x114440[_0x4d5ec8(0x198)][_0x4d5ec8(0x156)])),console[_0x4d5ec8(0x144)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x114440['counts'][_0x4d5ec8(0x13d)]));const _0x362812=_0x114440[_0x4d5ec8(0x198)][_0x4d5ec8(0x15c)]['created']>0x0||_0x114440[_0x4d5ec8(0x198)][_0x4d5ec8(0x15c)]['updated']>0x0||_0x114440[_0x4d5ec8(0x198)][_0x4d5ec8(0x15c)]['unchanged']>0x0||_0x114440[_0x4d5ec8(0x198)]['experimentalArtifacts'][_0x4d5ec8(0x114)]>0x0||_0x114440[_0x4d5ec8(0x198)][_0x4d5ec8(0x1c5)][_0x4d5ec8(0x1c9)]>0x0||_0x114440[_0x4d5ec8(0x198)][_0x4d5ec8(0x1c5)][_0x4d5ec8(0x11f)]>0x0;_0x362812&&(console[_0x4d5ec8(0x144)](_0x4d5ec8(0x14b)+formatCountSummary(_0x114440[_0x4d5ec8(0x198)][_0x4d5ec8(0x15c)])),console[_0x4d5ec8(0x144)](_0x4d5ec8(0x166)+formatCountSummary(_0x114440[_0x4d5ec8(0x198)][_0x4d5ec8(0x1c5)])));console['log'](_0x4d5ec8(0x178)+a4_0x2d01e3[_0x4d5ec8(0x1c0)](_0x509b9a)),displayDiffs(_0x114440[_0x4d5ec8(0x1b8)],_0x114440[_0x4d5ec8(0x15d)],_0x114440[_0x4d5ec8(0x1b5)],_0x114440[_0x4d5ec8(0x156)],_0x114440[_0x4d5ec8(0x13d)],_0x114440[_0x4d5ec8(0x15c)],_0x114440[_0x4d5ec8(0x1c5)]);if(_0x5b239b)return console[_0x4d5ec8(0x144)](a4_0x2d01e3[_0x4d5ec8(0x1bd)](_0x4d5ec8(0x151))),0x0;if(_0x132a2f===0x0&&_0x275384===0x0){console['log'](a4_0x2d01e3[_0x4d5ec8(0x148)](_0x4d5ec8(0x1bb)));const _0x28f09b=getLLMProjectUrl(_0x1bef77,_0x114440[_0x4d5ec8(0x130)]);return console[_0x4d5ec8(0x144)](_0x4d5ec8(0x1cf)+a4_0x2d01e3[_0x4d5ec8(0x1c0)](_0x28f09b)),0x0;}if(!_0x2856ac&&!_0x1a5dff){if(!isInteractive())return console[_0x4d5ec8(0x1ca)](a4_0x2d01e3[_0x4d5ec8(0x174)](_0x4d5ec8(0x1ae)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x4d5ec8(0x1ca)](a4_0x2d01e3['dim'](_0x4d5ec8(0x1ac))),0x1;const _0xaa18be=await confirmKey(_0x4d5ec8(0x132)+(_0x132a2f+_0x275384)+_0x4d5ec8(0x126));if(!_0xaa18be)return console[_0x4d5ec8(0x144)](a4_0x2d01e3[_0x4d5ec8(0x1bd)](_0x4d5ec8(0x167)),_0x4d5ec8(0x11a)),0x1;}const {data:_0x3d1446}=await withSpinner(_0x4d5ec8(0x19c),()=>_0x2ab5c2[_0x4d5ec8(0x11c)][_0x4d5ec8(0x150)](_0x509b9a,{'force':_0x1a5dff})),_0x33a583=_0x3d1446[_0x4d5ec8(0x198)][_0x4d5ec8(0x1b8)][_0x4d5ec8(0x1a1)]>0x0||_0x3d1446['counts'][_0x4d5ec8(0x15d)][_0x4d5ec8(0x1a1)]>0x0||_0x3d1446['counts']['textKnowledgeBases'][_0x4d5ec8(0x1a1)]>0x0||_0x3d1446[_0x4d5ec8(0x198)][_0x4d5ec8(0x156)][_0x4d5ec8(0x1a1)]>0x0;if(_0x33a583){console[_0x4d5ec8(0x144)](a4_0x2d01e3[_0x4d5ec8(0x1bd)]('\x0aProject\x20pushed\x20with\x20errors')),console[_0x4d5ec8(0x144)](),console[_0x4d5ec8(0x144)](a4_0x2d01e3[_0x4d5ec8(0x174)](_0x4d5ec8(0x1a3)));for(const _0x1dfa7e of _0x3d1446[_0x4d5ec8(0x1b8)]){_0x1dfa7e[_0x4d5ec8(0x158)]===_0x4d5ec8(0x1ca)&&console[_0x4d5ec8(0x144)](a4_0x2d01e3[_0x4d5ec8(0x174)](_0x4d5ec8(0x131)+_0x1dfa7e['agentName']+_0x4d5ec8(0x191)+_0x1dfa7e[_0x4d5ec8(0x1ca)]));}for(const _0x56cf2d of _0x3d1446[_0x4d5ec8(0x15d)]){_0x56cf2d[_0x4d5ec8(0x158)]===_0x4d5ec8(0x1ca)&&console[_0x4d5ec8(0x144)](a4_0x2d01e3[_0x4d5ec8(0x174)](_0x4d5ec8(0x117)+_0x56cf2d['name']+_0x4d5ec8(0x191)+_0x56cf2d['error']));}for(const _0x378db4 of _0x3d1446[_0x4d5ec8(0x1b5)]){_0x378db4['action']===_0x4d5ec8(0x1ca)&&console[_0x4d5ec8(0x144)](a4_0x2d01e3[_0x4d5ec8(0x174)](_0x4d5ec8(0x1c4)+_0x378db4[_0x4d5ec8(0x12f)]+_0x4d5ec8(0x191)+_0x378db4[_0x4d5ec8(0x1ca)]));}for(const _0x49d927 of _0x3d1446[_0x4d5ec8(0x156)]){_0x49d927[_0x4d5ec8(0x158)]===_0x4d5ec8(0x1ca)&&console[_0x4d5ec8(0x144)](a4_0x2d01e3[_0x4d5ec8(0x174)](_0x4d5ec8(0x16b)+_0x49d927[_0x4d5ec8(0x12f)]+_0x4d5ec8(0x191)+_0x49d927[_0x4d5ec8(0x1ca)]));}for(const _0x29b53c of _0x3d1446[_0x4d5ec8(0x13d)]){_0x29b53c[_0x4d5ec8(0x158)]===_0x4d5ec8(0x1ca)&&console[_0x4d5ec8(0x144)](a4_0x2d01e3['red'](_0x4d5ec8(0x1d1)+_0x29b53c[_0x4d5ec8(0x12f)]+_0x4d5ec8(0x191)+_0x29b53c[_0x4d5ec8(0x1ca)]));}return 0x1;}console[_0x4d5ec8(0x144)](a4_0x2d01e3[_0x4d5ec8(0x148)](_0x4d5ec8(0x154)+(_0x132a2f+_0x275384)+_0x4d5ec8(0x169)+_0x3d1446[_0x4d5ec8(0x1a7)]+'\x27'));const _0x4774ff=getLLMProjectUrl(_0x1bef77,_0x3d1446[_0x4d5ec8(0x130)]);return console['log']('Project:\x20'+a4_0x2d01e3['cyan'](_0x4774ff)),0x0;}}
@@ -1 +1 @@
1
- const a5_0x5aaed0=a5_0x17eb;function a5_0x17eb(_0x3f7db3,_0x127449){_0x3f7db3=_0x3f7db3-0xc2;const _0x4897cf=a5_0x4897();let _0x17eb25=_0x4897cf[_0x3f7db3];return _0x17eb25;}(function(_0x5dcd9e,_0x59e098){const _0x4b1646=a5_0x17eb,_0x23c717=_0x5dcd9e();while(!![]){try{const _0x361da2=parseInt(_0x4b1646(0x147))/0x1+parseInt(_0x4b1646(0x13b))/0x2+parseInt(_0x4b1646(0x133))/0x3*(-parseInt(_0x4b1646(0xd3))/0x4)+parseInt(_0x4b1646(0x116))/0x5*(-parseInt(_0x4b1646(0x11b))/0x6)+-parseInt(_0x4b1646(0x11f))/0x7+-parseInt(_0x4b1646(0xf8))/0x8*(parseInt(_0x4b1646(0xe4))/0x9)+parseInt(_0x4b1646(0x10e))/0xa;if(_0x361da2===_0x59e098)break;else _0x23c717['push'](_0x23c717['shift']());}catch(_0x1680b4){_0x23c717['push'](_0x23c717['shift']());}}}(a5_0x4897,0x922b8));import*as a5_0x4ac7af from'node:fs';function a5_0x4897(){const _0x2f8670=['No\x20tests\x20found\x20matching:\x20','Cached\x20run\x20is\x20from\x20site\x20\x22','llmProject','source','site','149049DgerEa','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','writeFileSync','dim','\x20\x20Project:\x20','Tests\x20found:\x20','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','Project\x20path:\x20','\x20\x20Evaluating...\x20','yellow','llm','...\x20','Duration:\x20','green','multiple_agents','round','tests','has','Error\x20writing\x20output\x20file:\x20','table','72mQrYpp','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','stop','\x22,\x20but\x20current\x20site\x20is\x20\x22','find','Running\x20agent\x20tests...','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','Re-evaluation\x20Summary','toISOString','\x20\x20Conversation:\x20','PASS','description','Errors:\x20\x20\x20','Output\x20written\x20to:\x20','testName','\x20\x20tdx\x20agent\x20test\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20(requires\x20context\x20or\x20tdx.json)','Available\x20tags:\x20','start','Failed\x20Tests:','reason','includes','resolve','16529370Szjrfk','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','push','projectName','length','conversations','add','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','4429810vcsBqK','Test\x20Summary','agent','red','rounds','6zEEZnY','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','Running:\x20','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','4528993ukyycu','No\x20tests\x20have\x20tags\x20defined.','map','filter','message','\x20\x20Site:\x20','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','✓\x20PASS:\x20','reeval','status','FAIL','tsv','testYmlPath','now','isSpinning','✗\x20ERROR:\x20Project\x20not\x20found:\x20','utf-8','Round\x201/','\x20(cached)','333UQxRGR','no_tests','join','Total:\x20\x20\x20\x20','404','forEach','no_context','agentName','2123136SVzaYx','Using\x20agent:\x20','Error:\x20No\x20previous\x20test\x20run\x20found.','...','Passed:\x20\x20\x20','output','no_local_folder','name','trim','resolveProjectId','Agent:\x20','conversation_url','339776OcJAgT','size','\x22:\x20','white','some','Run\x20tests\x20for\x20an\x20LLM\x20agent','✗\x20ERROR:\x20','✗\x20FAIL:\x20','\x20-\x20','\x27\x20to\x20create\x20the\x20folder\x20structure.','Test\x20Configuration:','found','log','Site:\x20',':\x20Sending\x20user\x20input...','executeReeval','verbose','Re-evaluating\x20','repeat','Conversation\x20URL:\x20','toLowerCase','Either\x20switch\x20to\x20the\x20\x22','projectDir','agent:test','not\x20found','\x20\x20Round\x20','text','Executing\x20new\x20tests...','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','⚠\x20SKIPPED:\x20','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','ERROR','context','existsSync','27876rMdisE','split','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','Available\x20tests:\x20','Round\x20','json','jsonl','substring','Running\x20test:\x20','tags','Evaluating\x20response...','cyan'];a5_0x4897=function(){return _0x2f8670;};return a5_0x4897();}import*as a5_0xfa872f from'node:path';import a5_0xf3ebf8 from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{['name']=a5_0x5aaed0(0xc8);[a5_0x5aaed0(0x103)]=a5_0x5aaed0(0x14c);async['execute'](_0x38c09f){const _0x29c1ab=a5_0x5aaed0,{options:_0x258cde,args:_0x486dfc,tdx:_0xea43a7}=_0x38c09f,_0x330ed3=_0x486dfc[0x0]||'.',_0x10de85=_0x258cde['dryRun'],_0x1ba5d4=_0x258cde,_0x2bc3bc=_0x1ba5d4['eval']===![],_0x23781a=_0x1ba5d4[_0x29c1ab(0x128)],_0x23f75d=_0x1ba5d4[_0x29c1ab(0x142)],_0xcbce34=_0x1ba5d4[_0x29c1ab(0xdc)],_0xe6215d=_0x258cde[_0x29c1ab(0xe3)],_0x2e037d=_0x1ba5d4[_0x29c1ab(0x140)];if(_0x23781a&&_0x2bc3bc)return console[_0x29c1ab(0x153)](a5_0xf3ebf8['red'](_0x29c1ab(0x126))),0x1;let _0x17e24f=_0x29c1ab(0xf7);if(_0x1ba5d4[_0x29c1ab(0xd8)])_0x17e24f=_0x29c1ab(0xd8);else{if(_0x1ba5d4[_0x29c1ab(0xd9)])_0x17e24f=_0x29c1ab(0xd9);else{if(_0x1ba5d4[_0x29c1ab(0x12b)])_0x17e24f=_0x29c1ab(0x12b);else{if(_0x1ba5d4['table'])_0x17e24f=_0x29c1ab(0xf7);}}}const _0x388818=_0x1ba5d4[_0x29c1ab(0xe1)];let _0x3b9a7c=_0x330ed3;const _0xff10a6=a5_0x4ac7af[_0x29c1ab(0xd2)](_0x330ed3),_0x543809=_0x330ed3==='.';if(!_0xff10a6||_0x543809){const _0x4fee76=resolveProjectFromContext(_0x330ed3,_0x388818,{'requireFile':'test.yml'});if(_0x4fee76[_0x29c1ab(0x152)])_0x3b9a7c=_0x4fee76[_0x29c1ab(0xc7)],_0x4fee76[_0x29c1ab(0xe2)]===_0x29c1ab(0xd1)&&console[_0x29c1ab(0x153)](a5_0xf3ebf8[_0x29c1ab(0xe7)](_0x29c1ab(0x13c)+_0x3b9a7c));else switch(_0x4fee76[_0x29c1ab(0x10b)]){case _0x29c1ab(0x139):console[_0x29c1ab(0x153)](a5_0xf3ebf8['yellow'](_0x4fee76[_0x29c1ab(0x123)])),console[_0x29c1ab(0x153)](),console['log']('Usage:'),console['log']('\x20\x20tdx\x20agent\x20test\x20<path>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20from\x20path'),console[_0x29c1ab(0x153)](_0x29c1ab(0x107)),console[_0x29c1ab(0x153)](),console['log'](_0x29c1ab(0xea));return 0x1;case _0x29c1ab(0x141):console['log'](a5_0xf3ebf8[_0x29c1ab(0xed)](_0x4fee76[_0x29c1ab(0x123)])),console[_0x29c1ab(0x153)](),console[_0x29c1ab(0x153)]('Run\x20\x27tdx\x20agent\x20pull\x20'+_0x4fee76[_0x29c1ab(0xe1)]+_0x29c1ab(0x150));return 0x1;case _0x29c1ab(0xf2):{const _0x4347d3=a5_0xfa872f['basename'](_0x4fee76[_0x29c1ab(0xc7)]);console['log'](a5_0xf3ebf8['yellow'](_0x29c1ab(0xcf)+_0x4fee76['llmProject']+'\x22:'));for(const _0x2d7727 of _0x4fee76['agentDirs']){console[_0x29c1ab(0x153)]('\x20\x20-\x20'+_0x2d7727);}return console[_0x29c1ab(0x153)](),console[_0x29c1ab(0x153)](_0x29c1ab(0xd5)+_0x4347d3+'/<agent-name>'),0x1;}case _0x29c1ab(0x134):console[_0x29c1ab(0x153)](a5_0xf3ebf8[_0x29c1ab(0xed)](_0x29c1ab(0x125)+_0x4fee76[_0x29c1ab(0xe1)]+'\x22.')),console['log'](a5_0xf3ebf8[_0x29c1ab(0xe7)](_0x29c1ab(0xeb)+_0x4fee76['projectDir'])),console[_0x29c1ab(0x153)](),console['log'](_0x29c1ab(0x11e));return 0x1;}}const {definition:_0x15d50f,agentInfo:_0x4a28b4}=parseTestFile(_0x3b9a7c);let _0x54f0d4=_0x15d50f[_0x29c1ab(0xf4)];if(_0x23f75d){const _0x2a9cd7=_0x23f75d[_0x29c1ab(0xd4)](',')['map'](_0x379001=>_0x379001[_0x29c1ab(0x143)]());_0x54f0d4=_0x15d50f[_0x29c1ab(0xf4)][_0x29c1ab(0x122)](_0x50aefc=>_0x2a9cd7[_0x29c1ab(0x10c)](_0x50aefc[_0x29c1ab(0x142)]));if(_0x54f0d4[_0x29c1ab(0x112)]===0x0)return console[_0x29c1ab(0x153)](a5_0xf3ebf8[_0x29c1ab(0xed)](_0x29c1ab(0xdf)+_0x23f75d)),console[_0x29c1ab(0x153)](a5_0xf3ebf8['dim'](_0x29c1ab(0xd6)+_0x15d50f[_0x29c1ab(0xf4)][_0x29c1ab(0x121)](_0x366d58=>_0x366d58[_0x29c1ab(0x142)])[_0x29c1ab(0x135)](',\x20'))),0x1;}if(_0xcbce34){const _0x49f2d8=_0xcbce34[_0x29c1ab(0xd4)](',')[_0x29c1ab(0x121)](_0x33f54f=>_0x33f54f[_0x29c1ab(0x143)]()[_0x29c1ab(0xc5)]());_0x54f0d4=_0x54f0d4[_0x29c1ab(0x122)](_0x48a535=>_0x48a535[_0x29c1ab(0xdc)]?.[_0x29c1ab(0x14b)](_0x123dac=>_0x49f2d8[_0x29c1ab(0x10c)](_0x123dac[_0x29c1ab(0xc5)]())));if(_0x54f0d4[_0x29c1ab(0x112)]===0x0){console[_0x29c1ab(0x153)](a5_0xf3ebf8[_0x29c1ab(0xed)]('No\x20tests\x20found\x20with\x20tags:\x20'+_0xcbce34));const _0x491538=new Set();return _0x15d50f[_0x29c1ab(0xf4)][_0x29c1ab(0x138)](_0x1f36e8=>_0x1f36e8['tags']?.[_0x29c1ab(0x138)](_0x2a7084=>_0x491538[_0x29c1ab(0x114)](_0x2a7084))),_0x491538[_0x29c1ab(0x148)]>0x0?console['log'](a5_0xf3ebf8[_0x29c1ab(0xe7)](_0x29c1ab(0x108)+[..._0x491538][_0x29c1ab(0x135)](',\x20'))):console[_0x29c1ab(0x153)](a5_0xf3ebf8[_0x29c1ab(0xe7)](_0x29c1ab(0x120))),0x1;}}if(_0x23781a)return this[_0x29c1ab(0x156)](_0x38c09f,{'definition':{'tests':_0x54f0d4},'agentInfo':_0x4a28b4,'outputFormat':_0x17e24f,'outputFile':_0x2e037d,'testNames':_0x23f75d});if(_0x10de85){console['log'](a5_0xf3ebf8[_0x29c1ab(0xde)](_0x29c1ab(0x151))),console[_0x29c1ab(0x153)](_0x29c1ab(0x124)+a5_0xf3ebf8[_0x29c1ab(0x14a)](_0xe6215d)),console[_0x29c1ab(0x153)](_0x29c1ab(0xe8)+a5_0xf3ebf8[_0x29c1ab(0x14a)](_0x4a28b4['projectName'])),console['log']('\x20\x20Agent:\x20'+a5_0xf3ebf8[_0x29c1ab(0x14a)](_0x4a28b4[_0x29c1ab(0x13a)])),console[_0x29c1ab(0x153)](),console[_0x29c1ab(0x153)](_0x29c1ab(0xe9)+a5_0xf3ebf8['white'](_0x54f0d4['length']));for(let _0x41e402=0x0;_0x41e402<_0x54f0d4[_0x29c1ab(0x112)];_0x41e402++){const _0x2f39a4=_0x54f0d4[_0x41e402],_0x29706d=_0x2f39a4[_0x29c1ab(0x11a)][_0x29c1ab(0x112)]===0x1?_0x29c1ab(0xf3):_0x29c1ab(0x11a),_0x2e4bee=_0x2f39a4['tags']?.[_0x29c1ab(0x112)]?'\x20['+_0x2f39a4['tags'][_0x29c1ab(0x135)](',\x20')+']':'';console[_0x29c1ab(0x153)]('\x20\x20'+(_0x41e402+0x1)+'.\x20'+a5_0xf3ebf8[_0x29c1ab(0x14a)](_0x2f39a4[_0x29c1ab(0x142)])+'\x20('+_0x2f39a4[_0x29c1ab(0x11a)][_0x29c1ab(0x112)]+'\x20'+_0x29706d+')'+a5_0xf3ebf8[_0x29c1ab(0xe7)](_0x2e4bee));}return 0x0;}let _0x12b2e2,_0x184f55;try{_0x12b2e2=await _0xea43a7[_0x29c1ab(0xee)][_0x29c1ab(0x144)](_0x4a28b4[_0x29c1ab(0x111)]);}catch(_0x4d3810){const _0x1747e=_0x4d3810 instanceof Error?_0x4d3810[_0x29c1ab(0x123)]:String(_0x4d3810);return _0x1747e[_0x29c1ab(0x10c)](_0x29c1ab(0x137))||_0x1747e[_0x29c1ab(0xc5)]()[_0x29c1ab(0x10c)]('not\x20found')?console[_0x29c1ab(0x153)](a5_0xf3ebf8[_0x29c1ab(0x119)](_0x29c1ab(0x12f)+_0x4a28b4[_0x29c1ab(0x111)])):console[_0x29c1ab(0x153)](a5_0xf3ebf8[_0x29c1ab(0x119)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22'+_0x4a28b4[_0x29c1ab(0x111)]+_0x29c1ab(0x149)+_0x1747e)),0x1;}try{_0x184f55=await _0xea43a7[_0x29c1ab(0xee)]['resolveAgentId'](_0x4a28b4['agentName'],_0x12b2e2);}catch(_0x276c61){const _0x26049b=_0x276c61 instanceof Error?_0x276c61[_0x29c1ab(0x123)]:String(_0x276c61);return _0x26049b[_0x29c1ab(0x10c)](_0x29c1ab(0x137))||_0x26049b[_0x29c1ab(0xc5)]()['includes'](_0x29c1ab(0xc9))?console[_0x29c1ab(0x153)](a5_0xf3ebf8[_0x29c1ab(0x119)]('✗\x20ERROR:\x20Agent\x20not\x20found:\x20'+_0x4a28b4[_0x29c1ab(0x13a)])):console['log'](a5_0xf3ebf8[_0x29c1ab(0x119)](_0x29c1ab(0x10f)+_0x4a28b4['agentName']+'\x22:\x20'+_0x26049b)),0x1;}let _0x4ed7c1;if(!_0x2bc3bc)try{_0x4ed7c1=await setupEvaluatorAgent(_0xea43a7[_0x29c1ab(0xee)],_0x258cde[_0x29c1ab(0x157)]);}catch(_0x2efb9b){const _0x5408dc=_0x2efb9b instanceof Error?_0x2efb9b[_0x29c1ab(0x123)]:String(_0x2efb9b);return console['log'](a5_0xf3ebf8['red'](_0x29c1ab(0xf9)+_0x5408dc)),0x1;}console[_0x29c1ab(0x153)](a5_0xf3ebf8[_0x29c1ab(0xde)](_0x29c1ab(0xfd))),console[_0x29c1ab(0x153)](_0x29c1ab(0x154)+a5_0xf3ebf8[_0x29c1ab(0x14a)](_0xe6215d)),console[_0x29c1ab(0x153)](_0x29c1ab(0x145)+a5_0xf3ebf8['white'](_0x4a28b4[_0x29c1ab(0x111)]+'/'+_0x4a28b4['agentName'])),console['log']();const _0x1ead77=[],_0x34b377=[],_0x5030b1=Date[_0x29c1ab(0x12d)]();for(let _0x16509a=0x0;_0x16509a<_0x54f0d4['length'];_0x16509a++){const _0x1a14cb=_0x54f0d4[_0x16509a];_0x54f0d4[_0x29c1ab(0x112)]>0x1?console[_0x29c1ab(0x153)]('Test\x20'+(_0x16509a+0x1)+'/'+_0x54f0d4['length']+':\x20'+a5_0xf3ebf8[_0x29c1ab(0x14a)](_0x1a14cb[_0x29c1ab(0x142)])):console[_0x29c1ab(0x153)](_0x29c1ab(0xdb)+a5_0xf3ebf8['white'](_0x1a14cb[_0x29c1ab(0x142)]));const _0x48a025=createCommandSpinner(_0x29c1ab(0x131)+_0x1a14cb[_0x29c1ab(0x11a)][_0x29c1ab(0x112)]+_0x29c1ab(0x155));_0x48a025[_0x29c1ab(0x109)]();try{const {result:_0x2d9575,conversation:_0x1b02c3}=await runTest(_0xea43a7[_0x29c1ab(0xee)],_0x1a14cb,{'agentId':_0x184f55,'projectId':_0x12b2e2,'site':_0xe6215d,'noEval':_0x2bc3bc,'evaluatorId':_0x4ed7c1,'onRoundStart':(_0x37350e,_0x5cbf38)=>{const _0x129772=_0x29c1ab;_0x48a025[_0x129772(0xcb)]='Round\x20'+(_0x37350e+0x1)+'/'+_0x5cbf38+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x54471a,_0x3662f2,_0x431474)=>{const _0x3600db=_0x29c1ab,_0x357bba=formatElapsed(_0x3662f2);_0x431474?console['log'](_0x3600db(0xca)+(_0x54471a+0x1)+'/'+_0x1a14cb['rounds'][_0x3600db(0x112)]+_0x3600db(0xef)+a5_0xf3ebf8[_0x3600db(0xf1)]('✓')+'\x20('+_0x357bba+')'):console[_0x3600db(0x153)]('\x20\x20Round\x20'+(_0x54471a+0x1)+'/'+_0x1a14cb[_0x3600db(0x11a)][_0x3600db(0x112)]+_0x3600db(0xef)+a5_0xf3ebf8[_0x3600db(0x119)]('✗'));},'onEvaluationStart':()=>{const _0x292368=_0x29c1ab;_0x48a025[_0x292368(0xcb)]='Evaluating\x20response...';},'onEvaluationComplete':_0x8871cd=>{const _0x5e554a=_0x29c1ab,_0x328310=formatElapsed(_0x8871cd);console[_0x5e554a(0x153)](_0x5e554a(0xec)+a5_0xf3ebf8[_0x5e554a(0xf1)]('✓')+'\x20('+_0x328310+')');}});_0x48a025[_0x29c1ab(0xfa)](),_0x1ead77[_0x29c1ab(0x110)](_0x2d9575),_0x34b377['push'](_0x1b02c3);if(_0x2d9575['status']===_0x29c1ab(0x102))console[_0x29c1ab(0x153)](a5_0xf3ebf8[_0x29c1ab(0xf1)](_0x29c1ab(0x127)+_0x2d9575[_0x29c1ab(0x10b)]));else _0x2d9575['status']===_0x29c1ab(0x12a)?console['log'](a5_0xf3ebf8[_0x29c1ab(0x119)](_0x29c1ab(0x14e)+_0x2d9575[_0x29c1ab(0x10b)])):console[_0x29c1ab(0x153)](a5_0xf3ebf8['red'](_0x29c1ab(0x14d)+_0x2d9575[_0x29c1ab(0x10b)]));_0x2d9575['conversation_url']&&console['log'](a5_0xf3ebf8[_0x29c1ab(0xe7)](_0x29c1ab(0xc4)+_0x2d9575[_0x29c1ab(0x146)])),console[_0x29c1ab(0x153)]();}catch(_0x2767a4){_0x48a025['stop']();const _0x2f2487=_0x2767a4 instanceof Error?_0x2767a4[_0x29c1ab(0x123)]:String(_0x2767a4);console[_0x29c1ab(0x153)](a5_0xf3ebf8['red']('✗\x20ERROR:\x20'+_0x2f2487)),console[_0x29c1ab(0x153)](),_0x1ead77['push']({'name':_0x1a14cb[_0x29c1ab(0x142)],'status':'ERROR','reason':_0x2f2487,'timestamp':new Date()[_0x29c1ab(0x100)](),'duration_ms':0x0});}}const _0x5d25e0=Date[_0x29c1ab(0x12d)]()-_0x5030b1,_0x41056b=_0x1ead77[_0x29c1ab(0x122)](_0xf4fedb=>_0xf4fedb[_0x29c1ab(0x129)]===_0x29c1ab(0x102))[_0x29c1ab(0x112)],_0x43a335=_0x1ead77[_0x29c1ab(0x122)](_0x5528f2=>_0x5528f2[_0x29c1ab(0x129)]===_0x29c1ab(0x12a))[_0x29c1ab(0x112)],_0x5a3f43=_0x1ead77[_0x29c1ab(0x122)](_0x5c6dbf=>_0x5c6dbf[_0x29c1ab(0x129)]==='ERROR')['length'];console[_0x29c1ab(0x153)]('━'[_0x29c1ab(0xc3)](0x3c)),console[_0x29c1ab(0x153)](_0x29c1ab(0x117)),console[_0x29c1ab(0x153)]('━'['repeat'](0x3c)),console[_0x29c1ab(0x153)](_0x29c1ab(0x136)+_0x1ead77[_0x29c1ab(0x112)]),console[_0x29c1ab(0x153)](_0x29c1ab(0x13f)+a5_0xf3ebf8['green'](_0x41056b)),console['log']('Failed:\x20\x20\x20'+a5_0xf3ebf8[_0x29c1ab(0x119)](_0x43a335));_0x5a3f43>0x0&&console['log']('Errors:\x20\x20\x20'+a5_0xf3ebf8['red'](_0x5a3f43));console[_0x29c1ab(0x153)](_0x29c1ab(0xf0)+formatElapsed(_0x5d25e0)),console[_0x29c1ab(0x153)]('━'[_0x29c1ab(0xc3)](0x3c));const _0x2c2b72=_0x1ead77[_0x29c1ab(0x122)](_0x49f222=>_0x49f222['status']!==_0x29c1ab(0x102));if(_0x2c2b72[_0x29c1ab(0x112)]>0x0){console[_0x29c1ab(0x153)](),console[_0x29c1ab(0x153)](_0x29c1ab(0x10a));for(const _0x228942 of _0x2c2b72){const _0x1db3bc=a5_0xf3ebf8[_0x29c1ab(0x119)]('✗'),_0x2903af=_0x228942['reason'][_0x29c1ab(0x112)]>0x32?_0x228942['reason'][_0x29c1ab(0xda)](0x0,0x32)+_0x29c1ab(0x13e):_0x228942['reason'];console[_0x29c1ab(0x153)]('\x20\x20'+_0x1db3bc+'\x20'+_0x228942[_0x29c1ab(0x142)]+':\x20'+_0x2903af);}}const _0x43f227={'summary':{'total':_0x1ead77[_0x29c1ab(0x112)],'passed':_0x41056b,'failed':_0x43a335,'errors':_0x5a3f43>0x0?_0x5a3f43:undefined,'duration_ms':_0x5d25e0},'tests':_0x1ead77,'agent':{'project':_0x4a28b4[_0x29c1ab(0x111)],'name':_0x4a28b4[_0x29c1ab(0x13a)],'site':_0xe6215d},'timestamp':new Date(_0x5030b1)[_0x29c1ab(0x100)]()};try{const _0x547258=buildCachedTestRun(_0x34b377,{'site':_0xe6215d,'projectId':_0x12b2e2,'projectName':_0x4a28b4[_0x29c1ab(0x111)],'agentId':_0x184f55,'agentName':_0x4a28b4[_0x29c1ab(0x13a)],'testYmlPath':a5_0xfa872f[_0x29c1ab(0x10d)](_0x4a28b4[_0x29c1ab(0x12c)])});saveLastTestRun(_0x547258);}catch{}if(_0x17e24f!==_0x29c1ab(0xf7)||_0x2e037d){const _0x99d6be=formatResults(_0x43f227,_0x17e24f);if(_0x2e037d)try{a5_0x4ac7af[_0x29c1ab(0xe6)](_0x2e037d,_0x99d6be,_0x29c1ab(0x130)),console[_0x29c1ab(0x153)](),console[_0x29c1ab(0x153)](a5_0xf3ebf8['dim']('Output\x20written\x20to:\x20'+_0x2e037d));}catch(_0x2f99f7){return console['log'](),console[_0x29c1ab(0x153)](a5_0xf3ebf8[_0x29c1ab(0x119)](_0x29c1ab(0xf6)+_0x2f99f7)),0x1;}else console[_0x29c1ab(0x153)](),console[_0x29c1ab(0x153)](_0x99d6be);}return _0x2c2b72[_0x29c1ab(0x112)]>0x0?0x1:0x0;}async[a5_0x5aaed0(0x156)](_0x427967,_0x299ffd){const _0x4d727c=a5_0x5aaed0,{options:_0x387231,tdx:_0x4e84d2}=_0x427967,{definition:_0x5067a3,agentInfo:_0x2086d0,outputFormat:_0x46cb53,outputFile:_0x4b7a8f}=_0x299ffd,_0x46234=_0x387231[_0x4d727c(0xe3)],_0x5ebb5a=loadLastTestRun();if(!_0x5ebb5a)return console[_0x4d727c(0x153)](a5_0xf3ebf8[_0x4d727c(0x119)](_0x4d727c(0x13d))),console[_0x4d727c(0x153)](a5_0xf3ebf8['dim'](_0x4d727c(0x115))),0x1;if(_0x5ebb5a[_0x4d727c(0x118)]['agentName']!==_0x2086d0['agentName'])return console['log'](a5_0xf3ebf8[_0x4d727c(0x119)](_0x4d727c(0x11c)+_0x5ebb5a[_0x4d727c(0x118)][_0x4d727c(0x13a)]+'\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22'+_0x2086d0[_0x4d727c(0x13a)]+'\x22.')),console[_0x4d727c(0x153)](a5_0xf3ebf8[_0x4d727c(0xe7)](_0x4d727c(0xcd))),0x1;const _0x389f21=new Set(_0x5ebb5a[_0x4d727c(0x113)][_0x4d727c(0x121)](_0x16db6e=>_0x16db6e[_0x4d727c(0x106)])),_0x35ca75=_0x5067a3[_0x4d727c(0xf4)]['filter'](_0x304207=>!_0x389f21[_0x4d727c(0xf5)](_0x304207[_0x4d727c(0x142)]));if(_0x35ca75['length']>0x0&&_0x5ebb5a[_0x4d727c(0xe3)]!==_0x46234)return console[_0x4d727c(0x153)](a5_0xf3ebf8[_0x4d727c(0x119)](_0x4d727c(0xe5))),console[_0x4d727c(0x153)](a5_0xf3ebf8[_0x4d727c(0xe7)](_0x4d727c(0xe0)+_0x5ebb5a[_0x4d727c(0xe3)]+_0x4d727c(0xfb)+_0x46234+'\x22.')),console[_0x4d727c(0x153)](a5_0xf3ebf8['dim'](_0x4d727c(0xc6)+_0x5ebb5a[_0x4d727c(0xe3)]+'\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.')),0x1;const _0x56a4e5=_0x5067a3[_0x4d727c(0xf4)][_0x4d727c(0x122)](_0x4f8ac1=>_0x389f21['has'](_0x4f8ac1[_0x4d727c(0x142)])),_0x4c6191=_0x35ca75;let _0x5207cf;try{_0x5207cf=await setupEvaluatorAgent(_0x4e84d2[_0x4d727c(0xee)],_0x387231[_0x4d727c(0x157)]);}catch(_0x3c0ec9){const _0x3bfafc=_0x3c0ec9 instanceof Error?_0x3c0ec9[_0x4d727c(0x123)]:String(_0x3c0ec9);return console[_0x4d727c(0x153)](a5_0xf3ebf8[_0x4d727c(0x119)](_0x4d727c(0xf9)+_0x3bfafc)),0x1;}console['log'](a5_0xf3ebf8[_0x4d727c(0xde)]('Re-evaluating\x20cached\x20test\x20run...')),console[_0x4d727c(0x153)]('Cached\x20run\x20from:\x20'+a5_0xf3ebf8[_0x4d727c(0x14a)](_0x5ebb5a['timestamp'])),console[_0x4d727c(0x153)](_0x4d727c(0x145)+a5_0xf3ebf8[_0x4d727c(0x14a)](_0x5ebb5a[_0x4d727c(0x118)]['projectName']+'/'+_0x5ebb5a[_0x4d727c(0x118)][_0x4d727c(0x13a)]));_0x4c6191[_0x4d727c(0x112)]>0x0&&console[_0x4d727c(0x153)]('New\x20tests\x20to\x20execute:\x20'+a5_0xf3ebf8[_0x4d727c(0xed)](_0x4c6191['length']));console[_0x4d727c(0x153)]();const _0x370490=[],_0x434f86=Date[_0x4d727c(0x12d)](),_0x5ba5ee=createCommandSpinner('Re-evaluating...');if(_0x56a4e5[_0x4d727c(0x112)]>0x0)try{const _0x5d44a4=await reevaluateFromCache(_0x4e84d2[_0x4d727c(0xee)],_0x5ebb5a,{'tests':_0x56a4e5},{'evaluatorId':_0x5207cf,'onTestStart':(_0x44fb0,_0x258927,_0x397edb)=>{const _0x363075=_0x4d727c;_0x5ba5ee[_0x363075(0xcb)]=_0x363075(0xc2)+(_0x258927+0x1)+'/'+_0x397edb+':\x20'+_0x44fb0+_0x363075(0x13e);if(!_0x5ba5ee[_0x363075(0x12e)])_0x5ba5ee[_0x363075(0x109)]();},'onTestComplete':(_0x1c2561,_0x136fb4)=>{const _0x5e7ef4=_0x4d727c;_0x5ba5ee[_0x5e7ef4(0xfa)]();if(_0x136fb4[_0x5e7ef4(0x129)]==='PASS')console[_0x5e7ef4(0x153)](a5_0xf3ebf8[_0x5e7ef4(0xf1)](_0x5e7ef4(0x127)+_0x1c2561)+a5_0xf3ebf8[_0x5e7ef4(0xe7)](_0x5e7ef4(0x132)));else _0x136fb4['status']===_0x5e7ef4(0x12a)?console[_0x5e7ef4(0x153)](a5_0xf3ebf8['red'](_0x5e7ef4(0x14e)+_0x1c2561+'\x20-\x20'+_0x136fb4[_0x5e7ef4(0x10b)])+a5_0xf3ebf8[_0x5e7ef4(0xe7)](_0x5e7ef4(0x132))):console[_0x5e7ef4(0x153)](a5_0xf3ebf8[_0x5e7ef4(0x119)](_0x5e7ef4(0x14d)+_0x1c2561+_0x5e7ef4(0x14f)+_0x136fb4[_0x5e7ef4(0x10b)]));_0x136fb4[_0x5e7ef4(0x146)]&&console[_0x5e7ef4(0x153)](a5_0xf3ebf8['dim'](_0x5e7ef4(0x101)+_0x136fb4[_0x5e7ef4(0x146)])),_0x370490[_0x5e7ef4(0x110)](_0x136fb4);},'onTestSkipped':(_0x3762ec,_0x3ee93b)=>{const _0x119342=_0x4d727c;_0x5ba5ee[_0x119342(0xfa)](),console[_0x119342(0x153)](a5_0xf3ebf8[_0x119342(0xed)](_0x119342(0xce)+_0x3762ec+_0x119342(0x14f)+_0x3ee93b));}});for(const _0x18c977 of _0x5d44a4){!_0x370490[_0x4d727c(0xfc)](_0x2cb286=>_0x2cb286[_0x4d727c(0x142)]===_0x18c977[_0x4d727c(0x142)])&&_0x370490[_0x4d727c(0x110)](_0x18c977);}}catch(_0x389382){_0x5ba5ee[_0x4d727c(0xfa)]();const _0x2ec26f=_0x389382 instanceof Error?_0x389382['message']:String(_0x389382);return console[_0x4d727c(0x153)](a5_0xf3ebf8['red'](_0x4d727c(0xfe)+_0x2ec26f)),0x1;}_0x5ba5ee['stop']();if(_0x4c6191[_0x4d727c(0x112)]>0x0){console['log'](),console[_0x4d727c(0x153)](a5_0xf3ebf8[_0x4d727c(0xde)](_0x4d727c(0xcc)));const {projectId:_0x504379,agentId:_0x51d6ff}=_0x5ebb5a[_0x4d727c(0x118)];for(const _0x43c7c3 of _0x4c6191){console[_0x4d727c(0x153)](_0x4d727c(0x11d)+a5_0xf3ebf8[_0x4d727c(0x14a)](_0x43c7c3['name']));const _0x1f847e=createCommandSpinner(_0x4d727c(0x131)+_0x43c7c3[_0x4d727c(0x11a)][_0x4d727c(0x112)]+_0x4d727c(0x155));_0x1f847e['start']();try{const {result:_0x4f0f18}=await runTest(_0x4e84d2[_0x4d727c(0xee)],_0x43c7c3,{'agentId':_0x51d6ff,'projectId':_0x504379,'site':_0x5ebb5a['site'],'noEval':![],'evaluatorId':_0x5207cf,'onRoundStart':(_0x27e108,_0x25a1b8)=>{const _0x2d8c12=_0x4d727c;_0x1f847e['text']=_0x2d8c12(0xd7)+(_0x27e108+0x1)+'/'+_0x25a1b8+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x4e9740,_0x3e72dd,_0x1f3369)=>{const _0x5c8a47=_0x4d727c,_0x382921=formatElapsed(_0x3e72dd);_0x1f3369?console['log']('\x20\x20Round\x20'+(_0x4e9740+0x1)+'/'+_0x43c7c3['rounds']['length']+_0x5c8a47(0xef)+a5_0xf3ebf8[_0x5c8a47(0xf1)]('✓')+'\x20('+_0x382921+')'):console[_0x5c8a47(0x153)](_0x5c8a47(0xca)+(_0x4e9740+0x1)+'/'+_0x43c7c3[_0x5c8a47(0x11a)]['length']+_0x5c8a47(0xef)+a5_0xf3ebf8[_0x5c8a47(0x119)]('✗'));},'onEvaluationStart':()=>{const _0x4f1cf3=_0x4d727c;_0x1f847e['text']=_0x4f1cf3(0xdd);},'onEvaluationComplete':_0x55da75=>{const _0x5e9457=_0x4d727c,_0x290d18=formatElapsed(_0x55da75);console[_0x5e9457(0x153)](_0x5e9457(0xec)+a5_0xf3ebf8[_0x5e9457(0xf1)]('✓')+'\x20('+_0x290d18+')');}});_0x1f847e[_0x4d727c(0xfa)](),_0x370490[_0x4d727c(0x110)](_0x4f0f18);if(_0x4f0f18[_0x4d727c(0x129)]===_0x4d727c(0x102))console[_0x4d727c(0x153)](a5_0xf3ebf8[_0x4d727c(0xf1)](_0x4d727c(0x127)+_0x4f0f18['reason'])+a5_0xf3ebf8[_0x4d727c(0xe7)]('\x20(new)'));else _0x4f0f18[_0x4d727c(0x129)]===_0x4d727c(0x12a)?console[_0x4d727c(0x153)](a5_0xf3ebf8[_0x4d727c(0x119)](_0x4d727c(0x14e)+_0x4f0f18[_0x4d727c(0x10b)])+a5_0xf3ebf8[_0x4d727c(0xe7)]('\x20(new)')):console[_0x4d727c(0x153)](a5_0xf3ebf8[_0x4d727c(0x119)]('✗\x20ERROR:\x20'+_0x4f0f18[_0x4d727c(0x10b)]));_0x4f0f18[_0x4d727c(0x146)]&&console[_0x4d727c(0x153)](a5_0xf3ebf8[_0x4d727c(0xe7)](_0x4d727c(0x101)+_0x4f0f18['conversation_url']));}catch(_0xafe2fd){_0x1f847e[_0x4d727c(0xfa)]();const _0x5b369f=_0xafe2fd instanceof Error?_0xafe2fd[_0x4d727c(0x123)]:String(_0xafe2fd);console[_0x4d727c(0x153)](a5_0xf3ebf8[_0x4d727c(0x119)](_0x4d727c(0x14d)+_0x5b369f)),_0x370490['push']({'name':_0x43c7c3[_0x4d727c(0x142)],'status':_0x4d727c(0xd0),'reason':_0x5b369f,'timestamp':new Date()[_0x4d727c(0x100)](),'duration_ms':0x0});}}}console[_0x4d727c(0x153)]();const _0x20bb78=Date['now']()-_0x434f86,_0x1a10d2=_0x370490[_0x4d727c(0x122)](_0x4f30cf=>_0x4f30cf[_0x4d727c(0x129)]===_0x4d727c(0x102))['length'],_0x4259bd=_0x370490[_0x4d727c(0x122)](_0x2dbd0b=>_0x2dbd0b['status']===_0x4d727c(0x12a))[_0x4d727c(0x112)],_0x37b084=_0x370490[_0x4d727c(0x122)](_0x104545=>_0x104545[_0x4d727c(0x129)]==='ERROR')['length'];console[_0x4d727c(0x153)]('━'[_0x4d727c(0xc3)](0x3c)),console[_0x4d727c(0x153)](_0x4d727c(0xff)),console[_0x4d727c(0x153)]('━'[_0x4d727c(0xc3)](0x3c)),console['log'](_0x4d727c(0x136)+_0x370490[_0x4d727c(0x112)]),console[_0x4d727c(0x153)](_0x4d727c(0x13f)+a5_0xf3ebf8[_0x4d727c(0xf1)](_0x1a10d2)),console[_0x4d727c(0x153)]('Failed:\x20\x20\x20'+a5_0xf3ebf8[_0x4d727c(0x119)](_0x4259bd));_0x37b084>0x0&&console['log'](_0x4d727c(0x104)+a5_0xf3ebf8['red'](_0x37b084));console[_0x4d727c(0x153)](_0x4d727c(0xf0)+formatElapsed(_0x20bb78)),console[_0x4d727c(0x153)]('━'[_0x4d727c(0xc3)](0x3c));const _0x4ac74c={'summary':{'total':_0x370490[_0x4d727c(0x112)],'passed':_0x1a10d2,'failed':_0x4259bd,'errors':_0x37b084>0x0?_0x37b084:undefined,'duration_ms':_0x20bb78},'tests':_0x370490,'agent':{'project':_0x2086d0[_0x4d727c(0x111)],'name':_0x2086d0[_0x4d727c(0x13a)],'site':_0x46234},'timestamp':new Date(_0x434f86)[_0x4d727c(0x100)]()};if(_0x46cb53!==_0x4d727c(0xf7)||_0x4b7a8f){const _0x52c2f7=formatResults(_0x4ac74c,_0x46cb53);if(_0x4b7a8f)try{a5_0x4ac7af['writeFileSync'](_0x4b7a8f,_0x52c2f7,_0x4d727c(0x130)),console['log'](),console[_0x4d727c(0x153)](a5_0xf3ebf8['dim'](_0x4d727c(0x105)+_0x4b7a8f));}catch(_0x22fa8d){return console[_0x4d727c(0x153)](),console[_0x4d727c(0x153)](a5_0xf3ebf8[_0x4d727c(0x119)]('Error\x20writing\x20output\x20file:\x20'+_0x22fa8d)),0x1;}else console[_0x4d727c(0x153)](),console[_0x4d727c(0x153)](_0x52c2f7);}const _0x4f0c26=_0x370490['filter'](_0x3410a0=>_0x3410a0[_0x4d727c(0x129)]!=='PASS');return _0x4f0c26['length']>0x0?0x1:0x0;}}
1
+ const a5_0x815915=a5_0x81a8;(function(_0x371a5c,_0x4481b6){const _0x5cd686=a5_0x81a8,_0x33aa82=_0x371a5c();while(!![]){try{const _0x2c1ecf=-parseInt(_0x5cd686(0xe5))/0x1+parseInt(_0x5cd686(0xf2))/0x2+parseInt(_0x5cd686(0x126))/0x3+-parseInt(_0x5cd686(0x146))/0x4+-parseInt(_0x5cd686(0xf8))/0x5+parseInt(_0x5cd686(0xea))/0x6*(parseInt(_0x5cd686(0x12d))/0x7)+parseInt(_0x5cd686(0x132))/0x8;if(_0x2c1ecf===_0x4481b6)break;else _0x33aa82['push'](_0x33aa82['shift']());}catch(_0x47a1bc){_0x33aa82['push'](_0x33aa82['shift']());}}}(a5_0x349a,0xa1f5f));import*as a5_0x2893b0 from'node:fs';import*as a5_0xbb3baa from'node:path';import a5_0x17c2f7 from'chalk';import{BaseCommand}from'./command.js';function a5_0x81a8(_0x33571a,_0x5b1c75){_0x33571a=_0x33571a-0xd2;const _0x349a92=a5_0x349a();let _0x81a81d=_0x349a92[_0x33571a];return _0x81a81d;}import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';function a5_0x349a(){const _0x4bee11=['timestamp','testName','has','No\x20tests\x20found\x20matching:\x20','no_tests','189125HjlkEL','Site:\x20','⚠\x20SKIPPED:\x20','existsSync','find','\x20(new)','Agent:\x20','stop','green','site','json','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','✗\x20ERROR:\x20','\x20\x20-\x20','no_local_folder','split','\x20\x20Agent:\x20','add','includes','Failed\x20Tests:','log','red','verbose','No\x20tests\x20have\x20tags\x20defined.','text','resolveProjectId',':\x20Sending\x20user\x20input...','message','Output\x20written\x20to:\x20','\x20\x20Conversation:\x20','PASS','Re-evaluating\x20','now','forEach','isSpinning','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','white','projectDir','dim','length','Using\x20agent:\x20','resolveAgentId','Either\x20switch\x20to\x20the\x20\x22','Cached\x20run\x20is\x20from\x20site\x20\x22','Test\x20Summary','1223979EinOzj','agent','found','Total:\x20\x20\x20\x20','FAIL','toISOString','\x20-\x20','1085JBrTgG','llmProject','Executing\x20new\x20tests...','tests','writeFileSync','748072VPXIlP','Running\x20agent\x20tests...','cyan','Run\x20tests\x20for\x20an\x20LLM\x20agent','Round\x201/','source','✗\x20ERROR:\x20Project\x20not\x20found:\x20','agent:test','Available\x20tags:\x20','rounds','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','\x22,\x20but\x20current\x20site\x20is\x20\x22','trim','Test\x20Configuration:','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','...\x20','reason','table','Cached\x20run\x20from:\x20','jsonl','1839704FMwXpI','Re-evaluating\x20cached\x20test\x20run...','no_context','\x20\x20Round\x20','...','\x20\x20Site:\x20','Passed:\x20\x20\x20','size','Tests\x20found:\x20','No\x20tests\x20found\x20with\x20tags:\x20','agentName','✗\x20FAIL:\x20','name','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','projectName','tags','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','repeat','status','\x20\x20Project:\x20','description','tsv','executeReeval','agentDirs','\x22:\x20','Error:\x20No\x20previous\x20test\x20run\x20found.','Error\x20writing\x20output\x20file:\x20','ERROR','filter','Duration:\x20','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','basename','Run\x20\x27tdx\x20agent\x20pull\x20','Round\x20','\x20\x20Evaluating...\x20','Evaluating\x20response...','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','conversation_url','dryRun','start','push','substring','not\x20found','\x27\x20to\x20create\x20the\x20folder\x20structure.','Failed:\x20\x20\x20','New\x20tests\x20to\x20execute:\x20','Re-evaluation\x20Summary','Available\x20tests:\x20','404','map','multiple_agents','toLowerCase','51149SnQxqX','Conversation\x20URL:\x20','✓\x20PASS:\x20','llm','eval','23046MEgsMt','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','execute','Running:\x20','join','Re-evaluating...','yellow','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','230868tEboMX'];a5_0x349a=function(){return _0x4bee11;};return a5_0x349a();}import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x815915(0x152)]=a5_0x815915(0x139);[a5_0x815915(0x15a)]=a5_0x815915(0x135);async[a5_0x815915(0xec)](_0x47dd19){const _0x24a554=a5_0x815915,{options:_0x59a7e6,args:_0xf3e320,tdx:_0x1f5f96}=_0x47dd19,_0x3501a4=_0xf3e320[0x0]||'.',_0x1bfb49=_0x59a7e6[_0x24a554(0xd7)],_0x141fc7=_0x59a7e6,_0x442288=_0x141fc7[_0x24a554(0xe9)]===![],_0x1a2028=_0x141fc7['reeval'],_0x2f615d=_0x141fc7['name'],_0x20756d=_0x141fc7[_0x24a554(0x155)],_0x4f215b=_0x59a7e6[_0x24a554(0x101)],_0x5a8c22=_0x141fc7['output'];if(_0x1a2028&&_0x442288)return console[_0x24a554(0x10c)](a5_0x17c2f7[_0x24a554(0x10d)](_0x24a554(0x103))),0x1;let _0x5d45a8=_0x24a554(0x143);if(_0x141fc7[_0x24a554(0x102)])_0x5d45a8=_0x24a554(0x102);else{if(_0x141fc7[_0x24a554(0x145)])_0x5d45a8=_0x24a554(0x145);else{if(_0x141fc7[_0x24a554(0x15b)])_0x5d45a8='tsv';else{if(_0x141fc7['table'])_0x5d45a8=_0x24a554(0x143);}}}const _0xaad49=_0x141fc7['llmProject'];let _0xf5fee7=_0x3501a4;const _0x45e47c=a5_0x2893b0[_0x24a554(0xfb)](_0x3501a4),_0x1c9d22=_0x3501a4==='.';if(!_0x45e47c||_0x1c9d22){const _0x17976e=resolveProjectFromContext(_0x3501a4,_0xaad49,{'requireFile':'test.yml'});if(_0x17976e[_0x24a554(0x128)])_0xf5fee7=_0x17976e['projectDir'],_0x17976e[_0x24a554(0x137)]==='context'&&console[_0x24a554(0x10c)](a5_0x17c2f7[_0x24a554(0x11f)](_0x24a554(0x121)+_0xf5fee7));else switch(_0x17976e[_0x24a554(0x142)]){case _0x24a554(0x148):console[_0x24a554(0x10c)](a5_0x17c2f7[_0x24a554(0xf0)](_0x17976e[_0x24a554(0x113)])),console['log'](),console['log']('Usage:'),console['log']('\x20\x20tdx\x20agent\x20test\x20<path>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20from\x20path'),console[_0x24a554(0x10c)]('\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[_0x24a554(0x10c)](),console[_0x24a554(0x10c)]('Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>');return 0x1;case _0x24a554(0x106):console[_0x24a554(0x10c)](a5_0x17c2f7['yellow'](_0x17976e[_0x24a554(0x113)])),console[_0x24a554(0x10c)](),console['log'](_0x24a554(0x166)+_0x17976e[_0x24a554(0x12e)]+_0x24a554(0xdc));return 0x1;case _0x24a554(0xe3):{const _0x478b94=a5_0xbb3baa[_0x24a554(0x165)](_0x17976e[_0x24a554(0x11e)]);console[_0x24a554(0x10c)](a5_0x17c2f7['yellow'](_0x24a554(0x153)+_0x17976e[_0x24a554(0x12e)]+'\x22:'));for(const _0x5e6a99 of _0x17976e[_0x24a554(0x15d)]){console['log'](_0x24a554(0x105)+_0x5e6a99);}return console[_0x24a554(0x10c)](),console[_0x24a554(0x10c)](_0x24a554(0x11b)+_0x478b94+'/<agent-name>'),0x1;}case _0x24a554(0xf7):console[_0x24a554(0x10c)](a5_0x17c2f7[_0x24a554(0xf0)]('No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22'+_0x17976e[_0x24a554(0x12e)]+'\x22.')),console['log'](a5_0x17c2f7[_0x24a554(0x11f)]('Project\x20path:\x20'+_0x17976e[_0x24a554(0x11e)])),console['log'](),console[_0x24a554(0x10c)](_0x24a554(0xeb));return 0x1;}}const {definition:_0x18c6ae,agentInfo:_0x46b9e1}=parseTestFile(_0xf5fee7);let _0x92e90a=_0x18c6ae[_0x24a554(0x130)];if(_0x2f615d){const _0x132831=_0x2f615d[_0x24a554(0x107)](',')[_0x24a554(0xe2)](_0x31e2b0=>_0x31e2b0[_0x24a554(0x13e)]());_0x92e90a=_0x18c6ae[_0x24a554(0x130)][_0x24a554(0x162)](_0xadacba=>_0x132831['includes'](_0xadacba[_0x24a554(0x152)]));if(_0x92e90a['length']===0x0)return console[_0x24a554(0x10c)](a5_0x17c2f7[_0x24a554(0xf0)](_0x24a554(0xf6)+_0x2f615d)),console['log'](a5_0x17c2f7[_0x24a554(0x11f)](_0x24a554(0xe0)+_0x18c6ae['tests'][_0x24a554(0xe2)](_0x561048=>_0x561048['name'])['join'](',\x20'))),0x1;}if(_0x20756d){const _0x236f7f=_0x20756d['split'](',')[_0x24a554(0xe2)](_0x12b968=>_0x12b968['trim']()[_0x24a554(0xe4)]());_0x92e90a=_0x92e90a[_0x24a554(0x162)](_0x5ecd98=>_0x5ecd98[_0x24a554(0x155)]?.['some'](_0x351b73=>_0x236f7f['includes'](_0x351b73['toLowerCase']())));if(_0x92e90a[_0x24a554(0x120)]===0x0){console[_0x24a554(0x10c)](a5_0x17c2f7['yellow'](_0x24a554(0x14f)+_0x20756d));const _0x27db93=new Set();return _0x18c6ae['tests'][_0x24a554(0x119)](_0x3edf91=>_0x3edf91[_0x24a554(0x155)]?.[_0x24a554(0x119)](_0x321ca6=>_0x27db93[_0x24a554(0x109)](_0x321ca6))),_0x27db93[_0x24a554(0x14d)]>0x0?console[_0x24a554(0x10c)](a5_0x17c2f7['dim'](_0x24a554(0x13a)+[..._0x27db93][_0x24a554(0xee)](',\x20'))):console[_0x24a554(0x10c)](a5_0x17c2f7[_0x24a554(0x11f)](_0x24a554(0x10f))),0x1;}}if(_0x1a2028)return this[_0x24a554(0x15c)](_0x47dd19,{'definition':{'tests':_0x92e90a},'agentInfo':_0x46b9e1,'outputFormat':_0x5d45a8,'outputFile':_0x5a8c22,'testNames':_0x2f615d});if(_0x1bfb49){console[_0x24a554(0x10c)](a5_0x17c2f7[_0x24a554(0x134)](_0x24a554(0x13f))),console[_0x24a554(0x10c)](_0x24a554(0x14b)+a5_0x17c2f7[_0x24a554(0x11d)](_0x4f215b)),console[_0x24a554(0x10c)](_0x24a554(0x159)+a5_0x17c2f7[_0x24a554(0x11d)](_0x46b9e1[_0x24a554(0x154)])),console[_0x24a554(0x10c)](_0x24a554(0x108)+a5_0x17c2f7[_0x24a554(0x11d)](_0x46b9e1[_0x24a554(0x150)])),console[_0x24a554(0x10c)](),console['log'](_0x24a554(0x14e)+a5_0x17c2f7[_0x24a554(0x11d)](_0x92e90a[_0x24a554(0x120)]));for(let _0x3fdab6=0x0;_0x3fdab6<_0x92e90a[_0x24a554(0x120)];_0x3fdab6++){const _0x578fe2=_0x92e90a[_0x3fdab6],_0x42b5b8=_0x578fe2[_0x24a554(0x13b)][_0x24a554(0x120)]===0x1?'round':_0x24a554(0x13b),_0x338e96=_0x578fe2['tags']?.[_0x24a554(0x120)]?'\x20['+_0x578fe2[_0x24a554(0x155)][_0x24a554(0xee)](',\x20')+']':'';console[_0x24a554(0x10c)]('\x20\x20'+(_0x3fdab6+0x1)+'.\x20'+a5_0x17c2f7[_0x24a554(0x11d)](_0x578fe2['name'])+'\x20('+_0x578fe2['rounds'][_0x24a554(0x120)]+'\x20'+_0x42b5b8+')'+a5_0x17c2f7[_0x24a554(0x11f)](_0x338e96));}return 0x0;}let _0x18b3d6,_0x9794ea;try{_0x18b3d6=await _0x1f5f96['llm'][_0x24a554(0x111)](_0x46b9e1['projectName']);}catch(_0x4e3453){const _0x4b30b8=_0x4e3453 instanceof Error?_0x4e3453['message']:String(_0x4e3453);return _0x4b30b8['includes']('404')||_0x4b30b8[_0x24a554(0xe4)]()[_0x24a554(0x10a)](_0x24a554(0xdb))?console[_0x24a554(0x10c)](a5_0x17c2f7['red'](_0x24a554(0x138)+_0x46b9e1[_0x24a554(0x154)])):console[_0x24a554(0x10c)](a5_0x17c2f7[_0x24a554(0x10d)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22'+_0x46b9e1[_0x24a554(0x154)]+_0x24a554(0x15e)+_0x4b30b8)),0x1;}try{_0x9794ea=await _0x1f5f96[_0x24a554(0xe8)][_0x24a554(0x122)](_0x46b9e1[_0x24a554(0x150)],_0x18b3d6);}catch(_0x2ea803){const _0xc5b106=_0x2ea803 instanceof Error?_0x2ea803[_0x24a554(0x113)]:String(_0x2ea803);return _0xc5b106[_0x24a554(0x10a)](_0x24a554(0xe1))||_0xc5b106[_0x24a554(0xe4)]()[_0x24a554(0x10a)](_0x24a554(0xdb))?console[_0x24a554(0x10c)](a5_0x17c2f7[_0x24a554(0x10d)](_0x24a554(0xf1)+_0x46b9e1[_0x24a554(0x150)])):console[_0x24a554(0x10c)](a5_0x17c2f7[_0x24a554(0x10d)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22'+_0x46b9e1[_0x24a554(0x150)]+_0x24a554(0x15e)+_0xc5b106)),0x1;}let _0x48f527;if(!_0x442288)try{_0x48f527=await setupEvaluatorAgent(_0x1f5f96[_0x24a554(0xe8)],_0x59a7e6[_0x24a554(0x10e)]);}catch(_0xefcf1b){const _0x522217=_0xefcf1b instanceof Error?_0xefcf1b['message']:String(_0xefcf1b);return console[_0x24a554(0x10c)](a5_0x17c2f7[_0x24a554(0x10d)](_0x24a554(0x140)+_0x522217)),0x1;}console['log'](a5_0x17c2f7[_0x24a554(0x134)](_0x24a554(0x133))),console[_0x24a554(0x10c)](_0x24a554(0xf9)+a5_0x17c2f7['white'](_0x4f215b)),console[_0x24a554(0x10c)](_0x24a554(0xfe)+a5_0x17c2f7[_0x24a554(0x11d)](_0x46b9e1[_0x24a554(0x154)]+'/'+_0x46b9e1[_0x24a554(0x150)])),console[_0x24a554(0x10c)]();const _0x26b3df=[],_0x6732a9=[],_0x29dc93=Date[_0x24a554(0x118)]();for(let _0x41202b=0x0;_0x41202b<_0x92e90a[_0x24a554(0x120)];_0x41202b++){const _0x3f0f4d=_0x92e90a[_0x41202b];_0x92e90a[_0x24a554(0x120)]>0x1?console['log']('Test\x20'+(_0x41202b+0x1)+'/'+_0x92e90a[_0x24a554(0x120)]+':\x20'+a5_0x17c2f7['white'](_0x3f0f4d[_0x24a554(0x152)])):console[_0x24a554(0x10c)]('Running\x20test:\x20'+a5_0x17c2f7['white'](_0x3f0f4d[_0x24a554(0x152)]));const _0x46489a=createCommandSpinner('Round\x201/'+_0x3f0f4d[_0x24a554(0x13b)][_0x24a554(0x120)]+_0x24a554(0x112));_0x46489a[_0x24a554(0xd8)]();try{const {result:_0xb0d959,conversation:_0x5a64bc}=await runTest(_0x1f5f96[_0x24a554(0xe8)],_0x3f0f4d,{'agentId':_0x9794ea,'projectId':_0x18b3d6,'site':_0x4f215b,'noEval':_0x442288,'evaluatorId':_0x48f527,'onRoundStart':(_0x4c396f,_0x1a7197)=>{const _0x4d8c05=_0x24a554;_0x46489a[_0x4d8c05(0x110)]='Round\x20'+(_0x4c396f+0x1)+'/'+_0x1a7197+_0x4d8c05(0x112);},'onRoundComplete':(_0x178f9f,_0x5222f7,_0x28369c)=>{const _0x2e5d76=_0x24a554,_0x16b43f=formatElapsed(_0x5222f7);_0x28369c?console['log'](_0x2e5d76(0x149)+(_0x178f9f+0x1)+'/'+_0x3f0f4d[_0x2e5d76(0x13b)][_0x2e5d76(0x120)]+'...\x20'+a5_0x17c2f7['green']('✓')+'\x20('+_0x16b43f+')'):console[_0x2e5d76(0x10c)](_0x2e5d76(0x149)+(_0x178f9f+0x1)+'/'+_0x3f0f4d[_0x2e5d76(0x13b)][_0x2e5d76(0x120)]+_0x2e5d76(0x141)+a5_0x17c2f7[_0x2e5d76(0x10d)]('✗'));},'onEvaluationStart':()=>{const _0x5d8e11=_0x24a554;_0x46489a[_0x5d8e11(0x110)]='Evaluating\x20response...';},'onEvaluationComplete':_0x3c3c9a=>{const _0x428386=_0x24a554,_0x517a6e=formatElapsed(_0x3c3c9a);console[_0x428386(0x10c)](_0x428386(0xd3)+a5_0x17c2f7[_0x428386(0x100)]('✓')+'\x20('+_0x517a6e+')');}});_0x46489a[_0x24a554(0xff)](),_0x26b3df[_0x24a554(0xd9)](_0xb0d959),_0x6732a9[_0x24a554(0xd9)](_0x5a64bc);if(_0xb0d959['status']===_0x24a554(0x116))console[_0x24a554(0x10c)](a5_0x17c2f7[_0x24a554(0x100)](_0x24a554(0xe7)+_0xb0d959[_0x24a554(0x142)]));else _0xb0d959[_0x24a554(0x158)]===_0x24a554(0x12a)?console[_0x24a554(0x10c)](a5_0x17c2f7[_0x24a554(0x10d)](_0x24a554(0x151)+_0xb0d959[_0x24a554(0x142)])):console['log'](a5_0x17c2f7[_0x24a554(0x10d)]('✗\x20ERROR:\x20'+_0xb0d959[_0x24a554(0x142)]));_0xb0d959[_0x24a554(0xd6)]&&console[_0x24a554(0x10c)](a5_0x17c2f7[_0x24a554(0x11f)](_0x24a554(0xe6)+_0xb0d959[_0x24a554(0xd6)])),console['log']();}catch(_0x146d15){_0x46489a[_0x24a554(0xff)]();const _0x254db8=_0x146d15 instanceof Error?_0x146d15[_0x24a554(0x113)]:String(_0x146d15);console[_0x24a554(0x10c)](a5_0x17c2f7[_0x24a554(0x10d)](_0x24a554(0x104)+_0x254db8)),console['log'](),_0x26b3df['push']({'name':_0x3f0f4d[_0x24a554(0x152)],'status':'ERROR','reason':_0x254db8,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}const _0x313bbc=Date[_0x24a554(0x118)]()-_0x29dc93,_0x434861=_0x26b3df['filter'](_0x499f79=>_0x499f79['status']===_0x24a554(0x116))[_0x24a554(0x120)],_0x23498f=_0x26b3df['filter'](_0x28500d=>_0x28500d['status']===_0x24a554(0x12a))['length'],_0x8ae27f=_0x26b3df[_0x24a554(0x162)](_0x58a51f=>_0x58a51f[_0x24a554(0x158)]===_0x24a554(0x161))[_0x24a554(0x120)];console[_0x24a554(0x10c)]('━'[_0x24a554(0x157)](0x3c)),console[_0x24a554(0x10c)](_0x24a554(0x125)),console[_0x24a554(0x10c)]('━'[_0x24a554(0x157)](0x3c)),console[_0x24a554(0x10c)](_0x24a554(0x129)+_0x26b3df[_0x24a554(0x120)]),console[_0x24a554(0x10c)](_0x24a554(0x14c)+a5_0x17c2f7[_0x24a554(0x100)](_0x434861)),console[_0x24a554(0x10c)](_0x24a554(0xdd)+a5_0x17c2f7['red'](_0x23498f));_0x8ae27f>0x0&&console[_0x24a554(0x10c)]('Errors:\x20\x20\x20'+a5_0x17c2f7['red'](_0x8ae27f));console[_0x24a554(0x10c)]('Duration:\x20'+formatElapsed(_0x313bbc)),console['log']('━'[_0x24a554(0x157)](0x3c));const _0x306f7d=_0x26b3df[_0x24a554(0x162)](_0x5817f8=>_0x5817f8[_0x24a554(0x158)]!==_0x24a554(0x116));if(_0x306f7d['length']>0x0){console[_0x24a554(0x10c)](),console[_0x24a554(0x10c)](_0x24a554(0x10b));for(const _0x2d8397 of _0x306f7d){const _0x4aebd4=a5_0x17c2f7[_0x24a554(0x10d)]('✗'),_0x4cf1bd=_0x2d8397[_0x24a554(0x142)]['length']>0x32?_0x2d8397[_0x24a554(0x142)][_0x24a554(0xda)](0x0,0x32)+_0x24a554(0x14a):_0x2d8397[_0x24a554(0x142)];console['log']('\x20\x20'+_0x4aebd4+'\x20'+_0x2d8397[_0x24a554(0x152)]+':\x20'+_0x4cf1bd);}}const _0x834816={'summary':{'total':_0x26b3df[_0x24a554(0x120)],'passed':_0x434861,'failed':_0x23498f,'errors':_0x8ae27f>0x0?_0x8ae27f:undefined,'duration_ms':_0x313bbc},'tests':_0x26b3df,'agent':{'project':_0x46b9e1[_0x24a554(0x154)],'name':_0x46b9e1[_0x24a554(0x150)],'site':_0x4f215b},'timestamp':new Date(_0x29dc93)[_0x24a554(0x12b)]()};try{const _0x5af70a=buildCachedTestRun(_0x6732a9,{'site':_0x4f215b,'projectId':_0x18b3d6,'projectName':_0x46b9e1[_0x24a554(0x154)],'agentId':_0x9794ea,'agentName':_0x46b9e1[_0x24a554(0x150)],'testYmlPath':a5_0xbb3baa['resolve'](_0x46b9e1['testYmlPath'])});saveLastTestRun(_0x5af70a);}catch{}if(_0x5d45a8!==_0x24a554(0x143)||_0x5a8c22){const _0x607273=formatResults(_0x834816,_0x5d45a8);if(_0x5a8c22)try{a5_0x2893b0[_0x24a554(0x131)](_0x5a8c22,_0x607273,'utf-8'),console[_0x24a554(0x10c)](),console['log'](a5_0x17c2f7[_0x24a554(0x11f)](_0x24a554(0x114)+_0x5a8c22));}catch(_0x259e44){return console[_0x24a554(0x10c)](),console[_0x24a554(0x10c)](a5_0x17c2f7[_0x24a554(0x10d)](_0x24a554(0x160)+_0x259e44)),0x1;}else console[_0x24a554(0x10c)](),console[_0x24a554(0x10c)](_0x607273);}return _0x306f7d[_0x24a554(0x120)]>0x0?0x1:0x0;}async[a5_0x815915(0x15c)](_0x11a0e5,_0x4a8dda){const _0x802a15=a5_0x815915,{options:_0xccd5cc,tdx:_0x5b614e}=_0x11a0e5,{definition:_0x146f6f,agentInfo:_0x15d38c,outputFormat:_0x31bef3,outputFile:_0x50ee73}=_0x4a8dda,_0x5ae626=_0xccd5cc[_0x802a15(0x101)],_0x20e5c3=loadLastTestRun();if(!_0x20e5c3)return console['log'](a5_0x17c2f7[_0x802a15(0x10d)](_0x802a15(0x15f))),console['log'](a5_0x17c2f7[_0x802a15(0x11f)](_0x802a15(0x11c))),0x1;if(_0x20e5c3[_0x802a15(0x127)][_0x802a15(0x150)]!==_0x15d38c[_0x802a15(0x150)])return console[_0x802a15(0x10c)](a5_0x17c2f7[_0x802a15(0x10d)]('Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22'+_0x20e5c3[_0x802a15(0x127)]['agentName']+_0x802a15(0xd5)+_0x15d38c[_0x802a15(0x150)]+'\x22.')),console['log'](a5_0x17c2f7[_0x802a15(0x11f)](_0x802a15(0x156))),0x1;const _0x457869=new Set(_0x20e5c3['conversations'][_0x802a15(0xe2)](_0x584c3f=>_0x584c3f[_0x802a15(0xf4)])),_0xcf3797=_0x146f6f[_0x802a15(0x130)][_0x802a15(0x162)](_0x1cce8f=>!_0x457869[_0x802a15(0xf5)](_0x1cce8f['name']));if(_0xcf3797[_0x802a15(0x120)]>0x0&&_0x20e5c3[_0x802a15(0x101)]!==_0x5ae626)return console[_0x802a15(0x10c)](a5_0x17c2f7[_0x802a15(0x10d)](_0x802a15(0x13c))),console[_0x802a15(0x10c)](a5_0x17c2f7[_0x802a15(0x11f)](_0x802a15(0x124)+_0x20e5c3[_0x802a15(0x101)]+_0x802a15(0x13d)+_0x5ae626+'\x22.')),console[_0x802a15(0x10c)](a5_0x17c2f7[_0x802a15(0x11f)](_0x802a15(0x123)+_0x20e5c3[_0x802a15(0x101)]+'\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.')),0x1;const _0x46d60e=_0x146f6f[_0x802a15(0x130)][_0x802a15(0x162)](_0x1b3b81=>_0x457869[_0x802a15(0xf5)](_0x1b3b81[_0x802a15(0x152)])),_0xbefd08=_0xcf3797;let _0xace298;try{_0xace298=await setupEvaluatorAgent(_0x5b614e[_0x802a15(0xe8)],_0xccd5cc[_0x802a15(0x10e)]);}catch(_0x4a32af){const _0x2b091e=_0x4a32af instanceof Error?_0x4a32af[_0x802a15(0x113)]:String(_0x4a32af);return console[_0x802a15(0x10c)](a5_0x17c2f7[_0x802a15(0x10d)](_0x802a15(0x140)+_0x2b091e)),0x1;}console['log'](a5_0x17c2f7[_0x802a15(0x134)](_0x802a15(0x147))),console[_0x802a15(0x10c)](_0x802a15(0x144)+a5_0x17c2f7[_0x802a15(0x11d)](_0x20e5c3[_0x802a15(0xf3)])),console[_0x802a15(0x10c)]('Agent:\x20'+a5_0x17c2f7[_0x802a15(0x11d)](_0x20e5c3[_0x802a15(0x127)][_0x802a15(0x154)]+'/'+_0x20e5c3['agent'][_0x802a15(0x150)]));_0xbefd08['length']>0x0&&console[_0x802a15(0x10c)](_0x802a15(0xde)+a5_0x17c2f7[_0x802a15(0xf0)](_0xbefd08['length']));console[_0x802a15(0x10c)]();const _0x3f096f=[],_0x417839=Date[_0x802a15(0x118)](),_0x4253d3=createCommandSpinner(_0x802a15(0xef));if(_0x46d60e['length']>0x0)try{const _0x2d3642=await reevaluateFromCache(_0x5b614e['llm'],_0x20e5c3,{'tests':_0x46d60e},{'evaluatorId':_0xace298,'onTestStart':(_0x353f88,_0x4858ab,_0xd65d48)=>{const _0x492c44=_0x802a15;_0x4253d3['text']=_0x492c44(0x117)+(_0x4858ab+0x1)+'/'+_0xd65d48+':\x20'+_0x353f88+_0x492c44(0x14a);if(!_0x4253d3[_0x492c44(0x11a)])_0x4253d3[_0x492c44(0xd8)]();},'onTestComplete':(_0x3730c0,_0x530568)=>{const _0x1f72c0=_0x802a15;_0x4253d3[_0x1f72c0(0xff)]();if(_0x530568[_0x1f72c0(0x158)]==='PASS')console['log'](a5_0x17c2f7[_0x1f72c0(0x100)](_0x1f72c0(0xe7)+_0x3730c0)+a5_0x17c2f7['dim']('\x20(cached)'));else _0x530568[_0x1f72c0(0x158)]===_0x1f72c0(0x12a)?console[_0x1f72c0(0x10c)](a5_0x17c2f7[_0x1f72c0(0x10d)](_0x1f72c0(0x151)+_0x3730c0+_0x1f72c0(0x12c)+_0x530568[_0x1f72c0(0x142)])+a5_0x17c2f7[_0x1f72c0(0x11f)]('\x20(cached)')):console[_0x1f72c0(0x10c)](a5_0x17c2f7[_0x1f72c0(0x10d)](_0x1f72c0(0x104)+_0x3730c0+'\x20-\x20'+_0x530568[_0x1f72c0(0x142)]));_0x530568['conversation_url']&&console['log'](a5_0x17c2f7[_0x1f72c0(0x11f)](_0x1f72c0(0x115)+_0x530568['conversation_url'])),_0x3f096f[_0x1f72c0(0xd9)](_0x530568);},'onTestSkipped':(_0x33d5c6,_0xa69ad)=>{const _0x24b9e4=_0x802a15;_0x4253d3['stop'](),console[_0x24b9e4(0x10c)](a5_0x17c2f7[_0x24b9e4(0xf0)](_0x24b9e4(0xfa)+_0x33d5c6+'\x20-\x20'+_0xa69ad));}});for(const _0x788db0 of _0x2d3642){!_0x3f096f[_0x802a15(0xfc)](_0x2fd79d=>_0x2fd79d[_0x802a15(0x152)]===_0x788db0[_0x802a15(0x152)])&&_0x3f096f[_0x802a15(0xd9)](_0x788db0);}}catch(_0xea7f96){_0x4253d3[_0x802a15(0xff)]();const _0x176798=_0xea7f96 instanceof Error?_0xea7f96[_0x802a15(0x113)]:String(_0xea7f96);return console[_0x802a15(0x10c)](a5_0x17c2f7[_0x802a15(0x10d)](_0x802a15(0x164)+_0x176798)),0x1;}_0x4253d3[_0x802a15(0xff)]();if(_0xbefd08[_0x802a15(0x120)]>0x0){console[_0x802a15(0x10c)](),console[_0x802a15(0x10c)](a5_0x17c2f7[_0x802a15(0x134)](_0x802a15(0x12f)));const {projectId:_0x4e5dd2,agentId:_0x21e086}=_0x20e5c3[_0x802a15(0x127)];for(const _0x561a3a of _0xbefd08){console['log'](_0x802a15(0xed)+a5_0x17c2f7[_0x802a15(0x11d)](_0x561a3a[_0x802a15(0x152)]));const _0x204f0a=createCommandSpinner(_0x802a15(0x136)+_0x561a3a[_0x802a15(0x13b)][_0x802a15(0x120)]+_0x802a15(0x112));_0x204f0a[_0x802a15(0xd8)]();try{const {result:_0x387d06}=await runTest(_0x5b614e[_0x802a15(0xe8)],_0x561a3a,{'agentId':_0x21e086,'projectId':_0x4e5dd2,'site':_0x20e5c3[_0x802a15(0x101)],'noEval':![],'evaluatorId':_0xace298,'onRoundStart':(_0x356fb5,_0x21afcb)=>{const _0x544ca9=_0x802a15;_0x204f0a[_0x544ca9(0x110)]=_0x544ca9(0xd2)+(_0x356fb5+0x1)+'/'+_0x21afcb+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0xb8350f,_0x1ed6ae,_0x446034)=>{const _0x36f48d=_0x802a15,_0x1eb033=formatElapsed(_0x1ed6ae);_0x446034?console[_0x36f48d(0x10c)](_0x36f48d(0x149)+(_0xb8350f+0x1)+'/'+_0x561a3a['rounds'][_0x36f48d(0x120)]+_0x36f48d(0x141)+a5_0x17c2f7['green']('✓')+'\x20('+_0x1eb033+')'):console[_0x36f48d(0x10c)](_0x36f48d(0x149)+(_0xb8350f+0x1)+'/'+_0x561a3a[_0x36f48d(0x13b)][_0x36f48d(0x120)]+'...\x20'+a5_0x17c2f7[_0x36f48d(0x10d)]('✗'));},'onEvaluationStart':()=>{const _0x148dc3=_0x802a15;_0x204f0a[_0x148dc3(0x110)]=_0x148dc3(0xd4);},'onEvaluationComplete':_0x1a45b0=>{const _0x14e34a=_0x802a15,_0x583e53=formatElapsed(_0x1a45b0);console['log'](_0x14e34a(0xd3)+a5_0x17c2f7[_0x14e34a(0x100)]('✓')+'\x20('+_0x583e53+')');}});_0x204f0a[_0x802a15(0xff)](),_0x3f096f['push'](_0x387d06);if(_0x387d06[_0x802a15(0x158)]===_0x802a15(0x116))console['log'](a5_0x17c2f7[_0x802a15(0x100)]('✓\x20PASS:\x20'+_0x387d06[_0x802a15(0x142)])+a5_0x17c2f7['dim'](_0x802a15(0xfd)));else _0x387d06[_0x802a15(0x158)]==='FAIL'?console[_0x802a15(0x10c)](a5_0x17c2f7[_0x802a15(0x10d)](_0x802a15(0x151)+_0x387d06[_0x802a15(0x142)])+a5_0x17c2f7[_0x802a15(0x11f)]('\x20(new)')):console['log'](a5_0x17c2f7[_0x802a15(0x10d)]('✗\x20ERROR:\x20'+_0x387d06[_0x802a15(0x142)]));_0x387d06[_0x802a15(0xd6)]&&console['log'](a5_0x17c2f7[_0x802a15(0x11f)](_0x802a15(0x115)+_0x387d06[_0x802a15(0xd6)]));}catch(_0x577f33){_0x204f0a[_0x802a15(0xff)]();const _0x15c070=_0x577f33 instanceof Error?_0x577f33['message']:String(_0x577f33);console[_0x802a15(0x10c)](a5_0x17c2f7[_0x802a15(0x10d)](_0x802a15(0x104)+_0x15c070)),_0x3f096f[_0x802a15(0xd9)]({'name':_0x561a3a[_0x802a15(0x152)],'status':_0x802a15(0x161),'reason':_0x15c070,'timestamp':new Date()[_0x802a15(0x12b)](),'duration_ms':0x0});}}}console[_0x802a15(0x10c)]();const _0x8b105c=Date[_0x802a15(0x118)]()-_0x417839,_0x30516a=_0x3f096f[_0x802a15(0x162)](_0x41b978=>_0x41b978[_0x802a15(0x158)]===_0x802a15(0x116))[_0x802a15(0x120)],_0x42d899=_0x3f096f[_0x802a15(0x162)](_0x541463=>_0x541463[_0x802a15(0x158)]===_0x802a15(0x12a))[_0x802a15(0x120)],_0x15ee91=_0x3f096f[_0x802a15(0x162)](_0x50b267=>_0x50b267[_0x802a15(0x158)]===_0x802a15(0x161))['length'];console[_0x802a15(0x10c)]('━'[_0x802a15(0x157)](0x3c)),console[_0x802a15(0x10c)](_0x802a15(0xdf)),console[_0x802a15(0x10c)]('━'[_0x802a15(0x157)](0x3c)),console[_0x802a15(0x10c)](_0x802a15(0x129)+_0x3f096f[_0x802a15(0x120)]),console['log'](_0x802a15(0x14c)+a5_0x17c2f7[_0x802a15(0x100)](_0x30516a)),console[_0x802a15(0x10c)]('Failed:\x20\x20\x20'+a5_0x17c2f7['red'](_0x42d899));_0x15ee91>0x0&&console[_0x802a15(0x10c)]('Errors:\x20\x20\x20'+a5_0x17c2f7[_0x802a15(0x10d)](_0x15ee91));console[_0x802a15(0x10c)](_0x802a15(0x163)+formatElapsed(_0x8b105c)),console[_0x802a15(0x10c)]('━'['repeat'](0x3c));const _0x1d569f={'summary':{'total':_0x3f096f[_0x802a15(0x120)],'passed':_0x30516a,'failed':_0x42d899,'errors':_0x15ee91>0x0?_0x15ee91:undefined,'duration_ms':_0x8b105c},'tests':_0x3f096f,'agent':{'project':_0x15d38c[_0x802a15(0x154)],'name':_0x15d38c['agentName'],'site':_0x5ae626},'timestamp':new Date(_0x417839)[_0x802a15(0x12b)]()};if(_0x31bef3!==_0x802a15(0x143)||_0x50ee73){const _0x252527=formatResults(_0x1d569f,_0x31bef3);if(_0x50ee73)try{a5_0x2893b0['writeFileSync'](_0x50ee73,_0x252527,'utf-8'),console[_0x802a15(0x10c)](),console[_0x802a15(0x10c)](a5_0x17c2f7[_0x802a15(0x11f)](_0x802a15(0x114)+_0x50ee73));}catch(_0x5ad4fe){return console['log'](),console[_0x802a15(0x10c)](a5_0x17c2f7[_0x802a15(0x10d)](_0x802a15(0x160)+_0x5ad4fe)),0x1;}else console[_0x802a15(0x10c)](),console['log'](_0x252527);}const _0x8ad730=_0x3f096f[_0x802a15(0x162)](_0x84c151=>_0x84c151[_0x802a15(0x158)]!==_0x802a15(0x116));return _0x8ad730[_0x802a15(0x120)]>0x0?0x1:0x0;}}
@@ -1 +1 @@
1
- const a6_0x38d4b6=a6_0x56a8;function a6_0x56a8(_0x432a5a,_0x1998a9){_0x432a5a=_0x432a5a-0x168;const _0x23f641=a6_0x23f6();let _0x56a877=_0x23f641[_0x432a5a];return _0x56a877;}(function(_0x396307,_0x18163d){const _0x1f0c0c=a6_0x56a8,_0xba2ba2=_0x396307();while(!![]){try{const _0x36b8ca=-parseInt(_0x1f0c0c(0x18c))/0x1+-parseInt(_0x1f0c0c(0x186))/0x2*(-parseInt(_0x1f0c0c(0x18b))/0x3)+parseInt(_0x1f0c0c(0x192))/0x4+-parseInt(_0x1f0c0c(0x1a8))/0x5+parseInt(_0x1f0c0c(0x197))/0x6+parseInt(_0x1f0c0c(0x1a0))/0x7+-parseInt(_0x1f0c0c(0x172))/0x8*(parseInt(_0x1f0c0c(0x196))/0x9);if(_0x36b8ca===_0x18163d)break;else _0xba2ba2['push'](_0xba2ba2['shift']());}catch(_0x18be34){_0xba2ba2['push'](_0xba2ba2['shift']());}}}(a6_0x23f6,0xbaf42));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_0x38d4b6(0x17f),a6_0x38d4b6(0x18d),a6_0x38d4b6(0x16e),a6_0x38d4b6(0x182),a6_0x38d4b6(0x16a),a6_0x38d4b6(0x194),a6_0x38d4b6(0x184),a6_0x38d4b6(0x16d)]);function isSensitiveHeader(_0x2d6f1e){const _0x5d3a81=a6_0x38d4b6;return SENSITIVE_HEADERS[_0x5d3a81(0x195)](_0x2d6f1e[_0x5d3a81(0x191)]());}function a6_0x23f6(){const _0x218f04=['method','241161wLbMKE','924685CfuIth','proxy-authorization','PUT','noColor','readBodyFromFile','toLowerCase','1298676MESQzy','file','x-xsrf-token','has','9RTpfko','8554158rMvRmF','color','log','name','stack','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','trino','substring','Invalid\x20HTTP\x20method:\x20','176897TNQRmZ','output','startsWith','data','.\x20Valid\x20types:\x20','headers','verbose','DELETE','468580uqYeaB','<\x20HTTP/1.1\x20','PATCH','site','Invalid\x20API\x20type:\x20','set-cookie2','error','description','x-trino-user','cookie','Invalid\x20header\x20format:\x20\x22','workflow','Error:\x20','5719624IxIFwB','join','cdp','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','length','isArray','validate','indexOf','llm','includes','api','type','toUpperCase','authorization','status','\x22.\x20','set-cookie','message','x-auth-token','trim','18BjGTik','GET','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','\x0aStack\x20trace:\x0a'];a6_0x23f6=function(){return _0x218f04;};return a6_0x23f6();}function parseHeader(_0x3b1c05){const _0x2329b0=a6_0x38d4b6,_0x136ecf=_0x3b1c05[_0x2329b0(0x179)](':');if(_0x136ecf===-0x1)throw new Error(_0x2329b0(0x16f)+_0x3b1c05+_0x2329b0(0x181)+_0x2329b0(0x175));const _0x58969b=_0x3b1c05[_0x2329b0(0x19e)](0x0,_0x136ecf)[_0x2329b0(0x185)](),_0x3cd499=_0x3b1c05['substring'](_0x136ecf+0x1)[_0x2329b0(0x185)]();if(!_0x58969b)throw new Error(_0x2329b0(0x188)+_0x3b1c05+'\x22');return[_0x58969b,_0x3cd499];}export class ApiCommand extends BaseCommand{[a6_0x38d4b6(0x19a)]=a6_0x38d4b6(0x17c);[a6_0x38d4b6(0x16c)]='Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs';[a6_0x38d4b6(0x178)](_0x4a1828){const _0x6b2719=a6_0x38d4b6,{args:_0x1cd751,options:_0x268031}=_0x4a1828,_0x264602=_0x268031;if(_0x1cd751[_0x6b2719(0x176)]===0x0)return _0x6b2719(0x19c);const _0x879416=_0x1cd751[0x0];if(!_0x879416[_0x6b2719(0x1a2)]('/'))return'Endpoint\x20must\x20start\x20with\x20/:\x20'+_0x879416;const _0x511f1b=_0x264602[_0x6b2719(0x1a3)],_0x47d8f3=_0x264602[_0x6b2719(0x193)];if(_0x511f1b&&_0x47d8f3)return'Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.';const _0x3938c7=_0x264602[_0x6b2719(0x18a)]||_0x6b2719(0x187),_0x1d78dd=[_0x6b2719(0x187),'POST',_0x6b2719(0x18e),_0x6b2719(0x1a7),_0x6b2719(0x1aa)];if(!_0x1d78dd[_0x6b2719(0x17b)](_0x3938c7[_0x6b2719(0x17e)]()))return _0x6b2719(0x19f)+_0x3938c7+'.\x20Valid\x20methods:\x20'+_0x1d78dd[_0x6b2719(0x173)](',\x20');const _0x414b66=_0x264602['type']||'td',_0x12c3c0=['td',_0x6b2719(0x174),_0x6b2719(0x170),_0x6b2719(0x19d),_0x6b2719(0x17a),'llm-proxy'];if(!_0x12c3c0[_0x6b2719(0x17b)](_0x414b66))return _0x6b2719(0x169)+_0x414b66+_0x6b2719(0x1a4)+_0x12c3c0[_0x6b2719(0x173)](',\x20');return undefined;}async['execute'](_0xa85fda){const _0x2399fc=a6_0x38d4b6,{options:_0x5dd831,args:_0x52367c,tdx:_0xfe3aa1}=_0xa85fda,_0x5050e2=_0x5dd831,_0x2cece2=_0x52367c[0x0],_0x705be0=(_0x5050e2['method']||_0x2399fc(0x187))[_0x2399fc(0x17e)](),_0x508f59=_0x5050e2[_0x2399fc(0x1a3)],_0x14313c=_0x5050e2['file'],_0x300632=_0x5050e2['header'],_0x51c9a4=_0x5050e2[_0x2399fc(0x17d)]||'td';try{const _0x424dd3={};if(_0x300632){const _0x55faca=Array[_0x2399fc(0x177)](_0x300632)?_0x300632:[_0x300632];for(const _0x32393a of _0x55faca){const [_0x35722c,_0x34e64b]=parseHeader(_0x32393a);_0x424dd3[_0x35722c]=_0x34e64b;}}let _0x21595a;if(_0x508f59)_0x21595a=_0x508f59;else{if(_0x14313c)try{_0x21595a=RawAPI[_0x2399fc(0x190)](_0x14313c);}catch(_0x4d549e){return console[_0x2399fc(0x16b)]('Error:\x20'+(_0x4d549e instanceof Error?_0x4d549e['message']:String(_0x4d549e))),0x1;}}const _0x235d6b={'method':_0x705be0,'apiType':_0x51c9a4,'includeHeaders':_0x5dd831[_0x2399fc(0x1a6)]};_0x21595a&&(_0x235d6b['body']=_0x21595a);Object['keys'](_0x424dd3)[_0x2399fc(0x176)]>0x0&&(_0x235d6b[_0x2399fc(0x1a5)]=_0x424dd3);if(_0x5dd831[_0x2399fc(0x1a6)]){const _0x184fb7=resolveSite(_0x5dd831[_0x2399fc(0x168)]),_0x303a9f=getEndpoint(_0x184fb7,_0x51c9a4),_0xbc68a8=''+_0x303a9f+_0x2cece2;console[_0x2399fc(0x16b)]('>\x20'+_0x705be0+'\x20'+_0xbc68a8);const _0x11e6ab=getAuthHeaders(_0x184fb7),_0x5d72ba={..._0x11e6ab,..._0x424dd3};for(const [_0x4c4b9f,_0x52bb56]of Object['entries'](_0x5d72ba)){!isSensitiveHeader(_0x4c4b9f)&&console[_0x2399fc(0x16b)]('>\x20'+_0x4c4b9f+':\x20'+_0x52bb56);}_0x21595a&&console['error']('>'),console['error']('');}const _0x210769=await _0xfe3aa1['api']['request'](_0x2cece2,_0x235d6b);if(_0x5dd831[_0x2399fc(0x1a6)]&&_0x210769[_0x2399fc(0x1a5)]){console[_0x2399fc(0x16b)](_0x2399fc(0x1a9)+_0x210769[_0x2399fc(0x180)]);for(const [_0xb7a5ba,_0x388f12]of Object['entries'](_0x210769[_0x2399fc(0x1a5)])){!isSensitiveHeader(_0xb7a5ba)&&console['error']('<\x20'+_0xb7a5ba+':\x20'+_0x388f12);}console[_0x2399fc(0x16b)]('');}const _0x3aea0f=Boolean(_0x5dd831[_0x2399fc(0x1a1)]),_0xe18edb={'color':_0x5dd831[_0x2399fc(0x198)],'noColor':_0x5dd831[_0x2399fc(0x18f)]||_0x3aea0f&&!_0x5dd831[_0x2399fc(0x198)]},_0x3f4a81=colorizeJSON(_0x210769['data'],_0xe18edb);return _0x5dd831[_0x2399fc(0x1a1)]?(writeFileSync(_0x5dd831[_0x2399fc(0x1a1)],_0x3f4a81),console[_0x2399fc(0x16b)]('Results\x20saved\x20to\x20'+_0x5dd831[_0x2399fc(0x1a1)])):console[_0x2399fc(0x199)](_0x3f4a81),0x0;}catch(_0x212c84){return _0x212c84 instanceof Error?(console[_0x2399fc(0x16b)]('Error:\x20'+_0x212c84[_0x2399fc(0x183)]),_0x5dd831[_0x2399fc(0x1a6)]&&_0x212c84[_0x2399fc(0x19b)]&&console['error'](_0x2399fc(0x189)+_0x212c84['stack'])):console[_0x2399fc(0x16b)](_0x2399fc(0x171)+String(_0x212c84)),0x1;}}}
1
+ const a6_0x14b3ae=a6_0x2120;(function(_0x470d77,_0x254855){const _0x123328=a6_0x2120,_0x298797=_0x470d77();while(!![]){try{const _0x1a0ecd=-parseInt(_0x123328(0x125))/0x1*(-parseInt(_0x123328(0x148))/0x2)+-parseInt(_0x123328(0x127))/0x3+-parseInt(_0x123328(0x154))/0x4*(-parseInt(_0x123328(0x163))/0x5)+-parseInt(_0x123328(0x15a))/0x6*(-parseInt(_0x123328(0x13d))/0x7)+parseInt(_0x123328(0x14f))/0x8*(-parseInt(_0x123328(0x155))/0x9)+-parseInt(_0x123328(0x158))/0xa*(parseInt(_0x123328(0x149))/0xb)+parseInt(_0x123328(0x132))/0xc;if(_0x1a0ecd===_0x254855)break;else _0x298797['push'](_0x298797['shift']());}catch(_0x14fcff){_0x298797['push'](_0x298797['shift']());}}}(a6_0x116a,0x2a647));import{BaseCommand}from'./command.js';function a6_0x2120(_0x2da84d,_0x1c9bb5){_0x2da84d=_0x2da84d-0x125;const _0x116a56=a6_0x116a();let _0x21203d=_0x116a56[_0x2da84d];return _0x21203d;}import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';function a6_0x116a(){const _0x22e4c8=['77KaMYmp','headers','Invalid\x20API\x20type:\x20','.\x20Valid\x20methods:\x20','Invalid\x20header\x20format:\x20\x22','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','startsWith','readBodyFromFile','.\x20Valid\x20types:\x20','isArray','stack','4tyXgsm','2785574NtXpNx','set-cookie2','verbose','trim','keys','Results\x20saved\x20to\x20','2120uyGXuQ','length','method','file','color','3448ZNzDuE','8199PxDKtD','has','DELETE','10huqgJE','llm','148026cwufwL','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','cookie','\x0aStack\x20trace:\x0a','data','output','error','noColor','x-xsrf-token','15fBGyZr','description','PUT','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','header','91687nVpDDz','message','192456CwkkmX','GET','status','name','site','log','x-auth-token','toLowerCase','execute','PATCH','substring','3301188XYsyEq','set-cookie','request','<\x20HTTP/1.1\x20','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','toUpperCase','api','Error:\x20','type','join','entries'];a6_0x116a=function(){return _0x22e4c8;};return a6_0x116a();}import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set(['authorization','proxy-authorization',a6_0x14b3ae(0x15c),a6_0x14b3ae(0x133),a6_0x14b3ae(0x14a),a6_0x14b3ae(0x162),a6_0x14b3ae(0x12d),'x-trino-user']);function isSensitiveHeader(_0x2f2ba2){const _0x15028a=a6_0x14b3ae;return SENSITIVE_HEADERS[_0x15028a(0x156)](_0x2f2ba2[_0x15028a(0x12e)]());}function parseHeader(_0x5aeebd){const _0x58ba91=a6_0x14b3ae,_0x34f436=_0x5aeebd['indexOf'](':');if(_0x34f436===-0x1)throw new Error(_0x58ba91(0x141)+_0x5aeebd+'\x22.\x20'+_0x58ba91(0x142));const _0x1fa068=_0x5aeebd['substring'](0x0,_0x34f436)[_0x58ba91(0x14c)](),_0x29bc66=_0x5aeebd[_0x58ba91(0x131)](_0x34f436+0x1)['trim']();if(!_0x1fa068)throw new Error(_0x58ba91(0x15b)+_0x5aeebd+'\x22');return[_0x1fa068,_0x29bc66];}export class ApiCommand extends BaseCommand{[a6_0x14b3ae(0x12a)]=a6_0x14b3ae(0x138);[a6_0x14b3ae(0x164)]=a6_0x14b3ae(0x166);['validate'](_0x5a21e0){const _0x3a7588=a6_0x14b3ae,{args:_0x54aa58,options:_0x25dcde}=_0x5a21e0,_0xde9c84=_0x25dcde;if(_0x54aa58[_0x3a7588(0x150)]===0x0)return'Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list';const _0x243078=_0x54aa58[0x0];if(!_0x243078[_0x3a7588(0x143)]('/'))return'Endpoint\x20must\x20start\x20with\x20/:\x20'+_0x243078;const _0x475bab=_0xde9c84[_0x3a7588(0x15e)],_0x495bdd=_0xde9c84['file'];if(_0x475bab&&_0x495bdd)return _0x3a7588(0x136);const _0x35fff1=_0xde9c84[_0x3a7588(0x151)]||'GET',_0x351bb6=['GET','POST',_0x3a7588(0x165),_0x3a7588(0x157),_0x3a7588(0x130)];if(!_0x351bb6['includes'](_0x35fff1[_0x3a7588(0x137)]()))return'Invalid\x20HTTP\x20method:\x20'+_0x35fff1+_0x3a7588(0x140)+_0x351bb6[_0x3a7588(0x13b)](',\x20');const _0x8f5c48=_0xde9c84[_0x3a7588(0x13a)]||'td',_0x28d0be=['td','cdp','workflow','trino',_0x3a7588(0x159),'llm-proxy'];if(!_0x28d0be['includes'](_0x8f5c48))return _0x3a7588(0x13f)+_0x8f5c48+_0x3a7588(0x145)+_0x28d0be[_0x3a7588(0x13b)](',\x20');return undefined;}async[a6_0x14b3ae(0x12f)](_0x2a9ffe){const _0x48b78d=a6_0x14b3ae,{options:_0x58e5b8,args:_0x4156cd,tdx:_0x4551bf}=_0x2a9ffe,_0x479d03=_0x58e5b8,_0x23e9b1=_0x4156cd[0x0],_0x131bcc=(_0x479d03[_0x48b78d(0x151)]||_0x48b78d(0x128))[_0x48b78d(0x137)](),_0x2d74d0=_0x479d03[_0x48b78d(0x15e)],_0x35e3bb=_0x479d03[_0x48b78d(0x152)],_0x28e58c=_0x479d03[_0x48b78d(0x167)],_0x5b2cd2=_0x479d03[_0x48b78d(0x13a)]||'td';try{const _0x5c10e2={};if(_0x28e58c){const _0x288721=Array[_0x48b78d(0x146)](_0x28e58c)?_0x28e58c:[_0x28e58c];for(const _0x46a18f of _0x288721){const [_0x1274b4,_0x69b8d9]=parseHeader(_0x46a18f);_0x5c10e2[_0x1274b4]=_0x69b8d9;}}let _0x233a95;if(_0x2d74d0)_0x233a95=_0x2d74d0;else{if(_0x35e3bb)try{_0x233a95=RawAPI[_0x48b78d(0x144)](_0x35e3bb);}catch(_0x12abd9){return console['error'](_0x48b78d(0x139)+(_0x12abd9 instanceof Error?_0x12abd9[_0x48b78d(0x126)]:String(_0x12abd9))),0x1;}}const _0x6ec213={'method':_0x131bcc,'apiType':_0x5b2cd2,'includeHeaders':_0x58e5b8[_0x48b78d(0x14b)]};_0x233a95&&(_0x6ec213['body']=_0x233a95);Object[_0x48b78d(0x14d)](_0x5c10e2)[_0x48b78d(0x150)]>0x0&&(_0x6ec213[_0x48b78d(0x13e)]=_0x5c10e2);if(_0x58e5b8[_0x48b78d(0x14b)]){const _0x5f4f64=resolveSite(_0x58e5b8[_0x48b78d(0x12b)]),_0x8a834b=getEndpoint(_0x5f4f64,_0x5b2cd2),_0x5584f6=''+_0x8a834b+_0x23e9b1;console[_0x48b78d(0x160)]('>\x20'+_0x131bcc+'\x20'+_0x5584f6);const _0x35f2d8=getAuthHeaders(_0x5f4f64),_0xbe238b={..._0x35f2d8,..._0x5c10e2};for(const [_0x8aad14,_0x4a039c]of Object[_0x48b78d(0x13c)](_0xbe238b)){!isSensitiveHeader(_0x8aad14)&&console['error']('>\x20'+_0x8aad14+':\x20'+_0x4a039c);}_0x233a95&&console[_0x48b78d(0x160)]('>'),console[_0x48b78d(0x160)]('');}const _0x1505c8=await _0x4551bf['api'][_0x48b78d(0x134)](_0x23e9b1,_0x6ec213);if(_0x58e5b8[_0x48b78d(0x14b)]&&_0x1505c8[_0x48b78d(0x13e)]){console[_0x48b78d(0x160)](_0x48b78d(0x135)+_0x1505c8[_0x48b78d(0x129)]);for(const [_0x144019,_0x565e8d]of Object[_0x48b78d(0x13c)](_0x1505c8[_0x48b78d(0x13e)])){!isSensitiveHeader(_0x144019)&&console[_0x48b78d(0x160)]('<\x20'+_0x144019+':\x20'+_0x565e8d);}console[_0x48b78d(0x160)]('');}const _0x2ad15b=Boolean(_0x58e5b8[_0x48b78d(0x15f)]),_0x3bf65c={'color':_0x58e5b8[_0x48b78d(0x153)],'noColor':_0x58e5b8[_0x48b78d(0x161)]||_0x2ad15b&&!_0x58e5b8[_0x48b78d(0x153)]},_0x563395=colorizeJSON(_0x1505c8['data'],_0x3bf65c);return _0x58e5b8[_0x48b78d(0x15f)]?(writeFileSync(_0x58e5b8[_0x48b78d(0x15f)],_0x563395),console['error'](_0x48b78d(0x14e)+_0x58e5b8[_0x48b78d(0x15f)])):console[_0x48b78d(0x12c)](_0x563395),0x0;}catch(_0x19ed06){return _0x19ed06 instanceof Error?(console[_0x48b78d(0x160)](_0x48b78d(0x139)+_0x19ed06[_0x48b78d(0x126)]),_0x58e5b8[_0x48b78d(0x14b)]&&_0x19ed06['stack']&&console[_0x48b78d(0x160)](_0x48b78d(0x15d)+_0x19ed06[_0x48b78d(0x147)])):console[_0x48b78d(0x160)](_0x48b78d(0x139)+String(_0x19ed06)),0x1;}}}
@@ -1 +1 @@
1
- function a7_0x5b15(_0x2a3c84,_0x420dd8){_0x2a3c84=_0x2a3c84-0xb9;const _0x4dc414=a7_0x4dc4();let _0x5b150a=_0x4dc414[_0x2a3c84];return _0x5b150a;}const a7_0x193020=a7_0x5b15;(function(_0x53a152,_0x2d343d){const _0x3d078d=a7_0x5b15,_0xf6055b=_0x53a152();while(!![]){try{const _0xb7fe29=-parseInt(_0x3d078d(0xff))/0x1*(parseInt(_0x3d078d(0xe2))/0x2)+parseInt(_0x3d078d(0xd4))/0x3+parseInt(_0x3d078d(0x100))/0x4*(parseInt(_0x3d078d(0xe0))/0x5)+-parseInt(_0x3d078d(0xf7))/0x6+-parseInt(_0x3d078d(0xfa))/0x7+-parseInt(_0x3d078d(0xc3))/0x8*(parseInt(_0x3d078d(0xd3))/0x9)+parseInt(_0x3d078d(0xcd))/0xa;if(_0xb7fe29===_0x2d343d)break;else _0xf6055b['push'](_0xf6055b['shift']());}catch(_0x3c3789){_0xf6055b['push'](_0xf6055b['shift']());}}}(a7_0x4dc4,0x8a0b7));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';import{buildSiteChoices}from'../core/constants.js';import a7_0xe0d3b2 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_0x4dc4(){const _0x1deed4=['\x0aSetup\x20cancelled','272533JWTSZc','45556gjJbZo','User:\x20','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','Name:\x20','✓\x20Authentication\x20successful\x0a','✓\x20API\x20key\x20removed\x20from\x20keychain','test','log','yellow','join','You\x20can\x20find\x20your\x20API\x20key\x20at:','\x27\x20registered','143432zlLeDn','Remove\x20API\x20key\x20from\x20system\x20keychain','text','select','bold','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','auth:clear','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','description','logLevel','11887620hQVNPU','profile','Enter\x20your\x20TD\x20API\x20key:','\x20--profile\x20','Site\x20name\x20cannot\x20be\x20empty','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','558hzDYAo','1833651kmCvNQ','Read\x20credential\x20from\x20','\x20\x20tdx','tdx:\x20auth\x20clear','✓\x20Default\x20site\x20set\x20to\x20','getUserInfo','Enter\x20site\x20name:','error','Validating\x20API\x20key...','last_name','Setting\x20up\x20authentication\x20for\x20site:\x20','site','365jNBsEL','name','2muWMay','message','API\x20key\x20cannot\x20be\x20empty','warn','Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','filter','password','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','create','\x20for\x20profile:\x20','customSite','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','tdx\x20profile:\x20','green','status','execute','✓\x20Profile\x20\x27','red','trim','Select\x20your\x20Treasure\x20Data\x20site:','3127536tExjZz','✗\x20Validation\x20failed:\x20','/app/mp/ak','1123906eVvtvg','other','auth','apiKey'];a7_0x4dc4=function(){return _0x1deed4;};return a7_0x4dc4();}import a7_0xc70c22 from'chalk';export class AuthSetupCommand extends BaseCommand{[a7_0x193020(0xe1)]='auth:setup';['description']='Setup\x20API\x20key\x20authentication\x20interactively';async[a7_0x193020(0xf2)](_0x2d1553){const _0x1d35f7=a7_0x193020,{options:_0x39154e}=_0x2d1553,_0x7d4b55=_0x39154e[_0x1d35f7(0xce)];console[_0x1d35f7(0xbe)](a7_0xc70c22[_0x1d35f7(0xc7)]('tdx:\x20auth\x20setup'));const _0x10dc66=_0x39154e['site']||'us01',{choices:_0x593801,initialIndex:_0x19bbd0}=buildSiteChoices(_0x10dc66),_0x4b430c=_0x7d4b55?_0x1d35f7(0xe6)+_0x7d4b55+'):':_0x1d35f7(0xf6),_0x1e468c=await a7_0xe0d3b2({'type':_0x1d35f7(0xc6),'name':_0x1d35f7(0xdf),'message':_0x4b430c,'choices':_0x593801,'initial':_0x19bbd0});if(!_0x1e468c[_0x1d35f7(0xdf)])return console[_0x1d35f7(0xbe)](_0x1d35f7(0xfe)),0x1;let _0x495a74;if(_0x1e468c[_0x1d35f7(0xdf)]===_0x1d35f7(0xfb)){const _0x51285a=await a7_0xe0d3b2({'type':_0x1d35f7(0xc5),'name':'customSite','message':_0x1d35f7(0xda),'initial':'us01','validate':_0x4c8ddf=>{const _0x2653e5=_0x1d35f7;if(!_0x4c8ddf||!_0x4c8ddf[_0x2653e5(0xf5)]())return _0x2653e5(0xd1);if(!/^[a-z0-9-]+$/[_0x2653e5(0xbd)](_0x4c8ddf[_0x2653e5(0xf5)]()))return _0x2653e5(0xe7);return!![];}});if(!_0x51285a[_0x1d35f7(0xed)])return console['log'](_0x1d35f7(0xfe)),0x1;_0x495a74=_0x51285a['customSite'];}else _0x495a74=_0x1e468c[_0x1d35f7(0xdf)];const _0x5ebb03=resolveSite(_0x495a74);console[_0x1d35f7(0xbe)](_0x1d35f7(0xde)+_0x5ebb03),console[_0x1d35f7(0xbe)](_0x1d35f7(0xc1)),console['log']('\x20\x20'+getConsoleUrl(_0x5ebb03,_0x1d35f7(0xf9)));const _0x3b0cbc=await a7_0xe0d3b2({'type':_0x1d35f7(0xe9),'name':'apiKey','message':_0x1d35f7(0xcf),'validate':_0x1cb9a5=>{const _0x47de61=_0x1d35f7;if(!_0x1cb9a5||!_0x1cb9a5[_0x47de61(0xf5)]())return _0x47de61(0xe4);return!![];}});if(!_0x3b0cbc['apiKey'])return console[_0x1d35f7(0xbe)]('\x0aSetup\x20cancelled'),0x1;const _0x215516=_0x3b0cbc[_0x1d35f7(0xfd)];console['log'](_0x1d35f7(0xdc));try{const _0x7c3a9c=TDX[_0x1d35f7(0xeb)]({'site':_0x5ebb03,'apiKey':_0x215516[_0x1d35f7(0xf5)](),'logLevel':_0x39154e[_0x1d35f7(0xcc)]??LogLevel['ERROR']}),_0x4ad05d=await _0x7c3a9c['jobs']['getUserInfo']();console['log']('✓\x20API\x20key\x20is\x20valid\x20(User:\x20'+_0x4ad05d['email']+')');const _0xdc5a1b=await isKeychainAvailable();_0xdc5a1b?(await saveAPIKeyAsync(_0x215516[_0x1d35f7(0xf5)](),_0x5ebb03,_0x7d4b55),console[_0x1d35f7(0xbe)](_0x1d35f7(0xb9)+(_0x7d4b55?'\x20(profile:\x20'+_0x7d4b55+')':''))):(console[_0x1d35f7(0xe5)](a7_0xc70c22[_0x1d35f7(0xbf)]('⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.')),console[_0x1d35f7(0xe5)](a7_0xc70c22[_0x1d35f7(0xbf)](_0x1d35f7(0xea))));if(_0x7d4b55){const _0x15782b={'site':_0x5ebb03};saveProfileToUserConfig(_0x7d4b55,_0x15782b),console[_0x1d35f7(0xbe)](_0x1d35f7(0xf3)+_0x7d4b55+_0x1d35f7(0xc2));}else saveDefaultSiteToUserConfig(_0x5ebb03),console[_0x1d35f7(0xbe)](_0x1d35f7(0xd8)+_0x5ebb03);const _0x59af3a=_0x7d4b55?_0x1d35f7(0xd0)+_0x7d4b55:'';return console[_0x1d35f7(0xbe)](),console[_0x1d35f7(0xbe)](_0x1d35f7(0xee)),console[_0x1d35f7(0xbe)](_0x1d35f7(0xd6)+_0x59af3a+_0x1d35f7(0xca)),console[_0x1d35f7(0xbe)](_0x1d35f7(0xd6)+_0x59af3a+_0x1d35f7(0xd2)),0x0;}catch(_0x29469a){if(_0x29469a instanceof HTTPClientError&&_0x29469a[_0x1d35f7(0xf1)]===0x191)return printAuthError(_0x29469a),0x1;return console[_0x1d35f7(0xdb)](a7_0xc70c22[_0x1d35f7(0xf4)](_0x1d35f7(0xf8)+(_0x29469a instanceof Error?_0x29469a[_0x1d35f7(0xe3)]:String(_0x29469a)))),console[_0x1d35f7(0xdb)](_0x1d35f7(0xc8)),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x193020(0xe1)]=a7_0x193020(0xfc);[a7_0x193020(0xcb)]='Show\x20authentication\x20status\x20and\x20validate\x20API\x20key';async[a7_0x193020(0xf2)](_0x326378){const _0x2aec75=a7_0x193020,{options:_0xdedb43,tdx:_0x4e7af3}=_0x326378,_0xbd5cb9=_0xdedb43['site'],_0x2ca1f4=_0xdedb43['profile'],_0xe7fb8b=_0x2ca1f4?_0x2ca1f4:'N/A';console[_0x2aec75(0xbe)](_0x2aec75(0xef)+_0xe7fb8b+'\x20(site:\x20'+_0xbd5cb9+')');const _0x1bf380=await resolveAPIKeyAsync(_0xbd5cb9,_0x2ca1f4);if(_0x1bf380){const {source:_0xa0a7db,isDeprecated:_0x414c82}=_0x1bf380,_0x27fc7b=_0x2aec75(0xd5)+_0xa0a7db;console[_0x2aec75(0xbe)](_0x414c82?a7_0xc70c22[_0x2aec75(0xbf)](_0x27fc7b):_0x27fc7b);}else console[_0x2aec75(0xbe)](a7_0xc70c22[_0x2aec75(0xbf)]('No\x20credential\x20found'));try{const _0x4630cc=await _0x4e7af3['jobs'][_0x2aec75(0xd9)]();return console[_0x2aec75(0xbe)](a7_0xc70c22[_0x2aec75(0xf0)](_0x2aec75(0xbb))),console[_0x2aec75(0xbe)](_0x2aec75(0x101)+_0x4630cc['email']),(_0x4630cc['first_name']||_0x4630cc[_0x2aec75(0xdd)])&&console[_0x2aec75(0xbe)](_0x2aec75(0xba)+[_0x4630cc['first_name'],_0x4630cc[_0x2aec75(0xdd)]][_0x2aec75(0xe8)](Boolean)[_0x2aec75(0xc0)]('\x20')),0x0;}catch(_0x1c497c){return _0x1c497c instanceof HTTPClientError&&_0x1c497c[_0x2aec75(0xf1)]===0x191?printAuthError(_0x1c497c,!![],_0x2ca1f4):console[_0x2aec75(0xdb)](a7_0xc70c22[_0x2aec75(0xf4)](_0x2aec75(0xf8)+(_0x1c497c instanceof Error?_0x1c497c['message']:String(_0x1c497c)))),0x1;}}}export class AuthClearCommand extends BaseCommand{['name']=a7_0x193020(0xc9);[a7_0x193020(0xcb)]=a7_0x193020(0xc4);async[a7_0x193020(0xf2)](_0x2967ab){const _0x4e7980=a7_0x193020,{options:_0x520ece}=_0x2967ab,_0x442ce6=_0x520ece[_0x4e7980(0xce)];console[_0x4e7980(0xbe)](a7_0xc70c22[_0x4e7980(0xc7)](_0x4e7980(0xd7)));const _0x342432=await isKeychainAvailable();if(!_0x342432)return console[_0x4e7980(0xdb)](a7_0xc70c22[_0x4e7980(0xf4)]('System\x20keychain\x20is\x20not\x20available')),0x1;const _0x42d0ed=await deleteKeychainAPIKey(_0x442ce6);return _0x42d0ed?(clearCredentialCache(),console['log'](_0x4e7980(0xbc)+(_0x442ce6?'\x20(profile:\x20'+_0x442ce6+')':'')),0x0):(console[_0x4e7980(0xbe)]('No\x20API\x20key\x20found\x20in\x20keychain'+(_0x442ce6?_0x4e7980(0xec)+_0x442ce6:'')),0x1);}}
1
+ const a7_0x31d674=a7_0x45ed;(function(_0x541d74,_0x3ca421){const _0x8a59bf=a7_0x45ed,_0x3e585a=_0x541d74();while(!![]){try{const _0x49daf1=parseInt(_0x8a59bf(0x1dd))/0x1+parseInt(_0x8a59bf(0x1b7))/0x2*(parseInt(_0x8a59bf(0x1ac))/0x3)+-parseInt(_0x8a59bf(0x1e2))/0x4*(parseInt(_0x8a59bf(0x1b8))/0x5)+parseInt(_0x8a59bf(0x1be))/0x6+parseInt(_0x8a59bf(0x1b1))/0x7+-parseInt(_0x8a59bf(0x1c8))/0x8*(-parseInt(_0x8a59bf(0x1d5))/0x9)+-parseInt(_0x8a59bf(0x1bc))/0xa*(parseInt(_0x8a59bf(0x1a8))/0xb);if(_0x49daf1===_0x3ca421)break;else _0x3e585a['push'](_0x3e585a['shift']());}catch(_0x50523e){_0x3e585a['push'](_0x3e585a['shift']());}}}(a7_0x4a58,0x4f901));function a7_0x4a58(){const _0x3fc6a1=['Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','getUserInfo','email','message','✓\x20Profile\x20\x27','tdx:\x20auth\x20clear','Setup\x20API\x20key\x20authentication\x20interactively','112rdVzPe','✗\x20Validation\x20failed:\x20','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','test','status','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','Select\x20your\x20Treasure\x20Data\x20site:','auth:clear','ERROR','description','/app/mp/ak','trim','select','26172cejFOK','✓\x20Default\x20site\x20set\x20to\x20','✓\x20API\x20key\x20removed\x20from\x20keychain','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','No\x20credential\x20found','first_name','apiKey','name','646673UHolvY','API\x20key\x20cannot\x20be\x20empty','Read\x20credential\x20from\x20','logLevel','last_name','9132zMXxQR','create','Site\x20name\x20cannot\x20be\x20empty','\x20(site:\x20','Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20','\x0aSetup\x20cancelled','error','site','jobs','filter','Validating\x20API\x20key...','bold','tdx\x20profile:\x20','Enter\x20site\x20name:','You\x20can\x20find\x20your\x20API\x20key\x20at:','\x20(profile:\x20','execute','User:\x20','\x27\x20registered','N/A','11394042NIYROU','join','No\x20API\x20key\x20found\x20in\x20keychain','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','40497chMPFh','auth','log','us01','customSite','3560676eymWqf','\x20\x20tdx','password','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','red','Name:\x20','30CUyvna','305QeeExa','yellow','green','profile','10iEzCCc','auth:setup','614616fMqfWC','\x20--profile\x20','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'];a7_0x4a58=function(){return _0x3fc6a1;};return a7_0x4a58();}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';function a7_0x45ed(_0x2ac5e8,_0x22d4eb){_0x2ac5e8=_0x2ac5e8-0x197;const _0x4a5816=a7_0x4a58();let _0x45ede9=_0x4a5816[_0x2ac5e8];return _0x45ede9;}import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';import{buildSiteChoices}from'../core/constants.js';import a7_0x58efa7 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_0x30355b from'chalk';export class AuthSetupCommand extends BaseCommand{[a7_0x31d674(0x1dc)]=a7_0x31d674(0x1bd);[a7_0x31d674(0x1d1)]=a7_0x31d674(0x1c7);async[a7_0x31d674(0x1a4)](_0x3f5db4){const _0x20a50a=a7_0x31d674,{options:_0x3fe8ef}=_0x3f5db4,_0x1cec4d=_0x3fe8ef[_0x20a50a(0x1bb)];console[_0x20a50a(0x1ae)](a7_0x30355b[_0x20a50a(0x19f)]('tdx:\x20auth\x20setup'));const _0x80b6a5=_0x3fe8ef[_0x20a50a(0x19b)]||_0x20a50a(0x1af),{choices:_0x682ad8,initialIndex:_0xf3a47c}=buildSiteChoices(_0x80b6a5),_0x10f894=_0x1cec4d?_0x20a50a(0x198)+_0x1cec4d+'):':_0x20a50a(0x1ce),_0x556eb9=await a7_0x58efa7({'type':_0x20a50a(0x1d4),'name':_0x20a50a(0x19b),'message':_0x10f894,'choices':_0x682ad8,'initial':_0xf3a47c});if(!_0x556eb9[_0x20a50a(0x19b)])return console['log'](_0x20a50a(0x199)),0x1;let _0x5a1427;if(_0x556eb9[_0x20a50a(0x19b)]==='other'){const _0x16b80c=await a7_0x58efa7({'type':'text','name':_0x20a50a(0x1b0),'message':_0x20a50a(0x1a1),'initial':_0x20a50a(0x1af),'validate':_0xd5356f=>{const _0x8f8b24=_0x20a50a;if(!_0xd5356f||!_0xd5356f[_0x8f8b24(0x1d3)]())return _0x8f8b24(0x1e4);if(!/^[a-z0-9-]+$/[_0x8f8b24(0x1cb)](_0xd5356f['trim']()))return _0x8f8b24(0x1c1);return!![];}});if(!_0x16b80c[_0x20a50a(0x1b0)])return console[_0x20a50a(0x1ae)](_0x20a50a(0x199)),0x1;_0x5a1427=_0x16b80c[_0x20a50a(0x1b0)];}else _0x5a1427=_0x556eb9['site'];const _0x1fe505=resolveSite(_0x5a1427);console[_0x20a50a(0x1ae)]('Setting\x20up\x20authentication\x20for\x20site:\x20'+_0x1fe505),console[_0x20a50a(0x1ae)](_0x20a50a(0x1a2)),console[_0x20a50a(0x1ae)]('\x20\x20'+getConsoleUrl(_0x1fe505,_0x20a50a(0x1d2)));const _0xb50290=await a7_0x58efa7({'type':_0x20a50a(0x1b3),'name':_0x20a50a(0x1db),'message':'Enter\x20your\x20TD\x20API\x20key:','validate':_0x18a322=>{const _0x4f0510=_0x20a50a;if(!_0x18a322||!_0x18a322[_0x4f0510(0x1d3)]())return _0x4f0510(0x1de);return!![];}});if(!_0xb50290['apiKey'])return console['log']('\x0aSetup\x20cancelled'),0x1;const _0x251c45=_0xb50290['apiKey'];console['log'](_0x20a50a(0x19e));try{const _0x69055e=TDX[_0x20a50a(0x1e3)]({'site':_0x1fe505,'apiKey':_0x251c45[_0x20a50a(0x1d3)](),'logLevel':_0x3fe8ef[_0x20a50a(0x1e0)]??LogLevel[_0x20a50a(0x1d0)]}),_0x56a416=await _0x69055e[_0x20a50a(0x19c)][_0x20a50a(0x1c2)]();console[_0x20a50a(0x1ae)](_0x20a50a(0x1d8)+_0x56a416[_0x20a50a(0x1c3)]+')');const _0x4fdca8=await isKeychainAvailable();_0x4fdca8?(await saveAPIKeyAsync(_0x251c45['trim'](),_0x1fe505,_0x1cec4d),console[_0x20a50a(0x1ae)]('✓\x20API\x20key\x20saved\x20to\x20system\x20keychain'+(_0x1cec4d?_0x20a50a(0x1a3)+_0x1cec4d+')':''))):(console['warn'](a7_0x30355b['yellow'](_0x20a50a(0x1ca))),console['warn'](a7_0x30355b[_0x20a50a(0x1b9)]('\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.')));if(_0x1cec4d){const _0x28c14e={'site':_0x1fe505};saveProfileToUserConfig(_0x1cec4d,_0x28c14e),console['log'](_0x20a50a(0x1c5)+_0x1cec4d+_0x20a50a(0x1a6));}else saveDefaultSiteToUserConfig(_0x1fe505),console[_0x20a50a(0x1ae)](_0x20a50a(0x1d6)+_0x1fe505);const _0x3fb933=_0x1cec4d?_0x20a50a(0x1bf)+_0x1cec4d:'';return console['log'](),console[_0x20a50a(0x1ae)](_0x20a50a(0x1cd)),console[_0x20a50a(0x1ae)](_0x20a50a(0x1b2)+_0x3fb933+_0x20a50a(0x1c0)),console[_0x20a50a(0x1ae)](_0x20a50a(0x1b2)+_0x3fb933+_0x20a50a(0x1b4)),0x0;}catch(_0xb7308d){if(_0xb7308d instanceof HTTPClientError&&_0xb7308d[_0x20a50a(0x1cc)]===0x191)return printAuthError(_0xb7308d),0x1;return console[_0x20a50a(0x19a)](a7_0x30355b[_0x20a50a(0x1b5)](_0x20a50a(0x1c9)+(_0xb7308d instanceof Error?_0xb7308d[_0x20a50a(0x1c4)]:String(_0xb7308d)))),console[_0x20a50a(0x19a)](_0x20a50a(0x1ab)),0x1;}}}export class AuthStatusCommand extends BaseCommand{['name']=a7_0x31d674(0x1ad);[a7_0x31d674(0x1d1)]='Show\x20authentication\x20status\x20and\x20validate\x20API\x20key';async[a7_0x31d674(0x1a4)](_0x49b84e){const _0xee1d57=a7_0x31d674,{options:_0x783cc0,tdx:_0x36b8b8}=_0x49b84e,_0x275006=_0x783cc0['site'],_0x960d24=_0x783cc0[_0xee1d57(0x1bb)],_0x4fd94a=_0x960d24?_0x960d24:_0xee1d57(0x1a7);console[_0xee1d57(0x1ae)](_0xee1d57(0x1a0)+_0x4fd94a+_0xee1d57(0x197)+_0x275006+')');const _0x490fa4=await resolveAPIKeyAsync(_0x275006,_0x960d24);if(_0x490fa4){const {source:_0x3d1059,isDeprecated:_0x307184}=_0x490fa4,_0x6f64d0=_0xee1d57(0x1df)+_0x3d1059;console[_0xee1d57(0x1ae)](_0x307184?a7_0x30355b[_0xee1d57(0x1b9)](_0x6f64d0):_0x6f64d0);}else console[_0xee1d57(0x1ae)](a7_0x30355b[_0xee1d57(0x1b9)](_0xee1d57(0x1d9)));try{const _0x15ec10=await _0x36b8b8[_0xee1d57(0x19c)][_0xee1d57(0x1c2)]();return console['log'](a7_0x30355b[_0xee1d57(0x1ba)]('✓\x20Authentication\x20successful\x0a')),console[_0xee1d57(0x1ae)](_0xee1d57(0x1a5)+_0x15ec10['email']),(_0x15ec10[_0xee1d57(0x1da)]||_0x15ec10[_0xee1d57(0x1e1)])&&console[_0xee1d57(0x1ae)](_0xee1d57(0x1b6)+[_0x15ec10['first_name'],_0x15ec10[_0xee1d57(0x1e1)]][_0xee1d57(0x19d)](Boolean)[_0xee1d57(0x1a9)]('\x20')),0x0;}catch(_0x347417){return _0x347417 instanceof HTTPClientError&&_0x347417[_0xee1d57(0x1cc)]===0x191?printAuthError(_0x347417,!![],_0x960d24):console[_0xee1d57(0x19a)](a7_0x30355b[_0xee1d57(0x1b5)](_0xee1d57(0x1c9)+(_0x347417 instanceof Error?_0x347417['message']:String(_0x347417)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x31d674(0x1dc)]=a7_0x31d674(0x1cf);['description']='Remove\x20API\x20key\x20from\x20system\x20keychain';async[a7_0x31d674(0x1a4)](_0x1707a4){const _0x22a694=a7_0x31d674,{options:_0x1f0866}=_0x1707a4,_0x42908f=_0x1f0866[_0x22a694(0x1bb)];console[_0x22a694(0x1ae)](a7_0x30355b[_0x22a694(0x19f)](_0x22a694(0x1c6)));const _0x1a488d=await isKeychainAvailable();if(!_0x1a488d)return console['error'](a7_0x30355b[_0x22a694(0x1b5)]('System\x20keychain\x20is\x20not\x20available')),0x1;const _0x5a4569=await deleteKeychainAPIKey(_0x42908f);return _0x5a4569?(clearCredentialCache(),console[_0x22a694(0x1ae)](_0x22a694(0x1d7)+(_0x42908f?_0x22a694(0x1a3)+_0x42908f+')':'')),0x0):(console['log'](_0x22a694(0x1aa)+(_0x42908f?'\x20for\x20profile:\x20'+_0x42908f:'')),0x1);}}
@@ -1 +1 @@
1
- const a8_0x26ba8f=a8_0x20bb;(function(_0x53845c,_0x2051d1){const _0x324b10=a8_0x20bb,_0x147d55=_0x53845c();while(!![]){try{const _0x1c9d91=-parseInt(_0x324b10(0xfd))/0x1+-parseInt(_0x324b10(0x109))/0x2*(-parseInt(_0x324b10(0x10a))/0x3)+-parseInt(_0x324b10(0x104))/0x4*(parseInt(_0x324b10(0x11e))/0x5)+parseInt(_0x324b10(0xfe))/0x6+parseInt(_0x324b10(0xdc))/0x7*(parseInt(_0x324b10(0xff))/0x8)+-parseInt(_0x324b10(0x11c))/0x9*(parseInt(_0x324b10(0xf7))/0xa)+parseInt(_0x324b10(0x117))/0xb;if(_0x1c9d91===_0x2051d1)break;else _0x147d55['push'](_0x147d55['shift']());}catch(_0x25c8b9){_0x147d55['push'](_0x147d55['shift']());}}}(a8_0x283a,0xadb49));function a8_0x283a(){const _0x16acb0=['log','type','13343781cZiOWs','getDefaultAgent','error','llmAgent','verbose','36vbNVlh','Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together','15aVxAWm','description','slice','session\x20context','streamChat','\x0aError:\x20','llm','targetWebSearchTool','write','includes','tool_call','stringify','llmProject','streamChatJsonl','options','245UJOZiA','404','context','site','metadata','validate','projectId','chat-create','stack','message','agent','startChat','Using\x20cached\x20default\x20agent:\x20','event','execute','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','CHAT_NOT_FOUND','tool','cause','targetFunction','Error:\x20Chat\x20session\x20\x27','join','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','code','\x27\x20not\x20found','resolveProjectId','\x27...','1130860YYVdlH','done','data','chat','agentId','Continuing\x20chat:\x20','726119gLJEih','8266386ubDnCM','18152LppyDa','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','Chat\x20session:\x20','targetKnowledgeBase','args','1281036trVjhx','content','Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22','Error:\x20','Using\x20agent\x20from\x20','45130WaxQlx','24AjxLKe','handleChatEvent','resolveAgentId','Resolving\x20project\x20\x27','\x20\x20Cause:\x20','getOrCreateDefaultAgent','chatId','No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22','Getting\x20default\x20agent...','Resolving\x20agent\x20\x27','name'];a8_0x283a=function(){return _0x16acb0;};return a8_0x283a();}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(_0x24d04b,_0x363a7b){const _0x395b85=a8_0x20bb;if(_0x24d04b instanceof SDKError)console[_0x395b85(0x119)](_0x395b85(0x107)+_0x24d04b[_0x395b85(0xe5)]),_0x363a7b[_0x395b85(0x11b)]&&(_0x24d04b[_0x395b85(0xee)]&&console[_0x395b85(0x119)](_0x395b85(0x10e)+_0x24d04b['cause']),_0x24d04b[_0x395b85(0xe4)]&&(console[_0x395b85(0x119)]('\x0aStack\x20trace:'),console['error'](_0x24d04b['stack'])));else throw _0x24d04b;}async function resolveAgentId(_0x27d708,_0x5d7b34,_0x43fe38,_0x2c424e,_0x1df255){const _0x414469=a8_0x20bb,_0x1aba0c=_0x5d7b34||_0x43fe38;if(_0x1aba0c){const {projectName:_0x1be771,agentName:_0x479b3b}=parseAgentRef(_0x1aba0c),_0x317e53=_0x479b3b||_0x1aba0c,_0x415f71=_0x479b3b?_0x1be771:_0x2c424e;if(!_0x415f71)throw new Error(_0x414469(0x111));if(_0x1df255){const _0x37dba9=_0x5d7b34?'--agent\x20flag':_0x414469(0x121);console[_0x414469(0x119)](_0x414469(0x108)+_0x37dba9+':\x20'+_0x415f71+'/'+_0x317e53);}const _0x45aba6=await withSpinner(_0x414469(0x10d)+_0x415f71+_0x414469(0xf6),()=>_0x27d708['llm'][_0x414469(0xf5)](_0x415f71),{'verbose':_0x1df255}),_0x51cc2f=await withSpinner(_0x414469(0x113)+_0x317e53+_0x414469(0xf6),()=>_0x27d708[_0x414469(0xd3)][_0x414469(0x10c)](_0x317e53,_0x45aba6[_0x414469(0xf9)]),{'verbose':_0x1df255});return _0x51cc2f['data'];}else{const _0x1ab0a1=_0x27d708[_0x414469(0xd3)][_0x414469(0x118)]();if(_0x1ab0a1)return _0x1df255&&console[_0x414469(0x119)](_0x414469(0xe8)+_0x1ab0a1[_0x414469(0x114)]),_0x1ab0a1['id'];const _0x8b4a95=await withSpinner(_0x414469(0x112),()=>_0x27d708['llm'][_0x414469(0x10f)]('claude-4.5-haiku',0x0),{'verbose':_0x1df255});return _0x8b4a95['data']['id'];}}export class ChatCommand extends BaseCommand{['name']=a8_0x26ba8f(0xfa);[a8_0x26ba8f(0x11f)]=a8_0x26ba8f(0xeb);[a8_0x26ba8f(0xe1)](_0x5a807c){const _0x1d093a=a8_0x26ba8f,_0x51e8b4=_0x5a807c[_0x1d093a(0x103)][_0x1d093a(0xf1)]('\x20');if(!_0x51e8b4)return _0x1d093a(0xf2);return undefined;}async[a8_0x26ba8f(0x122)](_0x9da598,_0x1c4df5,_0xed35af,_0x30d89c,_0x36ef01){const _0x12e9a6=a8_0x26ba8f;for await(const _0x55570e of _0x9da598[_0x12e9a6(0xd3)][_0x12e9a6(0xfa)](_0x1c4df5,{'agentId':_0xed35af,'chatId':_0x30d89c})){if(_0x55570e['type']==='metadata'){const _0x3e7f09=_0x55570e[_0x12e9a6(0xf9)][_0x12e9a6(0x110)];saveLastChatId(_0x3e7f09),_0x36ef01&&console['error'](_0x12e9a6(0x101)+_0x3e7f09);}else _0x55570e[_0x12e9a6(0x116)]==='event'&&this['handleChatEvent'](_0x55570e['data']);}}async['streamChatJsonl'](_0x11ffd1,_0x560ac3,_0x3f0576,_0x20ed5a){const _0x506efd=a8_0x26ba8f,_0xcc847e=_0x11ffd1[_0x506efd(0xde)][_0x506efd(0xdf)];let _0xb2c79e=![];for await(const _0x236c5c of _0x11ffd1['llm'][_0x506efd(0xfa)](_0x560ac3,{'agentId':_0x3f0576,'chatId':_0x20ed5a})){if(_0x236c5c[_0x506efd(0x116)]===_0x506efd(0xe0)){const _0x47e32b=_0x236c5c[_0x506efd(0xf9)];saveLastChatId(_0x47e32b[_0x506efd(0x110)]);const _0x686a56=_0x47e32b[_0x506efd(0xe2)]&&_0x47e32b['agentId']?getLLMConversationUrl(_0xcc847e,_0x47e32b[_0x506efd(0xe2)],_0x47e32b['agentId'],_0x47e32b[_0x506efd(0x110)]):undefined;console[_0x506efd(0x115)](JSON['stringify']({'type':_0x506efd(0xe0),'data':{'chatId':_0x47e32b['chatId'],'agentId':_0x47e32b[_0x506efd(0xfb)],'consoleUrl':_0x686a56}})),_0xb2c79e=!![];}else{if(_0x236c5c[_0x506efd(0x116)]===_0x506efd(0xe9)){!_0xb2c79e&&_0x20ed5a&&(console[_0x506efd(0x115)](JSON['stringify']({'type':_0x506efd(0xe0),'data':{'chatId':_0x20ed5a}})),_0xb2c79e=!![]);const _0x9405b2=_0x236c5c[_0x506efd(0xf9)];if('content'in _0x9405b2)console['log'](JSON[_0x506efd(0xd8)]({'type':_0x506efd(0x105),'data':{'content':_0x9405b2[_0x506efd(0x105)]}}));else{if(_0x506efd(0xd7)in _0x9405b2){const _0x4e8a54=_0x9405b2[_0x506efd(0xd7)];console[_0x506efd(0x115)](JSON['stringify']({'type':'tool_call','data':{'id':_0x4e8a54['id'],'name':_0x4e8a54['functionName'],'target':_0x4e8a54[_0x506efd(0x102)]?.[_0x506efd(0x114)]||_0x4e8a54['targetAgent']?.['name']||_0x4e8a54[_0x506efd(0xd4)]?.[_0x506efd(0x114)]||_0x4e8a54[_0x506efd(0xef)]}}));}else{if(_0x506efd(0xed)in _0x9405b2)console[_0x506efd(0x115)](JSON[_0x506efd(0xd8)]({'type':'tool_result','data':{'id':_0x9405b2[_0x506efd(0xed)]['id'],'name':_0x9405b2[_0x506efd(0xed)]['functionName'],'result':typeof _0x9405b2[_0x506efd(0xed)][_0x506efd(0x105)]==='string'?_0x9405b2[_0x506efd(0xed)]['content'][_0x506efd(0x120)](0x0,0x1f4):''}}));else _0x506efd(0x119)in _0x9405b2&&console[_0x506efd(0x115)](JSON[_0x506efd(0xd8)]({'type':_0x506efd(0x119),'data':{'error':_0x9405b2['error']}}));}}}}}console['log'](JSON[_0x506efd(0xd8)]({'type':_0x506efd(0xf8)}));}async[a8_0x26ba8f(0xea)](_0x31675e){const _0x423b42=a8_0x26ba8f,{options:_0x25283e,args:_0x1240fd,tdx:_0x50fa94}=_0x31675e,_0x38e455=_0x1240fd[_0x423b42(0xf1)]('\x20'),_0xf962ca=_0x25283e,_0x15b770=_0xf962ca[_0x423b42(0xe6)],_0xdd678b=_0xf962ca[_0x423b42(0x11a)],_0x44caa0=_0xf962ca['llmProject'],_0xe8846f=_0xf962ca['new'],_0x200ec9=_0xf962ca[_0x423b42(0x110)],_0x50f52d=_0xf962ca['stream'];if(_0xe8846f&&_0x200ec9)return console['error'](_0x423b42(0x11d)),0x1;try{let _0x4db43d,_0x289a82;if(_0x200ec9)_0x289a82=_0x200ec9;else!_0xe8846f&&(_0x289a82=loadLastChatId(),_0x289a82&&_0x25283e['verbose']&&console['error'](_0x423b42(0xfc)+_0x289a82));!_0x200ec9&&(_0xe8846f||!_0x289a82)&&(_0x4db43d=await resolveAgentId(_0x50fa94,_0x15b770,_0xdd678b,_0x44caa0,_0x25283e[_0x423b42(0x11b)]));const _0x257dff=_0x50f52d?(_0x63bf6b,_0x6abeea,_0x4e6b92)=>this[_0x423b42(0xda)](_0x50fa94,_0x63bf6b,_0x6abeea,_0x4e6b92):(_0xfff64b,_0x56a7e1,_0x2caee7)=>this['streamChat'](_0x50fa94,_0xfff64b,_0x56a7e1,_0x2caee7,_0x25283e[_0x423b42(0x11b)]);try{await _0x257dff(_0x38e455,_0x4db43d,_0x289a82);}catch(_0xa8f0d3){const _0x53512e=_0xa8f0d3 instanceof SDKError&&_0xa8f0d3[_0x423b42(0xf3)]===ErrorCode[_0x423b42(0xec)]||_0xa8f0d3 instanceof Error&&_0xa8f0d3[_0x423b42(0xe5)][_0x423b42(0xd6)](_0x423b42(0xdd));if(_0x53512e&&_0x200ec9)return console[_0x423b42(0x119)](_0x423b42(0xf0)+_0x200ec9+_0x423b42(0xf4)),0x1;if(_0x53512e)_0x25283e['verbose']&&console[_0x423b42(0x119)](_0x423b42(0x100)),!_0x4db43d&&(_0x4db43d=await resolveAgentId(_0x50fa94,_0x15b770,_0xdd678b,_0x44caa0,_0x25283e[_0x423b42(0x11b)])),await _0x257dff(_0x38e455,_0x4db43d,undefined);else throw _0xa8f0d3;}return!_0x50f52d&&console[_0x423b42(0x115)](),0x0;}catch(_0x3489b3){return console[_0x423b42(0x119)](),handleSDKError(_0x3489b3,_0x25283e),0x1;}}[a8_0x26ba8f(0x10b)](_0x327799){const _0xd400c1=a8_0x26ba8f;if(_0xd400c1(0x105)in _0x327799)process['stdout'][_0xd400c1(0xd5)](_0x327799[_0xd400c1(0x105)]);else _0xd400c1(0x119)in _0x327799&&console[_0xd400c1(0x119)](_0xd400c1(0x123)+_0x327799[_0xd400c1(0x119)]);}}function a8_0x20bb(_0x31fa68,_0x1dd08c){_0x31fa68=_0x31fa68-0xd3;const _0x283a4c=a8_0x283a();let _0x20bba0=_0x283a4c[_0x31fa68];return _0x20bba0;}export class ChatCreateCommand extends BaseCommand{['name']=a8_0x26ba8f(0xe3);[a8_0x26ba8f(0x11f)]='Create\x20a\x20new\x20chat\x20session';[a8_0x26ba8f(0xe1)](_0x1f9016){const _0x27343f=a8_0x26ba8f,_0x1a60b1=_0x1f9016[_0x27343f(0xdb)],_0x2154c6=_0x1a60b1[_0x27343f(0xe6)],_0x20e3c3=_0x1a60b1[_0x27343f(0x11a)];if(!_0x2154c6&&!_0x20e3c3)return _0x27343f(0x106);return undefined;}async[a8_0x26ba8f(0xea)](_0x39dfbe){const _0x2f861c=a8_0x26ba8f,{options:_0x14265e,tdx:_0xf5f5bc}=_0x39dfbe,_0xbd2d0b=_0x14265e,_0x2a72a0=_0xbd2d0b[_0x2f861c(0xe6)],_0x31e1be=_0xbd2d0b[_0x2f861c(0x11a)],_0x397a5a=_0xbd2d0b[_0x2f861c(0xd9)];try{const _0x467fd9=await resolveAgentId(_0xf5f5bc,_0x2a72a0,_0x31e1be,_0x397a5a,_0x14265e[_0x2f861c(0x11b)]),_0x154b76=await _0xf5f5bc[_0x2f861c(0xd3)][_0x2f861c(0xe7)](_0x467fd9);return saveLastChatId(_0x154b76['id']),console['log'](JSON[_0x2f861c(0xd8)]({'chatId':_0x154b76['id'],'agentId':_0x467fd9})),0x0;}catch(_0xa338df){return handleSDKError(_0xa338df,_0x14265e),0x1;}}}
1
+ function a8_0x5d97(){const _0x2d80c3=['10026LTZCSV','string','includes','54710PzmcJn','description','Using\x20cached\x20default\x20agent:\x20','1760Ffmqxi','context','73xeBvBo','metadata','Getting\x20default\x20agent...','chatId','Resolving\x20agent\x20\x27','\x27\x20not\x20found','error','targetFunction','2194584dDrSeG','Continuing\x20chat:\x20','Resolving\x20project\x20\x27','args','Error:\x20Chat\x20session\x20\x27','stream','stringify','handleChatEvent','resolveProjectId','310Hgktgk','slice','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22','llmAgent','streamChat','log','chat','targetKnowledgeBase','5039064UwjeHW','agentId','tool_call','content','llm','Using\x20agent\x20from\x20','tool','new','288gpVngS','name','chat-create','Chat\x20session:\x20','\x20\x20Cause:\x20','\x0aStack\x20trace:','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','1053866YAROBI','projectId','options','data','type','targetWebSearchTool','startChat','targetAgent','agent','404','claude-4.5-haiku','message','cause','validate','functionName','write','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','join','done','stack','1988sChHbE','resolveAgentId','verbose','event','llmProject','--agent\x20flag','streamChatJsonl','session\x20context','1767792jRrjVM'];a8_0x5d97=function(){return _0x2d80c3;};return a8_0x5d97();}const a8_0x437b92=a8_0x10a7;(function(_0x31f34b,_0x46ab22){const _0x222494=a8_0x10a7,_0x32ee79=_0x31f34b();while(!![]){try{const _0x3f95b4=-parseInt(_0x222494(0xb5))/0x1*(parseInt(_0x222494(0xad))/0x2)+-parseInt(_0x222494(0xbd))/0x3+-parseInt(_0x222494(0xac))/0x4+-parseInt(_0x222494(0xb0))/0x5*(parseInt(_0x222494(0x89))/0x6)+parseInt(_0x222494(0xa4))/0x7*(parseInt(_0x222494(0xb3))/0x8)+-parseInt(_0x222494(0xcf))/0x9+-parseInt(_0x222494(0xc6))/0xa*(-parseInt(_0x222494(0x90))/0xb);if(_0x3f95b4===_0x46ab22)break;else _0x32ee79['push'](_0x32ee79['shift']());}catch(_0x4d2ad0){_0x32ee79['push'](_0x32ee79['shift']());}}}(a8_0x5d97,0x63979));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';function a8_0x10a7(_0x45c153,_0x47aeba){_0x45c153=_0x45c153-0x86;const _0x5d9736=a8_0x5d97();let _0x10a7a3=_0x5d9736[_0x45c153];return _0x10a7a3;}import{saveLastChatId,loadLastChatId}from'../sdk/llm/chat-cache.js';import{getLLMConversationUrl}from'../sdk/client/endpoints.js';function handleSDKError(_0x35983d,_0x17fb7c){const _0x54bcf7=a8_0x10a7;if(_0x35983d instanceof SDKError)console[_0x54bcf7(0xbb)]('Error:\x20'+_0x35983d['message']),_0x17fb7c[_0x54bcf7(0xa6)]&&(_0x35983d[_0x54bcf7(0x9c)]&&console['error'](_0x54bcf7(0x8d)+_0x35983d[_0x54bcf7(0x9c)]),_0x35983d[_0x54bcf7(0xa3)]&&(console[_0x54bcf7(0xbb)](_0x54bcf7(0x8e)),console[_0x54bcf7(0xbb)](_0x35983d[_0x54bcf7(0xa3)])));else throw _0x35983d;}async function resolveAgentId(_0x4a4bb1,_0x31a758,_0x18cb4b,_0x28d819,_0x35b355){const _0x215984=a8_0x10a7,_0x422862=_0x31a758||_0x18cb4b;if(_0x422862){const {projectName:_0x2c42f1,agentName:_0x3e672e}=parseAgentRef(_0x422862),_0x3378b5=_0x3e672e||_0x422862,_0x3a8d84=_0x3e672e?_0x2c42f1:_0x28d819;if(!_0x3a8d84)throw new Error('No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22');if(_0x35b355){const _0x32c7d7=_0x31a758?_0x215984(0xa9):_0x215984(0xab);console[_0x215984(0xbb)](_0x215984(0x86)+_0x32c7d7+':\x20'+_0x3a8d84+'/'+_0x3378b5);}const _0x178ef8=await withSpinner(_0x215984(0xbf)+_0x3a8d84+'\x27...',()=>_0x4a4bb1[_0x215984(0xd3)][_0x215984(0xc5)](_0x3a8d84),{'verbose':_0x35b355}),_0xc8ea6d=await withSpinner(_0x215984(0xb9)+_0x3378b5+'\x27...',()=>_0x4a4bb1[_0x215984(0xd3)][_0x215984(0xa5)](_0x3378b5,_0x178ef8[_0x215984(0x93)]),{'verbose':_0x35b355});return _0xc8ea6d[_0x215984(0x93)];}else{const _0x483c99=_0x4a4bb1['llm']['getDefaultAgent']();if(_0x483c99)return _0x35b355&&console[_0x215984(0xbb)](_0x215984(0xb2)+_0x483c99[_0x215984(0x8a)]),_0x483c99['id'];const _0x1138ec=await withSpinner(_0x215984(0xb7),()=>_0x4a4bb1[_0x215984(0xd3)]['getOrCreateDefaultAgent'](_0x215984(0x9a),0x0),{'verbose':_0x35b355});return _0x1138ec[_0x215984(0x93)]['id'];}}export class ChatCommand extends BaseCommand{[a8_0x437b92(0x8a)]=a8_0x437b92(0xcd);[a8_0x437b92(0xb1)]=a8_0x437b92(0x8f);[a8_0x437b92(0x9d)](_0x313308){const _0x8549b1=a8_0x437b92,_0x32971d=_0x313308[_0x8549b1(0xc0)][_0x8549b1(0xa1)]('\x20');if(!_0x32971d)return _0x8549b1(0xc8);return undefined;}async['streamChat'](_0xad969a,_0x38f26d,_0x193b35,_0x38c7f7,_0x5d67a9){const _0xf28647=a8_0x437b92;for await(const _0x39939a of _0xad969a[_0xf28647(0xd3)][_0xf28647(0xcd)](_0x38f26d,{'agentId':_0x193b35,'chatId':_0x38c7f7})){if(_0x39939a[_0xf28647(0x94)]===_0xf28647(0xb6)){const _0x35fbd=_0x39939a['data'][_0xf28647(0xb8)];saveLastChatId(_0x35fbd),_0x5d67a9&&console[_0xf28647(0xbb)](_0xf28647(0x8c)+_0x35fbd);}else _0x39939a[_0xf28647(0x94)]===_0xf28647(0xa7)&&this[_0xf28647(0xc4)](_0x39939a[_0xf28647(0x93)]);}}async[a8_0x437b92(0xaa)](_0x443a5f,_0x3ee6fa,_0x4c34b4,_0x108811){const _0x153046=a8_0x437b92,_0x54e496=_0x443a5f[_0x153046(0xb4)]['site'];let _0x192a04=![];for await(const _0x188460 of _0x443a5f['llm'][_0x153046(0xcd)](_0x3ee6fa,{'agentId':_0x4c34b4,'chatId':_0x108811})){if(_0x188460[_0x153046(0x94)]===_0x153046(0xb6)){const _0x1b0777=_0x188460['data'];saveLastChatId(_0x1b0777['chatId']);const _0x3755d4=_0x1b0777[_0x153046(0x91)]&&_0x1b0777[_0x153046(0xd0)]?getLLMConversationUrl(_0x54e496,_0x1b0777['projectId'],_0x1b0777[_0x153046(0xd0)],_0x1b0777['chatId']):undefined;console[_0x153046(0xcc)](JSON[_0x153046(0xc3)]({'type':_0x153046(0xb6),'data':{'chatId':_0x1b0777['chatId'],'agentId':_0x1b0777[_0x153046(0xd0)],'consoleUrl':_0x3755d4}})),_0x192a04=!![];}else{if(_0x188460['type']===_0x153046(0xa7)){!_0x192a04&&_0x108811&&(console['log'](JSON['stringify']({'type':_0x153046(0xb6),'data':{'chatId':_0x108811}})),_0x192a04=!![]);const _0x1c6036=_0x188460[_0x153046(0x93)];if(_0x153046(0xd2)in _0x1c6036)console[_0x153046(0xcc)](JSON[_0x153046(0xc3)]({'type':_0x153046(0xd2),'data':{'content':_0x1c6036[_0x153046(0xd2)]}}));else{if(_0x153046(0xd1)in _0x1c6036){const _0x8382ad=_0x1c6036['tool_call'];console['log'](JSON[_0x153046(0xc3)]({'type':_0x153046(0xd1),'data':{'id':_0x8382ad['id'],'name':_0x8382ad[_0x153046(0x9e)],'target':_0x8382ad[_0x153046(0xce)]?.[_0x153046(0x8a)]||_0x8382ad[_0x153046(0x97)]?.[_0x153046(0x8a)]||_0x8382ad[_0x153046(0x95)]?.[_0x153046(0x8a)]||_0x8382ad[_0x153046(0xbc)]}}));}else{if(_0x153046(0x87)in _0x1c6036)console[_0x153046(0xcc)](JSON[_0x153046(0xc3)]({'type':'tool_result','data':{'id':_0x1c6036[_0x153046(0x87)]['id'],'name':_0x1c6036[_0x153046(0x87)][_0x153046(0x9e)],'result':typeof _0x1c6036[_0x153046(0x87)][_0x153046(0xd2)]===_0x153046(0xae)?_0x1c6036[_0x153046(0x87)]['content'][_0x153046(0xc7)](0x0,0x1f4):''}}));else _0x153046(0xbb)in _0x1c6036&&console['log'](JSON[_0x153046(0xc3)]({'type':_0x153046(0xbb),'data':{'error':_0x1c6036[_0x153046(0xbb)]}}));}}}}}console[_0x153046(0xcc)](JSON[_0x153046(0xc3)]({'type':_0x153046(0xa2)}));}async['execute'](_0x2b7836){const _0x2ddc10=a8_0x437b92,{options:_0x45747b,args:_0x33d620,tdx:_0x2d6b7c}=_0x2b7836,_0x2bfd92=_0x33d620[_0x2ddc10(0xa1)]('\x20'),_0x159025=_0x45747b,_0x59ee7b=_0x159025[_0x2ddc10(0x98)],_0xd1ceb9=_0x159025[_0x2ddc10(0xca)],_0x15794c=_0x159025[_0x2ddc10(0xa8)],_0x434947=_0x159025[_0x2ddc10(0x88)],_0x12f6d8=_0x159025[_0x2ddc10(0xb8)],_0x579aca=_0x159025[_0x2ddc10(0xc2)];if(_0x434947&&_0x12f6d8)return console[_0x2ddc10(0xbb)]('Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together'),0x1;try{let _0x3a4b35,_0x387c4a;if(_0x12f6d8)_0x387c4a=_0x12f6d8;else!_0x434947&&(_0x387c4a=loadLastChatId(),_0x387c4a&&_0x45747b[_0x2ddc10(0xa6)]&&console[_0x2ddc10(0xbb)](_0x2ddc10(0xbe)+_0x387c4a));!_0x12f6d8&&(_0x434947||!_0x387c4a)&&(_0x3a4b35=await resolveAgentId(_0x2d6b7c,_0x59ee7b,_0xd1ceb9,_0x15794c,_0x45747b[_0x2ddc10(0xa6)]));const _0x121a70=_0x579aca?(_0x5849aa,_0x566263,_0x3c5f7e)=>this[_0x2ddc10(0xaa)](_0x2d6b7c,_0x5849aa,_0x566263,_0x3c5f7e):(_0x5cdc66,_0x2b5b06,_0x52699c)=>this[_0x2ddc10(0xcb)](_0x2d6b7c,_0x5cdc66,_0x2b5b06,_0x52699c,_0x45747b[_0x2ddc10(0xa6)]);try{await _0x121a70(_0x2bfd92,_0x3a4b35,_0x387c4a);}catch(_0x2f9e64){const _0x53f18a=_0x2f9e64 instanceof SDKError&&_0x2f9e64['code']===ErrorCode['CHAT_NOT_FOUND']||_0x2f9e64 instanceof Error&&_0x2f9e64[_0x2ddc10(0x9b)][_0x2ddc10(0xaf)](_0x2ddc10(0x99));if(_0x53f18a&&_0x12f6d8)return console[_0x2ddc10(0xbb)](_0x2ddc10(0xc1)+_0x12f6d8+_0x2ddc10(0xba)),0x1;if(_0x53f18a)_0x45747b[_0x2ddc10(0xa6)]&&console[_0x2ddc10(0xbb)](_0x2ddc10(0xa0)),!_0x3a4b35&&(_0x3a4b35=await resolveAgentId(_0x2d6b7c,_0x59ee7b,_0xd1ceb9,_0x15794c,_0x45747b[_0x2ddc10(0xa6)])),await _0x121a70(_0x2bfd92,_0x3a4b35,undefined);else throw _0x2f9e64;}return!_0x579aca&&console[_0x2ddc10(0xcc)](),0x0;}catch(_0x2ddec4){return console[_0x2ddc10(0xbb)](),handleSDKError(_0x2ddec4,_0x45747b),0x1;}}['handleChatEvent'](_0xd4140f){const _0x199d53=a8_0x437b92;if(_0x199d53(0xd2)in _0xd4140f)process['stdout'][_0x199d53(0x9f)](_0xd4140f[_0x199d53(0xd2)]);else'error'in _0xd4140f&&console[_0x199d53(0xbb)]('\x0aError:\x20'+_0xd4140f[_0x199d53(0xbb)]);}}export class ChatCreateCommand extends BaseCommand{[a8_0x437b92(0x8a)]=a8_0x437b92(0x8b);[a8_0x437b92(0xb1)]='Create\x20a\x20new\x20chat\x20session';[a8_0x437b92(0x9d)](_0x166b65){const _0x32e85c=a8_0x437b92,_0xa0d23f=_0x166b65[_0x32e85c(0x92)],_0x560627=_0xa0d23f[_0x32e85c(0x98)],_0x1a431b=_0xa0d23f[_0x32e85c(0xca)];if(!_0x560627&&!_0x1a431b)return _0x32e85c(0xc9);return undefined;}async['execute'](_0xc9e265){const _0x56053f=a8_0x437b92,{options:_0x1e9fd7,tdx:_0xefa17}=_0xc9e265,_0x58c760=_0x1e9fd7,_0x41e59b=_0x58c760[_0x56053f(0x98)],_0xd64382=_0x58c760[_0x56053f(0xca)],_0x387985=_0x58c760[_0x56053f(0xa8)];try{const _0x1722ef=await resolveAgentId(_0xefa17,_0x41e59b,_0xd64382,_0x387985,_0x1e9fd7[_0x56053f(0xa6)]),_0x2ab7ae=await _0xefa17['llm'][_0x56053f(0x96)](_0x1722ef);return saveLastChatId(_0x2ab7ae['id']),console[_0x56053f(0xcc)](JSON[_0x56053f(0xc3)]({'chatId':_0x2ab7ae['id'],'agentId':_0x1722ef})),0x0;}catch(_0x57baa5){return handleSDKError(_0x57baa5,_0x1e9fd7),0x1;}}}