@treasuredata/tdx 2026.3.9 → 2026.3.10

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 (210) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/cli.js.map +1 -1
  6. package/dist/commands/activations.js +1 -1
  7. package/dist/commands/agent-command.js +1 -1
  8. package/dist/commands/agent-test-command.js +1 -1
  9. package/dist/commands/api-command.js +1 -1
  10. package/dist/commands/auth-command.js +1 -1
  11. package/dist/commands/auth-login-command.js +1 -1
  12. package/dist/commands/chat-command.js +1 -1
  13. package/dist/commands/claude-command.js +1 -1
  14. package/dist/commands/claude-statusline-command.js +1 -1
  15. package/dist/commands/claude-usage-command.js +1 -1
  16. package/dist/commands/command.js +1 -1
  17. package/dist/commands/connection-command.js +1 -1
  18. package/dist/commands/databases.js +1 -1
  19. package/dist/commands/delivery-command.js +1 -1
  20. package/dist/commands/describe.js +1 -1
  21. package/dist/commands/engage-campaign-pull-command.js +1 -1
  22. package/dist/commands/engage-campaign-push-command.js +1 -1
  23. package/dist/commands/engage-campaign-validate-command.js +1 -1
  24. package/dist/commands/engage-command.js +1 -1
  25. package/dist/commands/engage-template-pull-command.js +1 -1
  26. package/dist/commands/engage-template-push-command.js +1 -1
  27. package/dist/commands/engage-template-validate-command.js +1 -1
  28. package/dist/commands/job-command.js +1 -1
  29. package/dist/commands/journey-command.js +1 -1
  30. package/dist/commands/journey-validate-command.js +1 -1
  31. package/dist/commands/llm-command.js +1 -1
  32. package/dist/commands/mcp-command.js +1 -1
  33. package/dist/commands/parent-segment-command.js +1 -1
  34. package/dist/commands/profile-command.js +1 -1
  35. package/dist/commands/profiles-command.js +1 -1
  36. package/dist/commands/query-command.js +1 -1
  37. package/dist/commands/schedule-command.js +1 -1
  38. package/dist/commands/segment-command.js +1 -1
  39. package/dist/commands/segment-create-command.js +1 -1
  40. package/dist/commands/segment-fields-command.js +1 -1
  41. package/dist/commands/segment-pull-command.js +1 -1
  42. package/dist/commands/segment-push-command.js +1 -1
  43. package/dist/commands/segment-update-command.js +1 -1
  44. package/dist/commands/segment-use-command.js +1 -1
  45. package/dist/commands/segment-validate-command.js +1 -1
  46. package/dist/commands/segments.js +1 -1
  47. package/dist/commands/show.js +1 -1
  48. package/dist/commands/status-command.js +1 -1
  49. package/dist/commands/tables.js +1 -1
  50. package/dist/commands/unset-command.js +1 -1
  51. package/dist/commands/upgrade-command.js +1 -1
  52. package/dist/commands/use-command.js +1 -1
  53. package/dist/commands/user-command.js +1 -1
  54. package/dist/commands/workflow-command.d.ts.map +1 -1
  55. package/dist/commands/workflow-command.js +1 -1
  56. package/dist/commands/workflow-command.js.map +1 -1
  57. package/dist/core/auth.js +1 -1
  58. package/dist/core/command-output.js +1 -1
  59. package/dist/core/config.js +1 -1
  60. package/dist/core/connection-cache.js +1 -1
  61. package/dist/core/constants.js +1 -1
  62. package/dist/core/credential-cache.js +1 -1
  63. package/dist/core/global-context.js +1 -1
  64. package/dist/core/keychain.js +1 -1
  65. package/dist/core/oauth-keychain.js +1 -1
  66. package/dist/core/oauth.js +1 -1
  67. package/dist/core/profile.js +1 -1
  68. package/dist/core/project-config.js +1 -1
  69. package/dist/core/session.js +1 -1
  70. package/dist/core/user-cache.js +1 -1
  71. package/dist/core/version.js +1 -1
  72. package/dist/index.js +1 -1
  73. package/dist/mcp/server.js +1 -1
  74. package/dist/mcp/tools/index.js +1 -1
  75. package/dist/mcp/tools/tdx-run.js +1 -1
  76. package/dist/mcp/tools/tdx-search.js +1 -1
  77. package/dist/mcp/utils.js +1 -1
  78. package/dist/proxy/claude-usage-tracker.js +1 -1
  79. package/dist/proxy/passthrough-server.js +1 -1
  80. package/dist/proxy/sse-usage-parser.js +1 -1
  81. package/dist/sdk/agent/agent-config.js +1 -1
  82. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  83. package/dist/sdk/agent/agent-yaml.js +1 -1
  84. package/dist/sdk/agent/test/evaluator.js +1 -1
  85. package/dist/sdk/agent/test/executor.js +1 -1
  86. package/dist/sdk/agent/test/index.js +1 -1
  87. package/dist/sdk/agent/test/output.js +1 -1
  88. package/dist/sdk/agent/test/parser.js +1 -1
  89. package/dist/sdk/agent/tool-target-registry.js +1 -1
  90. package/dist/sdk/api.js +1 -1
  91. package/dist/sdk/client/cdp-api-client.js +1 -1
  92. package/dist/sdk/client/delivery-api-client.js +1 -1
  93. package/dist/sdk/client/endpoints.js +1 -1
  94. package/dist/sdk/client/engage-api-client.js +1 -1
  95. package/dist/sdk/client/http-client.js +1 -1
  96. package/dist/sdk/client/llm-api-client.js +1 -1
  97. package/dist/sdk/client/oauth-refresh.js +1 -1
  98. package/dist/sdk/client/rate-limiter.js +1 -1
  99. package/dist/sdk/client/td-api-client.js +1 -1
  100. package/dist/sdk/client/trino-api-client.js +1 -1
  101. package/dist/sdk/client/workflow-client.js +1 -1
  102. package/dist/sdk/connection-validator.js +1 -1
  103. package/dist/sdk/connection.js +1 -1
  104. package/dist/sdk/delivery.js +1 -1
  105. package/dist/sdk/engage/campaign-pull.js +1 -1
  106. package/dist/sdk/engage/campaign-push.js +1 -1
  107. package/dist/sdk/engage/campaign-validator.js +1 -1
  108. package/dist/sdk/engage/campaign-yaml.js +1 -1
  109. package/dist/sdk/engage/template-pull.js +1 -1
  110. package/dist/sdk/engage/template-push.js +1 -1
  111. package/dist/sdk/engage/template-validator.js +1 -1
  112. package/dist/sdk/engage/template-yaml.js +1 -1
  113. package/dist/sdk/engage/types/campaign-def.js +1 -1
  114. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  115. package/dist/sdk/engage/types/template-schema.js +1 -1
  116. package/dist/sdk/engage.js +1 -1
  117. package/dist/sdk/errors.d.ts +2 -0
  118. package/dist/sdk/errors.d.ts.map +1 -1
  119. package/dist/sdk/errors.js +1 -1
  120. package/dist/sdk/errors.js.map +1 -1
  121. package/dist/sdk/index.js +1 -1
  122. package/dist/sdk/io/index.js +1 -1
  123. package/dist/sdk/io/node-filesystem.js +1 -1
  124. package/dist/sdk/job.js +1 -1
  125. package/dist/sdk/journey.js +1 -1
  126. package/dist/sdk/llm/chat-cache.js +1 -1
  127. package/dist/sdk/llm/index.js +1 -1
  128. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  129. package/dist/sdk/llm/model-factors.js +1 -1
  130. package/dist/sdk/personalization.js +1 -1
  131. package/dist/sdk/query/index.js +1 -1
  132. package/dist/sdk/query/sql-parser.js +1 -1
  133. package/dist/sdk/realtime.js +1 -1
  134. package/dist/sdk/schedule.js +1 -1
  135. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  136. package/dist/sdk/segment/fields-display.js +1 -1
  137. package/dist/sdk/segment/file-discovery.js +1 -1
  138. package/dist/sdk/segment/journey-utils.js +1 -1
  139. package/dist/sdk/segment/journey-validator.js +1 -1
  140. package/dist/sdk/segment/journey-yaml.js +1 -1
  141. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  142. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  143. package/dist/sdk/segment/pull-workflow.js +1 -1
  144. package/dist/sdk/segment/push-recovery.js +1 -1
  145. package/dist/sdk/segment/push-workflow.js +1 -1
  146. package/dist/sdk/segment/resolution-context.js +1 -1
  147. package/dist/sdk/segment/segment-path-parser.js +1 -1
  148. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  149. package/dist/sdk/segment/segment-validator.js +1 -1
  150. package/dist/sdk/segment/target-resolution.js +1 -1
  151. package/dist/sdk/segment/tdx-config.js +1 -1
  152. package/dist/sdk/segment/types/activation-schema.js +1 -1
  153. package/dist/sdk/segment/types/journey-def.js +1 -1
  154. package/dist/sdk/segment/types/journey-schema.js +1 -1
  155. package/dist/sdk/segment/types/segment-def.js +1 -1
  156. package/dist/sdk/segment/types/segment-schema.js +1 -1
  157. package/dist/sdk/segment/validate-files.js +1 -1
  158. package/dist/sdk/segment/yaml-validator.js +1 -1
  159. package/dist/sdk/segment.js +1 -1
  160. package/dist/sdk/types/index.js +1 -1
  161. package/dist/sdk/types/progress.js +1 -1
  162. package/dist/sdk/user.js +1 -1
  163. package/dist/sdk/util/format-detector.js +1 -1
  164. package/dist/sdk/util/formatters.js +1 -1
  165. package/dist/sdk/util/index.js +1 -1
  166. package/dist/sdk/util/paginate.js +1 -1
  167. package/dist/sdk/util/tree-formatter.js +1 -1
  168. package/dist/sdk/workflow/archive-validation.js +1 -1
  169. package/dist/sdk/workflow/clone-workflow.js +1 -1
  170. package/dist/sdk/workflow/index.d.ts +12 -0
  171. package/dist/sdk/workflow/index.d.ts.map +1 -1
  172. package/dist/sdk/workflow/index.js +1 -1
  173. package/dist/sdk/workflow/index.js.map +1 -1
  174. package/dist/sdk/workflow/pull-workflow.js +1 -1
  175. package/dist/sdk/workflow/push-workflow.js +1 -1
  176. package/dist/sdk/workflow/tdx-config.js +1 -1
  177. package/dist/sdk/workflow/workflow-utils.js +1 -1
  178. package/dist/test-utils/command-runner.js +1 -1
  179. package/dist/test-utils/factories.js +1 -1
  180. package/dist/test-utils/fixtures.js +1 -1
  181. package/dist/test-utils/http-mock.js +1 -1
  182. package/dist/test-utils/index.js +1 -1
  183. package/dist/utils/async.js +1 -1
  184. package/dist/utils/colors.js +1 -1
  185. package/dist/utils/diff.js +1 -1
  186. package/dist/utils/file-permissions.js +1 -1
  187. package/dist/utils/file-reader.js +1 -1
  188. package/dist/utils/github-releases.js +1 -1
  189. package/dist/utils/global-cache.js +1 -1
  190. package/dist/utils/json-loader.js +1 -1
  191. package/dist/utils/local-cache.js +1 -1
  192. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  193. package/dist/utils/logger/formatters/index.js +1 -1
  194. package/dist/utils/logger/handlers/console-handler.js +1 -1
  195. package/dist/utils/logger/handlers/file-handler.js +1 -1
  196. package/dist/utils/logger/handlers/index.js +1 -1
  197. package/dist/utils/logger/handlers/null-handler.js +1 -1
  198. package/dist/utils/logger/index.js +1 -1
  199. package/dist/utils/logger/logger.js +1 -1
  200. package/dist/utils/logger/types.js +1 -1
  201. package/dist/utils/option-validation.js +1 -1
  202. package/dist/utils/process.js +1 -1
  203. package/dist/utils/prompt.js +1 -1
  204. package/dist/utils/spinner.js +1 -1
  205. package/dist/utils/sse-parser.js +1 -1
  206. package/dist/utils/string-utils.js +1 -1
  207. package/dist/utils/table-ref-parser.js +1 -1
  208. package/dist/utils/tdx-logger.js +1 -1
  209. package/dist/utils/version-check.js +1 -1
  210. package/package.json +1 -1
@@ -1 +1 @@
1
- const a4_0x40b9c1=a4_0x51a1;(function(_0x597529,_0x2b9a49){const _0x320714=a4_0x51a1,_0x4e5824=_0x597529();while(!![]){try{const _0x54ddee=parseInt(_0x320714(0x10e))/0x1*(parseInt(_0x320714(0x147))/0x2)+parseInt(_0x320714(0xb3))/0x3*(-parseInt(_0x320714(0x158))/0x4)+-parseInt(_0x320714(0x14e))/0x5*(-parseInt(_0x320714(0xb1))/0x6)+parseInt(_0x320714(0xa6))/0x7*(-parseInt(_0x320714(0xa9))/0x8)+-parseInt(_0x320714(0xdb))/0x9*(-parseInt(_0x320714(0x116))/0xa)+-parseInt(_0x320714(0x135))/0xb*(-parseInt(_0x320714(0x11d))/0xc)+-parseInt(_0x320714(0xf5))/0xd*(parseInt(_0x320714(0x152))/0xe);if(_0x54ddee===_0x2b9a49)break;else _0x4e5824['push'](_0x4e5824['shift']());}catch(_0x1c1ce6){_0x4e5824['push'](_0x4e5824['shift']());}}}(a4_0x5b32,0x6c579));import a4_0x3397c1 from'chalk';import a4_0x2d596d from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext,resolveAgentPullArgs}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x205ae6){const _0x29890f=a4_0x51a1,_0x54481d=[];if(_0x205ae6[_0x29890f(0x13c)]!==undefined)_0x54481d[_0x29890f(0xbc)](_0x205ae6[_0x29890f(0x13c)]+_0x29890f(0xb5));if(_0x205ae6[_0x29890f(0x157)]!==undefined&&_0x205ae6[_0x29890f(0x157)]>0x0)_0x54481d['push'](a4_0x3397c1[_0x29890f(0xb9)](_0x205ae6[_0x29890f(0x157)]+_0x29890f(0xf9)));if(_0x205ae6[_0x29890f(0x102)]!==undefined&&_0x205ae6[_0x29890f(0x102)]>0x0)_0x54481d[_0x29890f(0xbc)](a4_0x3397c1[_0x29890f(0xb9)](_0x205ae6[_0x29890f(0x102)]+_0x29890f(0xd6)));if(_0x205ae6[_0x29890f(0x112)]!==undefined&&_0x205ae6['updated']>0x0)_0x54481d[_0x29890f(0xbc)](a4_0x3397c1[_0x29890f(0x137)](_0x205ae6['updated']+_0x29890f(0x140)));if(_0x205ae6['unchanged']!==undefined&&_0x205ae6[_0x29890f(0x13d)]>0x0)_0x54481d['push'](a4_0x3397c1[_0x29890f(0x150)](_0x205ae6[_0x29890f(0x13d)]+_0x29890f(0x11c)));if(_0x205ae6[_0x29890f(0xb4)]!==undefined&&_0x205ae6[_0x29890f(0xb4)]>0x0)_0x54481d[_0x29890f(0xbc)](a4_0x3397c1['red'](_0x205ae6[_0x29890f(0xb4)]+'\x20errors'));return _0x54481d[_0x29890f(0xcd)](',\x20');}function a4_0x5b32(){const _0x142ad0=['description','-\x20no\x20files\x20written','llmProject','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory','isNew','session','agent:pull','join','cwd-config','red','profile','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','Using\x20current\x20project:\x20','reason','llm','execute','\x20created','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','Cloning\x20\x22','no_context','9LpbytD','\x20\x20Text\x20Knowledge\x20Bases:\x20','No\x20tdx.json\x20found\x20in\x20','\x0aWrite\x20','action','log','\x0aPush\x20summary\x20for\x20\x27','\x0a✔\x20Pulled\x20','\x22\x20to\x20new\x20project\x20\x22','\x0aChanges\x20to\x20prompt\x20\x27','force','prompts','\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\x20Prompt\x20\x22','hasChanges','<new-name>','cyan','Using\x20project\x20from\x20','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','\x0aError:','\x22\x20to\x20\x22','Writing\x20files...','Output\x20path:\x20','parse','experimentalArtifacts','diff','143Kgwvaq','textKnowledgeBases','Source:\x20','\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','\x20new','dim','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','Pushing\x20to\x20project...','sourceProjectName','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','knowledgeBases','agent:push','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','created','utf-8','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)','\x22\x20to\x20a\x20different\x20profile','cwd','name','output','Agent:\x20','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','newProjectId','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','\x22...','189194EqaDfc','Output:\x20','Dry\x20run\x20-\x20no\x20files\x20written','pushAgent','updated','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Would\x20clone:','llm_project','2025130yoXWNG','\x20\x20tdx\x20agent\x20pull\x20','\x0aPull\x20summary\x20for\x20\x27','agentId','outputPath','\x0aPush\x20','\x20unchanged','804qmeqKV','\x20\x20Integration\x20\x22','Project\x20cloned\x20successfully','Status:\x20','\x20--name\x20','\x20--profile\x20','pullProject','\x20\x20Experimental\x20Artifacts:\x20','\x20\x20Prompts:\x20','Would\x20pull\x20agent:\x20','\x20=\x20','\x0aErrors\x20found:','outputDir','✔\x20Context\x20set:\x20','New\x20project\x20ID:\x20','dirname','agentName','Using\x20project\x20from\x20context:\x20','Agent\x20pulled\x20successfully','Clone\x20\x22','\x20resources?','\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)','yes','Project\x20cloned\x20with\x20errors','50017SJykXT','\x20changed','yellow','experimentalKnowledgeBases','\x0a✔\x20Pushed\x20','error','\x20\x20Experimental\x20Artifact\x20\x22','total','unchanged','\x20successfully','found','\x20updated','\x20\x20Knowledge\x20Bases:\x20','context','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','newProjectName','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','arg-dir','8OLUDyT','agents','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20\x20tdx\x20agent\x20clone\x20agents/','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','projectName','message','4835vwtciw','pushProject','gray','\x27\x20to\x20create\x20the\x20folder\x20structure.','632352rjtRoj','pullAgent','dryRun','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','\x20\x20Source:\x20','new','2100516RLmnfq','Analyzing\x20changes\x20to\x20push...','Using\x20context\x20project:\x20','Would\x20push\x20agent:\x20','INVALID_ARGUMENT','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','\x0aChanges:','tdx.json','source','integrations','projectId','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','184079puwwvt','agent.yml','\x20|\x20','136EUMsrm','counts','agent','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','New\x20project:\x20','\x20\x20Agents:\x20','Errors:','Using\x20project:\x20','4026bMDAzh','\x20\x20Knowledge\x20Base\x20\x22','3ZYmoMx','errors','\x20total','Pushing\x20agent\x20from\x20\x22','cloneProject','site','green','Summary:','Project:\x20','push','Dry\x20run\x20-\x20no\x20changes\x20made','Cancelled','Failed\x20to\x20push\x20agent:\x20','\x20\x20Agent\x20\x22','repeat','agent:clone','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','\x22:\x20','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date'];a4_0x5b32=function(){return _0x142ad0;};return a4_0x5b32();}function displayDiffs(_0x51daf5,_0x5ba373,_0x3740a0,_0x43e946,_0x1b79ca,_0x22c353,_0x25c097){const _0x3292ac=a4_0x51a1;for(const _0x45e269 of _0x51daf5){if(_0x45e269['diff']){const _0x2bec3d=_0x45e269[_0x3292ac(0x12d)]||_0x45e269[_0x3292ac(0x107)];console[_0x3292ac(0xe0)]('\x0aChanges\x20to\x20agent\x20\x27'+_0x2bec3d+'\x27:'),console[_0x3292ac(0xe0)]('─'[_0x3292ac(0xc1)](0x3c)),console['log'](_0x45e269['diff']),console[_0x3292ac(0xe0)]('─'[_0x3292ac(0xc1)](0x3c));}}for(const _0x547ca7 of _0x5ba373){_0x547ca7[_0x3292ac(0xf4)]&&(console[_0x3292ac(0xe0)](_0x3292ac(0xd7)+_0x547ca7[_0x3292ac(0x107)]+'\x27:'),console['log']('─'[_0x3292ac(0xc1)](0x3c)),console[_0x3292ac(0xe0)](_0x547ca7[_0x3292ac(0xf4)]),console[_0x3292ac(0xe0)]('─'['repeat'](0x3c)));}for(const _0x11f5f8 of _0x3740a0){_0x11f5f8[_0x3292ac(0xf4)]&&(console[_0x3292ac(0xe0)](_0x3292ac(0xc3)+_0x11f5f8['name']+'\x27:'),console[_0x3292ac(0xe0)]('─'[_0x3292ac(0xc1)](0x3c)),console[_0x3292ac(0xe0)](_0x11f5f8[_0x3292ac(0xf4)]),console[_0x3292ac(0xe0)]('─'['repeat'](0x3c)));}for(const _0x3383a6 of _0x43e946){_0x3383a6[_0x3292ac(0xf4)]&&(console[_0x3292ac(0xe0)](_0x3292ac(0xe4)+_0x3383a6[_0x3292ac(0x107)]+'\x27:'),console[_0x3292ac(0xe0)]('─'[_0x3292ac(0xc1)](0x3c)),console['log'](_0x3383a6[_0x3292ac(0xf4)]),console['log']('─'[_0x3292ac(0xc1)](0x3c)));}for(const _0xd8008a of _0x1b79ca){_0xd8008a['diff']&&(console[_0x3292ac(0xe0)]('\x0aChanges\x20to\x20integration\x20\x27'+_0xd8008a[_0x3292ac(0x107)]+'\x27:'),console[_0x3292ac(0xe0)]('─'['repeat'](0x3c)),console['log'](_0xd8008a[_0x3292ac(0xf4)]),console[_0x3292ac(0xe0)]('─'[_0x3292ac(0xc1)](0x3c)));}for(const _0x34b091 of _0x22c353){_0x34b091[_0x3292ac(0xf4)]&&(console[_0x3292ac(0xe0)](_0x3292ac(0xd1)+_0x34b091[_0x3292ac(0x107)]+'\x27:'),console[_0x3292ac(0xe0)]('─'[_0x3292ac(0xc1)](0x3c)),console[_0x3292ac(0xe0)](_0x34b091[_0x3292ac(0xf4)]),console[_0x3292ac(0xe0)]('─'[_0x3292ac(0xc1)](0x3c)));}for(const _0x297521 of _0x25c097){_0x297521[_0x3292ac(0xf4)]&&(console[_0x3292ac(0xe0)]('\x0aChanges\x20to\x20experimental\x20artifact\x20\x27'+_0x297521[_0x3292ac(0x107)]+'\x27:'),console[_0x3292ac(0xe0)]('─'[_0x3292ac(0xc1)](0x3c)),console[_0x3292ac(0xe0)](_0x297521[_0x3292ac(0xf4)]),console[_0x3292ac(0xe0)]('─'[_0x3292ac(0xc1)](0x3c)));}}function a4_0x51a1(_0x32f2a9,_0x37e0f0){_0x32f2a9=_0x32f2a9-0xa4;const _0x5b3209=a4_0x5b32();let _0x51a12e=_0x5b3209[_0x32f2a9];return _0x51a12e;}export class AgentPullCommand extends BaseCommand{[a4_0x40b9c1(0x107)]=a4_0x40b9c1(0xcc);[a4_0x40b9c1(0xc6)]=a4_0x40b9c1(0x14b);async['execute'](_0x2cd33f){const _0x313275=a4_0x40b9c1,{options:_0x428604,args:_0x5ec7f3,tdx:_0x5e6eb5}=_0x2cd33f,_0x113e9b=_0x5ec7f3[0x0],_0x331915=_0x5ec7f3[0x1],_0x45b1bd=_0x428604[_0x313275(0x108)],_0x1d1d20=_0x428604['dryRun'],_0xf0fa09=_0x428604['force'],_0x4e22a7=_0x428604[_0x313275(0x133)],_0x4888f8=_0x428604[_0x313275(0xc8)],_0x298f93=_0x428604[_0x313275(0xab)];let _0x1c57a7;if(_0x113e9b){const _0x512a3b=a4_0x2d596d[_0x313275(0xcd)](_0x113e9b,_0x313275(0x15f));if(existsSync(_0x512a3b))try{const _0x313189=JSON[_0x313275(0xf2)](readFileSync(_0x512a3b,_0x313275(0x103)));_0x313189[_0x313275(0x115)]&&(_0x1c57a7={'llm_project':_0x313189[_0x313275(0x115)]});}catch{}}const _0x49a52b=findAgentConfigPath(process[_0x313275(0x106)]());let _0x4253aa;if(_0x49a52b)try{const _0x5085f2=JSON[_0x313275(0xf2)](readFileSync(_0x49a52b,_0x313275(0x103)));_0x5085f2[_0x313275(0x115)]&&(_0x4253aa={'llm_project':_0x5085f2['llm_project']});}catch{}const _0x3b7a2f=resolveAgentPullArgs({'arg':_0x113e9b,'agentNameArg':_0x331915,'agentFlag':_0x298f93,'contextProject':_0x4888f8,'argDirConfig':_0x1c57a7,'cwdConfigPath':_0x49a52b||undefined,'cwdConfig':_0x4253aa}),{projectNameOrId:_0xe30c68,targetAgentName:_0x29bd90,existingOutputDir:_0x2febe9,source:_0x5d5f65}=_0x3b7a2f;if(_0x5d5f65===_0x313275(0x146))console[_0x313275(0xe0)](a4_0x3397c1[_0x313275(0xfa)](_0x313275(0xec)+a4_0x2d596d['join'](_0x113e9b,'tdx.json')+':\x20'+_0xe30c68));else{if(_0x5d5f65===_0x313275(0xce))console[_0x313275(0xe0)](a4_0x3397c1[_0x313275(0xfa)](_0x313275(0xb0)+_0xe30c68));else _0x5d5f65===_0x313275(0x142)&&console['log'](a4_0x3397c1[_0x313275(0xfa)](_0x313275(0x12e)+_0xe30c68));}if(!_0xe30c68)return _0x298f93?(console[_0x313275(0xe0)](a4_0x3397c1[_0x313275(0x137)]('The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a')),console[_0x313275(0xe0)](_0x313275(0x10c)),console[_0x313275(0xe0)](_0x313275(0xac))):(console[_0x313275(0xe0)](a4_0x3397c1['yellow'](_0x313275(0x101))),console[_0x313275(0xe0)](_0x313275(0x104)),console[_0x313275(0xe0)](_0x313275(0xe7)),console[_0x313275(0xe0)](_0x313275(0xc9)),console[_0x313275(0xe0)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20--agent\x20<name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20context\x20project'),console[_0x313275(0xe0)](_0x313275(0xf8))),0x1;if(_0x29bd90){const {data:_0x3e41c2}=await withSpinner('Pulling\x20agent\x20\x22'+_0x29bd90+'\x22\x20from\x20project\x20\x22'+_0xe30c68+_0x313275(0x10d),()=>_0x5e6eb5['llm'][_0x313275(0x153)](_0xe30c68,_0x29bd90,_0x45b1bd,{'dryRun':_0x1d1d20,'force':_0xf0fa09}));if(_0x1d1d20)return console[_0x313275(0xe0)](a4_0x3397c1[_0x313275(0x137)](_0x313275(0x110))),console[_0x313275(0xe0)](_0x313275(0x126)+_0x3e41c2[_0x313275(0x12d)]),console[_0x313275(0xe0)](_0x313275(0xf1)+_0x3e41c2[_0x313275(0x11a)]),_0x3e41c2[_0x313275(0xf4)]&&(console[_0x313275(0xe0)](_0x313275(0x15e)),console[_0x313275(0xe0)]('─'[_0x313275(0xc1)](0x3c)),console['log'](_0x3e41c2[_0x313275(0xf4)]),console[_0x313275(0xe0)]('─'[_0x313275(0xc1)](0x3c))),0x0;return console[_0x313275(0xe0)](a4_0x3397c1[_0x313275(0xb9)](_0x313275(0x12f))),console[_0x313275(0xe0)](_0x313275(0x109)+_0x3e41c2[_0x313275(0x12d)]),console[_0x313275(0xe0)](_0x313275(0x10f)+_0x3e41c2[_0x313275(0x11a)]),console[_0x313275(0xe0)](_0x313275(0x120)+(_0x3e41c2[_0x313275(0xca)]?a4_0x3397c1[_0x313275(0xb9)](_0x313275(0x157)):_0x3e41c2[_0x313275(0xe9)]?a4_0x3397c1['yellow'](_0x313275(0x112)):a4_0x3397c1['gray']('unchanged'))),0x0;}const _0x574a07=_0x2febe9||_0x45b1bd,{data:_0x4b55f4}=await withSpinner('Analyzing\x20project\x20\x22'+_0xe30c68+_0x313275(0x10d),()=>_0x5e6eb5[_0x313275(0xd4)][_0x313275(0x123)](_0xe30c68,_0x574a07,{'dryRun':!![]})),_0x5cb9a1=_0x4b55f4[_0x313275(0xaa)][_0x313275(0x148)][_0x313275(0x157)]+_0x4b55f4[_0x313275(0xaa)]['knowledgeBases']['new']+_0x4b55f4[_0x313275(0xaa)][_0x313275(0xf6)][_0x313275(0x157)]+_0x4b55f4['counts']['prompts']['new']+_0x4b55f4['counts']['integrations']['new']+_0x4b55f4[_0x313275(0xaa)][_0x313275(0x138)][_0x313275(0x157)]+_0x4b55f4[_0x313275(0xaa)][_0x313275(0xf3)][_0x313275(0x157)],_0x2196b7=_0x4b55f4[_0x313275(0xaa)][_0x313275(0x148)][_0x313275(0x112)]+_0x4b55f4[_0x313275(0xaa)][_0x313275(0xff)]['updated']+_0x4b55f4[_0x313275(0xaa)][_0x313275(0xf6)]['updated']+_0x4b55f4[_0x313275(0xaa)][_0x313275(0xe6)][_0x313275(0x112)]+_0x4b55f4['counts'][_0x313275(0x161)][_0x313275(0x112)]+_0x4b55f4[_0x313275(0xaa)][_0x313275(0x138)][_0x313275(0x112)]+_0x4b55f4['counts'][_0x313275(0xf3)][_0x313275(0x112)],_0x15d389=_0x4b55f4[_0x313275(0xaa)][_0x313275(0x148)][_0x313275(0x13d)]+_0x4b55f4[_0x313275(0xaa)][_0x313275(0xff)][_0x313275(0x13d)]+_0x4b55f4[_0x313275(0xaa)]['textKnowledgeBases']['unchanged']+_0x4b55f4[_0x313275(0xaa)][_0x313275(0xe6)]['unchanged']+_0x4b55f4[_0x313275(0xaa)][_0x313275(0x161)][_0x313275(0x13d)]+_0x4b55f4[_0x313275(0xaa)][_0x313275(0x138)][_0x313275(0x13d)]+_0x4b55f4[_0x313275(0xaa)]['experimentalArtifacts'][_0x313275(0x13d)];console[_0x313275(0xe0)](_0x313275(0x118)+_0x4b55f4[_0x313275(0x14c)]+'\x27:'),console[_0x313275(0xe0)]('\x20\x20'+a4_0x3397c1['green']('+\x20'+_0x5cb9a1+_0x313275(0xf9))+'\x20|\x20'+a4_0x3397c1[_0x313275(0x137)]('~\x20'+_0x2196b7+_0x313275(0x136))+'\x20|\x20'+a4_0x3397c1['dim']('=\x20'+_0x15d389+_0x313275(0x11c))),console[_0x313275(0xe0)](_0x313275(0xae)+formatCountSummary(_0x4b55f4[_0x313275(0xaa)]['agents'])),console['log'](_0x313275(0x141)+formatCountSummary(_0x4b55f4['counts'][_0x313275(0xff)])),console[_0x313275(0xe0)](_0x313275(0xdc)+formatCountSummary(_0x4b55f4[_0x313275(0xaa)][_0x313275(0xf6)])),console[_0x313275(0xe0)](_0x313275(0x125)+formatCountSummary(_0x4b55f4['counts'][_0x313275(0xe6)])),console['log']('\x20\x20Integrations:\x20'+formatCountSummary(_0x4b55f4[_0x313275(0xaa)]['integrations']));const _0x368704=_0x4b55f4[_0x313275(0xaa)]['experimentalKnowledgeBases']['total']>0x0||_0x4b55f4['counts']['experimentalArtifacts'][_0x313275(0x13c)]>0x0;_0x368704&&(console['log'](_0x313275(0x143)+formatCountSummary(_0x4b55f4[_0x313275(0xaa)]['experimentalKnowledgeBases'])),console[_0x313275(0xe0)](_0x313275(0x124)+formatCountSummary(_0x4b55f4['counts']['experimentalArtifacts'])));console['log']('\x20\x20Target:\x20'+a4_0x3397c1[_0x313275(0xeb)](_0x4b55f4['outputDir'])),displayDiffs(_0x4b55f4['agents'],_0x4b55f4[_0x313275(0xff)],_0x4b55f4['textKnowledgeBases'],_0x4b55f4['prompts'],_0x4b55f4[_0x313275(0x161)],_0x4b55f4[_0x313275(0x138)],_0x4b55f4[_0x313275(0xf3)]);if(_0x1d1d20)return console[_0x313275(0xe0)](a4_0x3397c1[_0x313275(0x137)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x5cb9a1===0x0&&_0x2196b7===0x0)return console[_0x313275(0xe0)](a4_0x3397c1[_0x313275(0xb9)](_0x313275(0xc5))),saveSessionContext({'llm_project':_0x4b55f4[_0x313275(0x14c)]},_0x428604['session']),console[_0x313275(0xe0)](a4_0x3397c1[_0x313275(0xb9)](_0x313275(0x12a)+a4_0x3397c1['dim'](_0x313275(0x115))+_0x313275(0x127)+a4_0x3397c1[_0x313275(0xeb)](_0x4b55f4[_0x313275(0x14c)]))),0x0;if(!_0x4e22a7&&!_0xf0fa09){if(!isInteractive())return console[_0x313275(0x13a)](a4_0x3397c1['red'](_0x313275(0xee)),_0x313275(0x113)),console[_0x313275(0x13a)](a4_0x3397c1['dim'](_0x313275(0x149))),0x1;const _0x2d3b3b=await confirmKey(_0x313275(0xde)+(_0x5cb9a1+_0x2196b7)+'\x20files?');if(!_0x2d3b3b)return console[_0x313275(0xe0)](a4_0x3397c1[_0x313275(0x137)]('Cancelled'),_0x313275(0xc7)),0x1;}const {data:_0x131d3e}=await withSpinner(_0x313275(0xf0),()=>_0x5e6eb5[_0x313275(0xd4)][_0x313275(0x123)](_0xe30c68,_0x574a07,{'force':_0xf0fa09}));return console[_0x313275(0xe0)](a4_0x3397c1['green'](_0x313275(0xe2)+(_0x5cb9a1+_0x2196b7)+'\x20files\x20to\x20'+_0x131d3e[_0x313275(0x129)])),saveSessionContext({'llm_project':_0x131d3e[_0x313275(0x14c)]},_0x428604[_0x313275(0xcb)]),console[_0x313275(0xe0)](a4_0x3397c1[_0x313275(0xb9)](_0x313275(0x12a)+a4_0x3397c1[_0x313275(0xfa)](_0x313275(0x115))+'\x20=\x20'+a4_0x3397c1[_0x313275(0xeb)](_0x131d3e[_0x313275(0x14c)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x40b9c1(0x107)]=a4_0x40b9c1(0xc2);[a4_0x40b9c1(0xc6)]='Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project';async[a4_0x40b9c1(0xd5)](_0x4e7028){const _0x148871=a4_0x40b9c1,{options:_0x276328,args:_0x50f395,tdx:_0x32af8b}=_0x4e7028,_0xff8d65=_0x50f395[0x0],_0x3eecca=_0x276328[_0x148871(0x107)],_0x1028e3=_0x276328['dryRun'],_0x40cfed=_0x276328[_0x148871(0x133)],_0x377350=_0x276328['site'],_0x3b3d73=_0x276328[_0x148871(0xc8)];let _0x453d4d;const _0x91a4=findAgentConfigPath(process[_0x148871(0x106)]());if(_0xff8d65){const _0x1b8dc3=a4_0x2d596d['join'](_0xff8d65,_0x148871(0x15f));existsSync(_0x1b8dc3)?(_0x453d4d=_0xff8d65,console['log'](a4_0x3397c1['dim']('Using\x20local\x20project:\x20'+_0xff8d65))):_0x453d4d=_0xff8d65;}else{if(_0x91a4)_0x453d4d=a4_0x2d596d[_0x148871(0x12c)](_0x91a4),console[_0x148871(0xe0)](a4_0x3397c1[_0x148871(0xfa)](_0x148871(0xd2)+_0x453d4d));else{if(_0x3b3d73){const _0x5918dc=sanitizeForFilesystem(_0x3b3d73);let _0x3fcf15=_0x5918dc,_0x27269f=a4_0x2d596d['join'](process[_0x148871(0x106)](),_0x148871(0x148),_0x5918dc,_0x148871(0x15f));if(!existsSync(_0x27269f)){const _0x3e0d61=normalizeName(_0x3b3d73),_0x480228=a4_0x2d596d[_0x148871(0xcd)](process[_0x148871(0x106)](),_0x148871(0x148),_0x3e0d61,_0x148871(0x15f));existsSync(_0x480228)&&(_0x3fcf15=_0x3e0d61,_0x27269f=_0x480228);}if(existsSync(_0x27269f))_0x453d4d=a4_0x2d596d[_0x148871(0x12c)](_0x27269f),console[_0x148871(0xe0)](a4_0x3397c1[_0x148871(0xfa)]('Using\x20local\x20project:\x20'+_0x453d4d));else{const _0x418be9=_0x276328[_0x148871(0xd0)];if(_0x418be9)throw new SDKError(ErrorCode[_0x148871(0x15c)],'Cannot\x20clone\x20from\x20context\x20project\x20\x22'+_0x3b3d73+_0x148871(0x105),undefined,{'helpText':_0x148871(0xed)+_0x148871(0x10a)+(_0x148871(0x117)+_0x3b3d73+'\x0a')+(_0x148871(0x14a)+_0x3fcf15+_0x148871(0x121)+(_0x3eecca||_0x148871(0xea))+_0x148871(0x122)+_0x418be9)});_0x453d4d=_0x3b3d73,console[_0x148871(0xe0)](a4_0x3397c1['dim'](_0x148871(0x15a)+_0x3b3d73));}}}}if(!_0x453d4d)return console[_0x148871(0xe0)](a4_0x3397c1[_0x148871(0x137)](_0x148871(0xa5))),console[_0x148871(0xe0)]('\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project'),console[_0x148871(0xe0)](_0x148871(0x155)),console[_0x148871(0xe0)](_0x148871(0x132)),console[_0x148871(0xe0)]('\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>'),0x1;if(!_0x3eecca)throw new SDKError(ErrorCode['MISSING_ARGUMENT'],'New\x20project\x20name\x20is\x20required',undefined,{'helpText':_0x148871(0xfe)});if(!_0x40cfed&&!_0x1028e3){if(!isInteractive())return console['error'](a4_0x3397c1[_0x148871(0xcf)](_0x148871(0xee)),_0x148871(0x113)),console['error'](a4_0x3397c1['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x27bf4b=await confirmKey(_0x148871(0x130)+_0x453d4d+_0x148871(0xe3)+_0x3eecca+'\x22?');if(!_0x27bf4b)return console['log'](a4_0x3397c1[_0x148871(0x137)](_0x148871(0xbe))),0x1;}const {data:_0x246c8f}=await withSpinner(_0x148871(0xd9)+_0x453d4d+_0x148871(0xef)+_0x3eecca+'\x22...',()=>_0x32af8b[_0x148871(0xd4)][_0x148871(0xb7)](_0x453d4d,_0x3eecca,{'dryRun':_0x1028e3}));if(_0x1028e3){console[_0x148871(0xe0)](a4_0x3397c1[_0x148871(0x137)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console['log']('Source:\x20'+_0x246c8f[_0x148871(0xfd)]),console['log'](_0x148871(0xad)+_0x3eecca),console['log'](_0x148871(0x114)),console[_0x148871(0xe0)](_0x148871(0xae)+_0x246c8f[_0x148871(0xaa)]['agents'][_0x148871(0x102)]),console['log'](_0x148871(0x141)+_0x246c8f[_0x148871(0xaa)][_0x148871(0xff)][_0x148871(0x102)]),console[_0x148871(0xe0)](_0x148871(0x125)+_0x246c8f[_0x148871(0xaa)][_0x148871(0xe6)]['created']);const _0x1368ef=_0x246c8f['counts'][_0x148871(0x138)]['created']>0x0||_0x246c8f['counts'][_0x148871(0xf3)][_0x148871(0x102)]>0x0;return _0x1368ef&&(console['log']('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+_0x246c8f['counts']['experimentalKnowledgeBases'][_0x148871(0x102)]),console['log']('\x20\x20Experimental\x20Artifacts:\x20'+_0x246c8f[_0x148871(0xaa)][_0x148871(0xf3)][_0x148871(0x102)])),0x0;}const _0x546fd4=_0x246c8f[_0x148871(0xaa)][_0x148871(0x148)][_0x148871(0xb4)]>0x0||_0x246c8f[_0x148871(0xaa)][_0x148871(0xff)]['errors']>0x0||_0x246c8f[_0x148871(0xaa)][_0x148871(0xe6)][_0x148871(0xb4)]>0x0||_0x246c8f[_0x148871(0xaa)]['experimentalKnowledgeBases'][_0x148871(0xb4)]>0x0||_0x246c8f[_0x148871(0xaa)]['experimentalArtifacts'][_0x148871(0xb4)]>0x0;_0x546fd4?console['log'](a4_0x3397c1[_0x148871(0x137)](_0x148871(0x134))):console[_0x148871(0xe0)](a4_0x3397c1[_0x148871(0xb9)](_0x148871(0x11f)));console[_0x148871(0xe0)](_0x148871(0xf7)+_0x246c8f['sourceProjectName']),console[_0x148871(0xe0)](_0x148871(0xad)+_0x246c8f[_0x148871(0x144)]),console[_0x148871(0xe0)](_0x148871(0x12b)+_0x246c8f[_0x148871(0x10b)]),console[_0x148871(0xe0)](),console[_0x148871(0xe0)](_0x148871(0xba)),console[_0x148871(0xe0)](_0x148871(0xae)+formatCountSummary(_0x246c8f[_0x148871(0xaa)][_0x148871(0x148)])),console[_0x148871(0xe0)](_0x148871(0x141)+formatCountSummary(_0x246c8f[_0x148871(0xaa)][_0x148871(0xff)])),console[_0x148871(0xe0)](_0x148871(0x125)+formatCountSummary(_0x246c8f[_0x148871(0xaa)][_0x148871(0xe6)])),console[_0x148871(0xe0)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x246c8f[_0x148871(0xaa)][_0x148871(0x161)]));const _0x434f79=_0x246c8f[_0x148871(0xaa)]['experimentalKnowledgeBases'][_0x148871(0x102)]>0x0||_0x246c8f[_0x148871(0xaa)][_0x148871(0x138)][_0x148871(0x112)]>0x0||_0x246c8f[_0x148871(0xaa)][_0x148871(0x138)][_0x148871(0x13d)]>0x0||_0x246c8f[_0x148871(0xaa)][_0x148871(0xf3)][_0x148871(0x102)]>0x0||_0x246c8f[_0x148871(0xaa)][_0x148871(0xf3)][_0x148871(0x112)]>0x0||_0x246c8f[_0x148871(0xaa)][_0x148871(0xf3)][_0x148871(0x13d)]>0x0;_0x434f79&&(console[_0x148871(0xe0)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x246c8f[_0x148871(0xaa)][_0x148871(0x138)])),console[_0x148871(0xe0)](_0x148871(0x124)+formatCountSummary(_0x246c8f[_0x148871(0xaa)]['experimentalArtifacts'])));if(_0x546fd4){console[_0x148871(0xe0)](),console[_0x148871(0xe0)](a4_0x3397c1[_0x148871(0xcf)](_0x148871(0xaf)));for(const _0x10d02c of _0x246c8f[_0x148871(0x148)]){_0x10d02c['action']==='error'&&console[_0x148871(0xe0)](a4_0x3397c1[_0x148871(0xcf)](_0x148871(0xc0)+_0x10d02c[_0x148871(0x12d)]+_0x148871(0xc4)+_0x10d02c[_0x148871(0x13a)]));}for(const _0x5e6567 of _0x246c8f[_0x148871(0xff)]){_0x5e6567[_0x148871(0xdf)]==='error'&&console['log'](a4_0x3397c1[_0x148871(0xcf)](_0x148871(0xb2)+_0x5e6567[_0x148871(0x107)]+_0x148871(0xc4)+_0x5e6567[_0x148871(0x13a)]));}for(const _0x4af607 of _0x246c8f['prompts']){_0x4af607[_0x148871(0xdf)]==='error'&&console[_0x148871(0xe0)](a4_0x3397c1[_0x148871(0xcf)]('\x20\x20Prompt\x20\x22'+_0x4af607[_0x148871(0x107)]+'\x22:\x20'+_0x4af607[_0x148871(0x13a)]));}for(const _0x5e9dde of _0x246c8f[_0x148871(0x161)]){_0x5e9dde[_0x148871(0xdf)]===_0x148871(0x13a)&&console[_0x148871(0xe0)](a4_0x3397c1[_0x148871(0xcf)](_0x148871(0x11e)+_0x5e9dde[_0x148871(0x107)]+_0x148871(0xc4)+_0x5e9dde[_0x148871(0x13a)]));}for(const _0xe7879d of _0x246c8f[_0x148871(0x138)]){_0xe7879d[_0x148871(0xdf)]===_0x148871(0x13a)&&console[_0x148871(0xe0)](a4_0x3397c1['red']('\x20\x20Experimental\x20Knowledge\x20Base\x20\x22'+_0xe7879d['name']+'\x22:\x20'+_0xe7879d['error']));}for(const _0x49ad2e of _0x246c8f[_0x148871(0xf3)]){_0x49ad2e[_0x148871(0xdf)]==='error'&&console[_0x148871(0xe0)](a4_0x3397c1['red'](_0x148871(0x13b)+_0x49ad2e[_0x148871(0x107)]+_0x148871(0xc4)+_0x49ad2e[_0x148871(0x13a)]));}return 0x1;}console['log']();const _0x652d15=getLLMProjectUrl(_0x377350,_0x246c8f['newProjectId']);return console['log'](_0x148871(0xbb)+a4_0x3397c1[_0x148871(0xeb)](_0x652d15)),0x0;}}export class AgentPushCommand extends BaseCommand{['name']=a4_0x40b9c1(0x100);[a4_0x40b9c1(0xc6)]='Push\x20local\x20agent\x20files\x20to\x20LLM\x20project';async['execute'](_0x5a7a9){const _0x587577=a4_0x40b9c1,{options:_0x22377f,args:_0x27ed13,tdx:_0x47c3d5}=_0x5a7a9;let _0x549d1e=_0x27ed13[0x0]||process[_0x587577(0x106)]();const _0x34d4fa=_0x22377f[_0x587577(0x154)],_0x468dc3=_0x22377f[_0x587577(0xe5)],_0x46a4de=_0x22377f[_0x587577(0x133)],_0x30f4ce=_0x22377f[_0x587577(0xb8)],_0x1e930d=a4_0x2d596d[_0x587577(0xcd)](_0x549d1e,_0x587577(0xa7)),_0x25642a=existsSync(_0x1e930d);if(_0x25642a){const {data:_0x5035a1}=await withSpinner(_0x587577(0xb6)+_0x549d1e+_0x587577(0x10d),()=>_0x47c3d5[_0x587577(0xd4)][_0x587577(0x111)](_0x549d1e,{'dryRun':_0x34d4fa,'force':_0x468dc3}));if(_0x34d4fa)return console[_0x587577(0xe0)](a4_0x3397c1[_0x587577(0x137)](_0x587577(0xbd))),console['log'](_0x587577(0x15b)+_0x5035a1[_0x587577(0x12d)]),0x0;if(_0x5035a1[_0x587577(0xdf)]==='error')return console[_0x587577(0xe0)](a4_0x3397c1[_0x587577(0xcf)](_0x587577(0xbf)+_0x5035a1[_0x587577(0x13a)])),0x1;console['log'](a4_0x3397c1[_0x587577(0xb9)]('Agent\x20'+_0x5035a1[_0x587577(0xdf)]+_0x587577(0x13e))),console['log'](_0x587577(0x109)+_0x5035a1[_0x587577(0x12d)]);if(_0x5035a1['agentId']&&_0x5035a1[_0x587577(0xa4)]){const _0x48190d=getLLMAgentChatUrl(_0x30f4ce,_0x5035a1['projectId'],_0x5035a1[_0x587577(0x119)]);console[_0x587577(0xe0)]('Chat:\x20'+a4_0x3397c1[_0x587577(0xeb)](_0x48190d));}return 0x0;}const _0x8187c1=_0x22377f['llmProject'],_0x126b81=resolveProjectFromContext(_0x549d1e,_0x8187c1);if(_0x126b81[_0x587577(0x13f)])_0x549d1e=_0x126b81['projectDir'],_0x126b81[_0x587577(0x160)]===_0x587577(0x142)&&console['log'](a4_0x3397c1[_0x587577(0xfa)](_0x587577(0xb0)+_0x549d1e));else{let _0xda14b0=_0x587577(0x145);_0x126b81[_0x587577(0xd3)]==='no_local_folder'&&(_0xda14b0=_0x126b81[_0x587577(0x14d)]+_0x587577(0xd8)+_0x126b81[_0x587577(0xc8)]+_0x587577(0x151));throw new SDKError(ErrorCode[_0x587577(0x15c)],_0x126b81['reason']===_0x587577(0xda)?_0x126b81[_0x587577(0x14d)]:_0x587577(0xdd)+_0x549d1e,undefined,{'helpText':_0xda14b0});}const {data:_0x4a4d86}=await withSpinner(_0x587577(0x159),()=>_0x47c3d5[_0x587577(0xd4)][_0x587577(0x14f)](_0x549d1e,{'dryRun':!![]})),_0xd20d07=_0x4a4d86['counts'][_0x587577(0x148)]['errors']>0x0;if(_0xd20d07){console['log'](a4_0x3397c1[_0x587577(0xcf)](_0x587577(0x128)));for(const _0x43be70 of _0x4a4d86['agents']){_0x43be70[_0x587577(0xdf)]===_0x587577(0x13a)&&console[_0x587577(0xe0)](a4_0x3397c1['red'](_0x587577(0xc0)+_0x43be70[_0x587577(0x12d)]+_0x587577(0xc4)+_0x43be70[_0x587577(0x13a)]));}return 0x1;}const _0x499033=_0x4a4d86['counts']['agents'][_0x587577(0x102)]+_0x4a4d86['counts'][_0x587577(0xff)]['created']+_0x4a4d86[_0x587577(0xaa)][_0x587577(0xf6)][_0x587577(0x102)]+_0x4a4d86[_0x587577(0xaa)][_0x587577(0xe6)][_0x587577(0x102)]+_0x4a4d86[_0x587577(0xaa)][_0x587577(0x161)][_0x587577(0x102)]+_0x4a4d86[_0x587577(0xaa)][_0x587577(0x138)][_0x587577(0x102)]+_0x4a4d86[_0x587577(0xaa)]['experimentalArtifacts'][_0x587577(0x102)],_0x57f4c4=_0x4a4d86['counts'][_0x587577(0x148)][_0x587577(0x112)]+_0x4a4d86[_0x587577(0xaa)][_0x587577(0xff)][_0x587577(0x112)]+_0x4a4d86[_0x587577(0xaa)][_0x587577(0xf6)][_0x587577(0x112)]+_0x4a4d86[_0x587577(0xaa)][_0x587577(0xe6)][_0x587577(0x112)]+_0x4a4d86['counts'][_0x587577(0x161)][_0x587577(0x112)]+_0x4a4d86[_0x587577(0xaa)]['experimentalKnowledgeBases'][_0x587577(0x112)]+_0x4a4d86[_0x587577(0xaa)][_0x587577(0xf3)][_0x587577(0x112)],_0x249252=_0x4a4d86[_0x587577(0xaa)][_0x587577(0x148)][_0x587577(0x13d)]+_0x4a4d86[_0x587577(0xaa)][_0x587577(0xff)]['unchanged']+_0x4a4d86[_0x587577(0xaa)][_0x587577(0xf6)]['unchanged']+_0x4a4d86[_0x587577(0xaa)]['prompts'][_0x587577(0x13d)]+_0x4a4d86['counts']['integrations']['unchanged']+_0x4a4d86[_0x587577(0xaa)]['experimentalKnowledgeBases'][_0x587577(0x13d)]+_0x4a4d86[_0x587577(0xaa)]['experimentalArtifacts'][_0x587577(0x13d)];console[_0x587577(0xe0)](_0x587577(0xe1)+_0x4a4d86[_0x587577(0x14c)]+'\x27:'),console[_0x587577(0xe0)]('\x20\x20'+a4_0x3397c1[_0x587577(0xb9)]('+\x20'+_0x499033+_0x587577(0xf9))+'\x20|\x20'+a4_0x3397c1[_0x587577(0x137)]('~\x20'+_0x57f4c4+_0x587577(0x136))+_0x587577(0xa8)+a4_0x3397c1['dim']('=\x20'+_0x249252+_0x587577(0x11c))),console[_0x587577(0xe0)](_0x587577(0xae)+formatCountSummary(_0x4a4d86['counts'][_0x587577(0x148)])),console[_0x587577(0xe0)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x4a4d86[_0x587577(0xaa)][_0x587577(0xff)])),console['log'](_0x587577(0xdc)+formatCountSummary(_0x4a4d86['counts'][_0x587577(0xf6)])),console[_0x587577(0xe0)](_0x587577(0x125)+formatCountSummary(_0x4a4d86[_0x587577(0xaa)][_0x587577(0xe6)])),console[_0x587577(0xe0)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x4a4d86[_0x587577(0xaa)]['integrations']));const _0x4620a4=_0x4a4d86['counts'][_0x587577(0x138)]['created']>0x0||_0x4a4d86[_0x587577(0xaa)][_0x587577(0x138)]['updated']>0x0||_0x4a4d86[_0x587577(0xaa)][_0x587577(0x138)][_0x587577(0x13d)]>0x0||_0x4a4d86[_0x587577(0xaa)][_0x587577(0xf3)]['created']>0x0||_0x4a4d86[_0x587577(0xaa)]['experimentalArtifacts'][_0x587577(0x112)]>0x0||_0x4a4d86[_0x587577(0xaa)][_0x587577(0xf3)][_0x587577(0x13d)]>0x0;_0x4620a4&&(console['log'](_0x587577(0x143)+formatCountSummary(_0x4a4d86[_0x587577(0xaa)][_0x587577(0x138)])),console['log'](_0x587577(0x124)+formatCountSummary(_0x4a4d86[_0x587577(0xaa)][_0x587577(0xf3)])));console[_0x587577(0xe0)](_0x587577(0x156)+a4_0x3397c1[_0x587577(0xeb)](_0x549d1e)),displayDiffs(_0x4a4d86['agents'],_0x4a4d86['knowledgeBases'],_0x4a4d86[_0x587577(0xf6)],_0x4a4d86['prompts'],_0x4a4d86[_0x587577(0x161)],_0x4a4d86[_0x587577(0x138)],_0x4a4d86[_0x587577(0xf3)]);if(_0x34d4fa)return console['log'](a4_0x3397c1[_0x587577(0x137)](_0x587577(0xfb))),0x0;if(_0x499033===0x0&&_0x57f4c4===0x0){console[_0x587577(0xe0)](a4_0x3397c1[_0x587577(0xb9)](_0x587577(0x15d)));const _0xe2a728=getLLMProjectUrl(_0x30f4ce,_0x4a4d86[_0x587577(0xa4)]);return console[_0x587577(0xe0)](_0x587577(0xbb)+a4_0x3397c1[_0x587577(0xeb)](_0xe2a728)),0x0;}if(!_0x46a4de&&!_0x468dc3){if(!isInteractive())return console[_0x587577(0x13a)](a4_0x3397c1[_0x587577(0xcf)](_0x587577(0xee)),_0x587577(0x113)),console[_0x587577(0x13a)](a4_0x3397c1[_0x587577(0xfa)](_0x587577(0x149))),0x1;const _0x342eb6=await confirmKey(_0x587577(0x11b)+(_0x499033+_0x57f4c4)+_0x587577(0x131));if(!_0x342eb6)return console[_0x587577(0xe0)](a4_0x3397c1[_0x587577(0x137)]('Cancelled'),'-\x20nothing\x20pushed'),0x1;}const {data:_0x17345f}=await withSpinner(_0x587577(0xfc),()=>_0x47c3d5[_0x587577(0xd4)][_0x587577(0x14f)](_0x549d1e,{'force':_0x468dc3})),_0x3d8242=_0x17345f[_0x587577(0xaa)][_0x587577(0x148)][_0x587577(0xb4)]>0x0||_0x17345f[_0x587577(0xaa)]['knowledgeBases'][_0x587577(0xb4)]>0x0||_0x17345f['counts']['textKnowledgeBases'][_0x587577(0xb4)]>0x0||_0x17345f[_0x587577(0xaa)][_0x587577(0xe6)]['errors']>0x0;if(_0x3d8242){console['log'](a4_0x3397c1[_0x587577(0x137)]('\x0aProject\x20pushed\x20with\x20errors')),console['log'](),console[_0x587577(0xe0)](a4_0x3397c1['red'](_0x587577(0xaf)));for(const _0x2fe4f1 of _0x17345f[_0x587577(0x148)]){_0x2fe4f1[_0x587577(0xdf)]===_0x587577(0x13a)&&console[_0x587577(0xe0)](a4_0x3397c1[_0x587577(0xcf)]('\x20\x20Agent\x20\x22'+_0x2fe4f1[_0x587577(0x12d)]+_0x587577(0xc4)+_0x2fe4f1[_0x587577(0x13a)]));}for(const _0x3d7dc8 of _0x17345f['knowledgeBases']){_0x3d7dc8['action']===_0x587577(0x13a)&&console[_0x587577(0xe0)](a4_0x3397c1[_0x587577(0xcf)](_0x587577(0xb2)+_0x3d7dc8[_0x587577(0x107)]+'\x22:\x20'+_0x3d7dc8['error']));}for(const _0x3fdcfb of _0x17345f[_0x587577(0xf6)]){_0x3fdcfb[_0x587577(0xdf)]==='error'&&console['log'](a4_0x3397c1[_0x587577(0xcf)]('\x20\x20Text\x20Knowledge\x20Base\x20\x22'+_0x3fdcfb[_0x587577(0x107)]+_0x587577(0xc4)+_0x3fdcfb[_0x587577(0x13a)]));}for(const _0x492798 of _0x17345f['prompts']){_0x492798[_0x587577(0xdf)]===_0x587577(0x13a)&&console[_0x587577(0xe0)](a4_0x3397c1[_0x587577(0xcf)](_0x587577(0xe8)+_0x492798[_0x587577(0x107)]+_0x587577(0xc4)+_0x492798[_0x587577(0x13a)]));}for(const _0x55903b of _0x17345f['integrations']){_0x55903b[_0x587577(0xdf)]===_0x587577(0x13a)&&console[_0x587577(0xe0)](a4_0x3397c1[_0x587577(0xcf)](_0x587577(0x11e)+_0x55903b[_0x587577(0x107)]+_0x587577(0xc4)+_0x55903b[_0x587577(0x13a)]));}return 0x1;}console[_0x587577(0xe0)](a4_0x3397c1['green'](_0x587577(0x139)+(_0x499033+_0x57f4c4)+'\x20resources\x20to\x20\x27'+_0x17345f[_0x587577(0x14c)]+'\x27'));const _0x122637=getLLMProjectUrl(_0x30f4ce,_0x17345f[_0x587577(0xa4)]);return console[_0x587577(0xe0)](_0x587577(0xbb)+a4_0x3397c1['cyan'](_0x122637)),0x0;}}
1
+ const a4_0x601200=a4_0x1297;(function(_0x1e4344,_0x41d99a){const _0x446499=a4_0x1297,_0x24ac8b=_0x1e4344();while(!![]){try{const _0x3f33ec=-parseInt(_0x446499(0x105))/0x1+-parseInt(_0x446499(0x108))/0x2*(-parseInt(_0x446499(0x100))/0x3)+-parseInt(_0x446499(0x16b))/0x4*(-parseInt(_0x446499(0xe9))/0x5)+-parseInt(_0x446499(0xe5))/0x6*(parseInt(_0x446499(0x102))/0x7)+parseInt(_0x446499(0x118))/0x8+parseInt(_0x446499(0xd4))/0x9+-parseInt(_0x446499(0xba))/0xa*(parseInt(_0x446499(0x145))/0xb);if(_0x3f33ec===_0x41d99a)break;else _0x24ac8b['push'](_0x24ac8b['shift']());}catch(_0x542d86){_0x24ac8b['push'](_0x24ac8b['shift']());}}}(a4_0x3134,0x1970a));function a4_0x1297(_0x450cb1,_0xbe4519){_0x450cb1=_0x450cb1-0xb0;const _0x313403=a4_0x3134();let _0x129786=_0x313403[_0x450cb1];return _0x129786;}import a4_0x2b303b from'chalk';import a4_0xe8fa2f from'path';function a4_0x3134(){const _0x2987d6=['Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','cloneProject','updated','\x20--name\x20','reason','agentId','Project\x20cloned\x20successfully','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','Dry\x20run\x20-\x20no\x20changes\x20made','pushAgent','pushProject','\x20changed','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','cwd-config','diff','\x20\x20tdx\x20agent\x20pull\x20','\x20\x20Knowledge\x20Base\x20\x22','\x0a✔\x20Pulled\x20','Cancelled','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','Using\x20project\x20from\x20','agent:push','yellow','Pushing\x20to\x20project...','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','\x0aWrite\x20','Using\x20project:\x20','\x20\x20Experimental\x20Artifact\x20\x22','\x20\x20Agent\x20\x22','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','output','Dry\x20run\x20-\x20no\x20files\x20written','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','387937zekdbX','projectDir','\x0aPull\x20summary\x20for\x20\x27','\x20created','Source:\x20','-\x20no\x20files\x20written','\x20|\x20','\x20\x20Knowledge\x20Bases:\x20','context','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','source','Agent\x20','MISSING_ARGUMENT','\x20\x20tdx\x20agent\x20clone\x20agents/','\x0a✔\x20Pushed\x20','\x0aPush\x20','\x22\x20to\x20a\x20different\x20profile','agentName','Cannot\x20clone\x20from\x20context\x20project\x20\x22','session','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','arg-dir','pullAgent','Using\x20project\x20from\x20context:\x20','\x20\x20Prompts:\x20','\x20files?','\x20errors','✔\x20Context\x20set:\x20','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','\x20--profile\x20','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','name','\x22\x20to\x20new\x20project\x20\x22','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','utf-8','\x0aError:','textKnowledgeBases','87908AwBHJG','prompts','integrations','Output\x20path:\x20','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','log','<new-name>','agent','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','Status:\x20','Would\x20pull\x20agent:\x20','30EFgCKM','error','llmProject','tdx.json','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','\x20resources?','Clone\x20\x22','dim','\x20\x20Target:\x20','llm_project','New\x20project\x20name\x20is\x20required','site','\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','green','join','description','isNew','force','\x0aProject\x20pushed\x20with\x20errors','\x0aChanges\x20to\x20integration\x20\x27','created','\x20\x20Agents:\x20','\x20updated','\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','\x22\x20to\x20\x22','unchanged','446670bKfLdO','counts','\x20\x20Text\x20Knowledge\x20Base\x20\x22','Project\x20cloned\x20with\x20errors','agent.yml','No\x20tdx.json\x20found\x20in\x20','\x20resources\x20to\x20\x27','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','no_context','Failed\x20to\x20push\x20agent:\x20','experimentalArtifacts','new','Would\x20clone:','Pulling\x20agent\x20\x22','\x20=\x20','action','\x20\x20Prompt\x20\x22','919902YDUzgh','New\x20project:\x20','repeat','agent:pull','10GkkRrQ','\x20\x20Text\x20Knowledge\x20Bases:\x20','\x20files\x20to\x20','push','projectId','outputPath','dryRun','cwd','\x20new','\x0aChanges:','Agent:\x20','agent:clone','newProjectId','cyan','Project:\x20','knowledgeBases','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','\x20\x20Integrations:\x20','red','\x20\x20Integration\x20\x22','total','llm','12WljkkE','\x20\x20Experimental\x20Artifacts:\x20','7DdtYyU','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','execute','76281ODMcGg','yes','hasChanges','102636vXOjke','New\x20project\x20ID:\x20','agents','-\x20nothing\x20pushed','message','\x20total','gray','Output:\x20','Chat:\x20','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','\x22...','Using\x20local\x20project:\x20','projectName','Errors:','experimentalKnowledgeBases','profile','1125960XcjVVB','\x0aChanges\x20to\x20agent\x20\x27','dirname','errors','parse','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','\x22:\x20','sourceProjectName','Using\x20context\x20project:\x20','outputDir','INVALID_ARGUMENT'];a4_0x3134=function(){return _0x2987d6;};return a4_0x3134();}import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext,resolveAgentPullArgs}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x1b8ade){const _0x18adc7=a4_0x1297,_0x621797=[];if(_0x1b8ade[_0x18adc7(0xfe)]!==undefined)_0x621797[_0x18adc7(0xec)](_0x1b8ade[_0x18adc7(0xfe)]+_0x18adc7(0x10d));if(_0x1b8ade[_0x18adc7(0xdf)]!==undefined&&_0x1b8ade[_0x18adc7(0xdf)]>0x0)_0x621797[_0x18adc7(0xec)](a4_0x2b303b[_0x18adc7(0xc7)](_0x1b8ade[_0x18adc7(0xdf)]+_0x18adc7(0xf1)));if(_0x1b8ade[_0x18adc7(0xce)]!==undefined&&_0x1b8ade[_0x18adc7(0xce)]>0x0)_0x621797[_0x18adc7(0xec)](a4_0x2b303b[_0x18adc7(0xc7)](_0x1b8ade[_0x18adc7(0xce)]+_0x18adc7(0x148)));if(_0x1b8ade[_0x18adc7(0x126)]!==undefined&&_0x1b8ade[_0x18adc7(0x126)]>0x0)_0x621797['push'](a4_0x2b303b['yellow'](_0x1b8ade[_0x18adc7(0x126)]+_0x18adc7(0xd0)));if(_0x1b8ade[_0x18adc7(0xd3)]!==undefined&&_0x1b8ade[_0x18adc7(0xd3)]>0x0)_0x621797[_0x18adc7(0xec)](a4_0x2b303b[_0x18adc7(0x10e)](_0x1b8ade[_0x18adc7(0xd3)]+'\x20unchanged'));if(_0x1b8ade[_0x18adc7(0x11b)]!==undefined&&_0x1b8ade['errors']>0x0)_0x621797[_0x18adc7(0xec)](a4_0x2b303b['red'](_0x1b8ade[_0x18adc7(0x11b)]+_0x18adc7(0x160)));return _0x621797[_0x18adc7(0xc8)](',\x20');}function displayDiffs(_0x3c1701,_0x2bb363,_0x540645,_0x49dcdf,_0x43988e,_0x650d95,_0x4876ea){const _0x50a897=a4_0x1297;for(const _0x538fdf of _0x3c1701){if(_0x538fdf['diff']){const _0x524602=_0x538fdf[_0x50a897(0x156)]||_0x538fdf[_0x50a897(0x165)];console[_0x50a897(0xb4)](_0x50a897(0x119)+_0x524602+'\x27:'),console[_0x50a897(0xb4)]('─'[_0x50a897(0xe7)](0x3c)),console[_0x50a897(0xb4)](_0x538fdf[_0x50a897(0x132)]),console[_0x50a897(0xb4)]('─'[_0x50a897(0xe7)](0x3c));}}for(const _0xaed32f of _0x2bb363){_0xaed32f[_0x50a897(0x132)]&&(console['log']('\x0aChanges\x20to\x20knowledge\x20base\x20\x27'+_0xaed32f[_0x50a897(0x165)]+'\x27:'),console[_0x50a897(0xb4)]('─'[_0x50a897(0xe7)](0x3c)),console[_0x50a897(0xb4)](_0xaed32f['diff']),console['log']('─'[_0x50a897(0xe7)](0x3c)));}for(const _0x3511ed of _0x540645){_0x3511ed[_0x50a897(0x132)]&&(console[_0x50a897(0xb4)](_0x50a897(0x12b)+_0x3511ed[_0x50a897(0x165)]+'\x27:'),console['log']('─'[_0x50a897(0xe7)](0x3c)),console[_0x50a897(0xb4)](_0x3511ed[_0x50a897(0x132)]),console[_0x50a897(0xb4)]('─'['repeat'](0x3c)));}for(const _0x2c9368 of _0x49dcdf){_0x2c9368[_0x50a897(0x132)]&&(console[_0x50a897(0xb4)]('\x0aChanges\x20to\x20prompt\x20\x27'+_0x2c9368[_0x50a897(0x165)]+'\x27:'),console['log']('─'[_0x50a897(0xe7)](0x3c)),console[_0x50a897(0xb4)](_0x2c9368[_0x50a897(0x132)]),console['log']('─'[_0x50a897(0xe7)](0x3c)));}for(const _0x5e228c of _0x43988e){_0x5e228c[_0x50a897(0x132)]&&(console[_0x50a897(0xb4)](_0x50a897(0xcd)+_0x5e228c['name']+'\x27:'),console[_0x50a897(0xb4)]('─'[_0x50a897(0xe7)](0x3c)),console['log'](_0x5e228c['diff']),console[_0x50a897(0xb4)]('─'[_0x50a897(0xe7)](0x3c)));}for(const _0x4f62ec of _0x650d95){_0x4f62ec[_0x50a897(0x132)]&&(console[_0x50a897(0xb4)]('\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27'+_0x4f62ec[_0x50a897(0x165)]+'\x27:'),console[_0x50a897(0xb4)]('─'[_0x50a897(0xe7)](0x3c)),console['log'](_0x4f62ec[_0x50a897(0x132)]),console[_0x50a897(0xb4)]('─'['repeat'](0x3c)));}for(const _0x1ed7bc of _0x4876ea){_0x1ed7bc[_0x50a897(0x132)]&&(console[_0x50a897(0xb4)](_0x50a897(0xdb)+_0x1ed7bc['name']+'\x27:'),console[_0x50a897(0xb4)]('─'[_0x50a897(0xe7)](0x3c)),console[_0x50a897(0xb4)](_0x1ed7bc['diff']),console[_0x50a897(0xb4)]('─'['repeat'](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x601200(0x165)]=a4_0x601200(0xe8);[a4_0x601200(0xc9)]='Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files';async[a4_0x601200(0x104)](_0x5eb65b){const _0x288110=a4_0x601200,{options:_0x107e21,args:_0xc8e6a7,tdx:_0x583683}=_0x5eb65b,_0x3f36eb=_0xc8e6a7[0x0],_0x1d3f2e=_0xc8e6a7[0x1],_0x291846=_0x107e21[_0x288110(0x142)],_0x5631c5=_0x107e21['dryRun'],_0x4356ba=_0x107e21['force'],_0x2e4fca=_0x107e21['yes'],_0x8200d1=_0x107e21[_0x288110(0xbc)],_0x1dbe46=_0x107e21[_0x288110(0xb6)];let _0x28d24b;if(_0x3f36eb){const _0xd9fdd8=a4_0xe8fa2f[_0x288110(0xc8)](_0x3f36eb,_0x288110(0xbd));if(existsSync(_0xd9fdd8))try{const _0x52e15d=JSON[_0x288110(0x11c)](readFileSync(_0xd9fdd8,_0x288110(0x168)));_0x52e15d['llm_project']&&(_0x28d24b={'llm_project':_0x52e15d['llm_project']});}catch{}}const _0x143467=findAgentConfigPath(process[_0x288110(0xf0)]());let _0x22ec9c;if(_0x143467)try{const _0xca9784=JSON[_0x288110(0x11c)](readFileSync(_0x143467,_0x288110(0x168)));_0xca9784[_0x288110(0xc3)]&&(_0x22ec9c={'llm_project':_0xca9784[_0x288110(0xc3)]});}catch{}const _0x382d19=resolveAgentPullArgs({'arg':_0x3f36eb,'agentNameArg':_0x1d3f2e,'agentFlag':_0x1dbe46,'contextProject':_0x8200d1,'argDirConfig':_0x28d24b,'cwdConfigPath':_0x143467||undefined,'cwdConfig':_0x22ec9c}),{projectNameOrId:_0x361870,targetAgentName:_0x2dc2b4,existingOutputDir:_0x179572,source:_0x38af30}=_0x382d19;if(_0x38af30===_0x288110(0x15b))console['log'](a4_0x2b303b['dim'](_0x288110(0x138)+a4_0xe8fa2f[_0x288110(0xc8)](_0x3f36eb,_0x288110(0xbd))+':\x20'+_0x361870));else{if(_0x38af30===_0x288110(0x131))console[_0x288110(0xb4)](a4_0x2b303b[_0x288110(0xc1)](_0x288110(0x13e)+_0x361870));else _0x38af30===_0x288110(0x14d)&&console['log'](a4_0x2b303b[_0x288110(0xc1)](_0x288110(0x15d)+_0x361870));}if(!_0x361870)return _0x1dbe46?(console[_0x288110(0xb4)](a4_0x2b303b[_0x288110(0x13a)](_0x288110(0x159))),console[_0x288110(0xb4)]('Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>'),console[_0x288110(0xb4)](_0x288110(0x11d))):(console[_0x288110(0xb4)](a4_0x2b303b[_0x288110(0x13a)](_0x288110(0x111))),console['log']('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[_0x288110(0xb4)](_0x288110(0xc6)),console[_0x288110(0xb4)](_0x288110(0xd1)),console[_0x288110(0xb4)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20--agent\x20<name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20context\x20project'),console['log']('\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(_0x2dc2b4){const {data:_0x5f46c4}=await withSpinner(_0x288110(0xe1)+_0x2dc2b4+'\x22\x20from\x20project\x20\x22'+_0x361870+_0x288110(0x112),()=>_0x583683['llm'][_0x288110(0x15c)](_0x361870,_0x2dc2b4,_0x291846,{'dryRun':_0x5631c5,'force':_0x4356ba}));if(_0x5631c5)return console['log'](a4_0x2b303b[_0x288110(0x13a)](_0x288110(0x143))),console[_0x288110(0xb4)](_0x288110(0xb9)+_0x5f46c4[_0x288110(0x156)]),console[_0x288110(0xb4)](_0x288110(0xb2)+_0x5f46c4[_0x288110(0xee)]),_0x5f46c4[_0x288110(0x132)]&&(console[_0x288110(0xb4)](_0x288110(0xf2)),console[_0x288110(0xb4)]('─'[_0x288110(0xe7)](0x3c)),console[_0x288110(0xb4)](_0x5f46c4['diff']),console[_0x288110(0xb4)]('─'[_0x288110(0xe7)](0x3c))),0x0;return console[_0x288110(0xb4)](a4_0x2b303b[_0x288110(0xc7)]('Agent\x20pulled\x20successfully')),console[_0x288110(0xb4)](_0x288110(0xf3)+_0x5f46c4[_0x288110(0x156)]),console['log'](_0x288110(0x10f)+_0x5f46c4[_0x288110(0xee)]),console[_0x288110(0xb4)](_0x288110(0xb8)+(_0x5f46c4[_0x288110(0xca)]?a4_0x2b303b[_0x288110(0xc7)](_0x288110(0xdf)):_0x5f46c4[_0x288110(0x107)]?a4_0x2b303b['yellow'](_0x288110(0x126)):a4_0x2b303b['gray'](_0x288110(0xd3)))),0x0;}const _0x2fee21=_0x179572||_0x291846,{data:_0x302a34}=await withSpinner('Analyzing\x20project\x20\x22'+_0x361870+_0x288110(0x112),()=>_0x583683['llm']['pullProject'](_0x361870,_0x2fee21,{'dryRun':!![]})),_0x1e9983=_0x302a34[_0x288110(0xd5)][_0x288110(0x10a)][_0x288110(0xdf)]+_0x302a34[_0x288110(0xd5)]['knowledgeBases'][_0x288110(0xdf)]+_0x302a34['counts'][_0x288110(0x16a)][_0x288110(0xdf)]+_0x302a34[_0x288110(0xd5)][_0x288110(0xb0)]['new']+_0x302a34[_0x288110(0xd5)]['integrations'][_0x288110(0xdf)]+_0x302a34[_0x288110(0xd5)][_0x288110(0x116)][_0x288110(0xdf)]+_0x302a34[_0x288110(0xd5)][_0x288110(0xde)]['new'],_0x5c4e1d=_0x302a34['counts'][_0x288110(0x10a)][_0x288110(0x126)]+_0x302a34[_0x288110(0xd5)][_0x288110(0xf8)][_0x288110(0x126)]+_0x302a34[_0x288110(0xd5)][_0x288110(0x16a)]['updated']+_0x302a34['counts']['prompts'][_0x288110(0x126)]+_0x302a34['counts'][_0x288110(0xb1)][_0x288110(0x126)]+_0x302a34[_0x288110(0xd5)]['experimentalKnowledgeBases']['updated']+_0x302a34['counts'][_0x288110(0xde)][_0x288110(0x126)],_0x1319e6=_0x302a34[_0x288110(0xd5)][_0x288110(0x10a)][_0x288110(0xd3)]+_0x302a34[_0x288110(0xd5)][_0x288110(0xf8)][_0x288110(0xd3)]+_0x302a34[_0x288110(0xd5)][_0x288110(0x16a)]['unchanged']+_0x302a34['counts'][_0x288110(0xb0)][_0x288110(0xd3)]+_0x302a34[_0x288110(0xd5)]['integrations'][_0x288110(0xd3)]+_0x302a34['counts'][_0x288110(0x116)]['unchanged']+_0x302a34[_0x288110(0xd5)][_0x288110(0xde)]['unchanged'];console[_0x288110(0xb4)](_0x288110(0x147)+_0x302a34[_0x288110(0x114)]+'\x27:'),console[_0x288110(0xb4)]('\x20\x20'+a4_0x2b303b[_0x288110(0xc7)]('+\x20'+_0x1e9983+'\x20new')+_0x288110(0x14b)+a4_0x2b303b[_0x288110(0x13a)]('~\x20'+_0x5c4e1d+_0x288110(0x12f))+_0x288110(0x14b)+a4_0x2b303b[_0x288110(0xc1)]('=\x20'+_0x1319e6+'\x20unchanged')),console['log'](_0x288110(0xcf)+formatCountSummary(_0x302a34[_0x288110(0xd5)]['agents'])),console[_0x288110(0xb4)](_0x288110(0x14c)+formatCountSummary(_0x302a34[_0x288110(0xd5)][_0x288110(0xf8)])),console[_0x288110(0xb4)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x302a34[_0x288110(0xd5)][_0x288110(0x16a)])),console[_0x288110(0xb4)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x302a34[_0x288110(0xd5)][_0x288110(0xb0)])),console[_0x288110(0xb4)](_0x288110(0xfb)+formatCountSummary(_0x302a34[_0x288110(0xd5)][_0x288110(0xb1)]));const _0x23bf14=_0x302a34[_0x288110(0xd5)]['experimentalKnowledgeBases'][_0x288110(0xfe)]>0x0||_0x302a34[_0x288110(0xd5)][_0x288110(0xde)]['total']>0x0;_0x23bf14&&(console['log']('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x302a34[_0x288110(0xd5)][_0x288110(0x116)])),console['log'](_0x288110(0x101)+formatCountSummary(_0x302a34['counts']['experimentalArtifacts'])));console[_0x288110(0xb4)](_0x288110(0xc2)+a4_0x2b303b[_0x288110(0xf6)](_0x302a34[_0x288110(0x121)])),displayDiffs(_0x302a34[_0x288110(0x10a)],_0x302a34['knowledgeBases'],_0x302a34[_0x288110(0x16a)],_0x302a34['prompts'],_0x302a34['integrations'],_0x302a34[_0x288110(0x116)],_0x302a34[_0x288110(0xde)]);if(_0x5631c5)return console[_0x288110(0xb4)](a4_0x2b303b['yellow'](_0x288110(0x162))),0x0;if(_0x1e9983===0x0&&_0x5c4e1d===0x0)return console[_0x288110(0xb4)](a4_0x2b303b[_0x288110(0xc7)](_0x288110(0xbe))),saveSessionContext({'llm_project':_0x302a34[_0x288110(0x114)]},_0x107e21[_0x288110(0x158)]),console['log'](a4_0x2b303b[_0x288110(0xc7)](_0x288110(0x161)+a4_0x2b303b[_0x288110(0xc1)]('llm_project')+_0x288110(0xe2)+a4_0x2b303b[_0x288110(0xf6)](_0x302a34[_0x288110(0x114)]))),0x0;if(!_0x2e4fca&&!_0x4356ba){if(!isInteractive())return console[_0x288110(0xbb)](a4_0x2b303b[_0x288110(0xfc)](_0x288110(0x169)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x288110(0xbb)](a4_0x2b303b[_0x288110(0xc1)](_0x288110(0x14e))),0x1;const _0x372669=await confirmKey(_0x288110(0x13d)+(_0x1e9983+_0x5c4e1d)+_0x288110(0x15f));if(!_0x372669)return console[_0x288110(0xb4)](a4_0x2b303b[_0x288110(0x13a)](_0x288110(0x136)),_0x288110(0x14a)),0x1;}const {data:_0x3ca051}=await withSpinner('Writing\x20files...',()=>_0x583683[_0x288110(0xff)]['pullProject'](_0x361870,_0x2fee21,{'force':_0x4356ba}));return console[_0x288110(0xb4)](a4_0x2b303b[_0x288110(0xc7)](_0x288110(0x135)+(_0x1e9983+_0x5c4e1d)+_0x288110(0xeb)+_0x3ca051[_0x288110(0x121)])),saveSessionContext({'llm_project':_0x3ca051[_0x288110(0x114)]},_0x107e21[_0x288110(0x158)]),console[_0x288110(0xb4)](a4_0x2b303b[_0x288110(0xc7)]('✔\x20Context\x20set:\x20'+a4_0x2b303b[_0x288110(0xc1)]('llm_project')+_0x288110(0xe2)+a4_0x2b303b['cyan'](_0x3ca051[_0x288110(0x114)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x601200(0x165)]=a4_0x601200(0xf4);[a4_0x601200(0xc9)]=a4_0x601200(0xb7);async[a4_0x601200(0x104)](_0x327271){const _0x752529=a4_0x601200,{options:_0x47afcd,args:_0x1518aa,tdx:_0x103842}=_0x327271,_0x3c2f41=_0x1518aa[0x0],_0x54abcb=_0x47afcd[_0x752529(0x165)],_0x37cf96=_0x47afcd['dryRun'],_0x4f4f50=_0x47afcd[_0x752529(0x106)],_0x13c5b6=_0x47afcd[_0x752529(0xc5)],_0xf84414=_0x47afcd[_0x752529(0xbc)];let _0x4f15ba;const _0x542d57=findAgentConfigPath(process[_0x752529(0xf0)]());if(_0x3c2f41){const _0x3eec7e=a4_0xe8fa2f[_0x752529(0xc8)](_0x3c2f41,'tdx.json');existsSync(_0x3eec7e)?(_0x4f15ba=_0x3c2f41,console[_0x752529(0xb4)](a4_0x2b303b[_0x752529(0xc1)](_0x752529(0x113)+_0x3c2f41))):_0x4f15ba=_0x3c2f41;}else{if(_0x542d57)_0x4f15ba=a4_0xe8fa2f[_0x752529(0x11a)](_0x542d57),console[_0x752529(0xb4)](a4_0x2b303b[_0x752529(0xc1)]('Using\x20current\x20project:\x20'+_0x4f15ba));else{if(_0xf84414){const _0x1b76a3=sanitizeForFilesystem(_0xf84414);let _0x14eb81=_0x1b76a3,_0x298628=a4_0xe8fa2f['join'](process[_0x752529(0xf0)](),_0x752529(0x10a),_0x1b76a3,'tdx.json');if(!existsSync(_0x298628)){const _0x229c9e=normalizeName(_0xf84414),_0x5b00b6=a4_0xe8fa2f['join'](process[_0x752529(0xf0)](),_0x752529(0x10a),_0x229c9e,'tdx.json');existsSync(_0x5b00b6)&&(_0x14eb81=_0x229c9e,_0x298628=_0x5b00b6);}if(existsSync(_0x298628))_0x4f15ba=a4_0xe8fa2f['dirname'](_0x298628),console[_0x752529(0xb4)](a4_0x2b303b[_0x752529(0xc1)](_0x752529(0x113)+_0x4f15ba));else{const _0xc76242=_0x47afcd[_0x752529(0x117)];if(_0xc76242)throw new SDKError(ErrorCode[_0x752529(0x122)],_0x752529(0x157)+_0xf84414+_0x752529(0x155),undefined,{'helpText':_0x752529(0x130)+_0x752529(0xb3)+(_0x752529(0x133)+_0xf84414+'\x0a')+(_0x752529(0x152)+_0x14eb81+_0x752529(0x127)+(_0x54abcb||_0x752529(0xb5))+_0x752529(0x163)+_0xc76242)});_0x4f15ba=_0xf84414,console[_0x752529(0xb4)](a4_0x2b303b[_0x752529(0xc1)](_0x752529(0x120)+_0xf84414));}}}}if(!_0x4f15ba)return console[_0x752529(0xb4)](a4_0x2b303b[_0x752529(0x13a)](_0x752529(0x103))),console['log'](_0x752529(0x137)),console['log'](_0x752529(0x167)),console[_0x752529(0xb4)]('\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['log'](_0x752529(0x15a)),0x1;if(!_0x54abcb)throw new SDKError(ErrorCode[_0x752529(0x151)],_0x752529(0xc4),undefined,{'helpText':_0x752529(0x123)});if(!_0x4f4f50&&!_0x37cf96){if(!isInteractive())return console[_0x752529(0xbb)](a4_0x2b303b['red'](_0x752529(0x169)),_0x752529(0x144)),console['error'](a4_0x2b303b[_0x752529(0xc1)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x1dea9a=await confirmKey(_0x752529(0xc0)+_0x4f15ba+_0x752529(0x166)+_0x54abcb+'\x22?');if(!_0x1dea9a)return console[_0x752529(0xb4)](a4_0x2b303b['yellow'](_0x752529(0x136))),0x1;}const {data:_0x51e613}=await withSpinner('Cloning\x20\x22'+_0x4f15ba+_0x752529(0xd2)+_0x54abcb+_0x752529(0x112),()=>_0x103842[_0x752529(0xff)][_0x752529(0x125)](_0x4f15ba,_0x54abcb,{'dryRun':_0x37cf96}));if(_0x37cf96){console[_0x752529(0xb4)](a4_0x2b303b[_0x752529(0x13a)](_0x752529(0x12c))),console['log']('Source:\x20'+_0x51e613[_0x752529(0x11f)]),console[_0x752529(0xb4)](_0x752529(0xe6)+_0x54abcb),console['log'](_0x752529(0xe0)),console[_0x752529(0xb4)](_0x752529(0xcf)+_0x51e613[_0x752529(0xd5)][_0x752529(0x10a)][_0x752529(0xce)]),console['log'](_0x752529(0x14c)+_0x51e613[_0x752529(0xd5)][_0x752529(0xf8)][_0x752529(0xce)]),console[_0x752529(0xb4)]('\x20\x20Prompts:\x20'+_0x51e613[_0x752529(0xd5)][_0x752529(0xb0)][_0x752529(0xce)]);const _0x40e690=_0x51e613[_0x752529(0xd5)][_0x752529(0x116)]['created']>0x0||_0x51e613[_0x752529(0xd5)][_0x752529(0xde)]['created']>0x0;return _0x40e690&&(console[_0x752529(0xb4)](_0x752529(0xf9)+_0x51e613['counts'][_0x752529(0x116)][_0x752529(0xce)]),console['log'](_0x752529(0x101)+_0x51e613['counts'][_0x752529(0xde)][_0x752529(0xce)])),0x0;}const _0x24b165=_0x51e613[_0x752529(0xd5)][_0x752529(0x10a)][_0x752529(0x11b)]>0x0||_0x51e613[_0x752529(0xd5)][_0x752529(0xf8)][_0x752529(0x11b)]>0x0||_0x51e613['counts'][_0x752529(0xb0)][_0x752529(0x11b)]>0x0||_0x51e613[_0x752529(0xd5)][_0x752529(0x116)]['errors']>0x0||_0x51e613[_0x752529(0xd5)][_0x752529(0xde)]['errors']>0x0;_0x24b165?console[_0x752529(0xb4)](a4_0x2b303b['yellow'](_0x752529(0xd7))):console[_0x752529(0xb4)](a4_0x2b303b[_0x752529(0xc7)](_0x752529(0x12a)));console['log'](_0x752529(0x149)+_0x51e613[_0x752529(0x11f)]),console[_0x752529(0xb4)](_0x752529(0xe6)+_0x51e613['newProjectName']),console[_0x752529(0xb4)](_0x752529(0x109)+_0x51e613['newProjectId']),console[_0x752529(0xb4)](),console['log']('Summary:'),console['log']('\x20\x20Agents:\x20'+formatCountSummary(_0x51e613[_0x752529(0xd5)][_0x752529(0x10a)])),console[_0x752529(0xb4)](_0x752529(0x14c)+formatCountSummary(_0x51e613[_0x752529(0xd5)][_0x752529(0xf8)])),console[_0x752529(0xb4)](_0x752529(0x15e)+formatCountSummary(_0x51e613[_0x752529(0xd5)][_0x752529(0xb0)])),console['log'](_0x752529(0xfb)+formatCountSummary(_0x51e613[_0x752529(0xd5)]['integrations']));const _0x127b3f=_0x51e613['counts']['experimentalKnowledgeBases'][_0x752529(0xce)]>0x0||_0x51e613['counts']['experimentalKnowledgeBases'][_0x752529(0x126)]>0x0||_0x51e613[_0x752529(0xd5)][_0x752529(0x116)]['unchanged']>0x0||_0x51e613[_0x752529(0xd5)][_0x752529(0xde)][_0x752529(0xce)]>0x0||_0x51e613[_0x752529(0xd5)]['experimentalArtifacts'][_0x752529(0x126)]>0x0||_0x51e613[_0x752529(0xd5)][_0x752529(0xde)][_0x752529(0xd3)]>0x0;_0x127b3f&&(console[_0x752529(0xb4)](_0x752529(0xf9)+formatCountSummary(_0x51e613['counts'][_0x752529(0x116)])),console[_0x752529(0xb4)](_0x752529(0x101)+formatCountSummary(_0x51e613[_0x752529(0xd5)]['experimentalArtifacts'])));if(_0x24b165){console[_0x752529(0xb4)](),console[_0x752529(0xb4)](a4_0x2b303b['red'](_0x752529(0x115)));for(const _0x43f9d7 of _0x51e613[_0x752529(0x10a)]){_0x43f9d7[_0x752529(0xe3)]===_0x752529(0xbb)&&console[_0x752529(0xb4)](a4_0x2b303b[_0x752529(0xfc)](_0x752529(0x140)+_0x43f9d7[_0x752529(0x156)]+_0x752529(0x11e)+_0x43f9d7[_0x752529(0xbb)]));}for(const _0x3b7cb8 of _0x51e613['knowledgeBases']){_0x3b7cb8['action']==='error'&&console[_0x752529(0xb4)](a4_0x2b303b[_0x752529(0xfc)]('\x20\x20Knowledge\x20Base\x20\x22'+_0x3b7cb8['name']+_0x752529(0x11e)+_0x3b7cb8[_0x752529(0xbb)]));}for(const _0x5887d5 of _0x51e613[_0x752529(0xb0)]){_0x5887d5['action']==='error'&&console['log'](a4_0x2b303b[_0x752529(0xfc)]('\x20\x20Prompt\x20\x22'+_0x5887d5[_0x752529(0x165)]+_0x752529(0x11e)+_0x5887d5['error']));}for(const _0x7a1e91 of _0x51e613[_0x752529(0xb1)]){_0x7a1e91['action']===_0x752529(0xbb)&&console[_0x752529(0xb4)](a4_0x2b303b[_0x752529(0xfc)](_0x752529(0xfd)+_0x7a1e91[_0x752529(0x165)]+_0x752529(0x11e)+_0x7a1e91[_0x752529(0xbb)]));}for(const _0x3f6ecc of _0x51e613[_0x752529(0x116)]){_0x3f6ecc[_0x752529(0xe3)]===_0x752529(0xbb)&&console[_0x752529(0xb4)](a4_0x2b303b[_0x752529(0xfc)](_0x752529(0xfa)+_0x3f6ecc[_0x752529(0x165)]+_0x752529(0x11e)+_0x3f6ecc['error']));}for(const _0x4233a1 of _0x51e613[_0x752529(0xde)]){_0x4233a1[_0x752529(0xe3)]===_0x752529(0xbb)&&console[_0x752529(0xb4)](a4_0x2b303b[_0x752529(0xfc)](_0x752529(0x13f)+_0x4233a1[_0x752529(0x165)]+_0x752529(0x11e)+_0x4233a1['error']));}return 0x1;}console[_0x752529(0xb4)]();const _0xcf5265=getLLMProjectUrl(_0x13c5b6,_0x51e613[_0x752529(0xf5)]);return console[_0x752529(0xb4)](_0x752529(0xf7)+a4_0x2b303b[_0x752529(0xf6)](_0xcf5265)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x601200(0x165)]=a4_0x601200(0x139);[a4_0x601200(0xc9)]=a4_0x601200(0x164);async[a4_0x601200(0x104)](_0x18c00f){const _0x395f8e=a4_0x601200,{options:_0x2be765,args:_0xafe6ca,tdx:_0x3216d8}=_0x18c00f;let _0x19bcee=_0xafe6ca[0x0]||process[_0x395f8e(0xf0)]();const _0x2baf17=_0x2be765[_0x395f8e(0xef)],_0x1e38fe=_0x2be765[_0x395f8e(0xcb)],_0x2b6dc2=_0x2be765[_0x395f8e(0x106)],_0x391e49=_0x2be765[_0x395f8e(0xc5)],_0x10c0c5=a4_0xe8fa2f['join'](_0x19bcee,_0x395f8e(0xd8)),_0x34b3a5=existsSync(_0x10c0c5);if(_0x34b3a5){const {data:_0x1308be}=await withSpinner('Pushing\x20agent\x20from\x20\x22'+_0x19bcee+_0x395f8e(0x112),()=>_0x3216d8[_0x395f8e(0xff)][_0x395f8e(0x12d)](_0x19bcee,{'dryRun':_0x2baf17,'force':_0x1e38fe}));if(_0x2baf17)return console['log'](a4_0x2b303b['yellow'](_0x395f8e(0x12c))),console[_0x395f8e(0xb4)]('Would\x20push\x20agent:\x20'+_0x1308be[_0x395f8e(0x156)]),0x0;if(_0x1308be[_0x395f8e(0xe3)]===_0x395f8e(0xbb))return console[_0x395f8e(0xb4)](a4_0x2b303b['red'](_0x395f8e(0xdd)+_0x1308be['error'])),0x1;console[_0x395f8e(0xb4)](a4_0x2b303b[_0x395f8e(0xc7)](_0x395f8e(0x150)+_0x1308be[_0x395f8e(0xe3)]+'\x20successfully')),console[_0x395f8e(0xb4)]('Agent:\x20'+_0x1308be[_0x395f8e(0x156)]);if(_0x1308be[_0x395f8e(0x129)]&&_0x1308be[_0x395f8e(0xed)]){const _0x5efd28=getLLMAgentChatUrl(_0x391e49,_0x1308be[_0x395f8e(0xed)],_0x1308be[_0x395f8e(0x129)]);console[_0x395f8e(0xb4)](_0x395f8e(0x110)+a4_0x2b303b[_0x395f8e(0xf6)](_0x5efd28));}return 0x0;}const _0x1153f4=_0x2be765[_0x395f8e(0xbc)],_0x3b7cc=resolveProjectFromContext(_0x19bcee,_0x1153f4);if(_0x3b7cc['found'])_0x19bcee=_0x3b7cc[_0x395f8e(0x146)],_0x3b7cc[_0x395f8e(0x14f)]===_0x395f8e(0x14d)&&console[_0x395f8e(0xb4)](a4_0x2b303b[_0x395f8e(0xc1)](_0x395f8e(0x13e)+_0x19bcee));else{let _0x425a81=_0x395f8e(0x13c);_0x3b7cc['reason']==='no_local_folder'&&(_0x425a81=_0x3b7cc[_0x395f8e(0x10c)]+_0x395f8e(0x124)+_0x3b7cc[_0x395f8e(0xbc)]+'\x27\x20to\x20create\x20the\x20folder\x20structure.');throw new SDKError(ErrorCode[_0x395f8e(0x122)],_0x3b7cc[_0x395f8e(0x128)]===_0x395f8e(0xdc)?_0x3b7cc[_0x395f8e(0x10c)]:_0x395f8e(0xd9)+_0x19bcee,undefined,{'helpText':_0x425a81});}const {data:_0x9bd05f}=await withSpinner('Analyzing\x20changes\x20to\x20push...',()=>_0x3216d8[_0x395f8e(0xff)][_0x395f8e(0x12e)](_0x19bcee,{'dryRun':!![]})),_0x3196aa=_0x9bd05f[_0x395f8e(0xd5)][_0x395f8e(0x10a)]['errors']>0x0;if(_0x3196aa){console[_0x395f8e(0xb4)](a4_0x2b303b[_0x395f8e(0xfc)]('\x0aErrors\x20found:'));for(const _0x4ef963 of _0x9bd05f[_0x395f8e(0x10a)]){_0x4ef963[_0x395f8e(0xe3)]===_0x395f8e(0xbb)&&console[_0x395f8e(0xb4)](a4_0x2b303b[_0x395f8e(0xfc)](_0x395f8e(0x140)+_0x4ef963[_0x395f8e(0x156)]+_0x395f8e(0x11e)+_0x4ef963[_0x395f8e(0xbb)]));}return 0x1;}const _0x4f8897=_0x9bd05f['counts'][_0x395f8e(0x10a)]['created']+_0x9bd05f[_0x395f8e(0xd5)][_0x395f8e(0xf8)][_0x395f8e(0xce)]+_0x9bd05f[_0x395f8e(0xd5)][_0x395f8e(0x16a)][_0x395f8e(0xce)]+_0x9bd05f[_0x395f8e(0xd5)]['prompts'][_0x395f8e(0xce)]+_0x9bd05f[_0x395f8e(0xd5)][_0x395f8e(0xb1)][_0x395f8e(0xce)]+_0x9bd05f[_0x395f8e(0xd5)][_0x395f8e(0x116)][_0x395f8e(0xce)]+_0x9bd05f[_0x395f8e(0xd5)]['experimentalArtifacts'][_0x395f8e(0xce)],_0x154138=_0x9bd05f[_0x395f8e(0xd5)]['agents'][_0x395f8e(0x126)]+_0x9bd05f['counts'][_0x395f8e(0xf8)][_0x395f8e(0x126)]+_0x9bd05f[_0x395f8e(0xd5)][_0x395f8e(0x16a)][_0x395f8e(0x126)]+_0x9bd05f[_0x395f8e(0xd5)]['prompts'][_0x395f8e(0x126)]+_0x9bd05f[_0x395f8e(0xd5)][_0x395f8e(0xb1)][_0x395f8e(0x126)]+_0x9bd05f[_0x395f8e(0xd5)]['experimentalKnowledgeBases'][_0x395f8e(0x126)]+_0x9bd05f[_0x395f8e(0xd5)][_0x395f8e(0xde)][_0x395f8e(0x126)],_0x17c47f=_0x9bd05f[_0x395f8e(0xd5)]['agents']['unchanged']+_0x9bd05f['counts'][_0x395f8e(0xf8)][_0x395f8e(0xd3)]+_0x9bd05f['counts'][_0x395f8e(0x16a)]['unchanged']+_0x9bd05f[_0x395f8e(0xd5)][_0x395f8e(0xb0)][_0x395f8e(0xd3)]+_0x9bd05f[_0x395f8e(0xd5)]['integrations']['unchanged']+_0x9bd05f[_0x395f8e(0xd5)][_0x395f8e(0x116)][_0x395f8e(0xd3)]+_0x9bd05f['counts'][_0x395f8e(0xde)][_0x395f8e(0xd3)];console[_0x395f8e(0xb4)]('\x0aPush\x20summary\x20for\x20\x27'+_0x9bd05f[_0x395f8e(0x114)]+'\x27:'),console['log']('\x20\x20'+a4_0x2b303b[_0x395f8e(0xc7)]('+\x20'+_0x4f8897+'\x20new')+_0x395f8e(0x14b)+a4_0x2b303b['yellow']('~\x20'+_0x154138+_0x395f8e(0x12f))+_0x395f8e(0x14b)+a4_0x2b303b[_0x395f8e(0xc1)]('=\x20'+_0x17c47f+'\x20unchanged')),console[_0x395f8e(0xb4)](_0x395f8e(0xcf)+formatCountSummary(_0x9bd05f['counts'][_0x395f8e(0x10a)])),console['log'](_0x395f8e(0x14c)+formatCountSummary(_0x9bd05f[_0x395f8e(0xd5)]['knowledgeBases'])),console[_0x395f8e(0xb4)](_0x395f8e(0xea)+formatCountSummary(_0x9bd05f[_0x395f8e(0xd5)][_0x395f8e(0x16a)])),console[_0x395f8e(0xb4)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x9bd05f['counts']['prompts'])),console['log'](_0x395f8e(0xfb)+formatCountSummary(_0x9bd05f[_0x395f8e(0xd5)][_0x395f8e(0xb1)]));const _0x2716f5=_0x9bd05f[_0x395f8e(0xd5)][_0x395f8e(0x116)][_0x395f8e(0xce)]>0x0||_0x9bd05f[_0x395f8e(0xd5)][_0x395f8e(0x116)]['updated']>0x0||_0x9bd05f[_0x395f8e(0xd5)][_0x395f8e(0x116)][_0x395f8e(0xd3)]>0x0||_0x9bd05f[_0x395f8e(0xd5)][_0x395f8e(0xde)][_0x395f8e(0xce)]>0x0||_0x9bd05f[_0x395f8e(0xd5)][_0x395f8e(0xde)][_0x395f8e(0x126)]>0x0||_0x9bd05f[_0x395f8e(0xd5)]['experimentalArtifacts']['unchanged']>0x0;_0x2716f5&&(console[_0x395f8e(0xb4)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x9bd05f[_0x395f8e(0xd5)][_0x395f8e(0x116)])),console[_0x395f8e(0xb4)](_0x395f8e(0x101)+formatCountSummary(_0x9bd05f[_0x395f8e(0xd5)][_0x395f8e(0xde)])));console['log']('\x20\x20Source:\x20'+a4_0x2b303b[_0x395f8e(0xf6)](_0x19bcee)),displayDiffs(_0x9bd05f[_0x395f8e(0x10a)],_0x9bd05f[_0x395f8e(0xf8)],_0x9bd05f['textKnowledgeBases'],_0x9bd05f[_0x395f8e(0xb0)],_0x9bd05f[_0x395f8e(0xb1)],_0x9bd05f[_0x395f8e(0x116)],_0x9bd05f[_0x395f8e(0xde)]);if(_0x2baf17)return console['log'](a4_0x2b303b['yellow'](_0x395f8e(0x141))),0x0;if(_0x4f8897===0x0&&_0x154138===0x0){console[_0x395f8e(0xb4)](a4_0x2b303b[_0x395f8e(0xc7)]('\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date'));const _0x3636a3=getLLMProjectUrl(_0x391e49,_0x9bd05f['projectId']);return console[_0x395f8e(0xb4)](_0x395f8e(0xf7)+a4_0x2b303b['cyan'](_0x3636a3)),0x0;}if(!_0x2b6dc2&&!_0x1e38fe){if(!isInteractive())return console[_0x395f8e(0xbb)](a4_0x2b303b[_0x395f8e(0xfc)](_0x395f8e(0x169)),_0x395f8e(0x144)),console[_0x395f8e(0xbb)](a4_0x2b303b[_0x395f8e(0xc1)](_0x395f8e(0x14e))),0x1;const _0x43ef74=await confirmKey(_0x395f8e(0x154)+(_0x4f8897+_0x154138)+_0x395f8e(0xbf));if(!_0x43ef74)return console[_0x395f8e(0xb4)](a4_0x2b303b['yellow'](_0x395f8e(0x136)),_0x395f8e(0x10b)),0x1;}const {data:_0x55c45b}=await withSpinner(_0x395f8e(0x13b),()=>_0x3216d8[_0x395f8e(0xff)][_0x395f8e(0x12e)](_0x19bcee,{'force':_0x1e38fe})),_0x253f24=_0x55c45b[_0x395f8e(0xd5)]['agents'][_0x395f8e(0x11b)]>0x0||_0x55c45b['counts'][_0x395f8e(0xf8)]['errors']>0x0||_0x55c45b[_0x395f8e(0xd5)][_0x395f8e(0x16a)][_0x395f8e(0x11b)]>0x0||_0x55c45b[_0x395f8e(0xd5)][_0x395f8e(0xb0)][_0x395f8e(0x11b)]>0x0;if(_0x253f24){console[_0x395f8e(0xb4)](a4_0x2b303b[_0x395f8e(0x13a)](_0x395f8e(0xcc))),console[_0x395f8e(0xb4)](),console[_0x395f8e(0xb4)](a4_0x2b303b[_0x395f8e(0xfc)](_0x395f8e(0x115)));for(const _0x2d218b of _0x55c45b[_0x395f8e(0x10a)]){_0x2d218b[_0x395f8e(0xe3)]==='error'&&console['log'](a4_0x2b303b[_0x395f8e(0xfc)](_0x395f8e(0x140)+_0x2d218b['agentName']+_0x395f8e(0x11e)+_0x2d218b[_0x395f8e(0xbb)]));}for(const _0x3da534 of _0x55c45b[_0x395f8e(0xf8)]){_0x3da534[_0x395f8e(0xe3)]===_0x395f8e(0xbb)&&console[_0x395f8e(0xb4)](a4_0x2b303b[_0x395f8e(0xfc)](_0x395f8e(0x134)+_0x3da534['name']+_0x395f8e(0x11e)+_0x3da534[_0x395f8e(0xbb)]));}for(const _0x2783a2 of _0x55c45b[_0x395f8e(0x16a)]){_0x2783a2[_0x395f8e(0xe3)]===_0x395f8e(0xbb)&&console[_0x395f8e(0xb4)](a4_0x2b303b[_0x395f8e(0xfc)](_0x395f8e(0xd6)+_0x2783a2[_0x395f8e(0x165)]+_0x395f8e(0x11e)+_0x2783a2[_0x395f8e(0xbb)]));}for(const _0xf9e442 of _0x55c45b[_0x395f8e(0xb0)]){_0xf9e442['action']==='error'&&console['log'](a4_0x2b303b[_0x395f8e(0xfc)](_0x395f8e(0xe4)+_0xf9e442[_0x395f8e(0x165)]+'\x22:\x20'+_0xf9e442[_0x395f8e(0xbb)]));}for(const _0x2cf2c3 of _0x55c45b['integrations']){_0x2cf2c3[_0x395f8e(0xe3)]===_0x395f8e(0xbb)&&console[_0x395f8e(0xb4)](a4_0x2b303b[_0x395f8e(0xfc)](_0x395f8e(0xfd)+_0x2cf2c3['name']+_0x395f8e(0x11e)+_0x2cf2c3[_0x395f8e(0xbb)]));}return 0x1;}console[_0x395f8e(0xb4)](a4_0x2b303b[_0x395f8e(0xc7)](_0x395f8e(0x153)+(_0x4f8897+_0x154138)+_0x395f8e(0xda)+_0x55c45b[_0x395f8e(0x114)]+'\x27'));const _0x408d50=getLLMProjectUrl(_0x391e49,_0x55c45b[_0x395f8e(0xed)]);return console['log'](_0x395f8e(0xf7)+a4_0x2b303b[_0x395f8e(0xf6)](_0x408d50)),0x0;}}
@@ -1 +1 @@
1
- function a5_0x202f(_0x212be9,_0x457099){_0x212be9=_0x212be9-0x12e;const _0x5d095b=a5_0x5d09();let _0x202fab=_0x5d095b[_0x212be9];return _0x202fab;}const a5_0xdd547f=a5_0x202f;(function(_0x4f8332,_0x4475fa){const _0x203bb3=a5_0x202f,_0x54dcc2=_0x4f8332();while(!![]){try{const _0xae107a=-parseInt(_0x203bb3(0x19f))/0x1*(-parseInt(_0x203bb3(0x180))/0x2)+-parseInt(_0x203bb3(0x1c4))/0x3+-parseInt(_0x203bb3(0x18f))/0x4+parseInt(_0x203bb3(0x16c))/0x5*(-parseInt(_0x203bb3(0x1a5))/0x6)+-parseInt(_0x203bb3(0x13e))/0x7*(-parseInt(_0x203bb3(0x130))/0x8)+-parseInt(_0x203bb3(0x1bb))/0x9+parseInt(_0x203bb3(0x1c3))/0xa*(parseInt(_0x203bb3(0x1b0))/0xb);if(_0xae107a===_0x4475fa)break;else _0x54dcc2['push'](_0x54dcc2['shift']());}catch(_0x329e73){_0x54dcc2['push'](_0x54dcc2['shift']());}}}(a5_0x5d09,0xde827));import*as a5_0x543ebe from'node:fs';import*as a5_0x12bfc0 from'node:path';import a5_0x52832e from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';function a5_0x5d09(){const _0x432149=['Running\x20test:\x20','now','green','Test\x20Summary','PASS','projectDir',':\x20Sending\x20user\x20input...','resolve','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','yellow','...\x20','basename','6239366VHpSPh','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','\x20\x20Site:\x20','✗\x20FAIL:\x20','ERROR','Conversation\x20URL:\x20','Usage:','multiple_agents','Total:\x20\x20\x20\x20','Running:\x20','verbose','add','Re-evaluating...','FAIL','reason','no_context','utf-8','Re-evaluating\x20','round','\x27\x20to\x20create\x20the\x20folder\x20structure.','llmProject','test.yml','dim','Run\x20tests\x20for\x20an\x20LLM\x20agent','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','no_tests','agent','✗\x20ERROR:\x20Project\x20not\x20found:\x20','\x20\x20-\x20','text','not\x20found','conversation_url','Cached\x20run\x20is\x20from\x20site\x20\x22','tsv','substring','\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','Test\x20Configuration:','\x20\x20Project:\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','push','Tests\x20found:\x20','description','message','Failed:\x20\x20\x20','Either\x20switch\x20to\x20the\x20\x22','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','4041185ZwHGnA','toISOString','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','resolveAgentId','Errors:\x20\x20\x20','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','Duration:\x20','Failed\x20Tests:','agent:test','writeFileSync','red','forEach','Run\x20\x27tdx\x20agent\x20pull\x20','map','timestamp','reeval','no_local_folder','length','404','source','10DsYkpf','site','Running\x20agent\x20tests...','\x22,\x20but\x20current\x20site\x20is\x20\x22','Error:\x20No\x20previous\x20test\x20run\x20found.','✓\x20PASS:\x20','rounds','agentName','\x20\x20Conversation:\x20','Cached\x20run\x20from:\x20','status','\x20-\x20','start','trim','toLowerCase','3510956bkxTjC','resolveProjectId','\x20(new)','log','executeReeval','tests','...','join','split','some','\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)','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','white','New\x20tests\x20to\x20execute:\x20','repeat','json','131523WDJqXl','filter','Test\x20','Evaluating\x20response...','cyan','✗\x20ERROR:\x20','12fISrtP','\x22:\x20','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','table','testYmlPath','Using\x20agent:\x20','Site:\x20','Error\x20writing\x20output\x20file:\x20','stop','\x20\x20Evaluating...\x20','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','115445zTrwwT','Available\x20tests:\x20','find','/<agent-name>','name','tags','Agent:\x20','Round\x201/','found','llm','\x20\x20Round\x20','6698763sgVVJm','Available\x20tags:\x20','context','projectName','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','Passed:\x20\x20\x20','output','1930fJcfZS','947721QVOpRD','jsonl','includes','Output\x20written\x20to:\x20','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','agentDirs','16jQkKjX','Executing\x20new\x20tests...'];a5_0x5d09=function(){return _0x432149;};return a5_0x5d09();}import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0xdd547f(0x1b4)]=a5_0xdd547f(0x174);[a5_0xdd547f(0x167)]=a5_0xdd547f(0x155);async['execute'](_0x27c79c){const _0x36b9c5=a5_0xdd547f,{options:_0x5bbdff,args:_0x15dda7,tdx:_0x56782a}=_0x27c79c,_0x56aebf=_0x15dda7[0x0]||'.',_0x5828f8=_0x5bbdff['dryRun'],_0x1bc3f2=_0x5bbdff,_0x4dc2e7=_0x1bc3f2['eval']===![],_0x2a3b8b=_0x1bc3f2[_0x36b9c5(0x17b)],_0x56e277=_0x1bc3f2[_0x36b9c5(0x1b4)],_0x268662=_0x1bc3f2[_0x36b9c5(0x1b5)],_0x414c84=_0x5bbdff[_0x36b9c5(0x181)],_0x3a60ca=_0x1bc3f2[_0x36b9c5(0x1c2)];if(_0x2a3b8b&&_0x4dc2e7)return console[_0x36b9c5(0x192)](a5_0x52832e['red'](_0x36b9c5(0x16e))),0x1;let _0x797dd4=_0x36b9c5(0x1a8);if(_0x1bc3f2[_0x36b9c5(0x19e)])_0x797dd4=_0x36b9c5(0x19e);else{if(_0x1bc3f2[_0x36b9c5(0x1c5)])_0x797dd4='jsonl';else{if(_0x1bc3f2[_0x36b9c5(0x15f)])_0x797dd4=_0x36b9c5(0x15f);else{if(_0x1bc3f2[_0x36b9c5(0x1a8)])_0x797dd4=_0x36b9c5(0x1a8);}}}const _0x3169cb=_0x1bc3f2['llmProject'];let _0x55adcb=_0x56aebf;const _0x2a8105=a5_0x543ebe['existsSync'](_0x56aebf),_0x4b28cc=_0x56aebf==='.';if(!_0x2a8105||_0x4b28cc){const _0x4ed351=resolveProjectFromContext(_0x56aebf,_0x3169cb,{'requireFile':_0x36b9c5(0x153)});if(_0x4ed351[_0x36b9c5(0x1b8)])_0x55adcb=_0x4ed351[_0x36b9c5(0x137)],_0x4ed351[_0x36b9c5(0x17f)]===_0x36b9c5(0x1bd)&&console[_0x36b9c5(0x192)](a5_0x52832e[_0x36b9c5(0x154)](_0x36b9c5(0x1aa)+_0x55adcb));else switch(_0x4ed351[_0x36b9c5(0x14c)]){case _0x36b9c5(0x14d):console[_0x36b9c5(0x192)](a5_0x52832e[_0x36b9c5(0x13b)](_0x4ed351[_0x36b9c5(0x168)])),console[_0x36b9c5(0x192)](),console[_0x36b9c5(0x192)](_0x36b9c5(0x144)),console[_0x36b9c5(0x192)](_0x36b9c5(0x161)),console[_0x36b9c5(0x192)](_0x36b9c5(0x199)),console[_0x36b9c5(0x192)](),console[_0x36b9c5(0x192)](_0x36b9c5(0x19a));return 0x1;case _0x36b9c5(0x17c):console[_0x36b9c5(0x192)](a5_0x52832e[_0x36b9c5(0x13b)](_0x4ed351[_0x36b9c5(0x168)])),console['log'](),console[_0x36b9c5(0x192)](_0x36b9c5(0x178)+_0x4ed351[_0x36b9c5(0x152)]+_0x36b9c5(0x151));return 0x1;case _0x36b9c5(0x145):{const _0x3cb9d9=a5_0x12bfc0[_0x36b9c5(0x13d)](_0x4ed351[_0x36b9c5(0x137)]);console[_0x36b9c5(0x192)](a5_0x52832e[_0x36b9c5(0x13b)](_0x36b9c5(0x1a7)+_0x4ed351[_0x36b9c5(0x152)]+'\x22:'));for(const _0x252992 of _0x4ed351[_0x36b9c5(0x12f)]){console[_0x36b9c5(0x192)](_0x36b9c5(0x15a)+_0x252992);}return console[_0x36b9c5(0x192)](),console['log'](_0x36b9c5(0x1c0)+_0x3cb9d9+_0x36b9c5(0x1b3)),0x1;}case _0x36b9c5(0x157):console['log'](a5_0x52832e[_0x36b9c5(0x13b)]('No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22'+_0x4ed351['llmProject']+'\x22.')),console[_0x36b9c5(0x192)](a5_0x52832e['dim']('Project\x20path:\x20'+_0x4ed351['projectDir'])),console[_0x36b9c5(0x192)](),console['log']('Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.');return 0x1;}}const {definition:_0x3f462b,agentInfo:_0x466651}=parseTestFile(_0x55adcb);let _0x40d950=_0x3f462b[_0x36b9c5(0x194)];if(_0x56e277){const _0x1510f8=_0x56e277['split'](',')[_0x36b9c5(0x179)](_0x37cf9b=>_0x37cf9b[_0x36b9c5(0x18d)]());_0x40d950=_0x3f462b[_0x36b9c5(0x194)][_0x36b9c5(0x1a0)](_0x2809dc=>_0x1510f8[_0x36b9c5(0x1c6)](_0x2809dc[_0x36b9c5(0x1b4)]));if(_0x40d950[_0x36b9c5(0x17d)]===0x0)return console['log'](a5_0x52832e[_0x36b9c5(0x13b)]('No\x20tests\x20found\x20matching:\x20'+_0x56e277)),console[_0x36b9c5(0x192)](a5_0x52832e[_0x36b9c5(0x154)](_0x36b9c5(0x1b1)+_0x3f462b[_0x36b9c5(0x194)]['map'](_0x3740fc=>_0x3740fc['name'])['join'](',\x20'))),0x1;}if(_0x268662){const _0x16ddcb=_0x268662[_0x36b9c5(0x197)](',')[_0x36b9c5(0x179)](_0x924c46=>_0x924c46[_0x36b9c5(0x18d)]()[_0x36b9c5(0x18e)]());_0x40d950=_0x40d950[_0x36b9c5(0x1a0)](_0x2f33c6=>_0x2f33c6[_0x36b9c5(0x1b5)]?.[_0x36b9c5(0x198)](_0x68d91f=>_0x16ddcb[_0x36b9c5(0x1c6)](_0x68d91f[_0x36b9c5(0x18e)]())));if(_0x40d950['length']===0x0){console[_0x36b9c5(0x192)](a5_0x52832e[_0x36b9c5(0x13b)]('No\x20tests\x20found\x20with\x20tags:\x20'+_0x268662));const _0x27ddea=new Set();return _0x3f462b['tests'][_0x36b9c5(0x177)](_0x4a1ab8=>_0x4a1ab8[_0x36b9c5(0x1b5)]?.[_0x36b9c5(0x177)](_0x299981=>_0x27ddea[_0x36b9c5(0x149)](_0x299981))),_0x27ddea['size']>0x0?console['log'](a5_0x52832e[_0x36b9c5(0x154)](_0x36b9c5(0x1bc)+[..._0x27ddea][_0x36b9c5(0x196)](',\x20'))):console[_0x36b9c5(0x192)](a5_0x52832e[_0x36b9c5(0x154)]('No\x20tests\x20have\x20tags\x20defined.')),0x1;}}if(_0x2a3b8b)return this[_0x36b9c5(0x193)](_0x27c79c,{'definition':{'tests':_0x40d950},'agentInfo':_0x466651,'outputFormat':_0x797dd4,'outputFile':_0x3a60ca,'testNames':_0x56e277});if(_0x5828f8){console['log'](a5_0x52832e['cyan'](_0x36b9c5(0x162))),console[_0x36b9c5(0x192)](_0x36b9c5(0x140)+a5_0x52832e[_0x36b9c5(0x19b)](_0x414c84)),console[_0x36b9c5(0x192)](_0x36b9c5(0x163)+a5_0x52832e[_0x36b9c5(0x19b)](_0x466651['projectName'])),console['log']('\x20\x20Agent:\x20'+a5_0x52832e[_0x36b9c5(0x19b)](_0x466651[_0x36b9c5(0x187)])),console[_0x36b9c5(0x192)](),console[_0x36b9c5(0x192)](_0x36b9c5(0x166)+a5_0x52832e['white'](_0x40d950[_0x36b9c5(0x17d)]));for(let _0xd694b5=0x0;_0xd694b5<_0x40d950[_0x36b9c5(0x17d)];_0xd694b5++){const _0x5e77f7=_0x40d950[_0xd694b5],_0x2db93e=_0x5e77f7['rounds']['length']===0x1?_0x36b9c5(0x150):_0x36b9c5(0x186),_0x2ff7d4=_0x5e77f7[_0x36b9c5(0x1b5)]?.[_0x36b9c5(0x17d)]?'\x20['+_0x5e77f7['tags'][_0x36b9c5(0x196)](',\x20')+']':'';console['log']('\x20\x20'+(_0xd694b5+0x1)+'.\x20'+a5_0x52832e['white'](_0x5e77f7[_0x36b9c5(0x1b4)])+'\x20('+_0x5e77f7[_0x36b9c5(0x186)][_0x36b9c5(0x17d)]+'\x20'+_0x2db93e+')'+a5_0x52832e[_0x36b9c5(0x154)](_0x2ff7d4));}return 0x0;}let _0x4f2cef,_0x4ec616;try{_0x4f2cef=await _0x56782a[_0x36b9c5(0x1b9)][_0x36b9c5(0x190)](_0x466651['projectName']);}catch(_0xaa3658){const _0x297385=_0xaa3658 instanceof Error?_0xaa3658['message']:String(_0xaa3658);return _0x297385['includes'](_0x36b9c5(0x17e))||_0x297385['toLowerCase']()['includes'](_0x36b9c5(0x15c))?console[_0x36b9c5(0x192)](a5_0x52832e[_0x36b9c5(0x176)](_0x36b9c5(0x159)+_0x466651[_0x36b9c5(0x1be)])):console['log'](a5_0x52832e[_0x36b9c5(0x176)](_0x36b9c5(0x13a)+_0x466651['projectName']+_0x36b9c5(0x1a6)+_0x297385)),0x1;}try{_0x4ec616=await _0x56782a[_0x36b9c5(0x1b9)][_0x36b9c5(0x16f)](_0x466651[_0x36b9c5(0x187)],_0x4f2cef);}catch(_0x5f49ee){const _0x343e7c=_0x5f49ee instanceof Error?_0x5f49ee[_0x36b9c5(0x168)]:String(_0x5f49ee);return _0x343e7c[_0x36b9c5(0x1c6)](_0x36b9c5(0x17e))||_0x343e7c[_0x36b9c5(0x18e)]()[_0x36b9c5(0x1c6)](_0x36b9c5(0x15c))?console['log'](a5_0x52832e[_0x36b9c5(0x176)]('✗\x20ERROR:\x20Agent\x20not\x20found:\x20'+_0x466651['agentName'])):console[_0x36b9c5(0x192)](a5_0x52832e[_0x36b9c5(0x176)](_0x36b9c5(0x164)+_0x466651['agentName']+'\x22:\x20'+_0x343e7c)),0x1;}let _0x2d66fe;if(!_0x4dc2e7)try{_0x2d66fe=await setupEvaluatorAgent(_0x56782a[_0x36b9c5(0x1b9)],_0x5bbdff[_0x36b9c5(0x148)]);}catch(_0x261a35){const _0x5864af=_0x261a35 instanceof Error?_0x261a35['message']:String(_0x261a35);return console['log'](a5_0x52832e['red'](_0x36b9c5(0x12e)+_0x5864af)),0x1;}console['log'](a5_0x52832e['cyan'](_0x36b9c5(0x182))),console[_0x36b9c5(0x192)](_0x36b9c5(0x1ab)+a5_0x52832e[_0x36b9c5(0x19b)](_0x414c84)),console[_0x36b9c5(0x192)](_0x36b9c5(0x1b6)+a5_0x52832e['white'](_0x466651['projectName']+'/'+_0x466651[_0x36b9c5(0x187)])),console[_0x36b9c5(0x192)]();const _0x4d0bd2=[],_0x125290=[],_0x1ba706=Date[_0x36b9c5(0x133)]();for(let _0x372488=0x0;_0x372488<_0x40d950[_0x36b9c5(0x17d)];_0x372488++){const _0xfdead2=_0x40d950[_0x372488];_0x40d950['length']>0x1?console[_0x36b9c5(0x192)](_0x36b9c5(0x1a1)+(_0x372488+0x1)+'/'+_0x40d950[_0x36b9c5(0x17d)]+':\x20'+a5_0x52832e[_0x36b9c5(0x19b)](_0xfdead2[_0x36b9c5(0x1b4)])):console[_0x36b9c5(0x192)](_0x36b9c5(0x132)+a5_0x52832e[_0x36b9c5(0x19b)](_0xfdead2[_0x36b9c5(0x1b4)]));const _0x564200=createCommandSpinner(_0x36b9c5(0x1b7)+_0xfdead2['rounds'][_0x36b9c5(0x17d)]+_0x36b9c5(0x138));_0x564200[_0x36b9c5(0x18c)]();try{const {result:_0x3803b7,conversation:_0x28b793}=await runTest(_0x56782a[_0x36b9c5(0x1b9)],_0xfdead2,{'agentId':_0x4ec616,'projectId':_0x4f2cef,'site':_0x414c84,'noEval':_0x4dc2e7,'evaluatorId':_0x2d66fe,'onRoundStart':(_0x92200a,_0x3ee8dd)=>{const _0x4a6e8b=_0x36b9c5;_0x564200[_0x4a6e8b(0x15b)]='Round\x20'+(_0x92200a+0x1)+'/'+_0x3ee8dd+_0x4a6e8b(0x138);},'onRoundComplete':(_0x5a1e8e,_0x243052,_0x514d8a)=>{const _0x390d61=_0x36b9c5,_0x372cc3=formatElapsed(_0x243052);_0x514d8a?console[_0x390d61(0x192)]('\x20\x20Round\x20'+(_0x5a1e8e+0x1)+'/'+_0xfdead2['rounds'][_0x390d61(0x17d)]+_0x390d61(0x13c)+a5_0x52832e[_0x390d61(0x134)]('✓')+'\x20('+_0x372cc3+')'):console['log'](_0x390d61(0x1ba)+(_0x5a1e8e+0x1)+'/'+_0xfdead2['rounds'][_0x390d61(0x17d)]+_0x390d61(0x13c)+a5_0x52832e[_0x390d61(0x176)]('✗'));},'onEvaluationStart':()=>{const _0x29a7db=_0x36b9c5;_0x564200[_0x29a7db(0x15b)]=_0x29a7db(0x1a2);},'onEvaluationComplete':_0x3a1b96=>{const _0x35ffc5=_0x36b9c5,_0x1b87c7=formatElapsed(_0x3a1b96);console[_0x35ffc5(0x192)](_0x35ffc5(0x1ae)+a5_0x52832e['green']('✓')+'\x20('+_0x1b87c7+')');}});_0x564200[_0x36b9c5(0x1ad)](),_0x4d0bd2[_0x36b9c5(0x165)](_0x3803b7),_0x125290[_0x36b9c5(0x165)](_0x28b793);if(_0x3803b7[_0x36b9c5(0x18a)]===_0x36b9c5(0x136))console[_0x36b9c5(0x192)](a5_0x52832e[_0x36b9c5(0x134)](_0x36b9c5(0x185)+_0x3803b7[_0x36b9c5(0x14c)]));else _0x3803b7[_0x36b9c5(0x18a)]===_0x36b9c5(0x14b)?console[_0x36b9c5(0x192)](a5_0x52832e[_0x36b9c5(0x176)]('✗\x20FAIL:\x20'+_0x3803b7[_0x36b9c5(0x14c)])):console[_0x36b9c5(0x192)](a5_0x52832e[_0x36b9c5(0x176)]('✗\x20ERROR:\x20'+_0x3803b7[_0x36b9c5(0x14c)]));_0x3803b7[_0x36b9c5(0x15d)]&&console[_0x36b9c5(0x192)](a5_0x52832e[_0x36b9c5(0x154)](_0x36b9c5(0x143)+_0x3803b7[_0x36b9c5(0x15d)])),console['log']();}catch(_0x1f29a7){_0x564200[_0x36b9c5(0x1ad)]();const _0x5aa9e8=_0x1f29a7 instanceof Error?_0x1f29a7[_0x36b9c5(0x168)]:String(_0x1f29a7);console[_0x36b9c5(0x192)](a5_0x52832e[_0x36b9c5(0x176)]('✗\x20ERROR:\x20'+_0x5aa9e8)),console['log'](),_0x4d0bd2[_0x36b9c5(0x165)]({'name':_0xfdead2[_0x36b9c5(0x1b4)],'status':'ERROR','reason':_0x5aa9e8,'timestamp':new Date()[_0x36b9c5(0x16d)](),'duration_ms':0x0});}}const _0xf2176b=Date['now']()-_0x1ba706,_0x4f8dfc=_0x4d0bd2[_0x36b9c5(0x1a0)](_0x3573da=>_0x3573da[_0x36b9c5(0x18a)]===_0x36b9c5(0x136))['length'],_0x4b30d6=_0x4d0bd2[_0x36b9c5(0x1a0)](_0x2a8237=>_0x2a8237['status']==='FAIL')['length'],_0x1737ac=_0x4d0bd2[_0x36b9c5(0x1a0)](_0x682621=>_0x682621[_0x36b9c5(0x18a)]===_0x36b9c5(0x142))[_0x36b9c5(0x17d)];console['log']('━'['repeat'](0x3c)),console[_0x36b9c5(0x192)](_0x36b9c5(0x135)),console[_0x36b9c5(0x192)]('━'[_0x36b9c5(0x19d)](0x3c)),console[_0x36b9c5(0x192)](_0x36b9c5(0x146)+_0x4d0bd2[_0x36b9c5(0x17d)]),console[_0x36b9c5(0x192)]('Passed:\x20\x20\x20'+a5_0x52832e[_0x36b9c5(0x134)](_0x4f8dfc)),console[_0x36b9c5(0x192)]('Failed:\x20\x20\x20'+a5_0x52832e['red'](_0x4b30d6));_0x1737ac>0x0&&console['log'](_0x36b9c5(0x170)+a5_0x52832e['red'](_0x1737ac));console[_0x36b9c5(0x192)](_0x36b9c5(0x172)+formatElapsed(_0xf2176b)),console['log']('━'[_0x36b9c5(0x19d)](0x3c));const _0x3319cd=_0x4d0bd2[_0x36b9c5(0x1a0)](_0x195c2a=>_0x195c2a[_0x36b9c5(0x18a)]!==_0x36b9c5(0x136));if(_0x3319cd[_0x36b9c5(0x17d)]>0x0){console[_0x36b9c5(0x192)](),console[_0x36b9c5(0x192)](_0x36b9c5(0x173));for(const _0x506d4e of _0x3319cd){const _0x280584=a5_0x52832e[_0x36b9c5(0x176)]('✗'),_0x58321d=_0x506d4e['reason'][_0x36b9c5(0x17d)]>0x32?_0x506d4e[_0x36b9c5(0x14c)][_0x36b9c5(0x160)](0x0,0x32)+_0x36b9c5(0x195):_0x506d4e[_0x36b9c5(0x14c)];console['log']('\x20\x20'+_0x280584+'\x20'+_0x506d4e[_0x36b9c5(0x1b4)]+':\x20'+_0x58321d);}}const _0x1ed1fc={'summary':{'total':_0x4d0bd2[_0x36b9c5(0x17d)],'passed':_0x4f8dfc,'failed':_0x4b30d6,'errors':_0x1737ac>0x0?_0x1737ac:undefined,'duration_ms':_0xf2176b},'tests':_0x4d0bd2,'agent':{'project':_0x466651[_0x36b9c5(0x1be)],'name':_0x466651[_0x36b9c5(0x187)],'site':_0x414c84},'timestamp':new Date(_0x1ba706)[_0x36b9c5(0x16d)]()};try{const _0x5e3c3a=buildCachedTestRun(_0x125290,{'site':_0x414c84,'projectId':_0x4f2cef,'projectName':_0x466651[_0x36b9c5(0x1be)],'agentId':_0x4ec616,'agentName':_0x466651[_0x36b9c5(0x187)],'testYmlPath':a5_0x12bfc0[_0x36b9c5(0x139)](_0x466651[_0x36b9c5(0x1a9)])});saveLastTestRun(_0x5e3c3a);}catch{}if(_0x797dd4!=='table'||_0x3a60ca){const _0x443ab7=formatResults(_0x1ed1fc,_0x797dd4);if(_0x3a60ca)try{a5_0x543ebe[_0x36b9c5(0x175)](_0x3a60ca,_0x443ab7,_0x36b9c5(0x14e)),console[_0x36b9c5(0x192)](),console['log'](a5_0x52832e[_0x36b9c5(0x154)](_0x36b9c5(0x1c7)+_0x3a60ca));}catch(_0x45ac7b){return console[_0x36b9c5(0x192)](),console[_0x36b9c5(0x192)](a5_0x52832e[_0x36b9c5(0x176)](_0x36b9c5(0x1ac)+_0x45ac7b)),0x1;}else console['log'](),console[_0x36b9c5(0x192)](_0x443ab7);}return _0x3319cd[_0x36b9c5(0x17d)]>0x0?0x1:0x0;}async[a5_0xdd547f(0x193)](_0x1461b3,_0x20e82d){const _0x106724=a5_0xdd547f,{options:_0x504c46,tdx:_0x1356bf}=_0x1461b3,{definition:_0x4272ae,agentInfo:_0x25cd42,outputFormat:_0xf2be00,outputFile:_0x53e8fc}=_0x20e82d,_0x2cb16a=_0x504c46[_0x106724(0x181)],_0x58c18a=loadLastTestRun();if(!_0x58c18a)return console[_0x106724(0x192)](a5_0x52832e['red'](_0x106724(0x184))),console[_0x106724(0x192)](a5_0x52832e[_0x106724(0x154)](_0x106724(0x156))),0x1;if(_0x58c18a[_0x106724(0x158)][_0x106724(0x187)]!==_0x25cd42[_0x106724(0x187)])return console[_0x106724(0x192)](a5_0x52832e[_0x106724(0x176)](_0x106724(0x171)+_0x58c18a[_0x106724(0x158)][_0x106724(0x187)]+_0x106724(0x13f)+_0x25cd42[_0x106724(0x187)]+'\x22.')),console['log'](a5_0x52832e[_0x106724(0x154)](_0x106724(0x16b))),0x1;const _0x9666e9=new Set(_0x58c18a['conversations'][_0x106724(0x179)](_0x3d91d9=>_0x3d91d9['testName'])),_0x9ab314=_0x4272ae[_0x106724(0x194)][_0x106724(0x1a0)](_0x73910a=>!_0x9666e9['has'](_0x73910a[_0x106724(0x1b4)]));if(_0x9ab314['length']>0x0&&_0x58c18a[_0x106724(0x181)]!==_0x2cb16a)return console[_0x106724(0x192)](a5_0x52832e[_0x106724(0x176)](_0x106724(0x1bf))),console[_0x106724(0x192)](a5_0x52832e[_0x106724(0x154)](_0x106724(0x15e)+_0x58c18a[_0x106724(0x181)]+_0x106724(0x183)+_0x2cb16a+'\x22.')),console['log'](a5_0x52832e['dim'](_0x106724(0x16a)+_0x58c18a['site']+'\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.')),0x1;const _0x403195=_0x4272ae[_0x106724(0x194)][_0x106724(0x1a0)](_0x186c2c=>_0x9666e9['has'](_0x186c2c[_0x106724(0x1b4)])),_0x1b5ed4=_0x9ab314;let _0x5c3683;try{_0x5c3683=await setupEvaluatorAgent(_0x1356bf[_0x106724(0x1b9)],_0x504c46['verbose']);}catch(_0x88b693){const _0x58984b=_0x88b693 instanceof Error?_0x88b693[_0x106724(0x168)]:String(_0x88b693);return console[_0x106724(0x192)](a5_0x52832e[_0x106724(0x176)](_0x106724(0x12e)+_0x58984b)),0x1;}console[_0x106724(0x192)](a5_0x52832e[_0x106724(0x1a3)]('Re-evaluating\x20cached\x20test\x20run...')),console['log'](_0x106724(0x189)+a5_0x52832e[_0x106724(0x19b)](_0x58c18a[_0x106724(0x17a)])),console[_0x106724(0x192)](_0x106724(0x1b6)+a5_0x52832e[_0x106724(0x19b)](_0x58c18a[_0x106724(0x158)][_0x106724(0x1be)]+'/'+_0x58c18a['agent']['agentName']));_0x1b5ed4[_0x106724(0x17d)]>0x0&&console[_0x106724(0x192)](_0x106724(0x19c)+a5_0x52832e[_0x106724(0x13b)](_0x1b5ed4[_0x106724(0x17d)]));console['log']();const _0x5e134e=[],_0x2f4f21=Date[_0x106724(0x133)](),_0xcddfad=createCommandSpinner(_0x106724(0x14a));if(_0x403195[_0x106724(0x17d)]>0x0)try{const _0x2a9856=await reevaluateFromCache(_0x1356bf[_0x106724(0x1b9)],_0x58c18a,{'tests':_0x403195},{'evaluatorId':_0x5c3683,'onTestStart':(_0x51d177,_0x3ffed6,_0x3ab273)=>{const _0x458e5b=_0x106724;_0xcddfad[_0x458e5b(0x15b)]=_0x458e5b(0x14f)+(_0x3ffed6+0x1)+'/'+_0x3ab273+':\x20'+_0x51d177+_0x458e5b(0x195);if(!_0xcddfad['isSpinning'])_0xcddfad[_0x458e5b(0x18c)]();},'onTestComplete':(_0x2fae1c,_0x133ad3)=>{const _0x249780=_0x106724;_0xcddfad[_0x249780(0x1ad)]();if(_0x133ad3[_0x249780(0x18a)]===_0x249780(0x136))console[_0x249780(0x192)](a5_0x52832e[_0x249780(0x134)](_0x249780(0x185)+_0x2fae1c)+a5_0x52832e[_0x249780(0x154)]('\x20(cached)'));else _0x133ad3[_0x249780(0x18a)]===_0x249780(0x14b)?console[_0x249780(0x192)](a5_0x52832e[_0x249780(0x176)](_0x249780(0x141)+_0x2fae1c+'\x20-\x20'+_0x133ad3[_0x249780(0x14c)])+a5_0x52832e[_0x249780(0x154)]('\x20(cached)')):console[_0x249780(0x192)](a5_0x52832e[_0x249780(0x176)](_0x249780(0x1a4)+_0x2fae1c+_0x249780(0x18b)+_0x133ad3[_0x249780(0x14c)]));_0x133ad3[_0x249780(0x15d)]&&console[_0x249780(0x192)](a5_0x52832e[_0x249780(0x154)]('\x20\x20Conversation:\x20'+_0x133ad3[_0x249780(0x15d)])),_0x5e134e[_0x249780(0x165)](_0x133ad3);},'onTestSkipped':(_0x449a96,_0x255676)=>{const _0x415242=_0x106724;_0xcddfad[_0x415242(0x1ad)](),console[_0x415242(0x192)](a5_0x52832e['yellow']('⚠\x20SKIPPED:\x20'+_0x449a96+_0x415242(0x18b)+_0x255676));}});for(const _0x556e4c of _0x2a9856){!_0x5e134e[_0x106724(0x1b2)](_0x38d6dc=>_0x38d6dc['name']===_0x556e4c[_0x106724(0x1b4)])&&_0x5e134e[_0x106724(0x165)](_0x556e4c);}}catch(_0x45dce8){_0xcddfad[_0x106724(0x1ad)]();const _0x4d801e=_0x45dce8 instanceof Error?_0x45dce8[_0x106724(0x168)]:String(_0x45dce8);return console[_0x106724(0x192)](a5_0x52832e[_0x106724(0x176)](_0x106724(0x1af)+_0x4d801e)),0x1;}_0xcddfad['stop']();if(_0x1b5ed4[_0x106724(0x17d)]>0x0){console[_0x106724(0x192)](),console[_0x106724(0x192)](a5_0x52832e[_0x106724(0x1a3)](_0x106724(0x131)));const {projectId:_0xdda4fb,agentId:_0x1ec552}=_0x58c18a[_0x106724(0x158)];for(const _0x1ce2da of _0x1b5ed4){console['log'](_0x106724(0x147)+a5_0x52832e['white'](_0x1ce2da[_0x106724(0x1b4)]));const _0x2bf2d2=createCommandSpinner('Round\x201/'+_0x1ce2da['rounds']['length']+':\x20Sending\x20user\x20input...');_0x2bf2d2[_0x106724(0x18c)]();try{const {result:_0x16c705}=await runTest(_0x1356bf[_0x106724(0x1b9)],_0x1ce2da,{'agentId':_0x1ec552,'projectId':_0xdda4fb,'site':_0x58c18a[_0x106724(0x181)],'noEval':![],'evaluatorId':_0x5c3683,'onRoundStart':(_0x1d4bb6,_0x1c261e)=>{const _0x4f60aa=_0x106724;_0x2bf2d2[_0x4f60aa(0x15b)]='Round\x20'+(_0x1d4bb6+0x1)+'/'+_0x1c261e+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x2a0de1,_0x305af0,_0x42bebe)=>{const _0x5e3963=_0x106724,_0x1b6540=formatElapsed(_0x305af0);_0x42bebe?console['log'](_0x5e3963(0x1ba)+(_0x2a0de1+0x1)+'/'+_0x1ce2da['rounds'][_0x5e3963(0x17d)]+_0x5e3963(0x13c)+a5_0x52832e['green']('✓')+'\x20('+_0x1b6540+')'):console[_0x5e3963(0x192)](_0x5e3963(0x1ba)+(_0x2a0de1+0x1)+'/'+_0x1ce2da[_0x5e3963(0x186)]['length']+'...\x20'+a5_0x52832e[_0x5e3963(0x176)]('✗'));},'onEvaluationStart':()=>{const _0x299488=_0x106724;_0x2bf2d2[_0x299488(0x15b)]=_0x299488(0x1a2);},'onEvaluationComplete':_0x11c3d5=>{const _0x49342f=_0x106724,_0x1c26e9=formatElapsed(_0x11c3d5);console[_0x49342f(0x192)]('\x20\x20Evaluating...\x20'+a5_0x52832e[_0x49342f(0x134)]('✓')+'\x20('+_0x1c26e9+')');}});_0x2bf2d2[_0x106724(0x1ad)](),_0x5e134e[_0x106724(0x165)](_0x16c705);if(_0x16c705[_0x106724(0x18a)]===_0x106724(0x136))console['log'](a5_0x52832e[_0x106724(0x134)](_0x106724(0x185)+_0x16c705[_0x106724(0x14c)])+a5_0x52832e[_0x106724(0x154)](_0x106724(0x191)));else _0x16c705[_0x106724(0x18a)]===_0x106724(0x14b)?console['log'](a5_0x52832e[_0x106724(0x176)](_0x106724(0x141)+_0x16c705[_0x106724(0x14c)])+a5_0x52832e['dim']('\x20(new)')):console[_0x106724(0x192)](a5_0x52832e[_0x106724(0x176)](_0x106724(0x1a4)+_0x16c705[_0x106724(0x14c)]));_0x16c705[_0x106724(0x15d)]&&console[_0x106724(0x192)](a5_0x52832e['dim'](_0x106724(0x188)+_0x16c705[_0x106724(0x15d)]));}catch(_0xcbbd8c){_0x2bf2d2['stop']();const _0x270431=_0xcbbd8c instanceof Error?_0xcbbd8c['message']:String(_0xcbbd8c);console[_0x106724(0x192)](a5_0x52832e['red'](_0x106724(0x1a4)+_0x270431)),_0x5e134e['push']({'name':_0x1ce2da[_0x106724(0x1b4)],'status':_0x106724(0x142),'reason':_0x270431,'timestamp':new Date()[_0x106724(0x16d)](),'duration_ms':0x0});}}}console['log']();const _0x5109f6=Date[_0x106724(0x133)]()-_0x2f4f21,_0x17b44d=_0x5e134e[_0x106724(0x1a0)](_0x1841e1=>_0x1841e1[_0x106724(0x18a)]==='PASS')[_0x106724(0x17d)],_0x4d1d2d=_0x5e134e[_0x106724(0x1a0)](_0x4ec784=>_0x4ec784[_0x106724(0x18a)]===_0x106724(0x14b))['length'],_0x21bf75=_0x5e134e['filter'](_0x117eba=>_0x117eba[_0x106724(0x18a)]===_0x106724(0x142))['length'];console[_0x106724(0x192)]('━'[_0x106724(0x19d)](0x3c)),console['log']('Re-evaluation\x20Summary'),console['log']('━'[_0x106724(0x19d)](0x3c)),console[_0x106724(0x192)](_0x106724(0x146)+_0x5e134e['length']),console[_0x106724(0x192)](_0x106724(0x1c1)+a5_0x52832e[_0x106724(0x134)](_0x17b44d)),console[_0x106724(0x192)](_0x106724(0x169)+a5_0x52832e[_0x106724(0x176)](_0x4d1d2d));_0x21bf75>0x0&&console[_0x106724(0x192)](_0x106724(0x170)+a5_0x52832e[_0x106724(0x176)](_0x21bf75));console[_0x106724(0x192)](_0x106724(0x172)+formatElapsed(_0x5109f6)),console[_0x106724(0x192)]('━'[_0x106724(0x19d)](0x3c));const _0x10d7f3={'summary':{'total':_0x5e134e[_0x106724(0x17d)],'passed':_0x17b44d,'failed':_0x4d1d2d,'errors':_0x21bf75>0x0?_0x21bf75:undefined,'duration_ms':_0x5109f6},'tests':_0x5e134e,'agent':{'project':_0x25cd42[_0x106724(0x1be)],'name':_0x25cd42[_0x106724(0x187)],'site':_0x2cb16a},'timestamp':new Date(_0x2f4f21)['toISOString']()};if(_0xf2be00!==_0x106724(0x1a8)||_0x53e8fc){const _0x4f9b81=formatResults(_0x10d7f3,_0xf2be00);if(_0x53e8fc)try{a5_0x543ebe['writeFileSync'](_0x53e8fc,_0x4f9b81,_0x106724(0x14e)),console[_0x106724(0x192)](),console[_0x106724(0x192)](a5_0x52832e[_0x106724(0x154)](_0x106724(0x1c7)+_0x53e8fc));}catch(_0x323d59){return console[_0x106724(0x192)](),console[_0x106724(0x192)](a5_0x52832e['red']('Error\x20writing\x20output\x20file:\x20'+_0x323d59)),0x1;}else console['log'](),console['log'](_0x4f9b81);}const _0x483268=_0x5e134e['filter'](_0xca958d=>_0xca958d['status']!==_0x106724(0x136));return _0x483268[_0x106724(0x17d)]>0x0?0x1:0x0;}}
1
+ const a5_0x523791=a5_0x3c02;(function(_0x194fc2,_0x4c1ec9){const _0x8b398f=a5_0x3c02,_0x34af21=_0x194fc2();while(!![]){try{const _0x2dd514=parseInt(_0x8b398f(0x15d))/0x1+parseInt(_0x8b398f(0xf2))/0x2*(-parseInt(_0x8b398f(0x17d))/0x3)+parseInt(_0x8b398f(0x152))/0x4+-parseInt(_0x8b398f(0xf9))/0x5*(parseInt(_0x8b398f(0x14c))/0x6)+parseInt(_0x8b398f(0x14d))/0x7+parseInt(_0x8b398f(0xf0))/0x8*(-parseInt(_0x8b398f(0x13b))/0x9)+parseInt(_0x8b398f(0xfe))/0xa;if(_0x2dd514===_0x4c1ec9)break;else _0x34af21['push'](_0x34af21['shift']());}catch(_0x46c15d){_0x34af21['push'](_0x34af21['shift']());}}}(a5_0x381d,0x341fa));import*as a5_0x5ec645 from'node:fs';import*as a5_0x418b8b from'node:path';import a5_0x565188 from'chalk';import{BaseCommand}from'./command.js';function a5_0x3c02(_0x3258fc,_0x56c78a){_0x3258fc=_0x3258fc-0xec;const _0x381dd2=a5_0x381d();let _0x3c02c2=_0x381dd2[_0x3258fc];return _0x3c02c2;}import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';function a5_0x381d(){const _0x3aef13=['green','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','no_tests','4596sDuuHq','774781ygYMMA','Project\x20path:\x20','split','conversations','agentDirs','751340BDZYNi','\x20\x20Site:\x20','status','...','✓\x20PASS:\x20','Error\x20writing\x20output\x20file:\x20','\x27\x20to\x20create\x20the\x20folder\x20structure.','repeat','text','filter','Re-evaluating\x20cached\x20test\x20run...','144903LUKPGw','Round\x20','start','agentName','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','json','verbose','FAIL','cyan','\x20-\x20','output','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','Test\x20Summary','Running:\x20','white','resolveProjectId','\x20\x20Round\x20','table','Evaluating\x20response...','not\x20found','Site:\x20','tags','Tests\x20found:\x20','ERROR','message','...\x20','has','PASS','Round\x201/','timestamp','228024bVvdlh','Run\x20\x27tdx\x20agent\x20pull\x20',':\x20Sending\x20user\x20input...','Output\x20written\x20to:\x20','Running\x20agent\x20tests...','/<agent-name>','16BTUhgj','tests','4CGbHgo','found','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','No\x20tests\x20found\x20matching:\x20','jsonl','Passed:\x20\x20\x20','join','2270vfmnWi','substring','\x20\x20Evaluating...\x20','forEach','length','5304230cbLjca','context','dim','name','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','tsv','red','yellow','reason','stop','toLowerCase','Test\x20','\x20\x20-\x20','agent','Cached\x20run\x20from:\x20','\x22,\x20but\x20current\x20site\x20is\x20\x22','Running\x20test:\x20','no_local_folder','\x20\x20Agent:\x20','resolve','multiple_agents','Errors:\x20\x20\x20','basename','New\x20tests\x20to\x20execute:\x20','agent:test','add','dryRun','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','\x20(new)','404','rounds','push','Either\x20switch\x20to\x20the\x20\x22','⚠\x20SKIPPED:\x20','log','llm','description','resolveAgentId','Conversation\x20URL:\x20','Agent:\x20','includes','Test\x20Configuration:','some','projectName','executeReeval','Re-evaluation\x20Summary','now','writeFileSync','toISOString','trim','✗\x20FAIL:\x20','llmProject','\x22:\x20','no_context','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','utf-8','testYmlPath','Using\x20agent:\x20','\x20\x20Project:\x20','size','✗\x20ERROR:\x20','1172547wVrKxp','reeval','conversation_url','projectDir','site','existsSync','map','No\x20tests\x20found\x20with\x20tags:\x20','\x20(cached)','Failed:\x20\x20\x20','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','Duration:\x20','\x20\x20Conversation:\x20','isSpinning'];a5_0x381d=function(){return _0x3aef13;};return a5_0x381d();}export class AgentTestCommand extends BaseCommand{[a5_0x523791(0x101)]=a5_0x523791(0x116);[a5_0x523791(0x122)]='Run\x20tests\x20for\x20an\x20LLM\x20agent';async['execute'](_0xbcd5c9){const _0x5e3d2d=a5_0x523791,{options:_0xcd4e8f,args:_0x14f658,tdx:_0x41a4f5}=_0xbcd5c9,_0x4d0760=_0x14f658[0x0]||'.',_0x420fd1=_0xcd4e8f[_0x5e3d2d(0x118)],_0x1e3953=_0xcd4e8f,_0x329d4d=_0x1e3953['eval']===![],_0x2894c6=_0x1e3953[_0x5e3d2d(0x13c)],_0x59f3b4=_0x1e3953['name'],_0x2e039f=_0x1e3953[_0x5e3d2d(0x174)],_0x248220=_0xcd4e8f[_0x5e3d2d(0x13f)],_0x3c2901=_0x1e3953[_0x5e3d2d(0x167)];if(_0x2894c6&&_0x329d4d)return console[_0x5e3d2d(0x120)](a5_0x565188[_0x5e3d2d(0x104)](_0x5e3d2d(0x102))),0x1;let _0x535b4f=_0x5e3d2d(0x170);if(_0x1e3953[_0x5e3d2d(0x162)])_0x535b4f='json';else{if(_0x1e3953[_0x5e3d2d(0xf6)])_0x535b4f=_0x5e3d2d(0xf6);else{if(_0x1e3953[_0x5e3d2d(0x103)])_0x535b4f=_0x5e3d2d(0x103);else{if(_0x1e3953[_0x5e3d2d(0x170)])_0x535b4f=_0x5e3d2d(0x170);}}}const _0x4b5e84=_0x1e3953['llmProject'];let _0x55b9aa=_0x4d0760;const _0x1e9881=a5_0x5ec645[_0x5e3d2d(0x140)](_0x4d0760),_0xe6458=_0x4d0760==='.';if(!_0x1e9881||_0xe6458){const _0x6a5bee=resolveProjectFromContext(_0x4d0760,_0x4b5e84,{'requireFile':'test.yml'});if(_0x6a5bee[_0x5e3d2d(0xf3)])_0x55b9aa=_0x6a5bee['projectDir'],_0x6a5bee['source']===_0x5e3d2d(0xff)&&console[_0x5e3d2d(0x120)](a5_0x565188[_0x5e3d2d(0x100)](_0x5e3d2d(0x137)+_0x55b9aa));else switch(_0x6a5bee[_0x5e3d2d(0x106)]){case _0x5e3d2d(0x133):console[_0x5e3d2d(0x120)](a5_0x565188[_0x5e3d2d(0x105)](_0x6a5bee[_0x5e3d2d(0x177)])),console[_0x5e3d2d(0x120)](),console[_0x5e3d2d(0x120)]('Usage:'),console['log']('\x20\x20tdx\x20agent\x20test\x20<path>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20from\x20path'),console[_0x5e3d2d(0x120)]('\x20\x20tdx\x20agent\x20test\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20(requires\x20context\x20or\x20tdx.json)'),console[_0x5e3d2d(0x120)](),console[_0x5e3d2d(0x120)](_0x5e3d2d(0x14a));return 0x1;case _0x5e3d2d(0x10f):console[_0x5e3d2d(0x120)](a5_0x565188[_0x5e3d2d(0x105)](_0x6a5bee[_0x5e3d2d(0x177)])),console[_0x5e3d2d(0x120)](),console[_0x5e3d2d(0x120)](_0x5e3d2d(0x17e)+_0x6a5bee['llmProject']+_0x5e3d2d(0x158));return 0x1;case _0x5e3d2d(0x112):{const _0x4e10b3=a5_0x418b8b[_0x5e3d2d(0x114)](_0x6a5bee[_0x5e3d2d(0x13e)]);console[_0x5e3d2d(0x120)](a5_0x565188[_0x5e3d2d(0x105)](_0x5e3d2d(0x134)+_0x6a5bee[_0x5e3d2d(0x131)]+'\x22:'));for(const _0x35b61d of _0x6a5bee[_0x5e3d2d(0x151)]){console[_0x5e3d2d(0x120)](_0x5e3d2d(0x10a)+_0x35b61d);}return console[_0x5e3d2d(0x120)](),console['log'](_0x5e3d2d(0x168)+_0x4e10b3+_0x5e3d2d(0xef)),0x1;}case _0x5e3d2d(0x14b):console[_0x5e3d2d(0x120)](a5_0x565188['yellow']('No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22'+_0x6a5bee['llmProject']+'\x22.')),console[_0x5e3d2d(0x120)](a5_0x565188[_0x5e3d2d(0x100)](_0x5e3d2d(0x14e)+_0x6a5bee[_0x5e3d2d(0x13e)])),console[_0x5e3d2d(0x120)](),console[_0x5e3d2d(0x120)](_0x5e3d2d(0x145));return 0x1;}}const {definition:_0x571796,agentInfo:_0x1d7abd}=parseTestFile(_0x55b9aa);let _0x1a368c=_0x571796['tests'];if(_0x59f3b4){const _0x39dd55=_0x59f3b4['split'](',')[_0x5e3d2d(0x141)](_0x28f6b0=>_0x28f6b0[_0x5e3d2d(0x12f)]());_0x1a368c=_0x571796[_0x5e3d2d(0xf1)][_0x5e3d2d(0x15b)](_0xe7f222=>_0x39dd55[_0x5e3d2d(0x126)](_0xe7f222[_0x5e3d2d(0x101)]));if(_0x1a368c[_0x5e3d2d(0xfd)]===0x0)return console[_0x5e3d2d(0x120)](a5_0x565188[_0x5e3d2d(0x105)](_0x5e3d2d(0xf5)+_0x59f3b4)),console[_0x5e3d2d(0x120)](a5_0x565188['dim']('Available\x20tests:\x20'+_0x571796['tests'][_0x5e3d2d(0x141)](_0x5d8324=>_0x5d8324[_0x5e3d2d(0x101)])['join'](',\x20'))),0x1;}if(_0x2e039f){const _0x39fb8b=_0x2e039f[_0x5e3d2d(0x14f)](',')['map'](_0x2588bc=>_0x2588bc[_0x5e3d2d(0x12f)]()['toLowerCase']());_0x1a368c=_0x1a368c[_0x5e3d2d(0x15b)](_0x9971c6=>_0x9971c6[_0x5e3d2d(0x174)]?.[_0x5e3d2d(0x128)](_0x30fea4=>_0x39fb8b[_0x5e3d2d(0x126)](_0x30fea4['toLowerCase']())));if(_0x1a368c[_0x5e3d2d(0xfd)]===0x0){console[_0x5e3d2d(0x120)](a5_0x565188[_0x5e3d2d(0x105)](_0x5e3d2d(0x142)+_0x2e039f));const _0x4c9f7a=new Set();return _0x571796[_0x5e3d2d(0xf1)][_0x5e3d2d(0xfc)](_0x3430ca=>_0x3430ca[_0x5e3d2d(0x174)]?.[_0x5e3d2d(0xfc)](_0xf68287=>_0x4c9f7a[_0x5e3d2d(0x117)](_0xf68287))),_0x4c9f7a[_0x5e3d2d(0x139)]>0x0?console[_0x5e3d2d(0x120)](a5_0x565188['dim']('Available\x20tags:\x20'+[..._0x4c9f7a]['join'](',\x20'))):console[_0x5e3d2d(0x120)](a5_0x565188[_0x5e3d2d(0x100)]('No\x20tests\x20have\x20tags\x20defined.')),0x1;}}if(_0x2894c6)return this[_0x5e3d2d(0x12a)](_0xbcd5c9,{'definition':{'tests':_0x1a368c},'agentInfo':_0x1d7abd,'outputFormat':_0x535b4f,'outputFile':_0x3c2901,'testNames':_0x59f3b4});if(_0x420fd1){console[_0x5e3d2d(0x120)](a5_0x565188[_0x5e3d2d(0x165)](_0x5e3d2d(0x127))),console[_0x5e3d2d(0x120)](_0x5e3d2d(0x153)+a5_0x565188[_0x5e3d2d(0x16d)](_0x248220)),console[_0x5e3d2d(0x120)](_0x5e3d2d(0x138)+a5_0x565188['white'](_0x1d7abd['projectName'])),console[_0x5e3d2d(0x120)](_0x5e3d2d(0x110)+a5_0x565188[_0x5e3d2d(0x16d)](_0x1d7abd[_0x5e3d2d(0x160)])),console[_0x5e3d2d(0x120)](),console['log'](_0x5e3d2d(0x175)+a5_0x565188['white'](_0x1a368c[_0x5e3d2d(0xfd)]));for(let _0x14d5f1=0x0;_0x14d5f1<_0x1a368c[_0x5e3d2d(0xfd)];_0x14d5f1++){const _0x5c44c5=_0x1a368c[_0x14d5f1],_0xe1608f=_0x5c44c5['rounds'][_0x5e3d2d(0xfd)]===0x1?'round':'rounds',_0xc7a9f=_0x5c44c5[_0x5e3d2d(0x174)]?.[_0x5e3d2d(0xfd)]?'\x20['+_0x5c44c5[_0x5e3d2d(0x174)][_0x5e3d2d(0xf8)](',\x20')+']':'';console[_0x5e3d2d(0x120)]('\x20\x20'+(_0x14d5f1+0x1)+'.\x20'+a5_0x565188[_0x5e3d2d(0x16d)](_0x5c44c5[_0x5e3d2d(0x101)])+'\x20('+_0x5c44c5[_0x5e3d2d(0x11c)][_0x5e3d2d(0xfd)]+'\x20'+_0xe1608f+')'+a5_0x565188['dim'](_0xc7a9f));}return 0x0;}let _0x190ae1,_0x5df5d8;try{_0x190ae1=await _0x41a4f5[_0x5e3d2d(0x121)][_0x5e3d2d(0x16e)](_0x1d7abd['projectName']);}catch(_0x4e98c0){const _0x1b2808=_0x4e98c0 instanceof Error?_0x4e98c0[_0x5e3d2d(0x177)]:String(_0x4e98c0);return _0x1b2808[_0x5e3d2d(0x126)](_0x5e3d2d(0x11b))||_0x1b2808[_0x5e3d2d(0x108)]()[_0x5e3d2d(0x126)](_0x5e3d2d(0x172))?console[_0x5e3d2d(0x120)](a5_0x565188[_0x5e3d2d(0x104)]('✗\x20ERROR:\x20Project\x20not\x20found:\x20'+_0x1d7abd[_0x5e3d2d(0x129)])):console[_0x5e3d2d(0x120)](a5_0x565188[_0x5e3d2d(0x104)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22'+_0x1d7abd[_0x5e3d2d(0x129)]+_0x5e3d2d(0x132)+_0x1b2808)),0x1;}try{_0x5df5d8=await _0x41a4f5[_0x5e3d2d(0x121)][_0x5e3d2d(0x123)](_0x1d7abd[_0x5e3d2d(0x160)],_0x190ae1);}catch(_0x33e78a){const _0xce51ff=_0x33e78a instanceof Error?_0x33e78a[_0x5e3d2d(0x177)]:String(_0x33e78a);return _0xce51ff['includes'](_0x5e3d2d(0x11b))||_0xce51ff[_0x5e3d2d(0x108)]()[_0x5e3d2d(0x126)](_0x5e3d2d(0x172))?console[_0x5e3d2d(0x120)](a5_0x565188['red']('✗\x20ERROR:\x20Agent\x20not\x20found:\x20'+_0x1d7abd[_0x5e3d2d(0x160)])):console[_0x5e3d2d(0x120)](a5_0x565188[_0x5e3d2d(0x104)](_0x5e3d2d(0x16a)+_0x1d7abd[_0x5e3d2d(0x160)]+_0x5e3d2d(0x132)+_0xce51ff)),0x1;}let _0x114c63;if(!_0x329d4d)try{_0x114c63=await setupEvaluatorAgent(_0x41a4f5[_0x5e3d2d(0x121)],_0xcd4e8f['verbose']);}catch(_0x1c6c41){const _0x5078c6=_0x1c6c41 instanceof Error?_0x1c6c41[_0x5e3d2d(0x177)]:String(_0x1c6c41);return console[_0x5e3d2d(0x120)](a5_0x565188[_0x5e3d2d(0x104)](_0x5e3d2d(0x161)+_0x5078c6)),0x1;}console[_0x5e3d2d(0x120)](a5_0x565188[_0x5e3d2d(0x165)](_0x5e3d2d(0xee))),console[_0x5e3d2d(0x120)](_0x5e3d2d(0x173)+a5_0x565188[_0x5e3d2d(0x16d)](_0x248220)),console[_0x5e3d2d(0x120)](_0x5e3d2d(0x125)+a5_0x565188[_0x5e3d2d(0x16d)](_0x1d7abd['projectName']+'/'+_0x1d7abd['agentName'])),console[_0x5e3d2d(0x120)]();const _0x43dc5e=[],_0x2ff229=[],_0x27e0f0=Date[_0x5e3d2d(0x12c)]();for(let _0x3c2d9a=0x0;_0x3c2d9a<_0x1a368c[_0x5e3d2d(0xfd)];_0x3c2d9a++){const _0xbbc9fb=_0x1a368c[_0x3c2d9a];_0x1a368c['length']>0x1?console[_0x5e3d2d(0x120)](_0x5e3d2d(0x109)+(_0x3c2d9a+0x1)+'/'+_0x1a368c['length']+':\x20'+a5_0x565188['white'](_0xbbc9fb[_0x5e3d2d(0x101)])):console[_0x5e3d2d(0x120)](_0x5e3d2d(0x10e)+a5_0x565188[_0x5e3d2d(0x16d)](_0xbbc9fb[_0x5e3d2d(0x101)]));const _0x42a25f=createCommandSpinner('Round\x201/'+_0xbbc9fb[_0x5e3d2d(0x11c)][_0x5e3d2d(0xfd)]+_0x5e3d2d(0xec));_0x42a25f[_0x5e3d2d(0x15f)]();try{const {result:_0x50aade,conversation:_0x57889f}=await runTest(_0x41a4f5[_0x5e3d2d(0x121)],_0xbbc9fb,{'agentId':_0x5df5d8,'projectId':_0x190ae1,'site':_0x248220,'noEval':_0x329d4d,'evaluatorId':_0x114c63,'onRoundStart':(_0x5c6eae,_0x3b4173)=>{const _0x17aa85=_0x5e3d2d;_0x42a25f[_0x17aa85(0x15a)]=_0x17aa85(0x15e)+(_0x5c6eae+0x1)+'/'+_0x3b4173+_0x17aa85(0xec);},'onRoundComplete':(_0x38cc37,_0x479bb9,_0x3a1e1e)=>{const _0x26ca62=_0x5e3d2d,_0x1be16b=formatElapsed(_0x479bb9);_0x3a1e1e?console[_0x26ca62(0x120)](_0x26ca62(0x16f)+(_0x38cc37+0x1)+'/'+_0xbbc9fb['rounds'][_0x26ca62(0xfd)]+_0x26ca62(0x178)+a5_0x565188['green']('✓')+'\x20('+_0x1be16b+')'):console[_0x26ca62(0x120)](_0x26ca62(0x16f)+(_0x38cc37+0x1)+'/'+_0xbbc9fb[_0x26ca62(0x11c)][_0x26ca62(0xfd)]+_0x26ca62(0x178)+a5_0x565188[_0x26ca62(0x104)]('✗'));},'onEvaluationStart':()=>{const _0x386a6c=_0x5e3d2d;_0x42a25f[_0x386a6c(0x15a)]=_0x386a6c(0x171);},'onEvaluationComplete':_0x4203ff=>{const _0x5c5087=_0x5e3d2d,_0x8128e9=formatElapsed(_0x4203ff);console[_0x5c5087(0x120)](_0x5c5087(0xfb)+a5_0x565188[_0x5c5087(0x149)]('✓')+'\x20('+_0x8128e9+')');}});_0x42a25f[_0x5e3d2d(0x107)](),_0x43dc5e['push'](_0x50aade),_0x2ff229[_0x5e3d2d(0x11d)](_0x57889f);if(_0x50aade['status']===_0x5e3d2d(0x17a))console['log'](a5_0x565188[_0x5e3d2d(0x149)](_0x5e3d2d(0x156)+_0x50aade[_0x5e3d2d(0x106)]));else _0x50aade[_0x5e3d2d(0x154)]==='FAIL'?console[_0x5e3d2d(0x120)](a5_0x565188[_0x5e3d2d(0x104)]('✗\x20FAIL:\x20'+_0x50aade[_0x5e3d2d(0x106)])):console['log'](a5_0x565188[_0x5e3d2d(0x104)](_0x5e3d2d(0x13a)+_0x50aade[_0x5e3d2d(0x106)]));_0x50aade[_0x5e3d2d(0x13d)]&&console[_0x5e3d2d(0x120)](a5_0x565188[_0x5e3d2d(0x100)](_0x5e3d2d(0x124)+_0x50aade[_0x5e3d2d(0x13d)])),console[_0x5e3d2d(0x120)]();}catch(_0x2a2c95){_0x42a25f['stop']();const _0x128f39=_0x2a2c95 instanceof Error?_0x2a2c95['message']:String(_0x2a2c95);console[_0x5e3d2d(0x120)](a5_0x565188[_0x5e3d2d(0x104)]('✗\x20ERROR:\x20'+_0x128f39)),console['log'](),_0x43dc5e[_0x5e3d2d(0x11d)]({'name':_0xbbc9fb[_0x5e3d2d(0x101)],'status':_0x5e3d2d(0x176),'reason':_0x128f39,'timestamp':new Date()[_0x5e3d2d(0x12e)](),'duration_ms':0x0});}}const _0xf7c64c=Date[_0x5e3d2d(0x12c)]()-_0x27e0f0,_0x371e52=_0x43dc5e[_0x5e3d2d(0x15b)](_0xd5f38f=>_0xd5f38f['status']===_0x5e3d2d(0x17a))[_0x5e3d2d(0xfd)],_0x10bb26=_0x43dc5e[_0x5e3d2d(0x15b)](_0x5c2ba6=>_0x5c2ba6[_0x5e3d2d(0x154)]==='FAIL')[_0x5e3d2d(0xfd)],_0x13a50e=_0x43dc5e[_0x5e3d2d(0x15b)](_0x5b4fc0=>_0x5b4fc0[_0x5e3d2d(0x154)]===_0x5e3d2d(0x176))[_0x5e3d2d(0xfd)];console[_0x5e3d2d(0x120)]('━'['repeat'](0x3c)),console[_0x5e3d2d(0x120)](_0x5e3d2d(0x16b)),console[_0x5e3d2d(0x120)]('━'[_0x5e3d2d(0x159)](0x3c)),console[_0x5e3d2d(0x120)]('Total:\x20\x20\x20\x20'+_0x43dc5e[_0x5e3d2d(0xfd)]),console[_0x5e3d2d(0x120)](_0x5e3d2d(0xf7)+a5_0x565188[_0x5e3d2d(0x149)](_0x371e52)),console[_0x5e3d2d(0x120)](_0x5e3d2d(0x144)+a5_0x565188[_0x5e3d2d(0x104)](_0x10bb26));_0x13a50e>0x0&&console['log'](_0x5e3d2d(0x113)+a5_0x565188[_0x5e3d2d(0x104)](_0x13a50e));console['log']('Duration:\x20'+formatElapsed(_0xf7c64c)),console[_0x5e3d2d(0x120)]('━'[_0x5e3d2d(0x159)](0x3c));const _0x5b73be=_0x43dc5e[_0x5e3d2d(0x15b)](_0x3d5a2c=>_0x3d5a2c['status']!=='PASS');if(_0x5b73be[_0x5e3d2d(0xfd)]>0x0){console[_0x5e3d2d(0x120)](),console['log']('Failed\x20Tests:');for(const _0x4a1736 of _0x5b73be){const _0x43006a=a5_0x565188[_0x5e3d2d(0x104)]('✗'),_0x55132b=_0x4a1736['reason']['length']>0x32?_0x4a1736[_0x5e3d2d(0x106)][_0x5e3d2d(0xfa)](0x0,0x32)+_0x5e3d2d(0x155):_0x4a1736[_0x5e3d2d(0x106)];console[_0x5e3d2d(0x120)]('\x20\x20'+_0x43006a+'\x20'+_0x4a1736[_0x5e3d2d(0x101)]+':\x20'+_0x55132b);}}const _0x11d9ef={'summary':{'total':_0x43dc5e[_0x5e3d2d(0xfd)],'passed':_0x371e52,'failed':_0x10bb26,'errors':_0x13a50e>0x0?_0x13a50e:undefined,'duration_ms':_0xf7c64c},'tests':_0x43dc5e,'agent':{'project':_0x1d7abd[_0x5e3d2d(0x129)],'name':_0x1d7abd[_0x5e3d2d(0x160)],'site':_0x248220},'timestamp':new Date(_0x27e0f0)['toISOString']()};try{const _0x37ce7b=buildCachedTestRun(_0x2ff229,{'site':_0x248220,'projectId':_0x190ae1,'projectName':_0x1d7abd[_0x5e3d2d(0x129)],'agentId':_0x5df5d8,'agentName':_0x1d7abd['agentName'],'testYmlPath':a5_0x418b8b[_0x5e3d2d(0x111)](_0x1d7abd[_0x5e3d2d(0x136)])});saveLastTestRun(_0x37ce7b);}catch{}if(_0x535b4f!==_0x5e3d2d(0x170)||_0x3c2901){const _0x131a1f=formatResults(_0x11d9ef,_0x535b4f);if(_0x3c2901)try{a5_0x5ec645['writeFileSync'](_0x3c2901,_0x131a1f,_0x5e3d2d(0x135)),console['log'](),console[_0x5e3d2d(0x120)](a5_0x565188[_0x5e3d2d(0x100)](_0x5e3d2d(0xed)+_0x3c2901));}catch(_0x1ac994){return console[_0x5e3d2d(0x120)](),console['log'](a5_0x565188[_0x5e3d2d(0x104)](_0x5e3d2d(0x157)+_0x1ac994)),0x1;}else console['log'](),console[_0x5e3d2d(0x120)](_0x131a1f);}return _0x5b73be[_0x5e3d2d(0xfd)]>0x0?0x1:0x0;}async['executeReeval'](_0x1970b9,_0x504ad1){const _0x3982f5=a5_0x523791,{options:_0x2db70f,tdx:_0x5a1cfa}=_0x1970b9,{definition:_0x40b1dc,agentInfo:_0x190099,outputFormat:_0x11cc7b,outputFile:_0x4433e9}=_0x504ad1,_0x3796e4=_0x2db70f[_0x3982f5(0x13f)],_0x32b91e=loadLastTestRun();if(!_0x32b91e)return console[_0x3982f5(0x120)](a5_0x565188['red']('Error:\x20No\x20previous\x20test\x20run\x20found.')),console[_0x3982f5(0x120)](a5_0x565188[_0x3982f5(0x100)]('Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.')),0x1;if(_0x32b91e['agent'][_0x3982f5(0x160)]!==_0x190099['agentName'])return console[_0x3982f5(0x120)](a5_0x565188[_0x3982f5(0x104)]('Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22'+_0x32b91e[_0x3982f5(0x10b)]['agentName']+_0x3982f5(0xf4)+_0x190099[_0x3982f5(0x160)]+'\x22.')),console[_0x3982f5(0x120)](a5_0x565188[_0x3982f5(0x100)](_0x3982f5(0x119))),0x1;const _0x2f242d=new Set(_0x32b91e[_0x3982f5(0x150)][_0x3982f5(0x141)](_0x541bfd=>_0x541bfd['testName'])),_0x4e3de2=_0x40b1dc[_0x3982f5(0xf1)][_0x3982f5(0x15b)](_0x152eea=>!_0x2f242d['has'](_0x152eea['name']));if(_0x4e3de2[_0x3982f5(0xfd)]>0x0&&_0x32b91e['site']!==_0x3796e4)return console['log'](a5_0x565188[_0x3982f5(0x104)]('Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.')),console[_0x3982f5(0x120)](a5_0x565188[_0x3982f5(0x100)]('Cached\x20run\x20is\x20from\x20site\x20\x22'+_0x32b91e['site']+_0x3982f5(0x10d)+_0x3796e4+'\x22.')),console['log'](a5_0x565188[_0x3982f5(0x100)](_0x3982f5(0x11e)+_0x32b91e[_0x3982f5(0x13f)]+'\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.')),0x1;const _0x1109d6=_0x40b1dc['tests']['filter'](_0xfed0fc=>_0x2f242d[_0x3982f5(0x179)](_0xfed0fc[_0x3982f5(0x101)])),_0x4eb7c1=_0x4e3de2;let _0x3298bc;try{_0x3298bc=await setupEvaluatorAgent(_0x5a1cfa[_0x3982f5(0x121)],_0x2db70f[_0x3982f5(0x163)]);}catch(_0x4660b3){const _0x43b9d6=_0x4660b3 instanceof Error?_0x4660b3['message']:String(_0x4660b3);return console[_0x3982f5(0x120)](a5_0x565188['red'](_0x3982f5(0x161)+_0x43b9d6)),0x1;}console[_0x3982f5(0x120)](a5_0x565188['cyan'](_0x3982f5(0x15c))),console[_0x3982f5(0x120)](_0x3982f5(0x10c)+a5_0x565188[_0x3982f5(0x16d)](_0x32b91e[_0x3982f5(0x17c)])),console[_0x3982f5(0x120)](_0x3982f5(0x125)+a5_0x565188[_0x3982f5(0x16d)](_0x32b91e[_0x3982f5(0x10b)][_0x3982f5(0x129)]+'/'+_0x32b91e[_0x3982f5(0x10b)][_0x3982f5(0x160)]));_0x4eb7c1[_0x3982f5(0xfd)]>0x0&&console[_0x3982f5(0x120)](_0x3982f5(0x115)+a5_0x565188[_0x3982f5(0x105)](_0x4eb7c1[_0x3982f5(0xfd)]));console[_0x3982f5(0x120)]();const _0x282ca8=[],_0xfd1db6=Date[_0x3982f5(0x12c)](),_0x5c5c4d=createCommandSpinner('Re-evaluating...');if(_0x1109d6['length']>0x0)try{const _0x3cdf46=await reevaluateFromCache(_0x5a1cfa['llm'],_0x32b91e,{'tests':_0x1109d6},{'evaluatorId':_0x3298bc,'onTestStart':(_0x1dd863,_0x1528d6,_0x3108c0)=>{const _0x63ac71=_0x3982f5;_0x5c5c4d[_0x63ac71(0x15a)]='Re-evaluating\x20'+(_0x1528d6+0x1)+'/'+_0x3108c0+':\x20'+_0x1dd863+'...';if(!_0x5c5c4d[_0x63ac71(0x148)])_0x5c5c4d[_0x63ac71(0x15f)]();},'onTestComplete':(_0x5e49ce,_0x4ed3ce)=>{const _0x33a452=_0x3982f5;_0x5c5c4d[_0x33a452(0x107)]();if(_0x4ed3ce[_0x33a452(0x154)]===_0x33a452(0x17a))console[_0x33a452(0x120)](a5_0x565188[_0x33a452(0x149)](_0x33a452(0x156)+_0x5e49ce)+a5_0x565188[_0x33a452(0x100)](_0x33a452(0x143)));else _0x4ed3ce[_0x33a452(0x154)]==='FAIL'?console[_0x33a452(0x120)](a5_0x565188[_0x33a452(0x104)](_0x33a452(0x130)+_0x5e49ce+'\x20-\x20'+_0x4ed3ce[_0x33a452(0x106)])+a5_0x565188[_0x33a452(0x100)](_0x33a452(0x143))):console[_0x33a452(0x120)](a5_0x565188[_0x33a452(0x104)](_0x33a452(0x13a)+_0x5e49ce+_0x33a452(0x166)+_0x4ed3ce[_0x33a452(0x106)]));_0x4ed3ce['conversation_url']&&console[_0x33a452(0x120)](a5_0x565188[_0x33a452(0x100)](_0x33a452(0x147)+_0x4ed3ce['conversation_url'])),_0x282ca8[_0x33a452(0x11d)](_0x4ed3ce);},'onTestSkipped':(_0x13c3ab,_0x2cebac)=>{const _0x4dfe1d=_0x3982f5;_0x5c5c4d[_0x4dfe1d(0x107)](),console[_0x4dfe1d(0x120)](a5_0x565188[_0x4dfe1d(0x105)](_0x4dfe1d(0x11f)+_0x13c3ab+'\x20-\x20'+_0x2cebac));}});for(const _0x433844 of _0x3cdf46){!_0x282ca8['find'](_0x11369a=>_0x11369a[_0x3982f5(0x101)]===_0x433844[_0x3982f5(0x101)])&&_0x282ca8['push'](_0x433844);}}catch(_0xb7889b){_0x5c5c4d[_0x3982f5(0x107)]();const _0x42a35c=_0xb7889b instanceof Error?_0xb7889b[_0x3982f5(0x177)]:String(_0xb7889b);return console[_0x3982f5(0x120)](a5_0x565188['red'](_0x3982f5(0x169)+_0x42a35c)),0x1;}_0x5c5c4d[_0x3982f5(0x107)]();if(_0x4eb7c1[_0x3982f5(0xfd)]>0x0){console[_0x3982f5(0x120)](),console[_0x3982f5(0x120)](a5_0x565188['cyan']('Executing\x20new\x20tests...'));const {projectId:_0x2a93ae,agentId:_0x12466d}=_0x32b91e[_0x3982f5(0x10b)];for(const _0x2bd9a9 of _0x4eb7c1){console[_0x3982f5(0x120)](_0x3982f5(0x16c)+a5_0x565188[_0x3982f5(0x16d)](_0x2bd9a9[_0x3982f5(0x101)]));const _0x7eafb2=createCommandSpinner(_0x3982f5(0x17b)+_0x2bd9a9[_0x3982f5(0x11c)][_0x3982f5(0xfd)]+':\x20Sending\x20user\x20input...');_0x7eafb2[_0x3982f5(0x15f)]();try{const {result:_0x5eb39c}=await runTest(_0x5a1cfa[_0x3982f5(0x121)],_0x2bd9a9,{'agentId':_0x12466d,'projectId':_0x2a93ae,'site':_0x32b91e['site'],'noEval':![],'evaluatorId':_0x3298bc,'onRoundStart':(_0x21de15,_0x3e9225)=>{const _0x38735f=_0x3982f5;_0x7eafb2[_0x38735f(0x15a)]=_0x38735f(0x15e)+(_0x21de15+0x1)+'/'+_0x3e9225+_0x38735f(0xec);},'onRoundComplete':(_0x461ddc,_0x3bdc3b,_0xd22a32)=>{const _0x1874f0=_0x3982f5,_0x57ff50=formatElapsed(_0x3bdc3b);_0xd22a32?console['log'](_0x1874f0(0x16f)+(_0x461ddc+0x1)+'/'+_0x2bd9a9[_0x1874f0(0x11c)][_0x1874f0(0xfd)]+_0x1874f0(0x178)+a5_0x565188[_0x1874f0(0x149)]('✓')+'\x20('+_0x57ff50+')'):console['log'](_0x1874f0(0x16f)+(_0x461ddc+0x1)+'/'+_0x2bd9a9[_0x1874f0(0x11c)][_0x1874f0(0xfd)]+_0x1874f0(0x178)+a5_0x565188[_0x1874f0(0x104)]('✗'));},'onEvaluationStart':()=>{const _0x215b36=_0x3982f5;_0x7eafb2[_0x215b36(0x15a)]=_0x215b36(0x171);},'onEvaluationComplete':_0x31a421=>{const _0x50d86f=_0x3982f5,_0x3ddbfa=formatElapsed(_0x31a421);console['log'](_0x50d86f(0xfb)+a5_0x565188[_0x50d86f(0x149)]('✓')+'\x20('+_0x3ddbfa+')');}});_0x7eafb2[_0x3982f5(0x107)](),_0x282ca8[_0x3982f5(0x11d)](_0x5eb39c);if(_0x5eb39c[_0x3982f5(0x154)]===_0x3982f5(0x17a))console[_0x3982f5(0x120)](a5_0x565188['green'](_0x3982f5(0x156)+_0x5eb39c[_0x3982f5(0x106)])+a5_0x565188[_0x3982f5(0x100)](_0x3982f5(0x11a)));else _0x5eb39c[_0x3982f5(0x154)]===_0x3982f5(0x164)?console[_0x3982f5(0x120)](a5_0x565188['red'](_0x3982f5(0x130)+_0x5eb39c['reason'])+a5_0x565188[_0x3982f5(0x100)](_0x3982f5(0x11a))):console['log'](a5_0x565188[_0x3982f5(0x104)](_0x3982f5(0x13a)+_0x5eb39c[_0x3982f5(0x106)]));_0x5eb39c[_0x3982f5(0x13d)]&&console[_0x3982f5(0x120)](a5_0x565188[_0x3982f5(0x100)](_0x3982f5(0x147)+_0x5eb39c[_0x3982f5(0x13d)]));}catch(_0x28b509){_0x7eafb2[_0x3982f5(0x107)]();const _0x545d31=_0x28b509 instanceof Error?_0x28b509[_0x3982f5(0x177)]:String(_0x28b509);console[_0x3982f5(0x120)](a5_0x565188[_0x3982f5(0x104)]('✗\x20ERROR:\x20'+_0x545d31)),_0x282ca8['push']({'name':_0x2bd9a9['name'],'status':_0x3982f5(0x176),'reason':_0x545d31,'timestamp':new Date()[_0x3982f5(0x12e)](),'duration_ms':0x0});}}}console[_0x3982f5(0x120)]();const _0x466971=Date[_0x3982f5(0x12c)]()-_0xfd1db6,_0x3ccc0c=_0x282ca8['filter'](_0x98808b=>_0x98808b[_0x3982f5(0x154)]===_0x3982f5(0x17a))[_0x3982f5(0xfd)],_0x5a4f89=_0x282ca8[_0x3982f5(0x15b)](_0x842a=>_0x842a['status']===_0x3982f5(0x164))[_0x3982f5(0xfd)],_0x1b38c1=_0x282ca8['filter'](_0xb7612d=>_0xb7612d[_0x3982f5(0x154)]===_0x3982f5(0x176))[_0x3982f5(0xfd)];console[_0x3982f5(0x120)]('━'[_0x3982f5(0x159)](0x3c)),console[_0x3982f5(0x120)](_0x3982f5(0x12b)),console[_0x3982f5(0x120)]('━'[_0x3982f5(0x159)](0x3c)),console[_0x3982f5(0x120)]('Total:\x20\x20\x20\x20'+_0x282ca8[_0x3982f5(0xfd)]),console[_0x3982f5(0x120)](_0x3982f5(0xf7)+a5_0x565188[_0x3982f5(0x149)](_0x3ccc0c)),console[_0x3982f5(0x120)](_0x3982f5(0x144)+a5_0x565188[_0x3982f5(0x104)](_0x5a4f89));_0x1b38c1>0x0&&console[_0x3982f5(0x120)](_0x3982f5(0x113)+a5_0x565188[_0x3982f5(0x104)](_0x1b38c1));console[_0x3982f5(0x120)](_0x3982f5(0x146)+formatElapsed(_0x466971)),console['log']('━'[_0x3982f5(0x159)](0x3c));const _0x46a370={'summary':{'total':_0x282ca8[_0x3982f5(0xfd)],'passed':_0x3ccc0c,'failed':_0x5a4f89,'errors':_0x1b38c1>0x0?_0x1b38c1:undefined,'duration_ms':_0x466971},'tests':_0x282ca8,'agent':{'project':_0x190099[_0x3982f5(0x129)],'name':_0x190099[_0x3982f5(0x160)],'site':_0x3796e4},'timestamp':new Date(_0xfd1db6)[_0x3982f5(0x12e)]()};if(_0x11cc7b!=='table'||_0x4433e9){const _0xc0dc35=formatResults(_0x46a370,_0x11cc7b);if(_0x4433e9)try{a5_0x5ec645[_0x3982f5(0x12d)](_0x4433e9,_0xc0dc35,'utf-8'),console[_0x3982f5(0x120)](),console[_0x3982f5(0x120)](a5_0x565188[_0x3982f5(0x100)]('Output\x20written\x20to:\x20'+_0x4433e9));}catch(_0x1892d8){return console[_0x3982f5(0x120)](),console['log'](a5_0x565188['red'](_0x3982f5(0x157)+_0x1892d8)),0x1;}else console[_0x3982f5(0x120)](),console[_0x3982f5(0x120)](_0xc0dc35);}const _0x325423=_0x282ca8[_0x3982f5(0x15b)](_0x327177=>_0x327177[_0x3982f5(0x154)]!==_0x3982f5(0x17a));return _0x325423[_0x3982f5(0xfd)]>0x0?0x1:0x0;}}
@@ -1 +1 @@
1
- function a6_0x4553(_0x38f78e,_0x3ec555){_0x38f78e=_0x38f78e-0x174;const _0x2e6943=a6_0x2e69();let _0x455370=_0x2e6943[_0x38f78e];return _0x455370;}function a6_0x2e69(){const _0x55416d=['stack','\x0aStack\x20trace:\x0a','x-trino-user','427508cjHXiY','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','noColor','2044748HlTurD','set-cookie','workflow','header','body','includes','Error:\x20','x-auth-token','llm','site','error','message','startsWith','POST','isArray','color','status','type','api','authorization','cdp','headers','\x22.\x20','substring','64792QatFlG','Invalid\x20header\x20format:\x20\x22','trino','GET','x-xsrf-token','46801500OeRNyL','Results\x20saved\x20to\x20','output','137430mLPggy','verbose','set-cookie2','log','<\x20HTTP/1.1\x20','data','trim','PATCH','method','length','file','request','PUT','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','207HUOXfD','join','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','readBodyFromFile','validate','567eXVZZd','DELETE','entries','toLowerCase','4kfHqUv','1839006VoqbZI','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','8245870BfVLDI','toUpperCase','Invalid\x20HTTP\x20method:\x20','execute','llm-proxy'];a6_0x2e69=function(){return _0x55416d;};return a6_0x2e69();}const a6_0x2c8340=a6_0x4553;(function(_0x4b4525,_0x176d74){const _0x327c52=a6_0x4553,_0x49c195=_0x4b4525();while(!![]){try{const _0x19fd9a=-parseInt(_0x327c52(0x1a7))/0x1*(-parseInt(_0x327c52(0x1b2))/0x2)+parseInt(_0x327c52(0x1a8))/0x3+parseInt(_0x327c52(0x1b5))/0x4+parseInt(_0x327c52(0x1aa))/0x5+parseInt(_0x327c52(0x18f))/0x6*(parseInt(_0x327c52(0x1a3))/0x7)+parseInt(_0x327c52(0x187))/0x8*(parseInt(_0x327c52(0x19d))/0x9)+-parseInt(_0x327c52(0x18c))/0xa;if(_0x19fd9a===_0x176d74)break;else _0x49c195['push'](_0x49c195['shift']());}catch(_0x3ea7f9){_0x49c195['push'](_0x49c195['shift']());}}}(a6_0x2e69,0xf1a73));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a6_0x2c8340(0x182),'proxy-authorization','cookie',a6_0x2c8340(0x1b6),a6_0x2c8340(0x191),a6_0x2c8340(0x18b),a6_0x2c8340(0x176),a6_0x2c8340(0x1b1)]);function isSensitiveHeader(_0x44cc7b){const _0x1de6c3=a6_0x2c8340;return SENSITIVE_HEADERS['has'](_0x44cc7b[_0x1de6c3(0x1a6)]());}function parseHeader(_0x5bf3d2){const _0x464d93=a6_0x2c8340,_0x284d80=_0x5bf3d2['indexOf'](':');if(_0x284d80===-0x1)throw new Error(_0x464d93(0x188)+_0x5bf3d2+_0x464d93(0x185)+_0x464d93(0x19c));const _0x1dfe77=_0x5bf3d2[_0x464d93(0x186)](0x0,_0x284d80)[_0x464d93(0x195)](),_0x50e591=_0x5bf3d2['substring'](_0x284d80+0x1)[_0x464d93(0x195)]();if(!_0x1dfe77)throw new Error(_0x464d93(0x1b3)+_0x5bf3d2+'\x22');return[_0x1dfe77,_0x50e591];}export class ApiCommand extends BaseCommand{['name']=a6_0x2c8340(0x181);['description']=a6_0x2c8340(0x1a0);[a6_0x2c8340(0x1a2)](_0x22184c){const _0x43547d=a6_0x2c8340,{args:_0x2d7600,options:_0xef7d1}=_0x22184c,_0x1dc783=_0xef7d1;if(_0x2d7600['length']===0x0)return _0x43547d(0x1a9);const _0x17a3d5=_0x2d7600[0x0];if(!_0x17a3d5[_0x43547d(0x17b)]('/'))return'Endpoint\x20must\x20start\x20with\x20/:\x20'+_0x17a3d5;const _0x51d53c=_0x1dc783['data'],_0x12d98d=_0x1dc783[_0x43547d(0x199)];if(_0x51d53c&&_0x12d98d)return _0x43547d(0x19f);const _0x340984=_0x1dc783['method']||_0x43547d(0x18a),_0x193e6e=[_0x43547d(0x18a),_0x43547d(0x17c),_0x43547d(0x19b),_0x43547d(0x1a4),_0x43547d(0x196)];if(!_0x193e6e['includes'](_0x340984[_0x43547d(0x1ab)]()))return _0x43547d(0x1ac)+_0x340984+'.\x20Valid\x20methods:\x20'+_0x193e6e[_0x43547d(0x19e)](',\x20');const _0x53c83b=_0x1dc783['type']||'td',_0xf49542=['td',_0x43547d(0x183),_0x43547d(0x1b7),_0x43547d(0x189),_0x43547d(0x177),_0x43547d(0x1ae)];if(!_0xf49542[_0x43547d(0x174)](_0x53c83b))return'Invalid\x20API\x20type:\x20'+_0x53c83b+'.\x20Valid\x20types:\x20'+_0xf49542[_0x43547d(0x19e)](',\x20');return undefined;}async[a6_0x2c8340(0x1ad)](_0x368201){const _0x4b65b1=a6_0x2c8340,{options:_0x57d4ee,args:_0x30a769,tdx:_0x3433fb}=_0x368201,_0x2c137f=_0x57d4ee,_0x5109d5=_0x30a769[0x0],_0x45f938=(_0x2c137f[_0x4b65b1(0x197)]||'GET')[_0x4b65b1(0x1ab)](),_0x3e6422=_0x2c137f[_0x4b65b1(0x194)],_0x38a68b=_0x2c137f[_0x4b65b1(0x199)],_0x41bd5e=_0x2c137f[_0x4b65b1(0x1b8)],_0x50761f=_0x2c137f[_0x4b65b1(0x180)]||'td';try{const _0x48ceda={};if(_0x41bd5e){const _0x3a3127=Array[_0x4b65b1(0x17d)](_0x41bd5e)?_0x41bd5e:[_0x41bd5e];for(const _0x13c722 of _0x3a3127){const [_0x210bc1,_0x2f147d]=parseHeader(_0x13c722);_0x48ceda[_0x210bc1]=_0x2f147d;}}let _0x2a9224;if(_0x3e6422)_0x2a9224=_0x3e6422;else{if(_0x38a68b)try{_0x2a9224=RawAPI[_0x4b65b1(0x1a1)](_0x38a68b);}catch(_0x436eb7){return console[_0x4b65b1(0x179)](_0x4b65b1(0x175)+(_0x436eb7 instanceof Error?_0x436eb7[_0x4b65b1(0x17a)]:String(_0x436eb7))),0x1;}}const _0x3de8a8={'method':_0x45f938,'apiType':_0x50761f,'includeHeaders':_0x57d4ee['verbose']};_0x2a9224&&(_0x3de8a8[_0x4b65b1(0x1b9)]=_0x2a9224);Object['keys'](_0x48ceda)[_0x4b65b1(0x198)]>0x0&&(_0x3de8a8['headers']=_0x48ceda);if(_0x57d4ee[_0x4b65b1(0x190)]){const _0x45e688=resolveSite(_0x57d4ee[_0x4b65b1(0x178)]),_0x3fd4df=getEndpoint(_0x45e688,_0x50761f),_0x183579=''+_0x3fd4df+_0x5109d5;console[_0x4b65b1(0x179)]('>\x20'+_0x45f938+'\x20'+_0x183579);const _0x3f2e00=getAuthHeaders(_0x45e688),_0x2e5edc={..._0x3f2e00,..._0x48ceda};for(const [_0x39f142,_0x53a03f]of Object[_0x4b65b1(0x1a5)](_0x2e5edc)){!isSensitiveHeader(_0x39f142)&&console[_0x4b65b1(0x179)]('>\x20'+_0x39f142+':\x20'+_0x53a03f);}_0x2a9224&&console['error']('>'),console['error']('');}const _0x5c7461=await _0x3433fb['api'][_0x4b65b1(0x19a)](_0x5109d5,_0x3de8a8);if(_0x57d4ee[_0x4b65b1(0x190)]&&_0x5c7461['headers']){console[_0x4b65b1(0x179)](_0x4b65b1(0x193)+_0x5c7461[_0x4b65b1(0x17f)]);for(const [_0x2faa0d,_0x290d97]of Object[_0x4b65b1(0x1a5)](_0x5c7461[_0x4b65b1(0x184)])){!isSensitiveHeader(_0x2faa0d)&&console[_0x4b65b1(0x179)]('<\x20'+_0x2faa0d+':\x20'+_0x290d97);}console[_0x4b65b1(0x179)]('');}const _0x1256b7=Boolean(_0x57d4ee[_0x4b65b1(0x18e)]),_0x412a69={'color':_0x57d4ee[_0x4b65b1(0x17e)],'noColor':_0x57d4ee[_0x4b65b1(0x1b4)]||_0x1256b7&&!_0x57d4ee[_0x4b65b1(0x17e)]},_0x478e76=colorizeJSON(_0x5c7461['data'],_0x412a69);return _0x57d4ee[_0x4b65b1(0x18e)]?(writeFileSync(_0x57d4ee[_0x4b65b1(0x18e)],_0x478e76),console[_0x4b65b1(0x179)](_0x4b65b1(0x18d)+_0x57d4ee[_0x4b65b1(0x18e)])):console[_0x4b65b1(0x192)](_0x478e76),0x0;}catch(_0x415a35){return _0x415a35 instanceof Error?(console['error'](_0x4b65b1(0x175)+_0x415a35[_0x4b65b1(0x17a)]),_0x57d4ee[_0x4b65b1(0x190)]&&_0x415a35[_0x4b65b1(0x1af)]&&console[_0x4b65b1(0x179)](_0x4b65b1(0x1b0)+_0x415a35[_0x4b65b1(0x1af)])):console['error']('Error:\x20'+String(_0x415a35)),0x1;}}}
1
+ function a6_0x46e4(){const _0x409645=['DELETE','headers','415112mjxsCv','trim','validate','entries','readBodyFromFile','verbose','join','Invalid\x20API\x20type:\x20','keys','stack','indexOf','log','x-xsrf-token','error','POST','4700829LLikup','PUT','description','length','1728664KdIowg','46677612DmKKFz','.\x20Valid\x20types:\x20','cdp','Endpoint\x20must\x20start\x20with\x20/:\x20','body','includes','method','status','llm','toLowerCase','data','execute','27ADmaaA','has','isArray','\x22.\x20','header','11ZDDOOE','message','38aweaEJ','set-cookie','x-auth-token','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','file','color','toUpperCase','24IlSQSG','Results\x20saved\x20to\x20','name','GET','site','api','startsWith','Error:\x20','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','11866570znebHU','cookie','12703WcrPXf','trino','4dUZxnK','substring','noColor','type','output','proxy-authorization','Invalid\x20HTTP\x20method:\x20','4681255WsatSz','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','set-cookie2'];a6_0x46e4=function(){return _0x409645;};return a6_0x46e4();}const a6_0x114ed4=a6_0x23d9;(function(_0x6adc84,_0x51c13b){const _0x227015=a6_0x23d9,_0x38d837=_0x6adc84();while(!![]){try{const _0x299a58=parseInt(_0x227015(0x173))/0x1*(-parseInt(_0x227015(0x160))/0x2)+-parseInt(_0x227015(0x148))/0x3+parseInt(_0x227015(0x175))/0x4*(parseInt(_0x227015(0x134))/0x5)+-parseInt(_0x227015(0x167))/0x6*(parseInt(_0x227015(0x14c))/0x7)+parseInt(_0x227015(0x139))/0x8*(parseInt(_0x227015(0x159))/0x9)+-parseInt(_0x227015(0x171))/0xa+parseInt(_0x227015(0x15e))/0xb*(parseInt(_0x227015(0x14d))/0xc);if(_0x299a58===_0x51c13b)break;else _0x38d837['push'](_0x38d837['shift']());}catch(_0x324277){_0x38d837['push'](_0x38d837['shift']());}}}(a6_0x46e4,0xf3e2a));function a6_0x23d9(_0x21ab24,_0xd443e3){_0x21ab24=_0x21ab24-0x131;const _0x46e4f2=a6_0x46e4();let _0x23d9cb=_0x46e4f2[_0x21ab24];return _0x23d9cb;}import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set(['authorization',a6_0x114ed4(0x132),a6_0x114ed4(0x172),a6_0x114ed4(0x161),a6_0x114ed4(0x136),a6_0x114ed4(0x145),a6_0x114ed4(0x162),'x-trino-user']);function isSensitiveHeader(_0x54a56b){const _0x316e4d=a6_0x114ed4;return SENSITIVE_HEADERS[_0x316e4d(0x15a)](_0x54a56b[_0x316e4d(0x156)]());}function parseHeader(_0x4f7d45){const _0x3f0cd6=a6_0x114ed4,_0x4a286b=_0x4f7d45[_0x3f0cd6(0x143)](':');if(_0x4a286b===-0x1)throw new Error('Invalid\x20header\x20format:\x20\x22'+_0x4f7d45+_0x3f0cd6(0x15c)+'Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22');const _0x52439a=_0x4f7d45[_0x3f0cd6(0x176)](0x0,_0x4a286b)['trim'](),_0x5e6eba=_0x4f7d45[_0x3f0cd6(0x176)](_0x4a286b+0x1)[_0x3f0cd6(0x13a)]();if(!_0x52439a)throw new Error(_0x3f0cd6(0x163)+_0x4f7d45+'\x22');return[_0x52439a,_0x5e6eba];}export class ApiCommand extends BaseCommand{[a6_0x114ed4(0x169)]=a6_0x114ed4(0x16c);[a6_0x114ed4(0x14a)]=a6_0x114ed4(0x16f);[a6_0x114ed4(0x13b)](_0x8a7e72){const _0x25b564=a6_0x114ed4,{args:_0x118dd8,options:_0x3fe830}=_0x8a7e72,_0x5a1b4c=_0x3fe830;if(_0x118dd8[_0x25b564(0x14b)]===0x0)return _0x25b564(0x170);const _0x2c89bf=_0x118dd8[0x0];if(!_0x2c89bf[_0x25b564(0x16d)]('/'))return _0x25b564(0x150)+_0x2c89bf;const _0x26969b=_0x5a1b4c[_0x25b564(0x157)],_0x2e4f67=_0x5a1b4c[_0x25b564(0x164)];if(_0x26969b&&_0x2e4f67)return _0x25b564(0x135);const _0x501fe2=_0x5a1b4c[_0x25b564(0x153)]||'GET',_0x5082fc=[_0x25b564(0x16a),_0x25b564(0x147),_0x25b564(0x149),_0x25b564(0x137),'PATCH'];if(!_0x5082fc[_0x25b564(0x152)](_0x501fe2[_0x25b564(0x166)]()))return _0x25b564(0x133)+_0x501fe2+'.\x20Valid\x20methods:\x20'+_0x5082fc['join'](',\x20');const _0xfa7e03=_0x5a1b4c['type']||'td',_0xb8e4af=['td',_0x25b564(0x14f),'workflow',_0x25b564(0x174),_0x25b564(0x155),'llm-proxy'];if(!_0xb8e4af[_0x25b564(0x152)](_0xfa7e03))return _0x25b564(0x140)+_0xfa7e03+_0x25b564(0x14e)+_0xb8e4af[_0x25b564(0x13f)](',\x20');return undefined;}async[a6_0x114ed4(0x158)](_0x503d1e){const _0x417dd5=a6_0x114ed4,{options:_0x371fcf,args:_0x3c9b49,tdx:_0x806433}=_0x503d1e,_0x492275=_0x371fcf,_0x372d7e=_0x3c9b49[0x0],_0x5122f7=(_0x492275[_0x417dd5(0x153)]||_0x417dd5(0x16a))[_0x417dd5(0x166)](),_0x13614f=_0x492275['data'],_0x39fe9b=_0x492275['file'],_0x4d4b51=_0x492275[_0x417dd5(0x15d)],_0x32cbe7=_0x492275[_0x417dd5(0x178)]||'td';try{const _0xb77e05={};if(_0x4d4b51){const _0x362720=Array[_0x417dd5(0x15b)](_0x4d4b51)?_0x4d4b51:[_0x4d4b51];for(const _0x27ac6c of _0x362720){const [_0x143dee,_0x33c114]=parseHeader(_0x27ac6c);_0xb77e05[_0x143dee]=_0x33c114;}}let _0x318406;if(_0x13614f)_0x318406=_0x13614f;else{if(_0x39fe9b)try{_0x318406=RawAPI[_0x417dd5(0x13d)](_0x39fe9b);}catch(_0x4986c5){return console[_0x417dd5(0x146)](_0x417dd5(0x16e)+(_0x4986c5 instanceof Error?_0x4986c5[_0x417dd5(0x15f)]:String(_0x4986c5))),0x1;}}const _0x5e8aa2={'method':_0x5122f7,'apiType':_0x32cbe7,'includeHeaders':_0x371fcf[_0x417dd5(0x13e)]};_0x318406&&(_0x5e8aa2[_0x417dd5(0x151)]=_0x318406);Object[_0x417dd5(0x141)](_0xb77e05)[_0x417dd5(0x14b)]>0x0&&(_0x5e8aa2[_0x417dd5(0x138)]=_0xb77e05);if(_0x371fcf[_0x417dd5(0x13e)]){const _0x256da9=resolveSite(_0x371fcf[_0x417dd5(0x16b)]),_0x49be9b=getEndpoint(_0x256da9,_0x32cbe7),_0x2c24ce=''+_0x49be9b+_0x372d7e;console[_0x417dd5(0x146)]('>\x20'+_0x5122f7+'\x20'+_0x2c24ce);const _0x2078d9=getAuthHeaders(_0x256da9),_0x142219={..._0x2078d9,..._0xb77e05};for(const [_0x4c6b3e,_0x424b86]of Object['entries'](_0x142219)){!isSensitiveHeader(_0x4c6b3e)&&console[_0x417dd5(0x146)]('>\x20'+_0x4c6b3e+':\x20'+_0x424b86);}_0x318406&&console[_0x417dd5(0x146)]('>'),console['error']('');}const _0x3eac2a=await _0x806433['api']['request'](_0x372d7e,_0x5e8aa2);if(_0x371fcf[_0x417dd5(0x13e)]&&_0x3eac2a[_0x417dd5(0x138)]){console[_0x417dd5(0x146)]('<\x20HTTP/1.1\x20'+_0x3eac2a[_0x417dd5(0x154)]);for(const [_0x29acc9,_0x27caa4]of Object[_0x417dd5(0x13c)](_0x3eac2a[_0x417dd5(0x138)])){!isSensitiveHeader(_0x29acc9)&&console['error']('<\x20'+_0x29acc9+':\x20'+_0x27caa4);}console[_0x417dd5(0x146)]('');}const _0xbf939f=Boolean(_0x371fcf['output']),_0x4bcf9a={'color':_0x371fcf[_0x417dd5(0x165)],'noColor':_0x371fcf[_0x417dd5(0x177)]||_0xbf939f&&!_0x371fcf[_0x417dd5(0x165)]},_0x4b77e2=colorizeJSON(_0x3eac2a[_0x417dd5(0x157)],_0x4bcf9a);return _0x371fcf[_0x417dd5(0x131)]?(writeFileSync(_0x371fcf['output'],_0x4b77e2),console[_0x417dd5(0x146)](_0x417dd5(0x168)+_0x371fcf['output'])):console[_0x417dd5(0x144)](_0x4b77e2),0x0;}catch(_0x4631dc){return _0x4631dc instanceof Error?(console[_0x417dd5(0x146)](_0x417dd5(0x16e)+_0x4631dc[_0x417dd5(0x15f)]),_0x371fcf[_0x417dd5(0x13e)]&&_0x4631dc[_0x417dd5(0x142)]&&console['error']('\x0aStack\x20trace:\x0a'+_0x4631dc[_0x417dd5(0x142)])):console[_0x417dd5(0x146)](_0x417dd5(0x16e)+String(_0x4631dc)),0x1;}}}
@@ -1 +1 @@
1
- const a7_0x1e1706=a7_0x4da9;(function(_0x16ac86,_0x51b7d7){const _0x52b71d=a7_0x4da9,_0x1c5fb2=_0x16ac86();while(!![]){try{const _0x34042d=parseInt(_0x52b71d(0x17b))/0x1+-parseInt(_0x52b71d(0x16f))/0x2+parseInt(_0x52b71d(0x16e))/0x3+-parseInt(_0x52b71d(0x146))/0x4*(-parseInt(_0x52b71d(0x15d))/0x5)+parseInt(_0x52b71d(0x152))/0x6+-parseInt(_0x52b71d(0x186))/0x7+-parseInt(_0x52b71d(0x17f))/0x8;if(_0x34042d===_0x51b7d7)break;else _0x1c5fb2['push'](_0x1c5fb2['shift']());}catch(_0x4710be){_0x1c5fb2['push'](_0x1c5fb2['shift']());}}}(a7_0x1172,0x9091f));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';function a7_0x4da9(_0x139f60,_0x11310f){_0x139f60=_0x139f60-0x145;const _0x117249=a7_0x1172();let _0x4da93a=_0x117249[_0x139f60];return _0x4da93a;}import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{deleteOAuthTokens}from'../core/oauth-keychain.js';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_0x1adc16 from'prompts';import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';function a7_0x1172(){const _0xb76170=['logLevel','name','all','warn','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','error','execute','N/A','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','OAuth\x20(browser\x20login)','description','3688tWYWiU','profile','us01','auth:clear','Read\x20credential\x20from\x20','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','green','Read\x20credential\x20from\x20keychain','jobs','/app/mp/ak','✗\x20Validation\x20failed:\x20','site','2925684ermtFx','red','create','password','\x20(profile:\x20','Name:\x20','\x20for\x20profile:\x20','bold','\x20removed\x20from\x20keychain','log','OAuth\x20tokens','950AuKSJf','method','tdx:\x20auth\x20clear','System\x20keychain\x20is\x20not\x20available','last_name','getUserInfo','email','API\x20key\x20cannot\x20be\x20empty','Choose\x20authentication\x20method:','\x0aSetup\x20cancelled','trim','API\x20Key','\x27\x20registered','Setting\x20up\x20authentication\x20for\x20site:\x20','join','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','Setup\x20API\x20key\x20authentication\x20interactively','22836vhtzLi','548272ZLdMPB','first_name','message','\x20and\x20','\x20--profile\x20','Credential\x20type:\x20OAuth','yellow','User:\x20','tdx\x20profile:\x20','oauth','apiKey','✓\x20Authentication\x20successful\x0a','944445QCCJrd','No\x20credential\x20found','No\x20credentials\x20found\x20in\x20keychain','status','1122936DwdLra','ERROR','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','Enter\x20your\x20TD\x20API\x20key:','filter','API\x20key','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','4257323rnwEKJ','auth:setup','Remove\x20API\x20key\x20from\x20system\x20keychain','You\x20can\x20find\x20your\x20API\x20key\x20at:','\x20\x20tdx','\x20(site:\x20','✓\x20Default\x20site\x20set\x20to\x20'];a7_0x1172=function(){return _0xb76170;};return a7_0x1172();}import{LogLevel}from'../utils/tdx-logger.js';import a7_0x3592a6 from'chalk';export class AuthSetupCommand extends BaseCommand{[a7_0x1e1706(0x18e)]=a7_0x1e1706(0x187);['description']=a7_0x1e1706(0x16d);async['execute'](_0x5b0178){const _0x891da7=a7_0x1e1706,{options:_0x46bc15}=_0x5b0178,_0x14f5ec=_0x46bc15['profile'];console[_0x891da7(0x15b)](a7_0x3592a6[_0x891da7(0x159)]('tdx:\x20auth\x20setup'));const _0x24e5ab=_0x46bc15['site']||_0x891da7(0x148),_0x50f0c7=await promptSiteSelection(_0x24e5ab,_0x14f5ec,'Setup\x20cancelled');if(!_0x50f0c7)return 0x1;const _0x52e8c0=resolveSite(_0x50f0c7);if(isOAuthSupported(_0x52e8c0)){const _0x19d6e0=await a7_0x1adc16({'type':'select','name':_0x891da7(0x15e),'message':_0x891da7(0x165),'choices':[{'title':_0x891da7(0x196),'value':_0x891da7(0x178)},{'title':_0x891da7(0x168),'value':'apikey'}]});if(!_0x19d6e0['method'])return console[_0x891da7(0x15b)](_0x891da7(0x166)),0x1;if(_0x19d6e0['method']==='oauth')return await runOAuthLoginFlow(_0x52e8c0,_0x14f5ec,_0x46bc15[_0x891da7(0x18d)]??LogLevel[_0x891da7(0x180)]),0x0;}console[_0x891da7(0x15b)](_0x891da7(0x16a)+_0x52e8c0),console[_0x891da7(0x15b)](_0x891da7(0x189)),console[_0x891da7(0x15b)]('\x20\x20'+getConsoleUrl(_0x52e8c0,_0x891da7(0x14f)));const _0x5ca8f8=await a7_0x1adc16({'type':_0x891da7(0x155),'name':_0x891da7(0x179),'message':_0x891da7(0x182),'validate':_0x536341=>{const _0x4575d4=_0x891da7;if(!_0x536341||!_0x536341['trim']())return _0x4575d4(0x164);return!![];}});if(!_0x5ca8f8[_0x891da7(0x179)])return console[_0x891da7(0x15b)](_0x891da7(0x166)),0x1;const _0xa63590=_0x5ca8f8[_0x891da7(0x179)];console['log']('Validating\x20API\x20key...');try{const _0xe141e9=TDX[_0x891da7(0x154)]({'site':_0x52e8c0,'apiKey':_0xa63590[_0x891da7(0x167)](),'logLevel':_0x46bc15[_0x891da7(0x18d)]??LogLevel[_0x891da7(0x180)]}),_0x3f1168=await _0xe141e9['jobs'][_0x891da7(0x162)]();console[_0x891da7(0x15b)]('✓\x20API\x20key\x20is\x20valid\x20(User:\x20'+_0x3f1168[_0x891da7(0x163)]+')');const _0x4ea088=await isKeychainAvailable();_0x4ea088?(await saveAPIKeyAsync(_0xa63590[_0x891da7(0x167)](),_0x52e8c0,_0x14f5ec),console[_0x891da7(0x15b)](_0x891da7(0x185)+(_0x14f5ec?_0x891da7(0x156)+_0x14f5ec+')':''))):(console[_0x891da7(0x190)](a7_0x3592a6[_0x891da7(0x175)](_0x891da7(0x16c))),console[_0x891da7(0x190)](a7_0x3592a6[_0x891da7(0x175)](_0x891da7(0x191))));if(_0x14f5ec){const _0xe0afae={'site':_0x52e8c0};saveProfileToUserConfig(_0x14f5ec,_0xe0afae),console[_0x891da7(0x15b)]('✓\x20Profile\x20\x27'+_0x14f5ec+_0x891da7(0x169));}else saveDefaultSiteToUserConfig(_0x52e8c0),console[_0x891da7(0x15b)](_0x891da7(0x18c)+_0x52e8c0);const _0x4c7f45=_0x14f5ec?_0x891da7(0x173)+_0x14f5ec:'';return console[_0x891da7(0x15b)](),console[_0x891da7(0x15b)](_0x891da7(0x14b)),console['log'](_0x891da7(0x18a)+_0x4c7f45+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console[_0x891da7(0x15b)](_0x891da7(0x18a)+_0x4c7f45+_0x891da7(0x195)),0x0;}catch(_0x5a4b20){if(_0x5a4b20 instanceof HTTPClientError&&_0x5a4b20[_0x891da7(0x17e)]===0x191)return printAuthError(_0x5a4b20),0x1;return console[_0x891da7(0x192)](a7_0x3592a6['red'](_0x891da7(0x150)+(_0x5a4b20 instanceof Error?_0x5a4b20[_0x891da7(0x171)]:String(_0x5a4b20)))),console['error']('API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.'),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x1e1706(0x18e)]='auth';[a7_0x1e1706(0x145)]=a7_0x1e1706(0x181);async[a7_0x1e1706(0x193)](_0x1f2aa8){const _0xf50f8c=a7_0x1e1706,{options:_0x35ac01,tdx:_0x346314}=_0x1f2aa8,_0x532a2a=_0x35ac01[_0xf50f8c(0x151)],_0x3ecba0=_0x35ac01['profile'],_0x583297=_0x3ecba0?_0x3ecba0:_0xf50f8c(0x194);console[_0xf50f8c(0x15b)](_0xf50f8c(0x177)+_0x583297+_0xf50f8c(0x18b)+_0x532a2a+')');const _0x1c8d2a=await getOAuthTokens(_0x3ecba0);if(_0x1c8d2a)console[_0xf50f8c(0x15b)](_0xf50f8c(0x174)),console['log'](_0xf50f8c(0x14d)+(_0x3ecba0?_0xf50f8c(0x156)+_0x3ecba0+')':''));else{const _0x434220=await resolveAPIKeyAsync(_0x532a2a,_0x3ecba0);if(_0x434220){const {source:_0x5b6bd6,isDeprecated:_0x29ac0a}=_0x434220,_0x393eb7=_0xf50f8c(0x14a)+_0x5b6bd6;console[_0xf50f8c(0x15b)](_0x29ac0a?a7_0x3592a6[_0xf50f8c(0x175)](_0x393eb7):_0x393eb7);}else console[_0xf50f8c(0x15b)](a7_0x3592a6[_0xf50f8c(0x175)](_0xf50f8c(0x17c)));}try{const _0x153339=await _0x346314[_0xf50f8c(0x14e)][_0xf50f8c(0x162)]();return console[_0xf50f8c(0x15b)](a7_0x3592a6[_0xf50f8c(0x14c)](_0xf50f8c(0x17a))),console['log'](_0xf50f8c(0x176)+_0x153339[_0xf50f8c(0x163)]),(_0x153339[_0xf50f8c(0x170)]||_0x153339['last_name'])&&console[_0xf50f8c(0x15b)](_0xf50f8c(0x157)+[_0x153339[_0xf50f8c(0x170)],_0x153339[_0xf50f8c(0x161)]][_0xf50f8c(0x183)](Boolean)[_0xf50f8c(0x16b)]('\x20')),0x0;}catch(_0x2083e){return _0x2083e instanceof HTTPClientError&&_0x2083e['status']===0x191?printAuthError(_0x2083e,!![],_0x3ecba0):console['error'](a7_0x3592a6[_0xf50f8c(0x153)](_0xf50f8c(0x150)+(_0x2083e instanceof Error?_0x2083e[_0xf50f8c(0x171)]:String(_0x2083e)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x1e1706(0x18e)]=a7_0x1e1706(0x149);['description']=a7_0x1e1706(0x188);async[a7_0x1e1706(0x193)](_0x180fd3){const _0x4b352f=a7_0x1e1706,{options:_0x3330b8}=_0x180fd3,_0x47ff69=_0x3330b8[_0x4b352f(0x147)];console[_0x4b352f(0x15b)](a7_0x3592a6['bold'](_0x4b352f(0x15f)));const _0x4ba704=await isKeychainAvailable();if(!_0x4ba704)return console[_0x4b352f(0x192)](a7_0x3592a6[_0x4b352f(0x153)](_0x4b352f(0x160))),0x1;const [_0x3e314b,_0x10a4c8]=await Promise[_0x4b352f(0x18f)]([deleteKeychainAPIKey(_0x47ff69),deleteOAuthTokens(_0x47ff69)]);if(_0x3e314b||_0x10a4c8){clearCredentialCache();const _0x24e8b3=[_0x3e314b&&_0x4b352f(0x184),_0x10a4c8&&_0x4b352f(0x15c)][_0x4b352f(0x183)](Boolean)['join'](_0x4b352f(0x172));return console[_0x4b352f(0x15b)]('✓\x20'+_0x24e8b3+_0x4b352f(0x15a)+(_0x47ff69?_0x4b352f(0x156)+_0x47ff69+')':'')),0x0;}else return console[_0x4b352f(0x15b)](_0x4b352f(0x17d)+(_0x47ff69?_0x4b352f(0x158)+_0x47ff69:'')),0x1;}}
1
+ const a7_0x3c713d=a7_0x18e4;(function(_0x107cb3,_0x3da0e3){const _0x42acac=a7_0x18e4,_0x245efe=_0x107cb3();while(!![]){try{const _0x52100b=parseInt(_0x42acac(0x118))/0x1*(parseInt(_0x42acac(0xed))/0x2)+-parseInt(_0x42acac(0xfd))/0x3*(parseInt(_0x42acac(0xf5))/0x4)+parseInt(_0x42acac(0x105))/0x5+-parseInt(_0x42acac(0x11a))/0x6*(-parseInt(_0x42acac(0x112))/0x7)+parseInt(_0x42acac(0x10d))/0x8*(-parseInt(_0x42acac(0x106))/0x9)+parseInt(_0x42acac(0xfb))/0xa+-parseInt(_0x42acac(0x11d))/0xb;if(_0x52100b===_0x3da0e3)break;else _0x245efe['push'](_0x245efe['shift']());}catch(_0x3f25db){_0x245efe['push'](_0x245efe['shift']());}}}(a7_0x17f3,0xbce68));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens}from'../core/oauth-keychain.js';function a7_0x18e4(_0x6afb11,_0x308f06){_0x6afb11=_0x6afb11-0xd9;const _0x17f3a3=a7_0x17f3();let _0x18e4da=_0x17f3a3[_0x6afb11];return _0x18e4da;}import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{deleteOAuthTokens}from'../core/oauth-keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';import{isOAuthSupported}from'../core/oauth.js';import{runOAuthLoginFlow}from'./auth-login-command.js';import{promptSiteSelection}from'../core/constants.js';import a7_0x210644 from'prompts';import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';function a7_0x17f3(){const _0x368191=['tdx:\x20auth\x20setup','User:\x20','OAuth\x20(browser\x20login)','API\x20Key','logLevel','us01','216Clkchm','✓\x20Profile\x20\x27','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','\x20\x20tdx','auth','69083XOFopY','log','trim','Remove\x20API\x20key\x20from\x20system\x20keychain','method','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','27KDKYNH','tdx:\x20auth\x20clear','42HNwDvg','\x20(profile:\x20','getUserInfo','13404226yEaloL','yellow','auth:clear','ERROR','email','Read\x20credential\x20from\x20keychain','OAuth\x20tokens','password','warn','\x20and\x20','N/A','\x20removed\x20from\x20keychain','first_name','name','Enter\x20your\x20TD\x20API\x20key:','✗\x20Validation\x20failed:\x20','profile','apiKey','tdx\x20profile:\x20','message','red','Name:\x20','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','jobs','\x20(site:\x20','oauth','75434SVHYzx','/app/mp/ak','join','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','bold','Setup\x20API\x20key\x20authentication\x20interactively','API\x20key','\x0aSetup\x20cancelled','2747180ChEizL','error','No\x20credentials\x20found\x20in\x20keychain','description','execute','last_name','12665450FrLVAy','status','3eexqLf','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','System\x20keychain\x20is\x20not\x20available','Setup\x20cancelled','all','green','Setting\x20up\x20authentication\x20for\x20site:\x20','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','2478615vDEdbQ','56871lMszXb'];a7_0x17f3=function(){return _0x368191;};return a7_0x17f3();}import{LogLevel}from'../utils/tdx-logger.js';import a7_0x134ac1 from'chalk';export class AuthSetupCommand extends BaseCommand{[a7_0x3c713d(0xe0)]='auth:setup';[a7_0x3c713d(0xf8)]=a7_0x3c713d(0xf2);async[a7_0x3c713d(0xf9)](_0x2b4a1d){const _0x481d55=a7_0x3c713d,{options:_0x25aae8}=_0x2b4a1d,_0x43b79d=_0x25aae8[_0x481d55(0xe3)];console['log'](a7_0x134ac1[_0x481d55(0xf1)](_0x481d55(0x107)));const _0xb6d035=_0x25aae8['site']||_0x481d55(0x10c),_0x1362dd=await promptSiteSelection(_0xb6d035,_0x43b79d,_0x481d55(0x100));if(!_0x1362dd)return 0x1;const _0x51b30a=resolveSite(_0x1362dd);if(isOAuthSupported(_0x51b30a)){const _0x43a3a3=await a7_0x210644({'type':'select','name':_0x481d55(0x116),'message':'Choose\x20authentication\x20method:','choices':[{'title':_0x481d55(0x109),'value':'oauth'},{'title':_0x481d55(0x10a),'value':'apikey'}]});if(!_0x43a3a3[_0x481d55(0x116)])return console[_0x481d55(0x113)]('\x0aSetup\x20cancelled'),0x1;if(_0x43a3a3[_0x481d55(0x116)]===_0x481d55(0xec))return await runOAuthLoginFlow(_0x51b30a,_0x43b79d,_0x25aae8[_0x481d55(0x10b)]??LogLevel['ERROR']),0x0;}console[_0x481d55(0x113)](_0x481d55(0x103)+_0x51b30a),console['log']('You\x20can\x20find\x20your\x20API\x20key\x20at:'),console[_0x481d55(0x113)]('\x20\x20'+getConsoleUrl(_0x51b30a,_0x481d55(0xee)));const _0x3fd23b=await a7_0x210644({'type':_0x481d55(0xda),'name':_0x481d55(0xe4),'message':_0x481d55(0xe1),'validate':_0x483e62=>{if(!_0x483e62||!_0x483e62['trim']())return'API\x20key\x20cannot\x20be\x20empty';return!![];}});if(!_0x3fd23b[_0x481d55(0xe4)])return console[_0x481d55(0x113)](_0x481d55(0xf4)),0x1;const _0x31c0cc=_0x3fd23b['apiKey'];console[_0x481d55(0x113)]('Validating\x20API\x20key...');try{const _0x147f40=TDX['create']({'site':_0x51b30a,'apiKey':_0x31c0cc[_0x481d55(0x114)](),'logLevel':_0x25aae8[_0x481d55(0x10b)]??LogLevel[_0x481d55(0x120)]}),_0xf0f559=await _0x147f40[_0x481d55(0xea)][_0x481d55(0x11c)]();console['log']('✓\x20API\x20key\x20is\x20valid\x20(User:\x20'+_0xf0f559[_0x481d55(0x121)]+')');const _0x3f3808=await isKeychainAvailable();_0x3f3808?(await saveAPIKeyAsync(_0x31c0cc[_0x481d55(0x114)](),_0x51b30a,_0x43b79d),console[_0x481d55(0x113)](_0x481d55(0x104)+(_0x43b79d?_0x481d55(0x11b)+_0x43b79d+')':''))):(console[_0x481d55(0xdb)](a7_0x134ac1['yellow'](_0x481d55(0xf0))),console[_0x481d55(0xdb)](a7_0x134ac1['yellow']('\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.')));if(_0x43b79d){const _0x108c8d={'site':_0x51b30a};saveProfileToUserConfig(_0x43b79d,_0x108c8d),console['log'](_0x481d55(0x10e)+_0x43b79d+'\x27\x20registered');}else saveDefaultSiteToUserConfig(_0x51b30a),console[_0x481d55(0x113)]('✓\x20Default\x20site\x20set\x20to\x20'+_0x51b30a);const _0x5e364d=_0x43b79d?'\x20--profile\x20'+_0x43b79d:'';return console[_0x481d55(0x113)](),console[_0x481d55(0x113)]('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console[_0x481d55(0x113)](_0x481d55(0x110)+_0x5e364d+_0x481d55(0xe9)),console[_0x481d55(0x113)](_0x481d55(0x110)+_0x5e364d+_0x481d55(0x117)),0x0;}catch(_0x537631){if(_0x537631 instanceof HTTPClientError&&_0x537631['status']===0x191)return printAuthError(_0x537631),0x1;return console[_0x481d55(0xf6)](a7_0x134ac1[_0x481d55(0xe7)](_0x481d55(0xe2)+(_0x537631 instanceof Error?_0x537631[_0x481d55(0xe6)]:String(_0x537631)))),console[_0x481d55(0xf6)](_0x481d55(0xfe)),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x3c713d(0xe0)]=a7_0x3c713d(0x111);[a7_0x3c713d(0xf8)]=a7_0x3c713d(0x10f);async[a7_0x3c713d(0xf9)](_0x205d77){const _0x9c090f=a7_0x3c713d,{options:_0x5d560c,tdx:_0x204268}=_0x205d77,_0x44cfe0=_0x5d560c['site'],_0x5ae137=_0x5d560c[_0x9c090f(0xe3)],_0x4015f3=_0x5ae137?_0x5ae137:_0x9c090f(0xdd);console[_0x9c090f(0x113)](_0x9c090f(0xe5)+_0x4015f3+_0x9c090f(0xeb)+_0x44cfe0+')');const _0xbcd404=await getOAuthTokens(_0x5ae137);if(_0xbcd404)console[_0x9c090f(0x113)]('Credential\x20type:\x20OAuth'),console[_0x9c090f(0x113)](_0x9c090f(0x122)+(_0x5ae137?_0x9c090f(0x11b)+_0x5ae137+')':''));else{const _0xe13a01=await resolveAPIKeyAsync(_0x44cfe0,_0x5ae137);if(_0xe13a01){const {source:_0x19b408,isDeprecated:_0x47d06d}=_0xe13a01,_0x22217f='Read\x20credential\x20from\x20'+_0x19b408;console[_0x9c090f(0x113)](_0x47d06d?a7_0x134ac1[_0x9c090f(0x11e)](_0x22217f):_0x22217f);}else console[_0x9c090f(0x113)](a7_0x134ac1[_0x9c090f(0x11e)]('No\x20credential\x20found'));}try{const _0x3152cf=await _0x204268[_0x9c090f(0xea)][_0x9c090f(0x11c)]();return console[_0x9c090f(0x113)](a7_0x134ac1[_0x9c090f(0x102)]('✓\x20Authentication\x20successful\x0a')),console['log'](_0x9c090f(0x108)+_0x3152cf[_0x9c090f(0x121)]),(_0x3152cf['first_name']||_0x3152cf[_0x9c090f(0xfa)])&&console[_0x9c090f(0x113)](_0x9c090f(0xe8)+[_0x3152cf[_0x9c090f(0xdf)],_0x3152cf[_0x9c090f(0xfa)]]['filter'](Boolean)[_0x9c090f(0xef)]('\x20')),0x0;}catch(_0x4afd27){return _0x4afd27 instanceof HTTPClientError&&_0x4afd27[_0x9c090f(0xfc)]===0x191?printAuthError(_0x4afd27,!![],_0x5ae137):console[_0x9c090f(0xf6)](a7_0x134ac1[_0x9c090f(0xe7)](_0x9c090f(0xe2)+(_0x4afd27 instanceof Error?_0x4afd27[_0x9c090f(0xe6)]:String(_0x4afd27)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x3c713d(0xe0)]=a7_0x3c713d(0x11f);[a7_0x3c713d(0xf8)]=a7_0x3c713d(0x115);async[a7_0x3c713d(0xf9)](_0x1796bf){const _0x3c9d76=a7_0x3c713d,{options:_0x1a5a98}=_0x1796bf,_0xdc28fb=_0x1a5a98[_0x3c9d76(0xe3)];console['log'](a7_0x134ac1[_0x3c9d76(0xf1)](_0x3c9d76(0x119)));const _0x2ed7fd=await isKeychainAvailable();if(!_0x2ed7fd)return console['error'](a7_0x134ac1[_0x3c9d76(0xe7)](_0x3c9d76(0xff))),0x1;const [_0x5fc191,_0x1ee0e5]=await Promise[_0x3c9d76(0x101)]([deleteKeychainAPIKey(_0xdc28fb),deleteOAuthTokens(_0xdc28fb)]);if(_0x5fc191||_0x1ee0e5){clearCredentialCache();const _0x42a347=[_0x5fc191&&_0x3c9d76(0xf3),_0x1ee0e5&&_0x3c9d76(0xd9)]['filter'](Boolean)[_0x3c9d76(0xef)](_0x3c9d76(0xdc));return console[_0x3c9d76(0x113)]('✓\x20'+_0x42a347+_0x3c9d76(0xde)+(_0xdc28fb?_0x3c9d76(0x11b)+_0xdc28fb+')':'')),0x0;}else return console[_0x3c9d76(0x113)](_0x3c9d76(0xf7)+(_0xdc28fb?'\x20for\x20profile:\x20'+_0xdc28fb:'')),0x1;}}
@@ -1 +1 @@
1
- const a8_0x58aeb6=a8_0x40e6;(function(_0x360e00,_0x3d2ac2){const _0xee5394=a8_0x40e6,_0x412df6=_0x360e00();while(!![]){try{const _0x35a289=parseInt(_0xee5394(0xcb))/0x1*(parseInt(_0xee5394(0xd9))/0x2)+-parseInt(_0xee5394(0xbe))/0x3*(-parseInt(_0xee5394(0xde))/0x4)+parseInt(_0xee5394(0xc0))/0x5*(parseInt(_0xee5394(0xc6))/0x6)+-parseInt(_0xee5394(0xc3))/0x7*(-parseInt(_0xee5394(0xd6))/0x8)+parseInt(_0xee5394(0xd7))/0x9*(-parseInt(_0xee5394(0xc4))/0xa)+parseInt(_0xee5394(0xda))/0xb+-parseInt(_0xee5394(0xdc))/0xc*(parseInt(_0xee5394(0xc7))/0xd);if(_0x35a289===_0x3d2ac2)break;else _0x412df6['push'](_0x412df6['shift']());}catch(_0xb06a88){_0x412df6['push'](_0x412df6['shift']());}}}(a8_0x4920,0x3738b));function a8_0x40e6(_0x1f2bbe,_0x24c82d){_0x1f2bbe=_0x1f2bbe-0xb7;const _0x492070=a8_0x4920();let _0x40e6ef=_0x492070[_0x1f2bbe];return _0x40e6ef;}function a8_0x4920(){const _0xba229e=['Opening\x20browser\x20for\x20authentication...','4197AvwDSu','Validating\x20OAuth\x20tokens...','18385rPbJzM','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','site','7MYeiLd','12790RMmfVU','log','690QzPdhO','208ThnzNs','auth:login','\x20(profile:\x20','\x20--profile\x20','2RzjNxR','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','execute','getUserInfo','Login\x20cancelled','Authenticating\x20via\x20OAuth\x20for\x20site:\x20','bold','access_token','create','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','OAuth\x20login\x20is\x20not\x20yet\x20available\x20for\x20site:\x20','1329256GIlEoT','2583hWVisb','\x20\x20tdx','122810HOzZEl','2807827etaqVx','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','333876EZpacT','jobs','204QojyDG','✓\x20Profile\x20\x27','ERROR','description','Login\x20via\x20OAuth\x20(opens\x20browser)','green','/oauth/authorize','logLevel','email','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases'];a8_0x4920=function(){return _0xba229e;};return a8_0x4920();}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';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a8_0x43c354 from'chalk';export async function runOAuthLoginFlow(_0x4bcba7,_0x21b72d,_0x1d79fa){const _0x57c162=a8_0x40e6;if(!isOAuthSupported(_0x4bcba7))throw new Error(_0x57c162(0xd5)+_0x4bcba7+'.\x20'+'OAuth\x20is\x20currently\x20supported\x20on\x20dev-us01\x20and\x20dev-eu01\x20only.\x20'+_0x57c162(0xd4));const _0x45e352=await isKeychainAvailable();if(!_0x45e352)throw new Error(_0x57c162(0xcc)+_0x57c162(0xd4));const _0x2e254=getConsoleUrl(_0x4bcba7);console[_0x57c162(0xc5)](_0x57c162(0xbd)),console[_0x57c162(0xc5)]('\x20\x20'+_0x2e254+_0x57c162(0xb9)),console[_0x57c162(0xc5)](_0x57c162(0xdb));const _0x19f4f2=await startOAuthFlow(_0x4bcba7);console[_0x57c162(0xc5)](_0x57c162(0xbf));const _0xf62da9=TDX[_0x57c162(0xd3)]({'site':_0x4bcba7,'accessToken':_0x19f4f2[_0x57c162(0xd2)],'logLevel':_0x1d79fa??LogLevel[_0x57c162(0xe0)]}),_0x6f6910=await _0xf62da9[_0x57c162(0xdd)][_0x57c162(0xce)]();console[_0x57c162(0xc5)](a8_0x43c354[_0x57c162(0xb8)]('✓\x20Authentication\x20successful\x20(User:\x20'+_0x6f6910[_0x57c162(0xbb)]+')')),await saveOAuthTokens(_0x19f4f2,_0x21b72d),console['log']('✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain'+(_0x21b72d?_0x57c162(0xc9)+_0x21b72d+')':''));if(_0x21b72d){const _0x597330={'site':_0x4bcba7};saveProfileToUserConfig(_0x21b72d,_0x597330),console[_0x57c162(0xc5)](_0x57c162(0xdf)+_0x21b72d+'\x27\x20registered');}const _0x388375=_0x21b72d?_0x57c162(0xca)+_0x21b72d:'';console[_0x57c162(0xc5)](),console[_0x57c162(0xc5)](_0x57c162(0xc1)),console[_0x57c162(0xc5)](_0x57c162(0xd8)+_0x388375+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console[_0x57c162(0xc5)](_0x57c162(0xd8)+_0x388375+_0x57c162(0xbc));}export class AuthLoginCommand extends BaseCommand{['name']=a8_0x58aeb6(0xc8);[a8_0x58aeb6(0xe1)]=a8_0x58aeb6(0xb7);async[a8_0x58aeb6(0xcd)](_0x45a040){const _0x2ced3b=a8_0x58aeb6,{options:_0x45251f}=_0x45a040,_0x2a9811=_0x45251f['profile'];console[_0x2ced3b(0xc5)](a8_0x43c354[_0x2ced3b(0xd1)]('tdx:\x20auth\x20login'));const _0x30c120=_0x45251f[_0x2ced3b(0xc2)]||'us01',_0x295a4d=await promptSiteSelection(_0x30c120,_0x2a9811,_0x2ced3b(0xcf));if(!_0x295a4d)return 0x1;const _0x3dc6e9=resolveSite(_0x295a4d);return console['log'](_0x2ced3b(0xd0)+_0x3dc6e9),await runOAuthLoginFlow(_0x3dc6e9,_0x2a9811,_0x45251f[_0x2ced3b(0xba)]??LogLevel[_0x2ced3b(0xe0)]),0x0;}}
1
+ const a8_0x18fd40=a8_0x2a1c;(function(_0x1a5cb5,_0x3f40f0){const _0x10da76=a8_0x2a1c,_0x2ba68f=_0x1a5cb5();while(!![]){try{const _0x5430c4=-parseInt(_0x10da76(0x10b))/0x1*(parseInt(_0x10da76(0x116))/0x2)+parseInt(_0x10da76(0x12e))/0x3+-parseInt(_0x10da76(0x125))/0x4+parseInt(_0x10da76(0x10a))/0x5+parseInt(_0x10da76(0x127))/0x6*(-parseInt(_0x10da76(0x12a))/0x7)+parseInt(_0x10da76(0x11f))/0x8*(-parseInt(_0x10da76(0x102))/0x9)+parseInt(_0x10da76(0x12f))/0xa*(parseInt(_0x10da76(0x103))/0xb);if(_0x5430c4===_0x3f40f0)break;else _0x2ba68f['push'](_0x2ba68f['shift']());}catch(_0x26abba){_0x2ba68f['push'](_0x2ba68f['shift']());}}}(a8_0x5209,0x4d4a1));import{BaseCommand}from'./command.js';import{resolveSite}from'../core/config.js';import{saveProfileToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';function a8_0x2a1c(_0x1f947f,_0x1edc1d){_0x1f947f=_0x1f947f-0x101;const _0x520903=a8_0x5209();let _0x2a1cfc=_0x520903[_0x1f947f];return _0x2a1cfc;}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_0x5209(){const _0x4db303=['OAuth\x20is\x20currently\x20supported\x20on\x20dev-us01\x20and\x20dev-eu01\x20only.\x20','log','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','auth:login','ERROR','Validating\x20OAuth\x20tokens...','tdx:\x20auth\x20login','execute','856376bFVwKX','create','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','Login\x20via\x20OAuth\x20(opens\x20browser)','logLevel','Opening\x20browser\x20for\x20authentication...','1705028gskdKw','Authenticating\x20via\x20OAuth\x20for\x20site:\x20','5226pMFSYW','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','access_token','4186iZJgwL','us01','site','name','856092hvBNTP','1319330IZHzlV','\x20\x20tdx','9JYMEnd','88XWbXhs','bold','✓\x20Profile\x20\x27','\x20(profile:\x20','OAuth\x20login\x20is\x20not\x20yet\x20available\x20for\x20site:\x20','profile','getUserInfo','623125cbPoLG','1633NFDRlm','email','description','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','\x27\x20registered','✓\x20Authentication\x20successful\x20(User:\x20','\x20--profile\x20','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain','green','/oauth/authorize','Login\x20cancelled','116StGMmE'];a8_0x5209=function(){return _0x4db303;};return a8_0x5209();}import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a8_0x4395c5 from'chalk';export async function runOAuthLoginFlow(_0x2a57f4,_0x141665,_0x2a0bff){const _0x2cd271=a8_0x2a1c;if(!isOAuthSupported(_0x2a57f4))throw new Error(_0x2cd271(0x107)+_0x2a57f4+'.\x20'+_0x2cd271(0x117)+_0x2cd271(0x121));const _0x5aee5c=await isKeychainAvailable();if(!_0x5aee5c)throw new Error('System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20'+_0x2cd271(0x121));const _0x393231=getConsoleUrl(_0x2a57f4);console[_0x2cd271(0x118)](_0x2cd271(0x124)),console[_0x2cd271(0x118)]('\x20\x20'+_0x393231+_0x2cd271(0x114)),console[_0x2cd271(0x118)](_0x2cd271(0x10e));const _0x45d19f=await startOAuthFlow(_0x2a57f4);console[_0x2cd271(0x118)](_0x2cd271(0x11c));const _0x551838=TDX[_0x2cd271(0x120)]({'site':_0x2a57f4,'accessToken':_0x45d19f[_0x2cd271(0x129)],'logLevel':_0x2a0bff??LogLevel['ERROR']}),_0x1b2961=await _0x551838['jobs'][_0x2cd271(0x109)]();console[_0x2cd271(0x118)](a8_0x4395c5[_0x2cd271(0x113)](_0x2cd271(0x110)+_0x1b2961[_0x2cd271(0x10c)]+')')),await saveOAuthTokens(_0x45d19f,_0x141665),console['log'](_0x2cd271(0x112)+(_0x141665?_0x2cd271(0x106)+_0x141665+')':''));if(_0x141665){const _0x2b5773={'site':_0x2a57f4};saveProfileToUserConfig(_0x141665,_0x2b5773),console[_0x2cd271(0x118)](_0x2cd271(0x105)+_0x141665+_0x2cd271(0x10f));}const _0x2573e2=_0x141665?_0x2cd271(0x111)+_0x141665:'';console[_0x2cd271(0x118)](),console['log']('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console['log']('\x20\x20tdx'+_0x2573e2+_0x2cd271(0x128)),console[_0x2cd271(0x118)](_0x2cd271(0x101)+_0x2573e2+_0x2cd271(0x119));}export class AuthLoginCommand extends BaseCommand{[a8_0x18fd40(0x12d)]=a8_0x18fd40(0x11a);[a8_0x18fd40(0x10d)]=a8_0x18fd40(0x122);async[a8_0x18fd40(0x11e)](_0x339281){const _0x321e3b=a8_0x18fd40,{options:_0x484edb}=_0x339281,_0x5b6577=_0x484edb[_0x321e3b(0x108)];console[_0x321e3b(0x118)](a8_0x4395c5[_0x321e3b(0x104)](_0x321e3b(0x11d)));const _0x2402a5=_0x484edb[_0x321e3b(0x12c)]||_0x321e3b(0x12b),_0x5c36ec=await promptSiteSelection(_0x2402a5,_0x5b6577,_0x321e3b(0x115));if(!_0x5c36ec)return 0x1;const _0x1bf83b=resolveSite(_0x5c36ec);return console[_0x321e3b(0x118)](_0x321e3b(0x126)+_0x1bf83b),await runOAuthLoginFlow(_0x1bf83b,_0x5b6577,_0x484edb[_0x321e3b(0x123)]??LogLevel[_0x321e3b(0x11b)]),0x0;}}
@@ -1 +1 @@
1
- const a9_0x41da7c=a9_0x1fbb;(function(_0x4b0607,_0x3a007e){const _0x522297=a9_0x1fbb,_0x5f1205=_0x4b0607();while(!![]){try{const _0x354860=-parseInt(_0x522297(0x19c))/0x1+-parseInt(_0x522297(0x1a4))/0x2*(parseInt(_0x522297(0x181))/0x3)+-parseInt(_0x522297(0x17b))/0x4*(-parseInt(_0x522297(0x1ba))/0x5)+-parseInt(_0x522297(0x1bb))/0x6+parseInt(_0x522297(0x17d))/0x7+parseInt(_0x522297(0x1a0))/0x8*(-parseInt(_0x522297(0x1a9))/0x9)+parseInt(_0x522297(0x1ae))/0xa;if(_0x354860===_0x3a007e)break;else _0x5f1205['push'](_0x5f1205['shift']());}catch(_0x2edc45){_0x5f1205['push'](_0x5f1205['shift']());}}}(a9_0x4219,0x83ccb));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{withSpinner}from'../utils/spinner.js';import{parseAgentRef}from'../sdk/agent/agent-ref-parser.js';function a9_0x1fbb(_0x20ba88,_0x57d113){_0x20ba88=_0x20ba88-0x17a;const _0x4219d3=a9_0x4219();let _0x1fbb89=_0x4219d3[_0x20ba88];return _0x1fbb89;}import{saveLastChatId,loadLastChatId}from'../sdk/llm/chat-cache.js';import{getLLMConversationUrl}from'../sdk/client/endpoints.js';function handleSDKError(_0x42af66,_0x2a6371){const _0x4ee080=a9_0x1fbb;if(_0x42af66 instanceof SDKError)console[_0x4ee080(0x189)]('Error:\x20'+_0x42af66['message']),_0x2a6371[_0x4ee080(0x190)]&&(_0x42af66[_0x4ee080(0x186)]&&console[_0x4ee080(0x189)]('\x20\x20Cause:\x20'+_0x42af66[_0x4ee080(0x186)]),_0x42af66['stack']&&(console[_0x4ee080(0x189)](_0x4ee080(0x180)),console[_0x4ee080(0x189)](_0x42af66[_0x4ee080(0x1ad)])));else throw _0x42af66;}async function resolveAgentId(_0x2e0983,_0x3b0611,_0x23185a,_0x5d16b9,_0x22789a){const _0x228433=a9_0x1fbb,_0x3997d1=_0x3b0611||_0x23185a;if(_0x3997d1){const {projectName:_0x400951,agentName:_0x3cfaa0}=parseAgentRef(_0x3997d1),_0x12f559=_0x3cfaa0||_0x3997d1,_0x3a79b4=_0x3cfaa0?_0x400951:_0x5d16b9;if(!_0x3a79b4)throw new Error(_0x228433(0x19a));if(_0x22789a){const _0x1c1e12=_0x3b0611?_0x228433(0x1af):_0x228433(0x1b2);console['error'](_0x228433(0x187)+_0x1c1e12+':\x20'+_0x3a79b4+'/'+_0x12f559);}const _0x238dfa=await withSpinner(_0x228433(0x19d)+_0x3a79b4+_0x228433(0x197),()=>_0x2e0983[_0x228433(0x1be)][_0x228433(0x1ac)](_0x3a79b4),{'verbose':_0x22789a}),_0x2761b2=await withSpinner(_0x228433(0x1b7)+_0x12f559+'\x27...',()=>_0x2e0983[_0x228433(0x1be)][_0x228433(0x198)](_0x12f559,_0x238dfa['data']),{'verbose':_0x22789a});return _0x2761b2[_0x228433(0x1b5)];}else{const _0x50320e=_0x2e0983[_0x228433(0x1be)][_0x228433(0x1c6)]();if(_0x50320e)return _0x22789a&&console[_0x228433(0x189)]('Using\x20cached\x20default\x20agent:\x20'+_0x50320e[_0x228433(0x1bd)]),_0x50320e['id'];const _0x4fe7a3=await withSpinner(_0x228433(0x199),()=>_0x2e0983[_0x228433(0x1be)][_0x228433(0x192)](_0x228433(0x18e),0x0),{'verbose':_0x22789a});return _0x4fe7a3[_0x228433(0x1b5)]['id'];}}function a9_0x4219(){const _0x47b87b=['Using\x20agent\x20from\x20','validate','error','streamChat','\x0aError:\x20','tool_result','type','claude-4.5-haiku','agent','verbose','execute','getOrCreateDefaultAgent','site','chat-create','metadata','event','\x27...','resolveAgentId','Getting\x20default\x20agent...','No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22','targetFunction','350178paqfjl','Resolving\x20project\x20\x27','join','content','5176pPaLwH','options','CHAT_NOT_FOUND','tool','439954HwJtie','streamChatJsonl','chat','Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','11115PfwkjJ','functionName','log','resolveProjectId','stack','13232460fQfJsk','--agent\x20flag','description','message','session\x20context','projectId','\x27\x20not\x20found','data','handleChatEvent','Resolving\x20agent\x20\x27','tool_call','write','328645TsLkKz','2512524cCmThx','chatId','name','llm','stringify','args','llmAgent','targetKnowledgeBase','Continuing\x20chat:\x20','llmProject','Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together','getDefaultAgent','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','slice','20wWgSgC','agentId','4731398mrBFkT','code','string','\x0aStack\x20trace:','3AlkWlw','new','targetAgent','Chat\x20session:\x20','404','cause'];a9_0x4219=function(){return _0x47b87b;};return a9_0x4219();}export class ChatCommand extends BaseCommand{[a9_0x41da7c(0x1bd)]=a9_0x41da7c(0x1a6);[a9_0x41da7c(0x1b0)]=a9_0x41da7c(0x1c7);[a9_0x41da7c(0x188)](_0x13528f){const _0x53ab28=a9_0x41da7c,_0x54a8f6=_0x13528f[_0x53ab28(0x1c0)][_0x53ab28(0x19e)]('\x20');if(!_0x54a8f6)return'Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options';return undefined;}async[a9_0x41da7c(0x18a)](_0x51a4d5,_0x3b6caa,_0x406952,_0x576cf4,_0x441b91){const _0x2c5a18=a9_0x41da7c;for await(const _0xebbe3a of _0x51a4d5[_0x2c5a18(0x1be)][_0x2c5a18(0x1a6)](_0x3b6caa,{'agentId':_0x406952,'chatId':_0x576cf4})){if(_0xebbe3a['type']===_0x2c5a18(0x195)){const _0x1b62d8=_0xebbe3a[_0x2c5a18(0x1b5)][_0x2c5a18(0x1bc)];saveLastChatId(_0x1b62d8),_0x441b91&&console[_0x2c5a18(0x189)](_0x2c5a18(0x184)+_0x1b62d8);}else _0xebbe3a[_0x2c5a18(0x18d)]===_0x2c5a18(0x196)&&this[_0x2c5a18(0x1b6)](_0xebbe3a[_0x2c5a18(0x1b5)]);}}async[a9_0x41da7c(0x1a5)](_0x47cfe7,_0x231978,_0x964827,_0x48f19f){const _0x4bcd20=a9_0x41da7c,_0x3eaf9b=_0x47cfe7['context'][_0x4bcd20(0x193)];let _0x264328=![];for await(const _0x23a693 of _0x47cfe7[_0x4bcd20(0x1be)]['chat'](_0x231978,{'agentId':_0x964827,'chatId':_0x48f19f})){if(_0x23a693[_0x4bcd20(0x18d)]===_0x4bcd20(0x195)){const _0x3fe5b7=_0x23a693['data'];saveLastChatId(_0x3fe5b7[_0x4bcd20(0x1bc)]);const _0x10ccde=_0x3fe5b7[_0x4bcd20(0x1b3)]&&_0x3fe5b7[_0x4bcd20(0x17c)]?getLLMConversationUrl(_0x3eaf9b,_0x3fe5b7[_0x4bcd20(0x1b3)],_0x3fe5b7[_0x4bcd20(0x17c)],_0x3fe5b7[_0x4bcd20(0x1bc)]):undefined;console[_0x4bcd20(0x1ab)](JSON[_0x4bcd20(0x1bf)]({'type':_0x4bcd20(0x195),'data':{'chatId':_0x3fe5b7[_0x4bcd20(0x1bc)],'agentId':_0x3fe5b7[_0x4bcd20(0x17c)],'consoleUrl':_0x10ccde}})),_0x264328=!![];}else{if(_0x23a693[_0x4bcd20(0x18d)]===_0x4bcd20(0x196)){!_0x264328&&_0x48f19f&&(console[_0x4bcd20(0x1ab)](JSON[_0x4bcd20(0x1bf)]({'type':'metadata','data':{'chatId':_0x48f19f}})),_0x264328=!![]);const _0x18175d=_0x23a693[_0x4bcd20(0x1b5)];if(_0x4bcd20(0x19f)in _0x18175d)console['log'](JSON['stringify']({'type':_0x4bcd20(0x19f),'data':{'content':_0x18175d[_0x4bcd20(0x19f)]}}));else{if(_0x4bcd20(0x1b8)in _0x18175d){const _0x565c52=_0x18175d[_0x4bcd20(0x1b8)];console['log'](JSON[_0x4bcd20(0x1bf)]({'type':_0x4bcd20(0x1b8),'data':{'id':_0x565c52['id'],'name':_0x565c52[_0x4bcd20(0x1aa)],'target':_0x565c52[_0x4bcd20(0x1c2)]?.['name']||_0x565c52[_0x4bcd20(0x183)]?.['name']||_0x565c52['targetWebSearchTool']?.['name']||_0x565c52[_0x4bcd20(0x19b)]}}));}else{if('tool'in _0x18175d)console[_0x4bcd20(0x1ab)](JSON['stringify']({'type':_0x4bcd20(0x18c),'data':{'id':_0x18175d[_0x4bcd20(0x1a3)]['id'],'name':_0x18175d[_0x4bcd20(0x1a3)][_0x4bcd20(0x1aa)],'result':typeof _0x18175d[_0x4bcd20(0x1a3)][_0x4bcd20(0x19f)]===_0x4bcd20(0x17f)?_0x18175d['tool'][_0x4bcd20(0x19f)][_0x4bcd20(0x17a)](0x0,0x1f4):''}}));else _0x4bcd20(0x189)in _0x18175d&&console['log'](JSON['stringify']({'type':_0x4bcd20(0x189),'data':{'error':_0x18175d[_0x4bcd20(0x189)]}}));}}}}}console[_0x4bcd20(0x1ab)](JSON[_0x4bcd20(0x1bf)]({'type':'done'}));}async[a9_0x41da7c(0x191)](_0x3647a5){const _0x5eeb54=a9_0x41da7c,{options:_0x12ab26,args:_0x515026,tdx:_0x30f3f1}=_0x3647a5,_0x456566=_0x515026['join']('\x20'),_0x2e1798=_0x12ab26,_0x48c7f3=_0x2e1798['agent'],_0x5b0890=_0x2e1798[_0x5eeb54(0x1c1)],_0x35decf=_0x2e1798['llmProject'],_0x3f0238=_0x2e1798[_0x5eeb54(0x182)],_0x28c50f=_0x2e1798[_0x5eeb54(0x1bc)],_0x6cabb9=_0x2e1798['stream'];if(_0x3f0238&&_0x28c50f)return console[_0x5eeb54(0x189)](_0x5eeb54(0x1c5)),0x1;try{let _0xb52743,_0x560b06;if(_0x28c50f)_0x560b06=_0x28c50f;else!_0x3f0238&&(_0x560b06=loadLastChatId(),_0x560b06&&_0x12ab26[_0x5eeb54(0x190)]&&console[_0x5eeb54(0x189)](_0x5eeb54(0x1c3)+_0x560b06));!_0x28c50f&&(_0x3f0238||!_0x560b06)&&(_0xb52743=await resolveAgentId(_0x30f3f1,_0x48c7f3,_0x5b0890,_0x35decf,_0x12ab26[_0x5eeb54(0x190)]));const _0x508ef1=_0x6cabb9?(_0x11eead,_0x5726ca,_0xf866c7)=>this[_0x5eeb54(0x1a5)](_0x30f3f1,_0x11eead,_0x5726ca,_0xf866c7):(_0x4e2038,_0x2eaaa7,_0x5a2ece)=>this[_0x5eeb54(0x18a)](_0x30f3f1,_0x4e2038,_0x2eaaa7,_0x5a2ece,_0x12ab26[_0x5eeb54(0x190)]);try{await _0x508ef1(_0x456566,_0xb52743,_0x560b06);}catch(_0x147a99){const _0x44bd9d=_0x147a99 instanceof SDKError&&_0x147a99[_0x5eeb54(0x17e)]===ErrorCode[_0x5eeb54(0x1a2)]||_0x147a99 instanceof Error&&_0x147a99[_0x5eeb54(0x1b1)]['includes'](_0x5eeb54(0x185));if(_0x44bd9d&&_0x28c50f)return console[_0x5eeb54(0x189)]('Error:\x20Chat\x20session\x20\x27'+_0x28c50f+_0x5eeb54(0x1b4)),0x1;if(_0x44bd9d)_0x12ab26['verbose']&&console[_0x5eeb54(0x189)](_0x5eeb54(0x1a8)),!_0xb52743&&(_0xb52743=await resolveAgentId(_0x30f3f1,_0x48c7f3,_0x5b0890,_0x35decf,_0x12ab26[_0x5eeb54(0x190)])),await _0x508ef1(_0x456566,_0xb52743,undefined);else throw _0x147a99;}return!_0x6cabb9&&console[_0x5eeb54(0x1ab)](),0x0;}catch(_0x10ffed){return console['error'](),handleSDKError(_0x10ffed,_0x12ab26),0x1;}}[a9_0x41da7c(0x1b6)](_0x2c7289){const _0x3b670b=a9_0x41da7c;if(_0x3b670b(0x19f)in _0x2c7289)process['stdout'][_0x3b670b(0x1b9)](_0x2c7289[_0x3b670b(0x19f)]);else'error'in _0x2c7289&&console['error'](_0x3b670b(0x18b)+_0x2c7289[_0x3b670b(0x189)]);}}export class ChatCreateCommand extends BaseCommand{[a9_0x41da7c(0x1bd)]=a9_0x41da7c(0x194);[a9_0x41da7c(0x1b0)]='Create\x20a\x20new\x20chat\x20session';[a9_0x41da7c(0x188)](_0x535de7){const _0x157d57=a9_0x41da7c,_0x351d3e=_0x535de7[_0x157d57(0x1a1)],_0x44b1d7=_0x351d3e[_0x157d57(0x18f)],_0x5c954e=_0x351d3e[_0x157d57(0x1c1)];if(!_0x44b1d7&&!_0x5c954e)return _0x157d57(0x1a7);return undefined;}async[a9_0x41da7c(0x191)](_0x4f8ce1){const _0x16bed4=a9_0x41da7c,{options:_0x570ea8,tdx:_0x470aed}=_0x4f8ce1,_0x1e1518=_0x570ea8,_0x5cd6bd=_0x1e1518['agent'],_0x463af2=_0x1e1518[_0x16bed4(0x1c1)],_0x3353ce=_0x1e1518[_0x16bed4(0x1c4)];try{const _0x59defe=await resolveAgentId(_0x470aed,_0x5cd6bd,_0x463af2,_0x3353ce,_0x570ea8[_0x16bed4(0x190)]),_0x5e1f45=await _0x470aed[_0x16bed4(0x1be)]['startChat'](_0x59defe);return saveLastChatId(_0x5e1f45['id']),console['log'](JSON[_0x16bed4(0x1bf)]({'chatId':_0x5e1f45['id'],'agentId':_0x59defe})),0x0;}catch(_0x1d0d0d){return handleSDKError(_0x1d0d0d,_0x570ea8),0x1;}}}
1
+ const a9_0x4ab2a1=a9_0x66e6;(function(_0x2a25fb,_0x3ef7a2){const _0x2cde17=a9_0x66e6,_0x388bf0=_0x2a25fb();while(!![]){try{const _0x38ebad=parseInt(_0x2cde17(0x148))/0x1*(parseInt(_0x2cde17(0x135))/0x2)+parseInt(_0x2cde17(0x150))/0x3*(parseInt(_0x2cde17(0x146))/0x4)+parseInt(_0x2cde17(0x111))/0x5*(-parseInt(_0x2cde17(0x14c))/0x6)+-parseInt(_0x2cde17(0x124))/0x7+-parseInt(_0x2cde17(0x112))/0x8*(-parseInt(_0x2cde17(0x152))/0x9)+-parseInt(_0x2cde17(0x136))/0xa+-parseInt(_0x2cde17(0x11e))/0xb*(-parseInt(_0x2cde17(0x13d))/0xc);if(_0x38ebad===_0x3ef7a2)break;else _0x388bf0['push'](_0x388bf0['shift']());}catch(_0x1d51c1){_0x388bf0['push'](_0x388bf0['shift']());}}}(a9_0x44ea,0xadb63));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{withSpinner}from'../utils/spinner.js';import{parseAgentRef}from'../sdk/agent/agent-ref-parser.js';function a9_0x44ea(){const _0x58686d=['Resolving\x20project\x20\x27','2390490wjBFDT','getDefaultAgent','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','data','claude-4.5-haiku','targetWebSearchTool','write','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','validate','resolveAgentId','Getting\x20default\x20agent...','handleChatEvent','tool_result','Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together','agentId','functionName','51505qIUZpz','16xuswvL','tool_call','Create\x20a\x20new\x20chat\x20session','type','tool','stringify','event','stream','Continuing\x20chat:\x20','Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22','args','name','74107wzVCGj','log','cause','context','streamChat','Error:\x20','593236mOsQnG','chat-create','execute','chatId','projectId','Using\x20cached\x20default\x20agent:\x20','metadata','targetAgent','llm','\x27\x20not\x20found','getOrCreateDefaultAgent','done','targetKnowledgeBase','llmProject','includes','stack','\x0aError:\x20','1844WEXebU','8686460JyaKwk','404','\x27...','verbose','--agent\x20flag','description','Resolving\x20agent\x20\x27','696ajysAa','new','streamChatJsonl','Error:\x20Chat\x20session\x20\x27','stdout','message','targetFunction','llmAgent','content','4pXjPtu','\x20\x20Cause:\x20','649hMiePq','error','agent','session\x20context','210EfXRAZ','chat','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','Chat\x20session:\x20','1515324BJlSlJ'];a9_0x44ea=function(){return _0x58686d;};return a9_0x44ea();}import{saveLastChatId,loadLastChatId}from'../sdk/llm/chat-cache.js';import{getLLMConversationUrl}from'../sdk/client/endpoints.js';function handleSDKError(_0x10c230,_0x5edc24){const _0x45efdd=a9_0x66e6;if(_0x10c230 instanceof SDKError)console['error'](_0x45efdd(0x123)+_0x10c230[_0x45efdd(0x142)]),_0x5edc24['verbose']&&(_0x10c230[_0x45efdd(0x120)]&&console['error'](_0x45efdd(0x147)+_0x10c230[_0x45efdd(0x120)]),_0x10c230['stack']&&(console['error']('\x0aStack\x20trace:'),console[_0x45efdd(0x149)](_0x10c230[_0x45efdd(0x133)])));else throw _0x10c230;}async function resolveAgentId(_0x2eb387,_0x2c5e87,_0x15e352,_0x178a1b,_0x2769c5){const _0x18c9e5=a9_0x66e6,_0x247375=_0x2c5e87||_0x15e352;if(_0x247375){const {projectName:_0x178d57,agentName:_0x365b83}=parseAgentRef(_0x247375),_0x51785d=_0x365b83||_0x247375,_0x3c1b7e=_0x365b83?_0x178d57:_0x178a1b;if(!_0x3c1b7e)throw new Error('No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22');if(_0x2769c5){const _0x1ddd80=_0x2c5e87?_0x18c9e5(0x13a):_0x18c9e5(0x14b);console['error']('Using\x20agent\x20from\x20'+_0x1ddd80+':\x20'+_0x3c1b7e+'/'+_0x51785d);}const _0x9fcedf=await withSpinner(_0x18c9e5(0x151)+_0x3c1b7e+_0x18c9e5(0x138),()=>_0x2eb387[_0x18c9e5(0x12c)]['resolveProjectId'](_0x3c1b7e),{'verbose':_0x2769c5}),_0x243216=await withSpinner(_0x18c9e5(0x13c)+_0x51785d+_0x18c9e5(0x138),()=>_0x2eb387[_0x18c9e5(0x12c)][_0x18c9e5(0x10a)](_0x51785d,_0x9fcedf[_0x18c9e5(0x155)]),{'verbose':_0x2769c5});return _0x243216['data'];}else{const _0x580f37=_0x2eb387[_0x18c9e5(0x12c)][_0x18c9e5(0x153)]();if(_0x580f37)return _0x2769c5&&console['error'](_0x18c9e5(0x129)+_0x580f37[_0x18c9e5(0x11d)]),_0x580f37['id'];const _0x8d7f0a=await withSpinner(_0x18c9e5(0x10b),()=>_0x2eb387[_0x18c9e5(0x12c)][_0x18c9e5(0x12e)](_0x18c9e5(0x156),0x0),{'verbose':_0x2769c5});return _0x8d7f0a[_0x18c9e5(0x155)]['id'];}}export class ChatCommand extends BaseCommand{[a9_0x4ab2a1(0x11d)]=a9_0x4ab2a1(0x14d);[a9_0x4ab2a1(0x13b)]=a9_0x4ab2a1(0x154);[a9_0x4ab2a1(0x109)](_0x550978){const _0x272267=a9_0x4ab2a1,_0x621b96=_0x550978[_0x272267(0x11c)]['join']('\x20');if(!_0x621b96)return _0x272267(0x14e);return undefined;}async['streamChat'](_0x58d3f9,_0x46d920,_0x4e2ab5,_0x53cc42,_0x5d7c99){const _0x2c8435=a9_0x4ab2a1;for await(const _0x4157f2 of _0x58d3f9[_0x2c8435(0x12c)]['chat'](_0x46d920,{'agentId':_0x4e2ab5,'chatId':_0x53cc42})){if(_0x4157f2[_0x2c8435(0x115)]===_0x2c8435(0x12a)){const _0x94f1fc=_0x4157f2[_0x2c8435(0x155)]['chatId'];saveLastChatId(_0x94f1fc),_0x5d7c99&&console[_0x2c8435(0x149)](_0x2c8435(0x14f)+_0x94f1fc);}else _0x4157f2[_0x2c8435(0x115)]===_0x2c8435(0x118)&&this[_0x2c8435(0x10c)](_0x4157f2[_0x2c8435(0x155)]);}}async[a9_0x4ab2a1(0x13f)](_0x23c651,_0x525380,_0x9bd3f6,_0x340736){const _0x523c1b=a9_0x4ab2a1,_0x4b8281=_0x23c651[_0x523c1b(0x121)]['site'];let _0x550fb1=![];for await(const _0xb05f98 of _0x23c651['llm']['chat'](_0x525380,{'agentId':_0x9bd3f6,'chatId':_0x340736})){if(_0xb05f98['type']==='metadata'){const _0x242994=_0xb05f98[_0x523c1b(0x155)];saveLastChatId(_0x242994[_0x523c1b(0x127)]);const _0x45c1a0=_0x242994['projectId']&&_0x242994[_0x523c1b(0x10f)]?getLLMConversationUrl(_0x4b8281,_0x242994[_0x523c1b(0x128)],_0x242994[_0x523c1b(0x10f)],_0x242994['chatId']):undefined;console['log'](JSON[_0x523c1b(0x117)]({'type':'metadata','data':{'chatId':_0x242994['chatId'],'agentId':_0x242994[_0x523c1b(0x10f)],'consoleUrl':_0x45c1a0}})),_0x550fb1=!![];}else{if(_0xb05f98[_0x523c1b(0x115)]===_0x523c1b(0x118)){!_0x550fb1&&_0x340736&&(console[_0x523c1b(0x11f)](JSON[_0x523c1b(0x117)]({'type':_0x523c1b(0x12a),'data':{'chatId':_0x340736}})),_0x550fb1=!![]);const _0x26400d=_0xb05f98[_0x523c1b(0x155)];if(_0x523c1b(0x145)in _0x26400d)console[_0x523c1b(0x11f)](JSON[_0x523c1b(0x117)]({'type':_0x523c1b(0x145),'data':{'content':_0x26400d[_0x523c1b(0x145)]}}));else{if(_0x523c1b(0x113)in _0x26400d){const _0x2b956d=_0x26400d[_0x523c1b(0x113)];console[_0x523c1b(0x11f)](JSON['stringify']({'type':_0x523c1b(0x113),'data':{'id':_0x2b956d['id'],'name':_0x2b956d['functionName'],'target':_0x2b956d[_0x523c1b(0x130)]?.[_0x523c1b(0x11d)]||_0x2b956d[_0x523c1b(0x12b)]?.[_0x523c1b(0x11d)]||_0x2b956d[_0x523c1b(0x106)]?.[_0x523c1b(0x11d)]||_0x2b956d[_0x523c1b(0x143)]}}));}else{if('tool'in _0x26400d)console[_0x523c1b(0x11f)](JSON['stringify']({'type':_0x523c1b(0x10d),'data':{'id':_0x26400d[_0x523c1b(0x116)]['id'],'name':_0x26400d[_0x523c1b(0x116)][_0x523c1b(0x110)],'result':typeof _0x26400d[_0x523c1b(0x116)]['content']==='string'?_0x26400d[_0x523c1b(0x116)][_0x523c1b(0x145)]['slice'](0x0,0x1f4):''}}));else _0x523c1b(0x149)in _0x26400d&&console[_0x523c1b(0x11f)](JSON[_0x523c1b(0x117)]({'type':_0x523c1b(0x149),'data':{'error':_0x26400d[_0x523c1b(0x149)]}}));}}}}}console[_0x523c1b(0x11f)](JSON[_0x523c1b(0x117)]({'type':_0x523c1b(0x12f)}));}async['execute'](_0x3974ae){const _0x2874c3=a9_0x4ab2a1,{options:_0x20085e,args:_0x220038,tdx:_0x189bd1}=_0x3974ae,_0x14ebb2=_0x220038['join']('\x20'),_0x3f35ab=_0x20085e,_0x3c7652=_0x3f35ab[_0x2874c3(0x14a)],_0x144342=_0x3f35ab[_0x2874c3(0x144)],_0x4f7c99=_0x3f35ab[_0x2874c3(0x131)],_0x4f37c1=_0x3f35ab[_0x2874c3(0x13e)],_0x143457=_0x3f35ab[_0x2874c3(0x127)],_0x1c0af8=_0x3f35ab[_0x2874c3(0x119)];if(_0x4f37c1&&_0x143457)return console[_0x2874c3(0x149)](_0x2874c3(0x10e)),0x1;try{let _0x4ecb02,_0x374299;if(_0x143457)_0x374299=_0x143457;else!_0x4f37c1&&(_0x374299=loadLastChatId(),_0x374299&&_0x20085e[_0x2874c3(0x139)]&&console['error'](_0x2874c3(0x11a)+_0x374299));!_0x143457&&(_0x4f37c1||!_0x374299)&&(_0x4ecb02=await resolveAgentId(_0x189bd1,_0x3c7652,_0x144342,_0x4f7c99,_0x20085e[_0x2874c3(0x139)]));const _0x3fb6c2=_0x1c0af8?(_0x471e4f,_0x29d036,_0x4245b6)=>this[_0x2874c3(0x13f)](_0x189bd1,_0x471e4f,_0x29d036,_0x4245b6):(_0x2bf753,_0x4094ef,_0x4af5ce)=>this[_0x2874c3(0x122)](_0x189bd1,_0x2bf753,_0x4094ef,_0x4af5ce,_0x20085e[_0x2874c3(0x139)]);try{await _0x3fb6c2(_0x14ebb2,_0x4ecb02,_0x374299);}catch(_0x2e0d14){const _0x383f5c=_0x2e0d14 instanceof SDKError&&_0x2e0d14['code']===ErrorCode['CHAT_NOT_FOUND']||_0x2e0d14 instanceof Error&&_0x2e0d14[_0x2874c3(0x142)][_0x2874c3(0x132)](_0x2874c3(0x137));if(_0x383f5c&&_0x143457)return console[_0x2874c3(0x149)](_0x2874c3(0x140)+_0x143457+_0x2874c3(0x12d)),0x1;if(_0x383f5c)_0x20085e[_0x2874c3(0x139)]&&console['error'](_0x2874c3(0x108)),!_0x4ecb02&&(_0x4ecb02=await resolveAgentId(_0x189bd1,_0x3c7652,_0x144342,_0x4f7c99,_0x20085e[_0x2874c3(0x139)])),await _0x3fb6c2(_0x14ebb2,_0x4ecb02,undefined);else throw _0x2e0d14;}return!_0x1c0af8&&console[_0x2874c3(0x11f)](),0x0;}catch(_0xac62ec){return console['error'](),handleSDKError(_0xac62ec,_0x20085e),0x1;}}[a9_0x4ab2a1(0x10c)](_0x36eef9){const _0x11066c=a9_0x4ab2a1;if(_0x11066c(0x145)in _0x36eef9)process[_0x11066c(0x141)][_0x11066c(0x107)](_0x36eef9[_0x11066c(0x145)]);else _0x11066c(0x149)in _0x36eef9&&console[_0x11066c(0x149)](_0x11066c(0x134)+_0x36eef9['error']);}}function a9_0x66e6(_0x4ee272,_0x369184){_0x4ee272=_0x4ee272-0x106;const _0x44eadb=a9_0x44ea();let _0x66e64a=_0x44eadb[_0x4ee272];return _0x66e64a;}export class ChatCreateCommand extends BaseCommand{['name']=a9_0x4ab2a1(0x125);[a9_0x4ab2a1(0x13b)]=a9_0x4ab2a1(0x114);[a9_0x4ab2a1(0x109)](_0x5a2a49){const _0x156227=a9_0x4ab2a1,_0x5957cb=_0x5a2a49['options'],_0x2c1f1d=_0x5957cb['agent'],_0x5d9aca=_0x5957cb[_0x156227(0x144)];if(!_0x2c1f1d&&!_0x5d9aca)return _0x156227(0x11b);return undefined;}async[a9_0x4ab2a1(0x126)](_0xf15fc0){const _0x3282d3=a9_0x4ab2a1,{options:_0x104ea6,tdx:_0x44ebec}=_0xf15fc0,_0x3fa5a3=_0x104ea6,_0x140608=_0x3fa5a3[_0x3282d3(0x14a)],_0x5570de=_0x3fa5a3[_0x3282d3(0x144)],_0x2f4bdd=_0x3fa5a3[_0x3282d3(0x131)];try{const _0x3dcc15=await resolveAgentId(_0x44ebec,_0x140608,_0x5570de,_0x2f4bdd,_0x104ea6[_0x3282d3(0x139)]),_0x48b021=await _0x44ebec[_0x3282d3(0x12c)]['startChat'](_0x3dcc15);return saveLastChatId(_0x48b021['id']),console[_0x3282d3(0x11f)](JSON[_0x3282d3(0x117)]({'chatId':_0x48b021['id'],'agentId':_0x3dcc15})),0x0;}catch(_0xb5a607){return handleSDKError(_0xb5a607,_0x104ea6),0x1;}}}