@treasuredata/tdx 2026.3.19 → 2026.3.21

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 (226) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.d.ts +1 -1
  4. package/dist/cli-categories.js +1 -1
  5. package/dist/cli-categories.js.map +1 -1
  6. package/dist/cli.d.ts.map +1 -1
  7. package/dist/cli.js +1 -1
  8. package/dist/cli.js.map +1 -1
  9. package/dist/commands/activations.js +1 -1
  10. package/dist/commands/agent-command.js +1 -1
  11. package/dist/commands/agent-test-command.js +1 -1
  12. package/dist/commands/api-command.js +1 -1
  13. package/dist/commands/auth-command.js +1 -1
  14. package/dist/commands/auth-login-command.js +1 -1
  15. package/dist/commands/chat-command.js +1 -1
  16. package/dist/commands/claude-command.js +1 -1
  17. package/dist/commands/claude-statusline-command.js +1 -1
  18. package/dist/commands/claude-usage-command.js +1 -1
  19. package/dist/commands/command.js +1 -1
  20. package/dist/commands/connection-command.js +1 -1
  21. package/dist/commands/databases.js +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.js +1 -1
  28. package/dist/commands/engage-template-pull-command.js +1 -1
  29. package/dist/commands/engage-template-push-command.js +1 -1
  30. package/dist/commands/engage-template-validate-command.js +1 -1
  31. package/dist/commands/job-command.js +1 -1
  32. package/dist/commands/journey-command.js +1 -1
  33. package/dist/commands/journey-validate-command.js +1 -1
  34. package/dist/commands/llm-command.js +1 -1
  35. package/dist/commands/mcp-command.js +1 -1
  36. package/dist/commands/parent-segment-command.js +1 -1
  37. package/dist/commands/policy-command.d.ts +33 -0
  38. package/dist/commands/policy-command.d.ts.map +1 -0
  39. package/dist/commands/policy-command.js +1 -0
  40. package/dist/commands/policy-command.js.map +1 -0
  41. package/dist/commands/profile-command.js +1 -1
  42. package/dist/commands/profiles-command.js +1 -1
  43. package/dist/commands/query-command.js +1 -1
  44. package/dist/commands/schedule-command.js +1 -1
  45. package/dist/commands/segment-command.js +1 -1
  46. package/dist/commands/segment-create-command.js +1 -1
  47. package/dist/commands/segment-fields-command.js +1 -1
  48. package/dist/commands/segment-pull-command.js +1 -1
  49. package/dist/commands/segment-push-command.js +1 -1
  50. package/dist/commands/segment-update-command.js +1 -1
  51. package/dist/commands/segment-use-command.js +1 -1
  52. package/dist/commands/segment-validate-command.js +1 -1
  53. package/dist/commands/segments.js +1 -1
  54. package/dist/commands/show.js +1 -1
  55. package/dist/commands/status-command.js +1 -1
  56. package/dist/commands/tables.js +1 -1
  57. package/dist/commands/unset-command.js +1 -1
  58. package/dist/commands/upgrade-command.js +1 -1
  59. package/dist/commands/use-command.js +1 -1
  60. package/dist/commands/user-command.js +1 -1
  61. package/dist/commands/workflow-command.js +1 -1
  62. package/dist/core/auth.js +1 -1
  63. package/dist/core/command-output.js +1 -1
  64. package/dist/core/config.js +1 -1
  65. package/dist/core/connection-cache.js +1 -1
  66. package/dist/core/constants.js +1 -1
  67. package/dist/core/credential-cache.js +1 -1
  68. package/dist/core/global-context.js +1 -1
  69. package/dist/core/keychain.js +1 -1
  70. package/dist/core/oauth-keychain.js +1 -1
  71. package/dist/core/oauth.js +1 -1
  72. package/dist/core/profile.js +1 -1
  73. package/dist/core/project-config.js +1 -1
  74. package/dist/core/session.js +1 -1
  75. package/dist/core/user-cache.js +1 -1
  76. package/dist/core/version.js +1 -1
  77. package/dist/index.js +1 -1
  78. package/dist/mcp/server.js +1 -1
  79. package/dist/mcp/tools/index.js +1 -1
  80. package/dist/mcp/tools/tdx-run.js +1 -1
  81. package/dist/mcp/tools/tdx-search.js +1 -1
  82. package/dist/mcp/utils.js +1 -1
  83. package/dist/proxy/claude-usage-tracker.js +1 -1
  84. package/dist/proxy/passthrough-server.js +1 -1
  85. package/dist/proxy/sse-usage-parser.js +1 -1
  86. package/dist/sdk/agent/agent-config.js +1 -1
  87. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  88. package/dist/sdk/agent/agent-yaml.js +1 -1
  89. package/dist/sdk/agent/test/evaluator.js +1 -1
  90. package/dist/sdk/agent/test/executor.js +1 -1
  91. package/dist/sdk/agent/test/index.js +1 -1
  92. package/dist/sdk/agent/test/output.js +1 -1
  93. package/dist/sdk/agent/test/parser.js +1 -1
  94. package/dist/sdk/agent/tool-target-registry.js +1 -1
  95. package/dist/sdk/api.js +1 -1
  96. package/dist/sdk/client/cdp-api-client.js +1 -1
  97. package/dist/sdk/client/delivery-api-client.js +1 -1
  98. package/dist/sdk/client/endpoints.js +1 -1
  99. package/dist/sdk/client/engage-api-client.js +1 -1
  100. package/dist/sdk/client/http-client.js +1 -1
  101. package/dist/sdk/client/llm-api-client.js +1 -1
  102. package/dist/sdk/client/oauth-refresh.js +1 -1
  103. package/dist/sdk/client/rate-limiter.js +1 -1
  104. package/dist/sdk/client/td-api-client.js +1 -1
  105. package/dist/sdk/client/trino-api-client.js +1 -1
  106. package/dist/sdk/client/workflow-client.js +1 -1
  107. package/dist/sdk/connection-validator.js +1 -1
  108. package/dist/sdk/connection.js +1 -1
  109. package/dist/sdk/delivery.js +1 -1
  110. package/dist/sdk/engage/campaign-pull.js +1 -1
  111. package/dist/sdk/engage/campaign-push.js +1 -1
  112. package/dist/sdk/engage/campaign-validator.js +1 -1
  113. package/dist/sdk/engage/campaign-yaml.js +1 -1
  114. package/dist/sdk/engage/template-pull.js +1 -1
  115. package/dist/sdk/engage/template-push.js +1 -1
  116. package/dist/sdk/engage/template-validator.js +1 -1
  117. package/dist/sdk/engage/template-yaml.js +1 -1
  118. package/dist/sdk/engage/types/campaign-def.js +1 -1
  119. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  120. package/dist/sdk/engage/types/template-schema.js +1 -1
  121. package/dist/sdk/engage.js +1 -1
  122. package/dist/sdk/errors.js +1 -1
  123. package/dist/sdk/index.d.ts +7 -0
  124. package/dist/sdk/index.d.ts.map +1 -1
  125. package/dist/sdk/index.js +1 -1
  126. package/dist/sdk/index.js.map +1 -1
  127. package/dist/sdk/io/index.js +1 -1
  128. package/dist/sdk/io/node-filesystem.js +1 -1
  129. package/dist/sdk/job.js +1 -1
  130. package/dist/sdk/journey.js +1 -1
  131. package/dist/sdk/llm/chat-cache.js +1 -1
  132. package/dist/sdk/llm/index.js +1 -1
  133. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  134. package/dist/sdk/llm/model-factors.js +1 -1
  135. package/dist/sdk/personalization.js +1 -1
  136. package/dist/sdk/policy.d.ts +41 -0
  137. package/dist/sdk/policy.d.ts.map +1 -0
  138. package/dist/sdk/policy.js +1 -0
  139. package/dist/sdk/policy.js.map +1 -0
  140. package/dist/sdk/query/index.js +1 -1
  141. package/dist/sdk/query/sql-parser.js +1 -1
  142. package/dist/sdk/realtime.js +1 -1
  143. package/dist/sdk/schedule.js +1 -1
  144. package/dist/sdk/segment/child-segment-yaml.d.ts.map +1 -1
  145. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  146. package/dist/sdk/segment/child-segment-yaml.js.map +1 -1
  147. package/dist/sdk/segment/fields-display.js +1 -1
  148. package/dist/sdk/segment/file-discovery.js +1 -1
  149. package/dist/sdk/segment/journey-utils.js +1 -1
  150. package/dist/sdk/segment/journey-validator.js +1 -1
  151. package/dist/sdk/segment/journey-yaml.js +1 -1
  152. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  153. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  154. package/dist/sdk/segment/pull-workflow.js +1 -1
  155. package/dist/sdk/segment/push-recovery.js +1 -1
  156. package/dist/sdk/segment/push-workflow.js +1 -1
  157. package/dist/sdk/segment/resolution-context.js +1 -1
  158. package/dist/sdk/segment/segment-path-parser.js +1 -1
  159. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  160. package/dist/sdk/segment/segment-validator.js +1 -1
  161. package/dist/sdk/segment/segment-validator.js.map +1 -1
  162. package/dist/sdk/segment/target-resolution.js +1 -1
  163. package/dist/sdk/segment/tdx-config.js +1 -1
  164. package/dist/sdk/segment/types/activation-schema.js +1 -1
  165. package/dist/sdk/segment/types/journey-def.js +1 -1
  166. package/dist/sdk/segment/types/journey-schema.js +1 -1
  167. package/dist/sdk/segment/types/segment-def.js +1 -1
  168. package/dist/sdk/segment/types/segment-schema.js +1 -1
  169. package/dist/sdk/segment/validate-files.js +1 -1
  170. package/dist/sdk/segment/yaml-validator.js +1 -1
  171. package/dist/sdk/segment.js +1 -1
  172. package/dist/sdk/types/index.d.ts +1 -0
  173. package/dist/sdk/types/index.d.ts.map +1 -1
  174. package/dist/sdk/types/index.js +1 -1
  175. package/dist/sdk/types/index.js.map +1 -1
  176. package/dist/sdk/types/policy.d.ts +58 -0
  177. package/dist/sdk/types/policy.d.ts.map +1 -0
  178. package/dist/sdk/types/policy.js +1 -0
  179. package/dist/sdk/types/policy.js.map +1 -0
  180. package/dist/sdk/types/progress.js +1 -1
  181. package/dist/sdk/user.js +1 -1
  182. package/dist/sdk/util/format-detector.js +1 -1
  183. package/dist/sdk/util/formatters.js +1 -1
  184. package/dist/sdk/util/index.js +1 -1
  185. package/dist/sdk/util/paginate.js +1 -1
  186. package/dist/sdk/util/tree-formatter.js +1 -1
  187. package/dist/sdk/workflow/archive-validation.js +1 -1
  188. package/dist/sdk/workflow/clone-workflow.js +1 -1
  189. package/dist/sdk/workflow/index.js +1 -1
  190. package/dist/sdk/workflow/pull-workflow.js +1 -1
  191. package/dist/sdk/workflow/push-workflow.js +1 -1
  192. package/dist/sdk/workflow/tdx-config.js +1 -1
  193. package/dist/sdk/workflow/workflow-utils.js +1 -1
  194. package/dist/test-utils/command-runner.js +1 -1
  195. package/dist/test-utils/factories.js +1 -1
  196. package/dist/test-utils/fixtures.js +1 -1
  197. package/dist/test-utils/http-mock.js +1 -1
  198. package/dist/test-utils/index.js +1 -1
  199. package/dist/utils/async.js +1 -1
  200. package/dist/utils/colors.js +1 -1
  201. package/dist/utils/diff.js +1 -1
  202. package/dist/utils/file-permissions.js +1 -1
  203. package/dist/utils/file-reader.js +1 -1
  204. package/dist/utils/github-releases.js +1 -1
  205. package/dist/utils/global-cache.js +1 -1
  206. package/dist/utils/json-loader.js +1 -1
  207. package/dist/utils/local-cache.js +1 -1
  208. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  209. package/dist/utils/logger/formatters/index.js +1 -1
  210. package/dist/utils/logger/handlers/console-handler.js +1 -1
  211. package/dist/utils/logger/handlers/file-handler.js +1 -1
  212. package/dist/utils/logger/handlers/index.js +1 -1
  213. package/dist/utils/logger/handlers/null-handler.js +1 -1
  214. package/dist/utils/logger/index.js +1 -1
  215. package/dist/utils/logger/logger.js +1 -1
  216. package/dist/utils/logger/types.js +1 -1
  217. package/dist/utils/option-validation.js +1 -1
  218. package/dist/utils/process.js +1 -1
  219. package/dist/utils/prompt.js +1 -1
  220. package/dist/utils/spinner.js +1 -1
  221. package/dist/utils/sse-parser.js +1 -1
  222. package/dist/utils/string-utils.js +1 -1
  223. package/dist/utils/table-ref-parser.js +1 -1
  224. package/dist/utils/tdx-logger.js +1 -1
  225. package/dist/utils/version-check.js +1 -1
  226. package/package.json +1 -1
@@ -1 +1 @@
1
- const a4_0x40c5a9=a4_0x52db;(function(_0x25afe3,_0x215ce3){const _0x2fed22=a4_0x52db,_0x50efe3=_0x25afe3();while(!![]){try{const _0x50d42c=-parseInt(_0x2fed22(0x1f4))/0x1+-parseInt(_0x2fed22(0x1aa))/0x2*(parseInt(_0x2fed22(0x16c))/0x3)+-parseInt(_0x2fed22(0x1e4))/0x4*(parseInt(_0x2fed22(0x1ed))/0x5)+parseInt(_0x2fed22(0x172))/0x6*(parseInt(_0x2fed22(0x1d1))/0x7)+parseInt(_0x2fed22(0x1af))/0x8*(-parseInt(_0x2fed22(0x20a))/0x9)+-parseInt(_0x2fed22(0x18c))/0xa*(parseInt(_0x2fed22(0x1f5))/0xb)+parseInt(_0x2fed22(0x1ca))/0xc;if(_0x50d42c===_0x215ce3)break;else _0x50efe3['push'](_0x50efe3['shift']());}catch(_0x4d0c29){_0x50efe3['push'](_0x50efe3['shift']());}}}(a4_0x4731,0x30a36));import a4_0x8d4af9 from'chalk';import a4_0x4047d1 from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a4_0x4731(){const _0x5c0e0d=['Dry\x20run\x20-\x20no\x20changes\x20made','log','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','\x20\x20Prompt\x20\x22','\x20\x20Target:\x20','75KdnmWF','Agent\x20pulled\x20successfully','\x20successfully','updated','llm','agent:clone','\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','47948QjGdqv','81334eNRCtQ','\x0aChanges\x20to\x20prompt\x20\x27','\x20=\x20','\x20\x20Experimental\x20Artifact\x20\x22','\x20\x20Experimental\x20Artifacts:\x20','pullAgent','dirname','Output:\x20','-\x20no\x20files\x20written','\x20resources\x20to\x20\x27','\x20\x20Agents:\x20','\x20\x20Integration\x20\x22','sourceProjectName','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','\x0a✔\x20Pulled\x20','found','cwd-config','push','projectId','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','3352329ncuHTc','Using\x20current\x20project:\x20','agent','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','pushProject','\x20\x20Text\x20Knowledge\x20Bases:\x20','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','prompts','\x20total','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','error','errors','agentName','cwd','\x22\x20to\x20\x22','\x22\x20from\x20project\x20\x22','red','Source:\x20','gray','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','\x0aPull\x20summary\x20for\x20\x27','\x20\x20Integrations:\x20','\x0aPush\x20','\x20|\x20','\x20unchanged','integrations','dryRun','1190661KEtsBH','Cloning\x20\x22','Using\x20project\x20from\x20context:\x20','Status:\x20','Output\x20path:\x20','Using\x20project:\x20','106818YtjMGN','Using\x20project\x20from\x20','\x20files?','cloneProject','Would\x20push\x20agent:\x20','✔\x20Context\x20set:\x20','dim','source','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','\x20\x20Agent\x20\x22','Errors:','pullProject','\x20\x20Text\x20Knowledge\x20Base\x20\x22','hasChanges','Cancelled','\x20changed','outputPath','counts','execute','created','<new-name>','\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','\x0aWrite\x20','yellow','\x20files\x20to\x20','outputDir','170UyxJgd','New\x20project\x20ID:\x20','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','no_local_folder','repeat','\x20\x20tdx\x20agent\x20pull\x20','Writing\x20files...','\x20--name\x20','\x20\x20Knowledge\x20Base\x20\x22','pushAgent','INVALID_ARGUMENT','Using\x20local\x20project:\x20','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','-\x20nothing\x20pushed','total','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','\x20\x20Knowledge\x20Bases:\x20','\x0aChanges:','diff','profile','projectName','\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)','New\x20project:\x20','\x0aError:','experimentalArtifacts','knowledgeBases','\x0aPush\x20summary\x20for\x20\x27','\x0aChanges\x20to\x20integration\x20\x27','message','2CGCDKk','agentId','\x22:\x20','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','Agent:\x20','8WKxJZR','Analyzing\x20changes\x20to\x20push...','llm_project','\x20--profile\x20','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','Summary:','cyan','reason','Project\x20cloned\x20with\x20errors','session','Pulling\x20agent\x20\x22','\x0a✔\x20Pushed\x20','name','newProjectId','MISSING_ARGUMENT','\x20new','agent:pull','unchanged','llmProject','tdx.json','utf-8','join','yes','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','new','force','11143524bsmPwB','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','\x22...','no_context','newProjectName','\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','green','126VefXST','parse','Pushing\x20agent\x20from\x20\x22','action','Project\x20cloned\x20successfully','experimentalKnowledgeBases','textKnowledgeBases','context','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Using\x20context\x20project:\x20','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','Project:\x20','\x0aErrors\x20found:','\x0aProject\x20pushed\x20with\x20errors','arg-dir','site','\x20\x20Prompts:\x20','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','\x20\x20Source:\x20','28492cHfauX','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','Failed\x20to\x20push\x20agent:\x20','agents'];a4_0x4731=function(){return _0x5c0e0d;};return a4_0x4731();}import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext,resolveAgentPullArgs}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function a4_0x52db(_0x3fa26f,_0x417cd1){_0x3fa26f=_0x3fa26f-0x164;const _0x473126=a4_0x4731();let _0x52db2b=_0x473126[_0x3fa26f];return _0x52db2b;}function formatCountSummary(_0x3bb810){const _0x1beca0=a4_0x52db,_0x3966cc=[];if(_0x3bb810[_0x1beca0(0x19b)]!==undefined)_0x3966cc[_0x1beca0(0x206)](_0x3bb810[_0x1beca0(0x19b)]+_0x1beca0(0x212));if(_0x3bb810[_0x1beca0(0x1c8)]!==undefined&&_0x3bb810[_0x1beca0(0x1c8)]>0x0)_0x3966cc[_0x1beca0(0x206)](a4_0x8d4af9[_0x1beca0(0x1d0)](_0x3bb810[_0x1beca0(0x1c8)]+_0x1beca0(0x1bf)));if(_0x3bb810['created']!==undefined&&_0x3bb810[_0x1beca0(0x185)]>0x0)_0x3966cc['push'](a4_0x8d4af9[_0x1beca0(0x1d0)](_0x3bb810['created']+'\x20created'));if(_0x3bb810['updated']!==undefined&&_0x3bb810[_0x1beca0(0x1f0)]>0x0)_0x3966cc[_0x1beca0(0x206)](a4_0x8d4af9['yellow'](_0x3bb810[_0x1beca0(0x1f0)]+'\x20updated'));if(_0x3bb810['unchanged']!==undefined&&_0x3bb810['unchanged']>0x0)_0x3966cc[_0x1beca0(0x206)](a4_0x8d4af9['gray'](_0x3bb810[_0x1beca0(0x1c1)]+_0x1beca0(0x169)));if(_0x3bb810[_0x1beca0(0x215)]!==undefined&&_0x3bb810['errors']>0x0)_0x3966cc[_0x1beca0(0x206)](a4_0x8d4af9[_0x1beca0(0x21a)](_0x3bb810[_0x1beca0(0x215)]+'\x20errors'));return _0x3966cc[_0x1beca0(0x1c5)](',\x20');}function displayDiffs(_0x3c7b92,_0x410ab0,_0x4643c6,_0x70a5e,_0x16dc05,_0x55782f,_0x4a95f8){const _0x32caca=a4_0x52db;for(const _0x4adcb6 of _0x3c7b92){if(_0x4adcb6['diff']){const _0x14712e=_0x4adcb6[_0x32caca(0x216)]||_0x4adcb6[_0x32caca(0x1bc)];console[_0x32caca(0x1e9)]('\x0aChanges\x20to\x20agent\x20\x27'+_0x14712e+'\x27:'),console[_0x32caca(0x1e9)]('─'['repeat'](0x3c)),console[_0x32caca(0x1e9)](_0x4adcb6[_0x32caca(0x19f)]),console[_0x32caca(0x1e9)]('─'[_0x32caca(0x191)](0x3c));}}for(const _0x1f1df3 of _0x410ab0){_0x1f1df3[_0x32caca(0x19f)]&&(console[_0x32caca(0x1e9)]('\x0aChanges\x20to\x20knowledge\x20base\x20\x27'+_0x1f1df3[_0x32caca(0x1bc)]+'\x27:'),console[_0x32caca(0x1e9)]('─'['repeat'](0x3c)),console[_0x32caca(0x1e9)](_0x1f1df3['diff']),console[_0x32caca(0x1e9)]('─'[_0x32caca(0x191)](0x3c)));}for(const _0x4ea2e9 of _0x4643c6){_0x4ea2e9['diff']&&(console[_0x32caca(0x1e9)](_0x32caca(0x1ea)+_0x4ea2e9[_0x32caca(0x1bc)]+'\x27:'),console[_0x32caca(0x1e9)]('─'[_0x32caca(0x191)](0x3c)),console[_0x32caca(0x1e9)](_0x4ea2e9[_0x32caca(0x19f)]),console[_0x32caca(0x1e9)]('─'[_0x32caca(0x191)](0x3c)));}for(const _0xa74ef0 of _0x70a5e){_0xa74ef0[_0x32caca(0x19f)]&&(console[_0x32caca(0x1e9)](_0x32caca(0x1f6)+_0xa74ef0[_0x32caca(0x1bc)]+'\x27:'),console[_0x32caca(0x1e9)]('─'[_0x32caca(0x191)](0x3c)),console['log'](_0xa74ef0[_0x32caca(0x19f)]),console[_0x32caca(0x1e9)]('─'['repeat'](0x3c)));}for(const _0x47ed71 of _0x16dc05){_0x47ed71['diff']&&(console['log'](_0x32caca(0x1a8)+_0x47ed71[_0x32caca(0x1bc)]+'\x27:'),console['log']('─'['repeat'](0x3c)),console[_0x32caca(0x1e9)](_0x47ed71[_0x32caca(0x19f)]),console['log']('─'[_0x32caca(0x191)](0x3c)));}for(const _0x46425e of _0x55782f){_0x46425e[_0x32caca(0x19f)]&&(console[_0x32caca(0x1e9)]('\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27'+_0x46425e[_0x32caca(0x1bc)]+'\x27:'),console['log']('─'[_0x32caca(0x191)](0x3c)),console[_0x32caca(0x1e9)](_0x46425e['diff']),console['log']('─'[_0x32caca(0x191)](0x3c)));}for(const _0x1bbd1a of _0x4a95f8){_0x1bbd1a['diff']&&(console[_0x32caca(0x1e9)](_0x32caca(0x210)+_0x1bbd1a['name']+'\x27:'),console[_0x32caca(0x1e9)]('─'[_0x32caca(0x191)](0x3c)),console[_0x32caca(0x1e9)](_0x1bbd1a['diff']),console['log']('─'[_0x32caca(0x191)](0x3c)));}}export class AgentPullCommand extends BaseCommand{['name']=a4_0x40c5a9(0x1c0);['description']=a4_0x40c5a9(0x164);async[a4_0x40c5a9(0x184)](_0x4047eb){const _0x424afa=a4_0x40c5a9,{options:_0x4d3344,args:_0x4194f3,tdx:_0x30befb}=_0x4047eb,_0xcb4356=_0x4194f3[0x0],_0x56b43e=_0x4194f3[0x1],_0x509a64=_0x4d3344['output'],_0x1f610b=_0x4d3344[_0x424afa(0x16b)],_0x174703=_0x4d3344[_0x424afa(0x1c9)],_0x482f42=_0x4d3344[_0x424afa(0x1c6)],_0x51aa17=_0x4d3344[_0x424afa(0x1c2)],_0x388756=_0x4d3344[_0x424afa(0x20c)];let _0x325291;if(_0xcb4356){const _0x2f0d40=a4_0x4047d1[_0x424afa(0x1c5)](_0xcb4356,_0x424afa(0x1c3));if(existsSync(_0x2f0d40))try{const _0x371621=JSON['parse'](readFileSync(_0x2f0d40,_0x424afa(0x1c4)));_0x371621[_0x424afa(0x1b1)]&&(_0x325291={'llm_project':_0x371621[_0x424afa(0x1b1)]});}catch{}}const _0xf5eb51=findAgentConfigPath(process['cwd']());let _0x1935cf;if(_0xf5eb51)try{const _0x23ffe4=JSON[_0x424afa(0x1d2)](readFileSync(_0xf5eb51,_0x424afa(0x1c4)));_0x23ffe4[_0x424afa(0x1b1)]&&(_0x1935cf={'llm_project':_0x23ffe4[_0x424afa(0x1b1)]});}catch{}const _0x236547=resolveAgentPullArgs({'arg':_0xcb4356,'agentNameArg':_0x56b43e,'agentFlag':_0x388756,'contextProject':_0x51aa17,'argDirConfig':_0x325291,'cwdConfigPath':_0xf5eb51||undefined,'cwdConfig':_0x1935cf}),{projectNameOrId:_0x47ea66,targetAgentName:_0x11fd54,existingOutputDir:_0xac0f6c,source:_0x132dde}=_0x236547;if(_0x132dde===_0x424afa(0x1df))console[_0x424afa(0x1e9)](a4_0x8d4af9[_0x424afa(0x178)](_0x424afa(0x173)+a4_0x4047d1[_0x424afa(0x1c5)](_0xcb4356,_0x424afa(0x1c3))+':\x20'+_0x47ea66));else{if(_0x132dde===_0x424afa(0x205))console[_0x424afa(0x1e9)](a4_0x8d4af9['dim'](_0x424afa(0x171)+_0x47ea66));else _0x132dde===_0x424afa(0x1d8)&&console['log'](a4_0x8d4af9['dim'](_0x424afa(0x16e)+_0x47ea66));}if(!_0x47ea66)return _0x388756?(console[_0x424afa(0x1e9)](a4_0x8d4af9[_0x424afa(0x189)](_0x424afa(0x208))),console[_0x424afa(0x1e9)]('Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>'),console['log'](_0x424afa(0x1cb))):(console[_0x424afa(0x1e9)](a4_0x8d4af9[_0x424afa(0x189)](_0x424afa(0x1b4))),console[_0x424afa(0x1e9)]('Usage:\x20tdx\x20agent\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20project\x20(requires\x20context\x20or\x20tdx.json)'),console[_0x424afa(0x1e9)](_0x424afa(0x1f3)),console[_0x424afa(0x1e9)](_0x424afa(0x187)),console[_0x424afa(0x1e9)](_0x424afa(0x1cf)),console[_0x424afa(0x1e9)]('\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(_0x11fd54){const {data:_0x36a98b}=await withSpinner(_0x424afa(0x1ba)+_0x11fd54+_0x424afa(0x219)+_0x47ea66+_0x424afa(0x1cc),()=>_0x30befb[_0x424afa(0x1f1)][_0x424afa(0x1fa)](_0x47ea66,_0x11fd54,_0x509a64,{'dryRun':_0x1f610b,'force':_0x174703}));if(_0x1f610b)return console[_0x424afa(0x1e9)](a4_0x8d4af9['yellow']('Dry\x20run\x20-\x20no\x20files\x20written')),console['log']('Would\x20pull\x20agent:\x20'+_0x36a98b[_0x424afa(0x216)]),console[_0x424afa(0x1e9)](_0x424afa(0x170)+_0x36a98b['outputPath']),_0x36a98b['diff']&&(console[_0x424afa(0x1e9)](_0x424afa(0x19e)),console[_0x424afa(0x1e9)]('─'[_0x424afa(0x191)](0x3c)),console['log'](_0x36a98b[_0x424afa(0x19f)]),console[_0x424afa(0x1e9)]('─'[_0x424afa(0x191)](0x3c))),0x0;return console['log'](a4_0x8d4af9[_0x424afa(0x1d0)](_0x424afa(0x1ee))),console[_0x424afa(0x1e9)](_0x424afa(0x1ae)+_0x36a98b[_0x424afa(0x216)]),console[_0x424afa(0x1e9)](_0x424afa(0x1fc)+_0x36a98b[_0x424afa(0x182)]),console[_0x424afa(0x1e9)](_0x424afa(0x16f)+(_0x36a98b['isNew']?a4_0x8d4af9[_0x424afa(0x1d0)](_0x424afa(0x1c8)):_0x36a98b[_0x424afa(0x17f)]?a4_0x8d4af9['yellow']('updated'):a4_0x8d4af9[_0x424afa(0x21c)]('unchanged'))),0x0;}const _0x1407de=_0xac0f6c||_0x509a64,{data:_0x440a58}=await withSpinner('Analyzing\x20project\x20\x22'+_0x47ea66+_0x424afa(0x1cc),()=>_0x30befb[_0x424afa(0x1f1)][_0x424afa(0x17d)](_0x47ea66,_0x1407de,{'dryRun':!![]})),_0x36e110=_0x440a58[_0x424afa(0x183)][_0x424afa(0x1e7)][_0x424afa(0x1c8)]+_0x440a58[_0x424afa(0x183)][_0x424afa(0x1a6)]['new']+_0x440a58[_0x424afa(0x183)][_0x424afa(0x1d7)][_0x424afa(0x1c8)]+_0x440a58['counts'][_0x424afa(0x211)][_0x424afa(0x1c8)]+_0x440a58[_0x424afa(0x183)][_0x424afa(0x16a)][_0x424afa(0x1c8)]+_0x440a58[_0x424afa(0x183)][_0x424afa(0x1d6)]['new']+_0x440a58[_0x424afa(0x183)][_0x424afa(0x1a5)]['new'],_0x419ded=_0x440a58['counts'][_0x424afa(0x1e7)][_0x424afa(0x1f0)]+_0x440a58[_0x424afa(0x183)]['knowledgeBases'][_0x424afa(0x1f0)]+_0x440a58[_0x424afa(0x183)][_0x424afa(0x1d7)][_0x424afa(0x1f0)]+_0x440a58[_0x424afa(0x183)][_0x424afa(0x211)]['updated']+_0x440a58[_0x424afa(0x183)]['integrations'][_0x424afa(0x1f0)]+_0x440a58[_0x424afa(0x183)][_0x424afa(0x1d6)][_0x424afa(0x1f0)]+_0x440a58[_0x424afa(0x183)][_0x424afa(0x1a5)]['updated'],_0x1e0037=_0x440a58['counts'][_0x424afa(0x1e7)][_0x424afa(0x1c1)]+_0x440a58[_0x424afa(0x183)]['knowledgeBases']['unchanged']+_0x440a58[_0x424afa(0x183)][_0x424afa(0x1d7)][_0x424afa(0x1c1)]+_0x440a58[_0x424afa(0x183)][_0x424afa(0x211)][_0x424afa(0x1c1)]+_0x440a58[_0x424afa(0x183)][_0x424afa(0x16a)]['unchanged']+_0x440a58[_0x424afa(0x183)]['experimentalKnowledgeBases']['unchanged']+_0x440a58[_0x424afa(0x183)]['experimentalArtifacts'][_0x424afa(0x1c1)];console['log'](_0x424afa(0x165)+_0x440a58['projectName']+'\x27:'),console[_0x424afa(0x1e9)]('\x20\x20'+a4_0x8d4af9[_0x424afa(0x1d0)]('+\x20'+_0x36e110+_0x424afa(0x1bf))+_0x424afa(0x168)+a4_0x8d4af9[_0x424afa(0x189)]('~\x20'+_0x419ded+_0x424afa(0x181))+'\x20|\x20'+a4_0x8d4af9[_0x424afa(0x178)]('=\x20'+_0x1e0037+'\x20unchanged')),console[_0x424afa(0x1e9)]('\x20\x20Agents:\x20'+formatCountSummary(_0x440a58[_0x424afa(0x183)][_0x424afa(0x1e7)])),console[_0x424afa(0x1e9)](_0x424afa(0x19d)+formatCountSummary(_0x440a58[_0x424afa(0x183)][_0x424afa(0x1a6)])),console[_0x424afa(0x1e9)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x440a58[_0x424afa(0x183)][_0x424afa(0x1d7)])),console[_0x424afa(0x1e9)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x440a58[_0x424afa(0x183)]['prompts'])),console[_0x424afa(0x1e9)](_0x424afa(0x166)+formatCountSummary(_0x440a58[_0x424afa(0x183)][_0x424afa(0x16a)]));const _0x32e7bb=_0x440a58[_0x424afa(0x183)][_0x424afa(0x1d6)][_0x424afa(0x19b)]>0x0||_0x440a58[_0x424afa(0x183)][_0x424afa(0x1a5)][_0x424afa(0x19b)]>0x0;_0x32e7bb&&(console[_0x424afa(0x1e9)](_0x424afa(0x1db)+formatCountSummary(_0x440a58['counts'][_0x424afa(0x1d6)])),console[_0x424afa(0x1e9)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x440a58[_0x424afa(0x183)][_0x424afa(0x1a5)])));console[_0x424afa(0x1e9)](_0x424afa(0x1ec)+a4_0x8d4af9[_0x424afa(0x1b6)](_0x440a58[_0x424afa(0x18b)])),displayDiffs(_0x440a58[_0x424afa(0x1e7)],_0x440a58[_0x424afa(0x1a6)],_0x440a58[_0x424afa(0x1d7)],_0x440a58['prompts'],_0x440a58[_0x424afa(0x16a)],_0x440a58[_0x424afa(0x1d6)],_0x440a58[_0x424afa(0x1a5)]);if(_0x1f610b)return console['log'](a4_0x8d4af9[_0x424afa(0x189)](_0x424afa(0x209))),0x0;if(_0x36e110===0x0&&_0x419ded===0x0)return console[_0x424afa(0x1e9)](a4_0x8d4af9[_0x424afa(0x1d0)](_0x424afa(0x202))),saveSessionContext({'llm_project':_0x440a58[_0x424afa(0x1a1)]},_0x4d3344[_0x424afa(0x1b9)]),console[_0x424afa(0x1e9)](a4_0x8d4af9[_0x424afa(0x1d0)](_0x424afa(0x177)+a4_0x8d4af9['dim'](_0x424afa(0x1b1))+_0x424afa(0x1f7)+a4_0x8d4af9[_0x424afa(0x1b6)](_0x440a58[_0x424afa(0x1a1)]))),0x0;if(!_0x482f42&&!_0x174703){if(!isInteractive())return console[_0x424afa(0x214)](a4_0x8d4af9[_0x424afa(0x21a)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a4_0x8d4af9['dim'](_0x424afa(0x1d9))),0x1;const _0x1f6188=await confirmKey(_0x424afa(0x188)+(_0x36e110+_0x419ded)+_0x424afa(0x174));if(!_0x1f6188)return console['log'](a4_0x8d4af9['yellow'](_0x424afa(0x180)),_0x424afa(0x1fd)),0x1;}const {data:_0x2f7c79}=await withSpinner(_0x424afa(0x193),()=>_0x30befb[_0x424afa(0x1f1)]['pullProject'](_0x47ea66,_0x1407de,{'force':_0x174703}));return console[_0x424afa(0x1e9)](a4_0x8d4af9[_0x424afa(0x1d0)](_0x424afa(0x203)+(_0x36e110+_0x419ded)+_0x424afa(0x18a)+_0x2f7c79[_0x424afa(0x18b)])),saveSessionContext({'llm_project':_0x2f7c79[_0x424afa(0x1a1)]},_0x4d3344['session']),console['log'](a4_0x8d4af9[_0x424afa(0x1d0)](_0x424afa(0x177)+a4_0x8d4af9[_0x424afa(0x178)](_0x424afa(0x1b1))+_0x424afa(0x1f7)+a4_0x8d4af9[_0x424afa(0x1b6)](_0x2f7c79[_0x424afa(0x1a1)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x40c5a9(0x1bc)]=a4_0x40c5a9(0x1f2);['description']=a4_0x40c5a9(0x1c7);async['execute'](_0x51084c){const _0x2c459f=a4_0x40c5a9,{options:_0x442b0b,args:_0x51bd4b,tdx:_0x40de18}=_0x51084c,_0xfadf03=_0x51bd4b[0x0],_0x508573=_0x442b0b[_0x2c459f(0x1bc)],_0x1bf5a0=_0x442b0b[_0x2c459f(0x16b)],_0x5cdf4e=_0x442b0b[_0x2c459f(0x1c6)],_0x58cf13=_0x442b0b[_0x2c459f(0x1e0)],_0x4870cf=_0x442b0b[_0x2c459f(0x1c2)];let _0x8a2165;const _0x4a3efe=findAgentConfigPath(process[_0x2c459f(0x217)]());if(_0xfadf03){const _0x189cdc=a4_0x4047d1[_0x2c459f(0x1c5)](_0xfadf03,_0x2c459f(0x1c3));existsSync(_0x189cdc)?(_0x8a2165=_0xfadf03,console[_0x2c459f(0x1e9)](a4_0x8d4af9[_0x2c459f(0x178)](_0x2c459f(0x198)+_0xfadf03))):_0x8a2165=_0xfadf03;}else{if(_0x4a3efe)_0x8a2165=a4_0x4047d1[_0x2c459f(0x1fb)](_0x4a3efe),console['log'](a4_0x8d4af9[_0x2c459f(0x178)](_0x2c459f(0x20b)+_0x8a2165));else{if(_0x4870cf){const _0x1a2447=sanitizeForFilesystem(_0x4870cf);let _0x4d0f5a=_0x1a2447,_0x4efe8e=a4_0x4047d1[_0x2c459f(0x1c5)](process[_0x2c459f(0x217)](),_0x2c459f(0x1e7),_0x1a2447,_0x2c459f(0x1c3));if(!existsSync(_0x4efe8e)){const _0x48099f=normalizeName(_0x4870cf),_0x2107dd=a4_0x4047d1[_0x2c459f(0x1c5)](process[_0x2c459f(0x217)](),_0x2c459f(0x1e7),_0x48099f,_0x2c459f(0x1c3));existsSync(_0x2107dd)&&(_0x4d0f5a=_0x48099f,_0x4efe8e=_0x2107dd);}if(existsSync(_0x4efe8e))_0x8a2165=a4_0x4047d1['dirname'](_0x4efe8e),console[_0x2c459f(0x1e9)](a4_0x8d4af9[_0x2c459f(0x178)](_0x2c459f(0x198)+_0x8a2165));else{const _0x27eea4=_0x442b0b[_0x2c459f(0x1a0)];if(_0x27eea4)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Cannot\x20clone\x20from\x20context\x20project\x20\x22'+_0x4870cf+'\x22\x20to\x20a\x20different\x20profile',undefined,{'helpText':_0x2c459f(0x17a)+_0x2c459f(0x1e5)+(_0x2c459f(0x192)+_0x4870cf+'\x0a')+('\x20\x20tdx\x20agent\x20clone\x20agents/'+_0x4d0f5a+_0x2c459f(0x194)+(_0x508573||_0x2c459f(0x186))+_0x2c459f(0x1b2)+_0x27eea4)});_0x8a2165=_0x4870cf,console[_0x2c459f(0x1e9)](a4_0x8d4af9[_0x2c459f(0x178)](_0x2c459f(0x1da)+_0x4870cf));}}}}if(!_0x8a2165)return console[_0x2c459f(0x1e9)](a4_0x8d4af9[_0x2c459f(0x189)](_0x2c459f(0x18f))),console[_0x2c459f(0x1e9)](_0x2c459f(0x18e)),console[_0x2c459f(0x1e9)](_0x2c459f(0x1ad)),console['log'](_0x2c459f(0x1a2)),console[_0x2c459f(0x1e9)]('\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>'),0x1;if(!_0x508573)throw new SDKError(ErrorCode[_0x2c459f(0x1be)],'New\x20project\x20name\x20is\x20required',undefined,{'helpText':_0x2c459f(0x199)});if(!_0x5cdf4e&&!_0x1bf5a0){if(!isInteractive())return console[_0x2c459f(0x214)](a4_0x8d4af9[_0x2c459f(0x21a)](_0x2c459f(0x1a4)),_0x2c459f(0x20d)),console[_0x2c459f(0x214)](a4_0x8d4af9[_0x2c459f(0x178)](_0x2c459f(0x1d9))),0x1;const _0x5d4b2a=await confirmKey('Clone\x20\x22'+_0x8a2165+'\x22\x20to\x20new\x20project\x20\x22'+_0x508573+'\x22?');if(!_0x5d4b2a)return console[_0x2c459f(0x1e9)](a4_0x8d4af9['yellow']('Cancelled')),0x1;}const {data:_0x447923}=await withSpinner(_0x2c459f(0x16d)+_0x8a2165+_0x2c459f(0x218)+_0x508573+_0x2c459f(0x1cc),()=>_0x40de18[_0x2c459f(0x1f1)][_0x2c459f(0x175)](_0x8a2165,_0x508573,{'dryRun':_0x1bf5a0}));if(_0x1bf5a0){console['log'](a4_0x8d4af9[_0x2c459f(0x189)](_0x2c459f(0x1e8))),console[_0x2c459f(0x1e9)](_0x2c459f(0x21b)+_0x447923[_0x2c459f(0x201)]),console[_0x2c459f(0x1e9)](_0x2c459f(0x1a3)+_0x508573),console[_0x2c459f(0x1e9)]('Would\x20clone:'),console['log']('\x20\x20Agents:\x20'+_0x447923[_0x2c459f(0x183)][_0x2c459f(0x1e7)]['created']),console['log'](_0x2c459f(0x19d)+_0x447923[_0x2c459f(0x183)][_0x2c459f(0x1a6)]['created']),console[_0x2c459f(0x1e9)](_0x2c459f(0x1e1)+_0x447923[_0x2c459f(0x183)][_0x2c459f(0x211)][_0x2c459f(0x185)]);const _0x24c3f8=_0x447923['counts'][_0x2c459f(0x1d6)]['created']>0x0||_0x447923[_0x2c459f(0x183)]['experimentalArtifacts']['created']>0x0;return _0x24c3f8&&(console[_0x2c459f(0x1e9)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+_0x447923[_0x2c459f(0x183)][_0x2c459f(0x1d6)][_0x2c459f(0x185)]),console[_0x2c459f(0x1e9)](_0x2c459f(0x1f9)+_0x447923[_0x2c459f(0x183)]['experimentalArtifacts'][_0x2c459f(0x185)])),0x0;}const _0x3b85a7=_0x447923[_0x2c459f(0x183)]['agents'][_0x2c459f(0x215)]>0x0||_0x447923[_0x2c459f(0x183)][_0x2c459f(0x1a6)][_0x2c459f(0x215)]>0x0||_0x447923[_0x2c459f(0x183)][_0x2c459f(0x211)][_0x2c459f(0x215)]>0x0||_0x447923['counts'][_0x2c459f(0x1d6)]['errors']>0x0||_0x447923['counts'][_0x2c459f(0x1a5)]['errors']>0x0;_0x3b85a7?console[_0x2c459f(0x1e9)](a4_0x8d4af9[_0x2c459f(0x189)](_0x2c459f(0x1b8))):console['log'](a4_0x8d4af9[_0x2c459f(0x1d0)](_0x2c459f(0x1d5)));console[_0x2c459f(0x1e9)](_0x2c459f(0x21b)+_0x447923[_0x2c459f(0x201)]),console[_0x2c459f(0x1e9)]('New\x20project:\x20'+_0x447923[_0x2c459f(0x1ce)]),console[_0x2c459f(0x1e9)](_0x2c459f(0x18d)+_0x447923['newProjectId']),console[_0x2c459f(0x1e9)](),console[_0x2c459f(0x1e9)](_0x2c459f(0x1b5)),console['log'](_0x2c459f(0x1ff)+formatCountSummary(_0x447923[_0x2c459f(0x183)]['agents'])),console[_0x2c459f(0x1e9)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x447923[_0x2c459f(0x183)]['knowledgeBases'])),console[_0x2c459f(0x1e9)](_0x2c459f(0x1e1)+formatCountSummary(_0x447923['counts'][_0x2c459f(0x211)])),console['log'](_0x2c459f(0x166)+formatCountSummary(_0x447923[_0x2c459f(0x183)][_0x2c459f(0x16a)]));const _0x1b8577=_0x447923[_0x2c459f(0x183)][_0x2c459f(0x1d6)][_0x2c459f(0x185)]>0x0||_0x447923[_0x2c459f(0x183)][_0x2c459f(0x1d6)][_0x2c459f(0x1f0)]>0x0||_0x447923[_0x2c459f(0x183)][_0x2c459f(0x1d6)][_0x2c459f(0x1c1)]>0x0||_0x447923[_0x2c459f(0x183)][_0x2c459f(0x1a5)]['created']>0x0||_0x447923[_0x2c459f(0x183)]['experimentalArtifacts'][_0x2c459f(0x1f0)]>0x0||_0x447923[_0x2c459f(0x183)]['experimentalArtifacts'][_0x2c459f(0x1c1)]>0x0;_0x1b8577&&(console[_0x2c459f(0x1e9)](_0x2c459f(0x1db)+formatCountSummary(_0x447923['counts'][_0x2c459f(0x1d6)])),console[_0x2c459f(0x1e9)](_0x2c459f(0x1f9)+formatCountSummary(_0x447923['counts'][_0x2c459f(0x1a5)])));if(_0x3b85a7){console[_0x2c459f(0x1e9)](),console[_0x2c459f(0x1e9)](a4_0x8d4af9[_0x2c459f(0x21a)](_0x2c459f(0x17c)));for(const _0x42ed9e of _0x447923[_0x2c459f(0x1e7)]){_0x42ed9e[_0x2c459f(0x1d4)]===_0x2c459f(0x214)&&console[_0x2c459f(0x1e9)](a4_0x8d4af9[_0x2c459f(0x21a)](_0x2c459f(0x17b)+_0x42ed9e[_0x2c459f(0x216)]+_0x2c459f(0x1ac)+_0x42ed9e[_0x2c459f(0x214)]));}for(const _0x4bf547 of _0x447923[_0x2c459f(0x1a6)]){_0x4bf547[_0x2c459f(0x1d4)]==='error'&&console['log'](a4_0x8d4af9[_0x2c459f(0x21a)](_0x2c459f(0x195)+_0x4bf547[_0x2c459f(0x1bc)]+_0x2c459f(0x1ac)+_0x4bf547['error']));}for(const _0x17861f of _0x447923[_0x2c459f(0x211)]){_0x17861f['action']===_0x2c459f(0x214)&&console['log'](a4_0x8d4af9['red']('\x20\x20Prompt\x20\x22'+_0x17861f[_0x2c459f(0x1bc)]+_0x2c459f(0x1ac)+_0x17861f[_0x2c459f(0x214)]));}for(const _0x14a355 of _0x447923[_0x2c459f(0x16a)]){_0x14a355[_0x2c459f(0x1d4)]==='error'&&console[_0x2c459f(0x1e9)](a4_0x8d4af9[_0x2c459f(0x21a)](_0x2c459f(0x200)+_0x14a355['name']+_0x2c459f(0x1ac)+_0x14a355[_0x2c459f(0x214)]));}for(const _0x5b71ce of _0x447923[_0x2c459f(0x1d6)]){_0x5b71ce[_0x2c459f(0x1d4)]===_0x2c459f(0x214)&&console[_0x2c459f(0x1e9)](a4_0x8d4af9['red'](_0x2c459f(0x1e2)+_0x5b71ce[_0x2c459f(0x1bc)]+'\x22:\x20'+_0x5b71ce[_0x2c459f(0x214)]));}for(const _0x19d8ff of _0x447923[_0x2c459f(0x1a5)]){_0x19d8ff[_0x2c459f(0x1d4)]===_0x2c459f(0x214)&&console['log'](a4_0x8d4af9[_0x2c459f(0x21a)](_0x2c459f(0x1f8)+_0x19d8ff['name']+_0x2c459f(0x1ac)+_0x19d8ff[_0x2c459f(0x214)]));}return 0x1;}console[_0x2c459f(0x1e9)]();const _0x524ab6=getLLMProjectUrl(_0x58cf13,_0x447923[_0x2c459f(0x1bd)]);return console[_0x2c459f(0x1e9)](_0x2c459f(0x1dc)+a4_0x8d4af9['cyan'](_0x524ab6)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x40c5a9(0x1bc)]='agent:push';['description']=a4_0x40c5a9(0x19c);async[a4_0x40c5a9(0x184)](_0x549188){const _0x162587=a4_0x40c5a9,{options:_0x34c233,args:_0x461529,tdx:_0x40d7f8}=_0x549188;let _0x497d2c=_0x461529[0x0]||process['cwd']();const _0x434e3c=_0x34c233[_0x162587(0x16b)],_0x3d089b=_0x34c233['force'],_0x17f067=_0x34c233['yes'],_0x2580e0=_0x34c233[_0x162587(0x1e0)],_0x34180c=a4_0x4047d1[_0x162587(0x1c5)](_0x497d2c,'agent.yml'),_0x18d78e=existsSync(_0x34180c);if(_0x18d78e){const {data:_0x543d9e}=await withSpinner(_0x162587(0x1d3)+_0x497d2c+_0x162587(0x1cc),()=>_0x40d7f8[_0x162587(0x1f1)][_0x162587(0x196)](_0x497d2c,{'dryRun':_0x434e3c,'force':_0x3d089b}));if(_0x434e3c)return console[_0x162587(0x1e9)](a4_0x8d4af9['yellow'](_0x162587(0x1e8))),console['log'](_0x162587(0x176)+_0x543d9e['agentName']),0x0;if(_0x543d9e[_0x162587(0x1d4)]===_0x162587(0x214))return console[_0x162587(0x1e9)](a4_0x8d4af9[_0x162587(0x21a)](_0x162587(0x1e6)+_0x543d9e[_0x162587(0x214)])),0x1;console[_0x162587(0x1e9)](a4_0x8d4af9['green']('Agent\x20'+_0x543d9e['action']+_0x162587(0x1ef))),console[_0x162587(0x1e9)]('Agent:\x20'+_0x543d9e['agentName']);if(_0x543d9e[_0x162587(0x1ab)]&&_0x543d9e['projectId']){const _0x152bb8=getLLMAgentChatUrl(_0x2580e0,_0x543d9e[_0x162587(0x207)],_0x543d9e['agentId']);console[_0x162587(0x1e9)]('Chat:\x20'+a4_0x8d4af9[_0x162587(0x1b6)](_0x152bb8));}return 0x0;}const _0xf148ec=_0x34c233[_0x162587(0x1c2)],_0x56725f=resolveProjectFromContext(_0x497d2c,_0xf148ec);if(_0x56725f[_0x162587(0x204)])_0x497d2c=_0x56725f['projectDir'],_0x56725f[_0x162587(0x179)]===_0x162587(0x1d8)&&console[_0x162587(0x1e9)](a4_0x8d4af9['dim'](_0x162587(0x171)+_0x497d2c));else{let _0x5aa964='Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.';_0x56725f['reason']===_0x162587(0x190)&&(_0x5aa964=_0x56725f[_0x162587(0x1a9)]+'\x0aRun\x20\x27tdx\x20agent\x20pull\x20'+_0x56725f[_0x162587(0x1c2)]+'\x27\x20to\x20create\x20the\x20folder\x20structure.');throw new SDKError(ErrorCode[_0x162587(0x197)],_0x56725f[_0x162587(0x1b7)]===_0x162587(0x1cd)?_0x56725f[_0x162587(0x1a9)]:'No\x20tdx.json\x20found\x20in\x20'+_0x497d2c,undefined,{'helpText':_0x5aa964});}const {data:_0x49278e}=await withSpinner(_0x162587(0x1b0),()=>_0x40d7f8[_0x162587(0x1f1)]['pushProject'](_0x497d2c,{'dryRun':!![]})),_0x549081=_0x49278e['counts'][_0x162587(0x1e7)][_0x162587(0x215)]>0x0;if(_0x549081){console[_0x162587(0x1e9)](a4_0x8d4af9[_0x162587(0x21a)](_0x162587(0x1dd)));for(const _0x48cc35 of _0x49278e[_0x162587(0x1e7)]){_0x48cc35['action']===_0x162587(0x214)&&console[_0x162587(0x1e9)](a4_0x8d4af9[_0x162587(0x21a)](_0x162587(0x17b)+_0x48cc35[_0x162587(0x216)]+_0x162587(0x1ac)+_0x48cc35['error']));}return 0x1;}const _0x5d371c=_0x49278e['counts'][_0x162587(0x1e7)]['created']+_0x49278e[_0x162587(0x183)][_0x162587(0x1a6)][_0x162587(0x185)]+_0x49278e[_0x162587(0x183)][_0x162587(0x1d7)][_0x162587(0x185)]+_0x49278e[_0x162587(0x183)][_0x162587(0x211)][_0x162587(0x185)]+_0x49278e[_0x162587(0x183)][_0x162587(0x16a)][_0x162587(0x185)]+_0x49278e[_0x162587(0x183)][_0x162587(0x1d6)][_0x162587(0x185)]+_0x49278e[_0x162587(0x183)][_0x162587(0x1a5)]['created'],_0x4f5317=_0x49278e['counts']['agents'][_0x162587(0x1f0)]+_0x49278e['counts']['knowledgeBases']['updated']+_0x49278e[_0x162587(0x183)][_0x162587(0x1d7)]['updated']+_0x49278e[_0x162587(0x183)][_0x162587(0x211)][_0x162587(0x1f0)]+_0x49278e[_0x162587(0x183)]['integrations'][_0x162587(0x1f0)]+_0x49278e['counts'][_0x162587(0x1d6)][_0x162587(0x1f0)]+_0x49278e[_0x162587(0x183)][_0x162587(0x1a5)][_0x162587(0x1f0)],_0x3adaf2=_0x49278e['counts'][_0x162587(0x1e7)][_0x162587(0x1c1)]+_0x49278e[_0x162587(0x183)][_0x162587(0x1a6)][_0x162587(0x1c1)]+_0x49278e[_0x162587(0x183)]['textKnowledgeBases'][_0x162587(0x1c1)]+_0x49278e[_0x162587(0x183)][_0x162587(0x211)][_0x162587(0x1c1)]+_0x49278e['counts'][_0x162587(0x16a)]['unchanged']+_0x49278e[_0x162587(0x183)][_0x162587(0x1d6)]['unchanged']+_0x49278e[_0x162587(0x183)]['experimentalArtifacts']['unchanged'];console['log'](_0x162587(0x1a7)+_0x49278e[_0x162587(0x1a1)]+'\x27:'),console[_0x162587(0x1e9)]('\x20\x20'+a4_0x8d4af9[_0x162587(0x1d0)]('+\x20'+_0x5d371c+'\x20new')+_0x162587(0x168)+a4_0x8d4af9[_0x162587(0x189)]('~\x20'+_0x4f5317+_0x162587(0x181))+_0x162587(0x168)+a4_0x8d4af9[_0x162587(0x178)]('=\x20'+_0x3adaf2+_0x162587(0x169))),console[_0x162587(0x1e9)]('\x20\x20Agents:\x20'+formatCountSummary(_0x49278e[_0x162587(0x183)]['agents'])),console[_0x162587(0x1e9)](_0x162587(0x19d)+formatCountSummary(_0x49278e['counts'][_0x162587(0x1a6)])),console[_0x162587(0x1e9)](_0x162587(0x20f)+formatCountSummary(_0x49278e[_0x162587(0x183)][_0x162587(0x1d7)])),console['log'](_0x162587(0x1e1)+formatCountSummary(_0x49278e['counts']['prompts'])),console[_0x162587(0x1e9)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x49278e[_0x162587(0x183)][_0x162587(0x16a)]));const _0xb19bee=_0x49278e[_0x162587(0x183)][_0x162587(0x1d6)][_0x162587(0x185)]>0x0||_0x49278e[_0x162587(0x183)]['experimentalKnowledgeBases']['updated']>0x0||_0x49278e[_0x162587(0x183)][_0x162587(0x1d6)][_0x162587(0x1c1)]>0x0||_0x49278e[_0x162587(0x183)][_0x162587(0x1a5)][_0x162587(0x185)]>0x0||_0x49278e['counts']['experimentalArtifacts'][_0x162587(0x1f0)]>0x0||_0x49278e['counts'][_0x162587(0x1a5)][_0x162587(0x1c1)]>0x0;_0xb19bee&&(console['log'](_0x162587(0x1db)+formatCountSummary(_0x49278e['counts'][_0x162587(0x1d6)])),console[_0x162587(0x1e9)](_0x162587(0x1f9)+formatCountSummary(_0x49278e[_0x162587(0x183)][_0x162587(0x1a5)])));console[_0x162587(0x1e9)](_0x162587(0x1e3)+a4_0x8d4af9['cyan'](_0x497d2c)),displayDiffs(_0x49278e[_0x162587(0x1e7)],_0x49278e[_0x162587(0x1a6)],_0x49278e[_0x162587(0x1d7)],_0x49278e['prompts'],_0x49278e[_0x162587(0x16a)],_0x49278e[_0x162587(0x1d6)],_0x49278e[_0x162587(0x1a5)]);if(_0x434e3c)return console[_0x162587(0x1e9)](a4_0x8d4af9['yellow'](_0x162587(0x213))),0x0;if(_0x5d371c===0x0&&_0x4f5317===0x0){console[_0x162587(0x1e9)](a4_0x8d4af9[_0x162587(0x1d0)](_0x162587(0x1b3)));const _0xc68ea7=getLLMProjectUrl(_0x2580e0,_0x49278e[_0x162587(0x207)]);return console['log'](_0x162587(0x1dc)+a4_0x8d4af9[_0x162587(0x1b6)](_0xc68ea7)),0x0;}if(!_0x17f067&&!_0x3d089b){if(!isInteractive())return console[_0x162587(0x214)](a4_0x8d4af9[_0x162587(0x21a)](_0x162587(0x1a4)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x162587(0x214)](a4_0x8d4af9[_0x162587(0x178)](_0x162587(0x1d9))),0x1;const _0x1c28fe=await confirmKey(_0x162587(0x167)+(_0x5d371c+_0x4f5317)+'\x20resources?');if(!_0x1c28fe)return console[_0x162587(0x1e9)](a4_0x8d4af9['yellow']('Cancelled'),_0x162587(0x19a)),0x1;}const {data:_0x3eb7d1}=await withSpinner('Pushing\x20to\x20project...',()=>_0x40d7f8['llm'][_0x162587(0x20e)](_0x497d2c,{'force':_0x3d089b})),_0x3b9699=_0x3eb7d1[_0x162587(0x183)][_0x162587(0x1e7)][_0x162587(0x215)]>0x0||_0x3eb7d1[_0x162587(0x183)][_0x162587(0x1a6)][_0x162587(0x215)]>0x0||_0x3eb7d1[_0x162587(0x183)][_0x162587(0x1d7)][_0x162587(0x215)]>0x0||_0x3eb7d1[_0x162587(0x183)][_0x162587(0x211)]['errors']>0x0;if(_0x3b9699){console[_0x162587(0x1e9)](a4_0x8d4af9[_0x162587(0x189)](_0x162587(0x1de))),console[_0x162587(0x1e9)](),console['log'](a4_0x8d4af9[_0x162587(0x21a)]('Errors:'));for(const _0x22613d of _0x3eb7d1[_0x162587(0x1e7)]){_0x22613d['action']===_0x162587(0x214)&&console[_0x162587(0x1e9)](a4_0x8d4af9[_0x162587(0x21a)]('\x20\x20Agent\x20\x22'+_0x22613d[_0x162587(0x216)]+_0x162587(0x1ac)+_0x22613d[_0x162587(0x214)]));}for(const _0x4d62c6 of _0x3eb7d1[_0x162587(0x1a6)]){_0x4d62c6[_0x162587(0x1d4)]===_0x162587(0x214)&&console[_0x162587(0x1e9)](a4_0x8d4af9[_0x162587(0x21a)](_0x162587(0x195)+_0x4d62c6['name']+_0x162587(0x1ac)+_0x4d62c6['error']));}for(const _0x15d919 of _0x3eb7d1[_0x162587(0x1d7)]){_0x15d919[_0x162587(0x1d4)]===_0x162587(0x214)&&console[_0x162587(0x1e9)](a4_0x8d4af9[_0x162587(0x21a)](_0x162587(0x17e)+_0x15d919[_0x162587(0x1bc)]+_0x162587(0x1ac)+_0x15d919['error']));}for(const _0x5d9b38 of _0x3eb7d1[_0x162587(0x211)]){_0x5d9b38[_0x162587(0x1d4)]==='error'&&console['log'](a4_0x8d4af9['red'](_0x162587(0x1eb)+_0x5d9b38[_0x162587(0x1bc)]+_0x162587(0x1ac)+_0x5d9b38[_0x162587(0x214)]));}for(const _0x31b667 of _0x3eb7d1[_0x162587(0x16a)]){_0x31b667['action']===_0x162587(0x214)&&console[_0x162587(0x1e9)](a4_0x8d4af9[_0x162587(0x21a)]('\x20\x20Integration\x20\x22'+_0x31b667[_0x162587(0x1bc)]+_0x162587(0x1ac)+_0x31b667[_0x162587(0x214)]));}return 0x1;}console[_0x162587(0x1e9)](a4_0x8d4af9[_0x162587(0x1d0)](_0x162587(0x1bb)+(_0x5d371c+_0x4f5317)+_0x162587(0x1fe)+_0x3eb7d1['projectName']+'\x27'));const _0x2ca6fc=getLLMProjectUrl(_0x2580e0,_0x3eb7d1[_0x162587(0x207)]);return console[_0x162587(0x1e9)](_0x162587(0x1dc)+a4_0x8d4af9[_0x162587(0x1b6)](_0x2ca6fc)),0x0;}}
1
+ const a4_0x3a141b=a4_0x3d30;(function(_0x485da0,_0x28e536){const _0x13d159=a4_0x3d30,_0x1a6955=_0x485da0();while(!![]){try{const _0x447c92=parseInt(_0x13d159(0x25d))/0x1+parseInt(_0x13d159(0x27d))/0x2+-parseInt(_0x13d159(0x23a))/0x3+-parseInt(_0x13d159(0x228))/0x4*(parseInt(_0x13d159(0x240))/0x5)+-parseInt(_0x13d159(0x200))/0x6*(parseInt(_0x13d159(0x1ff))/0x7)+-parseInt(_0x13d159(0x22a))/0x8+parseInt(_0x13d159(0x207))/0x9*(parseInt(_0x13d159(0x20c))/0xa);if(_0x447c92===_0x28e536)break;else _0x1a6955['push'](_0x1a6955['shift']());}catch(_0x3d1fa7){_0x1a6955['push'](_0x1a6955['shift']());}}}(a4_0x1c39,0x276af));function a4_0x3d30(_0x92ad7d,_0x7ae4f8){_0x92ad7d=_0x92ad7d-0x1ec;const _0x1c3921=a4_0x1c39();let _0x3d305c=_0x1c3921[_0x92ad7d];return _0x3d305c;}import a4_0xb3fcd0 from'chalk';import a4_0x19716f from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext,resolveAgentPullArgs}from'../sdk/agent/agent-config.js';function a4_0x1c39(){const _0x59de18=['\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','pushProject','\x20\x20Prompt\x20\x22','pullProject','new','\x20|\x20','newProjectName','Using\x20local\x20project:\x20','539874nQtXJH','Agent\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project','\x20\x20Target:\x20','Project\x20cloned\x20successfully','parse','1541045vvlPAW','Pulling\x20agent\x20\x22','no_context','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','experimentalKnowledgeBases','yes','pushAgent','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','llm','description','Would\x20clone:','Dry\x20run\x20-\x20no\x20changes\x20made','\x20\x20Integrations:\x20','cwd-config','\x20changed','\x0aError:','total','MISSING_ARGUMENT','unchanged','cloneProject','log','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','\x0a✔\x20Pulled\x20','\x20\x20Text\x20Knowledge\x20Base\x20\x22','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','Would\x20push\x20agent:\x20','New\x20project:\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)','163334jJKHlc','Pushing\x20agent\x20from\x20\x22','tdx.json','profile','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','\x20unchanged','\x20\x20Agent\x20\x22','\x20updated','\x20\x20Knowledge\x20Bases:\x20','\x20=\x20','updated','\x20\x20Knowledge\x20Base\x20\x22','Cancelled','Source:\x20','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','Failed\x20to\x20push\x20agent:\x20','Using\x20current\x20project:\x20','Cannot\x20clone\x20from\x20context\x20project\x20\x22','cyan','join','sourceProjectName','message','Output:\x20','experimentalArtifacts','output','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','\x20files?','context','\x20\x20tdx\x20agent\x20clone\x20agents/','No\x20tdx.json\x20found\x20in\x20','dryRun','148816ZMTYSB','\x20\x20tdx\x20agent\x20pull\x20','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','\x22...','<new-name>','\x20\x20Experimental\x20Artifact\x20\x22','\x0aPull\x20summary\x20for\x20\x27','\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','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','counts','cwd','\x22\x20to\x20new\x20project\x20\x22','projectName','\x20--name\x20','textKnowledgeBases','New\x20project\x20ID:\x20','no_local_folder','agentName','Using\x20project\x20from\x20','agent','prompts','arg-dir','outputPath','Cloning\x20\x22','\x20files\x20to\x20','agentId','agent:pull','force','repeat','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','\x0aWrite\x20','\x0aProject\x20pushed\x20with\x20errors','\x20errors','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','site','\x20--profile\x20','integrations','reason','\x27\x20to\x20create\x20the\x20folder\x20structure.','errors','\x20\x20Integration\x20\x22','\x20resources?','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','Writing\x20files...','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','New\x20project\x20name\x20is\x20required','error','Clone\x20\x22','\x20successfully','\x0aErrors\x20found:','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','INVALID_ARGUMENT','\x0aChanges\x20to\x20agent\x20\x27','\x0aPush\x20','action','Using\x20context\x20project:\x20','name','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','✔\x20Context\x20set:\x20','agents','outputDir','Using\x20project\x20from\x20context:\x20','Analyzing\x20project\x20\x22','created','newProjectId','knowledgeBases','red','\x20resources\x20to\x20\x27','7XktuuU','1756470ahYnxP','hasChanges','\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','\x20\x20Agents:\x20','green','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','Would\x20pull\x20agent:\x20','457839qRgLHT','Errors:','diff','yellow','Using\x20project:\x20','140yJVNqD','\x20new','dirname','llm_project','agent:push','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','\x20\x20Text\x20Knowledge\x20Bases:\x20','push','utf-8','\x20total','\x0a✔\x20Pushed\x20','projectDir','\x0aChanges:','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','\x20\x20Experimental\x20Artifacts:\x20','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','Pushing\x20to\x20project...','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','source','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','\x22\x20to\x20a\x20different\x20profile','\x22:\x20','Project:\x20','Dry\x20run\x20-\x20no\x20files\x20written','llmProject','\x0aChanges\x20to\x20prompt\x20\x27','4fhxcyV','\x20\x20Prompts:\x20','60552TxLqtr','dim','projectId','-\x20nothing\x20pushed','\x22\x20to\x20\x22','\x22\x20from\x20project\x20\x22','Analyzing\x20changes\x20to\x20push...','execute'];a4_0x1c39=function(){return _0x59de18;};return a4_0x1c39();}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(_0x4c9ac0){const _0x1b05dd=a4_0x3d30,_0x2c7c5a=[];if(_0x4c9ac0[_0x1b05dd(0x251)]!==undefined)_0x2c7c5a[_0x1b05dd(0x213)](_0x4c9ac0['total']+_0x1b05dd(0x215));if(_0x4c9ac0[_0x1b05dd(0x236)]!==undefined&&_0x4c9ac0['new']>0x0)_0x2c7c5a[_0x1b05dd(0x213)](a4_0xb3fcd0[_0x1b05dd(0x204)](_0x4c9ac0['new']+_0x1b05dd(0x20d)));if(_0x4c9ac0[_0x1b05dd(0x1fa)]!==undefined&&_0x4c9ac0['created']>0x0)_0x2c7c5a['push'](a4_0xb3fcd0[_0x1b05dd(0x204)](_0x4c9ac0[_0x1b05dd(0x1fa)]+'\x20created'));if(_0x4c9ac0['updated']!==undefined&&_0x4c9ac0[_0x1b05dd(0x268)]>0x0)_0x2c7c5a['push'](a4_0xb3fcd0[_0x1b05dd(0x20a)](_0x4c9ac0['updated']+_0x1b05dd(0x265)));if(_0x4c9ac0[_0x1b05dd(0x253)]!==undefined&&_0x4c9ac0[_0x1b05dd(0x253)]>0x0)_0x2c7c5a[_0x1b05dd(0x213)](a4_0xb3fcd0['gray'](_0x4c9ac0[_0x1b05dd(0x253)]+_0x1b05dd(0x263)));if(_0x4c9ac0[_0x1b05dd(0x2a4)]!==undefined&&_0x4c9ac0['errors']>0x0)_0x2c7c5a['push'](a4_0xb3fcd0[_0x1b05dd(0x1fd)](_0x4c9ac0['errors']+_0x1b05dd(0x29d)));return _0x2c7c5a[_0x1b05dd(0x271)](',\x20');}function displayDiffs(_0x3a5d09,_0x6bed0c,_0x2d63e8,_0x882929,_0xbc9e8c,_0xfa993b,_0x2a4c5b){const _0x545d03=a4_0x3d30;for(const _0x2bd443 of _0x3a5d09){if(_0x2bd443[_0x545d03(0x209)]){const _0x1b6c4a=_0x2bd443[_0x545d03(0x28e)]||_0x2bd443['name'];console['log'](_0x545d03(0x1ef)+_0x1b6c4a+'\x27:'),console[_0x545d03(0x255)]('─'[_0x545d03(0x299)](0x3c)),console['log'](_0x2bd443[_0x545d03(0x209)]),console['log']('─'[_0x545d03(0x299)](0x3c));}}for(const _0x5e154c of _0x6bed0c){_0x5e154c[_0x545d03(0x209)]&&(console[_0x545d03(0x255)]('\x0aChanges\x20to\x20knowledge\x20base\x20\x27'+_0x5e154c[_0x545d03(0x1f3)]+'\x27:'),console['log']('─'[_0x545d03(0x299)](0x3c)),console[_0x545d03(0x255)](_0x5e154c[_0x545d03(0x209)]),console[_0x545d03(0x255)]('─'[_0x545d03(0x299)](0x3c)));}for(const _0xe1fc63 of _0x2d63e8){_0xe1fc63[_0x545d03(0x209)]&&(console[_0x545d03(0x255)](_0x545d03(0x248)+_0xe1fc63[_0x545d03(0x1f3)]+'\x27:'),console[_0x545d03(0x255)]('─'[_0x545d03(0x299)](0x3c)),console[_0x545d03(0x255)](_0xe1fc63[_0x545d03(0x209)]),console[_0x545d03(0x255)]('─'[_0x545d03(0x299)](0x3c)));}for(const _0x332330 of _0x882929){_0x332330[_0x545d03(0x209)]&&(console[_0x545d03(0x255)](_0x545d03(0x227)+_0x332330['name']+'\x27:'),console[_0x545d03(0x255)]('─'[_0x545d03(0x299)](0x3c)),console[_0x545d03(0x255)](_0x332330['diff']),console[_0x545d03(0x255)]('─'[_0x545d03(0x299)](0x3c)));}for(const _0x4a5640 of _0xbc9e8c){_0x4a5640[_0x545d03(0x209)]&&(console[_0x545d03(0x255)]('\x0aChanges\x20to\x20integration\x20\x27'+_0x4a5640['name']+'\x27:'),console[_0x545d03(0x255)]('─'[_0x545d03(0x299)](0x3c)),console[_0x545d03(0x255)](_0x4a5640[_0x545d03(0x209)]),console['log']('─'[_0x545d03(0x299)](0x3c)));}for(const _0x3bf19e of _0xfa993b){_0x3bf19e[_0x545d03(0x209)]&&(console[_0x545d03(0x255)](_0x545d03(0x205)+_0x3bf19e[_0x545d03(0x1f3)]+'\x27:'),console[_0x545d03(0x255)]('─'['repeat'](0x3c)),console[_0x545d03(0x255)](_0x3bf19e[_0x545d03(0x209)]),console[_0x545d03(0x255)]('─'['repeat'](0x3c)));}for(const _0x5a4270 of _0x2a4c5b){_0x5a4270['diff']&&(console['log'](_0x545d03(0x220)+_0x5a4270[_0x545d03(0x1f3)]+'\x27:'),console[_0x545d03(0x255)]('─'['repeat'](0x3c)),console['log'](_0x5a4270[_0x545d03(0x209)]),console[_0x545d03(0x255)]('─'[_0x545d03(0x299)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x3a141b(0x1f3)]=a4_0x3a141b(0x297);[a4_0x3a141b(0x24a)]='Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files';async[a4_0x3a141b(0x231)](_0x21724b){const _0x533749=a4_0x3a141b,{options:_0x21dcfd,args:_0x4284f6,tdx:_0x3e0337}=_0x21724b,_0x1e55df=_0x4284f6[0x0],_0x276d91=_0x4284f6[0x1],_0x58f9ba=_0x21dcfd[_0x533749(0x276)],_0xc79165=_0x21dcfd[_0x533749(0x27c)],_0x16a475=_0x21dcfd[_0x533749(0x298)],_0x1146fc=_0x21dcfd[_0x533749(0x246)],_0x2f80f8=_0x21dcfd[_0x533749(0x226)],_0x2c9569=_0x21dcfd[_0x533749(0x290)];let _0x13ca53;if(_0x1e55df){const _0x6621c4=a4_0x19716f[_0x533749(0x271)](_0x1e55df,_0x533749(0x25f));if(existsSync(_0x6621c4))try{const _0x4c2011=JSON[_0x533749(0x23f)](readFileSync(_0x6621c4,_0x533749(0x214)));_0x4c2011[_0x533749(0x20f)]&&(_0x13ca53={'llm_project':_0x4c2011['llm_project']});}catch{}}const _0x1b393b=findAgentConfigPath(process['cwd']());let _0x1b9822;if(_0x1b393b)try{const _0x56d1fc=JSON[_0x533749(0x23f)](readFileSync(_0x1b393b,_0x533749(0x214)));_0x56d1fc[_0x533749(0x20f)]&&(_0x1b9822={'llm_project':_0x56d1fc[_0x533749(0x20f)]});}catch{}const _0x2f7713=resolveAgentPullArgs({'arg':_0x1e55df,'agentNameArg':_0x276d91,'agentFlag':_0x2c9569,'contextProject':_0x2f80f8,'argDirConfig':_0x13ca53,'cwdConfigPath':_0x1b393b||undefined,'cwdConfig':_0x1b9822}),{projectNameOrId:_0x19db02,targetAgentName:_0xe8eae6,existingOutputDir:_0xfcdfde,source:_0x4d36c4}=_0x2f7713;if(_0x4d36c4===_0x533749(0x292))console[_0x533749(0x255)](a4_0xb3fcd0['dim'](_0x533749(0x28f)+a4_0x19716f[_0x533749(0x271)](_0x1e55df,_0x533749(0x25f))+':\x20'+_0x19db02));else{if(_0x4d36c4===_0x533749(0x24e))console[_0x533749(0x255)](a4_0xb3fcd0['dim'](_0x533749(0x20b)+_0x19db02));else _0x4d36c4===_0x533749(0x279)&&console[_0x533749(0x255)](a4_0xb3fcd0['dim'](_0x533749(0x1f8)+_0x19db02));}if(!_0x19db02)return _0x2c9569?(console[_0x533749(0x255)](a4_0xb3fcd0[_0x533749(0x20a)](_0x533749(0x21e))),console['log'](_0x533749(0x256)),console[_0x533749(0x255)]('Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>')):(console[_0x533749(0x255)](a4_0xb3fcd0[_0x533749(0x20a)](_0x533749(0x219))),console[_0x533749(0x255)](_0x533749(0x25c)),console['log'](_0x533749(0x23c)),console[_0x533749(0x255)](_0x533749(0x232)),console[_0x533749(0x255)](_0x533749(0x284)),console[_0x533749(0x255)](_0x533749(0x202))),0x1;if(_0xe8eae6){const {data:_0x167ee0}=await withSpinner(_0x533749(0x241)+_0xe8eae6+_0x533749(0x22f)+_0x19db02+_0x533749(0x280),()=>_0x3e0337[_0x533749(0x249)]['pullAgent'](_0x19db02,_0xe8eae6,_0x58f9ba,{'dryRun':_0xc79165,'force':_0x16a475}));if(_0xc79165)return console[_0x533749(0x255)](a4_0xb3fcd0[_0x533749(0x20a)](_0x533749(0x225))),console[_0x533749(0x255)](_0x533749(0x206)+_0x167ee0['agentName']),console[_0x533749(0x255)]('Output\x20path:\x20'+_0x167ee0[_0x533749(0x293)]),_0x167ee0[_0x533749(0x209)]&&(console['log'](_0x533749(0x218)),console['log']('─'[_0x533749(0x299)](0x3c)),console[_0x533749(0x255)](_0x167ee0[_0x533749(0x209)]),console[_0x533749(0x255)]('─'[_0x533749(0x299)](0x3c))),0x0;return console[_0x533749(0x255)](a4_0xb3fcd0[_0x533749(0x204)]('Agent\x20pulled\x20successfully')),console[_0x533749(0x255)]('Agent:\x20'+_0x167ee0[_0x533749(0x28e)]),console[_0x533749(0x255)](_0x533749(0x274)+_0x167ee0[_0x533749(0x293)]),console[_0x533749(0x255)]('Status:\x20'+(_0x167ee0['isNew']?a4_0xb3fcd0[_0x533749(0x204)](_0x533749(0x236)):_0x167ee0[_0x533749(0x201)]?a4_0xb3fcd0[_0x533749(0x20a)](_0x533749(0x268)):a4_0xb3fcd0['gray'](_0x533749(0x253)))),0x0;}const _0x8e751b=_0xfcdfde||_0x58f9ba,{data:_0x4a6b1b}=await withSpinner(_0x533749(0x1f9)+_0x19db02+_0x533749(0x280),()=>_0x3e0337[_0x533749(0x249)][_0x533749(0x235)](_0x19db02,_0x8e751b,{'dryRun':!![]})),_0x208da8=_0x4a6b1b[_0x533749(0x286)][_0x533749(0x1f6)]['new']+_0x4a6b1b[_0x533749(0x286)][_0x533749(0x1fc)][_0x533749(0x236)]+_0x4a6b1b[_0x533749(0x286)][_0x533749(0x28b)][_0x533749(0x236)]+_0x4a6b1b[_0x533749(0x286)][_0x533749(0x291)][_0x533749(0x236)]+_0x4a6b1b['counts'][_0x533749(0x2a1)][_0x533749(0x236)]+_0x4a6b1b['counts'][_0x533749(0x245)][_0x533749(0x236)]+_0x4a6b1b[_0x533749(0x286)][_0x533749(0x275)][_0x533749(0x236)],_0x49b424=_0x4a6b1b[_0x533749(0x286)][_0x533749(0x1f6)]['updated']+_0x4a6b1b[_0x533749(0x286)]['knowledgeBases'][_0x533749(0x268)]+_0x4a6b1b[_0x533749(0x286)][_0x533749(0x28b)]['updated']+_0x4a6b1b['counts']['prompts'][_0x533749(0x268)]+_0x4a6b1b['counts'][_0x533749(0x2a1)][_0x533749(0x268)]+_0x4a6b1b[_0x533749(0x286)][_0x533749(0x245)][_0x533749(0x268)]+_0x4a6b1b[_0x533749(0x286)][_0x533749(0x275)][_0x533749(0x268)],_0x8a9f2d=_0x4a6b1b[_0x533749(0x286)][_0x533749(0x1f6)]['unchanged']+_0x4a6b1b[_0x533749(0x286)][_0x533749(0x1fc)][_0x533749(0x253)]+_0x4a6b1b[_0x533749(0x286)][_0x533749(0x28b)][_0x533749(0x253)]+_0x4a6b1b['counts'][_0x533749(0x291)]['unchanged']+_0x4a6b1b[_0x533749(0x286)][_0x533749(0x2a1)]['unchanged']+_0x4a6b1b[_0x533749(0x286)][_0x533749(0x245)][_0x533749(0x253)]+_0x4a6b1b[_0x533749(0x286)][_0x533749(0x275)][_0x533749(0x253)];console[_0x533749(0x255)](_0x533749(0x283)+_0x4a6b1b['projectName']+'\x27:'),console[_0x533749(0x255)]('\x20\x20'+a4_0xb3fcd0['green']('+\x20'+_0x208da8+_0x533749(0x20d))+_0x533749(0x237)+a4_0xb3fcd0[_0x533749(0x20a)]('~\x20'+_0x49b424+_0x533749(0x24f))+_0x533749(0x237)+a4_0xb3fcd0[_0x533749(0x22b)]('=\x20'+_0x8a9f2d+'\x20unchanged')),console['log'](_0x533749(0x203)+formatCountSummary(_0x4a6b1b[_0x533749(0x286)][_0x533749(0x1f6)])),console[_0x533749(0x255)](_0x533749(0x266)+formatCountSummary(_0x4a6b1b[_0x533749(0x286)][_0x533749(0x1fc)])),console[_0x533749(0x255)](_0x533749(0x212)+formatCountSummary(_0x4a6b1b['counts'][_0x533749(0x28b)])),console['log']('\x20\x20Prompts:\x20'+formatCountSummary(_0x4a6b1b['counts'][_0x533749(0x291)])),console['log']('\x20\x20Integrations:\x20'+formatCountSummary(_0x4a6b1b[_0x533749(0x286)][_0x533749(0x2a1)]));const _0x1c805c=_0x4a6b1b['counts'][_0x533749(0x245)]['total']>0x0||_0x4a6b1b[_0x533749(0x286)][_0x533749(0x275)][_0x533749(0x251)]>0x0;_0x1c805c&&(console[_0x533749(0x255)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x4a6b1b[_0x533749(0x286)][_0x533749(0x245)])),console['log'](_0x533749(0x21a)+formatCountSummary(_0x4a6b1b['counts'][_0x533749(0x275)])));console[_0x533749(0x255)](_0x533749(0x23d)+a4_0xb3fcd0['cyan'](_0x4a6b1b[_0x533749(0x1f7)])),displayDiffs(_0x4a6b1b[_0x533749(0x1f6)],_0x4a6b1b['knowledgeBases'],_0x4a6b1b[_0x533749(0x28b)],_0x4a6b1b[_0x533749(0x291)],_0x4a6b1b[_0x533749(0x2a1)],_0x4a6b1b[_0x533749(0x245)],_0x4a6b1b[_0x533749(0x275)]);if(_0xc79165)return console[_0x533749(0x255)](a4_0xb3fcd0[_0x533749(0x20a)](_0x533749(0x285))),0x0;if(_0x208da8===0x0&&_0x49b424===0x0)return console[_0x533749(0x255)](a4_0xb3fcd0['green'](_0x533749(0x261))),saveSessionContext({'llm_project':_0x4a6b1b['projectName']},_0x21dcfd['session']),console[_0x533749(0x255)](a4_0xb3fcd0[_0x533749(0x204)]('✔\x20Context\x20set:\x20'+a4_0xb3fcd0['dim'](_0x533749(0x20f))+_0x533749(0x267)+a4_0xb3fcd0[_0x533749(0x270)](_0x4a6b1b['projectName']))),0x0;if(!_0x1146fc&&!_0x16a475){if(!isInteractive())return console[_0x533749(0x2ab)](a4_0xb3fcd0[_0x533749(0x1fd)]('\x0aError:'),_0x533749(0x243)),console[_0x533749(0x2ab)](a4_0xb3fcd0[_0x533749(0x22b)](_0x533749(0x2a9))),0x1;const _0x174fd5=await confirmKey(_0x533749(0x29b)+(_0x208da8+_0x49b424)+_0x533749(0x278));if(!_0x174fd5)return console[_0x533749(0x255)](a4_0xb3fcd0[_0x533749(0x20a)](_0x533749(0x26a)),'-\x20no\x20files\x20written'),0x1;}const {data:_0x31bbf2}=await withSpinner(_0x533749(0x2a8),()=>_0x3e0337['llm'][_0x533749(0x235)](_0x19db02,_0x8e751b,{'force':_0x16a475}));return console[_0x533749(0x255)](a4_0xb3fcd0[_0x533749(0x204)](_0x533749(0x257)+(_0x208da8+_0x49b424)+_0x533749(0x295)+_0x31bbf2['outputDir'])),saveSessionContext({'llm_project':_0x31bbf2[_0x533749(0x289)]},_0x21dcfd['session']),console['log'](a4_0xb3fcd0[_0x533749(0x204)](_0x533749(0x1f5)+a4_0xb3fcd0[_0x533749(0x22b)](_0x533749(0x20f))+_0x533749(0x267)+a4_0xb3fcd0[_0x533749(0x270)](_0x31bbf2[_0x533749(0x289)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{['name']='agent:clone';[a4_0x3a141b(0x24a)]=a4_0x3a141b(0x21d);async['execute'](_0x5d07dd){const _0x416afa=a4_0x3a141b,{options:_0x38d794,args:_0x407789,tdx:_0x53502d}=_0x5d07dd,_0x55a339=_0x407789[0x0],_0x29dd92=_0x38d794[_0x416afa(0x1f3)],_0x33d146=_0x38d794['dryRun'],_0x19e3df=_0x38d794[_0x416afa(0x246)],_0x4f9e06=_0x38d794[_0x416afa(0x29f)],_0x19e5b6=_0x38d794[_0x416afa(0x226)];let _0x287ae5;const _0x5b938f=findAgentConfigPath(process[_0x416afa(0x287)]());if(_0x55a339){const _0x2ebaa4=a4_0x19716f['join'](_0x55a339,_0x416afa(0x25f));existsSync(_0x2ebaa4)?(_0x287ae5=_0x55a339,console[_0x416afa(0x255)](a4_0xb3fcd0[_0x416afa(0x22b)](_0x416afa(0x239)+_0x55a339))):_0x287ae5=_0x55a339;}else{if(_0x5b938f)_0x287ae5=a4_0x19716f['dirname'](_0x5b938f),console['log'](a4_0xb3fcd0[_0x416afa(0x22b)](_0x416afa(0x26e)+_0x287ae5));else{if(_0x19e5b6){const _0x56d32e=sanitizeForFilesystem(_0x19e5b6);let _0x222b64=_0x56d32e,_0x56c1c7=a4_0x19716f[_0x416afa(0x271)](process['cwd'](),'agents',_0x56d32e,'tdx.json');if(!existsSync(_0x56c1c7)){const _0x1bc799=normalizeName(_0x19e5b6),_0x3a8e49=a4_0x19716f[_0x416afa(0x271)](process[_0x416afa(0x287)](),_0x416afa(0x1f6),_0x1bc799,'tdx.json');existsSync(_0x3a8e49)&&(_0x222b64=_0x1bc799,_0x56c1c7=_0x3a8e49);}if(existsSync(_0x56c1c7))_0x287ae5=a4_0x19716f[_0x416afa(0x20e)](_0x56c1c7),console[_0x416afa(0x255)](a4_0xb3fcd0[_0x416afa(0x22b)](_0x416afa(0x239)+_0x287ae5));else{const _0x419c63=_0x38d794[_0x416afa(0x260)];if(_0x419c63)throw new SDKError(ErrorCode[_0x416afa(0x1ee)],_0x416afa(0x26f)+_0x19e5b6+_0x416afa(0x222),undefined,{'helpText':_0x416afa(0x27f)+_0x416afa(0x1f4)+(_0x416afa(0x27e)+_0x19e5b6+'\x0a')+(_0x416afa(0x27a)+_0x222b64+_0x416afa(0x28a)+(_0x29dd92||_0x416afa(0x281))+_0x416afa(0x2a0)+_0x419c63)});_0x287ae5=_0x19e5b6,console[_0x416afa(0x255)](a4_0xb3fcd0[_0x416afa(0x22b)](_0x416afa(0x1f2)+_0x19e5b6));}}}}if(!_0x287ae5)return console[_0x416afa(0x255)](a4_0xb3fcd0[_0x416afa(0x20a)](_0x416afa(0x1ed))),console[_0x416afa(0x255)](_0x416afa(0x244)),console[_0x416afa(0x255)](_0x416afa(0x29a)),console[_0x416afa(0x255)]('\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[_0x416afa(0x255)](_0x416afa(0x26c)),0x1;if(!_0x29dd92)throw new SDKError(ErrorCode[_0x416afa(0x252)],_0x416afa(0x2aa),undefined,{'helpText':_0x416afa(0x277)});if(!_0x19e3df&&!_0x33d146){if(!isInteractive())return console[_0x416afa(0x2ab)](a4_0xb3fcd0['red'](_0x416afa(0x250)),_0x416afa(0x243)),console[_0x416afa(0x2ab)](a4_0xb3fcd0[_0x416afa(0x22b)](_0x416afa(0x2a9))),0x1;const _0x39ff66=await confirmKey(_0x416afa(0x2ac)+_0x287ae5+_0x416afa(0x288)+_0x29dd92+'\x22?');if(!_0x39ff66)return console[_0x416afa(0x255)](a4_0xb3fcd0['yellow'](_0x416afa(0x26a))),0x1;}const {data:_0x3ad659}=await withSpinner(_0x416afa(0x294)+_0x287ae5+_0x416afa(0x22e)+_0x29dd92+'\x22...',()=>_0x53502d[_0x416afa(0x249)][_0x416afa(0x254)](_0x287ae5,_0x29dd92,{'dryRun':_0x33d146}));if(_0x33d146){console[_0x416afa(0x255)](a4_0xb3fcd0[_0x416afa(0x20a)](_0x416afa(0x24c))),console[_0x416afa(0x255)](_0x416afa(0x26b)+_0x3ad659[_0x416afa(0x272)]),console[_0x416afa(0x255)](_0x416afa(0x25b)+_0x29dd92),console['log'](_0x416afa(0x24b)),console[_0x416afa(0x255)]('\x20\x20Agents:\x20'+_0x3ad659['counts'][_0x416afa(0x1f6)]['created']),console[_0x416afa(0x255)]('\x20\x20Knowledge\x20Bases:\x20'+_0x3ad659['counts'][_0x416afa(0x1fc)]['created']),console['log']('\x20\x20Prompts:\x20'+_0x3ad659['counts']['prompts'][_0x416afa(0x1fa)]);const _0x16dff2=_0x3ad659[_0x416afa(0x286)][_0x416afa(0x245)][_0x416afa(0x1fa)]>0x0||_0x3ad659['counts'][_0x416afa(0x275)][_0x416afa(0x1fa)]>0x0;return _0x16dff2&&(console[_0x416afa(0x255)](_0x416afa(0x2a7)+_0x3ad659[_0x416afa(0x286)][_0x416afa(0x245)]['created']),console[_0x416afa(0x255)]('\x20\x20Experimental\x20Artifacts:\x20'+_0x3ad659[_0x416afa(0x286)][_0x416afa(0x275)][_0x416afa(0x1fa)])),0x0;}const _0x51d882=_0x3ad659[_0x416afa(0x286)]['agents'][_0x416afa(0x2a4)]>0x0||_0x3ad659[_0x416afa(0x286)][_0x416afa(0x1fc)][_0x416afa(0x2a4)]>0x0||_0x3ad659['counts']['prompts'][_0x416afa(0x2a4)]>0x0||_0x3ad659[_0x416afa(0x286)][_0x416afa(0x245)][_0x416afa(0x2a4)]>0x0||_0x3ad659[_0x416afa(0x286)][_0x416afa(0x275)][_0x416afa(0x2a4)]>0x0;_0x51d882?console[_0x416afa(0x255)](a4_0xb3fcd0[_0x416afa(0x20a)]('Project\x20cloned\x20with\x20errors')):console[_0x416afa(0x255)](a4_0xb3fcd0[_0x416afa(0x204)](_0x416afa(0x23e)));console[_0x416afa(0x255)](_0x416afa(0x26b)+_0x3ad659[_0x416afa(0x272)]),console['log'](_0x416afa(0x25b)+_0x3ad659[_0x416afa(0x238)]),console['log'](_0x416afa(0x28c)+_0x3ad659['newProjectId']),console[_0x416afa(0x255)](),console[_0x416afa(0x255)]('Summary:'),console[_0x416afa(0x255)]('\x20\x20Agents:\x20'+formatCountSummary(_0x3ad659[_0x416afa(0x286)]['agents'])),console[_0x416afa(0x255)](_0x416afa(0x266)+formatCountSummary(_0x3ad659[_0x416afa(0x286)][_0x416afa(0x1fc)])),console[_0x416afa(0x255)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x3ad659[_0x416afa(0x286)][_0x416afa(0x291)])),console[_0x416afa(0x255)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x3ad659[_0x416afa(0x286)][_0x416afa(0x2a1)]));const _0x4635b2=_0x3ad659[_0x416afa(0x286)][_0x416afa(0x245)][_0x416afa(0x1fa)]>0x0||_0x3ad659['counts'][_0x416afa(0x245)][_0x416afa(0x268)]>0x0||_0x3ad659[_0x416afa(0x286)]['experimentalKnowledgeBases'][_0x416afa(0x253)]>0x0||_0x3ad659[_0x416afa(0x286)][_0x416afa(0x275)][_0x416afa(0x1fa)]>0x0||_0x3ad659['counts']['experimentalArtifacts'][_0x416afa(0x268)]>0x0||_0x3ad659[_0x416afa(0x286)][_0x416afa(0x275)][_0x416afa(0x253)]>0x0;_0x4635b2&&(console[_0x416afa(0x255)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x3ad659[_0x416afa(0x286)][_0x416afa(0x245)])),console[_0x416afa(0x255)](_0x416afa(0x21a)+formatCountSummary(_0x3ad659[_0x416afa(0x286)][_0x416afa(0x275)])));if(_0x51d882){console[_0x416afa(0x255)](),console[_0x416afa(0x255)](a4_0xb3fcd0['red']('Errors:'));for(const _0x407332 of _0x3ad659[_0x416afa(0x1f6)]){_0x407332['action']===_0x416afa(0x2ab)&&console[_0x416afa(0x255)](a4_0xb3fcd0[_0x416afa(0x1fd)](_0x416afa(0x264)+_0x407332[_0x416afa(0x28e)]+_0x416afa(0x223)+_0x407332[_0x416afa(0x2ab)]));}for(const _0x53b7c2 of _0x3ad659[_0x416afa(0x1fc)]){_0x53b7c2[_0x416afa(0x1f1)]===_0x416afa(0x2ab)&&console[_0x416afa(0x255)](a4_0xb3fcd0['red'](_0x416afa(0x269)+_0x53b7c2[_0x416afa(0x1f3)]+_0x416afa(0x223)+_0x53b7c2[_0x416afa(0x2ab)]));}for(const _0x1d572c of _0x3ad659[_0x416afa(0x291)]){_0x1d572c[_0x416afa(0x1f1)]===_0x416afa(0x2ab)&&console[_0x416afa(0x255)](a4_0xb3fcd0[_0x416afa(0x1fd)](_0x416afa(0x234)+_0x1d572c[_0x416afa(0x1f3)]+_0x416afa(0x223)+_0x1d572c[_0x416afa(0x2ab)]));}for(const _0x4a0779 of _0x3ad659[_0x416afa(0x2a1)]){_0x4a0779[_0x416afa(0x1f1)]==='error'&&console['log'](a4_0xb3fcd0[_0x416afa(0x1fd)](_0x416afa(0x2a5)+_0x4a0779[_0x416afa(0x1f3)]+_0x416afa(0x223)+_0x4a0779['error']));}for(const _0x26a520 of _0x3ad659[_0x416afa(0x245)]){_0x26a520[_0x416afa(0x1f1)]==='error'&&console[_0x416afa(0x255)](a4_0xb3fcd0[_0x416afa(0x1fd)](_0x416afa(0x221)+_0x26a520[_0x416afa(0x1f3)]+_0x416afa(0x223)+_0x26a520['error']));}for(const _0x1352a4 of _0x3ad659['experimentalArtifacts']){_0x1352a4['action']==='error'&&console[_0x416afa(0x255)](a4_0xb3fcd0['red'](_0x416afa(0x282)+_0x1352a4[_0x416afa(0x1f3)]+_0x416afa(0x223)+_0x1352a4[_0x416afa(0x2ab)]));}return 0x1;}console['log']();const _0x143d8d=getLLMProjectUrl(_0x4f9e06,_0x3ad659[_0x416afa(0x1fb)]);return console[_0x416afa(0x255)]('Project:\x20'+a4_0xb3fcd0['cyan'](_0x143d8d)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x3a141b(0x1f3)]=a4_0x3a141b(0x210);['description']=a4_0x3a141b(0x29e);async[a4_0x3a141b(0x231)](_0x3792ff){const _0x1a5c13=a4_0x3a141b,{options:_0x4cbec7,args:_0xc76d70,tdx:_0x1734ab}=_0x3792ff;let _0x5092a5=_0xc76d70[0x0]||process['cwd']();const _0x701cf8=_0x4cbec7[_0x1a5c13(0x27c)],_0x42dc53=_0x4cbec7[_0x1a5c13(0x298)],_0x5f43ba=_0x4cbec7[_0x1a5c13(0x246)],_0x25de85=_0x4cbec7['site'],_0x3767fc=a4_0x19716f[_0x1a5c13(0x271)](_0x5092a5,'agent.yml'),_0x14ead5=existsSync(_0x3767fc);if(_0x14ead5){const {data:_0x1fb70a}=await withSpinner(_0x1a5c13(0x25e)+_0x5092a5+_0x1a5c13(0x280),()=>_0x1734ab[_0x1a5c13(0x249)][_0x1a5c13(0x247)](_0x5092a5,{'dryRun':_0x701cf8,'force':_0x42dc53}));if(_0x701cf8)return console[_0x1a5c13(0x255)](a4_0xb3fcd0[_0x1a5c13(0x20a)](_0x1a5c13(0x24c))),console[_0x1a5c13(0x255)](_0x1a5c13(0x25a)+_0x1fb70a[_0x1a5c13(0x28e)]),0x0;if(_0x1fb70a[_0x1a5c13(0x1f1)]===_0x1a5c13(0x2ab))return console[_0x1a5c13(0x255)](a4_0xb3fcd0[_0x1a5c13(0x1fd)](_0x1a5c13(0x26d)+_0x1fb70a[_0x1a5c13(0x2ab)])),0x1;console[_0x1a5c13(0x255)](a4_0xb3fcd0[_0x1a5c13(0x204)](_0x1a5c13(0x23b)+_0x1fb70a['action']+_0x1a5c13(0x2ad))),console[_0x1a5c13(0x255)]('Agent:\x20'+_0x1fb70a[_0x1a5c13(0x28e)]);if(_0x1fb70a[_0x1a5c13(0x296)]&&_0x1fb70a[_0x1a5c13(0x22c)]){const _0x126a1e=getLLMAgentChatUrl(_0x25de85,_0x1fb70a['projectId'],_0x1fb70a[_0x1a5c13(0x296)]);console[_0x1a5c13(0x255)]('Chat:\x20'+a4_0xb3fcd0[_0x1a5c13(0x270)](_0x126a1e));}return 0x0;}const _0x346673=_0x4cbec7[_0x1a5c13(0x226)],_0x4c8275=resolveProjectFromContext(_0x5092a5,_0x346673);if(_0x4c8275['found'])_0x5092a5=_0x4c8275[_0x1a5c13(0x217)],_0x4c8275[_0x1a5c13(0x21f)]===_0x1a5c13(0x279)&&console['log'](a4_0xb3fcd0[_0x1a5c13(0x22b)](_0x1a5c13(0x20b)+_0x5092a5));else{let _0x4b7000=_0x1a5c13(0x259);_0x4c8275[_0x1a5c13(0x2a2)]===_0x1a5c13(0x28d)&&(_0x4b7000=_0x4c8275[_0x1a5c13(0x273)]+_0x1a5c13(0x262)+_0x4c8275[_0x1a5c13(0x226)]+_0x1a5c13(0x2a3));throw new SDKError(ErrorCode[_0x1a5c13(0x1ee)],_0x4c8275[_0x1a5c13(0x2a2)]===_0x1a5c13(0x242)?_0x4c8275['message']:_0x1a5c13(0x27b)+_0x5092a5,undefined,{'helpText':_0x4b7000});}const {data:_0x3dd973}=await withSpinner(_0x1a5c13(0x230),()=>_0x1734ab[_0x1a5c13(0x249)][_0x1a5c13(0x233)](_0x5092a5,{'dryRun':!![]})),_0x26e54f=_0x3dd973[_0x1a5c13(0x286)][_0x1a5c13(0x1f6)][_0x1a5c13(0x2a4)]>0x0;if(_0x26e54f){console['log'](a4_0xb3fcd0[_0x1a5c13(0x1fd)](_0x1a5c13(0x1ec)));for(const _0x3ffe29 of _0x3dd973[_0x1a5c13(0x1f6)]){_0x3ffe29[_0x1a5c13(0x1f1)]===_0x1a5c13(0x2ab)&&console['log'](a4_0xb3fcd0[_0x1a5c13(0x1fd)](_0x1a5c13(0x264)+_0x3ffe29[_0x1a5c13(0x28e)]+_0x1a5c13(0x223)+_0x3ffe29[_0x1a5c13(0x2ab)]));}return 0x1;}const _0x1e54ac=_0x3dd973['counts'][_0x1a5c13(0x1f6)][_0x1a5c13(0x1fa)]+_0x3dd973['counts'][_0x1a5c13(0x1fc)][_0x1a5c13(0x1fa)]+_0x3dd973[_0x1a5c13(0x286)][_0x1a5c13(0x28b)][_0x1a5c13(0x1fa)]+_0x3dd973[_0x1a5c13(0x286)][_0x1a5c13(0x291)][_0x1a5c13(0x1fa)]+_0x3dd973[_0x1a5c13(0x286)][_0x1a5c13(0x2a1)][_0x1a5c13(0x1fa)]+_0x3dd973[_0x1a5c13(0x286)][_0x1a5c13(0x245)][_0x1a5c13(0x1fa)]+_0x3dd973[_0x1a5c13(0x286)][_0x1a5c13(0x275)][_0x1a5c13(0x1fa)],_0x954c9e=_0x3dd973[_0x1a5c13(0x286)]['agents']['updated']+_0x3dd973[_0x1a5c13(0x286)][_0x1a5c13(0x1fc)][_0x1a5c13(0x268)]+_0x3dd973[_0x1a5c13(0x286)][_0x1a5c13(0x28b)][_0x1a5c13(0x268)]+_0x3dd973[_0x1a5c13(0x286)]['prompts'][_0x1a5c13(0x268)]+_0x3dd973[_0x1a5c13(0x286)][_0x1a5c13(0x2a1)][_0x1a5c13(0x268)]+_0x3dd973['counts'][_0x1a5c13(0x245)][_0x1a5c13(0x268)]+_0x3dd973[_0x1a5c13(0x286)][_0x1a5c13(0x275)][_0x1a5c13(0x268)],_0x2e561a=_0x3dd973['counts'][_0x1a5c13(0x1f6)][_0x1a5c13(0x253)]+_0x3dd973[_0x1a5c13(0x286)]['knowledgeBases']['unchanged']+_0x3dd973[_0x1a5c13(0x286)]['textKnowledgeBases'][_0x1a5c13(0x253)]+_0x3dd973[_0x1a5c13(0x286)][_0x1a5c13(0x291)][_0x1a5c13(0x253)]+_0x3dd973['counts'][_0x1a5c13(0x2a1)][_0x1a5c13(0x253)]+_0x3dd973[_0x1a5c13(0x286)]['experimentalKnowledgeBases'][_0x1a5c13(0x253)]+_0x3dd973[_0x1a5c13(0x286)]['experimentalArtifacts'][_0x1a5c13(0x253)];console[_0x1a5c13(0x255)]('\x0aPush\x20summary\x20for\x20\x27'+_0x3dd973[_0x1a5c13(0x289)]+'\x27:'),console['log']('\x20\x20'+a4_0xb3fcd0[_0x1a5c13(0x204)]('+\x20'+_0x1e54ac+_0x1a5c13(0x20d))+_0x1a5c13(0x237)+a4_0xb3fcd0[_0x1a5c13(0x20a)]('~\x20'+_0x954c9e+_0x1a5c13(0x24f))+_0x1a5c13(0x237)+a4_0xb3fcd0['dim']('=\x20'+_0x2e561a+_0x1a5c13(0x263))),console[_0x1a5c13(0x255)](_0x1a5c13(0x203)+formatCountSummary(_0x3dd973[_0x1a5c13(0x286)]['agents'])),console[_0x1a5c13(0x255)](_0x1a5c13(0x266)+formatCountSummary(_0x3dd973[_0x1a5c13(0x286)][_0x1a5c13(0x1fc)])),console['log'](_0x1a5c13(0x212)+formatCountSummary(_0x3dd973[_0x1a5c13(0x286)][_0x1a5c13(0x28b)])),console['log'](_0x1a5c13(0x229)+formatCountSummary(_0x3dd973[_0x1a5c13(0x286)][_0x1a5c13(0x291)])),console[_0x1a5c13(0x255)](_0x1a5c13(0x24d)+formatCountSummary(_0x3dd973[_0x1a5c13(0x286)][_0x1a5c13(0x2a1)]));const _0x38e45f=_0x3dd973[_0x1a5c13(0x286)][_0x1a5c13(0x245)][_0x1a5c13(0x1fa)]>0x0||_0x3dd973[_0x1a5c13(0x286)][_0x1a5c13(0x245)]['updated']>0x0||_0x3dd973[_0x1a5c13(0x286)][_0x1a5c13(0x245)][_0x1a5c13(0x253)]>0x0||_0x3dd973['counts'][_0x1a5c13(0x275)]['created']>0x0||_0x3dd973[_0x1a5c13(0x286)][_0x1a5c13(0x275)][_0x1a5c13(0x268)]>0x0||_0x3dd973[_0x1a5c13(0x286)]['experimentalArtifacts'][_0x1a5c13(0x253)]>0x0;_0x38e45f&&(console[_0x1a5c13(0x255)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x3dd973[_0x1a5c13(0x286)][_0x1a5c13(0x245)])),console[_0x1a5c13(0x255)](_0x1a5c13(0x21a)+formatCountSummary(_0x3dd973[_0x1a5c13(0x286)][_0x1a5c13(0x275)])));console[_0x1a5c13(0x255)]('\x20\x20Source:\x20'+a4_0xb3fcd0[_0x1a5c13(0x270)](_0x5092a5)),displayDiffs(_0x3dd973['agents'],_0x3dd973[_0x1a5c13(0x1fc)],_0x3dd973[_0x1a5c13(0x28b)],_0x3dd973[_0x1a5c13(0x291)],_0x3dd973['integrations'],_0x3dd973['experimentalKnowledgeBases'],_0x3dd973['experimentalArtifacts']);if(_0x701cf8)return console['log'](a4_0xb3fcd0[_0x1a5c13(0x20a)](_0x1a5c13(0x21b))),0x0;if(_0x1e54ac===0x0&&_0x954c9e===0x0){console['log'](a4_0xb3fcd0[_0x1a5c13(0x204)](_0x1a5c13(0x211)));const _0xcd1cc4=getLLMProjectUrl(_0x25de85,_0x3dd973['projectId']);return console[_0x1a5c13(0x255)](_0x1a5c13(0x224)+a4_0xb3fcd0[_0x1a5c13(0x270)](_0xcd1cc4)),0x0;}if(!_0x5f43ba&&!_0x42dc53){if(!isInteractive())return console[_0x1a5c13(0x2ab)](a4_0xb3fcd0[_0x1a5c13(0x1fd)](_0x1a5c13(0x250)),_0x1a5c13(0x243)),console[_0x1a5c13(0x2ab)](a4_0xb3fcd0['dim'](_0x1a5c13(0x2a9))),0x1;const _0x415709=await confirmKey(_0x1a5c13(0x1f0)+(_0x1e54ac+_0x954c9e)+_0x1a5c13(0x2a6));if(!_0x415709)return console[_0x1a5c13(0x255)](a4_0xb3fcd0[_0x1a5c13(0x20a)](_0x1a5c13(0x26a)),_0x1a5c13(0x22d)),0x1;}const {data:_0x284478}=await withSpinner(_0x1a5c13(0x21c),()=>_0x1734ab[_0x1a5c13(0x249)][_0x1a5c13(0x233)](_0x5092a5,{'force':_0x42dc53})),_0x4a5561=_0x284478[_0x1a5c13(0x286)][_0x1a5c13(0x1f6)][_0x1a5c13(0x2a4)]>0x0||_0x284478['counts'][_0x1a5c13(0x1fc)][_0x1a5c13(0x2a4)]>0x0||_0x284478[_0x1a5c13(0x286)][_0x1a5c13(0x28b)]['errors']>0x0||_0x284478['counts'][_0x1a5c13(0x291)][_0x1a5c13(0x2a4)]>0x0;if(_0x4a5561){console['log'](a4_0xb3fcd0[_0x1a5c13(0x20a)](_0x1a5c13(0x29c))),console['log'](),console[_0x1a5c13(0x255)](a4_0xb3fcd0[_0x1a5c13(0x1fd)](_0x1a5c13(0x208)));for(const _0x1b6820 of _0x284478[_0x1a5c13(0x1f6)]){_0x1b6820['action']===_0x1a5c13(0x2ab)&&console[_0x1a5c13(0x255)](a4_0xb3fcd0[_0x1a5c13(0x1fd)](_0x1a5c13(0x264)+_0x1b6820['agentName']+_0x1a5c13(0x223)+_0x1b6820[_0x1a5c13(0x2ab)]));}for(const _0xd75f09 of _0x284478['knowledgeBases']){_0xd75f09[_0x1a5c13(0x1f1)]===_0x1a5c13(0x2ab)&&console[_0x1a5c13(0x255)](a4_0xb3fcd0[_0x1a5c13(0x1fd)]('\x20\x20Knowledge\x20Base\x20\x22'+_0xd75f09[_0x1a5c13(0x1f3)]+_0x1a5c13(0x223)+_0xd75f09[_0x1a5c13(0x2ab)]));}for(const _0x3158ce of _0x284478[_0x1a5c13(0x28b)]){_0x3158ce[_0x1a5c13(0x1f1)]===_0x1a5c13(0x2ab)&&console[_0x1a5c13(0x255)](a4_0xb3fcd0[_0x1a5c13(0x1fd)](_0x1a5c13(0x258)+_0x3158ce[_0x1a5c13(0x1f3)]+_0x1a5c13(0x223)+_0x3158ce[_0x1a5c13(0x2ab)]));}for(const _0x4cb3c0 of _0x284478[_0x1a5c13(0x291)]){_0x4cb3c0[_0x1a5c13(0x1f1)]===_0x1a5c13(0x2ab)&&console[_0x1a5c13(0x255)](a4_0xb3fcd0[_0x1a5c13(0x1fd)](_0x1a5c13(0x234)+_0x4cb3c0[_0x1a5c13(0x1f3)]+'\x22:\x20'+_0x4cb3c0[_0x1a5c13(0x2ab)]));}for(const _0x14e39c of _0x284478[_0x1a5c13(0x2a1)]){_0x14e39c['action']===_0x1a5c13(0x2ab)&&console['log'](a4_0xb3fcd0[_0x1a5c13(0x1fd)]('\x20\x20Integration\x20\x22'+_0x14e39c[_0x1a5c13(0x1f3)]+_0x1a5c13(0x223)+_0x14e39c[_0x1a5c13(0x2ab)]));}return 0x1;}console[_0x1a5c13(0x255)](a4_0xb3fcd0[_0x1a5c13(0x204)](_0x1a5c13(0x216)+(_0x1e54ac+_0x954c9e)+_0x1a5c13(0x1fe)+_0x284478[_0x1a5c13(0x289)]+'\x27'));const _0x3ac59a=getLLMProjectUrl(_0x25de85,_0x284478[_0x1a5c13(0x22c)]);return console[_0x1a5c13(0x255)](_0x1a5c13(0x224)+a4_0xb3fcd0[_0x1a5c13(0x270)](_0x3ac59a)),0x0;}}
@@ -1 +1 @@
1
- const a5_0x236b70=a5_0x3342;(function(_0x56fb33,_0x23ce7c){const _0x5db979=a5_0x3342,_0x64fc1b=_0x56fb33();while(!![]){try{const _0x17a58c=parseInt(_0x5db979(0x126))/0x1*(parseInt(_0x5db979(0xdb))/0x2)+parseInt(_0x5db979(0x14a))/0x3*(-parseInt(_0x5db979(0xda))/0x4)+-parseInt(_0x5db979(0x120))/0x5*(parseInt(_0x5db979(0xef))/0x6)+parseInt(_0x5db979(0x14b))/0x7+-parseInt(_0x5db979(0xc1))/0x8*(parseInt(_0x5db979(0xc9))/0x9)+-parseInt(_0x5db979(0xd0))/0xa*(parseInt(_0x5db979(0x11d))/0xb)+-parseInt(_0x5db979(0xe8))/0xc*(-parseInt(_0x5db979(0xdf))/0xd);if(_0x17a58c===_0x23ce7c)break;else _0x64fc1b['push'](_0x64fc1b['shift']());}catch(_0x5c972c){_0x64fc1b['push'](_0x64fc1b['shift']());}}}(a5_0x5114,0x8ff79));function a5_0x5114(){const _0x5cf33e=['PASS','length','cyan','\x20\x20Evaluating...\x20','Project\x20path:\x20','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','table','Error\x20writing\x20output\x20file:\x20','Using\x20agent:\x20','\x20-\x20','9340064zUbivL','\x20\x20Agent:\x20','filter','conversation_url','✗\x20ERROR:\x20Project\x20not\x20found:\x20','no_local_folder','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','multiple_agents','9VICGBZ','execute','reeval','red','Usage:','tests','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','8664830HXZaME','Agent:\x20','add','\x20(new)','utf-8','Executing\x20new\x20tests...','timestamp','No\x20tests\x20have\x20tags\x20defined.','repeat',':\x20Sending\x20user\x20input...','68etPgik','2TZMdHx','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','dim','3979534awfhzE','\x20\x20Round\x20','FAIL','no_tests','Round\x20','site','llmProject','executeReeval','toLowerCase','84iXtVdM','tsv','size','Conversation\x20URL:\x20','name','Failed:\x20\x20\x20','forEach','930nzOiZs','Test\x20Configuration:','tags','projectDir','Available\x20tags:\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','green','isSpinning','dryRun','trim','json','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','✗\x20FAIL:\x20','Tests\x20found:\x20','Run\x20tests\x20for\x20an\x20LLM\x20agent','verbose','conversations','Evaluating\x20response...','✓\x20PASS:\x20','No\x20tests\x20found\x20with\x20tags:\x20','llm','\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)','...\x20','Running\x20test:\x20','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','Either\x20switch\x20to\x20the\x20\x22','join','agentDirs','\x20(cached)','not\x20found','New\x20tests\x20to\x20execute:\x20','Running:\x20','Failed\x20Tests:','Re-evaluation\x20Summary','map','test.yml','No\x20tests\x20found\x20matching:\x20','rounds','⚠\x20SKIPPED:\x20','Re-evaluating\x20cached\x20test\x20run...','push','agentName','white','resolveAgentId','Passed:\x20\x20\x20','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','11GTrirR','reason','status','35535sgMIcL','Round\x201/','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','jsonl','404','\x20\x20Conversation:\x20','591806FtbSox','agent:test','Site:\x20','Available\x20tests:\x20','now','basename','resolve','testName','✗\x20ERROR:\x20','found','start','yellow','Re-evaluating\x20','toISOString','log','ERROR','\x20\x20-\x20','split','has','message','Errors:\x20\x20\x20','some','Run\x20\x27tdx\x20agent\x20pull\x20','agent','text','projectName','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','writeFileSync','stop','Duration:\x20','includes','\x20\x20Site:\x20','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','Re-evaluating...','Output\x20written\x20to:\x20','723CXYNrX','6963110tyMMWI','Test\x20Summary','\x22:\x20','eval','\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'];a5_0x5114=function(){return _0x5cf33e;};return a5_0x5114();}import*as a5_0x26a35a from'node:fs';import*as a5_0x4da2d6 from'node:path';import a5_0x42b249 from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';function a5_0x3342(_0x3bd06d,_0x59822a){_0x3bd06d=_0x3bd06d-0xb5;const _0x5114ad=a5_0x5114();let _0x3342f2=_0x5114ad[_0x3bd06d];return _0x3342f2;}import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x236b70(0xec)]=a5_0x236b70(0x127);['description']=a5_0x236b70(0xfd);async[a5_0x236b70(0xca)](_0x1a5303){const _0x699572=a5_0x236b70,{options:_0x10fc74,args:_0x30aee7,tdx:_0x3582a5}=_0x1a5303,_0x37097d=_0x30aee7[0x0]||'.',_0x3549ca=_0x10fc74[_0x699572(0xf7)],_0x40585a=_0x10fc74,_0x551765=_0x40585a[_0x699572(0x14e)]===![],_0x2a9023=_0x40585a[_0x699572(0xcb)],_0x83334a=_0x40585a[_0x699572(0xec)],_0x4359f0=_0x40585a[_0x699572(0xf1)],_0x5443ae=_0x10fc74[_0x699572(0xe4)],_0xe6be08=_0x40585a['output'];if(_0x2a9023&&_0x551765)return console[_0x699572(0x134)](a5_0x42b249['red']('Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval')),0x1;let _0x2853c5=_0x699572(0xbd);if(_0x40585a[_0x699572(0xf9)])_0x2853c5=_0x699572(0xf9);else{if(_0x40585a[_0x699572(0x123)])_0x2853c5=_0x699572(0x123);else{if(_0x40585a[_0x699572(0xe9)])_0x2853c5=_0x699572(0xe9);else{if(_0x40585a['table'])_0x2853c5='table';}}}const _0x537abe=_0x40585a['llmProject'];let _0x363415=_0x37097d;const _0x42c333=a5_0x26a35a['existsSync'](_0x37097d),_0x59ec8f=_0x37097d==='.';if(!_0x42c333||_0x59ec8f){const _0x41f847=resolveProjectFromContext(_0x37097d,_0x537abe,{'requireFile':_0x699572(0x112)});if(_0x41f847[_0x699572(0x12f)])_0x363415=_0x41f847[_0x699572(0xf2)],_0x41f847['source']==='context'&&console[_0x699572(0x134)](a5_0x42b249[_0x699572(0xde)](_0x699572(0xbf)+_0x363415));else switch(_0x41f847[_0x699572(0x11e)]){case'no_context':console[_0x699572(0x134)](a5_0x42b249[_0x699572(0x131)](_0x41f847[_0x699572(0x139)])),console[_0x699572(0x134)](),console[_0x699572(0x134)](_0x699572(0xcd)),console[_0x699572(0x134)](_0x699572(0xb5)),console[_0x699572(0x134)](_0x699572(0x104)),console[_0x699572(0x134)](),console[_0x699572(0x134)](_0x699572(0xdd));return 0x1;case _0x699572(0xc6):console[_0x699572(0x134)](a5_0x42b249[_0x699572(0x131)](_0x41f847['message'])),console[_0x699572(0x134)](),console[_0x699572(0x134)](_0x699572(0x13c)+_0x41f847[_0x699572(0xe5)]+'\x27\x20to\x20create\x20the\x20folder\x20structure.');return 0x1;case _0x699572(0xc8):{const _0x6cfb84=a5_0x4da2d6[_0x699572(0x12b)](_0x41f847[_0x699572(0xf2)]);console[_0x699572(0x134)](a5_0x42b249[_0x699572(0x131)](_0x699572(0xbc)+_0x41f847[_0x699572(0xe5)]+'\x22:'));for(const _0x1870ae of _0x41f847[_0x699572(0x10a)]){console['log'](_0x699572(0x136)+_0x1870ae);}return console[_0x699572(0x134)](),console['log'](_0x699572(0xdc)+_0x6cfb84+'/<agent-name>'),0x1;}case _0x699572(0xe2):console[_0x699572(0x134)](a5_0x42b249[_0x699572(0x131)](_0x699572(0x11c)+_0x41f847[_0x699572(0xe5)]+'\x22.')),console[_0x699572(0x134)](a5_0x42b249[_0x699572(0xde)](_0x699572(0xba)+_0x41f847[_0x699572(0xf2)])),console[_0x699572(0x134)](),console[_0x699572(0x134)](_0x699572(0xc7));return 0x1;}}const {definition:_0x2c32a0,agentInfo:_0x4a1290}=parseTestFile(_0x363415);let _0x29ea04=_0x2c32a0[_0x699572(0xce)];if(_0x83334a){const _0xb76087=_0x83334a[_0x699572(0x137)](',')[_0x699572(0x111)](_0x3411ff=>_0x3411ff[_0x699572(0xf8)]());_0x29ea04=_0x2c32a0[_0x699572(0xce)][_0x699572(0xc3)](_0x37bd0f=>_0xb76087[_0x699572(0x144)](_0x37bd0f[_0x699572(0xec)]));if(_0x29ea04['length']===0x0)return console[_0x699572(0x134)](a5_0x42b249[_0x699572(0x131)](_0x699572(0x113)+_0x83334a)),console[_0x699572(0x134)](a5_0x42b249[_0x699572(0xde)](_0x699572(0x129)+_0x2c32a0[_0x699572(0xce)]['map'](_0x575f2e=>_0x575f2e[_0x699572(0xec)])['join'](',\x20'))),0x1;}if(_0x4359f0){const _0x3f377b=_0x4359f0['split'](',')[_0x699572(0x111)](_0x5bb8c9=>_0x5bb8c9['trim']()[_0x699572(0xe7)]());_0x29ea04=_0x29ea04[_0x699572(0xc3)](_0x4dd39d=>_0x4dd39d['tags']?.[_0x699572(0x13b)](_0x194de0=>_0x3f377b[_0x699572(0x144)](_0x194de0[_0x699572(0xe7)]())));if(_0x29ea04[_0x699572(0xb7)]===0x0){console[_0x699572(0x134)](a5_0x42b249[_0x699572(0x131)](_0x699572(0x102)+_0x4359f0));const _0x4869dc=new Set();return _0x2c32a0[_0x699572(0xce)][_0x699572(0xee)](_0xe2cb7f=>_0xe2cb7f[_0x699572(0xf1)]?.[_0x699572(0xee)](_0x41bfdc=>_0x4869dc[_0x699572(0xd2)](_0x41bfdc))),_0x4869dc[_0x699572(0xea)]>0x0?console[_0x699572(0x134)](a5_0x42b249[_0x699572(0xde)](_0x699572(0xf3)+[..._0x4869dc][_0x699572(0x109)](',\x20'))):console[_0x699572(0x134)](a5_0x42b249[_0x699572(0xde)](_0x699572(0xd7))),0x1;}}if(_0x2a9023)return this[_0x699572(0xe6)](_0x1a5303,{'definition':{'tests':_0x29ea04},'agentInfo':_0x4a1290,'outputFormat':_0x2853c5,'outputFile':_0xe6be08,'testNames':_0x83334a});if(_0x3549ca){console[_0x699572(0x134)](a5_0x42b249['cyan'](_0x699572(0xf0))),console[_0x699572(0x134)](_0x699572(0x145)+a5_0x42b249[_0x699572(0x119)](_0x5443ae)),console[_0x699572(0x134)]('\x20\x20Project:\x20'+a5_0x42b249[_0x699572(0x119)](_0x4a1290[_0x699572(0x13f)])),console['log'](_0x699572(0xc2)+a5_0x42b249[_0x699572(0x119)](_0x4a1290['agentName'])),console[_0x699572(0x134)](),console[_0x699572(0x134)](_0x699572(0xfc)+a5_0x42b249['white'](_0x29ea04[_0x699572(0xb7)]));for(let _0x3f931d=0x0;_0x3f931d<_0x29ea04[_0x699572(0xb7)];_0x3f931d++){const _0x22dd28=_0x29ea04[_0x3f931d],_0x121e25=_0x22dd28[_0x699572(0x114)][_0x699572(0xb7)]===0x1?'round':_0x699572(0x114),_0x53f80f=_0x22dd28[_0x699572(0xf1)]?.['length']?'\x20['+_0x22dd28[_0x699572(0xf1)][_0x699572(0x109)](',\x20')+']':'';console[_0x699572(0x134)]('\x20\x20'+(_0x3f931d+0x1)+'.\x20'+a5_0x42b249[_0x699572(0x119)](_0x22dd28['name'])+'\x20('+_0x22dd28[_0x699572(0x114)]['length']+'\x20'+_0x121e25+')'+a5_0x42b249['dim'](_0x53f80f));}return 0x0;}let _0x3078dd,_0x40107f;try{_0x3078dd=await _0x3582a5[_0x699572(0x103)]['resolveProjectId'](_0x4a1290[_0x699572(0x13f)]);}catch(_0xff6072){const _0xe97574=_0xff6072 instanceof Error?_0xff6072['message']:String(_0xff6072);return _0xe97574[_0x699572(0x144)](_0x699572(0x124))||_0xe97574['toLowerCase']()['includes'](_0x699572(0x10c))?console[_0x699572(0x134)](a5_0x42b249[_0x699572(0xcc)](_0x699572(0xc5)+_0x4a1290[_0x699572(0x13f)])):console['log'](a5_0x42b249['red']('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22'+_0x4a1290[_0x699572(0x13f)]+_0x699572(0x14d)+_0xe97574)),0x1;}try{_0x40107f=await _0x3582a5[_0x699572(0x103)][_0x699572(0x11a)](_0x4a1290[_0x699572(0x118)],_0x3078dd);}catch(_0x3e9d77){const _0x2fd085=_0x3e9d77 instanceof Error?_0x3e9d77[_0x699572(0x139)]:String(_0x3e9d77);return _0x2fd085[_0x699572(0x144)](_0x699572(0x124))||_0x2fd085[_0x699572(0xe7)]()['includes'](_0x699572(0x10c))?console['log'](a5_0x42b249['red'](_0x699572(0x146)+_0x4a1290[_0x699572(0x118)])):console['log'](a5_0x42b249['red'](_0x699572(0xf4)+_0x4a1290[_0x699572(0x118)]+_0x699572(0x14d)+_0x2fd085)),0x1;}let _0x47da58;if(!_0x551765)try{_0x47da58=await setupEvaluatorAgent(_0x3582a5[_0x699572(0x103)],_0x10fc74['verbose']);}catch(_0x1699fd){const _0x4a24fd=_0x1699fd instanceof Error?_0x1699fd[_0x699572(0x139)]:String(_0x1699fd);return console[_0x699572(0x134)](a5_0x42b249['red'](_0x699572(0x147)+_0x4a24fd)),0x1;}console[_0x699572(0x134)](a5_0x42b249[_0x699572(0xb8)]('Running\x20agent\x20tests...')),console[_0x699572(0x134)](_0x699572(0x128)+a5_0x42b249[_0x699572(0x119)](_0x5443ae)),console['log']('Agent:\x20'+a5_0x42b249[_0x699572(0x119)](_0x4a1290['projectName']+'/'+_0x4a1290['agentName'])),console[_0x699572(0x134)]();const _0x4ba7e1=[],_0x2563ad=[],_0x1d3cfa=Date[_0x699572(0x12a)]();for(let _0xc9df1b=0x0;_0xc9df1b<_0x29ea04[_0x699572(0xb7)];_0xc9df1b++){const _0x1ec015=_0x29ea04[_0xc9df1b];_0x29ea04[_0x699572(0xb7)]>0x1?console[_0x699572(0x134)]('Test\x20'+(_0xc9df1b+0x1)+'/'+_0x29ea04[_0x699572(0xb7)]+':\x20'+a5_0x42b249['white'](_0x1ec015['name'])):console[_0x699572(0x134)](_0x699572(0x106)+a5_0x42b249[_0x699572(0x119)](_0x1ec015[_0x699572(0xec)]));const _0x11dc07=createCommandSpinner(_0x699572(0x121)+_0x1ec015[_0x699572(0x114)]['length']+_0x699572(0xd9));_0x11dc07['start']();try{const {result:_0x34e7e2,conversation:_0x3df221}=await runTest(_0x3582a5[_0x699572(0x103)],_0x1ec015,{'agentId':_0x40107f,'projectId':_0x3078dd,'site':_0x5443ae,'noEval':_0x551765,'evaluatorId':_0x47da58,'onRoundStart':(_0x2ed176,_0x1f844a)=>{const _0x1aecd0=_0x699572;_0x11dc07['text']=_0x1aecd0(0xe3)+(_0x2ed176+0x1)+'/'+_0x1f844a+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x1b41de,_0x394813,_0x298780)=>{const _0x3d1c16=_0x699572,_0xecd44e=formatElapsed(_0x394813);_0x298780?console[_0x3d1c16(0x134)](_0x3d1c16(0xe0)+(_0x1b41de+0x1)+'/'+_0x1ec015[_0x3d1c16(0x114)][_0x3d1c16(0xb7)]+_0x3d1c16(0x105)+a5_0x42b249[_0x3d1c16(0xf5)]('✓')+'\x20('+_0xecd44e+')'):console[_0x3d1c16(0x134)]('\x20\x20Round\x20'+(_0x1b41de+0x1)+'/'+_0x1ec015[_0x3d1c16(0x114)]['length']+_0x3d1c16(0x105)+a5_0x42b249['red']('✗'));},'onEvaluationStart':()=>{const _0x58e62d=_0x699572;_0x11dc07[_0x58e62d(0x13e)]=_0x58e62d(0x100);},'onEvaluationComplete':_0x16b22e=>{const _0x5cbd36=_0x699572,_0xc147ee=formatElapsed(_0x16b22e);console['log'](_0x5cbd36(0xb9)+a5_0x42b249['green']('✓')+'\x20('+_0xc147ee+')');}});_0x11dc07['stop'](),_0x4ba7e1['push'](_0x34e7e2),_0x2563ad['push'](_0x3df221);if(_0x34e7e2['status']===_0x699572(0xb6))console[_0x699572(0x134)](a5_0x42b249[_0x699572(0xf5)](_0x699572(0x101)+_0x34e7e2[_0x699572(0x11e)]));else _0x34e7e2[_0x699572(0x11f)]===_0x699572(0xe1)?console['log'](a5_0x42b249[_0x699572(0xcc)](_0x699572(0xfb)+_0x34e7e2[_0x699572(0x11e)])):console[_0x699572(0x134)](a5_0x42b249['red'](_0x699572(0x12e)+_0x34e7e2['reason']));_0x34e7e2[_0x699572(0xc4)]&&console[_0x699572(0x134)](a5_0x42b249[_0x699572(0xde)](_0x699572(0xeb)+_0x34e7e2[_0x699572(0xc4)])),console[_0x699572(0x134)]();}catch(_0x71bc69){_0x11dc07[_0x699572(0x142)]();const _0x36ae7f=_0x71bc69 instanceof Error?_0x71bc69[_0x699572(0x139)]:String(_0x71bc69);console[_0x699572(0x134)](a5_0x42b249[_0x699572(0xcc)](_0x699572(0x12e)+_0x36ae7f)),console[_0x699572(0x134)](),_0x4ba7e1[_0x699572(0x117)]({'name':_0x1ec015[_0x699572(0xec)],'status':_0x699572(0x135),'reason':_0x36ae7f,'timestamp':new Date()[_0x699572(0x133)](),'duration_ms':0x0});}}const _0x290410=Date[_0x699572(0x12a)]()-_0x1d3cfa,_0x2ae111=_0x4ba7e1[_0x699572(0xc3)](_0xe0fe1=>_0xe0fe1['status']===_0x699572(0xb6))[_0x699572(0xb7)],_0xa4ccc8=_0x4ba7e1[_0x699572(0xc3)](_0x14aa3a=>_0x14aa3a['status']===_0x699572(0xe1))[_0x699572(0xb7)],_0x479dc9=_0x4ba7e1[_0x699572(0xc3)](_0x5a183e=>_0x5a183e[_0x699572(0x11f)]===_0x699572(0x135))[_0x699572(0xb7)];console[_0x699572(0x134)]('━'['repeat'](0x3c)),console[_0x699572(0x134)](_0x699572(0x14c)),console[_0x699572(0x134)]('━'['repeat'](0x3c)),console[_0x699572(0x134)]('Total:\x20\x20\x20\x20'+_0x4ba7e1[_0x699572(0xb7)]),console['log'](_0x699572(0x11b)+a5_0x42b249[_0x699572(0xf5)](_0x2ae111)),console['log'](_0x699572(0xed)+a5_0x42b249[_0x699572(0xcc)](_0xa4ccc8));_0x479dc9>0x0&&console[_0x699572(0x134)](_0x699572(0x13a)+a5_0x42b249[_0x699572(0xcc)](_0x479dc9));console[_0x699572(0x134)](_0x699572(0x143)+formatElapsed(_0x290410)),console[_0x699572(0x134)]('━'[_0x699572(0xd8)](0x3c));const _0x16688b=_0x4ba7e1[_0x699572(0xc3)](_0x5c85b7=>_0x5c85b7[_0x699572(0x11f)]!==_0x699572(0xb6));if(_0x16688b[_0x699572(0xb7)]>0x0){console[_0x699572(0x134)](),console[_0x699572(0x134)](_0x699572(0x10f));for(const _0x43ac6d of _0x16688b){const _0x52e8b8=a5_0x42b249[_0x699572(0xcc)]('✗'),_0x4b2a20=_0x43ac6d[_0x699572(0x11e)]['length']>0x32?_0x43ac6d[_0x699572(0x11e)]['substring'](0x0,0x32)+'...':_0x43ac6d['reason'];console['log']('\x20\x20'+_0x52e8b8+'\x20'+_0x43ac6d[_0x699572(0xec)]+':\x20'+_0x4b2a20);}}const _0x566949={'summary':{'total':_0x4ba7e1['length'],'passed':_0x2ae111,'failed':_0xa4ccc8,'errors':_0x479dc9>0x0?_0x479dc9:undefined,'duration_ms':_0x290410},'tests':_0x4ba7e1,'agent':{'project':_0x4a1290[_0x699572(0x13f)],'name':_0x4a1290[_0x699572(0x118)],'site':_0x5443ae},'timestamp':new Date(_0x1d3cfa)['toISOString']()};try{const _0x44bcd8=buildCachedTestRun(_0x2563ad,{'site':_0x5443ae,'projectId':_0x3078dd,'projectName':_0x4a1290[_0x699572(0x13f)],'agentId':_0x40107f,'agentName':_0x4a1290['agentName'],'testYmlPath':a5_0x4da2d6[_0x699572(0x12c)](_0x4a1290['testYmlPath'])});saveLastTestRun(_0x44bcd8);}catch{}if(_0x2853c5!==_0x699572(0xbd)||_0xe6be08){const _0x16d5ae=formatResults(_0x566949,_0x2853c5);if(_0xe6be08)try{a5_0x26a35a[_0x699572(0x141)](_0xe6be08,_0x16d5ae,'utf-8'),console[_0x699572(0x134)](),console[_0x699572(0x134)](a5_0x42b249[_0x699572(0xde)](_0x699572(0x149)+_0xe6be08));}catch(_0x378b80){return console[_0x699572(0x134)](),console[_0x699572(0x134)](a5_0x42b249[_0x699572(0xcc)](_0x699572(0xbe)+_0x378b80)),0x1;}else console[_0x699572(0x134)](),console[_0x699572(0x134)](_0x16d5ae);}return _0x16688b['length']>0x0?0x1:0x0;}async[a5_0x236b70(0xe6)](_0x225eec,_0x28c712){const _0x342ea6=a5_0x236b70,{options:_0x405ad5,tdx:_0xfc5955}=_0x225eec,{definition:_0x3ce4d5,agentInfo:_0x5c1c3d,outputFormat:_0x533576,outputFile:_0x2581d1}=_0x28c712,_0x57968c=_0x405ad5[_0x342ea6(0xe4)],_0x2c38aa=loadLastTestRun();if(!_0x2c38aa)return console[_0x342ea6(0x134)](a5_0x42b249['red']('Error:\x20No\x20previous\x20test\x20run\x20found.')),console[_0x342ea6(0x134)](a5_0x42b249[_0x342ea6(0xde)](_0x342ea6(0xbb))),0x1;if(_0x2c38aa['agent'][_0x342ea6(0x118)]!==_0x5c1c3d['agentName'])return console[_0x342ea6(0x134)](a5_0x42b249[_0x342ea6(0xcc)]('Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22'+_0x2c38aa[_0x342ea6(0x13d)][_0x342ea6(0x118)]+_0x342ea6(0xcf)+_0x5c1c3d[_0x342ea6(0x118)]+'\x22.')),console[_0x342ea6(0x134)](a5_0x42b249[_0x342ea6(0xde)](_0x342ea6(0x122))),0x1;const _0x38f141=new Set(_0x2c38aa[_0x342ea6(0xff)]['map'](_0x56aef0=>_0x56aef0[_0x342ea6(0x12d)])),_0x594814=_0x3ce4d5['tests'][_0x342ea6(0xc3)](_0x43db90=>!_0x38f141[_0x342ea6(0x138)](_0x43db90[_0x342ea6(0xec)]));if(_0x594814[_0x342ea6(0xb7)]>0x0&&_0x2c38aa[_0x342ea6(0xe4)]!==_0x57968c)return console[_0x342ea6(0x134)](a5_0x42b249[_0x342ea6(0xcc)](_0x342ea6(0xfa))),console[_0x342ea6(0x134)](a5_0x42b249[_0x342ea6(0xde)]('Cached\x20run\x20is\x20from\x20site\x20\x22'+_0x2c38aa[_0x342ea6(0xe4)]+'\x22,\x20but\x20current\x20site\x20is\x20\x22'+_0x57968c+'\x22.')),console['log'](a5_0x42b249[_0x342ea6(0xde)](_0x342ea6(0x108)+_0x2c38aa[_0x342ea6(0xe4)]+_0x342ea6(0x107))),0x1;const _0x2f04a9=_0x3ce4d5[_0x342ea6(0xce)][_0x342ea6(0xc3)](_0x40c1c0=>_0x38f141[_0x342ea6(0x138)](_0x40c1c0[_0x342ea6(0xec)])),_0x21ae95=_0x594814;let _0x414bf3;try{_0x414bf3=await setupEvaluatorAgent(_0xfc5955[_0x342ea6(0x103)],_0x405ad5[_0x342ea6(0xfe)]);}catch(_0x5dbcdb){const _0x22e6ca=_0x5dbcdb instanceof Error?_0x5dbcdb[_0x342ea6(0x139)]:String(_0x5dbcdb);return console['log'](a5_0x42b249[_0x342ea6(0xcc)](_0x342ea6(0x147)+_0x22e6ca)),0x1;}console[_0x342ea6(0x134)](a5_0x42b249[_0x342ea6(0xb8)](_0x342ea6(0x116))),console[_0x342ea6(0x134)]('Cached\x20run\x20from:\x20'+a5_0x42b249[_0x342ea6(0x119)](_0x2c38aa[_0x342ea6(0xd6)])),console[_0x342ea6(0x134)](_0x342ea6(0xd1)+a5_0x42b249[_0x342ea6(0x119)](_0x2c38aa[_0x342ea6(0x13d)]['projectName']+'/'+_0x2c38aa[_0x342ea6(0x13d)][_0x342ea6(0x118)]));_0x21ae95[_0x342ea6(0xb7)]>0x0&&console[_0x342ea6(0x134)](_0x342ea6(0x10d)+a5_0x42b249[_0x342ea6(0x131)](_0x21ae95['length']));console[_0x342ea6(0x134)]();const _0x51059a=[],_0x508d16=Date[_0x342ea6(0x12a)](),_0x2523b1=createCommandSpinner(_0x342ea6(0x148));if(_0x2f04a9['length']>0x0)try{const _0x1ac40f=await reevaluateFromCache(_0xfc5955['llm'],_0x2c38aa,{'tests':_0x2f04a9},{'evaluatorId':_0x414bf3,'onTestStart':(_0x6ef005,_0x3492c7,_0x157336)=>{const _0x1cb5f7=_0x342ea6;_0x2523b1[_0x1cb5f7(0x13e)]=_0x1cb5f7(0x132)+(_0x3492c7+0x1)+'/'+_0x157336+':\x20'+_0x6ef005+'...';if(!_0x2523b1[_0x1cb5f7(0xf6)])_0x2523b1[_0x1cb5f7(0x130)]();},'onTestComplete':(_0x4c119f,_0x4081ee)=>{const _0x2dcc60=_0x342ea6;_0x2523b1[_0x2dcc60(0x142)]();if(_0x4081ee['status']===_0x2dcc60(0xb6))console[_0x2dcc60(0x134)](a5_0x42b249['green'](_0x2dcc60(0x101)+_0x4c119f)+a5_0x42b249[_0x2dcc60(0xde)](_0x2dcc60(0x10b)));else _0x4081ee[_0x2dcc60(0x11f)]===_0x2dcc60(0xe1)?console[_0x2dcc60(0x134)](a5_0x42b249[_0x2dcc60(0xcc)](_0x2dcc60(0xfb)+_0x4c119f+_0x2dcc60(0xc0)+_0x4081ee[_0x2dcc60(0x11e)])+a5_0x42b249[_0x2dcc60(0xde)](_0x2dcc60(0x10b))):console[_0x2dcc60(0x134)](a5_0x42b249[_0x2dcc60(0xcc)]('✗\x20ERROR:\x20'+_0x4c119f+_0x2dcc60(0xc0)+_0x4081ee[_0x2dcc60(0x11e)]));_0x4081ee[_0x2dcc60(0xc4)]&&console[_0x2dcc60(0x134)](a5_0x42b249[_0x2dcc60(0xde)]('\x20\x20Conversation:\x20'+_0x4081ee['conversation_url'])),_0x51059a[_0x2dcc60(0x117)](_0x4081ee);},'onTestSkipped':(_0x2897ca,_0x1d097f)=>{const _0x3a89b3=_0x342ea6;_0x2523b1[_0x3a89b3(0x142)](),console[_0x3a89b3(0x134)](a5_0x42b249['yellow'](_0x3a89b3(0x115)+_0x2897ca+_0x3a89b3(0xc0)+_0x1d097f));}});for(const _0x4f8b5d of _0x1ac40f){!_0x51059a['find'](_0x2d55de=>_0x2d55de['name']===_0x4f8b5d[_0x342ea6(0xec)])&&_0x51059a[_0x342ea6(0x117)](_0x4f8b5d);}}catch(_0x494fd7){_0x2523b1[_0x342ea6(0x142)]();const _0x5ab6ab=_0x494fd7 instanceof Error?_0x494fd7[_0x342ea6(0x139)]:String(_0x494fd7);return console[_0x342ea6(0x134)](a5_0x42b249['red'](_0x342ea6(0x140)+_0x5ab6ab)),0x1;}_0x2523b1[_0x342ea6(0x142)]();if(_0x21ae95[_0x342ea6(0xb7)]>0x0){console[_0x342ea6(0x134)](),console[_0x342ea6(0x134)](a5_0x42b249[_0x342ea6(0xb8)](_0x342ea6(0xd5)));const {projectId:_0x217ea9,agentId:_0x1d30f9}=_0x2c38aa[_0x342ea6(0x13d)];for(const _0x25f9a7 of _0x21ae95){console['log'](_0x342ea6(0x10e)+a5_0x42b249[_0x342ea6(0x119)](_0x25f9a7[_0x342ea6(0xec)]));const _0x55aeb7=createCommandSpinner(_0x342ea6(0x121)+_0x25f9a7[_0x342ea6(0x114)][_0x342ea6(0xb7)]+':\x20Sending\x20user\x20input...');_0x55aeb7[_0x342ea6(0x130)]();try{const {result:_0x3acfc9}=await runTest(_0xfc5955[_0x342ea6(0x103)],_0x25f9a7,{'agentId':_0x1d30f9,'projectId':_0x217ea9,'site':_0x2c38aa[_0x342ea6(0xe4)],'noEval':![],'evaluatorId':_0x414bf3,'onRoundStart':(_0x4fed3a,_0x41a030)=>{const _0x4a1749=_0x342ea6;_0x55aeb7[_0x4a1749(0x13e)]=_0x4a1749(0xe3)+(_0x4fed3a+0x1)+'/'+_0x41a030+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x180019,_0x189200,_0x18cc10)=>{const _0x429f6f=_0x342ea6,_0x35471c=formatElapsed(_0x189200);_0x18cc10?console['log'](_0x429f6f(0xe0)+(_0x180019+0x1)+'/'+_0x25f9a7[_0x429f6f(0x114)][_0x429f6f(0xb7)]+_0x429f6f(0x105)+a5_0x42b249['green']('✓')+'\x20('+_0x35471c+')'):console[_0x429f6f(0x134)](_0x429f6f(0xe0)+(_0x180019+0x1)+'/'+_0x25f9a7['rounds']['length']+_0x429f6f(0x105)+a5_0x42b249['red']('✗'));},'onEvaluationStart':()=>{const _0x2138d1=_0x342ea6;_0x55aeb7[_0x2138d1(0x13e)]=_0x2138d1(0x100);},'onEvaluationComplete':_0x3c9dce=>{const _0x36451f=_0x342ea6,_0x47ca34=formatElapsed(_0x3c9dce);console['log'](_0x36451f(0xb9)+a5_0x42b249[_0x36451f(0xf5)]('✓')+'\x20('+_0x47ca34+')');}});_0x55aeb7[_0x342ea6(0x142)](),_0x51059a[_0x342ea6(0x117)](_0x3acfc9);if(_0x3acfc9[_0x342ea6(0x11f)]==='PASS')console['log'](a5_0x42b249[_0x342ea6(0xf5)](_0x342ea6(0x101)+_0x3acfc9[_0x342ea6(0x11e)])+a5_0x42b249[_0x342ea6(0xde)]('\x20(new)'));else _0x3acfc9[_0x342ea6(0x11f)]===_0x342ea6(0xe1)?console[_0x342ea6(0x134)](a5_0x42b249['red']('✗\x20FAIL:\x20'+_0x3acfc9[_0x342ea6(0x11e)])+a5_0x42b249['dim'](_0x342ea6(0xd3))):console[_0x342ea6(0x134)](a5_0x42b249['red']('✗\x20ERROR:\x20'+_0x3acfc9[_0x342ea6(0x11e)]));_0x3acfc9[_0x342ea6(0xc4)]&&console[_0x342ea6(0x134)](a5_0x42b249[_0x342ea6(0xde)](_0x342ea6(0x125)+_0x3acfc9[_0x342ea6(0xc4)]));}catch(_0x41ebdf){_0x55aeb7[_0x342ea6(0x142)]();const _0x5155c6=_0x41ebdf instanceof Error?_0x41ebdf[_0x342ea6(0x139)]:String(_0x41ebdf);console[_0x342ea6(0x134)](a5_0x42b249[_0x342ea6(0xcc)]('✗\x20ERROR:\x20'+_0x5155c6)),_0x51059a[_0x342ea6(0x117)]({'name':_0x25f9a7[_0x342ea6(0xec)],'status':_0x342ea6(0x135),'reason':_0x5155c6,'timestamp':new Date()[_0x342ea6(0x133)](),'duration_ms':0x0});}}}console[_0x342ea6(0x134)]();const _0x47c886=Date[_0x342ea6(0x12a)]()-_0x508d16,_0x191c66=_0x51059a[_0x342ea6(0xc3)](_0x3334e0=>_0x3334e0['status']==='PASS')['length'],_0x152f51=_0x51059a[_0x342ea6(0xc3)](_0x40ea2d=>_0x40ea2d[_0x342ea6(0x11f)]===_0x342ea6(0xe1))[_0x342ea6(0xb7)],_0x173d92=_0x51059a[_0x342ea6(0xc3)](_0x5b850d=>_0x5b850d[_0x342ea6(0x11f)]===_0x342ea6(0x135))[_0x342ea6(0xb7)];console[_0x342ea6(0x134)]('━'[_0x342ea6(0xd8)](0x3c)),console[_0x342ea6(0x134)](_0x342ea6(0x110)),console[_0x342ea6(0x134)]('━'[_0x342ea6(0xd8)](0x3c)),console[_0x342ea6(0x134)]('Total:\x20\x20\x20\x20'+_0x51059a[_0x342ea6(0xb7)]),console[_0x342ea6(0x134)](_0x342ea6(0x11b)+a5_0x42b249[_0x342ea6(0xf5)](_0x191c66)),console[_0x342ea6(0x134)](_0x342ea6(0xed)+a5_0x42b249[_0x342ea6(0xcc)](_0x152f51));_0x173d92>0x0&&console[_0x342ea6(0x134)](_0x342ea6(0x13a)+a5_0x42b249['red'](_0x173d92));console[_0x342ea6(0x134)]('Duration:\x20'+formatElapsed(_0x47c886)),console['log']('━'[_0x342ea6(0xd8)](0x3c));const _0x3e076a={'summary':{'total':_0x51059a['length'],'passed':_0x191c66,'failed':_0x152f51,'errors':_0x173d92>0x0?_0x173d92:undefined,'duration_ms':_0x47c886},'tests':_0x51059a,'agent':{'project':_0x5c1c3d[_0x342ea6(0x13f)],'name':_0x5c1c3d[_0x342ea6(0x118)],'site':_0x57968c},'timestamp':new Date(_0x508d16)[_0x342ea6(0x133)]()};if(_0x533576!==_0x342ea6(0xbd)||_0x2581d1){const _0x49054f=formatResults(_0x3e076a,_0x533576);if(_0x2581d1)try{a5_0x26a35a['writeFileSync'](_0x2581d1,_0x49054f,_0x342ea6(0xd4)),console[_0x342ea6(0x134)](),console[_0x342ea6(0x134)](a5_0x42b249[_0x342ea6(0xde)]('Output\x20written\x20to:\x20'+_0x2581d1));}catch(_0x27635f){return console[_0x342ea6(0x134)](),console[_0x342ea6(0x134)](a5_0x42b249[_0x342ea6(0xcc)](_0x342ea6(0xbe)+_0x27635f)),0x1;}else console[_0x342ea6(0x134)](),console[_0x342ea6(0x134)](_0x49054f);}const _0x3d5437=_0x51059a[_0x342ea6(0xc3)](_0x5b7808=>_0x5b7808['status']!==_0x342ea6(0xb6));return _0x3d5437[_0x342ea6(0xb7)]>0x0?0x1:0x0;}}
1
+ function a5_0x17da(){const _0x3b4d17=['No\x20tests\x20found\x20with\x20tags:\x20','ERROR','10864224NaBpEH','trim','Re-evaluating\x20cached\x20test\x20run...','rounds','98LOsnhn','no_tests','\x22,\x20but\x20current\x20site\x20is\x20\x22','3246432BkGfsR','red','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','filter','Test\x20','status','no_local_folder','not\x20found','resolveAgentId','138328eaZyiF','timestamp','...','2318448fCHusF','✓\x20PASS:\x20','llm','basename','✗\x20ERROR:\x20','agent','push','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','projectName','projectDir','agentDirs','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','2OjNQrv','\x22:\x20','utf-8','text','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','site','PASS','Round\x20','Evaluating\x20response...','yellow','\x20\x20Site:\x20',':\x20Sending\x20user\x20input...','No\x20tests\x20found\x20matching:\x20','writeFileSync','verbose','tsv','repeat','Cached\x20run\x20is\x20from\x20site\x20\x22','Re-evaluating...','Re-evaluation\x20Summary','\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','⚠\x20SKIPPED:\x20','Either\x20switch\x20to\x20the\x20\x22','substring','Output\x20written\x20to:\x20','includes','Agent:\x20','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','conversation_url','Run\x20tests\x20for\x20an\x20LLM\x20agent','description','Running\x20agent\x20tests...','message','No\x20tests\x20have\x20tags\x20defined.','\x20\x20Project:\x20','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','5184440bxegpf','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','white','Failed:\x20\x20\x20','toISOString','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','\x20(new)','log','Round\x201/','now','split','Duration:\x20','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','\x20(cached)','testName','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','tests','/<agent-name>','green','found','join','\x20\x20-\x20','context','has','Test\x20Configuration:','agent:test','forEach','conversations','eval','length','Total:\x20\x20\x20\x20','...\x20','name','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','table','cyan','multiple_agents','round','Site:\x20','test.yml','start','Available\x20tags:\x20','agentName','Re-evaluating\x20','New\x20tests\x20to\x20execute:\x20','\x20\x20Agent:\x20','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','toLowerCase','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','Failed\x20Tests:','\x20\x20Round\x20','stop','tags','dim','reason','output','Run\x20\x27tdx\x20agent\x20pull\x20','testYmlPath','jsonl','\x20\x20Conversation:\x20','llmProject','source','6974825YuSUpa','no_context','404','map','Running:\x20','Error:\x20No\x20previous\x20test\x20run\x20found.','✗\x20FAIL:\x20','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','Passed:\x20\x20\x20','Available\x20tests:\x20','some','FAIL','854198ZUKJgX','dryRun','\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)','Error\x20writing\x20output\x20file:\x20','json','\x20\x20Evaluating...\x20','resolveProjectId','\x20-\x20','find','size'];a5_0x17da=function(){return _0x3b4d17;};return a5_0x17da();}const a5_0x460621=a5_0x6380;(function(_0x3fe665,_0x238bcc){const _0x26f88f=a5_0x6380,_0x1c1dac=_0x3fe665();while(!![]){try{const _0x1c0dcc=parseInt(_0x26f88f(0xe0))/0x1+-parseInt(_0x26f88f(0x72))/0x2*(parseInt(_0x26f88f(0xff))/0x3)+parseInt(_0x26f88f(0x96))/0x4+parseInt(_0x26f88f(0xd4))/0x5+-parseInt(_0x26f88f(0xf3))/0x6+parseInt(_0x26f88f(0xf0))/0x7*(-parseInt(_0x26f88f(0xfc))/0x8)+-parseInt(_0x26f88f(0xec))/0x9;if(_0x1c0dcc===_0x238bcc)break;else _0x1c1dac['push'](_0x1c1dac['shift']());}catch(_0x5a9e8b){_0x1c1dac['push'](_0x1c1dac['shift']());}}}(a5_0x17da,0xbef5f));import*as a5_0x5cf069 from'node:fs';import*as a5_0x15e964 from'node:path';import a5_0x3ca49c from'chalk';import{BaseCommand}from'./command.js';function a5_0x6380(_0x1f0d05,_0x5936fe){_0x1f0d05=_0x1f0d05-0x69;const _0x17daa5=a5_0x17da();let _0x638047=_0x17daa5[_0x1f0d05];return _0x638047;}import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x460621(0xb6)]=a5_0x460621(0xaf);[a5_0x460621(0x90)]=a5_0x460621(0x8f);async['execute'](_0x45f6b9){const _0x437fc7=a5_0x460621,{options:_0x102585,args:_0x3c9d66,tdx:_0x277215}=_0x45f6b9,_0x32472d=_0x3c9d66[0x0]||'.',_0x440a85=_0x102585[_0x437fc7(0xe1)],_0x1035fa=_0x102585,_0x23b0f9=_0x1035fa[_0x437fc7(0xb2)]===![],_0x536ef6=_0x1035fa['reeval'],_0x3e0312=_0x1035fa[_0x437fc7(0xb6)],_0x224945=_0x1035fa[_0x437fc7(0xca)],_0x246409=_0x102585[_0x437fc7(0x77)],_0x49e40d=_0x1035fa[_0x437fc7(0xcd)];if(_0x536ef6&&_0x23b0f9)return console[_0x437fc7(0x9d)](a5_0x3ca49c[_0x437fc7(0xf4)]('Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval')),0x1;let _0x26e7bd=_0x437fc7(0xb8);if(_0x1035fa[_0x437fc7(0xe4)])_0x26e7bd=_0x437fc7(0xe4);else{if(_0x1035fa[_0x437fc7(0xd0)])_0x26e7bd=_0x437fc7(0xd0);else{if(_0x1035fa[_0x437fc7(0x81)])_0x26e7bd=_0x437fc7(0x81);else{if(_0x1035fa['table'])_0x26e7bd=_0x437fc7(0xb8);}}}const _0xda00bf=_0x1035fa[_0x437fc7(0xd2)];let _0x150eaa=_0x32472d;const _0x1f1b0c=a5_0x5cf069['existsSync'](_0x32472d),_0xe2ad93=_0x32472d==='.';if(!_0x1f1b0c||_0xe2ad93){const _0x29be55=resolveProjectFromContext(_0x32472d,_0xda00bf,{'requireFile':_0x437fc7(0xbd)});if(_0x29be55[_0x437fc7(0xa9)])_0x150eaa=_0x29be55[_0x437fc7(0x6f)],_0x29be55[_0x437fc7(0xd3)]===_0x437fc7(0xac)&&console[_0x437fc7(0x9d)](a5_0x3ca49c['dim']('Using\x20agent:\x20'+_0x150eaa));else switch(_0x29be55['reason']){case _0x437fc7(0xd5):console[_0x437fc7(0x9d)](a5_0x3ca49c['yellow'](_0x29be55[_0x437fc7(0x92)])),console[_0x437fc7(0x9d)](),console[_0x437fc7(0x9d)]('Usage:'),console['log'](_0x437fc7(0x86)),console[_0x437fc7(0x9d)](_0x437fc7(0xe2)),console[_0x437fc7(0x9d)](),console[_0x437fc7(0x9d)](_0x437fc7(0xdb));return 0x1;case _0x437fc7(0xf9):console[_0x437fc7(0x9d)](a5_0x3ca49c[_0x437fc7(0x7b)](_0x29be55[_0x437fc7(0x92)])),console['log'](),console[_0x437fc7(0x9d)](_0x437fc7(0xce)+_0x29be55[_0x437fc7(0xd2)]+'\x27\x20to\x20create\x20the\x20folder\x20structure.');return 0x1;case _0x437fc7(0xba):{const _0x2efa92=a5_0x15e964[_0x437fc7(0x69)](_0x29be55['projectDir']);console[_0x437fc7(0x9d)](a5_0x3ca49c[_0x437fc7(0x7b)](_0x437fc7(0x6d)+_0x29be55[_0x437fc7(0xd2)]+'\x22:'));for(const _0x3ec95c of _0x29be55[_0x437fc7(0x70)]){console[_0x437fc7(0x9d)](_0x437fc7(0xab)+_0x3ec95c);}return console[_0x437fc7(0x9d)](),console['log'](_0x437fc7(0x95)+_0x2efa92+_0x437fc7(0xa7)),0x1;}case _0x437fc7(0xf1):console[_0x437fc7(0x9d)](a5_0x3ca49c['yellow'](_0x437fc7(0x9b)+_0x29be55[_0x437fc7(0xd2)]+'\x22.')),console[_0x437fc7(0x9d)](a5_0x3ca49c['dim']('Project\x20path:\x20'+_0x29be55['projectDir'])),console[_0x437fc7(0x9d)](),console[_0x437fc7(0x9d)]('Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.');return 0x1;}}const {definition:_0x5d2aad,agentInfo:_0x52f85c}=parseTestFile(_0x150eaa);let _0xf4a45c=_0x5d2aad[_0x437fc7(0xa6)];if(_0x3e0312){const _0x290a80=_0x3e0312[_0x437fc7(0xa0)](',')[_0x437fc7(0xd7)](_0x50da8e=>_0x50da8e[_0x437fc7(0xed)]());_0xf4a45c=_0x5d2aad['tests']['filter'](_0xb887d5=>_0x290a80[_0x437fc7(0x8b)](_0xb887d5[_0x437fc7(0xb6)]));if(_0xf4a45c[_0x437fc7(0xb3)]===0x0)return console[_0x437fc7(0x9d)](a5_0x3ca49c[_0x437fc7(0x7b)](_0x437fc7(0x7e)+_0x3e0312)),console[_0x437fc7(0x9d)](a5_0x3ca49c[_0x437fc7(0xcb)](_0x437fc7(0xdd)+_0x5d2aad[_0x437fc7(0xa6)][_0x437fc7(0xd7)](_0x2335b8=>_0x2335b8[_0x437fc7(0xb6)])[_0x437fc7(0xaa)](',\x20'))),0x1;}if(_0x224945){const _0x221d5f=_0x224945['split'](',')['map'](_0x24e81c=>_0x24e81c[_0x437fc7(0xed)]()[_0x437fc7(0xc5)]());_0xf4a45c=_0xf4a45c[_0x437fc7(0xf6)](_0x1d9ed4=>_0x1d9ed4[_0x437fc7(0xca)]?.[_0x437fc7(0xde)](_0x3ae577=>_0x221d5f['includes'](_0x3ae577[_0x437fc7(0xc5)]())));if(_0xf4a45c['length']===0x0){console[_0x437fc7(0x9d)](a5_0x3ca49c[_0x437fc7(0x7b)](_0x437fc7(0xea)+_0x224945));const _0x41da90=new Set();return _0x5d2aad['tests'][_0x437fc7(0xb0)](_0x3b2142=>_0x3b2142['tags']?.['forEach'](_0x2473cd=>_0x41da90['add'](_0x2473cd))),_0x41da90[_0x437fc7(0xe9)]>0x0?console['log'](a5_0x3ca49c[_0x437fc7(0xcb)](_0x437fc7(0xbf)+[..._0x41da90]['join'](',\x20'))):console[_0x437fc7(0x9d)](a5_0x3ca49c[_0x437fc7(0xcb)](_0x437fc7(0x93))),0x1;}}if(_0x536ef6)return this['executeReeval'](_0x45f6b9,{'definition':{'tests':_0xf4a45c},'agentInfo':_0x52f85c,'outputFormat':_0x26e7bd,'outputFile':_0x49e40d,'testNames':_0x3e0312});if(_0x440a85){console['log'](a5_0x3ca49c['cyan'](_0x437fc7(0xae))),console[_0x437fc7(0x9d)](_0x437fc7(0x7c)+a5_0x3ca49c[_0x437fc7(0x98)](_0x246409)),console['log'](_0x437fc7(0x94)+a5_0x3ca49c[_0x437fc7(0x98)](_0x52f85c[_0x437fc7(0x6e)])),console[_0x437fc7(0x9d)](_0x437fc7(0xc3)+a5_0x3ca49c['white'](_0x52f85c[_0x437fc7(0xc0)])),console[_0x437fc7(0x9d)](),console[_0x437fc7(0x9d)]('Tests\x20found:\x20'+a5_0x3ca49c[_0x437fc7(0x98)](_0xf4a45c[_0x437fc7(0xb3)]));for(let _0x43507d=0x0;_0x43507d<_0xf4a45c[_0x437fc7(0xb3)];_0x43507d++){const _0x554c8e=_0xf4a45c[_0x43507d],_0x14d6b6=_0x554c8e[_0x437fc7(0xef)]['length']===0x1?_0x437fc7(0xbb):_0x437fc7(0xef),_0xfd06fa=_0x554c8e[_0x437fc7(0xca)]?.[_0x437fc7(0xb3)]?'\x20['+_0x554c8e[_0x437fc7(0xca)][_0x437fc7(0xaa)](',\x20')+']':'';console[_0x437fc7(0x9d)]('\x20\x20'+(_0x43507d+0x1)+'.\x20'+a5_0x3ca49c[_0x437fc7(0x98)](_0x554c8e[_0x437fc7(0xb6)])+'\x20('+_0x554c8e[_0x437fc7(0xef)][_0x437fc7(0xb3)]+'\x20'+_0x14d6b6+')'+a5_0x3ca49c[_0x437fc7(0xcb)](_0xfd06fa));}return 0x0;}let _0x45651a,_0x548aff;try{_0x45651a=await _0x277215['llm'][_0x437fc7(0xe6)](_0x52f85c['projectName']);}catch(_0x4bf0f3){const _0x21d6b0=_0x4bf0f3 instanceof Error?_0x4bf0f3['message']:String(_0x4bf0f3);return _0x21d6b0[_0x437fc7(0x8b)](_0x437fc7(0xd6))||_0x21d6b0['toLowerCase']()[_0x437fc7(0x8b)](_0x437fc7(0xfa))?console[_0x437fc7(0x9d)](a5_0x3ca49c[_0x437fc7(0xf4)]('✗\x20ERROR:\x20Project\x20not\x20found:\x20'+_0x52f85c[_0x437fc7(0x6e)])):console['log'](a5_0x3ca49c['red'](_0x437fc7(0xa5)+_0x52f85c[_0x437fc7(0x6e)]+_0x437fc7(0x73)+_0x21d6b0)),0x1;}try{_0x548aff=await _0x277215[_0x437fc7(0x101)][_0x437fc7(0xfb)](_0x52f85c[_0x437fc7(0xc0)],_0x45651a);}catch(_0x5680cb){const _0x442305=_0x5680cb instanceof Error?_0x5680cb[_0x437fc7(0x92)]:String(_0x5680cb);return _0x442305['includes']('404')||_0x442305[_0x437fc7(0xc5)]()['includes'](_0x437fc7(0xfa))?console[_0x437fc7(0x9d)](a5_0x3ca49c['red'](_0x437fc7(0x76)+_0x52f85c[_0x437fc7(0xc0)])):console[_0x437fc7(0x9d)](a5_0x3ca49c['red']('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22'+_0x52f85c[_0x437fc7(0xc0)]+_0x437fc7(0x73)+_0x442305)),0x1;}let _0x121816;if(!_0x23b0f9)try{_0x121816=await setupEvaluatorAgent(_0x277215[_0x437fc7(0x101)],_0x102585[_0x437fc7(0x80)]);}catch(_0x17d202){const _0x3bfe5b=_0x17d202 instanceof Error?_0x17d202[_0x437fc7(0x92)]:String(_0x17d202);return console['log'](a5_0x3ca49c[_0x437fc7(0xf4)](_0x437fc7(0xa2)+_0x3bfe5b)),0x1;}console[_0x437fc7(0x9d)](a5_0x3ca49c[_0x437fc7(0xb9)](_0x437fc7(0x91))),console['log'](_0x437fc7(0xbc)+a5_0x3ca49c[_0x437fc7(0x98)](_0x246409)),console[_0x437fc7(0x9d)](_0x437fc7(0x8c)+a5_0x3ca49c['white'](_0x52f85c[_0x437fc7(0x6e)]+'/'+_0x52f85c['agentName'])),console[_0x437fc7(0x9d)]();const _0x144811=[],_0x548955=[],_0x35faa8=Date[_0x437fc7(0x9f)]();for(let _0x358687=0x0;_0x358687<_0xf4a45c['length'];_0x358687++){const _0x2e4e8f=_0xf4a45c[_0x358687];_0xf4a45c[_0x437fc7(0xb3)]>0x1?console[_0x437fc7(0x9d)](_0x437fc7(0xf7)+(_0x358687+0x1)+'/'+_0xf4a45c[_0x437fc7(0xb3)]+':\x20'+a5_0x3ca49c[_0x437fc7(0x98)](_0x2e4e8f[_0x437fc7(0xb6)])):console['log']('Running\x20test:\x20'+a5_0x3ca49c['white'](_0x2e4e8f[_0x437fc7(0xb6)]));const _0x4a4275=createCommandSpinner('Round\x201/'+_0x2e4e8f[_0x437fc7(0xef)][_0x437fc7(0xb3)]+':\x20Sending\x20user\x20input...');_0x4a4275[_0x437fc7(0xbe)]();try{const {result:_0x892417,conversation:_0xe7b943}=await runTest(_0x277215[_0x437fc7(0x101)],_0x2e4e8f,{'agentId':_0x548aff,'projectId':_0x45651a,'site':_0x246409,'noEval':_0x23b0f9,'evaluatorId':_0x121816,'onRoundStart':(_0x10dc43,_0x1fab6a)=>{const _0x1b257c=_0x437fc7;_0x4a4275[_0x1b257c(0x75)]=_0x1b257c(0x79)+(_0x10dc43+0x1)+'/'+_0x1fab6a+_0x1b257c(0x7d);},'onRoundComplete':(_0x3ccb13,_0x2eb0ad,_0x303e73)=>{const _0x15aabe=_0x437fc7,_0x3db9fb=formatElapsed(_0x2eb0ad);_0x303e73?console[_0x15aabe(0x9d)](_0x15aabe(0xc8)+(_0x3ccb13+0x1)+'/'+_0x2e4e8f[_0x15aabe(0xef)]['length']+'...\x20'+a5_0x3ca49c[_0x15aabe(0xa8)]('✓')+'\x20('+_0x3db9fb+')'):console[_0x15aabe(0x9d)](_0x15aabe(0xc8)+(_0x3ccb13+0x1)+'/'+_0x2e4e8f[_0x15aabe(0xef)]['length']+_0x15aabe(0xb5)+a5_0x3ca49c[_0x15aabe(0xf4)]('✗'));},'onEvaluationStart':()=>{const _0x53521d=_0x437fc7;_0x4a4275[_0x53521d(0x75)]=_0x53521d(0x7a);},'onEvaluationComplete':_0x4be7e8=>{const _0x3ba73a=_0x437fc7,_0x5a7feb=formatElapsed(_0x4be7e8);console[_0x3ba73a(0x9d)](_0x3ba73a(0xe5)+a5_0x3ca49c[_0x3ba73a(0xa8)]('✓')+'\x20('+_0x5a7feb+')');}});_0x4a4275['stop'](),_0x144811[_0x437fc7(0x6c)](_0x892417),_0x548955[_0x437fc7(0x6c)](_0xe7b943);if(_0x892417['status']===_0x437fc7(0x78))console['log'](a5_0x3ca49c[_0x437fc7(0xa8)](_0x437fc7(0x100)+_0x892417[_0x437fc7(0xcc)]));else _0x892417[_0x437fc7(0xf8)]===_0x437fc7(0xdf)?console[_0x437fc7(0x9d)](a5_0x3ca49c[_0x437fc7(0xf4)]('✗\x20FAIL:\x20'+_0x892417[_0x437fc7(0xcc)])):console[_0x437fc7(0x9d)](a5_0x3ca49c['red'](_0x437fc7(0x6a)+_0x892417[_0x437fc7(0xcc)]));_0x892417[_0x437fc7(0x8e)]&&console[_0x437fc7(0x9d)](a5_0x3ca49c[_0x437fc7(0xcb)]('Conversation\x20URL:\x20'+_0x892417[_0x437fc7(0x8e)])),console[_0x437fc7(0x9d)]();}catch(_0x5d3ddc){_0x4a4275[_0x437fc7(0xc9)]();const _0x4173b1=_0x5d3ddc instanceof Error?_0x5d3ddc[_0x437fc7(0x92)]:String(_0x5d3ddc);console[_0x437fc7(0x9d)](a5_0x3ca49c[_0x437fc7(0xf4)](_0x437fc7(0x6a)+_0x4173b1)),console[_0x437fc7(0x9d)](),_0x144811[_0x437fc7(0x6c)]({'name':_0x2e4e8f[_0x437fc7(0xb6)],'status':_0x437fc7(0xeb),'reason':_0x4173b1,'timestamp':new Date()[_0x437fc7(0x9a)](),'duration_ms':0x0});}}const _0x30e5e7=Date[_0x437fc7(0x9f)]()-_0x35faa8,_0x14ee45=_0x144811[_0x437fc7(0xf6)](_0x95345b=>_0x95345b['status']==='PASS')[_0x437fc7(0xb3)],_0x2c4baa=_0x144811[_0x437fc7(0xf6)](_0xc946bb=>_0xc946bb['status']===_0x437fc7(0xdf))[_0x437fc7(0xb3)],_0x4eae88=_0x144811[_0x437fc7(0xf6)](_0xc849d9=>_0xc849d9[_0x437fc7(0xf8)]===_0x437fc7(0xeb))[_0x437fc7(0xb3)];console[_0x437fc7(0x9d)]('━'[_0x437fc7(0x82)](0x3c)),console['log']('Test\x20Summary'),console[_0x437fc7(0x9d)]('━'[_0x437fc7(0x82)](0x3c)),console[_0x437fc7(0x9d)](_0x437fc7(0xb4)+_0x144811['length']),console[_0x437fc7(0x9d)]('Passed:\x20\x20\x20'+a5_0x3ca49c[_0x437fc7(0xa8)](_0x14ee45)),console['log'](_0x437fc7(0x99)+a5_0x3ca49c[_0x437fc7(0xf4)](_0x2c4baa));_0x4eae88>0x0&&console[_0x437fc7(0x9d)]('Errors:\x20\x20\x20'+a5_0x3ca49c['red'](_0x4eae88));console[_0x437fc7(0x9d)](_0x437fc7(0xa1)+formatElapsed(_0x30e5e7)),console[_0x437fc7(0x9d)]('━'[_0x437fc7(0x82)](0x3c));const _0x124047=_0x144811[_0x437fc7(0xf6)](_0x1e7ca4=>_0x1e7ca4['status']!=='PASS');if(_0x124047[_0x437fc7(0xb3)]>0x0){console[_0x437fc7(0x9d)](),console[_0x437fc7(0x9d)](_0x437fc7(0xc7));for(const _0x2660a2 of _0x124047){const _0x744c84=a5_0x3ca49c['red']('✗'),_0x59f159=_0x2660a2['reason'][_0x437fc7(0xb3)]>0x32?_0x2660a2[_0x437fc7(0xcc)][_0x437fc7(0x89)](0x0,0x32)+_0x437fc7(0xfe):_0x2660a2['reason'];console[_0x437fc7(0x9d)]('\x20\x20'+_0x744c84+'\x20'+_0x2660a2[_0x437fc7(0xb6)]+':\x20'+_0x59f159);}}const _0x3c4cec={'summary':{'total':_0x144811[_0x437fc7(0xb3)],'passed':_0x14ee45,'failed':_0x2c4baa,'errors':_0x4eae88>0x0?_0x4eae88:undefined,'duration_ms':_0x30e5e7},'tests':_0x144811,'agent':{'project':_0x52f85c[_0x437fc7(0x6e)],'name':_0x52f85c['agentName'],'site':_0x246409},'timestamp':new Date(_0x35faa8)[_0x437fc7(0x9a)]()};try{const _0x4d223d=buildCachedTestRun(_0x548955,{'site':_0x246409,'projectId':_0x45651a,'projectName':_0x52f85c[_0x437fc7(0x6e)],'agentId':_0x548aff,'agentName':_0x52f85c[_0x437fc7(0xc0)],'testYmlPath':a5_0x15e964['resolve'](_0x52f85c[_0x437fc7(0xcf)])});saveLastTestRun(_0x4d223d);}catch{}if(_0x26e7bd!==_0x437fc7(0xb8)||_0x49e40d){const _0x4b370e=formatResults(_0x3c4cec,_0x26e7bd);if(_0x49e40d)try{a5_0x5cf069[_0x437fc7(0x7f)](_0x49e40d,_0x4b370e,'utf-8'),console[_0x437fc7(0x9d)](),console[_0x437fc7(0x9d)](a5_0x3ca49c[_0x437fc7(0xcb)](_0x437fc7(0x8a)+_0x49e40d));}catch(_0x102a96){return console['log'](),console['log'](a5_0x3ca49c[_0x437fc7(0xf4)](_0x437fc7(0xe3)+_0x102a96)),0x1;}else console[_0x437fc7(0x9d)](),console[_0x437fc7(0x9d)](_0x4b370e);}return _0x124047['length']>0x0?0x1:0x0;}async['executeReeval'](_0x57f930,_0xb22fff){const _0x209201=a5_0x460621,{options:_0x2a67e4,tdx:_0x81d4e2}=_0x57f930,{definition:_0x2362c7,agentInfo:_0x1ac133,outputFormat:_0x4eec98,outputFile:_0x274902}=_0xb22fff,_0xdff2f5=_0x2a67e4[_0x209201(0x77)],_0x241c80=loadLastTestRun();if(!_0x241c80)return console[_0x209201(0x9d)](a5_0x3ca49c[_0x209201(0xf4)](_0x209201(0xd9))),console[_0x209201(0x9d)](a5_0x3ca49c['dim'](_0x209201(0xf5))),0x1;if(_0x241c80['agent'][_0x209201(0xc0)]!==_0x1ac133[_0x209201(0xc0)])return console[_0x209201(0x9d)](a5_0x3ca49c['red'](_0x209201(0x8d)+_0x241c80[_0x209201(0x6b)]['agentName']+_0x209201(0xc4)+_0x1ac133[_0x209201(0xc0)]+'\x22.')),console[_0x209201(0x9d)](a5_0x3ca49c[_0x209201(0xcb)](_0x209201(0x71))),0x1;const _0x26352b=new Set(_0x241c80[_0x209201(0xb1)][_0x209201(0xd7)](_0x23ca2c=>_0x23ca2c[_0x209201(0xa4)])),_0x411a16=_0x2362c7[_0x209201(0xa6)][_0x209201(0xf6)](_0x967a4e=>!_0x26352b[_0x209201(0xad)](_0x967a4e[_0x209201(0xb6)]));if(_0x411a16['length']>0x0&&_0x241c80[_0x209201(0x77)]!==_0xdff2f5)return console[_0x209201(0x9d)](a5_0x3ca49c[_0x209201(0xf4)](_0x209201(0x97))),console['log'](a5_0x3ca49c['dim'](_0x209201(0x83)+_0x241c80[_0x209201(0x77)]+_0x209201(0xf2)+_0xdff2f5+'\x22.')),console[_0x209201(0x9d)](a5_0x3ca49c[_0x209201(0xcb)](_0x209201(0x88)+_0x241c80[_0x209201(0x77)]+_0x209201(0xc6))),0x1;const _0x26d2a5=_0x2362c7[_0x209201(0xa6)][_0x209201(0xf6)](_0xe4d688=>_0x26352b[_0x209201(0xad)](_0xe4d688['name'])),_0x4ee7a1=_0x411a16;let _0x4d3819;try{_0x4d3819=await setupEvaluatorAgent(_0x81d4e2[_0x209201(0x101)],_0x2a67e4[_0x209201(0x80)]);}catch(_0x473a66){const _0x5108d5=_0x473a66 instanceof Error?_0x473a66[_0x209201(0x92)]:String(_0x473a66);return console[_0x209201(0x9d)](a5_0x3ca49c[_0x209201(0xf4)](_0x209201(0xa2)+_0x5108d5)),0x1;}console[_0x209201(0x9d)](a5_0x3ca49c[_0x209201(0xb9)](_0x209201(0xee))),console[_0x209201(0x9d)]('Cached\x20run\x20from:\x20'+a5_0x3ca49c[_0x209201(0x98)](_0x241c80[_0x209201(0xfd)])),console[_0x209201(0x9d)](_0x209201(0x8c)+a5_0x3ca49c[_0x209201(0x98)](_0x241c80['agent'][_0x209201(0x6e)]+'/'+_0x241c80['agent']['agentName']));_0x4ee7a1[_0x209201(0xb3)]>0x0&&console[_0x209201(0x9d)](_0x209201(0xc2)+a5_0x3ca49c[_0x209201(0x7b)](_0x4ee7a1[_0x209201(0xb3)]));console['log']();const _0xca443b=[],_0x4e4843=Date[_0x209201(0x9f)](),_0x45fa71=createCommandSpinner(_0x209201(0x84));if(_0x26d2a5[_0x209201(0xb3)]>0x0)try{const _0x361c11=await reevaluateFromCache(_0x81d4e2['llm'],_0x241c80,{'tests':_0x26d2a5},{'evaluatorId':_0x4d3819,'onTestStart':(_0x38ed30,_0x8311b1,_0x6e1957)=>{const _0x24d6bf=_0x209201;_0x45fa71[_0x24d6bf(0x75)]=_0x24d6bf(0xc1)+(_0x8311b1+0x1)+'/'+_0x6e1957+':\x20'+_0x38ed30+_0x24d6bf(0xfe);if(!_0x45fa71['isSpinning'])_0x45fa71[_0x24d6bf(0xbe)]();},'onTestComplete':(_0x171a4a,_0x282ecc)=>{const _0x1b2e23=_0x209201;_0x45fa71[_0x1b2e23(0xc9)]();if(_0x282ecc[_0x1b2e23(0xf8)]===_0x1b2e23(0x78))console[_0x1b2e23(0x9d)](a5_0x3ca49c[_0x1b2e23(0xa8)](_0x1b2e23(0x100)+_0x171a4a)+a5_0x3ca49c[_0x1b2e23(0xcb)](_0x1b2e23(0xa3)));else _0x282ecc[_0x1b2e23(0xf8)]===_0x1b2e23(0xdf)?console[_0x1b2e23(0x9d)](a5_0x3ca49c[_0x1b2e23(0xf4)](_0x1b2e23(0xda)+_0x171a4a+_0x1b2e23(0xe7)+_0x282ecc['reason'])+a5_0x3ca49c[_0x1b2e23(0xcb)](_0x1b2e23(0xa3))):console['log'](a5_0x3ca49c[_0x1b2e23(0xf4)](_0x1b2e23(0x6a)+_0x171a4a+_0x1b2e23(0xe7)+_0x282ecc[_0x1b2e23(0xcc)]));_0x282ecc['conversation_url']&&console[_0x1b2e23(0x9d)](a5_0x3ca49c[_0x1b2e23(0xcb)]('\x20\x20Conversation:\x20'+_0x282ecc[_0x1b2e23(0x8e)])),_0xca443b['push'](_0x282ecc);},'onTestSkipped':(_0x2cb910,_0x9a137b)=>{const _0x448b86=_0x209201;_0x45fa71[_0x448b86(0xc9)](),console['log'](a5_0x3ca49c[_0x448b86(0x7b)](_0x448b86(0x87)+_0x2cb910+'\x20-\x20'+_0x9a137b));}});for(const _0xca6714 of _0x361c11){!_0xca443b[_0x209201(0xe8)](_0x3c4640=>_0x3c4640[_0x209201(0xb6)]===_0xca6714['name'])&&_0xca443b[_0x209201(0x6c)](_0xca6714);}}catch(_0x456614){_0x45fa71[_0x209201(0xc9)]();const _0x548467=_0x456614 instanceof Error?_0x456614['message']:String(_0x456614);return console[_0x209201(0x9d)](a5_0x3ca49c[_0x209201(0xf4)](_0x209201(0xb7)+_0x548467)),0x1;}_0x45fa71[_0x209201(0xc9)]();if(_0x4ee7a1['length']>0x0){console[_0x209201(0x9d)](),console['log'](a5_0x3ca49c[_0x209201(0xb9)]('Executing\x20new\x20tests...'));const {projectId:_0x2a3df0,agentId:_0x24187c}=_0x241c80[_0x209201(0x6b)];for(const _0x458474 of _0x4ee7a1){console[_0x209201(0x9d)](_0x209201(0xd8)+a5_0x3ca49c['white'](_0x458474[_0x209201(0xb6)]));const _0x43c002=createCommandSpinner(_0x209201(0x9e)+_0x458474[_0x209201(0xef)][_0x209201(0xb3)]+_0x209201(0x7d));_0x43c002[_0x209201(0xbe)]();try{const {result:_0x5f07ad}=await runTest(_0x81d4e2[_0x209201(0x101)],_0x458474,{'agentId':_0x24187c,'projectId':_0x2a3df0,'site':_0x241c80[_0x209201(0x77)],'noEval':![],'evaluatorId':_0x4d3819,'onRoundStart':(_0x20ff73,_0x149c5c)=>{const _0x5426d9=_0x209201;_0x43c002['text']=_0x5426d9(0x79)+(_0x20ff73+0x1)+'/'+_0x149c5c+_0x5426d9(0x7d);},'onRoundComplete':(_0x104cbc,_0x3c3735,_0x5e3f29)=>{const _0x1f5ce5=_0x209201,_0x52962a=formatElapsed(_0x3c3735);_0x5e3f29?console['log'](_0x1f5ce5(0xc8)+(_0x104cbc+0x1)+'/'+_0x458474[_0x1f5ce5(0xef)]['length']+_0x1f5ce5(0xb5)+a5_0x3ca49c['green']('✓')+'\x20('+_0x52962a+')'):console[_0x1f5ce5(0x9d)]('\x20\x20Round\x20'+(_0x104cbc+0x1)+'/'+_0x458474[_0x1f5ce5(0xef)][_0x1f5ce5(0xb3)]+'...\x20'+a5_0x3ca49c[_0x1f5ce5(0xf4)]('✗'));},'onEvaluationStart':()=>{const _0x1b0cfc=_0x209201;_0x43c002[_0x1b0cfc(0x75)]=_0x1b0cfc(0x7a);},'onEvaluationComplete':_0x598013=>{const _0x3764be=_0x209201,_0x13eaa2=formatElapsed(_0x598013);console['log'](_0x3764be(0xe5)+a5_0x3ca49c[_0x3764be(0xa8)]('✓')+'\x20('+_0x13eaa2+')');}});_0x43c002[_0x209201(0xc9)](),_0xca443b['push'](_0x5f07ad);if(_0x5f07ad[_0x209201(0xf8)]===_0x209201(0x78))console[_0x209201(0x9d)](a5_0x3ca49c[_0x209201(0xa8)]('✓\x20PASS:\x20'+_0x5f07ad[_0x209201(0xcc)])+a5_0x3ca49c['dim']('\x20(new)'));else _0x5f07ad[_0x209201(0xf8)]===_0x209201(0xdf)?console[_0x209201(0x9d)](a5_0x3ca49c[_0x209201(0xf4)](_0x209201(0xda)+_0x5f07ad['reason'])+a5_0x3ca49c[_0x209201(0xcb)](_0x209201(0x9c))):console[_0x209201(0x9d)](a5_0x3ca49c[_0x209201(0xf4)]('✗\x20ERROR:\x20'+_0x5f07ad[_0x209201(0xcc)]));_0x5f07ad[_0x209201(0x8e)]&&console[_0x209201(0x9d)](a5_0x3ca49c[_0x209201(0xcb)](_0x209201(0xd1)+_0x5f07ad[_0x209201(0x8e)]));}catch(_0x34dd7c){_0x43c002[_0x209201(0xc9)]();const _0x559175=_0x34dd7c instanceof Error?_0x34dd7c['message']:String(_0x34dd7c);console[_0x209201(0x9d)](a5_0x3ca49c[_0x209201(0xf4)](_0x209201(0x6a)+_0x559175)),_0xca443b['push']({'name':_0x458474['name'],'status':_0x209201(0xeb),'reason':_0x559175,'timestamp':new Date()[_0x209201(0x9a)](),'duration_ms':0x0});}}}console[_0x209201(0x9d)]();const _0x3a2962=Date[_0x209201(0x9f)]()-_0x4e4843,_0x27b175=_0xca443b[_0x209201(0xf6)](_0x18a9b3=>_0x18a9b3[_0x209201(0xf8)]===_0x209201(0x78))[_0x209201(0xb3)],_0x2d7d75=_0xca443b[_0x209201(0xf6)](_0x207a22=>_0x207a22['status']===_0x209201(0xdf))[_0x209201(0xb3)],_0x54e0fd=_0xca443b['filter'](_0x40a212=>_0x40a212[_0x209201(0xf8)]===_0x209201(0xeb))['length'];console[_0x209201(0x9d)]('━'['repeat'](0x3c)),console['log'](_0x209201(0x85)),console[_0x209201(0x9d)]('━'[_0x209201(0x82)](0x3c)),console['log'](_0x209201(0xb4)+_0xca443b[_0x209201(0xb3)]),console['log'](_0x209201(0xdc)+a5_0x3ca49c['green'](_0x27b175)),console[_0x209201(0x9d)](_0x209201(0x99)+a5_0x3ca49c['red'](_0x2d7d75));_0x54e0fd>0x0&&console['log']('Errors:\x20\x20\x20'+a5_0x3ca49c[_0x209201(0xf4)](_0x54e0fd));console[_0x209201(0x9d)](_0x209201(0xa1)+formatElapsed(_0x3a2962)),console[_0x209201(0x9d)]('━'[_0x209201(0x82)](0x3c));const _0x528f7b={'summary':{'total':_0xca443b['length'],'passed':_0x27b175,'failed':_0x2d7d75,'errors':_0x54e0fd>0x0?_0x54e0fd:undefined,'duration_ms':_0x3a2962},'tests':_0xca443b,'agent':{'project':_0x1ac133[_0x209201(0x6e)],'name':_0x1ac133[_0x209201(0xc0)],'site':_0xdff2f5},'timestamp':new Date(_0x4e4843)['toISOString']()};if(_0x4eec98!=='table'||_0x274902){const _0xefdce5=formatResults(_0x528f7b,_0x4eec98);if(_0x274902)try{a5_0x5cf069[_0x209201(0x7f)](_0x274902,_0xefdce5,_0x209201(0x74)),console[_0x209201(0x9d)](),console[_0x209201(0x9d)](a5_0x3ca49c[_0x209201(0xcb)](_0x209201(0x8a)+_0x274902));}catch(_0x5b9889){return console[_0x209201(0x9d)](),console[_0x209201(0x9d)](a5_0x3ca49c[_0x209201(0xf4)](_0x209201(0xe3)+_0x5b9889)),0x1;}else console[_0x209201(0x9d)](),console[_0x209201(0x9d)](_0xefdce5);}const _0x3fd93e=_0xca443b[_0x209201(0xf6)](_0x381056=>_0x381056[_0x209201(0xf8)]!==_0x209201(0x78));return _0x3fd93e[_0x209201(0xb3)]>0x0?0x1:0x0;}}
@@ -1 +1 @@
1
- const a6_0xa5ef=a6_0x2a2a;(function(_0x460bdc,_0x36ad42){const _0x323307=a6_0x2a2a,_0xf9794d=_0x460bdc();while(!![]){try{const _0x22da15=parseInt(_0x323307(0x208))/0x1*(-parseInt(_0x323307(0x207))/0x2)+parseInt(_0x323307(0x221))/0x3*(-parseInt(_0x323307(0x1fd))/0x4)+parseInt(_0x323307(0x216))/0x5+parseInt(_0x323307(0x1e2))/0x6+-parseInt(_0x323307(0x205))/0x7+-parseInt(_0x323307(0x202))/0x8+parseInt(_0x323307(0x1e9))/0x9;if(_0x22da15===_0x36ad42)break;else _0xf9794d['push'](_0xf9794d['shift']());}catch(_0x23b7e5){_0xf9794d['push'](_0xf9794d['shift']());}}}(a6_0x1a45,0x3e132));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';function a6_0x1a45(){const _0xf20428=['readBodyFromFile','body','7374627npOQxg','Invalid\x20HTTP\x20method:\x20','authorization','Results\x20saved\x20to\x20','trino','header','name','site','length','x-xsrf-token','GET','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','\x22.\x20','substring','entries','x-trino-user','error','set-cookie2','x-auth-token','Invalid\x20header\x20format:\x20\x22','1833112gXwjuW','keys','toLowerCase','llm','proxy-authorization','1570704uwJgSm','method','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','70462RNMLUH','includes','2AwKqSX','65171sfnxuZ','startsWith','stack','file','color','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','validate','\x0aStack\x20trace:\x0a','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','headers','type','data','workflow','PATCH','222205zdGmQF','message','join','llm-proxy','trim','cdp','Error:\x20','execute','noColor','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','verbose','3GxiSYA','PUT','status','indexOf','POST','721602XfBNmj','request','Invalid\x20API\x20type:\x20','DELETE','.\x20Valid\x20methods:\x20'];a6_0x1a45=function(){return _0xf20428;};return a6_0x1a45();}import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';function a6_0x2a2a(_0x2baa8b,_0x2e9cd8){_0x2baa8b=_0x2baa8b-0x1de;const _0x1a4553=a6_0x1a45();let _0x2a2aa6=_0x1a4553[_0x2baa8b];return _0x2a2aa6;}const SENSITIVE_HEADERS=new Set([a6_0xa5ef(0x1eb),a6_0xa5ef(0x201),'cookie','set-cookie',a6_0xa5ef(0x1fa),a6_0xa5ef(0x1f2),a6_0xa5ef(0x1fb),a6_0xa5ef(0x1f8)]);function isSensitiveHeader(_0xa5be0a){const _0x4f32b2=a6_0xa5ef;return SENSITIVE_HEADERS['has'](_0xa5be0a[_0x4f32b2(0x1ff)]());}function parseHeader(_0x3e91ce){const _0x3f7221=a6_0xa5ef,_0x4e5969=_0x3e91ce[_0x3f7221(0x1e0)](':');if(_0x4e5969===-0x1)throw new Error(_0x3f7221(0x1fc)+_0x3e91ce+_0x3f7221(0x1f5)+_0x3f7221(0x21f));const _0x11e537=_0x3e91ce[_0x3f7221(0x1f6)](0x0,_0x4e5969)[_0x3f7221(0x21a)](),_0x52b6f4=_0x3e91ce[_0x3f7221(0x1f6)](_0x4e5969+0x1)['trim']();if(!_0x11e537)throw new Error(_0x3f7221(0x204)+_0x3e91ce+'\x22');return[_0x11e537,_0x52b6f4];}export class ApiCommand extends BaseCommand{[a6_0xa5ef(0x1ef)]='api';['description']=a6_0xa5ef(0x210);[a6_0xa5ef(0x20e)](_0x5e8ecc){const _0x2aa4ca=a6_0xa5ef,{args:_0x19b695,options:_0x556e0b}=_0x5e8ecc,_0x16ace5=_0x556e0b;if(_0x19b695[_0x2aa4ca(0x1f1)]===0x0)return _0x2aa4ca(0x20d);const _0x1dfe61=_0x19b695[0x0];if(!_0x1dfe61[_0x2aa4ca(0x209)]('/'))return'Endpoint\x20must\x20start\x20with\x20/:\x20'+_0x1dfe61;const _0x8ec23e=_0x16ace5['data'],_0x239bbe=_0x16ace5[_0x2aa4ca(0x20b)];if(_0x8ec23e&&_0x239bbe)return _0x2aa4ca(0x1f4);const _0x20c2a7=_0x16ace5[_0x2aa4ca(0x203)]||_0x2aa4ca(0x1f3),_0x549d44=[_0x2aa4ca(0x1f3),_0x2aa4ca(0x1e1),_0x2aa4ca(0x1de),_0x2aa4ca(0x1e5),_0x2aa4ca(0x215)];if(!_0x549d44[_0x2aa4ca(0x206)](_0x20c2a7['toUpperCase']()))return _0x2aa4ca(0x1ea)+_0x20c2a7+_0x2aa4ca(0x1e6)+_0x549d44['join'](',\x20');const _0x59626c=_0x16ace5[_0x2aa4ca(0x212)]||'td',_0x70d95=['td',_0x2aa4ca(0x21b),_0x2aa4ca(0x214),_0x2aa4ca(0x1ed),_0x2aa4ca(0x200),_0x2aa4ca(0x219)];if(!_0x70d95[_0x2aa4ca(0x206)](_0x59626c))return _0x2aa4ca(0x1e4)+_0x59626c+'.\x20Valid\x20types:\x20'+_0x70d95[_0x2aa4ca(0x218)](',\x20');return undefined;}async[a6_0xa5ef(0x21d)](_0x1da988){const _0x1816d7=a6_0xa5ef,{options:_0x235f11,args:_0x2fee56,tdx:_0x4e5350}=_0x1da988,_0x523fc7=_0x235f11,_0x5971a7=_0x2fee56[0x0],_0x58440c=(_0x523fc7['method']||_0x1816d7(0x1f3))['toUpperCase'](),_0x2076ed=_0x523fc7[_0x1816d7(0x213)],_0xd42790=_0x523fc7[_0x1816d7(0x20b)],_0x282699=_0x523fc7[_0x1816d7(0x1ee)],_0x50ea7a=_0x523fc7[_0x1816d7(0x212)]||'td';try{const _0x56e74d={};if(_0x282699){const _0x289aea=Array['isArray'](_0x282699)?_0x282699:[_0x282699];for(const _0x4a7cef of _0x289aea){const [_0x191c08,_0x31c3ce]=parseHeader(_0x4a7cef);_0x56e74d[_0x191c08]=_0x31c3ce;}}let _0xdca2e5;if(_0x2076ed)_0xdca2e5=_0x2076ed;else{if(_0xd42790)try{_0xdca2e5=RawAPI[_0x1816d7(0x1e7)](_0xd42790);}catch(_0x10d947){return console[_0x1816d7(0x1f9)](_0x1816d7(0x21c)+(_0x10d947 instanceof Error?_0x10d947[_0x1816d7(0x217)]:String(_0x10d947))),0x1;}}const _0x51e4c7={'method':_0x58440c,'apiType':_0x50ea7a,'includeHeaders':_0x235f11[_0x1816d7(0x220)]};_0xdca2e5&&(_0x51e4c7[_0x1816d7(0x1e8)]=_0xdca2e5);Object[_0x1816d7(0x1fe)](_0x56e74d)[_0x1816d7(0x1f1)]>0x0&&(_0x51e4c7['headers']=_0x56e74d);if(_0x235f11[_0x1816d7(0x220)]){const _0x5ef58c=resolveSite(_0x235f11[_0x1816d7(0x1f0)]),_0x153ca5=getEndpoint(_0x5ef58c,_0x50ea7a),_0x580106=''+_0x153ca5+_0x5971a7;console['error']('>\x20'+_0x58440c+'\x20'+_0x580106);const _0x48e5f3=getAuthHeaders(_0x5ef58c),_0xe11c68={..._0x48e5f3,..._0x56e74d};for(const [_0x5d9e37,_0x5d0679]of Object[_0x1816d7(0x1f7)](_0xe11c68)){!isSensitiveHeader(_0x5d9e37)&&console['error']('>\x20'+_0x5d9e37+':\x20'+_0x5d0679);}_0xdca2e5&&console[_0x1816d7(0x1f9)]('>'),console[_0x1816d7(0x1f9)]('');}const _0x9be13=await _0x4e5350['api'][_0x1816d7(0x1e3)](_0x5971a7,_0x51e4c7);if(_0x235f11[_0x1816d7(0x220)]&&_0x9be13['headers']){console[_0x1816d7(0x1f9)]('<\x20HTTP/1.1\x20'+_0x9be13[_0x1816d7(0x1df)]);for(const [_0x359eff,_0x24566b]of Object[_0x1816d7(0x1f7)](_0x9be13[_0x1816d7(0x211)])){!isSensitiveHeader(_0x359eff)&&console[_0x1816d7(0x1f9)]('<\x20'+_0x359eff+':\x20'+_0x24566b);}console['error']('');}const _0x37aa03=Boolean(_0x235f11['output']),_0x1a2699={'color':_0x235f11[_0x1816d7(0x20c)],'noColor':_0x235f11[_0x1816d7(0x21e)]||_0x37aa03&&!_0x235f11[_0x1816d7(0x20c)]},_0x2ab456=colorizeJSON(_0x9be13[_0x1816d7(0x213)],_0x1a2699);return _0x235f11['output']?(writeFileSync(_0x235f11['output'],_0x2ab456),console[_0x1816d7(0x1f9)](_0x1816d7(0x1ec)+_0x235f11['output'])):console['log'](_0x2ab456),0x0;}catch(_0x2d94a8){return _0x2d94a8 instanceof Error?(console[_0x1816d7(0x1f9)](_0x1816d7(0x21c)+_0x2d94a8[_0x1816d7(0x217)]),_0x235f11[_0x1816d7(0x220)]&&_0x2d94a8[_0x1816d7(0x20a)]&&console['error'](_0x1816d7(0x20f)+_0x2d94a8[_0x1816d7(0x20a)])):console['error'](_0x1816d7(0x21c)+String(_0x2d94a8)),0x1;}}}
1
+ function a6_0x11c0(_0x1d0c80,_0x555cb4){_0x1d0c80=_0x1d0c80-0x74;const _0x49e433=a6_0x49e4();let _0x11c0e6=_0x49e433[_0x1d0c80];return _0x11c0e6;}const a6_0x2d5e14=a6_0x11c0;(function(_0x3b222f,_0x4b2248){const _0x11aed0=a6_0x11c0,_0x4b5ecc=_0x3b222f();while(!![]){try{const _0x5d627b=-parseInt(_0x11aed0(0x76))/0x1+-parseInt(_0x11aed0(0xb0))/0x2*(parseInt(_0x11aed0(0x95))/0x3)+-parseInt(_0x11aed0(0x89))/0x4*(-parseInt(_0x11aed0(0xad))/0x5)+parseInt(_0x11aed0(0xa2))/0x6*(-parseInt(_0x11aed0(0x8d))/0x7)+-parseInt(_0x11aed0(0x90))/0x8+-parseInt(_0x11aed0(0x9d))/0x9*(parseInt(_0x11aed0(0xb2))/0xa)+parseInt(_0x11aed0(0x74))/0xb;if(_0x5d627b===_0x4b2248)break;else _0x4b5ecc['push'](_0x4b5ecc['shift']());}catch(_0x1f4a68){_0x4b5ecc['push'](_0x4b5ecc['shift']());}}}(a6_0x49e4,0x3b7c4));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';function a6_0x49e4(){const _0x3ec33b=['file','POST','llm-proxy','status','5uFwLdn','verbose','.\x20Valid\x20methods:\x20','50242ONvrQU','entries','30aEUcbv','length','header','api','trim','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','name','10399598pmHGgl','indexOf','43427kuBaPx','set-cookie','Results\x20saved\x20to\x20','.\x20Valid\x20types:\x20','description','method','validate','output','color','Invalid\x20HTTP\x20method:\x20','GET','Error:\x20','cookie','data','x-xsrf-token','DELETE','headers','<\x20HTTP/1.1\x20','stack','652436ReUfLY','readBodyFromFile','x-trino-user','toUpperCase','7RPKMSU','body','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','1577920qVlcbe','message','PATCH','request','execute','18TgwctH','has','trino','llm','workflow','keys','join','set-cookie2','1177551GTGsRV','site','error','startsWith','substring','485790bwDmnM','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','type','Invalid\x20API\x20type:\x20','PUT','authorization','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs'];a6_0x49e4=function(){return _0x3ec33b;};return a6_0x49e4();}import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a6_0x2d5e14(0xa7),'proxy-authorization',a6_0x2d5e14(0x82),a6_0x2d5e14(0x77),a6_0x2d5e14(0x9c),a6_0x2d5e14(0x84),'x-auth-token',a6_0x2d5e14(0x8b)]);function isSensitiveHeader(_0x351547){const _0xbffcef=a6_0x2d5e14;return SENSITIVE_HEADERS[_0xbffcef(0x96)](_0x351547['toLowerCase']());}function parseHeader(_0x2197c5){const _0xec4097=a6_0x2d5e14,_0x1dcfb8=_0x2197c5[_0xec4097(0x75)](':');if(_0x1dcfb8===-0x1)throw new Error('Invalid\x20header\x20format:\x20\x22'+_0x2197c5+'\x22.\x20'+'Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22');const _0x5c23e6=_0x2197c5[_0xec4097(0xa1)](0x0,_0x1dcfb8)[_0xec4097(0xb6)](),_0x29aedd=_0x2197c5['substring'](_0x1dcfb8+0x1)[_0xec4097(0xb6)]();if(!_0x5c23e6)throw new Error(_0xec4097(0x8f)+_0x2197c5+'\x22');return[_0x5c23e6,_0x29aedd];}export class ApiCommand extends BaseCommand{[a6_0x2d5e14(0xb8)]=a6_0x2d5e14(0xb5);[a6_0x2d5e14(0x7a)]=a6_0x2d5e14(0xa8);[a6_0x2d5e14(0x7c)](_0x275c12){const _0x5207ca=a6_0x2d5e14,{args:_0x4b9270,options:_0x14898b}=_0x275c12,_0x56bd26=_0x14898b;if(_0x4b9270[_0x5207ca(0xb3)]===0x0)return _0x5207ca(0xb7);const _0x4893a4=_0x4b9270[0x0];if(!_0x4893a4[_0x5207ca(0xa0)]('/'))return'Endpoint\x20must\x20start\x20with\x20/:\x20'+_0x4893a4;const _0xa36313=_0x56bd26[_0x5207ca(0x83)],_0x55b04a=_0x56bd26['file'];if(_0xa36313&&_0x55b04a)return _0x5207ca(0xa3);const _0x6f25e3=_0x56bd26[_0x5207ca(0x7b)]||_0x5207ca(0x80),_0x4e6777=[_0x5207ca(0x80),_0x5207ca(0xaa),_0x5207ca(0xa6),_0x5207ca(0x85),_0x5207ca(0x92)];if(!_0x4e6777['includes'](_0x6f25e3['toUpperCase']()))return _0x5207ca(0x7f)+_0x6f25e3+_0x5207ca(0xaf)+_0x4e6777[_0x5207ca(0x9b)](',\x20');const _0x4082ee=_0x56bd26[_0x5207ca(0xa4)]||'td',_0x21352e=['td','cdp',_0x5207ca(0x99),_0x5207ca(0x97),_0x5207ca(0x98),_0x5207ca(0xab)];if(!_0x21352e['includes'](_0x4082ee))return _0x5207ca(0xa5)+_0x4082ee+_0x5207ca(0x79)+_0x21352e[_0x5207ca(0x9b)](',\x20');return undefined;}async[a6_0x2d5e14(0x94)](_0x2898e6){const _0x1da160=a6_0x2d5e14,{options:_0x179161,args:_0x32f734,tdx:_0x38dfbd}=_0x2898e6,_0x55569b=_0x179161,_0x323e12=_0x32f734[0x0],_0x5cad45=(_0x55569b['method']||'GET')[_0x1da160(0x8c)](),_0x3352c2=_0x55569b[_0x1da160(0x83)],_0x2c7ac5=_0x55569b[_0x1da160(0xa9)],_0x44cbc3=_0x55569b[_0x1da160(0xb4)],_0x1d4e02=_0x55569b[_0x1da160(0xa4)]||'td';try{const _0x3fb7d9={};if(_0x44cbc3){const _0x216018=Array['isArray'](_0x44cbc3)?_0x44cbc3:[_0x44cbc3];for(const _0x3aa542 of _0x216018){const [_0x4a74cb,_0x1b3eb3]=parseHeader(_0x3aa542);_0x3fb7d9[_0x4a74cb]=_0x1b3eb3;}}let _0x17df9a;if(_0x3352c2)_0x17df9a=_0x3352c2;else{if(_0x2c7ac5)try{_0x17df9a=RawAPI[_0x1da160(0x8a)](_0x2c7ac5);}catch(_0x1c0fb8){return console[_0x1da160(0x9f)](_0x1da160(0x81)+(_0x1c0fb8 instanceof Error?_0x1c0fb8[_0x1da160(0x91)]:String(_0x1c0fb8))),0x1;}}const _0x5f097f={'method':_0x5cad45,'apiType':_0x1d4e02,'includeHeaders':_0x179161[_0x1da160(0xae)]};_0x17df9a&&(_0x5f097f[_0x1da160(0x8e)]=_0x17df9a);Object[_0x1da160(0x9a)](_0x3fb7d9)['length']>0x0&&(_0x5f097f['headers']=_0x3fb7d9);if(_0x179161[_0x1da160(0xae)]){const _0x187596=resolveSite(_0x179161[_0x1da160(0x9e)]),_0x4e12f2=getEndpoint(_0x187596,_0x1d4e02),_0x438777=''+_0x4e12f2+_0x323e12;console['error']('>\x20'+_0x5cad45+'\x20'+_0x438777);const _0x181d2c=getAuthHeaders(_0x187596),_0x53eb2b={..._0x181d2c,..._0x3fb7d9};for(const [_0x2633b2,_0x5adc1f]of Object['entries'](_0x53eb2b)){!isSensitiveHeader(_0x2633b2)&&console[_0x1da160(0x9f)]('>\x20'+_0x2633b2+':\x20'+_0x5adc1f);}_0x17df9a&&console[_0x1da160(0x9f)]('>'),console['error']('');}const _0x107b0b=await _0x38dfbd[_0x1da160(0xb5)][_0x1da160(0x93)](_0x323e12,_0x5f097f);if(_0x179161[_0x1da160(0xae)]&&_0x107b0b['headers']){console[_0x1da160(0x9f)](_0x1da160(0x87)+_0x107b0b[_0x1da160(0xac)]);for(const [_0x3c3e0d,_0x191f70]of Object[_0x1da160(0xb1)](_0x107b0b[_0x1da160(0x86)])){!isSensitiveHeader(_0x3c3e0d)&&console[_0x1da160(0x9f)]('<\x20'+_0x3c3e0d+':\x20'+_0x191f70);}console[_0x1da160(0x9f)]('');}const _0x5b13e0=Boolean(_0x179161[_0x1da160(0x7d)]),_0x40cd24={'color':_0x179161[_0x1da160(0x7e)],'noColor':_0x179161['noColor']||_0x5b13e0&&!_0x179161[_0x1da160(0x7e)]},_0x229b73=colorizeJSON(_0x107b0b['data'],_0x40cd24);return _0x179161['output']?(writeFileSync(_0x179161['output'],_0x229b73),console[_0x1da160(0x9f)](_0x1da160(0x78)+_0x179161[_0x1da160(0x7d)])):console['log'](_0x229b73),0x0;}catch(_0x269ad0){return _0x269ad0 instanceof Error?(console['error'](_0x1da160(0x81)+_0x269ad0['message']),_0x179161[_0x1da160(0xae)]&&_0x269ad0[_0x1da160(0x88)]&&console[_0x1da160(0x9f)]('\x0aStack\x20trace:\x0a'+_0x269ad0[_0x1da160(0x88)])):console['error']('Error:\x20'+String(_0x269ad0)),0x1;}}}
@@ -1 +1 @@
1
- const a7_0xd1af96=a7_0x5b2e;(function(_0x8a19e5,_0x1bfe1f){const _0x4dafd0=a7_0x5b2e,_0xf04aff=_0x8a19e5();while(!![]){try{const _0x385688=parseInt(_0x4dafd0(0x1e3))/0x1+parseInt(_0x4dafd0(0x1ee))/0x2+parseInt(_0x4dafd0(0x1e6))/0x3*(parseInt(_0x4dafd0(0x1dd))/0x4)+-parseInt(_0x4dafd0(0x1da))/0x5+-parseInt(_0x4dafd0(0x200))/0x6*(parseInt(_0x4dafd0(0x1db))/0x7)+parseInt(_0x4dafd0(0x202))/0x8+parseInt(_0x4dafd0(0x1eb))/0x9*(-parseInt(_0x4dafd0(0x1e8))/0xa);if(_0x385688===_0x1bfe1f)break;else _0xf04aff['push'](_0xf04aff['shift']());}catch(_0x548ba5){_0xf04aff['push'](_0xf04aff['shift']());}}}(a7_0x1241,0xe4f55));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens}from'../core/oauth-keychain.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';function a7_0x1241(){const _0x215d29=['2900875sPpDlG','217WlcIQn','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','4axpOZS','warn','trim','✓\x20Profile\x20\x27','method','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','85985yTfBsY','auth','No\x20credential\x20found','592485jHACxu','description','362130avwEmz','Read\x20credential\x20from\x20','Validating\x20API\x20key...','405eHVGHu','N/A','Remove\x20API\x20key\x20from\x20system\x20keychain','2491864ckFMHO','/app/mp/ak','jobs','last_name','\x20\x20tdx','yellow','Enter\x20your\x20TD\x20API\x20key:','ERROR','password','tdx:\x20auth\x20clear','Name:\x20','error','\x20--profile\x20','Read\x20credential\x20from\x20keychain','site','message','Setup\x20cancelled','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','15546wPBrCB','bold','13587856mkJoNo','\x20removed\x20from\x20keychain','log','profile','red','No\x20credentials\x20found\x20in\x20keychain','join','green','User:\x20','\x20(site:\x20','API\x20key\x20cannot\x20be\x20empty','Credential\x20type:\x20OAuth','\x20and\x20','status','\x27\x20registered','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','filter','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','✗\x20Validation\x20failed:\x20','logLevel','\x20(profile:\x20','tdx:\x20auth\x20setup','System\x20keychain\x20is\x20not\x20available','Setting\x20up\x20authentication\x20for\x20site:\x20','create','first_name','execute','You\x20can\x20find\x20your\x20API\x20key\x20at:','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','✓\x20Authentication\x20successful\x0a','getUserInfo','select','API\x20key','oauth','all','\x0aSetup\x20cancelled','auth:setup','apiKey','Choose\x20authentication\x20method:','OAuth\x20tokens'];a7_0x1241=function(){return _0x215d29;};return a7_0x1241();}import{deleteOAuthTokens}from'../core/oauth-keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';function a7_0x5b2e(_0x2bdfcc,_0x2f04e8){_0x2bdfcc=_0x2bdfcc-0x1bb;const _0x1241ca=a7_0x1241();let _0x5b2e30=_0x1241ca[_0x2bdfcc];return _0x5b2e30;}import{isOAuthSupported}from'../core/oauth.js';import{runOAuthLoginFlow}from'./auth-login-command.js';import{promptSiteSelection}from'../core/constants.js';import a7_0x502421 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_0x5bcbdc from'chalk';export class AuthSetupCommand extends BaseCommand{['name']=a7_0xd1af96(0x1d6);[a7_0xd1af96(0x1e7)]='Setup\x20API\x20key\x20authentication\x20interactively';async[a7_0xd1af96(0x1cc)](_0x168c37){const _0xd7ee5=a7_0xd1af96,{options:_0x1d56b7}=_0x168c37,_0xe06745=_0x1d56b7['profile'];console[_0xd7ee5(0x204)](a7_0x5bcbdc[_0xd7ee5(0x201)](_0xd7ee5(0x1c7)));const _0x396c1f=_0x1d56b7[_0xd7ee5(0x1fc)]||'us01',_0x127a6b=await promptSiteSelection(_0x396c1f,_0xe06745,_0xd7ee5(0x1fe));if(!_0x127a6b)return 0x1;const _0x255dc8=resolveSite(_0x127a6b);if(isOAuthSupported(_0x255dc8)){const _0x31f913=await a7_0x502421({'type':_0xd7ee5(0x1d1),'name':_0xd7ee5(0x1e1),'message':_0xd7ee5(0x1d8),'choices':[{'title':'OAuth\x20(browser\x20login)','value':_0xd7ee5(0x1d3)},{'title':'API\x20Key','value':'apikey'}]});if(!_0x31f913['method'])return console[_0xd7ee5(0x204)](_0xd7ee5(0x1d5)),0x1;if(_0x31f913[_0xd7ee5(0x1e1)]===_0xd7ee5(0x1d3))return await runOAuthLoginFlow(_0x255dc8,_0xe06745,_0x1d56b7[_0xd7ee5(0x1c5)]??LogLevel['ERROR']),0x0;}console[_0xd7ee5(0x204)](_0xd7ee5(0x1c9)+_0x255dc8),console[_0xd7ee5(0x204)](_0xd7ee5(0x1cd)),console['log']('\x20\x20'+getConsoleUrl(_0x255dc8,_0xd7ee5(0x1ef)));const _0x5b7af7=await a7_0x502421({'type':_0xd7ee5(0x1f6),'name':'apiKey','message':_0xd7ee5(0x1f4),'validate':_0x4e2eb7=>{const _0x1aa5dd=_0xd7ee5;if(!_0x4e2eb7||!_0x4e2eb7[_0x1aa5dd(0x1df)]())return _0x1aa5dd(0x1bc);return!![];}});if(!_0x5b7af7[_0xd7ee5(0x1d7)])return console['log'](_0xd7ee5(0x1d5)),0x1;const _0x4d0a2f=_0x5b7af7[_0xd7ee5(0x1d7)];console[_0xd7ee5(0x204)](_0xd7ee5(0x1ea));try{const _0xdc262f=TDX[_0xd7ee5(0x1ca)]({'site':_0x255dc8,'apiKey':_0x4d0a2f['trim'](),'logLevel':_0x1d56b7[_0xd7ee5(0x1c5)]??LogLevel[_0xd7ee5(0x1f5)]}),_0x52da7a=await _0xdc262f['jobs']['getUserInfo']();console['log'](_0xd7ee5(0x1c3)+_0x52da7a['email']+')');const _0x4bd28d=await isKeychainAvailable();_0x4bd28d?(await saveAPIKeyAsync(_0x4d0a2f[_0xd7ee5(0x1df)](),_0x255dc8,_0xe06745),console[_0xd7ee5(0x204)](_0xd7ee5(0x1ce)+(_0xe06745?_0xd7ee5(0x1c6)+_0xe06745+')':''))):(console[_0xd7ee5(0x1de)](a7_0x5bcbdc['yellow']('⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.')),console[_0xd7ee5(0x1de)](a7_0x5bcbdc[_0xd7ee5(0x1f3)](_0xd7ee5(0x1dc))));if(_0xe06745){const _0x50476e={'site':_0x255dc8};saveProfileToUserConfig(_0xe06745,_0x50476e),console['log'](_0xd7ee5(0x1e0)+_0xe06745+_0xd7ee5(0x1c0));}else saveDefaultSiteToUserConfig(_0x255dc8),console[_0xd7ee5(0x204)]('✓\x20Default\x20site\x20set\x20to\x20'+_0x255dc8);const _0x2f18b2=_0xe06745?_0xd7ee5(0x1fa)+_0xe06745:'';return console['log'](),console['log'](_0xd7ee5(0x1e2)),console[_0xd7ee5(0x204)](_0xd7ee5(0x1f2)+_0x2f18b2+_0xd7ee5(0x1c1)),console[_0xd7ee5(0x204)](_0xd7ee5(0x1f2)+_0x2f18b2+_0xd7ee5(0x1ff)),0x0;}catch(_0x14585d){if(_0x14585d instanceof HTTPClientError&&_0x14585d[_0xd7ee5(0x1bf)]===0x191)return printAuthError(_0x14585d),0x1;return console['error'](a7_0x5bcbdc[_0xd7ee5(0x206)]('✗\x20Validation\x20failed:\x20'+(_0x14585d instanceof Error?_0x14585d[_0xd7ee5(0x1fd)]:String(_0x14585d)))),console[_0xd7ee5(0x1f9)]('API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.'),0x1;}}}export class AuthStatusCommand extends BaseCommand{['name']=a7_0xd1af96(0x1e4);[a7_0xd1af96(0x1e7)]='Show\x20authentication\x20status\x20and\x20validate\x20API\x20key';async[a7_0xd1af96(0x1cc)](_0x1c17f7){const _0x28e4eb=a7_0xd1af96,{options:_0x35ff4e,tdx:_0x5b5004}=_0x1c17f7,_0x2d98ec=_0x35ff4e['site'],_0x502adb=_0x35ff4e[_0x28e4eb(0x205)],_0xb5acb8=_0x502adb?_0x502adb:_0x28e4eb(0x1ec);console[_0x28e4eb(0x204)]('tdx\x20profile:\x20'+_0xb5acb8+_0x28e4eb(0x1bb)+_0x2d98ec+')');const _0x144d1e=await getOAuthTokens(_0x502adb);if(_0x144d1e)console['log'](_0x28e4eb(0x1bd)),console['log'](_0x28e4eb(0x1fb)+(_0x502adb?'\x20(profile:\x20'+_0x502adb+')':''));else{const _0x1497bf=await resolveAPIKeyAsync(_0x2d98ec,_0x502adb);if(_0x1497bf){const {source:_0x45d29b,isDeprecated:_0x1bbc72}=_0x1497bf,_0x3beace=_0x28e4eb(0x1e9)+_0x45d29b;console[_0x28e4eb(0x204)](_0x1bbc72?a7_0x5bcbdc[_0x28e4eb(0x1f3)](_0x3beace):_0x3beace);}else console[_0x28e4eb(0x204)](a7_0x5bcbdc[_0x28e4eb(0x1f3)](_0x28e4eb(0x1e5)));}try{const _0x4142f4=await _0x5b5004[_0x28e4eb(0x1f0)][_0x28e4eb(0x1d0)]();return console[_0x28e4eb(0x204)](a7_0x5bcbdc[_0x28e4eb(0x209)](_0x28e4eb(0x1cf))),console[_0x28e4eb(0x204)](_0x28e4eb(0x20a)+_0x4142f4['email']),(_0x4142f4[_0x28e4eb(0x1cb)]||_0x4142f4[_0x28e4eb(0x1f1)])&&console['log'](_0x28e4eb(0x1f8)+[_0x4142f4[_0x28e4eb(0x1cb)],_0x4142f4[_0x28e4eb(0x1f1)]]['filter'](Boolean)[_0x28e4eb(0x208)]('\x20')),0x0;}catch(_0x5cf59d){return _0x5cf59d instanceof HTTPClientError&&_0x5cf59d[_0x28e4eb(0x1bf)]===0x191?printAuthError(_0x5cf59d,!![],_0x502adb):console['error'](a7_0x5bcbdc[_0x28e4eb(0x206)](_0x28e4eb(0x1c4)+(_0x5cf59d instanceof Error?_0x5cf59d['message']:String(_0x5cf59d)))),0x1;}}}export class AuthClearCommand extends BaseCommand{['name']='auth:clear';[a7_0xd1af96(0x1e7)]=a7_0xd1af96(0x1ed);async[a7_0xd1af96(0x1cc)](_0x365a7c){const _0x1d2db1=a7_0xd1af96,{options:_0x2963bf}=_0x365a7c,_0x32e865=_0x2963bf[_0x1d2db1(0x205)];console[_0x1d2db1(0x204)](a7_0x5bcbdc[_0x1d2db1(0x201)](_0x1d2db1(0x1f7)));const _0x17e30f=await isKeychainAvailable();if(!_0x17e30f)return console[_0x1d2db1(0x1f9)](a7_0x5bcbdc[_0x1d2db1(0x206)](_0x1d2db1(0x1c8))),0x1;const [_0x334a27,_0x4b376b]=await Promise[_0x1d2db1(0x1d4)]([deleteKeychainAPIKey(_0x32e865),deleteOAuthTokens(_0x32e865)]);if(_0x334a27||_0x4b376b){clearCredentialCache();const _0x3c6661=[_0x334a27&&_0x1d2db1(0x1d2),_0x4b376b&&_0x1d2db1(0x1d9)][_0x1d2db1(0x1c2)](Boolean)[_0x1d2db1(0x208)](_0x1d2db1(0x1be));return console[_0x1d2db1(0x204)]('✓\x20'+_0x3c6661+_0x1d2db1(0x203)+(_0x32e865?_0x1d2db1(0x1c6)+_0x32e865+')':'')),0x0;}else return console[_0x1d2db1(0x204)](_0x1d2db1(0x207)+(_0x32e865?'\x20for\x20profile:\x20'+_0x32e865:'')),0x1;}}
1
+ const a7_0x21c6e0=a7_0x3924;(function(_0x2df169,_0x68a614){const _0x2a93ee=a7_0x3924,_0x3285dd=_0x2df169();while(!![]){try{const _0x29be6c=parseInt(_0x2a93ee(0x18d))/0x1+-parseInt(_0x2a93ee(0x190))/0x2+-parseInt(_0x2a93ee(0x165))/0x3+-parseInt(_0x2a93ee(0x177))/0x4+-parseInt(_0x2a93ee(0x179))/0x5*(parseInt(_0x2a93ee(0x16e))/0x6)+parseInt(_0x2a93ee(0x16d))/0x7*(parseInt(_0x2a93ee(0x195))/0x8)+parseInt(_0x2a93ee(0x16a))/0x9;if(_0x29be6c===_0x68a614)break;else _0x3285dd['push'](_0x3285dd['shift']());}catch(_0x13f5fa){_0x3285dd['push'](_0x3285dd['shift']());}}}(a7_0xd962,0xddce5));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens}from'../core/oauth-keychain.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{deleteOAuthTokens}from'../core/oauth-keychain.js';function a7_0x3924(_0x1f3bb1,_0x2b7d45){_0x1f3bb1=_0x1f3bb1-0x153;const _0xd962b6=a7_0xd962();let _0x39243f=_0xd962b6[_0x1f3bb1];return _0x39243f;}import{clearCredentialCache}from'../core/credential-cache.js';import{isOAuthSupported}from'../core/oauth.js';import{runOAuthLoginFlow}from'./auth-login-command.js';import{promptSiteSelection}from'../core/constants.js';import a7_0x22d575 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_0x599653 from'chalk';function a7_0xd962(){const _0x4ae17a=['4284816XBvRqd','oauth','getUserInfo','✗\x20Validation\x20failed:\x20','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','15979617wOXnmk','Remove\x20API\x20key\x20from\x20system\x20keychain','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','84gnhOSZ','462RMrYlL','last_name','OAuth\x20(browser\x20login)','\x20removed\x20from\x20keychain','name','email','✓\x20Default\x20site\x20set\x20to\x20','auth:clear','all','1226648hpWTqi','ERROR','92860WUNMCc','red','\x0aSetup\x20cancelled','User:\x20','execute','status','Credential\x20type:\x20OAuth','Read\x20credential\x20from\x20','trim','/app/mp/ak','Setup\x20cancelled','join','bold','tdx:\x20auth\x20setup','Setup\x20API\x20key\x20authentication\x20interactively','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','log','System\x20keychain\x20is\x20not\x20available','us01','auth:setup','870232MNetED','method','yellow','566060iOVWCe','\x27\x20registered','Enter\x20your\x20TD\x20API\x20key:','Name:\x20','logLevel','1140520vvJeya','first_name','OAuth\x20tokens','Setting\x20up\x20authentication\x20for\x20site:\x20','No\x20credentials\x20found\x20in\x20keychain','No\x20credential\x20found','select','filter','apikey','apiKey','warn','Read\x20credential\x20from\x20keychain','jobs','auth','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','error','You\x20can\x20find\x20your\x20API\x20key\x20at:','\x20\x20tdx','description','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','green','N/A','\x20(profile:\x20','\x20and\x20','tdx:\x20auth\x20clear','profile','API\x20key','site'];a7_0xd962=function(){return _0x4ae17a;};return a7_0xd962();}export class AuthSetupCommand extends BaseCommand{[a7_0x21c6e0(0x172)]=a7_0x21c6e0(0x18c);[a7_0x21c6e0(0x15b)]=a7_0x21c6e0(0x187);async[a7_0x21c6e0(0x17d)](_0x4558c9){const _0x1b6ca2=a7_0x21c6e0,{options:_0x2087aa}=_0x4558c9,_0x2f53f4=_0x2087aa[_0x1b6ca2(0x162)];console[_0x1b6ca2(0x189)](a7_0x599653[_0x1b6ca2(0x185)](_0x1b6ca2(0x186)));const _0x2aa870=_0x2087aa[_0x1b6ca2(0x164)]||_0x1b6ca2(0x18b),_0x59f006=await promptSiteSelection(_0x2aa870,_0x2f53f4,_0x1b6ca2(0x183));if(!_0x59f006)return 0x1;const _0x34decb=resolveSite(_0x59f006);if(isOAuthSupported(_0x34decb)){const _0x2559c7=await a7_0x22d575({'type':_0x1b6ca2(0x19b),'name':_0x1b6ca2(0x18e),'message':'Choose\x20authentication\x20method:','choices':[{'title':_0x1b6ca2(0x170),'value':'oauth'},{'title':'API\x20Key','value':_0x1b6ca2(0x19d)}]});if(!_0x2559c7[_0x1b6ca2(0x18e)])return console[_0x1b6ca2(0x189)]('\x0aSetup\x20cancelled'),0x1;if(_0x2559c7[_0x1b6ca2(0x18e)]===_0x1b6ca2(0x166))return await runOAuthLoginFlow(_0x34decb,_0x2f53f4,_0x2087aa[_0x1b6ca2(0x194)]??LogLevel[_0x1b6ca2(0x178)]),0x0;}console['log'](_0x1b6ca2(0x198)+_0x34decb),console[_0x1b6ca2(0x189)](_0x1b6ca2(0x159)),console['log']('\x20\x20'+getConsoleUrl(_0x34decb,_0x1b6ca2(0x182)));const _0x3cd6a6=await a7_0x22d575({'type':'password','name':_0x1b6ca2(0x19e),'message':_0x1b6ca2(0x192),'validate':_0x3574dd=>{const _0x537453=_0x1b6ca2;if(!_0x3574dd||!_0x3574dd[_0x537453(0x181)]())return'API\x20key\x20cannot\x20be\x20empty';return!![];}});if(!_0x3cd6a6[_0x1b6ca2(0x19e)])return console[_0x1b6ca2(0x189)](_0x1b6ca2(0x17b)),0x1;const _0x4ecfb1=_0x3cd6a6[_0x1b6ca2(0x19e)];console[_0x1b6ca2(0x189)]('Validating\x20API\x20key...');try{const _0x365e60=TDX['create']({'site':_0x34decb,'apiKey':_0x4ecfb1[_0x1b6ca2(0x181)](),'logLevel':_0x2087aa[_0x1b6ca2(0x194)]??LogLevel[_0x1b6ca2(0x178)]}),_0x2229e8=await _0x365e60[_0x1b6ca2(0x155)][_0x1b6ca2(0x167)]();console[_0x1b6ca2(0x189)]('✓\x20API\x20key\x20is\x20valid\x20(User:\x20'+_0x2229e8[_0x1b6ca2(0x173)]+')');const _0x52ca84=await isKeychainAvailable();_0x52ca84?(await saveAPIKeyAsync(_0x4ecfb1[_0x1b6ca2(0x181)](),_0x34decb,_0x2f53f4),console[_0x1b6ca2(0x189)]('✓\x20API\x20key\x20saved\x20to\x20system\x20keychain'+(_0x2f53f4?_0x1b6ca2(0x15f)+_0x2f53f4+')':''))):(console[_0x1b6ca2(0x153)](a7_0x599653['yellow'](_0x1b6ca2(0x169))),console[_0x1b6ca2(0x153)](a7_0x599653['yellow']('\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.')));if(_0x2f53f4){const _0x183079={'site':_0x34decb};saveProfileToUserConfig(_0x2f53f4,_0x183079),console[_0x1b6ca2(0x189)]('✓\x20Profile\x20\x27'+_0x2f53f4+_0x1b6ca2(0x191));}else saveDefaultSiteToUserConfig(_0x34decb),console[_0x1b6ca2(0x189)](_0x1b6ca2(0x174)+_0x34decb);const _0x2a97ae=_0x2f53f4?'\x20--profile\x20'+_0x2f53f4:'';return console['log'](),console[_0x1b6ca2(0x189)]('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console[_0x1b6ca2(0x189)](_0x1b6ca2(0x15a)+_0x2a97ae+_0x1b6ca2(0x16c)),console['log'](_0x1b6ca2(0x15a)+_0x2a97ae+_0x1b6ca2(0x157)),0x0;}catch(_0x1a0d19){if(_0x1a0d19 instanceof HTTPClientError&&_0x1a0d19[_0x1b6ca2(0x17e)]===0x191)return printAuthError(_0x1a0d19),0x1;return console[_0x1b6ca2(0x158)](a7_0x599653[_0x1b6ca2(0x17a)](_0x1b6ca2(0x168)+(_0x1a0d19 instanceof Error?_0x1a0d19['message']:String(_0x1a0d19)))),console['error'](_0x1b6ca2(0x188)),0x1;}}}export class AuthStatusCommand extends BaseCommand{['name']=a7_0x21c6e0(0x156);[a7_0x21c6e0(0x15b)]=a7_0x21c6e0(0x15c);async['execute'](_0x4d3085){const _0x2c69c0=a7_0x21c6e0,{options:_0x415fbc,tdx:_0x3cc5b4}=_0x4d3085,_0xaa0f99=_0x415fbc[_0x2c69c0(0x164)],_0x308f1c=_0x415fbc['profile'],_0x5f41c7=_0x308f1c?_0x308f1c:_0x2c69c0(0x15e);console[_0x2c69c0(0x189)]('tdx\x20profile:\x20'+_0x5f41c7+'\x20(site:\x20'+_0xaa0f99+')');const _0x47775d=await getOAuthTokens(_0x308f1c);if(_0x47775d)console[_0x2c69c0(0x189)](_0x2c69c0(0x17f)),console[_0x2c69c0(0x189)](_0x2c69c0(0x154)+(_0x308f1c?_0x2c69c0(0x15f)+_0x308f1c+')':''));else{const _0x2db2c9=await resolveAPIKeyAsync(_0xaa0f99,_0x308f1c);if(_0x2db2c9){const {source:_0xf0919a,isDeprecated:_0x3647bb}=_0x2db2c9,_0x4f66f4=_0x2c69c0(0x180)+_0xf0919a;console[_0x2c69c0(0x189)](_0x3647bb?a7_0x599653[_0x2c69c0(0x18f)](_0x4f66f4):_0x4f66f4);}else console['log'](a7_0x599653[_0x2c69c0(0x18f)](_0x2c69c0(0x19a)));}try{const _0x18292d=await _0x3cc5b4[_0x2c69c0(0x155)]['getUserInfo']();return console[_0x2c69c0(0x189)](a7_0x599653[_0x2c69c0(0x15d)]('✓\x20Authentication\x20successful\x0a')),console[_0x2c69c0(0x189)](_0x2c69c0(0x17c)+_0x18292d[_0x2c69c0(0x173)]),(_0x18292d[_0x2c69c0(0x196)]||_0x18292d[_0x2c69c0(0x16f)])&&console[_0x2c69c0(0x189)](_0x2c69c0(0x193)+[_0x18292d[_0x2c69c0(0x196)],_0x18292d['last_name']][_0x2c69c0(0x19c)](Boolean)[_0x2c69c0(0x184)]('\x20')),0x0;}catch(_0x1924b0){return _0x1924b0 instanceof HTTPClientError&&_0x1924b0[_0x2c69c0(0x17e)]===0x191?printAuthError(_0x1924b0,!![],_0x308f1c):console[_0x2c69c0(0x158)](a7_0x599653[_0x2c69c0(0x17a)](_0x2c69c0(0x168)+(_0x1924b0 instanceof Error?_0x1924b0['message']:String(_0x1924b0)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x21c6e0(0x172)]=a7_0x21c6e0(0x175);[a7_0x21c6e0(0x15b)]=a7_0x21c6e0(0x16b);async[a7_0x21c6e0(0x17d)](_0x58ee09){const _0x13267a=a7_0x21c6e0,{options:_0x209d18}=_0x58ee09,_0x575e7f=_0x209d18[_0x13267a(0x162)];console[_0x13267a(0x189)](a7_0x599653[_0x13267a(0x185)](_0x13267a(0x161)));const _0x573533=await isKeychainAvailable();if(!_0x573533)return console[_0x13267a(0x158)](a7_0x599653[_0x13267a(0x17a)](_0x13267a(0x18a))),0x1;const [_0x308c89,_0x11865b]=await Promise[_0x13267a(0x176)]([deleteKeychainAPIKey(_0x575e7f),deleteOAuthTokens(_0x575e7f)]);if(_0x308c89||_0x11865b){clearCredentialCache();const _0x569e49=[_0x308c89&&_0x13267a(0x163),_0x11865b&&_0x13267a(0x197)][_0x13267a(0x19c)](Boolean)['join'](_0x13267a(0x160));return console['log']('✓\x20'+_0x569e49+_0x13267a(0x171)+(_0x575e7f?'\x20(profile:\x20'+_0x575e7f+')':'')),0x0;}else return console[_0x13267a(0x189)](_0x13267a(0x199)+(_0x575e7f?'\x20for\x20profile:\x20'+_0x575e7f:'')),0x1;}}
@@ -1 +1 @@
1
- const a8_0x52fee1=a8_0x3d67;(function(_0x5162bb,_0x52d294){const _0x2264c5=a8_0x3d67,_0x115a78=_0x5162bb();while(!![]){try{const _0x65b731=-parseInt(_0x2264c5(0x19d))/0x1*(-parseInt(_0x2264c5(0x192))/0x2)+parseInt(_0x2264c5(0x183))/0x3+-parseInt(_0x2264c5(0x18f))/0x4+-parseInt(_0x2264c5(0x17e))/0x5*(-parseInt(_0x2264c5(0x1a6))/0x6)+-parseInt(_0x2264c5(0x19b))/0x7*(-parseInt(_0x2264c5(0x190))/0x8)+-parseInt(_0x2264c5(0x18b))/0x9+-parseInt(_0x2264c5(0x18d))/0xa;if(_0x65b731===_0x52d294)break;else _0x115a78['push'](_0x115a78['shift']());}catch(_0x42762e){_0x115a78['push'](_0x115a78['shift']());}}}(a8_0x3966,0x4de30));import{BaseCommand}from'./command.js';import{resolveSite}from'../core/config.js';import{saveProfileToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{isKeychainAvailable}from'../core/keychain.js';import{saveOAuthTokens}from'../core/oauth-keychain.js';import{startOAuthFlow,isOAuthSupported}from'../core/oauth.js';import{promptSiteSelection}from'../core/constants.js';function a8_0x3d67(_0x26d360,_0x4e9455){_0x26d360=_0x26d360-0x17e;const _0x396688=a8_0x3966();let _0x3d67fc=_0x396688[_0x26d360];return _0x3d67fc;}import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a8_0x3f5a49 from'chalk';export async function runOAuthLoginFlow(_0x3065bd,_0x3f6311,_0x1654e9){const _0x720784=a8_0x3d67;if(!isOAuthSupported(_0x3065bd))throw new Error(_0x720784(0x19e)+_0x3065bd+'.\x20'+_0x720784(0x1a5)+_0x720784(0x18e));const _0xbb4f30=await isKeychainAvailable();if(!_0xbb4f30)throw new Error(_0x720784(0x1a1)+_0x720784(0x18e));const _0x638384=getConsoleUrl(_0x3065bd);console['log'](_0x720784(0x19f)),console[_0x720784(0x182)]('\x20\x20'+_0x638384+_0x720784(0x194)),console[_0x720784(0x182)]('Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...');const _0x2fc6cb=await startOAuthFlow(_0x3065bd);console['log'](_0x720784(0x184));const _0x42ede1=TDX[_0x720784(0x193)]({'site':_0x3065bd,'accessToken':_0x2fc6cb[_0x720784(0x19c)],'logLevel':_0x1654e9??LogLevel[_0x720784(0x196)]}),_0x5b52d4=await _0x42ede1[_0x720784(0x181)][_0x720784(0x1a8)]();console[_0x720784(0x182)](a8_0x3f5a49[_0x720784(0x198)]('✓\x20Authentication\x20successful\x20(User:\x20'+_0x5b52d4[_0x720784(0x17f)]+')')),await saveOAuthTokens(_0x2fc6cb,_0x3f6311),console[_0x720784(0x182)](_0x720784(0x19a)+(_0x3f6311?_0x720784(0x180)+_0x3f6311+')':''));if(_0x3f6311){const _0x5523eb={'site':_0x3065bd};saveProfileToUserConfig(_0x3f6311,_0x5523eb),console['log'](_0x720784(0x187)+_0x3f6311+_0x720784(0x1a0));}const _0x20f23b=_0x3f6311?_0x720784(0x188)+_0x3f6311:'';console[_0x720784(0x182)](),console[_0x720784(0x182)](_0x720784(0x197)),console['log']('\x20\x20tdx'+_0x20f23b+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console[_0x720784(0x182)](_0x720784(0x191)+_0x20f23b+_0x720784(0x18a));}function a8_0x3966(){const _0xdabc96=['site','tdx:\x20auth\x20login','✓\x20Profile\x20\x27','\x20--profile\x20','Authenticating\x20via\x20OAuth\x20for\x20site:\x20','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','205920KRhbgd','Login\x20cancelled','2610540wPeDCw','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','2095952wamsdN','938200VZjXFN','\x20\x20tdx','98aDABkg','create','/oauth/authorize','bold','ERROR','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','green','auth:login','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain','21hvbJOt','access_token','711AybToU','OAuth\x20login\x20is\x20not\x20yet\x20available\x20for\x20site:\x20','Opening\x20browser\x20for\x20authentication...','\x27\x20registered','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','us01','profile','description','OAuth\x20is\x20currently\x20supported\x20on\x20dev-us01\x20and\x20dev-eu01\x20only.\x20','46716sYjGCK','logLevel','getUserInfo','190xdLPsG','email','\x20(profile:\x20','jobs','log','1333242uGJFXU','Validating\x20OAuth\x20tokens...'];a8_0x3966=function(){return _0xdabc96;};return a8_0x3966();}export class AuthLoginCommand extends BaseCommand{['name']=a8_0x52fee1(0x199);[a8_0x52fee1(0x1a4)]='Login\x20via\x20OAuth\x20(opens\x20browser)';async['execute'](_0x2fd0cf){const _0x449d1d=a8_0x52fee1,{options:_0x3521a9}=_0x2fd0cf,_0x563a4f=_0x3521a9[_0x449d1d(0x1a3)];console[_0x449d1d(0x182)](a8_0x3f5a49[_0x449d1d(0x195)](_0x449d1d(0x186)));const _0xabd9a5=_0x3521a9[_0x449d1d(0x185)]||_0x449d1d(0x1a2),_0x9f52e7=await promptSiteSelection(_0xabd9a5,_0x563a4f,_0x449d1d(0x18c));if(!_0x9f52e7)return 0x1;const _0x24babf=resolveSite(_0x9f52e7);return console[_0x449d1d(0x182)](_0x449d1d(0x189)+_0x24babf),await runOAuthLoginFlow(_0x24babf,_0x563a4f,_0x3521a9[_0x449d1d(0x1a7)]??LogLevel['ERROR']),0x0;}}
1
+ const a8_0x14586c=a8_0x301b;(function(_0x251c13,_0x1599b7){const _0x517a67=a8_0x301b,_0x522cbc=_0x251c13();while(!![]){try{const _0x162535=-parseInt(_0x517a67(0x86))/0x1*(parseInt(_0x517a67(0x84))/0x2)+-parseInt(_0x517a67(0x83))/0x3+-parseInt(_0x517a67(0x77))/0x4+parseInt(_0x517a67(0x7e))/0x5*(-parseInt(_0x517a67(0x87))/0x6)+-parseInt(_0x517a67(0x68))/0x7+-parseInt(_0x517a67(0x90))/0x8*(-parseInt(_0x517a67(0x88))/0x9)+parseInt(_0x517a67(0x71))/0xa;if(_0x162535===_0x1599b7)break;else _0x522cbc['push'](_0x522cbc['shift']());}catch(_0x531afc){_0x522cbc['push'](_0x522cbc['shift']());}}}(a8_0x2c8c,0x82b4d));import{BaseCommand}from'./command.js';import{resolveSite}from'../core/config.js';import{saveProfileToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{isKeychainAvailable}from'../core/keychain.js';import{saveOAuthTokens}from'../core/oauth-keychain.js';import{startOAuthFlow,isOAuthSupported}from'../core/oauth.js';function a8_0x2c8c(){const _0x45b560=['email','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','Login\x20cancelled','logLevel','profile','name','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','description','23121040xmUcYd','\x20(profile:\x20','execute','jobs','✓\x20Authentication\x20successful\x20(User:\x20','auth:login','3166744YAojRz','tdx:\x20auth\x20login','log','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','site','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain','green','387935ZhkbhM','Login\x20via\x20OAuth\x20(opens\x20browser)','Opening\x20browser\x20for\x20authentication...','OAuth\x20is\x20currently\x20supported\x20on\x20dev-us01\x20and\x20dev-eu01\x20only.\x20','\x20\x20tdx','792384tvGDyV','493258ENWVVO','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','2vGxNAP','78sBzboH','1752507qDQgVM','bold','us01','ERROR','/oauth/authorize','\x27\x20registered','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','Validating\x20OAuth\x20tokens...','40fKpjmt','create','Authenticating\x20via\x20OAuth\x20for\x20site:\x20','\x20--profile\x20','1348501QCgOqF'];a8_0x2c8c=function(){return _0x45b560;};return a8_0x2c8c();}import{promptSiteSelection}from'../core/constants.js';import{TDX}from'../sdk/index.js';function a8_0x301b(_0x205410,_0x50e165){_0x205410=_0x205410-0x65;const _0x2c8c9a=a8_0x2c8c();let _0x301b64=_0x2c8c9a[_0x205410];return _0x301b64;}import{LogLevel}from'../utils/tdx-logger.js';import a8_0x56ec7e from'chalk';export async function runOAuthLoginFlow(_0x2c17f0,_0x2787bc,_0x413426){const _0xb34f11=a8_0x301b;if(!isOAuthSupported(_0x2c17f0))throw new Error('OAuth\x20login\x20is\x20not\x20yet\x20available\x20for\x20site:\x20'+_0x2c17f0+'.\x20'+_0xb34f11(0x81)+_0xb34f11(0x6a));const _0x5052a7=await isKeychainAvailable();if(!_0x5052a7)throw new Error(_0xb34f11(0x85)+_0xb34f11(0x6a));const _0x24b690=getConsoleUrl(_0x2c17f0);console[_0xb34f11(0x79)](_0xb34f11(0x80)),console[_0xb34f11(0x79)]('\x20\x20'+_0x24b690+_0xb34f11(0x8c)),console['log']('Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...');const _0x11692d=await startOAuthFlow(_0x2c17f0);console['log'](_0xb34f11(0x8f));const _0x145d28=TDX[_0xb34f11(0x65)]({'site':_0x2c17f0,'accessToken':_0x11692d['access_token'],'logLevel':_0x413426??LogLevel[_0xb34f11(0x8b)]}),_0x534dbc=await _0x145d28[_0xb34f11(0x74)]['getUserInfo']();console[_0xb34f11(0x79)](a8_0x56ec7e[_0xb34f11(0x7d)](_0xb34f11(0x75)+_0x534dbc[_0xb34f11(0x69)]+')')),await saveOAuthTokens(_0x11692d,_0x2787bc),console['log'](_0xb34f11(0x7c)+(_0x2787bc?_0xb34f11(0x72)+_0x2787bc+')':''));if(_0x2787bc){const _0x1113e9={'site':_0x2c17f0};saveProfileToUserConfig(_0x2787bc,_0x1113e9),console[_0xb34f11(0x79)]('✓\x20Profile\x20\x27'+_0x2787bc+_0xb34f11(0x8d));}const _0x50d0ac=_0x2787bc?_0xb34f11(0x67)+_0x2787bc:'';console[_0xb34f11(0x79)](),console[_0xb34f11(0x79)](_0xb34f11(0x8e)),console[_0xb34f11(0x79)](_0xb34f11(0x82)+_0x50d0ac+_0xb34f11(0x6f)),console['log'](_0xb34f11(0x82)+_0x50d0ac+_0xb34f11(0x7a));}export class AuthLoginCommand extends BaseCommand{[a8_0x14586c(0x6e)]=a8_0x14586c(0x76);[a8_0x14586c(0x70)]=a8_0x14586c(0x7f);async[a8_0x14586c(0x73)](_0x21aa4c){const _0x379d18=a8_0x14586c,{options:_0x29f131}=_0x21aa4c,_0x133074=_0x29f131[_0x379d18(0x6d)];console[_0x379d18(0x79)](a8_0x56ec7e[_0x379d18(0x89)](_0x379d18(0x78)));const _0x178bb1=_0x29f131[_0x379d18(0x7b)]||_0x379d18(0x8a),_0x2aba6d=await promptSiteSelection(_0x178bb1,_0x133074,_0x379d18(0x6b));if(!_0x2aba6d)return 0x1;const _0x1d9f60=resolveSite(_0x2aba6d);return console[_0x379d18(0x79)](_0x379d18(0x66)+_0x1d9f60),await runOAuthLoginFlow(_0x1d9f60,_0x133074,_0x29f131[_0x379d18(0x6c)]??LogLevel[_0x379d18(0x8b)]),0x0;}}
@@ -1 +1 @@
1
- const a9_0x523ca8=a9_0x47d9;(function(_0x217793,_0x1ff6c4){const _0x4bd69c=a9_0x47d9,_0x68bcca=_0x217793();while(!![]){try{const _0x443cd5=-parseInt(_0x4bd69c(0x1b3))/0x1*(-parseInt(_0x4bd69c(0x1ab))/0x2)+parseInt(_0x4bd69c(0x1ef))/0x3*(-parseInt(_0x4bd69c(0x1cd))/0x4)+-parseInt(_0x4bd69c(0x1a5))/0x5+-parseInt(_0x4bd69c(0x1ca))/0x6+parseInt(_0x4bd69c(0x1a6))/0x7+-parseInt(_0x4bd69c(0x1e9))/0x8*(parseInt(_0x4bd69c(0x1cb))/0x9)+parseInt(_0x4bd69c(0x1e5))/0xa*(parseInt(_0x4bd69c(0x1a4))/0xb);if(_0x443cd5===_0x1ff6c4)break;else _0x68bcca['push'](_0x68bcca['shift']());}catch(_0x342122){_0x68bcca['push'](_0x68bcca['shift']());}}}(a9_0x2458,0xc3c7d));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(_0x5291cc,_0x1025b4){const _0x305925=a9_0x47d9;if(_0x5291cc instanceof SDKError)console['error'](_0x305925(0x1e4)+_0x5291cc['message']),_0x1025b4[_0x305925(0x1b1)]&&(_0x5291cc['cause']&&console[_0x305925(0x1c5)](_0x305925(0x1dc)+_0x5291cc['cause']),_0x5291cc[_0x305925(0x1ce)]&&(console[_0x305925(0x1c5)](_0x305925(0x1a3)),console[_0x305925(0x1c5)](_0x5291cc[_0x305925(0x1ce)])));else throw _0x5291cc;}function a9_0x2458(){const _0x37b9c3=['new','llm','join','agent','type','\x27...','log','\x27\x20not\x20found','Using\x20agent\x20from\x20','Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together','functionName','stream','Resolving\x20project\x20\x27','\x20\x20Cause:\x20','CHAT_NOT_FOUND','tool_result','site','--agent\x20flag','Error:\x20Chat\x20session\x20\x27','claude-4.5-haiku','Create\x20a\x20new\x20chat\x20session','Error:\x20','10qdXUEQ','getOrCreateDefaultAgent','name','done','3464YLyDFO','agentId','targetKnowledgeBase','description','event','write','108EgQyFr','Using\x20cached\x20default\x20agent:\x20','context','\x0aStack\x20trace:','29159482NLibFT','2045695LMogIO','3348317cXfMSl','metadata','targetFunction','includes','stringify','6PMtaMs','message','Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','404','validate','verbose','streamChat','284833DCeYPh','code','string','projectId','content','execute','llmProject','slice','resolveAgentId','Getting\x20default\x20agent...','tool_call','resolveProjectId','chat','chatId','startChat','Chat\x20session:\x20','llmAgent','streamChatJsonl','error','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','data','handleChatEvent','session\x20context','7506330SvCDBm','1017xDjjjI','tool','163628EdsUYx','stack'];a9_0x2458=function(){return _0x37b9c3;};return a9_0x2458();}function a9_0x47d9(_0x3c33e3,_0x1ad98f){_0x3c33e3=_0x3c33e3-0x1a1;const _0x2458c0=a9_0x2458();let _0x47d939=_0x2458c0[_0x3c33e3];return _0x47d939;}async function resolveAgentId(_0x26cfa2,_0x162a0b,_0x4a4b0b,_0x455cd6,_0x570658){const _0x44d185=a9_0x47d9,_0x534574=_0x162a0b||_0x4a4b0b;if(_0x534574){const {projectName:_0xf33e12,agentName:_0x2503af}=parseAgentRef(_0x534574),_0x3d9cd4=_0x2503af||_0x534574,_0x5047e9=_0x2503af?_0xf33e12:_0x455cd6;if(!_0x5047e9)throw new Error('No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22');if(_0x570658){const _0x12455b=_0x162a0b?_0x44d185(0x1e0):_0x44d185(0x1c9);console[_0x44d185(0x1c5)](_0x44d185(0x1d7)+_0x12455b+':\x20'+_0x5047e9+'/'+_0x3d9cd4);}const _0x39e00c=await withSpinner(_0x44d185(0x1db)+_0x5047e9+_0x44d185(0x1d4),()=>_0x26cfa2['llm'][_0x44d185(0x1be)](_0x5047e9),{'verbose':_0x570658}),_0x5e8e1f=await withSpinner('Resolving\x20agent\x20\x27'+_0x3d9cd4+'\x27...',()=>_0x26cfa2['llm'][_0x44d185(0x1bb)](_0x3d9cd4,_0x39e00c[_0x44d185(0x1c7)]),{'verbose':_0x570658});return _0x5e8e1f[_0x44d185(0x1c7)];}else{const _0x46971b=_0x26cfa2[_0x44d185(0x1d0)]['getDefaultAgent']();if(_0x46971b)return _0x570658&&console['error'](_0x44d185(0x1a1)+_0x46971b[_0x44d185(0x1e7)]),_0x46971b['id'];const _0x2a6c2a=await withSpinner(_0x44d185(0x1bc),()=>_0x26cfa2[_0x44d185(0x1d0)][_0x44d185(0x1e6)](_0x44d185(0x1e2),0x0),{'verbose':_0x570658});return _0x2a6c2a['data']['id'];}}export class ChatCommand extends BaseCommand{[a9_0x523ca8(0x1e7)]=a9_0x523ca8(0x1bf);['description']='Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)';['validate'](_0x1b8490){const _0x1c6078=a9_0x523ca8,_0x4e2348=_0x1b8490['args'][_0x1c6078(0x1d1)]('\x20');if(!_0x4e2348)return _0x1c6078(0x1ae);return undefined;}async[a9_0x523ca8(0x1b2)](_0x2cd12c,_0x4dfa7f,_0x3191e2,_0x199cfa,_0xc52e5e){const _0x57090a=a9_0x523ca8;for await(const _0x8917f8 of _0x2cd12c[_0x57090a(0x1d0)][_0x57090a(0x1bf)](_0x4dfa7f,{'agentId':_0x3191e2,'chatId':_0x199cfa})){if(_0x8917f8[_0x57090a(0x1d3)]==='metadata'){const _0x46ef50=_0x8917f8[_0x57090a(0x1c7)][_0x57090a(0x1c0)];saveLastChatId(_0x46ef50),_0xc52e5e&&console[_0x57090a(0x1c5)](_0x57090a(0x1c2)+_0x46ef50);}else _0x8917f8[_0x57090a(0x1d3)]==='event'&&this[_0x57090a(0x1c8)](_0x8917f8[_0x57090a(0x1c7)]);}}async[a9_0x523ca8(0x1c4)](_0x3cbe76,_0x159180,_0x588beb,_0x1e03c3){const _0x4b0c40=a9_0x523ca8,_0x1ab39d=_0x3cbe76[_0x4b0c40(0x1a2)][_0x4b0c40(0x1df)];let _0x1b4afb=![];for await(const _0x6f7d61 of _0x3cbe76[_0x4b0c40(0x1d0)][_0x4b0c40(0x1bf)](_0x159180,{'agentId':_0x588beb,'chatId':_0x1e03c3})){if(_0x6f7d61['type']===_0x4b0c40(0x1a7)){const _0x1e0473=_0x6f7d61[_0x4b0c40(0x1c7)];saveLastChatId(_0x1e0473['chatId']);const _0x2723c6=_0x1e0473[_0x4b0c40(0x1b6)]&&_0x1e0473[_0x4b0c40(0x1ea)]?getLLMConversationUrl(_0x1ab39d,_0x1e0473[_0x4b0c40(0x1b6)],_0x1e0473[_0x4b0c40(0x1ea)],_0x1e0473[_0x4b0c40(0x1c0)]):undefined;console[_0x4b0c40(0x1d5)](JSON[_0x4b0c40(0x1aa)]({'type':_0x4b0c40(0x1a7),'data':{'chatId':_0x1e0473[_0x4b0c40(0x1c0)],'agentId':_0x1e0473[_0x4b0c40(0x1ea)],'consoleUrl':_0x2723c6}})),_0x1b4afb=!![];}else{if(_0x6f7d61[_0x4b0c40(0x1d3)]===_0x4b0c40(0x1ed)){!_0x1b4afb&&_0x1e03c3&&(console[_0x4b0c40(0x1d5)](JSON[_0x4b0c40(0x1aa)]({'type':_0x4b0c40(0x1a7),'data':{'chatId':_0x1e03c3}})),_0x1b4afb=!![]);const _0x28ed68=_0x6f7d61['data'];if(_0x4b0c40(0x1b7)in _0x28ed68)console[_0x4b0c40(0x1d5)](JSON['stringify']({'type':_0x4b0c40(0x1b7),'data':{'content':_0x28ed68[_0x4b0c40(0x1b7)]}}));else{if(_0x4b0c40(0x1bd)in _0x28ed68){const _0x4aa0b4=_0x28ed68[_0x4b0c40(0x1bd)];console[_0x4b0c40(0x1d5)](JSON[_0x4b0c40(0x1aa)]({'type':_0x4b0c40(0x1bd),'data':{'id':_0x4aa0b4['id'],'name':_0x4aa0b4[_0x4b0c40(0x1d9)],'target':_0x4aa0b4[_0x4b0c40(0x1eb)]?.['name']||_0x4aa0b4['targetAgent']?.['name']||_0x4aa0b4['targetWebSearchTool']?.[_0x4b0c40(0x1e7)]||_0x4aa0b4[_0x4b0c40(0x1a8)]}}));}else{if('tool'in _0x28ed68)console[_0x4b0c40(0x1d5)](JSON[_0x4b0c40(0x1aa)]({'type':_0x4b0c40(0x1de),'data':{'id':_0x28ed68[_0x4b0c40(0x1cc)]['id'],'name':_0x28ed68['tool'][_0x4b0c40(0x1d9)],'result':typeof _0x28ed68[_0x4b0c40(0x1cc)][_0x4b0c40(0x1b7)]===_0x4b0c40(0x1b5)?_0x28ed68[_0x4b0c40(0x1cc)][_0x4b0c40(0x1b7)][_0x4b0c40(0x1ba)](0x0,0x1f4):''}}));else _0x4b0c40(0x1c5)in _0x28ed68&&console[_0x4b0c40(0x1d5)](JSON[_0x4b0c40(0x1aa)]({'type':'error','data':{'error':_0x28ed68[_0x4b0c40(0x1c5)]}}));}}}}}console[_0x4b0c40(0x1d5)](JSON[_0x4b0c40(0x1aa)]({'type':_0x4b0c40(0x1e8)}));}async[a9_0x523ca8(0x1b8)](_0x1ea9c8){const _0x3396bd=a9_0x523ca8,{options:_0x591bba,args:_0x5e9dbd,tdx:_0x6d6927}=_0x1ea9c8,_0x51f871=_0x5e9dbd[_0x3396bd(0x1d1)]('\x20'),_0x4049b5=_0x591bba,_0x10435a=_0x4049b5['agent'],_0x439585=_0x4049b5[_0x3396bd(0x1c3)],_0x1b56d3=_0x4049b5[_0x3396bd(0x1b9)],_0x370a67=_0x4049b5[_0x3396bd(0x1cf)],_0x5d3dbb=_0x4049b5[_0x3396bd(0x1c0)],_0x1ce486=_0x4049b5[_0x3396bd(0x1da)];if(_0x370a67&&_0x5d3dbb)return console[_0x3396bd(0x1c5)](_0x3396bd(0x1d8)),0x1;try{let _0x23c052,_0x58cf84;if(_0x5d3dbb)_0x58cf84=_0x5d3dbb;else!_0x370a67&&(_0x58cf84=loadLastChatId(),_0x58cf84&&_0x591bba[_0x3396bd(0x1b1)]&&console[_0x3396bd(0x1c5)]('Continuing\x20chat:\x20'+_0x58cf84));!_0x5d3dbb&&(_0x370a67||!_0x58cf84)&&(_0x23c052=await resolveAgentId(_0x6d6927,_0x10435a,_0x439585,_0x1b56d3,_0x591bba[_0x3396bd(0x1b1)]));const _0x1889f1=_0x1ce486?(_0x2cb386,_0x258551,_0x2302b7)=>this['streamChatJsonl'](_0x6d6927,_0x2cb386,_0x258551,_0x2302b7):(_0x28b5e8,_0x2d76c3,_0x5c456a)=>this[_0x3396bd(0x1b2)](_0x6d6927,_0x28b5e8,_0x2d76c3,_0x5c456a,_0x591bba[_0x3396bd(0x1b1)]);try{await _0x1889f1(_0x51f871,_0x23c052,_0x58cf84);}catch(_0x1a5e40){const _0x5018e2=_0x1a5e40 instanceof SDKError&&_0x1a5e40[_0x3396bd(0x1b4)]===ErrorCode[_0x3396bd(0x1dd)]||_0x1a5e40 instanceof Error&&_0x1a5e40[_0x3396bd(0x1ac)][_0x3396bd(0x1a9)](_0x3396bd(0x1af));if(_0x5018e2&&_0x5d3dbb)return console['error'](_0x3396bd(0x1e1)+_0x5d3dbb+_0x3396bd(0x1d6)),0x1;if(_0x5018e2)_0x591bba[_0x3396bd(0x1b1)]&&console['error'](_0x3396bd(0x1c6)),!_0x23c052&&(_0x23c052=await resolveAgentId(_0x6d6927,_0x10435a,_0x439585,_0x1b56d3,_0x591bba[_0x3396bd(0x1b1)])),await _0x1889f1(_0x51f871,_0x23c052,undefined);else throw _0x1a5e40;}return!_0x1ce486&&console['log'](),0x0;}catch(_0x19c6f5){return console['error'](),handleSDKError(_0x19c6f5,_0x591bba),0x1;}}[a9_0x523ca8(0x1c8)](_0x5164f0){const _0x2e5c18=a9_0x523ca8;if(_0x2e5c18(0x1b7)in _0x5164f0)process['stdout'][_0x2e5c18(0x1ee)](_0x5164f0['content']);else _0x2e5c18(0x1c5)in _0x5164f0&&console[_0x2e5c18(0x1c5)]('\x0aError:\x20'+_0x5164f0[_0x2e5c18(0x1c5)]);}}export class ChatCreateCommand extends BaseCommand{[a9_0x523ca8(0x1e7)]='chat-create';[a9_0x523ca8(0x1ec)]=a9_0x523ca8(0x1e3);[a9_0x523ca8(0x1b0)](_0x47b777){const _0x4b8fd8=a9_0x523ca8,_0x353c4a=_0x47b777['options'],_0x2a2f7c=_0x353c4a[_0x4b8fd8(0x1d2)],_0x460681=_0x353c4a[_0x4b8fd8(0x1c3)];if(!_0x2a2f7c&&!_0x460681)return _0x4b8fd8(0x1ad);return undefined;}async[a9_0x523ca8(0x1b8)](_0x314eff){const _0x128028=a9_0x523ca8,{options:_0x479b54,tdx:_0xe39472}=_0x314eff,_0x14e8d4=_0x479b54,_0x1a9baf=_0x14e8d4['agent'],_0x1a2b97=_0x14e8d4[_0x128028(0x1c3)],_0x1a8aab=_0x14e8d4['llmProject'];try{const _0xaeb29d=await resolveAgentId(_0xe39472,_0x1a9baf,_0x1a2b97,_0x1a8aab,_0x479b54['verbose']),_0x1e7fdd=await _0xe39472[_0x128028(0x1d0)][_0x128028(0x1c1)](_0xaeb29d);return saveLastChatId(_0x1e7fdd['id']),console[_0x128028(0x1d5)](JSON['stringify']({'chatId':_0x1e7fdd['id'],'agentId':_0xaeb29d})),0x0;}catch(_0x45a3c1){return handleSDKError(_0x45a3c1,_0x479b54),0x1;}}}
1
+ const a9_0x1c9abe=a9_0x5cd6;(function(_0x25b99b,_0x530172){const _0x4a03d0=a9_0x5cd6,_0x20fa35=_0x25b99b();while(!![]){try{const _0x122b9b=-parseInt(_0x4a03d0(0x16b))/0x1+parseInt(_0x4a03d0(0x165))/0x2+-parseInt(_0x4a03d0(0x186))/0x3*(-parseInt(_0x4a03d0(0x15c))/0x4)+parseInt(_0x4a03d0(0x194))/0x5+-parseInt(_0x4a03d0(0x161))/0x6*(-parseInt(_0x4a03d0(0x187))/0x7)+-parseInt(_0x4a03d0(0x19b))/0x8*(-parseInt(_0x4a03d0(0x17c))/0x9)+-parseInt(_0x4a03d0(0x166))/0xa*(parseInt(_0x4a03d0(0x198))/0xb);if(_0x122b9b===_0x530172)break;else _0x20fa35['push'](_0x20fa35['shift']());}catch(_0xc358a4){_0x20fa35['push'](_0x20fa35['shift']());}}}(a9_0x3a58,0x25e03));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 a9_0x5cd6(_0x5c09da,_0xf7dcd6){_0x5c09da=_0x5c09da-0x158;const _0x3a583d=a9_0x3a58();let _0x5cd67f=_0x3a583d[_0x5c09da];return _0x5cd67f;}function handleSDKError(_0x59ecf4,_0x3c1699){const _0x20e0d4=a9_0x5cd6;if(_0x59ecf4 instanceof SDKError)console[_0x20e0d4(0x159)](_0x20e0d4(0x18c)+_0x59ecf4[_0x20e0d4(0x19d)]),_0x3c1699[_0x20e0d4(0x167)]&&(_0x59ecf4[_0x20e0d4(0x188)]&&console[_0x20e0d4(0x159)](_0x20e0d4(0x17a)+_0x59ecf4[_0x20e0d4(0x188)]),_0x59ecf4['stack']&&(console['error'](_0x20e0d4(0x19a)),console['error'](_0x59ecf4[_0x20e0d4(0x182)])));else throw _0x59ecf4;}async function resolveAgentId(_0x2369fe,_0x2733df,_0x24dfcb,_0x13f639,_0x3f92b9){const _0x4b20cb=a9_0x5cd6,_0x5912ad=_0x2733df||_0x24dfcb;if(_0x5912ad){const {projectName:_0x53fe18,agentName:_0x48d829}=parseAgentRef(_0x5912ad),_0x3a3d7f=_0x48d829||_0x5912ad,_0x17f8e9=_0x48d829?_0x53fe18:_0x13f639;if(!_0x17f8e9)throw new Error('No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22');if(_0x3f92b9){const _0x41043e=_0x2733df?_0x4b20cb(0x178):_0x4b20cb(0x180);console[_0x4b20cb(0x159)](_0x4b20cb(0x19f)+_0x41043e+':\x20'+_0x17f8e9+'/'+_0x3a3d7f);}const _0x1f3d28=await withSpinner(_0x4b20cb(0x173)+_0x17f8e9+_0x4b20cb(0x163),()=>_0x2369fe[_0x4b20cb(0x15b)]['resolveProjectId'](_0x17f8e9),{'verbose':_0x3f92b9}),_0x2074f1=await withSpinner(_0x4b20cb(0x15a)+_0x3a3d7f+_0x4b20cb(0x163),()=>_0x2369fe[_0x4b20cb(0x15b)]['resolveAgentId'](_0x3a3d7f,_0x1f3d28['data']),{'verbose':_0x3f92b9});return _0x2074f1[_0x4b20cb(0x16c)];}else{const _0x5ea3e5=_0x2369fe[_0x4b20cb(0x15b)][_0x4b20cb(0x16a)]();if(_0x5ea3e5)return _0x3f92b9&&console['error']('Using\x20cached\x20default\x20agent:\x20'+_0x5ea3e5['name']),_0x5ea3e5['id'];const _0x75e9d6=await withSpinner(_0x4b20cb(0x171),()=>_0x2369fe[_0x4b20cb(0x15b)]['getOrCreateDefaultAgent'](_0x4b20cb(0x177),0x0),{'verbose':_0x3f92b9});return _0x75e9d6[_0x4b20cb(0x16c)]['id'];}}function a9_0x3a58(){const _0x53cad9=['222CNDamu','llmAgent','\x27...','log','50374bRBnJE','30wwAuIL','verbose','targetFunction','options','getDefaultAgent','131573mvdbll','data','404','type','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','tool','Getting\x20default\x20agent...','Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22','Resolving\x20project\x20\x27','Error:\x20Chat\x20session\x20\x27','streamChatJsonl','name','claude-4.5-haiku','--agent\x20flag','includes','\x20\x20Cause:\x20','string','279AqLNDr','llmProject','functionName','targetWebSearchTool','session\x20context','slice','stack','agent','args','startChat','3jRFfKI','25221KztknR','cause','handleChatEvent','stdout','description','Error:\x20','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','tool_result','\x27\x20not\x20found','Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together','projectId','execute','validate','13895NsCBth','streamChat','write','agentId','600435zhVDbc','Chat\x20session:\x20','\x0aStack\x20trace:','33688IYRZza','metadata','message','stringify','Using\x20agent\x20from\x20','done','chatId','chat','Continuing\x20chat:\x20','content','new','code','error','Resolving\x20agent\x20\x27','llm','634596fDfNlh','CHAT_NOT_FOUND','stream','join','tool_call'];a9_0x3a58=function(){return _0x53cad9;};return a9_0x3a58();}export class ChatCommand extends BaseCommand{[a9_0x1c9abe(0x176)]=a9_0x1c9abe(0x1a2);[a9_0x1c9abe(0x18b)]='Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)';[a9_0x1c9abe(0x193)](_0x2f01a6){const _0x6c0e77=a9_0x1c9abe,_0x2dcd83=_0x2f01a6[_0x6c0e77(0x184)][_0x6c0e77(0x15f)]('\x20');if(!_0x2dcd83)return _0x6c0e77(0x16f);return undefined;}async[a9_0x1c9abe(0x195)](_0x20fb54,_0x120815,_0x175a50,_0x1b1681,_0x5ca737){const _0x3caaf2=a9_0x1c9abe;for await(const _0x2b84df of _0x20fb54[_0x3caaf2(0x15b)][_0x3caaf2(0x1a2)](_0x120815,{'agentId':_0x175a50,'chatId':_0x1b1681})){if(_0x2b84df[_0x3caaf2(0x16e)]==='metadata'){const _0x40b996=_0x2b84df['data'][_0x3caaf2(0x1a1)];saveLastChatId(_0x40b996),_0x5ca737&&console['error'](_0x3caaf2(0x199)+_0x40b996);}else _0x2b84df['type']==='event'&&this[_0x3caaf2(0x189)](_0x2b84df[_0x3caaf2(0x16c)]);}}async[a9_0x1c9abe(0x175)](_0x1fbd3c,_0xa6ed71,_0x33137c,_0x5188ca){const _0x525b3d=a9_0x1c9abe,_0x28f39f=_0x1fbd3c['context']['site'];let _0x53b8c1=![];for await(const _0x4aa7fa of _0x1fbd3c['llm'][_0x525b3d(0x1a2)](_0xa6ed71,{'agentId':_0x33137c,'chatId':_0x5188ca})){if(_0x4aa7fa[_0x525b3d(0x16e)]===_0x525b3d(0x19c)){const _0xf52f2b=_0x4aa7fa['data'];saveLastChatId(_0xf52f2b[_0x525b3d(0x1a1)]);const _0x1b8f53=_0xf52f2b[_0x525b3d(0x191)]&&_0xf52f2b[_0x525b3d(0x197)]?getLLMConversationUrl(_0x28f39f,_0xf52f2b[_0x525b3d(0x191)],_0xf52f2b['agentId'],_0xf52f2b['chatId']):undefined;console[_0x525b3d(0x164)](JSON[_0x525b3d(0x19e)]({'type':_0x525b3d(0x19c),'data':{'chatId':_0xf52f2b['chatId'],'agentId':_0xf52f2b[_0x525b3d(0x197)],'consoleUrl':_0x1b8f53}})),_0x53b8c1=!![];}else{if(_0x4aa7fa[_0x525b3d(0x16e)]==='event'){!_0x53b8c1&&_0x5188ca&&(console[_0x525b3d(0x164)](JSON[_0x525b3d(0x19e)]({'type':_0x525b3d(0x19c),'data':{'chatId':_0x5188ca}})),_0x53b8c1=!![]);const _0x349984=_0x4aa7fa[_0x525b3d(0x16c)];if(_0x525b3d(0x1a4)in _0x349984)console['log'](JSON['stringify']({'type':_0x525b3d(0x1a4),'data':{'content':_0x349984['content']}}));else{if(_0x525b3d(0x160)in _0x349984){const _0x353e95=_0x349984[_0x525b3d(0x160)];console[_0x525b3d(0x164)](JSON[_0x525b3d(0x19e)]({'type':'tool_call','data':{'id':_0x353e95['id'],'name':_0x353e95[_0x525b3d(0x17e)],'target':_0x353e95['targetKnowledgeBase']?.['name']||_0x353e95['targetAgent']?.[_0x525b3d(0x176)]||_0x353e95[_0x525b3d(0x17f)]?.[_0x525b3d(0x176)]||_0x353e95[_0x525b3d(0x168)]}}));}else{if(_0x525b3d(0x170)in _0x349984)console[_0x525b3d(0x164)](JSON['stringify']({'type':_0x525b3d(0x18e),'data':{'id':_0x349984[_0x525b3d(0x170)]['id'],'name':_0x349984['tool'][_0x525b3d(0x17e)],'result':typeof _0x349984[_0x525b3d(0x170)][_0x525b3d(0x1a4)]===_0x525b3d(0x17b)?_0x349984['tool'][_0x525b3d(0x1a4)][_0x525b3d(0x181)](0x0,0x1f4):''}}));else _0x525b3d(0x159)in _0x349984&&console[_0x525b3d(0x164)](JSON[_0x525b3d(0x19e)]({'type':_0x525b3d(0x159),'data':{'error':_0x349984[_0x525b3d(0x159)]}}));}}}}}console[_0x525b3d(0x164)](JSON['stringify']({'type':_0x525b3d(0x1a0)}));}async[a9_0x1c9abe(0x192)](_0x33aeab){const _0x42c62d=a9_0x1c9abe,{options:_0x1defd8,args:_0x2fb78b,tdx:_0x1c3ba9}=_0x33aeab,_0x20efad=_0x2fb78b[_0x42c62d(0x15f)]('\x20'),_0x3b1445=_0x1defd8,_0x3b0709=_0x3b1445[_0x42c62d(0x183)],_0x6fee51=_0x3b1445[_0x42c62d(0x162)],_0x5cd706=_0x3b1445[_0x42c62d(0x17d)],_0x4c3294=_0x3b1445[_0x42c62d(0x1a5)],_0x2cc7d9=_0x3b1445[_0x42c62d(0x1a1)],_0x2c35c2=_0x3b1445[_0x42c62d(0x15e)];if(_0x4c3294&&_0x2cc7d9)return console[_0x42c62d(0x159)](_0x42c62d(0x190)),0x1;try{let _0x1956ce,_0x34ccfe;if(_0x2cc7d9)_0x34ccfe=_0x2cc7d9;else!_0x4c3294&&(_0x34ccfe=loadLastChatId(),_0x34ccfe&&_0x1defd8[_0x42c62d(0x167)]&&console['error'](_0x42c62d(0x1a3)+_0x34ccfe));!_0x2cc7d9&&(_0x4c3294||!_0x34ccfe)&&(_0x1956ce=await resolveAgentId(_0x1c3ba9,_0x3b0709,_0x6fee51,_0x5cd706,_0x1defd8['verbose']));const _0x435230=_0x2c35c2?(_0x46667b,_0x17434d,_0x3f9334)=>this[_0x42c62d(0x175)](_0x1c3ba9,_0x46667b,_0x17434d,_0x3f9334):(_0x303a15,_0x4e07c7,_0x48af56)=>this['streamChat'](_0x1c3ba9,_0x303a15,_0x4e07c7,_0x48af56,_0x1defd8['verbose']);try{await _0x435230(_0x20efad,_0x1956ce,_0x34ccfe);}catch(_0xd0fb02){const _0x4f1279=_0xd0fb02 instanceof SDKError&&_0xd0fb02[_0x42c62d(0x158)]===ErrorCode[_0x42c62d(0x15d)]||_0xd0fb02 instanceof Error&&_0xd0fb02['message'][_0x42c62d(0x179)](_0x42c62d(0x16d));if(_0x4f1279&&_0x2cc7d9)return console[_0x42c62d(0x159)](_0x42c62d(0x174)+_0x2cc7d9+_0x42c62d(0x18f)),0x1;if(_0x4f1279)_0x1defd8[_0x42c62d(0x167)]&&console['error'](_0x42c62d(0x18d)),!_0x1956ce&&(_0x1956ce=await resolveAgentId(_0x1c3ba9,_0x3b0709,_0x6fee51,_0x5cd706,_0x1defd8[_0x42c62d(0x167)])),await _0x435230(_0x20efad,_0x1956ce,undefined);else throw _0xd0fb02;}return!_0x2c35c2&&console[_0x42c62d(0x164)](),0x0;}catch(_0x51f97f){return console[_0x42c62d(0x159)](),handleSDKError(_0x51f97f,_0x1defd8),0x1;}}[a9_0x1c9abe(0x189)](_0x39e6ee){const _0x2a1a46=a9_0x1c9abe;if(_0x2a1a46(0x1a4)in _0x39e6ee)process[_0x2a1a46(0x18a)][_0x2a1a46(0x196)](_0x39e6ee[_0x2a1a46(0x1a4)]);else _0x2a1a46(0x159)in _0x39e6ee&&console['error']('\x0aError:\x20'+_0x39e6ee[_0x2a1a46(0x159)]);}}export class ChatCreateCommand extends BaseCommand{[a9_0x1c9abe(0x176)]='chat-create';[a9_0x1c9abe(0x18b)]='Create\x20a\x20new\x20chat\x20session';[a9_0x1c9abe(0x193)](_0x1091f6){const _0x58dafe=a9_0x1c9abe,_0x3c1afa=_0x1091f6[_0x58dafe(0x169)],_0x2688fa=_0x3c1afa[_0x58dafe(0x183)],_0x419595=_0x3c1afa[_0x58dafe(0x162)];if(!_0x2688fa&&!_0x419595)return _0x58dafe(0x172);return undefined;}async[a9_0x1c9abe(0x192)](_0x481069){const _0x4229d4=a9_0x1c9abe,{options:_0x3d7e0c,tdx:_0x365bad}=_0x481069,_0x40ba24=_0x3d7e0c,_0xaa2e0b=_0x40ba24['agent'],_0x4955eb=_0x40ba24[_0x4229d4(0x162)],_0x36ca1c=_0x40ba24[_0x4229d4(0x17d)];try{const _0x49cdd2=await resolveAgentId(_0x365bad,_0xaa2e0b,_0x4955eb,_0x36ca1c,_0x3d7e0c['verbose']),_0x129a22=await _0x365bad['llm'][_0x4229d4(0x185)](_0x49cdd2);return saveLastChatId(_0x129a22['id']),console[_0x4229d4(0x164)](JSON[_0x4229d4(0x19e)]({'chatId':_0x129a22['id'],'agentId':_0x49cdd2})),0x0;}catch(_0x1b7cf7){return handleSDKError(_0x1b7cf7,_0x3d7e0c),0x1;}}}