@treasuredata/tdx 0.16.18 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (192) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.d.ts.map +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/cli.js.map +1 -1
  7. package/dist/commands/activations.js +1 -1
  8. package/dist/commands/agent-command.js +1 -1
  9. package/dist/commands/agent-test-command.js +1 -1
  10. package/dist/commands/api-command.js +1 -1
  11. package/dist/commands/auth-command.js +1 -1
  12. package/dist/commands/chat-command.js +1 -1
  13. package/dist/commands/claude-command.js +1 -1
  14. package/dist/commands/claude-statusline-command.js +1 -1
  15. package/dist/commands/claude-usage-command.js +1 -1
  16. package/dist/commands/command.js +1 -1
  17. package/dist/commands/connection-command.js +1 -1
  18. package/dist/commands/databases.js +1 -1
  19. package/dist/commands/describe.js +1 -1
  20. package/dist/commands/engage-command.js +1 -1
  21. package/dist/commands/job-command.d.ts +3 -0
  22. package/dist/commands/job-command.d.ts.map +1 -1
  23. package/dist/commands/job-command.js +1 -1
  24. package/dist/commands/job-command.js.map +1 -1
  25. package/dist/commands/journey-command.js +1 -1
  26. package/dist/commands/journey-validate-command.js +1 -1
  27. package/dist/commands/llm-command.js +1 -1
  28. package/dist/commands/llm-proxy.js +1 -1
  29. package/dist/commands/mcp-command.js +1 -1
  30. package/dist/commands/parent-segment-command.js +1 -1
  31. package/dist/commands/profile-command.js +1 -1
  32. package/dist/commands/profiles-command.js +1 -1
  33. package/dist/commands/query-command.js +1 -1
  34. package/dist/commands/schedule-command.d.ts +67 -0
  35. package/dist/commands/schedule-command.d.ts.map +1 -0
  36. package/dist/commands/schedule-command.js +1 -0
  37. package/dist/commands/schedule-command.js.map +1 -0
  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/use-command.js +1 -1
  52. package/dist/commands/user-command.js +1 -1
  53. package/dist/commands/workflow-command.js +1 -1
  54. package/dist/core/auth.js +1 -1
  55. package/dist/core/command-output.js +1 -1
  56. package/dist/core/config.js +1 -1
  57. package/dist/core/connection-cache.js +1 -1
  58. package/dist/core/constants.js +1 -1
  59. package/dist/core/credential-cache.js +1 -1
  60. package/dist/core/global-context.js +1 -1
  61. package/dist/core/keychain.js +1 -1
  62. package/dist/core/profile.js +1 -1
  63. package/dist/core/project-config.js +1 -1
  64. package/dist/core/session.js +1 -1
  65. package/dist/core/user-cache.js +1 -1
  66. package/dist/core/version.js +1 -1
  67. package/dist/index.js +1 -1
  68. package/dist/mcp/server.js +1 -1
  69. package/dist/mcp/tools/index.js +1 -1
  70. package/dist/mcp/tools/tdx-run.js +1 -1
  71. package/dist/mcp/tools/tdx-search.js +1 -1
  72. package/dist/mcp/utils.js +1 -1
  73. package/dist/proxy/anthropic-adapter.js +1 -1
  74. package/dist/proxy/claude-usage-tracker.js +1 -1
  75. package/dist/proxy/context-signature.js +1 -1
  76. package/dist/proxy/conversation-utils.js +1 -1
  77. package/dist/proxy/passthrough-server.js +1 -1
  78. package/dist/proxy/server.js +1 -1
  79. package/dist/proxy/session-cache.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/api.js +1 -1
  90. package/dist/sdk/client/cdp-api-client.js +1 -1
  91. package/dist/sdk/client/endpoints.js +1 -1
  92. package/dist/sdk/client/engage-api-client.js +1 -1
  93. package/dist/sdk/client/http-client.js +1 -1
  94. package/dist/sdk/client/llm-api-client.js +1 -1
  95. package/dist/sdk/client/rate-limiter.js +1 -1
  96. package/dist/sdk/client/td-api-client.d.ts +64 -1
  97. package/dist/sdk/client/td-api-client.d.ts.map +1 -1
  98. package/dist/sdk/client/td-api-client.js +1 -1
  99. package/dist/sdk/client/td-api-client.js.map +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/engage.js +1 -1
  105. package/dist/sdk/errors.js +1 -1
  106. package/dist/sdk/index.d.ts +6 -0
  107. package/dist/sdk/index.d.ts.map +1 -1
  108. package/dist/sdk/index.js +1 -1
  109. package/dist/sdk/index.js.map +1 -1
  110. package/dist/sdk/io/index.js +1 -1
  111. package/dist/sdk/io/node-filesystem.js +1 -1
  112. package/dist/sdk/job.js +1 -1
  113. package/dist/sdk/journey.js +1 -1
  114. package/dist/sdk/llm/chat-cache.js +1 -1
  115. package/dist/sdk/llm/index.js +1 -1
  116. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  117. package/dist/sdk/llm/model-aliases.js +1 -1
  118. package/dist/sdk/llm/model-factors.js +1 -1
  119. package/dist/sdk/query/index.js +1 -1
  120. package/dist/sdk/query/sql-parser.js +1 -1
  121. package/dist/sdk/schedule.d.ts +99 -0
  122. package/dist/sdk/schedule.d.ts.map +1 -0
  123. package/dist/sdk/schedule.js +1 -0
  124. package/dist/sdk/schedule.js.map +1 -0
  125. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  126. package/dist/sdk/segment/fields-display.js +1 -1
  127. package/dist/sdk/segment/file-discovery.js +1 -1
  128. package/dist/sdk/segment/journey-utils.js +1 -1
  129. package/dist/sdk/segment/journey-yaml.js +1 -1
  130. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  131. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  132. package/dist/sdk/segment/pull-workflow.js +1 -1
  133. package/dist/sdk/segment/push-workflow.js +1 -1
  134. package/dist/sdk/segment/resolution-context.js +1 -1
  135. package/dist/sdk/segment/segment-path-parser.js +1 -1
  136. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  137. package/dist/sdk/segment/target-resolution.js +1 -1
  138. package/dist/sdk/segment/tdx-config.js +1 -1
  139. package/dist/sdk/segment/validate-files.js +1 -1
  140. package/dist/sdk/segment/yaml-validator.js +1 -1
  141. package/dist/sdk/segment.js +1 -1
  142. package/dist/sdk/types/index.d.ts +1 -0
  143. package/dist/sdk/types/index.d.ts.map +1 -1
  144. package/dist/sdk/types/index.js +1 -1
  145. package/dist/sdk/types/progress.js +1 -1
  146. package/dist/sdk/types/schedule.d.ts +196 -0
  147. package/dist/sdk/types/schedule.d.ts.map +1 -0
  148. package/dist/sdk/types/schedule.js +1 -0
  149. package/dist/sdk/types/schedule.js.map +1 -0
  150. package/dist/sdk/user.js +1 -1
  151. package/dist/sdk/util/format-detector.js +1 -1
  152. package/dist/sdk/util/formatters.js +1 -1
  153. package/dist/sdk/util/index.js +1 -1
  154. package/dist/sdk/util/tree-formatter.js +1 -1
  155. package/dist/sdk/workflow/clone-workflow.js +1 -1
  156. package/dist/sdk/workflow/index.js +1 -1
  157. package/dist/sdk/workflow/pull-workflow.js +1 -1
  158. package/dist/sdk/workflow/push-workflow.js +1 -1
  159. package/dist/sdk/workflow/tdx-config.js +1 -1
  160. package/dist/sdk/workflow/workflow-utils.js +1 -1
  161. package/dist/test-utils/command-runner.js +1 -1
  162. package/dist/test-utils/factories.js +1 -1
  163. package/dist/test-utils/fixtures.js +1 -1
  164. package/dist/test-utils/http-mock.js +1 -1
  165. package/dist/test-utils/index.js +1 -1
  166. package/dist/utils/async.js +1 -1
  167. package/dist/utils/colors.js +1 -1
  168. package/dist/utils/diff.js +1 -1
  169. package/dist/utils/file-permissions.js +1 -1
  170. package/dist/utils/global-cache.js +1 -1
  171. package/dist/utils/json-loader.js +1 -1
  172. package/dist/utils/local-cache.js +1 -1
  173. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  174. package/dist/utils/logger/formatters/index.js +1 -1
  175. package/dist/utils/logger/handlers/console-handler.js +1 -1
  176. package/dist/utils/logger/handlers/file-handler.js +1 -1
  177. package/dist/utils/logger/handlers/index.js +1 -1
  178. package/dist/utils/logger/handlers/null-handler.js +1 -1
  179. package/dist/utils/logger/index.js +1 -1
  180. package/dist/utils/logger/logger.js +1 -1
  181. package/dist/utils/logger/types.js +1 -1
  182. package/dist/utils/option-validation.js +1 -1
  183. package/dist/utils/port.js +1 -1
  184. package/dist/utils/process.js +1 -1
  185. package/dist/utils/prompt.js +1 -1
  186. package/dist/utils/spinner.js +1 -1
  187. package/dist/utils/sse-parser.js +1 -1
  188. package/dist/utils/string-utils.js +1 -1
  189. package/dist/utils/table-ref-parser.js +1 -1
  190. package/dist/utils/tdx-logger.js +1 -1
  191. package/dist/utils/version-check.js +1 -1
  192. package/package.json +2 -2
@@ -1 +1 @@
1
- const a4_0x381d38=a4_0x2f5f;(function(_0x3cbd4c,_0x240562){const _0x2f562f=a4_0x2f5f,_0x8bc41a=_0x3cbd4c();while(!![]){try{const _0x486730=parseInt(_0x2f562f(0x11b))/0x1+parseInt(_0x2f562f(0x190))/0x2+-parseInt(_0x2f562f(0x180))/0x3+-parseInt(_0x2f562f(0x15e))/0x4+parseInt(_0x2f562f(0x12f))/0x5+-parseInt(_0x2f562f(0x16d))/0x6*(parseInt(_0x2f562f(0x163))/0x7)+-parseInt(_0x2f562f(0x171))/0x8*(-parseInt(_0x2f562f(0x188))/0x9);if(_0x486730===_0x240562)break;else _0x8bc41a['push'](_0x8bc41a['shift']());}catch(_0x3df12d){_0x8bc41a['push'](_0x8bc41a['shift']());}}}(a4_0x105d,0x69e62));import a4_0x2be47d from'chalk';import a4_0x29509f 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}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext}from'../sdk/agent/agent-config.js';function a4_0x105d(){const _0x291a1b=['agent:pull','1917870yqsjXV','Would\x20pull\x20agent:\x20','created','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','Analyzing\x20project\x20\x22','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','MISSING_ARGUMENT','New\x20project\x20ID:\x20','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','\x20\x20tdx\x20agent\x20clone\x20agents/','dryRun','\x20errors','site','\x0aChanges\x20to\x20prompt\x20\x27','Using\x20project\x20from\x20','Project\x20cloned\x20successfully','✔\x20Context\x20set:\x20','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','Errors:','integrations','updated','\x0aProject\x20pushed\x20with\x20errors','\x20total','errors','knowledgeBases','pullProject','Output:\x20','action','\x22\x20to\x20a\x20different\x20profile','\x20files\x20to\x20','description','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','\x20\x20Prompts:\x20','\x22:\x20','no_local_folder','cyan','\x20\x20Agents:\x20','llm_project','\x0aWrite\x20','Usage:\x20tdx\x20agent\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20project\x20(requires\x20context\x20or\x20tdx.json)','agentId','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20#\x20Pull\x20specific\x20agent','outputPath','counts','diff','projectId','2117620EChqUL','Status:\x20','found','sourceProjectName','\x0aChanges:','12747lNriGQ','Dry\x20run\x20-\x20no\x20changes\x20made','Project:\x20','\x20unchanged','gray','Cannot\x20clone\x20from\x20context\x20project\x20\x22','Source:\x20','\x20changed','\x22\x20from\x20project\x20\x22','\x20resources?','972DypVqh','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','\x20--profile\x20','new','8aOQFFY','Pulling\x20agent\x20\x22','\x22...','Using\x20context\x20project:\x20','\x20\x20Integrations:\x20','\x20files?','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project','\x20|\x20','newProjectId','force','\x22\x20to\x20\x22','Using\x20project:\x20','source','log','No\x20tdx.json\x20found\x20in\x20','1902603qQCHbb','textKnowledgeBases','\x20updated','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','<new-name>','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','unchanged','\x20\x20Agent\x20\x22','2310732igDhWm','dirname','Using\x20local\x20project:\x20','INVALID_ARGUMENT','Clone\x20cancelled','Would\x20push\x20agent:\x20','projectDir','Dry\x20run\x20-\x20no\x20files\x20written','1113862aJAgEX','newProjectName','green','profile','Output\x20path:\x20','prompts','\x20\x20Knowledge\x20Bases:\x20','\x20\x20Knowledge\x20Base\x20\x22','name','Analyzing\x20changes\x20to\x20push...','isNew','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','Pull\x20cancelled','llm','session','outputDir','\x20--name\x20','message','\x0a✔\x20Pushed\x20','Pushing\x20to\x20project...','no_context','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','New\x20project:\x20','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','\x20=\x20','Agent\x20pulled\x20successfully','pushAgent','reason','Pushing\x20agent\x20from\x20\x22','error','\x0a✔\x20Pulled\x20','repeat','yellow','agent:clone','push','\x20\x20Prompt\x20\x22','tdx.json','projectName','\x20\x20tdx\x20agent\x20pull\x20','Would\x20clone:','\x20new','yes','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','agentName','pullAgent','Using\x20current\x20project:\x20','output','Agent:\x20','Chat:\x20','\x20\x20Target:\x20','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','llmProject','total','Push\x20cancelled','695117FtjzYm','join','\x20\x20Text\x20Knowledge\x20Base\x20\x22','\x20created','agents','\x0aPull\x20summary\x20for\x20\x27','parse','Clone\x20\x22','red','execute','\x20\x20Text\x20Knowledge\x20Bases:\x20','cwd','pushProject','\x20\x20Integration\x20\x22','dim','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','\x0aErrors\x20found:','\x20\x20Source:\x20','\x0aChanges\x20to\x20agent\x20\x27'];a4_0x105d=function(){return _0x291a1b;};return a4_0x105d();}import{saveSessionContext}from'../core/session.js';function a4_0x2f5f(_0x2fe361,_0x7ffeab){_0x2fe361=_0x2fe361-0x119;const _0x105d61=a4_0x105d();let _0x2f5fd1=_0x105d61[_0x2fe361];return _0x2f5fd1;}import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x56b8a5){const _0x54cde7=a4_0x2f5f,_0x11c4aa=[];if(_0x56b8a5[_0x54cde7(0x119)]!==undefined)_0x11c4aa['push'](_0x56b8a5[_0x54cde7(0x119)]+_0x54cde7(0x145));if(_0x56b8a5['new']!==undefined&&_0x56b8a5[_0x54cde7(0x170)]>0x0)_0x11c4aa['push'](a4_0x2be47d[_0x54cde7(0x192)](_0x56b8a5['new']+_0x54cde7(0x1b8)));if(_0x56b8a5[_0x54cde7(0x131)]!==undefined&&_0x56b8a5['created']>0x0)_0x11c4aa['push'](a4_0x2be47d[_0x54cde7(0x192)](_0x56b8a5[_0x54cde7(0x131)]+_0x54cde7(0x11e)));if(_0x56b8a5['updated']!==undefined&&_0x56b8a5[_0x54cde7(0x143)]>0x0)_0x11c4aa[_0x54cde7(0x1b2)](a4_0x2be47d[_0x54cde7(0x1b0)](_0x56b8a5[_0x54cde7(0x143)]+_0x54cde7(0x182)));if(_0x56b8a5[_0x54cde7(0x186)]!==undefined&&_0x56b8a5[_0x54cde7(0x186)]>0x0)_0x11c4aa['push'](a4_0x2be47d[_0x54cde7(0x167)](_0x56b8a5[_0x54cde7(0x186)]+'\x20unchanged'));if(_0x56b8a5[_0x54cde7(0x146)]!==undefined&&_0x56b8a5[_0x54cde7(0x146)]>0x0)_0x11c4aa['push'](a4_0x2be47d['red'](_0x56b8a5[_0x54cde7(0x146)]+_0x54cde7(0x13a)));return _0x11c4aa[_0x54cde7(0x11c)](',\x20');}function displayDiffs(_0x2a3a99,_0x291424,_0x2740d3,_0x332c27,_0x4eba06=[]){const _0x1b707a=a4_0x2f5f;for(const _0x55f1af of _0x2a3a99){if(_0x55f1af['diff']){const _0x475727=_0x55f1af[_0x1b707a(0x1bb)]||_0x55f1af[_0x1b707a(0x198)];console[_0x1b707a(0x17e)](_0x1b707a(0x12d)+_0x475727+'\x27:'),console[_0x1b707a(0x17e)]('─'[_0x1b707a(0x1af)](0x3c)),console[_0x1b707a(0x17e)](_0x55f1af[_0x1b707a(0x15c)]),console[_0x1b707a(0x17e)]('─'[_0x1b707a(0x1af)](0x3c));}}for(const _0x37e3dc of _0x291424){_0x37e3dc['diff']&&(console[_0x1b707a(0x17e)](_0x1b707a(0x185)+_0x37e3dc[_0x1b707a(0x198)]+'\x27:'),console[_0x1b707a(0x17e)]('─'[_0x1b707a(0x1af)](0x3c)),console[_0x1b707a(0x17e)](_0x37e3dc[_0x1b707a(0x15c)]),console['log']('─'[_0x1b707a(0x1af)](0x3c)));}for(const _0x5738a7 of _0x2740d3){_0x5738a7['diff']&&(console[_0x1b707a(0x17e)](_0x1b707a(0x140)+_0x5738a7[_0x1b707a(0x198)]+'\x27:'),console[_0x1b707a(0x17e)]('─'[_0x1b707a(0x1af)](0x3c)),console[_0x1b707a(0x17e)](_0x5738a7[_0x1b707a(0x15c)]),console[_0x1b707a(0x17e)]('─'[_0x1b707a(0x1af)](0x3c)));}for(const _0x5f2322 of _0x332c27){_0x5f2322[_0x1b707a(0x15c)]&&(console[_0x1b707a(0x17e)](_0x1b707a(0x13c)+_0x5f2322['name']+'\x27:'),console[_0x1b707a(0x17e)]('─'[_0x1b707a(0x1af)](0x3c)),console[_0x1b707a(0x17e)](_0x5f2322[_0x1b707a(0x15c)]),console[_0x1b707a(0x17e)]('─'[_0x1b707a(0x1af)](0x3c)));}for(const _0x183f26 of _0x4eba06){_0x183f26[_0x1b707a(0x15c)]&&(console[_0x1b707a(0x17e)]('\x0aChanges\x20to\x20integration\x20\x27'+_0x183f26[_0x1b707a(0x198)]+'\x27:'),console[_0x1b707a(0x17e)]('─'['repeat'](0x3c)),console[_0x1b707a(0x17e)](_0x183f26[_0x1b707a(0x15c)]),console[_0x1b707a(0x17e)]('─'[_0x1b707a(0x1af)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x381d38(0x198)]=a4_0x381d38(0x12e);[a4_0x381d38(0x14d)]='Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files';async[a4_0x381d38(0x124)](_0x5a7917){const _0x1f5c35=a4_0x381d38,{options:_0x511413,args:_0x5b3344,tdx:_0x2c0cc5}=_0x5a7917,_0x137172=_0x5b3344[0x0],_0x3e3c33=_0x5b3344[0x1],_0x1d8d43=_0x511413[_0x1f5c35(0x1be)],_0x165614=_0x511413['dryRun'],_0x14caa9=_0x511413[_0x1f5c35(0x17a)],_0x520d64=_0x511413[_0x1f5c35(0x1b9)],_0xf0f611=_0x511413[_0x1f5c35(0x1c3)];let _0x303ba8,_0x579267;const _0xaf0022=findAgentConfigPath(process[_0x1f5c35(0x126)]());if(_0x137172){const _0x4a7ca9=a4_0x29509f['join'](_0x137172,_0x1f5c35(0x1b4));if(existsSync(_0x4a7ca9))try{const _0x4cb110=JSON['parse'](readFileSync(_0x4a7ca9,'utf-8'));_0x303ba8=_0x4cb110[_0x1f5c35(0x155)],_0x579267=_0x137172,console[_0x1f5c35(0x17e)](a4_0x2be47d[_0x1f5c35(0x129)](_0x1f5c35(0x13d)+_0x4a7ca9+':\x20'+_0x303ba8));}catch{_0x303ba8=_0x137172;}else _0x303ba8=_0x137172;}else{if(_0xaf0022)try{const _0x5875b4=JSON[_0x1f5c35(0x121)](readFileSync(_0xaf0022,'utf-8'));_0x303ba8=_0x5875b4[_0x1f5c35(0x155)],_0x579267=a4_0x29509f[_0x1f5c35(0x189)](_0xaf0022),console['log'](a4_0x2be47d['dim'](_0x1f5c35(0x17c)+_0x303ba8));}catch{_0x303ba8=_0xf0f611;}else _0x303ba8=_0xf0f611;}if(!_0x303ba8)return console[_0x1f5c35(0x17e)](a4_0x2be47d[_0x1f5c35(0x1b0)](_0x1f5c35(0x137))),console[_0x1f5c35(0x17e)](_0x1f5c35(0x157)),console[_0x1f5c35(0x17e)](_0x1f5c35(0x177)),console[_0x1f5c35(0x17e)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory'),console[_0x1f5c35(0x17e)](_0x1f5c35(0x159)),0x1;if(_0x3e3c33){const {data:_0x4f434e}=await withSpinner(_0x1f5c35(0x172)+_0x3e3c33+_0x1f5c35(0x16b)+_0x303ba8+_0x1f5c35(0x173),()=>_0x2c0cc5[_0x1f5c35(0x19d)][_0x1f5c35(0x1bc)](_0x303ba8,_0x3e3c33,_0x1d8d43,{'dryRun':_0x165614,'force':_0x14caa9}));if(_0x165614)return console['log'](a4_0x2be47d[_0x1f5c35(0x1b0)](_0x1f5c35(0x18f))),console[_0x1f5c35(0x17e)](_0x1f5c35(0x130)+_0x4f434e['agentName']),console[_0x1f5c35(0x17e)](_0x1f5c35(0x194)+_0x4f434e[_0x1f5c35(0x15a)]),_0x4f434e['diff']&&(console[_0x1f5c35(0x17e)](_0x1f5c35(0x162)),console[_0x1f5c35(0x17e)]('─'[_0x1f5c35(0x1af)](0x3c)),console[_0x1f5c35(0x17e)](_0x4f434e[_0x1f5c35(0x15c)]),console[_0x1f5c35(0x17e)]('─'['repeat'](0x3c))),0x0;return console[_0x1f5c35(0x17e)](a4_0x2be47d['green'](_0x1f5c35(0x1a9))),console[_0x1f5c35(0x17e)](_0x1f5c35(0x1bf)+_0x4f434e['agentName']),console[_0x1f5c35(0x17e)](_0x1f5c35(0x149)+_0x4f434e[_0x1f5c35(0x15a)]),console[_0x1f5c35(0x17e)](_0x1f5c35(0x15f)+(_0x4f434e[_0x1f5c35(0x19a)]?a4_0x2be47d[_0x1f5c35(0x192)](_0x1f5c35(0x170)):_0x4f434e['hasChanges']?a4_0x2be47d[_0x1f5c35(0x1b0)]('updated'):a4_0x2be47d[_0x1f5c35(0x167)](_0x1f5c35(0x186)))),0x0;}const _0xe6243b=_0x579267||_0x1d8d43,{data:_0x282cff}=await withSpinner(_0x1f5c35(0x133)+_0x303ba8+'\x22...',()=>_0x2c0cc5[_0x1f5c35(0x19d)][_0x1f5c35(0x148)](_0x303ba8,_0xe6243b,{'dryRun':!![]})),_0x4b9269=_0x282cff['counts'][_0x1f5c35(0x11f)][_0x1f5c35(0x170)]+_0x282cff[_0x1f5c35(0x15b)]['knowledgeBases'][_0x1f5c35(0x170)]+_0x282cff[_0x1f5c35(0x15b)][_0x1f5c35(0x181)][_0x1f5c35(0x170)]+_0x282cff['counts']['prompts'][_0x1f5c35(0x170)]+_0x282cff[_0x1f5c35(0x15b)]['integrations'][_0x1f5c35(0x170)],_0x3aba09=_0x282cff[_0x1f5c35(0x15b)]['agents']['updated']+_0x282cff[_0x1f5c35(0x15b)][_0x1f5c35(0x147)][_0x1f5c35(0x143)]+_0x282cff[_0x1f5c35(0x15b)]['textKnowledgeBases']['updated']+_0x282cff[_0x1f5c35(0x15b)][_0x1f5c35(0x195)][_0x1f5c35(0x143)]+_0x282cff[_0x1f5c35(0x15b)]['integrations']['updated'],_0x47f67d=_0x282cff[_0x1f5c35(0x15b)]['agents'][_0x1f5c35(0x186)]+_0x282cff[_0x1f5c35(0x15b)][_0x1f5c35(0x147)][_0x1f5c35(0x186)]+_0x282cff[_0x1f5c35(0x15b)][_0x1f5c35(0x181)][_0x1f5c35(0x186)]+_0x282cff[_0x1f5c35(0x15b)][_0x1f5c35(0x195)][_0x1f5c35(0x186)]+_0x282cff[_0x1f5c35(0x15b)][_0x1f5c35(0x142)][_0x1f5c35(0x186)];console[_0x1f5c35(0x17e)](_0x1f5c35(0x120)+_0x282cff[_0x1f5c35(0x1b5)]+'\x27:'),console[_0x1f5c35(0x17e)]('\x20\x20'+a4_0x2be47d[_0x1f5c35(0x192)]('+\x20'+_0x4b9269+_0x1f5c35(0x1b8))+_0x1f5c35(0x178)+a4_0x2be47d['yellow']('~\x20'+_0x3aba09+_0x1f5c35(0x16a))+_0x1f5c35(0x178)+a4_0x2be47d[_0x1f5c35(0x129)]('=\x20'+_0x47f67d+_0x1f5c35(0x166))),console[_0x1f5c35(0x17e)](_0x1f5c35(0x154)+formatCountSummary(_0x282cff[_0x1f5c35(0x15b)][_0x1f5c35(0x11f)])),console[_0x1f5c35(0x17e)](_0x1f5c35(0x196)+formatCountSummary(_0x282cff[_0x1f5c35(0x15b)][_0x1f5c35(0x147)])),console[_0x1f5c35(0x17e)](_0x1f5c35(0x125)+formatCountSummary(_0x282cff[_0x1f5c35(0x15b)][_0x1f5c35(0x181)])),console[_0x1f5c35(0x17e)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x282cff[_0x1f5c35(0x15b)][_0x1f5c35(0x195)])),console[_0x1f5c35(0x17e)](_0x1f5c35(0x175)+formatCountSummary(_0x282cff['counts'][_0x1f5c35(0x142)])),console[_0x1f5c35(0x17e)](_0x1f5c35(0x1c1)+a4_0x2be47d[_0x1f5c35(0x153)](_0x282cff['outputDir'])),displayDiffs(_0x282cff[_0x1f5c35(0x11f)],_0x282cff[_0x1f5c35(0x147)],_0x282cff[_0x1f5c35(0x181)],_0x282cff[_0x1f5c35(0x195)],_0x282cff[_0x1f5c35(0x142)]);if(_0x165614)return console['log'](a4_0x2be47d['yellow'](_0x1f5c35(0x183))),0x0;if(_0x4b9269===0x0&&_0x3aba09===0x0)return console[_0x1f5c35(0x17e)](a4_0x2be47d['green']('\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'llm_project':_0x282cff[_0x1f5c35(0x1b5)]},_0x511413[_0x1f5c35(0x19e)]),console[_0x1f5c35(0x17e)](a4_0x2be47d[_0x1f5c35(0x192)](_0x1f5c35(0x13f)+a4_0x2be47d[_0x1f5c35(0x129)](_0x1f5c35(0x155))+'\x20=\x20'+a4_0x2be47d['cyan'](_0x282cff['projectName']))),0x0;if(!_0x520d64&&!_0x14caa9){const _0x2a9e40=await confirmKey(_0x1f5c35(0x156)+(_0x4b9269+_0x3aba09)+_0x1f5c35(0x176));if(!_0x2a9e40)return console[_0x1f5c35(0x17e)](_0x1f5c35(0x19c)),0x0;}const {data:_0x3a53d8}=await withSpinner('Writing\x20files...',()=>_0x2c0cc5[_0x1f5c35(0x19d)]['pullProject'](_0x303ba8,_0xe6243b,{'force':_0x14caa9}));return console[_0x1f5c35(0x17e)](a4_0x2be47d[_0x1f5c35(0x192)](_0x1f5c35(0x1ae)+(_0x4b9269+_0x3aba09)+_0x1f5c35(0x14c)+_0x3a53d8[_0x1f5c35(0x19f)])),saveSessionContext({'llm_project':_0x3a53d8[_0x1f5c35(0x1b5)]},_0x511413['session']),console[_0x1f5c35(0x17e)](a4_0x2be47d[_0x1f5c35(0x192)](_0x1f5c35(0x13f)+a4_0x2be47d[_0x1f5c35(0x129)]('llm_project')+_0x1f5c35(0x1a8)+a4_0x2be47d[_0x1f5c35(0x153)](_0x3a53d8['projectName']))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x381d38(0x198)]=a4_0x381d38(0x1b1);[a4_0x381d38(0x14d)]=a4_0x381d38(0x132);async['execute'](_0x43b716){const _0x531fa8=a4_0x381d38,{options:_0x399bf1,args:_0x36f33b,tdx:_0x5a1563}=_0x43b716,_0x2d88dc=_0x36f33b[0x0],_0x6a9cac=_0x399bf1[_0x531fa8(0x198)],_0x41109c=_0x399bf1[_0x531fa8(0x139)],_0x4c91a9=_0x399bf1['yes'],_0x52c803=_0x399bf1[_0x531fa8(0x13b)],_0x193a36=_0x399bf1[_0x531fa8(0x1c3)];let _0x4e1040;const _0x1db6cb=findAgentConfigPath(process[_0x531fa8(0x126)]());if(_0x2d88dc){const _0x23bb3=a4_0x29509f[_0x531fa8(0x11c)](_0x2d88dc,'tdx.json');existsSync(_0x23bb3)?(_0x4e1040=_0x2d88dc,console[_0x531fa8(0x17e)](a4_0x2be47d['dim'](_0x531fa8(0x18a)+_0x2d88dc))):_0x4e1040=_0x2d88dc;}else{if(_0x1db6cb)_0x4e1040=a4_0x29509f[_0x531fa8(0x189)](_0x1db6cb),console[_0x531fa8(0x17e)](a4_0x2be47d[_0x531fa8(0x129)](_0x531fa8(0x1bd)+_0x4e1040));else{if(_0x193a36){const _0x41d96e=sanitizeForFilesystem(_0x193a36);let _0x2b4dcd=_0x41d96e,_0x2934d3=a4_0x29509f['join'](process[_0x531fa8(0x126)](),_0x531fa8(0x11f),_0x41d96e,_0x531fa8(0x1b4));if(!existsSync(_0x2934d3)){const _0x134c48=normalizeName(_0x193a36),_0x1e6117=a4_0x29509f['join'](process[_0x531fa8(0x126)](),_0x531fa8(0x11f),_0x134c48,_0x531fa8(0x1b4));existsSync(_0x1e6117)&&(_0x2b4dcd=_0x134c48,_0x2934d3=_0x1e6117);}if(existsSync(_0x2934d3))_0x4e1040=a4_0x29509f[_0x531fa8(0x189)](_0x2934d3),console[_0x531fa8(0x17e)](a4_0x2be47d[_0x531fa8(0x129)](_0x531fa8(0x18a)+_0x4e1040));else{const _0x368cd5=_0x399bf1[_0x531fa8(0x193)];if(_0x368cd5)throw new SDKError(ErrorCode[_0x531fa8(0x18b)],_0x531fa8(0x168)+_0x193a36+_0x531fa8(0x14b),undefined,{'helpText':_0x531fa8(0x1a7)+_0x531fa8(0x1a5)+(_0x531fa8(0x1b6)+_0x193a36+'\x0a')+(_0x531fa8(0x138)+_0x2b4dcd+_0x531fa8(0x1a0)+(_0x6a9cac||_0x531fa8(0x184))+_0x531fa8(0x16f)+_0x368cd5)});_0x4e1040=_0x193a36,console[_0x531fa8(0x17e)](a4_0x2be47d[_0x531fa8(0x129)](_0x531fa8(0x174)+_0x193a36));}}}}if(!_0x4e1040)return console[_0x531fa8(0x17e)](a4_0x2be47d[_0x531fa8(0x1b0)](_0x531fa8(0x19b))),console[_0x531fa8(0x17e)](_0x531fa8(0x14e)),console[_0x531fa8(0x17e)](_0x531fa8(0x12a)),console[_0x531fa8(0x17e)]('\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']('\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>'),0x1;if(!_0x6a9cac)throw new SDKError(ErrorCode[_0x531fa8(0x135)],'New\x20project\x20name\x20is\x20required',undefined,{'helpText':_0x531fa8(0x1ba)});if(!_0x4c91a9&&!_0x41109c){const _0x33b438=await confirmKey(_0x531fa8(0x122)+_0x4e1040+'\x22\x20to\x20new\x20project\x20\x22'+_0x6a9cac+'\x22?');if(!_0x33b438)return console['log'](_0x531fa8(0x18c)),0x0;}const {data:_0x41d355}=await withSpinner('Cloning\x20\x22'+_0x4e1040+_0x531fa8(0x17b)+_0x6a9cac+_0x531fa8(0x173),()=>_0x5a1563['llm']['cloneProject'](_0x4e1040,_0x6a9cac,{'dryRun':_0x41109c}));if(_0x41109c)return console['log'](a4_0x2be47d[_0x531fa8(0x1b0)](_0x531fa8(0x164))),console[_0x531fa8(0x17e)](_0x531fa8(0x169)+_0x41d355[_0x531fa8(0x161)]),console[_0x531fa8(0x17e)](_0x531fa8(0x1a6)+_0x6a9cac),console[_0x531fa8(0x17e)](_0x531fa8(0x1b7)),console[_0x531fa8(0x17e)](_0x531fa8(0x154)+_0x41d355[_0x531fa8(0x15b)][_0x531fa8(0x11f)][_0x531fa8(0x131)]),console[_0x531fa8(0x17e)](_0x531fa8(0x196)+_0x41d355[_0x531fa8(0x15b)][_0x531fa8(0x147)]['created']),console[_0x531fa8(0x17e)](_0x531fa8(0x150)+_0x41d355[_0x531fa8(0x15b)][_0x531fa8(0x195)][_0x531fa8(0x131)]),0x0;const _0x581f3d=_0x41d355[_0x531fa8(0x15b)][_0x531fa8(0x11f)]['errors']>0x0||_0x41d355['counts']['knowledgeBases'][_0x531fa8(0x146)]>0x0||_0x41d355[_0x531fa8(0x15b)][_0x531fa8(0x195)][_0x531fa8(0x146)]>0x0;_0x581f3d?console['log'](a4_0x2be47d['yellow']('Project\x20cloned\x20with\x20errors')):console[_0x531fa8(0x17e)](a4_0x2be47d[_0x531fa8(0x192)](_0x531fa8(0x13e)));console[_0x531fa8(0x17e)](_0x531fa8(0x169)+_0x41d355[_0x531fa8(0x161)]),console[_0x531fa8(0x17e)](_0x531fa8(0x1a6)+_0x41d355[_0x531fa8(0x191)]),console[_0x531fa8(0x17e)](_0x531fa8(0x136)+_0x41d355[_0x531fa8(0x179)]),console[_0x531fa8(0x17e)](),console[_0x531fa8(0x17e)]('Summary:'),console['log'](_0x531fa8(0x154)+formatCountSummary(_0x41d355[_0x531fa8(0x15b)][_0x531fa8(0x11f)])),console[_0x531fa8(0x17e)](_0x531fa8(0x196)+formatCountSummary(_0x41d355[_0x531fa8(0x15b)][_0x531fa8(0x147)])),console['log'](_0x531fa8(0x150)+formatCountSummary(_0x41d355[_0x531fa8(0x15b)][_0x531fa8(0x195)])),console[_0x531fa8(0x17e)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x41d355[_0x531fa8(0x15b)][_0x531fa8(0x142)]));if(_0x581f3d){console['log'](),console[_0x531fa8(0x17e)](a4_0x2be47d[_0x531fa8(0x123)](_0x531fa8(0x141)));for(const _0x1020db of _0x41d355[_0x531fa8(0x11f)]){_0x1020db[_0x531fa8(0x14a)]==='error'&&console[_0x531fa8(0x17e)](a4_0x2be47d[_0x531fa8(0x123)](_0x531fa8(0x187)+_0x1020db[_0x531fa8(0x1bb)]+_0x531fa8(0x151)+_0x1020db[_0x531fa8(0x1ad)]));}for(const _0x11221b of _0x41d355['knowledgeBases']){_0x11221b[_0x531fa8(0x14a)]===_0x531fa8(0x1ad)&&console[_0x531fa8(0x17e)](a4_0x2be47d[_0x531fa8(0x123)]('\x20\x20Knowledge\x20Base\x20\x22'+_0x11221b[_0x531fa8(0x198)]+_0x531fa8(0x151)+_0x11221b[_0x531fa8(0x1ad)]));}for(const _0x4fd4ed of _0x41d355[_0x531fa8(0x195)]){_0x4fd4ed[_0x531fa8(0x14a)]===_0x531fa8(0x1ad)&&console[_0x531fa8(0x17e)](a4_0x2be47d[_0x531fa8(0x123)](_0x531fa8(0x1b3)+_0x4fd4ed['name']+_0x531fa8(0x151)+_0x4fd4ed[_0x531fa8(0x1ad)]));}for(const _0x509b6b of _0x41d355[_0x531fa8(0x142)]){_0x509b6b[_0x531fa8(0x14a)]===_0x531fa8(0x1ad)&&console[_0x531fa8(0x17e)](a4_0x2be47d[_0x531fa8(0x123)](_0x531fa8(0x128)+_0x509b6b[_0x531fa8(0x198)]+'\x22:\x20'+_0x509b6b['error']));}return 0x1;}console['log']();const _0x8ba9ea=getLLMProjectUrl(_0x52c803,_0x41d355['newProjectId']);return console[_0x531fa8(0x17e)]('Project:\x20'+a4_0x2be47d['cyan'](_0x8ba9ea)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x381d38(0x198)]='agent:push';['description']=a4_0x381d38(0x134);async['execute'](_0x5a3837){const _0x342383=a4_0x381d38,{options:_0x204596,args:_0xb15eee,tdx:_0x3fffd9}=_0x5a3837;let _0x4f278a=_0xb15eee[0x0]||process['cwd']();const _0x2db04a=_0x204596['dryRun'],_0x4edbb7=_0x204596[_0x342383(0x17a)],_0x1f38a1=_0x204596[_0x342383(0x1b9)],_0x91bc37=_0x204596[_0x342383(0x13b)],_0x4daf3d=a4_0x29509f[_0x342383(0x11c)](_0x4f278a,'agent.yml'),_0x70ba43=existsSync(_0x4daf3d);if(_0x70ba43){const {data:_0x3c3f0a}=await withSpinner(_0x342383(0x1ac)+_0x4f278a+_0x342383(0x173),()=>_0x3fffd9[_0x342383(0x19d)][_0x342383(0x1aa)](_0x4f278a,{'dryRun':_0x2db04a,'force':_0x4edbb7}));if(_0x2db04a)return console['log'](a4_0x2be47d['yellow'](_0x342383(0x164))),console['log'](_0x342383(0x18d)+_0x3c3f0a[_0x342383(0x1bb)]),0x0;if(_0x3c3f0a['action']===_0x342383(0x1ad))return console[_0x342383(0x17e)](a4_0x2be47d['red']('Failed\x20to\x20push\x20agent:\x20'+_0x3c3f0a[_0x342383(0x1ad)])),0x1;console[_0x342383(0x17e)](a4_0x2be47d['green']('Agent\x20'+_0x3c3f0a[_0x342383(0x14a)]+'\x20successfully')),console['log'](_0x342383(0x1bf)+_0x3c3f0a['agentName']);if(_0x3c3f0a[_0x342383(0x158)]&&_0x3c3f0a['projectId']){const _0xab9f2c=getLLMAgentChatUrl(_0x91bc37,_0x3c3f0a['projectId'],_0x3c3f0a[_0x342383(0x158)]);console['log'](_0x342383(0x1c0)+a4_0x2be47d[_0x342383(0x153)](_0xab9f2c));}return 0x0;}const _0xc350e8=_0x204596[_0x342383(0x1c3)],_0x3191bb=resolveProjectFromContext(_0x4f278a,_0xc350e8);if(_0x3191bb[_0x342383(0x160)])_0x4f278a=_0x3191bb[_0x342383(0x18e)],_0x3191bb[_0x342383(0x17d)]==='context'&&console[_0x342383(0x17e)](a4_0x2be47d[_0x342383(0x129)](_0x342383(0x17c)+_0x4f278a));else{let _0x4420d7=_0x342383(0x1c2);_0x3191bb[_0x342383(0x1ab)]===_0x342383(0x152)&&(_0x4420d7=_0x3191bb['message']+_0x342383(0x16e)+_0x3191bb[_0x342383(0x1c3)]+'\x27\x20to\x20create\x20the\x20folder\x20structure.');throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x3191bb[_0x342383(0x1ab)]===_0x342383(0x1a4)?_0x3191bb[_0x342383(0x1a1)]:_0x342383(0x17f)+_0x4f278a,undefined,{'helpText':_0x4420d7});}const {data:_0x4bb518}=await withSpinner(_0x342383(0x199),()=>_0x3fffd9[_0x342383(0x19d)]['pushProject'](_0x4f278a,{'dryRun':!![]})),_0x5c0d9b=_0x4bb518['counts'][_0x342383(0x11f)][_0x342383(0x146)]>0x0;if(_0x5c0d9b){console[_0x342383(0x17e)](a4_0x2be47d[_0x342383(0x123)](_0x342383(0x12b)));for(const _0x53b70d of _0x4bb518[_0x342383(0x11f)]){_0x53b70d['action']===_0x342383(0x1ad)&&console['log'](a4_0x2be47d[_0x342383(0x123)]('\x20\x20Agent\x20\x22'+_0x53b70d[_0x342383(0x1bb)]+_0x342383(0x151)+_0x53b70d[_0x342383(0x1ad)]));}return 0x1;}const _0x48726f=_0x4bb518[_0x342383(0x15b)][_0x342383(0x11f)]['created']+_0x4bb518['counts'][_0x342383(0x147)][_0x342383(0x131)]+_0x4bb518[_0x342383(0x15b)][_0x342383(0x181)][_0x342383(0x131)]+_0x4bb518[_0x342383(0x15b)][_0x342383(0x195)]['created']+_0x4bb518['counts'][_0x342383(0x142)][_0x342383(0x131)],_0x508a3a=_0x4bb518['counts'][_0x342383(0x11f)][_0x342383(0x143)]+_0x4bb518['counts'][_0x342383(0x147)][_0x342383(0x143)]+_0x4bb518[_0x342383(0x15b)][_0x342383(0x181)][_0x342383(0x143)]+_0x4bb518[_0x342383(0x15b)]['prompts']['updated']+_0x4bb518[_0x342383(0x15b)][_0x342383(0x142)][_0x342383(0x143)],_0xa8ba70=_0x4bb518[_0x342383(0x15b)]['agents'][_0x342383(0x186)]+_0x4bb518[_0x342383(0x15b)]['knowledgeBases']['unchanged']+_0x4bb518[_0x342383(0x15b)][_0x342383(0x181)][_0x342383(0x186)]+_0x4bb518[_0x342383(0x15b)][_0x342383(0x195)]['unchanged']+_0x4bb518[_0x342383(0x15b)][_0x342383(0x142)][_0x342383(0x186)];console[_0x342383(0x17e)]('\x0aPush\x20summary\x20for\x20\x27'+_0x4bb518[_0x342383(0x1b5)]+'\x27:'),console[_0x342383(0x17e)]('\x20\x20'+a4_0x2be47d[_0x342383(0x192)]('+\x20'+_0x48726f+'\x20new')+_0x342383(0x178)+a4_0x2be47d[_0x342383(0x1b0)]('~\x20'+_0x508a3a+_0x342383(0x16a))+_0x342383(0x178)+a4_0x2be47d[_0x342383(0x129)]('=\x20'+_0xa8ba70+_0x342383(0x166))),console[_0x342383(0x17e)](_0x342383(0x154)+formatCountSummary(_0x4bb518[_0x342383(0x15b)]['agents'])),console[_0x342383(0x17e)](_0x342383(0x196)+formatCountSummary(_0x4bb518['counts'][_0x342383(0x147)])),console['log'](_0x342383(0x125)+formatCountSummary(_0x4bb518[_0x342383(0x15b)][_0x342383(0x181)])),console[_0x342383(0x17e)](_0x342383(0x150)+formatCountSummary(_0x4bb518['counts'][_0x342383(0x195)])),console['log']('\x20\x20Integrations:\x20'+formatCountSummary(_0x4bb518[_0x342383(0x15b)][_0x342383(0x142)])),console[_0x342383(0x17e)](_0x342383(0x12c)+a4_0x2be47d['cyan'](_0x4f278a)),displayDiffs(_0x4bb518[_0x342383(0x11f)],_0x4bb518['knowledgeBases'],_0x4bb518[_0x342383(0x181)],_0x4bb518[_0x342383(0x195)],_0x4bb518[_0x342383(0x142)]);if(_0x2db04a)return console['log'](a4_0x2be47d[_0x342383(0x1b0)](_0x342383(0x14f))),0x0;if(_0x48726f===0x0&&_0x508a3a===0x0){console[_0x342383(0x17e)](a4_0x2be47d[_0x342383(0x192)]('\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date'));const _0x493ca5=getLLMProjectUrl(_0x91bc37,_0x4bb518[_0x342383(0x15d)]);return console[_0x342383(0x17e)](_0x342383(0x165)+a4_0x2be47d[_0x342383(0x153)](_0x493ca5)),0x0;}if(!_0x1f38a1&&!_0x4edbb7){const _0x223d4c=await confirmKey('\x0aPush\x20'+(_0x48726f+_0x508a3a)+_0x342383(0x16c));if(!_0x223d4c)return console['log'](_0x342383(0x11a)),0x0;}const {data:_0x46c747}=await withSpinner(_0x342383(0x1a3),()=>_0x3fffd9[_0x342383(0x19d)][_0x342383(0x127)](_0x4f278a,{'force':_0x4edbb7})),_0x39ba8b=_0x46c747['counts']['agents']['errors']>0x0||_0x46c747[_0x342383(0x15b)][_0x342383(0x147)][_0x342383(0x146)]>0x0||_0x46c747[_0x342383(0x15b)][_0x342383(0x181)][_0x342383(0x146)]>0x0||_0x46c747['counts'][_0x342383(0x195)][_0x342383(0x146)]>0x0;if(_0x39ba8b){console[_0x342383(0x17e)](a4_0x2be47d[_0x342383(0x1b0)](_0x342383(0x144))),console['log'](),console['log'](a4_0x2be47d[_0x342383(0x123)]('Errors:'));for(const _0x335491 of _0x46c747[_0x342383(0x11f)]){_0x335491['action']===_0x342383(0x1ad)&&console[_0x342383(0x17e)](a4_0x2be47d[_0x342383(0x123)](_0x342383(0x187)+_0x335491[_0x342383(0x1bb)]+_0x342383(0x151)+_0x335491['error']));}for(const _0x2da700 of _0x46c747[_0x342383(0x147)]){_0x2da700['action']==='error'&&console[_0x342383(0x17e)](a4_0x2be47d[_0x342383(0x123)](_0x342383(0x197)+_0x2da700[_0x342383(0x198)]+'\x22:\x20'+_0x2da700[_0x342383(0x1ad)]));}for(const _0xc59609 of _0x46c747[_0x342383(0x181)]){_0xc59609['action']===_0x342383(0x1ad)&&console[_0x342383(0x17e)](a4_0x2be47d[_0x342383(0x123)](_0x342383(0x11d)+_0xc59609[_0x342383(0x198)]+'\x22:\x20'+_0xc59609[_0x342383(0x1ad)]));}for(const _0x278039 of _0x46c747[_0x342383(0x195)]){_0x278039[_0x342383(0x14a)]===_0x342383(0x1ad)&&console[_0x342383(0x17e)](a4_0x2be47d['red'](_0x342383(0x1b3)+_0x278039[_0x342383(0x198)]+_0x342383(0x151)+_0x278039[_0x342383(0x1ad)]));}for(const _0x4397b4 of _0x46c747['integrations']){_0x4397b4[_0x342383(0x14a)]===_0x342383(0x1ad)&&console[_0x342383(0x17e)](a4_0x2be47d[_0x342383(0x123)](_0x342383(0x128)+_0x4397b4['name']+_0x342383(0x151)+_0x4397b4[_0x342383(0x1ad)]));}return 0x1;}console[_0x342383(0x17e)](a4_0x2be47d[_0x342383(0x192)](_0x342383(0x1a2)+(_0x48726f+_0x508a3a)+'\x20resources\x20to\x20\x27'+_0x46c747[_0x342383(0x1b5)]+'\x27'));const _0x44f286=getLLMProjectUrl(_0x91bc37,_0x46c747['projectId']);return console['log'](_0x342383(0x165)+a4_0x2be47d[_0x342383(0x153)](_0x44f286)),0x0;}}
1
+ const a4_0x3bc24c=a4_0x6439;(function(_0x5ac579,_0x505fb9){const _0xb3c386=a4_0x6439,_0x52f27d=_0x5ac579();while(!![]){try{const _0x3d2764=-parseInt(_0xb3c386(0x112))/0x1*(parseInt(_0xb3c386(0x10f))/0x2)+-parseInt(_0xb3c386(0x12d))/0x3+-parseInt(_0xb3c386(0x137))/0x4*(-parseInt(_0xb3c386(0xe4))/0x5)+parseInt(_0xb3c386(0xf7))/0x6*(-parseInt(_0xb3c386(0x153))/0x7)+parseInt(_0xb3c386(0x111))/0x8*(parseInt(_0xb3c386(0x14b))/0x9)+parseInt(_0xb3c386(0x16f))/0xa+parseInt(_0xb3c386(0x151))/0xb;if(_0x3d2764===_0x505fb9)break;else _0x52f27d['push'](_0x52f27d['shift']());}catch(_0x167c9a){_0x52f27d['push'](_0x52f27d['shift']());}}}(a4_0x4c7b,0xecfc0));import a4_0x3e39b5 from'chalk';import a4_0x2c0c07 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}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';function a4_0x4c7b(){const _0x5dae1c=['\x22:\x20','join','<new-name>','found','error','cloneProject','no_local_folder','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory','projectName','outputDir','errors','\x20\x20Target:\x20','push','656043hsxqhj','\x0aChanges\x20to\x20agent\x20\x27','\x20\x20Integrations:\x20','Using\x20project:\x20','\x0aChanges:','log','\x20\x20tdx\x20agent\x20clone\x20agents/','action','Would\x20pull\x20agent:\x20','Cannot\x20clone\x20from\x20context\x20project\x20\x22','8XvPyUF','\x22\x20to\x20\x22','INVALID_ARGUMENT','\x0a✔\x20Pushed\x20','New\x20project\x20name\x20is\x20required','Project:\x20','Chat:\x20','pushAgent','diff','created','\x20total','\x20\x20Text\x20Knowledge\x20Base\x20\x22','Failed\x20to\x20push\x20agent:\x20','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','\x20\x20Agent\x20\x22','Using\x20local\x20project:\x20','Agent\x20pulled\x20successfully','New\x20project\x20ID:\x20','knowledgeBases','Pull\x20cancelled','7266357TGoZKH','Errors:','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','Project\x20cloned\x20with\x20errors','\x20\x20Prompts:\x20','\x0aPull\x20summary\x20for\x20\x27','10798183mIbfNu','Agent\x20','133294Rrxzuz','\x20files?','\x0aChanges\x20to\x20integration\x20\x27','cyan','isNew','New\x20project:\x20','Output:\x20','repeat','\x20--name\x20','newProjectId','\x20errors','Agent:\x20','counts','description','tdx.json','session','\x20--profile\x20','hasChanges','outputPath','gray','\x20=\x20','Source:\x20','\x0aWrite\x20','agent:push','dim','sourceProjectName','\x20files\x20to\x20','agent.yml','8594800ptykOu','Clone\x20cancelled','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20#\x20Pull\x20specific\x20agent','agent:pull','\x20\x20Agents:\x20','\x22\x20to\x20new\x20project\x20\x22','\x22\x20from\x20project\x20\x22','pullProject','Would\x20clone:','\x0aPush\x20','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','integrations','source','\x22\x20to\x20a\x20different\x20profile','dirname','yellow','\x20\x20Knowledge\x20Bases:\x20','cwd','Project\x20cloned\x20successfully','\x20resources\x20to\x20\x27','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','utf-8','llm','dryRun','site','no_context','yes','\x0a✔\x20Pulled\x20','Usage:\x20tdx\x20agent\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20project\x20(requires\x20context\x20or\x20tdx.json)','unchanged','llmProject','197755IQBhrv','agentName','Dry\x20run\x20-\x20no\x20changes\x20made','\x20unchanged','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','pushProject','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project','reason','\x20\x20Knowledge\x20Base\x20\x22','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','prompts','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','\x0aPush\x20summary\x20for\x20\x27','newProjectName','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','agents','\x20changed','600dhqxzD','Dry\x20run\x20-\x20no\x20files\x20written','textKnowledgeBases','Status:\x20','red','\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)','total','Analyzing\x20changes\x20to\x20push...','\x20\x20Integration\x20\x22','\x20created','Pushing\x20to\x20project...','Using\x20current\x20project:\x20','context','message','\x22...','green','Analyzing\x20project\x20\x22','name','force','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','new','\x20\x20Prompt\x20\x22','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','agentId','4rvQeKW','projectId','16ZTlfBg','220706sPmxqL','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','Push\x20cancelled','llm_project','updated','\x20|\x20','✔\x20Context\x20set:\x20','execute','Cloning\x20\x22','\x0aProject\x20pushed\x20with\x20errors','Using\x20project\x20from\x20','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','No\x20tdx.json\x20found\x20in\x20','projectDir'];a4_0x4c7b=function(){return _0x5dae1c;};return a4_0x4c7b();}import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x36a4ba){const _0x5cd82a=a4_0x6439,_0x4cea32=[];if(_0x36a4ba['total']!==undefined)_0x4cea32[_0x5cd82a(0x12c)](_0x36a4ba[_0x5cd82a(0xfd)]+_0x5cd82a(0x141));if(_0x36a4ba[_0x5cd82a(0x10b)]!==undefined&&_0x36a4ba[_0x5cd82a(0x10b)]>0x0)_0x4cea32['push'](a4_0x3e39b5['green'](_0x36a4ba[_0x5cd82a(0x10b)]+'\x20new'));if(_0x36a4ba[_0x5cd82a(0x140)]!==undefined&&_0x36a4ba[_0x5cd82a(0x140)]>0x0)_0x4cea32[_0x5cd82a(0x12c)](a4_0x3e39b5[_0x5cd82a(0x106)](_0x36a4ba[_0x5cd82a(0x140)]+_0x5cd82a(0x100)));if(_0x36a4ba[_0x5cd82a(0x116)]!==undefined&&_0x36a4ba['updated']>0x0)_0x4cea32[_0x5cd82a(0x12c)](a4_0x3e39b5[_0x5cd82a(0x17e)](_0x36a4ba[_0x5cd82a(0x116)]+'\x20updated'));if(_0x36a4ba[_0x5cd82a(0xe2)]!==undefined&&_0x36a4ba[_0x5cd82a(0xe2)]>0x0)_0x4cea32[_0x5cd82a(0x12c)](a4_0x3e39b5['gray'](_0x36a4ba[_0x5cd82a(0xe2)]+'\x20unchanged'));if(_0x36a4ba[_0x5cd82a(0x12a)]!==undefined&&_0x36a4ba['errors']>0x0)_0x4cea32[_0x5cd82a(0x12c)](a4_0x3e39b5['red'](_0x36a4ba['errors']+_0x5cd82a(0x15d)));return _0x4cea32[_0x5cd82a(0x121)](',\x20');}function a4_0x6439(_0x3085b3,_0x162f02){_0x3085b3=_0x3085b3-0xd6;const _0x4c7b4b=a4_0x4c7b();let _0x6439f8=_0x4c7b4b[_0x3085b3];return _0x6439f8;}function displayDiffs(_0x34ab86,_0x169000,_0x4d3730,_0x2e38d2,_0x24d777=[]){const _0x402deb=a4_0x6439;for(const _0x27965b of _0x34ab86){if(_0x27965b[_0x402deb(0x13f)]){const _0x158c27=_0x27965b['agentName']||_0x27965b['name'];console[_0x402deb(0x132)](_0x402deb(0x12e)+_0x158c27+'\x27:'),console['log']('─'[_0x402deb(0x15a)](0x3c)),console[_0x402deb(0x132)](_0x27965b[_0x402deb(0x13f)]),console[_0x402deb(0x132)]('─'[_0x402deb(0x15a)](0x3c));}}for(const _0x10fb25 of _0x169000){_0x10fb25[_0x402deb(0x13f)]&&(console[_0x402deb(0x132)](_0x402deb(0xee)+_0x10fb25[_0x402deb(0x108)]+'\x27:'),console[_0x402deb(0x132)]('─'[_0x402deb(0x15a)](0x3c)),console[_0x402deb(0x132)](_0x10fb25[_0x402deb(0x13f)]),console[_0x402deb(0x132)]('─'[_0x402deb(0x15a)](0x3c)));}for(const _0x3a3a24 of _0x4d3730){_0x3a3a24[_0x402deb(0x13f)]&&(console[_0x402deb(0x132)](_0x402deb(0x113)+_0x3a3a24[_0x402deb(0x108)]+'\x27:'),console[_0x402deb(0x132)]('─'[_0x402deb(0x15a)](0x3c)),console[_0x402deb(0x132)](_0x3a3a24[_0x402deb(0x13f)]),console[_0x402deb(0x132)]('─'[_0x402deb(0x15a)](0x3c)));}for(const _0x3b37d5 of _0x2e38d2){_0x3b37d5[_0x402deb(0x13f)]&&(console['log']('\x0aChanges\x20to\x20prompt\x20\x27'+_0x3b37d5[_0x402deb(0x108)]+'\x27:'),console[_0x402deb(0x132)]('─'[_0x402deb(0x15a)](0x3c)),console[_0x402deb(0x132)](_0x3b37d5[_0x402deb(0x13f)]),console['log']('─'[_0x402deb(0x15a)](0x3c)));}for(const _0x528d91 of _0x24d777){_0x528d91['diff']&&(console['log'](_0x402deb(0x155)+_0x528d91[_0x402deb(0x108)]+'\x27:'),console['log']('─'[_0x402deb(0x15a)](0x3c)),console['log'](_0x528d91[_0x402deb(0x13f)]),console['log']('─'[_0x402deb(0x15a)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x3bc24c(0x108)]=a4_0x3bc24c(0x172);[a4_0x3bc24c(0x160)]='Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files';async[a4_0x3bc24c(0x119)](_0x572f43){const _0x57fac3=a4_0x3bc24c,{options:_0xf05adc,args:_0x3809a4,tdx:_0x298ebe}=_0x572f43,_0x8e71dd=_0x3809a4[0x0],_0x14022d=_0x3809a4[0x1],_0x29cc80=_0xf05adc['output'],_0x349675=_0xf05adc[_0x57fac3(0xdc)],_0xeef37c=_0xf05adc['force'],_0x40d0fb=_0xf05adc[_0x57fac3(0xdf)],_0xe89fd6=_0xf05adc[_0x57fac3(0xe3)];let _0x29c480,_0x26c53c;const _0x176283=findAgentConfigPath(process['cwd']());if(_0x8e71dd){const _0x5b1343=a4_0x2c0c07[_0x57fac3(0x121)](_0x8e71dd,_0x57fac3(0x161));if(existsSync(_0x5b1343))try{const _0x3e0b85=JSON['parse'](readFileSync(_0x5b1343,_0x57fac3(0xda)));_0x29c480=_0x3e0b85['llm_project'],_0x26c53c=_0x8e71dd,console[_0x57fac3(0x132)](a4_0x3e39b5['dim'](_0x57fac3(0x11c)+_0x5b1343+':\x20'+_0x29c480));}catch{_0x29c480=_0x8e71dd;}else _0x29c480=_0x8e71dd;}else{if(_0x176283)try{const _0x4b9a5c=JSON['parse'](readFileSync(_0x176283,_0x57fac3(0xda)));_0x29c480=_0x4b9a5c['llm_project'],_0x26c53c=a4_0x2c0c07[_0x57fac3(0x17d)](_0x176283),console['log'](a4_0x3e39b5[_0x57fac3(0x16b)]('Using\x20project:\x20'+_0x29c480));}catch{_0x29c480=_0xe89fd6;}else _0x29c480=_0xe89fd6;}if(!_0x29c480)return console[_0x57fac3(0x132)](a4_0x3e39b5[_0x57fac3(0x17e)](_0x57fac3(0x179))),console['log'](_0x57fac3(0xe1)),console[_0x57fac3(0x132)](_0x57fac3(0xeb)),console[_0x57fac3(0x132)](_0x57fac3(0x127)),console['log'](_0x57fac3(0x171)),0x1;if(_0x14022d){const {data:_0x2597ef}=await withSpinner('Pulling\x20agent\x20\x22'+_0x14022d+_0x57fac3(0x175)+_0x29c480+_0x57fac3(0x105),()=>_0x298ebe['llm']['pullAgent'](_0x29c480,_0x14022d,_0x29cc80,{'dryRun':_0x349675,'force':_0xeef37c}));if(_0x349675)return console[_0x57fac3(0x132)](a4_0x3e39b5[_0x57fac3(0x17e)](_0x57fac3(0xf8))),console[_0x57fac3(0x132)](_0x57fac3(0x135)+_0x2597ef[_0x57fac3(0xe5)]),console['log']('Output\x20path:\x20'+_0x2597ef['outputPath']),_0x2597ef[_0x57fac3(0x13f)]&&(console[_0x57fac3(0x132)](_0x57fac3(0x131)),console[_0x57fac3(0x132)]('─'[_0x57fac3(0x15a)](0x3c)),console[_0x57fac3(0x132)](_0x2597ef[_0x57fac3(0x13f)]),console['log']('─'[_0x57fac3(0x15a)](0x3c))),0x0;return console[_0x57fac3(0x132)](a4_0x3e39b5[_0x57fac3(0x106)](_0x57fac3(0x147))),console[_0x57fac3(0x132)](_0x57fac3(0x15e)+_0x2597ef[_0x57fac3(0xe5)]),console[_0x57fac3(0x132)](_0x57fac3(0x159)+_0x2597ef[_0x57fac3(0x165)]),console['log'](_0x57fac3(0xfa)+(_0x2597ef[_0x57fac3(0x157)]?a4_0x3e39b5[_0x57fac3(0x106)]('new'):_0x2597ef[_0x57fac3(0x164)]?a4_0x3e39b5['yellow'](_0x57fac3(0x116)):a4_0x3e39b5[_0x57fac3(0x166)]('unchanged'))),0x0;}const _0x6d991=_0x26c53c||_0x29cc80,{data:_0x2d0417}=await withSpinner(_0x57fac3(0x107)+_0x29c480+_0x57fac3(0x105),()=>_0x298ebe['llm'][_0x57fac3(0x176)](_0x29c480,_0x6d991,{'dryRun':!![]})),_0x2d2457=_0x2d0417[_0x57fac3(0x15f)][_0x57fac3(0xf5)][_0x57fac3(0x10b)]+_0x2d0417[_0x57fac3(0x15f)][_0x57fac3(0x149)][_0x57fac3(0x10b)]+_0x2d0417[_0x57fac3(0x15f)]['textKnowledgeBases'][_0x57fac3(0x10b)]+_0x2d0417[_0x57fac3(0x15f)]['prompts'][_0x57fac3(0x10b)]+_0x2d0417[_0x57fac3(0x15f)][_0x57fac3(0x17a)]['new'],_0x4bddbe=_0x2d0417['counts'][_0x57fac3(0xf5)]['updated']+_0x2d0417[_0x57fac3(0x15f)][_0x57fac3(0x149)][_0x57fac3(0x116)]+_0x2d0417[_0x57fac3(0x15f)][_0x57fac3(0xf9)][_0x57fac3(0x116)]+_0x2d0417['counts'][_0x57fac3(0xef)][_0x57fac3(0x116)]+_0x2d0417[_0x57fac3(0x15f)]['integrations'][_0x57fac3(0x116)],_0x35a065=_0x2d0417[_0x57fac3(0x15f)]['agents'][_0x57fac3(0xe2)]+_0x2d0417['counts'][_0x57fac3(0x149)][_0x57fac3(0xe2)]+_0x2d0417[_0x57fac3(0x15f)][_0x57fac3(0xf9)][_0x57fac3(0xe2)]+_0x2d0417[_0x57fac3(0x15f)]['prompts'][_0x57fac3(0xe2)]+_0x2d0417[_0x57fac3(0x15f)]['integrations'][_0x57fac3(0xe2)];console['log'](_0x57fac3(0x150)+_0x2d0417[_0x57fac3(0x128)]+'\x27:'),console[_0x57fac3(0x132)]('\x20\x20'+a4_0x3e39b5[_0x57fac3(0x106)]('+\x20'+_0x2d2457+'\x20new')+_0x57fac3(0x117)+a4_0x3e39b5[_0x57fac3(0x17e)]('~\x20'+_0x4bddbe+_0x57fac3(0xf6))+_0x57fac3(0x117)+a4_0x3e39b5[_0x57fac3(0x16b)]('=\x20'+_0x35a065+'\x20unchanged')),console[_0x57fac3(0x132)](_0x57fac3(0x173)+formatCountSummary(_0x2d0417[_0x57fac3(0x15f)][_0x57fac3(0xf5)])),console[_0x57fac3(0x132)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x2d0417[_0x57fac3(0x15f)][_0x57fac3(0x149)])),console[_0x57fac3(0x132)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x2d0417['counts'][_0x57fac3(0xf9)])),console['log'](_0x57fac3(0x14f)+formatCountSummary(_0x2d0417[_0x57fac3(0x15f)][_0x57fac3(0xef)])),console[_0x57fac3(0x132)](_0x57fac3(0x12f)+formatCountSummary(_0x2d0417[_0x57fac3(0x15f)][_0x57fac3(0x17a)])),console[_0x57fac3(0x132)](_0x57fac3(0x12b)+a4_0x3e39b5[_0x57fac3(0x156)](_0x2d0417[_0x57fac3(0x129)])),displayDiffs(_0x2d0417[_0x57fac3(0xf5)],_0x2d0417['knowledgeBases'],_0x2d0417[_0x57fac3(0xf9)],_0x2d0417[_0x57fac3(0xef)],_0x2d0417['integrations']);if(_0x349675)return console[_0x57fac3(0x132)](a4_0x3e39b5[_0x57fac3(0x17e)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x2d2457===0x0&&_0x4bddbe===0x0)return console[_0x57fac3(0x132)](a4_0x3e39b5[_0x57fac3(0x106)](_0x57fac3(0xf4))),saveSessionContext({'llm_project':_0x2d0417[_0x57fac3(0x128)]},_0xf05adc[_0x57fac3(0x162)]),console[_0x57fac3(0x132)](a4_0x3e39b5[_0x57fac3(0x106)](_0x57fac3(0x118)+a4_0x3e39b5[_0x57fac3(0x16b)]('llm_project')+_0x57fac3(0x167)+a4_0x3e39b5[_0x57fac3(0x156)](_0x2d0417[_0x57fac3(0x128)]))),0x0;if(!_0x40d0fb&&!_0xeef37c){const _0x5d5643=await confirmKey(_0x57fac3(0x169)+(_0x2d2457+_0x4bddbe)+_0x57fac3(0x154));if(!_0x5d5643)return console[_0x57fac3(0x132)](_0x57fac3(0x14a)),0x0;}const {data:_0x47136d}=await withSpinner('Writing\x20files...',()=>_0x298ebe[_0x57fac3(0xdb)][_0x57fac3(0x176)](_0x29c480,_0x6d991,{'force':_0xeef37c}));return console['log'](a4_0x3e39b5[_0x57fac3(0x106)](_0x57fac3(0xe0)+(_0x2d2457+_0x4bddbe)+_0x57fac3(0x16d)+_0x47136d['outputDir'])),saveSessionContext({'llm_project':_0x47136d[_0x57fac3(0x128)]},_0xf05adc[_0x57fac3(0x162)]),console[_0x57fac3(0x132)](a4_0x3e39b5[_0x57fac3(0x106)](_0x57fac3(0x118)+a4_0x3e39b5[_0x57fac3(0x16b)](_0x57fac3(0x115))+_0x57fac3(0x167)+a4_0x3e39b5['cyan'](_0x47136d[_0x57fac3(0x128)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x3bc24c(0x108)]='agent:clone';[a4_0x3bc24c(0x160)]='Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project';async['execute'](_0x3c23f2){const _0x9503c=a4_0x3bc24c,{options:_0x2ba719,args:_0x3b8fb7,tdx:_0x569ad9}=_0x3c23f2,_0x351390=_0x3b8fb7[0x0],_0x83c9f=_0x2ba719[_0x9503c(0x108)],_0x7441ad=_0x2ba719[_0x9503c(0xdc)],_0x4c7587=_0x2ba719['yes'],_0x1d0154=_0x2ba719[_0x9503c(0xdd)],_0x43e5a0=_0x2ba719['llmProject'];let _0x5c68e6;const _0x544aff=findAgentConfigPath(process[_0x9503c(0xd6)]());if(_0x351390){const _0x2dd48b=a4_0x2c0c07['join'](_0x351390,_0x9503c(0x161));existsSync(_0x2dd48b)?(_0x5c68e6=_0x351390,console[_0x9503c(0x132)](a4_0x3e39b5['dim'](_0x9503c(0x146)+_0x351390))):_0x5c68e6=_0x351390;}else{if(_0x544aff)_0x5c68e6=a4_0x2c0c07[_0x9503c(0x17d)](_0x544aff),console[_0x9503c(0x132)](a4_0x3e39b5['dim'](_0x9503c(0x102)+_0x5c68e6));else{if(_0x43e5a0){const _0x5b472d=sanitizeForFilesystem(_0x43e5a0);let _0x1ac591=_0x5b472d,_0x5ce9ca=a4_0x2c0c07[_0x9503c(0x121)](process[_0x9503c(0xd6)](),_0x9503c(0xf5),_0x5b472d,_0x9503c(0x161));if(!existsSync(_0x5ce9ca)){const _0x457a3c=normalizeName(_0x43e5a0),_0x422a27=a4_0x2c0c07[_0x9503c(0x121)](process[_0x9503c(0xd6)](),_0x9503c(0xf5),_0x457a3c,_0x9503c(0x161));existsSync(_0x422a27)&&(_0x1ac591=_0x457a3c,_0x5ce9ca=_0x422a27);}if(existsSync(_0x5ce9ca))_0x5c68e6=a4_0x2c0c07[_0x9503c(0x17d)](_0x5ce9ca),console[_0x9503c(0x132)](a4_0x3e39b5[_0x9503c(0x16b)](_0x9503c(0x146)+_0x5c68e6));else{const _0x51320a=_0x2ba719['profile'];if(_0x51320a)throw new SDKError(ErrorCode[_0x9503c(0x139)],_0x9503c(0x136)+_0x43e5a0+_0x9503c(0x17c),undefined,{'helpText':_0x9503c(0xd9)+'First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a'+('\x20\x20tdx\x20agent\x20pull\x20'+_0x43e5a0+'\x0a')+(_0x9503c(0x133)+_0x1ac591+_0x9503c(0x15b)+(_0x83c9f||_0x9503c(0x122))+_0x9503c(0x163)+_0x51320a)});_0x5c68e6=_0x43e5a0,console[_0x9503c(0x132)](a4_0x3e39b5[_0x9503c(0x16b)]('Using\x20context\x20project:\x20'+_0x43e5a0));}}}}if(!_0x5c68e6)return console[_0x9503c(0x132)](a4_0x3e39b5[_0x9503c(0x17e)](_0x9503c(0xf0))),console['log'](_0x9503c(0x11d)),console[_0x9503c(0x132)](_0x9503c(0x14d)),console[_0x9503c(0x132)](_0x9503c(0xfc)),console[_0x9503c(0x132)](_0x9503c(0x10d)),0x1;if(!_0x83c9f)throw new SDKError(ErrorCode['MISSING_ARGUMENT'],_0x9503c(0x13b),undefined,{'helpText':_0x9503c(0xe8)});if(!_0x4c7587&&!_0x7441ad){const _0x5573b0=await confirmKey('Clone\x20\x22'+_0x5c68e6+_0x9503c(0x174)+_0x83c9f+'\x22?');if(!_0x5573b0)return console['log'](_0x9503c(0x170)),0x0;}const {data:_0x1ac336}=await withSpinner(_0x9503c(0x11a)+_0x5c68e6+_0x9503c(0x138)+_0x83c9f+_0x9503c(0x105),()=>_0x569ad9['llm'][_0x9503c(0x125)](_0x5c68e6,_0x83c9f,{'dryRun':_0x7441ad}));if(_0x7441ad)return console['log'](a4_0x3e39b5[_0x9503c(0x17e)](_0x9503c(0xe6))),console[_0x9503c(0x132)]('Source:\x20'+_0x1ac336[_0x9503c(0x16c)]),console[_0x9503c(0x132)](_0x9503c(0x158)+_0x83c9f),console['log'](_0x9503c(0x177)),console['log'](_0x9503c(0x173)+_0x1ac336[_0x9503c(0x15f)]['agents']['created']),console[_0x9503c(0x132)]('\x20\x20Knowledge\x20Bases:\x20'+_0x1ac336[_0x9503c(0x15f)]['knowledgeBases'][_0x9503c(0x140)]),console[_0x9503c(0x132)]('\x20\x20Prompts:\x20'+_0x1ac336[_0x9503c(0x15f)][_0x9503c(0xef)]['created']),0x0;const _0x4cb455=_0x1ac336[_0x9503c(0x15f)]['agents'][_0x9503c(0x12a)]>0x0||_0x1ac336[_0x9503c(0x15f)][_0x9503c(0x149)][_0x9503c(0x12a)]>0x0||_0x1ac336[_0x9503c(0x15f)][_0x9503c(0xef)]['errors']>0x0;_0x4cb455?console[_0x9503c(0x132)](a4_0x3e39b5[_0x9503c(0x17e)](_0x9503c(0x14e))):console[_0x9503c(0x132)](a4_0x3e39b5[_0x9503c(0x106)](_0x9503c(0xd7)));console[_0x9503c(0x132)](_0x9503c(0x168)+_0x1ac336['sourceProjectName']),console[_0x9503c(0x132)]('New\x20project:\x20'+_0x1ac336[_0x9503c(0xf2)]),console[_0x9503c(0x132)](_0x9503c(0x148)+_0x1ac336[_0x9503c(0x15c)]),console[_0x9503c(0x132)](),console[_0x9503c(0x132)]('Summary:'),console[_0x9503c(0x132)](_0x9503c(0x173)+formatCountSummary(_0x1ac336[_0x9503c(0x15f)][_0x9503c(0xf5)])),console[_0x9503c(0x132)](_0x9503c(0x17f)+formatCountSummary(_0x1ac336[_0x9503c(0x15f)][_0x9503c(0x149)])),console[_0x9503c(0x132)](_0x9503c(0x14f)+formatCountSummary(_0x1ac336['counts'][_0x9503c(0xef)])),console[_0x9503c(0x132)](_0x9503c(0x12f)+formatCountSummary(_0x1ac336[_0x9503c(0x15f)]['integrations']));if(_0x4cb455){console[_0x9503c(0x132)](),console['log'](a4_0x3e39b5[_0x9503c(0xfb)](_0x9503c(0x14c)));for(const _0x524834 of _0x1ac336[_0x9503c(0xf5)]){_0x524834[_0x9503c(0x134)]===_0x9503c(0x124)&&console[_0x9503c(0x132)](a4_0x3e39b5[_0x9503c(0xfb)](_0x9503c(0x145)+_0x524834[_0x9503c(0xe5)]+_0x9503c(0x120)+_0x524834[_0x9503c(0x124)]));}for(const _0x3831c4 of _0x1ac336['knowledgeBases']){_0x3831c4['action']===_0x9503c(0x124)&&console[_0x9503c(0x132)](a4_0x3e39b5[_0x9503c(0xfb)](_0x9503c(0xed)+_0x3831c4['name']+_0x9503c(0x120)+_0x3831c4[_0x9503c(0x124)]));}for(const _0xaedaf2 of _0x1ac336['prompts']){_0xaedaf2[_0x9503c(0x134)]===_0x9503c(0x124)&&console['log'](a4_0x3e39b5['red'](_0x9503c(0x10c)+_0xaedaf2[_0x9503c(0x108)]+_0x9503c(0x120)+_0xaedaf2[_0x9503c(0x124)]));}for(const _0x2557f7 of _0x1ac336[_0x9503c(0x17a)]){_0x2557f7['action']===_0x9503c(0x124)&&console[_0x9503c(0x132)](a4_0x3e39b5[_0x9503c(0xfb)](_0x9503c(0xff)+_0x2557f7['name']+_0x9503c(0x120)+_0x2557f7[_0x9503c(0x124)]));}return 0x1;}console[_0x9503c(0x132)]();const _0x24794e=getLLMProjectUrl(_0x1d0154,_0x1ac336['newProjectId']);return console[_0x9503c(0x132)](_0x9503c(0x13c)+a4_0x3e39b5[_0x9503c(0x156)](_0x24794e)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x3bc24c(0x108)]=a4_0x3bc24c(0x16a);[a4_0x3bc24c(0x160)]=a4_0x3bc24c(0x144);async['execute'](_0xe8da3a){const _0x3bae29=a4_0x3bc24c,{options:_0x3f4568,args:_0x4628b1,tdx:_0x45a48a}=_0xe8da3a;let _0x30540d=_0x4628b1[0x0]||process[_0x3bae29(0xd6)]();const _0x1cabb6=_0x3f4568[_0x3bae29(0xdc)],_0x57dc2b=_0x3f4568[_0x3bae29(0x109)],_0x1d4059=_0x3f4568[_0x3bae29(0xdf)],_0x50efb8=_0x3f4568[_0x3bae29(0xdd)],_0x432ef2=a4_0x2c0c07['join'](_0x30540d,_0x3bae29(0x16e)),_0x4fb8a4=existsSync(_0x432ef2);if(_0x4fb8a4){const {data:_0x4519de}=await withSpinner('Pushing\x20agent\x20from\x20\x22'+_0x30540d+'\x22...',()=>_0x45a48a[_0x3bae29(0xdb)][_0x3bae29(0x13e)](_0x30540d,{'dryRun':_0x1cabb6,'force':_0x57dc2b}));if(_0x1cabb6)return console[_0x3bae29(0x132)](a4_0x3e39b5[_0x3bae29(0x17e)](_0x3bae29(0xe6))),console[_0x3bae29(0x132)]('Would\x20push\x20agent:\x20'+_0x4519de[_0x3bae29(0xe5)]),0x0;if(_0x4519de['action']==='error')return console[_0x3bae29(0x132)](a4_0x3e39b5['red'](_0x3bae29(0x143)+_0x4519de[_0x3bae29(0x124)])),0x1;console[_0x3bae29(0x132)](a4_0x3e39b5['green'](_0x3bae29(0x152)+_0x4519de[_0x3bae29(0x134)]+'\x20successfully')),console['log']('Agent:\x20'+_0x4519de[_0x3bae29(0xe5)]);if(_0x4519de[_0x3bae29(0x10e)]&&_0x4519de[_0x3bae29(0x110)]){const _0x489433=getLLMAgentChatUrl(_0x50efb8,_0x4519de[_0x3bae29(0x110)],_0x4519de[_0x3bae29(0x10e)]);console[_0x3bae29(0x132)](_0x3bae29(0x13d)+a4_0x3e39b5[_0x3bae29(0x156)](_0x489433));}return 0x0;}const _0x2a2519=_0x3f4568['llmProject'],_0x527c06=resolveProjectFromContext(_0x30540d,_0x2a2519);if(_0x527c06[_0x3bae29(0x123)])_0x30540d=_0x527c06[_0x3bae29(0x11f)],_0x527c06[_0x3bae29(0x17b)]===_0x3bae29(0x103)&&console['log'](a4_0x3e39b5[_0x3bae29(0x16b)](_0x3bae29(0x130)+_0x30540d));else{let _0x23fc72=_0x3bae29(0xe9);_0x527c06['reason']===_0x3bae29(0x126)&&(_0x23fc72=_0x527c06[_0x3bae29(0x104)]+'\x0aRun\x20\x27tdx\x20agent\x20pull\x20'+_0x527c06['llmProject']+'\x27\x20to\x20create\x20the\x20folder\x20structure.');throw new SDKError(ErrorCode[_0x3bae29(0x139)],_0x527c06[_0x3bae29(0xec)]===_0x3bae29(0xde)?_0x527c06[_0x3bae29(0x104)]:_0x3bae29(0x11e)+_0x30540d,undefined,{'helpText':_0x23fc72});}const {data:_0x26ad27}=await withSpinner(_0x3bae29(0xfe),()=>_0x45a48a[_0x3bae29(0xdb)][_0x3bae29(0xea)](_0x30540d,{'dryRun':!![]})),_0xa5c145=_0x26ad27[_0x3bae29(0x15f)]['agents'][_0x3bae29(0x12a)]>0x0;if(_0xa5c145){console['log'](a4_0x3e39b5[_0x3bae29(0xfb)]('\x0aErrors\x20found:'));for(const _0x20452c of _0x26ad27[_0x3bae29(0xf5)]){_0x20452c['action']==='error'&&console[_0x3bae29(0x132)](a4_0x3e39b5[_0x3bae29(0xfb)](_0x3bae29(0x145)+_0x20452c['agentName']+_0x3bae29(0x120)+_0x20452c[_0x3bae29(0x124)]));}return 0x1;}const _0x23df5f=_0x26ad27['counts'][_0x3bae29(0xf5)][_0x3bae29(0x140)]+_0x26ad27[_0x3bae29(0x15f)][_0x3bae29(0x149)][_0x3bae29(0x140)]+_0x26ad27['counts'][_0x3bae29(0xf9)][_0x3bae29(0x140)]+_0x26ad27['counts'][_0x3bae29(0xef)][_0x3bae29(0x140)]+_0x26ad27[_0x3bae29(0x15f)][_0x3bae29(0x17a)]['created'],_0x40a5c9=_0x26ad27[_0x3bae29(0x15f)][_0x3bae29(0xf5)][_0x3bae29(0x116)]+_0x26ad27['counts'][_0x3bae29(0x149)][_0x3bae29(0x116)]+_0x26ad27[_0x3bae29(0x15f)][_0x3bae29(0xf9)][_0x3bae29(0x116)]+_0x26ad27[_0x3bae29(0x15f)][_0x3bae29(0xef)]['updated']+_0x26ad27[_0x3bae29(0x15f)]['integrations'][_0x3bae29(0x116)],_0x4fa088=_0x26ad27[_0x3bae29(0x15f)]['agents'][_0x3bae29(0xe2)]+_0x26ad27[_0x3bae29(0x15f)][_0x3bae29(0x149)][_0x3bae29(0xe2)]+_0x26ad27[_0x3bae29(0x15f)][_0x3bae29(0xf9)][_0x3bae29(0xe2)]+_0x26ad27[_0x3bae29(0x15f)][_0x3bae29(0xef)][_0x3bae29(0xe2)]+_0x26ad27[_0x3bae29(0x15f)][_0x3bae29(0x17a)]['unchanged'];console[_0x3bae29(0x132)](_0x3bae29(0xf1)+_0x26ad27[_0x3bae29(0x128)]+'\x27:'),console['log']('\x20\x20'+a4_0x3e39b5[_0x3bae29(0x106)]('+\x20'+_0x23df5f+'\x20new')+_0x3bae29(0x117)+a4_0x3e39b5[_0x3bae29(0x17e)]('~\x20'+_0x40a5c9+_0x3bae29(0xf6))+_0x3bae29(0x117)+a4_0x3e39b5['dim']('=\x20'+_0x4fa088+_0x3bae29(0xe7))),console[_0x3bae29(0x132)](_0x3bae29(0x173)+formatCountSummary(_0x26ad27[_0x3bae29(0x15f)]['agents'])),console[_0x3bae29(0x132)](_0x3bae29(0x17f)+formatCountSummary(_0x26ad27[_0x3bae29(0x15f)]['knowledgeBases'])),console[_0x3bae29(0x132)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x26ad27[_0x3bae29(0x15f)]['textKnowledgeBases'])),console[_0x3bae29(0x132)](_0x3bae29(0x14f)+formatCountSummary(_0x26ad27[_0x3bae29(0x15f)][_0x3bae29(0xef)])),console[_0x3bae29(0x132)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x26ad27[_0x3bae29(0x15f)][_0x3bae29(0x17a)])),console['log']('\x20\x20Source:\x20'+a4_0x3e39b5[_0x3bae29(0x156)](_0x30540d)),displayDiffs(_0x26ad27['agents'],_0x26ad27[_0x3bae29(0x149)],_0x26ad27[_0x3bae29(0xf9)],_0x26ad27[_0x3bae29(0xef)],_0x26ad27['integrations']);if(_0x1cabb6)return console[_0x3bae29(0x132)](a4_0x3e39b5['yellow'](_0x3bae29(0xf3))),0x0;if(_0x23df5f===0x0&&_0x40a5c9===0x0){console['log'](a4_0x3e39b5[_0x3bae29(0x106)](_0x3bae29(0x10a)));const _0x5d3055=getLLMProjectUrl(_0x50efb8,_0x26ad27[_0x3bae29(0x110)]);return console['log']('Project:\x20'+a4_0x3e39b5[_0x3bae29(0x156)](_0x5d3055)),0x0;}if(!_0x1d4059&&!_0x57dc2b){const _0x345c9b=await confirmKey(_0x3bae29(0x178)+(_0x23df5f+_0x40a5c9)+'\x20resources?');if(!_0x345c9b)return console[_0x3bae29(0x132)](_0x3bae29(0x114)),0x0;}const {data:_0x37603e}=await withSpinner(_0x3bae29(0x101),()=>_0x45a48a[_0x3bae29(0xdb)][_0x3bae29(0xea)](_0x30540d,{'force':_0x57dc2b})),_0x39a396=_0x37603e['counts']['agents'][_0x3bae29(0x12a)]>0x0||_0x37603e[_0x3bae29(0x15f)]['knowledgeBases'][_0x3bae29(0x12a)]>0x0||_0x37603e[_0x3bae29(0x15f)][_0x3bae29(0xf9)][_0x3bae29(0x12a)]>0x0||_0x37603e[_0x3bae29(0x15f)][_0x3bae29(0xef)][_0x3bae29(0x12a)]>0x0;if(_0x39a396){console[_0x3bae29(0x132)](a4_0x3e39b5[_0x3bae29(0x17e)](_0x3bae29(0x11b))),console[_0x3bae29(0x132)](),console[_0x3bae29(0x132)](a4_0x3e39b5[_0x3bae29(0xfb)](_0x3bae29(0x14c)));for(const _0x5e8206 of _0x37603e['agents']){_0x5e8206[_0x3bae29(0x134)]===_0x3bae29(0x124)&&console[_0x3bae29(0x132)](a4_0x3e39b5[_0x3bae29(0xfb)](_0x3bae29(0x145)+_0x5e8206[_0x3bae29(0xe5)]+_0x3bae29(0x120)+_0x5e8206[_0x3bae29(0x124)]));}for(const _0x987d56 of _0x37603e['knowledgeBases']){_0x987d56['action']==='error'&&console['log'](a4_0x3e39b5[_0x3bae29(0xfb)](_0x3bae29(0xed)+_0x987d56['name']+_0x3bae29(0x120)+_0x987d56['error']));}for(const _0x59654e of _0x37603e[_0x3bae29(0xf9)]){_0x59654e[_0x3bae29(0x134)]===_0x3bae29(0x124)&&console[_0x3bae29(0x132)](a4_0x3e39b5['red'](_0x3bae29(0x142)+_0x59654e[_0x3bae29(0x108)]+_0x3bae29(0x120)+_0x59654e[_0x3bae29(0x124)]));}for(const _0x593594 of _0x37603e['prompts']){_0x593594[_0x3bae29(0x134)]==='error'&&console[_0x3bae29(0x132)](a4_0x3e39b5[_0x3bae29(0xfb)](_0x3bae29(0x10c)+_0x593594[_0x3bae29(0x108)]+_0x3bae29(0x120)+_0x593594[_0x3bae29(0x124)]));}for(const _0x2de1d0 of _0x37603e[_0x3bae29(0x17a)]){_0x2de1d0[_0x3bae29(0x134)]===_0x3bae29(0x124)&&console[_0x3bae29(0x132)](a4_0x3e39b5[_0x3bae29(0xfb)]('\x20\x20Integration\x20\x22'+_0x2de1d0[_0x3bae29(0x108)]+_0x3bae29(0x120)+_0x2de1d0[_0x3bae29(0x124)]));}return 0x1;}console['log'](a4_0x3e39b5['green'](_0x3bae29(0x13a)+(_0x23df5f+_0x40a5c9)+_0x3bae29(0xd8)+_0x37603e[_0x3bae29(0x128)]+'\x27'));const _0x415414=getLLMProjectUrl(_0x50efb8,_0x37603e[_0x3bae29(0x110)]);return console[_0x3bae29(0x132)](_0x3bae29(0x13c)+a4_0x3e39b5[_0x3bae29(0x156)](_0x415414)),0x0;}}
@@ -1 +1 @@
1
- const a5_0x471453=a5_0x3f95;(function(_0x219c56,_0x3bf7f3){const _0x35eb5b=a5_0x3f95,_0xd66d27=_0x219c56();while(!![]){try{const _0x56ccab=parseInt(_0x35eb5b(0x1b1))/0x1*(parseInt(_0x35eb5b(0x1c9))/0x2)+parseInt(_0x35eb5b(0x221))/0x3+-parseInt(_0x35eb5b(0x210))/0x4*(parseInt(_0x35eb5b(0x1cd))/0x5)+parseInt(_0x35eb5b(0x1d7))/0x6+-parseInt(_0x35eb5b(0x1de))/0x7+-parseInt(_0x35eb5b(0x20b))/0x8*(-parseInt(_0x35eb5b(0x1fe))/0x9)+parseInt(_0x35eb5b(0x225))/0xa*(-parseInt(_0x35eb5b(0x1a7))/0xb);if(_0x56ccab===_0x3bf7f3)break;else _0xd66d27['push'](_0xd66d27['shift']());}catch(_0x30c991){_0xd66d27['push'](_0xd66d27['shift']());}}}(a5_0xbf6c,0xcc9d1));import*as a5_0x3e1c39 from'node:fs';import*as a5_0x1aa8f7 from'node:path';import a5_0x4f4d8f from'chalk';import{BaseCommand}from'./command.js';function a5_0x3f95(_0x145fe4,_0x266cde){_0x145fe4=_0x145fe4-0x1a4;const _0xbf6cd=a5_0xbf6c();let _0x3f956c=_0xbf6cd[_0x145fe4];return _0x3f956c;}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_0xbf6c(){const _0x386599=['includes','test.yml','1370637lnKRmC','Running\x20test:\x20','dim','round','forEach','json','✗\x20ERROR:\x20','eval','status','\x20(cached)','\x20\x20Project:\x20','⚠\x20SKIPPED:\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','56QaSZPf','Using\x20agent:\x20','message','green','\x20\x20Conversation:\x20','12CRbewQ','\x22:\x20','output','Run\x20\x27tdx\x20agent\x20pull\x20','not\x20found','rounds','\x20(new)','log','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','agentName','Output\x20written\x20to:\x20','Executing\x20new\x20tests...','✓\x20PASS:\x20','timestamp','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','Round\x20','llmProject','569841NvJYkc','Errors:\x20\x20\x20','trim','Re-evaluating...','320pKWpDu','✗\x20FAIL:\x20','conversations','\x27\x20to\x20create\x20the\x20folder\x20structure.','Evaluating\x20response...','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','projectDir','FAIL','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','Error\x20writing\x20output\x20file:\x20','reeval','Available\x20tests:\x20','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','table','...','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','No\x20tests\x20found\x20matching:\x20','Failed\x20Tests:','stop','no_local_folder','\x20\x20Evaluating...\x20','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','/<agent-name>','text','400367PcwtJa','jsonl','\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)','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','start','join','Running\x20agent\x20tests...','Agent:\x20','name','172273rsjoPB','Usage:','\x22,\x20but\x20current\x20site\x20is\x20\x22','Round\x201/','size','\x20-\x20','Passed:\x20\x20\x20','Re-evaluation\x20Summary','Site:\x20','llm','projectName','verbose','execute','\x20\x20-\x20','Running:\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','conversation_url','Test\x20','Test\x20Summary','404','tests','white','cyan',':\x20Sending\x20user\x20input...','2VbhbIG','split','agent','context','869150OCaGht','some','source','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','red','repeat','filter','Cached\x20run\x20from:\x20','toISOString','toLowerCase','8533842zfyffs','found','isSpinning','writeFileSync','site','...\x20','resolve','2284009MTKccu','\x20\x20Site:\x20','tags','Tests\x20found:\x20','No\x20tests\x20found\x20with\x20tags:\x20','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','no_tests','existsSync','Error:\x20No\x20previous\x20test\x20run\x20found.','length','dryRun','push','Re-evaluating\x20cached\x20test\x20run...','\x20\x20Round\x20','Failed:\x20\x20\x20','basename','yellow','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','PASS','ERROR','utf-8','map','Total:\x20\x20\x20\x20','find','now','testName','has','reason','tsv','resolveAgentId'];a5_0xbf6c=function(){return _0x386599;};return a5_0xbf6c();}import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x471453(0x1b0)]='agent:test';['description']='Run\x20tests\x20for\x20an\x20LLM\x20agent';async[a5_0x471453(0x1bd)](_0x550c67){const _0x2ea18d=a5_0x471453,{options:_0x345c36,args:_0x59d2dc,tdx:_0x9bf81}=_0x550c67,_0x337719=_0x59d2dc[0x0]||'.',_0x3aca6a=_0x345c36[_0x2ea18d(0x1e8)],_0x12c3f9=_0x345c36,_0x491ae0=_0x12c3f9[_0x2ea18d(0x205)]===![],_0x3e6f71=_0x12c3f9[_0x2ea18d(0x230)],_0x266f0e=_0x12c3f9[_0x2ea18d(0x1b0)],_0x45cfeb=_0x12c3f9[_0x2ea18d(0x1e0)],_0x5a8bbf=_0x345c36['site'],_0x1f8cca=_0x12c3f9[_0x2ea18d(0x212)];if(_0x3e6f71&&_0x491ae0)return console['log'](a5_0x4f4d8f['red'](_0x2ea18d(0x1ab))),0x1;let _0x16cff5=_0x2ea18d(0x233);if(_0x12c3f9[_0x2ea18d(0x203)])_0x16cff5=_0x2ea18d(0x203);else{if(_0x12c3f9['jsonl'])_0x16cff5=_0x2ea18d(0x1a8);else{if(_0x12c3f9[_0x2ea18d(0x1fa)])_0x16cff5='tsv';else{if(_0x12c3f9[_0x2ea18d(0x233)])_0x16cff5=_0x2ea18d(0x233);}}}const _0x1c2ebb=_0x12c3f9[_0x2ea18d(0x220)];let _0x501795=_0x337719;const _0x5f3cee=a5_0x3e1c39[_0x2ea18d(0x1e5)](_0x337719),_0x54c696=_0x337719==='.';if(!_0x5f3cee||_0x54c696){const _0x3febe2=resolveProjectFromContext(_0x337719,_0x1c2ebb,{'requireFile':_0x2ea18d(0x1fd)});if(_0x3febe2[_0x2ea18d(0x1d8)])_0x501795=_0x3febe2[_0x2ea18d(0x22b)],_0x3febe2[_0x2ea18d(0x1cf)]===_0x2ea18d(0x1cc)&&console[_0x2ea18d(0x217)](a5_0x4f4d8f['dim'](_0x2ea18d(0x20c)+_0x501795));else switch(_0x3febe2[_0x2ea18d(0x1f9)]){case'no_context':console['log'](a5_0x4f4d8f[_0x2ea18d(0x1ee)](_0x3febe2[_0x2ea18d(0x20d)])),console[_0x2ea18d(0x217)](),console[_0x2ea18d(0x217)](_0x2ea18d(0x1b2)),console[_0x2ea18d(0x217)]('\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[_0x2ea18d(0x217)](_0x2ea18d(0x1a9)),console[_0x2ea18d(0x217)](),console[_0x2ea18d(0x217)]('Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>');return 0x1;case _0x2ea18d(0x239):console['log'](a5_0x4f4d8f[_0x2ea18d(0x1ee)](_0x3febe2['message'])),console[_0x2ea18d(0x217)](),console[_0x2ea18d(0x217)](_0x2ea18d(0x213)+_0x3febe2['llmProject']+_0x2ea18d(0x228));return 0x1;case'multiple_agents':{const _0x51f379=a5_0x1aa8f7[_0x2ea18d(0x1ed)](_0x3febe2['projectDir']);console[_0x2ea18d(0x217)](a5_0x4f4d8f[_0x2ea18d(0x1ee)](_0x2ea18d(0x22d)+_0x3febe2[_0x2ea18d(0x220)]+'\x22:'));for(const _0x18ff73 of _0x3febe2['agentDirs']){console[_0x2ea18d(0x217)](_0x2ea18d(0x1be)+_0x18ff73);}return console[_0x2ea18d(0x217)](),console['log'](_0x2ea18d(0x1aa)+_0x51f379+_0x2ea18d(0x1a5)),0x1;}case _0x2ea18d(0x1e4):console['log'](a5_0x4f4d8f['yellow'](_0x2ea18d(0x22a)+_0x3febe2[_0x2ea18d(0x220)]+'\x22.')),console[_0x2ea18d(0x217)](a5_0x4f4d8f[_0x2ea18d(0x200)]('Project\x20path:\x20'+_0x3febe2[_0x2ea18d(0x22b)])),console[_0x2ea18d(0x217)](),console[_0x2ea18d(0x217)](_0x2ea18d(0x22e));return 0x1;}}const {definition:_0x41b169,agentInfo:_0x19ad2c}=parseTestFile(_0x501795);let _0x31fe2a=_0x41b169[_0x2ea18d(0x1c5)];if(_0x266f0e){const _0x51f628=_0x266f0e[_0x2ea18d(0x1ca)](',')[_0x2ea18d(0x1f3)](_0x54f271=>_0x54f271['trim']());_0x31fe2a=_0x41b169['tests'][_0x2ea18d(0x1d3)](_0x376748=>_0x51f628[_0x2ea18d(0x1fc)](_0x376748[_0x2ea18d(0x1b0)]));if(_0x31fe2a[_0x2ea18d(0x1e7)]===0x0)return console[_0x2ea18d(0x217)](a5_0x4f4d8f['yellow'](_0x2ea18d(0x236)+_0x266f0e)),console[_0x2ea18d(0x217)](a5_0x4f4d8f[_0x2ea18d(0x200)](_0x2ea18d(0x231)+_0x41b169['tests'][_0x2ea18d(0x1f3)](_0x59a894=>_0x59a894[_0x2ea18d(0x1b0)])[_0x2ea18d(0x1ad)](',\x20'))),0x1;}if(_0x45cfeb){const _0x582608=_0x45cfeb[_0x2ea18d(0x1ca)](',')['map'](_0x679b02=>_0x679b02[_0x2ea18d(0x223)]()[_0x2ea18d(0x1d6)]());_0x31fe2a=_0x31fe2a[_0x2ea18d(0x1d3)](_0x58bad5=>_0x58bad5['tags']?.[_0x2ea18d(0x1ce)](_0x574db9=>_0x582608[_0x2ea18d(0x1fc)](_0x574db9['toLowerCase']())));if(_0x31fe2a[_0x2ea18d(0x1e7)]===0x0){console[_0x2ea18d(0x217)](a5_0x4f4d8f['yellow'](_0x2ea18d(0x1e2)+_0x45cfeb));const _0x2e812c=new Set();return _0x41b169['tests'][_0x2ea18d(0x202)](_0xd70066=>_0xd70066[_0x2ea18d(0x1e0)]?.[_0x2ea18d(0x202)](_0x54327b=>_0x2e812c['add'](_0x54327b))),_0x2e812c[_0x2ea18d(0x1b5)]>0x0?console[_0x2ea18d(0x217)](a5_0x4f4d8f['dim']('Available\x20tags:\x20'+[..._0x2e812c][_0x2ea18d(0x1ad)](',\x20'))):console[_0x2ea18d(0x217)](a5_0x4f4d8f['dim']('No\x20tests\x20have\x20tags\x20defined.')),0x1;}}if(_0x3e6f71)return this['executeReeval'](_0x550c67,{'definition':{'tests':_0x31fe2a},'agentInfo':_0x19ad2c,'outputFormat':_0x16cff5,'outputFile':_0x1f8cca,'testNames':_0x266f0e});if(_0x3aca6a){console[_0x2ea18d(0x217)](a5_0x4f4d8f[_0x2ea18d(0x1c7)]('Test\x20Configuration:')),console[_0x2ea18d(0x217)](_0x2ea18d(0x1df)+a5_0x4f4d8f[_0x2ea18d(0x1c6)](_0x5a8bbf)),console[_0x2ea18d(0x217)](_0x2ea18d(0x208)+a5_0x4f4d8f[_0x2ea18d(0x1c6)](_0x19ad2c[_0x2ea18d(0x1bb)])),console[_0x2ea18d(0x217)]('\x20\x20Agent:\x20'+a5_0x4f4d8f['white'](_0x19ad2c['agentName'])),console[_0x2ea18d(0x217)](),console['log'](_0x2ea18d(0x1e1)+a5_0x4f4d8f[_0x2ea18d(0x1c6)](_0x31fe2a['length']));for(let _0x5a8098=0x0;_0x5a8098<_0x31fe2a[_0x2ea18d(0x1e7)];_0x5a8098++){const _0x151bde=_0x31fe2a[_0x5a8098],_0x5b1112=_0x151bde['rounds'][_0x2ea18d(0x1e7)]===0x1?_0x2ea18d(0x201):_0x2ea18d(0x215),_0x1e321f=_0x151bde['tags']?.[_0x2ea18d(0x1e7)]?'\x20['+_0x151bde[_0x2ea18d(0x1e0)][_0x2ea18d(0x1ad)](',\x20')+']':'';console[_0x2ea18d(0x217)]('\x20\x20'+(_0x5a8098+0x1)+'.\x20'+a5_0x4f4d8f[_0x2ea18d(0x1c6)](_0x151bde['name'])+'\x20('+_0x151bde[_0x2ea18d(0x215)][_0x2ea18d(0x1e7)]+'\x20'+_0x5b1112+')'+a5_0x4f4d8f['dim'](_0x1e321f));}return 0x0;}let _0x5e7646,_0x861ef9;try{_0x5e7646=await _0x9bf81[_0x2ea18d(0x1ba)]['resolveProjectId'](_0x19ad2c[_0x2ea18d(0x1bb)]);}catch(_0x38b415){const _0x3be1a9=_0x38b415 instanceof Error?_0x38b415['message']:String(_0x38b415);return _0x3be1a9[_0x2ea18d(0x1fc)]('404')||_0x3be1a9[_0x2ea18d(0x1d6)]()['includes'](_0x2ea18d(0x214))?console[_0x2ea18d(0x217)](a5_0x4f4d8f[_0x2ea18d(0x1d1)]('✗\x20ERROR:\x20Project\x20not\x20found:\x20'+_0x19ad2c[_0x2ea18d(0x1bb)])):console[_0x2ea18d(0x217)](a5_0x4f4d8f[_0x2ea18d(0x1d1)](_0x2ea18d(0x1c0)+_0x19ad2c['projectName']+_0x2ea18d(0x211)+_0x3be1a9)),0x1;}try{_0x861ef9=await _0x9bf81[_0x2ea18d(0x1ba)][_0x2ea18d(0x1fb)](_0x19ad2c[_0x2ea18d(0x219)],_0x5e7646);}catch(_0x16e774){const _0x377460=_0x16e774 instanceof Error?_0x16e774[_0x2ea18d(0x20d)]:String(_0x16e774);return _0x377460[_0x2ea18d(0x1fc)](_0x2ea18d(0x1c4))||_0x377460['toLowerCase']()[_0x2ea18d(0x1fc)](_0x2ea18d(0x214))?console[_0x2ea18d(0x217)](a5_0x4f4d8f[_0x2ea18d(0x1d1)](_0x2ea18d(0x1d0)+_0x19ad2c[_0x2ea18d(0x219)])):console[_0x2ea18d(0x217)](a5_0x4f4d8f[_0x2ea18d(0x1d1)](_0x2ea18d(0x20a)+_0x19ad2c['agentName']+_0x2ea18d(0x211)+_0x377460)),0x1;}let _0x4dd256;if(!_0x491ae0)try{_0x4dd256=await setupEvaluatorAgent(_0x9bf81[_0x2ea18d(0x1ba)],_0x345c36[_0x2ea18d(0x1bc)]);}catch(_0x343fcf){const _0xd5b035=_0x343fcf instanceof Error?_0x343fcf[_0x2ea18d(0x20d)]:String(_0x343fcf);return console[_0x2ea18d(0x217)](a5_0x4f4d8f[_0x2ea18d(0x1d1)](_0x2ea18d(0x1ef)+_0xd5b035)),0x1;}console[_0x2ea18d(0x217)](a5_0x4f4d8f[_0x2ea18d(0x1c7)](_0x2ea18d(0x1ae))),console[_0x2ea18d(0x217)](_0x2ea18d(0x1b9)+a5_0x4f4d8f['white'](_0x5a8bbf)),console[_0x2ea18d(0x217)](_0x2ea18d(0x1af)+a5_0x4f4d8f[_0x2ea18d(0x1c6)](_0x19ad2c[_0x2ea18d(0x1bb)]+'/'+_0x19ad2c['agentName'])),console['log']();const _0x2c4e60=[],_0x54f1e0=[],_0x2ad7b8=Date[_0x2ea18d(0x1f6)]();for(let _0x361e12=0x0;_0x361e12<_0x31fe2a[_0x2ea18d(0x1e7)];_0x361e12++){const _0x2e55a2=_0x31fe2a[_0x361e12];_0x31fe2a['length']>0x1?console['log'](_0x2ea18d(0x1c2)+(_0x361e12+0x1)+'/'+_0x31fe2a[_0x2ea18d(0x1e7)]+':\x20'+a5_0x4f4d8f[_0x2ea18d(0x1c6)](_0x2e55a2['name'])):console[_0x2ea18d(0x217)](_0x2ea18d(0x1ff)+a5_0x4f4d8f['white'](_0x2e55a2[_0x2ea18d(0x1b0)]));const _0x2fec8f=createCommandSpinner(_0x2ea18d(0x1b4)+_0x2e55a2[_0x2ea18d(0x215)]['length']+_0x2ea18d(0x1c8));_0x2fec8f[_0x2ea18d(0x1ac)]();try{const {result:_0xda7819,conversation:_0x7f24ab}=await runTest(_0x9bf81[_0x2ea18d(0x1ba)],_0x2e55a2,{'agentId':_0x861ef9,'projectId':_0x5e7646,'site':_0x5a8bbf,'noEval':_0x491ae0,'evaluatorId':_0x4dd256,'onRoundStart':(_0x34255a,_0xc0c177)=>{const _0x372826=_0x2ea18d;_0x2fec8f[_0x372826(0x1a6)]=_0x372826(0x21f)+(_0x34255a+0x1)+'/'+_0xc0c177+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x371353,_0x170d8c,_0x4e3ac)=>{const _0x100dff=_0x2ea18d,_0x2f1fe1=formatElapsed(_0x170d8c);_0x4e3ac?console[_0x100dff(0x217)](_0x100dff(0x1eb)+(_0x371353+0x1)+'/'+_0x2e55a2[_0x100dff(0x215)][_0x100dff(0x1e7)]+_0x100dff(0x1dc)+a5_0x4f4d8f[_0x100dff(0x20e)]('✓')+'\x20('+_0x2f1fe1+')'):console['log'](_0x100dff(0x1eb)+(_0x371353+0x1)+'/'+_0x2e55a2[_0x100dff(0x215)][_0x100dff(0x1e7)]+'...\x20'+a5_0x4f4d8f[_0x100dff(0x1d1)]('✗'));},'onEvaluationStart':()=>{_0x2fec8f['text']='Evaluating\x20response...';},'onEvaluationComplete':_0x5e7ce6=>{const _0x29718a=_0x2ea18d,_0x174326=formatElapsed(_0x5e7ce6);console[_0x29718a(0x217)](_0x29718a(0x23a)+a5_0x4f4d8f[_0x29718a(0x20e)]('✓')+'\x20('+_0x174326+')');}});_0x2fec8f[_0x2ea18d(0x238)](),_0x2c4e60['push'](_0xda7819),_0x54f1e0['push'](_0x7f24ab);if(_0xda7819['status']===_0x2ea18d(0x1f0))console[_0x2ea18d(0x217)](a5_0x4f4d8f[_0x2ea18d(0x20e)](_0x2ea18d(0x21c)+_0xda7819[_0x2ea18d(0x1f9)]));else _0xda7819[_0x2ea18d(0x206)]===_0x2ea18d(0x22c)?console[_0x2ea18d(0x217)](a5_0x4f4d8f[_0x2ea18d(0x1d1)](_0x2ea18d(0x226)+_0xda7819[_0x2ea18d(0x1f9)])):console[_0x2ea18d(0x217)](a5_0x4f4d8f[_0x2ea18d(0x1d1)](_0x2ea18d(0x204)+_0xda7819[_0x2ea18d(0x1f9)]));_0xda7819['conversation_url']&&console['log'](a5_0x4f4d8f[_0x2ea18d(0x200)]('Conversation\x20URL:\x20'+_0xda7819[_0x2ea18d(0x1c1)])),console['log']();}catch(_0xf4c3a2){_0x2fec8f[_0x2ea18d(0x238)]();const _0x419533=_0xf4c3a2 instanceof Error?_0xf4c3a2['message']:String(_0xf4c3a2);console[_0x2ea18d(0x217)](a5_0x4f4d8f[_0x2ea18d(0x1d1)](_0x2ea18d(0x204)+_0x419533)),console['log'](),_0x2c4e60[_0x2ea18d(0x1e9)]({'name':_0x2e55a2[_0x2ea18d(0x1b0)],'status':_0x2ea18d(0x1f1),'reason':_0x419533,'timestamp':new Date()[_0x2ea18d(0x1d5)](),'duration_ms':0x0});}}const _0x2e331f=Date['now']()-_0x2ad7b8,_0x4e8d52=_0x2c4e60[_0x2ea18d(0x1d3)](_0x370bd1=>_0x370bd1[_0x2ea18d(0x206)]===_0x2ea18d(0x1f0))['length'],_0x3c1335=_0x2c4e60['filter'](_0xb9a822=>_0xb9a822[_0x2ea18d(0x206)]===_0x2ea18d(0x22c))[_0x2ea18d(0x1e7)],_0x5519bb=_0x2c4e60[_0x2ea18d(0x1d3)](_0x256621=>_0x256621[_0x2ea18d(0x206)]===_0x2ea18d(0x1f1))['length'];console['log']('━'[_0x2ea18d(0x1d2)](0x3c)),console[_0x2ea18d(0x217)](_0x2ea18d(0x1c3)),console[_0x2ea18d(0x217)]('━'['repeat'](0x3c)),console[_0x2ea18d(0x217)](_0x2ea18d(0x1f4)+_0x2c4e60['length']),console[_0x2ea18d(0x217)](_0x2ea18d(0x1b7)+a5_0x4f4d8f[_0x2ea18d(0x20e)](_0x4e8d52)),console['log'](_0x2ea18d(0x1ec)+a5_0x4f4d8f[_0x2ea18d(0x1d1)](_0x3c1335));_0x5519bb>0x0&&console[_0x2ea18d(0x217)]('Errors:\x20\x20\x20'+a5_0x4f4d8f['red'](_0x5519bb));console['log']('Duration:\x20'+formatElapsed(_0x2e331f)),console['log']('━'[_0x2ea18d(0x1d2)](0x3c));const _0x1e7280=_0x2c4e60[_0x2ea18d(0x1d3)](_0x481fc1=>_0x481fc1['status']!==_0x2ea18d(0x1f0));if(_0x1e7280[_0x2ea18d(0x1e7)]>0x0){console['log'](),console[_0x2ea18d(0x217)](_0x2ea18d(0x237));for(const _0x5487ab of _0x1e7280){const _0x9527dd=a5_0x4f4d8f[_0x2ea18d(0x1d1)]('✗'),_0x4028d1=_0x5487ab[_0x2ea18d(0x1f9)][_0x2ea18d(0x1e7)]>0x32?_0x5487ab['reason']['substring'](0x0,0x32)+'...':_0x5487ab[_0x2ea18d(0x1f9)];console['log']('\x20\x20'+_0x9527dd+'\x20'+_0x5487ab[_0x2ea18d(0x1b0)]+':\x20'+_0x4028d1);}}const _0x5e625c={'summary':{'total':_0x2c4e60[_0x2ea18d(0x1e7)],'passed':_0x4e8d52,'failed':_0x3c1335,'errors':_0x5519bb>0x0?_0x5519bb:undefined,'duration_ms':_0x2e331f},'tests':_0x2c4e60,'agent':{'project':_0x19ad2c[_0x2ea18d(0x1bb)],'name':_0x19ad2c[_0x2ea18d(0x219)],'site':_0x5a8bbf},'timestamp':new Date(_0x2ad7b8)[_0x2ea18d(0x1d5)]()};try{const _0x8be66b=buildCachedTestRun(_0x54f1e0,{'site':_0x5a8bbf,'projectId':_0x5e7646,'projectName':_0x19ad2c[_0x2ea18d(0x1bb)],'agentId':_0x861ef9,'agentName':_0x19ad2c[_0x2ea18d(0x219)],'testYmlPath':a5_0x1aa8f7[_0x2ea18d(0x1dd)](_0x19ad2c['testYmlPath'])});saveLastTestRun(_0x8be66b);}catch{}if(_0x16cff5!=='table'||_0x1f8cca){const _0x1ec0cd=formatResults(_0x5e625c,_0x16cff5);if(_0x1f8cca)try{a5_0x3e1c39[_0x2ea18d(0x1da)](_0x1f8cca,_0x1ec0cd,_0x2ea18d(0x1f2)),console['log'](),console[_0x2ea18d(0x217)](a5_0x4f4d8f['dim'](_0x2ea18d(0x21a)+_0x1f8cca));}catch(_0x4406a2){return console[_0x2ea18d(0x217)](),console[_0x2ea18d(0x217)](a5_0x4f4d8f[_0x2ea18d(0x1d1)](_0x2ea18d(0x22f)+_0x4406a2)),0x1;}else console[_0x2ea18d(0x217)](),console[_0x2ea18d(0x217)](_0x1ec0cd);}return _0x1e7280[_0x2ea18d(0x1e7)]>0x0?0x1:0x0;}async['executeReeval'](_0x557f79,_0x512afa){const _0x17412c=a5_0x471453,{options:_0x4c1a23,tdx:_0x2a4b50}=_0x557f79,{definition:_0x3017be,agentInfo:_0x2e47a3,outputFormat:_0x4b913c,outputFile:_0x46129b}=_0x512afa,_0x847383=_0x4c1a23[_0x17412c(0x1db)],_0x3b5aa9=loadLastTestRun();if(!_0x3b5aa9)return console[_0x17412c(0x217)](a5_0x4f4d8f[_0x17412c(0x1d1)](_0x17412c(0x1e6))),console[_0x17412c(0x217)](a5_0x4f4d8f[_0x17412c(0x200)]('Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.')),0x1;if(_0x3b5aa9['agent'][_0x17412c(0x219)]!==_0x2e47a3[_0x17412c(0x219)])return console[_0x17412c(0x217)](a5_0x4f4d8f[_0x17412c(0x1d1)](_0x17412c(0x21e)+_0x3b5aa9[_0x17412c(0x1cb)][_0x17412c(0x219)]+_0x17412c(0x232)+_0x2e47a3[_0x17412c(0x219)]+'\x22.')),console[_0x17412c(0x217)](a5_0x4f4d8f['dim'](_0x17412c(0x218))),0x1;const _0x2e133d=new Set(_0x3b5aa9[_0x17412c(0x227)][_0x17412c(0x1f3)](_0x21937d=>_0x21937d[_0x17412c(0x1f7)])),_0x160de0=_0x3017be[_0x17412c(0x1c5)][_0x17412c(0x1d3)](_0x406407=>!_0x2e133d[_0x17412c(0x1f8)](_0x406407[_0x17412c(0x1b0)]));if(_0x160de0[_0x17412c(0x1e7)]>0x0&&_0x3b5aa9[_0x17412c(0x1db)]!==_0x847383)return console['log'](a5_0x4f4d8f['red'](_0x17412c(0x1e3))),console[_0x17412c(0x217)](a5_0x4f4d8f[_0x17412c(0x200)]('Cached\x20run\x20is\x20from\x20site\x20\x22'+_0x3b5aa9['site']+_0x17412c(0x1b3)+_0x847383+'\x22.')),console[_0x17412c(0x217)](a5_0x4f4d8f[_0x17412c(0x200)]('Either\x20switch\x20to\x20the\x20\x22'+_0x3b5aa9['site']+_0x17412c(0x235))),0x1;const _0x358b34=_0x3017be[_0x17412c(0x1c5)][_0x17412c(0x1d3)](_0x221969=>_0x2e133d[_0x17412c(0x1f8)](_0x221969[_0x17412c(0x1b0)])),_0x569b2f=_0x160de0;let _0x3da6f3;try{_0x3da6f3=await setupEvaluatorAgent(_0x2a4b50[_0x17412c(0x1ba)],_0x4c1a23[_0x17412c(0x1bc)]);}catch(_0x3ea79c){const _0x460c7b=_0x3ea79c instanceof Error?_0x3ea79c[_0x17412c(0x20d)]:String(_0x3ea79c);return console[_0x17412c(0x217)](a5_0x4f4d8f['red'](_0x17412c(0x1ef)+_0x460c7b)),0x1;}console[_0x17412c(0x217)](a5_0x4f4d8f[_0x17412c(0x1c7)](_0x17412c(0x1ea))),console[_0x17412c(0x217)](_0x17412c(0x1d4)+a5_0x4f4d8f[_0x17412c(0x1c6)](_0x3b5aa9[_0x17412c(0x21d)])),console[_0x17412c(0x217)]('Agent:\x20'+a5_0x4f4d8f[_0x17412c(0x1c6)](_0x3b5aa9[_0x17412c(0x1cb)]['projectName']+'/'+_0x3b5aa9[_0x17412c(0x1cb)][_0x17412c(0x219)]));_0x569b2f[_0x17412c(0x1e7)]>0x0&&console['log']('New\x20tests\x20to\x20execute:\x20'+a5_0x4f4d8f['yellow'](_0x569b2f[_0x17412c(0x1e7)]));console['log']();const _0x4eb658=[],_0xea0fc7=Date[_0x17412c(0x1f6)](),_0x12cb29=createCommandSpinner(_0x17412c(0x224));if(_0x358b34['length']>0x0)try{const _0x1ddd9f=await reevaluateFromCache(_0x2a4b50[_0x17412c(0x1ba)],_0x3b5aa9,{'tests':_0x358b34},{'evaluatorId':_0x3da6f3,'onTestStart':(_0x3de2a7,_0xe7dd3b,_0xb1330f)=>{const _0x4fa003=_0x17412c;_0x12cb29[_0x4fa003(0x1a6)]='Re-evaluating\x20'+(_0xe7dd3b+0x1)+'/'+_0xb1330f+':\x20'+_0x3de2a7+_0x4fa003(0x234);if(!_0x12cb29[_0x4fa003(0x1d9)])_0x12cb29[_0x4fa003(0x1ac)]();},'onTestComplete':(_0x3eeb8c,_0x1c2659)=>{const _0x36fe57=_0x17412c;_0x12cb29[_0x36fe57(0x238)]();if(_0x1c2659[_0x36fe57(0x206)]==='PASS')console[_0x36fe57(0x217)](a5_0x4f4d8f[_0x36fe57(0x20e)](_0x36fe57(0x21c)+_0x3eeb8c)+a5_0x4f4d8f[_0x36fe57(0x200)](_0x36fe57(0x207)));else _0x1c2659[_0x36fe57(0x206)]==='FAIL'?console[_0x36fe57(0x217)](a5_0x4f4d8f[_0x36fe57(0x1d1)]('✗\x20FAIL:\x20'+_0x3eeb8c+_0x36fe57(0x1b6)+_0x1c2659[_0x36fe57(0x1f9)])+a5_0x4f4d8f[_0x36fe57(0x200)](_0x36fe57(0x207))):console[_0x36fe57(0x217)](a5_0x4f4d8f[_0x36fe57(0x1d1)]('✗\x20ERROR:\x20'+_0x3eeb8c+'\x20-\x20'+_0x1c2659[_0x36fe57(0x1f9)]));_0x1c2659[_0x36fe57(0x1c1)]&&console[_0x36fe57(0x217)](a5_0x4f4d8f['dim']('\x20\x20Conversation:\x20'+_0x1c2659[_0x36fe57(0x1c1)])),_0x4eb658['push'](_0x1c2659);},'onTestSkipped':(_0x24c619,_0xc878a6)=>{const _0x34066e=_0x17412c;_0x12cb29[_0x34066e(0x238)](),console[_0x34066e(0x217)](a5_0x4f4d8f['yellow'](_0x34066e(0x209)+_0x24c619+_0x34066e(0x1b6)+_0xc878a6));}});for(const _0x1c2081 of _0x1ddd9f){!_0x4eb658[_0x17412c(0x1f5)](_0x2370d7=>_0x2370d7[_0x17412c(0x1b0)]===_0x1c2081['name'])&&_0x4eb658[_0x17412c(0x1e9)](_0x1c2081);}}catch(_0x5631bb){_0x12cb29['stop']();const _0x4a2367=_0x5631bb instanceof Error?_0x5631bb[_0x17412c(0x20d)]:String(_0x5631bb);return console[_0x17412c(0x217)](a5_0x4f4d8f['red'](_0x17412c(0x1a4)+_0x4a2367)),0x1;}_0x12cb29['stop']();if(_0x569b2f['length']>0x0){console[_0x17412c(0x217)](),console['log'](a5_0x4f4d8f[_0x17412c(0x1c7)](_0x17412c(0x21b)));const {projectId:_0xab65d2,agentId:_0x222f8b}=_0x3b5aa9['agent'];for(const _0x518d86 of _0x569b2f){console[_0x17412c(0x217)](_0x17412c(0x1bf)+a5_0x4f4d8f[_0x17412c(0x1c6)](_0x518d86[_0x17412c(0x1b0)]));const _0x11cecf=createCommandSpinner(_0x17412c(0x1b4)+_0x518d86[_0x17412c(0x215)]['length']+':\x20Sending\x20user\x20input...');_0x11cecf[_0x17412c(0x1ac)]();try{const {result:_0x391d6a}=await runTest(_0x2a4b50[_0x17412c(0x1ba)],_0x518d86,{'agentId':_0x222f8b,'projectId':_0xab65d2,'site':_0x3b5aa9[_0x17412c(0x1db)],'noEval':![],'evaluatorId':_0x3da6f3,'onRoundStart':(_0x5898a6,_0x1b82b9)=>{const _0x298d50=_0x17412c;_0x11cecf[_0x298d50(0x1a6)]=_0x298d50(0x21f)+(_0x5898a6+0x1)+'/'+_0x1b82b9+_0x298d50(0x1c8);},'onRoundComplete':(_0x256d1b,_0x2a558d,_0x444d4c)=>{const _0xc88337=_0x17412c,_0x8deba7=formatElapsed(_0x2a558d);_0x444d4c?console[_0xc88337(0x217)](_0xc88337(0x1eb)+(_0x256d1b+0x1)+'/'+_0x518d86[_0xc88337(0x215)][_0xc88337(0x1e7)]+'...\x20'+a5_0x4f4d8f[_0xc88337(0x20e)]('✓')+'\x20('+_0x8deba7+')'):console[_0xc88337(0x217)]('\x20\x20Round\x20'+(_0x256d1b+0x1)+'/'+_0x518d86['rounds'][_0xc88337(0x1e7)]+'...\x20'+a5_0x4f4d8f[_0xc88337(0x1d1)]('✗'));},'onEvaluationStart':()=>{const _0xc327ce=_0x17412c;_0x11cecf[_0xc327ce(0x1a6)]=_0xc327ce(0x229);},'onEvaluationComplete':_0x3e65c6=>{const _0x3bf675=_0x17412c,_0x2f8a1b=formatElapsed(_0x3e65c6);console['log'](_0x3bf675(0x23a)+a5_0x4f4d8f[_0x3bf675(0x20e)]('✓')+'\x20('+_0x2f8a1b+')');}});_0x11cecf[_0x17412c(0x238)](),_0x4eb658[_0x17412c(0x1e9)](_0x391d6a);if(_0x391d6a[_0x17412c(0x206)]===_0x17412c(0x1f0))console['log'](a5_0x4f4d8f['green'](_0x17412c(0x21c)+_0x391d6a[_0x17412c(0x1f9)])+a5_0x4f4d8f[_0x17412c(0x200)](_0x17412c(0x216)));else _0x391d6a[_0x17412c(0x206)]===_0x17412c(0x22c)?console[_0x17412c(0x217)](a5_0x4f4d8f[_0x17412c(0x1d1)]('✗\x20FAIL:\x20'+_0x391d6a[_0x17412c(0x1f9)])+a5_0x4f4d8f[_0x17412c(0x200)](_0x17412c(0x216))):console[_0x17412c(0x217)](a5_0x4f4d8f[_0x17412c(0x1d1)](_0x17412c(0x204)+_0x391d6a[_0x17412c(0x1f9)]));_0x391d6a[_0x17412c(0x1c1)]&&console[_0x17412c(0x217)](a5_0x4f4d8f[_0x17412c(0x200)](_0x17412c(0x20f)+_0x391d6a[_0x17412c(0x1c1)]));}catch(_0x57f6a6){_0x11cecf[_0x17412c(0x238)]();const _0x2308be=_0x57f6a6 instanceof Error?_0x57f6a6[_0x17412c(0x20d)]:String(_0x57f6a6);console['log'](a5_0x4f4d8f[_0x17412c(0x1d1)](_0x17412c(0x204)+_0x2308be)),_0x4eb658[_0x17412c(0x1e9)]({'name':_0x518d86[_0x17412c(0x1b0)],'status':_0x17412c(0x1f1),'reason':_0x2308be,'timestamp':new Date()[_0x17412c(0x1d5)](),'duration_ms':0x0});}}}console[_0x17412c(0x217)]();const _0x362fe9=Date[_0x17412c(0x1f6)]()-_0xea0fc7,_0x49474f=_0x4eb658[_0x17412c(0x1d3)](_0x5c2dfe=>_0x5c2dfe[_0x17412c(0x206)]===_0x17412c(0x1f0))[_0x17412c(0x1e7)],_0x13c7cc=_0x4eb658[_0x17412c(0x1d3)](_0x387704=>_0x387704[_0x17412c(0x206)]===_0x17412c(0x22c))[_0x17412c(0x1e7)],_0x465af4=_0x4eb658['filter'](_0x17522a=>_0x17522a['status']===_0x17412c(0x1f1))[_0x17412c(0x1e7)];console['log']('━'['repeat'](0x3c)),console[_0x17412c(0x217)](_0x17412c(0x1b8)),console[_0x17412c(0x217)]('━'['repeat'](0x3c)),console[_0x17412c(0x217)](_0x17412c(0x1f4)+_0x4eb658[_0x17412c(0x1e7)]),console[_0x17412c(0x217)](_0x17412c(0x1b7)+a5_0x4f4d8f['green'](_0x49474f)),console[_0x17412c(0x217)](_0x17412c(0x1ec)+a5_0x4f4d8f['red'](_0x13c7cc));_0x465af4>0x0&&console['log'](_0x17412c(0x222)+a5_0x4f4d8f[_0x17412c(0x1d1)](_0x465af4));console[_0x17412c(0x217)]('Duration:\x20'+formatElapsed(_0x362fe9)),console[_0x17412c(0x217)]('━'['repeat'](0x3c));const _0x4351e8={'summary':{'total':_0x4eb658['length'],'passed':_0x49474f,'failed':_0x13c7cc,'errors':_0x465af4>0x0?_0x465af4:undefined,'duration_ms':_0x362fe9},'tests':_0x4eb658,'agent':{'project':_0x2e47a3[_0x17412c(0x1bb)],'name':_0x2e47a3[_0x17412c(0x219)],'site':_0x847383},'timestamp':new Date(_0xea0fc7)['toISOString']()};if(_0x4b913c!==_0x17412c(0x233)||_0x46129b){const _0x5ea47b=formatResults(_0x4351e8,_0x4b913c);if(_0x46129b)try{a5_0x3e1c39['writeFileSync'](_0x46129b,_0x5ea47b,_0x17412c(0x1f2)),console[_0x17412c(0x217)](),console[_0x17412c(0x217)](a5_0x4f4d8f[_0x17412c(0x200)](_0x17412c(0x21a)+_0x46129b));}catch(_0x47d3fb){return console['log'](),console[_0x17412c(0x217)](a5_0x4f4d8f['red'](_0x17412c(0x22f)+_0x47d3fb)),0x1;}else console[_0x17412c(0x217)](),console[_0x17412c(0x217)](_0x5ea47b);}const _0x54fa8a=_0x4eb658[_0x17412c(0x1d3)](_0x56e6fe=>_0x56e6fe[_0x17412c(0x206)]!=='PASS');return _0x54fa8a[_0x17412c(0x1e7)]>0x0?0x1:0x0;}}
1
+ const a5_0x5d7a31=a5_0x5be5;(function(_0x2eed20,_0x31a975){const _0x5dc466=a5_0x5be5,_0x219c7d=_0x2eed20();while(!![]){try{const _0x62af5a=parseInt(_0x5dc466(0x12c))/0x1*(-parseInt(_0x5dc466(0x188))/0x2)+-parseInt(_0x5dc466(0x1a5))/0x3+-parseInt(_0x5dc466(0x18c))/0x4*(parseInt(_0x5dc466(0x159))/0x5)+-parseInt(_0x5dc466(0x152))/0x6*(-parseInt(_0x5dc466(0x173))/0x7)+parseInt(_0x5dc466(0x1a1))/0x8+-parseInt(_0x5dc466(0x164))/0x9*(-parseInt(_0x5dc466(0x1a3))/0xa)+-parseInt(_0x5dc466(0x17c))/0xb*(-parseInt(_0x5dc466(0x167))/0xc);if(_0x62af5a===_0x31a975)break;else _0x219c7d['push'](_0x219c7d['shift']());}catch(_0x53264c){_0x219c7d['push'](_0x219c7d['shift']());}}}(a5_0x2c9b,0x43265));import*as a5_0x343e4e from'node:fs';import*as a5_0xd173a7 from'node:path';import a5_0x10e56c from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';function a5_0x5be5(_0x4d7bf3,_0x25dec5){_0x4d7bf3=_0x4d7bf3-0x116;const _0x2c9ba4=a5_0x2c9b();let _0x5be5b1=_0x2c9ba4[_0x4d7bf3];return _0x5be5b1;}import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';function a5_0x2c9b(){const _0x2cd34c=['Total:\x20\x20\x20\x20','✗\x20ERROR:\x20','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','\x20\x20-\x20','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','agentName','Failed\x20Tests:','size','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','Running\x20test:\x20','llmProject','\x27\x20to\x20create\x20the\x20folder\x20structure.','some','Running:\x20','6spiojE','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','Error:\x20No\x20previous\x20test\x20run\x20found.','round','\x20\x20Round\x20','\x20\x20Agent:\x20','\x20-\x20','15rGbAeV','Test\x20Configuration:','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','message','...\x20','Passed:\x20\x20\x20','jsonl','agent','verbose','Test\x20','1856772Jnqifg','\x22,\x20but\x20current\x20site\x20is\x20\x22','tests','160620vRGdno','Tests\x20found:\x20','404','FAIL','\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)','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','json','Evaluating\x20response...','testYmlPath',':\x20Sending\x20user\x20input...','resolveProjectId','conversation_url','226877xeFPFm','projectName','executeReeval','cyan','log','found','Run\x20\x27tdx\x20agent\x20pull\x20','\x20\x20Conversation:\x20','Available\x20tags:\x20','407TMTRuV','No\x20tests\x20found\x20with\x20tags:\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','Output\x20written\x20to:\x20','Usage:','utf-8','push','\x20\x20Project:\x20','⚠\x20SKIPPED:\x20','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','No\x20tests\x20found\x20matching:\x20','substring','173962pndDvu','✗\x20ERROR:\x20Project\x20not\x20found:\x20','Round\x201/','source','621524iARCBh','site','now','yellow','toISOString','text','Errors:\x20\x20\x20','resolveAgentId','Re-evaluation\x20Summary','Failed:\x20\x20\x20','status','llm','reason','join','agent:test','no_context','conversations','repeat','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','reeval','Duration:\x20','1717248yovjjs','Round\x20','20IcsTzB','green','458391DpCGEM','\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','testName','Re-evaluating\x20cached\x20test\x20run...','existsSync','resolve','map','ERROR','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','tsv','not\x20found','test.yml','rounds','Cached\x20run\x20from:\x20','no_tests','table','projectDir','name','forEach','\x20\x20Evaluating...\x20','Available\x20tests:\x20','length','Using\x20agent:\x20','...','✓\x20PASS:\x20','Project\x20path:\x20','dim','Agent:\x20','includes','description','Error\x20writing\x20output\x20file:\x20','filter','3ZkMcTc','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','Executing\x20new\x20tests...','start','stop','PASS','split','toLowerCase','✗\x20FAIL:\x20','dryRun','has','agentDirs','tags','isSpinning','Test\x20Summary','\x20\x20Site:\x20','execute','\x22:\x20','Cached\x20run\x20is\x20from\x20site\x20\x22','multiple_agents','white','no_local_folder','\x20(cached)','red'];a5_0x2c9b=function(){return _0x2cd34c;};return a5_0x2c9b();}import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x5d7a31(0x11d)]=a5_0x5d7a31(0x19a);[a5_0x5d7a31(0x129)]='Run\x20tests\x20for\x20an\x20LLM\x20agent';async[a5_0x5d7a31(0x13c)](_0x137522){const _0x46cc70=a5_0x5d7a31,{options:_0x376679,args:_0x596923,tdx:_0x40eda8}=_0x137522,_0x4df34d=_0x596923[0x0]||'.',_0x4de858=_0x376679[_0x46cc70(0x135)],_0x81d02=_0x376679,_0x1b815e=_0x81d02['eval']===![],_0x167576=_0x81d02[_0x46cc70(0x19f)],_0x320cc9=_0x81d02['name'],_0x3d5382=_0x81d02[_0x46cc70(0x138)],_0x6abef6=_0x376679[_0x46cc70(0x18d)],_0x2e0896=_0x81d02['output'];if(_0x167576&&_0x1b815e)return console[_0x46cc70(0x177)](a5_0x10e56c['red']('Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval')),0x1;let _0x47c626='table';if(_0x81d02[_0x46cc70(0x16d)])_0x47c626='json';else{if(_0x81d02[_0x46cc70(0x160)])_0x47c626=_0x46cc70(0x160);else{if(_0x81d02[_0x46cc70(0x1af)])_0x47c626=_0x46cc70(0x1af);else{if(_0x81d02[_0x46cc70(0x11b)])_0x47c626=_0x46cc70(0x11b);}}}const _0x3abfde=_0x81d02[_0x46cc70(0x14e)];let _0x2937a0=_0x4df34d;const _0x3e31f3=a5_0x343e4e[_0x46cc70(0x1a9)](_0x4df34d),_0x5b65be=_0x4df34d==='.';if(!_0x3e31f3||_0x5b65be){const _0x4ff3ba=resolveProjectFromContext(_0x4df34d,_0x3abfde,{'requireFile':_0x46cc70(0x117)});if(_0x4ff3ba[_0x46cc70(0x178)])_0x2937a0=_0x4ff3ba[_0x46cc70(0x11c)],_0x4ff3ba[_0x46cc70(0x18b)]==='context'&&console[_0x46cc70(0x177)](a5_0x10e56c[_0x46cc70(0x126)](_0x46cc70(0x122)+_0x2937a0));else switch(_0x4ff3ba[_0x46cc70(0x198)]){case _0x46cc70(0x19b):console[_0x46cc70(0x177)](a5_0x10e56c[_0x46cc70(0x18f)](_0x4ff3ba[_0x46cc70(0x15d)])),console[_0x46cc70(0x177)](),console[_0x46cc70(0x177)](_0x46cc70(0x180)),console['log'](_0x46cc70(0x1a6)),console[_0x46cc70(0x177)](_0x46cc70(0x16b)),console[_0x46cc70(0x177)](),console[_0x46cc70(0x177)]('Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>');return 0x1;case _0x46cc70(0x141):console[_0x46cc70(0x177)](a5_0x10e56c['yellow'](_0x4ff3ba[_0x46cc70(0x15d)])),console[_0x46cc70(0x177)](),console[_0x46cc70(0x177)](_0x46cc70(0x179)+_0x4ff3ba[_0x46cc70(0x14e)]+_0x46cc70(0x14f));return 0x1;case _0x46cc70(0x13f):{const _0x13e140=a5_0xd173a7['basename'](_0x4ff3ba[_0x46cc70(0x11c)]);console[_0x46cc70(0x177)](a5_0x10e56c[_0x46cc70(0x18f)](_0x46cc70(0x185)+_0x4ff3ba[_0x46cc70(0x14e)]+'\x22:'));for(const _0x33496e of _0x4ff3ba[_0x46cc70(0x137)]){console[_0x46cc70(0x177)](_0x46cc70(0x147)+_0x33496e);}return console[_0x46cc70(0x177)](),console[_0x46cc70(0x177)](_0x46cc70(0x19e)+_0x13e140+'/<agent-name>'),0x1;}case _0x46cc70(0x11a):console['log'](a5_0x10e56c[_0x46cc70(0x18f)]('No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22'+_0x4ff3ba[_0x46cc70(0x14e)]+'\x22.')),console[_0x46cc70(0x177)](a5_0x10e56c['dim'](_0x46cc70(0x125)+_0x4ff3ba[_0x46cc70(0x11c)])),console[_0x46cc70(0x177)](),console[_0x46cc70(0x177)](_0x46cc70(0x16c));return 0x1;}}const {definition:_0x3e4e4a,agentInfo:_0x1ae344}=parseTestFile(_0x2937a0);let _0x5f5b1d=_0x3e4e4a[_0x46cc70(0x166)];if(_0x320cc9){const _0x39ecf8=_0x320cc9[_0x46cc70(0x132)](',')['map'](_0x38f38b=>_0x38f38b['trim']());_0x5f5b1d=_0x3e4e4a['tests'][_0x46cc70(0x12b)](_0xb7c601=>_0x39ecf8['includes'](_0xb7c601[_0x46cc70(0x11d)]));if(_0x5f5b1d[_0x46cc70(0x121)]===0x0)return console['log'](a5_0x10e56c[_0x46cc70(0x18f)](_0x46cc70(0x186)+_0x320cc9)),console[_0x46cc70(0x177)](a5_0x10e56c[_0x46cc70(0x126)](_0x46cc70(0x120)+_0x3e4e4a['tests'][_0x46cc70(0x1ab)](_0x4b6f1e=>_0x4b6f1e[_0x46cc70(0x11d)])['join'](',\x20'))),0x1;}if(_0x3d5382){const _0x4592e4=_0x3d5382[_0x46cc70(0x132)](',')[_0x46cc70(0x1ab)](_0xcbd11a=>_0xcbd11a['trim']()[_0x46cc70(0x133)]());_0x5f5b1d=_0x5f5b1d[_0x46cc70(0x12b)](_0x256ac2=>_0x256ac2['tags']?.[_0x46cc70(0x150)](_0x12aeb8=>_0x4592e4['includes'](_0x12aeb8[_0x46cc70(0x133)]())));if(_0x5f5b1d[_0x46cc70(0x121)]===0x0){console[_0x46cc70(0x177)](a5_0x10e56c[_0x46cc70(0x18f)](_0x46cc70(0x17d)+_0x3d5382));const _0xd2927e=new Set();return _0x3e4e4a[_0x46cc70(0x166)][_0x46cc70(0x11e)](_0x589bf6=>_0x589bf6[_0x46cc70(0x138)]?.[_0x46cc70(0x11e)](_0x15a6df=>_0xd2927e['add'](_0x15a6df))),_0xd2927e[_0x46cc70(0x14b)]>0x0?console[_0x46cc70(0x177)](a5_0x10e56c[_0x46cc70(0x126)](_0x46cc70(0x17b)+[..._0xd2927e]['join'](',\x20'))):console[_0x46cc70(0x177)](a5_0x10e56c[_0x46cc70(0x126)]('No\x20tests\x20have\x20tags\x20defined.')),0x1;}}if(_0x167576)return this['executeReeval'](_0x137522,{'definition':{'tests':_0x5f5b1d},'agentInfo':_0x1ae344,'outputFormat':_0x47c626,'outputFile':_0x2e0896,'testNames':_0x320cc9});if(_0x4de858){console[_0x46cc70(0x177)](a5_0x10e56c['cyan'](_0x46cc70(0x15a))),console[_0x46cc70(0x177)](_0x46cc70(0x13b)+a5_0x10e56c[_0x46cc70(0x140)](_0x6abef6)),console['log'](_0x46cc70(0x183)+a5_0x10e56c['white'](_0x1ae344[_0x46cc70(0x174)])),console[_0x46cc70(0x177)](_0x46cc70(0x157)+a5_0x10e56c[_0x46cc70(0x140)](_0x1ae344['agentName'])),console[_0x46cc70(0x177)](),console['log'](_0x46cc70(0x168)+a5_0x10e56c[_0x46cc70(0x140)](_0x5f5b1d['length']));for(let _0x19b813=0x0;_0x19b813<_0x5f5b1d[_0x46cc70(0x121)];_0x19b813++){const _0x195d84=_0x5f5b1d[_0x19b813],_0x22be3d=_0x195d84[_0x46cc70(0x118)][_0x46cc70(0x121)]===0x1?_0x46cc70(0x155):_0x46cc70(0x118),_0x53df66=_0x195d84[_0x46cc70(0x138)]?.['length']?'\x20['+_0x195d84[_0x46cc70(0x138)][_0x46cc70(0x199)](',\x20')+']':'';console['log']('\x20\x20'+(_0x19b813+0x1)+'.\x20'+a5_0x10e56c[_0x46cc70(0x140)](_0x195d84[_0x46cc70(0x11d)])+'\x20('+_0x195d84[_0x46cc70(0x118)]['length']+'\x20'+_0x22be3d+')'+a5_0x10e56c['dim'](_0x53df66));}return 0x0;}let _0x81e993,_0x43838f;try{_0x81e993=await _0x40eda8[_0x46cc70(0x197)][_0x46cc70(0x171)](_0x1ae344[_0x46cc70(0x174)]);}catch(_0x5f32d5){const _0xb61a6c=_0x5f32d5 instanceof Error?_0x5f32d5[_0x46cc70(0x15d)]:String(_0x5f32d5);return _0xb61a6c[_0x46cc70(0x128)](_0x46cc70(0x169))||_0xb61a6c[_0x46cc70(0x133)]()[_0x46cc70(0x128)](_0x46cc70(0x116))?console[_0x46cc70(0x177)](a5_0x10e56c['red'](_0x46cc70(0x189)+_0x1ae344[_0x46cc70(0x174)])):console[_0x46cc70(0x177)](a5_0x10e56c[_0x46cc70(0x143)](_0x46cc70(0x153)+_0x1ae344[_0x46cc70(0x174)]+_0x46cc70(0x13d)+_0xb61a6c)),0x1;}try{_0x43838f=await _0x40eda8[_0x46cc70(0x197)][_0x46cc70(0x193)](_0x1ae344[_0x46cc70(0x149)],_0x81e993);}catch(_0xbe4718){const _0x12ec1a=_0xbe4718 instanceof Error?_0xbe4718[_0x46cc70(0x15d)]:String(_0xbe4718);return _0x12ec1a[_0x46cc70(0x128)](_0x46cc70(0x169))||_0x12ec1a[_0x46cc70(0x133)]()[_0x46cc70(0x128)](_0x46cc70(0x116))?console['log'](a5_0x10e56c[_0x46cc70(0x143)]('✗\x20ERROR:\x20Agent\x20not\x20found:\x20'+_0x1ae344['agentName'])):console[_0x46cc70(0x177)](a5_0x10e56c[_0x46cc70(0x143)](_0x46cc70(0x17e)+_0x1ae344['agentName']+_0x46cc70(0x13d)+_0x12ec1a)),0x1;}let _0x4dce8a;if(!_0x1b815e)try{_0x4dce8a=await setupEvaluatorAgent(_0x40eda8[_0x46cc70(0x197)],_0x376679[_0x46cc70(0x162)]);}catch(_0xf0d599){const _0x48f9c4=_0xf0d599 instanceof Error?_0xf0d599[_0x46cc70(0x15d)]:String(_0xf0d599);return console[_0x46cc70(0x177)](a5_0x10e56c[_0x46cc70(0x143)](_0x46cc70(0x1ad)+_0x48f9c4)),0x1;}console[_0x46cc70(0x177)](a5_0x10e56c[_0x46cc70(0x176)]('Running\x20agent\x20tests...')),console[_0x46cc70(0x177)]('Site:\x20'+a5_0x10e56c['white'](_0x6abef6)),console['log'](_0x46cc70(0x127)+a5_0x10e56c[_0x46cc70(0x140)](_0x1ae344[_0x46cc70(0x174)]+'/'+_0x1ae344[_0x46cc70(0x149)])),console['log']();const _0x21b5ff=[],_0x54ee2a=[],_0x2247a6=Date[_0x46cc70(0x18e)]();for(let _0xda366b=0x0;_0xda366b<_0x5f5b1d['length'];_0xda366b++){const _0x568caf=_0x5f5b1d[_0xda366b];_0x5f5b1d[_0x46cc70(0x121)]>0x1?console[_0x46cc70(0x177)](_0x46cc70(0x163)+(_0xda366b+0x1)+'/'+_0x5f5b1d[_0x46cc70(0x121)]+':\x20'+a5_0x10e56c[_0x46cc70(0x140)](_0x568caf[_0x46cc70(0x11d)])):console['log'](_0x46cc70(0x14d)+a5_0x10e56c[_0x46cc70(0x140)](_0x568caf['name']));const _0x1ae814=createCommandSpinner('Round\x201/'+_0x568caf[_0x46cc70(0x118)]['length']+_0x46cc70(0x170));_0x1ae814[_0x46cc70(0x12f)]();try{const {result:_0x2e98e6,conversation:_0x4a41be}=await runTest(_0x40eda8[_0x46cc70(0x197)],_0x568caf,{'agentId':_0x43838f,'projectId':_0x81e993,'site':_0x6abef6,'noEval':_0x1b815e,'evaluatorId':_0x4dce8a,'onRoundStart':(_0x14a666,_0x3915e7)=>{const _0x1215cd=_0x46cc70;_0x1ae814[_0x1215cd(0x191)]='Round\x20'+(_0x14a666+0x1)+'/'+_0x3915e7+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x22712d,_0x5205a7,_0x39ac3f)=>{const _0x58085a=_0x46cc70,_0x43af9d=formatElapsed(_0x5205a7);_0x39ac3f?console[_0x58085a(0x177)](_0x58085a(0x156)+(_0x22712d+0x1)+'/'+_0x568caf[_0x58085a(0x118)]['length']+_0x58085a(0x15e)+a5_0x10e56c[_0x58085a(0x1a4)]('✓')+'\x20('+_0x43af9d+')'):console[_0x58085a(0x177)](_0x58085a(0x156)+(_0x22712d+0x1)+'/'+_0x568caf[_0x58085a(0x118)]['length']+'...\x20'+a5_0x10e56c[_0x58085a(0x143)]('✗'));},'onEvaluationStart':()=>{const _0x59621d=_0x46cc70;_0x1ae814[_0x59621d(0x191)]=_0x59621d(0x16e);},'onEvaluationComplete':_0x2d9e23=>{const _0x262783=_0x46cc70,_0x549eb3=formatElapsed(_0x2d9e23);console['log'](_0x262783(0x11f)+a5_0x10e56c['green']('✓')+'\x20('+_0x549eb3+')');}});_0x1ae814[_0x46cc70(0x130)](),_0x21b5ff[_0x46cc70(0x182)](_0x2e98e6),_0x54ee2a['push'](_0x4a41be);if(_0x2e98e6[_0x46cc70(0x196)]===_0x46cc70(0x131))console[_0x46cc70(0x177)](a5_0x10e56c[_0x46cc70(0x1a4)](_0x46cc70(0x124)+_0x2e98e6['reason']));else _0x2e98e6[_0x46cc70(0x196)]===_0x46cc70(0x16a)?console[_0x46cc70(0x177)](a5_0x10e56c[_0x46cc70(0x143)](_0x46cc70(0x134)+_0x2e98e6['reason'])):console[_0x46cc70(0x177)](a5_0x10e56c[_0x46cc70(0x143)](_0x46cc70(0x145)+_0x2e98e6[_0x46cc70(0x198)]));_0x2e98e6[_0x46cc70(0x172)]&&console[_0x46cc70(0x177)](a5_0x10e56c['dim']('Conversation\x20URL:\x20'+_0x2e98e6[_0x46cc70(0x172)])),console[_0x46cc70(0x177)]();}catch(_0x13cc8d){_0x1ae814[_0x46cc70(0x130)]();const _0x6ed08d=_0x13cc8d instanceof Error?_0x13cc8d['message']:String(_0x13cc8d);console['log'](a5_0x10e56c[_0x46cc70(0x143)](_0x46cc70(0x145)+_0x6ed08d)),console[_0x46cc70(0x177)](),_0x21b5ff[_0x46cc70(0x182)]({'name':_0x568caf['name'],'status':_0x46cc70(0x1ac),'reason':_0x6ed08d,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}const _0x65a49f=Date['now']()-_0x2247a6,_0x523fe3=_0x21b5ff[_0x46cc70(0x12b)](_0x2655e5=>_0x2655e5[_0x46cc70(0x196)]===_0x46cc70(0x131))[_0x46cc70(0x121)],_0x2e6cd5=_0x21b5ff[_0x46cc70(0x12b)](_0x27179b=>_0x27179b['status']===_0x46cc70(0x16a))[_0x46cc70(0x121)],_0x3b481f=_0x21b5ff[_0x46cc70(0x12b)](_0xbcfeb4=>_0xbcfeb4[_0x46cc70(0x196)]===_0x46cc70(0x1ac))[_0x46cc70(0x121)];console[_0x46cc70(0x177)]('━'[_0x46cc70(0x19d)](0x3c)),console[_0x46cc70(0x177)](_0x46cc70(0x13a)),console[_0x46cc70(0x177)]('━'['repeat'](0x3c)),console[_0x46cc70(0x177)](_0x46cc70(0x144)+_0x21b5ff[_0x46cc70(0x121)]),console[_0x46cc70(0x177)](_0x46cc70(0x15f)+a5_0x10e56c['green'](_0x523fe3)),console[_0x46cc70(0x177)](_0x46cc70(0x195)+a5_0x10e56c['red'](_0x2e6cd5));_0x3b481f>0x0&&console[_0x46cc70(0x177)](_0x46cc70(0x192)+a5_0x10e56c[_0x46cc70(0x143)](_0x3b481f));console[_0x46cc70(0x177)](_0x46cc70(0x1a0)+formatElapsed(_0x65a49f)),console['log']('━'[_0x46cc70(0x19d)](0x3c));const _0xf5981e=_0x21b5ff[_0x46cc70(0x12b)](_0x469f89=>_0x469f89['status']!==_0x46cc70(0x131));if(_0xf5981e[_0x46cc70(0x121)]>0x0){console['log'](),console[_0x46cc70(0x177)](_0x46cc70(0x14a));for(const _0x33103b of _0xf5981e){const _0x4aab22=a5_0x10e56c[_0x46cc70(0x143)]('✗'),_0x5ce646=_0x33103b['reason']['length']>0x32?_0x33103b['reason'][_0x46cc70(0x187)](0x0,0x32)+_0x46cc70(0x123):_0x33103b[_0x46cc70(0x198)];console[_0x46cc70(0x177)]('\x20\x20'+_0x4aab22+'\x20'+_0x33103b[_0x46cc70(0x11d)]+':\x20'+_0x5ce646);}}const _0x2ef28b={'summary':{'total':_0x21b5ff[_0x46cc70(0x121)],'passed':_0x523fe3,'failed':_0x2e6cd5,'errors':_0x3b481f>0x0?_0x3b481f:undefined,'duration_ms':_0x65a49f},'tests':_0x21b5ff,'agent':{'project':_0x1ae344[_0x46cc70(0x174)],'name':_0x1ae344[_0x46cc70(0x149)],'site':_0x6abef6},'timestamp':new Date(_0x2247a6)['toISOString']()};try{const _0x3d290b=buildCachedTestRun(_0x54ee2a,{'site':_0x6abef6,'projectId':_0x81e993,'projectName':_0x1ae344[_0x46cc70(0x174)],'agentId':_0x43838f,'agentName':_0x1ae344[_0x46cc70(0x149)],'testYmlPath':a5_0xd173a7[_0x46cc70(0x1aa)](_0x1ae344[_0x46cc70(0x16f)])});saveLastTestRun(_0x3d290b);}catch{}if(_0x47c626!==_0x46cc70(0x11b)||_0x2e0896){const _0x5ad61a=formatResults(_0x2ef28b,_0x47c626);if(_0x2e0896)try{a5_0x343e4e['writeFileSync'](_0x2e0896,_0x5ad61a,'utf-8'),console['log'](),console[_0x46cc70(0x177)](a5_0x10e56c['dim']('Output\x20written\x20to:\x20'+_0x2e0896));}catch(_0x15ef26){return console[_0x46cc70(0x177)](),console[_0x46cc70(0x177)](a5_0x10e56c[_0x46cc70(0x143)](_0x46cc70(0x12a)+_0x15ef26)),0x1;}else console[_0x46cc70(0x177)](),console[_0x46cc70(0x177)](_0x5ad61a);}return _0xf5981e[_0x46cc70(0x121)]>0x0?0x1:0x0;}async[a5_0x5d7a31(0x175)](_0x2ba1f2,_0x11421c){const _0x35df99=a5_0x5d7a31,{options:_0x5ef9e7,tdx:_0x4dbf99}=_0x2ba1f2,{definition:_0x315dae,agentInfo:_0x262034,outputFormat:_0x4a1544,outputFile:_0x25390e}=_0x11421c,_0x215e18=_0x5ef9e7['site'],_0x3b8982=loadLastTestRun();if(!_0x3b8982)return console[_0x35df99(0x177)](a5_0x10e56c[_0x35df99(0x143)](_0x35df99(0x154))),console[_0x35df99(0x177)](a5_0x10e56c[_0x35df99(0x126)](_0x35df99(0x14c))),0x1;if(_0x3b8982[_0x35df99(0x161)][_0x35df99(0x149)]!==_0x262034[_0x35df99(0x149)])return console[_0x35df99(0x177)](a5_0x10e56c[_0x35df99(0x143)](_0x35df99(0x146)+_0x3b8982[_0x35df99(0x161)][_0x35df99(0x149)]+_0x35df99(0x15b)+_0x262034[_0x35df99(0x149)]+'\x22.')),console[_0x35df99(0x177)](a5_0x10e56c[_0x35df99(0x126)](_0x35df99(0x15c))),0x1;const _0x1a383f=new Set(_0x3b8982[_0x35df99(0x19c)][_0x35df99(0x1ab)](_0x348b4e=>_0x348b4e[_0x35df99(0x1a7)])),_0x429c2b=_0x315dae['tests'][_0x35df99(0x12b)](_0x448f3a=>!_0x1a383f[_0x35df99(0x136)](_0x448f3a[_0x35df99(0x11d)]));if(_0x429c2b[_0x35df99(0x121)]>0x0&&_0x3b8982['site']!==_0x215e18)return console['log'](a5_0x10e56c[_0x35df99(0x143)](_0x35df99(0x12d))),console[_0x35df99(0x177)](a5_0x10e56c[_0x35df99(0x126)](_0x35df99(0x13e)+_0x3b8982[_0x35df99(0x18d)]+_0x35df99(0x165)+_0x215e18+'\x22.')),console[_0x35df99(0x177)](a5_0x10e56c[_0x35df99(0x126)]('Either\x20switch\x20to\x20the\x20\x22'+_0x3b8982['site']+_0x35df99(0x148))),0x1;const _0x3239f1=_0x315dae[_0x35df99(0x166)][_0x35df99(0x12b)](_0x1af9f0=>_0x1a383f[_0x35df99(0x136)](_0x1af9f0[_0x35df99(0x11d)])),_0x5e0810=_0x429c2b;let _0x4ec66b;try{_0x4ec66b=await setupEvaluatorAgent(_0x4dbf99[_0x35df99(0x197)],_0x5ef9e7[_0x35df99(0x162)]);}catch(_0x5e9cd5){const _0x326169=_0x5e9cd5 instanceof Error?_0x5e9cd5[_0x35df99(0x15d)]:String(_0x5e9cd5);return console['log'](a5_0x10e56c[_0x35df99(0x143)](_0x35df99(0x1ad)+_0x326169)),0x1;}console[_0x35df99(0x177)](a5_0x10e56c[_0x35df99(0x176)](_0x35df99(0x1a8))),console[_0x35df99(0x177)](_0x35df99(0x119)+a5_0x10e56c[_0x35df99(0x140)](_0x3b8982['timestamp'])),console['log'](_0x35df99(0x127)+a5_0x10e56c['white'](_0x3b8982[_0x35df99(0x161)][_0x35df99(0x174)]+'/'+_0x3b8982['agent'][_0x35df99(0x149)]));_0x5e0810['length']>0x0&&console[_0x35df99(0x177)]('New\x20tests\x20to\x20execute:\x20'+a5_0x10e56c[_0x35df99(0x18f)](_0x5e0810[_0x35df99(0x121)]));console[_0x35df99(0x177)]();const _0x164777=[],_0x34538b=Date['now'](),_0x20aed7=createCommandSpinner('Re-evaluating...');if(_0x3239f1[_0x35df99(0x121)]>0x0)try{const _0x4f4c17=await reevaluateFromCache(_0x4dbf99[_0x35df99(0x197)],_0x3b8982,{'tests':_0x3239f1},{'evaluatorId':_0x4ec66b,'onTestStart':(_0x713f53,_0x58942,_0x4a5a9c)=>{const _0x5d496c=_0x35df99;_0x20aed7[_0x5d496c(0x191)]='Re-evaluating\x20'+(_0x58942+0x1)+'/'+_0x4a5a9c+':\x20'+_0x713f53+_0x5d496c(0x123);if(!_0x20aed7[_0x5d496c(0x139)])_0x20aed7[_0x5d496c(0x12f)]();},'onTestComplete':(_0x2e2276,_0x3f6732)=>{const _0x429daa=_0x35df99;_0x20aed7[_0x429daa(0x130)]();if(_0x3f6732[_0x429daa(0x196)]==='PASS')console[_0x429daa(0x177)](a5_0x10e56c[_0x429daa(0x1a4)]('✓\x20PASS:\x20'+_0x2e2276)+a5_0x10e56c['dim']('\x20(cached)'));else _0x3f6732[_0x429daa(0x196)]==='FAIL'?console[_0x429daa(0x177)](a5_0x10e56c['red']('✗\x20FAIL:\x20'+_0x2e2276+'\x20-\x20'+_0x3f6732[_0x429daa(0x198)])+a5_0x10e56c[_0x429daa(0x126)](_0x429daa(0x142))):console[_0x429daa(0x177)](a5_0x10e56c['red'](_0x429daa(0x145)+_0x2e2276+_0x429daa(0x158)+_0x3f6732['reason']));_0x3f6732['conversation_url']&&console[_0x429daa(0x177)](a5_0x10e56c[_0x429daa(0x126)](_0x429daa(0x17a)+_0x3f6732['conversation_url'])),_0x164777[_0x429daa(0x182)](_0x3f6732);},'onTestSkipped':(_0x3a4115,_0x2662f9)=>{const _0x1ffcf8=_0x35df99;_0x20aed7['stop'](),console['log'](a5_0x10e56c[_0x1ffcf8(0x18f)](_0x1ffcf8(0x184)+_0x3a4115+_0x1ffcf8(0x158)+_0x2662f9));}});for(const _0x4edacc of _0x4f4c17){!_0x164777['find'](_0x1712d0=>_0x1712d0[_0x35df99(0x11d)]===_0x4edacc[_0x35df99(0x11d)])&&_0x164777['push'](_0x4edacc);}}catch(_0x8baecc){_0x20aed7['stop']();const _0xc9cd38=_0x8baecc instanceof Error?_0x8baecc['message']:String(_0x8baecc);return console[_0x35df99(0x177)](a5_0x10e56c[_0x35df99(0x143)](_0x35df99(0x1ae)+_0xc9cd38)),0x1;}_0x20aed7[_0x35df99(0x130)]();if(_0x5e0810['length']>0x0){console[_0x35df99(0x177)](),console[_0x35df99(0x177)](a5_0x10e56c[_0x35df99(0x176)](_0x35df99(0x12e)));const {projectId:_0x1f71be,agentId:_0x2d8d4e}=_0x3b8982[_0x35df99(0x161)];for(const _0x41ef5e of _0x5e0810){console[_0x35df99(0x177)](_0x35df99(0x151)+a5_0x10e56c[_0x35df99(0x140)](_0x41ef5e[_0x35df99(0x11d)]));const _0x502dd6=createCommandSpinner(_0x35df99(0x18a)+_0x41ef5e[_0x35df99(0x118)][_0x35df99(0x121)]+_0x35df99(0x170));_0x502dd6['start']();try{const {result:_0x116b9a}=await runTest(_0x4dbf99[_0x35df99(0x197)],_0x41ef5e,{'agentId':_0x2d8d4e,'projectId':_0x1f71be,'site':_0x3b8982[_0x35df99(0x18d)],'noEval':![],'evaluatorId':_0x4ec66b,'onRoundStart':(_0xf6eb1d,_0x4db231)=>{const _0x171744=_0x35df99;_0x502dd6['text']=_0x171744(0x1a2)+(_0xf6eb1d+0x1)+'/'+_0x4db231+_0x171744(0x170);},'onRoundComplete':(_0x29caff,_0x3a1da6,_0x35168b)=>{const _0x12a343=_0x35df99,_0x230290=formatElapsed(_0x3a1da6);_0x35168b?console[_0x12a343(0x177)]('\x20\x20Round\x20'+(_0x29caff+0x1)+'/'+_0x41ef5e['rounds'][_0x12a343(0x121)]+_0x12a343(0x15e)+a5_0x10e56c[_0x12a343(0x1a4)]('✓')+'\x20('+_0x230290+')'):console[_0x12a343(0x177)]('\x20\x20Round\x20'+(_0x29caff+0x1)+'/'+_0x41ef5e['rounds'][_0x12a343(0x121)]+'...\x20'+a5_0x10e56c[_0x12a343(0x143)]('✗'));},'onEvaluationStart':()=>{const _0x17d088=_0x35df99;_0x502dd6[_0x17d088(0x191)]=_0x17d088(0x16e);},'onEvaluationComplete':_0x240607=>{const _0x4d715f=_0x35df99,_0x3648b8=formatElapsed(_0x240607);console[_0x4d715f(0x177)](_0x4d715f(0x11f)+a5_0x10e56c[_0x4d715f(0x1a4)]('✓')+'\x20('+_0x3648b8+')');}});_0x502dd6['stop'](),_0x164777['push'](_0x116b9a);if(_0x116b9a['status']===_0x35df99(0x131))console['log'](a5_0x10e56c['green'](_0x35df99(0x124)+_0x116b9a[_0x35df99(0x198)])+a5_0x10e56c[_0x35df99(0x126)]('\x20(new)'));else _0x116b9a[_0x35df99(0x196)]==='FAIL'?console[_0x35df99(0x177)](a5_0x10e56c[_0x35df99(0x143)](_0x35df99(0x134)+_0x116b9a[_0x35df99(0x198)])+a5_0x10e56c['dim']('\x20(new)')):console[_0x35df99(0x177)](a5_0x10e56c[_0x35df99(0x143)](_0x35df99(0x145)+_0x116b9a['reason']));_0x116b9a[_0x35df99(0x172)]&&console[_0x35df99(0x177)](a5_0x10e56c[_0x35df99(0x126)]('\x20\x20Conversation:\x20'+_0x116b9a[_0x35df99(0x172)]));}catch(_0x4ba899){_0x502dd6[_0x35df99(0x130)]();const _0x5344ad=_0x4ba899 instanceof Error?_0x4ba899[_0x35df99(0x15d)]:String(_0x4ba899);console['log'](a5_0x10e56c[_0x35df99(0x143)](_0x35df99(0x145)+_0x5344ad)),_0x164777[_0x35df99(0x182)]({'name':_0x41ef5e[_0x35df99(0x11d)],'status':'ERROR','reason':_0x5344ad,'timestamp':new Date()[_0x35df99(0x190)](),'duration_ms':0x0});}}}console['log']();const _0xdad340=Date['now']()-_0x34538b,_0x574eae=_0x164777[_0x35df99(0x12b)](_0x3a1f3d=>_0x3a1f3d[_0x35df99(0x196)]===_0x35df99(0x131))[_0x35df99(0x121)],_0x111db3=_0x164777[_0x35df99(0x12b)](_0x136743=>_0x136743[_0x35df99(0x196)]===_0x35df99(0x16a))[_0x35df99(0x121)],_0x3057e8=_0x164777['filter'](_0x1ced14=>_0x1ced14[_0x35df99(0x196)]===_0x35df99(0x1ac))[_0x35df99(0x121)];console[_0x35df99(0x177)]('━'[_0x35df99(0x19d)](0x3c)),console['log'](_0x35df99(0x194)),console[_0x35df99(0x177)]('━'[_0x35df99(0x19d)](0x3c)),console['log'](_0x35df99(0x144)+_0x164777['length']),console['log']('Passed:\x20\x20\x20'+a5_0x10e56c[_0x35df99(0x1a4)](_0x574eae)),console[_0x35df99(0x177)](_0x35df99(0x195)+a5_0x10e56c[_0x35df99(0x143)](_0x111db3));_0x3057e8>0x0&&console[_0x35df99(0x177)](_0x35df99(0x192)+a5_0x10e56c[_0x35df99(0x143)](_0x3057e8));console[_0x35df99(0x177)](_0x35df99(0x1a0)+formatElapsed(_0xdad340)),console[_0x35df99(0x177)]('━'['repeat'](0x3c));const _0x1f4418={'summary':{'total':_0x164777['length'],'passed':_0x574eae,'failed':_0x111db3,'errors':_0x3057e8>0x0?_0x3057e8:undefined,'duration_ms':_0xdad340},'tests':_0x164777,'agent':{'project':_0x262034['projectName'],'name':_0x262034[_0x35df99(0x149)],'site':_0x215e18},'timestamp':new Date(_0x34538b)[_0x35df99(0x190)]()};if(_0x4a1544!==_0x35df99(0x11b)||_0x25390e){const _0xb056db=formatResults(_0x1f4418,_0x4a1544);if(_0x25390e)try{a5_0x343e4e['writeFileSync'](_0x25390e,_0xb056db,_0x35df99(0x181)),console[_0x35df99(0x177)](),console['log'](a5_0x10e56c[_0x35df99(0x126)](_0x35df99(0x17f)+_0x25390e));}catch(_0x3c0440){return console[_0x35df99(0x177)](),console['log'](a5_0x10e56c[_0x35df99(0x143)](_0x35df99(0x12a)+_0x3c0440)),0x1;}else console[_0x35df99(0x177)](),console[_0x35df99(0x177)](_0xb056db);}const _0xc6b5be=_0x164777[_0x35df99(0x12b)](_0x50c049=>_0x50c049[_0x35df99(0x196)]!==_0x35df99(0x131));return _0xc6b5be[_0x35df99(0x121)]>0x0?0x1:0x0;}}
@@ -1 +1 @@
1
- const a6_0x21e70f=a6_0x455a;(function(_0x24fe42,_0x2401e8){const _0x3be248=a6_0x455a,_0x39cf92=_0x24fe42();while(!![]){try{const _0x5dce3c=parseInt(_0x3be248(0xf9))/0x1+-parseInt(_0x3be248(0xcf))/0x2*(parseInt(_0x3be248(0xe0))/0x3)+parseInt(_0x3be248(0xe6))/0x4+-parseInt(_0x3be248(0xe1))/0x5*(-parseInt(_0x3be248(0xee))/0x6)+parseInt(_0x3be248(0xc9))/0x7*(-parseInt(_0x3be248(0xf4))/0x8)+parseInt(_0x3be248(0xd2))/0x9*(-parseInt(_0x3be248(0x108))/0xa)+-parseInt(_0x3be248(0xf2))/0xb*(-parseInt(_0x3be248(0xd8))/0xc);if(_0x5dce3c===_0x2401e8)break;else _0x39cf92['push'](_0x39cf92['shift']());}catch(_0x4a9646){_0x39cf92['push'](_0x39cf92['shift']());}}}(a6_0x284a,0x771f3));function a6_0x284a(){const _0x47f0db=['entries','536223CzaDDv','indexOf','length','Results\x20saved\x20to\x20','startsWith','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','<\x20HTTP/1.1\x20','substring','output','.\x20Valid\x20types:\x20','POST','toUpperCase','Error:\x20','status','noColor','147430JYTyiZ','workflow','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','x-xsrf-token','log','x-trino-user','type','Invalid\x20API\x20type:\x20','1082844BzQOfu','name','message','trino','join','\x0aStack\x20trace:\x0a','401668oqCVHV','has','set-cookie2','171gfAinw','PUT','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','PATCH','stack','method','2115732YClOAj','data','error','validate','cdp','proxy-authorization','api','request','6WHvqni','24205IVWbBv','trim','x-auth-token','toLowerCase','GET','1498628IZdQCW','headers','keys','includes','.\x20Valid\x20methods:\x20','isArray','DELETE','header','294JFCTas','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','file','description','11UrQmPf','color','8ZAzQiY','verbose','body','Endpoint\x20must\x20start\x20with\x20/:\x20'];a6_0x284a=function(){return _0x47f0db;};return a6_0x284a();}import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';function a6_0x455a(_0xfc51a4,_0x20d64b){_0xfc51a4=_0xfc51a4-0xc9;const _0x284ac5=a6_0x284a();let _0x455aa7=_0x284ac5[_0xfc51a4];return _0x455aa7;}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_0x21e70f(0xdd),'cookie','set-cookie',a6_0x21e70f(0xd1),a6_0x21e70f(0x10b),a6_0x21e70f(0xe3),a6_0x21e70f(0x10d)]);function isSensitiveHeader(_0x45a05d){const _0x43d468=a6_0x21e70f;return SENSITIVE_HEADERS[_0x43d468(0xd0)](_0x45a05d[_0x43d468(0xe4)]());}function parseHeader(_0x5cdd15){const _0xefe508=a6_0x21e70f,_0x34409f=_0x5cdd15[_0xefe508(0xfa)](':');if(_0x34409f===-0x1)throw new Error('Invalid\x20header\x20format:\x20\x22'+_0x5cdd15+'\x22.\x20'+_0xefe508(0xfe));const _0x57dbbe=_0x5cdd15[_0xefe508(0x100)](0x0,_0x34409f)[_0xefe508(0xe2)](),_0x5a6948=_0x5cdd15[_0xefe508(0x100)](_0x34409f+0x1)['trim']();if(!_0x57dbbe)throw new Error(_0xefe508(0x10a)+_0x5cdd15+'\x22');return[_0x57dbbe,_0x5a6948];}export class ApiCommand extends BaseCommand{[a6_0x21e70f(0xca)]=a6_0x21e70f(0xde);[a6_0x21e70f(0xf1)]=a6_0x21e70f(0xef);[a6_0x21e70f(0xdb)](_0x100c40){const _0x405f77=a6_0x21e70f,{args:_0xaeab9f,options:_0x304b51}=_0x100c40,_0x8a8417=_0x304b51;if(_0xaeab9f[_0x405f77(0xfb)]===0x0)return _0x405f77(0xd4);const _0x40b44e=_0xaeab9f[0x0];if(!_0x40b44e[_0x405f77(0xfd)]('/'))return _0x405f77(0xf7)+_0x40b44e;const _0x1ca063=_0x8a8417[_0x405f77(0xd9)],_0x3310f7=_0x8a8417[_0x405f77(0xf0)];if(_0x1ca063&&_0x3310f7)return'Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.';const _0x23c778=_0x8a8417[_0x405f77(0xd7)]||_0x405f77(0xe5),_0x29c5dc=['GET',_0x405f77(0x103),_0x405f77(0xd3),_0x405f77(0xec),_0x405f77(0xd5)];if(!_0x29c5dc['includes'](_0x23c778['toUpperCase']()))return'Invalid\x20HTTP\x20method:\x20'+_0x23c778+_0x405f77(0xea)+_0x29c5dc[_0x405f77(0xcd)](',\x20');const _0x23071a=_0x8a8417[_0x405f77(0x10e)]||'td',_0x49fcd2=['td',_0x405f77(0xdc),_0x405f77(0x109),_0x405f77(0xcc),'llm','llm-proxy'];if(!_0x49fcd2[_0x405f77(0xe9)](_0x23071a))return _0x405f77(0x10f)+_0x23071a+_0x405f77(0x102)+_0x49fcd2[_0x405f77(0xcd)](',\x20');return undefined;}async['execute'](_0x15ba30){const _0x303880=a6_0x21e70f,{options:_0x80c6aa,args:_0x2a4346,tdx:_0x355475}=_0x15ba30,_0x3a4076=_0x80c6aa,_0x5566e6=_0x2a4346[0x0],_0x36e648=(_0x3a4076[_0x303880(0xd7)]||'GET')[_0x303880(0x104)](),_0x30f9c4=_0x3a4076[_0x303880(0xd9)],_0x47f4a6=_0x3a4076[_0x303880(0xf0)],_0x31b3ef=_0x3a4076[_0x303880(0xed)],_0x4d65a1=_0x3a4076[_0x303880(0x10e)]||'td';try{const _0x589d5e={};if(_0x31b3ef){const _0x5cef41=Array[_0x303880(0xeb)](_0x31b3ef)?_0x31b3ef:[_0x31b3ef];for(const _0x174330 of _0x5cef41){const [_0x362cce,_0x2eef1a]=parseHeader(_0x174330);_0x589d5e[_0x362cce]=_0x2eef1a;}}let _0x2488d2;if(_0x30f9c4)_0x2488d2=_0x30f9c4;else{if(_0x47f4a6)try{_0x2488d2=RawAPI['readBodyFromFile'](_0x47f4a6);}catch(_0x47b079){return console[_0x303880(0xda)]('Error:\x20'+(_0x47b079 instanceof Error?_0x47b079[_0x303880(0xcb)]:String(_0x47b079))),0x1;}}const _0x552ac4={'method':_0x36e648,'apiType':_0x4d65a1,'includeHeaders':_0x80c6aa[_0x303880(0xf5)]};_0x2488d2&&(_0x552ac4[_0x303880(0xf6)]=_0x2488d2);Object[_0x303880(0xe8)](_0x589d5e)['length']>0x0&&(_0x552ac4[_0x303880(0xe7)]=_0x589d5e);if(_0x80c6aa[_0x303880(0xf5)]){const _0x1b47c2=resolveSite(_0x80c6aa['site']),_0x3433b8=getEndpoint(_0x1b47c2,_0x4d65a1),_0xf71086=''+_0x3433b8+_0x5566e6;console[_0x303880(0xda)]('>\x20'+_0x36e648+'\x20'+_0xf71086);const _0x3a8bb3=getAuthHeaders(_0x1b47c2),_0x166b33={..._0x3a8bb3,..._0x589d5e};for(const [_0xfe625d,_0x3ae4b8]of Object['entries'](_0x166b33)){!isSensitiveHeader(_0xfe625d)&&console['error']('>\x20'+_0xfe625d+':\x20'+_0x3ae4b8);}_0x2488d2&&console[_0x303880(0xda)]('>'),console[_0x303880(0xda)]('');}const _0x5a6e37=await _0x355475[_0x303880(0xde)][_0x303880(0xdf)](_0x5566e6,_0x552ac4);if(_0x80c6aa[_0x303880(0xf5)]&&_0x5a6e37[_0x303880(0xe7)]){console[_0x303880(0xda)](_0x303880(0xff)+_0x5a6e37[_0x303880(0x106)]);for(const [_0x4ed808,_0x1549d3]of Object[_0x303880(0xf8)](_0x5a6e37[_0x303880(0xe7)])){!isSensitiveHeader(_0x4ed808)&&console['error']('<\x20'+_0x4ed808+':\x20'+_0x1549d3);}console[_0x303880(0xda)]('');}const _0x41322b=Boolean(_0x80c6aa[_0x303880(0x101)]),_0x3ee732={'color':_0x80c6aa[_0x303880(0xf3)],'noColor':_0x80c6aa[_0x303880(0x107)]||_0x41322b&&!_0x80c6aa[_0x303880(0xf3)]},_0x2edcfe=colorizeJSON(_0x5a6e37[_0x303880(0xd9)],_0x3ee732);return _0x80c6aa[_0x303880(0x101)]?(writeFileSync(_0x80c6aa[_0x303880(0x101)],_0x2edcfe),console[_0x303880(0xda)](_0x303880(0xfc)+_0x80c6aa[_0x303880(0x101)])):console[_0x303880(0x10c)](_0x2edcfe),0x0;}catch(_0x34af10){return _0x34af10 instanceof Error?(console['error'](_0x303880(0x105)+_0x34af10[_0x303880(0xcb)]),_0x80c6aa[_0x303880(0xf5)]&&_0x34af10[_0x303880(0xd6)]&&console[_0x303880(0xda)](_0x303880(0xce)+_0x34af10[_0x303880(0xd6)])):console['error'](_0x303880(0x105)+String(_0x34af10)),0x1;}}}
1
+ const a6_0x43006d=a6_0x57d9;(function(_0x54a553,_0x310236){const _0x23998c=a6_0x57d9,_0x725e3=_0x54a553();while(!![]){try{const _0x5a33f4=-parseInt(_0x23998c(0xe0))/0x1+parseInt(_0x23998c(0xc6))/0x2+-parseInt(_0x23998c(0xab))/0x3+parseInt(_0x23998c(0xad))/0x4+parseInt(_0x23998c(0xdc))/0x5*(parseInt(_0x23998c(0xc5))/0x6)+parseInt(_0x23998c(0xa7))/0x7*(parseInt(_0x23998c(0xb8))/0x8)+parseInt(_0x23998c(0xcd))/0x9*(-parseInt(_0x23998c(0xbe))/0xa);if(_0x5a33f4===_0x310236)break;else _0x725e3['push'](_0x725e3['shift']());}catch(_0x21e3b3){_0x725e3['push'](_0x725e3['shift']());}}}(a6_0x3a04,0x93529));function a6_0x3a04(){const _0x396c52=['length','headers','9rQtiJM','trino','x-trino-user','message','startsWith','data','api','error','keys','join','entries','workflow','execute','\x0aStack\x20trace:\x0a','stack','305OsxMvL','method','toLowerCase','Invalid\x20HTTP\x20method:\x20','489900KmprHb','PATCH','log','site','7KIIfvg','proxy-authorization','x-xsrf-token','trim','887964tlFwRm','.\x20Valid\x20methods:\x20','3690048rINfod','type','file','Invalid\x20API\x20type:\x20','\x22.\x20','set-cookie2','GET','validate','DELETE','noColor','Results\x20saved\x20to\x20','3903032KVrvHi','output','description','indexOf','Endpoint\x20must\x20start\x20with\x20/:\x20','substring','10128230siroif','POST','verbose','cookie','includes','Error:\x20','request','5076ccvkrE','1880294rubTvD','color','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','cdp','PUT'];a6_0x3a04=function(){return _0x396c52;};return a6_0x3a04();}function a6_0x57d9(_0x3f1256,_0x7e5aac){_0x3f1256=_0x3f1256-0xa6;const _0x3a04f5=a6_0x3a04();let _0x57d9f5=_0x3a04f5[_0x3f1256];return _0x57d9f5;}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_0x43006d(0xa8),a6_0x43006d(0xc1),'set-cookie',a6_0x43006d(0xb2),a6_0x43006d(0xa9),'x-auth-token',a6_0x43006d(0xcf)]);function isSensitiveHeader(_0x4f833e){const _0x1aa2a9=a6_0x43006d;return SENSITIVE_HEADERS['has'](_0x4f833e[_0x1aa2a9(0xde)]());}function parseHeader(_0x532af5){const _0x3c9b8a=a6_0x43006d,_0x56f02a=_0x532af5[_0x3c9b8a(0xbb)](':');if(_0x56f02a===-0x1)throw new Error('Invalid\x20header\x20format:\x20\x22'+_0x532af5+_0x3c9b8a(0xb1)+'Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22');const _0x34898e=_0x532af5[_0x3c9b8a(0xbd)](0x0,_0x56f02a)[_0x3c9b8a(0xaa)](),_0x34463d=_0x532af5[_0x3c9b8a(0xbd)](_0x56f02a+0x1)[_0x3c9b8a(0xaa)]();if(!_0x34898e)throw new Error('Header\x20key\x20cannot\x20be\x20empty:\x20\x22'+_0x532af5+'\x22');return[_0x34898e,_0x34463d];}export class ApiCommand extends BaseCommand{['name']=a6_0x43006d(0xd3);[a6_0x43006d(0xba)]='Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs';[a6_0x43006d(0xb4)](_0x784c58){const _0x599e15=a6_0x43006d,{args:_0xc1122f,options:_0x3f0a8d}=_0x784c58,_0x1bb30a=_0x3f0a8d;if(_0xc1122f[_0x599e15(0xcb)]===0x0)return'Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list';const _0x4f86ea=_0xc1122f[0x0];if(!_0x4f86ea[_0x599e15(0xd1)]('/'))return _0x599e15(0xbc)+_0x4f86ea;const _0x2e4b9e=_0x1bb30a[_0x599e15(0xd2)],_0x336526=_0x1bb30a[_0x599e15(0xaf)];if(_0x2e4b9e&&_0x336526)return _0x599e15(0xc8);const _0x29f3ea=_0x1bb30a[_0x599e15(0xdd)]||_0x599e15(0xb3),_0x5acb7f=[_0x599e15(0xb3),_0x599e15(0xbf),_0x599e15(0xca),_0x599e15(0xb5),_0x599e15(0xe1)];if(!_0x5acb7f[_0x599e15(0xc2)](_0x29f3ea['toUpperCase']()))return _0x599e15(0xdf)+_0x29f3ea+_0x599e15(0xac)+_0x5acb7f[_0x599e15(0xd6)](',\x20');const _0x41c479=_0x1bb30a['type']||'td',_0x2af872=['td',_0x599e15(0xc9),_0x599e15(0xd8),_0x599e15(0xce),'llm','llm-proxy'];if(!_0x2af872[_0x599e15(0xc2)](_0x41c479))return _0x599e15(0xb0)+_0x41c479+'.\x20Valid\x20types:\x20'+_0x2af872[_0x599e15(0xd6)](',\x20');return undefined;}async[a6_0x43006d(0xd9)](_0x34f976){const _0x368c42=a6_0x43006d,{options:_0x4f12dc,args:_0x108600,tdx:_0x2ad945}=_0x34f976,_0x247952=_0x4f12dc,_0x1b2f8e=_0x108600[0x0],_0x2c69ca=(_0x247952[_0x368c42(0xdd)]||'GET')['toUpperCase'](),_0x3e364e=_0x247952[_0x368c42(0xd2)],_0x33baea=_0x247952[_0x368c42(0xaf)],_0x209c8f=_0x247952['header'],_0x22723b=_0x247952[_0x368c42(0xae)]||'td';try{const _0x5e88f2={};if(_0x209c8f){const _0x302e0c=Array['isArray'](_0x209c8f)?_0x209c8f:[_0x209c8f];for(const _0x432826 of _0x302e0c){const [_0x31caf3,_0x3cf0d6]=parseHeader(_0x432826);_0x5e88f2[_0x31caf3]=_0x3cf0d6;}}let _0x14554e;if(_0x3e364e)_0x14554e=_0x3e364e;else{if(_0x33baea)try{_0x14554e=RawAPI['readBodyFromFile'](_0x33baea);}catch(_0x186eb9){return console[_0x368c42(0xd4)](_0x368c42(0xc3)+(_0x186eb9 instanceof Error?_0x186eb9[_0x368c42(0xd0)]:String(_0x186eb9))),0x1;}}const _0x1b1e31={'method':_0x2c69ca,'apiType':_0x22723b,'includeHeaders':_0x4f12dc[_0x368c42(0xc0)]};_0x14554e&&(_0x1b1e31['body']=_0x14554e);Object[_0x368c42(0xd5)](_0x5e88f2)[_0x368c42(0xcb)]>0x0&&(_0x1b1e31[_0x368c42(0xcc)]=_0x5e88f2);if(_0x4f12dc[_0x368c42(0xc0)]){const _0x5556df=resolveSite(_0x4f12dc[_0x368c42(0xa6)]),_0x2b88a5=getEndpoint(_0x5556df,_0x22723b),_0x2ef6ed=''+_0x2b88a5+_0x1b2f8e;console[_0x368c42(0xd4)]('>\x20'+_0x2c69ca+'\x20'+_0x2ef6ed);const _0x1cf0aa=getAuthHeaders(_0x5556df),_0x106f64={..._0x1cf0aa,..._0x5e88f2};for(const [_0x5f30de,_0x5f591e]of Object[_0x368c42(0xd7)](_0x106f64)){!isSensitiveHeader(_0x5f30de)&&console['error']('>\x20'+_0x5f30de+':\x20'+_0x5f591e);}_0x14554e&&console[_0x368c42(0xd4)]('>'),console['error']('');}const _0x550799=await _0x2ad945[_0x368c42(0xd3)][_0x368c42(0xc4)](_0x1b2f8e,_0x1b1e31);if(_0x4f12dc[_0x368c42(0xc0)]&&_0x550799['headers']){console[_0x368c42(0xd4)]('<\x20HTTP/1.1\x20'+_0x550799['status']);for(const [_0x299737,_0xadf409]of Object[_0x368c42(0xd7)](_0x550799[_0x368c42(0xcc)])){!isSensitiveHeader(_0x299737)&&console[_0x368c42(0xd4)]('<\x20'+_0x299737+':\x20'+_0xadf409);}console[_0x368c42(0xd4)]('');}const _0xc93f46=Boolean(_0x4f12dc['output']),_0x3f0d3f={'color':_0x4f12dc[_0x368c42(0xc7)],'noColor':_0x4f12dc[_0x368c42(0xb6)]||_0xc93f46&&!_0x4f12dc[_0x368c42(0xc7)]},_0x451252=colorizeJSON(_0x550799[_0x368c42(0xd2)],_0x3f0d3f);return _0x4f12dc['output']?(writeFileSync(_0x4f12dc[_0x368c42(0xb9)],_0x451252),console[_0x368c42(0xd4)](_0x368c42(0xb7)+_0x4f12dc[_0x368c42(0xb9)])):console[_0x368c42(0xe2)](_0x451252),0x0;}catch(_0x4a6ab7){return _0x4a6ab7 instanceof Error?(console[_0x368c42(0xd4)]('Error:\x20'+_0x4a6ab7['message']),_0x4f12dc['verbose']&&_0x4a6ab7[_0x368c42(0xdb)]&&console[_0x368c42(0xd4)](_0x368c42(0xda)+_0x4a6ab7[_0x368c42(0xdb)])):console[_0x368c42(0xd4)](_0x368c42(0xc3)+String(_0x4a6ab7)),0x1;}}}
@@ -1 +1 @@
1
- const a7_0x3de70e=a7_0x20be;(function(_0x5275ab,_0x45fd9a){const _0x45f509=a7_0x20be,_0x223f87=_0x5275ab();while(!![]){try{const _0x233737=parseInt(_0x45f509(0x7c))/0x1*(parseInt(_0x45f509(0x82))/0x2)+parseInt(_0x45f509(0x6d))/0x3*(-parseInt(_0x45f509(0x79))/0x4)+parseInt(_0x45f509(0x74))/0x5+parseInt(_0x45f509(0xb1))/0x6*(-parseInt(_0x45f509(0x8e))/0x7)+parseInt(_0x45f509(0x9c))/0x8*(parseInt(_0x45f509(0xa6))/0x9)+-parseInt(_0x45f509(0x99))/0xa+parseInt(_0x45f509(0xab))/0xb;if(_0x233737===_0x45fd9a)break;else _0x223f87['push'](_0x223f87['shift']());}catch(_0x3ac8fa){_0x223f87['push'](_0x223f87['shift']());}}}(a7_0x253b,0x78c17));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';function a7_0x253b(){const _0x365787=['No\x20credential\x20found','87kFFCxa','jobs','Site\x20name\x20cannot\x20be\x20empty','\x20(site:\x20','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','first_name','17286WxCnEY','apiKey','filter','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','auth:setup','select','Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20','text','status','bold','Setup\x20API\x20key\x20authentication\x20interactively','\x20--profile\x20','3907421yUMoeg','description','yellow','profile','site','ERROR','us01','warn','\x0aSetup\x20cancelled','You\x20can\x20find\x20your\x20API\x20key\x20at:','✓\x20Default\x20site\x20set\x20to\x20','9538190kvEWoz','red','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','88PVZflk','customSite','\x20(profile:\x20','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','test','API\x20key\x20cannot\x20be\x20empty','\x20\x20tdx','trim','name','User:\x20','15399ZhncfQ','Read\x20credential\x20from\x20','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','✓\x20API\x20key\x20removed\x20from\x20keychain','getUserInfo','19923453FFAvCO','Remove\x20API\x20key\x20from\x20system\x20keychain','other','create','Enter\x20your\x20TD\x20API\x20key:','execute','6Akcqjo','\x27\x20registered','Enter\x20site\x20name:','Name:\x20','email','✓\x20Authentication\x20successful\x0a','auth','18567LXAiNd','auth:clear','log','error','tdx:\x20auth\x20setup','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','tdx\x20profile:\x20','434375NqUaAT','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','logLevel','green','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','428ZAGsOP','tdx:\x20auth\x20clear'];a7_0x253b=function(){return _0x365787;};return a7_0x253b();}import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';import{buildSiteChoices}from'../core/constants.js';import a7_0x18e794 from'prompts';import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';function a7_0x20be(_0x38d2b7,_0x56bbe5){_0x38d2b7=_0x38d2b7-0x67;const _0x253bb=a7_0x253b();let _0x20be02=_0x253bb[_0x38d2b7];return _0x20be02;}import{LogLevel}from'../utils/tdx-logger.js';import a7_0x5e3ec3 from'chalk';export class AuthSetupCommand extends BaseCommand{['name']=a7_0x3de70e(0x86);[a7_0x3de70e(0x8f)]=a7_0x3de70e(0x8c);async[a7_0x3de70e(0xb0)](_0x5eca99){const _0x1f3404=a7_0x3de70e,{options:_0x19e546}=_0x5eca99,_0x2602e=_0x19e546['profile'];console[_0x1f3404(0x6f)](a7_0x5e3ec3[_0x1f3404(0x8b)](_0x1f3404(0x71)));const _0x47c838=_0x19e546[_0x1f3404(0x92)]||'us01',{choices:_0x13ae64,initialIndex:_0x596da5}=buildSiteChoices(_0x47c838),_0x2deb09=_0x2602e?_0x1f3404(0x88)+_0x2602e+'):':'Select\x20your\x20Treasure\x20Data\x20site:',_0x36cdc0=await a7_0x18e794({'type':_0x1f3404(0x87),'name':_0x1f3404(0x92),'message':_0x2deb09,'choices':_0x13ae64,'initial':_0x596da5});if(!_0x36cdc0[_0x1f3404(0x92)])return console['log'](_0x1f3404(0x96)),0x1;let _0x1b80ac;if(_0x36cdc0['site']===_0x1f3404(0xad)){const _0xc0a390=await a7_0x18e794({'type':_0x1f3404(0x89),'name':'customSite','message':_0x1f3404(0x68),'initial':_0x1f3404(0x94),'validate':_0x247c12=>{const _0x19c113=_0x1f3404;if(!_0x247c12||!_0x247c12[_0x19c113(0xa3)]())return _0x19c113(0x7e);if(!/^[a-z0-9-]+$/[_0x19c113(0xa0)](_0x247c12[_0x19c113(0xa3)]()))return _0x19c113(0x9f);return!![];}});if(!_0xc0a390[_0x1f3404(0x9d)])return console[_0x1f3404(0x6f)](_0x1f3404(0x96)),0x1;_0x1b80ac=_0xc0a390[_0x1f3404(0x9d)];}else _0x1b80ac=_0x36cdc0[_0x1f3404(0x92)];const _0x20f196=resolveSite(_0x1b80ac);console['log']('Setting\x20up\x20authentication\x20for\x20site:\x20'+_0x20f196),console[_0x1f3404(0x6f)](_0x1f3404(0x97)),console[_0x1f3404(0x6f)]('\x20\x20'+getConsoleUrl(_0x20f196,'/app/mp/ak'));const _0x3c1483=await a7_0x18e794({'type':'password','name':_0x1f3404(0x83),'message':_0x1f3404(0xaf),'validate':_0x5886ad=>{const _0x2f3598=_0x1f3404;if(!_0x5886ad||!_0x5886ad[_0x2f3598(0xa3)]())return _0x2f3598(0xa1);return!![];}});if(!_0x3c1483[_0x1f3404(0x83)])return console[_0x1f3404(0x6f)](_0x1f3404(0x96)),0x1;const _0x41abd5=_0x3c1483['apiKey'];console[_0x1f3404(0x6f)]('Validating\x20API\x20key...');try{const _0x33ba12=TDX[_0x1f3404(0xae)]({'site':_0x20f196,'apiKey':_0x41abd5[_0x1f3404(0xa3)](),'logLevel':_0x19e546[_0x1f3404(0x76)]??LogLevel[_0x1f3404(0x93)]}),_0x1a23ec=await _0x33ba12[_0x1f3404(0x7d)][_0x1f3404(0xaa)]();console[_0x1f3404(0x6f)](_0x1f3404(0x85)+_0x1a23ec[_0x1f3404(0x6a)]+')');const _0x1a8676=await isKeychainAvailable();_0x1a8676?(await saveAPIKeyAsync(_0x41abd5[_0x1f3404(0xa3)](),_0x20f196,_0x2602e),console[_0x1f3404(0x6f)]('✓\x20API\x20key\x20saved\x20to\x20system\x20keychain'+(_0x2602e?_0x1f3404(0x9e)+_0x2602e+')':''))):(console[_0x1f3404(0x95)](a7_0x5e3ec3[_0x1f3404(0x90)](_0x1f3404(0x80))),console[_0x1f3404(0x95)](a7_0x5e3ec3[_0x1f3404(0x90)](_0x1f3404(0xa8))));if(_0x2602e){const _0x3c8771={'site':_0x20f196};saveProfileToUserConfig(_0x2602e,_0x3c8771),console[_0x1f3404(0x6f)]('✓\x20Profile\x20\x27'+_0x2602e+_0x1f3404(0x67));}else saveDefaultSiteToUserConfig(_0x20f196),console[_0x1f3404(0x6f)](_0x1f3404(0x98)+_0x20f196);const _0x3194d4=_0x2602e?_0x1f3404(0x8d)+_0x2602e:'';return console[_0x1f3404(0x6f)](),console[_0x1f3404(0x6f)](_0x1f3404(0x72)),console[_0x1f3404(0x6f)]('\x20\x20tdx'+_0x3194d4+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console['log'](_0x1f3404(0xa2)+_0x3194d4+_0x1f3404(0x75)),0x0;}catch(_0x270ceb){if(_0x270ceb instanceof HTTPClientError&&_0x270ceb['status']===0x191)return printAuthError(_0x270ceb),0x1;return console[_0x1f3404(0x70)](a7_0x5e3ec3[_0x1f3404(0x9a)]('✗\x20Validation\x20failed:\x20'+(_0x270ceb instanceof Error?_0x270ceb['message']:String(_0x270ceb)))),console['error'](_0x1f3404(0x9b)),0x1;}}}export class AuthStatusCommand extends BaseCommand{['name']=a7_0x3de70e(0x6c);[a7_0x3de70e(0x8f)]=a7_0x3de70e(0x78);async['execute'](_0x371c48){const _0x2972ff=a7_0x3de70e,{options:_0xd02b4f,tdx:_0x393abe}=_0x371c48,_0x4bc856=_0xd02b4f[_0x2972ff(0x92)],_0x1c7ba1=_0xd02b4f[_0x2972ff(0x91)],_0x173248=_0x1c7ba1?_0x1c7ba1:'N/A';console[_0x2972ff(0x6f)](_0x2972ff(0x73)+_0x173248+_0x2972ff(0x7f)+_0x4bc856+')');const _0x4127fc=await resolveAPIKeyAsync(_0x4bc856,_0x1c7ba1);if(_0x4127fc){const {source:_0x2d95cd,isDeprecated:_0x1a133f}=_0x4127fc,_0x56aebd=_0x2972ff(0xa7)+_0x2d95cd;console[_0x2972ff(0x6f)](_0x1a133f?a7_0x5e3ec3[_0x2972ff(0x90)](_0x56aebd):_0x56aebd);}else console[_0x2972ff(0x6f)](a7_0x5e3ec3[_0x2972ff(0x90)](_0x2972ff(0x7b)));try{const _0x721764=await _0x393abe['jobs'][_0x2972ff(0xaa)]();return console['log'](a7_0x5e3ec3[_0x2972ff(0x77)](_0x2972ff(0x6b))),console[_0x2972ff(0x6f)](_0x2972ff(0xa5)+_0x721764[_0x2972ff(0x6a)]),(_0x721764[_0x2972ff(0x81)]||_0x721764['last_name'])&&console[_0x2972ff(0x6f)](_0x2972ff(0x69)+[_0x721764['first_name'],_0x721764['last_name']][_0x2972ff(0x84)](Boolean)['join']('\x20')),0x0;}catch(_0x10a009){return _0x10a009 instanceof HTTPClientError&&_0x10a009[_0x2972ff(0x8a)]===0x191?printAuthError(_0x10a009,!![],_0x1c7ba1):console[_0x2972ff(0x70)](a7_0x5e3ec3[_0x2972ff(0x9a)]('✗\x20Validation\x20failed:\x20'+(_0x10a009 instanceof Error?_0x10a009['message']:String(_0x10a009)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x3de70e(0xa4)]=a7_0x3de70e(0x6e);[a7_0x3de70e(0x8f)]=a7_0x3de70e(0xac);async['execute'](_0x152494){const _0x1b5b48=a7_0x3de70e,{options:_0xefc814}=_0x152494,_0x546b31=_0xefc814['profile'];console[_0x1b5b48(0x6f)](a7_0x5e3ec3[_0x1b5b48(0x8b)](_0x1b5b48(0x7a)));const _0x6e394c=await isKeychainAvailable();if(!_0x6e394c)return console['error'](a7_0x5e3ec3[_0x1b5b48(0x9a)]('System\x20keychain\x20is\x20not\x20available')),0x1;const _0x39c529=await deleteKeychainAPIKey(_0x546b31);return _0x39c529?(clearCredentialCache(),console[_0x1b5b48(0x6f)](_0x1b5b48(0xa9)+(_0x546b31?_0x1b5b48(0x9e)+_0x546b31+')':'')),0x0):(console['log']('No\x20API\x20key\x20found\x20in\x20keychain'+(_0x546b31?'\x20for\x20profile:\x20'+_0x546b31:'')),0x1);}}
1
+ function a7_0x2a22(_0x5b3e21,_0x4321b8){_0x5b3e21=_0x5b3e21-0xde;const _0x48dcfe=a7_0x48dc();let _0x2a2209=_0x48dcfe[_0x5b3e21];return _0x2a2209;}const a7_0x24cefe=a7_0x2a22;(function(_0x430510,_0xe3cb72){const _0x41635e=a7_0x2a22,_0x53e066=_0x430510();while(!![]){try{const _0x39dc80=parseInt(_0x41635e(0x122))/0x1+-parseInt(_0x41635e(0xe7))/0x2*(-parseInt(_0x41635e(0x109))/0x3)+parseInt(_0x41635e(0x11f))/0x4+parseInt(_0x41635e(0x11c))/0x5*(parseInt(_0x41635e(0xe5))/0x6)+parseInt(_0x41635e(0xe1))/0x7*(-parseInt(_0x41635e(0x124))/0x8)+-parseInt(_0x41635e(0x11b))/0x9*(-parseInt(_0x41635e(0xf4))/0xa)+-parseInt(_0x41635e(0xde))/0xb;if(_0x39dc80===_0xe3cb72)break;else _0x53e066['push'](_0x53e066['shift']());}catch(_0x4e7cc1){_0x53e066['push'](_0x53e066['shift']());}}}(a7_0x48dc,0x70963));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';import{buildSiteChoices}from'../core/constants.js';import a7_0x1048f9 from'prompts';import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a7_0xeef820 from'chalk';export class AuthSetupCommand extends BaseCommand{[a7_0x24cefe(0xef)]='auth:setup';[a7_0x24cefe(0xee)]='Setup\x20API\x20key\x20authentication\x20interactively';async['execute'](_0x22e294){const _0x32b541=a7_0x24cefe,{options:_0x374315}=_0x22e294,_0x364e2d=_0x374315[_0x32b541(0x110)];console[_0x32b541(0x10d)](a7_0xeef820['bold'](_0x32b541(0x119)));const _0x725bac=_0x374315[_0x32b541(0x112)]||_0x32b541(0xfa),{choices:_0xa18a7a,initialIndex:_0x5c05c4}=buildSiteChoices(_0x725bac),_0xd551f9=_0x364e2d?_0x32b541(0xf6)+_0x364e2d+'):':_0x32b541(0x11e),_0x1abe37=await a7_0x1048f9({'type':'select','name':'site','message':_0xd551f9,'choices':_0xa18a7a,'initial':_0x5c05c4});if(!_0x1abe37[_0x32b541(0x112)])return console['log'](_0x32b541(0x120)),0x1;let _0x24d6e1;if(_0x1abe37[_0x32b541(0x112)]===_0x32b541(0x117)){const _0x5217e5=await a7_0x1048f9({'type':_0x32b541(0xf0),'name':'customSite','message':_0x32b541(0xea),'initial':_0x32b541(0xfa),'validate':_0x4401fc=>{const _0x3a4b24=_0x32b541;if(!_0x4401fc||!_0x4401fc[_0x3a4b24(0xf2)]())return _0x3a4b24(0x103);if(!/^[a-z0-9-]+$/[_0x3a4b24(0x121)](_0x4401fc[_0x3a4b24(0xf2)]()))return _0x3a4b24(0x118);return!![];}});if(!_0x5217e5['customSite'])return console[_0x32b541(0x10d)](_0x32b541(0x120)),0x1;_0x24d6e1=_0x5217e5[_0x32b541(0x100)];}else _0x24d6e1=_0x1abe37[_0x32b541(0x112)];const _0x478ba9=resolveSite(_0x24d6e1);console[_0x32b541(0x10d)]('Setting\x20up\x20authentication\x20for\x20site:\x20'+_0x478ba9),console[_0x32b541(0x10d)](_0x32b541(0x127)),console['log']('\x20\x20'+getConsoleUrl(_0x478ba9,_0x32b541(0xfe)));const _0x3bb682=await a7_0x1048f9({'type':_0x32b541(0x126),'name':'apiKey','message':_0x32b541(0x101),'validate':_0x296ce0=>{if(!_0x296ce0||!_0x296ce0['trim']())return'API\x20key\x20cannot\x20be\x20empty';return!![];}});if(!_0x3bb682[_0x32b541(0x10e)])return console[_0x32b541(0x10d)]('\x0aSetup\x20cancelled'),0x1;const _0x2ce236=_0x3bb682[_0x32b541(0x10e)];console[_0x32b541(0x10d)](_0x32b541(0xf8));try{const _0xdea040=TDX[_0x32b541(0xff)]({'site':_0x478ba9,'apiKey':_0x2ce236[_0x32b541(0xf2)](),'logLevel':_0x374315[_0x32b541(0xdf)]??LogLevel['ERROR']}),_0x3bcdd2=await _0xdea040[_0x32b541(0xf3)][_0x32b541(0x116)]();console[_0x32b541(0x10d)]('✓\x20API\x20key\x20is\x20valid\x20(User:\x20'+_0x3bcdd2[_0x32b541(0xf5)]+')');const _0x500492=await isKeychainAvailable();_0x500492?(await saveAPIKeyAsync(_0x2ce236[_0x32b541(0xf2)](),_0x478ba9,_0x364e2d),console['log'](_0x32b541(0x114)+(_0x364e2d?_0x32b541(0x105)+_0x364e2d+')':''))):(console[_0x32b541(0xeb)](a7_0xeef820['yellow'](_0x32b541(0xe4))),console[_0x32b541(0xeb)](a7_0xeef820['yellow']('\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.')));if(_0x364e2d){const _0x745d33={'site':_0x478ba9};saveProfileToUserConfig(_0x364e2d,_0x745d33),console['log'](_0x32b541(0xf1)+_0x364e2d+_0x32b541(0xf9));}else saveDefaultSiteToUserConfig(_0x478ba9),console[_0x32b541(0x10d)](_0x32b541(0xe3)+_0x478ba9);const _0x3d31fb=_0x364e2d?_0x32b541(0xe0)+_0x364e2d:'';return console[_0x32b541(0x10d)](),console[_0x32b541(0x10d)]('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console[_0x32b541(0x10d)](_0x32b541(0x106)+_0x3d31fb+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console[_0x32b541(0x10d)](_0x32b541(0x106)+_0x3d31fb+_0x32b541(0x10f)),0x0;}catch(_0x120351){if(_0x120351 instanceof HTTPClientError&&_0x120351[_0x32b541(0x107)]===0x191)return printAuthError(_0x120351),0x1;return console[_0x32b541(0xe8)](a7_0xeef820[_0x32b541(0xfd)](_0x32b541(0x104)+(_0x120351 instanceof Error?_0x120351[_0x32b541(0x111)]:String(_0x120351)))),console[_0x32b541(0xe8)](_0x32b541(0xfc)),0x1;}}}function a7_0x48dc(){const _0x9868f2=['Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20','User:\x20','Validating\x20API\x20key...','\x27\x20registered','us01','filter','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','red','/app/mp/ak','create','customSite','Enter\x20your\x20TD\x20API\x20key:','bold','Site\x20name\x20cannot\x20be\x20empty','✗\x20Validation\x20failed:\x20','\x20(profile:\x20','\x20\x20tdx','status','Remove\x20API\x20key\x20from\x20system\x20keychain','58026TEmURw','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','Name:\x20','✓\x20Authentication\x20successful\x0a','log','apiKey','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','profile','message','site','green','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','No\x20credential\x20found','getUserInfo','other','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','tdx:\x20auth\x20setup','\x20for\x20profile:\x20','347607DGMwCM','16635ZhKLid','Read\x20credential\x20from\x20','Select\x20your\x20Treasure\x20Data\x20site:','3000720UyLrlx','\x0aSetup\x20cancelled','test','70722UonjfL','yellow','4386776BzlOsv','first_name','password','You\x20can\x20find\x20your\x20API\x20key\x20at:','6245998poeXHR','logLevel','\x20--profile\x20','7ZSbGnq','last_name','✓\x20Default\x20site\x20set\x20to\x20','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','354QbevFT','execute','6XeMgGV','error','✓\x20API\x20key\x20removed\x20from\x20keychain','Enter\x20site\x20name:','warn','\x20(site:\x20','join','description','name','text','✓\x20Profile\x20\x27','trim','jobs','130JunjKC','email'];a7_0x48dc=function(){return _0x9868f2;};return a7_0x48dc();}export class AuthStatusCommand extends BaseCommand{[a7_0x24cefe(0xef)]='auth';[a7_0x24cefe(0xee)]=a7_0x24cefe(0x10a);async[a7_0x24cefe(0xe6)](_0x206a4b){const _0x3b8fd1=a7_0x24cefe,{options:_0x428dd1,tdx:_0x8d8881}=_0x206a4b,_0x455765=_0x428dd1[_0x3b8fd1(0x112)],_0x315165=_0x428dd1[_0x3b8fd1(0x110)],_0x497a1b=_0x315165?_0x315165:'N/A';console[_0x3b8fd1(0x10d)]('tdx\x20profile:\x20'+_0x497a1b+_0x3b8fd1(0xec)+_0x455765+')');const _0x19430d=await resolveAPIKeyAsync(_0x455765,_0x315165);if(_0x19430d){const {source:_0x115354,isDeprecated:_0x39a772}=_0x19430d,_0x5b6d8a=_0x3b8fd1(0x11d)+_0x115354;console[_0x3b8fd1(0x10d)](_0x39a772?a7_0xeef820[_0x3b8fd1(0x123)](_0x5b6d8a):_0x5b6d8a);}else console[_0x3b8fd1(0x10d)](a7_0xeef820[_0x3b8fd1(0x123)](_0x3b8fd1(0x115)));try{const _0x188f95=await _0x8d8881[_0x3b8fd1(0xf3)][_0x3b8fd1(0x116)]();return console['log'](a7_0xeef820[_0x3b8fd1(0x113)](_0x3b8fd1(0x10c))),console['log'](_0x3b8fd1(0xf7)+_0x188f95['email']),(_0x188f95[_0x3b8fd1(0x125)]||_0x188f95[_0x3b8fd1(0xe2)])&&console[_0x3b8fd1(0x10d)](_0x3b8fd1(0x10b)+[_0x188f95['first_name'],_0x188f95[_0x3b8fd1(0xe2)]][_0x3b8fd1(0xfb)](Boolean)[_0x3b8fd1(0xed)]('\x20')),0x0;}catch(_0x461bbe){return _0x461bbe instanceof HTTPClientError&&_0x461bbe[_0x3b8fd1(0x107)]===0x191?printAuthError(_0x461bbe,!![],_0x315165):console[_0x3b8fd1(0xe8)](a7_0xeef820[_0x3b8fd1(0xfd)](_0x3b8fd1(0x104)+(_0x461bbe instanceof Error?_0x461bbe[_0x3b8fd1(0x111)]:String(_0x461bbe)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x24cefe(0xef)]='auth:clear';[a7_0x24cefe(0xee)]=a7_0x24cefe(0x108);async[a7_0x24cefe(0xe6)](_0x40eb8e){const _0x274136=a7_0x24cefe,{options:_0x27fc76}=_0x40eb8e,_0x141342=_0x27fc76['profile'];console['log'](a7_0xeef820[_0x274136(0x102)]('tdx:\x20auth\x20clear'));const _0x6e26ed=await isKeychainAvailable();if(!_0x6e26ed)return console[_0x274136(0xe8)](a7_0xeef820[_0x274136(0xfd)]('System\x20keychain\x20is\x20not\x20available')),0x1;const _0x296635=await deleteKeychainAPIKey(_0x141342);return _0x296635?(clearCredentialCache(),console[_0x274136(0x10d)](_0x274136(0xe9)+(_0x141342?_0x274136(0x105)+_0x141342+')':'')),0x0):(console[_0x274136(0x10d)]('No\x20API\x20key\x20found\x20in\x20keychain'+(_0x141342?_0x274136(0x11a)+_0x141342:'')),0x1);}}
@@ -1 +1 @@
1
- const a8_0x566a33=a8_0xd620;(function(_0x182e57,_0xa0cc8d){const _0x13f47b=a8_0xd620,_0x46ae8e=_0x182e57();while(!![]){try{const _0x3e4009=-parseInt(_0x13f47b(0xda))/0x1*(parseInt(_0x13f47b(0xef))/0x2)+parseInt(_0x13f47b(0xe6))/0x3+parseInt(_0x13f47b(0x10b))/0x4+-parseInt(_0x13f47b(0xf7))/0x5+-parseInt(_0x13f47b(0xf5))/0x6+parseInt(_0x13f47b(0x109))/0x7*(parseInt(_0x13f47b(0x102))/0x8)+parseInt(_0x13f47b(0xe2))/0x9;if(_0x3e4009===_0xa0cc8d)break;else _0x46ae8e['push'](_0x46ae8e['shift']());}catch(_0x34e68b){_0x46ae8e['push'](_0x46ae8e['shift']());}}}(a8_0x3f0a,0x54a72));import{BaseCommand}from'./command.js';function a8_0xd620(_0x97361d,_0x3e4452){_0x97361d=_0x97361d-0xd7;const _0x3f0ae8=a8_0x3f0a();let _0xd6207b=_0x3f0ae8[_0x97361d];return _0xd6207b;}import{SDKError,ErrorCode}from'../sdk/errors.js';import{withSpinner}from'../utils/spinner.js';import{parseAgentRef}from'../sdk/agent/agent-ref-parser.js';import{saveLastChatId,loadLastChatId}from'../sdk/llm/chat-cache.js';function handleSDKError(_0x8b41f2,_0x53976d){const _0x444359=a8_0xd620;if(_0x8b41f2 instanceof SDKError)console[_0x444359(0xeb)](_0x444359(0x101)+_0x8b41f2[_0x444359(0xf2)]),_0x53976d['verbose']&&(_0x8b41f2[_0x444359(0xee)]&&console[_0x444359(0xeb)](_0x444359(0xe8)+_0x8b41f2[_0x444359(0xee)]),_0x8b41f2[_0x444359(0xf4)]&&(console['error']('\x0aStack\x20trace:'),console[_0x444359(0xeb)](_0x8b41f2['stack'])));else throw _0x8b41f2;}function a8_0x3f0a(){const _0x140716=['Chat\x20session:\x20','404','code','35rFSeIv','agent','2659620BSuOVH','name','getAgentId','\x0aError:\x20','Continuing\x20chat:\x20','args','659409vpInWw','--agent\x20flag','No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22','llm','stdout','getOrCreateDefaultAgent','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','validate','1594053zOFabx','execute','Using\x20cached\x20default\x20agent:\x20','Using\x20agent\x20from\x20','2076012hdaYTc','\x27...','\x20\x20Cause:\x20','resolveAgentId','getDefaultAgent','error','metadata','handleChatEvent','cause','2sykjvg','log','chatId','message','session\x20context','stack','2694696MbmbVg','write','2561040JSueBJ','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','claude-4.5-haiku','data','verbose','content','includes','llmProject','chat','event','Error:\x20','693512ChpNlg','description','join','streamChat'];a8_0x3f0a=function(){return _0x140716;};return a8_0x3f0a();}export class ChatCommand extends BaseCommand{['name']=a8_0x566a33(0xff);[a8_0x566a33(0x103)]=a8_0x566a33(0xf8);[a8_0x566a33(0xe1)](_0x186f27){const _0x52d550=a8_0x566a33,_0x53d507=_0x186f27[_0x52d550(0xd9)]['join']('\x20');if(!_0x53d507)return'Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options';return undefined;}async['streamChat'](_0x448a48,_0x2a76fa,_0x821c69,_0x438822,_0x572d83){const _0x47beaf=a8_0x566a33;for await(const _0x4def7b of _0x448a48[_0x47beaf(0xdd)]['chat'](_0x2a76fa,{'agentId':_0x821c69,'chatId':_0x438822})){if(_0x4def7b['type']===_0x47beaf(0xec)){const _0x5b3c0a=_0x4def7b[_0x47beaf(0xfa)][_0x47beaf(0xf1)];saveLastChatId(_0x5b3c0a),_0x572d83&&console['error'](_0x47beaf(0x106)+_0x5b3c0a);}else _0x4def7b['type']===_0x47beaf(0x100)&&this[_0x47beaf(0xed)](_0x4def7b[_0x47beaf(0xfa)]);}}async[a8_0x566a33(0x10d)](_0x840fbd,_0x1694fd,_0x5d5b89,_0x17f6dc,_0x5df2f6){const _0x4fc5bf=a8_0x566a33,_0x109694=_0x1694fd||_0x5d5b89;if(_0x109694){const {projectName:_0x5ddfc4,agentName:_0x3601df}=parseAgentRef(_0x109694),_0x2f558d=_0x3601df||_0x109694,_0x3b11d9=_0x3601df?_0x5ddfc4:_0x17f6dc;if(!_0x3b11d9)throw new Error(_0x4fc5bf(0xdc));if(_0x5df2f6){const _0x480ae8=_0x1694fd?_0x4fc5bf(0xdb):_0x4fc5bf(0xf3);console[_0x4fc5bf(0xeb)](_0x4fc5bf(0xe5)+_0x480ae8+':\x20'+_0x3b11d9+'/'+_0x2f558d);}const _0x355ee3=await withSpinner('Resolving\x20project\x20\x27'+_0x3b11d9+_0x4fc5bf(0xe7),()=>_0x840fbd[_0x4fc5bf(0xdd)]['resolveProjectId'](_0x3b11d9),{'verbose':_0x5df2f6}),_0x4317ae=await withSpinner('Resolving\x20agent\x20\x27'+_0x2f558d+_0x4fc5bf(0xe7),()=>_0x840fbd[_0x4fc5bf(0xdd)][_0x4fc5bf(0xe9)](_0x2f558d,_0x355ee3[_0x4fc5bf(0xfa)]),{'verbose':_0x5df2f6});return _0x4317ae[_0x4fc5bf(0xfa)];}else{const _0x5bff11=_0x840fbd[_0x4fc5bf(0xdd)][_0x4fc5bf(0xea)]();if(_0x5bff11)return _0x5df2f6&&console[_0x4fc5bf(0xeb)](_0x4fc5bf(0xe4)+_0x5bff11[_0x4fc5bf(0x10c)]),_0x5bff11['id'];const _0x378ade=await withSpinner('Getting\x20default\x20agent...',()=>_0x840fbd[_0x4fc5bf(0xdd)][_0x4fc5bf(0xdf)](_0x4fc5bf(0xf9),0x0),{'verbose':_0x5df2f6});return _0x378ade[_0x4fc5bf(0xfa)]['id'];}}async[a8_0x566a33(0xe3)](_0x10a38c){const _0x323135=a8_0x566a33,{options:_0xcad746,args:_0x1b0b5d,tdx:_0x4db90e}=_0x10a38c,_0x86512d=_0x1b0b5d[_0x323135(0x104)]('\x20'),_0x3dbca9=_0xcad746,_0x1afea1=_0x3dbca9[_0x323135(0x10a)],_0x5975f2=_0x3dbca9['llmAgent'],_0x1c96b0=_0x3dbca9[_0x323135(0xfe)],_0x3c4b4c=_0x3dbca9['new'];try{let _0x175f94,_0x4552c6;!_0x3c4b4c&&(_0x4552c6=loadLastChatId(),_0x4552c6&&_0xcad746['verbose']&&console[_0x323135(0xeb)](_0x323135(0xd8)+_0x4552c6));(_0x3c4b4c||!_0x4552c6)&&(_0x175f94=await this[_0x323135(0x10d)](_0x4db90e,_0x1afea1,_0x5975f2,_0x1c96b0,_0xcad746['verbose']));try{await this[_0x323135(0x105)](_0x4db90e,_0x86512d,_0x175f94,_0x4552c6,_0xcad746[_0x323135(0xfb)]);}catch(_0x51b8cf){const _0x301932=_0x51b8cf instanceof SDKError&&_0x51b8cf[_0x323135(0x108)]===ErrorCode['CHAT_NOT_FOUND']||_0x51b8cf instanceof Error&&_0x51b8cf[_0x323135(0xf2)][_0x323135(0xfd)](_0x323135(0x107));if(_0x301932)_0xcad746[_0x323135(0xfb)]&&console[_0x323135(0xeb)](_0x323135(0xe0)),!_0x175f94&&(_0x175f94=await this[_0x323135(0x10d)](_0x4db90e,_0x1afea1,_0x5975f2,_0x1c96b0,_0xcad746[_0x323135(0xfb)])),await this[_0x323135(0x105)](_0x4db90e,_0x86512d,_0x175f94,undefined,_0xcad746[_0x323135(0xfb)]);else throw _0x51b8cf;}return console[_0x323135(0xf0)](),0x0;}catch(_0x5d87a4){return console[_0x323135(0xeb)](),handleSDKError(_0x5d87a4,_0xcad746),0x1;}}[a8_0x566a33(0xed)](_0x4249c7){const _0x593292=a8_0x566a33;if(_0x593292(0xfc)in _0x4249c7)process[_0x593292(0xde)][_0x593292(0xf6)](_0x4249c7['content']);else'error'in _0x4249c7&&console['error'](_0x593292(0xd7)+_0x4249c7[_0x593292(0xeb)]);}}
1
+ const a8_0x169ab1=a8_0x3e2b;(function(_0x4835fa,_0x25124f){const _0xcfa264=a8_0x3e2b,_0x324005=_0x4835fa();while(!![]){try{const _0x1bd432=-parseInt(_0xcfa264(0x1d1))/0x1+-parseInt(_0xcfa264(0x1be))/0x2*(-parseInt(_0xcfa264(0x1b6))/0x3)+-parseInt(_0xcfa264(0x1dc))/0x4+-parseInt(_0xcfa264(0x1c7))/0x5*(parseInt(_0xcfa264(0x1b8))/0x6)+parseInt(_0xcfa264(0x1d6))/0x7+-parseInt(_0xcfa264(0x1e1))/0x8+parseInt(_0xcfa264(0x1b4))/0x9;if(_0x1bd432===_0x25124f)break;else _0x324005['push'](_0x324005['shift']());}catch(_0x366259){_0x324005['push'](_0x324005['shift']());}}}(a8_0x4a3a,0xe8284));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/errors.js';function a8_0x4a3a(){const _0x55348b=['10329mtogEr','Chat\x20session:\x20','6CEJbTJ','llmAgent','llm','metadata','validate','description','932GUuhaA','data','event','getDefaultAgent','streamChat','404','resolveProjectId','content','\x27...','2095955SLZgYV','agent','No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22','getAgentId','getOrCreateDefaultAgent','llmProject','log','write','Using\x20agent\x20from\x20','\x0aStack\x20trace:','1316459hfFAMl','Error:\x20','chatId','verbose','message','1806231GtbXXh','Getting\x20default\x20agent...','CHAT_NOT_FOUND','args','Resolving\x20project\x20\x27','cause','1427532GgWnyX','stdout','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','join','13385504aZaMrc','handleChatEvent','stack','\x0aError:\x20','error','name','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','session\x20context','resolveAgentId','Continuing\x20chat:\x20','chat','type','25687494poSBHR','Resolving\x20agent\x20\x27'];a8_0x4a3a=function(){return _0x55348b;};return a8_0x4a3a();}import{withSpinner}from'../utils/spinner.js';import{parseAgentRef}from'../sdk/agent/agent-ref-parser.js';import{saveLastChatId,loadLastChatId}from'../sdk/llm/chat-cache.js';function handleSDKError(_0x11a6d2,_0x57ae55){const _0x8bda8f=a8_0x3e2b;if(_0x11a6d2 instanceof SDKError)console[_0x8bda8f(0x1e5)](_0x8bda8f(0x1d2)+_0x11a6d2[_0x8bda8f(0x1d5)]),_0x57ae55[_0x8bda8f(0x1d4)]&&(_0x11a6d2[_0x8bda8f(0x1db)]&&console['error']('\x20\x20Cause:\x20'+_0x11a6d2[_0x8bda8f(0x1db)]),_0x11a6d2[_0x8bda8f(0x1e3)]&&(console[_0x8bda8f(0x1e5)](_0x8bda8f(0x1d0)),console['error'](_0x11a6d2[_0x8bda8f(0x1e3)])));else throw _0x11a6d2;}function a8_0x3e2b(_0x57d09f,_0x4dad18){_0x57d09f=_0x57d09f-0x1b2;const _0x4a3a40=a8_0x4a3a();let _0x3e2b6d=_0x4a3a40[_0x57d09f];return _0x3e2b6d;}export class ChatCommand extends BaseCommand{[a8_0x169ab1(0x1e6)]=a8_0x169ab1(0x1b2);[a8_0x169ab1(0x1bd)]=a8_0x169ab1(0x1df);[a8_0x169ab1(0x1bc)](_0x327426){const _0x1b922e=a8_0x169ab1,_0x55e7cb=_0x327426[_0x1b922e(0x1d9)][_0x1b922e(0x1e0)]('\x20');if(!_0x55e7cb)return _0x1b922e(0x1de);return undefined;}async['streamChat'](_0x13854f,_0x72ed27,_0x3e135e,_0xe75b47,_0x1981f5){const _0x438f89=a8_0x169ab1;for await(const _0x203403 of _0x13854f['llm'][_0x438f89(0x1b2)](_0x72ed27,{'agentId':_0x3e135e,'chatId':_0xe75b47})){if(_0x203403[_0x438f89(0x1b3)]===_0x438f89(0x1bb)){const _0x3bfeb2=_0x203403[_0x438f89(0x1bf)][_0x438f89(0x1d3)];saveLastChatId(_0x3bfeb2),_0x1981f5&&console[_0x438f89(0x1e5)](_0x438f89(0x1b7)+_0x3bfeb2);}else _0x203403[_0x438f89(0x1b3)]===_0x438f89(0x1c0)&&this['handleChatEvent'](_0x203403['data']);}}async[a8_0x169ab1(0x1ca)](_0x3ab1ec,_0x257d35,_0x2905d0,_0x52cf4d,_0x3581bf){const _0x1800b3=a8_0x169ab1,_0x210e43=_0x257d35||_0x2905d0;if(_0x210e43){const {projectName:_0x1efb3e,agentName:_0x3d1ab4}=parseAgentRef(_0x210e43),_0x12658c=_0x3d1ab4||_0x210e43,_0x3dff61=_0x3d1ab4?_0x1efb3e:_0x52cf4d;if(!_0x3dff61)throw new Error(_0x1800b3(0x1c9));if(_0x3581bf){const _0x37f7a8=_0x257d35?'--agent\x20flag':_0x1800b3(0x1e8);console['error'](_0x1800b3(0x1cf)+_0x37f7a8+':\x20'+_0x3dff61+'/'+_0x12658c);}const _0x48a439=await withSpinner(_0x1800b3(0x1da)+_0x3dff61+_0x1800b3(0x1c6),()=>_0x3ab1ec[_0x1800b3(0x1ba)][_0x1800b3(0x1c4)](_0x3dff61),{'verbose':_0x3581bf}),_0x1f18ea=await withSpinner(_0x1800b3(0x1b5)+_0x12658c+_0x1800b3(0x1c6),()=>_0x3ab1ec[_0x1800b3(0x1ba)][_0x1800b3(0x1e9)](_0x12658c,_0x48a439[_0x1800b3(0x1bf)]),{'verbose':_0x3581bf});return _0x1f18ea[_0x1800b3(0x1bf)];}else{const _0x41608c=_0x3ab1ec[_0x1800b3(0x1ba)][_0x1800b3(0x1c1)]();if(_0x41608c)return _0x3581bf&&console[_0x1800b3(0x1e5)]('Using\x20cached\x20default\x20agent:\x20'+_0x41608c['name']),_0x41608c['id'];const _0x222158=await withSpinner(_0x1800b3(0x1d7),()=>_0x3ab1ec[_0x1800b3(0x1ba)][_0x1800b3(0x1cb)]('claude-4.5-haiku',0x0),{'verbose':_0x3581bf});return _0x222158[_0x1800b3(0x1bf)]['id'];}}async['execute'](_0x17c265){const _0x478111=a8_0x169ab1,{options:_0x21e503,args:_0x26ed57,tdx:_0x3d0db8}=_0x17c265,_0x24967f=_0x26ed57[_0x478111(0x1e0)]('\x20'),_0x55c870=_0x21e503,_0x50fd87=_0x55c870[_0x478111(0x1c8)],_0xbfdb88=_0x55c870[_0x478111(0x1b9)],_0x1856f7=_0x55c870[_0x478111(0x1cc)],_0x21dc06=_0x55c870['new'];try{let _0x33d880,_0x3444be;!_0x21dc06&&(_0x3444be=loadLastChatId(),_0x3444be&&_0x21e503[_0x478111(0x1d4)]&&console[_0x478111(0x1e5)](_0x478111(0x1ea)+_0x3444be));(_0x21dc06||!_0x3444be)&&(_0x33d880=await this[_0x478111(0x1ca)](_0x3d0db8,_0x50fd87,_0xbfdb88,_0x1856f7,_0x21e503[_0x478111(0x1d4)]));try{await this[_0x478111(0x1c2)](_0x3d0db8,_0x24967f,_0x33d880,_0x3444be,_0x21e503[_0x478111(0x1d4)]);}catch(_0x229549){const _0x4be33b=_0x229549 instanceof SDKError&&_0x229549['code']===ErrorCode[_0x478111(0x1d8)]||_0x229549 instanceof Error&&_0x229549['message']['includes'](_0x478111(0x1c3));if(_0x4be33b)_0x21e503[_0x478111(0x1d4)]&&console[_0x478111(0x1e5)](_0x478111(0x1e7)),!_0x33d880&&(_0x33d880=await this[_0x478111(0x1ca)](_0x3d0db8,_0x50fd87,_0xbfdb88,_0x1856f7,_0x21e503[_0x478111(0x1d4)])),await this[_0x478111(0x1c2)](_0x3d0db8,_0x24967f,_0x33d880,undefined,_0x21e503['verbose']);else throw _0x229549;}return console[_0x478111(0x1cd)](),0x0;}catch(_0x5d9696){return console[_0x478111(0x1e5)](),handleSDKError(_0x5d9696,_0x21e503),0x1;}}[a8_0x169ab1(0x1e2)](_0x34c241){const _0x86060d=a8_0x169ab1;if(_0x86060d(0x1c5)in _0x34c241)process[_0x86060d(0x1dd)][_0x86060d(0x1ce)](_0x34c241[_0x86060d(0x1c5)]);else _0x86060d(0x1e5)in _0x34c241&&console['error'](_0x86060d(0x1e4)+_0x34c241['error']);}}