@treasuredata/tdx 2026.3.8 → 2026.3.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (217) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/cli.js.map +1 -1
  6. package/dist/commands/activations.js +1 -1
  7. package/dist/commands/agent-command.js +1 -1
  8. package/dist/commands/agent-test-command.js +1 -1
  9. package/dist/commands/api-command.js +1 -1
  10. package/dist/commands/auth-command.js +1 -1
  11. package/dist/commands/auth-login-command.js +1 -1
  12. package/dist/commands/chat-command.js +1 -1
  13. package/dist/commands/claude-command.js +1 -1
  14. package/dist/commands/claude-statusline-command.js +1 -1
  15. package/dist/commands/claude-usage-command.js +1 -1
  16. package/dist/commands/command.js +1 -1
  17. package/dist/commands/connection-command.js +1 -1
  18. package/dist/commands/databases.js +1 -1
  19. package/dist/commands/delivery-command.js +1 -1
  20. package/dist/commands/describe.js +1 -1
  21. package/dist/commands/engage-campaign-pull-command.js +1 -1
  22. package/dist/commands/engage-campaign-push-command.js +1 -1
  23. package/dist/commands/engage-campaign-validate-command.js +1 -1
  24. package/dist/commands/engage-command.js +1 -1
  25. package/dist/commands/engage-template-pull-command.js +1 -1
  26. package/dist/commands/engage-template-push-command.js +1 -1
  27. package/dist/commands/engage-template-validate-command.js +1 -1
  28. package/dist/commands/job-command.js +1 -1
  29. package/dist/commands/journey-command.js +1 -1
  30. package/dist/commands/journey-validate-command.js +1 -1
  31. package/dist/commands/llm-command.js +1 -1
  32. package/dist/commands/mcp-command.js +1 -1
  33. package/dist/commands/parent-segment-command.js +1 -1
  34. package/dist/commands/profile-command.js +1 -1
  35. package/dist/commands/profiles-command.js +1 -1
  36. package/dist/commands/query-command.js +1 -1
  37. package/dist/commands/schedule-command.js +1 -1
  38. package/dist/commands/segment-command.js +1 -1
  39. package/dist/commands/segment-create-command.js +1 -1
  40. package/dist/commands/segment-fields-command.js +1 -1
  41. package/dist/commands/segment-pull-command.js +1 -1
  42. package/dist/commands/segment-push-command.js +1 -1
  43. package/dist/commands/segment-update-command.js +1 -1
  44. package/dist/commands/segment-use-command.js +1 -1
  45. package/dist/commands/segment-validate-command.js +1 -1
  46. package/dist/commands/segments.js +1 -1
  47. package/dist/commands/show.js +1 -1
  48. package/dist/commands/status-command.js +1 -1
  49. package/dist/commands/tables.js +1 -1
  50. package/dist/commands/unset-command.js +1 -1
  51. package/dist/commands/upgrade-command.js +1 -1
  52. package/dist/commands/use-command.js +1 -1
  53. package/dist/commands/user-command.js +1 -1
  54. package/dist/commands/workflow-command.d.ts.map +1 -1
  55. package/dist/commands/workflow-command.js +1 -1
  56. package/dist/commands/workflow-command.js.map +1 -1
  57. package/dist/core/auth.js +1 -1
  58. package/dist/core/command-output.js +1 -1
  59. package/dist/core/config.js +1 -1
  60. package/dist/core/connection-cache.js +1 -1
  61. package/dist/core/constants.js +1 -1
  62. package/dist/core/credential-cache.js +1 -1
  63. package/dist/core/global-context.js +1 -1
  64. package/dist/core/keychain.js +1 -1
  65. package/dist/core/oauth-keychain.js +1 -1
  66. package/dist/core/oauth.d.ts +2 -2
  67. package/dist/core/oauth.js +1 -1
  68. package/dist/core/profile.js +1 -1
  69. package/dist/core/profile.js.map +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.js +1 -1
  81. package/dist/proxy/passthrough-server.js +1 -1
  82. package/dist/proxy/sse-usage-parser.js +1 -1
  83. package/dist/sdk/agent/agent-config.js +1 -1
  84. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  85. package/dist/sdk/agent/agent-yaml.js +1 -1
  86. package/dist/sdk/agent/test/evaluator.js +1 -1
  87. package/dist/sdk/agent/test/executor.js +1 -1
  88. package/dist/sdk/agent/test/index.js +1 -1
  89. package/dist/sdk/agent/test/output.js +1 -1
  90. package/dist/sdk/agent/test/parser.js +1 -1
  91. package/dist/sdk/agent/tool-target-registry.js +1 -1
  92. package/dist/sdk/api.js +1 -1
  93. package/dist/sdk/client/cdp-api-client.js +1 -1
  94. package/dist/sdk/client/delivery-api-client.js +1 -1
  95. package/dist/sdk/client/endpoints.js +1 -1
  96. package/dist/sdk/client/endpoints.js.map +1 -1
  97. package/dist/sdk/client/engage-api-client.js +1 -1
  98. package/dist/sdk/client/http-client.js +1 -1
  99. package/dist/sdk/client/llm-api-client.js +1 -1
  100. package/dist/sdk/client/oauth-refresh.d.ts +1 -1
  101. package/dist/sdk/client/oauth-refresh.js +1 -1
  102. package/dist/sdk/client/rate-limiter.js +1 -1
  103. package/dist/sdk/client/td-api-client.js +1 -1
  104. package/dist/sdk/client/trino-api-client.js +1 -1
  105. package/dist/sdk/client/workflow-client.js +1 -1
  106. package/dist/sdk/connection-validator.js +1 -1
  107. package/dist/sdk/connection.js +1 -1
  108. package/dist/sdk/delivery.js +1 -1
  109. package/dist/sdk/engage/campaign-pull.js +1 -1
  110. package/dist/sdk/engage/campaign-push.js +1 -1
  111. package/dist/sdk/engage/campaign-validator.js +1 -1
  112. package/dist/sdk/engage/campaign-yaml.js +1 -1
  113. package/dist/sdk/engage/template-pull.js +1 -1
  114. package/dist/sdk/engage/template-push.js +1 -1
  115. package/dist/sdk/engage/template-validator.js +1 -1
  116. package/dist/sdk/engage/template-yaml.js +1 -1
  117. package/dist/sdk/engage/types/campaign-def.js +1 -1
  118. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  119. package/dist/sdk/engage/types/template-schema.js +1 -1
  120. package/dist/sdk/engage.js +1 -1
  121. package/dist/sdk/errors.d.ts +2 -0
  122. package/dist/sdk/errors.d.ts.map +1 -1
  123. package/dist/sdk/errors.js +1 -1
  124. package/dist/sdk/errors.js.map +1 -1
  125. package/dist/sdk/index.js +1 -1
  126. package/dist/sdk/io/index.js +1 -1
  127. package/dist/sdk/io/node-filesystem.js +1 -1
  128. package/dist/sdk/job.js +1 -1
  129. package/dist/sdk/journey.js +1 -1
  130. package/dist/sdk/llm/chat-cache.js +1 -1
  131. package/dist/sdk/llm/index.js +1 -1
  132. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  133. package/dist/sdk/llm/model-factors.js +1 -1
  134. package/dist/sdk/personalization.js +1 -1
  135. package/dist/sdk/query/index.js +1 -1
  136. package/dist/sdk/query/sql-parser.js +1 -1
  137. package/dist/sdk/realtime.js +1 -1
  138. package/dist/sdk/schedule.js +1 -1
  139. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  140. package/dist/sdk/segment/fields-display.js +1 -1
  141. package/dist/sdk/segment/file-discovery.js +1 -1
  142. package/dist/sdk/segment/journey-utils.d.ts.map +1 -1
  143. package/dist/sdk/segment/journey-utils.js +1 -1
  144. package/dist/sdk/segment/journey-utils.js.map +1 -1
  145. package/dist/sdk/segment/journey-validator.js +1 -1
  146. package/dist/sdk/segment/journey-yaml.js +1 -1
  147. package/dist/sdk/segment/journey-yaml.js.map +1 -1
  148. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  149. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  150. package/dist/sdk/segment/pull-workflow.js +1 -1
  151. package/dist/sdk/segment/push-recovery.js +1 -1
  152. package/dist/sdk/segment/push-workflow.js +1 -1
  153. package/dist/sdk/segment/resolution-context.js +1 -1
  154. package/dist/sdk/segment/segment-path-parser.js +1 -1
  155. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  156. package/dist/sdk/segment/segment-validator.js +1 -1
  157. package/dist/sdk/segment/target-resolution.js +1 -1
  158. package/dist/sdk/segment/tdx-config.js +1 -1
  159. package/dist/sdk/segment/types/activation-schema.js +1 -1
  160. package/dist/sdk/segment/types/journey-def.js +1 -1
  161. package/dist/sdk/segment/types/journey-schema.js +1 -1
  162. package/dist/sdk/segment/types/segment-def.js +1 -1
  163. package/dist/sdk/segment/types/segment-schema.js +1 -1
  164. package/dist/sdk/segment/validate-files.js +1 -1
  165. package/dist/sdk/segment/yaml-validator.js +1 -1
  166. package/dist/sdk/segment.js +1 -1
  167. package/dist/sdk/types/index.js +1 -1
  168. package/dist/sdk/types/progress.js +1 -1
  169. package/dist/sdk/user.js +1 -1
  170. package/dist/sdk/util/format-detector.js +1 -1
  171. package/dist/sdk/util/formatters.js +1 -1
  172. package/dist/sdk/util/index.js +1 -1
  173. package/dist/sdk/util/paginate.js +1 -1
  174. package/dist/sdk/util/tree-formatter.js +1 -1
  175. package/dist/sdk/workflow/archive-validation.js +1 -1
  176. package/dist/sdk/workflow/clone-workflow.js +1 -1
  177. package/dist/sdk/workflow/index.d.ts +12 -0
  178. package/dist/sdk/workflow/index.d.ts.map +1 -1
  179. package/dist/sdk/workflow/index.js +1 -1
  180. package/dist/sdk/workflow/index.js.map +1 -1
  181. package/dist/sdk/workflow/pull-workflow.js +1 -1
  182. package/dist/sdk/workflow/push-workflow.js +1 -1
  183. package/dist/sdk/workflow/tdx-config.js +1 -1
  184. package/dist/sdk/workflow/workflow-utils.js +1 -1
  185. package/dist/test-utils/command-runner.js +1 -1
  186. package/dist/test-utils/factories.js +1 -1
  187. package/dist/test-utils/fixtures.js +1 -1
  188. package/dist/test-utils/http-mock.js +1 -1
  189. package/dist/test-utils/index.js +1 -1
  190. package/dist/utils/async.js +1 -1
  191. package/dist/utils/colors.js +1 -1
  192. package/dist/utils/diff.js +1 -1
  193. package/dist/utils/file-permissions.js +1 -1
  194. package/dist/utils/file-reader.js +1 -1
  195. package/dist/utils/github-releases.js +1 -1
  196. package/dist/utils/global-cache.js +1 -1
  197. package/dist/utils/json-loader.js +1 -1
  198. package/dist/utils/local-cache.js +1 -1
  199. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  200. package/dist/utils/logger/formatters/index.js +1 -1
  201. package/dist/utils/logger/handlers/console-handler.js +1 -1
  202. package/dist/utils/logger/handlers/file-handler.js +1 -1
  203. package/dist/utils/logger/handlers/index.js +1 -1
  204. package/dist/utils/logger/handlers/null-handler.js +1 -1
  205. package/dist/utils/logger/index.js +1 -1
  206. package/dist/utils/logger/logger.js +1 -1
  207. package/dist/utils/logger/types.js +1 -1
  208. package/dist/utils/option-validation.js +1 -1
  209. package/dist/utils/process.js +1 -1
  210. package/dist/utils/prompt.js +1 -1
  211. package/dist/utils/spinner.js +1 -1
  212. package/dist/utils/sse-parser.js +1 -1
  213. package/dist/utils/string-utils.js +1 -1
  214. package/dist/utils/table-ref-parser.js +1 -1
  215. package/dist/utils/tdx-logger.js +1 -1
  216. package/dist/utils/version-check.js +1 -1
  217. package/package.json +1 -1
@@ -1 +1 @@
1
- const a4_0x49f1e9=a4_0x4ed4;(function(_0x5661f5,_0x2b93b5){const _0x163736=a4_0x4ed4,_0x5c6777=_0x5661f5();while(!![]){try{const _0x1107f5=parseInt(_0x163736(0x182))/0x1*(-parseInt(_0x163736(0x130))/0x2)+-parseInt(_0x163736(0x15d))/0x3*(parseInt(_0x163736(0x18f))/0x4)+-parseInt(_0x163736(0x158))/0x5*(-parseInt(_0x163736(0x1a5))/0x6)+parseInt(_0x163736(0x1b5))/0x7+parseInt(_0x163736(0x1af))/0x8*(-parseInt(_0x163736(0x16c))/0x9)+-parseInt(_0x163736(0x168))/0xa+parseInt(_0x163736(0x184))/0xb;if(_0x1107f5===_0x2b93b5)break;else _0x5c6777['push'](_0x5c6777['shift']());}catch(_0x454ddc){_0x5c6777['push'](_0x5c6777['shift']());}}}(a4_0x449a,0xc40eb));import a4_0x370cfc from'chalk';import a4_0xdab3b3 from'path';import{existsSync,readFileSync}from'fs';function a4_0x4ed4(_0x28b170,_0xbde919){_0x28b170=_0x28b170-0x127;const _0x449a1a=a4_0x449a();let _0x4ed4de=_0x449a1a[_0x28b170];return _0x4ed4de;}import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext,resolveAgentPullArgs}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x3157ef){const _0x325405=a4_0x4ed4,_0x8c6674=[];if(_0x3157ef['total']!==undefined)_0x8c6674[_0x325405(0x1bf)](_0x3157ef[_0x325405(0x19a)]+_0x325405(0x17a));if(_0x3157ef[_0x325405(0x159)]!==undefined&&_0x3157ef[_0x325405(0x159)]>0x0)_0x8c6674[_0x325405(0x1bf)](a4_0x370cfc['green'](_0x3157ef['new']+_0x325405(0x180)));if(_0x3157ef[_0x325405(0x1bb)]!==undefined&&_0x3157ef[_0x325405(0x1bb)]>0x0)_0x8c6674[_0x325405(0x1bf)](a4_0x370cfc[_0x325405(0x134)](_0x3157ef[_0x325405(0x1bb)]+'\x20created'));if(_0x3157ef[_0x325405(0x1a9)]!==undefined&&_0x3157ef[_0x325405(0x1a9)]>0x0)_0x8c6674[_0x325405(0x1bf)](a4_0x370cfc[_0x325405(0x1ab)](_0x3157ef[_0x325405(0x1a9)]+_0x325405(0x12a)));if(_0x3157ef['unchanged']!==undefined&&_0x3157ef['unchanged']>0x0)_0x8c6674['push'](a4_0x370cfc[_0x325405(0x170)](_0x3157ef[_0x325405(0x17c)]+_0x325405(0x1d1)));if(_0x3157ef[_0x325405(0x1c1)]!==undefined&&_0x3157ef[_0x325405(0x1c1)]>0x0)_0x8c6674[_0x325405(0x1bf)](a4_0x370cfc[_0x325405(0x18b)](_0x3157ef[_0x325405(0x1c1)]+'\x20errors'));return _0x8c6674[_0x325405(0x174)](',\x20');}function displayDiffs(_0x5b9743,_0x3f9c6d,_0x437868,_0x1dd615,_0x1171fa,_0x39c1d8,_0x1ac032){const _0x305d52=a4_0x4ed4;for(const _0x1942c8 of _0x5b9743){if(_0x1942c8[_0x305d52(0x177)]){const _0xe31c17=_0x1942c8['agentName']||_0x1942c8[_0x305d52(0x19e)];console[_0x305d52(0x1ba)](_0x305d52(0x1b8)+_0xe31c17+'\x27:'),console[_0x305d52(0x1ba)]('─'[_0x305d52(0x13c)](0x3c)),console[_0x305d52(0x1ba)](_0x1942c8[_0x305d52(0x177)]),console[_0x305d52(0x1ba)]('─'[_0x305d52(0x13c)](0x3c));}}for(const _0x15e76a of _0x3f9c6d){_0x15e76a[_0x305d52(0x177)]&&(console[_0x305d52(0x1ba)](_0x305d52(0x186)+_0x15e76a['name']+'\x27:'),console[_0x305d52(0x1ba)]('─'[_0x305d52(0x13c)](0x3c)),console[_0x305d52(0x1ba)](_0x15e76a[_0x305d52(0x177)]),console[_0x305d52(0x1ba)]('─'[_0x305d52(0x13c)](0x3c)));}for(const _0x287b9f of _0x437868){_0x287b9f['diff']&&(console[_0x305d52(0x1ba)](_0x305d52(0x1c9)+_0x287b9f['name']+'\x27:'),console[_0x305d52(0x1ba)]('─'['repeat'](0x3c)),console[_0x305d52(0x1ba)](_0x287b9f['diff']),console[_0x305d52(0x1ba)]('─'[_0x305d52(0x13c)](0x3c)));}for(const _0x432079 of _0x1dd615){_0x432079[_0x305d52(0x177)]&&(console[_0x305d52(0x1ba)](_0x305d52(0x12c)+_0x432079[_0x305d52(0x19e)]+'\x27:'),console['log']('─'[_0x305d52(0x13c)](0x3c)),console['log'](_0x432079['diff']),console[_0x305d52(0x1ba)]('─'[_0x305d52(0x13c)](0x3c)));}for(const _0x54cb64 of _0x1171fa){_0x54cb64[_0x305d52(0x177)]&&(console['log']('\x0aChanges\x20to\x20integration\x20\x27'+_0x54cb64[_0x305d52(0x19e)]+'\x27:'),console[_0x305d52(0x1ba)]('─'[_0x305d52(0x13c)](0x3c)),console[_0x305d52(0x1ba)](_0x54cb64[_0x305d52(0x177)]),console['log']('─'[_0x305d52(0x13c)](0x3c)));}for(const _0x42a638 of _0x39c1d8){_0x42a638[_0x305d52(0x177)]&&(console['log']('\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27'+_0x42a638['name']+'\x27:'),console[_0x305d52(0x1ba)]('─'[_0x305d52(0x13c)](0x3c)),console['log'](_0x42a638[_0x305d52(0x177)]),console[_0x305d52(0x1ba)]('─'[_0x305d52(0x13c)](0x3c)));}for(const _0x1849de of _0x1ac032){_0x1849de['diff']&&(console['log'](_0x305d52(0x19d)+_0x1849de[_0x305d52(0x19e)]+'\x27:'),console[_0x305d52(0x1ba)]('─'['repeat'](0x3c)),console['log'](_0x1849de[_0x305d52(0x177)]),console[_0x305d52(0x1ba)]('─'['repeat'](0x3c)));}}function a4_0x449a(){const _0x31569b=['projectDir','\x20new','pushAgent','1389499qGemhH','force','29699109UhWeAz','agentId','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','\x20--name\x20','dryRun','action','agent:pull','red','\x22...','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','Agent\x20','8LvDXgR','cwd-config','\x20\x20Text\x20Knowledge\x20Bases:\x20','\x20\x20Prompts:\x20','counts','cwd','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','\x20\x20Integration\x20\x22','Cancelled','Agent:\x20','pullProject','total','\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)','cloneProject','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','name','\x20files?','experimentalArtifacts','\x20|\x20','✔\x20Context\x20set:\x20','source','context','6mphGQc','\x20\x20Knowledge\x20Base\x20\x22','Agent\x20pulled\x20successfully','\x20\x20Integrations:\x20','updated','Dry\x20run\x20-\x20no\x20files\x20written','yellow','Errors:','integrations','dirname','184tJkifV','\x20\x20Experimental\x20Artifacts:\x20','isNew','knowledgeBases','Pushing\x20agent\x20from\x20\x22','\x20=\x20','4024748JwZfUI','\x0aErrors\x20found:','no_context','\x0aChanges\x20to\x20agent\x20\x27','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','log','created','dim','Output:\x20','Using\x20local\x20project:\x20','push','Using\x20project\x20from\x20','errors','\x0aError:','\x20\x20Experimental\x20Artifact\x20\x22','Failed\x20to\x20push\x20agent:\x20','Project\x20cloned\x20with\x20errors','experimentalKnowledgeBases','Source:\x20','\x0aPush\x20','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','\x20--profile\x20','Cloning\x20\x22','Would\x20pull\x20agent:\x20','profile','outputPath','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory','tdx.json','\x20unchanged','newProjectId','Usage:\x20tdx\x20agent\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20project\x20(requires\x20context\x20or\x20tdx.json)','Using\x20context\x20project:\x20','parse','Analyzing\x20changes\x20to\x20push...','\x20updated','textKnowledgeBases','\x0aChanges\x20to\x20prompt\x20\x27','INVALID_ARGUMENT','pushProject','\x20changed','2gDKULg','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','outputDir','llm','green','site','Using\x20current\x20project:\x20','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','\x20\x20Text\x20Knowledge\x20Base\x20\x22','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','reason','MISSING_ARGUMENT','repeat','message','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','hasChanges','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Dry\x20run\x20-\x20no\x20changes\x20made','Clone\x20\x22','yes','\x20\x20Agent\x20\x22','\x0aProject\x20pushed\x20with\x20errors','\x20\x20tdx\x20agent\x20clone\x20agents/','description','\x0aChanges:','Summary:','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','Project:\x20','Cannot\x20clone\x20from\x20context\x20project\x20\x22','prompts','cyan','\x20\x20Agents:\x20','Using\x20project:\x20','llm_project','\x20\x20Prompt\x20\x22','agentName','Using\x20project\x20from\x20context:\x20','agent:push','\x20\x20Target:\x20','Chat:\x20','6797785ouabtQ','new','No\x20tdx.json\x20found\x20in\x20','\x0a✔\x20Pushed\x20','agents','776418fLmGVk','sourceProjectName','llmProject','\x0aPull\x20summary\x20for\x20\x27','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','\x20resources?','\x20\x20Knowledge\x20Bases:\x20','\x22\x20to\x20new\x20project\x20\x22','newProjectName','9756200FKQrKy','Status:\x20','session','\x22:\x20','371214TJPLHP','error','projectName','utf-8','gray','\x27\x20to\x20create\x20the\x20folder\x20structure.','execute','Pushing\x20to\x20project...','join','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','New\x20project:\x20','diff','\x20\x20tdx\x20agent\x20pull\x20','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','\x20total','\x20successfully','unchanged','projectId','output'];a4_0x449a=function(){return _0x31569b;};return a4_0x449a();}export class AgentPullCommand extends BaseCommand{['name']=a4_0x49f1e9(0x18a);[a4_0x49f1e9(0x147)]='Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files';async[a4_0x49f1e9(0x172)](_0x5b4d1a){const _0x487344=a4_0x49f1e9,{options:_0x4572b2,args:_0x332244,tdx:_0x1990bb}=_0x5b4d1a,_0x4076b3=_0x332244[0x0],_0x32df90=_0x332244[0x1],_0x46dee5=_0x4572b2[_0x487344(0x17e)],_0x671d2b=_0x4572b2[_0x487344(0x188)],_0x445cd2=_0x4572b2[_0x487344(0x183)],_0x47ed54=_0x4572b2[_0x487344(0x143)],_0x28e6c0=_0x4572b2['llmProject'],_0x1b9f1e=_0x4572b2['agent'];let _0x100d1d;if(_0x4076b3){const _0x2d10da=a4_0xdab3b3[_0x487344(0x174)](_0x4076b3,_0x487344(0x1d0));if(existsSync(_0x2d10da))try{const _0x2bf5d1=JSON[_0x487344(0x128)](readFileSync(_0x2d10da,'utf-8'));_0x2bf5d1[_0x487344(0x151)]&&(_0x100d1d={'llm_project':_0x2bf5d1[_0x487344(0x151)]});}catch{}}const _0x155cac=findAgentConfigPath(process['cwd']());let _0x27bff2;if(_0x155cac)try{const _0x450783=JSON[_0x487344(0x128)](readFileSync(_0x155cac,_0x487344(0x16f)));_0x450783[_0x487344(0x151)]&&(_0x27bff2={'llm_project':_0x450783[_0x487344(0x151)]});}catch{}const _0x2ed963=resolveAgentPullArgs({'arg':_0x4076b3,'agentNameArg':_0x32df90,'agentFlag':_0x1b9f1e,'contextProject':_0x28e6c0,'argDirConfig':_0x100d1d,'cwdConfigPath':_0x155cac||undefined,'cwdConfig':_0x27bff2}),{projectNameOrId:_0x226e7a,targetAgentName:_0x5ee102,existingOutputDir:_0x334d0e,source:_0x56268d}=_0x2ed963;if(_0x56268d==='arg-dir')console[_0x487344(0x1ba)](a4_0x370cfc[_0x487344(0x1bc)](_0x487344(0x1c0)+a4_0xdab3b3[_0x487344(0x174)](_0x4076b3,_0x487344(0x1d0))+':\x20'+_0x226e7a));else{if(_0x56268d===_0x487344(0x190))console[_0x487344(0x1ba)](a4_0x370cfc[_0x487344(0x1bc)](_0x487344(0x150)+_0x226e7a));else _0x56268d===_0x487344(0x1a4)&&console[_0x487344(0x1ba)](a4_0x370cfc[_0x487344(0x1bc)](_0x487344(0x154)+_0x226e7a));}if(!_0x226e7a)return _0x1b9f1e?(console[_0x487344(0x1ba)](a4_0x370cfc[_0x487344(0x1ab)]('The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a')),console[_0x487344(0x1ba)](_0x487344(0x162)),console[_0x487344(0x1ba)](_0x487344(0x18d))):(console[_0x487344(0x1ba)](a4_0x370cfc[_0x487344(0x1ab)](_0x487344(0x137))),console[_0x487344(0x1ba)](_0x487344(0x1d3)),console['log']('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project'),console['log'](_0x487344(0x1cf)),console[_0x487344(0x1ba)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20--agent\x20<name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20context\x20project'),console[_0x487344(0x1ba)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20project')),0x1;if(_0x5ee102){const {data:_0x480fba}=await withSpinner('Pulling\x20agent\x20\x22'+_0x5ee102+'\x22\x20from\x20project\x20\x22'+_0x226e7a+_0x487344(0x18c),()=>_0x1990bb[_0x487344(0x133)]['pullAgent'](_0x226e7a,_0x5ee102,_0x46dee5,{'dryRun':_0x671d2b,'force':_0x445cd2}));if(_0x671d2b)return console[_0x487344(0x1ba)](a4_0x370cfc[_0x487344(0x1ab)](_0x487344(0x1aa))),console[_0x487344(0x1ba)](_0x487344(0x1cc)+_0x480fba[_0x487344(0x153)]),console[_0x487344(0x1ba)]('Output\x20path:\x20'+_0x480fba[_0x487344(0x1ce)]),_0x480fba[_0x487344(0x177)]&&(console['log'](_0x487344(0x148)),console['log']('─'['repeat'](0x3c)),console[_0x487344(0x1ba)](_0x480fba['diff']),console[_0x487344(0x1ba)]('─'[_0x487344(0x13c)](0x3c))),0x0;return console[_0x487344(0x1ba)](a4_0x370cfc['green'](_0x487344(0x1a7))),console[_0x487344(0x1ba)]('Agent:\x20'+_0x480fba['agentName']),console[_0x487344(0x1ba)](_0x487344(0x1bd)+_0x480fba[_0x487344(0x1ce)]),console[_0x487344(0x1ba)](_0x487344(0x169)+(_0x480fba[_0x487344(0x1b1)]?a4_0x370cfc['green'](_0x487344(0x159)):_0x480fba[_0x487344(0x13f)]?a4_0x370cfc[_0x487344(0x1ab)]('updated'):a4_0x370cfc[_0x487344(0x170)](_0x487344(0x17c)))),0x0;}const _0x4eff79=_0x334d0e||_0x46dee5,{data:_0x312e4b}=await withSpinner('Analyzing\x20project\x20\x22'+_0x226e7a+_0x487344(0x18c),()=>_0x1990bb[_0x487344(0x133)]['pullProject'](_0x226e7a,_0x4eff79,{'dryRun':!![]})),_0x5900d2=_0x312e4b[_0x487344(0x193)][_0x487344(0x15c)][_0x487344(0x159)]+_0x312e4b['counts']['knowledgeBases'][_0x487344(0x159)]+_0x312e4b[_0x487344(0x193)]['textKnowledgeBases'][_0x487344(0x159)]+_0x312e4b[_0x487344(0x193)][_0x487344(0x14d)][_0x487344(0x159)]+_0x312e4b[_0x487344(0x193)][_0x487344(0x1ad)]['new']+_0x312e4b[_0x487344(0x193)][_0x487344(0x1c6)][_0x487344(0x159)]+_0x312e4b[_0x487344(0x193)]['experimentalArtifacts'][_0x487344(0x159)],_0x100650=_0x312e4b[_0x487344(0x193)][_0x487344(0x15c)][_0x487344(0x1a9)]+_0x312e4b[_0x487344(0x193)][_0x487344(0x1b2)][_0x487344(0x1a9)]+_0x312e4b[_0x487344(0x193)][_0x487344(0x12b)][_0x487344(0x1a9)]+_0x312e4b[_0x487344(0x193)][_0x487344(0x14d)][_0x487344(0x1a9)]+_0x312e4b[_0x487344(0x193)]['integrations']['updated']+_0x312e4b[_0x487344(0x193)][_0x487344(0x1c6)][_0x487344(0x1a9)]+_0x312e4b['counts'][_0x487344(0x1a0)][_0x487344(0x1a9)],_0x2b502a=_0x312e4b[_0x487344(0x193)][_0x487344(0x15c)][_0x487344(0x17c)]+_0x312e4b[_0x487344(0x193)]['knowledgeBases'][_0x487344(0x17c)]+_0x312e4b[_0x487344(0x193)][_0x487344(0x12b)]['unchanged']+_0x312e4b[_0x487344(0x193)]['prompts'][_0x487344(0x17c)]+_0x312e4b[_0x487344(0x193)][_0x487344(0x1ad)][_0x487344(0x17c)]+_0x312e4b[_0x487344(0x193)]['experimentalKnowledgeBases'][_0x487344(0x17c)]+_0x312e4b[_0x487344(0x193)][_0x487344(0x1a0)][_0x487344(0x17c)];console[_0x487344(0x1ba)](_0x487344(0x160)+_0x312e4b[_0x487344(0x16e)]+'\x27:'),console[_0x487344(0x1ba)]('\x20\x20'+a4_0x370cfc[_0x487344(0x134)]('+\x20'+_0x5900d2+_0x487344(0x180))+_0x487344(0x1a1)+a4_0x370cfc[_0x487344(0x1ab)]('~\x20'+_0x100650+_0x487344(0x12f))+'\x20|\x20'+a4_0x370cfc['dim']('=\x20'+_0x2b502a+_0x487344(0x1d1))),console[_0x487344(0x1ba)]('\x20\x20Agents:\x20'+formatCountSummary(_0x312e4b[_0x487344(0x193)]['agents'])),console[_0x487344(0x1ba)](_0x487344(0x165)+formatCountSummary(_0x312e4b[_0x487344(0x193)]['knowledgeBases'])),console[_0x487344(0x1ba)](_0x487344(0x191)+formatCountSummary(_0x312e4b['counts'][_0x487344(0x12b)])),console[_0x487344(0x1ba)](_0x487344(0x192)+formatCountSummary(_0x312e4b[_0x487344(0x193)]['prompts'])),console[_0x487344(0x1ba)](_0x487344(0x1a8)+formatCountSummary(_0x312e4b['counts']['integrations']));const _0x4f8974=_0x312e4b[_0x487344(0x193)]['experimentalKnowledgeBases'][_0x487344(0x19a)]>0x0||_0x312e4b[_0x487344(0x193)][_0x487344(0x1a0)]['total']>0x0;_0x4f8974&&(console[_0x487344(0x1ba)](_0x487344(0x163)+formatCountSummary(_0x312e4b['counts'][_0x487344(0x1c6)])),console[_0x487344(0x1ba)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x312e4b[_0x487344(0x193)]['experimentalArtifacts'])));console[_0x487344(0x1ba)](_0x487344(0x156)+a4_0x370cfc['cyan'](_0x312e4b[_0x487344(0x132)])),displayDiffs(_0x312e4b['agents'],_0x312e4b[_0x487344(0x1b2)],_0x312e4b[_0x487344(0x12b)],_0x312e4b[_0x487344(0x14d)],_0x312e4b[_0x487344(0x1ad)],_0x312e4b[_0x487344(0x1c6)],_0x312e4b['experimentalArtifacts']);if(_0x671d2b)return console['log'](a4_0x370cfc[_0x487344(0x1ab)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x5900d2===0x0&&_0x100650===0x0)return console[_0x487344(0x1ba)](a4_0x370cfc[_0x487344(0x134)](_0x487344(0x131))),saveSessionContext({'llm_project':_0x312e4b[_0x487344(0x16e)]},_0x4572b2[_0x487344(0x16a)]),console[_0x487344(0x1ba)](a4_0x370cfc['green'](_0x487344(0x1a2)+a4_0x370cfc[_0x487344(0x1bc)](_0x487344(0x151))+_0x487344(0x1b4)+a4_0x370cfc[_0x487344(0x14e)](_0x312e4b['projectName']))),0x0;if(!_0x47ed54&&!_0x445cd2){if(!isInteractive())return console[_0x487344(0x16d)](a4_0x370cfc['red']('\x0aError:'),_0x487344(0x175)),console[_0x487344(0x16d)](a4_0x370cfc[_0x487344(0x1bc)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x499dad=await confirmKey('\x0aWrite\x20'+(_0x5900d2+_0x100650)+_0x487344(0x19f));if(!_0x499dad)return console[_0x487344(0x1ba)](a4_0x370cfc['yellow'](_0x487344(0x197)),'-\x20no\x20files\x20written'),0x1;}const {data:_0xe9a508}=await withSpinner('Writing\x20files...',()=>_0x1990bb['llm'][_0x487344(0x199)](_0x226e7a,_0x4eff79,{'force':_0x445cd2}));return console[_0x487344(0x1ba)](a4_0x370cfc[_0x487344(0x134)]('\x0a✔\x20Pulled\x20'+(_0x5900d2+_0x100650)+'\x20files\x20to\x20'+_0xe9a508['outputDir'])),saveSessionContext({'llm_project':_0xe9a508['projectName']},_0x4572b2['session']),console['log'](a4_0x370cfc[_0x487344(0x134)]('✔\x20Context\x20set:\x20'+a4_0x370cfc[_0x487344(0x1bc)](_0x487344(0x151))+'\x20=\x20'+a4_0x370cfc['cyan'](_0xe9a508[_0x487344(0x16e)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{['name']='agent:clone';[a4_0x49f1e9(0x147)]='Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project';async[a4_0x49f1e9(0x172)](_0x420861){const _0x12c790=a4_0x49f1e9,{options:_0x3f0027,args:_0x2ca414,tdx:_0x21f8fd}=_0x420861,_0x5381da=_0x2ca414[0x0],_0x3245b5=_0x3f0027[_0x12c790(0x19e)],_0x7b3477=_0x3f0027[_0x12c790(0x188)],_0x5bd87e=_0x3f0027[_0x12c790(0x143)],_0x174417=_0x3f0027[_0x12c790(0x135)],_0x5481cf=_0x3f0027[_0x12c790(0x15f)];let _0x26f25b;const _0x26d628=findAgentConfigPath(process[_0x12c790(0x194)]());if(_0x5381da){const _0x3ee1d2=a4_0xdab3b3[_0x12c790(0x174)](_0x5381da,_0x12c790(0x1d0));existsSync(_0x3ee1d2)?(_0x26f25b=_0x5381da,console[_0x12c790(0x1ba)](a4_0x370cfc[_0x12c790(0x1bc)](_0x12c790(0x1be)+_0x5381da))):_0x26f25b=_0x5381da;}else{if(_0x26d628)_0x26f25b=a4_0xdab3b3[_0x12c790(0x1ae)](_0x26d628),console['log'](a4_0x370cfc[_0x12c790(0x1bc)](_0x12c790(0x136)+_0x26f25b));else{if(_0x5481cf){const _0xe03093=sanitizeForFilesystem(_0x5481cf);let _0x565079=_0xe03093,_0x2ba935=a4_0xdab3b3[_0x12c790(0x174)](process[_0x12c790(0x194)](),_0x12c790(0x15c),_0xe03093,_0x12c790(0x1d0));if(!existsSync(_0x2ba935)){const _0x4b1f2b=normalizeName(_0x5481cf),_0x5eed20=a4_0xdab3b3[_0x12c790(0x174)](process[_0x12c790(0x194)](),'agents',_0x4b1f2b,_0x12c790(0x1d0));existsSync(_0x5eed20)&&(_0x565079=_0x4b1f2b,_0x2ba935=_0x5eed20);}if(existsSync(_0x2ba935))_0x26f25b=a4_0xdab3b3[_0x12c790(0x1ae)](_0x2ba935),console['log'](a4_0x370cfc[_0x12c790(0x1bc)](_0x12c790(0x1be)+_0x26f25b));else{const _0x37308f=_0x3f0027[_0x12c790(0x1cd)];if(_0x37308f)throw new SDKError(ErrorCode[_0x12c790(0x12d)],_0x12c790(0x14c)+_0x5481cf+'\x22\x20to\x20a\x20different\x20profile',undefined,{'helpText':_0x12c790(0x161)+'First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a'+(_0x12c790(0x178)+_0x5481cf+'\x0a')+(_0x12c790(0x146)+_0x565079+_0x12c790(0x187)+(_0x3245b5||'<new-name>')+_0x12c790(0x1ca)+_0x37308f)});_0x26f25b=_0x5481cf,console[_0x12c790(0x1ba)](a4_0x370cfc[_0x12c790(0x1bc)](_0x12c790(0x127)+_0x5481cf));}}}}if(!_0x26f25b)return console[_0x12c790(0x1ba)](a4_0x370cfc[_0x12c790(0x1ab)](_0x12c790(0x179))),console[_0x12c790(0x1ba)](_0x12c790(0x1b9)),console[_0x12c790(0x1ba)](_0x12c790(0x195)),console[_0x12c790(0x1ba)](_0x12c790(0x19b)),console[_0x12c790(0x1ba)](_0x12c790(0x14a)),0x1;if(!_0x3245b5)throw new SDKError(ErrorCode[_0x12c790(0x13b)],'New\x20project\x20name\x20is\x20required',undefined,{'helpText':'Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>'});if(!_0x5bd87e&&!_0x7b3477){if(!isInteractive())return console[_0x12c790(0x16d)](a4_0x370cfc[_0x12c790(0x18b)]('\x0aError:'),_0x12c790(0x175)),console[_0x12c790(0x16d)](a4_0x370cfc[_0x12c790(0x1bc)](_0x12c790(0x140))),0x1;const _0x32f0fc=await confirmKey(_0x12c790(0x142)+_0x26f25b+_0x12c790(0x166)+_0x3245b5+'\x22?');if(!_0x32f0fc)return console[_0x12c790(0x1ba)](a4_0x370cfc[_0x12c790(0x1ab)](_0x12c790(0x197))),0x1;}const {data:_0x20aca6}=await withSpinner(_0x12c790(0x1cb)+_0x26f25b+'\x22\x20to\x20\x22'+_0x3245b5+'\x22...',()=>_0x21f8fd[_0x12c790(0x133)][_0x12c790(0x19c)](_0x26f25b,_0x3245b5,{'dryRun':_0x7b3477}));if(_0x7b3477){console['log'](a4_0x370cfc['yellow'](_0x12c790(0x141))),console[_0x12c790(0x1ba)](_0x12c790(0x1c7)+_0x20aca6[_0x12c790(0x15e)]),console[_0x12c790(0x1ba)](_0x12c790(0x176)+_0x3245b5),console[_0x12c790(0x1ba)]('Would\x20clone:'),console[_0x12c790(0x1ba)](_0x12c790(0x14f)+_0x20aca6[_0x12c790(0x193)][_0x12c790(0x15c)][_0x12c790(0x1bb)]),console['log'](_0x12c790(0x165)+_0x20aca6[_0x12c790(0x193)][_0x12c790(0x1b2)][_0x12c790(0x1bb)]),console['log'](_0x12c790(0x192)+_0x20aca6[_0x12c790(0x193)][_0x12c790(0x14d)][_0x12c790(0x1bb)]);const _0x52b89a=_0x20aca6['counts'][_0x12c790(0x1c6)][_0x12c790(0x1bb)]>0x0||_0x20aca6[_0x12c790(0x193)]['experimentalArtifacts'][_0x12c790(0x1bb)]>0x0;return _0x52b89a&&(console[_0x12c790(0x1ba)](_0x12c790(0x163)+_0x20aca6[_0x12c790(0x193)][_0x12c790(0x1c6)][_0x12c790(0x1bb)]),console[_0x12c790(0x1ba)](_0x12c790(0x1b0)+_0x20aca6[_0x12c790(0x193)][_0x12c790(0x1a0)]['created'])),0x0;}const _0x1c1df8=_0x20aca6['counts']['agents'][_0x12c790(0x1c1)]>0x0||_0x20aca6['counts'][_0x12c790(0x1b2)][_0x12c790(0x1c1)]>0x0||_0x20aca6[_0x12c790(0x193)][_0x12c790(0x14d)][_0x12c790(0x1c1)]>0x0||_0x20aca6[_0x12c790(0x193)][_0x12c790(0x1c6)][_0x12c790(0x1c1)]>0x0||_0x20aca6['counts'][_0x12c790(0x1a0)]['errors']>0x0;_0x1c1df8?console['log'](a4_0x370cfc[_0x12c790(0x1ab)](_0x12c790(0x1c5))):console['log'](a4_0x370cfc[_0x12c790(0x134)]('Project\x20cloned\x20successfully'));console[_0x12c790(0x1ba)](_0x12c790(0x1c7)+_0x20aca6['sourceProjectName']),console[_0x12c790(0x1ba)]('New\x20project:\x20'+_0x20aca6[_0x12c790(0x167)]),console[_0x12c790(0x1ba)]('New\x20project\x20ID:\x20'+_0x20aca6[_0x12c790(0x1d2)]),console['log'](),console['log'](_0x12c790(0x149)),console[_0x12c790(0x1ba)](_0x12c790(0x14f)+formatCountSummary(_0x20aca6['counts'][_0x12c790(0x15c)])),console['log'](_0x12c790(0x165)+formatCountSummary(_0x20aca6[_0x12c790(0x193)][_0x12c790(0x1b2)])),console['log'](_0x12c790(0x192)+formatCountSummary(_0x20aca6[_0x12c790(0x193)]['prompts'])),console[_0x12c790(0x1ba)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x20aca6['counts'][_0x12c790(0x1ad)]));const _0x5ac67e=_0x20aca6[_0x12c790(0x193)]['experimentalKnowledgeBases']['created']>0x0||_0x20aca6[_0x12c790(0x193)][_0x12c790(0x1c6)][_0x12c790(0x1a9)]>0x0||_0x20aca6['counts'][_0x12c790(0x1c6)][_0x12c790(0x17c)]>0x0||_0x20aca6[_0x12c790(0x193)]['experimentalArtifacts'][_0x12c790(0x1bb)]>0x0||_0x20aca6[_0x12c790(0x193)][_0x12c790(0x1a0)]['updated']>0x0||_0x20aca6[_0x12c790(0x193)][_0x12c790(0x1a0)][_0x12c790(0x17c)]>0x0;_0x5ac67e&&(console[_0x12c790(0x1ba)](_0x12c790(0x163)+formatCountSummary(_0x20aca6['counts'][_0x12c790(0x1c6)])),console[_0x12c790(0x1ba)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x20aca6[_0x12c790(0x193)][_0x12c790(0x1a0)])));if(_0x1c1df8){console['log'](),console[_0x12c790(0x1ba)](a4_0x370cfc[_0x12c790(0x18b)](_0x12c790(0x1ac)));for(const _0x3efad5 of _0x20aca6[_0x12c790(0x15c)]){_0x3efad5['action']===_0x12c790(0x16d)&&console[_0x12c790(0x1ba)](a4_0x370cfc[_0x12c790(0x18b)](_0x12c790(0x144)+_0x3efad5[_0x12c790(0x153)]+_0x12c790(0x16b)+_0x3efad5[_0x12c790(0x16d)]));}for(const _0x4ce51d of _0x20aca6['knowledgeBases']){_0x4ce51d[_0x12c790(0x189)]===_0x12c790(0x16d)&&console[_0x12c790(0x1ba)](a4_0x370cfc[_0x12c790(0x18b)](_0x12c790(0x1a6)+_0x4ce51d[_0x12c790(0x19e)]+'\x22:\x20'+_0x4ce51d['error']));}for(const _0x3533b0 of _0x20aca6[_0x12c790(0x14d)]){_0x3533b0[_0x12c790(0x189)]===_0x12c790(0x16d)&&console[_0x12c790(0x1ba)](a4_0x370cfc[_0x12c790(0x18b)](_0x12c790(0x152)+_0x3533b0[_0x12c790(0x19e)]+_0x12c790(0x16b)+_0x3533b0[_0x12c790(0x16d)]));}for(const _0x2ae860 of _0x20aca6[_0x12c790(0x1ad)]){_0x2ae860[_0x12c790(0x189)]===_0x12c790(0x16d)&&console[_0x12c790(0x1ba)](a4_0x370cfc['red'](_0x12c790(0x196)+_0x2ae860[_0x12c790(0x19e)]+_0x12c790(0x16b)+_0x2ae860[_0x12c790(0x16d)]));}for(const _0x16327c of _0x20aca6['experimentalKnowledgeBases']){_0x16327c[_0x12c790(0x189)]===_0x12c790(0x16d)&&console[_0x12c790(0x1ba)](a4_0x370cfc['red'](_0x12c790(0x13e)+_0x16327c['name']+_0x12c790(0x16b)+_0x16327c['error']));}for(const _0x38222c of _0x20aca6[_0x12c790(0x1a0)]){_0x38222c[_0x12c790(0x189)]==='error'&&console[_0x12c790(0x1ba)](a4_0x370cfc[_0x12c790(0x18b)](_0x12c790(0x1c3)+_0x38222c[_0x12c790(0x19e)]+'\x22:\x20'+_0x38222c['error']));}return 0x1;}console[_0x12c790(0x1ba)]();const _0x3c4b73=getLLMProjectUrl(_0x174417,_0x20aca6['newProjectId']);return console[_0x12c790(0x1ba)](_0x12c790(0x14b)+a4_0x370cfc[_0x12c790(0x14e)](_0x3c4b73)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x49f1e9(0x19e)]=a4_0x49f1e9(0x155);['description']='Push\x20local\x20agent\x20files\x20to\x20LLM\x20project';async[a4_0x49f1e9(0x172)](_0xc74499){const _0x4cd28e=a4_0x49f1e9,{options:_0x4aa071,args:_0x9aedb9,tdx:_0x17848b}=_0xc74499;let _0x413684=_0x9aedb9[0x0]||process[_0x4cd28e(0x194)]();const _0x484c66=_0x4aa071[_0x4cd28e(0x188)],_0x4b9c1f=_0x4aa071[_0x4cd28e(0x183)],_0x5e5b98=_0x4aa071['yes'],_0x3d1269=_0x4aa071['site'],_0x229337=a4_0xdab3b3[_0x4cd28e(0x174)](_0x413684,'agent.yml'),_0xaba77e=existsSync(_0x229337);if(_0xaba77e){const {data:_0x4dedcb}=await withSpinner(_0x4cd28e(0x1b3)+_0x413684+_0x4cd28e(0x18c),()=>_0x17848b[_0x4cd28e(0x133)][_0x4cd28e(0x181)](_0x413684,{'dryRun':_0x484c66,'force':_0x4b9c1f}));if(_0x484c66)return console[_0x4cd28e(0x1ba)](a4_0x370cfc['yellow'](_0x4cd28e(0x141))),console[_0x4cd28e(0x1ba)]('Would\x20push\x20agent:\x20'+_0x4dedcb['agentName']),0x0;if(_0x4dedcb[_0x4cd28e(0x189)]===_0x4cd28e(0x16d))return console[_0x4cd28e(0x1ba)](a4_0x370cfc['red'](_0x4cd28e(0x1c4)+_0x4dedcb['error'])),0x1;console[_0x4cd28e(0x1ba)](a4_0x370cfc['green'](_0x4cd28e(0x18e)+_0x4dedcb[_0x4cd28e(0x189)]+_0x4cd28e(0x17b))),console[_0x4cd28e(0x1ba)](_0x4cd28e(0x198)+_0x4dedcb[_0x4cd28e(0x153)]);if(_0x4dedcb[_0x4cd28e(0x185)]&&_0x4dedcb['projectId']){const _0x74bab0=getLLMAgentChatUrl(_0x3d1269,_0x4dedcb['projectId'],_0x4dedcb[_0x4cd28e(0x185)]);console[_0x4cd28e(0x1ba)](_0x4cd28e(0x157)+a4_0x370cfc[_0x4cd28e(0x14e)](_0x74bab0));}return 0x0;}const _0x24cd75=_0x4aa071[_0x4cd28e(0x15f)],_0x42d0c3=resolveProjectFromContext(_0x413684,_0x24cd75);if(_0x42d0c3['found'])_0x413684=_0x42d0c3[_0x4cd28e(0x17f)],_0x42d0c3[_0x4cd28e(0x1a3)]===_0x4cd28e(0x1a4)&&console[_0x4cd28e(0x1ba)](a4_0x370cfc[_0x4cd28e(0x1bc)](_0x4cd28e(0x150)+_0x413684));else{let _0x3d8c4b='Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.';_0x42d0c3[_0x4cd28e(0x13a)]==='no_local_folder'&&(_0x3d8c4b=_0x42d0c3[_0x4cd28e(0x13d)]+_0x4cd28e(0x139)+_0x42d0c3['llmProject']+_0x4cd28e(0x171));throw new SDKError(ErrorCode[_0x4cd28e(0x12d)],_0x42d0c3[_0x4cd28e(0x13a)]===_0x4cd28e(0x1b7)?_0x42d0c3[_0x4cd28e(0x13d)]:_0x4cd28e(0x15a)+_0x413684,undefined,{'helpText':_0x3d8c4b});}const {data:_0x337800}=await withSpinner(_0x4cd28e(0x129),()=>_0x17848b[_0x4cd28e(0x133)][_0x4cd28e(0x12e)](_0x413684,{'dryRun':!![]})),_0x65d6c9=_0x337800['counts']['agents'][_0x4cd28e(0x1c1)]>0x0;if(_0x65d6c9){console[_0x4cd28e(0x1ba)](a4_0x370cfc[_0x4cd28e(0x18b)](_0x4cd28e(0x1b6)));for(const _0x261d6f of _0x337800[_0x4cd28e(0x15c)]){_0x261d6f[_0x4cd28e(0x189)]===_0x4cd28e(0x16d)&&console[_0x4cd28e(0x1ba)](a4_0x370cfc[_0x4cd28e(0x18b)](_0x4cd28e(0x144)+_0x261d6f[_0x4cd28e(0x153)]+_0x4cd28e(0x16b)+_0x261d6f[_0x4cd28e(0x16d)]));}return 0x1;}const _0x54eb13=_0x337800[_0x4cd28e(0x193)][_0x4cd28e(0x15c)]['created']+_0x337800[_0x4cd28e(0x193)][_0x4cd28e(0x1b2)][_0x4cd28e(0x1bb)]+_0x337800[_0x4cd28e(0x193)][_0x4cd28e(0x12b)][_0x4cd28e(0x1bb)]+_0x337800['counts']['prompts'][_0x4cd28e(0x1bb)]+_0x337800[_0x4cd28e(0x193)][_0x4cd28e(0x1ad)]['created']+_0x337800[_0x4cd28e(0x193)]['experimentalKnowledgeBases']['created']+_0x337800[_0x4cd28e(0x193)][_0x4cd28e(0x1a0)][_0x4cd28e(0x1bb)],_0x4eb015=_0x337800[_0x4cd28e(0x193)][_0x4cd28e(0x15c)]['updated']+_0x337800[_0x4cd28e(0x193)][_0x4cd28e(0x1b2)][_0x4cd28e(0x1a9)]+_0x337800[_0x4cd28e(0x193)][_0x4cd28e(0x12b)]['updated']+_0x337800[_0x4cd28e(0x193)][_0x4cd28e(0x14d)][_0x4cd28e(0x1a9)]+_0x337800[_0x4cd28e(0x193)][_0x4cd28e(0x1ad)][_0x4cd28e(0x1a9)]+_0x337800[_0x4cd28e(0x193)][_0x4cd28e(0x1c6)][_0x4cd28e(0x1a9)]+_0x337800['counts']['experimentalArtifacts']['updated'],_0x173d70=_0x337800[_0x4cd28e(0x193)]['agents'][_0x4cd28e(0x17c)]+_0x337800['counts'][_0x4cd28e(0x1b2)][_0x4cd28e(0x17c)]+_0x337800['counts'][_0x4cd28e(0x12b)][_0x4cd28e(0x17c)]+_0x337800[_0x4cd28e(0x193)][_0x4cd28e(0x14d)][_0x4cd28e(0x17c)]+_0x337800[_0x4cd28e(0x193)]['integrations'][_0x4cd28e(0x17c)]+_0x337800[_0x4cd28e(0x193)][_0x4cd28e(0x1c6)][_0x4cd28e(0x17c)]+_0x337800[_0x4cd28e(0x193)][_0x4cd28e(0x1a0)][_0x4cd28e(0x17c)];console['log']('\x0aPush\x20summary\x20for\x20\x27'+_0x337800[_0x4cd28e(0x16e)]+'\x27:'),console['log']('\x20\x20'+a4_0x370cfc['green']('+\x20'+_0x54eb13+_0x4cd28e(0x180))+_0x4cd28e(0x1a1)+a4_0x370cfc[_0x4cd28e(0x1ab)]('~\x20'+_0x4eb015+'\x20changed')+_0x4cd28e(0x1a1)+a4_0x370cfc[_0x4cd28e(0x1bc)]('=\x20'+_0x173d70+_0x4cd28e(0x1d1))),console['log']('\x20\x20Agents:\x20'+formatCountSummary(_0x337800[_0x4cd28e(0x193)][_0x4cd28e(0x15c)])),console[_0x4cd28e(0x1ba)](_0x4cd28e(0x165)+formatCountSummary(_0x337800[_0x4cd28e(0x193)]['knowledgeBases'])),console[_0x4cd28e(0x1ba)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x337800[_0x4cd28e(0x193)][_0x4cd28e(0x12b)])),console[_0x4cd28e(0x1ba)](_0x4cd28e(0x192)+formatCountSummary(_0x337800['counts']['prompts'])),console[_0x4cd28e(0x1ba)](_0x4cd28e(0x1a8)+formatCountSummary(_0x337800[_0x4cd28e(0x193)][_0x4cd28e(0x1ad)]));const _0x1c3e24=_0x337800[_0x4cd28e(0x193)][_0x4cd28e(0x1c6)]['created']>0x0||_0x337800[_0x4cd28e(0x193)][_0x4cd28e(0x1c6)]['updated']>0x0||_0x337800['counts'][_0x4cd28e(0x1c6)][_0x4cd28e(0x17c)]>0x0||_0x337800[_0x4cd28e(0x193)][_0x4cd28e(0x1a0)]['created']>0x0||_0x337800['counts'][_0x4cd28e(0x1a0)][_0x4cd28e(0x1a9)]>0x0||_0x337800[_0x4cd28e(0x193)][_0x4cd28e(0x1a0)]['unchanged']>0x0;_0x1c3e24&&(console[_0x4cd28e(0x1ba)](_0x4cd28e(0x163)+formatCountSummary(_0x337800[_0x4cd28e(0x193)]['experimentalKnowledgeBases'])),console[_0x4cd28e(0x1ba)](_0x4cd28e(0x1b0)+formatCountSummary(_0x337800['counts'][_0x4cd28e(0x1a0)])));console['log']('\x20\x20Source:\x20'+a4_0x370cfc[_0x4cd28e(0x14e)](_0x413684)),displayDiffs(_0x337800[_0x4cd28e(0x15c)],_0x337800[_0x4cd28e(0x1b2)],_0x337800['textKnowledgeBases'],_0x337800[_0x4cd28e(0x14d)],_0x337800[_0x4cd28e(0x1ad)],_0x337800[_0x4cd28e(0x1c6)],_0x337800[_0x4cd28e(0x1a0)]);if(_0x484c66)return console[_0x4cd28e(0x1ba)](a4_0x370cfc[_0x4cd28e(0x1ab)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed')),0x0;if(_0x54eb13===0x0&&_0x4eb015===0x0){console[_0x4cd28e(0x1ba)](a4_0x370cfc['green']('\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date'));const _0x44424b=getLLMProjectUrl(_0x3d1269,_0x337800[_0x4cd28e(0x17d)]);return console[_0x4cd28e(0x1ba)](_0x4cd28e(0x14b)+a4_0x370cfc[_0x4cd28e(0x14e)](_0x44424b)),0x0;}if(!_0x5e5b98&&!_0x4b9c1f){if(!isInteractive())return console[_0x4cd28e(0x16d)](a4_0x370cfc[_0x4cd28e(0x18b)](_0x4cd28e(0x1c2)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x4cd28e(0x16d)](a4_0x370cfc[_0x4cd28e(0x1bc)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x3e1ed5=await confirmKey(_0x4cd28e(0x1c8)+(_0x54eb13+_0x4eb015)+_0x4cd28e(0x164));if(!_0x3e1ed5)return console[_0x4cd28e(0x1ba)](a4_0x370cfc[_0x4cd28e(0x1ab)](_0x4cd28e(0x197)),'-\x20nothing\x20pushed'),0x1;}const {data:_0x4b04f6}=await withSpinner(_0x4cd28e(0x173),()=>_0x17848b[_0x4cd28e(0x133)][_0x4cd28e(0x12e)](_0x413684,{'force':_0x4b9c1f})),_0x2d9967=_0x4b04f6[_0x4cd28e(0x193)][_0x4cd28e(0x15c)]['errors']>0x0||_0x4b04f6[_0x4cd28e(0x193)]['knowledgeBases'][_0x4cd28e(0x1c1)]>0x0||_0x4b04f6[_0x4cd28e(0x193)][_0x4cd28e(0x12b)]['errors']>0x0||_0x4b04f6['counts']['prompts'][_0x4cd28e(0x1c1)]>0x0;if(_0x2d9967){console['log'](a4_0x370cfc[_0x4cd28e(0x1ab)](_0x4cd28e(0x145))),console[_0x4cd28e(0x1ba)](),console[_0x4cd28e(0x1ba)](a4_0x370cfc[_0x4cd28e(0x18b)](_0x4cd28e(0x1ac)));for(const _0xf121ac of _0x4b04f6[_0x4cd28e(0x15c)]){_0xf121ac[_0x4cd28e(0x189)]==='error'&&console[_0x4cd28e(0x1ba)](a4_0x370cfc[_0x4cd28e(0x18b)]('\x20\x20Agent\x20\x22'+_0xf121ac[_0x4cd28e(0x153)]+'\x22:\x20'+_0xf121ac[_0x4cd28e(0x16d)]));}for(const _0x391b75 of _0x4b04f6[_0x4cd28e(0x1b2)]){_0x391b75[_0x4cd28e(0x189)]===_0x4cd28e(0x16d)&&console[_0x4cd28e(0x1ba)](a4_0x370cfc[_0x4cd28e(0x18b)](_0x4cd28e(0x1a6)+_0x391b75['name']+_0x4cd28e(0x16b)+_0x391b75[_0x4cd28e(0x16d)]));}for(const _0x59a0e6 of _0x4b04f6[_0x4cd28e(0x12b)]){_0x59a0e6[_0x4cd28e(0x189)]==='error'&&console[_0x4cd28e(0x1ba)](a4_0x370cfc['red'](_0x4cd28e(0x138)+_0x59a0e6[_0x4cd28e(0x19e)]+_0x4cd28e(0x16b)+_0x59a0e6[_0x4cd28e(0x16d)]));}for(const _0x5632a6 of _0x4b04f6[_0x4cd28e(0x14d)]){_0x5632a6[_0x4cd28e(0x189)]===_0x4cd28e(0x16d)&&console[_0x4cd28e(0x1ba)](a4_0x370cfc[_0x4cd28e(0x18b)](_0x4cd28e(0x152)+_0x5632a6['name']+_0x4cd28e(0x16b)+_0x5632a6[_0x4cd28e(0x16d)]));}for(const _0x2d8633 of _0x4b04f6[_0x4cd28e(0x1ad)]){_0x2d8633['action']==='error'&&console[_0x4cd28e(0x1ba)](a4_0x370cfc[_0x4cd28e(0x18b)]('\x20\x20Integration\x20\x22'+_0x2d8633[_0x4cd28e(0x19e)]+'\x22:\x20'+_0x2d8633[_0x4cd28e(0x16d)]));}return 0x1;}console[_0x4cd28e(0x1ba)](a4_0x370cfc[_0x4cd28e(0x134)](_0x4cd28e(0x15b)+(_0x54eb13+_0x4eb015)+'\x20resources\x20to\x20\x27'+_0x4b04f6[_0x4cd28e(0x16e)]+'\x27'));const _0x3ee9b9=getLLMProjectUrl(_0x3d1269,_0x4b04f6['projectId']);return console[_0x4cd28e(0x1ba)](_0x4cd28e(0x14b)+a4_0x370cfc[_0x4cd28e(0x14e)](_0x3ee9b9)),0x0;}}
1
+ const a4_0x601200=a4_0x1297;(function(_0x1e4344,_0x41d99a){const _0x446499=a4_0x1297,_0x24ac8b=_0x1e4344();while(!![]){try{const _0x3f33ec=-parseInt(_0x446499(0x105))/0x1+-parseInt(_0x446499(0x108))/0x2*(-parseInt(_0x446499(0x100))/0x3)+-parseInt(_0x446499(0x16b))/0x4*(-parseInt(_0x446499(0xe9))/0x5)+-parseInt(_0x446499(0xe5))/0x6*(parseInt(_0x446499(0x102))/0x7)+parseInt(_0x446499(0x118))/0x8+parseInt(_0x446499(0xd4))/0x9+-parseInt(_0x446499(0xba))/0xa*(parseInt(_0x446499(0x145))/0xb);if(_0x3f33ec===_0x41d99a)break;else _0x24ac8b['push'](_0x24ac8b['shift']());}catch(_0x542d86){_0x24ac8b['push'](_0x24ac8b['shift']());}}}(a4_0x3134,0x1970a));function a4_0x1297(_0x450cb1,_0xbe4519){_0x450cb1=_0x450cb1-0xb0;const _0x313403=a4_0x3134();let _0x129786=_0x313403[_0x450cb1];return _0x129786;}import a4_0x2b303b from'chalk';import a4_0xe8fa2f from'path';function a4_0x3134(){const _0x2987d6=['Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','cloneProject','updated','\x20--name\x20','reason','agentId','Project\x20cloned\x20successfully','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','Dry\x20run\x20-\x20no\x20changes\x20made','pushAgent','pushProject','\x20changed','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','cwd-config','diff','\x20\x20tdx\x20agent\x20pull\x20','\x20\x20Knowledge\x20Base\x20\x22','\x0a✔\x20Pulled\x20','Cancelled','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','Using\x20project\x20from\x20','agent:push','yellow','Pushing\x20to\x20project...','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','\x0aWrite\x20','Using\x20project:\x20','\x20\x20Experimental\x20Artifact\x20\x22','\x20\x20Agent\x20\x22','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','output','Dry\x20run\x20-\x20no\x20files\x20written','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','387937zekdbX','projectDir','\x0aPull\x20summary\x20for\x20\x27','\x20created','Source:\x20','-\x20no\x20files\x20written','\x20|\x20','\x20\x20Knowledge\x20Bases:\x20','context','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','source','Agent\x20','MISSING_ARGUMENT','\x20\x20tdx\x20agent\x20clone\x20agents/','\x0a✔\x20Pushed\x20','\x0aPush\x20','\x22\x20to\x20a\x20different\x20profile','agentName','Cannot\x20clone\x20from\x20context\x20project\x20\x22','session','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','arg-dir','pullAgent','Using\x20project\x20from\x20context:\x20','\x20\x20Prompts:\x20','\x20files?','\x20errors','✔\x20Context\x20set:\x20','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','\x20--profile\x20','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','name','\x22\x20to\x20new\x20project\x20\x22','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','utf-8','\x0aError:','textKnowledgeBases','87908AwBHJG','prompts','integrations','Output\x20path:\x20','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','log','<new-name>','agent','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','Status:\x20','Would\x20pull\x20agent:\x20','30EFgCKM','error','llmProject','tdx.json','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','\x20resources?','Clone\x20\x22','dim','\x20\x20Target:\x20','llm_project','New\x20project\x20name\x20is\x20required','site','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project','green','join','description','isNew','force','\x0aProject\x20pushed\x20with\x20errors','\x0aChanges\x20to\x20integration\x20\x27','created','\x20\x20Agents:\x20','\x20updated','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory','\x22\x20to\x20\x22','unchanged','446670bKfLdO','counts','\x20\x20Text\x20Knowledge\x20Base\x20\x22','Project\x20cloned\x20with\x20errors','agent.yml','No\x20tdx.json\x20found\x20in\x20','\x20resources\x20to\x20\x27','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','no_context','Failed\x20to\x20push\x20agent:\x20','experimentalArtifacts','new','Would\x20clone:','Pulling\x20agent\x20\x22','\x20=\x20','action','\x20\x20Prompt\x20\x22','919902YDUzgh','New\x20project:\x20','repeat','agent:pull','10GkkRrQ','\x20\x20Text\x20Knowledge\x20Bases:\x20','\x20files\x20to\x20','push','projectId','outputPath','dryRun','cwd','\x20new','\x0aChanges:','Agent:\x20','agent:clone','newProjectId','cyan','Project:\x20','knowledgeBases','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','\x20\x20Integrations:\x20','red','\x20\x20Integration\x20\x22','total','llm','12WljkkE','\x20\x20Experimental\x20Artifacts:\x20','7DdtYyU','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','execute','76281ODMcGg','yes','hasChanges','102636vXOjke','New\x20project\x20ID:\x20','agents','-\x20nothing\x20pushed','message','\x20total','gray','Output:\x20','Chat:\x20','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','\x22...','Using\x20local\x20project:\x20','projectName','Errors:','experimentalKnowledgeBases','profile','1125960XcjVVB','\x0aChanges\x20to\x20agent\x20\x27','dirname','errors','parse','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','\x22:\x20','sourceProjectName','Using\x20context\x20project:\x20','outputDir','INVALID_ARGUMENT'];a4_0x3134=function(){return _0x2987d6;};return a4_0x3134();}import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext,resolveAgentPullArgs}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x1b8ade){const _0x18adc7=a4_0x1297,_0x621797=[];if(_0x1b8ade[_0x18adc7(0xfe)]!==undefined)_0x621797[_0x18adc7(0xec)](_0x1b8ade[_0x18adc7(0xfe)]+_0x18adc7(0x10d));if(_0x1b8ade[_0x18adc7(0xdf)]!==undefined&&_0x1b8ade[_0x18adc7(0xdf)]>0x0)_0x621797[_0x18adc7(0xec)](a4_0x2b303b[_0x18adc7(0xc7)](_0x1b8ade[_0x18adc7(0xdf)]+_0x18adc7(0xf1)));if(_0x1b8ade[_0x18adc7(0xce)]!==undefined&&_0x1b8ade[_0x18adc7(0xce)]>0x0)_0x621797[_0x18adc7(0xec)](a4_0x2b303b[_0x18adc7(0xc7)](_0x1b8ade[_0x18adc7(0xce)]+_0x18adc7(0x148)));if(_0x1b8ade[_0x18adc7(0x126)]!==undefined&&_0x1b8ade[_0x18adc7(0x126)]>0x0)_0x621797['push'](a4_0x2b303b['yellow'](_0x1b8ade[_0x18adc7(0x126)]+_0x18adc7(0xd0)));if(_0x1b8ade[_0x18adc7(0xd3)]!==undefined&&_0x1b8ade[_0x18adc7(0xd3)]>0x0)_0x621797[_0x18adc7(0xec)](a4_0x2b303b[_0x18adc7(0x10e)](_0x1b8ade[_0x18adc7(0xd3)]+'\x20unchanged'));if(_0x1b8ade[_0x18adc7(0x11b)]!==undefined&&_0x1b8ade['errors']>0x0)_0x621797[_0x18adc7(0xec)](a4_0x2b303b['red'](_0x1b8ade[_0x18adc7(0x11b)]+_0x18adc7(0x160)));return _0x621797[_0x18adc7(0xc8)](',\x20');}function displayDiffs(_0x3c1701,_0x2bb363,_0x540645,_0x49dcdf,_0x43988e,_0x650d95,_0x4876ea){const _0x50a897=a4_0x1297;for(const _0x538fdf of _0x3c1701){if(_0x538fdf['diff']){const _0x524602=_0x538fdf[_0x50a897(0x156)]||_0x538fdf[_0x50a897(0x165)];console[_0x50a897(0xb4)](_0x50a897(0x119)+_0x524602+'\x27:'),console[_0x50a897(0xb4)]('─'[_0x50a897(0xe7)](0x3c)),console[_0x50a897(0xb4)](_0x538fdf[_0x50a897(0x132)]),console[_0x50a897(0xb4)]('─'[_0x50a897(0xe7)](0x3c));}}for(const _0xaed32f of _0x2bb363){_0xaed32f[_0x50a897(0x132)]&&(console['log']('\x0aChanges\x20to\x20knowledge\x20base\x20\x27'+_0xaed32f[_0x50a897(0x165)]+'\x27:'),console[_0x50a897(0xb4)]('─'[_0x50a897(0xe7)](0x3c)),console[_0x50a897(0xb4)](_0xaed32f['diff']),console['log']('─'[_0x50a897(0xe7)](0x3c)));}for(const _0x3511ed of _0x540645){_0x3511ed[_0x50a897(0x132)]&&(console[_0x50a897(0xb4)](_0x50a897(0x12b)+_0x3511ed[_0x50a897(0x165)]+'\x27:'),console['log']('─'[_0x50a897(0xe7)](0x3c)),console[_0x50a897(0xb4)](_0x3511ed[_0x50a897(0x132)]),console[_0x50a897(0xb4)]('─'['repeat'](0x3c)));}for(const _0x2c9368 of _0x49dcdf){_0x2c9368[_0x50a897(0x132)]&&(console[_0x50a897(0xb4)]('\x0aChanges\x20to\x20prompt\x20\x27'+_0x2c9368[_0x50a897(0x165)]+'\x27:'),console['log']('─'[_0x50a897(0xe7)](0x3c)),console[_0x50a897(0xb4)](_0x2c9368[_0x50a897(0x132)]),console['log']('─'[_0x50a897(0xe7)](0x3c)));}for(const _0x5e228c of _0x43988e){_0x5e228c[_0x50a897(0x132)]&&(console[_0x50a897(0xb4)](_0x50a897(0xcd)+_0x5e228c['name']+'\x27:'),console[_0x50a897(0xb4)]('─'[_0x50a897(0xe7)](0x3c)),console['log'](_0x5e228c['diff']),console[_0x50a897(0xb4)]('─'[_0x50a897(0xe7)](0x3c)));}for(const _0x4f62ec of _0x650d95){_0x4f62ec[_0x50a897(0x132)]&&(console[_0x50a897(0xb4)]('\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27'+_0x4f62ec[_0x50a897(0x165)]+'\x27:'),console[_0x50a897(0xb4)]('─'[_0x50a897(0xe7)](0x3c)),console['log'](_0x4f62ec[_0x50a897(0x132)]),console[_0x50a897(0xb4)]('─'['repeat'](0x3c)));}for(const _0x1ed7bc of _0x4876ea){_0x1ed7bc[_0x50a897(0x132)]&&(console[_0x50a897(0xb4)](_0x50a897(0xdb)+_0x1ed7bc['name']+'\x27:'),console[_0x50a897(0xb4)]('─'[_0x50a897(0xe7)](0x3c)),console[_0x50a897(0xb4)](_0x1ed7bc['diff']),console[_0x50a897(0xb4)]('─'['repeat'](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x601200(0x165)]=a4_0x601200(0xe8);[a4_0x601200(0xc9)]='Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files';async[a4_0x601200(0x104)](_0x5eb65b){const _0x288110=a4_0x601200,{options:_0x107e21,args:_0xc8e6a7,tdx:_0x583683}=_0x5eb65b,_0x3f36eb=_0xc8e6a7[0x0],_0x1d3f2e=_0xc8e6a7[0x1],_0x291846=_0x107e21[_0x288110(0x142)],_0x5631c5=_0x107e21['dryRun'],_0x4356ba=_0x107e21['force'],_0x2e4fca=_0x107e21['yes'],_0x8200d1=_0x107e21[_0x288110(0xbc)],_0x1dbe46=_0x107e21[_0x288110(0xb6)];let _0x28d24b;if(_0x3f36eb){const _0xd9fdd8=a4_0xe8fa2f[_0x288110(0xc8)](_0x3f36eb,_0x288110(0xbd));if(existsSync(_0xd9fdd8))try{const _0x52e15d=JSON[_0x288110(0x11c)](readFileSync(_0xd9fdd8,_0x288110(0x168)));_0x52e15d['llm_project']&&(_0x28d24b={'llm_project':_0x52e15d['llm_project']});}catch{}}const _0x143467=findAgentConfigPath(process[_0x288110(0xf0)]());let _0x22ec9c;if(_0x143467)try{const _0xca9784=JSON[_0x288110(0x11c)](readFileSync(_0x143467,_0x288110(0x168)));_0xca9784[_0x288110(0xc3)]&&(_0x22ec9c={'llm_project':_0xca9784[_0x288110(0xc3)]});}catch{}const _0x382d19=resolveAgentPullArgs({'arg':_0x3f36eb,'agentNameArg':_0x1d3f2e,'agentFlag':_0x1dbe46,'contextProject':_0x8200d1,'argDirConfig':_0x28d24b,'cwdConfigPath':_0x143467||undefined,'cwdConfig':_0x22ec9c}),{projectNameOrId:_0x361870,targetAgentName:_0x2dc2b4,existingOutputDir:_0x179572,source:_0x38af30}=_0x382d19;if(_0x38af30===_0x288110(0x15b))console['log'](a4_0x2b303b['dim'](_0x288110(0x138)+a4_0xe8fa2f[_0x288110(0xc8)](_0x3f36eb,_0x288110(0xbd))+':\x20'+_0x361870));else{if(_0x38af30===_0x288110(0x131))console[_0x288110(0xb4)](a4_0x2b303b[_0x288110(0xc1)](_0x288110(0x13e)+_0x361870));else _0x38af30===_0x288110(0x14d)&&console['log'](a4_0x2b303b[_0x288110(0xc1)](_0x288110(0x15d)+_0x361870));}if(!_0x361870)return _0x1dbe46?(console[_0x288110(0xb4)](a4_0x2b303b[_0x288110(0x13a)](_0x288110(0x159))),console[_0x288110(0xb4)]('Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>'),console[_0x288110(0xb4)](_0x288110(0x11d))):(console[_0x288110(0xb4)](a4_0x2b303b[_0x288110(0x13a)](_0x288110(0x111))),console['log']('Usage:\x20tdx\x20agent\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20project\x20(requires\x20context\x20or\x20tdx.json)'),console[_0x288110(0xb4)](_0x288110(0xc6)),console[_0x288110(0xb4)](_0x288110(0xd1)),console[_0x288110(0xb4)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20--agent\x20<name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20context\x20project'),console['log']('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20project')),0x1;if(_0x2dc2b4){const {data:_0x5f46c4}=await withSpinner(_0x288110(0xe1)+_0x2dc2b4+'\x22\x20from\x20project\x20\x22'+_0x361870+_0x288110(0x112),()=>_0x583683['llm'][_0x288110(0x15c)](_0x361870,_0x2dc2b4,_0x291846,{'dryRun':_0x5631c5,'force':_0x4356ba}));if(_0x5631c5)return console['log'](a4_0x2b303b[_0x288110(0x13a)](_0x288110(0x143))),console[_0x288110(0xb4)](_0x288110(0xb9)+_0x5f46c4[_0x288110(0x156)]),console[_0x288110(0xb4)](_0x288110(0xb2)+_0x5f46c4[_0x288110(0xee)]),_0x5f46c4[_0x288110(0x132)]&&(console[_0x288110(0xb4)](_0x288110(0xf2)),console[_0x288110(0xb4)]('─'[_0x288110(0xe7)](0x3c)),console[_0x288110(0xb4)](_0x5f46c4['diff']),console[_0x288110(0xb4)]('─'[_0x288110(0xe7)](0x3c))),0x0;return console[_0x288110(0xb4)](a4_0x2b303b[_0x288110(0xc7)]('Agent\x20pulled\x20successfully')),console[_0x288110(0xb4)](_0x288110(0xf3)+_0x5f46c4[_0x288110(0x156)]),console['log'](_0x288110(0x10f)+_0x5f46c4[_0x288110(0xee)]),console[_0x288110(0xb4)](_0x288110(0xb8)+(_0x5f46c4[_0x288110(0xca)]?a4_0x2b303b[_0x288110(0xc7)](_0x288110(0xdf)):_0x5f46c4[_0x288110(0x107)]?a4_0x2b303b['yellow'](_0x288110(0x126)):a4_0x2b303b['gray'](_0x288110(0xd3)))),0x0;}const _0x2fee21=_0x179572||_0x291846,{data:_0x302a34}=await withSpinner('Analyzing\x20project\x20\x22'+_0x361870+_0x288110(0x112),()=>_0x583683['llm']['pullProject'](_0x361870,_0x2fee21,{'dryRun':!![]})),_0x1e9983=_0x302a34[_0x288110(0xd5)][_0x288110(0x10a)][_0x288110(0xdf)]+_0x302a34[_0x288110(0xd5)]['knowledgeBases'][_0x288110(0xdf)]+_0x302a34['counts'][_0x288110(0x16a)][_0x288110(0xdf)]+_0x302a34[_0x288110(0xd5)][_0x288110(0xb0)]['new']+_0x302a34[_0x288110(0xd5)]['integrations'][_0x288110(0xdf)]+_0x302a34[_0x288110(0xd5)][_0x288110(0x116)][_0x288110(0xdf)]+_0x302a34[_0x288110(0xd5)][_0x288110(0xde)]['new'],_0x5c4e1d=_0x302a34['counts'][_0x288110(0x10a)][_0x288110(0x126)]+_0x302a34[_0x288110(0xd5)][_0x288110(0xf8)][_0x288110(0x126)]+_0x302a34[_0x288110(0xd5)][_0x288110(0x16a)]['updated']+_0x302a34['counts']['prompts'][_0x288110(0x126)]+_0x302a34['counts'][_0x288110(0xb1)][_0x288110(0x126)]+_0x302a34[_0x288110(0xd5)]['experimentalKnowledgeBases']['updated']+_0x302a34['counts'][_0x288110(0xde)][_0x288110(0x126)],_0x1319e6=_0x302a34[_0x288110(0xd5)][_0x288110(0x10a)][_0x288110(0xd3)]+_0x302a34[_0x288110(0xd5)][_0x288110(0xf8)][_0x288110(0xd3)]+_0x302a34[_0x288110(0xd5)][_0x288110(0x16a)]['unchanged']+_0x302a34['counts'][_0x288110(0xb0)][_0x288110(0xd3)]+_0x302a34[_0x288110(0xd5)]['integrations'][_0x288110(0xd3)]+_0x302a34['counts'][_0x288110(0x116)]['unchanged']+_0x302a34[_0x288110(0xd5)][_0x288110(0xde)]['unchanged'];console[_0x288110(0xb4)](_0x288110(0x147)+_0x302a34[_0x288110(0x114)]+'\x27:'),console[_0x288110(0xb4)]('\x20\x20'+a4_0x2b303b[_0x288110(0xc7)]('+\x20'+_0x1e9983+'\x20new')+_0x288110(0x14b)+a4_0x2b303b[_0x288110(0x13a)]('~\x20'+_0x5c4e1d+_0x288110(0x12f))+_0x288110(0x14b)+a4_0x2b303b[_0x288110(0xc1)]('=\x20'+_0x1319e6+'\x20unchanged')),console['log'](_0x288110(0xcf)+formatCountSummary(_0x302a34[_0x288110(0xd5)]['agents'])),console[_0x288110(0xb4)](_0x288110(0x14c)+formatCountSummary(_0x302a34[_0x288110(0xd5)][_0x288110(0xf8)])),console[_0x288110(0xb4)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x302a34[_0x288110(0xd5)][_0x288110(0x16a)])),console[_0x288110(0xb4)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x302a34[_0x288110(0xd5)][_0x288110(0xb0)])),console[_0x288110(0xb4)](_0x288110(0xfb)+formatCountSummary(_0x302a34[_0x288110(0xd5)][_0x288110(0xb1)]));const _0x23bf14=_0x302a34[_0x288110(0xd5)]['experimentalKnowledgeBases'][_0x288110(0xfe)]>0x0||_0x302a34[_0x288110(0xd5)][_0x288110(0xde)]['total']>0x0;_0x23bf14&&(console['log']('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x302a34[_0x288110(0xd5)][_0x288110(0x116)])),console['log'](_0x288110(0x101)+formatCountSummary(_0x302a34['counts']['experimentalArtifacts'])));console[_0x288110(0xb4)](_0x288110(0xc2)+a4_0x2b303b[_0x288110(0xf6)](_0x302a34[_0x288110(0x121)])),displayDiffs(_0x302a34[_0x288110(0x10a)],_0x302a34['knowledgeBases'],_0x302a34[_0x288110(0x16a)],_0x302a34['prompts'],_0x302a34['integrations'],_0x302a34[_0x288110(0x116)],_0x302a34[_0x288110(0xde)]);if(_0x5631c5)return console[_0x288110(0xb4)](a4_0x2b303b['yellow'](_0x288110(0x162))),0x0;if(_0x1e9983===0x0&&_0x5c4e1d===0x0)return console[_0x288110(0xb4)](a4_0x2b303b[_0x288110(0xc7)](_0x288110(0xbe))),saveSessionContext({'llm_project':_0x302a34[_0x288110(0x114)]},_0x107e21[_0x288110(0x158)]),console['log'](a4_0x2b303b[_0x288110(0xc7)](_0x288110(0x161)+a4_0x2b303b[_0x288110(0xc1)]('llm_project')+_0x288110(0xe2)+a4_0x2b303b[_0x288110(0xf6)](_0x302a34[_0x288110(0x114)]))),0x0;if(!_0x2e4fca&&!_0x4356ba){if(!isInteractive())return console[_0x288110(0xbb)](a4_0x2b303b[_0x288110(0xfc)](_0x288110(0x169)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x288110(0xbb)](a4_0x2b303b[_0x288110(0xc1)](_0x288110(0x14e))),0x1;const _0x372669=await confirmKey(_0x288110(0x13d)+(_0x1e9983+_0x5c4e1d)+_0x288110(0x15f));if(!_0x372669)return console[_0x288110(0xb4)](a4_0x2b303b[_0x288110(0x13a)](_0x288110(0x136)),_0x288110(0x14a)),0x1;}const {data:_0x3ca051}=await withSpinner('Writing\x20files...',()=>_0x583683[_0x288110(0xff)]['pullProject'](_0x361870,_0x2fee21,{'force':_0x4356ba}));return console[_0x288110(0xb4)](a4_0x2b303b[_0x288110(0xc7)](_0x288110(0x135)+(_0x1e9983+_0x5c4e1d)+_0x288110(0xeb)+_0x3ca051[_0x288110(0x121)])),saveSessionContext({'llm_project':_0x3ca051[_0x288110(0x114)]},_0x107e21[_0x288110(0x158)]),console[_0x288110(0xb4)](a4_0x2b303b[_0x288110(0xc7)]('✔\x20Context\x20set:\x20'+a4_0x2b303b[_0x288110(0xc1)]('llm_project')+_0x288110(0xe2)+a4_0x2b303b['cyan'](_0x3ca051[_0x288110(0x114)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x601200(0x165)]=a4_0x601200(0xf4);[a4_0x601200(0xc9)]=a4_0x601200(0xb7);async[a4_0x601200(0x104)](_0x327271){const _0x752529=a4_0x601200,{options:_0x47afcd,args:_0x1518aa,tdx:_0x103842}=_0x327271,_0x3c2f41=_0x1518aa[0x0],_0x54abcb=_0x47afcd[_0x752529(0x165)],_0x37cf96=_0x47afcd['dryRun'],_0x4f4f50=_0x47afcd[_0x752529(0x106)],_0x13c5b6=_0x47afcd[_0x752529(0xc5)],_0xf84414=_0x47afcd[_0x752529(0xbc)];let _0x4f15ba;const _0x542d57=findAgentConfigPath(process[_0x752529(0xf0)]());if(_0x3c2f41){const _0x3eec7e=a4_0xe8fa2f[_0x752529(0xc8)](_0x3c2f41,'tdx.json');existsSync(_0x3eec7e)?(_0x4f15ba=_0x3c2f41,console[_0x752529(0xb4)](a4_0x2b303b[_0x752529(0xc1)](_0x752529(0x113)+_0x3c2f41))):_0x4f15ba=_0x3c2f41;}else{if(_0x542d57)_0x4f15ba=a4_0xe8fa2f[_0x752529(0x11a)](_0x542d57),console[_0x752529(0xb4)](a4_0x2b303b[_0x752529(0xc1)]('Using\x20current\x20project:\x20'+_0x4f15ba));else{if(_0xf84414){const _0x1b76a3=sanitizeForFilesystem(_0xf84414);let _0x14eb81=_0x1b76a3,_0x298628=a4_0xe8fa2f['join'](process[_0x752529(0xf0)](),_0x752529(0x10a),_0x1b76a3,'tdx.json');if(!existsSync(_0x298628)){const _0x229c9e=normalizeName(_0xf84414),_0x5b00b6=a4_0xe8fa2f['join'](process[_0x752529(0xf0)](),_0x752529(0x10a),_0x229c9e,'tdx.json');existsSync(_0x5b00b6)&&(_0x14eb81=_0x229c9e,_0x298628=_0x5b00b6);}if(existsSync(_0x298628))_0x4f15ba=a4_0xe8fa2f['dirname'](_0x298628),console[_0x752529(0xb4)](a4_0x2b303b[_0x752529(0xc1)](_0x752529(0x113)+_0x4f15ba));else{const _0xc76242=_0x47afcd[_0x752529(0x117)];if(_0xc76242)throw new SDKError(ErrorCode[_0x752529(0x122)],_0x752529(0x157)+_0xf84414+_0x752529(0x155),undefined,{'helpText':_0x752529(0x130)+_0x752529(0xb3)+(_0x752529(0x133)+_0xf84414+'\x0a')+(_0x752529(0x152)+_0x14eb81+_0x752529(0x127)+(_0x54abcb||_0x752529(0xb5))+_0x752529(0x163)+_0xc76242)});_0x4f15ba=_0xf84414,console[_0x752529(0xb4)](a4_0x2b303b[_0x752529(0xc1)](_0x752529(0x120)+_0xf84414));}}}}if(!_0x4f15ba)return console[_0x752529(0xb4)](a4_0x2b303b[_0x752529(0x13a)](_0x752529(0x103))),console['log'](_0x752529(0x137)),console['log'](_0x752529(0x167)),console[_0x752529(0xb4)]('\x20\x20tdx\x20agent\x20clone\x20--name\x20<new-name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clone\x20from\x20context\x20(llm_project)'),console['log'](_0x752529(0x15a)),0x1;if(!_0x54abcb)throw new SDKError(ErrorCode[_0x752529(0x151)],_0x752529(0xc4),undefined,{'helpText':_0x752529(0x123)});if(!_0x4f4f50&&!_0x37cf96){if(!isInteractive())return console[_0x752529(0xbb)](a4_0x2b303b['red'](_0x752529(0x169)),_0x752529(0x144)),console['error'](a4_0x2b303b[_0x752529(0xc1)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x1dea9a=await confirmKey(_0x752529(0xc0)+_0x4f15ba+_0x752529(0x166)+_0x54abcb+'\x22?');if(!_0x1dea9a)return console[_0x752529(0xb4)](a4_0x2b303b['yellow'](_0x752529(0x136))),0x1;}const {data:_0x51e613}=await withSpinner('Cloning\x20\x22'+_0x4f15ba+_0x752529(0xd2)+_0x54abcb+_0x752529(0x112),()=>_0x103842[_0x752529(0xff)][_0x752529(0x125)](_0x4f15ba,_0x54abcb,{'dryRun':_0x37cf96}));if(_0x37cf96){console[_0x752529(0xb4)](a4_0x2b303b[_0x752529(0x13a)](_0x752529(0x12c))),console['log']('Source:\x20'+_0x51e613[_0x752529(0x11f)]),console[_0x752529(0xb4)](_0x752529(0xe6)+_0x54abcb),console['log'](_0x752529(0xe0)),console[_0x752529(0xb4)](_0x752529(0xcf)+_0x51e613[_0x752529(0xd5)][_0x752529(0x10a)][_0x752529(0xce)]),console['log'](_0x752529(0x14c)+_0x51e613[_0x752529(0xd5)][_0x752529(0xf8)][_0x752529(0xce)]),console[_0x752529(0xb4)]('\x20\x20Prompts:\x20'+_0x51e613[_0x752529(0xd5)][_0x752529(0xb0)][_0x752529(0xce)]);const _0x40e690=_0x51e613[_0x752529(0xd5)][_0x752529(0x116)]['created']>0x0||_0x51e613[_0x752529(0xd5)][_0x752529(0xde)]['created']>0x0;return _0x40e690&&(console[_0x752529(0xb4)](_0x752529(0xf9)+_0x51e613['counts'][_0x752529(0x116)][_0x752529(0xce)]),console['log'](_0x752529(0x101)+_0x51e613['counts'][_0x752529(0xde)][_0x752529(0xce)])),0x0;}const _0x24b165=_0x51e613[_0x752529(0xd5)][_0x752529(0x10a)][_0x752529(0x11b)]>0x0||_0x51e613[_0x752529(0xd5)][_0x752529(0xf8)][_0x752529(0x11b)]>0x0||_0x51e613['counts'][_0x752529(0xb0)][_0x752529(0x11b)]>0x0||_0x51e613[_0x752529(0xd5)][_0x752529(0x116)]['errors']>0x0||_0x51e613[_0x752529(0xd5)][_0x752529(0xde)]['errors']>0x0;_0x24b165?console[_0x752529(0xb4)](a4_0x2b303b['yellow'](_0x752529(0xd7))):console[_0x752529(0xb4)](a4_0x2b303b[_0x752529(0xc7)](_0x752529(0x12a)));console['log'](_0x752529(0x149)+_0x51e613[_0x752529(0x11f)]),console[_0x752529(0xb4)](_0x752529(0xe6)+_0x51e613['newProjectName']),console[_0x752529(0xb4)](_0x752529(0x109)+_0x51e613['newProjectId']),console[_0x752529(0xb4)](),console['log']('Summary:'),console['log']('\x20\x20Agents:\x20'+formatCountSummary(_0x51e613[_0x752529(0xd5)][_0x752529(0x10a)])),console[_0x752529(0xb4)](_0x752529(0x14c)+formatCountSummary(_0x51e613[_0x752529(0xd5)][_0x752529(0xf8)])),console[_0x752529(0xb4)](_0x752529(0x15e)+formatCountSummary(_0x51e613[_0x752529(0xd5)][_0x752529(0xb0)])),console['log'](_0x752529(0xfb)+formatCountSummary(_0x51e613[_0x752529(0xd5)]['integrations']));const _0x127b3f=_0x51e613['counts']['experimentalKnowledgeBases'][_0x752529(0xce)]>0x0||_0x51e613['counts']['experimentalKnowledgeBases'][_0x752529(0x126)]>0x0||_0x51e613[_0x752529(0xd5)][_0x752529(0x116)]['unchanged']>0x0||_0x51e613[_0x752529(0xd5)][_0x752529(0xde)][_0x752529(0xce)]>0x0||_0x51e613[_0x752529(0xd5)]['experimentalArtifacts'][_0x752529(0x126)]>0x0||_0x51e613[_0x752529(0xd5)][_0x752529(0xde)][_0x752529(0xd3)]>0x0;_0x127b3f&&(console[_0x752529(0xb4)](_0x752529(0xf9)+formatCountSummary(_0x51e613['counts'][_0x752529(0x116)])),console[_0x752529(0xb4)](_0x752529(0x101)+formatCountSummary(_0x51e613[_0x752529(0xd5)]['experimentalArtifacts'])));if(_0x24b165){console[_0x752529(0xb4)](),console[_0x752529(0xb4)](a4_0x2b303b['red'](_0x752529(0x115)));for(const _0x43f9d7 of _0x51e613[_0x752529(0x10a)]){_0x43f9d7[_0x752529(0xe3)]===_0x752529(0xbb)&&console[_0x752529(0xb4)](a4_0x2b303b[_0x752529(0xfc)](_0x752529(0x140)+_0x43f9d7[_0x752529(0x156)]+_0x752529(0x11e)+_0x43f9d7[_0x752529(0xbb)]));}for(const _0x3b7cb8 of _0x51e613['knowledgeBases']){_0x3b7cb8['action']==='error'&&console[_0x752529(0xb4)](a4_0x2b303b[_0x752529(0xfc)]('\x20\x20Knowledge\x20Base\x20\x22'+_0x3b7cb8['name']+_0x752529(0x11e)+_0x3b7cb8[_0x752529(0xbb)]));}for(const _0x5887d5 of _0x51e613[_0x752529(0xb0)]){_0x5887d5['action']==='error'&&console['log'](a4_0x2b303b[_0x752529(0xfc)]('\x20\x20Prompt\x20\x22'+_0x5887d5[_0x752529(0x165)]+_0x752529(0x11e)+_0x5887d5['error']));}for(const _0x7a1e91 of _0x51e613[_0x752529(0xb1)]){_0x7a1e91['action']===_0x752529(0xbb)&&console[_0x752529(0xb4)](a4_0x2b303b[_0x752529(0xfc)](_0x752529(0xfd)+_0x7a1e91[_0x752529(0x165)]+_0x752529(0x11e)+_0x7a1e91[_0x752529(0xbb)]));}for(const _0x3f6ecc of _0x51e613[_0x752529(0x116)]){_0x3f6ecc[_0x752529(0xe3)]===_0x752529(0xbb)&&console[_0x752529(0xb4)](a4_0x2b303b[_0x752529(0xfc)](_0x752529(0xfa)+_0x3f6ecc[_0x752529(0x165)]+_0x752529(0x11e)+_0x3f6ecc['error']));}for(const _0x4233a1 of _0x51e613[_0x752529(0xde)]){_0x4233a1[_0x752529(0xe3)]===_0x752529(0xbb)&&console[_0x752529(0xb4)](a4_0x2b303b[_0x752529(0xfc)](_0x752529(0x13f)+_0x4233a1[_0x752529(0x165)]+_0x752529(0x11e)+_0x4233a1['error']));}return 0x1;}console[_0x752529(0xb4)]();const _0xcf5265=getLLMProjectUrl(_0x13c5b6,_0x51e613[_0x752529(0xf5)]);return console[_0x752529(0xb4)](_0x752529(0xf7)+a4_0x2b303b[_0x752529(0xf6)](_0xcf5265)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x601200(0x165)]=a4_0x601200(0x139);[a4_0x601200(0xc9)]=a4_0x601200(0x164);async[a4_0x601200(0x104)](_0x18c00f){const _0x395f8e=a4_0x601200,{options:_0x2be765,args:_0xafe6ca,tdx:_0x3216d8}=_0x18c00f;let _0x19bcee=_0xafe6ca[0x0]||process[_0x395f8e(0xf0)]();const _0x2baf17=_0x2be765[_0x395f8e(0xef)],_0x1e38fe=_0x2be765[_0x395f8e(0xcb)],_0x2b6dc2=_0x2be765[_0x395f8e(0x106)],_0x391e49=_0x2be765[_0x395f8e(0xc5)],_0x10c0c5=a4_0xe8fa2f['join'](_0x19bcee,_0x395f8e(0xd8)),_0x34b3a5=existsSync(_0x10c0c5);if(_0x34b3a5){const {data:_0x1308be}=await withSpinner('Pushing\x20agent\x20from\x20\x22'+_0x19bcee+_0x395f8e(0x112),()=>_0x3216d8[_0x395f8e(0xff)][_0x395f8e(0x12d)](_0x19bcee,{'dryRun':_0x2baf17,'force':_0x1e38fe}));if(_0x2baf17)return console['log'](a4_0x2b303b['yellow'](_0x395f8e(0x12c))),console[_0x395f8e(0xb4)]('Would\x20push\x20agent:\x20'+_0x1308be[_0x395f8e(0x156)]),0x0;if(_0x1308be[_0x395f8e(0xe3)]===_0x395f8e(0xbb))return console[_0x395f8e(0xb4)](a4_0x2b303b['red'](_0x395f8e(0xdd)+_0x1308be['error'])),0x1;console[_0x395f8e(0xb4)](a4_0x2b303b[_0x395f8e(0xc7)](_0x395f8e(0x150)+_0x1308be[_0x395f8e(0xe3)]+'\x20successfully')),console[_0x395f8e(0xb4)]('Agent:\x20'+_0x1308be[_0x395f8e(0x156)]);if(_0x1308be[_0x395f8e(0x129)]&&_0x1308be[_0x395f8e(0xed)]){const _0x5efd28=getLLMAgentChatUrl(_0x391e49,_0x1308be[_0x395f8e(0xed)],_0x1308be[_0x395f8e(0x129)]);console[_0x395f8e(0xb4)](_0x395f8e(0x110)+a4_0x2b303b[_0x395f8e(0xf6)](_0x5efd28));}return 0x0;}const _0x1153f4=_0x2be765[_0x395f8e(0xbc)],_0x3b7cc=resolveProjectFromContext(_0x19bcee,_0x1153f4);if(_0x3b7cc['found'])_0x19bcee=_0x3b7cc[_0x395f8e(0x146)],_0x3b7cc[_0x395f8e(0x14f)]===_0x395f8e(0x14d)&&console[_0x395f8e(0xb4)](a4_0x2b303b[_0x395f8e(0xc1)](_0x395f8e(0x13e)+_0x19bcee));else{let _0x425a81=_0x395f8e(0x13c);_0x3b7cc['reason']==='no_local_folder'&&(_0x425a81=_0x3b7cc[_0x395f8e(0x10c)]+_0x395f8e(0x124)+_0x3b7cc[_0x395f8e(0xbc)]+'\x27\x20to\x20create\x20the\x20folder\x20structure.');throw new SDKError(ErrorCode[_0x395f8e(0x122)],_0x3b7cc[_0x395f8e(0x128)]===_0x395f8e(0xdc)?_0x3b7cc[_0x395f8e(0x10c)]:_0x395f8e(0xd9)+_0x19bcee,undefined,{'helpText':_0x425a81});}const {data:_0x9bd05f}=await withSpinner('Analyzing\x20changes\x20to\x20push...',()=>_0x3216d8[_0x395f8e(0xff)][_0x395f8e(0x12e)](_0x19bcee,{'dryRun':!![]})),_0x3196aa=_0x9bd05f[_0x395f8e(0xd5)][_0x395f8e(0x10a)]['errors']>0x0;if(_0x3196aa){console[_0x395f8e(0xb4)](a4_0x2b303b[_0x395f8e(0xfc)]('\x0aErrors\x20found:'));for(const _0x4ef963 of _0x9bd05f[_0x395f8e(0x10a)]){_0x4ef963[_0x395f8e(0xe3)]===_0x395f8e(0xbb)&&console[_0x395f8e(0xb4)](a4_0x2b303b[_0x395f8e(0xfc)](_0x395f8e(0x140)+_0x4ef963[_0x395f8e(0x156)]+_0x395f8e(0x11e)+_0x4ef963[_0x395f8e(0xbb)]));}return 0x1;}const _0x4f8897=_0x9bd05f['counts'][_0x395f8e(0x10a)]['created']+_0x9bd05f[_0x395f8e(0xd5)][_0x395f8e(0xf8)][_0x395f8e(0xce)]+_0x9bd05f[_0x395f8e(0xd5)][_0x395f8e(0x16a)][_0x395f8e(0xce)]+_0x9bd05f[_0x395f8e(0xd5)]['prompts'][_0x395f8e(0xce)]+_0x9bd05f[_0x395f8e(0xd5)][_0x395f8e(0xb1)][_0x395f8e(0xce)]+_0x9bd05f[_0x395f8e(0xd5)][_0x395f8e(0x116)][_0x395f8e(0xce)]+_0x9bd05f[_0x395f8e(0xd5)]['experimentalArtifacts'][_0x395f8e(0xce)],_0x154138=_0x9bd05f[_0x395f8e(0xd5)]['agents'][_0x395f8e(0x126)]+_0x9bd05f['counts'][_0x395f8e(0xf8)][_0x395f8e(0x126)]+_0x9bd05f[_0x395f8e(0xd5)][_0x395f8e(0x16a)][_0x395f8e(0x126)]+_0x9bd05f[_0x395f8e(0xd5)]['prompts'][_0x395f8e(0x126)]+_0x9bd05f[_0x395f8e(0xd5)][_0x395f8e(0xb1)][_0x395f8e(0x126)]+_0x9bd05f[_0x395f8e(0xd5)]['experimentalKnowledgeBases'][_0x395f8e(0x126)]+_0x9bd05f[_0x395f8e(0xd5)][_0x395f8e(0xde)][_0x395f8e(0x126)],_0x17c47f=_0x9bd05f[_0x395f8e(0xd5)]['agents']['unchanged']+_0x9bd05f['counts'][_0x395f8e(0xf8)][_0x395f8e(0xd3)]+_0x9bd05f['counts'][_0x395f8e(0x16a)]['unchanged']+_0x9bd05f[_0x395f8e(0xd5)][_0x395f8e(0xb0)][_0x395f8e(0xd3)]+_0x9bd05f[_0x395f8e(0xd5)]['integrations']['unchanged']+_0x9bd05f[_0x395f8e(0xd5)][_0x395f8e(0x116)][_0x395f8e(0xd3)]+_0x9bd05f['counts'][_0x395f8e(0xde)][_0x395f8e(0xd3)];console[_0x395f8e(0xb4)]('\x0aPush\x20summary\x20for\x20\x27'+_0x9bd05f[_0x395f8e(0x114)]+'\x27:'),console['log']('\x20\x20'+a4_0x2b303b[_0x395f8e(0xc7)]('+\x20'+_0x4f8897+'\x20new')+_0x395f8e(0x14b)+a4_0x2b303b['yellow']('~\x20'+_0x154138+_0x395f8e(0x12f))+_0x395f8e(0x14b)+a4_0x2b303b[_0x395f8e(0xc1)]('=\x20'+_0x17c47f+'\x20unchanged')),console[_0x395f8e(0xb4)](_0x395f8e(0xcf)+formatCountSummary(_0x9bd05f['counts'][_0x395f8e(0x10a)])),console['log'](_0x395f8e(0x14c)+formatCountSummary(_0x9bd05f[_0x395f8e(0xd5)]['knowledgeBases'])),console[_0x395f8e(0xb4)](_0x395f8e(0xea)+formatCountSummary(_0x9bd05f[_0x395f8e(0xd5)][_0x395f8e(0x16a)])),console[_0x395f8e(0xb4)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x9bd05f['counts']['prompts'])),console['log'](_0x395f8e(0xfb)+formatCountSummary(_0x9bd05f[_0x395f8e(0xd5)][_0x395f8e(0xb1)]));const _0x2716f5=_0x9bd05f[_0x395f8e(0xd5)][_0x395f8e(0x116)][_0x395f8e(0xce)]>0x0||_0x9bd05f[_0x395f8e(0xd5)][_0x395f8e(0x116)]['updated']>0x0||_0x9bd05f[_0x395f8e(0xd5)][_0x395f8e(0x116)][_0x395f8e(0xd3)]>0x0||_0x9bd05f[_0x395f8e(0xd5)][_0x395f8e(0xde)][_0x395f8e(0xce)]>0x0||_0x9bd05f[_0x395f8e(0xd5)][_0x395f8e(0xde)][_0x395f8e(0x126)]>0x0||_0x9bd05f[_0x395f8e(0xd5)]['experimentalArtifacts']['unchanged']>0x0;_0x2716f5&&(console[_0x395f8e(0xb4)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x9bd05f[_0x395f8e(0xd5)][_0x395f8e(0x116)])),console[_0x395f8e(0xb4)](_0x395f8e(0x101)+formatCountSummary(_0x9bd05f[_0x395f8e(0xd5)][_0x395f8e(0xde)])));console['log']('\x20\x20Source:\x20'+a4_0x2b303b[_0x395f8e(0xf6)](_0x19bcee)),displayDiffs(_0x9bd05f[_0x395f8e(0x10a)],_0x9bd05f[_0x395f8e(0xf8)],_0x9bd05f['textKnowledgeBases'],_0x9bd05f[_0x395f8e(0xb0)],_0x9bd05f[_0x395f8e(0xb1)],_0x9bd05f[_0x395f8e(0x116)],_0x9bd05f[_0x395f8e(0xde)]);if(_0x2baf17)return console['log'](a4_0x2b303b['yellow'](_0x395f8e(0x141))),0x0;if(_0x4f8897===0x0&&_0x154138===0x0){console[_0x395f8e(0xb4)](a4_0x2b303b[_0x395f8e(0xc7)]('\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date'));const _0x3636a3=getLLMProjectUrl(_0x391e49,_0x9bd05f['projectId']);return console[_0x395f8e(0xb4)](_0x395f8e(0xf7)+a4_0x2b303b['cyan'](_0x3636a3)),0x0;}if(!_0x2b6dc2&&!_0x1e38fe){if(!isInteractive())return console[_0x395f8e(0xbb)](a4_0x2b303b[_0x395f8e(0xfc)](_0x395f8e(0x169)),_0x395f8e(0x144)),console[_0x395f8e(0xbb)](a4_0x2b303b[_0x395f8e(0xc1)](_0x395f8e(0x14e))),0x1;const _0x43ef74=await confirmKey(_0x395f8e(0x154)+(_0x4f8897+_0x154138)+_0x395f8e(0xbf));if(!_0x43ef74)return console[_0x395f8e(0xb4)](a4_0x2b303b['yellow'](_0x395f8e(0x136)),_0x395f8e(0x10b)),0x1;}const {data:_0x55c45b}=await withSpinner(_0x395f8e(0x13b),()=>_0x3216d8[_0x395f8e(0xff)][_0x395f8e(0x12e)](_0x19bcee,{'force':_0x1e38fe})),_0x253f24=_0x55c45b[_0x395f8e(0xd5)]['agents'][_0x395f8e(0x11b)]>0x0||_0x55c45b['counts'][_0x395f8e(0xf8)]['errors']>0x0||_0x55c45b[_0x395f8e(0xd5)][_0x395f8e(0x16a)][_0x395f8e(0x11b)]>0x0||_0x55c45b[_0x395f8e(0xd5)][_0x395f8e(0xb0)][_0x395f8e(0x11b)]>0x0;if(_0x253f24){console[_0x395f8e(0xb4)](a4_0x2b303b[_0x395f8e(0x13a)](_0x395f8e(0xcc))),console[_0x395f8e(0xb4)](),console[_0x395f8e(0xb4)](a4_0x2b303b[_0x395f8e(0xfc)](_0x395f8e(0x115)));for(const _0x2d218b of _0x55c45b[_0x395f8e(0x10a)]){_0x2d218b[_0x395f8e(0xe3)]==='error'&&console['log'](a4_0x2b303b[_0x395f8e(0xfc)](_0x395f8e(0x140)+_0x2d218b['agentName']+_0x395f8e(0x11e)+_0x2d218b[_0x395f8e(0xbb)]));}for(const _0x3da534 of _0x55c45b[_0x395f8e(0xf8)]){_0x3da534[_0x395f8e(0xe3)]===_0x395f8e(0xbb)&&console[_0x395f8e(0xb4)](a4_0x2b303b[_0x395f8e(0xfc)](_0x395f8e(0x134)+_0x3da534['name']+_0x395f8e(0x11e)+_0x3da534[_0x395f8e(0xbb)]));}for(const _0x2783a2 of _0x55c45b[_0x395f8e(0x16a)]){_0x2783a2[_0x395f8e(0xe3)]===_0x395f8e(0xbb)&&console[_0x395f8e(0xb4)](a4_0x2b303b[_0x395f8e(0xfc)](_0x395f8e(0xd6)+_0x2783a2[_0x395f8e(0x165)]+_0x395f8e(0x11e)+_0x2783a2[_0x395f8e(0xbb)]));}for(const _0xf9e442 of _0x55c45b[_0x395f8e(0xb0)]){_0xf9e442['action']==='error'&&console['log'](a4_0x2b303b[_0x395f8e(0xfc)](_0x395f8e(0xe4)+_0xf9e442[_0x395f8e(0x165)]+'\x22:\x20'+_0xf9e442[_0x395f8e(0xbb)]));}for(const _0x2cf2c3 of _0x55c45b['integrations']){_0x2cf2c3[_0x395f8e(0xe3)]===_0x395f8e(0xbb)&&console[_0x395f8e(0xb4)](a4_0x2b303b[_0x395f8e(0xfc)](_0x395f8e(0xfd)+_0x2cf2c3['name']+_0x395f8e(0x11e)+_0x2cf2c3[_0x395f8e(0xbb)]));}return 0x1;}console[_0x395f8e(0xb4)](a4_0x2b303b[_0x395f8e(0xc7)](_0x395f8e(0x153)+(_0x4f8897+_0x154138)+_0x395f8e(0xda)+_0x55c45b[_0x395f8e(0x114)]+'\x27'));const _0x408d50=getLLMProjectUrl(_0x391e49,_0x55c45b[_0x395f8e(0xed)]);return console['log'](_0x395f8e(0xf7)+a4_0x2b303b[_0x395f8e(0xf6)](_0x408d50)),0x0;}}
@@ -1 +1 @@
1
- function a5_0x2ec1(_0x590f35,_0x1867a1){_0x590f35=_0x590f35-0x1c8;const _0x2bf96d=a5_0x2bf9();let _0x2ec186=_0x2bf96d[_0x590f35];return _0x2ec186;}const a5_0x5166cf=a5_0x2ec1;(function(_0x323bf6,_0x2346c3){const _0xf6572f=a5_0x2ec1,_0x64b20d=_0x323bf6();while(!![]){try{const _0x546613=parseInt(_0xf6572f(0x22e))/0x1+parseInt(_0xf6572f(0x24c))/0x2*(parseInt(_0xf6572f(0x25e))/0x3)+-parseInt(_0xf6572f(0x206))/0x4+-parseInt(_0xf6572f(0x1f2))/0x5*(parseInt(_0xf6572f(0x237))/0x6)+parseInt(_0xf6572f(0x23d))/0x7+-parseInt(_0xf6572f(0x1e7))/0x8+-parseInt(_0xf6572f(0x20f))/0x9*(parseInt(_0xf6572f(0x259))/0xa);if(_0x546613===_0x2346c3)break;else _0x64b20d['push'](_0x64b20d['shift']());}catch(_0x36b3c3){_0x64b20d['push'](_0x64b20d['shift']());}}}(a5_0x2bf9,0x64b61));import*as a5_0x1ace68 from'node:fs';function a5_0x2bf9(){const _0x9c0a50=['dim','944672DzrPau','no_context','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','\x20(cached)','...\x20','projectDir','split','FAIL','\x20\x20Conversation:\x20','repeat','Errors:\x20\x20\x20','Total:\x20\x20\x20\x20','has','282580ppjURc','verbose','add','\x20\x20Site:\x20','now','3SdBVRu','No\x20tests\x20have\x20tags\x20defined.','description','rounds','red','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','Re-evaluating...','Re-evaluating\x20cached\x20test\x20run...','trim','writeFileSync','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','✗\x20FAIL:\x20','executeReeval','push','llmProject','projectName','execute','\x20\x20Evaluating...\x20','tests','⚠\x20SKIPPED:\x20','llm','stop','testName','✗\x20ERROR:\x20Project\x20not\x20found:\x20','jsonl','existsSync','eval','log','round','site','Usage:','toISOString','1541880ZwVwKW','forEach','no_tests','Re-evaluation\x20Summary','Test\x20Summary','✓\x20PASS:\x20','table','\x20-\x20','size','Round\x201/','Passed:\x20\x20\x20','317570szCfdx','source','Error\x20writing\x20output\x20file:\x20','reason','Either\x20switch\x20to\x20the\x20\x22','basename','Re-evaluating\x20','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','Run\x20tests\x20for\x20an\x20LLM\x20agent','Cached\x20run\x20is\x20from\x20site\x20\x22','\x20(new)','agent:test','filter','includes','cyan','\x20\x20Project:\x20','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','\x20\x20Round\x20','output','Running:\x20','29928OfUzKw','\x22:\x20','json','tsv','\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','ERROR','Tests\x20found:\x20','\x20\x20-\x20','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','153WaUEVh','\x27\x20to\x20create\x20the\x20folder\x20structure.','toLowerCase','Conversation\x20URL:\x20','find','Running\x20agent\x20tests...','✗\x20ERROR:\x20','Evaluating\x20response...','conversation_url','PASS','message','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','green','resolveProjectId','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','agentDirs','map','Error:\x20No\x20previous\x20test\x20run\x20found.','reeval','start','found','agentName','Duration:\x20','timestamp','...','\x22,\x20but\x20current\x20site\x20is\x20\x22','length','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','status','utf-8','757152GjrqFd','dryRun','white','Output\x20written\x20to:\x20','resolve','Failed:\x20\x20\x20','Running\x20test:\x20','test.yml','Agent:\x20','24CYFlxD','substring','yellow','Test\x20',':\x20Sending\x20user\x20input...','name','823788VmjIGt','404','No\x20tests\x20found\x20with\x20tags:\x20','conversations','Failed\x20Tests:','Run\x20\x27tdx\x20agent\x20pull\x20','Available\x20tests:\x20','tags','agent','text','join','Test\x20Configuration:','Available\x20tags:\x20','resolveAgentId'];a5_0x2bf9=function(){return _0x9c0a50;};return a5_0x2bf9();}import*as a5_0x503231 from'node:path';import a5_0x572ef7 from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x5166cf(0x23c)]=a5_0x5166cf(0x1fd);[a5_0x5166cf(0x1c9)]=a5_0x5166cf(0x1fa);async[a5_0x5166cf(0x1d7)](_0x225a38){const _0x56d81e=a5_0x5166cf,{options:_0x1937be,args:_0xc50313,tdx:_0x30d74d}=_0x225a38,_0x2229b9=_0xc50313[0x0]||'.',_0x1e3668=_0x1937be[_0x56d81e(0x22f)],_0x53742f=_0x1937be,_0x45f30e=_0x53742f[_0x56d81e(0x1e1)]===![],_0x83b535=_0x53742f[_0x56d81e(0x221)],_0x3e2a9d=_0x53742f[_0x56d81e(0x23c)],_0x2a4dc1=_0x53742f['tags'],_0x37fa51=_0x1937be[_0x56d81e(0x1e4)],_0x359e31=_0x53742f[_0x56d81e(0x204)];if(_0x83b535&&_0x45f30e)return console['log'](a5_0x572ef7[_0x56d81e(0x1cb)](_0x56d81e(0x1cc))),0x1;let _0x157dfd=_0x56d81e(0x1ed);if(_0x53742f[_0x56d81e(0x208)])_0x157dfd='json';else{if(_0x53742f[_0x56d81e(0x1df)])_0x157dfd=_0x56d81e(0x1df);else{if(_0x53742f[_0x56d81e(0x209)])_0x157dfd=_0x56d81e(0x209);else{if(_0x53742f[_0x56d81e(0x1ed)])_0x157dfd=_0x56d81e(0x1ed);}}}const _0x2659dc=_0x53742f['llmProject'];let _0x5c0881=_0x2229b9;const _0x178545=a5_0x1ace68[_0x56d81e(0x1e0)](_0x2229b9),_0x23e853=_0x2229b9==='.';if(!_0x178545||_0x23e853){const _0x23c84b=resolveProjectFromContext(_0x2229b9,_0x2659dc,{'requireFile':_0x56d81e(0x235)});if(_0x23c84b[_0x56d81e(0x223)])_0x5c0881=_0x23c84b[_0x56d81e(0x251)],_0x23c84b[_0x56d81e(0x1f3)]==='context'&&console['log'](a5_0x572ef7['dim']('Using\x20agent:\x20'+_0x5c0881));else switch(_0x23c84b[_0x56d81e(0x1f5)]){case _0x56d81e(0x24d):console[_0x56d81e(0x1e2)](a5_0x572ef7[_0x56d81e(0x239)](_0x23c84b[_0x56d81e(0x219)])),console[_0x56d81e(0x1e2)](),console[_0x56d81e(0x1e2)](_0x56d81e(0x1e5)),console['log'](_0x56d81e(0x20a)),console[_0x56d81e(0x1e2)]('\x20\x20tdx\x20agent\x20test\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20(requires\x20context\x20or\x20tdx.json)'),console[_0x56d81e(0x1e2)](),console[_0x56d81e(0x1e2)]('Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>');return 0x1;case'no_local_folder':console['log'](a5_0x572ef7['yellow'](_0x23c84b[_0x56d81e(0x219)])),console['log'](),console[_0x56d81e(0x1e2)](_0x56d81e(0x242)+_0x23c84b['llmProject']+_0x56d81e(0x210));return 0x1;case'multiple_agents':{const _0x573d57=a5_0x503231[_0x56d81e(0x1f7)](_0x23c84b[_0x56d81e(0x251)]);console['log'](a5_0x572ef7['yellow'](_0x56d81e(0x1f9)+_0x23c84b[_0x56d81e(0x1d5)]+'\x22:'));for(const _0x1b1766 of _0x23c84b[_0x56d81e(0x21e)]){console[_0x56d81e(0x1e2)](_0x56d81e(0x20d)+_0x1b1766);}return console[_0x56d81e(0x1e2)](),console[_0x56d81e(0x1e2)]('Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/'+_0x573d57+'/<agent-name>'),0x1;}case _0x56d81e(0x1e9):console[_0x56d81e(0x1e2)](a5_0x572ef7['yellow']('No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22'+_0x23c84b[_0x56d81e(0x1d5)]+'\x22.')),console['log'](a5_0x572ef7[_0x56d81e(0x24b)]('Project\x20path:\x20'+_0x23c84b[_0x56d81e(0x251)])),console['log'](),console['log'](_0x56d81e(0x1d1));return 0x1;}}const {definition:_0x3bdb36,agentInfo:_0x317a57}=parseTestFile(_0x5c0881);let _0x4b68e2=_0x3bdb36[_0x56d81e(0x1d9)];if(_0x3e2a9d){const _0x2c7c5d=_0x3e2a9d[_0x56d81e(0x252)](',')['map'](_0x14f327=>_0x14f327[_0x56d81e(0x1cf)]());_0x4b68e2=_0x3bdb36[_0x56d81e(0x1d9)]['filter'](_0x5adfce=>_0x2c7c5d['includes'](_0x5adfce['name']));if(_0x4b68e2[_0x56d81e(0x229)]===0x0)return console[_0x56d81e(0x1e2)](a5_0x572ef7[_0x56d81e(0x239)]('No\x20tests\x20found\x20matching:\x20'+_0x3e2a9d)),console[_0x56d81e(0x1e2)](a5_0x572ef7[_0x56d81e(0x24b)](_0x56d81e(0x243)+_0x3bdb36[_0x56d81e(0x1d9)][_0x56d81e(0x21f)](_0xa3a273=>_0xa3a273['name'])[_0x56d81e(0x247)](',\x20'))),0x1;}if(_0x2a4dc1){const _0x56ae61=_0x2a4dc1[_0x56d81e(0x252)](',')[_0x56d81e(0x21f)](_0x432572=>_0x432572[_0x56d81e(0x1cf)]()[_0x56d81e(0x211)]());_0x4b68e2=_0x4b68e2[_0x56d81e(0x1fe)](_0x15882d=>_0x15882d['tags']?.['some'](_0x5b1c56=>_0x56ae61[_0x56d81e(0x1ff)](_0x5b1c56[_0x56d81e(0x211)]())));if(_0x4b68e2[_0x56d81e(0x229)]===0x0){console['log'](a5_0x572ef7['yellow'](_0x56d81e(0x23f)+_0x2a4dc1));const _0x3e29ac=new Set();return _0x3bdb36[_0x56d81e(0x1d9)]['forEach'](_0x4e8176=>_0x4e8176[_0x56d81e(0x244)]?.[_0x56d81e(0x1e8)](_0x2096ea=>_0x3e29ac[_0x56d81e(0x25b)](_0x2096ea))),_0x3e29ac[_0x56d81e(0x1ef)]>0x0?console['log'](a5_0x572ef7[_0x56d81e(0x24b)](_0x56d81e(0x249)+[..._0x3e29ac][_0x56d81e(0x247)](',\x20'))):console['log'](a5_0x572ef7[_0x56d81e(0x24b)](_0x56d81e(0x1c8))),0x1;}}if(_0x83b535)return this['executeReeval'](_0x225a38,{'definition':{'tests':_0x4b68e2},'agentInfo':_0x317a57,'outputFormat':_0x157dfd,'outputFile':_0x359e31,'testNames':_0x3e2a9d});if(_0x1e3668){console[_0x56d81e(0x1e2)](a5_0x572ef7[_0x56d81e(0x200)](_0x56d81e(0x248))),console[_0x56d81e(0x1e2)](_0x56d81e(0x25c)+a5_0x572ef7[_0x56d81e(0x230)](_0x37fa51)),console[_0x56d81e(0x1e2)](_0x56d81e(0x201)+a5_0x572ef7[_0x56d81e(0x230)](_0x317a57[_0x56d81e(0x1d6)])),console[_0x56d81e(0x1e2)]('\x20\x20Agent:\x20'+a5_0x572ef7[_0x56d81e(0x230)](_0x317a57[_0x56d81e(0x224)])),console['log'](),console[_0x56d81e(0x1e2)](_0x56d81e(0x20c)+a5_0x572ef7[_0x56d81e(0x230)](_0x4b68e2[_0x56d81e(0x229)]));for(let _0x525316=0x0;_0x525316<_0x4b68e2[_0x56d81e(0x229)];_0x525316++){const _0x15e133=_0x4b68e2[_0x525316],_0x477534=_0x15e133[_0x56d81e(0x1ca)]['length']===0x1?_0x56d81e(0x1e3):_0x56d81e(0x1ca),_0x1f9867=_0x15e133[_0x56d81e(0x244)]?.['length']?'\x20['+_0x15e133[_0x56d81e(0x244)][_0x56d81e(0x247)](',\x20')+']':'';console[_0x56d81e(0x1e2)]('\x20\x20'+(_0x525316+0x1)+'.\x20'+a5_0x572ef7[_0x56d81e(0x230)](_0x15e133[_0x56d81e(0x23c)])+'\x20('+_0x15e133[_0x56d81e(0x1ca)][_0x56d81e(0x229)]+'\x20'+_0x477534+')'+a5_0x572ef7['dim'](_0x1f9867));}return 0x0;}let _0x569fb4,_0x54c2c5;try{_0x569fb4=await _0x30d74d[_0x56d81e(0x1db)][_0x56d81e(0x21c)](_0x317a57['projectName']);}catch(_0x55c09e){const _0x267575=_0x55c09e instanceof Error?_0x55c09e[_0x56d81e(0x219)]:String(_0x55c09e);return _0x267575[_0x56d81e(0x1ff)](_0x56d81e(0x23e))||_0x267575[_0x56d81e(0x211)]()[_0x56d81e(0x1ff)]('not\x20found')?console[_0x56d81e(0x1e2)](a5_0x572ef7[_0x56d81e(0x1cb)](_0x56d81e(0x1de)+_0x317a57['projectName'])):console[_0x56d81e(0x1e2)](a5_0x572ef7[_0x56d81e(0x1cb)](_0x56d81e(0x21a)+_0x317a57[_0x56d81e(0x1d6)]+_0x56d81e(0x207)+_0x267575)),0x1;}try{_0x54c2c5=await _0x30d74d[_0x56d81e(0x1db)][_0x56d81e(0x24a)](_0x317a57[_0x56d81e(0x224)],_0x569fb4);}catch(_0x2be61e){const _0x2de758=_0x2be61e instanceof Error?_0x2be61e['message']:String(_0x2be61e);return _0x2de758[_0x56d81e(0x1ff)]('404')||_0x2de758[_0x56d81e(0x211)]()['includes']('not\x20found')?console['log'](a5_0x572ef7['red'](_0x56d81e(0x20e)+_0x317a57[_0x56d81e(0x224)])):console['log'](a5_0x572ef7[_0x56d81e(0x1cb)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22'+_0x317a57['agentName']+_0x56d81e(0x207)+_0x2de758)),0x1;}let _0x599f5b;if(!_0x45f30e)try{_0x599f5b=await setupEvaluatorAgent(_0x30d74d[_0x56d81e(0x1db)],_0x1937be[_0x56d81e(0x25a)]);}catch(_0x50dab9){const _0x339bf5=_0x50dab9 instanceof Error?_0x50dab9[_0x56d81e(0x219)]:String(_0x50dab9);return console[_0x56d81e(0x1e2)](a5_0x572ef7[_0x56d81e(0x1cb)](_0x56d81e(0x22b)+_0x339bf5)),0x1;}console['log'](a5_0x572ef7[_0x56d81e(0x200)](_0x56d81e(0x214))),console[_0x56d81e(0x1e2)]('Site:\x20'+a5_0x572ef7[_0x56d81e(0x230)](_0x37fa51)),console['log']('Agent:\x20'+a5_0x572ef7[_0x56d81e(0x230)](_0x317a57['projectName']+'/'+_0x317a57[_0x56d81e(0x224)])),console[_0x56d81e(0x1e2)]();const _0x216035=[],_0x3d0c8e=[],_0x5dfa2f=Date[_0x56d81e(0x25d)]();for(let _0x1fb083=0x0;_0x1fb083<_0x4b68e2[_0x56d81e(0x229)];_0x1fb083++){const _0x563dbf=_0x4b68e2[_0x1fb083];_0x4b68e2[_0x56d81e(0x229)]>0x1?console[_0x56d81e(0x1e2)](_0x56d81e(0x23a)+(_0x1fb083+0x1)+'/'+_0x4b68e2['length']+':\x20'+a5_0x572ef7['white'](_0x563dbf[_0x56d81e(0x23c)])):console[_0x56d81e(0x1e2)](_0x56d81e(0x234)+a5_0x572ef7['white'](_0x563dbf[_0x56d81e(0x23c)]));const _0x2be5c0=createCommandSpinner(_0x56d81e(0x1f0)+_0x563dbf[_0x56d81e(0x1ca)][_0x56d81e(0x229)]+_0x56d81e(0x23b));_0x2be5c0['start']();try{const {result:_0x3dc2f2,conversation:_0x2b82d6}=await runTest(_0x30d74d[_0x56d81e(0x1db)],_0x563dbf,{'agentId':_0x54c2c5,'projectId':_0x569fb4,'site':_0x37fa51,'noEval':_0x45f30e,'evaluatorId':_0x599f5b,'onRoundStart':(_0xf708c,_0x30410c)=>{const _0x5ba669=_0x56d81e;_0x2be5c0[_0x5ba669(0x246)]='Round\x20'+(_0xf708c+0x1)+'/'+_0x30410c+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x1d9e31,_0xfb55b5,_0x1a5526)=>{const _0x36c412=_0x56d81e,_0x1499f6=formatElapsed(_0xfb55b5);_0x1a5526?console[_0x36c412(0x1e2)](_0x36c412(0x203)+(_0x1d9e31+0x1)+'/'+_0x563dbf[_0x36c412(0x1ca)][_0x36c412(0x229)]+_0x36c412(0x250)+a5_0x572ef7[_0x36c412(0x21b)]('✓')+'\x20('+_0x1499f6+')'):console[_0x36c412(0x1e2)](_0x36c412(0x203)+(_0x1d9e31+0x1)+'/'+_0x563dbf['rounds']['length']+_0x36c412(0x250)+a5_0x572ef7[_0x36c412(0x1cb)]('✗'));},'onEvaluationStart':()=>{const _0x5d02f9=_0x56d81e;_0x2be5c0[_0x5d02f9(0x246)]=_0x5d02f9(0x216);},'onEvaluationComplete':_0x4ee199=>{const _0xea1cec=_0x56d81e,_0x26d88b=formatElapsed(_0x4ee199);console[_0xea1cec(0x1e2)](_0xea1cec(0x1d8)+a5_0x572ef7[_0xea1cec(0x21b)]('✓')+'\x20('+_0x26d88b+')');}});_0x2be5c0[_0x56d81e(0x1dc)](),_0x216035[_0x56d81e(0x1d4)](_0x3dc2f2),_0x3d0c8e[_0x56d81e(0x1d4)](_0x2b82d6);if(_0x3dc2f2[_0x56d81e(0x22c)]===_0x56d81e(0x218))console[_0x56d81e(0x1e2)](a5_0x572ef7[_0x56d81e(0x21b)](_0x56d81e(0x1ec)+_0x3dc2f2[_0x56d81e(0x1f5)]));else _0x3dc2f2[_0x56d81e(0x22c)]===_0x56d81e(0x253)?console['log'](a5_0x572ef7[_0x56d81e(0x1cb)](_0x56d81e(0x1d2)+_0x3dc2f2['reason'])):console['log'](a5_0x572ef7['red'](_0x56d81e(0x215)+_0x3dc2f2['reason']));_0x3dc2f2['conversation_url']&&console[_0x56d81e(0x1e2)](a5_0x572ef7[_0x56d81e(0x24b)](_0x56d81e(0x212)+_0x3dc2f2[_0x56d81e(0x217)])),console[_0x56d81e(0x1e2)]();}catch(_0x24d4fa){_0x2be5c0[_0x56d81e(0x1dc)]();const _0x537faf=_0x24d4fa instanceof Error?_0x24d4fa[_0x56d81e(0x219)]:String(_0x24d4fa);console[_0x56d81e(0x1e2)](a5_0x572ef7['red'](_0x56d81e(0x215)+_0x537faf)),console[_0x56d81e(0x1e2)](),_0x216035['push']({'name':_0x563dbf[_0x56d81e(0x23c)],'status':_0x56d81e(0x20b),'reason':_0x537faf,'timestamp':new Date()[_0x56d81e(0x1e6)](),'duration_ms':0x0});}}const _0x30d87f=Date[_0x56d81e(0x25d)]()-_0x5dfa2f,_0x29d53b=_0x216035['filter'](_0x5865a7=>_0x5865a7[_0x56d81e(0x22c)]===_0x56d81e(0x218))['length'],_0x325719=_0x216035[_0x56d81e(0x1fe)](_0x12ca0a=>_0x12ca0a[_0x56d81e(0x22c)]==='FAIL')[_0x56d81e(0x229)],_0x12b714=_0x216035['filter'](_0x104fbc=>_0x104fbc[_0x56d81e(0x22c)]===_0x56d81e(0x20b))['length'];console[_0x56d81e(0x1e2)]('━'['repeat'](0x3c)),console[_0x56d81e(0x1e2)](_0x56d81e(0x1eb)),console[_0x56d81e(0x1e2)]('━'[_0x56d81e(0x255)](0x3c)),console[_0x56d81e(0x1e2)](_0x56d81e(0x257)+_0x216035[_0x56d81e(0x229)]),console['log'](_0x56d81e(0x1f1)+a5_0x572ef7[_0x56d81e(0x21b)](_0x29d53b)),console[_0x56d81e(0x1e2)](_0x56d81e(0x233)+a5_0x572ef7[_0x56d81e(0x1cb)](_0x325719));_0x12b714>0x0&&console[_0x56d81e(0x1e2)](_0x56d81e(0x256)+a5_0x572ef7[_0x56d81e(0x1cb)](_0x12b714));console[_0x56d81e(0x1e2)](_0x56d81e(0x225)+formatElapsed(_0x30d87f)),console[_0x56d81e(0x1e2)]('━'[_0x56d81e(0x255)](0x3c));const _0x11400d=_0x216035['filter'](_0x1cad3e=>_0x1cad3e['status']!=='PASS');if(_0x11400d[_0x56d81e(0x229)]>0x0){console[_0x56d81e(0x1e2)](),console[_0x56d81e(0x1e2)](_0x56d81e(0x241));for(const _0x29ae05 of _0x11400d){const _0x1107ad=a5_0x572ef7['red']('✗'),_0x1b8a97=_0x29ae05[_0x56d81e(0x1f5)][_0x56d81e(0x229)]>0x32?_0x29ae05['reason'][_0x56d81e(0x238)](0x0,0x32)+_0x56d81e(0x227):_0x29ae05['reason'];console['log']('\x20\x20'+_0x1107ad+'\x20'+_0x29ae05[_0x56d81e(0x23c)]+':\x20'+_0x1b8a97);}}const _0x1962f9={'summary':{'total':_0x216035['length'],'passed':_0x29d53b,'failed':_0x325719,'errors':_0x12b714>0x0?_0x12b714:undefined,'duration_ms':_0x30d87f},'tests':_0x216035,'agent':{'project':_0x317a57[_0x56d81e(0x1d6)],'name':_0x317a57[_0x56d81e(0x224)],'site':_0x37fa51},'timestamp':new Date(_0x5dfa2f)[_0x56d81e(0x1e6)]()};try{const _0xa95689=buildCachedTestRun(_0x3d0c8e,{'site':_0x37fa51,'projectId':_0x569fb4,'projectName':_0x317a57['projectName'],'agentId':_0x54c2c5,'agentName':_0x317a57[_0x56d81e(0x224)],'testYmlPath':a5_0x503231[_0x56d81e(0x232)](_0x317a57['testYmlPath'])});saveLastTestRun(_0xa95689);}catch{}if(_0x157dfd!==_0x56d81e(0x1ed)||_0x359e31){const _0x692f7e=formatResults(_0x1962f9,_0x157dfd);if(_0x359e31)try{a5_0x1ace68['writeFileSync'](_0x359e31,_0x692f7e,_0x56d81e(0x22d)),console[_0x56d81e(0x1e2)](),console['log'](a5_0x572ef7[_0x56d81e(0x24b)](_0x56d81e(0x231)+_0x359e31));}catch(_0x40dfe1){return console[_0x56d81e(0x1e2)](),console[_0x56d81e(0x1e2)](a5_0x572ef7[_0x56d81e(0x1cb)](_0x56d81e(0x1f4)+_0x40dfe1)),0x1;}else console[_0x56d81e(0x1e2)](),console[_0x56d81e(0x1e2)](_0x692f7e);}return _0x11400d[_0x56d81e(0x229)]>0x0?0x1:0x0;}async[a5_0x5166cf(0x1d3)](_0x1d191a,_0xa9ca30){const _0x2e8248=a5_0x5166cf,{options:_0x3b26d9,tdx:_0x1ab9f7}=_0x1d191a,{definition:_0x108d19,agentInfo:_0x1d7157,outputFormat:_0x2c7122,outputFile:_0x1d50c3}=_0xa9ca30,_0x2ca14b=_0x3b26d9[_0x2e8248(0x1e4)],_0x3f6370=loadLastTestRun();if(!_0x3f6370)return console['log'](a5_0x572ef7['red'](_0x2e8248(0x220))),console[_0x2e8248(0x1e2)](a5_0x572ef7[_0x2e8248(0x24b)]('Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.')),0x1;if(_0x3f6370[_0x2e8248(0x245)][_0x2e8248(0x224)]!==_0x1d7157[_0x2e8248(0x224)])return console[_0x2e8248(0x1e2)](a5_0x572ef7[_0x2e8248(0x1cb)](_0x2e8248(0x22a)+_0x3f6370[_0x2e8248(0x245)][_0x2e8248(0x224)]+_0x2e8248(0x24e)+_0x1d7157['agentName']+'\x22.')),console['log'](a5_0x572ef7['dim']('Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.')),0x1;const _0x696bee=new Set(_0x3f6370[_0x2e8248(0x240)]['map'](_0x24d8b1=>_0x24d8b1[_0x2e8248(0x1dd)])),_0x219603=_0x108d19[_0x2e8248(0x1d9)][_0x2e8248(0x1fe)](_0x15b892=>!_0x696bee[_0x2e8248(0x258)](_0x15b892['name']));if(_0x219603[_0x2e8248(0x229)]>0x0&&_0x3f6370[_0x2e8248(0x1e4)]!==_0x2ca14b)return console[_0x2e8248(0x1e2)](a5_0x572ef7[_0x2e8248(0x1cb)](_0x2e8248(0x21d))),console[_0x2e8248(0x1e2)](a5_0x572ef7[_0x2e8248(0x24b)](_0x2e8248(0x1fb)+_0x3f6370[_0x2e8248(0x1e4)]+_0x2e8248(0x228)+_0x2ca14b+'\x22.')),console[_0x2e8248(0x1e2)](a5_0x572ef7[_0x2e8248(0x24b)](_0x2e8248(0x1f6)+_0x3f6370[_0x2e8248(0x1e4)]+_0x2e8248(0x202))),0x1;const _0x56066b=_0x108d19['tests'][_0x2e8248(0x1fe)](_0x2065e7=>_0x696bee[_0x2e8248(0x258)](_0x2065e7['name'])),_0xe996b0=_0x219603;let _0x4b52df;try{_0x4b52df=await setupEvaluatorAgent(_0x1ab9f7[_0x2e8248(0x1db)],_0x3b26d9['verbose']);}catch(_0x7940a9){const _0x3ffa75=_0x7940a9 instanceof Error?_0x7940a9['message']:String(_0x7940a9);return console['log'](a5_0x572ef7[_0x2e8248(0x1cb)](_0x2e8248(0x22b)+_0x3ffa75)),0x1;}console[_0x2e8248(0x1e2)](a5_0x572ef7[_0x2e8248(0x200)](_0x2e8248(0x1ce))),console[_0x2e8248(0x1e2)]('Cached\x20run\x20from:\x20'+a5_0x572ef7[_0x2e8248(0x230)](_0x3f6370[_0x2e8248(0x226)])),console[_0x2e8248(0x1e2)](_0x2e8248(0x236)+a5_0x572ef7[_0x2e8248(0x230)](_0x3f6370['agent']['projectName']+'/'+_0x3f6370['agent'][_0x2e8248(0x224)]));_0xe996b0[_0x2e8248(0x229)]>0x0&&console['log']('New\x20tests\x20to\x20execute:\x20'+a5_0x572ef7['yellow'](_0xe996b0[_0x2e8248(0x229)]));console[_0x2e8248(0x1e2)]();const _0x4e5d8c=[],_0x456659=Date[_0x2e8248(0x25d)](),_0x577013=createCommandSpinner(_0x2e8248(0x1cd));if(_0x56066b[_0x2e8248(0x229)]>0x0)try{const _0x339388=await reevaluateFromCache(_0x1ab9f7[_0x2e8248(0x1db)],_0x3f6370,{'tests':_0x56066b},{'evaluatorId':_0x4b52df,'onTestStart':(_0x57eb70,_0x2bd9a6,_0x439a26)=>{const _0x50c1d2=_0x2e8248;_0x577013[_0x50c1d2(0x246)]=_0x50c1d2(0x1f8)+(_0x2bd9a6+0x1)+'/'+_0x439a26+':\x20'+_0x57eb70+_0x50c1d2(0x227);if(!_0x577013['isSpinning'])_0x577013[_0x50c1d2(0x222)]();},'onTestComplete':(_0xf6ad0a,_0x30dfc6)=>{const _0x5c7426=_0x2e8248;_0x577013['stop']();if(_0x30dfc6[_0x5c7426(0x22c)]==='PASS')console[_0x5c7426(0x1e2)](a5_0x572ef7['green'](_0x5c7426(0x1ec)+_0xf6ad0a)+a5_0x572ef7[_0x5c7426(0x24b)](_0x5c7426(0x24f)));else _0x30dfc6['status']===_0x5c7426(0x253)?console[_0x5c7426(0x1e2)](a5_0x572ef7[_0x5c7426(0x1cb)](_0x5c7426(0x1d2)+_0xf6ad0a+'\x20-\x20'+_0x30dfc6[_0x5c7426(0x1f5)])+a5_0x572ef7[_0x5c7426(0x24b)](_0x5c7426(0x24f))):console[_0x5c7426(0x1e2)](a5_0x572ef7['red'](_0x5c7426(0x215)+_0xf6ad0a+_0x5c7426(0x1ee)+_0x30dfc6[_0x5c7426(0x1f5)]));_0x30dfc6['conversation_url']&&console[_0x5c7426(0x1e2)](a5_0x572ef7['dim']('\x20\x20Conversation:\x20'+_0x30dfc6[_0x5c7426(0x217)])),_0x4e5d8c[_0x5c7426(0x1d4)](_0x30dfc6);},'onTestSkipped':(_0x536bc6,_0x4dc83c)=>{const _0x1a712f=_0x2e8248;_0x577013[_0x1a712f(0x1dc)](),console[_0x1a712f(0x1e2)](a5_0x572ef7[_0x1a712f(0x239)](_0x1a712f(0x1da)+_0x536bc6+_0x1a712f(0x1ee)+_0x4dc83c));}});for(const _0x330866 of _0x339388){!_0x4e5d8c[_0x2e8248(0x213)](_0xa3e517=>_0xa3e517[_0x2e8248(0x23c)]===_0x330866[_0x2e8248(0x23c)])&&_0x4e5d8c[_0x2e8248(0x1d4)](_0x330866);}}catch(_0x21a553){_0x577013[_0x2e8248(0x1dc)]();const _0xf6cb41=_0x21a553 instanceof Error?_0x21a553[_0x2e8248(0x219)]:String(_0x21a553);return console[_0x2e8248(0x1e2)](a5_0x572ef7['red']('✗\x20ERROR:\x20Re-evaluation\x20failed:\x20'+_0xf6cb41)),0x1;}_0x577013[_0x2e8248(0x1dc)]();if(_0xe996b0[_0x2e8248(0x229)]>0x0){console[_0x2e8248(0x1e2)](),console[_0x2e8248(0x1e2)](a5_0x572ef7[_0x2e8248(0x200)]('Executing\x20new\x20tests...'));const {projectId:_0x1323aa,agentId:_0x4c6604}=_0x3f6370[_0x2e8248(0x245)];for(const _0x2c7dd9 of _0xe996b0){console['log'](_0x2e8248(0x205)+a5_0x572ef7['white'](_0x2c7dd9[_0x2e8248(0x23c)]));const _0x54e52=createCommandSpinner(_0x2e8248(0x1f0)+_0x2c7dd9[_0x2e8248(0x1ca)][_0x2e8248(0x229)]+':\x20Sending\x20user\x20input...');_0x54e52[_0x2e8248(0x222)]();try{const {result:_0x1046cb}=await runTest(_0x1ab9f7[_0x2e8248(0x1db)],_0x2c7dd9,{'agentId':_0x4c6604,'projectId':_0x1323aa,'site':_0x3f6370[_0x2e8248(0x1e4)],'noEval':![],'evaluatorId':_0x4b52df,'onRoundStart':(_0x4d77b2,_0x1edee1)=>{const _0x8b9fb5=_0x2e8248;_0x54e52[_0x8b9fb5(0x246)]='Round\x20'+(_0x4d77b2+0x1)+'/'+_0x1edee1+_0x8b9fb5(0x23b);},'onRoundComplete':(_0x3d1eeb,_0x5197ed,_0x297956)=>{const _0x2d0280=_0x2e8248,_0x3eae14=formatElapsed(_0x5197ed);_0x297956?console['log']('\x20\x20Round\x20'+(_0x3d1eeb+0x1)+'/'+_0x2c7dd9[_0x2d0280(0x1ca)]['length']+'...\x20'+a5_0x572ef7[_0x2d0280(0x21b)]('✓')+'\x20('+_0x3eae14+')'):console[_0x2d0280(0x1e2)]('\x20\x20Round\x20'+(_0x3d1eeb+0x1)+'/'+_0x2c7dd9[_0x2d0280(0x1ca)][_0x2d0280(0x229)]+_0x2d0280(0x250)+a5_0x572ef7[_0x2d0280(0x1cb)]('✗'));},'onEvaluationStart':()=>{const _0x50ec27=_0x2e8248;_0x54e52[_0x50ec27(0x246)]=_0x50ec27(0x216);},'onEvaluationComplete':_0x808845=>{const _0x529564=_0x2e8248,_0x158f3b=formatElapsed(_0x808845);console[_0x529564(0x1e2)](_0x529564(0x1d8)+a5_0x572ef7[_0x529564(0x21b)]('✓')+'\x20('+_0x158f3b+')');}});_0x54e52[_0x2e8248(0x1dc)](),_0x4e5d8c[_0x2e8248(0x1d4)](_0x1046cb);if(_0x1046cb[_0x2e8248(0x22c)]===_0x2e8248(0x218))console[_0x2e8248(0x1e2)](a5_0x572ef7[_0x2e8248(0x21b)](_0x2e8248(0x1ec)+_0x1046cb[_0x2e8248(0x1f5)])+a5_0x572ef7['dim']('\x20(new)'));else _0x1046cb[_0x2e8248(0x22c)]==='FAIL'?console[_0x2e8248(0x1e2)](a5_0x572ef7[_0x2e8248(0x1cb)](_0x2e8248(0x1d2)+_0x1046cb['reason'])+a5_0x572ef7[_0x2e8248(0x24b)](_0x2e8248(0x1fc))):console[_0x2e8248(0x1e2)](a5_0x572ef7[_0x2e8248(0x1cb)](_0x2e8248(0x215)+_0x1046cb[_0x2e8248(0x1f5)]));_0x1046cb[_0x2e8248(0x217)]&&console[_0x2e8248(0x1e2)](a5_0x572ef7[_0x2e8248(0x24b)](_0x2e8248(0x254)+_0x1046cb[_0x2e8248(0x217)]));}catch(_0x5cbfc5){_0x54e52[_0x2e8248(0x1dc)]();const _0x5d3a80=_0x5cbfc5 instanceof Error?_0x5cbfc5[_0x2e8248(0x219)]:String(_0x5cbfc5);console[_0x2e8248(0x1e2)](a5_0x572ef7[_0x2e8248(0x1cb)](_0x2e8248(0x215)+_0x5d3a80)),_0x4e5d8c[_0x2e8248(0x1d4)]({'name':_0x2c7dd9[_0x2e8248(0x23c)],'status':'ERROR','reason':_0x5d3a80,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}}console[_0x2e8248(0x1e2)]();const _0x4e4aaf=Date['now']()-_0x456659,_0x191209=_0x4e5d8c[_0x2e8248(0x1fe)](_0x290a13=>_0x290a13['status']===_0x2e8248(0x218))[_0x2e8248(0x229)],_0x4af17a=_0x4e5d8c[_0x2e8248(0x1fe)](_0x4e4522=>_0x4e4522['status']===_0x2e8248(0x253))[_0x2e8248(0x229)],_0x366744=_0x4e5d8c['filter'](_0x543414=>_0x543414[_0x2e8248(0x22c)]===_0x2e8248(0x20b))[_0x2e8248(0x229)];console['log']('━'[_0x2e8248(0x255)](0x3c)),console[_0x2e8248(0x1e2)](_0x2e8248(0x1ea)),console['log']('━'[_0x2e8248(0x255)](0x3c)),console[_0x2e8248(0x1e2)]('Total:\x20\x20\x20\x20'+_0x4e5d8c[_0x2e8248(0x229)]),console['log']('Passed:\x20\x20\x20'+a5_0x572ef7[_0x2e8248(0x21b)](_0x191209)),console['log']('Failed:\x20\x20\x20'+a5_0x572ef7['red'](_0x4af17a));_0x366744>0x0&&console[_0x2e8248(0x1e2)](_0x2e8248(0x256)+a5_0x572ef7[_0x2e8248(0x1cb)](_0x366744));console[_0x2e8248(0x1e2)](_0x2e8248(0x225)+formatElapsed(_0x4e4aaf)),console[_0x2e8248(0x1e2)]('━'[_0x2e8248(0x255)](0x3c));const _0x3dad6c={'summary':{'total':_0x4e5d8c['length'],'passed':_0x191209,'failed':_0x4af17a,'errors':_0x366744>0x0?_0x366744:undefined,'duration_ms':_0x4e4aaf},'tests':_0x4e5d8c,'agent':{'project':_0x1d7157[_0x2e8248(0x1d6)],'name':_0x1d7157[_0x2e8248(0x224)],'site':_0x2ca14b},'timestamp':new Date(_0x456659)[_0x2e8248(0x1e6)]()};if(_0x2c7122!==_0x2e8248(0x1ed)||_0x1d50c3){const _0xbcff1c=formatResults(_0x3dad6c,_0x2c7122);if(_0x1d50c3)try{a5_0x1ace68[_0x2e8248(0x1d0)](_0x1d50c3,_0xbcff1c,'utf-8'),console['log'](),console['log'](a5_0x572ef7[_0x2e8248(0x24b)](_0x2e8248(0x231)+_0x1d50c3));}catch(_0x1f462c){return console['log'](),console[_0x2e8248(0x1e2)](a5_0x572ef7[_0x2e8248(0x1cb)](_0x2e8248(0x1f4)+_0x1f462c)),0x1;}else console[_0x2e8248(0x1e2)](),console[_0x2e8248(0x1e2)](_0xbcff1c);}const _0x50a309=_0x4e5d8c[_0x2e8248(0x1fe)](_0x3161f4=>_0x3161f4[_0x2e8248(0x22c)]!==_0x2e8248(0x218));return _0x50a309[_0x2e8248(0x229)]>0x0?0x1:0x0;}}
1
+ const a5_0x523791=a5_0x3c02;(function(_0x194fc2,_0x4c1ec9){const _0x8b398f=a5_0x3c02,_0x34af21=_0x194fc2();while(!![]){try{const _0x2dd514=parseInt(_0x8b398f(0x15d))/0x1+parseInt(_0x8b398f(0xf2))/0x2*(-parseInt(_0x8b398f(0x17d))/0x3)+parseInt(_0x8b398f(0x152))/0x4+-parseInt(_0x8b398f(0xf9))/0x5*(parseInt(_0x8b398f(0x14c))/0x6)+parseInt(_0x8b398f(0x14d))/0x7+parseInt(_0x8b398f(0xf0))/0x8*(-parseInt(_0x8b398f(0x13b))/0x9)+parseInt(_0x8b398f(0xfe))/0xa;if(_0x2dd514===_0x4c1ec9)break;else _0x34af21['push'](_0x34af21['shift']());}catch(_0x46c15d){_0x34af21['push'](_0x34af21['shift']());}}}(a5_0x381d,0x341fa));import*as a5_0x5ec645 from'node:fs';import*as a5_0x418b8b from'node:path';import a5_0x565188 from'chalk';import{BaseCommand}from'./command.js';function a5_0x3c02(_0x3258fc,_0x56c78a){_0x3258fc=_0x3258fc-0xec;const _0x381dd2=a5_0x381d();let _0x3c02c2=_0x381dd2[_0x3258fc];return _0x3c02c2;}import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';function a5_0x381d(){const _0x3aef13=['green','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','no_tests','4596sDuuHq','774781ygYMMA','Project\x20path:\x20','split','conversations','agentDirs','751340BDZYNi','\x20\x20Site:\x20','status','...','✓\x20PASS:\x20','Error\x20writing\x20output\x20file:\x20','\x27\x20to\x20create\x20the\x20folder\x20structure.','repeat','text','filter','Re-evaluating\x20cached\x20test\x20run...','144903LUKPGw','Round\x20','start','agentName','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','json','verbose','FAIL','cyan','\x20-\x20','output','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','Test\x20Summary','Running:\x20','white','resolveProjectId','\x20\x20Round\x20','table','Evaluating\x20response...','not\x20found','Site:\x20','tags','Tests\x20found:\x20','ERROR','message','...\x20','has','PASS','Round\x201/','timestamp','228024bVvdlh','Run\x20\x27tdx\x20agent\x20pull\x20',':\x20Sending\x20user\x20input...','Output\x20written\x20to:\x20','Running\x20agent\x20tests...','/<agent-name>','16BTUhgj','tests','4CGbHgo','found','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','No\x20tests\x20found\x20matching:\x20','jsonl','Passed:\x20\x20\x20','join','2270vfmnWi','substring','\x20\x20Evaluating...\x20','forEach','length','5304230cbLjca','context','dim','name','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','tsv','red','yellow','reason','stop','toLowerCase','Test\x20','\x20\x20-\x20','agent','Cached\x20run\x20from:\x20','\x22,\x20but\x20current\x20site\x20is\x20\x22','Running\x20test:\x20','no_local_folder','\x20\x20Agent:\x20','resolve','multiple_agents','Errors:\x20\x20\x20','basename','New\x20tests\x20to\x20execute:\x20','agent:test','add','dryRun','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','\x20(new)','404','rounds','push','Either\x20switch\x20to\x20the\x20\x22','⚠\x20SKIPPED:\x20','log','llm','description','resolveAgentId','Conversation\x20URL:\x20','Agent:\x20','includes','Test\x20Configuration:','some','projectName','executeReeval','Re-evaluation\x20Summary','now','writeFileSync','toISOString','trim','✗\x20FAIL:\x20','llmProject','\x22:\x20','no_context','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','utf-8','testYmlPath','Using\x20agent:\x20','\x20\x20Project:\x20','size','✗\x20ERROR:\x20','1172547wVrKxp','reeval','conversation_url','projectDir','site','existsSync','map','No\x20tests\x20found\x20with\x20tags:\x20','\x20(cached)','Failed:\x20\x20\x20','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','Duration:\x20','\x20\x20Conversation:\x20','isSpinning'];a5_0x381d=function(){return _0x3aef13;};return a5_0x381d();}export class AgentTestCommand extends BaseCommand{[a5_0x523791(0x101)]=a5_0x523791(0x116);[a5_0x523791(0x122)]='Run\x20tests\x20for\x20an\x20LLM\x20agent';async['execute'](_0xbcd5c9){const _0x5e3d2d=a5_0x523791,{options:_0xcd4e8f,args:_0x14f658,tdx:_0x41a4f5}=_0xbcd5c9,_0x4d0760=_0x14f658[0x0]||'.',_0x420fd1=_0xcd4e8f[_0x5e3d2d(0x118)],_0x1e3953=_0xcd4e8f,_0x329d4d=_0x1e3953['eval']===![],_0x2894c6=_0x1e3953[_0x5e3d2d(0x13c)],_0x59f3b4=_0x1e3953['name'],_0x2e039f=_0x1e3953[_0x5e3d2d(0x174)],_0x248220=_0xcd4e8f[_0x5e3d2d(0x13f)],_0x3c2901=_0x1e3953[_0x5e3d2d(0x167)];if(_0x2894c6&&_0x329d4d)return console[_0x5e3d2d(0x120)](a5_0x565188[_0x5e3d2d(0x104)](_0x5e3d2d(0x102))),0x1;let _0x535b4f=_0x5e3d2d(0x170);if(_0x1e3953[_0x5e3d2d(0x162)])_0x535b4f='json';else{if(_0x1e3953[_0x5e3d2d(0xf6)])_0x535b4f=_0x5e3d2d(0xf6);else{if(_0x1e3953[_0x5e3d2d(0x103)])_0x535b4f=_0x5e3d2d(0x103);else{if(_0x1e3953[_0x5e3d2d(0x170)])_0x535b4f=_0x5e3d2d(0x170);}}}const _0x4b5e84=_0x1e3953['llmProject'];let _0x55b9aa=_0x4d0760;const _0x1e9881=a5_0x5ec645[_0x5e3d2d(0x140)](_0x4d0760),_0xe6458=_0x4d0760==='.';if(!_0x1e9881||_0xe6458){const _0x6a5bee=resolveProjectFromContext(_0x4d0760,_0x4b5e84,{'requireFile':'test.yml'});if(_0x6a5bee[_0x5e3d2d(0xf3)])_0x55b9aa=_0x6a5bee['projectDir'],_0x6a5bee['source']===_0x5e3d2d(0xff)&&console[_0x5e3d2d(0x120)](a5_0x565188[_0x5e3d2d(0x100)](_0x5e3d2d(0x137)+_0x55b9aa));else switch(_0x6a5bee[_0x5e3d2d(0x106)]){case _0x5e3d2d(0x133):console[_0x5e3d2d(0x120)](a5_0x565188[_0x5e3d2d(0x105)](_0x6a5bee[_0x5e3d2d(0x177)])),console[_0x5e3d2d(0x120)](),console[_0x5e3d2d(0x120)]('Usage:'),console['log']('\x20\x20tdx\x20agent\x20test\x20<path>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20from\x20path'),console[_0x5e3d2d(0x120)]('\x20\x20tdx\x20agent\x20test\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20(requires\x20context\x20or\x20tdx.json)'),console[_0x5e3d2d(0x120)](),console[_0x5e3d2d(0x120)](_0x5e3d2d(0x14a));return 0x1;case _0x5e3d2d(0x10f):console[_0x5e3d2d(0x120)](a5_0x565188[_0x5e3d2d(0x105)](_0x6a5bee[_0x5e3d2d(0x177)])),console[_0x5e3d2d(0x120)](),console[_0x5e3d2d(0x120)](_0x5e3d2d(0x17e)+_0x6a5bee['llmProject']+_0x5e3d2d(0x158));return 0x1;case _0x5e3d2d(0x112):{const _0x4e10b3=a5_0x418b8b[_0x5e3d2d(0x114)](_0x6a5bee[_0x5e3d2d(0x13e)]);console[_0x5e3d2d(0x120)](a5_0x565188[_0x5e3d2d(0x105)](_0x5e3d2d(0x134)+_0x6a5bee[_0x5e3d2d(0x131)]+'\x22:'));for(const _0x35b61d of _0x6a5bee[_0x5e3d2d(0x151)]){console[_0x5e3d2d(0x120)](_0x5e3d2d(0x10a)+_0x35b61d);}return console[_0x5e3d2d(0x120)](),console['log'](_0x5e3d2d(0x168)+_0x4e10b3+_0x5e3d2d(0xef)),0x1;}case _0x5e3d2d(0x14b):console[_0x5e3d2d(0x120)](a5_0x565188['yellow']('No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22'+_0x6a5bee['llmProject']+'\x22.')),console[_0x5e3d2d(0x120)](a5_0x565188[_0x5e3d2d(0x100)](_0x5e3d2d(0x14e)+_0x6a5bee[_0x5e3d2d(0x13e)])),console[_0x5e3d2d(0x120)](),console[_0x5e3d2d(0x120)](_0x5e3d2d(0x145));return 0x1;}}const {definition:_0x571796,agentInfo:_0x1d7abd}=parseTestFile(_0x55b9aa);let _0x1a368c=_0x571796['tests'];if(_0x59f3b4){const _0x39dd55=_0x59f3b4['split'](',')[_0x5e3d2d(0x141)](_0x28f6b0=>_0x28f6b0[_0x5e3d2d(0x12f)]());_0x1a368c=_0x571796[_0x5e3d2d(0xf1)][_0x5e3d2d(0x15b)](_0xe7f222=>_0x39dd55[_0x5e3d2d(0x126)](_0xe7f222[_0x5e3d2d(0x101)]));if(_0x1a368c[_0x5e3d2d(0xfd)]===0x0)return console[_0x5e3d2d(0x120)](a5_0x565188[_0x5e3d2d(0x105)](_0x5e3d2d(0xf5)+_0x59f3b4)),console[_0x5e3d2d(0x120)](a5_0x565188['dim']('Available\x20tests:\x20'+_0x571796['tests'][_0x5e3d2d(0x141)](_0x5d8324=>_0x5d8324[_0x5e3d2d(0x101)])['join'](',\x20'))),0x1;}if(_0x2e039f){const _0x39fb8b=_0x2e039f[_0x5e3d2d(0x14f)](',')['map'](_0x2588bc=>_0x2588bc[_0x5e3d2d(0x12f)]()['toLowerCase']());_0x1a368c=_0x1a368c[_0x5e3d2d(0x15b)](_0x9971c6=>_0x9971c6[_0x5e3d2d(0x174)]?.[_0x5e3d2d(0x128)](_0x30fea4=>_0x39fb8b[_0x5e3d2d(0x126)](_0x30fea4['toLowerCase']())));if(_0x1a368c[_0x5e3d2d(0xfd)]===0x0){console[_0x5e3d2d(0x120)](a5_0x565188[_0x5e3d2d(0x105)](_0x5e3d2d(0x142)+_0x2e039f));const _0x4c9f7a=new Set();return _0x571796[_0x5e3d2d(0xf1)][_0x5e3d2d(0xfc)](_0x3430ca=>_0x3430ca[_0x5e3d2d(0x174)]?.[_0x5e3d2d(0xfc)](_0xf68287=>_0x4c9f7a[_0x5e3d2d(0x117)](_0xf68287))),_0x4c9f7a[_0x5e3d2d(0x139)]>0x0?console[_0x5e3d2d(0x120)](a5_0x565188['dim']('Available\x20tags:\x20'+[..._0x4c9f7a]['join'](',\x20'))):console[_0x5e3d2d(0x120)](a5_0x565188[_0x5e3d2d(0x100)]('No\x20tests\x20have\x20tags\x20defined.')),0x1;}}if(_0x2894c6)return this[_0x5e3d2d(0x12a)](_0xbcd5c9,{'definition':{'tests':_0x1a368c},'agentInfo':_0x1d7abd,'outputFormat':_0x535b4f,'outputFile':_0x3c2901,'testNames':_0x59f3b4});if(_0x420fd1){console[_0x5e3d2d(0x120)](a5_0x565188[_0x5e3d2d(0x165)](_0x5e3d2d(0x127))),console[_0x5e3d2d(0x120)](_0x5e3d2d(0x153)+a5_0x565188[_0x5e3d2d(0x16d)](_0x248220)),console[_0x5e3d2d(0x120)](_0x5e3d2d(0x138)+a5_0x565188['white'](_0x1d7abd['projectName'])),console[_0x5e3d2d(0x120)](_0x5e3d2d(0x110)+a5_0x565188[_0x5e3d2d(0x16d)](_0x1d7abd[_0x5e3d2d(0x160)])),console[_0x5e3d2d(0x120)](),console['log'](_0x5e3d2d(0x175)+a5_0x565188['white'](_0x1a368c[_0x5e3d2d(0xfd)]));for(let _0x14d5f1=0x0;_0x14d5f1<_0x1a368c[_0x5e3d2d(0xfd)];_0x14d5f1++){const _0x5c44c5=_0x1a368c[_0x14d5f1],_0xe1608f=_0x5c44c5['rounds'][_0x5e3d2d(0xfd)]===0x1?'round':'rounds',_0xc7a9f=_0x5c44c5[_0x5e3d2d(0x174)]?.[_0x5e3d2d(0xfd)]?'\x20['+_0x5c44c5[_0x5e3d2d(0x174)][_0x5e3d2d(0xf8)](',\x20')+']':'';console[_0x5e3d2d(0x120)]('\x20\x20'+(_0x14d5f1+0x1)+'.\x20'+a5_0x565188[_0x5e3d2d(0x16d)](_0x5c44c5[_0x5e3d2d(0x101)])+'\x20('+_0x5c44c5[_0x5e3d2d(0x11c)][_0x5e3d2d(0xfd)]+'\x20'+_0xe1608f+')'+a5_0x565188['dim'](_0xc7a9f));}return 0x0;}let _0x190ae1,_0x5df5d8;try{_0x190ae1=await _0x41a4f5[_0x5e3d2d(0x121)][_0x5e3d2d(0x16e)](_0x1d7abd['projectName']);}catch(_0x4e98c0){const _0x1b2808=_0x4e98c0 instanceof Error?_0x4e98c0[_0x5e3d2d(0x177)]:String(_0x4e98c0);return _0x1b2808[_0x5e3d2d(0x126)](_0x5e3d2d(0x11b))||_0x1b2808[_0x5e3d2d(0x108)]()[_0x5e3d2d(0x126)](_0x5e3d2d(0x172))?console[_0x5e3d2d(0x120)](a5_0x565188[_0x5e3d2d(0x104)]('✗\x20ERROR:\x20Project\x20not\x20found:\x20'+_0x1d7abd[_0x5e3d2d(0x129)])):console[_0x5e3d2d(0x120)](a5_0x565188[_0x5e3d2d(0x104)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22'+_0x1d7abd[_0x5e3d2d(0x129)]+_0x5e3d2d(0x132)+_0x1b2808)),0x1;}try{_0x5df5d8=await _0x41a4f5[_0x5e3d2d(0x121)][_0x5e3d2d(0x123)](_0x1d7abd[_0x5e3d2d(0x160)],_0x190ae1);}catch(_0x33e78a){const _0xce51ff=_0x33e78a instanceof Error?_0x33e78a[_0x5e3d2d(0x177)]:String(_0x33e78a);return _0xce51ff['includes'](_0x5e3d2d(0x11b))||_0xce51ff[_0x5e3d2d(0x108)]()[_0x5e3d2d(0x126)](_0x5e3d2d(0x172))?console[_0x5e3d2d(0x120)](a5_0x565188['red']('✗\x20ERROR:\x20Agent\x20not\x20found:\x20'+_0x1d7abd[_0x5e3d2d(0x160)])):console[_0x5e3d2d(0x120)](a5_0x565188[_0x5e3d2d(0x104)](_0x5e3d2d(0x16a)+_0x1d7abd[_0x5e3d2d(0x160)]+_0x5e3d2d(0x132)+_0xce51ff)),0x1;}let _0x114c63;if(!_0x329d4d)try{_0x114c63=await setupEvaluatorAgent(_0x41a4f5[_0x5e3d2d(0x121)],_0xcd4e8f['verbose']);}catch(_0x1c6c41){const _0x5078c6=_0x1c6c41 instanceof Error?_0x1c6c41[_0x5e3d2d(0x177)]:String(_0x1c6c41);return console[_0x5e3d2d(0x120)](a5_0x565188[_0x5e3d2d(0x104)](_0x5e3d2d(0x161)+_0x5078c6)),0x1;}console[_0x5e3d2d(0x120)](a5_0x565188[_0x5e3d2d(0x165)](_0x5e3d2d(0xee))),console[_0x5e3d2d(0x120)](_0x5e3d2d(0x173)+a5_0x565188[_0x5e3d2d(0x16d)](_0x248220)),console[_0x5e3d2d(0x120)](_0x5e3d2d(0x125)+a5_0x565188[_0x5e3d2d(0x16d)](_0x1d7abd['projectName']+'/'+_0x1d7abd['agentName'])),console[_0x5e3d2d(0x120)]();const _0x43dc5e=[],_0x2ff229=[],_0x27e0f0=Date[_0x5e3d2d(0x12c)]();for(let _0x3c2d9a=0x0;_0x3c2d9a<_0x1a368c[_0x5e3d2d(0xfd)];_0x3c2d9a++){const _0xbbc9fb=_0x1a368c[_0x3c2d9a];_0x1a368c['length']>0x1?console[_0x5e3d2d(0x120)](_0x5e3d2d(0x109)+(_0x3c2d9a+0x1)+'/'+_0x1a368c['length']+':\x20'+a5_0x565188['white'](_0xbbc9fb[_0x5e3d2d(0x101)])):console[_0x5e3d2d(0x120)](_0x5e3d2d(0x10e)+a5_0x565188[_0x5e3d2d(0x16d)](_0xbbc9fb[_0x5e3d2d(0x101)]));const _0x42a25f=createCommandSpinner('Round\x201/'+_0xbbc9fb[_0x5e3d2d(0x11c)][_0x5e3d2d(0xfd)]+_0x5e3d2d(0xec));_0x42a25f[_0x5e3d2d(0x15f)]();try{const {result:_0x50aade,conversation:_0x57889f}=await runTest(_0x41a4f5[_0x5e3d2d(0x121)],_0xbbc9fb,{'agentId':_0x5df5d8,'projectId':_0x190ae1,'site':_0x248220,'noEval':_0x329d4d,'evaluatorId':_0x114c63,'onRoundStart':(_0x5c6eae,_0x3b4173)=>{const _0x17aa85=_0x5e3d2d;_0x42a25f[_0x17aa85(0x15a)]=_0x17aa85(0x15e)+(_0x5c6eae+0x1)+'/'+_0x3b4173+_0x17aa85(0xec);},'onRoundComplete':(_0x38cc37,_0x479bb9,_0x3a1e1e)=>{const _0x26ca62=_0x5e3d2d,_0x1be16b=formatElapsed(_0x479bb9);_0x3a1e1e?console[_0x26ca62(0x120)](_0x26ca62(0x16f)+(_0x38cc37+0x1)+'/'+_0xbbc9fb['rounds'][_0x26ca62(0xfd)]+_0x26ca62(0x178)+a5_0x565188['green']('✓')+'\x20('+_0x1be16b+')'):console[_0x26ca62(0x120)](_0x26ca62(0x16f)+(_0x38cc37+0x1)+'/'+_0xbbc9fb[_0x26ca62(0x11c)][_0x26ca62(0xfd)]+_0x26ca62(0x178)+a5_0x565188[_0x26ca62(0x104)]('✗'));},'onEvaluationStart':()=>{const _0x386a6c=_0x5e3d2d;_0x42a25f[_0x386a6c(0x15a)]=_0x386a6c(0x171);},'onEvaluationComplete':_0x4203ff=>{const _0x5c5087=_0x5e3d2d,_0x8128e9=formatElapsed(_0x4203ff);console[_0x5c5087(0x120)](_0x5c5087(0xfb)+a5_0x565188[_0x5c5087(0x149)]('✓')+'\x20('+_0x8128e9+')');}});_0x42a25f[_0x5e3d2d(0x107)](),_0x43dc5e['push'](_0x50aade),_0x2ff229[_0x5e3d2d(0x11d)](_0x57889f);if(_0x50aade['status']===_0x5e3d2d(0x17a))console['log'](a5_0x565188[_0x5e3d2d(0x149)](_0x5e3d2d(0x156)+_0x50aade[_0x5e3d2d(0x106)]));else _0x50aade[_0x5e3d2d(0x154)]==='FAIL'?console[_0x5e3d2d(0x120)](a5_0x565188[_0x5e3d2d(0x104)]('✗\x20FAIL:\x20'+_0x50aade[_0x5e3d2d(0x106)])):console['log'](a5_0x565188[_0x5e3d2d(0x104)](_0x5e3d2d(0x13a)+_0x50aade[_0x5e3d2d(0x106)]));_0x50aade[_0x5e3d2d(0x13d)]&&console[_0x5e3d2d(0x120)](a5_0x565188[_0x5e3d2d(0x100)](_0x5e3d2d(0x124)+_0x50aade[_0x5e3d2d(0x13d)])),console[_0x5e3d2d(0x120)]();}catch(_0x2a2c95){_0x42a25f['stop']();const _0x128f39=_0x2a2c95 instanceof Error?_0x2a2c95['message']:String(_0x2a2c95);console[_0x5e3d2d(0x120)](a5_0x565188[_0x5e3d2d(0x104)]('✗\x20ERROR:\x20'+_0x128f39)),console['log'](),_0x43dc5e[_0x5e3d2d(0x11d)]({'name':_0xbbc9fb[_0x5e3d2d(0x101)],'status':_0x5e3d2d(0x176),'reason':_0x128f39,'timestamp':new Date()[_0x5e3d2d(0x12e)](),'duration_ms':0x0});}}const _0xf7c64c=Date[_0x5e3d2d(0x12c)]()-_0x27e0f0,_0x371e52=_0x43dc5e[_0x5e3d2d(0x15b)](_0xd5f38f=>_0xd5f38f['status']===_0x5e3d2d(0x17a))[_0x5e3d2d(0xfd)],_0x10bb26=_0x43dc5e[_0x5e3d2d(0x15b)](_0x5c2ba6=>_0x5c2ba6[_0x5e3d2d(0x154)]==='FAIL')[_0x5e3d2d(0xfd)],_0x13a50e=_0x43dc5e[_0x5e3d2d(0x15b)](_0x5b4fc0=>_0x5b4fc0[_0x5e3d2d(0x154)]===_0x5e3d2d(0x176))[_0x5e3d2d(0xfd)];console[_0x5e3d2d(0x120)]('━'['repeat'](0x3c)),console[_0x5e3d2d(0x120)](_0x5e3d2d(0x16b)),console[_0x5e3d2d(0x120)]('━'[_0x5e3d2d(0x159)](0x3c)),console[_0x5e3d2d(0x120)]('Total:\x20\x20\x20\x20'+_0x43dc5e[_0x5e3d2d(0xfd)]),console[_0x5e3d2d(0x120)](_0x5e3d2d(0xf7)+a5_0x565188[_0x5e3d2d(0x149)](_0x371e52)),console[_0x5e3d2d(0x120)](_0x5e3d2d(0x144)+a5_0x565188[_0x5e3d2d(0x104)](_0x10bb26));_0x13a50e>0x0&&console['log'](_0x5e3d2d(0x113)+a5_0x565188[_0x5e3d2d(0x104)](_0x13a50e));console['log']('Duration:\x20'+formatElapsed(_0xf7c64c)),console[_0x5e3d2d(0x120)]('━'[_0x5e3d2d(0x159)](0x3c));const _0x5b73be=_0x43dc5e[_0x5e3d2d(0x15b)](_0x3d5a2c=>_0x3d5a2c['status']!=='PASS');if(_0x5b73be[_0x5e3d2d(0xfd)]>0x0){console[_0x5e3d2d(0x120)](),console['log']('Failed\x20Tests:');for(const _0x4a1736 of _0x5b73be){const _0x43006a=a5_0x565188[_0x5e3d2d(0x104)]('✗'),_0x55132b=_0x4a1736['reason']['length']>0x32?_0x4a1736[_0x5e3d2d(0x106)][_0x5e3d2d(0xfa)](0x0,0x32)+_0x5e3d2d(0x155):_0x4a1736[_0x5e3d2d(0x106)];console[_0x5e3d2d(0x120)]('\x20\x20'+_0x43006a+'\x20'+_0x4a1736[_0x5e3d2d(0x101)]+':\x20'+_0x55132b);}}const _0x11d9ef={'summary':{'total':_0x43dc5e[_0x5e3d2d(0xfd)],'passed':_0x371e52,'failed':_0x10bb26,'errors':_0x13a50e>0x0?_0x13a50e:undefined,'duration_ms':_0xf7c64c},'tests':_0x43dc5e,'agent':{'project':_0x1d7abd[_0x5e3d2d(0x129)],'name':_0x1d7abd[_0x5e3d2d(0x160)],'site':_0x248220},'timestamp':new Date(_0x27e0f0)['toISOString']()};try{const _0x37ce7b=buildCachedTestRun(_0x2ff229,{'site':_0x248220,'projectId':_0x190ae1,'projectName':_0x1d7abd[_0x5e3d2d(0x129)],'agentId':_0x5df5d8,'agentName':_0x1d7abd['agentName'],'testYmlPath':a5_0x418b8b[_0x5e3d2d(0x111)](_0x1d7abd[_0x5e3d2d(0x136)])});saveLastTestRun(_0x37ce7b);}catch{}if(_0x535b4f!==_0x5e3d2d(0x170)||_0x3c2901){const _0x131a1f=formatResults(_0x11d9ef,_0x535b4f);if(_0x3c2901)try{a5_0x5ec645['writeFileSync'](_0x3c2901,_0x131a1f,_0x5e3d2d(0x135)),console['log'](),console[_0x5e3d2d(0x120)](a5_0x565188[_0x5e3d2d(0x100)](_0x5e3d2d(0xed)+_0x3c2901));}catch(_0x1ac994){return console[_0x5e3d2d(0x120)](),console['log'](a5_0x565188[_0x5e3d2d(0x104)](_0x5e3d2d(0x157)+_0x1ac994)),0x1;}else console['log'](),console[_0x5e3d2d(0x120)](_0x131a1f);}return _0x5b73be[_0x5e3d2d(0xfd)]>0x0?0x1:0x0;}async['executeReeval'](_0x1970b9,_0x504ad1){const _0x3982f5=a5_0x523791,{options:_0x2db70f,tdx:_0x5a1cfa}=_0x1970b9,{definition:_0x40b1dc,agentInfo:_0x190099,outputFormat:_0x11cc7b,outputFile:_0x4433e9}=_0x504ad1,_0x3796e4=_0x2db70f[_0x3982f5(0x13f)],_0x32b91e=loadLastTestRun();if(!_0x32b91e)return console[_0x3982f5(0x120)](a5_0x565188['red']('Error:\x20No\x20previous\x20test\x20run\x20found.')),console[_0x3982f5(0x120)](a5_0x565188[_0x3982f5(0x100)]('Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.')),0x1;if(_0x32b91e['agent'][_0x3982f5(0x160)]!==_0x190099['agentName'])return console[_0x3982f5(0x120)](a5_0x565188[_0x3982f5(0x104)]('Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22'+_0x32b91e[_0x3982f5(0x10b)]['agentName']+_0x3982f5(0xf4)+_0x190099[_0x3982f5(0x160)]+'\x22.')),console[_0x3982f5(0x120)](a5_0x565188[_0x3982f5(0x100)](_0x3982f5(0x119))),0x1;const _0x2f242d=new Set(_0x32b91e[_0x3982f5(0x150)][_0x3982f5(0x141)](_0x541bfd=>_0x541bfd['testName'])),_0x4e3de2=_0x40b1dc[_0x3982f5(0xf1)][_0x3982f5(0x15b)](_0x152eea=>!_0x2f242d['has'](_0x152eea['name']));if(_0x4e3de2[_0x3982f5(0xfd)]>0x0&&_0x32b91e['site']!==_0x3796e4)return console['log'](a5_0x565188[_0x3982f5(0x104)]('Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.')),console[_0x3982f5(0x120)](a5_0x565188[_0x3982f5(0x100)]('Cached\x20run\x20is\x20from\x20site\x20\x22'+_0x32b91e['site']+_0x3982f5(0x10d)+_0x3796e4+'\x22.')),console['log'](a5_0x565188[_0x3982f5(0x100)](_0x3982f5(0x11e)+_0x32b91e[_0x3982f5(0x13f)]+'\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.')),0x1;const _0x1109d6=_0x40b1dc['tests']['filter'](_0xfed0fc=>_0x2f242d[_0x3982f5(0x179)](_0xfed0fc[_0x3982f5(0x101)])),_0x4eb7c1=_0x4e3de2;let _0x3298bc;try{_0x3298bc=await setupEvaluatorAgent(_0x5a1cfa[_0x3982f5(0x121)],_0x2db70f[_0x3982f5(0x163)]);}catch(_0x4660b3){const _0x43b9d6=_0x4660b3 instanceof Error?_0x4660b3['message']:String(_0x4660b3);return console[_0x3982f5(0x120)](a5_0x565188['red'](_0x3982f5(0x161)+_0x43b9d6)),0x1;}console[_0x3982f5(0x120)](a5_0x565188['cyan'](_0x3982f5(0x15c))),console[_0x3982f5(0x120)](_0x3982f5(0x10c)+a5_0x565188[_0x3982f5(0x16d)](_0x32b91e[_0x3982f5(0x17c)])),console[_0x3982f5(0x120)](_0x3982f5(0x125)+a5_0x565188[_0x3982f5(0x16d)](_0x32b91e[_0x3982f5(0x10b)][_0x3982f5(0x129)]+'/'+_0x32b91e[_0x3982f5(0x10b)][_0x3982f5(0x160)]));_0x4eb7c1[_0x3982f5(0xfd)]>0x0&&console[_0x3982f5(0x120)](_0x3982f5(0x115)+a5_0x565188[_0x3982f5(0x105)](_0x4eb7c1[_0x3982f5(0xfd)]));console[_0x3982f5(0x120)]();const _0x282ca8=[],_0xfd1db6=Date[_0x3982f5(0x12c)](),_0x5c5c4d=createCommandSpinner('Re-evaluating...');if(_0x1109d6['length']>0x0)try{const _0x3cdf46=await reevaluateFromCache(_0x5a1cfa['llm'],_0x32b91e,{'tests':_0x1109d6},{'evaluatorId':_0x3298bc,'onTestStart':(_0x1dd863,_0x1528d6,_0x3108c0)=>{const _0x63ac71=_0x3982f5;_0x5c5c4d[_0x63ac71(0x15a)]='Re-evaluating\x20'+(_0x1528d6+0x1)+'/'+_0x3108c0+':\x20'+_0x1dd863+'...';if(!_0x5c5c4d[_0x63ac71(0x148)])_0x5c5c4d[_0x63ac71(0x15f)]();},'onTestComplete':(_0x5e49ce,_0x4ed3ce)=>{const _0x33a452=_0x3982f5;_0x5c5c4d[_0x33a452(0x107)]();if(_0x4ed3ce[_0x33a452(0x154)]===_0x33a452(0x17a))console[_0x33a452(0x120)](a5_0x565188[_0x33a452(0x149)](_0x33a452(0x156)+_0x5e49ce)+a5_0x565188[_0x33a452(0x100)](_0x33a452(0x143)));else _0x4ed3ce[_0x33a452(0x154)]==='FAIL'?console[_0x33a452(0x120)](a5_0x565188[_0x33a452(0x104)](_0x33a452(0x130)+_0x5e49ce+'\x20-\x20'+_0x4ed3ce[_0x33a452(0x106)])+a5_0x565188[_0x33a452(0x100)](_0x33a452(0x143))):console[_0x33a452(0x120)](a5_0x565188[_0x33a452(0x104)](_0x33a452(0x13a)+_0x5e49ce+_0x33a452(0x166)+_0x4ed3ce[_0x33a452(0x106)]));_0x4ed3ce['conversation_url']&&console[_0x33a452(0x120)](a5_0x565188[_0x33a452(0x100)](_0x33a452(0x147)+_0x4ed3ce['conversation_url'])),_0x282ca8[_0x33a452(0x11d)](_0x4ed3ce);},'onTestSkipped':(_0x13c3ab,_0x2cebac)=>{const _0x4dfe1d=_0x3982f5;_0x5c5c4d[_0x4dfe1d(0x107)](),console[_0x4dfe1d(0x120)](a5_0x565188[_0x4dfe1d(0x105)](_0x4dfe1d(0x11f)+_0x13c3ab+'\x20-\x20'+_0x2cebac));}});for(const _0x433844 of _0x3cdf46){!_0x282ca8['find'](_0x11369a=>_0x11369a[_0x3982f5(0x101)]===_0x433844[_0x3982f5(0x101)])&&_0x282ca8['push'](_0x433844);}}catch(_0xb7889b){_0x5c5c4d[_0x3982f5(0x107)]();const _0x42a35c=_0xb7889b instanceof Error?_0xb7889b[_0x3982f5(0x177)]:String(_0xb7889b);return console[_0x3982f5(0x120)](a5_0x565188['red'](_0x3982f5(0x169)+_0x42a35c)),0x1;}_0x5c5c4d[_0x3982f5(0x107)]();if(_0x4eb7c1[_0x3982f5(0xfd)]>0x0){console[_0x3982f5(0x120)](),console[_0x3982f5(0x120)](a5_0x565188['cyan']('Executing\x20new\x20tests...'));const {projectId:_0x2a93ae,agentId:_0x12466d}=_0x32b91e[_0x3982f5(0x10b)];for(const _0x2bd9a9 of _0x4eb7c1){console[_0x3982f5(0x120)](_0x3982f5(0x16c)+a5_0x565188[_0x3982f5(0x16d)](_0x2bd9a9[_0x3982f5(0x101)]));const _0x7eafb2=createCommandSpinner(_0x3982f5(0x17b)+_0x2bd9a9[_0x3982f5(0x11c)][_0x3982f5(0xfd)]+':\x20Sending\x20user\x20input...');_0x7eafb2[_0x3982f5(0x15f)]();try{const {result:_0x5eb39c}=await runTest(_0x5a1cfa[_0x3982f5(0x121)],_0x2bd9a9,{'agentId':_0x12466d,'projectId':_0x2a93ae,'site':_0x32b91e['site'],'noEval':![],'evaluatorId':_0x3298bc,'onRoundStart':(_0x21de15,_0x3e9225)=>{const _0x38735f=_0x3982f5;_0x7eafb2[_0x38735f(0x15a)]=_0x38735f(0x15e)+(_0x21de15+0x1)+'/'+_0x3e9225+_0x38735f(0xec);},'onRoundComplete':(_0x461ddc,_0x3bdc3b,_0xd22a32)=>{const _0x1874f0=_0x3982f5,_0x57ff50=formatElapsed(_0x3bdc3b);_0xd22a32?console['log'](_0x1874f0(0x16f)+(_0x461ddc+0x1)+'/'+_0x2bd9a9[_0x1874f0(0x11c)][_0x1874f0(0xfd)]+_0x1874f0(0x178)+a5_0x565188[_0x1874f0(0x149)]('✓')+'\x20('+_0x57ff50+')'):console['log'](_0x1874f0(0x16f)+(_0x461ddc+0x1)+'/'+_0x2bd9a9[_0x1874f0(0x11c)][_0x1874f0(0xfd)]+_0x1874f0(0x178)+a5_0x565188[_0x1874f0(0x104)]('✗'));},'onEvaluationStart':()=>{const _0x215b36=_0x3982f5;_0x7eafb2[_0x215b36(0x15a)]=_0x215b36(0x171);},'onEvaluationComplete':_0x31a421=>{const _0x50d86f=_0x3982f5,_0x3ddbfa=formatElapsed(_0x31a421);console['log'](_0x50d86f(0xfb)+a5_0x565188[_0x50d86f(0x149)]('✓')+'\x20('+_0x3ddbfa+')');}});_0x7eafb2[_0x3982f5(0x107)](),_0x282ca8[_0x3982f5(0x11d)](_0x5eb39c);if(_0x5eb39c[_0x3982f5(0x154)]===_0x3982f5(0x17a))console[_0x3982f5(0x120)](a5_0x565188['green'](_0x3982f5(0x156)+_0x5eb39c[_0x3982f5(0x106)])+a5_0x565188[_0x3982f5(0x100)](_0x3982f5(0x11a)));else _0x5eb39c[_0x3982f5(0x154)]===_0x3982f5(0x164)?console[_0x3982f5(0x120)](a5_0x565188['red'](_0x3982f5(0x130)+_0x5eb39c['reason'])+a5_0x565188[_0x3982f5(0x100)](_0x3982f5(0x11a))):console['log'](a5_0x565188[_0x3982f5(0x104)](_0x3982f5(0x13a)+_0x5eb39c[_0x3982f5(0x106)]));_0x5eb39c[_0x3982f5(0x13d)]&&console[_0x3982f5(0x120)](a5_0x565188[_0x3982f5(0x100)](_0x3982f5(0x147)+_0x5eb39c[_0x3982f5(0x13d)]));}catch(_0x28b509){_0x7eafb2[_0x3982f5(0x107)]();const _0x545d31=_0x28b509 instanceof Error?_0x28b509[_0x3982f5(0x177)]:String(_0x28b509);console[_0x3982f5(0x120)](a5_0x565188[_0x3982f5(0x104)]('✗\x20ERROR:\x20'+_0x545d31)),_0x282ca8['push']({'name':_0x2bd9a9['name'],'status':_0x3982f5(0x176),'reason':_0x545d31,'timestamp':new Date()[_0x3982f5(0x12e)](),'duration_ms':0x0});}}}console[_0x3982f5(0x120)]();const _0x466971=Date[_0x3982f5(0x12c)]()-_0xfd1db6,_0x3ccc0c=_0x282ca8['filter'](_0x98808b=>_0x98808b[_0x3982f5(0x154)]===_0x3982f5(0x17a))[_0x3982f5(0xfd)],_0x5a4f89=_0x282ca8[_0x3982f5(0x15b)](_0x842a=>_0x842a['status']===_0x3982f5(0x164))[_0x3982f5(0xfd)],_0x1b38c1=_0x282ca8['filter'](_0xb7612d=>_0xb7612d[_0x3982f5(0x154)]===_0x3982f5(0x176))[_0x3982f5(0xfd)];console[_0x3982f5(0x120)]('━'[_0x3982f5(0x159)](0x3c)),console[_0x3982f5(0x120)](_0x3982f5(0x12b)),console[_0x3982f5(0x120)]('━'[_0x3982f5(0x159)](0x3c)),console[_0x3982f5(0x120)]('Total:\x20\x20\x20\x20'+_0x282ca8[_0x3982f5(0xfd)]),console[_0x3982f5(0x120)](_0x3982f5(0xf7)+a5_0x565188[_0x3982f5(0x149)](_0x3ccc0c)),console[_0x3982f5(0x120)](_0x3982f5(0x144)+a5_0x565188[_0x3982f5(0x104)](_0x5a4f89));_0x1b38c1>0x0&&console[_0x3982f5(0x120)](_0x3982f5(0x113)+a5_0x565188[_0x3982f5(0x104)](_0x1b38c1));console[_0x3982f5(0x120)](_0x3982f5(0x146)+formatElapsed(_0x466971)),console['log']('━'[_0x3982f5(0x159)](0x3c));const _0x46a370={'summary':{'total':_0x282ca8[_0x3982f5(0xfd)],'passed':_0x3ccc0c,'failed':_0x5a4f89,'errors':_0x1b38c1>0x0?_0x1b38c1:undefined,'duration_ms':_0x466971},'tests':_0x282ca8,'agent':{'project':_0x190099[_0x3982f5(0x129)],'name':_0x190099[_0x3982f5(0x160)],'site':_0x3796e4},'timestamp':new Date(_0xfd1db6)[_0x3982f5(0x12e)]()};if(_0x11cc7b!=='table'||_0x4433e9){const _0xc0dc35=formatResults(_0x46a370,_0x11cc7b);if(_0x4433e9)try{a5_0x5ec645[_0x3982f5(0x12d)](_0x4433e9,_0xc0dc35,'utf-8'),console[_0x3982f5(0x120)](),console[_0x3982f5(0x120)](a5_0x565188[_0x3982f5(0x100)]('Output\x20written\x20to:\x20'+_0x4433e9));}catch(_0x1892d8){return console[_0x3982f5(0x120)](),console['log'](a5_0x565188['red'](_0x3982f5(0x157)+_0x1892d8)),0x1;}else console[_0x3982f5(0x120)](),console[_0x3982f5(0x120)](_0xc0dc35);}const _0x325423=_0x282ca8[_0x3982f5(0x15b)](_0x327177=>_0x327177[_0x3982f5(0x154)]!==_0x3982f5(0x17a));return _0x325423[_0x3982f5(0xfd)]>0x0?0x1:0x0;}}
@@ -1 +1 @@
1
- const a6_0xff9c24=a6_0x4144;function a6_0x4144(_0x4e6baf,_0x398b69){_0x4e6baf=_0x4e6baf-0x12a;const _0x5d3456=a6_0x5d34();let _0x414445=_0x5d3456[_0x4e6baf];return _0x414445;}(function(_0x2a2a18,_0x41aef8){const _0x118309=a6_0x4144,_0x13d3a9=_0x2a2a18();while(!![]){try{const _0x2cad58=-parseInt(_0x118309(0x16c))/0x1*(parseInt(_0x118309(0x155))/0x2)+parseInt(_0x118309(0x163))/0x3*(-parseInt(_0x118309(0x13c))/0x4)+-parseInt(_0x118309(0x14f))/0x5*(parseInt(_0x118309(0x168))/0x6)+parseInt(_0x118309(0x159))/0x7+parseInt(_0x118309(0x14d))/0x8+parseInt(_0x118309(0x15f))/0x9*(-parseInt(_0x118309(0x151))/0xa)+-parseInt(_0x118309(0x157))/0xb*(-parseInt(_0x118309(0x13b))/0xc);if(_0x2cad58===_0x41aef8)break;else _0x13d3a9['push'](_0x13d3a9['shift']());}catch(_0x58540d){_0x13d3a9['push'](_0x13d3a9['shift']());}}}(a6_0x5d34,0xaf1c5));import{BaseCommand}from'./command.js';function a6_0x5d34(){const _0x311824=['indexOf','883756QDlfUK','status','22BZOMai','trim','3222401GecgJS','isArray','method','toLowerCase','llm','error','9tqybwL','validate','Endpoint\x20must\x20start\x20with\x20/:\x20','\x22.\x20','8571lWRqxZ','name','output','site','data','48fZnsRl','Invalid\x20HTTP\x20method:\x20','color','file','1XIpsRF','proxy-authorization','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','x-trino-user','DELETE','llm-proxy','Error:\x20','Results\x20saved\x20to\x20','type','set-cookie2','message','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','.\x20Valid\x20methods:\x20','GET','noColor','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','set-cookie','description','entries','9179904TCdwzX','428eSaBlH','verbose','POST','cookie','api','substring','has','includes','x-auth-token','header','Invalid\x20header\x20format:\x20\x22','length','join','<\x20HTTP/1.1\x20','Invalid\x20API\x20type:\x20','.\x20Valid\x20types:\x20','body','7143696irCOeI','x-xsrf-token','174175WbXEdh','log','11397790dnorXv','toUpperCase','stack'];a6_0x5d34=function(){return _0x311824;};return a6_0x5d34();}import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set(['authorization',a6_0xff9c24(0x16d),a6_0xff9c24(0x13f),a6_0xff9c24(0x138),a6_0xff9c24(0x130),a6_0xff9c24(0x14e),a6_0xff9c24(0x144),a6_0xff9c24(0x12a)]);function isSensitiveHeader(_0x7b1282){const _0x9ef4d1=a6_0xff9c24;return SENSITIVE_HEADERS[_0x9ef4d1(0x142)](_0x7b1282[_0x9ef4d1(0x15c)]());}function parseHeader(_0x1510a4){const _0x476254=a6_0xff9c24,_0x1b48da=_0x1510a4[_0x476254(0x154)](':');if(_0x1b48da===-0x1)throw new Error(_0x476254(0x146)+_0x1510a4+_0x476254(0x162)+_0x476254(0x132));const _0x5071d6=_0x1510a4[_0x476254(0x141)](0x0,_0x1b48da)[_0x476254(0x158)](),_0x1e807a=_0x1510a4['substring'](_0x1b48da+0x1)[_0x476254(0x158)]();if(!_0x5071d6)throw new Error(_0x476254(0x137)+_0x1510a4+'\x22');return[_0x5071d6,_0x1e807a];}export class ApiCommand extends BaseCommand{[a6_0xff9c24(0x164)]='api';[a6_0xff9c24(0x139)]='Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs';[a6_0xff9c24(0x160)](_0x9e8937){const _0x285a53=a6_0xff9c24,{args:_0x2f050c,options:_0x3fc720}=_0x9e8937,_0xbeffd6=_0x3fc720;if(_0x2f050c[_0x285a53(0x147)]===0x0)return _0x285a53(0x16e);const _0x380dcd=_0x2f050c[0x0];if(!_0x380dcd['startsWith']('/'))return _0x285a53(0x161)+_0x380dcd;const _0x12b2c2=_0xbeffd6[_0x285a53(0x167)],_0x2bf4da=_0xbeffd6[_0x285a53(0x16b)];if(_0x12b2c2&&_0x2bf4da)return _0x285a53(0x133);const _0xa4a26a=_0xbeffd6[_0x285a53(0x15b)]||_0x285a53(0x135),_0x3dfeef=['GET',_0x285a53(0x13e),'PUT',_0x285a53(0x12b),'PATCH'];if(!_0x3dfeef[_0x285a53(0x143)](_0xa4a26a[_0x285a53(0x152)]()))return _0x285a53(0x169)+_0xa4a26a+_0x285a53(0x134)+_0x3dfeef[_0x285a53(0x148)](',\x20');const _0x466257=_0xbeffd6[_0x285a53(0x12f)]||'td',_0x1db654=['td','cdp','workflow','trino',_0x285a53(0x15d),_0x285a53(0x12c)];if(!_0x1db654['includes'](_0x466257))return _0x285a53(0x14a)+_0x466257+_0x285a53(0x14b)+_0x1db654[_0x285a53(0x148)](',\x20');return undefined;}async['execute'](_0x5f5030){const _0x3fe5d7=a6_0xff9c24,{options:_0x2b77f7,args:_0x24a049,tdx:_0x53f0b7}=_0x5f5030,_0x146b94=_0x2b77f7,_0x336283=_0x24a049[0x0],_0x33a798=(_0x146b94[_0x3fe5d7(0x15b)]||_0x3fe5d7(0x135))[_0x3fe5d7(0x152)](),_0x302109=_0x146b94[_0x3fe5d7(0x167)],_0x4acf8b=_0x146b94['file'],_0x4f02c0=_0x146b94[_0x3fe5d7(0x145)],_0x301be5=_0x146b94[_0x3fe5d7(0x12f)]||'td';try{const _0x25ae32={};if(_0x4f02c0){const _0x502de8=Array[_0x3fe5d7(0x15a)](_0x4f02c0)?_0x4f02c0:[_0x4f02c0];for(const _0x322b64 of _0x502de8){const [_0x2c58fe,_0x51d960]=parseHeader(_0x322b64);_0x25ae32[_0x2c58fe]=_0x51d960;}}let _0x19ca23;if(_0x302109)_0x19ca23=_0x302109;else{if(_0x4acf8b)try{_0x19ca23=RawAPI['readBodyFromFile'](_0x4acf8b);}catch(_0x3f03e7){return console[_0x3fe5d7(0x15e)](_0x3fe5d7(0x12d)+(_0x3f03e7 instanceof Error?_0x3f03e7[_0x3fe5d7(0x131)]:String(_0x3f03e7))),0x1;}}const _0x2fb146={'method':_0x33a798,'apiType':_0x301be5,'includeHeaders':_0x2b77f7[_0x3fe5d7(0x13d)]};_0x19ca23&&(_0x2fb146[_0x3fe5d7(0x14c)]=_0x19ca23);Object['keys'](_0x25ae32)[_0x3fe5d7(0x147)]>0x0&&(_0x2fb146['headers']=_0x25ae32);if(_0x2b77f7[_0x3fe5d7(0x13d)]){const _0x3786a8=resolveSite(_0x2b77f7[_0x3fe5d7(0x166)]),_0x1018e1=getEndpoint(_0x3786a8,_0x301be5),_0x4e363e=''+_0x1018e1+_0x336283;console[_0x3fe5d7(0x15e)]('>\x20'+_0x33a798+'\x20'+_0x4e363e);const _0x5a33a8=getAuthHeaders(_0x3786a8),_0x20c005={..._0x5a33a8,..._0x25ae32};for(const [_0x7c01ee,_0x2cf712]of Object[_0x3fe5d7(0x13a)](_0x20c005)){!isSensitiveHeader(_0x7c01ee)&&console[_0x3fe5d7(0x15e)]('>\x20'+_0x7c01ee+':\x20'+_0x2cf712);}_0x19ca23&&console[_0x3fe5d7(0x15e)]('>'),console[_0x3fe5d7(0x15e)]('');}const _0x3f9414=await _0x53f0b7[_0x3fe5d7(0x140)]['request'](_0x336283,_0x2fb146);if(_0x2b77f7[_0x3fe5d7(0x13d)]&&_0x3f9414['headers']){console[_0x3fe5d7(0x15e)](_0x3fe5d7(0x149)+_0x3f9414[_0x3fe5d7(0x156)]);for(const [_0x577305,_0xfd31eb]of Object[_0x3fe5d7(0x13a)](_0x3f9414['headers'])){!isSensitiveHeader(_0x577305)&&console[_0x3fe5d7(0x15e)]('<\x20'+_0x577305+':\x20'+_0xfd31eb);}console[_0x3fe5d7(0x15e)]('');}const _0x5bc3d2=Boolean(_0x2b77f7[_0x3fe5d7(0x165)]),_0x2a68ed={'color':_0x2b77f7[_0x3fe5d7(0x16a)],'noColor':_0x2b77f7[_0x3fe5d7(0x136)]||_0x5bc3d2&&!_0x2b77f7[_0x3fe5d7(0x16a)]},_0x2c47a0=colorizeJSON(_0x3f9414[_0x3fe5d7(0x167)],_0x2a68ed);return _0x2b77f7['output']?(writeFileSync(_0x2b77f7[_0x3fe5d7(0x165)],_0x2c47a0),console['error'](_0x3fe5d7(0x12e)+_0x2b77f7[_0x3fe5d7(0x165)])):console[_0x3fe5d7(0x150)](_0x2c47a0),0x0;}catch(_0x5d3b1a){return _0x5d3b1a instanceof Error?(console[_0x3fe5d7(0x15e)](_0x3fe5d7(0x12d)+_0x5d3b1a[_0x3fe5d7(0x131)]),_0x2b77f7[_0x3fe5d7(0x13d)]&&_0x5d3b1a[_0x3fe5d7(0x153)]&&console['error']('\x0aStack\x20trace:\x0a'+_0x5d3b1a[_0x3fe5d7(0x153)])):console[_0x3fe5d7(0x15e)]('Error:\x20'+String(_0x5d3b1a)),0x1;}}}
1
+ function a6_0x46e4(){const _0x409645=['DELETE','headers','415112mjxsCv','trim','validate','entries','readBodyFromFile','verbose','join','Invalid\x20API\x20type:\x20','keys','stack','indexOf','log','x-xsrf-token','error','POST','4700829LLikup','PUT','description','length','1728664KdIowg','46677612DmKKFz','.\x20Valid\x20types:\x20','cdp','Endpoint\x20must\x20start\x20with\x20/:\x20','body','includes','method','status','llm','toLowerCase','data','execute','27ADmaaA','has','isArray','\x22.\x20','header','11ZDDOOE','message','38aweaEJ','set-cookie','x-auth-token','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','file','color','toUpperCase','24IlSQSG','Results\x20saved\x20to\x20','name','GET','site','api','startsWith','Error:\x20','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','11866570znebHU','cookie','12703WcrPXf','trino','4dUZxnK','substring','noColor','type','output','proxy-authorization','Invalid\x20HTTP\x20method:\x20','4681255WsatSz','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','set-cookie2'];a6_0x46e4=function(){return _0x409645;};return a6_0x46e4();}const a6_0x114ed4=a6_0x23d9;(function(_0x6adc84,_0x51c13b){const _0x227015=a6_0x23d9,_0x38d837=_0x6adc84();while(!![]){try{const _0x299a58=parseInt(_0x227015(0x173))/0x1*(-parseInt(_0x227015(0x160))/0x2)+-parseInt(_0x227015(0x148))/0x3+parseInt(_0x227015(0x175))/0x4*(parseInt(_0x227015(0x134))/0x5)+-parseInt(_0x227015(0x167))/0x6*(parseInt(_0x227015(0x14c))/0x7)+parseInt(_0x227015(0x139))/0x8*(parseInt(_0x227015(0x159))/0x9)+-parseInt(_0x227015(0x171))/0xa+parseInt(_0x227015(0x15e))/0xb*(parseInt(_0x227015(0x14d))/0xc);if(_0x299a58===_0x51c13b)break;else _0x38d837['push'](_0x38d837['shift']());}catch(_0x324277){_0x38d837['push'](_0x38d837['shift']());}}}(a6_0x46e4,0xf3e2a));function a6_0x23d9(_0x21ab24,_0xd443e3){_0x21ab24=_0x21ab24-0x131;const _0x46e4f2=a6_0x46e4();let _0x23d9cb=_0x46e4f2[_0x21ab24];return _0x23d9cb;}import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set(['authorization',a6_0x114ed4(0x132),a6_0x114ed4(0x172),a6_0x114ed4(0x161),a6_0x114ed4(0x136),a6_0x114ed4(0x145),a6_0x114ed4(0x162),'x-trino-user']);function isSensitiveHeader(_0x54a56b){const _0x316e4d=a6_0x114ed4;return SENSITIVE_HEADERS[_0x316e4d(0x15a)](_0x54a56b[_0x316e4d(0x156)]());}function parseHeader(_0x4f7d45){const _0x3f0cd6=a6_0x114ed4,_0x4a286b=_0x4f7d45[_0x3f0cd6(0x143)](':');if(_0x4a286b===-0x1)throw new Error('Invalid\x20header\x20format:\x20\x22'+_0x4f7d45+_0x3f0cd6(0x15c)+'Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22');const _0x52439a=_0x4f7d45[_0x3f0cd6(0x176)](0x0,_0x4a286b)['trim'](),_0x5e6eba=_0x4f7d45[_0x3f0cd6(0x176)](_0x4a286b+0x1)[_0x3f0cd6(0x13a)]();if(!_0x52439a)throw new Error(_0x3f0cd6(0x163)+_0x4f7d45+'\x22');return[_0x52439a,_0x5e6eba];}export class ApiCommand extends BaseCommand{[a6_0x114ed4(0x169)]=a6_0x114ed4(0x16c);[a6_0x114ed4(0x14a)]=a6_0x114ed4(0x16f);[a6_0x114ed4(0x13b)](_0x8a7e72){const _0x25b564=a6_0x114ed4,{args:_0x118dd8,options:_0x3fe830}=_0x8a7e72,_0x5a1b4c=_0x3fe830;if(_0x118dd8[_0x25b564(0x14b)]===0x0)return _0x25b564(0x170);const _0x2c89bf=_0x118dd8[0x0];if(!_0x2c89bf[_0x25b564(0x16d)]('/'))return _0x25b564(0x150)+_0x2c89bf;const _0x26969b=_0x5a1b4c[_0x25b564(0x157)],_0x2e4f67=_0x5a1b4c[_0x25b564(0x164)];if(_0x26969b&&_0x2e4f67)return _0x25b564(0x135);const _0x501fe2=_0x5a1b4c[_0x25b564(0x153)]||'GET',_0x5082fc=[_0x25b564(0x16a),_0x25b564(0x147),_0x25b564(0x149),_0x25b564(0x137),'PATCH'];if(!_0x5082fc[_0x25b564(0x152)](_0x501fe2[_0x25b564(0x166)]()))return _0x25b564(0x133)+_0x501fe2+'.\x20Valid\x20methods:\x20'+_0x5082fc['join'](',\x20');const _0xfa7e03=_0x5a1b4c['type']||'td',_0xb8e4af=['td',_0x25b564(0x14f),'workflow',_0x25b564(0x174),_0x25b564(0x155),'llm-proxy'];if(!_0xb8e4af[_0x25b564(0x152)](_0xfa7e03))return _0x25b564(0x140)+_0xfa7e03+_0x25b564(0x14e)+_0xb8e4af[_0x25b564(0x13f)](',\x20');return undefined;}async[a6_0x114ed4(0x158)](_0x503d1e){const _0x417dd5=a6_0x114ed4,{options:_0x371fcf,args:_0x3c9b49,tdx:_0x806433}=_0x503d1e,_0x492275=_0x371fcf,_0x372d7e=_0x3c9b49[0x0],_0x5122f7=(_0x492275[_0x417dd5(0x153)]||_0x417dd5(0x16a))[_0x417dd5(0x166)](),_0x13614f=_0x492275['data'],_0x39fe9b=_0x492275['file'],_0x4d4b51=_0x492275[_0x417dd5(0x15d)],_0x32cbe7=_0x492275[_0x417dd5(0x178)]||'td';try{const _0xb77e05={};if(_0x4d4b51){const _0x362720=Array[_0x417dd5(0x15b)](_0x4d4b51)?_0x4d4b51:[_0x4d4b51];for(const _0x27ac6c of _0x362720){const [_0x143dee,_0x33c114]=parseHeader(_0x27ac6c);_0xb77e05[_0x143dee]=_0x33c114;}}let _0x318406;if(_0x13614f)_0x318406=_0x13614f;else{if(_0x39fe9b)try{_0x318406=RawAPI[_0x417dd5(0x13d)](_0x39fe9b);}catch(_0x4986c5){return console[_0x417dd5(0x146)](_0x417dd5(0x16e)+(_0x4986c5 instanceof Error?_0x4986c5[_0x417dd5(0x15f)]:String(_0x4986c5))),0x1;}}const _0x5e8aa2={'method':_0x5122f7,'apiType':_0x32cbe7,'includeHeaders':_0x371fcf[_0x417dd5(0x13e)]};_0x318406&&(_0x5e8aa2[_0x417dd5(0x151)]=_0x318406);Object[_0x417dd5(0x141)](_0xb77e05)[_0x417dd5(0x14b)]>0x0&&(_0x5e8aa2[_0x417dd5(0x138)]=_0xb77e05);if(_0x371fcf[_0x417dd5(0x13e)]){const _0x256da9=resolveSite(_0x371fcf[_0x417dd5(0x16b)]),_0x49be9b=getEndpoint(_0x256da9,_0x32cbe7),_0x2c24ce=''+_0x49be9b+_0x372d7e;console[_0x417dd5(0x146)]('>\x20'+_0x5122f7+'\x20'+_0x2c24ce);const _0x2078d9=getAuthHeaders(_0x256da9),_0x142219={..._0x2078d9,..._0xb77e05};for(const [_0x4c6b3e,_0x424b86]of Object['entries'](_0x142219)){!isSensitiveHeader(_0x4c6b3e)&&console[_0x417dd5(0x146)]('>\x20'+_0x4c6b3e+':\x20'+_0x424b86);}_0x318406&&console[_0x417dd5(0x146)]('>'),console['error']('');}const _0x3eac2a=await _0x806433['api']['request'](_0x372d7e,_0x5e8aa2);if(_0x371fcf[_0x417dd5(0x13e)]&&_0x3eac2a[_0x417dd5(0x138)]){console[_0x417dd5(0x146)]('<\x20HTTP/1.1\x20'+_0x3eac2a[_0x417dd5(0x154)]);for(const [_0x29acc9,_0x27caa4]of Object[_0x417dd5(0x13c)](_0x3eac2a[_0x417dd5(0x138)])){!isSensitiveHeader(_0x29acc9)&&console['error']('<\x20'+_0x29acc9+':\x20'+_0x27caa4);}console[_0x417dd5(0x146)]('');}const _0xbf939f=Boolean(_0x371fcf['output']),_0x4bcf9a={'color':_0x371fcf[_0x417dd5(0x165)],'noColor':_0x371fcf[_0x417dd5(0x177)]||_0xbf939f&&!_0x371fcf[_0x417dd5(0x165)]},_0x4b77e2=colorizeJSON(_0x3eac2a[_0x417dd5(0x157)],_0x4bcf9a);return _0x371fcf[_0x417dd5(0x131)]?(writeFileSync(_0x371fcf['output'],_0x4b77e2),console[_0x417dd5(0x146)](_0x417dd5(0x168)+_0x371fcf['output'])):console[_0x417dd5(0x144)](_0x4b77e2),0x0;}catch(_0x4631dc){return _0x4631dc instanceof Error?(console[_0x417dd5(0x146)](_0x417dd5(0x16e)+_0x4631dc[_0x417dd5(0x15f)]),_0x371fcf[_0x417dd5(0x13e)]&&_0x4631dc[_0x417dd5(0x142)]&&console['error']('\x0aStack\x20trace:\x0a'+_0x4631dc[_0x417dd5(0x142)])):console[_0x417dd5(0x146)](_0x417dd5(0x16e)+String(_0x4631dc)),0x1;}}}
@@ -1 +1 @@
1
- const a7_0x4cc1d2=a7_0x3c4b;function a7_0x2a9a(){const _0x40746a=['✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','5643pJQgYP','You\x20can\x20find\x20your\x20API\x20key\x20at:','No\x20credentials\x20found\x20in\x20keychain','jobs','Choose\x20authentication\x20method:','trim','tdx:\x20auth\x20setup','User:\x20','5727246shBmGK','log','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','\x20(site:\x20','profile','API\x20key','\x20(profile:\x20','API\x20Key','Setup\x20API\x20key\x20authentication\x20interactively','Validating\x20API\x20key...','✓\x20Authentication\x20successful\x0a','red','message','getUserInfo','\x20for\x20profile:\x20','/app/mp/ak','Enter\x20your\x20TD\x20API\x20key:','filter','3968soZDYd','yellow','Setup\x20cancelled','API\x20key\x20cannot\x20be\x20empty','site','warn','create','No\x20credential\x20found','Setting\x20up\x20authentication\x20for\x20site:\x20','password','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','Read\x20credential\x20from\x20','auth:clear','Read\x20credential\x20from\x20keychain','268aAmUMW','Remove\x20API\x20key\x20from\x20system\x20keychain','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','9812400CkgfVM','\x20removed\x20from\x20keychain','error','✓\x20Profile\x20\x27','us01','execute','method','Name:\x20','oauth','tdx\x20profile:\x20','6794217ulNrar','✗\x20Validation\x20failed:\x20','8834VkESgq','apikey','Credential\x20type:\x20OAuth','bold','all','ERROR','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','last_name','tdx:\x20auth\x20clear','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','description','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','apiKey','status','auth','logLevel','\x27\x20registered','7674855pzSZCU','join','email','✓\x20Default\x20site\x20set\x20to\x20','\x0aSetup\x20cancelled','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','3489400pSupNQ','System\x20keychain\x20is\x20not\x20available','first_name','name'];a7_0x2a9a=function(){return _0x40746a;};return a7_0x2a9a();}(function(_0x4f1791,_0x40e6ab){const _0x10557e=a7_0x3c4b,_0x45cc1d=_0x4f1791();while(!![]){try{const _0x259113=parseInt(_0x10557e(0x1ab))/0x1*(parseInt(_0x10557e(0x19c))/0x2)+parseInt(_0x10557e(0x1c7))/0x3*(parseInt(_0x10557e(0x1e1))/0x4)+parseInt(_0x10557e(0x1bc))/0x5+-parseInt(_0x10557e(0x19f))/0x6+-parseInt(_0x10557e(0x1cf))/0x7+-parseInt(_0x10557e(0x1c2))/0x8+-parseInt(_0x10557e(0x1a9))/0x9;if(_0x259113===_0x40e6ab)break;else _0x45cc1d['push'](_0x45cc1d['shift']());}catch(_0x2661ed){_0x45cc1d['push'](_0x45cc1d['shift']());}}}(a7_0x2a9a,0xe57ed));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens}from'../core/oauth-keychain.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{deleteOAuthTokens}from'../core/oauth-keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';function a7_0x3c4b(_0x46cd82,_0x3054aa){_0x46cd82=_0x46cd82-0x190;const _0x2a9a18=a7_0x2a9a();let _0x3c4b6d=_0x2a9a18[_0x46cd82];return _0x3c4b6d;}import{isOAuthSupported}from'../core/oauth.js';import{runOAuthLoginFlow}from'./auth-login-command.js';import{promptSiteSelection}from'../core/constants.js';import a7_0x2d8506 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_0x5c29a9 from'chalk';export class AuthSetupCommand extends BaseCommand{[a7_0x4cc1d2(0x1c5)]='auth:setup';[a7_0x4cc1d2(0x1b5)]=a7_0x4cc1d2(0x1d7);async[a7_0x4cc1d2(0x1a4)](_0x491cda){const _0x5a63f3=a7_0x4cc1d2,{options:_0x46b22a}=_0x491cda,_0x17d39f=_0x46b22a[_0x5a63f3(0x1d3)];console[_0x5a63f3(0x1d0)](a7_0x5c29a9[_0x5a63f3(0x1ae)](_0x5a63f3(0x1cd)));const _0x3642d4=_0x46b22a[_0x5a63f3(0x192)]||_0x5a63f3(0x1a3),_0x35ded0=await promptSiteSelection(_0x3642d4,_0x17d39f,_0x5a63f3(0x190));if(!_0x35ded0)return 0x1;const _0xa74909=resolveSite(_0x35ded0);if(isOAuthSupported(_0xa74909)){const _0x9971ac=await a7_0x2d8506({'type':'select','name':_0x5a63f3(0x1a5),'message':_0x5a63f3(0x1cb),'choices':[{'title':'OAuth\x20(browser\x20login)','value':_0x5a63f3(0x1a7)},{'title':_0x5a63f3(0x1d6),'value':_0x5a63f3(0x1ac)}]});if(!_0x9971ac[_0x5a63f3(0x1a5)])return console[_0x5a63f3(0x1d0)](_0x5a63f3(0x1c0)),0x1;if(_0x9971ac[_0x5a63f3(0x1a5)]===_0x5a63f3(0x1a7))return await runOAuthLoginFlow(_0xa74909,_0x17d39f,_0x46b22a[_0x5a63f3(0x1ba)]??LogLevel[_0x5a63f3(0x1b0)]),0x0;}console['log'](_0x5a63f3(0x196)+_0xa74909),console[_0x5a63f3(0x1d0)](_0x5a63f3(0x1c8)),console[_0x5a63f3(0x1d0)]('\x20\x20'+getConsoleUrl(_0xa74909,_0x5a63f3(0x1de)));const _0x2fe1b8=await a7_0x2d8506({'type':_0x5a63f3(0x197),'name':_0x5a63f3(0x1b7),'message':_0x5a63f3(0x1df),'validate':_0x71841b=>{const _0x57fa7e=_0x5a63f3;if(!_0x71841b||!_0x71841b[_0x57fa7e(0x1cc)]())return _0x57fa7e(0x191);return!![];}});if(!_0x2fe1b8[_0x5a63f3(0x1b7)])return console[_0x5a63f3(0x1d0)](_0x5a63f3(0x1c0)),0x1;const _0x462b67=_0x2fe1b8['apiKey'];console[_0x5a63f3(0x1d0)](_0x5a63f3(0x1d8));try{const _0x5cad58=TDX[_0x5a63f3(0x194)]({'site':_0xa74909,'apiKey':_0x462b67['trim'](),'logLevel':_0x46b22a[_0x5a63f3(0x1ba)]??LogLevel[_0x5a63f3(0x1b0)]}),_0x5c1863=await _0x5cad58[_0x5a63f3(0x1ca)][_0x5a63f3(0x1dc)]();console['log'](_0x5a63f3(0x1b1)+_0x5c1863[_0x5a63f3(0x1be)]+')');const _0x3af178=await isKeychainAvailable();_0x3af178?(await saveAPIKeyAsync(_0x462b67[_0x5a63f3(0x1cc)](),_0xa74909,_0x17d39f),console['log'](_0x5a63f3(0x1c6)+(_0x17d39f?_0x5a63f3(0x1d5)+_0x17d39f+')':''))):(console[_0x5a63f3(0x193)](a7_0x5c29a9[_0x5a63f3(0x1e2)](_0x5a63f3(0x19e))),console[_0x5a63f3(0x193)](a7_0x5c29a9[_0x5a63f3(0x1e2)](_0x5a63f3(0x1c1))));if(_0x17d39f){const _0x37ac95={'site':_0xa74909};saveProfileToUserConfig(_0x17d39f,_0x37ac95),console['log'](_0x5a63f3(0x1a2)+_0x17d39f+_0x5a63f3(0x1bb));}else saveDefaultSiteToUserConfig(_0xa74909),console[_0x5a63f3(0x1d0)](_0x5a63f3(0x1bf)+_0xa74909);const _0x221a00=_0x17d39f?'\x20--profile\x20'+_0x17d39f:'';return console[_0x5a63f3(0x1d0)](),console[_0x5a63f3(0x1d0)]('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console[_0x5a63f3(0x1d0)]('\x20\x20tdx'+_0x221a00+_0x5a63f3(0x1d1)),console['log']('\x20\x20tdx'+_0x221a00+_0x5a63f3(0x1b6)),0x0;}catch(_0x1f554){if(_0x1f554 instanceof HTTPClientError&&_0x1f554[_0x5a63f3(0x1b8)]===0x191)return printAuthError(_0x1f554),0x1;return console[_0x5a63f3(0x1a1)](a7_0x5c29a9[_0x5a63f3(0x1da)](_0x5a63f3(0x1aa)+(_0x1f554 instanceof Error?_0x1f554[_0x5a63f3(0x1db)]:String(_0x1f554)))),console['error'](_0x5a63f3(0x198)),0x1;}}}export class AuthStatusCommand extends BaseCommand{['name']=a7_0x4cc1d2(0x1b9);[a7_0x4cc1d2(0x1b5)]=a7_0x4cc1d2(0x1b4);async[a7_0x4cc1d2(0x1a4)](_0x42ff11){const _0x424436=a7_0x4cc1d2,{options:_0x550b75,tdx:_0x3e572d}=_0x42ff11,_0x13527b=_0x550b75[_0x424436(0x192)],_0x1c67b0=_0x550b75[_0x424436(0x1d3)],_0x1173ec=_0x1c67b0?_0x1c67b0:'N/A';console[_0x424436(0x1d0)](_0x424436(0x1a8)+_0x1173ec+_0x424436(0x1d2)+_0x13527b+')');const _0x3e79c0=await getOAuthTokens(_0x1c67b0);if(_0x3e79c0)console[_0x424436(0x1d0)](_0x424436(0x1ad)),console[_0x424436(0x1d0)](_0x424436(0x19b)+(_0x1c67b0?_0x424436(0x1d5)+_0x1c67b0+')':''));else{const _0xe18ab9=await resolveAPIKeyAsync(_0x13527b,_0x1c67b0);if(_0xe18ab9){const {source:_0x1a34c4,isDeprecated:_0x43b45a}=_0xe18ab9,_0x40c929=_0x424436(0x199)+_0x1a34c4;console[_0x424436(0x1d0)](_0x43b45a?a7_0x5c29a9['yellow'](_0x40c929):_0x40c929);}else console[_0x424436(0x1d0)](a7_0x5c29a9[_0x424436(0x1e2)](_0x424436(0x195)));}try{const _0x11e73f=await _0x3e572d['jobs']['getUserInfo']();return console[_0x424436(0x1d0)](a7_0x5c29a9['green'](_0x424436(0x1d9))),console[_0x424436(0x1d0)](_0x424436(0x1ce)+_0x11e73f[_0x424436(0x1be)]),(_0x11e73f['first_name']||_0x11e73f[_0x424436(0x1b2)])&&console[_0x424436(0x1d0)](_0x424436(0x1a6)+[_0x11e73f[_0x424436(0x1c4)],_0x11e73f[_0x424436(0x1b2)]][_0x424436(0x1e0)](Boolean)[_0x424436(0x1bd)]('\x20')),0x0;}catch(_0x1d41d0){return _0x1d41d0 instanceof HTTPClientError&&_0x1d41d0['status']===0x191?printAuthError(_0x1d41d0,!![],_0x1c67b0):console[_0x424436(0x1a1)](a7_0x5c29a9[_0x424436(0x1da)](_0x424436(0x1aa)+(_0x1d41d0 instanceof Error?_0x1d41d0['message']:String(_0x1d41d0)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x4cc1d2(0x1c5)]=a7_0x4cc1d2(0x19a);[a7_0x4cc1d2(0x1b5)]=a7_0x4cc1d2(0x19d);async[a7_0x4cc1d2(0x1a4)](_0x1db271){const _0x524b75=a7_0x4cc1d2,{options:_0x1383f9}=_0x1db271,_0x46cc2e=_0x1383f9['profile'];console['log'](a7_0x5c29a9[_0x524b75(0x1ae)](_0x524b75(0x1b3)));const _0x3c9290=await isKeychainAvailable();if(!_0x3c9290)return console[_0x524b75(0x1a1)](a7_0x5c29a9[_0x524b75(0x1da)](_0x524b75(0x1c3))),0x1;const [_0x385afa,_0x42fecd]=await Promise[_0x524b75(0x1af)]([deleteKeychainAPIKey(_0x46cc2e),deleteOAuthTokens(_0x46cc2e)]);if(_0x385afa||_0x42fecd){clearCredentialCache();const _0x16b114=[_0x385afa&&_0x524b75(0x1d4),_0x42fecd&&'OAuth\x20tokens'][_0x524b75(0x1e0)](Boolean)['join']('\x20and\x20');return console['log']('✓\x20'+_0x16b114+_0x524b75(0x1a0)+(_0x46cc2e?_0x524b75(0x1d5)+_0x46cc2e+')':'')),0x0;}else return console['log'](_0x524b75(0x1c9)+(_0x46cc2e?_0x524b75(0x1dd)+_0x46cc2e:'')),0x1;}}
1
+ const a7_0x3c713d=a7_0x18e4;(function(_0x107cb3,_0x3da0e3){const _0x42acac=a7_0x18e4,_0x245efe=_0x107cb3();while(!![]){try{const _0x52100b=parseInt(_0x42acac(0x118))/0x1*(parseInt(_0x42acac(0xed))/0x2)+-parseInt(_0x42acac(0xfd))/0x3*(parseInt(_0x42acac(0xf5))/0x4)+parseInt(_0x42acac(0x105))/0x5+-parseInt(_0x42acac(0x11a))/0x6*(-parseInt(_0x42acac(0x112))/0x7)+parseInt(_0x42acac(0x10d))/0x8*(-parseInt(_0x42acac(0x106))/0x9)+parseInt(_0x42acac(0xfb))/0xa+-parseInt(_0x42acac(0x11d))/0xb;if(_0x52100b===_0x3da0e3)break;else _0x245efe['push'](_0x245efe['shift']());}catch(_0x3f25db){_0x245efe['push'](_0x245efe['shift']());}}}(a7_0x17f3,0xbce68));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens}from'../core/oauth-keychain.js';function a7_0x18e4(_0x6afb11,_0x308f06){_0x6afb11=_0x6afb11-0xd9;const _0x17f3a3=a7_0x17f3();let _0x18e4da=_0x17f3a3[_0x6afb11];return _0x18e4da;}import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{deleteOAuthTokens}from'../core/oauth-keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';import{isOAuthSupported}from'../core/oauth.js';import{runOAuthLoginFlow}from'./auth-login-command.js';import{promptSiteSelection}from'../core/constants.js';import a7_0x210644 from'prompts';import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';function a7_0x17f3(){const _0x368191=['tdx:\x20auth\x20setup','User:\x20','OAuth\x20(browser\x20login)','API\x20Key','logLevel','us01','216Clkchm','✓\x20Profile\x20\x27','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','\x20\x20tdx','auth','69083XOFopY','log','trim','Remove\x20API\x20key\x20from\x20system\x20keychain','method','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','27KDKYNH','tdx:\x20auth\x20clear','42HNwDvg','\x20(profile:\x20','getUserInfo','13404226yEaloL','yellow','auth:clear','ERROR','email','Read\x20credential\x20from\x20keychain','OAuth\x20tokens','password','warn','\x20and\x20','N/A','\x20removed\x20from\x20keychain','first_name','name','Enter\x20your\x20TD\x20API\x20key:','✗\x20Validation\x20failed:\x20','profile','apiKey','tdx\x20profile:\x20','message','red','Name:\x20','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','jobs','\x20(site:\x20','oauth','75434SVHYzx','/app/mp/ak','join','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','bold','Setup\x20API\x20key\x20authentication\x20interactively','API\x20key','\x0aSetup\x20cancelled','2747180ChEizL','error','No\x20credentials\x20found\x20in\x20keychain','description','execute','last_name','12665450FrLVAy','status','3eexqLf','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','System\x20keychain\x20is\x20not\x20available','Setup\x20cancelled','all','green','Setting\x20up\x20authentication\x20for\x20site:\x20','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','2478615vDEdbQ','56871lMszXb'];a7_0x17f3=function(){return _0x368191;};return a7_0x17f3();}import{LogLevel}from'../utils/tdx-logger.js';import a7_0x134ac1 from'chalk';export class AuthSetupCommand extends BaseCommand{[a7_0x3c713d(0xe0)]='auth:setup';[a7_0x3c713d(0xf8)]=a7_0x3c713d(0xf2);async[a7_0x3c713d(0xf9)](_0x2b4a1d){const _0x481d55=a7_0x3c713d,{options:_0x25aae8}=_0x2b4a1d,_0x43b79d=_0x25aae8[_0x481d55(0xe3)];console['log'](a7_0x134ac1[_0x481d55(0xf1)](_0x481d55(0x107)));const _0xb6d035=_0x25aae8['site']||_0x481d55(0x10c),_0x1362dd=await promptSiteSelection(_0xb6d035,_0x43b79d,_0x481d55(0x100));if(!_0x1362dd)return 0x1;const _0x51b30a=resolveSite(_0x1362dd);if(isOAuthSupported(_0x51b30a)){const _0x43a3a3=await a7_0x210644({'type':'select','name':_0x481d55(0x116),'message':'Choose\x20authentication\x20method:','choices':[{'title':_0x481d55(0x109),'value':'oauth'},{'title':_0x481d55(0x10a),'value':'apikey'}]});if(!_0x43a3a3[_0x481d55(0x116)])return console[_0x481d55(0x113)]('\x0aSetup\x20cancelled'),0x1;if(_0x43a3a3[_0x481d55(0x116)]===_0x481d55(0xec))return await runOAuthLoginFlow(_0x51b30a,_0x43b79d,_0x25aae8[_0x481d55(0x10b)]??LogLevel['ERROR']),0x0;}console[_0x481d55(0x113)](_0x481d55(0x103)+_0x51b30a),console['log']('You\x20can\x20find\x20your\x20API\x20key\x20at:'),console[_0x481d55(0x113)]('\x20\x20'+getConsoleUrl(_0x51b30a,_0x481d55(0xee)));const _0x3fd23b=await a7_0x210644({'type':_0x481d55(0xda),'name':_0x481d55(0xe4),'message':_0x481d55(0xe1),'validate':_0x483e62=>{if(!_0x483e62||!_0x483e62['trim']())return'API\x20key\x20cannot\x20be\x20empty';return!![];}});if(!_0x3fd23b[_0x481d55(0xe4)])return console[_0x481d55(0x113)](_0x481d55(0xf4)),0x1;const _0x31c0cc=_0x3fd23b['apiKey'];console[_0x481d55(0x113)]('Validating\x20API\x20key...');try{const _0x147f40=TDX['create']({'site':_0x51b30a,'apiKey':_0x31c0cc[_0x481d55(0x114)](),'logLevel':_0x25aae8[_0x481d55(0x10b)]??LogLevel[_0x481d55(0x120)]}),_0xf0f559=await _0x147f40[_0x481d55(0xea)][_0x481d55(0x11c)]();console['log']('✓\x20API\x20key\x20is\x20valid\x20(User:\x20'+_0xf0f559[_0x481d55(0x121)]+')');const _0x3f3808=await isKeychainAvailable();_0x3f3808?(await saveAPIKeyAsync(_0x31c0cc[_0x481d55(0x114)](),_0x51b30a,_0x43b79d),console[_0x481d55(0x113)](_0x481d55(0x104)+(_0x43b79d?_0x481d55(0x11b)+_0x43b79d+')':''))):(console[_0x481d55(0xdb)](a7_0x134ac1['yellow'](_0x481d55(0xf0))),console[_0x481d55(0xdb)](a7_0x134ac1['yellow']('\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.')));if(_0x43b79d){const _0x108c8d={'site':_0x51b30a};saveProfileToUserConfig(_0x43b79d,_0x108c8d),console['log'](_0x481d55(0x10e)+_0x43b79d+'\x27\x20registered');}else saveDefaultSiteToUserConfig(_0x51b30a),console[_0x481d55(0x113)]('✓\x20Default\x20site\x20set\x20to\x20'+_0x51b30a);const _0x5e364d=_0x43b79d?'\x20--profile\x20'+_0x43b79d:'';return console[_0x481d55(0x113)](),console[_0x481d55(0x113)]('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console[_0x481d55(0x113)](_0x481d55(0x110)+_0x5e364d+_0x481d55(0xe9)),console[_0x481d55(0x113)](_0x481d55(0x110)+_0x5e364d+_0x481d55(0x117)),0x0;}catch(_0x537631){if(_0x537631 instanceof HTTPClientError&&_0x537631['status']===0x191)return printAuthError(_0x537631),0x1;return console[_0x481d55(0xf6)](a7_0x134ac1[_0x481d55(0xe7)](_0x481d55(0xe2)+(_0x537631 instanceof Error?_0x537631[_0x481d55(0xe6)]:String(_0x537631)))),console[_0x481d55(0xf6)](_0x481d55(0xfe)),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x3c713d(0xe0)]=a7_0x3c713d(0x111);[a7_0x3c713d(0xf8)]=a7_0x3c713d(0x10f);async[a7_0x3c713d(0xf9)](_0x205d77){const _0x9c090f=a7_0x3c713d,{options:_0x5d560c,tdx:_0x204268}=_0x205d77,_0x44cfe0=_0x5d560c['site'],_0x5ae137=_0x5d560c[_0x9c090f(0xe3)],_0x4015f3=_0x5ae137?_0x5ae137:_0x9c090f(0xdd);console[_0x9c090f(0x113)](_0x9c090f(0xe5)+_0x4015f3+_0x9c090f(0xeb)+_0x44cfe0+')');const _0xbcd404=await getOAuthTokens(_0x5ae137);if(_0xbcd404)console[_0x9c090f(0x113)]('Credential\x20type:\x20OAuth'),console[_0x9c090f(0x113)](_0x9c090f(0x122)+(_0x5ae137?_0x9c090f(0x11b)+_0x5ae137+')':''));else{const _0xe13a01=await resolveAPIKeyAsync(_0x44cfe0,_0x5ae137);if(_0xe13a01){const {source:_0x19b408,isDeprecated:_0x47d06d}=_0xe13a01,_0x22217f='Read\x20credential\x20from\x20'+_0x19b408;console[_0x9c090f(0x113)](_0x47d06d?a7_0x134ac1[_0x9c090f(0x11e)](_0x22217f):_0x22217f);}else console[_0x9c090f(0x113)](a7_0x134ac1[_0x9c090f(0x11e)]('No\x20credential\x20found'));}try{const _0x3152cf=await _0x204268[_0x9c090f(0xea)][_0x9c090f(0x11c)]();return console[_0x9c090f(0x113)](a7_0x134ac1[_0x9c090f(0x102)]('✓\x20Authentication\x20successful\x0a')),console['log'](_0x9c090f(0x108)+_0x3152cf[_0x9c090f(0x121)]),(_0x3152cf['first_name']||_0x3152cf[_0x9c090f(0xfa)])&&console[_0x9c090f(0x113)](_0x9c090f(0xe8)+[_0x3152cf[_0x9c090f(0xdf)],_0x3152cf[_0x9c090f(0xfa)]]['filter'](Boolean)[_0x9c090f(0xef)]('\x20')),0x0;}catch(_0x4afd27){return _0x4afd27 instanceof HTTPClientError&&_0x4afd27[_0x9c090f(0xfc)]===0x191?printAuthError(_0x4afd27,!![],_0x5ae137):console[_0x9c090f(0xf6)](a7_0x134ac1[_0x9c090f(0xe7)](_0x9c090f(0xe2)+(_0x4afd27 instanceof Error?_0x4afd27[_0x9c090f(0xe6)]:String(_0x4afd27)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x3c713d(0xe0)]=a7_0x3c713d(0x11f);[a7_0x3c713d(0xf8)]=a7_0x3c713d(0x115);async[a7_0x3c713d(0xf9)](_0x1796bf){const _0x3c9d76=a7_0x3c713d,{options:_0x1a5a98}=_0x1796bf,_0xdc28fb=_0x1a5a98[_0x3c9d76(0xe3)];console['log'](a7_0x134ac1[_0x3c9d76(0xf1)](_0x3c9d76(0x119)));const _0x2ed7fd=await isKeychainAvailable();if(!_0x2ed7fd)return console['error'](a7_0x134ac1[_0x3c9d76(0xe7)](_0x3c9d76(0xff))),0x1;const [_0x5fc191,_0x1ee0e5]=await Promise[_0x3c9d76(0x101)]([deleteKeychainAPIKey(_0xdc28fb),deleteOAuthTokens(_0xdc28fb)]);if(_0x5fc191||_0x1ee0e5){clearCredentialCache();const _0x42a347=[_0x5fc191&&_0x3c9d76(0xf3),_0x1ee0e5&&_0x3c9d76(0xd9)]['filter'](Boolean)[_0x3c9d76(0xef)](_0x3c9d76(0xdc));return console[_0x3c9d76(0x113)]('✓\x20'+_0x42a347+_0x3c9d76(0xde)+(_0xdc28fb?_0x3c9d76(0x11b)+_0xdc28fb+')':'')),0x0;}else return console[_0x3c9d76(0x113)](_0x3c9d76(0xf7)+(_0xdc28fb?'\x20for\x20profile:\x20'+_0xdc28fb:'')),0x1;}}
@@ -1 +1 @@
1
- function a8_0x30a7(_0x58adce,_0x16c8c6){_0x58adce=_0x58adce-0xd9;const _0xe7f6d7=a8_0xe7f6();let _0x30a781=_0xe7f6d7[_0x58adce];return _0x30a781;}const a8_0x506186=a8_0x30a7;(function(_0x1891e1,_0x1c1071){const _0x4d34b6=a8_0x30a7,_0x2341ee=_0x1891e1();while(!![]){try{const _0x279e04=-parseInt(_0x4d34b6(0xec))/0x1*(parseInt(_0x4d34b6(0xf3))/0x2)+-parseInt(_0x4d34b6(0xed))/0x3+parseInt(_0x4d34b6(0xde))/0x4*(parseInt(_0x4d34b6(0x101))/0x5)+-parseInt(_0x4d34b6(0xe8))/0x6+-parseInt(_0x4d34b6(0xeb))/0x7+parseInt(_0x4d34b6(0xdc))/0x8+parseInt(_0x4d34b6(0xea))/0x9*(parseInt(_0x4d34b6(0xdf))/0xa);if(_0x279e04===_0x1c1071)break;else _0x2341ee['push'](_0x2341ee['shift']());}catch(_0x2700f5){_0x2341ee['push'](_0x2341ee['shift']());}}}(a8_0xe7f6,0xbdd66));import{BaseCommand}from'./command.js';import{resolveSite}from'../core/config.js';import{saveProfileToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{isKeychainAvailable}from'../core/keychain.js';import{saveOAuthTokens}from'../core/oauth-keychain.js';function a8_0xe7f6(){const _0x272ab1=['site','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','4bazmRT','name','us01','getUserInfo','Login\x20via\x20OAuth\x20(opens\x20browser)','\x20\x20tdx','log','Authenticating\x20via\x20OAuth\x20for\x20site:\x20','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain','profile','✓\x20Profile\x20\x27','email','/oauth/authorize','2155EzLKwt','tdx:\x20auth\x20login','Validating\x20OAuth\x20tokens...','\x20--profile\x20','create','9691864ZUEdYT','✓\x20Authentication\x20successful\x20(User:\x20','3428yYHUqu','40mdzStk','Opening\x20browser\x20for\x20authentication...','jobs','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','green','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','OAuth\x20login\x20is\x20not\x20yet\x20available\x20for\x20site:\x20','Login\x20cancelled','bold','7209246iMXOxO','ERROR','5663853WENoTa','1149834FQNDgQ','456257UHKjpu','3126681zTzGUk','description','OAuth\x20is\x20currently\x20supported\x20on\x20dev-us01\x20and\x20dev-eu01\x20only.\x20','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'];a8_0xe7f6=function(){return _0x272ab1;};return a8_0xe7f6();}import{startOAuthFlow,isOAuthSupported}from'../core/oauth.js';import{promptSiteSelection}from'../core/constants.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a8_0x29b0de from'chalk';export async function runOAuthLoginFlow(_0x792864,_0x125b88,_0x6c439d){const _0x2b7928=a8_0x30a7;if(!isOAuthSupported(_0x792864))throw new Error(_0x2b7928(0xe5)+_0x792864+'.\x20'+_0x2b7928(0xef)+_0x2b7928(0xfb));const _0x11b5a9=await isKeychainAvailable();if(!_0x11b5a9)throw new Error(_0x2b7928(0xe4)+_0x2b7928(0xfb));const _0x2082c0=getConsoleUrl(_0x792864);console[_0x2b7928(0xf9)](_0x2b7928(0xe0)),console['log']('\x20\x20'+_0x2082c0+_0x2b7928(0x100)),console[_0x2b7928(0xf9)](_0x2b7928(0xf2));const _0xc990b2=await startOAuthFlow(_0x792864);console[_0x2b7928(0xf9)](_0x2b7928(0xd9));const _0x280596=TDX[_0x2b7928(0xdb)]({'site':_0x792864,'accessToken':_0xc990b2['access_token'],'logLevel':_0x6c439d??LogLevel[_0x2b7928(0xe9)]}),_0x4dfbd9=await _0x280596[_0x2b7928(0xe1)][_0x2b7928(0xf6)]();console['log'](a8_0x29b0de[_0x2b7928(0xe3)](_0x2b7928(0xdd)+_0x4dfbd9[_0x2b7928(0xff)]+')')),await saveOAuthTokens(_0xc990b2,_0x125b88),console[_0x2b7928(0xf9)](_0x2b7928(0xfc)+(_0x125b88?'\x20(profile:\x20'+_0x125b88+')':''));if(_0x125b88){const _0x584c25={'site':_0x792864};saveProfileToUserConfig(_0x125b88,_0x584c25),console[_0x2b7928(0xf9)](_0x2b7928(0xfe)+_0x125b88+'\x27\x20registered');}const _0x12122e=_0x125b88?_0x2b7928(0xda)+_0x125b88:'';console[_0x2b7928(0xf9)](),console['log']('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console['log'](_0x2b7928(0xf8)+_0x12122e+_0x2b7928(0xf0)),console[_0x2b7928(0xf9)](_0x2b7928(0xf8)+_0x12122e+_0x2b7928(0xe2));}export class AuthLoginCommand extends BaseCommand{[a8_0x506186(0xf4)]='auth:login';[a8_0x506186(0xee)]=a8_0x506186(0xf7);async['execute'](_0xffa4e2){const _0x2db93b=a8_0x506186,{options:_0x10b3be}=_0xffa4e2,_0xbee949=_0x10b3be[_0x2db93b(0xfd)];console['log'](a8_0x29b0de[_0x2db93b(0xe7)](_0x2db93b(0x102)));const _0x24a1a4=_0x10b3be[_0x2db93b(0xf1)]||_0x2db93b(0xf5),_0x1b384f=await promptSiteSelection(_0x24a1a4,_0xbee949,_0x2db93b(0xe6));if(!_0x1b384f)return 0x1;const _0x351de0=resolveSite(_0x1b384f);return console[_0x2db93b(0xf9)](_0x2db93b(0xfa)+_0x351de0),await runOAuthLoginFlow(_0x351de0,_0xbee949,_0x10b3be['logLevel']??LogLevel['ERROR']),0x0;}}
1
+ const a8_0x18fd40=a8_0x2a1c;(function(_0x1a5cb5,_0x3f40f0){const _0x10da76=a8_0x2a1c,_0x2ba68f=_0x1a5cb5();while(!![]){try{const _0x5430c4=-parseInt(_0x10da76(0x10b))/0x1*(parseInt(_0x10da76(0x116))/0x2)+parseInt(_0x10da76(0x12e))/0x3+-parseInt(_0x10da76(0x125))/0x4+parseInt(_0x10da76(0x10a))/0x5+parseInt(_0x10da76(0x127))/0x6*(-parseInt(_0x10da76(0x12a))/0x7)+parseInt(_0x10da76(0x11f))/0x8*(-parseInt(_0x10da76(0x102))/0x9)+parseInt(_0x10da76(0x12f))/0xa*(parseInt(_0x10da76(0x103))/0xb);if(_0x5430c4===_0x3f40f0)break;else _0x2ba68f['push'](_0x2ba68f['shift']());}catch(_0x26abba){_0x2ba68f['push'](_0x2ba68f['shift']());}}}(a8_0x5209,0x4d4a1));import{BaseCommand}from'./command.js';import{resolveSite}from'../core/config.js';import{saveProfileToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';function a8_0x2a1c(_0x1f947f,_0x1edc1d){_0x1f947f=_0x1f947f-0x101;const _0x520903=a8_0x5209();let _0x2a1cfc=_0x520903[_0x1f947f];return _0x2a1cfc;}import{isKeychainAvailable}from'../core/keychain.js';import{saveOAuthTokens}from'../core/oauth-keychain.js';import{startOAuthFlow,isOAuthSupported}from'../core/oauth.js';import{promptSiteSelection}from'../core/constants.js';function a8_0x5209(){const _0x4db303=['OAuth\x20is\x20currently\x20supported\x20on\x20dev-us01\x20and\x20dev-eu01\x20only.\x20','log','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','auth:login','ERROR','Validating\x20OAuth\x20tokens...','tdx:\x20auth\x20login','execute','856376bFVwKX','create','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','Login\x20via\x20OAuth\x20(opens\x20browser)','logLevel','Opening\x20browser\x20for\x20authentication...','1705028gskdKw','Authenticating\x20via\x20OAuth\x20for\x20site:\x20','5226pMFSYW','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','access_token','4186iZJgwL','us01','site','name','856092hvBNTP','1319330IZHzlV','\x20\x20tdx','9JYMEnd','88XWbXhs','bold','✓\x20Profile\x20\x27','\x20(profile:\x20','OAuth\x20login\x20is\x20not\x20yet\x20available\x20for\x20site:\x20','profile','getUserInfo','623125cbPoLG','1633NFDRlm','email','description','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','\x27\x20registered','✓\x20Authentication\x20successful\x20(User:\x20','\x20--profile\x20','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain','green','/oauth/authorize','Login\x20cancelled','116StGMmE'];a8_0x5209=function(){return _0x4db303;};return a8_0x5209();}import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a8_0x4395c5 from'chalk';export async function runOAuthLoginFlow(_0x2a57f4,_0x141665,_0x2a0bff){const _0x2cd271=a8_0x2a1c;if(!isOAuthSupported(_0x2a57f4))throw new Error(_0x2cd271(0x107)+_0x2a57f4+'.\x20'+_0x2cd271(0x117)+_0x2cd271(0x121));const _0x5aee5c=await isKeychainAvailable();if(!_0x5aee5c)throw new Error('System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20'+_0x2cd271(0x121));const _0x393231=getConsoleUrl(_0x2a57f4);console[_0x2cd271(0x118)](_0x2cd271(0x124)),console[_0x2cd271(0x118)]('\x20\x20'+_0x393231+_0x2cd271(0x114)),console[_0x2cd271(0x118)](_0x2cd271(0x10e));const _0x45d19f=await startOAuthFlow(_0x2a57f4);console[_0x2cd271(0x118)](_0x2cd271(0x11c));const _0x551838=TDX[_0x2cd271(0x120)]({'site':_0x2a57f4,'accessToken':_0x45d19f[_0x2cd271(0x129)],'logLevel':_0x2a0bff??LogLevel['ERROR']}),_0x1b2961=await _0x551838['jobs'][_0x2cd271(0x109)]();console[_0x2cd271(0x118)](a8_0x4395c5[_0x2cd271(0x113)](_0x2cd271(0x110)+_0x1b2961[_0x2cd271(0x10c)]+')')),await saveOAuthTokens(_0x45d19f,_0x141665),console['log'](_0x2cd271(0x112)+(_0x141665?_0x2cd271(0x106)+_0x141665+')':''));if(_0x141665){const _0x2b5773={'site':_0x2a57f4};saveProfileToUserConfig(_0x141665,_0x2b5773),console[_0x2cd271(0x118)](_0x2cd271(0x105)+_0x141665+_0x2cd271(0x10f));}const _0x2573e2=_0x141665?_0x2cd271(0x111)+_0x141665:'';console[_0x2cd271(0x118)](),console['log']('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console['log']('\x20\x20tdx'+_0x2573e2+_0x2cd271(0x128)),console[_0x2cd271(0x118)](_0x2cd271(0x101)+_0x2573e2+_0x2cd271(0x119));}export class AuthLoginCommand extends BaseCommand{[a8_0x18fd40(0x12d)]=a8_0x18fd40(0x11a);[a8_0x18fd40(0x10d)]=a8_0x18fd40(0x122);async[a8_0x18fd40(0x11e)](_0x339281){const _0x321e3b=a8_0x18fd40,{options:_0x484edb}=_0x339281,_0x5b6577=_0x484edb[_0x321e3b(0x108)];console[_0x321e3b(0x118)](a8_0x4395c5[_0x321e3b(0x104)](_0x321e3b(0x11d)));const _0x2402a5=_0x484edb[_0x321e3b(0x12c)]||_0x321e3b(0x12b),_0x5c36ec=await promptSiteSelection(_0x2402a5,_0x5b6577,_0x321e3b(0x115));if(!_0x5c36ec)return 0x1;const _0x1bf83b=resolveSite(_0x5c36ec);return console[_0x321e3b(0x118)](_0x321e3b(0x126)+_0x1bf83b),await runOAuthLoginFlow(_0x1bf83b,_0x5b6577,_0x484edb[_0x321e3b(0x123)]??LogLevel[_0x321e3b(0x11b)]),0x0;}}
@@ -1 +1 @@
1
- const a9_0x542652=a9_0x1b43;(function(_0xb4b003,_0x119166){const _0x526cab=a9_0x1b43,_0x2c29d7=_0xb4b003();while(!![]){try{const _0x4e21cb=-parseInt(_0x526cab(0x164))/0x1*(parseInt(_0x526cab(0x150))/0x2)+parseInt(_0x526cab(0x16f))/0x3+parseInt(_0x526cab(0x179))/0x4*(-parseInt(_0x526cab(0x175))/0x5)+-parseInt(_0x526cab(0x183))/0x6*(parseInt(_0x526cab(0x15a))/0x7)+-parseInt(_0x526cab(0x142))/0x8+-parseInt(_0x526cab(0x167))/0x9+-parseInt(_0x526cab(0x14e))/0xa*(-parseInt(_0x526cab(0x174))/0xb);if(_0x4e21cb===_0x119166)break;else _0x2c29d7['push'](_0x2c29d7['shift']());}catch(_0x2da9cc){_0x2c29d7['push'](_0x2c29d7['shift']());}}}(a9_0x3ff6,0x639ab));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';function a9_0x3ff6(){const _0x34453d=['data','Using\x20agent\x20from\x20','name','targetKnowledgeBase','args','done','streamChatJsonl','\x27\x20not\x20found','970ujPUGk','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','34ZTUSAD','validate','\x0aError:\x20','chat','stringify','execute','error','Error:\x20Chat\x20session\x20\x27','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','--agent\x20flag','14MlMbLO','\x0aStack\x20trace:','log','write','llm','Getting\x20default\x20agent...','agent','No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22','description','tool','10949kwednD','metadata','new','4915683zOFoYj','llmProject','targetWebSearchTool','Resolving\x20agent\x20\x27','handleChatEvent','tool_call','site','llmAgent','1845213plglhd','getDefaultAgent','Create\x20a\x20new\x20chat\x20session','join','Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22','221771NldHwG','15HikvEg','cause','404','claude-4.5-haiku','135680tqhpRD','message','content','slice','code','targetAgent','verbose','stack','Using\x20cached\x20default\x20agent:\x20','resolveProjectId','1937028CnvjRw','options','agentId','chat-create','event','chatId','functionName','type','session\x20context','\x27...','5463624hLVfvH','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','streamChat','stdout'];a9_0x3ff6=function(){return _0x34453d;};return a9_0x3ff6();}import{getLLMConversationUrl}from'../sdk/client/endpoints.js';function handleSDKError(_0x57b404,_0x1d335c){const _0x5c9de6=a9_0x1b43;if(_0x57b404 instanceof SDKError)console['error']('Error:\x20'+_0x57b404[_0x5c9de6(0x17a)]),_0x1d335c[_0x5c9de6(0x17f)]&&(_0x57b404['cause']&&console[_0x5c9de6(0x156)]('\x20\x20Cause:\x20'+_0x57b404[_0x5c9de6(0x176)]),_0x57b404[_0x5c9de6(0x180)]&&(console[_0x5c9de6(0x156)](_0x5c9de6(0x15b)),console[_0x5c9de6(0x156)](_0x57b404['stack'])));else throw _0x57b404;}async function resolveAgentId(_0x42e8aa,_0x3bf5b7,_0x50edb2,_0x446fac,_0x201c99){const _0x4dca22=a9_0x1b43,_0x538b51=_0x3bf5b7||_0x50edb2;if(_0x538b51){const {projectName:_0x5490a4,agentName:_0x2e8305}=parseAgentRef(_0x538b51),_0x43d84e=_0x2e8305||_0x538b51,_0x45dce6=_0x2e8305?_0x5490a4:_0x446fac;if(!_0x45dce6)throw new Error(_0x4dca22(0x161));if(_0x201c99){const _0x595e1b=_0x3bf5b7?_0x4dca22(0x159):_0x4dca22(0x140);console[_0x4dca22(0x156)](_0x4dca22(0x147)+_0x595e1b+':\x20'+_0x45dce6+'/'+_0x43d84e);}const _0x58a1d7=await withSpinner('Resolving\x20project\x20\x27'+_0x45dce6+_0x4dca22(0x141),()=>_0x42e8aa[_0x4dca22(0x15e)][_0x4dca22(0x182)](_0x45dce6),{'verbose':_0x201c99}),_0x45e0e8=await withSpinner(_0x4dca22(0x16a)+_0x43d84e+_0x4dca22(0x141),()=>_0x42e8aa[_0x4dca22(0x15e)]['resolveAgentId'](_0x43d84e,_0x58a1d7[_0x4dca22(0x146)]),{'verbose':_0x201c99});return _0x45e0e8[_0x4dca22(0x146)];}else{const _0x1aefc4=_0x42e8aa[_0x4dca22(0x15e)][_0x4dca22(0x170)]();if(_0x1aefc4)return _0x201c99&&console[_0x4dca22(0x156)](_0x4dca22(0x181)+_0x1aefc4[_0x4dca22(0x148)]),_0x1aefc4['id'];const _0x2dd424=await withSpinner(_0x4dca22(0x15f),()=>_0x42e8aa[_0x4dca22(0x15e)]['getOrCreateDefaultAgent'](_0x4dca22(0x178),0x0),{'verbose':_0x201c99});return _0x2dd424['data']['id'];}}function a9_0x1b43(_0x5cc1ec,_0x4f7356){_0x5cc1ec=_0x5cc1ec-0x13d;const _0x3ff6b0=a9_0x3ff6();let _0x1b4310=_0x3ff6b0[_0x5cc1ec];return _0x1b4310;}export class ChatCommand extends BaseCommand{[a9_0x542652(0x148)]='chat';[a9_0x542652(0x162)]=a9_0x542652(0x158);[a9_0x542652(0x151)](_0x5c32a8){const _0x287615=a9_0x542652,_0x47d443=_0x5c32a8[_0x287615(0x14a)]['join']('\x20');if(!_0x47d443)return _0x287615(0x143);return undefined;}async[a9_0x542652(0x144)](_0x283d25,_0x4cf031,_0x49486c,_0x43ec2e,_0x491840){const _0x2b07d6=a9_0x542652;for await(const _0x204e1a of _0x283d25[_0x2b07d6(0x15e)]['chat'](_0x4cf031,{'agentId':_0x49486c,'chatId':_0x43ec2e})){if(_0x204e1a[_0x2b07d6(0x13f)]==='metadata'){const _0x569489=_0x204e1a['data'][_0x2b07d6(0x13d)];saveLastChatId(_0x569489),_0x491840&&console[_0x2b07d6(0x156)]('Chat\x20session:\x20'+_0x569489);}else _0x204e1a[_0x2b07d6(0x13f)]===_0x2b07d6(0x187)&&this['handleChatEvent'](_0x204e1a[_0x2b07d6(0x146)]);}}async['streamChatJsonl'](_0x5c087c,_0x1d4c82,_0x5a0af9,_0x5aa238){const _0x4e728c=a9_0x542652,_0x245f9d=_0x5c087c['context'][_0x4e728c(0x16d)];let _0x22214d=![];for await(const _0x2f16f3 of _0x5c087c[_0x4e728c(0x15e)][_0x4e728c(0x153)](_0x1d4c82,{'agentId':_0x5a0af9,'chatId':_0x5aa238})){if(_0x2f16f3[_0x4e728c(0x13f)]===_0x4e728c(0x165)){const _0x268960=_0x2f16f3['data'];saveLastChatId(_0x268960[_0x4e728c(0x13d)]);const _0x885c1b=_0x268960['projectId']&&_0x268960[_0x4e728c(0x185)]?getLLMConversationUrl(_0x245f9d,_0x268960['projectId'],_0x268960[_0x4e728c(0x185)],_0x268960[_0x4e728c(0x13d)]):undefined;console[_0x4e728c(0x15c)](JSON['stringify']({'type':_0x4e728c(0x165),'data':{'chatId':_0x268960['chatId'],'agentId':_0x268960[_0x4e728c(0x185)],'consoleUrl':_0x885c1b}})),_0x22214d=!![];}else{if(_0x2f16f3['type']===_0x4e728c(0x187)){!_0x22214d&&_0x5aa238&&(console[_0x4e728c(0x15c)](JSON[_0x4e728c(0x154)]({'type':_0x4e728c(0x165),'data':{'chatId':_0x5aa238}})),_0x22214d=!![]);const _0x449d12=_0x2f16f3[_0x4e728c(0x146)];if('content'in _0x449d12)console[_0x4e728c(0x15c)](JSON[_0x4e728c(0x154)]({'type':_0x4e728c(0x17b),'data':{'content':_0x449d12['content']}}));else{if(_0x4e728c(0x16c)in _0x449d12){const _0x1719bc=_0x449d12[_0x4e728c(0x16c)];console['log'](JSON[_0x4e728c(0x154)]({'type':'tool_call','data':{'id':_0x1719bc['id'],'name':_0x1719bc[_0x4e728c(0x13e)],'target':_0x1719bc[_0x4e728c(0x149)]?.[_0x4e728c(0x148)]||_0x1719bc[_0x4e728c(0x17e)]?.[_0x4e728c(0x148)]||_0x1719bc[_0x4e728c(0x169)]?.[_0x4e728c(0x148)]||_0x1719bc['targetFunction']}}));}else{if('tool'in _0x449d12)console[_0x4e728c(0x15c)](JSON[_0x4e728c(0x154)]({'type':'tool_result','data':{'id':_0x449d12[_0x4e728c(0x163)]['id'],'name':_0x449d12[_0x4e728c(0x163)]['functionName'],'result':typeof _0x449d12[_0x4e728c(0x163)]['content']==='string'?_0x449d12[_0x4e728c(0x163)]['content'][_0x4e728c(0x17c)](0x0,0x1f4):''}}));else _0x4e728c(0x156)in _0x449d12&&console[_0x4e728c(0x15c)](JSON[_0x4e728c(0x154)]({'type':_0x4e728c(0x156),'data':{'error':_0x449d12[_0x4e728c(0x156)]}}));}}}}}console['log'](JSON[_0x4e728c(0x154)]({'type':_0x4e728c(0x14b)}));}async[a9_0x542652(0x155)](_0x49706b){const _0x2172d6=a9_0x542652,{options:_0x243b4b,args:_0x292639,tdx:_0x2dcd98}=_0x49706b,_0x558b1e=_0x292639[_0x2172d6(0x172)]('\x20'),_0x4db45f=_0x243b4b,_0x1a758a=_0x4db45f[_0x2172d6(0x160)],_0x157b4f=_0x4db45f['llmAgent'],_0x23faca=_0x4db45f['llmProject'],_0x14d5a6=_0x4db45f[_0x2172d6(0x166)],_0x5c322e=_0x4db45f[_0x2172d6(0x13d)],_0x4983c5=_0x4db45f['stream'];if(_0x14d5a6&&_0x5c322e)return console[_0x2172d6(0x156)]('Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together'),0x1;try{let _0x3ff6c7,_0x4c29e3;if(_0x5c322e)_0x4c29e3=_0x5c322e;else!_0x14d5a6&&(_0x4c29e3=loadLastChatId(),_0x4c29e3&&_0x243b4b[_0x2172d6(0x17f)]&&console[_0x2172d6(0x156)]('Continuing\x20chat:\x20'+_0x4c29e3));!_0x5c322e&&(_0x14d5a6||!_0x4c29e3)&&(_0x3ff6c7=await resolveAgentId(_0x2dcd98,_0x1a758a,_0x157b4f,_0x23faca,_0x243b4b[_0x2172d6(0x17f)]));const _0x48de46=_0x4983c5?(_0x1c472b,_0x16b47d,_0x296ea6)=>this[_0x2172d6(0x14c)](_0x2dcd98,_0x1c472b,_0x16b47d,_0x296ea6):(_0xecdb4d,_0x10a25c,_0x283498)=>this['streamChat'](_0x2dcd98,_0xecdb4d,_0x10a25c,_0x283498,_0x243b4b[_0x2172d6(0x17f)]);try{await _0x48de46(_0x558b1e,_0x3ff6c7,_0x4c29e3);}catch(_0x4206cd){const _0x4de735=_0x4206cd instanceof SDKError&&_0x4206cd[_0x2172d6(0x17d)]===ErrorCode['CHAT_NOT_FOUND']||_0x4206cd instanceof Error&&_0x4206cd[_0x2172d6(0x17a)]['includes'](_0x2172d6(0x177));if(_0x4de735&&_0x5c322e)return console[_0x2172d6(0x156)](_0x2172d6(0x157)+_0x5c322e+_0x2172d6(0x14d)),0x1;if(_0x4de735)_0x243b4b[_0x2172d6(0x17f)]&&console['error'](_0x2172d6(0x14f)),!_0x3ff6c7&&(_0x3ff6c7=await resolveAgentId(_0x2dcd98,_0x1a758a,_0x157b4f,_0x23faca,_0x243b4b[_0x2172d6(0x17f)])),await _0x48de46(_0x558b1e,_0x3ff6c7,undefined);else throw _0x4206cd;}return!_0x4983c5&&console[_0x2172d6(0x15c)](),0x0;}catch(_0x220737){return console[_0x2172d6(0x156)](),handleSDKError(_0x220737,_0x243b4b),0x1;}}[a9_0x542652(0x16b)](_0x6bcc01){const _0x16c4f1=a9_0x542652;if('content'in _0x6bcc01)process[_0x16c4f1(0x145)][_0x16c4f1(0x15d)](_0x6bcc01[_0x16c4f1(0x17b)]);else'error'in _0x6bcc01&&console[_0x16c4f1(0x156)](_0x16c4f1(0x152)+_0x6bcc01[_0x16c4f1(0x156)]);}}export class ChatCreateCommand extends BaseCommand{[a9_0x542652(0x148)]=a9_0x542652(0x186);[a9_0x542652(0x162)]=a9_0x542652(0x171);[a9_0x542652(0x151)](_0x7be62d){const _0xd207c1=a9_0x542652,_0x3dcea1=_0x7be62d[_0xd207c1(0x184)],_0x1eae62=_0x3dcea1[_0xd207c1(0x160)],_0x2afdec=_0x3dcea1[_0xd207c1(0x16e)];if(!_0x1eae62&&!_0x2afdec)return _0xd207c1(0x173);return undefined;}async[a9_0x542652(0x155)](_0x42084c){const _0x5ec8b9=a9_0x542652,{options:_0x40af2a,tdx:_0x58fdd3}=_0x42084c,_0x17c36e=_0x40af2a,_0xcb588=_0x17c36e[_0x5ec8b9(0x160)],_0x33a775=_0x17c36e['llmAgent'],_0x47b774=_0x17c36e[_0x5ec8b9(0x168)];try{const _0x38e351=await resolveAgentId(_0x58fdd3,_0xcb588,_0x33a775,_0x47b774,_0x40af2a[_0x5ec8b9(0x17f)]),_0x18c55b=await _0x58fdd3['llm']['startChat'](_0x38e351);return saveLastChatId(_0x18c55b['id']),console[_0x5ec8b9(0x15c)](JSON[_0x5ec8b9(0x154)]({'chatId':_0x18c55b['id'],'agentId':_0x38e351})),0x0;}catch(_0x599268){return handleSDKError(_0x599268,_0x40af2a),0x1;}}}
1
+ const a9_0x4ab2a1=a9_0x66e6;(function(_0x2a25fb,_0x3ef7a2){const _0x2cde17=a9_0x66e6,_0x388bf0=_0x2a25fb();while(!![]){try{const _0x38ebad=parseInt(_0x2cde17(0x148))/0x1*(parseInt(_0x2cde17(0x135))/0x2)+parseInt(_0x2cde17(0x150))/0x3*(parseInt(_0x2cde17(0x146))/0x4)+parseInt(_0x2cde17(0x111))/0x5*(-parseInt(_0x2cde17(0x14c))/0x6)+-parseInt(_0x2cde17(0x124))/0x7+-parseInt(_0x2cde17(0x112))/0x8*(-parseInt(_0x2cde17(0x152))/0x9)+-parseInt(_0x2cde17(0x136))/0xa+-parseInt(_0x2cde17(0x11e))/0xb*(-parseInt(_0x2cde17(0x13d))/0xc);if(_0x38ebad===_0x3ef7a2)break;else _0x388bf0['push'](_0x388bf0['shift']());}catch(_0x1d51c1){_0x388bf0['push'](_0x388bf0['shift']());}}}(a9_0x44ea,0xadb63));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{withSpinner}from'../utils/spinner.js';import{parseAgentRef}from'../sdk/agent/agent-ref-parser.js';function a9_0x44ea(){const _0x58686d=['Resolving\x20project\x20\x27','2390490wjBFDT','getDefaultAgent','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','data','claude-4.5-haiku','targetWebSearchTool','write','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','validate','resolveAgentId','Getting\x20default\x20agent...','handleChatEvent','tool_result','Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together','agentId','functionName','51505qIUZpz','16xuswvL','tool_call','Create\x20a\x20new\x20chat\x20session','type','tool','stringify','event','stream','Continuing\x20chat:\x20','Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22','args','name','74107wzVCGj','log','cause','context','streamChat','Error:\x20','593236mOsQnG','chat-create','execute','chatId','projectId','Using\x20cached\x20default\x20agent:\x20','metadata','targetAgent','llm','\x27\x20not\x20found','getOrCreateDefaultAgent','done','targetKnowledgeBase','llmProject','includes','stack','\x0aError:\x20','1844WEXebU','8686460JyaKwk','404','\x27...','verbose','--agent\x20flag','description','Resolving\x20agent\x20\x27','696ajysAa','new','streamChatJsonl','Error:\x20Chat\x20session\x20\x27','stdout','message','targetFunction','llmAgent','content','4pXjPtu','\x20\x20Cause:\x20','649hMiePq','error','agent','session\x20context','210EfXRAZ','chat','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','Chat\x20session:\x20','1515324BJlSlJ'];a9_0x44ea=function(){return _0x58686d;};return a9_0x44ea();}import{saveLastChatId,loadLastChatId}from'../sdk/llm/chat-cache.js';import{getLLMConversationUrl}from'../sdk/client/endpoints.js';function handleSDKError(_0x10c230,_0x5edc24){const _0x45efdd=a9_0x66e6;if(_0x10c230 instanceof SDKError)console['error'](_0x45efdd(0x123)+_0x10c230[_0x45efdd(0x142)]),_0x5edc24['verbose']&&(_0x10c230[_0x45efdd(0x120)]&&console['error'](_0x45efdd(0x147)+_0x10c230[_0x45efdd(0x120)]),_0x10c230['stack']&&(console['error']('\x0aStack\x20trace:'),console[_0x45efdd(0x149)](_0x10c230[_0x45efdd(0x133)])));else throw _0x10c230;}async function resolveAgentId(_0x2eb387,_0x2c5e87,_0x15e352,_0x178a1b,_0x2769c5){const _0x18c9e5=a9_0x66e6,_0x247375=_0x2c5e87||_0x15e352;if(_0x247375){const {projectName:_0x178d57,agentName:_0x365b83}=parseAgentRef(_0x247375),_0x51785d=_0x365b83||_0x247375,_0x3c1b7e=_0x365b83?_0x178d57:_0x178a1b;if(!_0x3c1b7e)throw new Error('No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22');if(_0x2769c5){const _0x1ddd80=_0x2c5e87?_0x18c9e5(0x13a):_0x18c9e5(0x14b);console['error']('Using\x20agent\x20from\x20'+_0x1ddd80+':\x20'+_0x3c1b7e+'/'+_0x51785d);}const _0x9fcedf=await withSpinner(_0x18c9e5(0x151)+_0x3c1b7e+_0x18c9e5(0x138),()=>_0x2eb387[_0x18c9e5(0x12c)]['resolveProjectId'](_0x3c1b7e),{'verbose':_0x2769c5}),_0x243216=await withSpinner(_0x18c9e5(0x13c)+_0x51785d+_0x18c9e5(0x138),()=>_0x2eb387[_0x18c9e5(0x12c)][_0x18c9e5(0x10a)](_0x51785d,_0x9fcedf[_0x18c9e5(0x155)]),{'verbose':_0x2769c5});return _0x243216['data'];}else{const _0x580f37=_0x2eb387[_0x18c9e5(0x12c)][_0x18c9e5(0x153)]();if(_0x580f37)return _0x2769c5&&console['error'](_0x18c9e5(0x129)+_0x580f37[_0x18c9e5(0x11d)]),_0x580f37['id'];const _0x8d7f0a=await withSpinner(_0x18c9e5(0x10b),()=>_0x2eb387[_0x18c9e5(0x12c)][_0x18c9e5(0x12e)](_0x18c9e5(0x156),0x0),{'verbose':_0x2769c5});return _0x8d7f0a[_0x18c9e5(0x155)]['id'];}}export class ChatCommand extends BaseCommand{[a9_0x4ab2a1(0x11d)]=a9_0x4ab2a1(0x14d);[a9_0x4ab2a1(0x13b)]=a9_0x4ab2a1(0x154);[a9_0x4ab2a1(0x109)](_0x550978){const _0x272267=a9_0x4ab2a1,_0x621b96=_0x550978[_0x272267(0x11c)]['join']('\x20');if(!_0x621b96)return _0x272267(0x14e);return undefined;}async['streamChat'](_0x58d3f9,_0x46d920,_0x4e2ab5,_0x53cc42,_0x5d7c99){const _0x2c8435=a9_0x4ab2a1;for await(const _0x4157f2 of _0x58d3f9[_0x2c8435(0x12c)]['chat'](_0x46d920,{'agentId':_0x4e2ab5,'chatId':_0x53cc42})){if(_0x4157f2[_0x2c8435(0x115)]===_0x2c8435(0x12a)){const _0x94f1fc=_0x4157f2[_0x2c8435(0x155)]['chatId'];saveLastChatId(_0x94f1fc),_0x5d7c99&&console[_0x2c8435(0x149)](_0x2c8435(0x14f)+_0x94f1fc);}else _0x4157f2[_0x2c8435(0x115)]===_0x2c8435(0x118)&&this[_0x2c8435(0x10c)](_0x4157f2[_0x2c8435(0x155)]);}}async[a9_0x4ab2a1(0x13f)](_0x23c651,_0x525380,_0x9bd3f6,_0x340736){const _0x523c1b=a9_0x4ab2a1,_0x4b8281=_0x23c651[_0x523c1b(0x121)]['site'];let _0x550fb1=![];for await(const _0xb05f98 of _0x23c651['llm']['chat'](_0x525380,{'agentId':_0x9bd3f6,'chatId':_0x340736})){if(_0xb05f98['type']==='metadata'){const _0x242994=_0xb05f98[_0x523c1b(0x155)];saveLastChatId(_0x242994[_0x523c1b(0x127)]);const _0x45c1a0=_0x242994['projectId']&&_0x242994[_0x523c1b(0x10f)]?getLLMConversationUrl(_0x4b8281,_0x242994[_0x523c1b(0x128)],_0x242994[_0x523c1b(0x10f)],_0x242994['chatId']):undefined;console['log'](JSON[_0x523c1b(0x117)]({'type':'metadata','data':{'chatId':_0x242994['chatId'],'agentId':_0x242994[_0x523c1b(0x10f)],'consoleUrl':_0x45c1a0}})),_0x550fb1=!![];}else{if(_0xb05f98[_0x523c1b(0x115)]===_0x523c1b(0x118)){!_0x550fb1&&_0x340736&&(console[_0x523c1b(0x11f)](JSON[_0x523c1b(0x117)]({'type':_0x523c1b(0x12a),'data':{'chatId':_0x340736}})),_0x550fb1=!![]);const _0x26400d=_0xb05f98[_0x523c1b(0x155)];if(_0x523c1b(0x145)in _0x26400d)console[_0x523c1b(0x11f)](JSON[_0x523c1b(0x117)]({'type':_0x523c1b(0x145),'data':{'content':_0x26400d[_0x523c1b(0x145)]}}));else{if(_0x523c1b(0x113)in _0x26400d){const _0x2b956d=_0x26400d[_0x523c1b(0x113)];console[_0x523c1b(0x11f)](JSON['stringify']({'type':_0x523c1b(0x113),'data':{'id':_0x2b956d['id'],'name':_0x2b956d['functionName'],'target':_0x2b956d[_0x523c1b(0x130)]?.[_0x523c1b(0x11d)]||_0x2b956d[_0x523c1b(0x12b)]?.[_0x523c1b(0x11d)]||_0x2b956d[_0x523c1b(0x106)]?.[_0x523c1b(0x11d)]||_0x2b956d[_0x523c1b(0x143)]}}));}else{if('tool'in _0x26400d)console[_0x523c1b(0x11f)](JSON['stringify']({'type':_0x523c1b(0x10d),'data':{'id':_0x26400d[_0x523c1b(0x116)]['id'],'name':_0x26400d[_0x523c1b(0x116)][_0x523c1b(0x110)],'result':typeof _0x26400d[_0x523c1b(0x116)]['content']==='string'?_0x26400d[_0x523c1b(0x116)][_0x523c1b(0x145)]['slice'](0x0,0x1f4):''}}));else _0x523c1b(0x149)in _0x26400d&&console[_0x523c1b(0x11f)](JSON[_0x523c1b(0x117)]({'type':_0x523c1b(0x149),'data':{'error':_0x26400d[_0x523c1b(0x149)]}}));}}}}}console[_0x523c1b(0x11f)](JSON[_0x523c1b(0x117)]({'type':_0x523c1b(0x12f)}));}async['execute'](_0x3974ae){const _0x2874c3=a9_0x4ab2a1,{options:_0x20085e,args:_0x220038,tdx:_0x189bd1}=_0x3974ae,_0x14ebb2=_0x220038['join']('\x20'),_0x3f35ab=_0x20085e,_0x3c7652=_0x3f35ab[_0x2874c3(0x14a)],_0x144342=_0x3f35ab[_0x2874c3(0x144)],_0x4f7c99=_0x3f35ab[_0x2874c3(0x131)],_0x4f37c1=_0x3f35ab[_0x2874c3(0x13e)],_0x143457=_0x3f35ab[_0x2874c3(0x127)],_0x1c0af8=_0x3f35ab[_0x2874c3(0x119)];if(_0x4f37c1&&_0x143457)return console[_0x2874c3(0x149)](_0x2874c3(0x10e)),0x1;try{let _0x4ecb02,_0x374299;if(_0x143457)_0x374299=_0x143457;else!_0x4f37c1&&(_0x374299=loadLastChatId(),_0x374299&&_0x20085e[_0x2874c3(0x139)]&&console['error'](_0x2874c3(0x11a)+_0x374299));!_0x143457&&(_0x4f37c1||!_0x374299)&&(_0x4ecb02=await resolveAgentId(_0x189bd1,_0x3c7652,_0x144342,_0x4f7c99,_0x20085e[_0x2874c3(0x139)]));const _0x3fb6c2=_0x1c0af8?(_0x471e4f,_0x29d036,_0x4245b6)=>this[_0x2874c3(0x13f)](_0x189bd1,_0x471e4f,_0x29d036,_0x4245b6):(_0x2bf753,_0x4094ef,_0x4af5ce)=>this[_0x2874c3(0x122)](_0x189bd1,_0x2bf753,_0x4094ef,_0x4af5ce,_0x20085e[_0x2874c3(0x139)]);try{await _0x3fb6c2(_0x14ebb2,_0x4ecb02,_0x374299);}catch(_0x2e0d14){const _0x383f5c=_0x2e0d14 instanceof SDKError&&_0x2e0d14['code']===ErrorCode['CHAT_NOT_FOUND']||_0x2e0d14 instanceof Error&&_0x2e0d14[_0x2874c3(0x142)][_0x2874c3(0x132)](_0x2874c3(0x137));if(_0x383f5c&&_0x143457)return console[_0x2874c3(0x149)](_0x2874c3(0x140)+_0x143457+_0x2874c3(0x12d)),0x1;if(_0x383f5c)_0x20085e[_0x2874c3(0x139)]&&console['error'](_0x2874c3(0x108)),!_0x4ecb02&&(_0x4ecb02=await resolveAgentId(_0x189bd1,_0x3c7652,_0x144342,_0x4f7c99,_0x20085e[_0x2874c3(0x139)])),await _0x3fb6c2(_0x14ebb2,_0x4ecb02,undefined);else throw _0x2e0d14;}return!_0x1c0af8&&console[_0x2874c3(0x11f)](),0x0;}catch(_0xac62ec){return console['error'](),handleSDKError(_0xac62ec,_0x20085e),0x1;}}[a9_0x4ab2a1(0x10c)](_0x36eef9){const _0x11066c=a9_0x4ab2a1;if(_0x11066c(0x145)in _0x36eef9)process[_0x11066c(0x141)][_0x11066c(0x107)](_0x36eef9[_0x11066c(0x145)]);else _0x11066c(0x149)in _0x36eef9&&console[_0x11066c(0x149)](_0x11066c(0x134)+_0x36eef9['error']);}}function a9_0x66e6(_0x4ee272,_0x369184){_0x4ee272=_0x4ee272-0x106;const _0x44eadb=a9_0x44ea();let _0x66e64a=_0x44eadb[_0x4ee272];return _0x66e64a;}export class ChatCreateCommand extends BaseCommand{['name']=a9_0x4ab2a1(0x125);[a9_0x4ab2a1(0x13b)]=a9_0x4ab2a1(0x114);[a9_0x4ab2a1(0x109)](_0x5a2a49){const _0x156227=a9_0x4ab2a1,_0x5957cb=_0x5a2a49['options'],_0x2c1f1d=_0x5957cb['agent'],_0x5d9aca=_0x5957cb[_0x156227(0x144)];if(!_0x2c1f1d&&!_0x5d9aca)return _0x156227(0x11b);return undefined;}async[a9_0x4ab2a1(0x126)](_0xf15fc0){const _0x3282d3=a9_0x4ab2a1,{options:_0x104ea6,tdx:_0x44ebec}=_0xf15fc0,_0x3fa5a3=_0x104ea6,_0x140608=_0x3fa5a3[_0x3282d3(0x14a)],_0x5570de=_0x3fa5a3[_0x3282d3(0x144)],_0x2f4bdd=_0x3fa5a3[_0x3282d3(0x131)];try{const _0x3dcc15=await resolveAgentId(_0x44ebec,_0x140608,_0x5570de,_0x2f4bdd,_0x104ea6[_0x3282d3(0x139)]),_0x48b021=await _0x44ebec[_0x3282d3(0x12c)]['startChat'](_0x3dcc15);return saveLastChatId(_0x48b021['id']),console[_0x3282d3(0x11f)](JSON[_0x3282d3(0x117)]({'chatId':_0x48b021['id'],'agentId':_0x3dcc15})),0x0;}catch(_0xb5a607){return handleSDKError(_0xb5a607,_0x104ea6),0x1;}}}