@treasuredata/tdx 0.26.7 → 0.27.1

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 (229) 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.d.ts.map +1 -1
  14. package/dist/commands/claude-command.js +1 -1
  15. package/dist/commands/claude-command.js.map +1 -1
  16. package/dist/commands/claude-statusline-command.d.ts +4 -2
  17. package/dist/commands/claude-statusline-command.d.ts.map +1 -1
  18. package/dist/commands/claude-statusline-command.js +1 -1
  19. package/dist/commands/claude-statusline-command.js.map +1 -1
  20. package/dist/commands/claude-usage-command.js +1 -1
  21. package/dist/commands/command.js +1 -1
  22. package/dist/commands/connection-command.js +1 -1
  23. package/dist/commands/databases.js +1 -1
  24. package/dist/commands/describe.js +1 -1
  25. package/dist/commands/engage-command.js +1 -1
  26. package/dist/commands/job-command.js +1 -1
  27. package/dist/commands/journey-command.d.ts +52 -0
  28. package/dist/commands/journey-command.d.ts.map +1 -1
  29. package/dist/commands/journey-command.js +1 -1
  30. package/dist/commands/journey-command.js.map +1 -1
  31. package/dist/commands/journey-validate-command.js +1 -1
  32. package/dist/commands/llm-command.d.ts.map +1 -1
  33. package/dist/commands/llm-command.js +1 -1
  34. package/dist/commands/llm-command.js.map +1 -1
  35. package/dist/commands/mcp-command.js +1 -1
  36. package/dist/commands/parent-segment-command.js +1 -1
  37. package/dist/commands/profile-command.js +1 -1
  38. package/dist/commands/profiles-command.js +1 -1
  39. package/dist/commands/query-command.js +1 -1
  40. package/dist/commands/schedule-command.js +1 -1
  41. package/dist/commands/segment-command.js +1 -1
  42. package/dist/commands/segment-create-command.js +1 -1
  43. package/dist/commands/segment-fields-command.js +1 -1
  44. package/dist/commands/segment-pull-command.js +1 -1
  45. package/dist/commands/segment-push-command.d.ts.map +1 -1
  46. package/dist/commands/segment-push-command.js +1 -1
  47. package/dist/commands/segment-push-command.js.map +1 -1
  48. package/dist/commands/segment-update-command.js +1 -1
  49. package/dist/commands/segment-use-command.js +1 -1
  50. package/dist/commands/segment-validate-command.js +1 -1
  51. package/dist/commands/segments.js +1 -1
  52. package/dist/commands/show.js +1 -1
  53. package/dist/commands/status-command.js +1 -1
  54. package/dist/commands/tables.js +1 -1
  55. package/dist/commands/unset-command.js +1 -1
  56. package/dist/commands/use-command.d.ts.map +1 -1
  57. package/dist/commands/use-command.js +1 -1
  58. package/dist/commands/use-command.js.map +1 -1
  59. package/dist/commands/user-command.js +1 -1
  60. package/dist/commands/workflow-command.js +1 -1
  61. package/dist/core/auth.js +1 -1
  62. package/dist/core/command-output.js +1 -1
  63. package/dist/core/config.js +1 -1
  64. package/dist/core/connection-cache.js +1 -1
  65. package/dist/core/constants.js +1 -1
  66. package/dist/core/credential-cache.js +1 -1
  67. package/dist/core/global-context.js +1 -1
  68. package/dist/core/keychain.js +1 -1
  69. package/dist/core/profile.js +1 -1
  70. package/dist/core/project-config.js +1 -1
  71. package/dist/core/session.js +1 -1
  72. package/dist/core/user-cache.js +1 -1
  73. package/dist/core/version.js +1 -1
  74. package/dist/index.js +1 -1
  75. package/dist/mcp/server.js +1 -1
  76. package/dist/mcp/tools/index.js +1 -1
  77. package/dist/mcp/tools/tdx-run.js +1 -1
  78. package/dist/mcp/tools/tdx-search.js +1 -1
  79. package/dist/mcp/utils.js +1 -1
  80. package/dist/proxy/claude-usage-tracker.d.ts +2 -2
  81. package/dist/proxy/claude-usage-tracker.d.ts.map +1 -1
  82. package/dist/proxy/claude-usage-tracker.js +1 -1
  83. package/dist/proxy/claude-usage-tracker.js.map +1 -1
  84. package/dist/proxy/passthrough-server.d.ts +18 -3
  85. package/dist/proxy/passthrough-server.d.ts.map +1 -1
  86. package/dist/proxy/passthrough-server.js +1 -1
  87. package/dist/proxy/passthrough-server.js.map +1 -1
  88. package/dist/proxy/sse-usage-parser.d.ts +20 -2
  89. package/dist/proxy/sse-usage-parser.d.ts.map +1 -1
  90. package/dist/proxy/sse-usage-parser.js +1 -1
  91. package/dist/proxy/sse-usage-parser.js.map +1 -1
  92. package/dist/sdk/agent/agent-config.js +1 -1
  93. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  94. package/dist/sdk/agent/agent-yaml.js +1 -1
  95. package/dist/sdk/agent/test/evaluator.js +1 -1
  96. package/dist/sdk/agent/test/executor.js +1 -1
  97. package/dist/sdk/agent/test/index.js +1 -1
  98. package/dist/sdk/agent/test/output.js +1 -1
  99. package/dist/sdk/agent/test/parser.js +1 -1
  100. package/dist/sdk/agent/tool-target-registry.js +1 -1
  101. package/dist/sdk/api.js +1 -1
  102. package/dist/sdk/client/cdp-api-client.d.ts +94 -2
  103. package/dist/sdk/client/cdp-api-client.d.ts.map +1 -1
  104. package/dist/sdk/client/cdp-api-client.js +1 -1
  105. package/dist/sdk/client/cdp-api-client.js.map +1 -1
  106. package/dist/sdk/client/endpoints.js +1 -1
  107. package/dist/sdk/client/engage-api-client.js +1 -1
  108. package/dist/sdk/client/http-client.js +1 -1
  109. package/dist/sdk/client/llm-api-client.js +1 -1
  110. package/dist/sdk/client/rate-limiter.js +1 -1
  111. package/dist/sdk/client/td-api-client.js +1 -1
  112. package/dist/sdk/client/trino-api-client.js +1 -1
  113. package/dist/sdk/client/workflow-client.js +1 -1
  114. package/dist/sdk/connection-validator.js +1 -1
  115. package/dist/sdk/connection.js +1 -1
  116. package/dist/sdk/engage.js +1 -1
  117. package/dist/sdk/errors.js +1 -1
  118. package/dist/sdk/index.js +1 -1
  119. package/dist/sdk/io/index.js +1 -1
  120. package/dist/sdk/io/node-filesystem.js +1 -1
  121. package/dist/sdk/job.js +1 -1
  122. package/dist/sdk/journey.d.ts +149 -2
  123. package/dist/sdk/journey.d.ts.map +1 -1
  124. package/dist/sdk/journey.js +1 -1
  125. package/dist/sdk/journey.js.map +1 -1
  126. package/dist/sdk/llm/chat-cache.js +1 -1
  127. package/dist/sdk/llm/index.js +1 -1
  128. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  129. package/dist/sdk/llm/model-factors.d.ts +0 -4
  130. package/dist/sdk/llm/model-factors.d.ts.map +1 -1
  131. package/dist/sdk/llm/model-factors.js +1 -1
  132. package/dist/sdk/llm/model-factors.js.map +1 -1
  133. package/dist/sdk/personalization.js +1 -1
  134. package/dist/sdk/query/index.js +1 -1
  135. package/dist/sdk/query/sql-parser.js +1 -1
  136. package/dist/sdk/realtime.js +1 -1
  137. package/dist/sdk/schedule.js +1 -1
  138. package/dist/sdk/segment/child-segment-yaml.d.ts +2 -2
  139. package/dist/sdk/segment/child-segment-yaml.d.ts.map +1 -1
  140. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  141. package/dist/sdk/segment/child-segment-yaml.js.map +1 -1
  142. package/dist/sdk/segment/fields-display.js +1 -1
  143. package/dist/sdk/segment/file-discovery.js +1 -1
  144. package/dist/sdk/segment/journey-utils.d.ts.map +1 -1
  145. package/dist/sdk/segment/journey-utils.js +1 -1
  146. package/dist/sdk/segment/journey-utils.js.map +1 -1
  147. package/dist/sdk/segment/journey-validator.d.ts +3 -0
  148. package/dist/sdk/segment/journey-validator.d.ts.map +1 -1
  149. package/dist/sdk/segment/journey-validator.js +1 -1
  150. package/dist/sdk/segment/journey-validator.js.map +1 -1
  151. package/dist/sdk/segment/journey-yaml.d.ts.map +1 -1
  152. package/dist/sdk/segment/journey-yaml.js +1 -1
  153. package/dist/sdk/segment/journey-yaml.js.map +1 -1
  154. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  155. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  156. package/dist/sdk/segment/pull-workflow.js +1 -1
  157. package/dist/sdk/segment/pull-workflow.js.map +1 -1
  158. package/dist/sdk/segment/push-recovery.js +1 -1
  159. package/dist/sdk/segment/push-workflow.d.ts +21 -3
  160. package/dist/sdk/segment/push-workflow.d.ts.map +1 -1
  161. package/dist/sdk/segment/push-workflow.js +1 -1
  162. package/dist/sdk/segment/push-workflow.js.map +1 -1
  163. package/dist/sdk/segment/resolution-context.js +1 -1
  164. package/dist/sdk/segment/segment-path-parser.js +1 -1
  165. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  166. package/dist/sdk/segment/target-resolution.js +1 -1
  167. package/dist/sdk/segment/tdx-config.js +1 -1
  168. package/dist/sdk/segment/types/segment-def.d.ts +10 -1
  169. package/dist/sdk/segment/types/segment-def.d.ts.map +1 -1
  170. package/dist/sdk/segment/validate-files.js +1 -1
  171. package/dist/sdk/segment/yaml-validator.d.ts +1 -1
  172. package/dist/sdk/segment/yaml-validator.d.ts.map +1 -1
  173. package/dist/sdk/segment/yaml-validator.js +1 -1
  174. package/dist/sdk/segment/yaml-validator.js.map +1 -1
  175. package/dist/sdk/segment.js +1 -1
  176. package/dist/sdk/types/cdp.d.ts +188 -16
  177. package/dist/sdk/types/cdp.d.ts.map +1 -1
  178. package/dist/sdk/types/index.d.ts +1 -1
  179. package/dist/sdk/types/index.d.ts.map +1 -1
  180. package/dist/sdk/types/index.js +1 -1
  181. package/dist/sdk/types/index.js.map +1 -1
  182. package/dist/sdk/types/progress.js +1 -1
  183. package/dist/sdk/user.js +1 -1
  184. package/dist/sdk/util/format-detector.js +1 -1
  185. package/dist/sdk/util/formatters.js +1 -1
  186. package/dist/sdk/util/index.js +1 -1
  187. package/dist/sdk/util/tree-formatter.js +1 -1
  188. package/dist/sdk/workflow/archive-validation.js +1 -1
  189. package/dist/sdk/workflow/clone-workflow.js +1 -1
  190. package/dist/sdk/workflow/index.js +1 -1
  191. package/dist/sdk/workflow/pull-workflow.js +1 -1
  192. package/dist/sdk/workflow/push-workflow.js +1 -1
  193. package/dist/sdk/workflow/tdx-config.js +1 -1
  194. package/dist/sdk/workflow/workflow-utils.js +1 -1
  195. package/dist/test-utils/command-runner.js +1 -1
  196. package/dist/test-utils/factories.js +1 -1
  197. package/dist/test-utils/fixtures.js +1 -1
  198. package/dist/test-utils/http-mock.js +1 -1
  199. package/dist/test-utils/index.js +1 -1
  200. package/dist/utils/async.js +1 -1
  201. package/dist/utils/colors.js +1 -1
  202. package/dist/utils/diff.js +1 -1
  203. package/dist/utils/file-permissions.js +1 -1
  204. package/dist/utils/global-cache.js +1 -1
  205. package/dist/utils/json-loader.js +1 -1
  206. package/dist/utils/local-cache.js +1 -1
  207. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  208. package/dist/utils/logger/formatters/index.js +1 -1
  209. package/dist/utils/logger/handlers/console-handler.js +1 -1
  210. package/dist/utils/logger/handlers/file-handler.js +1 -1
  211. package/dist/utils/logger/handlers/index.js +1 -1
  212. package/dist/utils/logger/handlers/null-handler.js +1 -1
  213. package/dist/utils/logger/index.js +1 -1
  214. package/dist/utils/logger/logger.js +1 -1
  215. package/dist/utils/logger/types.js +1 -1
  216. package/dist/utils/option-validation.js +1 -1
  217. package/dist/utils/process.js +1 -1
  218. package/dist/utils/prompt.js +1 -1
  219. package/dist/utils/spinner.js +1 -1
  220. package/dist/utils/sse-parser.js +1 -1
  221. package/dist/utils/string-utils.js +1 -1
  222. package/dist/utils/table-ref-parser.js +1 -1
  223. package/dist/utils/tdx-logger.js +1 -1
  224. package/dist/utils/version-check.js +1 -1
  225. package/package.json +3 -3
  226. package/dist/utils/port.d.ts +0 -18
  227. package/dist/utils/port.d.ts.map +0 -1
  228. package/dist/utils/port.js +0 -1
  229. package/dist/utils/port.js.map +0 -1
@@ -1 +1 @@
1
- const a4_0x59ba5d=a4_0x28cf;(function(_0x14898a,_0x335a60){const _0x4c2752=a4_0x28cf,_0x36e8d8=_0x14898a();while(!![]){try{const _0x3d66f5=parseInt(_0x4c2752(0x1ba))/0x1+parseInt(_0x4c2752(0x175))/0x2+-parseInt(_0x4c2752(0x14b))/0x3*(parseInt(_0x4c2752(0x124))/0x4)+-parseInt(_0x4c2752(0x172))/0x5+-parseInt(_0x4c2752(0x1bc))/0x6*(parseInt(_0x4c2752(0x1b6))/0x7)+-parseInt(_0x4c2752(0x137))/0x8*(parseInt(_0x4c2752(0x118))/0x9)+parseInt(_0x4c2752(0x161))/0xa;if(_0x3d66f5===_0x335a60)break;else _0x36e8d8['push'](_0x36e8d8['shift']());}catch(_0x522199){_0x36e8d8['push'](_0x36e8d8['shift']());}}}(a4_0x4789,0x352c8));import a4_0x2b36da from'chalk';import a4_0x4a5513 from'path';function a4_0x4789(){const _0x3d8367=['Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','8koPfPH','updated','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','errors','\x20resources\x20to\x20\x27','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','outputPath','\x20total','session','dim','\x20--profile\x20','pullProject','repeat','New\x20project\x20name\x20is\x20required','no_local_folder','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','Output\x20path:\x20','newProjectName','projectName','action','30UFCyJX','\x20\x20Agents:\x20','\x20\x20Knowledge\x20Bases:\x20','Analyzing\x20project\x20\x22','cwd','red','execute','<new-name>','total','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','gray','MISSING_ARGUMENT','Using\x20project\x20from\x20','prompts','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','\x22:\x20','Agent\x20pulled\x20successfully','\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','name','No\x20tdx.json\x20found\x20in\x20','parse','\x20\x20Source:\x20','3873130tCOHqT','llm','\x20\x20Experimental\x20Artifacts:\x20','New\x20project:\x20','\x20files?','\x20\x20Text\x20Knowledge\x20Base\x20\x22','green','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','\x20\x20Integration\x20\x22','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','\x0aChanges:','Project\x20cloned\x20with\x20errors','site','textKnowledgeBases','Analyzing\x20changes\x20to\x20push...','\x22...','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','1274480pRIsUL','\x20\x20Agent\x20\x22','\x20changed','610698JsRyAw','dirname','agent:pull','\x20created','\x0aWrite\x20','experimentalArtifacts','Would\x20pull\x20agent:\x20','Pushing\x20to\x20project...','dryRun','Errors:','\x20\x20tdx\x20agent\x20clone\x20agents/','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','New\x20project\x20ID:\x20','pushProject','diff','\x20new','new','Cancelled','\x20|\x20','sourceProjectName','\x20resources?','\x20unchanged','Would\x20push\x20agent:\x20','pullAgent','Writing\x20files...','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20\x20tdx\x20agent\x20pull\x20','log','projectDir','no_context','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','\x0aChanges\x20to\x20agent\x20\x27','Failed\x20to\x20push\x20agent:\x20','Using\x20local\x20project:\x20','projectId','\x0aPush\x20summary\x20for\x20\x27','profile','Would\x20clone:','INVALID_ARGUMENT','experimentalKnowledgeBases','Source:\x20','tdx.json','cyan','hasChanges','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','\x20updated','\x20files\x20to\x20','llmProject','Using\x20context\x20project:\x20','push','unchanged','context','agents','pushAgent','agentId','knowledgeBases','join','\x0aErrors\x20found:','yes','\x0aChanges\x20to\x20prompt\x20\x27','\x20\x20Knowledge\x20Base\x20\x22','agent:push','found','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','yellow','28OMRLUw','Cannot\x20clone\x20from\x20context\x20project\x20\x22','message','counts','294842Fuegrh','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','295170eAyEiH','\x0aPull\x20summary\x20for\x20\x27','newProjectId','✔\x20Context\x20set:\x20','Dry\x20run\x20-\x20no\x20changes\x20made','isNew','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','agentName','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','Status:\x20','Using\x20project:\x20','error','\x20\x20Integrations:\x20','integrations','\x20\x20Prompt\x20\x22','Pushing\x20agent\x20from\x20\x22','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','Pulling\x20agent\x20\x22','2441682opKyWo','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20#\x20Pull\x20specific\x20agent','\x20=\x20','Clone\x20\x22','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','\x0aPush\x20','description','\x20\x20Prompts:\x20','created','force','llm_project','source','18692zYAbHU','outputDir','\x20successfully','\x20--name\x20','\x0aError:','\x0aProject\x20pushed\x20with\x20errors','output','\x22\x20from\x20project\x20\x22','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','\x20\x20Text\x20Knowledge\x20Bases:\x20','Project:\x20','Summary:','reason','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','utf-8','cloneProject','Agent:\x20','\x20\x20Target:\x20'];a4_0x4789=function(){return _0x3d8367;};return a4_0x4789();}import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext}from'../sdk/agent/agent-config.js';function a4_0x28cf(_0x2d75f2,_0x4ca05a){_0x2d75f2=_0x2d75f2-0x116;const _0x4789d3=a4_0x4789();let _0x28cf59=_0x4789d3[_0x2d75f2];return _0x28cf59;}import{saveSessionContext}from'../core/session.js';import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x52eb4f){const _0x5b645d=a4_0x28cf,_0x18453b=[];if(_0x52eb4f['total']!==undefined)_0x18453b['push'](_0x52eb4f[_0x5b645d(0x153)]+_0x5b645d(0x13e));if(_0x52eb4f[_0x5b645d(0x185)]!==undefined&&_0x52eb4f[_0x5b645d(0x185)]>0x0)_0x18453b['push'](a4_0x2b36da['green'](_0x52eb4f['new']+_0x5b645d(0x184)));if(_0x52eb4f[_0x5b645d(0x120)]!==undefined&&_0x52eb4f[_0x5b645d(0x120)]>0x0)_0x18453b[_0x5b645d(0x1a6)](a4_0x2b36da[_0x5b645d(0x167)](_0x52eb4f[_0x5b645d(0x120)]+_0x5b645d(0x178)));if(_0x52eb4f[_0x5b645d(0x138)]!==undefined&&_0x52eb4f['updated']>0x0)_0x18453b[_0x5b645d(0x1a6)](a4_0x2b36da[_0x5b645d(0x1b5)](_0x52eb4f['updated']+_0x5b645d(0x1a2)));if(_0x52eb4f[_0x5b645d(0x1a7)]!==undefined&&_0x52eb4f['unchanged']>0x0)_0x18453b['push'](a4_0x2b36da[_0x5b645d(0x155)](_0x52eb4f[_0x5b645d(0x1a7)]+_0x5b645d(0x18a)));if(_0x52eb4f['errors']!==undefined&&_0x52eb4f[_0x5b645d(0x13a)]>0x0)_0x18453b[_0x5b645d(0x1a6)](a4_0x2b36da[_0x5b645d(0x150)](_0x52eb4f['errors']+'\x20errors'));return _0x18453b[_0x5b645d(0x1ad)](',\x20');}function displayDiffs(_0x2fb322,_0x856b2c,_0x357617,_0x371e0b,_0x541c5a,_0x5c86e8,_0x46b4a7){const _0x7d894e=a4_0x28cf;for(const _0xced9c4 of _0x2fb322){if(_0xced9c4[_0x7d894e(0x183)]){const _0x1a6cf0=_0xced9c4[_0x7d894e(0x1c3)]||_0xced9c4[_0x7d894e(0x15d)];console['log'](_0x7d894e(0x194)+_0x1a6cf0+'\x27:'),console[_0x7d894e(0x190)]('─'[_0x7d894e(0x143)](0x3c)),console['log'](_0xced9c4['diff']),console[_0x7d894e(0x190)]('─'['repeat'](0x3c));}}for(const _0x576861 of _0x856b2c){_0x576861[_0x7d894e(0x183)]&&(console[_0x7d894e(0x190)]('\x0aChanges\x20to\x20knowledge\x20base\x20\x27'+_0x576861[_0x7d894e(0x15d)]+'\x27:'),console[_0x7d894e(0x190)]('─'[_0x7d894e(0x143)](0x3c)),console[_0x7d894e(0x190)](_0x576861[_0x7d894e(0x183)]),console[_0x7d894e(0x190)]('─'['repeat'](0x3c)));}for(const _0x5dc2a4 of _0x357617){_0x5dc2a4[_0x7d894e(0x183)]&&(console['log']('\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27'+_0x5dc2a4[_0x7d894e(0x15d)]+'\x27:'),console['log']('─'[_0x7d894e(0x143)](0x3c)),console[_0x7d894e(0x190)](_0x5dc2a4['diff']),console[_0x7d894e(0x190)]('─'[_0x7d894e(0x143)](0x3c)));}for(const _0x9bff11 of _0x371e0b){_0x9bff11[_0x7d894e(0x183)]&&(console['log'](_0x7d894e(0x1b0)+_0x9bff11[_0x7d894e(0x15d)]+'\x27:'),console['log']('─'['repeat'](0x3c)),console['log'](_0x9bff11[_0x7d894e(0x183)]),console[_0x7d894e(0x190)]('─'[_0x7d894e(0x143)](0x3c)));}for(const _0x41efcf of _0x541c5a){_0x41efcf[_0x7d894e(0x183)]&&(console[_0x7d894e(0x190)]('\x0aChanges\x20to\x20integration\x20\x27'+_0x41efcf[_0x7d894e(0x15d)]+'\x27:'),console[_0x7d894e(0x190)]('─'['repeat'](0x3c)),console[_0x7d894e(0x190)](_0x41efcf[_0x7d894e(0x183)]),console[_0x7d894e(0x190)]('─'[_0x7d894e(0x143)](0x3c)));}for(const _0x4b5d81 of _0x5c86e8){_0x4b5d81[_0x7d894e(0x183)]&&(console[_0x7d894e(0x190)]('\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27'+_0x4b5d81[_0x7d894e(0x15d)]+'\x27:'),console[_0x7d894e(0x190)]('─'['repeat'](0x3c)),console[_0x7d894e(0x190)](_0x4b5d81['diff']),console[_0x7d894e(0x190)]('─'[_0x7d894e(0x143)](0x3c)));}for(const _0x2e53cb of _0x46b4a7){_0x2e53cb[_0x7d894e(0x183)]&&(console[_0x7d894e(0x190)](_0x7d894e(0x116)+_0x2e53cb[_0x7d894e(0x15d)]+'\x27:'),console['log']('─'['repeat'](0x3c)),console[_0x7d894e(0x190)](_0x2e53cb[_0x7d894e(0x183)]),console[_0x7d894e(0x190)]('─'[_0x7d894e(0x143)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x59ba5d(0x15d)]=a4_0x59ba5d(0x177);[a4_0x59ba5d(0x11e)]=a4_0x59ba5d(0x171);async[a4_0x59ba5d(0x151)](_0x12e34f){const _0x1f2f4a=a4_0x59ba5d,{options:_0x2e7742,args:_0x762432,tdx:_0x4efd75}=_0x12e34f,_0x3cd8c8=_0x762432[0x0],_0x3e742b=_0x762432[0x1],_0x39d077=_0x2e7742[_0x1f2f4a(0x12a)],_0x2138c5=_0x2e7742[_0x1f2f4a(0x17d)],_0x59f95e=_0x2e7742[_0x1f2f4a(0x121)],_0x51afab=_0x2e7742[_0x1f2f4a(0x1af)],_0x3bdfe5=_0x2e7742[_0x1f2f4a(0x1a4)];let _0x338627,_0x327398;const _0x1e3601=findAgentConfigPath(process[_0x1f2f4a(0x14f)]());if(_0x3cd8c8){const _0x2ef564=a4_0x4a5513['join'](_0x3cd8c8,_0x1f2f4a(0x19e));if(existsSync(_0x2ef564))try{const _0x142ad4=JSON[_0x1f2f4a(0x15f)](readFileSync(_0x2ef564,_0x1f2f4a(0x132)));_0x338627=_0x142ad4[_0x1f2f4a(0x122)],_0x327398=_0x3cd8c8,console['log'](a4_0x2b36da[_0x1f2f4a(0x140)](_0x1f2f4a(0x157)+_0x2ef564+':\x20'+_0x338627));}catch{_0x338627=_0x3cd8c8;}else _0x338627=_0x3cd8c8;}else{if(_0x1e3601)try{const _0x10e392=JSON[_0x1f2f4a(0x15f)](readFileSync(_0x1e3601,_0x1f2f4a(0x132)));_0x338627=_0x10e392[_0x1f2f4a(0x122)],_0x327398=a4_0x4a5513['dirname'](_0x1e3601),console['log'](a4_0x2b36da[_0x1f2f4a(0x140)](_0x1f2f4a(0x1c6)+_0x338627));}catch{_0x338627=_0x3bdfe5;}else _0x338627=_0x3bdfe5;}if(!_0x338627)return console['log'](a4_0x2b36da['yellow'](_0x1f2f4a(0x180))),console[_0x1f2f4a(0x190)]('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)'),console['log'](_0x1f2f4a(0x15c)),console[_0x1f2f4a(0x190)]('\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[_0x1f2f4a(0x190)](_0x1f2f4a(0x119)),0x1;if(_0x3e742b){const {data:_0x20330f}=await withSpinner(_0x1f2f4a(0x117)+_0x3e742b+_0x1f2f4a(0x12b)+_0x338627+_0x1f2f4a(0x170),()=>_0x4efd75[_0x1f2f4a(0x162)][_0x1f2f4a(0x18c)](_0x338627,_0x3e742b,_0x39d077,{'dryRun':_0x2138c5,'force':_0x59f95e}));if(_0x2138c5)return console[_0x1f2f4a(0x190)](a4_0x2b36da[_0x1f2f4a(0x1b5)]('Dry\x20run\x20-\x20no\x20files\x20written')),console['log'](_0x1f2f4a(0x17b)+_0x20330f['agentName']),console[_0x1f2f4a(0x190)](_0x1f2f4a(0x147)+_0x20330f[_0x1f2f4a(0x13d)]),_0x20330f['diff']&&(console['log'](_0x1f2f4a(0x16b)),console[_0x1f2f4a(0x190)]('─'[_0x1f2f4a(0x143)](0x3c)),console[_0x1f2f4a(0x190)](_0x20330f[_0x1f2f4a(0x183)]),console[_0x1f2f4a(0x190)]('─'[_0x1f2f4a(0x143)](0x3c))),0x0;return console[_0x1f2f4a(0x190)](a4_0x2b36da[_0x1f2f4a(0x167)](_0x1f2f4a(0x15b))),console['log']('Agent:\x20'+_0x20330f[_0x1f2f4a(0x1c3)]),console[_0x1f2f4a(0x190)]('Output:\x20'+_0x20330f[_0x1f2f4a(0x13d)]),console[_0x1f2f4a(0x190)](_0x1f2f4a(0x1c5)+(_0x20330f[_0x1f2f4a(0x1c1)]?a4_0x2b36da[_0x1f2f4a(0x167)](_0x1f2f4a(0x185)):_0x20330f[_0x1f2f4a(0x1a0)]?a4_0x2b36da['yellow']('updated'):a4_0x2b36da[_0x1f2f4a(0x155)](_0x1f2f4a(0x1a7)))),0x0;}const _0x474eb9=_0x327398||_0x39d077,{data:_0x457526}=await withSpinner(_0x1f2f4a(0x14e)+_0x338627+_0x1f2f4a(0x170),()=>_0x4efd75['llm'][_0x1f2f4a(0x142)](_0x338627,_0x474eb9,{'dryRun':!![]})),_0x43f6ae=_0x457526[_0x1f2f4a(0x1b9)][_0x1f2f4a(0x1a9)]['new']+_0x457526[_0x1f2f4a(0x1b9)][_0x1f2f4a(0x1ac)][_0x1f2f4a(0x185)]+_0x457526['counts'][_0x1f2f4a(0x16e)][_0x1f2f4a(0x185)]+_0x457526[_0x1f2f4a(0x1b9)]['prompts'][_0x1f2f4a(0x185)]+_0x457526[_0x1f2f4a(0x1b9)][_0x1f2f4a(0x1c9)][_0x1f2f4a(0x185)]+_0x457526[_0x1f2f4a(0x1b9)][_0x1f2f4a(0x19c)][_0x1f2f4a(0x185)]+_0x457526[_0x1f2f4a(0x1b9)][_0x1f2f4a(0x17a)][_0x1f2f4a(0x185)],_0x2b2f00=_0x457526[_0x1f2f4a(0x1b9)][_0x1f2f4a(0x1a9)][_0x1f2f4a(0x138)]+_0x457526['counts'][_0x1f2f4a(0x1ac)][_0x1f2f4a(0x138)]+_0x457526[_0x1f2f4a(0x1b9)][_0x1f2f4a(0x16e)][_0x1f2f4a(0x138)]+_0x457526[_0x1f2f4a(0x1b9)]['prompts'][_0x1f2f4a(0x138)]+_0x457526[_0x1f2f4a(0x1b9)]['integrations'][_0x1f2f4a(0x138)]+_0x457526[_0x1f2f4a(0x1b9)][_0x1f2f4a(0x19c)][_0x1f2f4a(0x138)]+_0x457526[_0x1f2f4a(0x1b9)][_0x1f2f4a(0x17a)]['updated'],_0x15d14e=_0x457526[_0x1f2f4a(0x1b9)]['agents'][_0x1f2f4a(0x1a7)]+_0x457526['counts'][_0x1f2f4a(0x1ac)][_0x1f2f4a(0x1a7)]+_0x457526[_0x1f2f4a(0x1b9)]['textKnowledgeBases'][_0x1f2f4a(0x1a7)]+_0x457526[_0x1f2f4a(0x1b9)][_0x1f2f4a(0x158)][_0x1f2f4a(0x1a7)]+_0x457526[_0x1f2f4a(0x1b9)][_0x1f2f4a(0x1c9)]['unchanged']+_0x457526[_0x1f2f4a(0x1b9)][_0x1f2f4a(0x19c)][_0x1f2f4a(0x1a7)]+_0x457526[_0x1f2f4a(0x1b9)]['experimentalArtifacts'][_0x1f2f4a(0x1a7)];console[_0x1f2f4a(0x190)](_0x1f2f4a(0x1bd)+_0x457526[_0x1f2f4a(0x149)]+'\x27:'),console['log']('\x20\x20'+a4_0x2b36da['green']('+\x20'+_0x43f6ae+_0x1f2f4a(0x184))+'\x20|\x20'+a4_0x2b36da[_0x1f2f4a(0x1b5)]('~\x20'+_0x2b2f00+_0x1f2f4a(0x174))+_0x1f2f4a(0x187)+a4_0x2b36da[_0x1f2f4a(0x140)]('=\x20'+_0x15d14e+_0x1f2f4a(0x18a))),console[_0x1f2f4a(0x190)]('\x20\x20Agents:\x20'+formatCountSummary(_0x457526[_0x1f2f4a(0x1b9)]['agents'])),console[_0x1f2f4a(0x190)](_0x1f2f4a(0x14d)+formatCountSummary(_0x457526[_0x1f2f4a(0x1b9)][_0x1f2f4a(0x1ac)])),console[_0x1f2f4a(0x190)](_0x1f2f4a(0x12d)+formatCountSummary(_0x457526[_0x1f2f4a(0x1b9)][_0x1f2f4a(0x16e)])),console[_0x1f2f4a(0x190)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x457526[_0x1f2f4a(0x1b9)][_0x1f2f4a(0x158)])),console[_0x1f2f4a(0x190)](_0x1f2f4a(0x1c8)+formatCountSummary(_0x457526['counts']['integrations']));const _0x263549=_0x457526['counts'][_0x1f2f4a(0x19c)][_0x1f2f4a(0x153)]>0x0||_0x457526[_0x1f2f4a(0x1b9)][_0x1f2f4a(0x17a)][_0x1f2f4a(0x153)]>0x0;_0x263549&&(console[_0x1f2f4a(0x190)](_0x1f2f4a(0x1a1)+formatCountSummary(_0x457526['counts'][_0x1f2f4a(0x19c)])),console[_0x1f2f4a(0x190)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x457526[_0x1f2f4a(0x1b9)][_0x1f2f4a(0x17a)])));console[_0x1f2f4a(0x190)](_0x1f2f4a(0x135)+a4_0x2b36da[_0x1f2f4a(0x19f)](_0x457526[_0x1f2f4a(0x125)])),displayDiffs(_0x457526['agents'],_0x457526[_0x1f2f4a(0x1ac)],_0x457526[_0x1f2f4a(0x16e)],_0x457526['prompts'],_0x457526[_0x1f2f4a(0x1c9)],_0x457526[_0x1f2f4a(0x19c)],_0x457526[_0x1f2f4a(0x17a)]);if(_0x2138c5)return console[_0x1f2f4a(0x190)](a4_0x2b36da['yellow'](_0x1f2f4a(0x11c))),0x0;if(_0x43f6ae===0x0&&_0x2b2f00===0x0)return console[_0x1f2f4a(0x190)](a4_0x2b36da[_0x1f2f4a(0x167)](_0x1f2f4a(0x139))),saveSessionContext({'llm_project':_0x457526[_0x1f2f4a(0x149)]},_0x2e7742[_0x1f2f4a(0x13f)]),console[_0x1f2f4a(0x190)](a4_0x2b36da['green'](_0x1f2f4a(0x1bf)+a4_0x2b36da['dim'](_0x1f2f4a(0x122))+_0x1f2f4a(0x11a)+a4_0x2b36da[_0x1f2f4a(0x19f)](_0x457526[_0x1f2f4a(0x149)]))),0x0;if(!_0x51afab&&!_0x59f95e){if(!isInteractive())return console['error'](a4_0x2b36da[_0x1f2f4a(0x150)](_0x1f2f4a(0x128)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x1f2f4a(0x1c7)](a4_0x2b36da[_0x1f2f4a(0x140)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x1c8fcb=await confirmKey(_0x1f2f4a(0x179)+(_0x43f6ae+_0x2b2f00)+_0x1f2f4a(0x165));if(!_0x1c8fcb)return console[_0x1f2f4a(0x190)](a4_0x2b36da[_0x1f2f4a(0x1b5)]('Cancelled'),'-\x20no\x20files\x20written'),0x1;}const {data:_0x446025}=await withSpinner(_0x1f2f4a(0x18d),()=>_0x4efd75[_0x1f2f4a(0x162)][_0x1f2f4a(0x142)](_0x338627,_0x474eb9,{'force':_0x59f95e}));return console['log'](a4_0x2b36da[_0x1f2f4a(0x167)]('\x0a✔\x20Pulled\x20'+(_0x43f6ae+_0x2b2f00)+_0x1f2f4a(0x1a3)+_0x446025[_0x1f2f4a(0x125)])),saveSessionContext({'llm_project':_0x446025[_0x1f2f4a(0x149)]},_0x2e7742[_0x1f2f4a(0x13f)]),console[_0x1f2f4a(0x190)](a4_0x2b36da[_0x1f2f4a(0x167)]('✔\x20Context\x20set:\x20'+a4_0x2b36da[_0x1f2f4a(0x140)](_0x1f2f4a(0x122))+'\x20=\x20'+a4_0x2b36da[_0x1f2f4a(0x19f)](_0x446025[_0x1f2f4a(0x149)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x59ba5d(0x15d)]='agent:clone';[a4_0x59ba5d(0x11e)]=a4_0x59ba5d(0x193);async[a4_0x59ba5d(0x151)](_0x462acf){const _0x499706=a4_0x59ba5d,{options:_0x4fd79d,args:_0xe2e9d4,tdx:_0x490a86}=_0x462acf,_0x3f5190=_0xe2e9d4[0x0],_0x2e3d49=_0x4fd79d[_0x499706(0x15d)],_0x1acac2=_0x4fd79d[_0x499706(0x17d)],_0x461eb3=_0x4fd79d[_0x499706(0x1af)],_0x1a92d5=_0x4fd79d[_0x499706(0x16d)],_0x368966=_0x4fd79d[_0x499706(0x1a4)];let _0x1776f8;const _0x84a26a=findAgentConfigPath(process[_0x499706(0x14f)]());if(_0x3f5190){const _0x1aedab=a4_0x4a5513['join'](_0x3f5190,_0x499706(0x19e));existsSync(_0x1aedab)?(_0x1776f8=_0x3f5190,console[_0x499706(0x190)](a4_0x2b36da[_0x499706(0x140)]('Using\x20local\x20project:\x20'+_0x3f5190))):_0x1776f8=_0x3f5190;}else{if(_0x84a26a)_0x1776f8=a4_0x4a5513['dirname'](_0x84a26a),console[_0x499706(0x190)](a4_0x2b36da['dim']('Using\x20current\x20project:\x20'+_0x1776f8));else{if(_0x368966){const _0x6cb08b=sanitizeForFilesystem(_0x368966);let _0x1a6958=_0x6cb08b,_0x51b3a2=a4_0x4a5513[_0x499706(0x1ad)](process[_0x499706(0x14f)](),_0x499706(0x1a9),_0x6cb08b,_0x499706(0x19e));if(!existsSync(_0x51b3a2)){const _0x14aa1c=normalizeName(_0x368966),_0x1994c0=a4_0x4a5513[_0x499706(0x1ad)](process[_0x499706(0x14f)](),_0x499706(0x1a9),_0x14aa1c,'tdx.json');existsSync(_0x1994c0)&&(_0x1a6958=_0x14aa1c,_0x51b3a2=_0x1994c0);}if(existsSync(_0x51b3a2))_0x1776f8=a4_0x4a5513[_0x499706(0x176)](_0x51b3a2),console['log'](a4_0x2b36da[_0x499706(0x140)](_0x499706(0x196)+_0x1776f8));else{const _0x5c32cc=_0x4fd79d[_0x499706(0x199)];if(_0x5c32cc)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x499706(0x1b7)+_0x368966+'\x22\x20to\x20a\x20different\x20profile',undefined,{'helpText':_0x499706(0x12c)+'First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a'+(_0x499706(0x18f)+_0x368966+'\x0a')+(_0x499706(0x17f)+_0x1a6958+_0x499706(0x127)+(_0x2e3d49||_0x499706(0x152))+_0x499706(0x141)+_0x5c32cc)});_0x1776f8=_0x368966,console[_0x499706(0x190)](a4_0x2b36da[_0x499706(0x140)](_0x499706(0x1a5)+_0x368966));}}}}if(!_0x1776f8)return console[_0x499706(0x190)](a4_0x2b36da[_0x499706(0x1b5)](_0x499706(0x1b4))),console[_0x499706(0x190)](_0x499706(0x1c2)),console[_0x499706(0x190)](_0x499706(0x154)),console[_0x499706(0x190)]('\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'](_0x499706(0x16a)),0x1;if(!_0x2e3d49)throw new SDKError(ErrorCode[_0x499706(0x156)],_0x499706(0x144),undefined,{'helpText':_0x499706(0x131)});if(!_0x461eb3&&!_0x1acac2){if(!isInteractive())return console[_0x499706(0x1c7)](a4_0x2b36da[_0x499706(0x150)](_0x499706(0x128)),_0x499706(0x18e)),console['error'](a4_0x2b36da[_0x499706(0x140)](_0x499706(0x136))),0x1;const _0x53d7c5=await confirmKey(_0x499706(0x11b)+_0x1776f8+'\x22\x20to\x20new\x20project\x20\x22'+_0x2e3d49+'\x22?');if(!_0x53d7c5)return console[_0x499706(0x190)](a4_0x2b36da[_0x499706(0x1b5)](_0x499706(0x186))),0x1;}const {data:_0x55fbdf}=await withSpinner('Cloning\x20\x22'+_0x1776f8+'\x22\x20to\x20\x22'+_0x2e3d49+'\x22...',()=>_0x490a86[_0x499706(0x162)][_0x499706(0x133)](_0x1776f8,_0x2e3d49,{'dryRun':_0x1acac2}));if(_0x1acac2){console[_0x499706(0x190)](a4_0x2b36da[_0x499706(0x1b5)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x499706(0x190)](_0x499706(0x19d)+_0x55fbdf['sourceProjectName']),console['log'](_0x499706(0x164)+_0x2e3d49),console[_0x499706(0x190)](_0x499706(0x19a)),console[_0x499706(0x190)](_0x499706(0x14c)+_0x55fbdf[_0x499706(0x1b9)][_0x499706(0x1a9)][_0x499706(0x120)]),console['log']('\x20\x20Knowledge\x20Bases:\x20'+_0x55fbdf[_0x499706(0x1b9)][_0x499706(0x1ac)][_0x499706(0x120)]),console[_0x499706(0x190)](_0x499706(0x11f)+_0x55fbdf['counts'][_0x499706(0x158)][_0x499706(0x120)]);const _0x2a03e6=_0x55fbdf['counts'][_0x499706(0x19c)][_0x499706(0x120)]>0x0||_0x55fbdf[_0x499706(0x1b9)][_0x499706(0x17a)][_0x499706(0x120)]>0x0;return _0x2a03e6&&(console['log'](_0x499706(0x1a1)+_0x55fbdf[_0x499706(0x1b9)][_0x499706(0x19c)][_0x499706(0x120)]),console[_0x499706(0x190)]('\x20\x20Experimental\x20Artifacts:\x20'+_0x55fbdf[_0x499706(0x1b9)][_0x499706(0x17a)]['created'])),0x0;}const _0x541e20=_0x55fbdf['counts'][_0x499706(0x1a9)]['errors']>0x0||_0x55fbdf[_0x499706(0x1b9)][_0x499706(0x1ac)][_0x499706(0x13a)]>0x0||_0x55fbdf[_0x499706(0x1b9)][_0x499706(0x158)][_0x499706(0x13a)]>0x0||_0x55fbdf[_0x499706(0x1b9)][_0x499706(0x19c)][_0x499706(0x13a)]>0x0||_0x55fbdf[_0x499706(0x1b9)][_0x499706(0x17a)][_0x499706(0x13a)]>0x0;_0x541e20?console[_0x499706(0x190)](a4_0x2b36da[_0x499706(0x1b5)](_0x499706(0x16c))):console[_0x499706(0x190)](a4_0x2b36da[_0x499706(0x167)]('Project\x20cloned\x20successfully'));console[_0x499706(0x190)](_0x499706(0x19d)+_0x55fbdf[_0x499706(0x188)]),console[_0x499706(0x190)](_0x499706(0x164)+_0x55fbdf[_0x499706(0x148)]),console['log'](_0x499706(0x181)+_0x55fbdf[_0x499706(0x1be)]),console[_0x499706(0x190)](),console[_0x499706(0x190)](_0x499706(0x12f)),console[_0x499706(0x190)]('\x20\x20Agents:\x20'+formatCountSummary(_0x55fbdf[_0x499706(0x1b9)]['agents'])),console[_0x499706(0x190)](_0x499706(0x14d)+formatCountSummary(_0x55fbdf['counts'][_0x499706(0x1ac)])),console['log'](_0x499706(0x11f)+formatCountSummary(_0x55fbdf['counts'][_0x499706(0x158)])),console[_0x499706(0x190)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x55fbdf[_0x499706(0x1b9)][_0x499706(0x1c9)]));const _0x4080f7=_0x55fbdf[_0x499706(0x1b9)]['experimentalKnowledgeBases'][_0x499706(0x120)]>0x0||_0x55fbdf['counts']['experimentalKnowledgeBases']['updated']>0x0||_0x55fbdf[_0x499706(0x1b9)]['experimentalKnowledgeBases'][_0x499706(0x1a7)]>0x0||_0x55fbdf[_0x499706(0x1b9)][_0x499706(0x17a)][_0x499706(0x120)]>0x0||_0x55fbdf['counts']['experimentalArtifacts'][_0x499706(0x138)]>0x0||_0x55fbdf[_0x499706(0x1b9)]['experimentalArtifacts'][_0x499706(0x1a7)]>0x0;_0x4080f7&&(console['log'](_0x499706(0x1a1)+formatCountSummary(_0x55fbdf[_0x499706(0x1b9)][_0x499706(0x19c)])),console[_0x499706(0x190)](_0x499706(0x163)+formatCountSummary(_0x55fbdf[_0x499706(0x1b9)][_0x499706(0x17a)])));if(_0x541e20){console[_0x499706(0x190)](),console['log'](a4_0x2b36da[_0x499706(0x150)](_0x499706(0x17e)));for(const _0x2e7d05 of _0x55fbdf[_0x499706(0x1a9)]){_0x2e7d05[_0x499706(0x14a)]==='error'&&console[_0x499706(0x190)](a4_0x2b36da[_0x499706(0x150)]('\x20\x20Agent\x20\x22'+_0x2e7d05[_0x499706(0x1c3)]+'\x22:\x20'+_0x2e7d05[_0x499706(0x1c7)]));}for(const _0x42c8b0 of _0x55fbdf[_0x499706(0x1ac)]){_0x42c8b0[_0x499706(0x14a)]===_0x499706(0x1c7)&&console['log'](a4_0x2b36da[_0x499706(0x150)](_0x499706(0x1b1)+_0x42c8b0['name']+_0x499706(0x15a)+_0x42c8b0[_0x499706(0x1c7)]));}for(const _0x4cb1c7 of _0x55fbdf[_0x499706(0x158)]){_0x4cb1c7[_0x499706(0x14a)]===_0x499706(0x1c7)&&console[_0x499706(0x190)](a4_0x2b36da['red']('\x20\x20Prompt\x20\x22'+_0x4cb1c7[_0x499706(0x15d)]+_0x499706(0x15a)+_0x4cb1c7[_0x499706(0x1c7)]));}for(const _0x2c926c of _0x55fbdf['integrations']){_0x2c926c[_0x499706(0x14a)]===_0x499706(0x1c7)&&console[_0x499706(0x190)](a4_0x2b36da[_0x499706(0x150)](_0x499706(0x169)+_0x2c926c[_0x499706(0x15d)]+_0x499706(0x15a)+_0x2c926c[_0x499706(0x1c7)]));}for(const _0x4af424 of _0x55fbdf[_0x499706(0x19c)]){_0x4af424[_0x499706(0x14a)]===_0x499706(0x1c7)&&console[_0x499706(0x190)](a4_0x2b36da[_0x499706(0x150)](_0x499706(0x1c4)+_0x4af424['name']+_0x499706(0x15a)+_0x4af424['error']));}for(const _0xb7e046 of _0x55fbdf[_0x499706(0x17a)]){_0xb7e046['action']===_0x499706(0x1c7)&&console[_0x499706(0x190)](a4_0x2b36da[_0x499706(0x150)]('\x20\x20Experimental\x20Artifact\x20\x22'+_0xb7e046[_0x499706(0x15d)]+_0x499706(0x15a)+_0xb7e046['error']));}return 0x1;}console[_0x499706(0x190)]();const _0x3cfc43=getLLMProjectUrl(_0x1a92d5,_0x55fbdf[_0x499706(0x1be)]);return console[_0x499706(0x190)](_0x499706(0x12e)+a4_0x2b36da['cyan'](_0x3cfc43)),0x0;}}export class AgentPushCommand extends BaseCommand{['name']=a4_0x59ba5d(0x1b2);[a4_0x59ba5d(0x11e)]=a4_0x59ba5d(0x13c);async[a4_0x59ba5d(0x151)](_0x427586){const _0x4a1e49=a4_0x59ba5d,{options:_0x3a6882,args:_0x658145,tdx:_0x26b04e}=_0x427586;let _0x5ce224=_0x658145[0x0]||process['cwd']();const _0x2b8ee1=_0x3a6882[_0x4a1e49(0x17d)],_0x56d368=_0x3a6882[_0x4a1e49(0x121)],_0x3e5772=_0x3a6882[_0x4a1e49(0x1af)],_0x2eb975=_0x3a6882['site'],_0xfc6828=a4_0x4a5513[_0x4a1e49(0x1ad)](_0x5ce224,'agent.yml'),_0x5d3111=existsSync(_0xfc6828);if(_0x5d3111){const {data:_0x3674e6}=await withSpinner(_0x4a1e49(0x1cb)+_0x5ce224+_0x4a1e49(0x170),()=>_0x26b04e['llm'][_0x4a1e49(0x1aa)](_0x5ce224,{'dryRun':_0x2b8ee1,'force':_0x56d368}));if(_0x2b8ee1)return console['log'](a4_0x2b36da[_0x4a1e49(0x1b5)](_0x4a1e49(0x1c0))),console[_0x4a1e49(0x190)](_0x4a1e49(0x18b)+_0x3674e6[_0x4a1e49(0x1c3)]),0x0;if(_0x3674e6[_0x4a1e49(0x14a)]===_0x4a1e49(0x1c7))return console[_0x4a1e49(0x190)](a4_0x2b36da[_0x4a1e49(0x150)](_0x4a1e49(0x195)+_0x3674e6[_0x4a1e49(0x1c7)])),0x1;console[_0x4a1e49(0x190)](a4_0x2b36da[_0x4a1e49(0x167)]('Agent\x20'+_0x3674e6[_0x4a1e49(0x14a)]+_0x4a1e49(0x126))),console[_0x4a1e49(0x190)](_0x4a1e49(0x134)+_0x3674e6['agentName']);if(_0x3674e6[_0x4a1e49(0x1ab)]&&_0x3674e6[_0x4a1e49(0x197)]){const _0x168ad9=getLLMAgentChatUrl(_0x2eb975,_0x3674e6[_0x4a1e49(0x197)],_0x3674e6[_0x4a1e49(0x1ab)]);console[_0x4a1e49(0x190)]('Chat:\x20'+a4_0x2b36da[_0x4a1e49(0x19f)](_0x168ad9));}return 0x0;}const _0x4206f6=_0x3a6882[_0x4a1e49(0x1a4)],_0x436c02=resolveProjectFromContext(_0x5ce224,_0x4206f6);if(_0x436c02[_0x4a1e49(0x1b3)])_0x5ce224=_0x436c02[_0x4a1e49(0x191)],_0x436c02[_0x4a1e49(0x123)]===_0x4a1e49(0x1a8)&&console[_0x4a1e49(0x190)](a4_0x2b36da[_0x4a1e49(0x140)](_0x4a1e49(0x1c6)+_0x5ce224));else{let _0x49cb01=_0x4a1e49(0x159);_0x436c02[_0x4a1e49(0x130)]===_0x4a1e49(0x145)&&(_0x49cb01=_0x436c02[_0x4a1e49(0x1b8)]+_0x4a1e49(0x1bb)+_0x436c02[_0x4a1e49(0x1a4)]+'\x27\x20to\x20create\x20the\x20folder\x20structure.');throw new SDKError(ErrorCode[_0x4a1e49(0x19b)],_0x436c02['reason']===_0x4a1e49(0x192)?_0x436c02[_0x4a1e49(0x1b8)]:_0x4a1e49(0x15e)+_0x5ce224,undefined,{'helpText':_0x49cb01});}const {data:_0x1e5fe8}=await withSpinner(_0x4a1e49(0x16f),()=>_0x26b04e[_0x4a1e49(0x162)][_0x4a1e49(0x182)](_0x5ce224,{'dryRun':!![]})),_0x111062=_0x1e5fe8[_0x4a1e49(0x1b9)][_0x4a1e49(0x1a9)][_0x4a1e49(0x13a)]>0x0;if(_0x111062){console[_0x4a1e49(0x190)](a4_0x2b36da[_0x4a1e49(0x150)](_0x4a1e49(0x1ae)));for(const _0x460bd7 of _0x1e5fe8[_0x4a1e49(0x1a9)]){_0x460bd7['action']===_0x4a1e49(0x1c7)&&console[_0x4a1e49(0x190)](a4_0x2b36da['red'](_0x4a1e49(0x173)+_0x460bd7[_0x4a1e49(0x1c3)]+_0x4a1e49(0x15a)+_0x460bd7[_0x4a1e49(0x1c7)]));}return 0x1;}const _0x1d2df0=_0x1e5fe8[_0x4a1e49(0x1b9)]['agents']['created']+_0x1e5fe8[_0x4a1e49(0x1b9)][_0x4a1e49(0x1ac)][_0x4a1e49(0x120)]+_0x1e5fe8['counts'][_0x4a1e49(0x16e)][_0x4a1e49(0x120)]+_0x1e5fe8[_0x4a1e49(0x1b9)]['prompts'][_0x4a1e49(0x120)]+_0x1e5fe8[_0x4a1e49(0x1b9)][_0x4a1e49(0x1c9)][_0x4a1e49(0x120)]+_0x1e5fe8['counts'][_0x4a1e49(0x19c)][_0x4a1e49(0x120)]+_0x1e5fe8['counts'][_0x4a1e49(0x17a)][_0x4a1e49(0x120)],_0x473149=_0x1e5fe8['counts']['agents'][_0x4a1e49(0x138)]+_0x1e5fe8['counts'][_0x4a1e49(0x1ac)]['updated']+_0x1e5fe8['counts'][_0x4a1e49(0x16e)][_0x4a1e49(0x138)]+_0x1e5fe8[_0x4a1e49(0x1b9)][_0x4a1e49(0x158)][_0x4a1e49(0x138)]+_0x1e5fe8[_0x4a1e49(0x1b9)][_0x4a1e49(0x1c9)]['updated']+_0x1e5fe8[_0x4a1e49(0x1b9)][_0x4a1e49(0x19c)]['updated']+_0x1e5fe8[_0x4a1e49(0x1b9)]['experimentalArtifacts'][_0x4a1e49(0x138)],_0xc60e5a=_0x1e5fe8[_0x4a1e49(0x1b9)]['agents'][_0x4a1e49(0x1a7)]+_0x1e5fe8[_0x4a1e49(0x1b9)][_0x4a1e49(0x1ac)][_0x4a1e49(0x1a7)]+_0x1e5fe8['counts']['textKnowledgeBases'][_0x4a1e49(0x1a7)]+_0x1e5fe8[_0x4a1e49(0x1b9)][_0x4a1e49(0x158)][_0x4a1e49(0x1a7)]+_0x1e5fe8[_0x4a1e49(0x1b9)]['integrations'][_0x4a1e49(0x1a7)]+_0x1e5fe8['counts']['experimentalKnowledgeBases'][_0x4a1e49(0x1a7)]+_0x1e5fe8[_0x4a1e49(0x1b9)][_0x4a1e49(0x17a)][_0x4a1e49(0x1a7)];console[_0x4a1e49(0x190)](_0x4a1e49(0x198)+_0x1e5fe8['projectName']+'\x27:'),console[_0x4a1e49(0x190)]('\x20\x20'+a4_0x2b36da[_0x4a1e49(0x167)]('+\x20'+_0x1d2df0+_0x4a1e49(0x184))+_0x4a1e49(0x187)+a4_0x2b36da['yellow']('~\x20'+_0x473149+_0x4a1e49(0x174))+_0x4a1e49(0x187)+a4_0x2b36da[_0x4a1e49(0x140)]('=\x20'+_0xc60e5a+'\x20unchanged')),console[_0x4a1e49(0x190)](_0x4a1e49(0x14c)+formatCountSummary(_0x1e5fe8[_0x4a1e49(0x1b9)]['agents'])),console['log']('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x1e5fe8[_0x4a1e49(0x1b9)][_0x4a1e49(0x1ac)])),console['log'](_0x4a1e49(0x12d)+formatCountSummary(_0x1e5fe8[_0x4a1e49(0x1b9)][_0x4a1e49(0x16e)])),console[_0x4a1e49(0x190)](_0x4a1e49(0x11f)+formatCountSummary(_0x1e5fe8[_0x4a1e49(0x1b9)][_0x4a1e49(0x158)])),console[_0x4a1e49(0x190)](_0x4a1e49(0x1c8)+formatCountSummary(_0x1e5fe8['counts']['integrations']));const _0x382c39=_0x1e5fe8[_0x4a1e49(0x1b9)]['experimentalKnowledgeBases'][_0x4a1e49(0x120)]>0x0||_0x1e5fe8[_0x4a1e49(0x1b9)]['experimentalKnowledgeBases'][_0x4a1e49(0x138)]>0x0||_0x1e5fe8['counts'][_0x4a1e49(0x19c)][_0x4a1e49(0x1a7)]>0x0||_0x1e5fe8[_0x4a1e49(0x1b9)][_0x4a1e49(0x17a)][_0x4a1e49(0x120)]>0x0||_0x1e5fe8[_0x4a1e49(0x1b9)]['experimentalArtifacts'][_0x4a1e49(0x138)]>0x0||_0x1e5fe8[_0x4a1e49(0x1b9)][_0x4a1e49(0x17a)][_0x4a1e49(0x1a7)]>0x0;_0x382c39&&(console[_0x4a1e49(0x190)](_0x4a1e49(0x1a1)+formatCountSummary(_0x1e5fe8['counts'][_0x4a1e49(0x19c)])),console[_0x4a1e49(0x190)](_0x4a1e49(0x163)+formatCountSummary(_0x1e5fe8[_0x4a1e49(0x1b9)]['experimentalArtifacts'])));console[_0x4a1e49(0x190)](_0x4a1e49(0x160)+a4_0x2b36da['cyan'](_0x5ce224)),displayDiffs(_0x1e5fe8['agents'],_0x1e5fe8[_0x4a1e49(0x1ac)],_0x1e5fe8[_0x4a1e49(0x16e)],_0x1e5fe8[_0x4a1e49(0x158)],_0x1e5fe8[_0x4a1e49(0x1c9)],_0x1e5fe8['experimentalKnowledgeBases'],_0x1e5fe8[_0x4a1e49(0x17a)]);if(_0x2b8ee1)return console[_0x4a1e49(0x190)](a4_0x2b36da[_0x4a1e49(0x1b5)](_0x4a1e49(0x168))),0x0;if(_0x1d2df0===0x0&&_0x473149===0x0){console[_0x4a1e49(0x190)](a4_0x2b36da[_0x4a1e49(0x167)](_0x4a1e49(0x146)));const _0xb65f43=getLLMProjectUrl(_0x2eb975,_0x1e5fe8[_0x4a1e49(0x197)]);return console[_0x4a1e49(0x190)](_0x4a1e49(0x12e)+a4_0x2b36da[_0x4a1e49(0x19f)](_0xb65f43)),0x0;}if(!_0x3e5772&&!_0x56d368){if(!isInteractive())return console['error'](a4_0x2b36da[_0x4a1e49(0x150)](_0x4a1e49(0x128)),_0x4a1e49(0x18e)),console[_0x4a1e49(0x1c7)](a4_0x2b36da[_0x4a1e49(0x140)](_0x4a1e49(0x136))),0x1;const _0x3ea356=await confirmKey(_0x4a1e49(0x11d)+(_0x1d2df0+_0x473149)+_0x4a1e49(0x189));if(!_0x3ea356)return console['log'](a4_0x2b36da[_0x4a1e49(0x1b5)]('Cancelled'),'-\x20nothing\x20pushed'),0x1;}const {data:_0x3202f4}=await withSpinner(_0x4a1e49(0x17c),()=>_0x26b04e[_0x4a1e49(0x162)][_0x4a1e49(0x182)](_0x5ce224,{'force':_0x56d368})),_0x1e3826=_0x3202f4[_0x4a1e49(0x1b9)][_0x4a1e49(0x1a9)]['errors']>0x0||_0x3202f4[_0x4a1e49(0x1b9)]['knowledgeBases']['errors']>0x0||_0x3202f4[_0x4a1e49(0x1b9)][_0x4a1e49(0x16e)][_0x4a1e49(0x13a)]>0x0||_0x3202f4[_0x4a1e49(0x1b9)][_0x4a1e49(0x158)][_0x4a1e49(0x13a)]>0x0;if(_0x1e3826){console[_0x4a1e49(0x190)](a4_0x2b36da['yellow'](_0x4a1e49(0x129))),console[_0x4a1e49(0x190)](),console[_0x4a1e49(0x190)](a4_0x2b36da[_0x4a1e49(0x150)](_0x4a1e49(0x17e)));for(const _0x33d4d3 of _0x3202f4[_0x4a1e49(0x1a9)]){_0x33d4d3[_0x4a1e49(0x14a)]===_0x4a1e49(0x1c7)&&console['log'](a4_0x2b36da[_0x4a1e49(0x150)](_0x4a1e49(0x173)+_0x33d4d3[_0x4a1e49(0x1c3)]+'\x22:\x20'+_0x33d4d3['error']));}for(const _0x479424 of _0x3202f4[_0x4a1e49(0x1ac)]){_0x479424[_0x4a1e49(0x14a)]===_0x4a1e49(0x1c7)&&console[_0x4a1e49(0x190)](a4_0x2b36da[_0x4a1e49(0x150)](_0x4a1e49(0x1b1)+_0x479424[_0x4a1e49(0x15d)]+_0x4a1e49(0x15a)+_0x479424[_0x4a1e49(0x1c7)]));}for(const _0x33df2e of _0x3202f4[_0x4a1e49(0x16e)]){_0x33df2e['action']===_0x4a1e49(0x1c7)&&console[_0x4a1e49(0x190)](a4_0x2b36da[_0x4a1e49(0x150)](_0x4a1e49(0x166)+_0x33df2e[_0x4a1e49(0x15d)]+_0x4a1e49(0x15a)+_0x33df2e[_0x4a1e49(0x1c7)]));}for(const _0x43dd2f of _0x3202f4['prompts']){_0x43dd2f['action']===_0x4a1e49(0x1c7)&&console[_0x4a1e49(0x190)](a4_0x2b36da[_0x4a1e49(0x150)](_0x4a1e49(0x1ca)+_0x43dd2f[_0x4a1e49(0x15d)]+_0x4a1e49(0x15a)+_0x43dd2f[_0x4a1e49(0x1c7)]));}for(const _0x7c33b7 of _0x3202f4['integrations']){_0x7c33b7[_0x4a1e49(0x14a)]===_0x4a1e49(0x1c7)&&console['log'](a4_0x2b36da['red'](_0x4a1e49(0x169)+_0x7c33b7[_0x4a1e49(0x15d)]+_0x4a1e49(0x15a)+_0x7c33b7['error']));}return 0x1;}console[_0x4a1e49(0x190)](a4_0x2b36da[_0x4a1e49(0x167)]('\x0a✔\x20Pushed\x20'+(_0x1d2df0+_0x473149)+_0x4a1e49(0x13b)+_0x3202f4['projectName']+'\x27'));const _0x5be5c7=getLLMProjectUrl(_0x2eb975,_0x3202f4[_0x4a1e49(0x197)]);return console[_0x4a1e49(0x190)]('Project:\x20'+a4_0x2b36da[_0x4a1e49(0x19f)](_0x5be5c7)),0x0;}}
1
+ const a4_0x1bde89=a4_0x5dd1;(function(_0x1c1c86,_0x8c4e82){const _0x373ac9=a4_0x5dd1,_0xc2cb2b=_0x1c1c86();while(!![]){try{const _0x38b1bd=-parseInt(_0x373ac9(0x1b0))/0x1+-parseInt(_0x373ac9(0x148))/0x2+parseInt(_0x373ac9(0x127))/0x3*(parseInt(_0x373ac9(0x1ce))/0x4)+parseInt(_0x373ac9(0x166))/0x5*(-parseInt(_0x373ac9(0x1a6))/0x6)+-parseInt(_0x373ac9(0x134))/0x7+parseInt(_0x373ac9(0x170))/0x8*(-parseInt(_0x373ac9(0x11c))/0x9)+parseInt(_0x373ac9(0x19e))/0xa;if(_0x38b1bd===_0x8c4e82)break;else _0xc2cb2b['push'](_0xc2cb2b['shift']());}catch(_0x4a2bb8){_0xc2cb2b['push'](_0xc2cb2b['shift']());}}}(a4_0x1fa9,0xd77c2));import a4_0x47e7d2 from'chalk';import a4_0x170d36 from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext}from'../sdk/agent/agent-config.js';function a4_0x1fa9(){const _0x35a133=['reason','\x0a✔\x20Pushed\x20','profile','pullProject','agent:pull','\x20files\x20to\x20','llm_project','agent.yml','Agent\x20pulled\x20successfully','Agent\x20','cyan','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','Output\x20path:\x20','2043410aMLCYO','no_local_folder','pushProject','\x27\x20to\x20create\x20the\x20folder\x20structure.','execute','Status:\x20','experimentalKnowledgeBases','\x20\x20Integration\x20\x22','action','found','Would\x20pull\x20agent:\x20','pullAgent','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','agent:push','\x20\x20Agent\x20\x22','\x20\x20Text\x20Knowledge\x20Bases:\x20','\x20resources\x20to\x20\x27','llm','agent:clone','New\x20project:\x20','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','Analyzing\x20project\x20\x22','\x20=\x20','No\x20tdx.json\x20found\x20in\x20','\x20\x20Source:\x20','llmProject','new','experimentalArtifacts','Source:\x20','\x0aErrors\x20found:','70ghaHIQ','errors','\x0aChanges\x20to\x20agent\x20\x27','Errors:','cwd','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','\x20\x20tdx\x20agent\x20pull\x20','unchanged','source','agentId','878112WNacqB','\x20new','session','outputPath','Clone\x20\x22','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','error','cloneProject','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','\x0aProject\x20pushed\x20with\x20errors','Pulling\x20agent\x20\x22','dryRun','\x20resources?','site','dirname','\x0aError:','counts','\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)','dim','\x20updated','log','\x22\x20to\x20\x22','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','sourceProjectName','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','\x0a✔\x20Pulled\x20','\x0aChanges\x20to\x20integration\x20\x27','Using\x20local\x20project:\x20','created','\x20\x20Experimental\x20Artifact\x20\x22','\x20\x20Experimental\x20Artifacts:\x20','Using\x20context\x20project:\x20','tdx.json','agentName','\x20\x20Knowledge\x20Bases:\x20','textKnowledgeBases','Agent:\x20','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20#\x20Pull\x20specific\x20agent','Failed\x20to\x20push\x20agent:\x20','\x20\x20Prompt\x20\x22','Summary:','red','\x20unchanged','42006070JVVjAa','<new-name>','yellow','integrations','\x22\x20to\x20new\x20project\x20\x22','\x0aChanges\x20to\x20prompt\x20\x27','context','gray','92820zHoIVB','\x20\x20Integrations:\x20','Using\x20project:\x20','updated','description','prompts','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','force','Pushing\x20agent\x20from\x20\x22','\x20\x20Target:\x20','1642194kAwVva','Pushing\x20to\x20project...','knowledgeBases','\x22...','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','total','New\x20project\x20ID:\x20','message','Dry\x20run\x20-\x20no\x20files\x20written','\x20errors','\x20\x20Text\x20Knowledge\x20Base\x20\x22','name','\x20\x20Knowledge\x20Base\x20\x22','Cancelled','newProjectName','\x20\x20Prompts:\x20','\x20\x20tdx\x20agent\x20clone\x20agents/','pushAgent','Would\x20push\x20agent:\x20','\x20created','\x20--profile\x20','\x22\x20from\x20project\x20\x22','Dry\x20run\x20-\x20no\x20changes\x20made','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','Would\x20clone:','newProjectId','\x20|\x20','\x20\x20Agents:\x20','\x0aPush\x20','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','6439612iLTOlH','Project:\x20','green','New\x20project\x20name\x20is\x20required','projectName','projectDir','Project\x20cloned\x20with\x20errors','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','yes','126VWsjut','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','\x0aChanges:','projectId','Chat:\x20','✔\x20Context\x20set:\x20','agents','Project\x20cloned\x20successfully','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','INVALID_ARGUMENT','\x22:\x20','3FKbzCs','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20total','repeat','MISSING_ARGUMENT','parse','no_context','push','\x22\x20to\x20a\x20different\x20profile','outputDir','diff','Analyzing\x20changes\x20to\x20push...','Using\x20project\x20from\x20','3574963bBcWsp','Using\x20current\x20project:\x20','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','\x20--name\x20','join','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','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)'];a4_0x1fa9=function(){return _0x35a133;};return a4_0x1fa9();}import{saveSessionContext}from'../core/session.js';import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x4309d5){const _0x25690e=a4_0x5dd1,_0x57edd6=[];if(_0x4309d5['total']!==undefined)_0x57edd6[_0x25690e(0x12e)](_0x4309d5[_0x25690e(0x1b5)]+_0x25690e(0x129));if(_0x4309d5[_0x25690e(0x162)]!==undefined&&_0x4309d5[_0x25690e(0x162)]>0x0)_0x57edd6[_0x25690e(0x12e)](a4_0x47e7d2[_0x25690e(0x1d0)](_0x4309d5[_0x25690e(0x162)]+_0x25690e(0x171)));if(_0x4309d5[_0x25690e(0x18d)]!==undefined&&_0x4309d5[_0x25690e(0x18d)]>0x0)_0x57edd6[_0x25690e(0x12e)](a4_0x47e7d2[_0x25690e(0x1d0)](_0x4309d5[_0x25690e(0x18d)]+_0x25690e(0x1c3)));if(_0x4309d5[_0x25690e(0x1a9)]!==undefined&&_0x4309d5[_0x25690e(0x1a9)]>0x0)_0x57edd6['push'](a4_0x47e7d2[_0x25690e(0x1a0)](_0x4309d5[_0x25690e(0x1a9)]+_0x25690e(0x183)));if(_0x4309d5[_0x25690e(0x16d)]!==undefined&&_0x4309d5[_0x25690e(0x16d)]>0x0)_0x57edd6[_0x25690e(0x12e)](a4_0x47e7d2[_0x25690e(0x1a5)](_0x4309d5[_0x25690e(0x16d)]+_0x25690e(0x19d)));if(_0x4309d5[_0x25690e(0x167)]!==undefined&&_0x4309d5[_0x25690e(0x167)]>0x0)_0x57edd6[_0x25690e(0x12e)](a4_0x47e7d2[_0x25690e(0x19c)](_0x4309d5[_0x25690e(0x167)]+_0x25690e(0x1b9)));return _0x57edd6[_0x25690e(0x138)](',\x20');}function displayDiffs(_0x50bf60,_0xafeb17,_0xcfd99f,_0x4fe973,_0x1206f1,_0x2e3cc9,_0x3db751){const _0x197628=a4_0x5dd1;for(const _0x17b567 of _0x50bf60){if(_0x17b567[_0x197628(0x131)]){const _0x3ba370=_0x17b567[_0x197628(0x192)]||_0x17b567[_0x197628(0x1bb)];console[_0x197628(0x184)](_0x197628(0x168)+_0x3ba370+'\x27:'),console[_0x197628(0x184)]('─'[_0x197628(0x12a)](0x3c)),console[_0x197628(0x184)](_0x17b567['diff']),console['log']('─'[_0x197628(0x12a)](0x3c));}}for(const _0x4b8943 of _0xafeb17){_0x4b8943[_0x197628(0x131)]&&(console[_0x197628(0x184)]('\x0aChanges\x20to\x20knowledge\x20base\x20\x27'+_0x4b8943[_0x197628(0x1bb)]+'\x27:'),console['log']('─'['repeat'](0x3c)),console[_0x197628(0x184)](_0x4b8943[_0x197628(0x131)]),console[_0x197628(0x184)]('─'[_0x197628(0x12a)](0x3c)));}for(const _0x4e6f45 of _0xcfd99f){_0x4e6f45[_0x197628(0x131)]&&(console[_0x197628(0x184)](_0x197628(0x139)+_0x4e6f45[_0x197628(0x1bb)]+'\x27:'),console[_0x197628(0x184)]('─'[_0x197628(0x12a)](0x3c)),console[_0x197628(0x184)](_0x4e6f45['diff']),console[_0x197628(0x184)]('─'[_0x197628(0x12a)](0x3c)));}for(const _0x3ad577 of _0x4fe973){_0x3ad577[_0x197628(0x131)]&&(console['log'](_0x197628(0x1a3)+_0x3ad577[_0x197628(0x1bb)]+'\x27:'),console[_0x197628(0x184)]('─'[_0x197628(0x12a)](0x3c)),console[_0x197628(0x184)](_0x3ad577[_0x197628(0x131)]),console[_0x197628(0x184)]('─'[_0x197628(0x12a)](0x3c)));}for(const _0x4041f4 of _0x1206f1){_0x4041f4[_0x197628(0x131)]&&(console['log'](_0x197628(0x18b)+_0x4041f4[_0x197628(0x1bb)]+'\x27:'),console[_0x197628(0x184)]('─'[_0x197628(0x12a)](0x3c)),console['log'](_0x4041f4[_0x197628(0x131)]),console[_0x197628(0x184)]('─'['repeat'](0x3c)));}for(const _0x3ed833 of _0x2e3cc9){_0x3ed833[_0x197628(0x131)]&&(console['log'](_0x197628(0x186)+_0x3ed833['name']+'\x27:'),console[_0x197628(0x184)]('─'[_0x197628(0x12a)](0x3c)),console[_0x197628(0x184)](_0x3ed833[_0x197628(0x131)]),console[_0x197628(0x184)]('─'[_0x197628(0x12a)](0x3c)));}for(const _0x4ca291 of _0x3db751){_0x4ca291['diff']&&(console[_0x197628(0x184)](_0x197628(0x136)+_0x4ca291[_0x197628(0x1bb)]+'\x27:'),console[_0x197628(0x184)]('─'['repeat'](0x3c)),console[_0x197628(0x184)](_0x4ca291[_0x197628(0x131)]),console['log']('─'[_0x197628(0x12a)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x1bde89(0x1bb)]=a4_0x1bde89(0x13f);['description']=a4_0x1bde89(0x1ac);async[a4_0x1bde89(0x14c)](_0x4a6d52){const _0x1cc6d2=a4_0x1bde89,{options:_0x84348f,args:_0x451b86,tdx:_0x193f3a}=_0x4a6d52,_0x26d678=_0x451b86[0x0],_0x583015=_0x451b86[0x1],_0x242d09=_0x84348f['output'],_0x455182=_0x84348f[_0x1cc6d2(0x17b)],_0x438977=_0x84348f[_0x1cc6d2(0x1ad)],_0x5da69b=_0x84348f['yes'],_0x247c91=_0x84348f['llmProject'];let _0x426fb8,_0x51cf64;const _0x3665ff=findAgentConfigPath(process['cwd']());if(_0x26d678){const _0x3b3cb0=a4_0x170d36[_0x1cc6d2(0x138)](_0x26d678,'tdx.json');if(existsSync(_0x3b3cb0))try{const _0x256c1f=JSON[_0x1cc6d2(0x12c)](readFileSync(_0x3b3cb0,'utf-8'));_0x426fb8=_0x256c1f[_0x1cc6d2(0x141)],_0x51cf64=_0x26d678,console[_0x1cc6d2(0x184)](a4_0x47e7d2[_0x1cc6d2(0x182)](_0x1cc6d2(0x133)+_0x3b3cb0+':\x20'+_0x426fb8));}catch{_0x426fb8=_0x26d678;}else _0x426fb8=_0x26d678;}else{if(_0x3665ff)try{const _0x2223ca=JSON[_0x1cc6d2(0x12c)](readFileSync(_0x3665ff,'utf-8'));_0x426fb8=_0x2223ca[_0x1cc6d2(0x141)],_0x51cf64=a4_0x170d36['dirname'](_0x3665ff),console[_0x1cc6d2(0x184)](a4_0x47e7d2[_0x1cc6d2(0x182)](_0x1cc6d2(0x1a8)+_0x426fb8));}catch{_0x426fb8=_0x247c91;}else _0x426fb8=_0x247c91;}if(!_0x426fb8)return console['log'](a4_0x47e7d2['yellow']('llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a')),console[_0x1cc6d2(0x184)](_0x1cc6d2(0x13a)),console['log']('\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'),console[_0x1cc6d2(0x184)]('\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[_0x1cc6d2(0x184)](_0x1cc6d2(0x198)),0x1;if(_0x583015){const {data:_0x5e56b3}=await withSpinner(_0x1cc6d2(0x17a)+_0x583015+_0x1cc6d2(0x1c5)+_0x426fb8+_0x1cc6d2(0x1b3),()=>_0x193f3a[_0x1cc6d2(0x159)][_0x1cc6d2(0x153)](_0x426fb8,_0x583015,_0x242d09,{'dryRun':_0x455182,'force':_0x438977}));if(_0x455182)return console[_0x1cc6d2(0x184)](a4_0x47e7d2[_0x1cc6d2(0x1a0)](_0x1cc6d2(0x1b8))),console[_0x1cc6d2(0x184)](_0x1cc6d2(0x152)+_0x5e56b3[_0x1cc6d2(0x192)]),console['log'](_0x1cc6d2(0x147)+_0x5e56b3[_0x1cc6d2(0x173)]),_0x5e56b3['diff']&&(console[_0x1cc6d2(0x184)](_0x1cc6d2(0x11e)),console['log']('─'[_0x1cc6d2(0x12a)](0x3c)),console['log'](_0x5e56b3[_0x1cc6d2(0x131)]),console[_0x1cc6d2(0x184)]('─'[_0x1cc6d2(0x12a)](0x3c))),0x0;return console[_0x1cc6d2(0x184)](a4_0x47e7d2['green'](_0x1cc6d2(0x143))),console[_0x1cc6d2(0x184)]('Agent:\x20'+_0x5e56b3['agentName']),console[_0x1cc6d2(0x184)]('Output:\x20'+_0x5e56b3[_0x1cc6d2(0x173)]),console[_0x1cc6d2(0x184)](_0x1cc6d2(0x14d)+(_0x5e56b3['isNew']?a4_0x47e7d2[_0x1cc6d2(0x1d0)]('new'):_0x5e56b3['hasChanges']?a4_0x47e7d2['yellow'](_0x1cc6d2(0x1a9)):a4_0x47e7d2[_0x1cc6d2(0x1a5)](_0x1cc6d2(0x16d)))),0x0;}const _0x4c2cfd=_0x51cf64||_0x242d09,{data:_0x232082}=await withSpinner(_0x1cc6d2(0x15d)+_0x426fb8+_0x1cc6d2(0x1b3),()=>_0x193f3a['llm'][_0x1cc6d2(0x13e)](_0x426fb8,_0x4c2cfd,{'dryRun':!![]})),_0x4417d0=_0x232082['counts']['agents']['new']+_0x232082[_0x1cc6d2(0x180)]['knowledgeBases'][_0x1cc6d2(0x162)]+_0x232082[_0x1cc6d2(0x180)][_0x1cc6d2(0x194)]['new']+_0x232082[_0x1cc6d2(0x180)]['prompts'][_0x1cc6d2(0x162)]+_0x232082[_0x1cc6d2(0x180)]['integrations'][_0x1cc6d2(0x162)]+_0x232082[_0x1cc6d2(0x180)]['experimentalKnowledgeBases'][_0x1cc6d2(0x162)]+_0x232082['counts'][_0x1cc6d2(0x163)][_0x1cc6d2(0x162)],_0x4b2def=_0x232082[_0x1cc6d2(0x180)][_0x1cc6d2(0x122)][_0x1cc6d2(0x1a9)]+_0x232082['counts'][_0x1cc6d2(0x1b2)]['updated']+_0x232082[_0x1cc6d2(0x180)][_0x1cc6d2(0x194)][_0x1cc6d2(0x1a9)]+_0x232082[_0x1cc6d2(0x180)][_0x1cc6d2(0x1ab)][_0x1cc6d2(0x1a9)]+_0x232082[_0x1cc6d2(0x180)][_0x1cc6d2(0x1a1)][_0x1cc6d2(0x1a9)]+_0x232082[_0x1cc6d2(0x180)][_0x1cc6d2(0x14e)][_0x1cc6d2(0x1a9)]+_0x232082[_0x1cc6d2(0x180)][_0x1cc6d2(0x163)][_0x1cc6d2(0x1a9)],_0x2005e5=_0x232082[_0x1cc6d2(0x180)][_0x1cc6d2(0x122)][_0x1cc6d2(0x16d)]+_0x232082['counts']['knowledgeBases'][_0x1cc6d2(0x16d)]+_0x232082[_0x1cc6d2(0x180)]['textKnowledgeBases'][_0x1cc6d2(0x16d)]+_0x232082['counts'][_0x1cc6d2(0x1ab)][_0x1cc6d2(0x16d)]+_0x232082[_0x1cc6d2(0x180)]['integrations']['unchanged']+_0x232082[_0x1cc6d2(0x180)][_0x1cc6d2(0x14e)][_0x1cc6d2(0x16d)]+_0x232082[_0x1cc6d2(0x180)][_0x1cc6d2(0x163)]['unchanged'];console[_0x1cc6d2(0x184)]('\x0aPull\x20summary\x20for\x20\x27'+_0x232082[_0x1cc6d2(0x117)]+'\x27:'),console[_0x1cc6d2(0x184)]('\x20\x20'+a4_0x47e7d2[_0x1cc6d2(0x1d0)]('+\x20'+_0x4417d0+'\x20new')+_0x1cc6d2(0x1ca)+a4_0x47e7d2[_0x1cc6d2(0x1a0)]('~\x20'+_0x4b2def+'\x20changed')+_0x1cc6d2(0x1ca)+a4_0x47e7d2[_0x1cc6d2(0x182)]('=\x20'+_0x2005e5+_0x1cc6d2(0x19d))),console['log'](_0x1cc6d2(0x1cb)+formatCountSummary(_0x232082[_0x1cc6d2(0x180)][_0x1cc6d2(0x122)])),console[_0x1cc6d2(0x184)](_0x1cc6d2(0x193)+formatCountSummary(_0x232082['counts'][_0x1cc6d2(0x1b2)])),console[_0x1cc6d2(0x184)](_0x1cc6d2(0x157)+formatCountSummary(_0x232082[_0x1cc6d2(0x180)][_0x1cc6d2(0x194)])),console[_0x1cc6d2(0x184)](_0x1cc6d2(0x1bf)+formatCountSummary(_0x232082['counts']['prompts'])),console[_0x1cc6d2(0x184)](_0x1cc6d2(0x1a7)+formatCountSummary(_0x232082['counts'][_0x1cc6d2(0x1a1)]));const _0x4b1b49=_0x232082['counts'][_0x1cc6d2(0x14e)]['total']>0x0||_0x232082['counts'][_0x1cc6d2(0x163)]['total']>0x0;_0x4b1b49&&(console[_0x1cc6d2(0x184)](_0x1cc6d2(0x124)+formatCountSummary(_0x232082[_0x1cc6d2(0x180)][_0x1cc6d2(0x14e)])),console['log'](_0x1cc6d2(0x18f)+formatCountSummary(_0x232082['counts'][_0x1cc6d2(0x163)])));console['log'](_0x1cc6d2(0x1af)+a4_0x47e7d2[_0x1cc6d2(0x145)](_0x232082[_0x1cc6d2(0x130)])),displayDiffs(_0x232082[_0x1cc6d2(0x122)],_0x232082[_0x1cc6d2(0x1b2)],_0x232082['textKnowledgeBases'],_0x232082[_0x1cc6d2(0x1ab)],_0x232082[_0x1cc6d2(0x1a1)],_0x232082[_0x1cc6d2(0x14e)],_0x232082[_0x1cc6d2(0x163)]);if(_0x455182)return console[_0x1cc6d2(0x184)](a4_0x47e7d2[_0x1cc6d2(0x1a0)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x4417d0===0x0&&_0x4b2def===0x0)return console[_0x1cc6d2(0x184)](a4_0x47e7d2[_0x1cc6d2(0x1d0)](_0x1cc6d2(0x175))),saveSessionContext({'llm_project':_0x232082[_0x1cc6d2(0x117)]},_0x84348f[_0x1cc6d2(0x172)]),console[_0x1cc6d2(0x184)](a4_0x47e7d2[_0x1cc6d2(0x1d0)]('✔\x20Context\x20set:\x20'+a4_0x47e7d2[_0x1cc6d2(0x182)](_0x1cc6d2(0x141))+_0x1cc6d2(0x15e)+a4_0x47e7d2[_0x1cc6d2(0x145)](_0x232082['projectName']))),0x0;if(!_0x5da69b&&!_0x438977){if(!isInteractive())return console['error'](a4_0x47e7d2[_0x1cc6d2(0x19c)]('\x0aError:'),_0x1cc6d2(0x154)),console['error'](a4_0x47e7d2[_0x1cc6d2(0x182)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x1407f2=await confirmKey('\x0aWrite\x20'+(_0x4417d0+_0x4b2def)+'\x20files?');if(!_0x1407f2)return console[_0x1cc6d2(0x184)](a4_0x47e7d2[_0x1cc6d2(0x1a0)]('Cancelled'),'-\x20no\x20files\x20written'),0x1;}const {data:_0x1e5403}=await withSpinner('Writing\x20files...',()=>_0x193f3a['llm'][_0x1cc6d2(0x13e)](_0x426fb8,_0x4c2cfd,{'force':_0x438977}));return console[_0x1cc6d2(0x184)](a4_0x47e7d2[_0x1cc6d2(0x1d0)](_0x1cc6d2(0x18a)+(_0x4417d0+_0x4b2def)+_0x1cc6d2(0x140)+_0x1e5403[_0x1cc6d2(0x130)])),saveSessionContext({'llm_project':_0x1e5403['projectName']},_0x84348f[_0x1cc6d2(0x172)]),console[_0x1cc6d2(0x184)](a4_0x47e7d2[_0x1cc6d2(0x1d0)](_0x1cc6d2(0x121)+a4_0x47e7d2[_0x1cc6d2(0x182)](_0x1cc6d2(0x141))+'\x20=\x20'+a4_0x47e7d2[_0x1cc6d2(0x145)](_0x1e5403[_0x1cc6d2(0x117)]))),0x0;}}function a4_0x5dd1(_0x180759,_0x37b7b8){_0x180759=_0x180759-0x116;const _0x1fa9c0=a4_0x1fa9();let _0x5dd183=_0x1fa9c0[_0x180759];return _0x5dd183;}export class AgentCloneCommand extends BaseCommand{[a4_0x1bde89(0x1bb)]=a4_0x1bde89(0x15a);['description']=a4_0x1bde89(0x1cd);async['execute'](_0x4f2ca3){const _0x1da0f0=a4_0x1bde89,{options:_0x5f24fd,args:_0x7bcea6,tdx:_0x59dd50}=_0x4f2ca3,_0x4afeb9=_0x7bcea6[0x0],_0x269677=_0x5f24fd[_0x1da0f0(0x1bb)],_0x17f592=_0x5f24fd[_0x1da0f0(0x17b)],_0x3b01a6=_0x5f24fd[_0x1da0f0(0x11b)],_0x18bdbe=_0x5f24fd['site'],_0x36e05b=_0x5f24fd[_0x1da0f0(0x161)];let _0x17de53;const _0x27dab9=findAgentConfigPath(process[_0x1da0f0(0x16a)]());if(_0x4afeb9){const _0x3caf82=a4_0x170d36[_0x1da0f0(0x138)](_0x4afeb9,_0x1da0f0(0x191));existsSync(_0x3caf82)?(_0x17de53=_0x4afeb9,console['log'](a4_0x47e7d2[_0x1da0f0(0x182)]('Using\x20local\x20project:\x20'+_0x4afeb9))):_0x17de53=_0x4afeb9;}else{if(_0x27dab9)_0x17de53=a4_0x170d36['dirname'](_0x27dab9),console[_0x1da0f0(0x184)](a4_0x47e7d2[_0x1da0f0(0x182)](_0x1da0f0(0x135)+_0x17de53));else{if(_0x36e05b){const _0x39e22f=sanitizeForFilesystem(_0x36e05b);let _0x13ca5d=_0x39e22f,_0x4989c4=a4_0x170d36[_0x1da0f0(0x138)](process[_0x1da0f0(0x16a)](),_0x1da0f0(0x122),_0x39e22f,'tdx.json');if(!existsSync(_0x4989c4)){const _0x2479e7=normalizeName(_0x36e05b),_0xd39aa5=a4_0x170d36[_0x1da0f0(0x138)](process[_0x1da0f0(0x16a)](),'agents',_0x2479e7,'tdx.json');existsSync(_0xd39aa5)&&(_0x13ca5d=_0x2479e7,_0x4989c4=_0xd39aa5);}if(existsSync(_0x4989c4))_0x17de53=a4_0x170d36[_0x1da0f0(0x17e)](_0x4989c4),console[_0x1da0f0(0x184)](a4_0x47e7d2[_0x1da0f0(0x182)](_0x1da0f0(0x18c)+_0x17de53));else{const _0xfa4999=_0x5f24fd[_0x1da0f0(0x13d)];if(_0xfa4999)throw new SDKError(ErrorCode[_0x1da0f0(0x125)],'Cannot\x20clone\x20from\x20context\x20project\x20\x22'+_0x36e05b+_0x1da0f0(0x12f),undefined,{'helpText':_0x1da0f0(0x11d)+_0x1da0f0(0x197)+(_0x1da0f0(0x16c)+_0x36e05b+'\x0a')+(_0x1da0f0(0x1c0)+_0x13ca5d+_0x1da0f0(0x137)+(_0x269677||_0x1da0f0(0x19f))+_0x1da0f0(0x1c4)+_0xfa4999)});_0x17de53=_0x36e05b,console['log'](a4_0x47e7d2[_0x1da0f0(0x182)](_0x1da0f0(0x190)+_0x36e05b));}}}}if(!_0x17de53)return console[_0x1da0f0(0x184)](a4_0x47e7d2[_0x1da0f0(0x1a0)](_0x1da0f0(0x11a))),console['log'](_0x1da0f0(0x196)),console[_0x1da0f0(0x184)](_0x1da0f0(0x146)),console[_0x1da0f0(0x184)](_0x1da0f0(0x181)),console[_0x1da0f0(0x184)](_0x1da0f0(0x189)),0x1;if(!_0x269677)throw new SDKError(ErrorCode[_0x1da0f0(0x12b)],_0x1da0f0(0x116),undefined,{'helpText':_0x1da0f0(0x16b)});if(!_0x3b01a6&&!_0x17f592){if(!isInteractive())return console['error'](a4_0x47e7d2[_0x1da0f0(0x19c)](_0x1da0f0(0x17f)),_0x1da0f0(0x154)),console[_0x1da0f0(0x176)](a4_0x47e7d2[_0x1da0f0(0x182)](_0x1da0f0(0x128))),0x1;const _0x373725=await confirmKey(_0x1da0f0(0x174)+_0x17de53+_0x1da0f0(0x1a2)+_0x269677+'\x22?');if(!_0x373725)return console[_0x1da0f0(0x184)](a4_0x47e7d2[_0x1da0f0(0x1a0)](_0x1da0f0(0x1bd))),0x1;}const {data:_0x1758c8}=await withSpinner('Cloning\x20\x22'+_0x17de53+_0x1da0f0(0x185)+_0x269677+_0x1da0f0(0x1b3),()=>_0x59dd50['llm'][_0x1da0f0(0x177)](_0x17de53,_0x269677,{'dryRun':_0x17f592}));if(_0x17f592){console[_0x1da0f0(0x184)](a4_0x47e7d2[_0x1da0f0(0x1a0)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x1da0f0(0x184)](_0x1da0f0(0x164)+_0x1758c8[_0x1da0f0(0x188)]),console[_0x1da0f0(0x184)](_0x1da0f0(0x15b)+_0x269677),console[_0x1da0f0(0x184)](_0x1da0f0(0x1c8)),console[_0x1da0f0(0x184)](_0x1da0f0(0x1cb)+_0x1758c8['counts'][_0x1da0f0(0x122)][_0x1da0f0(0x18d)]),console[_0x1da0f0(0x184)](_0x1da0f0(0x193)+_0x1758c8[_0x1da0f0(0x180)][_0x1da0f0(0x1b2)][_0x1da0f0(0x18d)]),console[_0x1da0f0(0x184)](_0x1da0f0(0x1bf)+_0x1758c8['counts'][_0x1da0f0(0x1ab)][_0x1da0f0(0x18d)]);const _0x43bf63=_0x1758c8[_0x1da0f0(0x180)][_0x1da0f0(0x14e)][_0x1da0f0(0x18d)]>0x0||_0x1758c8[_0x1da0f0(0x180)][_0x1da0f0(0x163)][_0x1da0f0(0x18d)]>0x0;return _0x43bf63&&(console['log'](_0x1da0f0(0x124)+_0x1758c8[_0x1da0f0(0x180)][_0x1da0f0(0x14e)][_0x1da0f0(0x18d)]),console[_0x1da0f0(0x184)](_0x1da0f0(0x18f)+_0x1758c8[_0x1da0f0(0x180)][_0x1da0f0(0x163)][_0x1da0f0(0x18d)])),0x0;}const _0x7fee8=_0x1758c8[_0x1da0f0(0x180)][_0x1da0f0(0x122)][_0x1da0f0(0x167)]>0x0||_0x1758c8[_0x1da0f0(0x180)][_0x1da0f0(0x1b2)][_0x1da0f0(0x167)]>0x0||_0x1758c8['counts'][_0x1da0f0(0x1ab)][_0x1da0f0(0x167)]>0x0||_0x1758c8[_0x1da0f0(0x180)][_0x1da0f0(0x14e)]['errors']>0x0||_0x1758c8[_0x1da0f0(0x180)]['experimentalArtifacts'][_0x1da0f0(0x167)]>0x0;_0x7fee8?console['log'](a4_0x47e7d2[_0x1da0f0(0x1a0)](_0x1da0f0(0x119))):console[_0x1da0f0(0x184)](a4_0x47e7d2[_0x1da0f0(0x1d0)](_0x1da0f0(0x123)));console[_0x1da0f0(0x184)](_0x1da0f0(0x164)+_0x1758c8['sourceProjectName']),console[_0x1da0f0(0x184)](_0x1da0f0(0x15b)+_0x1758c8[_0x1da0f0(0x1be)]),console['log'](_0x1da0f0(0x1b6)+_0x1758c8[_0x1da0f0(0x1c9)]),console[_0x1da0f0(0x184)](),console[_0x1da0f0(0x184)](_0x1da0f0(0x19b)),console[_0x1da0f0(0x184)]('\x20\x20Agents:\x20'+formatCountSummary(_0x1758c8['counts'][_0x1da0f0(0x122)])),console[_0x1da0f0(0x184)](_0x1da0f0(0x193)+formatCountSummary(_0x1758c8[_0x1da0f0(0x180)][_0x1da0f0(0x1b2)])),console[_0x1da0f0(0x184)](_0x1da0f0(0x1bf)+formatCountSummary(_0x1758c8['counts']['prompts'])),console['log'](_0x1da0f0(0x1a7)+formatCountSummary(_0x1758c8[_0x1da0f0(0x180)][_0x1da0f0(0x1a1)]));const _0x1624e4=_0x1758c8[_0x1da0f0(0x180)][_0x1da0f0(0x14e)][_0x1da0f0(0x18d)]>0x0||_0x1758c8[_0x1da0f0(0x180)][_0x1da0f0(0x14e)][_0x1da0f0(0x1a9)]>0x0||_0x1758c8['counts']['experimentalKnowledgeBases'][_0x1da0f0(0x16d)]>0x0||_0x1758c8[_0x1da0f0(0x180)]['experimentalArtifacts'][_0x1da0f0(0x18d)]>0x0||_0x1758c8[_0x1da0f0(0x180)][_0x1da0f0(0x163)][_0x1da0f0(0x1a9)]>0x0||_0x1758c8['counts'][_0x1da0f0(0x163)][_0x1da0f0(0x16d)]>0x0;_0x1624e4&&(console[_0x1da0f0(0x184)](_0x1da0f0(0x124)+formatCountSummary(_0x1758c8[_0x1da0f0(0x180)]['experimentalKnowledgeBases'])),console[_0x1da0f0(0x184)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x1758c8['counts'][_0x1da0f0(0x163)])));if(_0x7fee8){console[_0x1da0f0(0x184)](),console[_0x1da0f0(0x184)](a4_0x47e7d2['red'](_0x1da0f0(0x169)));for(const _0x2c61a3 of _0x1758c8[_0x1da0f0(0x122)]){_0x2c61a3[_0x1da0f0(0x150)]===_0x1da0f0(0x176)&&console[_0x1da0f0(0x184)](a4_0x47e7d2[_0x1da0f0(0x19c)](_0x1da0f0(0x156)+_0x2c61a3[_0x1da0f0(0x192)]+_0x1da0f0(0x126)+_0x2c61a3['error']));}for(const _0xdcd8cb of _0x1758c8[_0x1da0f0(0x1b2)]){_0xdcd8cb[_0x1da0f0(0x150)]===_0x1da0f0(0x176)&&console['log'](a4_0x47e7d2[_0x1da0f0(0x19c)](_0x1da0f0(0x1bc)+_0xdcd8cb['name']+_0x1da0f0(0x126)+_0xdcd8cb[_0x1da0f0(0x176)]));}for(const _0x336478 of _0x1758c8['prompts']){_0x336478['action']==='error'&&console['log'](a4_0x47e7d2[_0x1da0f0(0x19c)](_0x1da0f0(0x19a)+_0x336478[_0x1da0f0(0x1bb)]+_0x1da0f0(0x126)+_0x336478[_0x1da0f0(0x176)]));}for(const _0x44ae67 of _0x1758c8['integrations']){_0x44ae67[_0x1da0f0(0x150)]===_0x1da0f0(0x176)&&console[_0x1da0f0(0x184)](a4_0x47e7d2[_0x1da0f0(0x19c)](_0x1da0f0(0x14f)+_0x44ae67[_0x1da0f0(0x1bb)]+_0x1da0f0(0x126)+_0x44ae67[_0x1da0f0(0x176)]));}for(const _0x2a630b of _0x1758c8[_0x1da0f0(0x14e)]){_0x2a630b['action']===_0x1da0f0(0x176)&&console['log'](a4_0x47e7d2['red'](_0x1da0f0(0x187)+_0x2a630b['name']+_0x1da0f0(0x126)+_0x2a630b['error']));}for(const _0x137490 of _0x1758c8[_0x1da0f0(0x163)]){_0x137490[_0x1da0f0(0x150)]===_0x1da0f0(0x176)&&console['log'](a4_0x47e7d2['red'](_0x1da0f0(0x18e)+_0x137490[_0x1da0f0(0x1bb)]+_0x1da0f0(0x126)+_0x137490[_0x1da0f0(0x176)]));}return 0x1;}console['log']();const _0x5e2d99=getLLMProjectUrl(_0x18bdbe,_0x1758c8[_0x1da0f0(0x1c9)]);return console['log'](_0x1da0f0(0x1cf)+a4_0x47e7d2[_0x1da0f0(0x145)](_0x5e2d99)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x1bde89(0x1bb)]=a4_0x1bde89(0x155);[a4_0x1bde89(0x1aa)]='Push\x20local\x20agent\x20files\x20to\x20LLM\x20project';async[a4_0x1bde89(0x14c)](_0x59afb6){const _0x2f3d48=a4_0x1bde89,{options:_0x35de57,args:_0x2806ea,tdx:_0x117f54}=_0x59afb6;let _0x6ef5df=_0x2806ea[0x0]||process[_0x2f3d48(0x16a)]();const _0x4b66f1=_0x35de57[_0x2f3d48(0x17b)],_0x32a4d5=_0x35de57[_0x2f3d48(0x1ad)],_0x5a1056=_0x35de57['yes'],_0x65233d=_0x35de57[_0x2f3d48(0x17d)],_0x2718bf=a4_0x170d36['join'](_0x6ef5df,_0x2f3d48(0x142)),_0x257302=existsSync(_0x2718bf);if(_0x257302){const {data:_0x38e827}=await withSpinner(_0x2f3d48(0x1ae)+_0x6ef5df+_0x2f3d48(0x1b3),()=>_0x117f54[_0x2f3d48(0x159)][_0x2f3d48(0x1c1)](_0x6ef5df,{'dryRun':_0x4b66f1,'force':_0x32a4d5}));if(_0x4b66f1)return console[_0x2f3d48(0x184)](a4_0x47e7d2[_0x2f3d48(0x1a0)](_0x2f3d48(0x1c6))),console[_0x2f3d48(0x184)](_0x2f3d48(0x1c2)+_0x38e827[_0x2f3d48(0x192)]),0x0;if(_0x38e827[_0x2f3d48(0x150)]===_0x2f3d48(0x176))return console[_0x2f3d48(0x184)](a4_0x47e7d2[_0x2f3d48(0x19c)](_0x2f3d48(0x199)+_0x38e827['error'])),0x1;console['log'](a4_0x47e7d2[_0x2f3d48(0x1d0)](_0x2f3d48(0x144)+_0x38e827['action']+'\x20successfully')),console[_0x2f3d48(0x184)](_0x2f3d48(0x195)+_0x38e827[_0x2f3d48(0x192)]);if(_0x38e827[_0x2f3d48(0x16f)]&&_0x38e827[_0x2f3d48(0x11f)]){const _0x5c6643=getLLMAgentChatUrl(_0x65233d,_0x38e827[_0x2f3d48(0x11f)],_0x38e827[_0x2f3d48(0x16f)]);console[_0x2f3d48(0x184)](_0x2f3d48(0x120)+a4_0x47e7d2['cyan'](_0x5c6643));}return 0x0;}const _0x1ad51c=_0x35de57['llmProject'],_0x403993=resolveProjectFromContext(_0x6ef5df,_0x1ad51c);if(_0x403993[_0x2f3d48(0x151)])_0x6ef5df=_0x403993[_0x2f3d48(0x118)],_0x403993[_0x2f3d48(0x16e)]===_0x2f3d48(0x1a4)&&console['log'](a4_0x47e7d2[_0x2f3d48(0x182)](_0x2f3d48(0x1a8)+_0x6ef5df));else{let _0x25e581=_0x2f3d48(0x1b4);_0x403993[_0x2f3d48(0x13b)]===_0x2f3d48(0x149)&&(_0x25e581=_0x403993[_0x2f3d48(0x1b7)]+_0x2f3d48(0x15c)+_0x403993['llmProject']+_0x2f3d48(0x14b));throw new SDKError(ErrorCode[_0x2f3d48(0x125)],_0x403993[_0x2f3d48(0x13b)]===_0x2f3d48(0x12d)?_0x403993[_0x2f3d48(0x1b7)]:_0x2f3d48(0x15f)+_0x6ef5df,undefined,{'helpText':_0x25e581});}const {data:_0x553bd5}=await withSpinner(_0x2f3d48(0x132),()=>_0x117f54['llm'][_0x2f3d48(0x14a)](_0x6ef5df,{'dryRun':!![]})),_0x7b6661=_0x553bd5[_0x2f3d48(0x180)][_0x2f3d48(0x122)][_0x2f3d48(0x167)]>0x0;if(_0x7b6661){console[_0x2f3d48(0x184)](a4_0x47e7d2[_0x2f3d48(0x19c)](_0x2f3d48(0x165)));for(const _0x54777f of _0x553bd5[_0x2f3d48(0x122)]){_0x54777f[_0x2f3d48(0x150)]===_0x2f3d48(0x176)&&console[_0x2f3d48(0x184)](a4_0x47e7d2['red'](_0x2f3d48(0x156)+_0x54777f['agentName']+_0x2f3d48(0x126)+_0x54777f[_0x2f3d48(0x176)]));}return 0x1;}const _0x488513=_0x553bd5[_0x2f3d48(0x180)][_0x2f3d48(0x122)]['created']+_0x553bd5[_0x2f3d48(0x180)]['knowledgeBases'][_0x2f3d48(0x18d)]+_0x553bd5[_0x2f3d48(0x180)][_0x2f3d48(0x194)][_0x2f3d48(0x18d)]+_0x553bd5[_0x2f3d48(0x180)][_0x2f3d48(0x1ab)][_0x2f3d48(0x18d)]+_0x553bd5[_0x2f3d48(0x180)][_0x2f3d48(0x1a1)][_0x2f3d48(0x18d)]+_0x553bd5[_0x2f3d48(0x180)][_0x2f3d48(0x14e)][_0x2f3d48(0x18d)]+_0x553bd5[_0x2f3d48(0x180)][_0x2f3d48(0x163)]['created'],_0x1d7e7f=_0x553bd5[_0x2f3d48(0x180)][_0x2f3d48(0x122)][_0x2f3d48(0x1a9)]+_0x553bd5[_0x2f3d48(0x180)][_0x2f3d48(0x1b2)][_0x2f3d48(0x1a9)]+_0x553bd5[_0x2f3d48(0x180)][_0x2f3d48(0x194)][_0x2f3d48(0x1a9)]+_0x553bd5[_0x2f3d48(0x180)][_0x2f3d48(0x1ab)][_0x2f3d48(0x1a9)]+_0x553bd5['counts'][_0x2f3d48(0x1a1)]['updated']+_0x553bd5['counts'][_0x2f3d48(0x14e)][_0x2f3d48(0x1a9)]+_0x553bd5['counts']['experimentalArtifacts'][_0x2f3d48(0x1a9)],_0x318fc2=_0x553bd5[_0x2f3d48(0x180)][_0x2f3d48(0x122)][_0x2f3d48(0x16d)]+_0x553bd5['counts'][_0x2f3d48(0x1b2)][_0x2f3d48(0x16d)]+_0x553bd5['counts']['textKnowledgeBases'][_0x2f3d48(0x16d)]+_0x553bd5[_0x2f3d48(0x180)][_0x2f3d48(0x1ab)]['unchanged']+_0x553bd5[_0x2f3d48(0x180)]['integrations'][_0x2f3d48(0x16d)]+_0x553bd5[_0x2f3d48(0x180)][_0x2f3d48(0x14e)][_0x2f3d48(0x16d)]+_0x553bd5['counts'][_0x2f3d48(0x163)][_0x2f3d48(0x16d)];console[_0x2f3d48(0x184)]('\x0aPush\x20summary\x20for\x20\x27'+_0x553bd5[_0x2f3d48(0x117)]+'\x27:'),console[_0x2f3d48(0x184)]('\x20\x20'+a4_0x47e7d2[_0x2f3d48(0x1d0)]('+\x20'+_0x488513+_0x2f3d48(0x171))+_0x2f3d48(0x1ca)+a4_0x47e7d2[_0x2f3d48(0x1a0)]('~\x20'+_0x1d7e7f+'\x20changed')+_0x2f3d48(0x1ca)+a4_0x47e7d2[_0x2f3d48(0x182)]('=\x20'+_0x318fc2+_0x2f3d48(0x19d))),console[_0x2f3d48(0x184)](_0x2f3d48(0x1cb)+formatCountSummary(_0x553bd5[_0x2f3d48(0x180)][_0x2f3d48(0x122)])),console[_0x2f3d48(0x184)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x553bd5[_0x2f3d48(0x180)][_0x2f3d48(0x1b2)])),console[_0x2f3d48(0x184)](_0x2f3d48(0x157)+formatCountSummary(_0x553bd5['counts']['textKnowledgeBases'])),console[_0x2f3d48(0x184)](_0x2f3d48(0x1bf)+formatCountSummary(_0x553bd5[_0x2f3d48(0x180)][_0x2f3d48(0x1ab)])),console[_0x2f3d48(0x184)](_0x2f3d48(0x1a7)+formatCountSummary(_0x553bd5[_0x2f3d48(0x180)][_0x2f3d48(0x1a1)]));const _0x50018d=_0x553bd5['counts']['experimentalKnowledgeBases'][_0x2f3d48(0x18d)]>0x0||_0x553bd5[_0x2f3d48(0x180)][_0x2f3d48(0x14e)][_0x2f3d48(0x1a9)]>0x0||_0x553bd5[_0x2f3d48(0x180)]['experimentalKnowledgeBases'][_0x2f3d48(0x16d)]>0x0||_0x553bd5[_0x2f3d48(0x180)][_0x2f3d48(0x163)][_0x2f3d48(0x18d)]>0x0||_0x553bd5['counts'][_0x2f3d48(0x163)][_0x2f3d48(0x1a9)]>0x0||_0x553bd5[_0x2f3d48(0x180)][_0x2f3d48(0x163)][_0x2f3d48(0x16d)]>0x0;_0x50018d&&(console[_0x2f3d48(0x184)](_0x2f3d48(0x124)+formatCountSummary(_0x553bd5[_0x2f3d48(0x180)][_0x2f3d48(0x14e)])),console[_0x2f3d48(0x184)](_0x2f3d48(0x18f)+formatCountSummary(_0x553bd5[_0x2f3d48(0x180)][_0x2f3d48(0x163)])));console[_0x2f3d48(0x184)](_0x2f3d48(0x160)+a4_0x47e7d2[_0x2f3d48(0x145)](_0x6ef5df)),displayDiffs(_0x553bd5[_0x2f3d48(0x122)],_0x553bd5['knowledgeBases'],_0x553bd5[_0x2f3d48(0x194)],_0x553bd5[_0x2f3d48(0x1ab)],_0x553bd5[_0x2f3d48(0x1a1)],_0x553bd5[_0x2f3d48(0x14e)],_0x553bd5[_0x2f3d48(0x163)]);if(_0x4b66f1)return console[_0x2f3d48(0x184)](a4_0x47e7d2[_0x2f3d48(0x1a0)](_0x2f3d48(0x178))),0x0;if(_0x488513===0x0&&_0x1d7e7f===0x0){console[_0x2f3d48(0x184)](a4_0x47e7d2['green'](_0x2f3d48(0x1c7)));const _0x51e1b9=getLLMProjectUrl(_0x65233d,_0x553bd5[_0x2f3d48(0x11f)]);return console[_0x2f3d48(0x184)](_0x2f3d48(0x1cf)+a4_0x47e7d2[_0x2f3d48(0x145)](_0x51e1b9)),0x0;}if(!_0x5a1056&&!_0x32a4d5){if(!isInteractive())return console[_0x2f3d48(0x176)](a4_0x47e7d2[_0x2f3d48(0x19c)]('\x0aError:'),_0x2f3d48(0x154)),console[_0x2f3d48(0x176)](a4_0x47e7d2[_0x2f3d48(0x182)](_0x2f3d48(0x128))),0x1;const _0x566af6=await confirmKey(_0x2f3d48(0x1cc)+(_0x488513+_0x1d7e7f)+_0x2f3d48(0x17c));if(!_0x566af6)return console['log'](a4_0x47e7d2[_0x2f3d48(0x1a0)](_0x2f3d48(0x1bd)),'-\x20nothing\x20pushed'),0x1;}const {data:_0x5717a9}=await withSpinner(_0x2f3d48(0x1b1),()=>_0x117f54[_0x2f3d48(0x159)]['pushProject'](_0x6ef5df,{'force':_0x32a4d5})),_0x18b080=_0x5717a9[_0x2f3d48(0x180)][_0x2f3d48(0x122)][_0x2f3d48(0x167)]>0x0||_0x5717a9[_0x2f3d48(0x180)][_0x2f3d48(0x1b2)]['errors']>0x0||_0x5717a9[_0x2f3d48(0x180)]['textKnowledgeBases'][_0x2f3d48(0x167)]>0x0||_0x5717a9[_0x2f3d48(0x180)][_0x2f3d48(0x1ab)][_0x2f3d48(0x167)]>0x0;if(_0x18b080){console[_0x2f3d48(0x184)](a4_0x47e7d2['yellow'](_0x2f3d48(0x179))),console[_0x2f3d48(0x184)](),console['log'](a4_0x47e7d2[_0x2f3d48(0x19c)](_0x2f3d48(0x169)));for(const _0x1a5e85 of _0x5717a9[_0x2f3d48(0x122)]){_0x1a5e85[_0x2f3d48(0x150)]===_0x2f3d48(0x176)&&console[_0x2f3d48(0x184)](a4_0x47e7d2[_0x2f3d48(0x19c)](_0x2f3d48(0x156)+_0x1a5e85['agentName']+_0x2f3d48(0x126)+_0x1a5e85['error']));}for(const _0x34f477 of _0x5717a9['knowledgeBases']){_0x34f477[_0x2f3d48(0x150)]===_0x2f3d48(0x176)&&console['log'](a4_0x47e7d2[_0x2f3d48(0x19c)](_0x2f3d48(0x1bc)+_0x34f477['name']+'\x22:\x20'+_0x34f477[_0x2f3d48(0x176)]));}for(const _0x2e4c45 of _0x5717a9[_0x2f3d48(0x194)]){_0x2e4c45[_0x2f3d48(0x150)]===_0x2f3d48(0x176)&&console['log'](a4_0x47e7d2[_0x2f3d48(0x19c)](_0x2f3d48(0x1ba)+_0x2e4c45[_0x2f3d48(0x1bb)]+_0x2f3d48(0x126)+_0x2e4c45[_0x2f3d48(0x176)]));}for(const _0x2ce7c4 of _0x5717a9[_0x2f3d48(0x1ab)]){_0x2ce7c4[_0x2f3d48(0x150)]===_0x2f3d48(0x176)&&console['log'](a4_0x47e7d2['red'](_0x2f3d48(0x19a)+_0x2ce7c4[_0x2f3d48(0x1bb)]+'\x22:\x20'+_0x2ce7c4['error']));}for(const _0xeca6a4 of _0x5717a9[_0x2f3d48(0x1a1)]){_0xeca6a4[_0x2f3d48(0x150)]===_0x2f3d48(0x176)&&console[_0x2f3d48(0x184)](a4_0x47e7d2['red'](_0x2f3d48(0x14f)+_0xeca6a4['name']+_0x2f3d48(0x126)+_0xeca6a4[_0x2f3d48(0x176)]));}return 0x1;}console[_0x2f3d48(0x184)](a4_0x47e7d2[_0x2f3d48(0x1d0)](_0x2f3d48(0x13c)+(_0x488513+_0x1d7e7f)+_0x2f3d48(0x158)+_0x5717a9[_0x2f3d48(0x117)]+'\x27'));const _0x23910c=getLLMProjectUrl(_0x65233d,_0x5717a9[_0x2f3d48(0x11f)]);return console[_0x2f3d48(0x184)](_0x2f3d48(0x1cf)+a4_0x47e7d2[_0x2f3d48(0x145)](_0x23910c)),0x0;}}
@@ -1 +1 @@
1
- const a5_0x1aadb1=a5_0x4be3;(function(_0x12fb04,_0x3ac9e1){const _0x9cacdd=a5_0x4be3,_0x3afd9d=_0x12fb04();while(!![]){try{const _0x1eeb09=-parseInt(_0x9cacdd(0x203))/0x1*(-parseInt(_0x9cacdd(0x24b))/0x2)+-parseInt(_0x9cacdd(0x254))/0x3+-parseInt(_0x9cacdd(0x240))/0x4+parseInt(_0x9cacdd(0x230))/0x5*(-parseInt(_0x9cacdd(0x256))/0x6)+-parseInt(_0x9cacdd(0x237))/0x7*(parseInt(_0x9cacdd(0x1c7))/0x8)+parseInt(_0x9cacdd(0x223))/0x9*(-parseInt(_0x9cacdd(0x210))/0xa)+parseInt(_0x9cacdd(0x25a))/0xb*(parseInt(_0x9cacdd(0x248))/0xc);if(_0x1eeb09===_0x3ac9e1)break;else _0x3afd9d['push'](_0x3afd9d['shift']());}catch(_0x27f076){_0x3afd9d['push'](_0x3afd9d['shift']());}}}(a5_0x225f,0x7b65d));function a5_0x4be3(_0x51ec28,_0x21ccde){_0x51ec28=_0x51ec28-0x1c6;const _0x225f21=a5_0x225f();let _0x4be35b=_0x225f21[_0x51ec28];return _0x4be35b;}import*as a5_0xabfca1 from'node:fs';import*as a5_0x207983 from'node:path';import a5_0x535e65 from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';function a5_0x225f(){const _0x3c3409=['tags','has','conversations','PASS','Running\x20test:\x20','site','json','tsv','projectName','testName','substring','green','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','no_tests','find','\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','red','\x20-\x20','9NxewtU','llm','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','resolve','includes','\x20\x20-\x20','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','name','\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)','Failed:\x20\x20\x20','conversation_url','message','white','8035ReYmex','Test\x20','Running\x20agent\x20tests...','\x20\x20Evaluating...\x20','rounds','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','length','319928RsebKF','filter','existsSync','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','Project\x20path:\x20','jsonl','404','Site:\x20','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','3707768FqNacm','No\x20tests\x20found\x20matching:\x20','map','trim','\x22:\x20','ERROR','Output\x20written\x20to:\x20','toISOString','348aZLcoh','Using\x20agent:\x20','not\x20found','1645762qaamBC','context','utf-8','now','...','eval','size','start','Conversation\x20URL:\x20','135357eRnHFv','verbose','1482jOwcMB','Cached\x20run\x20is\x20from\x20site\x20\x22','reeval','dim','965602LhaNVp','repeat','Available\x20tests:\x20','Total:\x20\x20\x20\x20','✗\x20ERROR:\x20','...\x20','Evaluating\x20response...','152zJuPHs','Running:\x20','Run\x20tests\x20for\x20an\x20LLM\x20agent','projectDir','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','resolveProjectId','/<agent-name>','cyan','resolveAgentId','Error\x20writing\x20output\x20file:\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','table','Executing\x20new\x20tests...','Agent:\x20','yellow','text','output','isSpinning','✓\x20PASS:\x20','Error:\x20No\x20previous\x20test\x20run\x20found.','⚠\x20SKIPPED:\x20','executeReeval','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','llmProject','Available\x20tags:\x20','Either\x20switch\x20to\x20the\x20\x22','\x27\x20to\x20create\x20the\x20folder\x20structure.','log','✗\x20ERROR:\x20Project\x20not\x20found:\x20','join','timestamp',':\x20Sending\x20user\x20input...','push','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','\x20\x20Conversation:\x20','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','agent','Re-evaluating...','✗\x20FAIL:\x20','agentName','Test\x20Summary','no_local_folder','No\x20tests\x20have\x20tags\x20defined.','reason','Round\x20','writeFileSync','execute','Usage:','dryRun','some','Cached\x20run\x20from:\x20','\x20(new)','tests','no_context','toLowerCase','FAIL','status','No\x20tests\x20found\x20with\x20tags:\x20','source','test.yml','1wfmmYE','forEach','found','round','Test\x20Configuration:','stop','multiple_agents','Re-evaluation\x20Summary','Passed:\x20\x20\x20','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','\x20\x20Round\x20','Round\x201/','6257560dxWyle'];a5_0x225f=function(){return _0x3c3409;};return a5_0x225f();}export class AgentTestCommand extends BaseCommand{[a5_0x1aadb1(0x22a)]='agent:test';['description']=a5_0x1aadb1(0x1c9);async[a5_0x1aadb1(0x1f5)](_0x56f955){const _0x41a204=a5_0x1aadb1,{options:_0x42cac2,args:_0x3d26eb,tdx:_0xfcf5a7}=_0x56f955,_0x41fbc8=_0x3d26eb[0x0]||'.',_0x35230c=_0x42cac2[_0x41a204(0x1f7)],_0x143edf=_0x42cac2,_0x43f63b=_0x143edf[_0x41a204(0x250)]===![],_0x24f2e0=_0x143edf[_0x41a204(0x258)],_0x596b7a=_0x143edf['name'],_0x3a2446=_0x143edf[_0x41a204(0x211)],_0x12690a=_0x42cac2[_0x41a204(0x216)],_0x4a37ba=_0x143edf[_0x41a204(0x1d7)];if(_0x24f2e0&&_0x43f63b)return console[_0x41a204(0x1e2)](a5_0x535e65['red']('Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval')),0x1;let _0x2c521e=_0x41a204(0x1d2);if(_0x143edf['json'])_0x2c521e=_0x41a204(0x217);else{if(_0x143edf[_0x41a204(0x23c)])_0x2c521e='jsonl';else{if(_0x143edf[_0x41a204(0x218)])_0x2c521e=_0x41a204(0x218);else{if(_0x143edf[_0x41a204(0x1d2)])_0x2c521e=_0x41a204(0x1d2);}}}const _0x45d91b=_0x143edf[_0x41a204(0x1de)];let _0x2b2f27=_0x41fbc8;const _0x4a7a01=a5_0xabfca1[_0x41a204(0x239)](_0x41fbc8),_0x429b36=_0x41fbc8==='.';if(!_0x4a7a01||_0x429b36){const _0x5932a0=resolveProjectFromContext(_0x41fbc8,_0x45d91b,{'requireFile':_0x41a204(0x202)});if(_0x5932a0[_0x41a204(0x205)])_0x2b2f27=_0x5932a0['projectDir'],_0x5932a0[_0x41a204(0x201)]===_0x41a204(0x24c)&&console[_0x41a204(0x1e2)](a5_0x535e65[_0x41a204(0x259)](_0x41a204(0x249)+_0x2b2f27));else switch(_0x5932a0[_0x41a204(0x1f2)]){case _0x41a204(0x1fc):console[_0x41a204(0x1e2)](a5_0x535e65[_0x41a204(0x1d5)](_0x5932a0[_0x41a204(0x22e)])),console[_0x41a204(0x1e2)](),console[_0x41a204(0x1e2)](_0x41a204(0x1f6)),console[_0x41a204(0x1e2)](_0x41a204(0x220)),console[_0x41a204(0x1e2)](_0x41a204(0x22b)),console[_0x41a204(0x1e2)](),console[_0x41a204(0x1e2)]('Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>');return 0x1;case _0x41a204(0x1f0):console['log'](a5_0x535e65[_0x41a204(0x1d5)](_0x5932a0['message'])),console[_0x41a204(0x1e2)](),console[_0x41a204(0x1e2)]('Run\x20\x27tdx\x20agent\x20pull\x20'+_0x5932a0[_0x41a204(0x1de)]+_0x41a204(0x1e1));return 0x1;case _0x41a204(0x209):{const _0x1c3556=a5_0x207983['basename'](_0x5932a0[_0x41a204(0x1ca)]);console['log'](a5_0x535e65[_0x41a204(0x1d5)](_0x41a204(0x1ea)+_0x5932a0[_0x41a204(0x1de)]+'\x22:'));for(const _0xc8cc5b of _0x5932a0['agentDirs']){console[_0x41a204(0x1e2)](_0x41a204(0x228)+_0xc8cc5b);}return console[_0x41a204(0x1e2)](),console['log'](_0x41a204(0x23f)+_0x1c3556+_0x41a204(0x1cd)),0x1;}case _0x41a204(0x21e):console[_0x41a204(0x1e2)](a5_0x535e65[_0x41a204(0x1d5)](_0x41a204(0x235)+_0x5932a0['llmProject']+'\x22.')),console[_0x41a204(0x1e2)](a5_0x535e65['dim'](_0x41a204(0x23b)+_0x5932a0['projectDir'])),console['log'](),console['log'](_0x41a204(0x23a));return 0x1;}}const {definition:_0x6b625f,agentInfo:_0x3f955f}=parseTestFile(_0x2b2f27);let _0x442584=_0x6b625f['tests'];if(_0x596b7a){const _0x464af1=_0x596b7a['split'](',')[_0x41a204(0x242)](_0xfdaa43=>_0xfdaa43['trim']());_0x442584=_0x6b625f['tests']['filter'](_0x578588=>_0x464af1[_0x41a204(0x227)](_0x578588[_0x41a204(0x22a)]));if(_0x442584[_0x41a204(0x236)]===0x0)return console['log'](a5_0x535e65[_0x41a204(0x1d5)](_0x41a204(0x241)+_0x596b7a)),console[_0x41a204(0x1e2)](a5_0x535e65[_0x41a204(0x259)](_0x41a204(0x25c)+_0x6b625f[_0x41a204(0x1fb)][_0x41a204(0x242)](_0x273fc2=>_0x273fc2[_0x41a204(0x22a)])[_0x41a204(0x1e4)](',\x20'))),0x1;}if(_0x3a2446){const _0x798c99=_0x3a2446['split'](',')[_0x41a204(0x242)](_0x2938a3=>_0x2938a3[_0x41a204(0x243)]()[_0x41a204(0x1fd)]());_0x442584=_0x442584[_0x41a204(0x238)](_0x305f96=>_0x305f96[_0x41a204(0x211)]?.[_0x41a204(0x1f8)](_0x4852d0=>_0x798c99[_0x41a204(0x227)](_0x4852d0[_0x41a204(0x1fd)]())));if(_0x442584[_0x41a204(0x236)]===0x0){console[_0x41a204(0x1e2)](a5_0x535e65['yellow'](_0x41a204(0x200)+_0x3a2446));const _0x39c4c6=new Set();return _0x6b625f[_0x41a204(0x1fb)][_0x41a204(0x204)](_0x3ac4d7=>_0x3ac4d7[_0x41a204(0x211)]?.['forEach'](_0x49c33b=>_0x39c4c6['add'](_0x49c33b))),_0x39c4c6[_0x41a204(0x251)]>0x0?console['log'](a5_0x535e65[_0x41a204(0x259)](_0x41a204(0x1df)+[..._0x39c4c6][_0x41a204(0x1e4)](',\x20'))):console['log'](a5_0x535e65[_0x41a204(0x259)](_0x41a204(0x1f1))),0x1;}}if(_0x24f2e0)return this[_0x41a204(0x1dc)](_0x56f955,{'definition':{'tests':_0x442584},'agentInfo':_0x3f955f,'outputFormat':_0x2c521e,'outputFile':_0x4a37ba,'testNames':_0x596b7a});if(_0x35230c){console[_0x41a204(0x1e2)](a5_0x535e65[_0x41a204(0x1ce)](_0x41a204(0x207))),console[_0x41a204(0x1e2)]('\x20\x20Site:\x20'+a5_0x535e65[_0x41a204(0x22f)](_0x12690a)),console[_0x41a204(0x1e2)]('\x20\x20Project:\x20'+a5_0x535e65[_0x41a204(0x22f)](_0x3f955f[_0x41a204(0x219)])),console['log']('\x20\x20Agent:\x20'+a5_0x535e65[_0x41a204(0x22f)](_0x3f955f['agentName'])),console[_0x41a204(0x1e2)](),console[_0x41a204(0x1e2)]('Tests\x20found:\x20'+a5_0x535e65['white'](_0x442584[_0x41a204(0x236)]));for(let _0x2065be=0x0;_0x2065be<_0x442584[_0x41a204(0x236)];_0x2065be++){const _0x58fc6d=_0x442584[_0x2065be],_0x38d74e=_0x58fc6d[_0x41a204(0x234)]['length']===0x1?_0x41a204(0x206):_0x41a204(0x234),_0x5eff87=_0x58fc6d[_0x41a204(0x211)]?.[_0x41a204(0x236)]?'\x20['+_0x58fc6d['tags']['join'](',\x20')+']':'';console[_0x41a204(0x1e2)]('\x20\x20'+(_0x2065be+0x1)+'.\x20'+a5_0x535e65[_0x41a204(0x22f)](_0x58fc6d[_0x41a204(0x22a)])+'\x20('+_0x58fc6d[_0x41a204(0x234)][_0x41a204(0x236)]+'\x20'+_0x38d74e+')'+a5_0x535e65[_0x41a204(0x259)](_0x5eff87));}return 0x0;}let _0x35cf0a,_0x45479e;try{_0x35cf0a=await _0xfcf5a7[_0x41a204(0x224)][_0x41a204(0x1cc)](_0x3f955f[_0x41a204(0x219)]);}catch(_0x4a9c83){const _0xa7fc2c=_0x4a9c83 instanceof Error?_0x4a9c83[_0x41a204(0x22e)]:String(_0x4a9c83);return _0xa7fc2c['includes'](_0x41a204(0x23d))||_0xa7fc2c[_0x41a204(0x1fd)]()[_0x41a204(0x227)](_0x41a204(0x24a))?console['log'](a5_0x535e65['red'](_0x41a204(0x1e3)+_0x3f955f[_0x41a204(0x219)])):console[_0x41a204(0x1e2)](a5_0x535e65[_0x41a204(0x221)](_0x41a204(0x1d1)+_0x3f955f[_0x41a204(0x219)]+_0x41a204(0x244)+_0xa7fc2c)),0x1;}try{_0x45479e=await _0xfcf5a7[_0x41a204(0x224)][_0x41a204(0x1cf)](_0x3f955f[_0x41a204(0x1ee)],_0x35cf0a);}catch(_0x4c0e7f){const _0x40de61=_0x4c0e7f instanceof Error?_0x4c0e7f['message']:String(_0x4c0e7f);return _0x40de61[_0x41a204(0x227)](_0x41a204(0x23d))||_0x40de61[_0x41a204(0x1fd)]()[_0x41a204(0x227)](_0x41a204(0x24a))?console[_0x41a204(0x1e2)](a5_0x535e65[_0x41a204(0x221)](_0x41a204(0x225)+_0x3f955f['agentName'])):console[_0x41a204(0x1e2)](a5_0x535e65[_0x41a204(0x221)](_0x41a204(0x1dd)+_0x3f955f[_0x41a204(0x1ee)]+_0x41a204(0x244)+_0x40de61)),0x1;}let _0x1aa066;if(!_0x43f63b)try{_0x1aa066=await setupEvaluatorAgent(_0xfcf5a7['llm'],_0x42cac2[_0x41a204(0x255)]);}catch(_0x310bc1){const _0x492c70=_0x310bc1 instanceof Error?_0x310bc1['message']:String(_0x310bc1);return console[_0x41a204(0x1e2)](a5_0x535e65[_0x41a204(0x221)](_0x41a204(0x20d)+_0x492c70)),0x1;}console['log'](a5_0x535e65[_0x41a204(0x1ce)](_0x41a204(0x232))),console[_0x41a204(0x1e2)](_0x41a204(0x23e)+a5_0x535e65[_0x41a204(0x22f)](_0x12690a)),console[_0x41a204(0x1e2)](_0x41a204(0x1d4)+a5_0x535e65[_0x41a204(0x22f)](_0x3f955f[_0x41a204(0x219)]+'/'+_0x3f955f[_0x41a204(0x1ee)])),console[_0x41a204(0x1e2)]();const _0x2895a8=[],_0x40eaad=[],_0x398a7c=Date[_0x41a204(0x24e)]();for(let _0x2fa936=0x0;_0x2fa936<_0x442584[_0x41a204(0x236)];_0x2fa936++){const _0x2e42b2=_0x442584[_0x2fa936];_0x442584['length']>0x1?console['log'](_0x41a204(0x231)+(_0x2fa936+0x1)+'/'+_0x442584[_0x41a204(0x236)]+':\x20'+a5_0x535e65[_0x41a204(0x22f)](_0x2e42b2['name'])):console[_0x41a204(0x1e2)](_0x41a204(0x215)+a5_0x535e65[_0x41a204(0x22f)](_0x2e42b2[_0x41a204(0x22a)]));const _0x16d66c=createCommandSpinner('Round\x201/'+_0x2e42b2[_0x41a204(0x234)][_0x41a204(0x236)]+_0x41a204(0x1e6));_0x16d66c['start']();try{const {result:_0x322140,conversation:_0x303e8b}=await runTest(_0xfcf5a7['llm'],_0x2e42b2,{'agentId':_0x45479e,'projectId':_0x35cf0a,'site':_0x12690a,'noEval':_0x43f63b,'evaluatorId':_0x1aa066,'onRoundStart':(_0x507f4f,_0xecb330)=>{_0x16d66c['text']='Round\x20'+(_0x507f4f+0x1)+'/'+_0xecb330+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x8573d2,_0x2d9f33,_0x4bcba0)=>{const _0x37d868=_0x41a204,_0x211865=formatElapsed(_0x2d9f33);_0x4bcba0?console[_0x37d868(0x1e2)](_0x37d868(0x20e)+(_0x8573d2+0x1)+'/'+_0x2e42b2['rounds'][_0x37d868(0x236)]+_0x37d868(0x25f)+a5_0x535e65[_0x37d868(0x21c)]('✓')+'\x20('+_0x211865+')'):console['log'](_0x37d868(0x20e)+(_0x8573d2+0x1)+'/'+_0x2e42b2['rounds']['length']+_0x37d868(0x25f)+a5_0x535e65[_0x37d868(0x221)]('✗'));},'onEvaluationStart':()=>{const _0x599a47=_0x41a204;_0x16d66c[_0x599a47(0x1d6)]=_0x599a47(0x1c6);},'onEvaluationComplete':_0x5c3bce=>{const _0x58360e=_0x41a204,_0xd427ca=formatElapsed(_0x5c3bce);console[_0x58360e(0x1e2)]('\x20\x20Evaluating...\x20'+a5_0x535e65[_0x58360e(0x21c)]('✓')+'\x20('+_0xd427ca+')');}});_0x16d66c['stop'](),_0x2895a8[_0x41a204(0x1e7)](_0x322140),_0x40eaad[_0x41a204(0x1e7)](_0x303e8b);if(_0x322140[_0x41a204(0x1ff)]===_0x41a204(0x214))console[_0x41a204(0x1e2)](a5_0x535e65[_0x41a204(0x21c)](_0x41a204(0x1d9)+_0x322140['reason']));else _0x322140[_0x41a204(0x1ff)]===_0x41a204(0x1fe)?console[_0x41a204(0x1e2)](a5_0x535e65['red'](_0x41a204(0x1ed)+_0x322140[_0x41a204(0x1f2)])):console['log'](a5_0x535e65[_0x41a204(0x221)](_0x41a204(0x25e)+_0x322140[_0x41a204(0x1f2)]));_0x322140[_0x41a204(0x22d)]&&console[_0x41a204(0x1e2)](a5_0x535e65['dim'](_0x41a204(0x253)+_0x322140[_0x41a204(0x22d)])),console[_0x41a204(0x1e2)]();}catch(_0x4d27f8){_0x16d66c[_0x41a204(0x208)]();const _0x203160=_0x4d27f8 instanceof Error?_0x4d27f8[_0x41a204(0x22e)]:String(_0x4d27f8);console[_0x41a204(0x1e2)](a5_0x535e65[_0x41a204(0x221)]('✗\x20ERROR:\x20'+_0x203160)),console[_0x41a204(0x1e2)](),_0x2895a8[_0x41a204(0x1e7)]({'name':_0x2e42b2[_0x41a204(0x22a)],'status':_0x41a204(0x245),'reason':_0x203160,'timestamp':new Date()[_0x41a204(0x247)](),'duration_ms':0x0});}}const _0x478617=Date[_0x41a204(0x24e)]()-_0x398a7c,_0x2419bc=_0x2895a8[_0x41a204(0x238)](_0x396182=>_0x396182[_0x41a204(0x1ff)]===_0x41a204(0x214))['length'],_0x2df3cc=_0x2895a8[_0x41a204(0x238)](_0x22266e=>_0x22266e[_0x41a204(0x1ff)]===_0x41a204(0x1fe))['length'],_0x2a1b62=_0x2895a8[_0x41a204(0x238)](_0x19aa0e=>_0x19aa0e[_0x41a204(0x1ff)]===_0x41a204(0x245))[_0x41a204(0x236)];console[_0x41a204(0x1e2)]('━'[_0x41a204(0x25b)](0x3c)),console[_0x41a204(0x1e2)](_0x41a204(0x1ef)),console[_0x41a204(0x1e2)]('━'[_0x41a204(0x25b)](0x3c)),console[_0x41a204(0x1e2)](_0x41a204(0x25d)+_0x2895a8[_0x41a204(0x236)]),console[_0x41a204(0x1e2)](_0x41a204(0x20b)+a5_0x535e65['green'](_0x2419bc)),console[_0x41a204(0x1e2)](_0x41a204(0x22c)+a5_0x535e65[_0x41a204(0x221)](_0x2df3cc));_0x2a1b62>0x0&&console[_0x41a204(0x1e2)]('Errors:\x20\x20\x20'+a5_0x535e65[_0x41a204(0x221)](_0x2a1b62));console[_0x41a204(0x1e2)]('Duration:\x20'+formatElapsed(_0x478617)),console['log']('━'[_0x41a204(0x25b)](0x3c));const _0x51f38d=_0x2895a8[_0x41a204(0x238)](_0xa87927=>_0xa87927[_0x41a204(0x1ff)]!=='PASS');if(_0x51f38d[_0x41a204(0x236)]>0x0){console['log'](),console['log']('Failed\x20Tests:');for(const _0x4fb26a of _0x51f38d){const _0x525588=a5_0x535e65['red']('✗'),_0x114530=_0x4fb26a[_0x41a204(0x1f2)][_0x41a204(0x236)]>0x32?_0x4fb26a[_0x41a204(0x1f2)][_0x41a204(0x21b)](0x0,0x32)+_0x41a204(0x24f):_0x4fb26a[_0x41a204(0x1f2)];console['log']('\x20\x20'+_0x525588+'\x20'+_0x4fb26a['name']+':\x20'+_0x114530);}}const _0x4be87e={'summary':{'total':_0x2895a8[_0x41a204(0x236)],'passed':_0x2419bc,'failed':_0x2df3cc,'errors':_0x2a1b62>0x0?_0x2a1b62:undefined,'duration_ms':_0x478617},'tests':_0x2895a8,'agent':{'project':_0x3f955f[_0x41a204(0x219)],'name':_0x3f955f[_0x41a204(0x1ee)],'site':_0x12690a},'timestamp':new Date(_0x398a7c)[_0x41a204(0x247)]()};try{const _0x4d3c02=buildCachedTestRun(_0x40eaad,{'site':_0x12690a,'projectId':_0x35cf0a,'projectName':_0x3f955f['projectName'],'agentId':_0x45479e,'agentName':_0x3f955f['agentName'],'testYmlPath':a5_0x207983[_0x41a204(0x226)](_0x3f955f['testYmlPath'])});saveLastTestRun(_0x4d3c02);}catch{}if(_0x2c521e!==_0x41a204(0x1d2)||_0x4a37ba){const _0x3fe3c9=formatResults(_0x4be87e,_0x2c521e);if(_0x4a37ba)try{a5_0xabfca1[_0x41a204(0x1f4)](_0x4a37ba,_0x3fe3c9,_0x41a204(0x24d)),console['log'](),console['log'](a5_0x535e65[_0x41a204(0x259)](_0x41a204(0x246)+_0x4a37ba));}catch(_0x3d1ed2){return console[_0x41a204(0x1e2)](),console['log'](a5_0x535e65[_0x41a204(0x221)](_0x41a204(0x1d0)+_0x3d1ed2)),0x1;}else console[_0x41a204(0x1e2)](),console[_0x41a204(0x1e2)](_0x3fe3c9);}return _0x51f38d[_0x41a204(0x236)]>0x0?0x1:0x0;}async['executeReeval'](_0x2564e3,_0x501e38){const _0x5d3168=a5_0x1aadb1,{options:_0xe0d45b,tdx:_0x3b737b}=_0x2564e3,{definition:_0x52b934,agentInfo:_0x4b8a7f,outputFormat:_0x4fb726,outputFile:_0x1ea26c}=_0x501e38,_0x2c27b9=_0xe0d45b[_0x5d3168(0x216)],_0x2200e3=loadLastTestRun();if(!_0x2200e3)return console[_0x5d3168(0x1e2)](a5_0x535e65['red'](_0x5d3168(0x1da))),console['log'](a5_0x535e65[_0x5d3168(0x259)](_0x5d3168(0x1e8))),0x1;if(_0x2200e3[_0x5d3168(0x1eb)][_0x5d3168(0x1ee)]!==_0x4b8a7f[_0x5d3168(0x1ee)])return console[_0x5d3168(0x1e2)](a5_0x535e65[_0x5d3168(0x221)](_0x5d3168(0x21d)+_0x2200e3[_0x5d3168(0x1eb)][_0x5d3168(0x1ee)]+_0x5d3168(0x1cb)+_0x4b8a7f[_0x5d3168(0x1ee)]+'\x22.')),console[_0x5d3168(0x1e2)](a5_0x535e65[_0x5d3168(0x259)](_0x5d3168(0x20c))),0x1;const _0x434092=new Set(_0x2200e3[_0x5d3168(0x213)][_0x5d3168(0x242)](_0x58427e=>_0x58427e[_0x5d3168(0x21a)])),_0x48124c=_0x52b934[_0x5d3168(0x1fb)][_0x5d3168(0x238)](_0x3cfe3=>!_0x434092[_0x5d3168(0x212)](_0x3cfe3['name']));if(_0x48124c[_0x5d3168(0x236)]>0x0&&_0x2200e3[_0x5d3168(0x216)]!==_0x2c27b9)return console[_0x5d3168(0x1e2)](a5_0x535e65['red']('Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.')),console['log'](a5_0x535e65[_0x5d3168(0x259)](_0x5d3168(0x257)+_0x2200e3[_0x5d3168(0x216)]+'\x22,\x20but\x20current\x20site\x20is\x20\x22'+_0x2c27b9+'\x22.')),console[_0x5d3168(0x1e2)](a5_0x535e65[_0x5d3168(0x259)](_0x5d3168(0x1e0)+_0x2200e3[_0x5d3168(0x216)]+_0x5d3168(0x229))),0x1;const _0x45d5c6=_0x52b934[_0x5d3168(0x1fb)][_0x5d3168(0x238)](_0x2ecedc=>_0x434092[_0x5d3168(0x212)](_0x2ecedc['name'])),_0x1a2511=_0x48124c;let _0x17d25b;try{_0x17d25b=await setupEvaluatorAgent(_0x3b737b[_0x5d3168(0x224)],_0xe0d45b['verbose']);}catch(_0x32ec84){const _0x332e26=_0x32ec84 instanceof Error?_0x32ec84[_0x5d3168(0x22e)]:String(_0x32ec84);return console[_0x5d3168(0x1e2)](a5_0x535e65['red']('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x332e26)),0x1;}console[_0x5d3168(0x1e2)](a5_0x535e65[_0x5d3168(0x1ce)]('Re-evaluating\x20cached\x20test\x20run...')),console[_0x5d3168(0x1e2)](_0x5d3168(0x1f9)+a5_0x535e65[_0x5d3168(0x22f)](_0x2200e3[_0x5d3168(0x1e5)])),console[_0x5d3168(0x1e2)](_0x5d3168(0x1d4)+a5_0x535e65[_0x5d3168(0x22f)](_0x2200e3['agent'][_0x5d3168(0x219)]+'/'+_0x2200e3['agent']['agentName']));_0x1a2511[_0x5d3168(0x236)]>0x0&&console[_0x5d3168(0x1e2)]('New\x20tests\x20to\x20execute:\x20'+a5_0x535e65[_0x5d3168(0x1d5)](_0x1a2511[_0x5d3168(0x236)]));console[_0x5d3168(0x1e2)]();const _0x11b139=[],_0x185af4=Date[_0x5d3168(0x24e)](),_0x418f27=createCommandSpinner(_0x5d3168(0x1ec));if(_0x45d5c6['length']>0x0)try{const _0x447929=await reevaluateFromCache(_0x3b737b[_0x5d3168(0x224)],_0x2200e3,{'tests':_0x45d5c6},{'evaluatorId':_0x17d25b,'onTestStart':(_0x3f70a2,_0x2417f0,_0x50fccc)=>{const _0x330122=_0x5d3168;_0x418f27[_0x330122(0x1d6)]='Re-evaluating\x20'+(_0x2417f0+0x1)+'/'+_0x50fccc+':\x20'+_0x3f70a2+_0x330122(0x24f);if(!_0x418f27[_0x330122(0x1d8)])_0x418f27[_0x330122(0x252)]();},'onTestComplete':(_0x5da1d0,_0x56dfa3)=>{const _0xae576c=_0x5d3168;_0x418f27[_0xae576c(0x208)]();if(_0x56dfa3[_0xae576c(0x1ff)]==='PASS')console[_0xae576c(0x1e2)](a5_0x535e65['green'](_0xae576c(0x1d9)+_0x5da1d0)+a5_0x535e65[_0xae576c(0x259)]('\x20(cached)'));else _0x56dfa3[_0xae576c(0x1ff)]==='FAIL'?console[_0xae576c(0x1e2)](a5_0x535e65[_0xae576c(0x221)](_0xae576c(0x1ed)+_0x5da1d0+_0xae576c(0x222)+_0x56dfa3[_0xae576c(0x1f2)])+a5_0x535e65[_0xae576c(0x259)]('\x20(cached)')):console[_0xae576c(0x1e2)](a5_0x535e65[_0xae576c(0x221)](_0xae576c(0x25e)+_0x5da1d0+_0xae576c(0x222)+_0x56dfa3[_0xae576c(0x1f2)]));_0x56dfa3['conversation_url']&&console['log'](a5_0x535e65[_0xae576c(0x259)](_0xae576c(0x1e9)+_0x56dfa3[_0xae576c(0x22d)])),_0x11b139[_0xae576c(0x1e7)](_0x56dfa3);},'onTestSkipped':(_0x1ddeeb,_0x4dc7a8)=>{const _0x1e3c33=_0x5d3168;_0x418f27[_0x1e3c33(0x208)](),console[_0x1e3c33(0x1e2)](a5_0x535e65[_0x1e3c33(0x1d5)](_0x1e3c33(0x1db)+_0x1ddeeb+'\x20-\x20'+_0x4dc7a8));}});for(const _0xec6967 of _0x447929){!_0x11b139[_0x5d3168(0x21f)](_0x36fd2c=>_0x36fd2c['name']===_0xec6967[_0x5d3168(0x22a)])&&_0x11b139[_0x5d3168(0x1e7)](_0xec6967);}}catch(_0x27994e){_0x418f27[_0x5d3168(0x208)]();const _0x4d8824=_0x27994e instanceof Error?_0x27994e[_0x5d3168(0x22e)]:String(_0x27994e);return console['log'](a5_0x535e65['red']('✗\x20ERROR:\x20Re-evaluation\x20failed:\x20'+_0x4d8824)),0x1;}_0x418f27['stop']();if(_0x1a2511[_0x5d3168(0x236)]>0x0){console[_0x5d3168(0x1e2)](),console['log'](a5_0x535e65[_0x5d3168(0x1ce)](_0x5d3168(0x1d3)));const {projectId:_0x3b39b6,agentId:_0x1eebf1}=_0x2200e3['agent'];for(const _0x40a2ff of _0x1a2511){console[_0x5d3168(0x1e2)](_0x5d3168(0x1c8)+a5_0x535e65[_0x5d3168(0x22f)](_0x40a2ff['name']));const _0x3560ab=createCommandSpinner(_0x5d3168(0x20f)+_0x40a2ff[_0x5d3168(0x234)][_0x5d3168(0x236)]+_0x5d3168(0x1e6));_0x3560ab[_0x5d3168(0x252)]();try{const {result:_0x534a85}=await runTest(_0x3b737b[_0x5d3168(0x224)],_0x40a2ff,{'agentId':_0x1eebf1,'projectId':_0x3b39b6,'site':_0x2200e3[_0x5d3168(0x216)],'noEval':![],'evaluatorId':_0x17d25b,'onRoundStart':(_0x379612,_0x5e8edd)=>{const _0x49184b=_0x5d3168;_0x3560ab[_0x49184b(0x1d6)]=_0x49184b(0x1f3)+(_0x379612+0x1)+'/'+_0x5e8edd+_0x49184b(0x1e6);},'onRoundComplete':(_0x541cad,_0x8317ea,_0x4bc1ba)=>{const _0x42d178=_0x5d3168,_0x1e6a64=formatElapsed(_0x8317ea);_0x4bc1ba?console['log'](_0x42d178(0x20e)+(_0x541cad+0x1)+'/'+_0x40a2ff[_0x42d178(0x234)][_0x42d178(0x236)]+_0x42d178(0x25f)+a5_0x535e65[_0x42d178(0x21c)]('✓')+'\x20('+_0x1e6a64+')'):console[_0x42d178(0x1e2)](_0x42d178(0x20e)+(_0x541cad+0x1)+'/'+_0x40a2ff[_0x42d178(0x234)][_0x42d178(0x236)]+'...\x20'+a5_0x535e65[_0x42d178(0x221)]('✗'));},'onEvaluationStart':()=>{_0x3560ab['text']='Evaluating\x20response...';},'onEvaluationComplete':_0x25cc0e=>{const _0x2dad6b=_0x5d3168,_0x41e5bc=formatElapsed(_0x25cc0e);console[_0x2dad6b(0x1e2)](_0x2dad6b(0x233)+a5_0x535e65['green']('✓')+'\x20('+_0x41e5bc+')');}});_0x3560ab[_0x5d3168(0x208)](),_0x11b139[_0x5d3168(0x1e7)](_0x534a85);if(_0x534a85[_0x5d3168(0x1ff)]===_0x5d3168(0x214))console[_0x5d3168(0x1e2)](a5_0x535e65[_0x5d3168(0x21c)](_0x5d3168(0x1d9)+_0x534a85[_0x5d3168(0x1f2)])+a5_0x535e65[_0x5d3168(0x259)](_0x5d3168(0x1fa)));else _0x534a85[_0x5d3168(0x1ff)]==='FAIL'?console[_0x5d3168(0x1e2)](a5_0x535e65[_0x5d3168(0x221)]('✗\x20FAIL:\x20'+_0x534a85[_0x5d3168(0x1f2)])+a5_0x535e65['dim'](_0x5d3168(0x1fa))):console[_0x5d3168(0x1e2)](a5_0x535e65['red']('✗\x20ERROR:\x20'+_0x534a85['reason']));_0x534a85[_0x5d3168(0x22d)]&&console[_0x5d3168(0x1e2)](a5_0x535e65[_0x5d3168(0x259)](_0x5d3168(0x1e9)+_0x534a85[_0x5d3168(0x22d)]));}catch(_0x1bd828){_0x3560ab['stop']();const _0x75b159=_0x1bd828 instanceof Error?_0x1bd828[_0x5d3168(0x22e)]:String(_0x1bd828);console[_0x5d3168(0x1e2)](a5_0x535e65['red'](_0x5d3168(0x25e)+_0x75b159)),_0x11b139[_0x5d3168(0x1e7)]({'name':_0x40a2ff[_0x5d3168(0x22a)],'status':_0x5d3168(0x245),'reason':_0x75b159,'timestamp':new Date()[_0x5d3168(0x247)](),'duration_ms':0x0});}}}console[_0x5d3168(0x1e2)]();const _0x51ca6f=Date['now']()-_0x185af4,_0x387ab4=_0x11b139[_0x5d3168(0x238)](_0x46507c=>_0x46507c[_0x5d3168(0x1ff)]==='PASS')[_0x5d3168(0x236)],_0x50f358=_0x11b139['filter'](_0x2fca2c=>_0x2fca2c[_0x5d3168(0x1ff)]===_0x5d3168(0x1fe))[_0x5d3168(0x236)],_0x4b0a30=_0x11b139[_0x5d3168(0x238)](_0x13e8df=>_0x13e8df[_0x5d3168(0x1ff)]==='ERROR')[_0x5d3168(0x236)];console[_0x5d3168(0x1e2)]('━'[_0x5d3168(0x25b)](0x3c)),console[_0x5d3168(0x1e2)](_0x5d3168(0x20a)),console[_0x5d3168(0x1e2)]('━'[_0x5d3168(0x25b)](0x3c)),console[_0x5d3168(0x1e2)](_0x5d3168(0x25d)+_0x11b139[_0x5d3168(0x236)]),console[_0x5d3168(0x1e2)](_0x5d3168(0x20b)+a5_0x535e65['green'](_0x387ab4)),console[_0x5d3168(0x1e2)](_0x5d3168(0x22c)+a5_0x535e65[_0x5d3168(0x221)](_0x50f358));_0x4b0a30>0x0&&console[_0x5d3168(0x1e2)]('Errors:\x20\x20\x20'+a5_0x535e65['red'](_0x4b0a30));console[_0x5d3168(0x1e2)]('Duration:\x20'+formatElapsed(_0x51ca6f)),console[_0x5d3168(0x1e2)]('━'[_0x5d3168(0x25b)](0x3c));const _0x79a5af={'summary':{'total':_0x11b139['length'],'passed':_0x387ab4,'failed':_0x50f358,'errors':_0x4b0a30>0x0?_0x4b0a30:undefined,'duration_ms':_0x51ca6f},'tests':_0x11b139,'agent':{'project':_0x4b8a7f['projectName'],'name':_0x4b8a7f['agentName'],'site':_0x2c27b9},'timestamp':new Date(_0x185af4)[_0x5d3168(0x247)]()};if(_0x4fb726!=='table'||_0x1ea26c){const _0x3099df=formatResults(_0x79a5af,_0x4fb726);if(_0x1ea26c)try{a5_0xabfca1[_0x5d3168(0x1f4)](_0x1ea26c,_0x3099df,'utf-8'),console['log'](),console[_0x5d3168(0x1e2)](a5_0x535e65['dim'](_0x5d3168(0x246)+_0x1ea26c));}catch(_0x319893){return console['log'](),console[_0x5d3168(0x1e2)](a5_0x535e65[_0x5d3168(0x221)](_0x5d3168(0x1d0)+_0x319893)),0x1;}else console[_0x5d3168(0x1e2)](),console[_0x5d3168(0x1e2)](_0x3099df);}const _0x53f4fc=_0x11b139['filter'](_0x5b5a10=>_0x5b5a10[_0x5d3168(0x1ff)]!=='PASS');return _0x53f4fc[_0x5d3168(0x236)]>0x0?0x1:0x0;}}
1
+ const a5_0x4fb7d6=a5_0x4d1d;(function(_0x313bf0,_0x2c46b7){const _0x5e0390=a5_0x4d1d,_0x576447=_0x313bf0();while(!![]){try{const _0x53ba5c=parseInt(_0x5e0390(0x188))/0x1+-parseInt(_0x5e0390(0x185))/0x2*(-parseInt(_0x5e0390(0x15f))/0x3)+parseInt(_0x5e0390(0x19b))/0x4+parseInt(_0x5e0390(0x180))/0x5+-parseInt(_0x5e0390(0x1ab))/0x6+parseInt(_0x5e0390(0x1e4))/0x7*(parseInt(_0x5e0390(0x1d0))/0x8)+-parseInt(_0x5e0390(0x19a))/0x9;if(_0x53ba5c===_0x2c46b7)break;else _0x576447['push'](_0x576447['shift']());}catch(_0x66aee5){_0x576447['push'](_0x576447['shift']());}}}(a5_0xb136,0x66f4d));import*as a5_0x572dac from'node:fs';import*as a5_0x234e02 from'node:path';import a5_0x14baf1 from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';function a5_0x4d1d(_0x1fb384,_0x40a3a3){_0x1fb384=_0x1fb384-0x152;const _0xb13651=a5_0xb136();let _0x4d1d3f=_0xb13651[_0x1fb384];return _0x4d1d3f;}import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';function a5_0xb136(){const _0x1f55c5=['Round\x201/','description','\x20\x20Evaluating...\x20','dim','\x20\x20-\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','trim','\x20(cached)','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','3TYYpJf','New\x20tests\x20to\x20execute:\x20','agent','\x20-\x20','Using\x20agent:\x20','white','rounds','Failed:\x20\x20\x20','add','✗\x20FAIL:\x20','Error\x20writing\x20output\x20file:\x20','length','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','stop','no_tests','FAIL','\x20\x20Site:\x20','reason','isSpinning','no_local_folder','text','agentDirs','Project\x20path:\x20','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','Test\x20Configuration:','Available\x20tests:\x20','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','reeval','Site:\x20','json','repeat','log','site','1273640BagLyB','timestamp','yellow','Cached\x20run\x20is\x20from\x20site\x20\x22','Re-evaluation\x20Summary','1387654CrJmRa','agentName','\x27\x20to\x20create\x20the\x20folder\x20structure.','621169iwqUzU','executeReeval','llm','Running\x20agent\x20tests...','\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)','Test\x20Summary','cyan','name','testYmlPath','writeFileSync','Running:\x20','Output\x20written\x20to:\x20',':\x20Sending\x20user\x20input...','Re-evaluating\x20','Round\x20','✗\x20ERROR:\x20Project\x20not\x20found:\x20','verbose','conversation_url','13269681iDWqQr','1501708NCAdId','No\x20tests\x20found\x20matching:\x20','✓\x20PASS:\x20','green','includes','Duration:\x20','round','eval','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','agent:test','existsSync','Run\x20tests\x20for\x20an\x20LLM\x20agent','Running\x20test:\x20','Agent:\x20','projectName','tests','1604628OkYjYo','\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','...','\x20\x20Round\x20','some','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','join','found','split','No\x20tests\x20have\x20tags\x20defined.','ERROR','⚠\x20SKIPPED:\x20','source','push','start','forEach','toLowerCase','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','context','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','toISOString','\x20\x20Agent:\x20','Failed\x20Tests:','no_context','utf-8','filter','Re-evaluating...','llmProject','PASS','...\x20','Conversation\x20URL:\x20','dryRun','Passed:\x20\x20\x20','Available\x20tags:\x20','\x22:\x20','404','output','31768BaHPbF','now','red','message','\x22,\x20but\x20current\x20site\x20is\x20\x22','table','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','No\x20tests\x20found\x20with\x20tags:\x20','\x20(new)','has','Error:\x20No\x20previous\x20test\x20run\x20found.','tags','Total:\x20\x20\x20\x20','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','execute','basename','map','✗\x20ERROR:\x20','\x20\x20Project:\x20','Tests\x20found:\x20','385wZEuBf','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','tsv','status','multiple_agents','projectDir','Usage:','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','substring','size','/<agent-name>'];a5_0xb136=function(){return _0x1f55c5;};return a5_0xb136();}export class AgentTestCommand extends BaseCommand{[a5_0x4fb7d6(0x18f)]=a5_0x4fb7d6(0x1a4);[a5_0x4fb7d6(0x157)]=a5_0x4fb7d6(0x1a6);async[a5_0x4fb7d6(0x1de)](_0x208f11){const _0xa685ad=a5_0x4fb7d6,{options:_0x4a6608,args:_0x5a445c,tdx:_0x2181b9}=_0x208f11,_0x497726=_0x5a445c[0x0]||'.',_0x413829=_0x4a6608[_0xa685ad(0x1ca)],_0x214388=_0x4a6608,_0x113fbc=_0x214388[_0xa685ad(0x1a2)]===![],_0x31fa25=_0x214388[_0xa685ad(0x17a)],_0x406afb=_0x214388['name'],_0x277046=_0x214388[_0xa685ad(0x1db)],_0xcf1386=_0x4a6608['site'],_0x2e52f2=_0x214388[_0xa685ad(0x1cf)];if(_0x31fa25&&_0x113fbc)return console[_0xa685ad(0x17e)](a5_0x14baf1[_0xa685ad(0x1d2)](_0xa685ad(0x1a3))),0x1;let _0x3b835c=_0xa685ad(0x1d5);if(_0x214388[_0xa685ad(0x17c)])_0x3b835c=_0xa685ad(0x17c);else{if(_0x214388['jsonl'])_0x3b835c='jsonl';else{if(_0x214388[_0xa685ad(0x1e6)])_0x3b835c=_0xa685ad(0x1e6);else{if(_0x214388['table'])_0x3b835c=_0xa685ad(0x1d5);}}}const _0x27bb77=_0x214388[_0xa685ad(0x1c6)];let _0x27e3e2=_0x497726;const _0x1d4ec0=a5_0x572dac[_0xa685ad(0x1a5)](_0x497726),_0x1933df=_0x497726==='.';if(!_0x1d4ec0||_0x1933df){const _0x5a7b8f=resolveProjectFromContext(_0x497726,_0x27bb77,{'requireFile':'test.yml'});if(_0x5a7b8f[_0xa685ad(0x1b2)])_0x27e3e2=_0x5a7b8f[_0xa685ad(0x1e9)],_0x5a7b8f[_0xa685ad(0x1b7)]===_0xa685ad(0x1bd)&&console[_0xa685ad(0x17e)](a5_0x14baf1['dim'](_0xa685ad(0x163)+_0x27e3e2));else switch(_0x5a7b8f[_0xa685ad(0x170)]){case _0xa685ad(0x1c2):console[_0xa685ad(0x17e)](a5_0x14baf1['yellow'](_0x5a7b8f[_0xa685ad(0x1d3)])),console[_0xa685ad(0x17e)](),console[_0xa685ad(0x17e)](_0xa685ad(0x1ea)),console[_0xa685ad(0x17e)](_0xa685ad(0x1ac)),console['log'](_0xa685ad(0x18c)),console[_0xa685ad(0x17e)](),console[_0xa685ad(0x17e)]('Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>');return 0x1;case _0xa685ad(0x172):console[_0xa685ad(0x17e)](a5_0x14baf1[_0xa685ad(0x182)](_0x5a7b8f[_0xa685ad(0x1d3)])),console[_0xa685ad(0x17e)](),console[_0xa685ad(0x17e)]('Run\x20\x27tdx\x20agent\x20pull\x20'+_0x5a7b8f[_0xa685ad(0x1c6)]+_0xa685ad(0x187));return 0x1;case _0xa685ad(0x1e8):{const _0x1a8302=a5_0x234e02[_0xa685ad(0x1df)](_0x5a7b8f[_0xa685ad(0x1e9)]);console[_0xa685ad(0x17e)](a5_0x14baf1[_0xa685ad(0x182)](_0xa685ad(0x1be)+_0x5a7b8f[_0xa685ad(0x1c6)]+'\x22:'));for(const _0x238d2b of _0x5a7b8f[_0xa685ad(0x174)]){console[_0xa685ad(0x17e)](_0xa685ad(0x15a)+_0x238d2b);}return console[_0xa685ad(0x17e)](),console[_0xa685ad(0x17e)](_0xa685ad(0x152)+_0x1a8302+_0xa685ad(0x155)),0x1;}case _0xa685ad(0x16d):console['log'](a5_0x14baf1[_0xa685ad(0x182)]('No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22'+_0x5a7b8f[_0xa685ad(0x1c6)]+'\x22.')),console[_0xa685ad(0x17e)](a5_0x14baf1[_0xa685ad(0x159)](_0xa685ad(0x175)+_0x5a7b8f['projectDir'])),console[_0xa685ad(0x17e)](),console[_0xa685ad(0x17e)](_0xa685ad(0x1d6));return 0x1;}}const {definition:_0x224d3b,agentInfo:_0x1d95dc}=parseTestFile(_0x27e3e2);let _0x50d90a=_0x224d3b[_0xa685ad(0x1aa)];if(_0x406afb){const _0x3f2d82=_0x406afb[_0xa685ad(0x1b3)](',')[_0xa685ad(0x1e0)](_0x7c767b=>_0x7c767b['trim']());_0x50d90a=_0x224d3b[_0xa685ad(0x1aa)][_0xa685ad(0x1c4)](_0x461c7c=>_0x3f2d82[_0xa685ad(0x19f)](_0x461c7c['name']));if(_0x50d90a[_0xa685ad(0x16a)]===0x0)return console[_0xa685ad(0x17e)](a5_0x14baf1[_0xa685ad(0x182)](_0xa685ad(0x19c)+_0x406afb)),console['log'](a5_0x14baf1['dim'](_0xa685ad(0x178)+_0x224d3b[_0xa685ad(0x1aa)][_0xa685ad(0x1e0)](_0x5a5bb5=>_0x5a5bb5[_0xa685ad(0x18f)])[_0xa685ad(0x1b1)](',\x20'))),0x1;}if(_0x277046){const _0x7ec15=_0x277046[_0xa685ad(0x1b3)](',')[_0xa685ad(0x1e0)](_0x264a0e=>_0x264a0e[_0xa685ad(0x15c)]()['toLowerCase']());_0x50d90a=_0x50d90a[_0xa685ad(0x1c4)](_0x4c8475=>_0x4c8475[_0xa685ad(0x1db)]?.[_0xa685ad(0x1af)](_0x1237ea=>_0x7ec15['includes'](_0x1237ea[_0xa685ad(0x1bb)]())));if(_0x50d90a[_0xa685ad(0x16a)]===0x0){console['log'](a5_0x14baf1['yellow'](_0xa685ad(0x1d7)+_0x277046));const _0x5dab45=new Set();return _0x224d3b[_0xa685ad(0x1aa)][_0xa685ad(0x1ba)](_0x3b6717=>_0x3b6717[_0xa685ad(0x1db)]?.[_0xa685ad(0x1ba)](_0x1b1832=>_0x5dab45[_0xa685ad(0x167)](_0x1b1832))),_0x5dab45[_0xa685ad(0x154)]>0x0?console[_0xa685ad(0x17e)](a5_0x14baf1['dim'](_0xa685ad(0x1cc)+[..._0x5dab45][_0xa685ad(0x1b1)](',\x20'))):console['log'](a5_0x14baf1[_0xa685ad(0x159)](_0xa685ad(0x1b4))),0x1;}}if(_0x31fa25)return this[_0xa685ad(0x189)](_0x208f11,{'definition':{'tests':_0x50d90a},'agentInfo':_0x1d95dc,'outputFormat':_0x3b835c,'outputFile':_0x2e52f2,'testNames':_0x406afb});if(_0x413829){console[_0xa685ad(0x17e)](a5_0x14baf1['cyan'](_0xa685ad(0x177))),console['log'](_0xa685ad(0x16f)+a5_0x14baf1[_0xa685ad(0x164)](_0xcf1386)),console[_0xa685ad(0x17e)](_0xa685ad(0x1e2)+a5_0x14baf1[_0xa685ad(0x164)](_0x1d95dc['projectName'])),console[_0xa685ad(0x17e)](_0xa685ad(0x1c0)+a5_0x14baf1[_0xa685ad(0x164)](_0x1d95dc[_0xa685ad(0x186)])),console['log'](),console[_0xa685ad(0x17e)](_0xa685ad(0x1e3)+a5_0x14baf1[_0xa685ad(0x164)](_0x50d90a[_0xa685ad(0x16a)]));for(let _0x24c226=0x0;_0x24c226<_0x50d90a['length'];_0x24c226++){const _0x43cd82=_0x50d90a[_0x24c226],_0x21fbba=_0x43cd82[_0xa685ad(0x165)][_0xa685ad(0x16a)]===0x1?_0xa685ad(0x1a1):_0xa685ad(0x165),_0x1d8e21=_0x43cd82[_0xa685ad(0x1db)]?.[_0xa685ad(0x16a)]?'\x20['+_0x43cd82[_0xa685ad(0x1db)][_0xa685ad(0x1b1)](',\x20')+']':'';console['log']('\x20\x20'+(_0x24c226+0x1)+'.\x20'+a5_0x14baf1['white'](_0x43cd82[_0xa685ad(0x18f)])+'\x20('+_0x43cd82[_0xa685ad(0x165)][_0xa685ad(0x16a)]+'\x20'+_0x21fbba+')'+a5_0x14baf1['dim'](_0x1d8e21));}return 0x0;}let _0x36bb37,_0x5dec0b;try{_0x36bb37=await _0x2181b9[_0xa685ad(0x18a)]['resolveProjectId'](_0x1d95dc[_0xa685ad(0x1a9)]);}catch(_0x16437a){const _0x39e32c=_0x16437a instanceof Error?_0x16437a[_0xa685ad(0x1d3)]:String(_0x16437a);return _0x39e32c['includes'](_0xa685ad(0x1ce))||_0x39e32c[_0xa685ad(0x1bb)]()[_0xa685ad(0x19f)]('not\x20found')?console[_0xa685ad(0x17e)](a5_0x14baf1[_0xa685ad(0x1d2)](_0xa685ad(0x197)+_0x1d95dc[_0xa685ad(0x1a9)])):console[_0xa685ad(0x17e)](a5_0x14baf1[_0xa685ad(0x1d2)](_0xa685ad(0x15e)+_0x1d95dc[_0xa685ad(0x1a9)]+_0xa685ad(0x1cd)+_0x39e32c)),0x1;}try{_0x5dec0b=await _0x2181b9[_0xa685ad(0x18a)]['resolveAgentId'](_0x1d95dc[_0xa685ad(0x186)],_0x36bb37);}catch(_0x55807d){const _0xd3b173=_0x55807d instanceof Error?_0x55807d[_0xa685ad(0x1d3)]:String(_0x55807d);return _0xd3b173['includes'](_0xa685ad(0x1ce))||_0xd3b173[_0xa685ad(0x1bb)]()[_0xa685ad(0x19f)]('not\x20found')?console['log'](a5_0x14baf1[_0xa685ad(0x1d2)]('✗\x20ERROR:\x20Agent\x20not\x20found:\x20'+_0x1d95dc[_0xa685ad(0x186)])):console[_0xa685ad(0x17e)](a5_0x14baf1[_0xa685ad(0x1d2)](_0xa685ad(0x15b)+_0x1d95dc[_0xa685ad(0x186)]+_0xa685ad(0x1cd)+_0xd3b173)),0x1;}let _0x52a00a;if(!_0x113fbc)try{_0x52a00a=await setupEvaluatorAgent(_0x2181b9[_0xa685ad(0x18a)],_0x4a6608['verbose']);}catch(_0x1e94b8){const _0x33ca4e=_0x1e94b8 instanceof Error?_0x1e94b8[_0xa685ad(0x1d3)]:String(_0x1e94b8);return console[_0xa685ad(0x17e)](a5_0x14baf1[_0xa685ad(0x1d2)](_0xa685ad(0x179)+_0x33ca4e)),0x1;}console[_0xa685ad(0x17e)](a5_0x14baf1['cyan'](_0xa685ad(0x18b))),console[_0xa685ad(0x17e)](_0xa685ad(0x17b)+a5_0x14baf1[_0xa685ad(0x164)](_0xcf1386)),console[_0xa685ad(0x17e)]('Agent:\x20'+a5_0x14baf1[_0xa685ad(0x164)](_0x1d95dc['projectName']+'/'+_0x1d95dc[_0xa685ad(0x186)])),console[_0xa685ad(0x17e)]();const _0x1840c6=[],_0x26fcc7=[],_0x5a9543=Date['now']();for(let _0xebe520=0x0;_0xebe520<_0x50d90a[_0xa685ad(0x16a)];_0xebe520++){const _0x3b8755=_0x50d90a[_0xebe520];_0x50d90a[_0xa685ad(0x16a)]>0x1?console[_0xa685ad(0x17e)]('Test\x20'+(_0xebe520+0x1)+'/'+_0x50d90a[_0xa685ad(0x16a)]+':\x20'+a5_0x14baf1[_0xa685ad(0x164)](_0x3b8755[_0xa685ad(0x18f)])):console[_0xa685ad(0x17e)](_0xa685ad(0x1a7)+a5_0x14baf1[_0xa685ad(0x164)](_0x3b8755[_0xa685ad(0x18f)]));const _0x49e5b3=createCommandSpinner(_0xa685ad(0x156)+_0x3b8755['rounds']['length']+_0xa685ad(0x194));_0x49e5b3[_0xa685ad(0x1b9)]();try{const {result:_0x4e6c66,conversation:_0xb2e525}=await runTest(_0x2181b9[_0xa685ad(0x18a)],_0x3b8755,{'agentId':_0x5dec0b,'projectId':_0x36bb37,'site':_0xcf1386,'noEval':_0x113fbc,'evaluatorId':_0x52a00a,'onRoundStart':(_0x374cac,_0xfd5aa)=>{const _0x5773cd=_0xa685ad;_0x49e5b3['text']=_0x5773cd(0x196)+(_0x374cac+0x1)+'/'+_0xfd5aa+_0x5773cd(0x194);},'onRoundComplete':(_0x1df05a,_0x4d857b,_0xda4cf1)=>{const _0xea3ea2=_0xa685ad,_0x23da77=formatElapsed(_0x4d857b);_0xda4cf1?console[_0xea3ea2(0x17e)]('\x20\x20Round\x20'+(_0x1df05a+0x1)+'/'+_0x3b8755[_0xea3ea2(0x165)][_0xea3ea2(0x16a)]+_0xea3ea2(0x1c8)+a5_0x14baf1[_0xea3ea2(0x19e)]('✓')+'\x20('+_0x23da77+')'):console['log'](_0xea3ea2(0x1ae)+(_0x1df05a+0x1)+'/'+_0x3b8755[_0xea3ea2(0x165)]['length']+_0xea3ea2(0x1c8)+a5_0x14baf1[_0xea3ea2(0x1d2)]('✗'));},'onEvaluationStart':()=>{_0x49e5b3['text']='Evaluating\x20response...';},'onEvaluationComplete':_0x4ca5c6=>{const _0x3e3553=_0xa685ad,_0x4d73d4=formatElapsed(_0x4ca5c6);console['log'](_0x3e3553(0x158)+a5_0x14baf1[_0x3e3553(0x19e)]('✓')+'\x20('+_0x4d73d4+')');}});_0x49e5b3[_0xa685ad(0x16c)](),_0x1840c6['push'](_0x4e6c66),_0x26fcc7[_0xa685ad(0x1b8)](_0xb2e525);if(_0x4e6c66[_0xa685ad(0x1e7)]===_0xa685ad(0x1c7))console[_0xa685ad(0x17e)](a5_0x14baf1[_0xa685ad(0x19e)]('✓\x20PASS:\x20'+_0x4e6c66[_0xa685ad(0x170)]));else _0x4e6c66[_0xa685ad(0x1e7)]===_0xa685ad(0x16e)?console['log'](a5_0x14baf1[_0xa685ad(0x1d2)](_0xa685ad(0x168)+_0x4e6c66[_0xa685ad(0x170)])):console['log'](a5_0x14baf1[_0xa685ad(0x1d2)](_0xa685ad(0x1e1)+_0x4e6c66[_0xa685ad(0x170)]));_0x4e6c66[_0xa685ad(0x199)]&&console[_0xa685ad(0x17e)](a5_0x14baf1[_0xa685ad(0x159)](_0xa685ad(0x1c9)+_0x4e6c66['conversation_url'])),console[_0xa685ad(0x17e)]();}catch(_0xbfce3d){_0x49e5b3[_0xa685ad(0x16c)]();const _0x15c51f=_0xbfce3d instanceof Error?_0xbfce3d[_0xa685ad(0x1d3)]:String(_0xbfce3d);console['log'](a5_0x14baf1['red'](_0xa685ad(0x1e1)+_0x15c51f)),console[_0xa685ad(0x17e)](),_0x1840c6[_0xa685ad(0x1b8)]({'name':_0x3b8755[_0xa685ad(0x18f)],'status':_0xa685ad(0x1b5),'reason':_0x15c51f,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}const _0x57d66b=Date[_0xa685ad(0x1d1)]()-_0x5a9543,_0x5ea404=_0x1840c6[_0xa685ad(0x1c4)](_0x22e381=>_0x22e381[_0xa685ad(0x1e7)]===_0xa685ad(0x1c7))[_0xa685ad(0x16a)],_0x35697c=_0x1840c6[_0xa685ad(0x1c4)](_0x1f0af2=>_0x1f0af2[_0xa685ad(0x1e7)]===_0xa685ad(0x16e))['length'],_0x7f7b5f=_0x1840c6['filter'](_0x3f1f6b=>_0x3f1f6b['status']===_0xa685ad(0x1b5))[_0xa685ad(0x16a)];console[_0xa685ad(0x17e)]('━'[_0xa685ad(0x17d)](0x3c)),console['log'](_0xa685ad(0x18d)),console[_0xa685ad(0x17e)]('━'[_0xa685ad(0x17d)](0x3c)),console['log'](_0xa685ad(0x1dc)+_0x1840c6[_0xa685ad(0x16a)]),console[_0xa685ad(0x17e)]('Passed:\x20\x20\x20'+a5_0x14baf1['green'](_0x5ea404)),console['log'](_0xa685ad(0x166)+a5_0x14baf1[_0xa685ad(0x1d2)](_0x35697c));_0x7f7b5f>0x0&&console[_0xa685ad(0x17e)]('Errors:\x20\x20\x20'+a5_0x14baf1[_0xa685ad(0x1d2)](_0x7f7b5f));console[_0xa685ad(0x17e)](_0xa685ad(0x1a0)+formatElapsed(_0x57d66b)),console[_0xa685ad(0x17e)]('━'[_0xa685ad(0x17d)](0x3c));const _0x59a452=_0x1840c6['filter'](_0xe38124=>_0xe38124[_0xa685ad(0x1e7)]!==_0xa685ad(0x1c7));if(_0x59a452[_0xa685ad(0x16a)]>0x0){console[_0xa685ad(0x17e)](),console['log'](_0xa685ad(0x1c1));for(const _0x1657e1 of _0x59a452){const _0x4596fd=a5_0x14baf1['red']('✗'),_0x47244d=_0x1657e1[_0xa685ad(0x170)][_0xa685ad(0x16a)]>0x32?_0x1657e1[_0xa685ad(0x170)][_0xa685ad(0x153)](0x0,0x32)+'...':_0x1657e1[_0xa685ad(0x170)];console[_0xa685ad(0x17e)]('\x20\x20'+_0x4596fd+'\x20'+_0x1657e1[_0xa685ad(0x18f)]+':\x20'+_0x47244d);}}const _0xc03702={'summary':{'total':_0x1840c6[_0xa685ad(0x16a)],'passed':_0x5ea404,'failed':_0x35697c,'errors':_0x7f7b5f>0x0?_0x7f7b5f:undefined,'duration_ms':_0x57d66b},'tests':_0x1840c6,'agent':{'project':_0x1d95dc[_0xa685ad(0x1a9)],'name':_0x1d95dc['agentName'],'site':_0xcf1386},'timestamp':new Date(_0x5a9543)['toISOString']()};try{const _0x3e002d=buildCachedTestRun(_0x26fcc7,{'site':_0xcf1386,'projectId':_0x36bb37,'projectName':_0x1d95dc[_0xa685ad(0x1a9)],'agentId':_0x5dec0b,'agentName':_0x1d95dc['agentName'],'testYmlPath':a5_0x234e02['resolve'](_0x1d95dc[_0xa685ad(0x190)])});saveLastTestRun(_0x3e002d);}catch{}if(_0x3b835c!=='table'||_0x2e52f2){const _0x355c43=formatResults(_0xc03702,_0x3b835c);if(_0x2e52f2)try{a5_0x572dac[_0xa685ad(0x191)](_0x2e52f2,_0x355c43,_0xa685ad(0x1c3)),console[_0xa685ad(0x17e)](),console[_0xa685ad(0x17e)](a5_0x14baf1[_0xa685ad(0x159)](_0xa685ad(0x193)+_0x2e52f2));}catch(_0x25423e){return console[_0xa685ad(0x17e)](),console[_0xa685ad(0x17e)](a5_0x14baf1[_0xa685ad(0x1d2)](_0xa685ad(0x169)+_0x25423e)),0x1;}else console[_0xa685ad(0x17e)](),console[_0xa685ad(0x17e)](_0x355c43);}return _0x59a452[_0xa685ad(0x16a)]>0x0?0x1:0x0;}async[a5_0x4fb7d6(0x189)](_0x45d2a4,_0x386c3d){const _0x4aecd0=a5_0x4fb7d6,{options:_0x410626,tdx:_0x5d214d}=_0x45d2a4,{definition:_0x901e4d,agentInfo:_0x5a1af9,outputFormat:_0x479067,outputFile:_0x500622}=_0x386c3d,_0x24cf08=_0x410626['site'],_0xdee21a=loadLastTestRun();if(!_0xdee21a)return console[_0x4aecd0(0x17e)](a5_0x14baf1[_0x4aecd0(0x1d2)](_0x4aecd0(0x1da))),console[_0x4aecd0(0x17e)](a5_0x14baf1[_0x4aecd0(0x159)](_0x4aecd0(0x1dd))),0x1;if(_0xdee21a[_0x4aecd0(0x161)]['agentName']!==_0x5a1af9['agentName'])return console[_0x4aecd0(0x17e)](a5_0x14baf1[_0x4aecd0(0x1d2)](_0x4aecd0(0x1e5)+_0xdee21a[_0x4aecd0(0x161)][_0x4aecd0(0x186)]+_0x4aecd0(0x1bc)+_0x5a1af9[_0x4aecd0(0x186)]+'\x22.')),console['log'](a5_0x14baf1[_0x4aecd0(0x159)](_0x4aecd0(0x16b))),0x1;const _0x573310=new Set(_0xdee21a['conversations']['map'](_0x54b0ad=>_0x54b0ad['testName'])),_0x19c55a=_0x901e4d[_0x4aecd0(0x1aa)]['filter'](_0x54d1fb=>!_0x573310[_0x4aecd0(0x1d9)](_0x54d1fb[_0x4aecd0(0x18f)]));if(_0x19c55a[_0x4aecd0(0x16a)]>0x0&&_0xdee21a[_0x4aecd0(0x17f)]!==_0x24cf08)return console['log'](a5_0x14baf1['red'](_0x4aecd0(0x1b0))),console[_0x4aecd0(0x17e)](a5_0x14baf1[_0x4aecd0(0x159)](_0x4aecd0(0x183)+_0xdee21a['site']+_0x4aecd0(0x1d4)+_0x24cf08+'\x22.')),console[_0x4aecd0(0x17e)](a5_0x14baf1[_0x4aecd0(0x159)]('Either\x20switch\x20to\x20the\x20\x22'+_0xdee21a[_0x4aecd0(0x17f)]+_0x4aecd0(0x176))),0x1;const _0x292e33=_0x901e4d['tests']['filter'](_0xbe574d=>_0x573310[_0x4aecd0(0x1d9)](_0xbe574d[_0x4aecd0(0x18f)])),_0x4978d6=_0x19c55a;let _0x2afe4f;try{_0x2afe4f=await setupEvaluatorAgent(_0x5d214d[_0x4aecd0(0x18a)],_0x410626[_0x4aecd0(0x198)]);}catch(_0x1b38f5){const _0x11c19c=_0x1b38f5 instanceof Error?_0x1b38f5[_0x4aecd0(0x1d3)]:String(_0x1b38f5);return console['log'](a5_0x14baf1[_0x4aecd0(0x1d2)](_0x4aecd0(0x179)+_0x11c19c)),0x1;}console[_0x4aecd0(0x17e)](a5_0x14baf1[_0x4aecd0(0x18e)]('Re-evaluating\x20cached\x20test\x20run...')),console[_0x4aecd0(0x17e)]('Cached\x20run\x20from:\x20'+a5_0x14baf1[_0x4aecd0(0x164)](_0xdee21a[_0x4aecd0(0x181)])),console[_0x4aecd0(0x17e)](_0x4aecd0(0x1a8)+a5_0x14baf1[_0x4aecd0(0x164)](_0xdee21a['agent'][_0x4aecd0(0x1a9)]+'/'+_0xdee21a[_0x4aecd0(0x161)][_0x4aecd0(0x186)]));_0x4978d6[_0x4aecd0(0x16a)]>0x0&&console[_0x4aecd0(0x17e)](_0x4aecd0(0x160)+a5_0x14baf1[_0x4aecd0(0x182)](_0x4978d6[_0x4aecd0(0x16a)]));console[_0x4aecd0(0x17e)]();const _0x6af31f=[],_0x30fe83=Date[_0x4aecd0(0x1d1)](),_0x37f995=createCommandSpinner(_0x4aecd0(0x1c5));if(_0x292e33[_0x4aecd0(0x16a)]>0x0)try{const _0x4c146f=await reevaluateFromCache(_0x5d214d[_0x4aecd0(0x18a)],_0xdee21a,{'tests':_0x292e33},{'evaluatorId':_0x2afe4f,'onTestStart':(_0x170259,_0x3433d7,_0x21d82d)=>{const _0x419f55=_0x4aecd0;_0x37f995[_0x419f55(0x173)]=_0x419f55(0x195)+(_0x3433d7+0x1)+'/'+_0x21d82d+':\x20'+_0x170259+_0x419f55(0x1ad);if(!_0x37f995[_0x419f55(0x171)])_0x37f995['start']();},'onTestComplete':(_0x10c9b0,_0xf528b4)=>{const _0x3b9b6e=_0x4aecd0;_0x37f995[_0x3b9b6e(0x16c)]();if(_0xf528b4[_0x3b9b6e(0x1e7)]===_0x3b9b6e(0x1c7))console['log'](a5_0x14baf1['green'](_0x3b9b6e(0x19d)+_0x10c9b0)+a5_0x14baf1[_0x3b9b6e(0x159)](_0x3b9b6e(0x15d)));else _0xf528b4[_0x3b9b6e(0x1e7)]===_0x3b9b6e(0x16e)?console[_0x3b9b6e(0x17e)](a5_0x14baf1[_0x3b9b6e(0x1d2)]('✗\x20FAIL:\x20'+_0x10c9b0+_0x3b9b6e(0x162)+_0xf528b4[_0x3b9b6e(0x170)])+a5_0x14baf1[_0x3b9b6e(0x159)](_0x3b9b6e(0x15d))):console[_0x3b9b6e(0x17e)](a5_0x14baf1['red']('✗\x20ERROR:\x20'+_0x10c9b0+_0x3b9b6e(0x162)+_0xf528b4['reason']));_0xf528b4[_0x3b9b6e(0x199)]&&console[_0x3b9b6e(0x17e)](a5_0x14baf1[_0x3b9b6e(0x159)]('\x20\x20Conversation:\x20'+_0xf528b4[_0x3b9b6e(0x199)])),_0x6af31f[_0x3b9b6e(0x1b8)](_0xf528b4);},'onTestSkipped':(_0xf82e9e,_0x2e1dfd)=>{const _0x36bd12=_0x4aecd0;_0x37f995[_0x36bd12(0x16c)](),console[_0x36bd12(0x17e)](a5_0x14baf1[_0x36bd12(0x182)](_0x36bd12(0x1b6)+_0xf82e9e+_0x36bd12(0x162)+_0x2e1dfd));}});for(const _0x36c679 of _0x4c146f){!_0x6af31f['find'](_0x10e7f7=>_0x10e7f7[_0x4aecd0(0x18f)]===_0x36c679['name'])&&_0x6af31f['push'](_0x36c679);}}catch(_0x21b604){_0x37f995[_0x4aecd0(0x16c)]();const _0x399c73=_0x21b604 instanceof Error?_0x21b604['message']:String(_0x21b604);return console['log'](a5_0x14baf1[_0x4aecd0(0x1d2)]('✗\x20ERROR:\x20Re-evaluation\x20failed:\x20'+_0x399c73)),0x1;}_0x37f995[_0x4aecd0(0x16c)]();if(_0x4978d6[_0x4aecd0(0x16a)]>0x0){console[_0x4aecd0(0x17e)](),console[_0x4aecd0(0x17e)](a5_0x14baf1[_0x4aecd0(0x18e)]('Executing\x20new\x20tests...'));const {projectId:_0x19b953,agentId:_0x1a144a}=_0xdee21a[_0x4aecd0(0x161)];for(const _0x51b7fa of _0x4978d6){console[_0x4aecd0(0x17e)](_0x4aecd0(0x192)+a5_0x14baf1[_0x4aecd0(0x164)](_0x51b7fa[_0x4aecd0(0x18f)]));const _0x30119d=createCommandSpinner(_0x4aecd0(0x156)+_0x51b7fa['rounds'][_0x4aecd0(0x16a)]+':\x20Sending\x20user\x20input...');_0x30119d['start']();try{const {result:_0x512f6e}=await runTest(_0x5d214d[_0x4aecd0(0x18a)],_0x51b7fa,{'agentId':_0x1a144a,'projectId':_0x19b953,'site':_0xdee21a[_0x4aecd0(0x17f)],'noEval':![],'evaluatorId':_0x2afe4f,'onRoundStart':(_0x5d2e39,_0x34376d)=>{const _0x135af7=_0x4aecd0;_0x30119d['text']='Round\x20'+(_0x5d2e39+0x1)+'/'+_0x34376d+_0x135af7(0x194);},'onRoundComplete':(_0x1fe215,_0x9b29e,_0x161e71)=>{const _0x3d3324=_0x4aecd0,_0x52f70a=formatElapsed(_0x9b29e);_0x161e71?console['log']('\x20\x20Round\x20'+(_0x1fe215+0x1)+'/'+_0x51b7fa['rounds'][_0x3d3324(0x16a)]+'...\x20'+a5_0x14baf1[_0x3d3324(0x19e)]('✓')+'\x20('+_0x52f70a+')'):console[_0x3d3324(0x17e)](_0x3d3324(0x1ae)+(_0x1fe215+0x1)+'/'+_0x51b7fa[_0x3d3324(0x165)][_0x3d3324(0x16a)]+_0x3d3324(0x1c8)+a5_0x14baf1[_0x3d3324(0x1d2)]('✗'));},'onEvaluationStart':()=>{_0x30119d['text']='Evaluating\x20response...';},'onEvaluationComplete':_0xa8b82b=>{const _0x187bcb=_0x4aecd0,_0x52b78c=formatElapsed(_0xa8b82b);console['log'](_0x187bcb(0x158)+a5_0x14baf1['green']('✓')+'\x20('+_0x52b78c+')');}});_0x30119d[_0x4aecd0(0x16c)](),_0x6af31f[_0x4aecd0(0x1b8)](_0x512f6e);if(_0x512f6e['status']===_0x4aecd0(0x1c7))console[_0x4aecd0(0x17e)](a5_0x14baf1[_0x4aecd0(0x19e)](_0x4aecd0(0x19d)+_0x512f6e['reason'])+a5_0x14baf1[_0x4aecd0(0x159)](_0x4aecd0(0x1d8)));else _0x512f6e[_0x4aecd0(0x1e7)]===_0x4aecd0(0x16e)?console[_0x4aecd0(0x17e)](a5_0x14baf1[_0x4aecd0(0x1d2)]('✗\x20FAIL:\x20'+_0x512f6e[_0x4aecd0(0x170)])+a5_0x14baf1[_0x4aecd0(0x159)]('\x20(new)')):console[_0x4aecd0(0x17e)](a5_0x14baf1[_0x4aecd0(0x1d2)]('✗\x20ERROR:\x20'+_0x512f6e[_0x4aecd0(0x170)]));_0x512f6e['conversation_url']&&console[_0x4aecd0(0x17e)](a5_0x14baf1['dim']('\x20\x20Conversation:\x20'+_0x512f6e[_0x4aecd0(0x199)]));}catch(_0x13abf5){_0x30119d[_0x4aecd0(0x16c)]();const _0x132260=_0x13abf5 instanceof Error?_0x13abf5['message']:String(_0x13abf5);console[_0x4aecd0(0x17e)](a5_0x14baf1[_0x4aecd0(0x1d2)](_0x4aecd0(0x1e1)+_0x132260)),_0x6af31f[_0x4aecd0(0x1b8)]({'name':_0x51b7fa['name'],'status':'ERROR','reason':_0x132260,'timestamp':new Date()[_0x4aecd0(0x1bf)](),'duration_ms':0x0});}}}console[_0x4aecd0(0x17e)]();const _0x5c010f=Date[_0x4aecd0(0x1d1)]()-_0x30fe83,_0x3042fa=_0x6af31f[_0x4aecd0(0x1c4)](_0x144851=>_0x144851[_0x4aecd0(0x1e7)]===_0x4aecd0(0x1c7))[_0x4aecd0(0x16a)],_0x211bcb=_0x6af31f[_0x4aecd0(0x1c4)](_0x267177=>_0x267177[_0x4aecd0(0x1e7)]===_0x4aecd0(0x16e))[_0x4aecd0(0x16a)],_0x5bbfd0=_0x6af31f[_0x4aecd0(0x1c4)](_0x592423=>_0x592423[_0x4aecd0(0x1e7)]===_0x4aecd0(0x1b5))['length'];console['log']('━'[_0x4aecd0(0x17d)](0x3c)),console[_0x4aecd0(0x17e)](_0x4aecd0(0x184)),console[_0x4aecd0(0x17e)]('━'[_0x4aecd0(0x17d)](0x3c)),console[_0x4aecd0(0x17e)](_0x4aecd0(0x1dc)+_0x6af31f[_0x4aecd0(0x16a)]),console[_0x4aecd0(0x17e)](_0x4aecd0(0x1cb)+a5_0x14baf1[_0x4aecd0(0x19e)](_0x3042fa)),console['log'](_0x4aecd0(0x166)+a5_0x14baf1[_0x4aecd0(0x1d2)](_0x211bcb));_0x5bbfd0>0x0&&console[_0x4aecd0(0x17e)]('Errors:\x20\x20\x20'+a5_0x14baf1['red'](_0x5bbfd0));console[_0x4aecd0(0x17e)](_0x4aecd0(0x1a0)+formatElapsed(_0x5c010f)),console[_0x4aecd0(0x17e)]('━'['repeat'](0x3c));const _0x3ef326={'summary':{'total':_0x6af31f['length'],'passed':_0x3042fa,'failed':_0x211bcb,'errors':_0x5bbfd0>0x0?_0x5bbfd0:undefined,'duration_ms':_0x5c010f},'tests':_0x6af31f,'agent':{'project':_0x5a1af9['projectName'],'name':_0x5a1af9[_0x4aecd0(0x186)],'site':_0x24cf08},'timestamp':new Date(_0x30fe83)[_0x4aecd0(0x1bf)]()};if(_0x479067!==_0x4aecd0(0x1d5)||_0x500622){const _0x422709=formatResults(_0x3ef326,_0x479067);if(_0x500622)try{a5_0x572dac[_0x4aecd0(0x191)](_0x500622,_0x422709,_0x4aecd0(0x1c3)),console[_0x4aecd0(0x17e)](),console[_0x4aecd0(0x17e)](a5_0x14baf1[_0x4aecd0(0x159)](_0x4aecd0(0x193)+_0x500622));}catch(_0x4a60c8){return console['log'](),console['log'](a5_0x14baf1[_0x4aecd0(0x1d2)](_0x4aecd0(0x169)+_0x4a60c8)),0x1;}else console[_0x4aecd0(0x17e)](),console[_0x4aecd0(0x17e)](_0x422709);}const _0x2a1278=_0x6af31f['filter'](_0x4f3d37=>_0x4f3d37[_0x4aecd0(0x1e7)]!=='PASS');return _0x2a1278[_0x4aecd0(0x16a)]>0x0?0x1:0x0;}}
@@ -1 +1 @@
1
- const a6_0x2224ee=a6_0x4b60;(function(_0x4901c7,_0x25778a){const _0x5dbd72=a6_0x4b60,_0x5c0acd=_0x4901c7();while(!![]){try{const _0x1c4ae8=-parseInt(_0x5dbd72(0xfd))/0x1*(-parseInt(_0x5dbd72(0xf3))/0x2)+-parseInt(_0x5dbd72(0xf0))/0x3*(parseInt(_0x5dbd72(0x103))/0x4)+parseInt(_0x5dbd72(0x10f))/0x5+parseInt(_0x5dbd72(0xee))/0x6+parseInt(_0x5dbd72(0xdb))/0x7*(-parseInt(_0x5dbd72(0xf5))/0x8)+parseInt(_0x5dbd72(0x10d))/0x9*(parseInt(_0x5dbd72(0x10c))/0xa)+parseInt(_0x5dbd72(0xeb))/0xb*(-parseInt(_0x5dbd72(0xe3))/0xc);if(_0x1c4ae8===_0x25778a)break;else _0x5c0acd['push'](_0x5c0acd['shift']());}catch(_0x4b572c){_0x5c0acd['push'](_0x5c0acd['shift']());}}}(a6_0x219c,0x2da1f));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';function a6_0x219c(){const _0x2ad340=['Error:\x20','363OvfmAz','trino','.\x20Valid\x20types:\x20','trim','set-cookie','PATCH','4KngidD','POST','message','x-trino-user','entries','isArray','proxy-authorization','data','authorization','3030630ZhUmDr','9GFIjFW','toUpperCase','709680FRwhfh','output','<\x20HTTP/1.1\x20','startsWith','error','includes','verbose','readBodyFromFile','Invalid\x20API\x20type:\x20','status','request','llm-proxy','stack','set-cookie2','1341326rDoEKu','file','cdp','join','name','description','has','type','5680392FaZwRb','api','headers','method','noColor','llm','GET','color','11AzykwF','workflow','substring','1720800PGlsiu','body','620901MsuoSd','\x22.\x20','indexOf','1802gbVPgm','Invalid\x20HTTP\x20method:\x20','8mLNrig','Results\x20saved\x20to\x20','DELETE','keys','length','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','.\x20Valid\x20methods:\x20'];a6_0x219c=function(){return _0x2ad340;};return a6_0x219c();}import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';function a6_0x4b60(_0xe12bb6,_0x2c5748){_0xe12bb6=_0xe12bb6-0xd4;const _0x219c4b=a6_0x219c();let _0x4b6069=_0x219c4b[_0xe12bb6];return _0x4b6069;}import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a6_0x2224ee(0x10b),a6_0x2224ee(0x109),'cookie',a6_0x2224ee(0x101),a6_0x2224ee(0xda),'x-xsrf-token','x-auth-token',a6_0x2224ee(0x106)]);function isSensitiveHeader(_0x5a5af3){const _0x13306d=a6_0x2224ee;return SENSITIVE_HEADERS[_0x13306d(0xe1)](_0x5a5af3['toLowerCase']());}function parseHeader(_0x1737d5){const _0x31ec25=a6_0x2224ee,_0xc92e98=_0x1737d5[_0x31ec25(0xf2)](':');if(_0xc92e98===-0x1)throw new Error('Invalid\x20header\x20format:\x20\x22'+_0x1737d5+_0x31ec25(0xf1)+'Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22');const _0x3cca64=_0x1737d5[_0x31ec25(0xed)](0x0,_0xc92e98)['trim'](),_0x332c86=_0x1737d5[_0x31ec25(0xed)](_0xc92e98+0x1)[_0x31ec25(0x100)]();if(!_0x3cca64)throw new Error(_0x31ec25(0xfa)+_0x1737d5+'\x22');return[_0x3cca64,_0x332c86];}export class ApiCommand extends BaseCommand{[a6_0x2224ee(0xdf)]=a6_0x2224ee(0xe4);[a6_0x2224ee(0xe0)]='Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs';['validate'](_0x26aa14){const _0x3dcf95=a6_0x2224ee,{args:_0x205237,options:_0x3ab61c}=_0x26aa14,_0x340943=_0x3ab61c;if(_0x205237[_0x3dcf95(0xf9)]===0x0)return'Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list';const _0x7225d2=_0x205237[0x0];if(!_0x7225d2[_0x3dcf95(0x112)]('/'))return'Endpoint\x20must\x20start\x20with\x20/:\x20'+_0x7225d2;const _0x386571=_0x340943[_0x3dcf95(0x10a)],_0x43821e=_0x340943[_0x3dcf95(0xdc)];if(_0x386571&&_0x43821e)return'Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.';const _0x155e80=_0x340943['method']||_0x3dcf95(0xe9),_0x1a49bd=[_0x3dcf95(0xe9),_0x3dcf95(0x104),'PUT',_0x3dcf95(0xf7),_0x3dcf95(0x102)];if(!_0x1a49bd[_0x3dcf95(0x114)](_0x155e80[_0x3dcf95(0x10e)]()))return _0x3dcf95(0xf4)+_0x155e80+_0x3dcf95(0xfb)+_0x1a49bd[_0x3dcf95(0xde)](',\x20');const _0x236f1d=_0x340943[_0x3dcf95(0xe2)]||'td',_0x3c95f6=['td',_0x3dcf95(0xdd),_0x3dcf95(0xec),_0x3dcf95(0xfe),_0x3dcf95(0xe8),_0x3dcf95(0xd8)];if(!_0x3c95f6[_0x3dcf95(0x114)](_0x236f1d))return _0x3dcf95(0xd5)+_0x236f1d+_0x3dcf95(0xff)+_0x3c95f6[_0x3dcf95(0xde)](',\x20');return undefined;}async['execute'](_0x2d898d){const _0x20f9a2=a6_0x2224ee,{options:_0x40bdf8,args:_0x251770,tdx:_0x39bade}=_0x2d898d,_0x4194c2=_0x40bdf8,_0x419688=_0x251770[0x0],_0x501e21=(_0x4194c2[_0x20f9a2(0xe6)]||_0x20f9a2(0xe9))['toUpperCase'](),_0x2b6a09=_0x4194c2[_0x20f9a2(0x10a)],_0x858547=_0x4194c2[_0x20f9a2(0xdc)],_0x1ca2af=_0x4194c2['header'],_0x44ed43=_0x4194c2[_0x20f9a2(0xe2)]||'td';try{const _0x46aef1={};if(_0x1ca2af){const _0xf6037a=Array[_0x20f9a2(0x108)](_0x1ca2af)?_0x1ca2af:[_0x1ca2af];for(const _0x36958a of _0xf6037a){const [_0x41e166,_0x5ad3cb]=parseHeader(_0x36958a);_0x46aef1[_0x41e166]=_0x5ad3cb;}}let _0x30022a;if(_0x2b6a09)_0x30022a=_0x2b6a09;else{if(_0x858547)try{_0x30022a=RawAPI[_0x20f9a2(0xd4)](_0x858547);}catch(_0xea2c1c){return console['error'](_0x20f9a2(0xfc)+(_0xea2c1c instanceof Error?_0xea2c1c['message']:String(_0xea2c1c))),0x1;}}const _0x50f000={'method':_0x501e21,'apiType':_0x44ed43,'includeHeaders':_0x40bdf8[_0x20f9a2(0x115)]};_0x30022a&&(_0x50f000[_0x20f9a2(0xef)]=_0x30022a);Object[_0x20f9a2(0xf8)](_0x46aef1)[_0x20f9a2(0xf9)]>0x0&&(_0x50f000[_0x20f9a2(0xe5)]=_0x46aef1);if(_0x40bdf8[_0x20f9a2(0x115)]){const _0x2079aa=resolveSite(_0x40bdf8['site']),_0x26a135=getEndpoint(_0x2079aa,_0x44ed43),_0x477fd8=''+_0x26a135+_0x419688;console[_0x20f9a2(0x113)]('>\x20'+_0x501e21+'\x20'+_0x477fd8);const _0x2a31f6=getAuthHeaders(_0x2079aa),_0x7d151d={..._0x2a31f6,..._0x46aef1};for(const [_0x3ceefb,_0x19e172]of Object[_0x20f9a2(0x107)](_0x7d151d)){!isSensitiveHeader(_0x3ceefb)&&console[_0x20f9a2(0x113)]('>\x20'+_0x3ceefb+':\x20'+_0x19e172);}_0x30022a&&console['error']('>'),console['error']('');}const _0x3d035a=await _0x39bade[_0x20f9a2(0xe4)][_0x20f9a2(0xd7)](_0x419688,_0x50f000);if(_0x40bdf8[_0x20f9a2(0x115)]&&_0x3d035a['headers']){console[_0x20f9a2(0x113)](_0x20f9a2(0x111)+_0x3d035a[_0x20f9a2(0xd6)]);for(const [_0x475b49,_0x4b9985]of Object[_0x20f9a2(0x107)](_0x3d035a[_0x20f9a2(0xe5)])){!isSensitiveHeader(_0x475b49)&&console[_0x20f9a2(0x113)]('<\x20'+_0x475b49+':\x20'+_0x4b9985);}console[_0x20f9a2(0x113)]('');}const _0x56fa42=Boolean(_0x40bdf8[_0x20f9a2(0x110)]),_0x3b70ab={'color':_0x40bdf8[_0x20f9a2(0xea)],'noColor':_0x40bdf8[_0x20f9a2(0xe7)]||_0x56fa42&&!_0x40bdf8[_0x20f9a2(0xea)]},_0x49319d=colorizeJSON(_0x3d035a[_0x20f9a2(0x10a)],_0x3b70ab);return _0x40bdf8[_0x20f9a2(0x110)]?(writeFileSync(_0x40bdf8[_0x20f9a2(0x110)],_0x49319d),console['error'](_0x20f9a2(0xf6)+_0x40bdf8[_0x20f9a2(0x110)])):console['log'](_0x49319d),0x0;}catch(_0x39e318){return _0x39e318 instanceof Error?(console[_0x20f9a2(0x113)]('Error:\x20'+_0x39e318[_0x20f9a2(0x105)]),_0x40bdf8[_0x20f9a2(0x115)]&&_0x39e318[_0x20f9a2(0xd9)]&&console[_0x20f9a2(0x113)]('\x0aStack\x20trace:\x0a'+_0x39e318['stack'])):console['error']('Error:\x20'+String(_0x39e318)),0x1;}}}
1
+ const a6_0x9e514e=a6_0x2aa2;(function(_0x5400cd,_0xd02eac){const _0x107ee9=a6_0x2aa2,_0x2550ad=_0x5400cd();while(!![]){try{const _0x45ad68=-parseInt(_0x107ee9(0xcd))/0x1*(-parseInt(_0x107ee9(0xd8))/0x2)+parseInt(_0x107ee9(0xc7))/0x3+-parseInt(_0x107ee9(0xf3))/0x4*(parseInt(_0x107ee9(0xdc))/0x5)+-parseInt(_0x107ee9(0xeb))/0x6*(parseInt(_0x107ee9(0xef))/0x7)+-parseInt(_0x107ee9(0xd7))/0x8*(-parseInt(_0x107ee9(0xb4))/0x9)+parseInt(_0x107ee9(0xcc))/0xa*(parseInt(_0x107ee9(0xcb))/0xb)+-parseInt(_0x107ee9(0xb2))/0xc*(-parseInt(_0x107ee9(0xe6))/0xd);if(_0x45ad68===_0xd02eac)break;else _0x2550ad['push'](_0x2550ad['shift']());}catch(_0x1993d4){_0x2550ad['push'](_0x2550ad['shift']());}}}(a6_0xe1d8,0x885cf));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';function a6_0x2aa2(_0x32eaba,_0xb15eae){_0x32eaba=_0x32eaba-0xb2;const _0xe1d833=a6_0xe1d8();let _0x2aa22f=_0xe1d833[_0x32eaba];return _0x2aa22f;}function a6_0xe1d8(){const _0x310753=['stack','body','substring','keys','.\x20Valid\x20types:\x20','file','entries','3040984FdPEVQ','492WCjNRu','<\x20HTTP/1.1\x20','POST','api','5PNJCyp','noColor','trim','message','name','readBodyFromFile','verbose','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','toUpperCase','.\x20Valid\x20methods:\x20','13AZjznB','method','log','x-trino-user','has','42goLTYn','error','status','Invalid\x20header\x20format:\x20\x22','736001VSiOXx','GET','proxy-authorization','Endpoint\x20must\x20start\x20with\x20/:\x20','3715568lnaHZw','2631696nsuwWX','Results\x20saved\x20to\x20','9rDFpLI','header','data','indexOf','headers','set-cookie2','trino','join','output','cookie','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','toLowerCase','type','DELETE','Error:\x20','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','set-cookie','startsWith','includes','2753406WQFAUq','length','x-xsrf-token','description','11HbNFdA','3942750cyWsUA','1268aMqDhw','color','request'];a6_0xe1d8=function(){return _0x310753;};return a6_0xe1d8();}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_0x9e514e(0xf1),a6_0x9e514e(0xbd),a6_0x9e514e(0xc4),a6_0x9e514e(0xb9),a6_0x9e514e(0xc9),'x-auth-token',a6_0x9e514e(0xe9)]);function isSensitiveHeader(_0x1ab86c){const _0x268d06=a6_0x9e514e;return SENSITIVE_HEADERS[_0x268d06(0xea)](_0x1ab86c[_0x268d06(0xbf)]());}function parseHeader(_0x2484bd){const _0x7108f8=a6_0x9e514e,_0x3830f8=_0x2484bd[_0x7108f8(0xb7)](':');if(_0x3830f8===-0x1)throw new Error(_0x7108f8(0xee)+_0x2484bd+'\x22.\x20'+_0x7108f8(0xc3));const _0xe01014=_0x2484bd['substring'](0x0,_0x3830f8)['trim'](),_0x34f718=_0x2484bd[_0x7108f8(0xd2)](_0x3830f8+0x1)[_0x7108f8(0xde)]();if(!_0xe01014)throw new Error(_0x7108f8(0xbe)+_0x2484bd+'\x22');return[_0xe01014,_0x34f718];}export class ApiCommand extends BaseCommand{[a6_0x9e514e(0xe0)]=a6_0x9e514e(0xdb);[a6_0x9e514e(0xca)]=a6_0x9e514e(0xe3);['validate'](_0x4053fe){const _0x456d9e=a6_0x9e514e,{args:_0x4592c2,options:_0x34790c}=_0x4053fe,_0x21e050=_0x34790c;if(_0x4592c2['length']===0x0)return'Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list';const _0xc231ef=_0x4592c2[0x0];if(!_0xc231ef[_0x456d9e(0xc5)]('/'))return _0x456d9e(0xf2)+_0xc231ef;const _0x307e3d=_0x21e050[_0x456d9e(0xb6)],_0x31877a=_0x21e050[_0x456d9e(0xd5)];if(_0x307e3d&&_0x31877a)return'Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.';const _0x9af4ca=_0x21e050[_0x456d9e(0xe7)]||_0x456d9e(0xf0),_0x3c89c5=[_0x456d9e(0xf0),_0x456d9e(0xda),'PUT',_0x456d9e(0xc1),'PATCH'];if(!_0x3c89c5[_0x456d9e(0xc6)](_0x9af4ca[_0x456d9e(0xe4)]()))return'Invalid\x20HTTP\x20method:\x20'+_0x9af4ca+_0x456d9e(0xe5)+_0x3c89c5[_0x456d9e(0xbb)](',\x20');const _0x2faa59=_0x21e050[_0x456d9e(0xc0)]||'td',_0x6eeee4=['td','cdp','workflow',_0x456d9e(0xba),'llm','llm-proxy'];if(!_0x6eeee4['includes'](_0x2faa59))return'Invalid\x20API\x20type:\x20'+_0x2faa59+_0x456d9e(0xd4)+_0x6eeee4[_0x456d9e(0xbb)](',\x20');return undefined;}async['execute'](_0x26ca2f){const _0x280dea=a6_0x9e514e,{options:_0x4b48b8,args:_0x730888,tdx:_0x2ddf40}=_0x26ca2f,_0x2ac6f7=_0x4b48b8,_0x5a663e=_0x730888[0x0],_0x36ad33=(_0x2ac6f7[_0x280dea(0xe7)]||_0x280dea(0xf0))[_0x280dea(0xe4)](),_0x316e9c=_0x2ac6f7[_0x280dea(0xb6)],_0x59553c=_0x2ac6f7[_0x280dea(0xd5)],_0x527a17=_0x2ac6f7[_0x280dea(0xb5)],_0x60acb0=_0x2ac6f7[_0x280dea(0xc0)]||'td';try{const _0x53aeb0={};if(_0x527a17){const _0x283127=Array['isArray'](_0x527a17)?_0x527a17:[_0x527a17];for(const _0x506750 of _0x283127){const [_0x5926bb,_0x18c2e2]=parseHeader(_0x506750);_0x53aeb0[_0x5926bb]=_0x18c2e2;}}let _0xe3b4bc;if(_0x316e9c)_0xe3b4bc=_0x316e9c;else{if(_0x59553c)try{_0xe3b4bc=RawAPI[_0x280dea(0xe1)](_0x59553c);}catch(_0x301bf4){return console[_0x280dea(0xec)](_0x280dea(0xc2)+(_0x301bf4 instanceof Error?_0x301bf4[_0x280dea(0xdf)]:String(_0x301bf4))),0x1;}}const _0x376513={'method':_0x36ad33,'apiType':_0x60acb0,'includeHeaders':_0x4b48b8[_0x280dea(0xe2)]};_0xe3b4bc&&(_0x376513[_0x280dea(0xd1)]=_0xe3b4bc);Object[_0x280dea(0xd3)](_0x53aeb0)[_0x280dea(0xc8)]>0x0&&(_0x376513[_0x280dea(0xb8)]=_0x53aeb0);if(_0x4b48b8['verbose']){const _0x1f044e=resolveSite(_0x4b48b8['site']),_0x2f2d06=getEndpoint(_0x1f044e,_0x60acb0),_0x23e412=''+_0x2f2d06+_0x5a663e;console[_0x280dea(0xec)]('>\x20'+_0x36ad33+'\x20'+_0x23e412);const _0x51ebc4=getAuthHeaders(_0x1f044e),_0x360da7={..._0x51ebc4,..._0x53aeb0};for(const [_0x143141,_0x11c295]of Object[_0x280dea(0xd6)](_0x360da7)){!isSensitiveHeader(_0x143141)&&console[_0x280dea(0xec)]('>\x20'+_0x143141+':\x20'+_0x11c295);}_0xe3b4bc&&console['error']('>'),console['error']('');}const _0xb058bb=await _0x2ddf40[_0x280dea(0xdb)][_0x280dea(0xcf)](_0x5a663e,_0x376513);if(_0x4b48b8['verbose']&&_0xb058bb[_0x280dea(0xb8)]){console[_0x280dea(0xec)](_0x280dea(0xd9)+_0xb058bb[_0x280dea(0xed)]);for(const [_0xaef73b,_0xdb1b90]of Object[_0x280dea(0xd6)](_0xb058bb[_0x280dea(0xb8)])){!isSensitiveHeader(_0xaef73b)&&console[_0x280dea(0xec)]('<\x20'+_0xaef73b+':\x20'+_0xdb1b90);}console[_0x280dea(0xec)]('');}const _0x2d95e8=Boolean(_0x4b48b8[_0x280dea(0xbc)]),_0x580181={'color':_0x4b48b8[_0x280dea(0xce)],'noColor':_0x4b48b8[_0x280dea(0xdd)]||_0x2d95e8&&!_0x4b48b8[_0x280dea(0xce)]},_0x5206c2=colorizeJSON(_0xb058bb[_0x280dea(0xb6)],_0x580181);return _0x4b48b8[_0x280dea(0xbc)]?(writeFileSync(_0x4b48b8[_0x280dea(0xbc)],_0x5206c2),console['error'](_0x280dea(0xb3)+_0x4b48b8['output'])):console[_0x280dea(0xe8)](_0x5206c2),0x0;}catch(_0x16707d){return _0x16707d instanceof Error?(console[_0x280dea(0xec)](_0x280dea(0xc2)+_0x16707d[_0x280dea(0xdf)]),_0x4b48b8[_0x280dea(0xe2)]&&_0x16707d[_0x280dea(0xd0)]&&console['error']('\x0aStack\x20trace:\x0a'+_0x16707d['stack'])):console['error'](_0x280dea(0xc2)+String(_0x16707d)),0x1;}}}
@@ -1 +1 @@
1
- function a7_0x1686(_0x2d4032,_0x19869e){_0x2d4032=_0x2d4032-0x16c;const _0x2be632=a7_0x2be6();let _0x168604=_0x2be632[_0x2d4032];return _0x168604;}const a7_0x155f7b=a7_0x1686;(function(_0x141659,_0x15d449){const _0x22b964=a7_0x1686,_0x4a74ba=_0x141659();while(!![]){try{const _0x231a16=-parseInt(_0x22b964(0x175))/0x1+-parseInt(_0x22b964(0x1af))/0x2*(parseInt(_0x22b964(0x1ae))/0x3)+-parseInt(_0x22b964(0x17e))/0x4+-parseInt(_0x22b964(0x191))/0x5+parseInt(_0x22b964(0x18c))/0x6*(-parseInt(_0x22b964(0x1b4))/0x7)+parseInt(_0x22b964(0x1b8))/0x8*(-parseInt(_0x22b964(0x183))/0x9)+parseInt(_0x22b964(0x1ad))/0xa*(parseInt(_0x22b964(0x1a4))/0xb);if(_0x231a16===_0x15d449)break;else _0x4a74ba['push'](_0x4a74ba['shift']());}catch(_0x426315){_0x4a74ba['push'](_0x4a74ba['shift']());}}}(a7_0x2be6,0x4ce89));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';function a7_0x2be6(){const _0x3af797=['133190oEKXHA','trim','Validating\x20API\x20key...','\x0aSetup\x20cancelled','Name:\x20','\x20(site:\x20','status','logLevel','execute','1267836mrrgtl','✓\x20API\x20key\x20removed\x20from\x20keychain','getUserInfo','email','filter','1629iRySRu','System\x20keychain\x20is\x20not\x20available','API\x20key\x20cannot\x20be\x20empty','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','tdx:\x20auth\x20clear','\x20(profile:\x20','auth:clear','\x27\x20registered','✗\x20Validation\x20failed:\x20','12TloykX','jobs','User:\x20','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','Remove\x20API\x20key\x20from\x20system\x20keychain','956585euOyBs','Read\x20credential\x20from\x20','\x20\x20tdx','select','Enter\x20site\x20name:','auth:setup','Select\x20your\x20Treasure\x20Data\x20site:','us01','bold','tdx:\x20auth\x20setup','ERROR','customSite','red','N/A','other','yellow','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','profile','name','22ovjyNB','No\x20API\x20key\x20found\x20in\x20keychain','log','Enter\x20your\x20TD\x20API\x20key:','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','description','test','\x20--profile\x20','last_name','8547460sHdSmc','6hCWpag','96358PAnmne','auth','site','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','/app/mp/ak','549185fRpKao','join','Setting\x20up\x20authentication\x20for\x20site:\x20','You\x20can\x20find\x20your\x20API\x20key\x20at:','22088PsgxzD','\x20for\x20profile:\x20','apiKey','✓\x20Default\x20site\x20set\x20to\x20','first_name','text','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','No\x20credential\x20found','error','Site\x20name\x20cannot\x20be\x20empty','message','warn','green'];a7_0x2be6=function(){return _0x3af797;};return a7_0x2be6();}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_0x2eb36a 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_0x1cac94 from'chalk';export class AuthSetupCommand extends BaseCommand{['name']=a7_0x155f7b(0x196);[a7_0x155f7b(0x1a9)]='Setup\x20API\x20key\x20authentication\x20interactively';async[a7_0x155f7b(0x17d)](_0x29c2d7){const _0x540af2=a7_0x155f7b,{options:_0x1f9679}=_0x29c2d7,_0x140803=_0x1f9679[_0x540af2(0x1a2)];console[_0x540af2(0x1a6)](a7_0x1cac94[_0x540af2(0x199)](_0x540af2(0x19a)));const _0x5c7d5f=_0x1f9679[_0x540af2(0x1b1)]||'us01',{choices:_0x59b70c,initialIndex:_0x417069}=buildSiteChoices(_0x5c7d5f),_0x329203=_0x140803?'Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20'+_0x140803+'):':_0x540af2(0x197),_0x14e64c=await a7_0x2eb36a({'type':_0x540af2(0x194),'name':_0x540af2(0x1b1),'message':_0x329203,'choices':_0x59b70c,'initial':_0x417069});if(!_0x14e64c[_0x540af2(0x1b1)])return console[_0x540af2(0x1a6)](_0x540af2(0x178)),0x1;let _0x969f4d;if(_0x14e64c[_0x540af2(0x1b1)]===_0x540af2(0x19f)){const _0x162772=await a7_0x2eb36a({'type':_0x540af2(0x16d),'name':_0x540af2(0x19c),'message':_0x540af2(0x195),'initial':_0x540af2(0x198),'validate':_0x2d7c12=>{const _0x50ac03=_0x540af2;if(!_0x2d7c12||!_0x2d7c12['trim']())return _0x50ac03(0x171);if(!/^[a-z0-9-]+$/[_0x50ac03(0x1aa)](_0x2d7c12[_0x50ac03(0x176)]()))return _0x50ac03(0x1a1);return!![];}});if(!_0x162772['customSite'])return console[_0x540af2(0x1a6)](_0x540af2(0x178)),0x1;_0x969f4d=_0x162772[_0x540af2(0x19c)];}else _0x969f4d=_0x14e64c[_0x540af2(0x1b1)];const _0x432bd7=resolveSite(_0x969f4d);console[_0x540af2(0x1a6)](_0x540af2(0x1b6)+_0x432bd7),console[_0x540af2(0x1a6)](_0x540af2(0x1b7)),console[_0x540af2(0x1a6)]('\x20\x20'+getConsoleUrl(_0x432bd7,_0x540af2(0x1b3)));const _0x5e37c8=await a7_0x2eb36a({'type':'password','name':_0x540af2(0x1ba),'message':_0x540af2(0x1a7),'validate':_0x2e0353=>{const _0x254814=_0x540af2;if(!_0x2e0353||!_0x2e0353[_0x254814(0x176)]())return _0x254814(0x185);return!![];}});if(!_0x5e37c8['apiKey'])return console[_0x540af2(0x1a6)](_0x540af2(0x178)),0x1;const _0x33bd88=_0x5e37c8[_0x540af2(0x1ba)];console[_0x540af2(0x1a6)](_0x540af2(0x177));try{const _0x383952=TDX['create']({'site':_0x432bd7,'apiKey':_0x33bd88[_0x540af2(0x176)](),'logLevel':_0x1f9679[_0x540af2(0x17c)]??LogLevel[_0x540af2(0x19b)]}),_0x19fbc0=await _0x383952['jobs'][_0x540af2(0x180)]();console['log'](_0x540af2(0x1a8)+_0x19fbc0[_0x540af2(0x181)]+')');const _0x142cdb=await isKeychainAvailable();_0x142cdb?(await saveAPIKeyAsync(_0x33bd88[_0x540af2(0x176)](),_0x432bd7,_0x140803),console[_0x540af2(0x1a6)]('✓\x20API\x20key\x20saved\x20to\x20system\x20keychain'+(_0x140803?'\x20(profile:\x20'+_0x140803+')':''))):(console[_0x540af2(0x173)](a7_0x1cac94[_0x540af2(0x1a0)]('⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.')),console['warn'](a7_0x1cac94['yellow'](_0x540af2(0x18f))));if(_0x140803){const _0x4dd5a3={'site':_0x432bd7};saveProfileToUserConfig(_0x140803,_0x4dd5a3),console['log']('✓\x20Profile\x20\x27'+_0x140803+_0x540af2(0x18a));}else saveDefaultSiteToUserConfig(_0x432bd7),console[_0x540af2(0x1a6)](_0x540af2(0x1bb)+_0x432bd7);const _0x562ac0=_0x140803?_0x540af2(0x1ab)+_0x140803:'';return console[_0x540af2(0x1a6)](),console[_0x540af2(0x1a6)](_0x540af2(0x186)),console[_0x540af2(0x1a6)](_0x540af2(0x193)+_0x562ac0+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console['log'](_0x540af2(0x193)+_0x562ac0+_0x540af2(0x1b2)),0x0;}catch(_0xdd17ed){if(_0xdd17ed instanceof HTTPClientError&&_0xdd17ed[_0x540af2(0x17b)]===0x191)return printAuthError(_0xdd17ed),0x1;return console[_0x540af2(0x170)](a7_0x1cac94[_0x540af2(0x19d)](_0x540af2(0x18b)+(_0xdd17ed instanceof Error?_0xdd17ed['message']:String(_0xdd17ed)))),console[_0x540af2(0x170)]('API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.'),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x155f7b(0x1a3)]=a7_0x155f7b(0x1b0);[a7_0x155f7b(0x1a9)]=a7_0x155f7b(0x16e);async[a7_0x155f7b(0x17d)](_0x222c9d){const _0x572fc7=a7_0x155f7b,{options:_0x2f6119,tdx:_0x43da7d}=_0x222c9d,_0x18b2d5=_0x2f6119[_0x572fc7(0x1b1)],_0x27444d=_0x2f6119[_0x572fc7(0x1a2)],_0x3f443e=_0x27444d?_0x27444d:_0x572fc7(0x19e);console[_0x572fc7(0x1a6)]('tdx\x20profile:\x20'+_0x3f443e+_0x572fc7(0x17a)+_0x18b2d5+')');const _0xc0e7a0=await resolveAPIKeyAsync(_0x18b2d5,_0x27444d);if(_0xc0e7a0){const {source:_0xbcabec,isDeprecated:_0xdcbcc2}=_0xc0e7a0,_0x417b0d=_0x572fc7(0x192)+_0xbcabec;console[_0x572fc7(0x1a6)](_0xdcbcc2?a7_0x1cac94[_0x572fc7(0x1a0)](_0x417b0d):_0x417b0d);}else console[_0x572fc7(0x1a6)](a7_0x1cac94[_0x572fc7(0x1a0)](_0x572fc7(0x16f)));try{const _0x49bfdb=await _0x43da7d[_0x572fc7(0x18d)][_0x572fc7(0x180)]();return console['log'](a7_0x1cac94[_0x572fc7(0x174)]('✓\x20Authentication\x20successful\x0a')),console['log'](_0x572fc7(0x18e)+_0x49bfdb[_0x572fc7(0x181)]),(_0x49bfdb[_0x572fc7(0x16c)]||_0x49bfdb[_0x572fc7(0x1ac)])&&console['log'](_0x572fc7(0x179)+[_0x49bfdb[_0x572fc7(0x16c)],_0x49bfdb[_0x572fc7(0x1ac)]][_0x572fc7(0x182)](Boolean)[_0x572fc7(0x1b5)]('\x20')),0x0;}catch(_0x41df66){return _0x41df66 instanceof HTTPClientError&&_0x41df66[_0x572fc7(0x17b)]===0x191?printAuthError(_0x41df66,!![],_0x27444d):console[_0x572fc7(0x170)](a7_0x1cac94[_0x572fc7(0x19d)](_0x572fc7(0x18b)+(_0x41df66 instanceof Error?_0x41df66[_0x572fc7(0x172)]:String(_0x41df66)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x155f7b(0x1a3)]=a7_0x155f7b(0x189);['description']=a7_0x155f7b(0x190);async[a7_0x155f7b(0x17d)](_0x4778a8){const _0x40d5f1=a7_0x155f7b,{options:_0x59babe}=_0x4778a8,_0x199902=_0x59babe[_0x40d5f1(0x1a2)];console['log'](a7_0x1cac94[_0x40d5f1(0x199)](_0x40d5f1(0x187)));const _0x1e2082=await isKeychainAvailable();if(!_0x1e2082)return console[_0x40d5f1(0x170)](a7_0x1cac94['red'](_0x40d5f1(0x184))),0x1;const _0x1f56c1=await deleteKeychainAPIKey(_0x199902);return _0x1f56c1?(clearCredentialCache(),console[_0x40d5f1(0x1a6)](_0x40d5f1(0x17f)+(_0x199902?_0x40d5f1(0x188)+_0x199902+')':'')),0x0):(console[_0x40d5f1(0x1a6)](_0x40d5f1(0x1a5)+(_0x199902?_0x40d5f1(0x1b9)+_0x199902:'')),0x1);}}
1
+ const a7_0x51ba99=a7_0x27b4;(function(_0x3153b5,_0x7db1f8){const _0x25f414=a7_0x27b4,_0x3e3381=_0x3153b5();while(!![]){try{const _0x4a7bd7=parseInt(_0x25f414(0x149))/0x1*(-parseInt(_0x25f414(0x144))/0x2)+-parseInt(_0x25f414(0x159))/0x3*(-parseInt(_0x25f414(0x125))/0x4)+parseInt(_0x25f414(0x140))/0x5+-parseInt(_0x25f414(0x134))/0x6*(-parseInt(_0x25f414(0x168))/0x7)+parseInt(_0x25f414(0x13e))/0x8+parseInt(_0x25f414(0x124))/0x9*(-parseInt(_0x25f414(0x121))/0xa)+-parseInt(_0x25f414(0x123))/0xb;if(_0x4a7bd7===_0x7db1f8)break;else _0x3e3381['push'](_0x3e3381['shift']());}catch(_0x524ffe){_0x3e3381['push'](_0x3e3381['shift']());}}}(a7_0x334b,0x5a357));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';function a7_0x334b(){const _0x438620=['You\x20can\x20find\x20your\x20API\x20key\x20at:','message','email','auth:setup','password','tdx:\x20auth\x20clear','error','6nLYeXj','apiKey','last_name','Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20','green','✓\x20Default\x20site\x20set\x20to\x20','ERROR','API\x20key\x20cannot\x20be\x20empty','auth','description','5320448WrFjxa','/app/mp/ak','3149515czbyzC','getUserInfo','Enter\x20your\x20TD\x20API\x20key:','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','105414luDZmA','status','trim','log','Enter\x20site\x20name:','1aGIFBc','Select\x20your\x20Treasure\x20Data\x20site:','execute','System\x20keychain\x20is\x20not\x20available','profile','yellow','No\x20API\x20key\x20found\x20in\x20keychain','Validating\x20API\x20key...','red','create','bold','warn','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','N/A','select','first_name','870tjLrTO','\x27\x20registered','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','Name:\x20','\x20\x20tdx','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','filter','\x20for\x20profile:\x20','No\x20credential\x20found','Read\x20credential\x20from\x20','Setup\x20API\x20key\x20authentication\x20interactively','✗\x20Validation\x20failed:\x20','Site\x20name\x20cannot\x20be\x20empty','other','test','853811sTOuME','✓\x20Authentication\x20successful\x0a','1853010twxJUZ','customSite','12256409WpNiHh','9ODjmOZ','4204xiGfha','text','join','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','\x20--profile\x20','site','\x20(profile:\x20','\x0aSetup\x20cancelled'];a7_0x334b=function(){return _0x438620;};return a7_0x334b();}function a7_0x27b4(_0x22845f,_0x291b73){_0x22845f=_0x22845f-0x121;const _0x334b18=a7_0x334b();let _0x27b4a5=_0x334b18[_0x22845f];return _0x27b4a5;}import{clearCredentialCache}from'../core/credential-cache.js';import{buildSiteChoices}from'../core/constants.js';import a7_0x3488e0 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_0x4be521 from'chalk';export class AuthSetupCommand extends BaseCommand{['name']=a7_0x51ba99(0x130);[a7_0x51ba99(0x13d)]=a7_0x51ba99(0x163);async[a7_0x51ba99(0x14b)](_0x4b8a71){const _0x1fd9ac=a7_0x51ba99,{options:_0x100993}=_0x4b8a71,_0x58f583=_0x100993[_0x1fd9ac(0x14d)];console[_0x1fd9ac(0x147)](a7_0x4be521['bold']('tdx:\x20auth\x20setup'));const _0x571941=_0x100993[_0x1fd9ac(0x12a)]||'us01',{choices:_0x56b842,initialIndex:_0x24bc32}=buildSiteChoices(_0x571941),_0xfbfdf8=_0x58f583?_0x1fd9ac(0x137)+_0x58f583+'):':_0x1fd9ac(0x14a),_0x23d0bf=await a7_0x3488e0({'type':_0x1fd9ac(0x157),'name':_0x1fd9ac(0x12a),'message':_0xfbfdf8,'choices':_0x56b842,'initial':_0x24bc32});if(!_0x23d0bf[_0x1fd9ac(0x12a)])return console[_0x1fd9ac(0x147)](_0x1fd9ac(0x12c)),0x1;let _0x1b4012;if(_0x23d0bf[_0x1fd9ac(0x12a)]===_0x1fd9ac(0x166)){const _0x2b58c2=await a7_0x3488e0({'type':_0x1fd9ac(0x126),'name':_0x1fd9ac(0x122),'message':_0x1fd9ac(0x148),'initial':'us01','validate':_0x2d16f8=>{const _0x63d0aa=_0x1fd9ac;if(!_0x2d16f8||!_0x2d16f8[_0x63d0aa(0x146)]())return _0x63d0aa(0x165);if(!/^[a-z0-9-]+$/[_0x63d0aa(0x167)](_0x2d16f8[_0x63d0aa(0x146)]()))return'Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens';return!![];}});if(!_0x2b58c2[_0x1fd9ac(0x122)])return console[_0x1fd9ac(0x147)](_0x1fd9ac(0x12c)),0x1;_0x1b4012=_0x2b58c2[_0x1fd9ac(0x122)];}else _0x1b4012=_0x23d0bf[_0x1fd9ac(0x12a)];const _0x130188=resolveSite(_0x1b4012);console[_0x1fd9ac(0x147)]('Setting\x20up\x20authentication\x20for\x20site:\x20'+_0x130188),console[_0x1fd9ac(0x147)](_0x1fd9ac(0x12d)),console['log']('\x20\x20'+getConsoleUrl(_0x130188,_0x1fd9ac(0x13f)));const _0xf524d8=await a7_0x3488e0({'type':_0x1fd9ac(0x131),'name':'apiKey','message':_0x1fd9ac(0x142),'validate':_0x553549=>{const _0x230c72=_0x1fd9ac;if(!_0x553549||!_0x553549[_0x230c72(0x146)]())return _0x230c72(0x13b);return!![];}});if(!_0xf524d8['apiKey'])return console['log'](_0x1fd9ac(0x12c)),0x1;const _0x3da2ac=_0xf524d8[_0x1fd9ac(0x135)];console[_0x1fd9ac(0x147)](_0x1fd9ac(0x150));try{const _0x4342de=TDX[_0x1fd9ac(0x152)]({'site':_0x130188,'apiKey':_0x3da2ac['trim'](),'logLevel':_0x100993['logLevel']??LogLevel[_0x1fd9ac(0x13a)]}),_0x2a72b4=await _0x4342de['jobs'][_0x1fd9ac(0x141)]();console[_0x1fd9ac(0x147)](_0x1fd9ac(0x128)+_0x2a72b4[_0x1fd9ac(0x12f)]+')');const _0x23d0e4=await isKeychainAvailable();_0x23d0e4?(await saveAPIKeyAsync(_0x3da2ac[_0x1fd9ac(0x146)](),_0x130188,_0x58f583),console[_0x1fd9ac(0x147)](_0x1fd9ac(0x15b)+(_0x58f583?_0x1fd9ac(0x12b)+_0x58f583+')':''))):(console[_0x1fd9ac(0x154)](a7_0x4be521[_0x1fd9ac(0x14e)]('⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.')),console[_0x1fd9ac(0x154)](a7_0x4be521[_0x1fd9ac(0x14e)]('\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.')));if(_0x58f583){const _0x36527c={'site':_0x130188};saveProfileToUserConfig(_0x58f583,_0x36527c),console[_0x1fd9ac(0x147)]('✓\x20Profile\x20\x27'+_0x58f583+_0x1fd9ac(0x15a));}else saveDefaultSiteToUserConfig(_0x130188),console[_0x1fd9ac(0x147)](_0x1fd9ac(0x139)+_0x130188);const _0x42edf0=_0x58f583?_0x1fd9ac(0x129)+_0x58f583:'';return console[_0x1fd9ac(0x147)](),console[_0x1fd9ac(0x147)](_0x1fd9ac(0x143)),console[_0x1fd9ac(0x147)](_0x1fd9ac(0x15d)+_0x42edf0+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console[_0x1fd9ac(0x147)](_0x1fd9ac(0x15d)+_0x42edf0+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases'),0x0;}catch(_0x2a98f8){if(_0x2a98f8 instanceof HTTPClientError&&_0x2a98f8['status']===0x191)return printAuthError(_0x2a98f8),0x1;return console[_0x1fd9ac(0x133)](a7_0x4be521['red'](_0x1fd9ac(0x164)+(_0x2a98f8 instanceof Error?_0x2a98f8['message']:String(_0x2a98f8)))),console[_0x1fd9ac(0x133)](_0x1fd9ac(0x155)),0x1;}}}export class AuthStatusCommand extends BaseCommand{['name']=a7_0x51ba99(0x13c);['description']=a7_0x51ba99(0x15e);async['execute'](_0x4b3fea){const _0x39ae76=a7_0x51ba99,{options:_0x4e949a,tdx:_0x53a59f}=_0x4b3fea,_0x36fc34=_0x4e949a[_0x39ae76(0x12a)],_0x436c81=_0x4e949a[_0x39ae76(0x14d)],_0x54a18b=_0x436c81?_0x436c81:_0x39ae76(0x156);console[_0x39ae76(0x147)]('tdx\x20profile:\x20'+_0x54a18b+'\x20(site:\x20'+_0x36fc34+')');const _0x2951c0=await resolveAPIKeyAsync(_0x36fc34,_0x436c81);if(_0x2951c0){const {source:_0x484c5c,isDeprecated:_0x46c60f}=_0x2951c0,_0x351e90=_0x39ae76(0x162)+_0x484c5c;console[_0x39ae76(0x147)](_0x46c60f?a7_0x4be521[_0x39ae76(0x14e)](_0x351e90):_0x351e90);}else console[_0x39ae76(0x147)](a7_0x4be521[_0x39ae76(0x14e)](_0x39ae76(0x161)));try{const _0x30ab99=await _0x53a59f['jobs'][_0x39ae76(0x141)]();return console['log'](a7_0x4be521[_0x39ae76(0x138)](_0x39ae76(0x169))),console['log']('User:\x20'+_0x30ab99[_0x39ae76(0x12f)]),(_0x30ab99[_0x39ae76(0x158)]||_0x30ab99[_0x39ae76(0x136)])&&console[_0x39ae76(0x147)](_0x39ae76(0x15c)+[_0x30ab99[_0x39ae76(0x158)],_0x30ab99[_0x39ae76(0x136)]][_0x39ae76(0x15f)](Boolean)[_0x39ae76(0x127)]('\x20')),0x0;}catch(_0x2ee123){return _0x2ee123 instanceof HTTPClientError&&_0x2ee123[_0x39ae76(0x145)]===0x191?printAuthError(_0x2ee123,!![],_0x436c81):console[_0x39ae76(0x133)](a7_0x4be521['red'](_0x39ae76(0x164)+(_0x2ee123 instanceof Error?_0x2ee123[_0x39ae76(0x12e)]:String(_0x2ee123)))),0x1;}}}export class AuthClearCommand extends BaseCommand{['name']='auth:clear';[a7_0x51ba99(0x13d)]='Remove\x20API\x20key\x20from\x20system\x20keychain';async[a7_0x51ba99(0x14b)](_0x19fe43){const _0x34eb93=a7_0x51ba99,{options:_0x1ff3a2}=_0x19fe43,_0x4cbe98=_0x1ff3a2[_0x34eb93(0x14d)];console[_0x34eb93(0x147)](a7_0x4be521[_0x34eb93(0x153)](_0x34eb93(0x132)));const _0x507c4d=await isKeychainAvailable();if(!_0x507c4d)return console[_0x34eb93(0x133)](a7_0x4be521[_0x34eb93(0x151)](_0x34eb93(0x14c))),0x1;const _0x1b34df=await deleteKeychainAPIKey(_0x4cbe98);return _0x1b34df?(clearCredentialCache(),console[_0x34eb93(0x147)]('✓\x20API\x20key\x20removed\x20from\x20keychain'+(_0x4cbe98?_0x34eb93(0x12b)+_0x4cbe98+')':'')),0x0):(console['log'](_0x34eb93(0x14f)+(_0x4cbe98?_0x34eb93(0x160)+_0x4cbe98:'')),0x1);}}
@@ -1 +1 @@
1
- const a8_0x420c75=a8_0x235c;(function(_0x9038b0,_0x4db313){const _0x42b95e=a8_0x235c,_0x155986=_0x9038b0();while(!![]){try{const _0x536202=-parseInt(_0x42b95e(0xd4))/0x1*(-parseInt(_0x42b95e(0xa0))/0x2)+parseInt(_0x42b95e(0xc8))/0x3+parseInt(_0x42b95e(0x9b))/0x4*(parseInt(_0x42b95e(0xb7))/0x5)+-parseInt(_0x42b95e(0xb8))/0x6*(parseInt(_0x42b95e(0xbb))/0x7)+parseInt(_0x42b95e(0xda))/0x8*(-parseInt(_0x42b95e(0xd5))/0x9)+parseInt(_0x42b95e(0xb3))/0xa+-parseInt(_0x42b95e(0xb2))/0xb;if(_0x536202===_0x4db313)break;else _0x155986['push'](_0x155986['shift']());}catch(_0x383a4c){_0x155986['push'](_0x155986['shift']());}}}(a8_0x5875,0x7c6da));import{BaseCommand}from'./command.js';function a8_0x5875(){const _0x177051=['llm','Continuing\x20chat:\x20','includes','metadata','1106KyMqns','startChat','Getting\x20default\x20agent...','chatId','done','args','content','verbose','event','validate','targetFunction','--agent\x20flag','stream','stringify','Error:\x20Chat\x20session\x20\x27','llmAgent','Create\x20a\x20new\x20chat\x20session','streamChat','684618BHFxkj','2519090hpWMRX','claude-4.5-haiku','\x0aStack\x20trace:','tool_call','23105jsaVTf','6hWUtLz','agentId','streamChatJsonl','2344237ybuiLn','string','404','Chat\x20session:\x20','write','cause','error','Resolving\x20agent\x20\x27','No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22','new','execute','stdout','stack','1515870aHSvCF','join','name','projectId','agent','functionName','\x27...','\x0aError:\x20','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','description','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','tool','1289qVMXKq','13059uvNCYw','message','log','getDefaultAgent','chat','4048wZMsrY','code','llmProject','type','options','\x20\x20Cause:\x20','resolveAgentId','slice','getOrCreateDefaultAgent','resolveProjectId','targetKnowledgeBase','handleChatEvent','Resolving\x20project\x20\x27','data','Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together','148LWGzca'];a8_0x5875=function(){return _0x177051;};return a8_0x5875();}import{SDKError,ErrorCode}from'../sdk/errors.js';function a8_0x235c(_0x35d3b6,_0x5b5bbd){_0x35d3b6=_0x35d3b6-0x94;const _0x5875e5=a8_0x5875();let _0x235c25=_0x5875e5[_0x35d3b6];return _0x235c25;}import{withSpinner}from'../utils/spinner.js';import{parseAgentRef}from'../sdk/agent/agent-ref-parser.js';import{saveLastChatId,loadLastChatId}from'../sdk/llm/chat-cache.js';import{getLLMConversationUrl}from'../sdk/client/endpoints.js';function handleSDKError(_0x3ec962,_0x4d9693){const _0xae42c8=a8_0x235c;if(_0x3ec962 instanceof SDKError)console['error']('Error:\x20'+_0x3ec962[_0xae42c8(0xd6)]),_0x4d9693['verbose']&&(_0x3ec962[_0xae42c8(0xc0)]&&console[_0xae42c8(0xc1)](_0xae42c8(0xdf)+_0x3ec962[_0xae42c8(0xc0)]),_0x3ec962['stack']&&(console[_0xae42c8(0xc1)](_0xae42c8(0xb5)),console[_0xae42c8(0xc1)](_0x3ec962[_0xae42c8(0xc7)])));else throw _0x3ec962;}async function resolveAgentId(_0x41495d,_0x50d4be,_0x3574c6,_0x7832e,_0x196363){const _0xd4aeb3=a8_0x235c,_0x2b5a40=_0x50d4be||_0x3574c6;if(_0x2b5a40){const {projectName:_0x503959,agentName:_0x22ab7b}=parseAgentRef(_0x2b5a40),_0xfbe1af=_0x22ab7b||_0x2b5a40,_0x52aecc=_0x22ab7b?_0x503959:_0x7832e;if(!_0x52aecc)throw new Error(_0xd4aeb3(0xc3));if(_0x196363){const _0x1c200f=_0x50d4be?_0xd4aeb3(0xab):'session\x20context';console['error']('Using\x20agent\x20from\x20'+_0x1c200f+':\x20'+_0x52aecc+'/'+_0xfbe1af);}const _0x2d5216=await withSpinner(_0xd4aeb3(0x98)+_0x52aecc+'\x27...',()=>_0x41495d[_0xd4aeb3(0x9c)][_0xd4aeb3(0x95)](_0x52aecc),{'verbose':_0x196363}),_0xb33886=await withSpinner(_0xd4aeb3(0xc2)+_0xfbe1af+_0xd4aeb3(0xce),()=>_0x41495d[_0xd4aeb3(0x9c)][_0xd4aeb3(0xe0)](_0xfbe1af,_0x2d5216[_0xd4aeb3(0x99)]),{'verbose':_0x196363});return _0xb33886[_0xd4aeb3(0x99)];}else{const _0x13fc9f=_0x41495d['llm'][_0xd4aeb3(0xd8)]();if(_0x13fc9f)return _0x196363&&console[_0xd4aeb3(0xc1)]('Using\x20cached\x20default\x20agent:\x20'+_0x13fc9f['name']),_0x13fc9f['id'];const _0xbf25d5=await withSpinner(_0xd4aeb3(0xa2),()=>_0x41495d['llm'][_0xd4aeb3(0x94)](_0xd4aeb3(0xb4),0x0),{'verbose':_0x196363});return _0xbf25d5[_0xd4aeb3(0x99)]['id'];}}export class ChatCommand extends BaseCommand{[a8_0x420c75(0xca)]=a8_0x420c75(0xd9);['description']=a8_0x420c75(0xd2);[a8_0x420c75(0xa9)](_0xad7804){const _0x23e106=a8_0x420c75,_0x4a6cd2=_0xad7804[_0x23e106(0xa5)]['join']('\x20');if(!_0x4a6cd2)return'Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options';return undefined;}async['streamChat'](_0x2c86e0,_0x41b135,_0x1c2878,_0x3dd039,_0x1ea158){const _0x5e9930=a8_0x420c75;for await(const _0x2f75ff of _0x2c86e0[_0x5e9930(0x9c)][_0x5e9930(0xd9)](_0x41b135,{'agentId':_0x1c2878,'chatId':_0x3dd039})){if(_0x2f75ff[_0x5e9930(0xdd)]==='metadata'){const _0x255561=_0x2f75ff[_0x5e9930(0x99)][_0x5e9930(0xa3)];saveLastChatId(_0x255561),_0x1ea158&&console[_0x5e9930(0xc1)](_0x5e9930(0xbe)+_0x255561);}else _0x2f75ff[_0x5e9930(0xdd)]===_0x5e9930(0xa8)&&this[_0x5e9930(0x97)](_0x2f75ff['data']);}}async[a8_0x420c75(0xba)](_0x7be2ea,_0x38f6bf,_0x4e420c,_0x1b66ec){const _0x99f296=a8_0x420c75,_0x192e12=_0x7be2ea['context']['site'];let _0x2fd633=![];for await(const _0x15002e of _0x7be2ea['llm']['chat'](_0x38f6bf,{'agentId':_0x4e420c,'chatId':_0x1b66ec})){if(_0x15002e[_0x99f296(0xdd)]===_0x99f296(0x9f)){const _0x4113be=_0x15002e[_0x99f296(0x99)];saveLastChatId(_0x4113be[_0x99f296(0xa3)]);const _0x1e4cc5=_0x4113be['projectId']&&_0x4113be[_0x99f296(0xb9)]?getLLMConversationUrl(_0x192e12,_0x4113be[_0x99f296(0xcb)],_0x4113be[_0x99f296(0xb9)],_0x4113be['chatId']):undefined;console[_0x99f296(0xd7)](JSON[_0x99f296(0xad)]({'type':_0x99f296(0x9f),'data':{'chatId':_0x4113be[_0x99f296(0xa3)],'agentId':_0x4113be[_0x99f296(0xb9)],'consoleUrl':_0x1e4cc5}})),_0x2fd633=!![];}else{if(_0x15002e[_0x99f296(0xdd)]===_0x99f296(0xa8)){!_0x2fd633&&_0x1b66ec&&(console[_0x99f296(0xd7)](JSON[_0x99f296(0xad)]({'type':_0x99f296(0x9f),'data':{'chatId':_0x1b66ec}})),_0x2fd633=!![]);const _0x2a0007=_0x15002e[_0x99f296(0x99)];if('content'in _0x2a0007)console[_0x99f296(0xd7)](JSON[_0x99f296(0xad)]({'type':_0x99f296(0xa6),'data':{'content':_0x2a0007['content']}}));else{if('tool_call'in _0x2a0007){const _0x48c4d0=_0x2a0007['tool_call'];console[_0x99f296(0xd7)](JSON['stringify']({'type':_0x99f296(0xb6),'data':{'id':_0x48c4d0['id'],'name':_0x48c4d0[_0x99f296(0xcd)],'target':_0x48c4d0[_0x99f296(0x96)]?.[_0x99f296(0xca)]||_0x48c4d0['targetAgent']?.[_0x99f296(0xca)]||_0x48c4d0['targetWebSearchTool']?.[_0x99f296(0xca)]||_0x48c4d0[_0x99f296(0xaa)]}}));}else{if(_0x99f296(0xd3)in _0x2a0007)console[_0x99f296(0xd7)](JSON['stringify']({'type':'tool_result','data':{'id':_0x2a0007[_0x99f296(0xd3)]['id'],'name':_0x2a0007[_0x99f296(0xd3)][_0x99f296(0xcd)],'result':typeof _0x2a0007[_0x99f296(0xd3)]['content']===_0x99f296(0xbc)?_0x2a0007['tool'][_0x99f296(0xa6)][_0x99f296(0xe1)](0x0,0x1f4):''}}));else _0x99f296(0xc1)in _0x2a0007&&console[_0x99f296(0xd7)](JSON['stringify']({'type':_0x99f296(0xc1),'data':{'error':_0x2a0007['error']}}));}}}}}console[_0x99f296(0xd7)](JSON[_0x99f296(0xad)]({'type':_0x99f296(0xa4)}));}async[a8_0x420c75(0xc5)](_0x266f68){const _0x218b50=a8_0x420c75,{options:_0x2fa45f,args:_0xeddd09,tdx:_0x3d11f7}=_0x266f68,_0x14c07b=_0xeddd09[_0x218b50(0xc9)]('\x20'),_0x23e944=_0x2fa45f,_0x355062=_0x23e944[_0x218b50(0xcc)],_0x150ec3=_0x23e944[_0x218b50(0xaf)],_0x4bc8a0=_0x23e944[_0x218b50(0xdc)],_0x4ced48=_0x23e944[_0x218b50(0xc4)],_0x4db03b=_0x23e944['chatId'],_0x304d6a=_0x23e944[_0x218b50(0xac)];if(_0x4ced48&&_0x4db03b)return console[_0x218b50(0xc1)](_0x218b50(0x9a)),0x1;try{let _0x4a9c80,_0x154131;if(_0x4db03b)_0x154131=_0x4db03b;else!_0x4ced48&&(_0x154131=loadLastChatId(),_0x154131&&_0x2fa45f['verbose']&&console[_0x218b50(0xc1)](_0x218b50(0x9d)+_0x154131));!_0x4db03b&&(_0x4ced48||!_0x154131)&&(_0x4a9c80=await resolveAgentId(_0x3d11f7,_0x355062,_0x150ec3,_0x4bc8a0,_0x2fa45f[_0x218b50(0xa7)]));const _0x1ead52=_0x304d6a?(_0x27fc3f,_0x19c160,_0x563d48)=>this[_0x218b50(0xba)](_0x3d11f7,_0x27fc3f,_0x19c160,_0x563d48):(_0x46f6f8,_0x3cd5be,_0x5e144e)=>this[_0x218b50(0xb1)](_0x3d11f7,_0x46f6f8,_0x3cd5be,_0x5e144e,_0x2fa45f[_0x218b50(0xa7)]);try{await _0x1ead52(_0x14c07b,_0x4a9c80,_0x154131);}catch(_0x54e7ce){const _0x4fadab=_0x54e7ce instanceof SDKError&&_0x54e7ce[_0x218b50(0xdb)]===ErrorCode['CHAT_NOT_FOUND']||_0x54e7ce instanceof Error&&_0x54e7ce[_0x218b50(0xd6)][_0x218b50(0x9e)](_0x218b50(0xbd));if(_0x4fadab&&_0x4db03b)return console['error'](_0x218b50(0xae)+_0x4db03b+'\x27\x20not\x20found'),0x1;if(_0x4fadab)_0x2fa45f[_0x218b50(0xa7)]&&console[_0x218b50(0xc1)](_0x218b50(0xd0)),!_0x4a9c80&&(_0x4a9c80=await resolveAgentId(_0x3d11f7,_0x355062,_0x150ec3,_0x4bc8a0,_0x2fa45f[_0x218b50(0xa7)])),await _0x1ead52(_0x14c07b,_0x4a9c80,undefined);else throw _0x54e7ce;}return!_0x304d6a&&console[_0x218b50(0xd7)](),0x0;}catch(_0x21449c){return console[_0x218b50(0xc1)](),handleSDKError(_0x21449c,_0x2fa45f),0x1;}}[a8_0x420c75(0x97)](_0x476396){const _0x5e8ba3=a8_0x420c75;if(_0x5e8ba3(0xa6)in _0x476396)process[_0x5e8ba3(0xc6)][_0x5e8ba3(0xbf)](_0x476396['content']);else'error'in _0x476396&&console[_0x5e8ba3(0xc1)](_0x5e8ba3(0xcf)+_0x476396[_0x5e8ba3(0xc1)]);}}export class ChatCreateCommand extends BaseCommand{[a8_0x420c75(0xca)]='chat-create';[a8_0x420c75(0xd1)]=a8_0x420c75(0xb0);[a8_0x420c75(0xa9)](_0x9b4f92){const _0x3b4cd4=a8_0x420c75,_0x776aa8=_0x9b4f92[_0x3b4cd4(0xde)],_0x116726=_0x776aa8[_0x3b4cd4(0xcc)],_0x874f1c=_0x776aa8[_0x3b4cd4(0xaf)];if(!_0x116726&&!_0x874f1c)return'Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22';return undefined;}async[a8_0x420c75(0xc5)](_0x53e865){const _0x196a9b=a8_0x420c75,{options:_0x5b2636,tdx:_0x6c20d3}=_0x53e865,_0x3b795d=_0x5b2636,_0x3fbc66=_0x3b795d[_0x196a9b(0xcc)],_0x338d90=_0x3b795d[_0x196a9b(0xaf)],_0xfe62e4=_0x3b795d[_0x196a9b(0xdc)];try{const _0x1e68bb=await resolveAgentId(_0x6c20d3,_0x3fbc66,_0x338d90,_0xfe62e4,_0x5b2636[_0x196a9b(0xa7)]),_0x2a0387=await _0x6c20d3[_0x196a9b(0x9c)][_0x196a9b(0xa1)](_0x1e68bb);return saveLastChatId(_0x2a0387['id']),console[_0x196a9b(0xd7)](JSON[_0x196a9b(0xad)]({'chatId':_0x2a0387['id'],'agentId':_0x1e68bb})),0x0;}catch(_0x5ecaed){return handleSDKError(_0x5ecaed,_0x5b2636),0x1;}}}
1
+ function a8_0x468b(){const _0x1f866f=['3032802qyZmQB','name','Getting\x20default\x20agent...','event','171ZYDuFN','targetKnowledgeBase','done','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','session\x20context','type','6XNnico','new','streamChat','string','execute','Resolving\x20project\x20\x27','llmProject','resolveAgentId','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','message','description','resolveProjectId','metadata','targetAgent','content','8222074vArJbQ','--agent\x20flag','cause','chat-create','Using\x20cached\x20default\x20agent:\x20','Continuing\x20chat:\x20','streamChatJsonl','688628oLOouc','\x27\x20not\x20found','targetWebSearchTool','Error:\x20','slice','887770ovAtKP','2851732JyyyMo','log','tool','handleChatEvent','verbose','\x0aStack\x20trace:','getOrCreateDefaultAgent','chatId','Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22','Error:\x20Chat\x20session\x20\x27','claude-4.5-haiku','context','getDefaultAgent','chat','tool_call','stream','927208Scjjpz','\x27...','Chat\x20session:\x20','Create\x20a\x20new\x20chat\x20session','CHAT_NOT_FOUND','llmAgent','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','validate','code','Resolving\x20agent\x20\x27','functionName','args','agent','includes','\x0aError:\x20','data','agentId','targetFunction','Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together','6224795dVSJIp','site','llm','write','stack','404','\x20\x20Cause:\x20','stringify','error','join'];a8_0x468b=function(){return _0x1f866f;};return a8_0x468b();}const a8_0x508861=a8_0x5dbc;(function(_0x3a5ae4,_0xe58807){const _0xacc719=a8_0x5dbc,_0x3ddea9=_0x3a5ae4();while(!![]){try{const _0x5eed78=parseInt(_0xacc719(0x10b))/0x1+parseInt(_0xacc719(0x110))/0x2*(parseInt(_0xacc719(0xf5))/0x3)+parseInt(_0xacc719(0x111))/0x4+parseInt(_0xacc719(0xe1))/0x5+parseInt(_0xacc719(0xeb))/0x6+-parseInt(_0xacc719(0x104))/0x7+-parseInt(_0xacc719(0x121))/0x8*(parseInt(_0xacc719(0xef))/0x9);if(_0x5eed78===_0xe58807)break;else _0x3ddea9['push'](_0x3ddea9['shift']());}catch(_0x24cdec){_0x3ddea9['push'](_0x3ddea9['shift']());}}}(a8_0x468b,0xa1e10));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{withSpinner}from'../utils/spinner.js';import{parseAgentRef}from'../sdk/agent/agent-ref-parser.js';import{saveLastChatId,loadLastChatId}from'../sdk/llm/chat-cache.js';import{getLLMConversationUrl}from'../sdk/client/endpoints.js';function handleSDKError(_0x2dbf51,_0x2701f0){const _0x2462fe=a8_0x5dbc;if(_0x2dbf51 instanceof SDKError)console['error'](_0x2462fe(0x10e)+_0x2dbf51[_0x2462fe(0xfe)]),_0x2701f0[_0x2462fe(0x115)]&&(_0x2dbf51[_0x2462fe(0x106)]&&console[_0x2462fe(0xe9)](_0x2462fe(0xe7)+_0x2dbf51[_0x2462fe(0x106)]),_0x2dbf51[_0x2462fe(0xe5)]&&(console[_0x2462fe(0xe9)](_0x2462fe(0x116)),console['error'](_0x2dbf51[_0x2462fe(0xe5)])));else throw _0x2dbf51;}async function resolveAgentId(_0x5af050,_0x62b44,_0x3595b9,_0x224cfc,_0x1c236a){const _0x357ae0=a8_0x5dbc,_0x176b98=_0x62b44||_0x3595b9;if(_0x176b98){const {projectName:_0x4d9397,agentName:_0x27de40}=parseAgentRef(_0x176b98),_0x38fbe5=_0x27de40||_0x176b98,_0x2c693b=_0x27de40?_0x4d9397:_0x224cfc;if(!_0x2c693b)throw new Error('No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22');if(_0x1c236a){const _0x5d6d24=_0x62b44?_0x357ae0(0x105):_0x357ae0(0xf3);console[_0x357ae0(0xe9)]('Using\x20agent\x20from\x20'+_0x5d6d24+':\x20'+_0x2c693b+'/'+_0x38fbe5);}const _0x34ebb1=await withSpinner(_0x357ae0(0xfa)+_0x2c693b+_0x357ae0(0x122),()=>_0x5af050[_0x357ae0(0xe3)][_0x357ae0(0x100)](_0x2c693b),{'verbose':_0x1c236a}),_0x27cb63=await withSpinner(_0x357ae0(0x12a)+_0x38fbe5+_0x357ae0(0x122),()=>_0x5af050['llm'][_0x357ae0(0xfc)](_0x38fbe5,_0x34ebb1[_0x357ae0(0xdd)]),{'verbose':_0x1c236a});return _0x27cb63[_0x357ae0(0xdd)];}else{const _0x5082a5=_0x5af050[_0x357ae0(0xe3)][_0x357ae0(0x11d)]();if(_0x5082a5)return _0x1c236a&&console[_0x357ae0(0xe9)](_0x357ae0(0x108)+_0x5082a5[_0x357ae0(0xec)]),_0x5082a5['id'];const _0x4e8990=await withSpinner(_0x357ae0(0xed),()=>_0x5af050[_0x357ae0(0xe3)][_0x357ae0(0x117)](_0x357ae0(0x11b),0x0),{'verbose':_0x1c236a});return _0x4e8990[_0x357ae0(0xdd)]['id'];}}function a8_0x5dbc(_0xa61152,_0x374e87){_0xa61152=_0xa61152-0xd8;const _0x468b03=a8_0x468b();let _0x5dbc88=_0x468b03[_0xa61152];return _0x5dbc88;}export class ChatCommand extends BaseCommand{[a8_0x508861(0xec)]=a8_0x508861(0x11e);[a8_0x508861(0xff)]=a8_0x508861(0x127);[a8_0x508861(0x128)](_0x3679ba){const _0x509e13=a8_0x508861,_0x47b6b5=_0x3679ba[_0x509e13(0xd9)][_0x509e13(0xea)]('\x20');if(!_0x47b6b5)return _0x509e13(0xfd);return undefined;}async['streamChat'](_0x22f858,_0x4f183c,_0xda42c2,_0x1ae738,_0x34c6f9){const _0x291802=a8_0x508861;for await(const _0x1b7b2c of _0x22f858[_0x291802(0xe3)]['chat'](_0x4f183c,{'agentId':_0xda42c2,'chatId':_0x1ae738})){if(_0x1b7b2c[_0x291802(0xf4)]===_0x291802(0x101)){const _0x1c8b38=_0x1b7b2c[_0x291802(0xdd)][_0x291802(0x118)];saveLastChatId(_0x1c8b38),_0x34c6f9&&console[_0x291802(0xe9)](_0x291802(0x123)+_0x1c8b38);}else _0x1b7b2c['type']===_0x291802(0xee)&&this[_0x291802(0x114)](_0x1b7b2c[_0x291802(0xdd)]);}}async[a8_0x508861(0x10a)](_0x5df0cc,_0x497657,_0x1f034e,_0x38239b){const _0x3900fb=a8_0x508861,_0x426a52=_0x5df0cc[_0x3900fb(0x11c)][_0x3900fb(0xe2)];let _0x69529=![];for await(const _0x913404 of _0x5df0cc['llm']['chat'](_0x497657,{'agentId':_0x1f034e,'chatId':_0x38239b})){if(_0x913404[_0x3900fb(0xf4)]===_0x3900fb(0x101)){const _0x57748d=_0x913404[_0x3900fb(0xdd)];saveLastChatId(_0x57748d['chatId']);const _0x52086a=_0x57748d['projectId']&&_0x57748d[_0x3900fb(0xde)]?getLLMConversationUrl(_0x426a52,_0x57748d['projectId'],_0x57748d[_0x3900fb(0xde)],_0x57748d[_0x3900fb(0x118)]):undefined;console[_0x3900fb(0x112)](JSON[_0x3900fb(0xe8)]({'type':_0x3900fb(0x101),'data':{'chatId':_0x57748d[_0x3900fb(0x118)],'agentId':_0x57748d[_0x3900fb(0xde)],'consoleUrl':_0x52086a}})),_0x69529=!![];}else{if(_0x913404[_0x3900fb(0xf4)]===_0x3900fb(0xee)){!_0x69529&&_0x38239b&&(console['log'](JSON['stringify']({'type':_0x3900fb(0x101),'data':{'chatId':_0x38239b}})),_0x69529=!![]);const _0x557cc9=_0x913404['data'];if(_0x3900fb(0x103)in _0x557cc9)console[_0x3900fb(0x112)](JSON['stringify']({'type':_0x3900fb(0x103),'data':{'content':_0x557cc9['content']}}));else{if(_0x3900fb(0x11f)in _0x557cc9){const _0x31acfd=_0x557cc9[_0x3900fb(0x11f)];console[_0x3900fb(0x112)](JSON[_0x3900fb(0xe8)]({'type':_0x3900fb(0x11f),'data':{'id':_0x31acfd['id'],'name':_0x31acfd[_0x3900fb(0xd8)],'target':_0x31acfd[_0x3900fb(0xf0)]?.[_0x3900fb(0xec)]||_0x31acfd[_0x3900fb(0x102)]?.[_0x3900fb(0xec)]||_0x31acfd[_0x3900fb(0x10d)]?.[_0x3900fb(0xec)]||_0x31acfd[_0x3900fb(0xdf)]}}));}else{if(_0x3900fb(0x113)in _0x557cc9)console['log'](JSON[_0x3900fb(0xe8)]({'type':'tool_result','data':{'id':_0x557cc9[_0x3900fb(0x113)]['id'],'name':_0x557cc9[_0x3900fb(0x113)][_0x3900fb(0xd8)],'result':typeof _0x557cc9[_0x3900fb(0x113)][_0x3900fb(0x103)]===_0x3900fb(0xf8)?_0x557cc9[_0x3900fb(0x113)][_0x3900fb(0x103)][_0x3900fb(0x10f)](0x0,0x1f4):''}}));else _0x3900fb(0xe9)in _0x557cc9&&console[_0x3900fb(0x112)](JSON[_0x3900fb(0xe8)]({'type':_0x3900fb(0xe9),'data':{'error':_0x557cc9[_0x3900fb(0xe9)]}}));}}}}}console[_0x3900fb(0x112)](JSON[_0x3900fb(0xe8)]({'type':_0x3900fb(0xf1)}));}async['execute'](_0x2f0309){const _0x25bfed=a8_0x508861,{options:_0x1aaebe,args:_0x486220,tdx:_0x4206ee}=_0x2f0309,_0x582392=_0x486220['join']('\x20'),_0x568fc2=_0x1aaebe,_0x2e613d=_0x568fc2[_0x25bfed(0xda)],_0x67baa8=_0x568fc2[_0x25bfed(0x126)],_0x57accb=_0x568fc2[_0x25bfed(0xfb)],_0x280dcd=_0x568fc2[_0x25bfed(0xf6)],_0xe182d5=_0x568fc2[_0x25bfed(0x118)],_0x1f01c7=_0x568fc2[_0x25bfed(0x120)];if(_0x280dcd&&_0xe182d5)return console[_0x25bfed(0xe9)](_0x25bfed(0xe0)),0x1;try{let _0x5e6caa,_0x309ff3;if(_0xe182d5)_0x309ff3=_0xe182d5;else!_0x280dcd&&(_0x309ff3=loadLastChatId(),_0x309ff3&&_0x1aaebe[_0x25bfed(0x115)]&&console[_0x25bfed(0xe9)](_0x25bfed(0x109)+_0x309ff3));!_0xe182d5&&(_0x280dcd||!_0x309ff3)&&(_0x5e6caa=await resolveAgentId(_0x4206ee,_0x2e613d,_0x67baa8,_0x57accb,_0x1aaebe[_0x25bfed(0x115)]));const _0x5005de=_0x1f01c7?(_0x24029d,_0x2a6e47,_0x220906)=>this[_0x25bfed(0x10a)](_0x4206ee,_0x24029d,_0x2a6e47,_0x220906):(_0xcc81cf,_0x5b917a,_0xbb349c)=>this[_0x25bfed(0xf7)](_0x4206ee,_0xcc81cf,_0x5b917a,_0xbb349c,_0x1aaebe[_0x25bfed(0x115)]);try{await _0x5005de(_0x582392,_0x5e6caa,_0x309ff3);}catch(_0xd0181b){const _0x3b5ff6=_0xd0181b instanceof SDKError&&_0xd0181b[_0x25bfed(0x129)]===ErrorCode[_0x25bfed(0x125)]||_0xd0181b instanceof Error&&_0xd0181b[_0x25bfed(0xfe)][_0x25bfed(0xdb)](_0x25bfed(0xe6));if(_0x3b5ff6&&_0xe182d5)return console[_0x25bfed(0xe9)](_0x25bfed(0x11a)+_0xe182d5+_0x25bfed(0x10c)),0x1;if(_0x3b5ff6)_0x1aaebe[_0x25bfed(0x115)]&&console['error'](_0x25bfed(0xf2)),!_0x5e6caa&&(_0x5e6caa=await resolveAgentId(_0x4206ee,_0x2e613d,_0x67baa8,_0x57accb,_0x1aaebe['verbose'])),await _0x5005de(_0x582392,_0x5e6caa,undefined);else throw _0xd0181b;}return!_0x1f01c7&&console['log'](),0x0;}catch(_0x517606){return console[_0x25bfed(0xe9)](),handleSDKError(_0x517606,_0x1aaebe),0x1;}}[a8_0x508861(0x114)](_0x5c935e){const _0x21dcfc=a8_0x508861;if(_0x21dcfc(0x103)in _0x5c935e)process['stdout'][_0x21dcfc(0xe4)](_0x5c935e[_0x21dcfc(0x103)]);else _0x21dcfc(0xe9)in _0x5c935e&&console[_0x21dcfc(0xe9)](_0x21dcfc(0xdc)+_0x5c935e[_0x21dcfc(0xe9)]);}}export class ChatCreateCommand extends BaseCommand{[a8_0x508861(0xec)]=a8_0x508861(0x107);['description']=a8_0x508861(0x124);[a8_0x508861(0x128)](_0x4f6da3){const _0x240688=a8_0x508861,_0x2d7c63=_0x4f6da3['options'],_0x3dc980=_0x2d7c63[_0x240688(0xda)],_0x49c6d5=_0x2d7c63[_0x240688(0x126)];if(!_0x3dc980&&!_0x49c6d5)return _0x240688(0x119);return undefined;}async[a8_0x508861(0xf9)](_0x6d16dd){const _0x55ab06=a8_0x508861,{options:_0x1ffeec,tdx:_0x597cf8}=_0x6d16dd,_0xc05c46=_0x1ffeec,_0x59d902=_0xc05c46[_0x55ab06(0xda)],_0x403dfc=_0xc05c46['llmAgent'],_0x545be9=_0xc05c46[_0x55ab06(0xfb)];try{const _0x35ed78=await resolveAgentId(_0x597cf8,_0x59d902,_0x403dfc,_0x545be9,_0x1ffeec['verbose']),_0x81588a=await _0x597cf8['llm']['startChat'](_0x35ed78);return saveLastChatId(_0x81588a['id']),console[_0x55ab06(0x112)](JSON[_0x55ab06(0xe8)]({'chatId':_0x81588a['id'],'agentId':_0x35ed78})),0x0;}catch(_0x57005f){return handleSDKError(_0x57005f,_0x1ffeec),0x1;}}}
@@ -1 +1 @@
1
- {"version":3,"file":"claude-command.d.ts","sourceRoot":"","sources":["../../src/commands/claude-command.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,WAAW,EAAE,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAmDhE;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAQpG;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,EAAE,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EACnD,EAAE,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAClD,MAAM,CAIR;AAgJD;;GAEG;AACH,eAAO,MAAM,qBAAqB,+CAA+C,CAAC;AAElF;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,CAO3C;AA+QD;;;GAGG;AACH,qBAAa,aAAc,SAAQ,WAAW;IAC5C,QAAQ,CAAC,IAAI,YAAY;IACzB,QAAQ,CAAC,WAAW,kDAAkD;IAEtE,OAAO,CAAC,iBAAiB,CAAC,CAAyB;IACnD,OAAO,CAAC,gBAAgB,CAAC,CAAmB;IAC5C,OAAO,CAAC,MAAM,CAAC,CAAY;IAC3B,OAAO,CAAC,IAAI,CAAC,CAAS;IAEhB,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CA2NxD"}
1
+ {"version":3,"file":"claude-command.d.ts","sourceRoot":"","sources":["../../src/commands/claude-command.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,WAAW,EAAE,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AA2KhE;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAQpG;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,EAAE,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EACnD,EAAE,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAClD,MAAM,CAIR;AAgJD;;GAEG;AACH,eAAO,MAAM,qBAAqB,+CAA+C,CAAC;AAElF;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,CAO3C;AA8ND;;;GAGG;AACH,qBAAa,aAAc,SAAQ,WAAW;IAC5C,QAAQ,CAAC,IAAI,YAAY;IACzB,QAAQ,CAAC,WAAW,kDAAkD;IAEtE,OAAO,CAAC,iBAAiB,CAAC,CAAyB;IACnD,OAAO,CAAC,gBAAgB,CAAC,CAAmB;IAC5C,OAAO,CAAC,MAAM,CAAC,CAAY;IAC3B,OAAO,CAAC,IAAI,CAAC,CAAS;IAEhB,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CAuNxD"}