@treasuredata/tdx 2026.3.0 → 2026.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (200) 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/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/chat-command.js +1 -1
  11. package/dist/commands/claude-command.js +1 -1
  12. package/dist/commands/claude-statusline-command.js +1 -1
  13. package/dist/commands/claude-usage-command.js +1 -1
  14. package/dist/commands/command.js +1 -1
  15. package/dist/commands/connection-command.js +1 -1
  16. package/dist/commands/databases.js +1 -1
  17. package/dist/commands/delivery-command.js +1 -1
  18. package/dist/commands/describe.js +1 -1
  19. package/dist/commands/engage-campaign-pull-command.js +1 -1
  20. package/dist/commands/engage-campaign-push-command.js +1 -1
  21. package/dist/commands/engage-campaign-validate-command.js +1 -1
  22. package/dist/commands/engage-command.js +1 -1
  23. package/dist/commands/engage-template-pull-command.js +1 -1
  24. package/dist/commands/engage-template-push-command.js +1 -1
  25. package/dist/commands/engage-template-validate-command.js +1 -1
  26. package/dist/commands/job-command.js +1 -1
  27. package/dist/commands/journey-command.js +1 -1
  28. package/dist/commands/journey-validate-command.js +1 -1
  29. package/dist/commands/llm-command.js +1 -1
  30. package/dist/commands/mcp-command.js +1 -1
  31. package/dist/commands/parent-segment-command.js +1 -1
  32. package/dist/commands/profile-command.js +1 -1
  33. package/dist/commands/profiles-command.js +1 -1
  34. package/dist/commands/query-command.js +1 -1
  35. package/dist/commands/schedule-command.js +1 -1
  36. package/dist/commands/segment-command.js +1 -1
  37. package/dist/commands/segment-create-command.js +1 -1
  38. package/dist/commands/segment-fields-command.js +1 -1
  39. package/dist/commands/segment-pull-command.js +1 -1
  40. package/dist/commands/segment-push-command.js +1 -1
  41. package/dist/commands/segment-update-command.js +1 -1
  42. package/dist/commands/segment-use-command.js +1 -1
  43. package/dist/commands/segment-validate-command.js +1 -1
  44. package/dist/commands/segments.js +1 -1
  45. package/dist/commands/show.js +1 -1
  46. package/dist/commands/status-command.js +1 -1
  47. package/dist/commands/tables.js +1 -1
  48. package/dist/commands/unset-command.js +1 -1
  49. package/dist/commands/upgrade-command.js +1 -1
  50. package/dist/commands/use-command.js +1 -1
  51. package/dist/commands/user-command.js +1 -1
  52. package/dist/commands/workflow-command.js +1 -1
  53. package/dist/core/auth.js +1 -1
  54. package/dist/core/command-output.js +1 -1
  55. package/dist/core/config.d.ts +4 -4
  56. package/dist/core/config.d.ts.map +1 -1
  57. package/dist/core/config.js +1 -1
  58. package/dist/core/config.js.map +1 -1
  59. package/dist/core/connection-cache.js +1 -1
  60. package/dist/core/constants.js +1 -1
  61. package/dist/core/credential-cache.js +1 -1
  62. package/dist/core/global-context.js +1 -1
  63. package/dist/core/keychain.js +1 -1
  64. package/dist/core/profile.js +1 -1
  65. package/dist/core/project-config.js +1 -1
  66. package/dist/core/session.js +1 -1
  67. package/dist/core/user-cache.js +1 -1
  68. package/dist/core/version.js +1 -1
  69. package/dist/index.js +1 -1
  70. package/dist/mcp/server.js +1 -1
  71. package/dist/mcp/tools/index.js +1 -1
  72. package/dist/mcp/tools/tdx-run.js +1 -1
  73. package/dist/mcp/tools/tdx-search.js +1 -1
  74. package/dist/mcp/utils.js +1 -1
  75. package/dist/proxy/claude-usage-tracker.js +1 -1
  76. package/dist/proxy/passthrough-server.js +1 -1
  77. package/dist/proxy/sse-usage-parser.js +1 -1
  78. package/dist/sdk/agent/agent-config.js +1 -1
  79. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  80. package/dist/sdk/agent/agent-yaml.js +1 -1
  81. package/dist/sdk/agent/test/evaluator.js +1 -1
  82. package/dist/sdk/agent/test/executor.js +1 -1
  83. package/dist/sdk/agent/test/index.js +1 -1
  84. package/dist/sdk/agent/test/output.js +1 -1
  85. package/dist/sdk/agent/test/parser.js +1 -1
  86. package/dist/sdk/agent/tool-target-registry.js +1 -1
  87. package/dist/sdk/api.js +1 -1
  88. package/dist/sdk/client/cdp-api-client.js +1 -1
  89. package/dist/sdk/client/delivery-api-client.js +1 -1
  90. package/dist/sdk/client/endpoints.js +1 -1
  91. package/dist/sdk/client/engage-api-client.js +1 -1
  92. package/dist/sdk/client/http-client.js +1 -1
  93. package/dist/sdk/client/llm-api-client.js +1 -1
  94. package/dist/sdk/client/rate-limiter.js +1 -1
  95. package/dist/sdk/client/td-api-client.js +1 -1
  96. package/dist/sdk/client/trino-api-client.js +1 -1
  97. package/dist/sdk/client/workflow-client.js +1 -1
  98. package/dist/sdk/connection-validator.js +1 -1
  99. package/dist/sdk/connection.js +1 -1
  100. package/dist/sdk/delivery.js +1 -1
  101. package/dist/sdk/engage/campaign-pull.js +1 -1
  102. package/dist/sdk/engage/campaign-push.js +1 -1
  103. package/dist/sdk/engage/campaign-validator.js +1 -1
  104. package/dist/sdk/engage/campaign-yaml.js +1 -1
  105. package/dist/sdk/engage/template-pull.js +1 -1
  106. package/dist/sdk/engage/template-push.js +1 -1
  107. package/dist/sdk/engage/template-validator.js +1 -1
  108. package/dist/sdk/engage/template-yaml.js +1 -1
  109. package/dist/sdk/engage/types/campaign-def.js +1 -1
  110. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  111. package/dist/sdk/engage/types/template-schema.js +1 -1
  112. package/dist/sdk/engage.js +1 -1
  113. package/dist/sdk/errors.js +1 -1
  114. package/dist/sdk/index.js +1 -1
  115. package/dist/sdk/io/index.js +1 -1
  116. package/dist/sdk/io/node-filesystem.js +1 -1
  117. package/dist/sdk/job.js +1 -1
  118. package/dist/sdk/journey.js +1 -1
  119. package/dist/sdk/llm/chat-cache.js +1 -1
  120. package/dist/sdk/llm/index.js +1 -1
  121. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  122. package/dist/sdk/llm/model-factors.js +1 -1
  123. package/dist/sdk/personalization.js +1 -1
  124. package/dist/sdk/query/index.js +1 -1
  125. package/dist/sdk/query/sql-parser.js +1 -1
  126. package/dist/sdk/realtime.js +1 -1
  127. package/dist/sdk/schedule.js +1 -1
  128. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  129. package/dist/sdk/segment/fields-display.js +1 -1
  130. package/dist/sdk/segment/file-discovery.js +1 -1
  131. package/dist/sdk/segment/journey-utils.js +1 -1
  132. package/dist/sdk/segment/journey-validator.js +1 -1
  133. package/dist/sdk/segment/journey-yaml.js +1 -1
  134. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  135. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  136. package/dist/sdk/segment/pull-workflow.js +1 -1
  137. package/dist/sdk/segment/push-recovery.js +1 -1
  138. package/dist/sdk/segment/push-workflow.js +1 -1
  139. package/dist/sdk/segment/resolution-context.js +1 -1
  140. package/dist/sdk/segment/segment-path-parser.js +1 -1
  141. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  142. package/dist/sdk/segment/segment-validator.js +1 -1
  143. package/dist/sdk/segment/target-resolution.js +1 -1
  144. package/dist/sdk/segment/tdx-config.js +1 -1
  145. package/dist/sdk/segment/types/activation-schema.js +1 -1
  146. package/dist/sdk/segment/types/journey-def.js +1 -1
  147. package/dist/sdk/segment/types/journey-schema.js +1 -1
  148. package/dist/sdk/segment/types/segment-def.js +1 -1
  149. package/dist/sdk/segment/types/segment-schema.js +1 -1
  150. package/dist/sdk/segment/validate-files.js +1 -1
  151. package/dist/sdk/segment/yaml-validator.js +1 -1
  152. package/dist/sdk/segment.js +1 -1
  153. package/dist/sdk/types/index.js +1 -1
  154. package/dist/sdk/types/progress.js +1 -1
  155. package/dist/sdk/user.js +1 -1
  156. package/dist/sdk/util/format-detector.js +1 -1
  157. package/dist/sdk/util/formatters.js +1 -1
  158. package/dist/sdk/util/index.js +1 -1
  159. package/dist/sdk/util/paginate.js +1 -1
  160. package/dist/sdk/util/tree-formatter.js +1 -1
  161. package/dist/sdk/workflow/archive-validation.js +1 -1
  162. package/dist/sdk/workflow/clone-workflow.js +1 -1
  163. package/dist/sdk/workflow/index.js +1 -1
  164. package/dist/sdk/workflow/pull-workflow.js +1 -1
  165. package/dist/sdk/workflow/push-workflow.js +1 -1
  166. package/dist/sdk/workflow/tdx-config.js +1 -1
  167. package/dist/sdk/workflow/workflow-utils.js +1 -1
  168. package/dist/test-utils/command-runner.js +1 -1
  169. package/dist/test-utils/factories.js +1 -1
  170. package/dist/test-utils/fixtures.js +1 -1
  171. package/dist/test-utils/http-mock.js +1 -1
  172. package/dist/test-utils/index.js +1 -1
  173. package/dist/utils/async.js +1 -1
  174. package/dist/utils/colors.js +1 -1
  175. package/dist/utils/diff.js +1 -1
  176. package/dist/utils/file-permissions.js +1 -1
  177. package/dist/utils/file-reader.js +1 -1
  178. package/dist/utils/github-releases.js +1 -1
  179. package/dist/utils/global-cache.js +1 -1
  180. package/dist/utils/json-loader.js +1 -1
  181. package/dist/utils/local-cache.js +1 -1
  182. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  183. package/dist/utils/logger/formatters/index.js +1 -1
  184. package/dist/utils/logger/handlers/console-handler.js +1 -1
  185. package/dist/utils/logger/handlers/file-handler.js +1 -1
  186. package/dist/utils/logger/handlers/index.js +1 -1
  187. package/dist/utils/logger/handlers/null-handler.js +1 -1
  188. package/dist/utils/logger/index.js +1 -1
  189. package/dist/utils/logger/logger.js +1 -1
  190. package/dist/utils/logger/types.js +1 -1
  191. package/dist/utils/option-validation.js +1 -1
  192. package/dist/utils/process.js +1 -1
  193. package/dist/utils/prompt.js +1 -1
  194. package/dist/utils/spinner.js +1 -1
  195. package/dist/utils/sse-parser.js +1 -1
  196. package/dist/utils/string-utils.js +1 -1
  197. package/dist/utils/table-ref-parser.js +1 -1
  198. package/dist/utils/tdx-logger.js +1 -1
  199. package/dist/utils/version-check.js +1 -1
  200. package/package.json +1 -1
@@ -1 +1 @@
1
- const a3_0x189263=a3_0x2a04;(function(_0x5f1615,_0x41d40a){const _0x5a525b=a3_0x2a04,_0x5ccc9c=_0x5f1615();while(!![]){try{const _0x2f03bf=-parseInt(_0x5a525b(0xd9))/0x1*(-parseInt(_0x5a525b(0xda))/0x2)+parseInt(_0x5a525b(0xe6))/0x3+parseInt(_0x5a525b(0xd0))/0x4+-parseInt(_0x5a525b(0xce))/0x5+-parseInt(_0x5a525b(0xcc))/0x6+parseInt(_0x5a525b(0xe9))/0x7+parseInt(_0x5a525b(0xcd))/0x8*(-parseInt(_0x5a525b(0xca))/0x9);if(_0x2f03bf===_0x41d40a)break;else _0x5ccc9c['push'](_0x5ccc9c['shift']());}catch(_0x520402){_0x5ccc9c['push'](_0x5ccc9c['shift']());}}}(a3_0x37e3,0xa8336));function a3_0x2a04(_0x52c3f3,_0x387186){_0x52c3f3=_0x52c3f3-0xca;const _0x37e3bf=a3_0x37e3();let _0x2a048d=_0x37e3bf[_0x52c3f3];return _0x2a048d;}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';function a3_0x37e3(){const _0x130eb7=['verbose','Resolving\x20parent\x20segment\x20\x27','Error:\x20','name','241667HXBfJW','4lwWjYA','List\x20activations\x20for\x20a\x20segment','description','cause','Resolved\x20child\x20ID:\x20','site','\x27...','listActivations','activations','\x20\x20Cause:\x20','Resolved\x20parent\x20ID:\x20','Parent\x20name:\x20','1656093bvKiIO','length','Child\x20name:\x20','1724002FOuddO','error','segment','Resolving\x20child\x20segment\x20\x27','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','118962vPovol','data','3186966iDuNpE','640EjXeJk','925975ViKVqZ','message','4724380PtWcua','\x20activation','Site:\x20','Error:\x20Segment\x20name\x20is\x20required','resolveSegmentId'];a3_0x37e3=function(){return _0x130eb7;};return a3_0x37e3();}export class ActivationsCommand extends BaseCommand{[a3_0x189263(0xd8)]=a3_0x189263(0xe2);[a3_0x189263(0xdc)]=a3_0x189263(0xdb);async['execute'](_0x3f68ac){const _0xd9df6e=a3_0x189263,{options:_0x19034c,args:_0x17e93d,tdx:_0x47f56c}=_0x3f68ac;if(_0x17e93d[_0xd9df6e(0xe7)]===0x0)return console[_0xd9df6e(0xea)](_0xd9df6e(0xd3)),console['error']('Usage:\x20tdx\x20activations\x20<parent_name/child_name>'),0x1;try{const {parentId:_0x2414eb,childId:_0x2370f6}=parseSegmentRef(_0x17e93d[0x0]);if(!_0x2370f6)return console[_0xd9df6e(0xea)]('Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations'),console[_0xd9df6e(0xea)](_0xd9df6e(0xed)),0x1;_0x19034c[_0xd9df6e(0xd5)]&&(console[_0xd9df6e(0xea)](_0xd9df6e(0xd2)+_0x19034c[_0xd9df6e(0xdf)]),console[_0xd9df6e(0xea)](_0xd9df6e(0xe5)+_0x2414eb),console[_0xd9df6e(0xea)](_0xd9df6e(0xe8)+_0x2370f6));const _0x5bfe99=await withSpinner(_0xd9df6e(0xd6)+_0x2414eb+_0xd9df6e(0xe0),()=>_0x47f56c[_0xd9df6e(0xeb)]['resolveParentId'](_0x2414eb),{'verbose':_0x19034c[_0xd9df6e(0xd5)]}),_0x55df68=_0x5bfe99[_0xd9df6e(0xcb)];_0x19034c[_0xd9df6e(0xd5)]&&console['error'](_0xd9df6e(0xe4)+_0x55df68);const _0x2fb555=await withSpinner(_0xd9df6e(0xec)+_0x2370f6+_0xd9df6e(0xe0),()=>_0x47f56c[_0xd9df6e(0xeb)][_0xd9df6e(0xd4)](_0x55df68,_0x2370f6),{'verbose':_0x19034c[_0xd9df6e(0xd5)]}),_0x12b76e=_0x2fb555[_0xd9df6e(0xcb)];_0x19034c[_0xd9df6e(0xd5)]&&console['error'](_0xd9df6e(0xde)+_0x12b76e);const _0x1dc039=await withSpinner('Listing\x20activations\x20for\x20segment\x20\x27'+_0x2370f6+'\x27...',()=>_0x47f56c[_0xd9df6e(0xeb)][_0xd9df6e(0xe1)](_0x55df68,_0x12b76e),{'verbose':_0x19034c['verbose']}),_0x5c6018=_0x1dc039[_0xd9df6e(0xcb)];return console['error']('✔\x20Found\x20'+_0x5c6018['length']+_0xd9df6e(0xd1)+(_0x5c6018['length']!==0x1?'s':'')),await handleSDKOutput(_0x5c6018,_0x19034c),0x0;}catch(_0x1e0bbe){if(_0x1e0bbe instanceof SDKError)return console[_0xd9df6e(0xea)](_0xd9df6e(0xd7)+_0x1e0bbe[_0xd9df6e(0xcf)]),_0x1e0bbe[_0xd9df6e(0xdd)]&&console[_0xd9df6e(0xea)](_0xd9df6e(0xe3)+_0x1e0bbe['cause']),0x1;throw _0x1e0bbe;}}}
1
+ const a3_0xcb1026=a3_0x3231;(function(_0x528d6f,_0x36c2f7){const _0x4e6b23=a3_0x3231,_0xa028fa=_0x528d6f();while(!![]){try{const _0x2ac935=-parseInt(_0x4e6b23(0x138))/0x1+-parseInt(_0x4e6b23(0x142))/0x2+parseInt(_0x4e6b23(0x12f))/0x3*(-parseInt(_0x4e6b23(0x132))/0x4)+parseInt(_0x4e6b23(0x12d))/0x5+parseInt(_0x4e6b23(0x12c))/0x6*(parseInt(_0x4e6b23(0x130))/0x7)+-parseInt(_0x4e6b23(0x139))/0x8*(-parseInt(_0x4e6b23(0x147))/0x9)+-parseInt(_0x4e6b23(0x14a))/0xa*(parseInt(_0x4e6b23(0x129))/0xb);if(_0x2ac935===_0x36c2f7)break;else _0xa028fa['push'](_0xa028fa['shift']());}catch(_0x3a494a){_0xa028fa['push'](_0xa028fa['shift']());}}}(a3_0x9a94,0xbd46a));function a3_0x3231(_0x526733,_0x15a112){_0x526733=_0x526733-0x126;const _0x9a94a2=a3_0x9a94();let _0x32312f=_0x9a94a2[_0x526733];return _0x32312f;}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a3_0x9a94(){const _0xc46af9=['List\x20activations\x20for\x20a\x20segment','1741893MQPFQk','112wJtDEV','site','4ecVVZi','length','verbose','message','\x20\x20Cause:\x20','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','149944PebUIZ','118856TdpgdF','Listing\x20activations\x20for\x20segment\x20\x27','cause','activations','Parent\x20name:\x20','\x20activation','execute','Error:\x20Segment\x20name\x20is\x20required','Resolved\x20child\x20ID:\x20','1622606NJlaGu','Site:\x20','error','segment','\x27...','810EfYahD','listActivations','name','20QIDXcg','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','Child\x20name:\x20','Resolving\x20child\x20segment\x20\x27','resolveSegmentId','Resolved\x20parent\x20ID:\x20','✔\x20Found\x20','Error:\x20','Resolving\x20parent\x20segment\x20\x27','data','4087292yERpKW','resolveParentId','description','326082fsqAru','4268070TSVRMz'];a3_0x9a94=function(){return _0xc46af9;};return a3_0x9a94();}import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';export class ActivationsCommand extends BaseCommand{[a3_0xcb1026(0x149)]=a3_0xcb1026(0x13c);[a3_0xcb1026(0x12b)]=a3_0xcb1026(0x12e);async[a3_0xcb1026(0x13f)](_0x29e5a2){const _0x4255ed=a3_0xcb1026,{options:_0xf6de65,args:_0x2b3380,tdx:_0x2ac7ac}=_0x29e5a2;if(_0x2b3380[_0x4255ed(0x133)]===0x0)return console['error'](_0x4255ed(0x140)),console[_0x4255ed(0x144)]('Usage:\x20tdx\x20activations\x20<parent_name/child_name>'),0x1;try{const {parentId:_0x52f6ff,childId:_0x1a2a31}=parseSegmentRef(_0x2b3380[0x0]);if(!_0x1a2a31)return console['error'](_0x4255ed(0x137)),console['error'](_0x4255ed(0x14b)),0x1;_0xf6de65[_0x4255ed(0x134)]&&(console[_0x4255ed(0x144)](_0x4255ed(0x143)+_0xf6de65[_0x4255ed(0x131)]),console[_0x4255ed(0x144)](_0x4255ed(0x13d)+_0x52f6ff),console[_0x4255ed(0x144)](_0x4255ed(0x14c)+_0x1a2a31));const _0x2ac582=await withSpinner(_0x4255ed(0x127)+_0x52f6ff+'\x27...',()=>_0x2ac7ac[_0x4255ed(0x145)][_0x4255ed(0x12a)](_0x52f6ff),{'verbose':_0xf6de65[_0x4255ed(0x134)]}),_0x4b1ca3=_0x2ac582[_0x4255ed(0x128)];_0xf6de65['verbose']&&console[_0x4255ed(0x144)](_0x4255ed(0x14f)+_0x4b1ca3);const _0x3e1abf=await withSpinner(_0x4255ed(0x14d)+_0x1a2a31+'\x27...',()=>_0x2ac7ac[_0x4255ed(0x145)][_0x4255ed(0x14e)](_0x4b1ca3,_0x1a2a31),{'verbose':_0xf6de65[_0x4255ed(0x134)]}),_0xed6803=_0x3e1abf[_0x4255ed(0x128)];_0xf6de65[_0x4255ed(0x134)]&&console[_0x4255ed(0x144)](_0x4255ed(0x141)+_0xed6803);const _0x371100=await withSpinner(_0x4255ed(0x13a)+_0x1a2a31+_0x4255ed(0x146),()=>_0x2ac7ac[_0x4255ed(0x145)][_0x4255ed(0x148)](_0x4b1ca3,_0xed6803),{'verbose':_0xf6de65[_0x4255ed(0x134)]}),_0x306235=_0x371100[_0x4255ed(0x128)];return console[_0x4255ed(0x144)](_0x4255ed(0x150)+_0x306235[_0x4255ed(0x133)]+_0x4255ed(0x13e)+(_0x306235['length']!==0x1?'s':'')),await handleSDKOutput(_0x306235,_0xf6de65),0x0;}catch(_0x19e1d8){if(_0x19e1d8 instanceof SDKError)return console['error'](_0x4255ed(0x126)+_0x19e1d8[_0x4255ed(0x135)]),_0x19e1d8[_0x4255ed(0x13b)]&&console[_0x4255ed(0x144)](_0x4255ed(0x136)+_0x19e1d8[_0x4255ed(0x13b)]),0x1;throw _0x19e1d8;}}}
@@ -1 +1 @@
1
- const a4_0x35fc9a=a4_0x2d4b;(function(_0x3d93a1,_0x1243b1){const _0xd96f18=a4_0x2d4b,_0x2dffa1=_0x3d93a1();while(!![]){try{const _0x1a53be=-parseInt(_0xd96f18(0x1a0))/0x1+parseInt(_0xd96f18(0x18c))/0x2+parseInt(_0xd96f18(0x19d))/0x3+parseInt(_0xd96f18(0x1ba))/0x4*(parseInt(_0xd96f18(0x1be))/0x5)+parseInt(_0xd96f18(0x1b0))/0x6*(-parseInt(_0xd96f18(0x12c))/0x7)+-parseInt(_0xd96f18(0x181))/0x8*(-parseInt(_0xd96f18(0x171))/0x9)+-parseInt(_0xd96f18(0x1b4))/0xa*(parseInt(_0xd96f18(0x172))/0xb);if(_0x1a53be===_0x1243b1)break;else _0x2dffa1['push'](_0x2dffa1['shift']());}catch(_0xe038b8){_0x2dffa1['push'](_0x2dffa1['shift']());}}}(a4_0x1dca,0x91f7c));import a4_0x2d01e3 from'chalk';import a4_0x3cc5ff from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';function a4_0x1dca(){const _0x53440f=['projectId','\x20\x20Agent\x20\x22','\x0aPush\x20','agent:clone','\x0aPush\x20summary\x20for\x20\x27','\x20new','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','\x20files?','Pulling\x20agent\x20\x22','New\x20project\x20name\x20is\x20required','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','sourceProjectName','new','integrations','pullAgent','repeat','Using\x20local\x20project:\x20','newProjectName','\x0aErrors\x20found:','cwd','log','Using\x20project\x20from\x20','New\x20project:\x20','\x20\x20Prompts:\x20','green','Agent\x20','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','Using\x20current\x20project:\x20','Cloning\x20\x22','pushProject','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','\x20|\x20','Chat:\x20','\x0a✔\x20Pushed\x20','\x20\x20Target:\x20','prompts','Would\x20pull\x20agent:\x20','action','Output\x20path:\x20','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','message','experimentalKnowledgeBases','knowledgeBases','\x20--profile\x20','dryRun','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','output','\x20errors','description','context','\x0aChanges\x20to\x20prompt\x20\x27','\x20\x20Experimental\x20Artifacts:\x20','Cancelled','Using\x20project:\x20','\x20resources\x20to\x20\x27','projectDir','\x20\x20Prompt\x20\x22','total','utf-8','arg-dir','Clone\x20\x22','Analyzing\x20changes\x20to\x20push...','733923BueJUh','7514045MGvUzX','INVALID_ARGUMENT','red','\x20\x20Agents:\x20','yes','\x22\x20to\x20a\x20different\x20profile','\x20\x20Source:\x20','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','\x20\x20Knowledge\x20Bases:\x20','\x0aWrite\x20','Analyzing\x20project\x20\x22','tdx.json','pushAgent','agent:pull','diff','104DFDHFN','Source:\x20','Failed\x20to\x20push\x20agent:\x20','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','\x0aPull\x20summary\x20for\x20\x27','\x20files\x20to\x20','\x22\x20to\x20\x22','dim','Using\x20project\x20from\x20context:\x20','isNew','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','983982lXYcNj','Status:\x20','cwd-config','site','✔\x20Context\x20set:\x20','\x22:\x20','agent.yml','Agent:\x20','Would\x20push\x20agent:\x20','Agent\x20pulled\x20successfully','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','pullProject','counts','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','execute','Pushing\x20agent\x20from\x20\x22','Pushing\x20to\x20project...','1471563PfcDJj','\x0aChanges\x20to\x20agent\x20\x27','reason','842605kinztw','errors','\x20\x20Experimental\x20Artifact\x20\x22','Errors:','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','\x20=\x20','\x20updated','projectName','Would\x20clone:','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)','parse','gray','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','MISSING_ARGUMENT','\x0aError:','\x20\x20tdx\x20agent\x20pull\x20','5698074XkWxkb','\x20\x20Integrations:\x20','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','Using\x20context\x20project:\x20','10NwdyGs','textKnowledgeBases','\x20\x20Text\x20Knowledge\x20Bases:\x20','llm_project','agents','Summary:','4160sKDHLa','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','source','yellow','4955cOhdwo','hasChanges','cyan','agentId','\x20created','New\x20project\x20ID:\x20','\x20\x20Text\x20Knowledge\x20Base\x20\x22','experimentalArtifacts','\x20successfully','no_context','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','updated','error','<new-name>','\x22...','\x20unchanged','outputDir','Project:\x20','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','\x20\x20Integration\x20\x22','Dry\x20run\x20-\x20no\x20files\x20written','push','created','Writing\x20files...','\x20changed','\x20\x20Knowledge\x20Base\x20\x22','dirname','Dry\x20run\x20-\x20no\x20changes\x20made','-\x20nothing\x20pushed','agentName','llm','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','unchanged','\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','newProjectId','join','Project\x20cloned\x20successfully','\x0aChanges:','\x20\x20tdx\x20agent\x20clone\x20agents/','\x20resources?','cloneProject','llmProject','no_local_folder','-\x20no\x20files\x20written','outputPath','7UasmLJ','force','agent:push','name'];a4_0x1dca=function(){return _0x53440f;};return a4_0x1dca();}import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext,resolveAgentPullArgs}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';function a4_0x2d4b(_0x272124,_0x22e446){_0x272124=_0x272124-0x112;const _0x1dcae0=a4_0x1dca();let _0x2d4b73=_0x1dcae0[_0x272124];return _0x2d4b73;}import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x4a7b17){const _0x29c354=a4_0x2d4b,_0x22f5eb=[];if(_0x4a7b17['total']!==undefined)_0x22f5eb[_0x29c354(0x113)](_0x4a7b17[_0x29c354(0x16c)]+'\x20total');if(_0x4a7b17[_0x29c354(0x13c)]!==undefined&&_0x4a7b17[_0x29c354(0x13c)]>0x0)_0x22f5eb[_0x29c354(0x113)](a4_0x2d01e3[_0x29c354(0x148)](_0x4a7b17[_0x29c354(0x13c)]+_0x29c354(0x135)));if(_0x4a7b17['created']!==undefined&&_0x4a7b17[_0x29c354(0x114)]>0x0)_0x22f5eb['push'](a4_0x2d01e3[_0x29c354(0x148)](_0x4a7b17[_0x29c354(0x114)]+_0x29c354(0x1c2)));if(_0x4a7b17[_0x29c354(0x1c9)]!==undefined&&_0x4a7b17[_0x29c354(0x1c9)]>0x0)_0x22f5eb['push'](a4_0x2d01e3['yellow'](_0x4a7b17['updated']+_0x29c354(0x1a6)));if(_0x4a7b17['unchanged']!==undefined&&_0x4a7b17[_0x29c354(0x11f)]>0x0)_0x22f5eb[_0x29c354(0x113)](a4_0x2d01e3[_0x29c354(0x1ab)](_0x4a7b17['unchanged']+_0x29c354(0x1cd)));if(_0x4a7b17['errors']!==undefined&&_0x4a7b17[_0x29c354(0x1a1)]>0x0)_0x22f5eb[_0x29c354(0x113)](a4_0x2d01e3['red'](_0x4a7b17[_0x29c354(0x1a1)]+_0x29c354(0x162)));return _0x22f5eb[_0x29c354(0x122)](',\x20');}function displayDiffs(_0x5561b5,_0x1d22cf,_0x489093,_0x4d5012,_0x460429,_0x3ceb5e,_0xad0a0c){const _0x239da0=a4_0x2d4b;for(const _0x206c74 of _0x5561b5){if(_0x206c74[_0x239da0(0x180)]){const _0x365128=_0x206c74[_0x239da0(0x11b)]||_0x206c74[_0x239da0(0x12f)];console[_0x239da0(0x144)](_0x239da0(0x19e)+_0x365128+'\x27:'),console[_0x239da0(0x144)]('─'[_0x239da0(0x13f)](0x3c)),console[_0x239da0(0x144)](_0x206c74[_0x239da0(0x180)]),console[_0x239da0(0x144)]('─'[_0x239da0(0x13f)](0x3c));}}for(const _0x2a9d72 of _0x1d22cf){_0x2a9d72[_0x239da0(0x180)]&&(console['log'](_0x239da0(0x160)+_0x2a9d72[_0x239da0(0x12f)]+'\x27:'),console[_0x239da0(0x144)]('─'[_0x239da0(0x13f)](0x3c)),console[_0x239da0(0x144)](_0x2a9d72[_0x239da0(0x180)]),console['log']('─'[_0x239da0(0x13f)](0x3c)));}for(const _0x13c450 of _0x489093){_0x13c450['diff']&&(console[_0x239da0(0x144)](_0x239da0(0x1b2)+_0x13c450[_0x239da0(0x12f)]+'\x27:'),console[_0x239da0(0x144)]('─'['repeat'](0x3c)),console[_0x239da0(0x144)](_0x13c450[_0x239da0(0x180)]),console[_0x239da0(0x144)]('─'[_0x239da0(0x13f)](0x3c)));}for(const _0x2b4cdf of _0x4d5012){_0x2b4cdf[_0x239da0(0x180)]&&(console[_0x239da0(0x144)](_0x239da0(0x165)+_0x2b4cdf['name']+'\x27:'),console[_0x239da0(0x144)]('─'['repeat'](0x3c)),console['log'](_0x2b4cdf[_0x239da0(0x180)]),console['log']('─'[_0x239da0(0x13f)](0x3c)));}for(const _0x5d0864 of _0x460429){_0x5d0864[_0x239da0(0x180)]&&(console[_0x239da0(0x144)]('\x0aChanges\x20to\x20integration\x20\x27'+_0x5d0864[_0x239da0(0x12f)]+'\x27:'),console[_0x239da0(0x144)]('─'[_0x239da0(0x13f)](0x3c)),console[_0x239da0(0x144)](_0x5d0864['diff']),console['log']('─'['repeat'](0x3c)));}for(const _0x76a7d of _0x3ceb5e){_0x76a7d[_0x239da0(0x180)]&&(console[_0x239da0(0x144)]('\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27'+_0x76a7d[_0x239da0(0x12f)]+'\x27:'),console[_0x239da0(0x144)]('─'[_0x239da0(0x13f)](0x3c)),console[_0x239da0(0x144)](_0x76a7d['diff']),console['log']('─'[_0x239da0(0x13f)](0x3c)));}for(const _0x155333 of _0xad0a0c){_0x155333[_0x239da0(0x180)]&&(console[_0x239da0(0x144)](_0x239da0(0x199)+_0x155333['name']+'\x27:'),console[_0x239da0(0x144)]('─'['repeat'](0x3c)),console[_0x239da0(0x144)](_0x155333['diff']),console[_0x239da0(0x144)]('─'['repeat'](0x3c)));}}export class AgentPullCommand extends BaseCommand{['name']=a4_0x35fc9a(0x17f);[a4_0x35fc9a(0x163)]=a4_0x35fc9a(0x14a);async[a4_0x35fc9a(0x19a)](_0x57bab9){const _0x1a576f=a4_0x35fc9a,{options:_0x47a8b2,args:_0xf5ab0b,tdx:_0x1c9466}=_0x57bab9,_0x3e1a07=_0xf5ab0b[0x0],_0x33b784=_0xf5ab0b[0x1],_0x3b36d4=_0x47a8b2[_0x1a576f(0x161)],_0x3d6d85=_0x47a8b2[_0x1a576f(0x15f)],_0x2ebf53=_0x47a8b2[_0x1a576f(0x12d)],_0x1b92ba=_0x47a8b2[_0x1a576f(0x176)],_0x5c37bc=_0x47a8b2[_0x1a576f(0x128)],_0x2b1844=_0x47a8b2['agent'];let _0x3157dd;if(_0x3e1a07){const _0x83e64=a4_0x3cc5ff['join'](_0x3e1a07,_0x1a576f(0x17d));if(existsSync(_0x83e64))try{const _0x4773da=JSON[_0x1a576f(0x1aa)](readFileSync(_0x83e64,_0x1a576f(0x16d)));_0x4773da[_0x1a576f(0x1b7)]&&(_0x3157dd={'llm_project':_0x4773da[_0x1a576f(0x1b7)]});}catch{}}const _0xcdca96=findAgentConfigPath(process[_0x1a576f(0x143)]());let _0x173516;if(_0xcdca96)try{const _0x220807=JSON[_0x1a576f(0x1aa)](readFileSync(_0xcdca96,_0x1a576f(0x16d)));_0x220807[_0x1a576f(0x1b7)]&&(_0x173516={'llm_project':_0x220807[_0x1a576f(0x1b7)]});}catch{}const _0x38c936=resolveAgentPullArgs({'arg':_0x3e1a07,'agentNameArg':_0x33b784,'agentFlag':_0x2b1844,'contextProject':_0x5c37bc,'argDirConfig':_0x3157dd,'cwdConfigPath':_0xcdca96||undefined,'cwdConfig':_0x173516}),{projectNameOrId:_0x39c6d7,targetAgentName:_0x48ed53,existingOutputDir:_0x2123c8,source:_0x166b37}=_0x38c936;if(_0x166b37===_0x1a576f(0x16e))console['log'](a4_0x2d01e3[_0x1a576f(0x188)](_0x1a576f(0x145)+a4_0x3cc5ff[_0x1a576f(0x122)](_0x3e1a07,_0x1a576f(0x17d))+':\x20'+_0x39c6d7));else{if(_0x166b37===_0x1a576f(0x18e))console[_0x1a576f(0x144)](a4_0x2d01e3[_0x1a576f(0x188)](_0x1a576f(0x168)+_0x39c6d7));else _0x166b37===_0x1a576f(0x164)&&console[_0x1a576f(0x144)](a4_0x2d01e3[_0x1a576f(0x188)](_0x1a576f(0x189)+_0x39c6d7));}if(!_0x39c6d7)return _0x2b1844?(console[_0x1a576f(0x144)](a4_0x2d01e3['yellow']('The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a')),console[_0x1a576f(0x144)](_0x1a576f(0x14d)),console[_0x1a576f(0x144)](_0x1a576f(0x136))):(console[_0x1a576f(0x144)](a4_0x2d01e3['yellow'](_0x1a576f(0x18b))),console[_0x1a576f(0x144)](_0x1a576f(0x1a9)),console[_0x1a576f(0x144)](_0x1a576f(0x120)),console[_0x1a576f(0x144)]('\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'),console[_0x1a576f(0x144)]('\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[_0x1a576f(0x144)]('\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(_0x48ed53){const {data:_0x11959b}=await withSpinner(_0x1a576f(0x138)+_0x48ed53+'\x22\x20from\x20project\x20\x22'+_0x39c6d7+_0x1a576f(0x1cc),()=>_0x1c9466[_0x1a576f(0x11c)][_0x1a576f(0x13e)](_0x39c6d7,_0x48ed53,_0x3b36d4,{'dryRun':_0x3d6d85,'force':_0x2ebf53}));if(_0x3d6d85)return console[_0x1a576f(0x144)](a4_0x2d01e3[_0x1a576f(0x1bd)](_0x1a576f(0x112))),console[_0x1a576f(0x144)](_0x1a576f(0x157)+_0x11959b[_0x1a576f(0x11b)]),console[_0x1a576f(0x144)](_0x1a576f(0x159)+_0x11959b[_0x1a576f(0x12b)]),_0x11959b[_0x1a576f(0x180)]&&(console['log'](_0x1a576f(0x124)),console['log']('─'[_0x1a576f(0x13f)](0x3c)),console[_0x1a576f(0x144)](_0x11959b['diff']),console[_0x1a576f(0x144)]('─'[_0x1a576f(0x13f)](0x3c))),0x0;return console[_0x1a576f(0x144)](a4_0x2d01e3[_0x1a576f(0x148)](_0x1a576f(0x195))),console[_0x1a576f(0x144)](_0x1a576f(0x193)+_0x11959b[_0x1a576f(0x11b)]),console[_0x1a576f(0x144)]('Output:\x20'+_0x11959b['outputPath']),console['log'](_0x1a576f(0x18d)+(_0x11959b[_0x1a576f(0x18a)]?a4_0x2d01e3['green'](_0x1a576f(0x13c)):_0x11959b[_0x1a576f(0x1bf)]?a4_0x2d01e3[_0x1a576f(0x1bd)](_0x1a576f(0x1c9)):a4_0x2d01e3['gray'](_0x1a576f(0x11f)))),0x0;}const _0x37f351=_0x2123c8||_0x3b36d4,{data:_0x364bbf}=await withSpinner(_0x1a576f(0x17c)+_0x39c6d7+_0x1a576f(0x1cc),()=>_0x1c9466['llm'][_0x1a576f(0x197)](_0x39c6d7,_0x37f351,{'dryRun':!![]})),_0x280c29=_0x364bbf[_0x1a576f(0x198)][_0x1a576f(0x1b8)][_0x1a576f(0x13c)]+_0x364bbf['counts'][_0x1a576f(0x15d)]['new']+_0x364bbf[_0x1a576f(0x198)][_0x1a576f(0x1b5)][_0x1a576f(0x13c)]+_0x364bbf['counts'][_0x1a576f(0x156)]['new']+_0x364bbf['counts'][_0x1a576f(0x13d)]['new']+_0x364bbf['counts']['experimentalKnowledgeBases'][_0x1a576f(0x13c)]+_0x364bbf[_0x1a576f(0x198)][_0x1a576f(0x1c5)]['new'],_0x26a36e=_0x364bbf[_0x1a576f(0x198)][_0x1a576f(0x1b8)][_0x1a576f(0x1c9)]+_0x364bbf['counts'][_0x1a576f(0x15d)][_0x1a576f(0x1c9)]+_0x364bbf[_0x1a576f(0x198)]['textKnowledgeBases'][_0x1a576f(0x1c9)]+_0x364bbf[_0x1a576f(0x198)][_0x1a576f(0x156)][_0x1a576f(0x1c9)]+_0x364bbf[_0x1a576f(0x198)][_0x1a576f(0x13d)][_0x1a576f(0x1c9)]+_0x364bbf[_0x1a576f(0x198)][_0x1a576f(0x15c)][_0x1a576f(0x1c9)]+_0x364bbf[_0x1a576f(0x198)][_0x1a576f(0x1c5)][_0x1a576f(0x1c9)],_0x111cac=_0x364bbf[_0x1a576f(0x198)][_0x1a576f(0x1b8)][_0x1a576f(0x11f)]+_0x364bbf[_0x1a576f(0x198)][_0x1a576f(0x15d)][_0x1a576f(0x11f)]+_0x364bbf[_0x1a576f(0x198)][_0x1a576f(0x1b5)][_0x1a576f(0x11f)]+_0x364bbf[_0x1a576f(0x198)][_0x1a576f(0x156)][_0x1a576f(0x11f)]+_0x364bbf[_0x1a576f(0x198)][_0x1a576f(0x13d)][_0x1a576f(0x11f)]+_0x364bbf[_0x1a576f(0x198)][_0x1a576f(0x15c)][_0x1a576f(0x11f)]+_0x364bbf[_0x1a576f(0x198)][_0x1a576f(0x1c5)][_0x1a576f(0x11f)];console[_0x1a576f(0x144)](_0x1a576f(0x185)+_0x364bbf[_0x1a576f(0x1a7)]+'\x27:'),console[_0x1a576f(0x144)]('\x20\x20'+a4_0x2d01e3[_0x1a576f(0x148)]('+\x20'+_0x280c29+'\x20new')+_0x1a576f(0x152)+a4_0x2d01e3[_0x1a576f(0x1bd)]('~\x20'+_0x26a36e+'\x20changed')+_0x1a576f(0x152)+a4_0x2d01e3[_0x1a576f(0x188)]('=\x20'+_0x111cac+_0x1a576f(0x1cd))),console[_0x1a576f(0x144)](_0x1a576f(0x175)+formatCountSummary(_0x364bbf[_0x1a576f(0x198)][_0x1a576f(0x1b8)])),console['log'](_0x1a576f(0x17a)+formatCountSummary(_0x364bbf[_0x1a576f(0x198)][_0x1a576f(0x15d)])),console[_0x1a576f(0x144)](_0x1a576f(0x1b6)+formatCountSummary(_0x364bbf['counts'][_0x1a576f(0x1b5)])),console['log']('\x20\x20Prompts:\x20'+formatCountSummary(_0x364bbf[_0x1a576f(0x198)][_0x1a576f(0x156)])),console[_0x1a576f(0x144)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x364bbf[_0x1a576f(0x198)][_0x1a576f(0x13d)]));const _0x3f993e=_0x364bbf['counts'][_0x1a576f(0x15c)]['total']>0x0||_0x364bbf[_0x1a576f(0x198)][_0x1a576f(0x1c5)]['total']>0x0;_0x3f993e&&(console[_0x1a576f(0x144)](_0x1a576f(0x14b)+formatCountSummary(_0x364bbf[_0x1a576f(0x198)]['experimentalKnowledgeBases'])),console[_0x1a576f(0x144)](_0x1a576f(0x166)+formatCountSummary(_0x364bbf['counts'][_0x1a576f(0x1c5)])));console[_0x1a576f(0x144)](_0x1a576f(0x155)+a4_0x2d01e3[_0x1a576f(0x1c0)](_0x364bbf[_0x1a576f(0x1ce)])),displayDiffs(_0x364bbf[_0x1a576f(0x1b8)],_0x364bbf[_0x1a576f(0x15d)],_0x364bbf['textKnowledgeBases'],_0x364bbf[_0x1a576f(0x156)],_0x364bbf[_0x1a576f(0x13d)],_0x364bbf[_0x1a576f(0x15c)],_0x364bbf[_0x1a576f(0x1c5)]);if(_0x3d6d85)return console[_0x1a576f(0x144)](a4_0x2d01e3[_0x1a576f(0x1bd)](_0x1a576f(0x13a))),0x0;if(_0x280c29===0x0&&_0x26a36e===0x0)return console[_0x1a576f(0x144)](a4_0x2d01e3['green'](_0x1a576f(0x1c8))),saveSessionContext({'llm_project':_0x364bbf['projectName']},_0x47a8b2['session']),console[_0x1a576f(0x144)](a4_0x2d01e3[_0x1a576f(0x148)](_0x1a576f(0x190)+a4_0x2d01e3[_0x1a576f(0x188)](_0x1a576f(0x1b7))+_0x1a576f(0x1a5)+a4_0x2d01e3['cyan'](_0x364bbf[_0x1a576f(0x1a7)]))),0x0;if(!_0x1b92ba&&!_0x2ebf53){if(!isInteractive())return console['error'](a4_0x2d01e3['red'](_0x1a576f(0x1ae)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a4_0x2d01e3['dim'](_0x1a576f(0x1ac))),0x1;const _0x496f7c=await confirmKey(_0x1a576f(0x17b)+(_0x280c29+_0x26a36e)+_0x1a576f(0x137));if(!_0x496f7c)return console[_0x1a576f(0x144)](a4_0x2d01e3[_0x1a576f(0x1bd)](_0x1a576f(0x167)),_0x1a576f(0x12a)),0x1;}const {data:_0x2c728d}=await withSpinner(_0x1a576f(0x115),()=>_0x1c9466[_0x1a576f(0x11c)]['pullProject'](_0x39c6d7,_0x37f351,{'force':_0x2ebf53}));return console['log'](a4_0x2d01e3[_0x1a576f(0x148)]('\x0a✔\x20Pulled\x20'+(_0x280c29+_0x26a36e)+_0x1a576f(0x186)+_0x2c728d[_0x1a576f(0x1ce)])),saveSessionContext({'llm_project':_0x2c728d[_0x1a576f(0x1a7)]},_0x47a8b2['session']),console['log'](a4_0x2d01e3[_0x1a576f(0x148)]('✔\x20Context\x20set:\x20'+a4_0x2d01e3[_0x1a576f(0x188)](_0x1a576f(0x1b7))+_0x1a576f(0x1a5)+a4_0x2d01e3['cyan'](_0x2c728d['projectName']))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x35fc9a(0x12f)]=a4_0x35fc9a(0x133);['description']=a4_0x35fc9a(0x1d0);async[a4_0x35fc9a(0x19a)](_0x1b2f53){const _0x36b020=a4_0x35fc9a,{options:_0x40423d,args:_0x185d79,tdx:_0x480cbf}=_0x1b2f53,_0x4c4909=_0x185d79[0x0],_0x556539=_0x40423d[_0x36b020(0x12f)],_0x274108=_0x40423d[_0x36b020(0x15f)],_0xb328ad=_0x40423d[_0x36b020(0x176)],_0x100f03=_0x40423d[_0x36b020(0x18f)],_0x5bcb3c=_0x40423d[_0x36b020(0x128)];let _0x8de5f3;const _0x5645cc=findAgentConfigPath(process[_0x36b020(0x143)]());if(_0x4c4909){const _0x4f6a33=a4_0x3cc5ff[_0x36b020(0x122)](_0x4c4909,_0x36b020(0x17d));existsSync(_0x4f6a33)?(_0x8de5f3=_0x4c4909,console[_0x36b020(0x144)](a4_0x2d01e3[_0x36b020(0x188)](_0x36b020(0x140)+_0x4c4909))):_0x8de5f3=_0x4c4909;}else{if(_0x5645cc)_0x8de5f3=a4_0x3cc5ff[_0x36b020(0x118)](_0x5645cc),console[_0x36b020(0x144)](a4_0x2d01e3['dim'](_0x36b020(0x14e)+_0x8de5f3));else{if(_0x5bcb3c){const _0x41806c=sanitizeForFilesystem(_0x5bcb3c);let _0x51ea21=_0x41806c,_0x234dc4=a4_0x3cc5ff['join'](process[_0x36b020(0x143)](),'agents',_0x41806c,'tdx.json');if(!existsSync(_0x234dc4)){const _0x3c8695=normalizeName(_0x5bcb3c),_0x47eb72=a4_0x3cc5ff[_0x36b020(0x122)](process['cwd'](),_0x36b020(0x1b8),_0x3c8695,_0x36b020(0x17d));existsSync(_0x47eb72)&&(_0x51ea21=_0x3c8695,_0x234dc4=_0x47eb72);}if(existsSync(_0x234dc4))_0x8de5f3=a4_0x3cc5ff[_0x36b020(0x118)](_0x234dc4),console[_0x36b020(0x144)](a4_0x2d01e3[_0x36b020(0x188)](_0x36b020(0x140)+_0x8de5f3));else{const _0x53ff77=_0x40423d['profile'];if(_0x53ff77)throw new SDKError(ErrorCode[_0x36b020(0x173)],'Cannot\x20clone\x20from\x20context\x20project\x20\x22'+_0x5bcb3c+_0x36b020(0x177),undefined,{'helpText':_0x36b020(0x196)+_0x36b020(0x11e)+(_0x36b020(0x1af)+_0x5bcb3c+'\x0a')+(_0x36b020(0x125)+_0x51ea21+'\x20--name\x20'+(_0x556539||_0x36b020(0x1cb))+_0x36b020(0x15e)+_0x53ff77)});_0x8de5f3=_0x5bcb3c,console[_0x36b020(0x144)](a4_0x2d01e3[_0x36b020(0x188)](_0x36b020(0x1b3)+_0x5bcb3c));}}}}if(!_0x8de5f3)return console[_0x36b020(0x144)](a4_0x2d01e3[_0x36b020(0x1bd)](_0x36b020(0x1a4))),console[_0x36b020(0x144)]('\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project'),console[_0x36b020(0x144)](_0x36b020(0x184)),console['log']('\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[_0x36b020(0x144)]('\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>'),0x1;if(!_0x556539)throw new SDKError(ErrorCode[_0x36b020(0x1ad)],_0x36b020(0x139),undefined,{'helpText':_0x36b020(0x14c)});if(!_0xb328ad&&!_0x274108){if(!isInteractive())return console['error'](a4_0x2d01e3[_0x36b020(0x174)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x36b020(0x1ca)](a4_0x2d01e3[_0x36b020(0x188)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x66e76a=await confirmKey(_0x36b020(0x16f)+_0x8de5f3+'\x22\x20to\x20new\x20project\x20\x22'+_0x556539+'\x22?');if(!_0x66e76a)return console[_0x36b020(0x144)](a4_0x2d01e3[_0x36b020(0x1bd)](_0x36b020(0x167))),0x1;}const {data:_0x12f4c5}=await withSpinner(_0x36b020(0x14f)+_0x8de5f3+_0x36b020(0x187)+_0x556539+_0x36b020(0x1cc),()=>_0x480cbf[_0x36b020(0x11c)][_0x36b020(0x127)](_0x8de5f3,_0x556539,{'dryRun':_0x274108}));if(_0x274108){console['log'](a4_0x2d01e3[_0x36b020(0x1bd)](_0x36b020(0x119))),console[_0x36b020(0x144)](_0x36b020(0x182)+_0x12f4c5['sourceProjectName']),console[_0x36b020(0x144)](_0x36b020(0x146)+_0x556539),console['log'](_0x36b020(0x1a8)),console[_0x36b020(0x144)](_0x36b020(0x175)+_0x12f4c5[_0x36b020(0x198)][_0x36b020(0x1b8)][_0x36b020(0x114)]),console[_0x36b020(0x144)](_0x36b020(0x17a)+_0x12f4c5['counts']['knowledgeBases']['created']),console[_0x36b020(0x144)](_0x36b020(0x147)+_0x12f4c5['counts']['prompts'][_0x36b020(0x114)]);const _0x166862=_0x12f4c5[_0x36b020(0x198)]['experimentalKnowledgeBases'][_0x36b020(0x114)]>0x0||_0x12f4c5[_0x36b020(0x198)]['experimentalArtifacts'][_0x36b020(0x114)]>0x0;return _0x166862&&(console[_0x36b020(0x144)](_0x36b020(0x14b)+_0x12f4c5[_0x36b020(0x198)][_0x36b020(0x15c)][_0x36b020(0x114)]),console[_0x36b020(0x144)](_0x36b020(0x166)+_0x12f4c5[_0x36b020(0x198)][_0x36b020(0x1c5)][_0x36b020(0x114)])),0x0;}const _0x47ba06=_0x12f4c5[_0x36b020(0x198)][_0x36b020(0x1b8)][_0x36b020(0x1a1)]>0x0||_0x12f4c5[_0x36b020(0x198)][_0x36b020(0x15d)][_0x36b020(0x1a1)]>0x0||_0x12f4c5['counts']['prompts'][_0x36b020(0x1a1)]>0x0||_0x12f4c5[_0x36b020(0x198)][_0x36b020(0x15c)]['errors']>0x0||_0x12f4c5[_0x36b020(0x198)]['experimentalArtifacts'][_0x36b020(0x1a1)]>0x0;_0x47ba06?console[_0x36b020(0x144)](a4_0x2d01e3[_0x36b020(0x1bd)]('Project\x20cloned\x20with\x20errors')):console['log'](a4_0x2d01e3[_0x36b020(0x148)](_0x36b020(0x123)));console[_0x36b020(0x144)](_0x36b020(0x182)+_0x12f4c5[_0x36b020(0x13b)]),console[_0x36b020(0x144)]('New\x20project:\x20'+_0x12f4c5[_0x36b020(0x141)]),console[_0x36b020(0x144)](_0x36b020(0x1c3)+_0x12f4c5[_0x36b020(0x121)]),console['log'](),console[_0x36b020(0x144)](_0x36b020(0x1b9)),console[_0x36b020(0x144)](_0x36b020(0x175)+formatCountSummary(_0x12f4c5[_0x36b020(0x198)][_0x36b020(0x1b8)])),console['log'](_0x36b020(0x17a)+formatCountSummary(_0x12f4c5[_0x36b020(0x198)]['knowledgeBases'])),console[_0x36b020(0x144)](_0x36b020(0x147)+formatCountSummary(_0x12f4c5[_0x36b020(0x198)]['prompts'])),console[_0x36b020(0x144)](_0x36b020(0x1b1)+formatCountSummary(_0x12f4c5['counts'][_0x36b020(0x13d)]));const _0x382d5b=_0x12f4c5[_0x36b020(0x198)]['experimentalKnowledgeBases'][_0x36b020(0x114)]>0x0||_0x12f4c5[_0x36b020(0x198)][_0x36b020(0x15c)][_0x36b020(0x1c9)]>0x0||_0x12f4c5['counts'][_0x36b020(0x15c)][_0x36b020(0x11f)]>0x0||_0x12f4c5[_0x36b020(0x198)]['experimentalArtifacts'][_0x36b020(0x114)]>0x0||_0x12f4c5[_0x36b020(0x198)][_0x36b020(0x1c5)]['updated']>0x0||_0x12f4c5['counts']['experimentalArtifacts'][_0x36b020(0x11f)]>0x0;_0x382d5b&&(console['log'](_0x36b020(0x14b)+formatCountSummary(_0x12f4c5[_0x36b020(0x198)]['experimentalKnowledgeBases'])),console['log']('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x12f4c5[_0x36b020(0x198)][_0x36b020(0x1c5)])));if(_0x47ba06){console[_0x36b020(0x144)](),console['log'](a4_0x2d01e3[_0x36b020(0x174)]('Errors:'));for(const _0x1772b0 of _0x12f4c5['agents']){_0x1772b0[_0x36b020(0x158)]===_0x36b020(0x1ca)&&console['log'](a4_0x2d01e3[_0x36b020(0x174)]('\x20\x20Agent\x20\x22'+_0x1772b0[_0x36b020(0x11b)]+_0x36b020(0x191)+_0x1772b0[_0x36b020(0x1ca)]));}for(const _0x4c8f60 of _0x12f4c5[_0x36b020(0x15d)]){_0x4c8f60[_0x36b020(0x158)]===_0x36b020(0x1ca)&&console[_0x36b020(0x144)](a4_0x2d01e3[_0x36b020(0x174)](_0x36b020(0x117)+_0x4c8f60[_0x36b020(0x12f)]+_0x36b020(0x191)+_0x4c8f60[_0x36b020(0x1ca)]));}for(const _0x156934 of _0x12f4c5[_0x36b020(0x156)]){_0x156934[_0x36b020(0x158)]==='error'&&console[_0x36b020(0x144)](a4_0x2d01e3['red'](_0x36b020(0x16b)+_0x156934['name']+_0x36b020(0x191)+_0x156934[_0x36b020(0x1ca)]));}for(const _0x444c7d of _0x12f4c5[_0x36b020(0x13d)]){_0x444c7d[_0x36b020(0x158)]==='error'&&console['log'](a4_0x2d01e3[_0x36b020(0x174)](_0x36b020(0x1d1)+_0x444c7d['name']+_0x36b020(0x191)+_0x444c7d['error']));}for(const _0x39a8cf of _0x12f4c5['experimentalKnowledgeBases']){_0x39a8cf[_0x36b020(0x158)]===_0x36b020(0x1ca)&&console[_0x36b020(0x144)](a4_0x2d01e3[_0x36b020(0x174)]('\x20\x20Experimental\x20Knowledge\x20Base\x20\x22'+_0x39a8cf[_0x36b020(0x12f)]+_0x36b020(0x191)+_0x39a8cf[_0x36b020(0x1ca)]));}for(const _0x23b6dc of _0x12f4c5[_0x36b020(0x1c5)]){_0x23b6dc['action']===_0x36b020(0x1ca)&&console[_0x36b020(0x144)](a4_0x2d01e3['red'](_0x36b020(0x1a2)+_0x23b6dc[_0x36b020(0x12f)]+_0x36b020(0x191)+_0x23b6dc[_0x36b020(0x1ca)]));}return 0x1;}console[_0x36b020(0x144)]();const _0x274e26=getLLMProjectUrl(_0x100f03,_0x12f4c5[_0x36b020(0x121)]);return console['log'](_0x36b020(0x1cf)+a4_0x2d01e3[_0x36b020(0x1c0)](_0x274e26)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x35fc9a(0x12f)]=a4_0x35fc9a(0x12e);[a4_0x35fc9a(0x163)]=a4_0x35fc9a(0x11d);async[a4_0x35fc9a(0x19a)](_0x286df6){const _0x4d5ec8=a4_0x35fc9a,{options:_0x49fb33,args:_0x3cfddd,tdx:_0x2ab5c2}=_0x286df6;let _0x509b9a=_0x3cfddd[0x0]||process[_0x4d5ec8(0x143)]();const _0x5b239b=_0x49fb33[_0x4d5ec8(0x15f)],_0x1a5dff=_0x49fb33[_0x4d5ec8(0x12d)],_0x2856ac=_0x49fb33[_0x4d5ec8(0x176)],_0x1bef77=_0x49fb33['site'],_0x2d58f2=a4_0x3cc5ff[_0x4d5ec8(0x122)](_0x509b9a,_0x4d5ec8(0x192)),_0x365786=existsSync(_0x2d58f2);if(_0x365786){const {data:_0x2e7c6e}=await withSpinner(_0x4d5ec8(0x19b)+_0x509b9a+_0x4d5ec8(0x1cc),()=>_0x2ab5c2[_0x4d5ec8(0x11c)][_0x4d5ec8(0x17e)](_0x509b9a,{'dryRun':_0x5b239b,'force':_0x1a5dff}));if(_0x5b239b)return console[_0x4d5ec8(0x144)](a4_0x2d01e3[_0x4d5ec8(0x1bd)](_0x4d5ec8(0x119))),console[_0x4d5ec8(0x144)](_0x4d5ec8(0x194)+_0x2e7c6e['agentName']),0x0;if(_0x2e7c6e[_0x4d5ec8(0x158)]===_0x4d5ec8(0x1ca))return console['log'](a4_0x2d01e3[_0x4d5ec8(0x174)](_0x4d5ec8(0x183)+_0x2e7c6e[_0x4d5ec8(0x1ca)])),0x1;console[_0x4d5ec8(0x144)](a4_0x2d01e3[_0x4d5ec8(0x148)](_0x4d5ec8(0x149)+_0x2e7c6e[_0x4d5ec8(0x158)]+_0x4d5ec8(0x1c6))),console[_0x4d5ec8(0x144)](_0x4d5ec8(0x193)+_0x2e7c6e[_0x4d5ec8(0x11b)]);if(_0x2e7c6e['agentId']&&_0x2e7c6e[_0x4d5ec8(0x130)]){const _0x515ec5=getLLMAgentChatUrl(_0x1bef77,_0x2e7c6e[_0x4d5ec8(0x130)],_0x2e7c6e[_0x4d5ec8(0x1c1)]);console[_0x4d5ec8(0x144)](_0x4d5ec8(0x153)+a4_0x2d01e3[_0x4d5ec8(0x1c0)](_0x515ec5));}return 0x0;}const _0x5a7508=_0x49fb33[_0x4d5ec8(0x128)],_0x5d9ffb=resolveProjectFromContext(_0x509b9a,_0x5a7508);if(_0x5d9ffb['found'])_0x509b9a=_0x5d9ffb[_0x4d5ec8(0x16a)],_0x5d9ffb[_0x4d5ec8(0x1bc)]===_0x4d5ec8(0x164)&&console[_0x4d5ec8(0x144)](a4_0x2d01e3['dim']('Using\x20project:\x20'+_0x509b9a));else{let _0x34247b=_0x4d5ec8(0x179);_0x5d9ffb[_0x4d5ec8(0x19f)]===_0x4d5ec8(0x129)&&(_0x34247b=_0x5d9ffb[_0x4d5ec8(0x15b)]+_0x4d5ec8(0x15a)+_0x5d9ffb[_0x4d5ec8(0x128)]+'\x27\x20to\x20create\x20the\x20folder\x20structure.');throw new SDKError(ErrorCode[_0x4d5ec8(0x173)],_0x5d9ffb['reason']===_0x4d5ec8(0x1c7)?_0x5d9ffb[_0x4d5ec8(0x15b)]:'No\x20tdx.json\x20found\x20in\x20'+_0x509b9a,undefined,{'helpText':_0x34247b});}const {data:_0x114440}=await withSpinner(_0x4d5ec8(0x170),()=>_0x2ab5c2[_0x4d5ec8(0x11c)]['pushProject'](_0x509b9a,{'dryRun':!![]})),_0x121b7f=_0x114440[_0x4d5ec8(0x198)]['agents'][_0x4d5ec8(0x1a1)]>0x0;if(_0x121b7f){console[_0x4d5ec8(0x144)](a4_0x2d01e3[_0x4d5ec8(0x174)](_0x4d5ec8(0x142)));for(const _0x568502 of _0x114440[_0x4d5ec8(0x1b8)]){_0x568502[_0x4d5ec8(0x158)]==='error'&&console[_0x4d5ec8(0x144)](a4_0x2d01e3[_0x4d5ec8(0x174)]('\x20\x20Agent\x20\x22'+_0x568502[_0x4d5ec8(0x11b)]+'\x22:\x20'+_0x568502[_0x4d5ec8(0x1ca)]));}return 0x1;}const _0x132a2f=_0x114440[_0x4d5ec8(0x198)][_0x4d5ec8(0x1b8)][_0x4d5ec8(0x114)]+_0x114440[_0x4d5ec8(0x198)][_0x4d5ec8(0x15d)][_0x4d5ec8(0x114)]+_0x114440[_0x4d5ec8(0x198)][_0x4d5ec8(0x1b5)][_0x4d5ec8(0x114)]+_0x114440[_0x4d5ec8(0x198)]['prompts'][_0x4d5ec8(0x114)]+_0x114440[_0x4d5ec8(0x198)][_0x4d5ec8(0x13d)][_0x4d5ec8(0x114)]+_0x114440[_0x4d5ec8(0x198)][_0x4d5ec8(0x15c)][_0x4d5ec8(0x114)]+_0x114440[_0x4d5ec8(0x198)][_0x4d5ec8(0x1c5)][_0x4d5ec8(0x114)],_0x275384=_0x114440['counts'][_0x4d5ec8(0x1b8)][_0x4d5ec8(0x1c9)]+_0x114440[_0x4d5ec8(0x198)][_0x4d5ec8(0x15d)][_0x4d5ec8(0x1c9)]+_0x114440[_0x4d5ec8(0x198)]['textKnowledgeBases']['updated']+_0x114440[_0x4d5ec8(0x198)][_0x4d5ec8(0x156)]['updated']+_0x114440[_0x4d5ec8(0x198)][_0x4d5ec8(0x13d)][_0x4d5ec8(0x1c9)]+_0x114440[_0x4d5ec8(0x198)][_0x4d5ec8(0x15c)][_0x4d5ec8(0x1c9)]+_0x114440[_0x4d5ec8(0x198)][_0x4d5ec8(0x1c5)]['updated'],_0x4c4c47=_0x114440[_0x4d5ec8(0x198)][_0x4d5ec8(0x1b8)][_0x4d5ec8(0x11f)]+_0x114440['counts'][_0x4d5ec8(0x15d)][_0x4d5ec8(0x11f)]+_0x114440[_0x4d5ec8(0x198)][_0x4d5ec8(0x1b5)][_0x4d5ec8(0x11f)]+_0x114440['counts'][_0x4d5ec8(0x156)][_0x4d5ec8(0x11f)]+_0x114440['counts'][_0x4d5ec8(0x13d)][_0x4d5ec8(0x11f)]+_0x114440['counts']['experimentalKnowledgeBases'][_0x4d5ec8(0x11f)]+_0x114440[_0x4d5ec8(0x198)][_0x4d5ec8(0x1c5)][_0x4d5ec8(0x11f)];console[_0x4d5ec8(0x144)](_0x4d5ec8(0x134)+_0x114440[_0x4d5ec8(0x1a7)]+'\x27:'),console['log']('\x20\x20'+a4_0x2d01e3[_0x4d5ec8(0x148)]('+\x20'+_0x132a2f+_0x4d5ec8(0x135))+_0x4d5ec8(0x152)+a4_0x2d01e3[_0x4d5ec8(0x1bd)]('~\x20'+_0x275384+_0x4d5ec8(0x116))+'\x20|\x20'+a4_0x2d01e3[_0x4d5ec8(0x188)]('=\x20'+_0x4c4c47+_0x4d5ec8(0x1cd))),console[_0x4d5ec8(0x144)]('\x20\x20Agents:\x20'+formatCountSummary(_0x114440['counts']['agents'])),console[_0x4d5ec8(0x144)](_0x4d5ec8(0x17a)+formatCountSummary(_0x114440[_0x4d5ec8(0x198)][_0x4d5ec8(0x15d)])),console['log'](_0x4d5ec8(0x1b6)+formatCountSummary(_0x114440[_0x4d5ec8(0x198)][_0x4d5ec8(0x1b5)])),console[_0x4d5ec8(0x144)](_0x4d5ec8(0x147)+formatCountSummary(_0x114440[_0x4d5ec8(0x198)][_0x4d5ec8(0x156)])),console[_0x4d5ec8(0x144)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x114440['counts'][_0x4d5ec8(0x13d)]));const _0x362812=_0x114440[_0x4d5ec8(0x198)][_0x4d5ec8(0x15c)]['created']>0x0||_0x114440[_0x4d5ec8(0x198)][_0x4d5ec8(0x15c)]['updated']>0x0||_0x114440[_0x4d5ec8(0x198)][_0x4d5ec8(0x15c)]['unchanged']>0x0||_0x114440[_0x4d5ec8(0x198)]['experimentalArtifacts'][_0x4d5ec8(0x114)]>0x0||_0x114440[_0x4d5ec8(0x198)][_0x4d5ec8(0x1c5)][_0x4d5ec8(0x1c9)]>0x0||_0x114440[_0x4d5ec8(0x198)][_0x4d5ec8(0x1c5)][_0x4d5ec8(0x11f)]>0x0;_0x362812&&(console[_0x4d5ec8(0x144)](_0x4d5ec8(0x14b)+formatCountSummary(_0x114440[_0x4d5ec8(0x198)][_0x4d5ec8(0x15c)])),console[_0x4d5ec8(0x144)](_0x4d5ec8(0x166)+formatCountSummary(_0x114440[_0x4d5ec8(0x198)][_0x4d5ec8(0x1c5)])));console['log'](_0x4d5ec8(0x178)+a4_0x2d01e3[_0x4d5ec8(0x1c0)](_0x509b9a)),displayDiffs(_0x114440[_0x4d5ec8(0x1b8)],_0x114440[_0x4d5ec8(0x15d)],_0x114440[_0x4d5ec8(0x1b5)],_0x114440[_0x4d5ec8(0x156)],_0x114440[_0x4d5ec8(0x13d)],_0x114440[_0x4d5ec8(0x15c)],_0x114440[_0x4d5ec8(0x1c5)]);if(_0x5b239b)return console[_0x4d5ec8(0x144)](a4_0x2d01e3[_0x4d5ec8(0x1bd)](_0x4d5ec8(0x151))),0x0;if(_0x132a2f===0x0&&_0x275384===0x0){console['log'](a4_0x2d01e3[_0x4d5ec8(0x148)](_0x4d5ec8(0x1bb)));const _0x28f09b=getLLMProjectUrl(_0x1bef77,_0x114440[_0x4d5ec8(0x130)]);return console[_0x4d5ec8(0x144)](_0x4d5ec8(0x1cf)+a4_0x2d01e3[_0x4d5ec8(0x1c0)](_0x28f09b)),0x0;}if(!_0x2856ac&&!_0x1a5dff){if(!isInteractive())return console[_0x4d5ec8(0x1ca)](a4_0x2d01e3[_0x4d5ec8(0x174)](_0x4d5ec8(0x1ae)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x4d5ec8(0x1ca)](a4_0x2d01e3['dim'](_0x4d5ec8(0x1ac))),0x1;const _0xaa18be=await confirmKey(_0x4d5ec8(0x132)+(_0x132a2f+_0x275384)+_0x4d5ec8(0x126));if(!_0xaa18be)return console[_0x4d5ec8(0x144)](a4_0x2d01e3[_0x4d5ec8(0x1bd)](_0x4d5ec8(0x167)),_0x4d5ec8(0x11a)),0x1;}const {data:_0x3d1446}=await withSpinner(_0x4d5ec8(0x19c),()=>_0x2ab5c2[_0x4d5ec8(0x11c)][_0x4d5ec8(0x150)](_0x509b9a,{'force':_0x1a5dff})),_0x33a583=_0x3d1446[_0x4d5ec8(0x198)][_0x4d5ec8(0x1b8)][_0x4d5ec8(0x1a1)]>0x0||_0x3d1446['counts'][_0x4d5ec8(0x15d)][_0x4d5ec8(0x1a1)]>0x0||_0x3d1446['counts']['textKnowledgeBases'][_0x4d5ec8(0x1a1)]>0x0||_0x3d1446[_0x4d5ec8(0x198)][_0x4d5ec8(0x156)][_0x4d5ec8(0x1a1)]>0x0;if(_0x33a583){console[_0x4d5ec8(0x144)](a4_0x2d01e3[_0x4d5ec8(0x1bd)]('\x0aProject\x20pushed\x20with\x20errors')),console[_0x4d5ec8(0x144)](),console[_0x4d5ec8(0x144)](a4_0x2d01e3[_0x4d5ec8(0x174)](_0x4d5ec8(0x1a3)));for(const _0x1dfa7e of _0x3d1446[_0x4d5ec8(0x1b8)]){_0x1dfa7e[_0x4d5ec8(0x158)]===_0x4d5ec8(0x1ca)&&console[_0x4d5ec8(0x144)](a4_0x2d01e3[_0x4d5ec8(0x174)](_0x4d5ec8(0x131)+_0x1dfa7e['agentName']+_0x4d5ec8(0x191)+_0x1dfa7e[_0x4d5ec8(0x1ca)]));}for(const _0x56cf2d of _0x3d1446[_0x4d5ec8(0x15d)]){_0x56cf2d[_0x4d5ec8(0x158)]===_0x4d5ec8(0x1ca)&&console[_0x4d5ec8(0x144)](a4_0x2d01e3[_0x4d5ec8(0x174)](_0x4d5ec8(0x117)+_0x56cf2d['name']+_0x4d5ec8(0x191)+_0x56cf2d['error']));}for(const _0x378db4 of _0x3d1446[_0x4d5ec8(0x1b5)]){_0x378db4['action']===_0x4d5ec8(0x1ca)&&console[_0x4d5ec8(0x144)](a4_0x2d01e3[_0x4d5ec8(0x174)](_0x4d5ec8(0x1c4)+_0x378db4[_0x4d5ec8(0x12f)]+_0x4d5ec8(0x191)+_0x378db4[_0x4d5ec8(0x1ca)]));}for(const _0x49d927 of _0x3d1446[_0x4d5ec8(0x156)]){_0x49d927[_0x4d5ec8(0x158)]===_0x4d5ec8(0x1ca)&&console[_0x4d5ec8(0x144)](a4_0x2d01e3[_0x4d5ec8(0x174)](_0x4d5ec8(0x16b)+_0x49d927[_0x4d5ec8(0x12f)]+_0x4d5ec8(0x191)+_0x49d927[_0x4d5ec8(0x1ca)]));}for(const _0x29b53c of _0x3d1446[_0x4d5ec8(0x13d)]){_0x29b53c[_0x4d5ec8(0x158)]===_0x4d5ec8(0x1ca)&&console[_0x4d5ec8(0x144)](a4_0x2d01e3['red'](_0x4d5ec8(0x1d1)+_0x29b53c[_0x4d5ec8(0x12f)]+_0x4d5ec8(0x191)+_0x29b53c[_0x4d5ec8(0x1ca)]));}return 0x1;}console[_0x4d5ec8(0x144)](a4_0x2d01e3[_0x4d5ec8(0x148)](_0x4d5ec8(0x154)+(_0x132a2f+_0x275384)+_0x4d5ec8(0x169)+_0x3d1446[_0x4d5ec8(0x1a7)]+'\x27'));const _0x4774ff=getLLMProjectUrl(_0x1bef77,_0x3d1446[_0x4d5ec8(0x130)]);return console['log']('Project:\x20'+a4_0x2d01e3['cyan'](_0x4774ff)),0x0;}}
1
+ const a4_0x48458a=a4_0x2f87;(function(_0x36d512,_0xc73dff){const _0x50c249=a4_0x2f87,_0x597b0a=_0x36d512();while(!![]){try{const _0x14343d=-parseInt(_0x50c249(0xd2))/0x1*(-parseInt(_0x50c249(0x13c))/0x2)+-parseInt(_0x50c249(0x12f))/0x3+parseInt(_0x50c249(0x173))/0x4+parseInt(_0x50c249(0x134))/0x5*(-parseInt(_0x50c249(0xef))/0x6)+parseInt(_0x50c249(0xd0))/0x7+-parseInt(_0x50c249(0x158))/0x8*(parseInt(_0x50c249(0x179))/0x9)+parseInt(_0x50c249(0xe3))/0xa*(-parseInt(_0x50c249(0xcd))/0xb);if(_0x14343d===_0xc73dff)break;else _0x597b0a['push'](_0x597b0a['shift']());}catch(_0x3e3d57){_0x597b0a['push'](_0x597b0a['shift']());}}}(a4_0x2fb7,0x9c09c));function a4_0x2f87(_0x5d5057,_0x1a360f){_0x5d5057=_0x5d5057-0xc9;const _0x2fb7cc=a4_0x2fb7();let _0x2f87e6=_0x2fb7cc[_0x5d5057];return _0x2f87e6;}import a4_0x19c80c from'chalk';import a4_0x155d79 from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext,resolveAgentPullArgs}from'../sdk/agent/agent-config.js';function a4_0x2fb7(){const _0x1e9774=['yes','Pulling\x20agent\x20\x22','\x20|\x20','Dry\x20run\x20-\x20no\x20files\x20written','Project\x20cloned\x20with\x20errors','agent:clone','Cannot\x20clone\x20from\x20context\x20project\x20\x22','Agent:\x20','2248636AZAEKg','repeat','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','force','\x20total','1098JEZgIN','Would\x20pull\x20agent:\x20','sourceProjectName','\x20\x20Experimental\x20Artifact\x20\x22','cwd-config','no_local_folder','new','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','pushProject','\x20\x20Text\x20Knowledge\x20Bases:\x20','\x0aPush\x20','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','MISSING_ARGUMENT','projectDir','44GXBLXE','output','projectName','8071679CVokBW','\x20files?','6XRikfy','experimentalArtifacts','\x0aPull\x20summary\x20for\x20\x27','agent.yml','Agent\x20pulled\x20successfully','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','green','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','experimentalKnowledgeBases','\x0aPush\x20summary\x20for\x20\x27','\x20\x20Prompts:\x20','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','isNew','no_context','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','\x20\x20Experimental\x20Artifacts:\x20','\x20\x20tdx\x20agent\x20clone\x20agents/','936560dgGkTm','yellow','outputPath','Would\x20clone:','\x20resources\x20to\x20\x27','agentId','Pushing\x20to\x20project...','\x20=\x20','session','\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','errors','\x0a✔\x20Pushed\x20','1077630CvKSYL','unchanged','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','Output:\x20','dim','found','agent','agents','Summary:','Using\x20project:\x20','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','reason','Chat:\x20','utf-8','Project:\x20','llm_project','Failed\x20to\x20push\x20agent:\x20','cyan','log','\x0aChanges\x20to\x20agent\x20\x27','\x20\x20Text\x20Knowledge\x20Base\x20\x22','newProjectName','action','\x20--profile\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','llm','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','Using\x20local\x20project:\x20','\x20\x20Agent\x20\x22','cloneProject','Dry\x20run\x20-\x20no\x20changes\x20made','\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','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','\x20files\x20to\x20','New\x20project:\x20','\x20\x20Source:\x20','\x20\x20Integration\x20\x22','red','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','Errors:','-\x20no\x20files\x20written','Using\x20project\x20from\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project','Agent\x20','pushAgent','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','outputDir','\x20--name\x20','\x20resources?','projectId','Cloning\x20\x22','\x22...','Clone\x20\x22','\x27\x20to\x20create\x20the\x20folder\x20structure.','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','New\x20project\x20name\x20is\x20required','context','knowledgeBases','pullAgent','Source:\x20','push','created','463188bTmjoP','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','\x20new','agentName','\x22\x20to\x20\x22','10JtthSU','\x20errors','Output\x20path:\x20','updated','name','newProjectId','\x22\x20from\x20project\x20\x22','\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)','356276OEVsCv','\x20\x20Knowledge\x20Bases:\x20','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','textKnowledgeBases','counts','\x0aProject\x20pushed\x20with\x20errors','-\x20nothing\x20pushed','Would\x20push\x20agent:\x20','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','pullProject','hasChanges','description','Pushing\x20agent\x20from\x20\x22','Using\x20current\x20project:\x20','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','\x20\x20tdx\x20agent\x20pull\x20','\x22:\x20','parse','total','\x20created','INVALID_ARGUMENT','Using\x20project\x20from\x20context:\x20','Cancelled','diff','Analyzing\x20project\x20\x22','error','prompts','\x20\x20Agents:\x20','82408BvIMXD','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','execute','tdx.json','integrations','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20changed','join','Analyzing\x20changes\x20to\x20push...','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','\x20\x20Integrations:\x20','agent:pull','\x0aError:','dryRun','dirname','profile','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','cwd','\x20\x20Prompt\x20\x22'];a4_0x2fb7=function(){return _0x1e9774;};return a4_0x2fb7();}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(_0x55d249){const _0x11b033=a4_0x2f87,_0x146373=[];if(_0x55d249[_0x11b033(0x14e)]!==undefined)_0x146373['push'](_0x55d249[_0x11b033(0x14e)]+_0x11b033(0x178));if(_0x55d249[_0x11b033(0x17f)]!==undefined&&_0x55d249[_0x11b033(0x17f)]>0x0)_0x146373[_0x11b033(0x12d)](a4_0x19c80c[_0x11b033(0xd8)](_0x55d249[_0x11b033(0x17f)]+'\x20new'));if(_0x55d249[_0x11b033(0x12e)]!==undefined&&_0x55d249[_0x11b033(0x12e)]>0x0)_0x146373[_0x11b033(0x12d)](a4_0x19c80c[_0x11b033(0xd8)](_0x55d249[_0x11b033(0x12e)]+_0x11b033(0x14f)));if(_0x55d249['updated']!==undefined&&_0x55d249[_0x11b033(0x137)]>0x0)_0x146373[_0x11b033(0x12d)](a4_0x19c80c['yellow'](_0x55d249[_0x11b033(0x137)]+_0x11b033(0x107)));if(_0x55d249[_0x11b033(0xf0)]!==undefined&&_0x55d249[_0x11b033(0xf0)]>0x0)_0x146373['push'](a4_0x19c80c['gray'](_0x55d249['unchanged']+'\x20unchanged'));if(_0x55d249['errors']!==undefined&&_0x55d249[_0x11b033(0xed)]>0x0)_0x146373[_0x11b033(0x12d)](a4_0x19c80c[_0x11b033(0x116)](_0x55d249['errors']+_0x11b033(0x135)));return _0x146373[_0x11b033(0x15f)](',\x20');}function displayDiffs(_0x6271c0,_0x1dba97,_0x3fe093,_0x2f8c2d,_0x4f45c0,_0x357ac6,_0x1bf95e){const _0x273d8d=a4_0x2f87;for(const _0x3f63a1 of _0x6271c0){if(_0x3f63a1[_0x273d8d(0x153)]){const _0x3ce3bb=_0x3f63a1[_0x273d8d(0x132)]||_0x3f63a1[_0x273d8d(0x138)];console['log'](_0x273d8d(0x102)+_0x3ce3bb+'\x27:'),console[_0x273d8d(0x101)]('─'[_0x273d8d(0x174)](0x3c)),console[_0x273d8d(0x101)](_0x3f63a1['diff']),console[_0x273d8d(0x101)]('─'['repeat'](0x3c));}}for(const _0x499ca2 of _0x1dba97){_0x499ca2[_0x273d8d(0x153)]&&(console['log'](_0x273d8d(0xca)+_0x499ca2[_0x273d8d(0x138)]+'\x27:'),console[_0x273d8d(0x101)]('─'[_0x273d8d(0x174)](0x3c)),console['log'](_0x499ca2['diff']),console[_0x273d8d(0x101)]('─'['repeat'](0x3c)));}for(const _0x2e9d4a of _0x3fe093){_0x2e9d4a[_0x273d8d(0x153)]&&(console[_0x273d8d(0x101)](_0x273d8d(0x111)+_0x2e9d4a[_0x273d8d(0x138)]+'\x27:'),console[_0x273d8d(0x101)]('─'[_0x273d8d(0x174)](0x3c)),console[_0x273d8d(0x101)](_0x2e9d4a[_0x273d8d(0x153)]),console[_0x273d8d(0x101)]('─'[_0x273d8d(0x174)](0x3c)));}for(const _0x5e1495 of _0x2f8c2d){_0x5e1495[_0x273d8d(0x153)]&&(console[_0x273d8d(0x101)]('\x0aChanges\x20to\x20prompt\x20\x27'+_0x5e1495['name']+'\x27:'),console[_0x273d8d(0x101)]('─'[_0x273d8d(0x174)](0x3c)),console['log'](_0x5e1495[_0x273d8d(0x153)]),console['log']('─'[_0x273d8d(0x174)](0x3c)));}for(const _0x6b9ae1 of _0x4f45c0){_0x6b9ae1[_0x273d8d(0x153)]&&(console[_0x273d8d(0x101)]('\x0aChanges\x20to\x20integration\x20\x27'+_0x6b9ae1[_0x273d8d(0x138)]+'\x27:'),console['log']('─'[_0x273d8d(0x174)](0x3c)),console[_0x273d8d(0x101)](_0x6b9ae1[_0x273d8d(0x153)]),console[_0x273d8d(0x101)]('─'['repeat'](0x3c)));}for(const _0x42adab of _0x357ac6){_0x42adab[_0x273d8d(0x153)]&&(console[_0x273d8d(0x101)](_0x273d8d(0x13e)+_0x42adab[_0x273d8d(0x138)]+'\x27:'),console['log']('─'['repeat'](0x3c)),console[_0x273d8d(0x101)](_0x42adab[_0x273d8d(0x153)]),console[_0x273d8d(0x101)]('─'[_0x273d8d(0x174)](0x3c)));}for(const _0x3bc09b of _0x1bf95e){_0x3bc09b['diff']&&(console[_0x273d8d(0x101)](_0x273d8d(0x175)+_0x3bc09b[_0x273d8d(0x138)]+'\x27:'),console['log']('─'[_0x273d8d(0x174)](0x3c)),console['log'](_0x3bc09b['diff']),console[_0x273d8d(0x101)]('─'[_0x273d8d(0x174)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x48458a(0x138)]=a4_0x48458a(0x163);['description']=a4_0x48458a(0x130);async['execute'](_0x5b442a){const _0x115e0d=a4_0x48458a,{options:_0x58135a,args:_0x4e37de,tdx:_0x1ee97c}=_0x5b442a,_0x1c47c5=_0x4e37de[0x0],_0x219b74=_0x4e37de[0x1],_0x3b311f=_0x58135a[_0x115e0d(0xce)],_0x208593=_0x58135a['dryRun'],_0x53a468=_0x58135a['force'],_0x280738=_0x58135a[_0x115e0d(0x16b)],_0x46d683=_0x58135a['llmProject'],_0x3e458f=_0x58135a[_0x115e0d(0xf5)];let _0x20ae02;if(_0x1c47c5){const _0x1e2815=a4_0x155d79[_0x115e0d(0x15f)](_0x1c47c5,_0x115e0d(0x15b));if(existsSync(_0x1e2815))try{const _0x42e8e6=JSON[_0x115e0d(0x14d)](readFileSync(_0x1e2815,_0x115e0d(0xfc)));_0x42e8e6[_0x115e0d(0xfe)]&&(_0x20ae02={'llm_project':_0x42e8e6['llm_project']});}catch{}}const _0x520a63=findAgentConfigPath(process[_0x115e0d(0x169)]());let _0xb60dc5;if(_0x520a63)try{const _0x3bd402=JSON['parse'](readFileSync(_0x520a63,_0x115e0d(0xfc)));_0x3bd402[_0x115e0d(0xfe)]&&(_0xb60dc5={'llm_project':_0x3bd402[_0x115e0d(0xfe)]});}catch{}const _0x3e0598=resolveAgentPullArgs({'arg':_0x1c47c5,'agentNameArg':_0x219b74,'agentFlag':_0x3e458f,'contextProject':_0x46d683,'argDirConfig':_0x20ae02,'cwdConfigPath':_0x520a63||undefined,'cwdConfig':_0xb60dc5}),{projectNameOrId:_0x42f41a,targetAgentName:_0x266362,existingOutputDir:_0x284fad,source:_0xa569a2}=_0x3e0598;if(_0xa569a2==='arg-dir')console[_0x115e0d(0x101)](a4_0x19c80c[_0x115e0d(0xf3)](_0x115e0d(0x11a)+a4_0x155d79['join'](_0x1c47c5,_0x115e0d(0x15b))+':\x20'+_0x42f41a));else{if(_0xa569a2===_0x115e0d(0x17d))console[_0x115e0d(0x101)](a4_0x19c80c[_0x115e0d(0xf3)](_0x115e0d(0xf8)+_0x42f41a));else _0xa569a2===_0x115e0d(0x129)&&console[_0x115e0d(0x101)](a4_0x19c80c['dim'](_0x115e0d(0x151)+_0x42f41a));}if(!_0x42f41a)return _0x3e458f?(console['log'](a4_0x19c80c[_0x115e0d(0xe4)](_0x115e0d(0xdd))),console[_0x115e0d(0x101)](_0x115e0d(0xf9)),console[_0x115e0d(0x101)](_0x115e0d(0x144))):(console[_0x115e0d(0x101)](a4_0x19c80c[_0x115e0d(0xe4)]('llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a')),console[_0x115e0d(0x101)]('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[_0x115e0d(0x101)](_0x115e0d(0x11b)),console[_0x115e0d(0x101)](_0x115e0d(0x108)),console[_0x115e0d(0x101)](_0x115e0d(0x10f)),console[_0x115e0d(0x101)](_0x115e0d(0xec))),0x1;if(_0x266362){const {data:_0x1e77f0}=await withSpinner(_0x115e0d(0x16c)+_0x266362+_0x115e0d(0x13a)+_0x42f41a+'\x22...',()=>_0x1ee97c[_0x115e0d(0x109)][_0x115e0d(0x12b)](_0x42f41a,_0x266362,_0x3b311f,{'dryRun':_0x208593,'force':_0x53a468}));if(_0x208593)return console['log'](a4_0x19c80c['yellow'](_0x115e0d(0x16e))),console[_0x115e0d(0x101)](_0x115e0d(0x17a)+_0x1e77f0[_0x115e0d(0x132)]),console['log'](_0x115e0d(0x136)+_0x1e77f0[_0x115e0d(0xe5)]),_0x1e77f0[_0x115e0d(0x153)]&&(console['log']('\x0aChanges:'),console[_0x115e0d(0x101)]('─'[_0x115e0d(0x174)](0x3c)),console[_0x115e0d(0x101)](_0x1e77f0['diff']),console[_0x115e0d(0x101)]('─'['repeat'](0x3c))),0x0;return console[_0x115e0d(0x101)](a4_0x19c80c[_0x115e0d(0xd8)](_0x115e0d(0xd6))),console[_0x115e0d(0x101)](_0x115e0d(0x172)+_0x1e77f0[_0x115e0d(0x132)]),console['log'](_0x115e0d(0xf2)+_0x1e77f0['outputPath']),console[_0x115e0d(0x101)]('Status:\x20'+(_0x1e77f0[_0x115e0d(0xde)]?a4_0x19c80c[_0x115e0d(0xd8)](_0x115e0d(0x17f)):_0x1e77f0[_0x115e0d(0x146)]?a4_0x19c80c[_0x115e0d(0xe4)](_0x115e0d(0x137)):a4_0x19c80c['gray'](_0x115e0d(0xf0)))),0x0;}const _0x2a3cdf=_0x284fad||_0x3b311f,{data:_0x1bef86}=await withSpinner(_0x115e0d(0x154)+_0x42f41a+_0x115e0d(0x124),()=>_0x1ee97c[_0x115e0d(0x109)][_0x115e0d(0x145)](_0x42f41a,_0x2a3cdf,{'dryRun':!![]})),_0x36ed24=_0x1bef86[_0x115e0d(0x140)][_0x115e0d(0xf6)][_0x115e0d(0x17f)]+_0x1bef86[_0x115e0d(0x140)][_0x115e0d(0x12a)][_0x115e0d(0x17f)]+_0x1bef86[_0x115e0d(0x140)]['textKnowledgeBases']['new']+_0x1bef86['counts'][_0x115e0d(0x156)]['new']+_0x1bef86[_0x115e0d(0x140)][_0x115e0d(0x15c)][_0x115e0d(0x17f)]+_0x1bef86[_0x115e0d(0x140)]['experimentalKnowledgeBases'][_0x115e0d(0x17f)]+_0x1bef86[_0x115e0d(0x140)]['experimentalArtifacts'][_0x115e0d(0x17f)],_0x121ac6=_0x1bef86[_0x115e0d(0x140)][_0x115e0d(0xf6)]['updated']+_0x1bef86[_0x115e0d(0x140)][_0x115e0d(0x12a)]['updated']+_0x1bef86['counts'][_0x115e0d(0x13f)][_0x115e0d(0x137)]+_0x1bef86[_0x115e0d(0x140)][_0x115e0d(0x156)][_0x115e0d(0x137)]+_0x1bef86[_0x115e0d(0x140)][_0x115e0d(0x15c)][_0x115e0d(0x137)]+_0x1bef86[_0x115e0d(0x140)][_0x115e0d(0xda)][_0x115e0d(0x137)]+_0x1bef86['counts'][_0x115e0d(0xd3)][_0x115e0d(0x137)],_0x2341ff=_0x1bef86[_0x115e0d(0x140)]['agents']['unchanged']+_0x1bef86[_0x115e0d(0x140)][_0x115e0d(0x12a)][_0x115e0d(0xf0)]+_0x1bef86[_0x115e0d(0x140)]['textKnowledgeBases'][_0x115e0d(0xf0)]+_0x1bef86[_0x115e0d(0x140)][_0x115e0d(0x156)]['unchanged']+_0x1bef86[_0x115e0d(0x140)][_0x115e0d(0x15c)][_0x115e0d(0xf0)]+_0x1bef86[_0x115e0d(0x140)][_0x115e0d(0xda)]['unchanged']+_0x1bef86[_0x115e0d(0x140)][_0x115e0d(0xd3)][_0x115e0d(0xf0)];console['log'](_0x115e0d(0xd4)+_0x1bef86[_0x115e0d(0xcf)]+'\x27:'),console[_0x115e0d(0x101)]('\x20\x20'+a4_0x19c80c[_0x115e0d(0xd8)]('+\x20'+_0x36ed24+'\x20new')+_0x115e0d(0x16d)+a4_0x19c80c['yellow']('~\x20'+_0x121ac6+'\x20changed')+_0x115e0d(0x16d)+a4_0x19c80c[_0x115e0d(0xf3)]('=\x20'+_0x2341ff+'\x20unchanged')),console[_0x115e0d(0x101)]('\x20\x20Agents:\x20'+formatCountSummary(_0x1bef86[_0x115e0d(0x140)][_0x115e0d(0xf6)])),console[_0x115e0d(0x101)](_0x115e0d(0x13d)+formatCountSummary(_0x1bef86[_0x115e0d(0x140)][_0x115e0d(0x12a)])),console[_0x115e0d(0x101)](_0x115e0d(0x182)+formatCountSummary(_0x1bef86[_0x115e0d(0x140)][_0x115e0d(0x13f)])),console[_0x115e0d(0x101)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x1bef86['counts'][_0x115e0d(0x156)])),console[_0x115e0d(0x101)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x1bef86[_0x115e0d(0x140)][_0x115e0d(0x15c)]));const _0x273c35=_0x1bef86[_0x115e0d(0x140)][_0x115e0d(0xda)][_0x115e0d(0x14e)]>0x0||_0x1bef86[_0x115e0d(0x140)][_0x115e0d(0xd3)][_0x115e0d(0x14e)]>0x0;_0x273c35&&(console[_0x115e0d(0x101)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x1bef86[_0x115e0d(0x140)][_0x115e0d(0xda)])),console[_0x115e0d(0x101)](_0x115e0d(0xe1)+formatCountSummary(_0x1bef86[_0x115e0d(0x140)][_0x115e0d(0xd3)])));console['log']('\x20\x20Target:\x20'+a4_0x19c80c['cyan'](_0x1bef86[_0x115e0d(0x11f)])),displayDiffs(_0x1bef86[_0x115e0d(0xf6)],_0x1bef86[_0x115e0d(0x12a)],_0x1bef86['textKnowledgeBases'],_0x1bef86[_0x115e0d(0x156)],_0x1bef86[_0x115e0d(0x15c)],_0x1bef86['experimentalKnowledgeBases'],_0x1bef86[_0x115e0d(0xd3)]);if(_0x208593)return console[_0x115e0d(0x101)](a4_0x19c80c[_0x115e0d(0xe4)](_0x115e0d(0x168))),0x0;if(_0x36ed24===0x0&&_0x121ac6===0x0)return console['log'](a4_0x19c80c['green'](_0x115e0d(0xf1))),saveSessionContext({'llm_project':_0x1bef86[_0x115e0d(0xcf)]},_0x58135a[_0x115e0d(0xeb)]),console['log'](a4_0x19c80c[_0x115e0d(0xd8)]('✔\x20Context\x20set:\x20'+a4_0x19c80c[_0x115e0d(0xf3)](_0x115e0d(0xfe))+_0x115e0d(0xea)+a4_0x19c80c[_0x115e0d(0x100)](_0x1bef86[_0x115e0d(0xcf)]))),0x0;if(!_0x280738&&!_0x53a468){if(!isInteractive())return console[_0x115e0d(0x155)](a4_0x19c80c['red'](_0x115e0d(0x164)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x115e0d(0x155)](a4_0x19c80c[_0x115e0d(0xf3)](_0x115e0d(0x180))),0x1;const _0x56a5cd=await confirmKey('\x0aWrite\x20'+(_0x36ed24+_0x121ac6)+_0x115e0d(0xd1));if(!_0x56a5cd)return console['log'](a4_0x19c80c[_0x115e0d(0xe4)](_0x115e0d(0x152)),_0x115e0d(0x119)),0x1;}const {data:_0xad92c2}=await withSpinner('Writing\x20files...',()=>_0x1ee97c[_0x115e0d(0x109)]['pullProject'](_0x42f41a,_0x2a3cdf,{'force':_0x53a468}));return console[_0x115e0d(0x101)](a4_0x19c80c[_0x115e0d(0xd8)]('\x0a✔\x20Pulled\x20'+(_0x36ed24+_0x121ac6)+_0x115e0d(0x112)+_0xad92c2['outputDir'])),saveSessionContext({'llm_project':_0xad92c2['projectName']},_0x58135a[_0x115e0d(0xeb)]),console[_0x115e0d(0x101)](a4_0x19c80c[_0x115e0d(0xd8)]('✔\x20Context\x20set:\x20'+a4_0x19c80c['dim'](_0x115e0d(0xfe))+_0x115e0d(0xea)+a4_0x19c80c[_0x115e0d(0x100)](_0xad92c2[_0x115e0d(0xcf)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{['name']=a4_0x48458a(0x170);[a4_0x48458a(0x147)]=a4_0x48458a(0x10a);async['execute'](_0x37052d){const _0x1224df=a4_0x48458a,{options:_0x1092b3,args:_0x316597,tdx:_0x14683a}=_0x37052d,_0x5f15e2=_0x316597[0x0],_0x160faf=_0x1092b3[_0x1224df(0x138)],_0x3456ff=_0x1092b3['dryRun'],_0x58d323=_0x1092b3[_0x1224df(0x16b)],_0x22074a=_0x1092b3['site'],_0x1e0e3b=_0x1092b3['llmProject'];let _0x424527;const _0x1f51ce=findAgentConfigPath(process[_0x1224df(0x169)]());if(_0x5f15e2){const _0x3924a7=a4_0x155d79[_0x1224df(0x15f)](_0x5f15e2,_0x1224df(0x15b));existsSync(_0x3924a7)?(_0x424527=_0x5f15e2,console[_0x1224df(0x101)](a4_0x19c80c[_0x1224df(0xf3)]('Using\x20local\x20project:\x20'+_0x5f15e2))):_0x424527=_0x5f15e2;}else{if(_0x1f51ce)_0x424527=a4_0x155d79[_0x1224df(0x166)](_0x1f51ce),console[_0x1224df(0x101)](a4_0x19c80c['dim'](_0x1224df(0x149)+_0x424527));else{if(_0x1e0e3b){const _0x1a07a8=sanitizeForFilesystem(_0x1e0e3b);let _0x494761=_0x1a07a8,_0x4a3e69=a4_0x155d79['join'](process[_0x1224df(0x169)](),_0x1224df(0xf6),_0x1a07a8,_0x1224df(0x15b));if(!existsSync(_0x4a3e69)){const _0x5b4f2c=normalizeName(_0x1e0e3b),_0x2803d5=a4_0x155d79[_0x1224df(0x15f)](process[_0x1224df(0x169)](),'agents',_0x5b4f2c,_0x1224df(0x15b));existsSync(_0x2803d5)&&(_0x494761=_0x5b4f2c,_0x4a3e69=_0x2803d5);}if(existsSync(_0x4a3e69))_0x424527=a4_0x155d79[_0x1224df(0x166)](_0x4a3e69),console[_0x1224df(0x101)](a4_0x19c80c[_0x1224df(0xf3)](_0x1224df(0x10b)+_0x424527));else{const _0x219707=_0x1092b3[_0x1224df(0x167)];if(_0x219707)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x1224df(0x171)+_0x1e0e3b+'\x22\x20to\x20a\x20different\x20profile',undefined,{'helpText':_0x1224df(0x11e)+'First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a'+(_0x1224df(0x14b)+_0x1e0e3b+'\x0a')+(_0x1224df(0xe2)+_0x494761+_0x1224df(0x120)+(_0x160faf||'<new-name>')+_0x1224df(0x106)+_0x219707)});_0x424527=_0x1e0e3b,console[_0x1224df(0x101)](a4_0x19c80c[_0x1224df(0xf3)]('Using\x20context\x20project:\x20'+_0x1e0e3b));}}}}if(!_0x424527)return console[_0x1224df(0x101)](a4_0x19c80c[_0x1224df(0xe4)](_0x1224df(0x159))),console['log'](_0x1224df(0xc9)),console[_0x1224df(0x101)](_0x1224df(0x110)),console[_0x1224df(0x101)](_0x1224df(0x13b)),console[_0x1224df(0x101)]('\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>'),0x1;if(!_0x160faf)throw new SDKError(ErrorCode[_0x1224df(0xcb)],_0x1224df(0x128),undefined,{'helpText':_0x1224df(0xd7)});if(!_0x58d323&&!_0x3456ff){if(!isInteractive())return console[_0x1224df(0x155)](a4_0x19c80c[_0x1224df(0x116)](_0x1224df(0x164)),_0x1224df(0x15d)),console['error'](a4_0x19c80c['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x2d1e37=await confirmKey(_0x1224df(0x125)+_0x424527+'\x22\x20to\x20new\x20project\x20\x22'+_0x160faf+'\x22?');if(!_0x2d1e37)return console[_0x1224df(0x101)](a4_0x19c80c[_0x1224df(0xe4)](_0x1224df(0x152))),0x1;}const {data:_0x559be6}=await withSpinner(_0x1224df(0x123)+_0x424527+_0x1224df(0x133)+_0x160faf+'\x22...',()=>_0x14683a[_0x1224df(0x109)][_0x1224df(0x10d)](_0x424527,_0x160faf,{'dryRun':_0x3456ff}));if(_0x3456ff){console['log'](a4_0x19c80c[_0x1224df(0xe4)](_0x1224df(0x10e))),console[_0x1224df(0x101)](_0x1224df(0x12c)+_0x559be6['sourceProjectName']),console[_0x1224df(0x101)](_0x1224df(0x113)+_0x160faf),console[_0x1224df(0x101)](_0x1224df(0xe6)),console[_0x1224df(0x101)](_0x1224df(0x157)+_0x559be6[_0x1224df(0x140)][_0x1224df(0xf6)][_0x1224df(0x12e)]),console[_0x1224df(0x101)](_0x1224df(0x13d)+_0x559be6['counts'][_0x1224df(0x12a)][_0x1224df(0x12e)]),console[_0x1224df(0x101)](_0x1224df(0xdc)+_0x559be6['counts'][_0x1224df(0x156)][_0x1224df(0x12e)]);const _0x1fc462=_0x559be6[_0x1224df(0x140)][_0x1224df(0xda)][_0x1224df(0x12e)]>0x0||_0x559be6[_0x1224df(0x140)][_0x1224df(0xd3)][_0x1224df(0x12e)]>0x0;return _0x1fc462&&(console[_0x1224df(0x101)](_0x1224df(0x117)+_0x559be6[_0x1224df(0x140)][_0x1224df(0xda)][_0x1224df(0x12e)]),console[_0x1224df(0x101)](_0x1224df(0xe1)+_0x559be6[_0x1224df(0x140)][_0x1224df(0xd3)][_0x1224df(0x12e)])),0x0;}const _0x3e7bac=_0x559be6[_0x1224df(0x140)][_0x1224df(0xf6)][_0x1224df(0xed)]>0x0||_0x559be6['counts'][_0x1224df(0x12a)]['errors']>0x0||_0x559be6[_0x1224df(0x140)][_0x1224df(0x156)][_0x1224df(0xed)]>0x0||_0x559be6[_0x1224df(0x140)][_0x1224df(0xda)][_0x1224df(0xed)]>0x0||_0x559be6[_0x1224df(0x140)][_0x1224df(0xd3)][_0x1224df(0xed)]>0x0;_0x3e7bac?console[_0x1224df(0x101)](a4_0x19c80c[_0x1224df(0xe4)](_0x1224df(0x16f))):console[_0x1224df(0x101)](a4_0x19c80c[_0x1224df(0xd8)]('Project\x20cloned\x20successfully'));console[_0x1224df(0x101)](_0x1224df(0x12c)+_0x559be6[_0x1224df(0x17b)]),console[_0x1224df(0x101)](_0x1224df(0x113)+_0x559be6[_0x1224df(0x104)]),console['log']('New\x20project\x20ID:\x20'+_0x559be6[_0x1224df(0x139)]),console[_0x1224df(0x101)](),console[_0x1224df(0x101)](_0x1224df(0xf7)),console['log']('\x20\x20Agents:\x20'+formatCountSummary(_0x559be6[_0x1224df(0x140)][_0x1224df(0xf6)])),console['log']('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x559be6[_0x1224df(0x140)][_0x1224df(0x12a)])),console[_0x1224df(0x101)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x559be6[_0x1224df(0x140)][_0x1224df(0x156)])),console[_0x1224df(0x101)](_0x1224df(0x162)+formatCountSummary(_0x559be6[_0x1224df(0x140)][_0x1224df(0x15c)]));const _0x1962a5=_0x559be6[_0x1224df(0x140)][_0x1224df(0xda)][_0x1224df(0x12e)]>0x0||_0x559be6['counts'][_0x1224df(0xda)][_0x1224df(0x137)]>0x0||_0x559be6[_0x1224df(0x140)][_0x1224df(0xda)]['unchanged']>0x0||_0x559be6[_0x1224df(0x140)][_0x1224df(0xd3)][_0x1224df(0x12e)]>0x0||_0x559be6[_0x1224df(0x140)][_0x1224df(0xd3)][_0x1224df(0x137)]>0x0||_0x559be6[_0x1224df(0x140)][_0x1224df(0xd3)][_0x1224df(0xf0)]>0x0;_0x1962a5&&(console[_0x1224df(0x101)](_0x1224df(0x117)+formatCountSummary(_0x559be6['counts'][_0x1224df(0xda)])),console[_0x1224df(0x101)](_0x1224df(0xe1)+formatCountSummary(_0x559be6['counts']['experimentalArtifacts'])));if(_0x3e7bac){console[_0x1224df(0x101)](),console[_0x1224df(0x101)](a4_0x19c80c[_0x1224df(0x116)](_0x1224df(0x118)));for(const _0x557489 of _0x559be6['agents']){_0x557489[_0x1224df(0x105)]===_0x1224df(0x155)&&console[_0x1224df(0x101)](a4_0x19c80c[_0x1224df(0x116)](_0x1224df(0x10c)+_0x557489[_0x1224df(0x132)]+'\x22:\x20'+_0x557489[_0x1224df(0x155)]));}for(const _0x3ba671 of _0x559be6['knowledgeBases']){_0x3ba671[_0x1224df(0x105)]===_0x1224df(0x155)&&console[_0x1224df(0x101)](a4_0x19c80c[_0x1224df(0x116)]('\x20\x20Knowledge\x20Base\x20\x22'+_0x3ba671[_0x1224df(0x138)]+_0x1224df(0x14c)+_0x3ba671[_0x1224df(0x155)]));}for(const _0x217bf0 of _0x559be6[_0x1224df(0x156)]){_0x217bf0['action']===_0x1224df(0x155)&&console['log'](a4_0x19c80c[_0x1224df(0x116)](_0x1224df(0x16a)+_0x217bf0[_0x1224df(0x138)]+_0x1224df(0x14c)+_0x217bf0[_0x1224df(0x155)]));}for(const _0x50c7ae of _0x559be6[_0x1224df(0x15c)]){_0x50c7ae[_0x1224df(0x105)]==='error'&&console[_0x1224df(0x101)](a4_0x19c80c[_0x1224df(0x116)]('\x20\x20Integration\x20\x22'+_0x50c7ae[_0x1224df(0x138)]+_0x1224df(0x14c)+_0x50c7ae[_0x1224df(0x155)]));}for(const _0x51c4c6 of _0x559be6[_0x1224df(0xda)]){_0x51c4c6[_0x1224df(0x105)]===_0x1224df(0x155)&&console[_0x1224df(0x101)](a4_0x19c80c[_0x1224df(0x116)](_0x1224df(0xe0)+_0x51c4c6[_0x1224df(0x138)]+_0x1224df(0x14c)+_0x51c4c6[_0x1224df(0x155)]));}for(const _0x5cea68 of _0x559be6['experimentalArtifacts']){_0x5cea68['action']===_0x1224df(0x155)&&console['log'](a4_0x19c80c[_0x1224df(0x116)](_0x1224df(0x17c)+_0x5cea68[_0x1224df(0x138)]+_0x1224df(0x14c)+_0x5cea68[_0x1224df(0x155)]));}return 0x1;}console[_0x1224df(0x101)]();const _0x3a798c=getLLMProjectUrl(_0x22074a,_0x559be6[_0x1224df(0x139)]);return console[_0x1224df(0x101)]('Project:\x20'+a4_0x19c80c[_0x1224df(0x100)](_0x3a798c)),0x0;}}export class AgentPushCommand extends BaseCommand{['name']='agent:push';[a4_0x48458a(0x147)]=a4_0x48458a(0xd9);async[a4_0x48458a(0x15a)](_0xd73fd1){const _0x5932a7=a4_0x48458a,{options:_0x7322de,args:_0x28001b,tdx:_0x2db746}=_0xd73fd1;let _0x19def2=_0x28001b[0x0]||process[_0x5932a7(0x169)]();const _0x113d77=_0x7322de[_0x5932a7(0x165)],_0x590757=_0x7322de[_0x5932a7(0x177)],_0x3d0ec5=_0x7322de[_0x5932a7(0x16b)],_0x5c10ba=_0x7322de['site'],_0x5eabbb=a4_0x155d79['join'](_0x19def2,_0x5932a7(0xd5)),_0x3e1128=existsSync(_0x5eabbb);if(_0x3e1128){const {data:_0x555464}=await withSpinner(_0x5932a7(0x148)+_0x19def2+_0x5932a7(0x124),()=>_0x2db746[_0x5932a7(0x109)][_0x5932a7(0x11d)](_0x19def2,{'dryRun':_0x113d77,'force':_0x590757}));if(_0x113d77)return console[_0x5932a7(0x101)](a4_0x19c80c[_0x5932a7(0xe4)](_0x5932a7(0x10e))),console[_0x5932a7(0x101)](_0x5932a7(0x143)+_0x555464[_0x5932a7(0x132)]),0x0;if(_0x555464[_0x5932a7(0x105)]===_0x5932a7(0x155))return console[_0x5932a7(0x101)](a4_0x19c80c[_0x5932a7(0x116)](_0x5932a7(0xff)+_0x555464['error'])),0x1;console[_0x5932a7(0x101)](a4_0x19c80c[_0x5932a7(0xd8)](_0x5932a7(0x11c)+_0x555464[_0x5932a7(0x105)]+'\x20successfully')),console[_0x5932a7(0x101)](_0x5932a7(0x172)+_0x555464[_0x5932a7(0x132)]);if(_0x555464[_0x5932a7(0xe8)]&&_0x555464[_0x5932a7(0x122)]){const _0x31b493=getLLMAgentChatUrl(_0x5c10ba,_0x555464[_0x5932a7(0x122)],_0x555464['agentId']);console[_0x5932a7(0x101)](_0x5932a7(0xfb)+a4_0x19c80c[_0x5932a7(0x100)](_0x31b493));}return 0x0;}const _0x378a05=_0x7322de['llmProject'],_0x2a8197=resolveProjectFromContext(_0x19def2,_0x378a05);if(_0x2a8197[_0x5932a7(0xf4)])_0x19def2=_0x2a8197[_0x5932a7(0xcc)],_0x2a8197['source']===_0x5932a7(0x129)&&console[_0x5932a7(0x101)](a4_0x19c80c['dim'](_0x5932a7(0xf8)+_0x19def2));else{let _0x5a7080=_0x5932a7(0x176);_0x2a8197['reason']===_0x5932a7(0x17e)&&(_0x5a7080=_0x2a8197['message']+_0x5932a7(0x161)+_0x2a8197['llmProject']+_0x5932a7(0x126));throw new SDKError(ErrorCode[_0x5932a7(0x150)],_0x2a8197[_0x5932a7(0xfa)]===_0x5932a7(0xdf)?_0x2a8197['message']:'No\x20tdx.json\x20found\x20in\x20'+_0x19def2,undefined,{'helpText':_0x5a7080});}const {data:_0x51cc15}=await withSpinner(_0x5932a7(0x160),()=>_0x2db746[_0x5932a7(0x109)][_0x5932a7(0x181)](_0x19def2,{'dryRun':!![]})),_0x2b2501=_0x51cc15[_0x5932a7(0x140)][_0x5932a7(0xf6)]['errors']>0x0;if(_0x2b2501){console[_0x5932a7(0x101)](a4_0x19c80c[_0x5932a7(0x116)]('\x0aErrors\x20found:'));for(const _0x3c13a5 of _0x51cc15[_0x5932a7(0xf6)]){_0x3c13a5[_0x5932a7(0x105)]===_0x5932a7(0x155)&&console[_0x5932a7(0x101)](a4_0x19c80c[_0x5932a7(0x116)](_0x5932a7(0x10c)+_0x3c13a5[_0x5932a7(0x132)]+_0x5932a7(0x14c)+_0x3c13a5[_0x5932a7(0x155)]));}return 0x1;}const _0x181ea3=_0x51cc15[_0x5932a7(0x140)][_0x5932a7(0xf6)][_0x5932a7(0x12e)]+_0x51cc15[_0x5932a7(0x140)][_0x5932a7(0x12a)][_0x5932a7(0x12e)]+_0x51cc15['counts'][_0x5932a7(0x13f)][_0x5932a7(0x12e)]+_0x51cc15[_0x5932a7(0x140)]['prompts'][_0x5932a7(0x12e)]+_0x51cc15[_0x5932a7(0x140)][_0x5932a7(0x15c)][_0x5932a7(0x12e)]+_0x51cc15[_0x5932a7(0x140)][_0x5932a7(0xda)][_0x5932a7(0x12e)]+_0x51cc15[_0x5932a7(0x140)][_0x5932a7(0xd3)]['created'],_0x22a47b=_0x51cc15[_0x5932a7(0x140)]['agents'][_0x5932a7(0x137)]+_0x51cc15[_0x5932a7(0x140)][_0x5932a7(0x12a)][_0x5932a7(0x137)]+_0x51cc15[_0x5932a7(0x140)]['textKnowledgeBases'][_0x5932a7(0x137)]+_0x51cc15[_0x5932a7(0x140)][_0x5932a7(0x156)][_0x5932a7(0x137)]+_0x51cc15[_0x5932a7(0x140)][_0x5932a7(0x15c)]['updated']+_0x51cc15[_0x5932a7(0x140)]['experimentalKnowledgeBases'][_0x5932a7(0x137)]+_0x51cc15['counts'][_0x5932a7(0xd3)][_0x5932a7(0x137)],_0x1f640b=_0x51cc15[_0x5932a7(0x140)][_0x5932a7(0xf6)][_0x5932a7(0xf0)]+_0x51cc15[_0x5932a7(0x140)][_0x5932a7(0x12a)][_0x5932a7(0xf0)]+_0x51cc15['counts']['textKnowledgeBases'][_0x5932a7(0xf0)]+_0x51cc15[_0x5932a7(0x140)]['prompts'][_0x5932a7(0xf0)]+_0x51cc15[_0x5932a7(0x140)][_0x5932a7(0x15c)]['unchanged']+_0x51cc15[_0x5932a7(0x140)]['experimentalKnowledgeBases']['unchanged']+_0x51cc15['counts'][_0x5932a7(0xd3)][_0x5932a7(0xf0)];console[_0x5932a7(0x101)](_0x5932a7(0xdb)+_0x51cc15['projectName']+'\x27:'),console[_0x5932a7(0x101)]('\x20\x20'+a4_0x19c80c['green']('+\x20'+_0x181ea3+_0x5932a7(0x131))+_0x5932a7(0x16d)+a4_0x19c80c[_0x5932a7(0xe4)]('~\x20'+_0x22a47b+_0x5932a7(0x15e))+_0x5932a7(0x16d)+a4_0x19c80c[_0x5932a7(0xf3)]('=\x20'+_0x1f640b+'\x20unchanged')),console[_0x5932a7(0x101)](_0x5932a7(0x157)+formatCountSummary(_0x51cc15[_0x5932a7(0x140)][_0x5932a7(0xf6)])),console[_0x5932a7(0x101)](_0x5932a7(0x13d)+formatCountSummary(_0x51cc15[_0x5932a7(0x140)][_0x5932a7(0x12a)])),console['log'](_0x5932a7(0x182)+formatCountSummary(_0x51cc15[_0x5932a7(0x140)][_0x5932a7(0x13f)])),console[_0x5932a7(0x101)](_0x5932a7(0xdc)+formatCountSummary(_0x51cc15['counts']['prompts'])),console[_0x5932a7(0x101)](_0x5932a7(0x162)+formatCountSummary(_0x51cc15[_0x5932a7(0x140)]['integrations']));const _0x5baccd=_0x51cc15[_0x5932a7(0x140)][_0x5932a7(0xda)]['created']>0x0||_0x51cc15[_0x5932a7(0x140)][_0x5932a7(0xda)]['updated']>0x0||_0x51cc15[_0x5932a7(0x140)][_0x5932a7(0xda)]['unchanged']>0x0||_0x51cc15['counts'][_0x5932a7(0xd3)][_0x5932a7(0x12e)]>0x0||_0x51cc15[_0x5932a7(0x140)][_0x5932a7(0xd3)][_0x5932a7(0x137)]>0x0||_0x51cc15['counts'][_0x5932a7(0xd3)][_0x5932a7(0xf0)]>0x0;_0x5baccd&&(console['log']('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x51cc15[_0x5932a7(0x140)]['experimentalKnowledgeBases'])),console[_0x5932a7(0x101)](_0x5932a7(0xe1)+formatCountSummary(_0x51cc15[_0x5932a7(0x140)][_0x5932a7(0xd3)])));console[_0x5932a7(0x101)](_0x5932a7(0x114)+a4_0x19c80c[_0x5932a7(0x100)](_0x19def2)),displayDiffs(_0x51cc15[_0x5932a7(0xf6)],_0x51cc15[_0x5932a7(0x12a)],_0x51cc15[_0x5932a7(0x13f)],_0x51cc15[_0x5932a7(0x156)],_0x51cc15['integrations'],_0x51cc15[_0x5932a7(0xda)],_0x51cc15[_0x5932a7(0xd3)]);if(_0x113d77)return console[_0x5932a7(0x101)](a4_0x19c80c[_0x5932a7(0xe4)](_0x5932a7(0x14a))),0x0;if(_0x181ea3===0x0&&_0x22a47b===0x0){console[_0x5932a7(0x101)](a4_0x19c80c[_0x5932a7(0xd8)](_0x5932a7(0x127)));const _0x3a8b77=getLLMProjectUrl(_0x5c10ba,_0x51cc15['projectId']);return console[_0x5932a7(0x101)]('Project:\x20'+a4_0x19c80c[_0x5932a7(0x100)](_0x3a8b77)),0x0;}if(!_0x3d0ec5&&!_0x590757){if(!isInteractive())return console[_0x5932a7(0x155)](a4_0x19c80c[_0x5932a7(0x116)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x5932a7(0x155)](a4_0x19c80c[_0x5932a7(0xf3)](_0x5932a7(0x180))),0x1;const _0x37030e=await confirmKey(_0x5932a7(0x183)+(_0x181ea3+_0x22a47b)+_0x5932a7(0x121));if(!_0x37030e)return console[_0x5932a7(0x101)](a4_0x19c80c[_0x5932a7(0xe4)](_0x5932a7(0x152)),_0x5932a7(0x142)),0x1;}const {data:_0x4280b9}=await withSpinner(_0x5932a7(0xe9),()=>_0x2db746[_0x5932a7(0x109)][_0x5932a7(0x181)](_0x19def2,{'force':_0x590757})),_0x3618c0=_0x4280b9[_0x5932a7(0x140)]['agents'][_0x5932a7(0xed)]>0x0||_0x4280b9['counts']['knowledgeBases']['errors']>0x0||_0x4280b9[_0x5932a7(0x140)][_0x5932a7(0x13f)][_0x5932a7(0xed)]>0x0||_0x4280b9[_0x5932a7(0x140)][_0x5932a7(0x156)][_0x5932a7(0xed)]>0x0;if(_0x3618c0){console[_0x5932a7(0x101)](a4_0x19c80c[_0x5932a7(0xe4)](_0x5932a7(0x141))),console['log'](),console[_0x5932a7(0x101)](a4_0x19c80c[_0x5932a7(0x116)](_0x5932a7(0x118)));for(const _0x54ffab of _0x4280b9[_0x5932a7(0xf6)]){_0x54ffab[_0x5932a7(0x105)]===_0x5932a7(0x155)&&console[_0x5932a7(0x101)](a4_0x19c80c[_0x5932a7(0x116)](_0x5932a7(0x10c)+_0x54ffab[_0x5932a7(0x132)]+_0x5932a7(0x14c)+_0x54ffab['error']));}for(const _0x36a576 of _0x4280b9[_0x5932a7(0x12a)]){_0x36a576[_0x5932a7(0x105)]===_0x5932a7(0x155)&&console[_0x5932a7(0x101)](a4_0x19c80c[_0x5932a7(0x116)]('\x20\x20Knowledge\x20Base\x20\x22'+_0x36a576[_0x5932a7(0x138)]+_0x5932a7(0x14c)+_0x36a576[_0x5932a7(0x155)]));}for(const _0x40f540 of _0x4280b9[_0x5932a7(0x13f)]){_0x40f540['action']===_0x5932a7(0x155)&&console['log'](a4_0x19c80c[_0x5932a7(0x116)](_0x5932a7(0x103)+_0x40f540['name']+'\x22:\x20'+_0x40f540[_0x5932a7(0x155)]));}for(const _0x26ded5 of _0x4280b9[_0x5932a7(0x156)]){_0x26ded5['action']===_0x5932a7(0x155)&&console[_0x5932a7(0x101)](a4_0x19c80c[_0x5932a7(0x116)]('\x20\x20Prompt\x20\x22'+_0x26ded5[_0x5932a7(0x138)]+_0x5932a7(0x14c)+_0x26ded5[_0x5932a7(0x155)]));}for(const _0x5ccb68 of _0x4280b9[_0x5932a7(0x15c)]){_0x5ccb68['action']===_0x5932a7(0x155)&&console[_0x5932a7(0x101)](a4_0x19c80c[_0x5932a7(0x116)](_0x5932a7(0x115)+_0x5ccb68[_0x5932a7(0x138)]+_0x5932a7(0x14c)+_0x5ccb68[_0x5932a7(0x155)]));}return 0x1;}console['log'](a4_0x19c80c[_0x5932a7(0xd8)](_0x5932a7(0xee)+(_0x181ea3+_0x22a47b)+_0x5932a7(0xe7)+_0x4280b9['projectName']+'\x27'));const _0x18e638=getLLMProjectUrl(_0x5c10ba,_0x4280b9[_0x5932a7(0x122)]);return console[_0x5932a7(0x101)](_0x5932a7(0xfd)+a4_0x19c80c[_0x5932a7(0x100)](_0x18e638)),0x0;}}
@@ -1 +1 @@
1
- const a5_0x815915=a5_0x81a8;(function(_0x371a5c,_0x4481b6){const _0x5cd686=a5_0x81a8,_0x33aa82=_0x371a5c();while(!![]){try{const _0x2c1ecf=-parseInt(_0x5cd686(0xe5))/0x1+parseInt(_0x5cd686(0xf2))/0x2+parseInt(_0x5cd686(0x126))/0x3+-parseInt(_0x5cd686(0x146))/0x4+-parseInt(_0x5cd686(0xf8))/0x5+parseInt(_0x5cd686(0xea))/0x6*(parseInt(_0x5cd686(0x12d))/0x7)+parseInt(_0x5cd686(0x132))/0x8;if(_0x2c1ecf===_0x4481b6)break;else _0x33aa82['push'](_0x33aa82['shift']());}catch(_0x47a1bc){_0x33aa82['push'](_0x33aa82['shift']());}}}(a5_0x349a,0xa1f5f));import*as a5_0x2893b0 from'node:fs';import*as a5_0xbb3baa from'node:path';import a5_0x17c2f7 from'chalk';import{BaseCommand}from'./command.js';function a5_0x81a8(_0x33571a,_0x5b1c75){_0x33571a=_0x33571a-0xd2;const _0x349a92=a5_0x349a();let _0x81a81d=_0x349a92[_0x33571a];return _0x81a81d;}import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';function a5_0x349a(){const _0x4bee11=['timestamp','testName','has','No\x20tests\x20found\x20matching:\x20','no_tests','189125HjlkEL','Site:\x20','⚠\x20SKIPPED:\x20','existsSync','find','\x20(new)','Agent:\x20','stop','green','site','json','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','✗\x20ERROR:\x20','\x20\x20-\x20','no_local_folder','split','\x20\x20Agent:\x20','add','includes','Failed\x20Tests:','log','red','verbose','No\x20tests\x20have\x20tags\x20defined.','text','resolveProjectId',':\x20Sending\x20user\x20input...','message','Output\x20written\x20to:\x20','\x20\x20Conversation:\x20','PASS','Re-evaluating\x20','now','forEach','isSpinning','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','white','projectDir','dim','length','Using\x20agent:\x20','resolveAgentId','Either\x20switch\x20to\x20the\x20\x22','Cached\x20run\x20is\x20from\x20site\x20\x22','Test\x20Summary','1223979EinOzj','agent','found','Total:\x20\x20\x20\x20','FAIL','toISOString','\x20-\x20','1085JBrTgG','llmProject','Executing\x20new\x20tests...','tests','writeFileSync','748072VPXIlP','Running\x20agent\x20tests...','cyan','Run\x20tests\x20for\x20an\x20LLM\x20agent','Round\x201/','source','✗\x20ERROR:\x20Project\x20not\x20found:\x20','agent:test','Available\x20tags:\x20','rounds','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','\x22,\x20but\x20current\x20site\x20is\x20\x22','trim','Test\x20Configuration:','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','...\x20','reason','table','Cached\x20run\x20from:\x20','jsonl','1839704FMwXpI','Re-evaluating\x20cached\x20test\x20run...','no_context','\x20\x20Round\x20','...','\x20\x20Site:\x20','Passed:\x20\x20\x20','size','Tests\x20found:\x20','No\x20tests\x20found\x20with\x20tags:\x20','agentName','✗\x20FAIL:\x20','name','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','projectName','tags','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','repeat','status','\x20\x20Project:\x20','description','tsv','executeReeval','agentDirs','\x22:\x20','Error:\x20No\x20previous\x20test\x20run\x20found.','Error\x20writing\x20output\x20file:\x20','ERROR','filter','Duration:\x20','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','basename','Run\x20\x27tdx\x20agent\x20pull\x20','Round\x20','\x20\x20Evaluating...\x20','Evaluating\x20response...','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','conversation_url','dryRun','start','push','substring','not\x20found','\x27\x20to\x20create\x20the\x20folder\x20structure.','Failed:\x20\x20\x20','New\x20tests\x20to\x20execute:\x20','Re-evaluation\x20Summary','Available\x20tests:\x20','404','map','multiple_agents','toLowerCase','51149SnQxqX','Conversation\x20URL:\x20','✓\x20PASS:\x20','llm','eval','23046MEgsMt','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','execute','Running:\x20','join','Re-evaluating...','yellow','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','230868tEboMX'];a5_0x349a=function(){return _0x4bee11;};return a5_0x349a();}import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x815915(0x152)]=a5_0x815915(0x139);[a5_0x815915(0x15a)]=a5_0x815915(0x135);async[a5_0x815915(0xec)](_0x47dd19){const _0x24a554=a5_0x815915,{options:_0x59a7e6,args:_0xf3e320,tdx:_0x1f5f96}=_0x47dd19,_0x3501a4=_0xf3e320[0x0]||'.',_0x1bfb49=_0x59a7e6[_0x24a554(0xd7)],_0x141fc7=_0x59a7e6,_0x442288=_0x141fc7[_0x24a554(0xe9)]===![],_0x1a2028=_0x141fc7['reeval'],_0x2f615d=_0x141fc7['name'],_0x20756d=_0x141fc7[_0x24a554(0x155)],_0x4f215b=_0x59a7e6[_0x24a554(0x101)],_0x5a8c22=_0x141fc7['output'];if(_0x1a2028&&_0x442288)return console[_0x24a554(0x10c)](a5_0x17c2f7[_0x24a554(0x10d)](_0x24a554(0x103))),0x1;let _0x5d45a8=_0x24a554(0x143);if(_0x141fc7[_0x24a554(0x102)])_0x5d45a8=_0x24a554(0x102);else{if(_0x141fc7[_0x24a554(0x145)])_0x5d45a8=_0x24a554(0x145);else{if(_0x141fc7[_0x24a554(0x15b)])_0x5d45a8='tsv';else{if(_0x141fc7['table'])_0x5d45a8=_0x24a554(0x143);}}}const _0xaad49=_0x141fc7['llmProject'];let _0xf5fee7=_0x3501a4;const _0x45e47c=a5_0x2893b0[_0x24a554(0xfb)](_0x3501a4),_0x1c9d22=_0x3501a4==='.';if(!_0x45e47c||_0x1c9d22){const _0x17976e=resolveProjectFromContext(_0x3501a4,_0xaad49,{'requireFile':'test.yml'});if(_0x17976e[_0x24a554(0x128)])_0xf5fee7=_0x17976e['projectDir'],_0x17976e[_0x24a554(0x137)]==='context'&&console[_0x24a554(0x10c)](a5_0x17c2f7[_0x24a554(0x11f)](_0x24a554(0x121)+_0xf5fee7));else switch(_0x17976e[_0x24a554(0x142)]){case _0x24a554(0x148):console[_0x24a554(0x10c)](a5_0x17c2f7[_0x24a554(0xf0)](_0x17976e[_0x24a554(0x113)])),console['log'](),console['log']('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[_0x24a554(0x10c)]('\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[_0x24a554(0x10c)](),console[_0x24a554(0x10c)]('Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>');return 0x1;case _0x24a554(0x106):console[_0x24a554(0x10c)](a5_0x17c2f7['yellow'](_0x17976e[_0x24a554(0x113)])),console[_0x24a554(0x10c)](),console['log'](_0x24a554(0x166)+_0x17976e[_0x24a554(0x12e)]+_0x24a554(0xdc));return 0x1;case _0x24a554(0xe3):{const _0x478b94=a5_0xbb3baa[_0x24a554(0x165)](_0x17976e[_0x24a554(0x11e)]);console[_0x24a554(0x10c)](a5_0x17c2f7['yellow'](_0x24a554(0x153)+_0x17976e[_0x24a554(0x12e)]+'\x22:'));for(const _0x5e6a99 of _0x17976e[_0x24a554(0x15d)]){console['log'](_0x24a554(0x105)+_0x5e6a99);}return console[_0x24a554(0x10c)](),console[_0x24a554(0x10c)](_0x24a554(0x11b)+_0x478b94+'/<agent-name>'),0x1;}case _0x24a554(0xf7):console[_0x24a554(0x10c)](a5_0x17c2f7[_0x24a554(0xf0)]('No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22'+_0x17976e[_0x24a554(0x12e)]+'\x22.')),console['log'](a5_0x17c2f7[_0x24a554(0x11f)]('Project\x20path:\x20'+_0x17976e[_0x24a554(0x11e)])),console['log'](),console[_0x24a554(0x10c)](_0x24a554(0xeb));return 0x1;}}const {definition:_0x18c6ae,agentInfo:_0x46b9e1}=parseTestFile(_0xf5fee7);let _0x92e90a=_0x18c6ae[_0x24a554(0x130)];if(_0x2f615d){const _0x132831=_0x2f615d[_0x24a554(0x107)](',')[_0x24a554(0xe2)](_0x31e2b0=>_0x31e2b0[_0x24a554(0x13e)]());_0x92e90a=_0x18c6ae[_0x24a554(0x130)][_0x24a554(0x162)](_0xadacba=>_0x132831['includes'](_0xadacba[_0x24a554(0x152)]));if(_0x92e90a['length']===0x0)return console[_0x24a554(0x10c)](a5_0x17c2f7[_0x24a554(0xf0)](_0x24a554(0xf6)+_0x2f615d)),console['log'](a5_0x17c2f7[_0x24a554(0x11f)](_0x24a554(0xe0)+_0x18c6ae['tests'][_0x24a554(0xe2)](_0x561048=>_0x561048['name'])['join'](',\x20'))),0x1;}if(_0x20756d){const _0x236f7f=_0x20756d['split'](',')[_0x24a554(0xe2)](_0x12b968=>_0x12b968['trim']()[_0x24a554(0xe4)]());_0x92e90a=_0x92e90a[_0x24a554(0x162)](_0x5ecd98=>_0x5ecd98[_0x24a554(0x155)]?.['some'](_0x351b73=>_0x236f7f['includes'](_0x351b73['toLowerCase']())));if(_0x92e90a[_0x24a554(0x120)]===0x0){console[_0x24a554(0x10c)](a5_0x17c2f7['yellow'](_0x24a554(0x14f)+_0x20756d));const _0x27db93=new Set();return _0x18c6ae['tests'][_0x24a554(0x119)](_0x3edf91=>_0x3edf91[_0x24a554(0x155)]?.[_0x24a554(0x119)](_0x321ca6=>_0x27db93[_0x24a554(0x109)](_0x321ca6))),_0x27db93[_0x24a554(0x14d)]>0x0?console[_0x24a554(0x10c)](a5_0x17c2f7['dim'](_0x24a554(0x13a)+[..._0x27db93][_0x24a554(0xee)](',\x20'))):console[_0x24a554(0x10c)](a5_0x17c2f7[_0x24a554(0x11f)](_0x24a554(0x10f))),0x1;}}if(_0x1a2028)return this[_0x24a554(0x15c)](_0x47dd19,{'definition':{'tests':_0x92e90a},'agentInfo':_0x46b9e1,'outputFormat':_0x5d45a8,'outputFile':_0x5a8c22,'testNames':_0x2f615d});if(_0x1bfb49){console[_0x24a554(0x10c)](a5_0x17c2f7[_0x24a554(0x134)](_0x24a554(0x13f))),console[_0x24a554(0x10c)](_0x24a554(0x14b)+a5_0x17c2f7[_0x24a554(0x11d)](_0x4f215b)),console[_0x24a554(0x10c)](_0x24a554(0x159)+a5_0x17c2f7[_0x24a554(0x11d)](_0x46b9e1[_0x24a554(0x154)])),console[_0x24a554(0x10c)](_0x24a554(0x108)+a5_0x17c2f7[_0x24a554(0x11d)](_0x46b9e1[_0x24a554(0x150)])),console[_0x24a554(0x10c)](),console['log'](_0x24a554(0x14e)+a5_0x17c2f7[_0x24a554(0x11d)](_0x92e90a[_0x24a554(0x120)]));for(let _0x3fdab6=0x0;_0x3fdab6<_0x92e90a[_0x24a554(0x120)];_0x3fdab6++){const _0x578fe2=_0x92e90a[_0x3fdab6],_0x42b5b8=_0x578fe2[_0x24a554(0x13b)][_0x24a554(0x120)]===0x1?'round':_0x24a554(0x13b),_0x338e96=_0x578fe2['tags']?.[_0x24a554(0x120)]?'\x20['+_0x578fe2[_0x24a554(0x155)][_0x24a554(0xee)](',\x20')+']':'';console[_0x24a554(0x10c)]('\x20\x20'+(_0x3fdab6+0x1)+'.\x20'+a5_0x17c2f7[_0x24a554(0x11d)](_0x578fe2['name'])+'\x20('+_0x578fe2['rounds'][_0x24a554(0x120)]+'\x20'+_0x42b5b8+')'+a5_0x17c2f7[_0x24a554(0x11f)](_0x338e96));}return 0x0;}let _0x18b3d6,_0x9794ea;try{_0x18b3d6=await _0x1f5f96['llm'][_0x24a554(0x111)](_0x46b9e1['projectName']);}catch(_0x4e3453){const _0x4b30b8=_0x4e3453 instanceof Error?_0x4e3453['message']:String(_0x4e3453);return _0x4b30b8['includes']('404')||_0x4b30b8[_0x24a554(0xe4)]()[_0x24a554(0x10a)](_0x24a554(0xdb))?console[_0x24a554(0x10c)](a5_0x17c2f7['red'](_0x24a554(0x138)+_0x46b9e1[_0x24a554(0x154)])):console[_0x24a554(0x10c)](a5_0x17c2f7[_0x24a554(0x10d)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22'+_0x46b9e1[_0x24a554(0x154)]+_0x24a554(0x15e)+_0x4b30b8)),0x1;}try{_0x9794ea=await _0x1f5f96[_0x24a554(0xe8)][_0x24a554(0x122)](_0x46b9e1[_0x24a554(0x150)],_0x18b3d6);}catch(_0x2ea803){const _0xc5b106=_0x2ea803 instanceof Error?_0x2ea803[_0x24a554(0x113)]:String(_0x2ea803);return _0xc5b106[_0x24a554(0x10a)](_0x24a554(0xe1))||_0xc5b106[_0x24a554(0xe4)]()[_0x24a554(0x10a)](_0x24a554(0xdb))?console[_0x24a554(0x10c)](a5_0x17c2f7[_0x24a554(0x10d)](_0x24a554(0xf1)+_0x46b9e1[_0x24a554(0x150)])):console[_0x24a554(0x10c)](a5_0x17c2f7[_0x24a554(0x10d)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22'+_0x46b9e1[_0x24a554(0x150)]+_0x24a554(0x15e)+_0xc5b106)),0x1;}let _0x48f527;if(!_0x442288)try{_0x48f527=await setupEvaluatorAgent(_0x1f5f96[_0x24a554(0xe8)],_0x59a7e6[_0x24a554(0x10e)]);}catch(_0xefcf1b){const _0x522217=_0xefcf1b instanceof Error?_0xefcf1b['message']:String(_0xefcf1b);return console[_0x24a554(0x10c)](a5_0x17c2f7[_0x24a554(0x10d)](_0x24a554(0x140)+_0x522217)),0x1;}console['log'](a5_0x17c2f7[_0x24a554(0x134)](_0x24a554(0x133))),console[_0x24a554(0x10c)](_0x24a554(0xf9)+a5_0x17c2f7['white'](_0x4f215b)),console[_0x24a554(0x10c)](_0x24a554(0xfe)+a5_0x17c2f7[_0x24a554(0x11d)](_0x46b9e1[_0x24a554(0x154)]+'/'+_0x46b9e1[_0x24a554(0x150)])),console[_0x24a554(0x10c)]();const _0x26b3df=[],_0x6732a9=[],_0x29dc93=Date[_0x24a554(0x118)]();for(let _0x41202b=0x0;_0x41202b<_0x92e90a[_0x24a554(0x120)];_0x41202b++){const _0x3f0f4d=_0x92e90a[_0x41202b];_0x92e90a[_0x24a554(0x120)]>0x1?console['log']('Test\x20'+(_0x41202b+0x1)+'/'+_0x92e90a[_0x24a554(0x120)]+':\x20'+a5_0x17c2f7['white'](_0x3f0f4d[_0x24a554(0x152)])):console[_0x24a554(0x10c)]('Running\x20test:\x20'+a5_0x17c2f7['white'](_0x3f0f4d[_0x24a554(0x152)]));const _0x46489a=createCommandSpinner('Round\x201/'+_0x3f0f4d[_0x24a554(0x13b)][_0x24a554(0x120)]+_0x24a554(0x112));_0x46489a[_0x24a554(0xd8)]();try{const {result:_0xb0d959,conversation:_0x5a64bc}=await runTest(_0x1f5f96[_0x24a554(0xe8)],_0x3f0f4d,{'agentId':_0x9794ea,'projectId':_0x18b3d6,'site':_0x4f215b,'noEval':_0x442288,'evaluatorId':_0x48f527,'onRoundStart':(_0x4c396f,_0x1a7197)=>{const _0x4d8c05=_0x24a554;_0x46489a[_0x4d8c05(0x110)]='Round\x20'+(_0x4c396f+0x1)+'/'+_0x1a7197+_0x4d8c05(0x112);},'onRoundComplete':(_0x178f9f,_0x5222f7,_0x28369c)=>{const _0x2e5d76=_0x24a554,_0x16b43f=formatElapsed(_0x5222f7);_0x28369c?console['log'](_0x2e5d76(0x149)+(_0x178f9f+0x1)+'/'+_0x3f0f4d[_0x2e5d76(0x13b)][_0x2e5d76(0x120)]+'...\x20'+a5_0x17c2f7['green']('✓')+'\x20('+_0x16b43f+')'):console[_0x2e5d76(0x10c)](_0x2e5d76(0x149)+(_0x178f9f+0x1)+'/'+_0x3f0f4d[_0x2e5d76(0x13b)][_0x2e5d76(0x120)]+_0x2e5d76(0x141)+a5_0x17c2f7[_0x2e5d76(0x10d)]('✗'));},'onEvaluationStart':()=>{const _0x5d8e11=_0x24a554;_0x46489a[_0x5d8e11(0x110)]='Evaluating\x20response...';},'onEvaluationComplete':_0x3c3c9a=>{const _0x428386=_0x24a554,_0x517a6e=formatElapsed(_0x3c3c9a);console[_0x428386(0x10c)](_0x428386(0xd3)+a5_0x17c2f7[_0x428386(0x100)]('✓')+'\x20('+_0x517a6e+')');}});_0x46489a[_0x24a554(0xff)](),_0x26b3df[_0x24a554(0xd9)](_0xb0d959),_0x6732a9[_0x24a554(0xd9)](_0x5a64bc);if(_0xb0d959['status']===_0x24a554(0x116))console[_0x24a554(0x10c)](a5_0x17c2f7[_0x24a554(0x100)](_0x24a554(0xe7)+_0xb0d959[_0x24a554(0x142)]));else _0xb0d959[_0x24a554(0x158)]===_0x24a554(0x12a)?console[_0x24a554(0x10c)](a5_0x17c2f7[_0x24a554(0x10d)](_0x24a554(0x151)+_0xb0d959[_0x24a554(0x142)])):console['log'](a5_0x17c2f7[_0x24a554(0x10d)]('✗\x20ERROR:\x20'+_0xb0d959[_0x24a554(0x142)]));_0xb0d959[_0x24a554(0xd6)]&&console[_0x24a554(0x10c)](a5_0x17c2f7[_0x24a554(0x11f)](_0x24a554(0xe6)+_0xb0d959[_0x24a554(0xd6)])),console['log']();}catch(_0x146d15){_0x46489a[_0x24a554(0xff)]();const _0x254db8=_0x146d15 instanceof Error?_0x146d15[_0x24a554(0x113)]:String(_0x146d15);console[_0x24a554(0x10c)](a5_0x17c2f7[_0x24a554(0x10d)](_0x24a554(0x104)+_0x254db8)),console['log'](),_0x26b3df['push']({'name':_0x3f0f4d[_0x24a554(0x152)],'status':'ERROR','reason':_0x254db8,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}const _0x313bbc=Date[_0x24a554(0x118)]()-_0x29dc93,_0x434861=_0x26b3df['filter'](_0x499f79=>_0x499f79['status']===_0x24a554(0x116))[_0x24a554(0x120)],_0x23498f=_0x26b3df['filter'](_0x28500d=>_0x28500d['status']===_0x24a554(0x12a))['length'],_0x8ae27f=_0x26b3df[_0x24a554(0x162)](_0x58a51f=>_0x58a51f[_0x24a554(0x158)]===_0x24a554(0x161))[_0x24a554(0x120)];console[_0x24a554(0x10c)]('━'[_0x24a554(0x157)](0x3c)),console[_0x24a554(0x10c)](_0x24a554(0x125)),console[_0x24a554(0x10c)]('━'[_0x24a554(0x157)](0x3c)),console[_0x24a554(0x10c)](_0x24a554(0x129)+_0x26b3df[_0x24a554(0x120)]),console[_0x24a554(0x10c)](_0x24a554(0x14c)+a5_0x17c2f7[_0x24a554(0x100)](_0x434861)),console[_0x24a554(0x10c)](_0x24a554(0xdd)+a5_0x17c2f7['red'](_0x23498f));_0x8ae27f>0x0&&console[_0x24a554(0x10c)]('Errors:\x20\x20\x20'+a5_0x17c2f7['red'](_0x8ae27f));console[_0x24a554(0x10c)]('Duration:\x20'+formatElapsed(_0x313bbc)),console['log']('━'[_0x24a554(0x157)](0x3c));const _0x306f7d=_0x26b3df[_0x24a554(0x162)](_0x5817f8=>_0x5817f8[_0x24a554(0x158)]!==_0x24a554(0x116));if(_0x306f7d['length']>0x0){console[_0x24a554(0x10c)](),console[_0x24a554(0x10c)](_0x24a554(0x10b));for(const _0x2d8397 of _0x306f7d){const _0x4aebd4=a5_0x17c2f7[_0x24a554(0x10d)]('✗'),_0x4cf1bd=_0x2d8397[_0x24a554(0x142)]['length']>0x32?_0x2d8397[_0x24a554(0x142)][_0x24a554(0xda)](0x0,0x32)+_0x24a554(0x14a):_0x2d8397[_0x24a554(0x142)];console['log']('\x20\x20'+_0x4aebd4+'\x20'+_0x2d8397[_0x24a554(0x152)]+':\x20'+_0x4cf1bd);}}const _0x834816={'summary':{'total':_0x26b3df[_0x24a554(0x120)],'passed':_0x434861,'failed':_0x23498f,'errors':_0x8ae27f>0x0?_0x8ae27f:undefined,'duration_ms':_0x313bbc},'tests':_0x26b3df,'agent':{'project':_0x46b9e1[_0x24a554(0x154)],'name':_0x46b9e1[_0x24a554(0x150)],'site':_0x4f215b},'timestamp':new Date(_0x29dc93)[_0x24a554(0x12b)]()};try{const _0x5af70a=buildCachedTestRun(_0x6732a9,{'site':_0x4f215b,'projectId':_0x18b3d6,'projectName':_0x46b9e1[_0x24a554(0x154)],'agentId':_0x9794ea,'agentName':_0x46b9e1[_0x24a554(0x150)],'testYmlPath':a5_0xbb3baa['resolve'](_0x46b9e1['testYmlPath'])});saveLastTestRun(_0x5af70a);}catch{}if(_0x5d45a8!==_0x24a554(0x143)||_0x5a8c22){const _0x607273=formatResults(_0x834816,_0x5d45a8);if(_0x5a8c22)try{a5_0x2893b0[_0x24a554(0x131)](_0x5a8c22,_0x607273,'utf-8'),console[_0x24a554(0x10c)](),console['log'](a5_0x17c2f7[_0x24a554(0x11f)](_0x24a554(0x114)+_0x5a8c22));}catch(_0x259e44){return console[_0x24a554(0x10c)](),console[_0x24a554(0x10c)](a5_0x17c2f7[_0x24a554(0x10d)](_0x24a554(0x160)+_0x259e44)),0x1;}else console[_0x24a554(0x10c)](),console[_0x24a554(0x10c)](_0x607273);}return _0x306f7d[_0x24a554(0x120)]>0x0?0x1:0x0;}async[a5_0x815915(0x15c)](_0x11a0e5,_0x4a8dda){const _0x802a15=a5_0x815915,{options:_0xccd5cc,tdx:_0x5b614e}=_0x11a0e5,{definition:_0x146f6f,agentInfo:_0x15d38c,outputFormat:_0x31bef3,outputFile:_0x50ee73}=_0x4a8dda,_0x5ae626=_0xccd5cc[_0x802a15(0x101)],_0x20e5c3=loadLastTestRun();if(!_0x20e5c3)return console['log'](a5_0x17c2f7[_0x802a15(0x10d)](_0x802a15(0x15f))),console['log'](a5_0x17c2f7[_0x802a15(0x11f)](_0x802a15(0x11c))),0x1;if(_0x20e5c3[_0x802a15(0x127)][_0x802a15(0x150)]!==_0x15d38c[_0x802a15(0x150)])return console[_0x802a15(0x10c)](a5_0x17c2f7[_0x802a15(0x10d)]('Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22'+_0x20e5c3[_0x802a15(0x127)]['agentName']+_0x802a15(0xd5)+_0x15d38c[_0x802a15(0x150)]+'\x22.')),console['log'](a5_0x17c2f7[_0x802a15(0x11f)](_0x802a15(0x156))),0x1;const _0x457869=new Set(_0x20e5c3['conversations'][_0x802a15(0xe2)](_0x584c3f=>_0x584c3f[_0x802a15(0xf4)])),_0xcf3797=_0x146f6f[_0x802a15(0x130)][_0x802a15(0x162)](_0x1cce8f=>!_0x457869[_0x802a15(0xf5)](_0x1cce8f['name']));if(_0xcf3797[_0x802a15(0x120)]>0x0&&_0x20e5c3[_0x802a15(0x101)]!==_0x5ae626)return console[_0x802a15(0x10c)](a5_0x17c2f7[_0x802a15(0x10d)](_0x802a15(0x13c))),console[_0x802a15(0x10c)](a5_0x17c2f7[_0x802a15(0x11f)](_0x802a15(0x124)+_0x20e5c3[_0x802a15(0x101)]+_0x802a15(0x13d)+_0x5ae626+'\x22.')),console[_0x802a15(0x10c)](a5_0x17c2f7[_0x802a15(0x11f)](_0x802a15(0x123)+_0x20e5c3[_0x802a15(0x101)]+'\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.')),0x1;const _0x46d60e=_0x146f6f[_0x802a15(0x130)][_0x802a15(0x162)](_0x1b3b81=>_0x457869[_0x802a15(0xf5)](_0x1b3b81[_0x802a15(0x152)])),_0xbefd08=_0xcf3797;let _0xace298;try{_0xace298=await setupEvaluatorAgent(_0x5b614e[_0x802a15(0xe8)],_0xccd5cc[_0x802a15(0x10e)]);}catch(_0x4a32af){const _0x2b091e=_0x4a32af instanceof Error?_0x4a32af[_0x802a15(0x113)]:String(_0x4a32af);return console[_0x802a15(0x10c)](a5_0x17c2f7[_0x802a15(0x10d)](_0x802a15(0x140)+_0x2b091e)),0x1;}console['log'](a5_0x17c2f7[_0x802a15(0x134)](_0x802a15(0x147))),console[_0x802a15(0x10c)](_0x802a15(0x144)+a5_0x17c2f7[_0x802a15(0x11d)](_0x20e5c3[_0x802a15(0xf3)])),console[_0x802a15(0x10c)]('Agent:\x20'+a5_0x17c2f7[_0x802a15(0x11d)](_0x20e5c3[_0x802a15(0x127)][_0x802a15(0x154)]+'/'+_0x20e5c3['agent'][_0x802a15(0x150)]));_0xbefd08['length']>0x0&&console[_0x802a15(0x10c)](_0x802a15(0xde)+a5_0x17c2f7[_0x802a15(0xf0)](_0xbefd08['length']));console[_0x802a15(0x10c)]();const _0x3f096f=[],_0x417839=Date[_0x802a15(0x118)](),_0x4253d3=createCommandSpinner(_0x802a15(0xef));if(_0x46d60e['length']>0x0)try{const _0x2d3642=await reevaluateFromCache(_0x5b614e['llm'],_0x20e5c3,{'tests':_0x46d60e},{'evaluatorId':_0xace298,'onTestStart':(_0x353f88,_0x4858ab,_0xd65d48)=>{const _0x492c44=_0x802a15;_0x4253d3['text']=_0x492c44(0x117)+(_0x4858ab+0x1)+'/'+_0xd65d48+':\x20'+_0x353f88+_0x492c44(0x14a);if(!_0x4253d3[_0x492c44(0x11a)])_0x4253d3[_0x492c44(0xd8)]();},'onTestComplete':(_0x3730c0,_0x530568)=>{const _0x1f72c0=_0x802a15;_0x4253d3[_0x1f72c0(0xff)]();if(_0x530568[_0x1f72c0(0x158)]==='PASS')console['log'](a5_0x17c2f7[_0x1f72c0(0x100)](_0x1f72c0(0xe7)+_0x3730c0)+a5_0x17c2f7['dim']('\x20(cached)'));else _0x530568[_0x1f72c0(0x158)]===_0x1f72c0(0x12a)?console[_0x1f72c0(0x10c)](a5_0x17c2f7[_0x1f72c0(0x10d)](_0x1f72c0(0x151)+_0x3730c0+_0x1f72c0(0x12c)+_0x530568[_0x1f72c0(0x142)])+a5_0x17c2f7[_0x1f72c0(0x11f)]('\x20(cached)')):console[_0x1f72c0(0x10c)](a5_0x17c2f7[_0x1f72c0(0x10d)](_0x1f72c0(0x104)+_0x3730c0+'\x20-\x20'+_0x530568[_0x1f72c0(0x142)]));_0x530568['conversation_url']&&console['log'](a5_0x17c2f7[_0x1f72c0(0x11f)](_0x1f72c0(0x115)+_0x530568['conversation_url'])),_0x3f096f[_0x1f72c0(0xd9)](_0x530568);},'onTestSkipped':(_0x33d5c6,_0xa69ad)=>{const _0x24b9e4=_0x802a15;_0x4253d3['stop'](),console[_0x24b9e4(0x10c)](a5_0x17c2f7[_0x24b9e4(0xf0)](_0x24b9e4(0xfa)+_0x33d5c6+'\x20-\x20'+_0xa69ad));}});for(const _0x788db0 of _0x2d3642){!_0x3f096f[_0x802a15(0xfc)](_0x2fd79d=>_0x2fd79d[_0x802a15(0x152)]===_0x788db0[_0x802a15(0x152)])&&_0x3f096f[_0x802a15(0xd9)](_0x788db0);}}catch(_0xea7f96){_0x4253d3[_0x802a15(0xff)]();const _0x176798=_0xea7f96 instanceof Error?_0xea7f96[_0x802a15(0x113)]:String(_0xea7f96);return console[_0x802a15(0x10c)](a5_0x17c2f7[_0x802a15(0x10d)](_0x802a15(0x164)+_0x176798)),0x1;}_0x4253d3[_0x802a15(0xff)]();if(_0xbefd08[_0x802a15(0x120)]>0x0){console[_0x802a15(0x10c)](),console[_0x802a15(0x10c)](a5_0x17c2f7[_0x802a15(0x134)](_0x802a15(0x12f)));const {projectId:_0x4e5dd2,agentId:_0x21e086}=_0x20e5c3[_0x802a15(0x127)];for(const _0x561a3a of _0xbefd08){console['log'](_0x802a15(0xed)+a5_0x17c2f7[_0x802a15(0x11d)](_0x561a3a[_0x802a15(0x152)]));const _0x204f0a=createCommandSpinner(_0x802a15(0x136)+_0x561a3a[_0x802a15(0x13b)][_0x802a15(0x120)]+_0x802a15(0x112));_0x204f0a[_0x802a15(0xd8)]();try{const {result:_0x387d06}=await runTest(_0x5b614e[_0x802a15(0xe8)],_0x561a3a,{'agentId':_0x21e086,'projectId':_0x4e5dd2,'site':_0x20e5c3[_0x802a15(0x101)],'noEval':![],'evaluatorId':_0xace298,'onRoundStart':(_0x356fb5,_0x21afcb)=>{const _0x544ca9=_0x802a15;_0x204f0a[_0x544ca9(0x110)]=_0x544ca9(0xd2)+(_0x356fb5+0x1)+'/'+_0x21afcb+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0xb8350f,_0x1ed6ae,_0x446034)=>{const _0x36f48d=_0x802a15,_0x1eb033=formatElapsed(_0x1ed6ae);_0x446034?console[_0x36f48d(0x10c)](_0x36f48d(0x149)+(_0xb8350f+0x1)+'/'+_0x561a3a['rounds'][_0x36f48d(0x120)]+_0x36f48d(0x141)+a5_0x17c2f7['green']('✓')+'\x20('+_0x1eb033+')'):console[_0x36f48d(0x10c)](_0x36f48d(0x149)+(_0xb8350f+0x1)+'/'+_0x561a3a[_0x36f48d(0x13b)][_0x36f48d(0x120)]+'...\x20'+a5_0x17c2f7[_0x36f48d(0x10d)]('✗'));},'onEvaluationStart':()=>{const _0x148dc3=_0x802a15;_0x204f0a[_0x148dc3(0x110)]=_0x148dc3(0xd4);},'onEvaluationComplete':_0x1a45b0=>{const _0x14e34a=_0x802a15,_0x583e53=formatElapsed(_0x1a45b0);console['log'](_0x14e34a(0xd3)+a5_0x17c2f7[_0x14e34a(0x100)]('✓')+'\x20('+_0x583e53+')');}});_0x204f0a[_0x802a15(0xff)](),_0x3f096f['push'](_0x387d06);if(_0x387d06[_0x802a15(0x158)]===_0x802a15(0x116))console['log'](a5_0x17c2f7[_0x802a15(0x100)]('✓\x20PASS:\x20'+_0x387d06[_0x802a15(0x142)])+a5_0x17c2f7['dim'](_0x802a15(0xfd)));else _0x387d06[_0x802a15(0x158)]==='FAIL'?console[_0x802a15(0x10c)](a5_0x17c2f7[_0x802a15(0x10d)](_0x802a15(0x151)+_0x387d06[_0x802a15(0x142)])+a5_0x17c2f7[_0x802a15(0x11f)]('\x20(new)')):console['log'](a5_0x17c2f7[_0x802a15(0x10d)]('✗\x20ERROR:\x20'+_0x387d06[_0x802a15(0x142)]));_0x387d06[_0x802a15(0xd6)]&&console['log'](a5_0x17c2f7[_0x802a15(0x11f)](_0x802a15(0x115)+_0x387d06[_0x802a15(0xd6)]));}catch(_0x577f33){_0x204f0a[_0x802a15(0xff)]();const _0x15c070=_0x577f33 instanceof Error?_0x577f33['message']:String(_0x577f33);console[_0x802a15(0x10c)](a5_0x17c2f7[_0x802a15(0x10d)](_0x802a15(0x104)+_0x15c070)),_0x3f096f[_0x802a15(0xd9)]({'name':_0x561a3a[_0x802a15(0x152)],'status':_0x802a15(0x161),'reason':_0x15c070,'timestamp':new Date()[_0x802a15(0x12b)](),'duration_ms':0x0});}}}console[_0x802a15(0x10c)]();const _0x8b105c=Date[_0x802a15(0x118)]()-_0x417839,_0x30516a=_0x3f096f[_0x802a15(0x162)](_0x41b978=>_0x41b978[_0x802a15(0x158)]===_0x802a15(0x116))[_0x802a15(0x120)],_0x42d899=_0x3f096f[_0x802a15(0x162)](_0x541463=>_0x541463[_0x802a15(0x158)]===_0x802a15(0x12a))[_0x802a15(0x120)],_0x15ee91=_0x3f096f[_0x802a15(0x162)](_0x50b267=>_0x50b267[_0x802a15(0x158)]===_0x802a15(0x161))['length'];console[_0x802a15(0x10c)]('━'[_0x802a15(0x157)](0x3c)),console[_0x802a15(0x10c)](_0x802a15(0xdf)),console[_0x802a15(0x10c)]('━'[_0x802a15(0x157)](0x3c)),console[_0x802a15(0x10c)](_0x802a15(0x129)+_0x3f096f[_0x802a15(0x120)]),console['log'](_0x802a15(0x14c)+a5_0x17c2f7[_0x802a15(0x100)](_0x30516a)),console[_0x802a15(0x10c)]('Failed:\x20\x20\x20'+a5_0x17c2f7['red'](_0x42d899));_0x15ee91>0x0&&console[_0x802a15(0x10c)]('Errors:\x20\x20\x20'+a5_0x17c2f7[_0x802a15(0x10d)](_0x15ee91));console[_0x802a15(0x10c)](_0x802a15(0x163)+formatElapsed(_0x8b105c)),console[_0x802a15(0x10c)]('━'['repeat'](0x3c));const _0x1d569f={'summary':{'total':_0x3f096f[_0x802a15(0x120)],'passed':_0x30516a,'failed':_0x42d899,'errors':_0x15ee91>0x0?_0x15ee91:undefined,'duration_ms':_0x8b105c},'tests':_0x3f096f,'agent':{'project':_0x15d38c[_0x802a15(0x154)],'name':_0x15d38c['agentName'],'site':_0x5ae626},'timestamp':new Date(_0x417839)[_0x802a15(0x12b)]()};if(_0x31bef3!==_0x802a15(0x143)||_0x50ee73){const _0x252527=formatResults(_0x1d569f,_0x31bef3);if(_0x50ee73)try{a5_0x2893b0['writeFileSync'](_0x50ee73,_0x252527,'utf-8'),console[_0x802a15(0x10c)](),console[_0x802a15(0x10c)](a5_0x17c2f7[_0x802a15(0x11f)](_0x802a15(0x114)+_0x50ee73));}catch(_0x5ad4fe){return console['log'](),console[_0x802a15(0x10c)](a5_0x17c2f7[_0x802a15(0x10d)](_0x802a15(0x160)+_0x5ad4fe)),0x1;}else console[_0x802a15(0x10c)](),console['log'](_0x252527);}const _0x8ad730=_0x3f096f[_0x802a15(0x162)](_0x84c151=>_0x84c151[_0x802a15(0x158)]!==_0x802a15(0x116));return _0x8ad730[_0x802a15(0x120)]>0x0?0x1:0x0;}}
1
+ const a5_0xfc51c3=a5_0x5cb3;function a5_0x5cb3(_0x496b7f,_0x458eb8){_0x496b7f=_0x496b7f-0x1da;const _0x416bf9=a5_0x416b();let _0x5cb382=_0x416bf9[_0x496b7f];return _0x5cb382;}(function(_0x31fdc6,_0x515ce5){const _0x5f3eb7=a5_0x5cb3,_0x44701e=_0x31fdc6();while(!![]){try{const _0x1a6e6f=parseInt(_0x5f3eb7(0x214))/0x1*(parseInt(_0x5f3eb7(0x26c))/0x2)+parseInt(_0x5f3eb7(0x246))/0x3+parseInt(_0x5f3eb7(0x268))/0x4+-parseInt(_0x5f3eb7(0x228))/0x5*(-parseInt(_0x5f3eb7(0x261))/0x6)+-parseInt(_0x5f3eb7(0x24a))/0x7+parseInt(_0x5f3eb7(0x252))/0x8+-parseInt(_0x5f3eb7(0x23a))/0x9*(parseInt(_0x5f3eb7(0x1e8))/0xa);if(_0x1a6e6f===_0x515ce5)break;else _0x44701e['push'](_0x44701e['shift']());}catch(_0x15bc61){_0x44701e['push'](_0x44701e['shift']());}}}(a5_0x416b,0x25710));import*as a5_0x318812 from'node:fs';import*as a5_0x77a59b from'node:path';import a5_0x1cdcfc from'chalk';function a5_0x416b(){const _0xc08cdb=['projectName','substring','721371bcrONI','✗\x20ERROR:\x20','green','FAIL','\x20\x20Project:\x20','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','\x20(cached)','log','2360464ijiBMG','json','table','PASS','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','reason','white','testName','...\x20','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','Agent:\x20','resolveAgentId','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','tsv','context','72120ZDNYTi','trim','projectDir','\x20\x20Evaluating...\x20','text','writeFileSync','length','332852KzyYTN','Usage:','testYmlPath','name','7826RIcfKU','New\x20tests\x20to\x20execute:\x20','Re-evaluation\x20Summary','toISOString','Failed:\x20\x20\x20','\x20-\x20','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','output','size','Re-evaluating...','conversation_url','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','Tests\x20found:\x20','\x22:\x20','llmProject','10lVDjkQ','\x20\x20Round\x20','jsonl','Running:\x20','agent:test','Evaluating\x20response...','\x27\x20to\x20create\x20the\x20folder\x20structure.','basename',':\x20Sending\x20user\x20input...','source','Error:\x20No\x20previous\x20test\x20run\x20found.','status','reeval','\x20\x20Conversation:\x20','multiple_agents','site','Output\x20written\x20to:\x20','existsSync','dim','no_local_folder','add','yellow','Cached\x20run\x20from:\x20','start','Executing\x20new\x20tests...','Error\x20writing\x20output\x20file:\x20','no_tests','Available\x20tests:\x20','agent','Round\x201/','✗\x20FAIL:\x20','Run\x20tests\x20for\x20an\x20LLM\x20agent','split','repeat','includes','Re-evaluating\x20','/<agent-name>','tags','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','test.yml','Passed:\x20\x20\x20','Total:\x20\x20\x20\x20','\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','agentDirs','49ZAYvBD','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','map','Round\x20','✓\x20PASS:\x20','Project\x20path:\x20','isSpinning','now','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','Run\x20\x27tdx\x20agent\x20pull\x20','agentName','filter','ERROR','no_context','red','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','\x20\x20Agent:\x20','llm','Cached\x20run\x20is\x20from\x20site\x20\x22','Re-evaluating\x20cached\x20test\x20run...','95hXmKVz','forEach','executeReeval','\x20(new)','eval','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','Conversation\x20URL:\x20','join','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','...','dryRun','conversations','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','push','stop','round','not\x20found','7277121EjpaSw','✗\x20ERROR:\x20Project\x20not\x20found:\x20','404','\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)','toLowerCase','message','utf-8','cyan','Failed\x20Tests:','execute','\x22,\x20but\x20current\x20site\x20is\x20\x22','tests','799782TkLdYH','rounds'];a5_0x416b=function(){return _0xc08cdb;};return a5_0x416b();}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_0xfc51c3(0x26b)]=a5_0xfc51c3(0x1ec);['description']=a5_0xfc51c3(0x207);async[a5_0xfc51c3(0x243)](_0x1161e8){const _0x461f6b=a5_0xfc51c3,{options:_0x1223c5,args:_0x374b6e,tdx:_0x2898c7}=_0x1161e8,_0x65a708=_0x374b6e[0x0]||'.',_0x3a08b0=_0x1223c5[_0x461f6b(0x233)],_0x140e81=_0x1223c5,_0x5484fa=_0x140e81[_0x461f6b(0x22c)]===![],_0x4680b1=_0x140e81[_0x461f6b(0x1f4)],_0x19dc1c=_0x140e81['name'],_0x2e66a7=_0x140e81[_0x461f6b(0x20d)],_0x5d2efc=_0x1223c5[_0x461f6b(0x1f7)],_0x5154d2=_0x140e81[_0x461f6b(0x1e0)];if(_0x4680b1&&_0x5484fa)return console[_0x461f6b(0x251)](a5_0x1cdcfc[_0x461f6b(0x222)](_0x461f6b(0x25e))),0x1;let _0x2ad6c0=_0x461f6b(0x254);if(_0x140e81[_0x461f6b(0x253)])_0x2ad6c0=_0x461f6b(0x253);else{if(_0x140e81[_0x461f6b(0x1ea)])_0x2ad6c0=_0x461f6b(0x1ea);else{if(_0x140e81[_0x461f6b(0x25f)])_0x2ad6c0=_0x461f6b(0x25f);else{if(_0x140e81[_0x461f6b(0x254)])_0x2ad6c0='table';}}}const _0x56e1c8=_0x140e81[_0x461f6b(0x1e7)];let _0x2e29f0=_0x65a708;const _0x284fee=a5_0x318812[_0x461f6b(0x1f9)](_0x65a708),_0x565687=_0x65a708==='.';if(!_0x284fee||_0x565687){const _0x3b610f=resolveProjectFromContext(_0x65a708,_0x56e1c8,{'requireFile':_0x461f6b(0x20f)});if(_0x3b610f['found'])_0x2e29f0=_0x3b610f['projectDir'],_0x3b610f[_0x461f6b(0x1f1)]===_0x461f6b(0x260)&&console['log'](a5_0x1cdcfc[_0x461f6b(0x1fa)]('Using\x20agent:\x20'+_0x2e29f0));else switch(_0x3b610f[_0x461f6b(0x257)]){case _0x461f6b(0x221):console[_0x461f6b(0x251)](a5_0x1cdcfc['yellow'](_0x3b610f[_0x461f6b(0x23f)])),console[_0x461f6b(0x251)](),console['log'](_0x461f6b(0x269)),console[_0x461f6b(0x251)](_0x461f6b(0x212)),console[_0x461f6b(0x251)](_0x461f6b(0x23d)),console[_0x461f6b(0x251)](),console[_0x461f6b(0x251)](_0x461f6b(0x21c));return 0x1;case _0x461f6b(0x1fb):console['log'](a5_0x1cdcfc['yellow'](_0x3b610f[_0x461f6b(0x23f)])),console[_0x461f6b(0x251)](),console['log'](_0x461f6b(0x21d)+_0x3b610f[_0x461f6b(0x1e7)]+_0x461f6b(0x1ee));return 0x1;case _0x461f6b(0x1f6):{const _0x115db8=a5_0x77a59b[_0x461f6b(0x1ef)](_0x3b610f[_0x461f6b(0x263)]);console[_0x461f6b(0x251)](a5_0x1cdcfc[_0x461f6b(0x1fd)](_0x461f6b(0x1df)+_0x3b610f[_0x461f6b(0x1e7)]+'\x22:'));for(const _0x475c53 of _0x3b610f[_0x461f6b(0x213)]){console[_0x461f6b(0x251)]('\x20\x20-\x20'+_0x475c53);}return console[_0x461f6b(0x251)](),console[_0x461f6b(0x251)](_0x461f6b(0x223)+_0x115db8+_0x461f6b(0x20c)),0x1;}case _0x461f6b(0x202):console[_0x461f6b(0x251)](a5_0x1cdcfc[_0x461f6b(0x1fd)](_0x461f6b(0x235)+_0x3b610f[_0x461f6b(0x1e7)]+'\x22.')),console['log'](a5_0x1cdcfc[_0x461f6b(0x1fa)](_0x461f6b(0x219)+_0x3b610f[_0x461f6b(0x263)])),console[_0x461f6b(0x251)](),console[_0x461f6b(0x251)]('Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.');return 0x1;}}const {definition:_0x134d89,agentInfo:_0x803de3}=parseTestFile(_0x2e29f0);let _0x1ba0da=_0x134d89['tests'];if(_0x19dc1c){const _0x39d734=_0x19dc1c['split'](',')[_0x461f6b(0x216)](_0x141289=>_0x141289[_0x461f6b(0x262)]());_0x1ba0da=_0x134d89['tests'][_0x461f6b(0x21f)](_0x2d1fa5=>_0x39d734[_0x461f6b(0x20a)](_0x2d1fa5['name']));if(_0x1ba0da['length']===0x0)return console[_0x461f6b(0x251)](a5_0x1cdcfc['yellow']('No\x20tests\x20found\x20matching:\x20'+_0x19dc1c)),console['log'](a5_0x1cdcfc['dim'](_0x461f6b(0x203)+_0x134d89[_0x461f6b(0x245)][_0x461f6b(0x216)](_0x1c7afc=>_0x1c7afc[_0x461f6b(0x26b)])[_0x461f6b(0x22f)](',\x20'))),0x1;}if(_0x2e66a7){const _0x188dd4=_0x2e66a7[_0x461f6b(0x208)](',')[_0x461f6b(0x216)](_0x2bf055=>_0x2bf055[_0x461f6b(0x262)]()[_0x461f6b(0x23e)]());_0x1ba0da=_0x1ba0da['filter'](_0xc64f0d=>_0xc64f0d[_0x461f6b(0x20d)]?.['some'](_0x423384=>_0x188dd4[_0x461f6b(0x20a)](_0x423384['toLowerCase']())));if(_0x1ba0da[_0x461f6b(0x267)]===0x0){console[_0x461f6b(0x251)](a5_0x1cdcfc[_0x461f6b(0x1fd)]('No\x20tests\x20found\x20with\x20tags:\x20'+_0x2e66a7));const _0x30bbb8=new Set();return _0x134d89[_0x461f6b(0x245)][_0x461f6b(0x229)](_0x2ca1b1=>_0x2ca1b1['tags']?.[_0x461f6b(0x229)](_0x5649fb=>_0x30bbb8[_0x461f6b(0x1fc)](_0x5649fb))),_0x30bbb8[_0x461f6b(0x1e1)]>0x0?console[_0x461f6b(0x251)](a5_0x1cdcfc['dim']('Available\x20tags:\x20'+[..._0x30bbb8][_0x461f6b(0x22f)](',\x20'))):console[_0x461f6b(0x251)](a5_0x1cdcfc[_0x461f6b(0x1fa)]('No\x20tests\x20have\x20tags\x20defined.')),0x1;}}if(_0x4680b1)return this[_0x461f6b(0x22a)](_0x1161e8,{'definition':{'tests':_0x1ba0da},'agentInfo':_0x803de3,'outputFormat':_0x2ad6c0,'outputFile':_0x5154d2,'testNames':_0x19dc1c});if(_0x3a08b0){console[_0x461f6b(0x251)](a5_0x1cdcfc[_0x461f6b(0x241)]('Test\x20Configuration:')),console['log']('\x20\x20Site:\x20'+a5_0x1cdcfc['white'](_0x5d2efc)),console[_0x461f6b(0x251)](_0x461f6b(0x24e)+a5_0x1cdcfc[_0x461f6b(0x258)](_0x803de3[_0x461f6b(0x248)])),console['log'](_0x461f6b(0x224)+a5_0x1cdcfc[_0x461f6b(0x258)](_0x803de3[_0x461f6b(0x21e)])),console[_0x461f6b(0x251)](),console['log'](_0x461f6b(0x1e5)+a5_0x1cdcfc[_0x461f6b(0x258)](_0x1ba0da[_0x461f6b(0x267)]));for(let _0x43e728=0x0;_0x43e728<_0x1ba0da[_0x461f6b(0x267)];_0x43e728++){const _0x35b8c9=_0x1ba0da[_0x43e728],_0xa65e7b=_0x35b8c9[_0x461f6b(0x247)]['length']===0x1?_0x461f6b(0x238):_0x461f6b(0x247),_0x4dc5da=_0x35b8c9['tags']?.[_0x461f6b(0x267)]?'\x20['+_0x35b8c9[_0x461f6b(0x20d)]['join'](',\x20')+']':'';console[_0x461f6b(0x251)]('\x20\x20'+(_0x43e728+0x1)+'.\x20'+a5_0x1cdcfc['white'](_0x35b8c9[_0x461f6b(0x26b)])+'\x20('+_0x35b8c9[_0x461f6b(0x247)][_0x461f6b(0x267)]+'\x20'+_0xa65e7b+')'+a5_0x1cdcfc['dim'](_0x4dc5da));}return 0x0;}let _0x5239a7,_0x3e5243;try{_0x5239a7=await _0x2898c7[_0x461f6b(0x225)]['resolveProjectId'](_0x803de3[_0x461f6b(0x248)]);}catch(_0x3aef88){const _0x5b739e=_0x3aef88 instanceof Error?_0x3aef88['message']:String(_0x3aef88);return _0x5b739e[_0x461f6b(0x20a)](_0x461f6b(0x23c))||_0x5b739e['toLowerCase']()[_0x461f6b(0x20a)](_0x461f6b(0x239))?console[_0x461f6b(0x251)](a5_0x1cdcfc['red'](_0x461f6b(0x23b)+_0x803de3[_0x461f6b(0x248)])):console['log'](a5_0x1cdcfc[_0x461f6b(0x222)](_0x461f6b(0x215)+_0x803de3[_0x461f6b(0x248)]+_0x461f6b(0x1e6)+_0x5b739e)),0x1;}try{_0x3e5243=await _0x2898c7[_0x461f6b(0x225)][_0x461f6b(0x25d)](_0x803de3[_0x461f6b(0x21e)],_0x5239a7);}catch(_0x41274c){const _0xd3993b=_0x41274c instanceof Error?_0x41274c[_0x461f6b(0x23f)]:String(_0x41274c);return _0xd3993b[_0x461f6b(0x20a)](_0x461f6b(0x23c))||_0xd3993b[_0x461f6b(0x23e)]()['includes'](_0x461f6b(0x239))?console[_0x461f6b(0x251)](a5_0x1cdcfc[_0x461f6b(0x222)](_0x461f6b(0x24f)+_0x803de3[_0x461f6b(0x21e)])):console['log'](a5_0x1cdcfc[_0x461f6b(0x222)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22'+_0x803de3[_0x461f6b(0x21e)]+_0x461f6b(0x1e6)+_0xd3993b)),0x1;}let _0x5b3339;if(!_0x5484fa)try{_0x5b3339=await setupEvaluatorAgent(_0x2898c7[_0x461f6b(0x225)],_0x1223c5['verbose']);}catch(_0x486e35){const _0x5a369a=_0x486e35 instanceof Error?_0x486e35[_0x461f6b(0x23f)]:String(_0x486e35);return console[_0x461f6b(0x251)](a5_0x1cdcfc[_0x461f6b(0x222)](_0x461f6b(0x20e)+_0x5a369a)),0x1;}console[_0x461f6b(0x251)](a5_0x1cdcfc[_0x461f6b(0x241)]('Running\x20agent\x20tests...')),console[_0x461f6b(0x251)]('Site:\x20'+a5_0x1cdcfc[_0x461f6b(0x258)](_0x5d2efc)),console['log'](_0x461f6b(0x25c)+a5_0x1cdcfc['white'](_0x803de3[_0x461f6b(0x248)]+'/'+_0x803de3[_0x461f6b(0x21e)])),console['log']();const _0x43e843=[],_0x322b78=[],_0x35c88f=Date[_0x461f6b(0x21b)]();for(let _0x238ae7=0x0;_0x238ae7<_0x1ba0da['length'];_0x238ae7++){const _0x5904ac=_0x1ba0da[_0x238ae7];_0x1ba0da[_0x461f6b(0x267)]>0x1?console[_0x461f6b(0x251)]('Test\x20'+(_0x238ae7+0x1)+'/'+_0x1ba0da[_0x461f6b(0x267)]+':\x20'+a5_0x1cdcfc[_0x461f6b(0x258)](_0x5904ac[_0x461f6b(0x26b)])):console[_0x461f6b(0x251)]('Running\x20test:\x20'+a5_0x1cdcfc[_0x461f6b(0x258)](_0x5904ac[_0x461f6b(0x26b)]));const _0x30ece1=createCommandSpinner(_0x461f6b(0x205)+_0x5904ac[_0x461f6b(0x247)]['length']+':\x20Sending\x20user\x20input...');_0x30ece1[_0x461f6b(0x1ff)]();try{const {result:_0x4962c9,conversation:_0x5db45c}=await runTest(_0x2898c7[_0x461f6b(0x225)],_0x5904ac,{'agentId':_0x3e5243,'projectId':_0x5239a7,'site':_0x5d2efc,'noEval':_0x5484fa,'evaluatorId':_0x5b3339,'onRoundStart':(_0x510d90,_0x5defbb)=>{const _0x41591f=_0x461f6b;_0x30ece1['text']=_0x41591f(0x217)+(_0x510d90+0x1)+'/'+_0x5defbb+_0x41591f(0x1f0);},'onRoundComplete':(_0x26702e,_0xff4f48,_0x10a93d)=>{const _0x17bbfa=_0x461f6b,_0x1afdf0=formatElapsed(_0xff4f48);_0x10a93d?console[_0x17bbfa(0x251)](_0x17bbfa(0x1e9)+(_0x26702e+0x1)+'/'+_0x5904ac[_0x17bbfa(0x247)][_0x17bbfa(0x267)]+'...\x20'+a5_0x1cdcfc[_0x17bbfa(0x24c)]('✓')+'\x20('+_0x1afdf0+')'):console['log'](_0x17bbfa(0x1e9)+(_0x26702e+0x1)+'/'+_0x5904ac[_0x17bbfa(0x247)][_0x17bbfa(0x267)]+_0x17bbfa(0x25a)+a5_0x1cdcfc['red']('✗'));},'onEvaluationStart':()=>{const _0x449d19=_0x461f6b;_0x30ece1[_0x449d19(0x265)]=_0x449d19(0x1ed);},'onEvaluationComplete':_0x4a3833=>{const _0x8bde59=_0x461f6b,_0x5f4c46=formatElapsed(_0x4a3833);console['log']('\x20\x20Evaluating...\x20'+a5_0x1cdcfc[_0x8bde59(0x24c)]('✓')+'\x20('+_0x5f4c46+')');}});_0x30ece1['stop'](),_0x43e843['push'](_0x4962c9),_0x322b78['push'](_0x5db45c);if(_0x4962c9[_0x461f6b(0x1f3)]==='PASS')console[_0x461f6b(0x251)](a5_0x1cdcfc[_0x461f6b(0x24c)]('✓\x20PASS:\x20'+_0x4962c9[_0x461f6b(0x257)]));else _0x4962c9[_0x461f6b(0x1f3)]===_0x461f6b(0x24d)?console[_0x461f6b(0x251)](a5_0x1cdcfc[_0x461f6b(0x222)]('✗\x20FAIL:\x20'+_0x4962c9['reason'])):console[_0x461f6b(0x251)](a5_0x1cdcfc[_0x461f6b(0x222)](_0x461f6b(0x24b)+_0x4962c9[_0x461f6b(0x257)]));_0x4962c9[_0x461f6b(0x1e3)]&&console[_0x461f6b(0x251)](a5_0x1cdcfc['dim'](_0x461f6b(0x22e)+_0x4962c9[_0x461f6b(0x1e3)])),console[_0x461f6b(0x251)]();}catch(_0x1f3349){_0x30ece1[_0x461f6b(0x237)]();const _0x17ad77=_0x1f3349 instanceof Error?_0x1f3349[_0x461f6b(0x23f)]:String(_0x1f3349);console[_0x461f6b(0x251)](a5_0x1cdcfc['red'](_0x461f6b(0x24b)+_0x17ad77)),console[_0x461f6b(0x251)](),_0x43e843['push']({'name':_0x5904ac[_0x461f6b(0x26b)],'status':'ERROR','reason':_0x17ad77,'timestamp':new Date()[_0x461f6b(0x1dc)](),'duration_ms':0x0});}}const _0x4116c2=Date['now']()-_0x35c88f,_0x474bce=_0x43e843[_0x461f6b(0x21f)](_0x26a78d=>_0x26a78d[_0x461f6b(0x1f3)]===_0x461f6b(0x255))[_0x461f6b(0x267)],_0x285069=_0x43e843[_0x461f6b(0x21f)](_0x4c7372=>_0x4c7372['status']===_0x461f6b(0x24d))['length'],_0x337c28=_0x43e843[_0x461f6b(0x21f)](_0x88504f=>_0x88504f['status']===_0x461f6b(0x220))[_0x461f6b(0x267)];console['log']('━'[_0x461f6b(0x209)](0x3c)),console[_0x461f6b(0x251)]('Test\x20Summary'),console[_0x461f6b(0x251)]('━'['repeat'](0x3c)),console['log'](_0x461f6b(0x211)+_0x43e843[_0x461f6b(0x267)]),console[_0x461f6b(0x251)](_0x461f6b(0x210)+a5_0x1cdcfc[_0x461f6b(0x24c)](_0x474bce)),console[_0x461f6b(0x251)](_0x461f6b(0x1dd)+a5_0x1cdcfc[_0x461f6b(0x222)](_0x285069));_0x337c28>0x0&&console[_0x461f6b(0x251)]('Errors:\x20\x20\x20'+a5_0x1cdcfc['red'](_0x337c28));console['log']('Duration:\x20'+formatElapsed(_0x4116c2)),console['log']('━'[_0x461f6b(0x209)](0x3c));const _0x33b67c=_0x43e843[_0x461f6b(0x21f)](_0x49f3a4=>_0x49f3a4['status']!==_0x461f6b(0x255));if(_0x33b67c[_0x461f6b(0x267)]>0x0){console[_0x461f6b(0x251)](),console[_0x461f6b(0x251)](_0x461f6b(0x242));for(const _0xca1db5 of _0x33b67c){const _0xdcd272=a5_0x1cdcfc[_0x461f6b(0x222)]('✗'),_0x35e8fc=_0xca1db5[_0x461f6b(0x257)][_0x461f6b(0x267)]>0x32?_0xca1db5[_0x461f6b(0x257)][_0x461f6b(0x249)](0x0,0x32)+'...':_0xca1db5[_0x461f6b(0x257)];console[_0x461f6b(0x251)]('\x20\x20'+_0xdcd272+'\x20'+_0xca1db5[_0x461f6b(0x26b)]+':\x20'+_0x35e8fc);}}const _0x300cd1={'summary':{'total':_0x43e843[_0x461f6b(0x267)],'passed':_0x474bce,'failed':_0x285069,'errors':_0x337c28>0x0?_0x337c28:undefined,'duration_ms':_0x4116c2},'tests':_0x43e843,'agent':{'project':_0x803de3[_0x461f6b(0x248)],'name':_0x803de3[_0x461f6b(0x21e)],'site':_0x5d2efc},'timestamp':new Date(_0x35c88f)['toISOString']()};try{const _0x4141eb=buildCachedTestRun(_0x322b78,{'site':_0x5d2efc,'projectId':_0x5239a7,'projectName':_0x803de3[_0x461f6b(0x248)],'agentId':_0x3e5243,'agentName':_0x803de3[_0x461f6b(0x21e)],'testYmlPath':a5_0x77a59b['resolve'](_0x803de3[_0x461f6b(0x26a)])});saveLastTestRun(_0x4141eb);}catch{}if(_0x2ad6c0!=='table'||_0x5154d2){const _0x4f1ed0=formatResults(_0x300cd1,_0x2ad6c0);if(_0x5154d2)try{a5_0x318812[_0x461f6b(0x266)](_0x5154d2,_0x4f1ed0,_0x461f6b(0x240)),console['log'](),console['log'](a5_0x1cdcfc[_0x461f6b(0x1fa)](_0x461f6b(0x1f8)+_0x5154d2));}catch(_0x160602){return console[_0x461f6b(0x251)](),console[_0x461f6b(0x251)](a5_0x1cdcfc['red']('Error\x20writing\x20output\x20file:\x20'+_0x160602)),0x1;}else console[_0x461f6b(0x251)](),console['log'](_0x4f1ed0);}return _0x33b67c[_0x461f6b(0x267)]>0x0?0x1:0x0;}async[a5_0xfc51c3(0x22a)](_0x2a97cd,_0x31e21e){const _0x3ae425=a5_0xfc51c3,{options:_0xad058a,tdx:_0x32edf2}=_0x2a97cd,{definition:_0x1a3b59,agentInfo:_0x4a6bcc,outputFormat:_0x3b8799,outputFile:_0x31e72c}=_0x31e21e,_0x2aeb24=_0xad058a['site'],_0x383376=loadLastTestRun();if(!_0x383376)return console['log'](a5_0x1cdcfc['red'](_0x3ae425(0x1f2))),console[_0x3ae425(0x251)](a5_0x1cdcfc[_0x3ae425(0x1fa)](_0x3ae425(0x231))),0x1;if(_0x383376['agent']['agentName']!==_0x4a6bcc[_0x3ae425(0x21e)])return console['log'](a5_0x1cdcfc[_0x3ae425(0x222)]('Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22'+_0x383376[_0x3ae425(0x204)][_0x3ae425(0x21e)]+_0x3ae425(0x256)+_0x4a6bcc[_0x3ae425(0x21e)]+'\x22.')),console[_0x3ae425(0x251)](a5_0x1cdcfc['dim'](_0x3ae425(0x22d))),0x1;const _0x4d0237=new Set(_0x383376[_0x3ae425(0x234)][_0x3ae425(0x216)](_0xc1a29=>_0xc1a29[_0x3ae425(0x259)])),_0x37f710=_0x1a3b59[_0x3ae425(0x245)][_0x3ae425(0x21f)](_0x5268df=>!_0x4d0237['has'](_0x5268df[_0x3ae425(0x26b)]));if(_0x37f710[_0x3ae425(0x267)]>0x0&&_0x383376[_0x3ae425(0x1f7)]!==_0x2aeb24)return console['log'](a5_0x1cdcfc['red'](_0x3ae425(0x1e4))),console[_0x3ae425(0x251)](a5_0x1cdcfc[_0x3ae425(0x1fa)](_0x3ae425(0x226)+_0x383376['site']+_0x3ae425(0x244)+_0x2aeb24+'\x22.')),console['log'](a5_0x1cdcfc[_0x3ae425(0x1fa)]('Either\x20switch\x20to\x20the\x20\x22'+_0x383376[_0x3ae425(0x1f7)]+_0x3ae425(0x25b))),0x1;const _0x34fbd5=_0x1a3b59[_0x3ae425(0x245)]['filter'](_0x1fd808=>_0x4d0237['has'](_0x1fd808[_0x3ae425(0x26b)])),_0x2d344f=_0x37f710;let _0x3ed8a8;try{_0x3ed8a8=await setupEvaluatorAgent(_0x32edf2[_0x3ae425(0x225)],_0xad058a['verbose']);}catch(_0x30fa3b){const _0x5f37e2=_0x30fa3b instanceof Error?_0x30fa3b[_0x3ae425(0x23f)]:String(_0x30fa3b);return console['log'](a5_0x1cdcfc[_0x3ae425(0x222)](_0x3ae425(0x20e)+_0x5f37e2)),0x1;}console[_0x3ae425(0x251)](a5_0x1cdcfc[_0x3ae425(0x241)](_0x3ae425(0x227))),console[_0x3ae425(0x251)](_0x3ae425(0x1fe)+a5_0x1cdcfc['white'](_0x383376['timestamp'])),console[_0x3ae425(0x251)](_0x3ae425(0x25c)+a5_0x1cdcfc[_0x3ae425(0x258)](_0x383376[_0x3ae425(0x204)]['projectName']+'/'+_0x383376['agent'][_0x3ae425(0x21e)]));_0x2d344f[_0x3ae425(0x267)]>0x0&&console[_0x3ae425(0x251)](_0x3ae425(0x1da)+a5_0x1cdcfc['yellow'](_0x2d344f[_0x3ae425(0x267)]));console[_0x3ae425(0x251)]();const _0x178da9=[],_0x42cd9b=Date['now'](),_0x41bfe5=createCommandSpinner(_0x3ae425(0x1e2));if(_0x34fbd5['length']>0x0)try{const _0xce77a=await reevaluateFromCache(_0x32edf2['llm'],_0x383376,{'tests':_0x34fbd5},{'evaluatorId':_0x3ed8a8,'onTestStart':(_0x24fc19,_0xbf65ad,_0xfc770d)=>{const _0x92b474=_0x3ae425;_0x41bfe5['text']=_0x92b474(0x20b)+(_0xbf65ad+0x1)+'/'+_0xfc770d+':\x20'+_0x24fc19+_0x92b474(0x232);if(!_0x41bfe5[_0x92b474(0x21a)])_0x41bfe5[_0x92b474(0x1ff)]();},'onTestComplete':(_0x16a558,_0x599137)=>{const _0x4b3964=_0x3ae425;_0x41bfe5[_0x4b3964(0x237)]();if(_0x599137['status']===_0x4b3964(0x255))console[_0x4b3964(0x251)](a5_0x1cdcfc['green'](_0x4b3964(0x218)+_0x16a558)+a5_0x1cdcfc['dim'](_0x4b3964(0x250)));else _0x599137[_0x4b3964(0x1f3)]===_0x4b3964(0x24d)?console['log'](a5_0x1cdcfc[_0x4b3964(0x222)](_0x4b3964(0x206)+_0x16a558+_0x4b3964(0x1de)+_0x599137[_0x4b3964(0x257)])+a5_0x1cdcfc[_0x4b3964(0x1fa)]('\x20(cached)')):console[_0x4b3964(0x251)](a5_0x1cdcfc[_0x4b3964(0x222)](_0x4b3964(0x24b)+_0x16a558+_0x4b3964(0x1de)+_0x599137[_0x4b3964(0x257)]));_0x599137[_0x4b3964(0x1e3)]&&console[_0x4b3964(0x251)](a5_0x1cdcfc[_0x4b3964(0x1fa)](_0x4b3964(0x1f5)+_0x599137['conversation_url'])),_0x178da9[_0x4b3964(0x236)](_0x599137);},'onTestSkipped':(_0x3d3966,_0x9aec07)=>{const _0x37c277=_0x3ae425;_0x41bfe5['stop'](),console['log'](a5_0x1cdcfc[_0x37c277(0x1fd)]('⚠\x20SKIPPED:\x20'+_0x3d3966+_0x37c277(0x1de)+_0x9aec07));}});for(const _0x7aa217 of _0xce77a){!_0x178da9['find'](_0x247727=>_0x247727[_0x3ae425(0x26b)]===_0x7aa217['name'])&&_0x178da9[_0x3ae425(0x236)](_0x7aa217);}}catch(_0x577d92){_0x41bfe5[_0x3ae425(0x237)]();const _0x205e9f=_0x577d92 instanceof Error?_0x577d92['message']:String(_0x577d92);return console[_0x3ae425(0x251)](a5_0x1cdcfc['red'](_0x3ae425(0x230)+_0x205e9f)),0x1;}_0x41bfe5[_0x3ae425(0x237)]();if(_0x2d344f[_0x3ae425(0x267)]>0x0){console[_0x3ae425(0x251)](),console[_0x3ae425(0x251)](a5_0x1cdcfc[_0x3ae425(0x241)](_0x3ae425(0x200)));const {projectId:_0x3278f4,agentId:_0xd56cca}=_0x383376[_0x3ae425(0x204)];for(const _0x4546aa of _0x2d344f){console[_0x3ae425(0x251)](_0x3ae425(0x1eb)+a5_0x1cdcfc[_0x3ae425(0x258)](_0x4546aa[_0x3ae425(0x26b)]));const _0x531ad8=createCommandSpinner('Round\x201/'+_0x4546aa[_0x3ae425(0x247)][_0x3ae425(0x267)]+_0x3ae425(0x1f0));_0x531ad8['start']();try{const {result:_0x5e8eef}=await runTest(_0x32edf2['llm'],_0x4546aa,{'agentId':_0xd56cca,'projectId':_0x3278f4,'site':_0x383376[_0x3ae425(0x1f7)],'noEval':![],'evaluatorId':_0x3ed8a8,'onRoundStart':(_0x43b575,_0x3e0c71)=>{const _0x252ece=_0x3ae425;_0x531ad8[_0x252ece(0x265)]=_0x252ece(0x217)+(_0x43b575+0x1)+'/'+_0x3e0c71+_0x252ece(0x1f0);},'onRoundComplete':(_0x446484,_0x33a7ea,_0x47c6ae)=>{const _0x1998fe=_0x3ae425,_0x2c36af=formatElapsed(_0x33a7ea);_0x47c6ae?console[_0x1998fe(0x251)](_0x1998fe(0x1e9)+(_0x446484+0x1)+'/'+_0x4546aa[_0x1998fe(0x247)][_0x1998fe(0x267)]+_0x1998fe(0x25a)+a5_0x1cdcfc[_0x1998fe(0x24c)]('✓')+'\x20('+_0x2c36af+')'):console[_0x1998fe(0x251)](_0x1998fe(0x1e9)+(_0x446484+0x1)+'/'+_0x4546aa['rounds'][_0x1998fe(0x267)]+_0x1998fe(0x25a)+a5_0x1cdcfc[_0x1998fe(0x222)]('✗'));},'onEvaluationStart':()=>{const _0x805827=_0x3ae425;_0x531ad8['text']=_0x805827(0x1ed);},'onEvaluationComplete':_0x4e35bf=>{const _0xc9f48c=_0x3ae425,_0x5d9401=formatElapsed(_0x4e35bf);console[_0xc9f48c(0x251)](_0xc9f48c(0x264)+a5_0x1cdcfc[_0xc9f48c(0x24c)]('✓')+'\x20('+_0x5d9401+')');}});_0x531ad8[_0x3ae425(0x237)](),_0x178da9[_0x3ae425(0x236)](_0x5e8eef);if(_0x5e8eef['status']===_0x3ae425(0x255))console[_0x3ae425(0x251)](a5_0x1cdcfc[_0x3ae425(0x24c)](_0x3ae425(0x218)+_0x5e8eef['reason'])+a5_0x1cdcfc['dim'](_0x3ae425(0x22b)));else _0x5e8eef[_0x3ae425(0x1f3)]==='FAIL'?console[_0x3ae425(0x251)](a5_0x1cdcfc[_0x3ae425(0x222)](_0x3ae425(0x206)+_0x5e8eef[_0x3ae425(0x257)])+a5_0x1cdcfc[_0x3ae425(0x1fa)]('\x20(new)')):console[_0x3ae425(0x251)](a5_0x1cdcfc['red'](_0x3ae425(0x24b)+_0x5e8eef[_0x3ae425(0x257)]));_0x5e8eef['conversation_url']&&console[_0x3ae425(0x251)](a5_0x1cdcfc['dim']('\x20\x20Conversation:\x20'+_0x5e8eef[_0x3ae425(0x1e3)]));}catch(_0x2e60ac){_0x531ad8[_0x3ae425(0x237)]();const _0x432bbe=_0x2e60ac instanceof Error?_0x2e60ac[_0x3ae425(0x23f)]:String(_0x2e60ac);console['log'](a5_0x1cdcfc[_0x3ae425(0x222)](_0x3ae425(0x24b)+_0x432bbe)),_0x178da9[_0x3ae425(0x236)]({'name':_0x4546aa[_0x3ae425(0x26b)],'status':_0x3ae425(0x220),'reason':_0x432bbe,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}}console[_0x3ae425(0x251)]();const _0xa0aa9c=Date[_0x3ae425(0x21b)]()-_0x42cd9b,_0x57cc8c=_0x178da9[_0x3ae425(0x21f)](_0x2d85f5=>_0x2d85f5[_0x3ae425(0x1f3)]===_0x3ae425(0x255))[_0x3ae425(0x267)],_0x20c4e2=_0x178da9[_0x3ae425(0x21f)](_0x481b85=>_0x481b85[_0x3ae425(0x1f3)]===_0x3ae425(0x24d))[_0x3ae425(0x267)],_0x5dfc80=_0x178da9[_0x3ae425(0x21f)](_0x43a5e3=>_0x43a5e3['status']===_0x3ae425(0x220))[_0x3ae425(0x267)];console['log']('━'['repeat'](0x3c)),console[_0x3ae425(0x251)](_0x3ae425(0x1db)),console[_0x3ae425(0x251)]('━'[_0x3ae425(0x209)](0x3c)),console[_0x3ae425(0x251)](_0x3ae425(0x211)+_0x178da9[_0x3ae425(0x267)]),console[_0x3ae425(0x251)](_0x3ae425(0x210)+a5_0x1cdcfc[_0x3ae425(0x24c)](_0x57cc8c)),console[_0x3ae425(0x251)]('Failed:\x20\x20\x20'+a5_0x1cdcfc[_0x3ae425(0x222)](_0x20c4e2));_0x5dfc80>0x0&&console[_0x3ae425(0x251)]('Errors:\x20\x20\x20'+a5_0x1cdcfc[_0x3ae425(0x222)](_0x5dfc80));console[_0x3ae425(0x251)]('Duration:\x20'+formatElapsed(_0xa0aa9c)),console['log']('━'['repeat'](0x3c));const _0x528d62={'summary':{'total':_0x178da9['length'],'passed':_0x57cc8c,'failed':_0x20c4e2,'errors':_0x5dfc80>0x0?_0x5dfc80:undefined,'duration_ms':_0xa0aa9c},'tests':_0x178da9,'agent':{'project':_0x4a6bcc[_0x3ae425(0x248)],'name':_0x4a6bcc[_0x3ae425(0x21e)],'site':_0x2aeb24},'timestamp':new Date(_0x42cd9b)['toISOString']()};if(_0x3b8799!==_0x3ae425(0x254)||_0x31e72c){const _0x4e5826=formatResults(_0x528d62,_0x3b8799);if(_0x31e72c)try{a5_0x318812[_0x3ae425(0x266)](_0x31e72c,_0x4e5826,_0x3ae425(0x240)),console[_0x3ae425(0x251)](),console[_0x3ae425(0x251)](a5_0x1cdcfc[_0x3ae425(0x1fa)](_0x3ae425(0x1f8)+_0x31e72c));}catch(_0x212035){return console[_0x3ae425(0x251)](),console['log'](a5_0x1cdcfc['red'](_0x3ae425(0x201)+_0x212035)),0x1;}else console['log'](),console[_0x3ae425(0x251)](_0x4e5826);}const _0x268075=_0x178da9[_0x3ae425(0x21f)](_0x3cb75f=>_0x3cb75f['status']!==_0x3ae425(0x255));return _0x268075[_0x3ae425(0x267)]>0x0?0x1:0x0;}}
@@ -1 +1 @@
1
- const a6_0x14b3ae=a6_0x2120;(function(_0x470d77,_0x254855){const _0x123328=a6_0x2120,_0x298797=_0x470d77();while(!![]){try{const _0x1a0ecd=-parseInt(_0x123328(0x125))/0x1*(-parseInt(_0x123328(0x148))/0x2)+-parseInt(_0x123328(0x127))/0x3+-parseInt(_0x123328(0x154))/0x4*(-parseInt(_0x123328(0x163))/0x5)+-parseInt(_0x123328(0x15a))/0x6*(-parseInt(_0x123328(0x13d))/0x7)+parseInt(_0x123328(0x14f))/0x8*(-parseInt(_0x123328(0x155))/0x9)+-parseInt(_0x123328(0x158))/0xa*(parseInt(_0x123328(0x149))/0xb)+parseInt(_0x123328(0x132))/0xc;if(_0x1a0ecd===_0x254855)break;else _0x298797['push'](_0x298797['shift']());}catch(_0x14fcff){_0x298797['push'](_0x298797['shift']());}}}(a6_0x116a,0x2a647));import{BaseCommand}from'./command.js';function a6_0x2120(_0x2da84d,_0x1c9bb5){_0x2da84d=_0x2da84d-0x125;const _0x116a56=a6_0x116a();let _0x21203d=_0x116a56[_0x2da84d];return _0x21203d;}import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';function a6_0x116a(){const _0x22e4c8=['77KaMYmp','headers','Invalid\x20API\x20type:\x20','.\x20Valid\x20methods:\x20','Invalid\x20header\x20format:\x20\x22','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','startsWith','readBodyFromFile','.\x20Valid\x20types:\x20','isArray','stack','4tyXgsm','2785574NtXpNx','set-cookie2','verbose','trim','keys','Results\x20saved\x20to\x20','2120uyGXuQ','length','method','file','color','3448ZNzDuE','8199PxDKtD','has','DELETE','10huqgJE','llm','148026cwufwL','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','cookie','\x0aStack\x20trace:\x0a','data','output','error','noColor','x-xsrf-token','15fBGyZr','description','PUT','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','header','91687nVpDDz','message','192456CwkkmX','GET','status','name','site','log','x-auth-token','toLowerCase','execute','PATCH','substring','3301188XYsyEq','set-cookie','request','<\x20HTTP/1.1\x20','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','toUpperCase','api','Error:\x20','type','join','entries'];a6_0x116a=function(){return _0x22e4c8;};return a6_0x116a();}import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set(['authorization','proxy-authorization',a6_0x14b3ae(0x15c),a6_0x14b3ae(0x133),a6_0x14b3ae(0x14a),a6_0x14b3ae(0x162),a6_0x14b3ae(0x12d),'x-trino-user']);function isSensitiveHeader(_0x2f2ba2){const _0x15028a=a6_0x14b3ae;return SENSITIVE_HEADERS[_0x15028a(0x156)](_0x2f2ba2[_0x15028a(0x12e)]());}function parseHeader(_0x5aeebd){const _0x58ba91=a6_0x14b3ae,_0x34f436=_0x5aeebd['indexOf'](':');if(_0x34f436===-0x1)throw new Error(_0x58ba91(0x141)+_0x5aeebd+'\x22.\x20'+_0x58ba91(0x142));const _0x1fa068=_0x5aeebd['substring'](0x0,_0x34f436)[_0x58ba91(0x14c)](),_0x29bc66=_0x5aeebd[_0x58ba91(0x131)](_0x34f436+0x1)['trim']();if(!_0x1fa068)throw new Error(_0x58ba91(0x15b)+_0x5aeebd+'\x22');return[_0x1fa068,_0x29bc66];}export class ApiCommand extends BaseCommand{[a6_0x14b3ae(0x12a)]=a6_0x14b3ae(0x138);[a6_0x14b3ae(0x164)]=a6_0x14b3ae(0x166);['validate'](_0x5a21e0){const _0x3a7588=a6_0x14b3ae,{args:_0x54aa58,options:_0x25dcde}=_0x5a21e0,_0xde9c84=_0x25dcde;if(_0x54aa58[_0x3a7588(0x150)]===0x0)return'Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list';const _0x243078=_0x54aa58[0x0];if(!_0x243078[_0x3a7588(0x143)]('/'))return'Endpoint\x20must\x20start\x20with\x20/:\x20'+_0x243078;const _0x475bab=_0xde9c84[_0x3a7588(0x15e)],_0x495bdd=_0xde9c84['file'];if(_0x475bab&&_0x495bdd)return _0x3a7588(0x136);const _0x35fff1=_0xde9c84[_0x3a7588(0x151)]||'GET',_0x351bb6=['GET','POST',_0x3a7588(0x165),_0x3a7588(0x157),_0x3a7588(0x130)];if(!_0x351bb6['includes'](_0x35fff1[_0x3a7588(0x137)]()))return'Invalid\x20HTTP\x20method:\x20'+_0x35fff1+_0x3a7588(0x140)+_0x351bb6[_0x3a7588(0x13b)](',\x20');const _0x8f5c48=_0xde9c84[_0x3a7588(0x13a)]||'td',_0x28d0be=['td','cdp','workflow','trino',_0x3a7588(0x159),'llm-proxy'];if(!_0x28d0be['includes'](_0x8f5c48))return _0x3a7588(0x13f)+_0x8f5c48+_0x3a7588(0x145)+_0x28d0be[_0x3a7588(0x13b)](',\x20');return undefined;}async[a6_0x14b3ae(0x12f)](_0x2a9ffe){const _0x48b78d=a6_0x14b3ae,{options:_0x58e5b8,args:_0x4156cd,tdx:_0x4551bf}=_0x2a9ffe,_0x479d03=_0x58e5b8,_0x23e9b1=_0x4156cd[0x0],_0x131bcc=(_0x479d03[_0x48b78d(0x151)]||_0x48b78d(0x128))[_0x48b78d(0x137)](),_0x2d74d0=_0x479d03[_0x48b78d(0x15e)],_0x35e3bb=_0x479d03[_0x48b78d(0x152)],_0x28e58c=_0x479d03[_0x48b78d(0x167)],_0x5b2cd2=_0x479d03[_0x48b78d(0x13a)]||'td';try{const _0x5c10e2={};if(_0x28e58c){const _0x288721=Array[_0x48b78d(0x146)](_0x28e58c)?_0x28e58c:[_0x28e58c];for(const _0x46a18f of _0x288721){const [_0x1274b4,_0x69b8d9]=parseHeader(_0x46a18f);_0x5c10e2[_0x1274b4]=_0x69b8d9;}}let _0x233a95;if(_0x2d74d0)_0x233a95=_0x2d74d0;else{if(_0x35e3bb)try{_0x233a95=RawAPI[_0x48b78d(0x144)](_0x35e3bb);}catch(_0x12abd9){return console['error'](_0x48b78d(0x139)+(_0x12abd9 instanceof Error?_0x12abd9[_0x48b78d(0x126)]:String(_0x12abd9))),0x1;}}const _0x6ec213={'method':_0x131bcc,'apiType':_0x5b2cd2,'includeHeaders':_0x58e5b8[_0x48b78d(0x14b)]};_0x233a95&&(_0x6ec213['body']=_0x233a95);Object[_0x48b78d(0x14d)](_0x5c10e2)[_0x48b78d(0x150)]>0x0&&(_0x6ec213[_0x48b78d(0x13e)]=_0x5c10e2);if(_0x58e5b8[_0x48b78d(0x14b)]){const _0x5f4f64=resolveSite(_0x58e5b8[_0x48b78d(0x12b)]),_0x8a834b=getEndpoint(_0x5f4f64,_0x5b2cd2),_0x5584f6=''+_0x8a834b+_0x23e9b1;console[_0x48b78d(0x160)]('>\x20'+_0x131bcc+'\x20'+_0x5584f6);const _0x35f2d8=getAuthHeaders(_0x5f4f64),_0xbe238b={..._0x35f2d8,..._0x5c10e2};for(const [_0x8aad14,_0x4a039c]of Object[_0x48b78d(0x13c)](_0xbe238b)){!isSensitiveHeader(_0x8aad14)&&console['error']('>\x20'+_0x8aad14+':\x20'+_0x4a039c);}_0x233a95&&console[_0x48b78d(0x160)]('>'),console[_0x48b78d(0x160)]('');}const _0x1505c8=await _0x4551bf['api'][_0x48b78d(0x134)](_0x23e9b1,_0x6ec213);if(_0x58e5b8[_0x48b78d(0x14b)]&&_0x1505c8[_0x48b78d(0x13e)]){console[_0x48b78d(0x160)](_0x48b78d(0x135)+_0x1505c8[_0x48b78d(0x129)]);for(const [_0x144019,_0x565e8d]of Object[_0x48b78d(0x13c)](_0x1505c8[_0x48b78d(0x13e)])){!isSensitiveHeader(_0x144019)&&console[_0x48b78d(0x160)]('<\x20'+_0x144019+':\x20'+_0x565e8d);}console[_0x48b78d(0x160)]('');}const _0x2ad15b=Boolean(_0x58e5b8[_0x48b78d(0x15f)]),_0x3bf65c={'color':_0x58e5b8[_0x48b78d(0x153)],'noColor':_0x58e5b8[_0x48b78d(0x161)]||_0x2ad15b&&!_0x58e5b8[_0x48b78d(0x153)]},_0x563395=colorizeJSON(_0x1505c8['data'],_0x3bf65c);return _0x58e5b8[_0x48b78d(0x15f)]?(writeFileSync(_0x58e5b8[_0x48b78d(0x15f)],_0x563395),console['error'](_0x48b78d(0x14e)+_0x58e5b8[_0x48b78d(0x15f)])):console[_0x48b78d(0x12c)](_0x563395),0x0;}catch(_0x19ed06){return _0x19ed06 instanceof Error?(console[_0x48b78d(0x160)](_0x48b78d(0x139)+_0x19ed06[_0x48b78d(0x126)]),_0x58e5b8[_0x48b78d(0x14b)]&&_0x19ed06['stack']&&console[_0x48b78d(0x160)](_0x48b78d(0x15d)+_0x19ed06[_0x48b78d(0x147)])):console[_0x48b78d(0x160)](_0x48b78d(0x139)+String(_0x19ed06)),0x1;}}}
1
+ const a6_0x24b2bd=a6_0x209a;(function(_0x3f19c6,_0x218260){const _0x40e54d=a6_0x209a,_0x21dcfc=_0x3f19c6();while(!![]){try{const _0x1809e9=parseInt(_0x40e54d(0x1e1))/0x1*(-parseInt(_0x40e54d(0x1d1))/0x2)+parseInt(_0x40e54d(0x1f5))/0x3*(-parseInt(_0x40e54d(0x1e5))/0x4)+parseInt(_0x40e54d(0x1dc))/0x5+parseInt(_0x40e54d(0x1d3))/0x6+-parseInt(_0x40e54d(0x1d5))/0x7+parseInt(_0x40e54d(0x209))/0x8+-parseInt(_0x40e54d(0x20d))/0x9*(-parseInt(_0x40e54d(0x1ee))/0xa);if(_0x1809e9===_0x218260)break;else _0x21dcfc['push'](_0x21dcfc['shift']());}catch(_0x2fe554){_0x21dcfc['push'](_0x21dcfc['shift']());}}}(a6_0x1690,0x2223e));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';function a6_0x209a(_0x78f948,_0x2d0322){_0x78f948=_0x78f948-0x1c9;const _0x1690d7=a6_0x1690();let _0x209a28=_0x1690d7[_0x78f948];return _0x209a28;}import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set(['authorization','proxy-authorization',a6_0x24b2bd(0x20e),a6_0x24b2bd(0x1ff),'set-cookie2',a6_0x24b2bd(0x1dd),a6_0x24b2bd(0x1f0),a6_0x24b2bd(0x204)]);function isSensitiveHeader(_0x263783){const _0x5c993d=a6_0x24b2bd;return SENSITIVE_HEADERS['has'](_0x263783[_0x5c993d(0x1cd)]());}function parseHeader(_0x30ce88){const _0x3b269e=a6_0x24b2bd,_0xdf9186=_0x30ce88[_0x3b269e(0x1f3)](':');if(_0xdf9186===-0x1)throw new Error('Invalid\x20header\x20format:\x20\x22'+_0x30ce88+_0x3b269e(0x1fc)+_0x3b269e(0x1d6));const _0x167467=_0x30ce88['substring'](0x0,_0xdf9186)[_0x3b269e(0x1e9)](),_0x1f3c83=_0x30ce88[_0x3b269e(0x1d7)](_0xdf9186+0x1)[_0x3b269e(0x1e9)]();if(!_0x167467)throw new Error(_0x3b269e(0x1da)+_0x30ce88+'\x22');return[_0x167467,_0x1f3c83];}function a6_0x1690(){const _0x451bce=['x-trino-user','llm','cdp','includes','color','1845008OzJXGD','isArray','PATCH','Invalid\x20API\x20type:\x20','469998MTIFlL','cookie','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','description','header','workflow','validate','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','toLowerCase','message','DELETE','error','2ncFydH','file','985350QwiSgG','startsWith','1578528RGUAyt','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','substring','.\x20Valid\x20methods:\x20','GET','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','443580zrJLjE','x-xsrf-token','stack','join','data','21627xNaYJN','method','body','\x0aStack\x20trace:\x0a','560Ppalpn','length','Invalid\x20HTTP\x20method:\x20','log','trim','verbose','name','headers','entries','10UTRYVr','readBodyFromFile','x-auth-token','trino','Error:\x20','indexOf','keys','3189NjqriH','Endpoint\x20must\x20start\x20with\x20/:\x20','POST','request','type','site','api','\x22.\x20','output','.\x20Valid\x20types:\x20','set-cookie','execute','status','PUT','toUpperCase'];a6_0x1690=function(){return _0x451bce;};return a6_0x1690();}export class ApiCommand extends BaseCommand{[a6_0x24b2bd(0x1eb)]=a6_0x24b2bd(0x1fb);[a6_0x24b2bd(0x210)]=a6_0x24b2bd(0x1cc);[a6_0x24b2bd(0x1cb)](_0x436fe5){const _0x3af69a=a6_0x24b2bd,{args:_0x278d2b,options:_0x32c48f}=_0x436fe5,_0x490461=_0x32c48f;if(_0x278d2b[_0x3af69a(0x1e6)]===0x0)return _0x3af69a(0x1db);const _0x1fcfa4=_0x278d2b[0x0];if(!_0x1fcfa4[_0x3af69a(0x1d4)]('/'))return _0x3af69a(0x1f6)+_0x1fcfa4;const _0x3d136d=_0x490461[_0x3af69a(0x1e0)],_0x24be6c=_0x490461['file'];if(_0x3d136d&&_0x24be6c)return _0x3af69a(0x20f);const _0x24df71=_0x490461[_0x3af69a(0x1e2)]||_0x3af69a(0x1d9),_0x549604=['GET',_0x3af69a(0x1f7),_0x3af69a(0x202),_0x3af69a(0x1cf),_0x3af69a(0x20b)];if(!_0x549604[_0x3af69a(0x207)](_0x24df71[_0x3af69a(0x203)]()))return _0x3af69a(0x1e7)+_0x24df71+_0x3af69a(0x1d8)+_0x549604[_0x3af69a(0x1df)](',\x20');const _0x240f3f=_0x490461[_0x3af69a(0x1f9)]||'td',_0x5f0625=['td',_0x3af69a(0x206),_0x3af69a(0x1ca),_0x3af69a(0x1f1),_0x3af69a(0x205),'llm-proxy'];if(!_0x5f0625[_0x3af69a(0x207)](_0x240f3f))return _0x3af69a(0x20c)+_0x240f3f+_0x3af69a(0x1fe)+_0x5f0625[_0x3af69a(0x1df)](',\x20');return undefined;}async[a6_0x24b2bd(0x200)](_0x41c28d){const _0x5255e3=a6_0x24b2bd,{options:_0x342c79,args:_0x39901d,tdx:_0x36148b}=_0x41c28d,_0x1104f5=_0x342c79,_0x1f98b1=_0x39901d[0x0],_0x58ff64=(_0x1104f5[_0x5255e3(0x1e2)]||_0x5255e3(0x1d9))['toUpperCase'](),_0x1ddf85=_0x1104f5[_0x5255e3(0x1e0)],_0x102e16=_0x1104f5[_0x5255e3(0x1d2)],_0x4e8274=_0x1104f5[_0x5255e3(0x1c9)],_0x338357=_0x1104f5[_0x5255e3(0x1f9)]||'td';try{const _0x213cf2={};if(_0x4e8274){const _0x4fe59c=Array[_0x5255e3(0x20a)](_0x4e8274)?_0x4e8274:[_0x4e8274];for(const _0x5c43d6 of _0x4fe59c){const [_0x506036,_0x12be6b]=parseHeader(_0x5c43d6);_0x213cf2[_0x506036]=_0x12be6b;}}let _0x80d232;if(_0x1ddf85)_0x80d232=_0x1ddf85;else{if(_0x102e16)try{_0x80d232=RawAPI[_0x5255e3(0x1ef)](_0x102e16);}catch(_0x40447c){return console[_0x5255e3(0x1d0)](_0x5255e3(0x1f2)+(_0x40447c instanceof Error?_0x40447c[_0x5255e3(0x1ce)]:String(_0x40447c))),0x1;}}const _0x44fa52={'method':_0x58ff64,'apiType':_0x338357,'includeHeaders':_0x342c79[_0x5255e3(0x1ea)]};_0x80d232&&(_0x44fa52[_0x5255e3(0x1e3)]=_0x80d232);Object[_0x5255e3(0x1f4)](_0x213cf2)[_0x5255e3(0x1e6)]>0x0&&(_0x44fa52[_0x5255e3(0x1ec)]=_0x213cf2);if(_0x342c79['verbose']){const _0x42539d=resolveSite(_0x342c79[_0x5255e3(0x1fa)]),_0x18e6bd=getEndpoint(_0x42539d,_0x338357),_0x451132=''+_0x18e6bd+_0x1f98b1;console[_0x5255e3(0x1d0)]('>\x20'+_0x58ff64+'\x20'+_0x451132);const _0x28085a=getAuthHeaders(_0x42539d),_0x4cd120={..._0x28085a,..._0x213cf2};for(const [_0x7c5263,_0x4059aa]of Object[_0x5255e3(0x1ed)](_0x4cd120)){!isSensitiveHeader(_0x7c5263)&&console[_0x5255e3(0x1d0)]('>\x20'+_0x7c5263+':\x20'+_0x4059aa);}_0x80d232&&console[_0x5255e3(0x1d0)]('>'),console[_0x5255e3(0x1d0)]('');}const _0x3306be=await _0x36148b['api'][_0x5255e3(0x1f8)](_0x1f98b1,_0x44fa52);if(_0x342c79[_0x5255e3(0x1ea)]&&_0x3306be[_0x5255e3(0x1ec)]){console[_0x5255e3(0x1d0)]('<\x20HTTP/1.1\x20'+_0x3306be[_0x5255e3(0x201)]);for(const [_0xaf9114,_0x5d00ca]of Object[_0x5255e3(0x1ed)](_0x3306be[_0x5255e3(0x1ec)])){!isSensitiveHeader(_0xaf9114)&&console['error']('<\x20'+_0xaf9114+':\x20'+_0x5d00ca);}console[_0x5255e3(0x1d0)]('');}const _0x4181e9=Boolean(_0x342c79[_0x5255e3(0x1fd)]),_0x229123={'color':_0x342c79[_0x5255e3(0x208)],'noColor':_0x342c79['noColor']||_0x4181e9&&!_0x342c79[_0x5255e3(0x208)]},_0x18eb65=colorizeJSON(_0x3306be[_0x5255e3(0x1e0)],_0x229123);return _0x342c79['output']?(writeFileSync(_0x342c79[_0x5255e3(0x1fd)],_0x18eb65),console[_0x5255e3(0x1d0)]('Results\x20saved\x20to\x20'+_0x342c79[_0x5255e3(0x1fd)])):console[_0x5255e3(0x1e8)](_0x18eb65),0x0;}catch(_0x10044a){return _0x10044a instanceof Error?(console[_0x5255e3(0x1d0)](_0x5255e3(0x1f2)+_0x10044a[_0x5255e3(0x1ce)]),_0x342c79['verbose']&&_0x10044a[_0x5255e3(0x1de)]&&console['error'](_0x5255e3(0x1e4)+_0x10044a[_0x5255e3(0x1de)])):console[_0x5255e3(0x1d0)](_0x5255e3(0x1f2)+String(_0x10044a)),0x1;}}}
@@ -1 +1 @@
1
- const a7_0x31d674=a7_0x45ed;(function(_0x541d74,_0x3ca421){const _0x8a59bf=a7_0x45ed,_0x3e585a=_0x541d74();while(!![]){try{const _0x49daf1=parseInt(_0x8a59bf(0x1dd))/0x1+parseInt(_0x8a59bf(0x1b7))/0x2*(parseInt(_0x8a59bf(0x1ac))/0x3)+-parseInt(_0x8a59bf(0x1e2))/0x4*(parseInt(_0x8a59bf(0x1b8))/0x5)+parseInt(_0x8a59bf(0x1be))/0x6+parseInt(_0x8a59bf(0x1b1))/0x7+-parseInt(_0x8a59bf(0x1c8))/0x8*(-parseInt(_0x8a59bf(0x1d5))/0x9)+-parseInt(_0x8a59bf(0x1bc))/0xa*(parseInt(_0x8a59bf(0x1a8))/0xb);if(_0x49daf1===_0x3ca421)break;else _0x3e585a['push'](_0x3e585a['shift']());}catch(_0x50523e){_0x3e585a['push'](_0x3e585a['shift']());}}}(a7_0x4a58,0x4f901));function a7_0x4a58(){const _0x3fc6a1=['Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','getUserInfo','email','message','✓\x20Profile\x20\x27','tdx:\x20auth\x20clear','Setup\x20API\x20key\x20authentication\x20interactively','112rdVzPe','✗\x20Validation\x20failed:\x20','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','test','status','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','Select\x20your\x20Treasure\x20Data\x20site:','auth:clear','ERROR','description','/app/mp/ak','trim','select','26172cejFOK','✓\x20Default\x20site\x20set\x20to\x20','✓\x20API\x20key\x20removed\x20from\x20keychain','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','No\x20credential\x20found','first_name','apiKey','name','646673UHolvY','API\x20key\x20cannot\x20be\x20empty','Read\x20credential\x20from\x20','logLevel','last_name','9132zMXxQR','create','Site\x20name\x20cannot\x20be\x20empty','\x20(site:\x20','Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20','\x0aSetup\x20cancelled','error','site','jobs','filter','Validating\x20API\x20key...','bold','tdx\x20profile:\x20','Enter\x20site\x20name:','You\x20can\x20find\x20your\x20API\x20key\x20at:','\x20(profile:\x20','execute','User:\x20','\x27\x20registered','N/A','11394042NIYROU','join','No\x20API\x20key\x20found\x20in\x20keychain','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','40497chMPFh','auth','log','us01','customSite','3560676eymWqf','\x20\x20tdx','password','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','red','Name:\x20','30CUyvna','305QeeExa','yellow','green','profile','10iEzCCc','auth:setup','614616fMqfWC','\x20--profile\x20','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'];a7_0x4a58=function(){return _0x3fc6a1;};return a7_0x4a58();}import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';function a7_0x45ed(_0x2ac5e8,_0x22d4eb){_0x2ac5e8=_0x2ac5e8-0x197;const _0x4a5816=a7_0x4a58();let _0x45ede9=_0x4a5816[_0x2ac5e8];return _0x45ede9;}import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';import{buildSiteChoices}from'../core/constants.js';import a7_0x58efa7 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_0x30355b from'chalk';export class AuthSetupCommand extends BaseCommand{[a7_0x31d674(0x1dc)]=a7_0x31d674(0x1bd);[a7_0x31d674(0x1d1)]=a7_0x31d674(0x1c7);async[a7_0x31d674(0x1a4)](_0x3f5db4){const _0x20a50a=a7_0x31d674,{options:_0x3fe8ef}=_0x3f5db4,_0x1cec4d=_0x3fe8ef[_0x20a50a(0x1bb)];console[_0x20a50a(0x1ae)](a7_0x30355b[_0x20a50a(0x19f)]('tdx:\x20auth\x20setup'));const _0x80b6a5=_0x3fe8ef[_0x20a50a(0x19b)]||_0x20a50a(0x1af),{choices:_0x682ad8,initialIndex:_0xf3a47c}=buildSiteChoices(_0x80b6a5),_0x10f894=_0x1cec4d?_0x20a50a(0x198)+_0x1cec4d+'):':_0x20a50a(0x1ce),_0x556eb9=await a7_0x58efa7({'type':_0x20a50a(0x1d4),'name':_0x20a50a(0x19b),'message':_0x10f894,'choices':_0x682ad8,'initial':_0xf3a47c});if(!_0x556eb9[_0x20a50a(0x19b)])return console['log'](_0x20a50a(0x199)),0x1;let _0x5a1427;if(_0x556eb9[_0x20a50a(0x19b)]==='other'){const _0x16b80c=await a7_0x58efa7({'type':'text','name':_0x20a50a(0x1b0),'message':_0x20a50a(0x1a1),'initial':_0x20a50a(0x1af),'validate':_0xd5356f=>{const _0x8f8b24=_0x20a50a;if(!_0xd5356f||!_0xd5356f[_0x8f8b24(0x1d3)]())return _0x8f8b24(0x1e4);if(!/^[a-z0-9-]+$/[_0x8f8b24(0x1cb)](_0xd5356f['trim']()))return _0x8f8b24(0x1c1);return!![];}});if(!_0x16b80c[_0x20a50a(0x1b0)])return console[_0x20a50a(0x1ae)](_0x20a50a(0x199)),0x1;_0x5a1427=_0x16b80c[_0x20a50a(0x1b0)];}else _0x5a1427=_0x556eb9['site'];const _0x1fe505=resolveSite(_0x5a1427);console[_0x20a50a(0x1ae)]('Setting\x20up\x20authentication\x20for\x20site:\x20'+_0x1fe505),console[_0x20a50a(0x1ae)](_0x20a50a(0x1a2)),console[_0x20a50a(0x1ae)]('\x20\x20'+getConsoleUrl(_0x1fe505,_0x20a50a(0x1d2)));const _0xb50290=await a7_0x58efa7({'type':_0x20a50a(0x1b3),'name':_0x20a50a(0x1db),'message':'Enter\x20your\x20TD\x20API\x20key:','validate':_0x18a322=>{const _0x4f0510=_0x20a50a;if(!_0x18a322||!_0x18a322[_0x4f0510(0x1d3)]())return _0x4f0510(0x1de);return!![];}});if(!_0xb50290['apiKey'])return console['log']('\x0aSetup\x20cancelled'),0x1;const _0x251c45=_0xb50290['apiKey'];console['log'](_0x20a50a(0x19e));try{const _0x69055e=TDX[_0x20a50a(0x1e3)]({'site':_0x1fe505,'apiKey':_0x251c45[_0x20a50a(0x1d3)](),'logLevel':_0x3fe8ef[_0x20a50a(0x1e0)]??LogLevel[_0x20a50a(0x1d0)]}),_0x56a416=await _0x69055e[_0x20a50a(0x19c)][_0x20a50a(0x1c2)]();console[_0x20a50a(0x1ae)](_0x20a50a(0x1d8)+_0x56a416[_0x20a50a(0x1c3)]+')');const _0x4fdca8=await isKeychainAvailable();_0x4fdca8?(await saveAPIKeyAsync(_0x251c45['trim'](),_0x1fe505,_0x1cec4d),console[_0x20a50a(0x1ae)]('✓\x20API\x20key\x20saved\x20to\x20system\x20keychain'+(_0x1cec4d?_0x20a50a(0x1a3)+_0x1cec4d+')':''))):(console['warn'](a7_0x30355b['yellow'](_0x20a50a(0x1ca))),console['warn'](a7_0x30355b[_0x20a50a(0x1b9)]('\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.')));if(_0x1cec4d){const _0x28c14e={'site':_0x1fe505};saveProfileToUserConfig(_0x1cec4d,_0x28c14e),console['log'](_0x20a50a(0x1c5)+_0x1cec4d+_0x20a50a(0x1a6));}else saveDefaultSiteToUserConfig(_0x1fe505),console[_0x20a50a(0x1ae)](_0x20a50a(0x1d6)+_0x1fe505);const _0x3fb933=_0x1cec4d?_0x20a50a(0x1bf)+_0x1cec4d:'';return console['log'](),console[_0x20a50a(0x1ae)](_0x20a50a(0x1cd)),console[_0x20a50a(0x1ae)](_0x20a50a(0x1b2)+_0x3fb933+_0x20a50a(0x1c0)),console[_0x20a50a(0x1ae)](_0x20a50a(0x1b2)+_0x3fb933+_0x20a50a(0x1b4)),0x0;}catch(_0xb7308d){if(_0xb7308d instanceof HTTPClientError&&_0xb7308d[_0x20a50a(0x1cc)]===0x191)return printAuthError(_0xb7308d),0x1;return console[_0x20a50a(0x19a)](a7_0x30355b[_0x20a50a(0x1b5)](_0x20a50a(0x1c9)+(_0xb7308d instanceof Error?_0xb7308d[_0x20a50a(0x1c4)]:String(_0xb7308d)))),console[_0x20a50a(0x19a)](_0x20a50a(0x1ab)),0x1;}}}export class AuthStatusCommand extends BaseCommand{['name']=a7_0x31d674(0x1ad);[a7_0x31d674(0x1d1)]='Show\x20authentication\x20status\x20and\x20validate\x20API\x20key';async[a7_0x31d674(0x1a4)](_0x49b84e){const _0xee1d57=a7_0x31d674,{options:_0x783cc0,tdx:_0x36b8b8}=_0x49b84e,_0x275006=_0x783cc0['site'],_0x960d24=_0x783cc0[_0xee1d57(0x1bb)],_0x4fd94a=_0x960d24?_0x960d24:_0xee1d57(0x1a7);console[_0xee1d57(0x1ae)](_0xee1d57(0x1a0)+_0x4fd94a+_0xee1d57(0x197)+_0x275006+')');const _0x490fa4=await resolveAPIKeyAsync(_0x275006,_0x960d24);if(_0x490fa4){const {source:_0x3d1059,isDeprecated:_0x307184}=_0x490fa4,_0x6f64d0=_0xee1d57(0x1df)+_0x3d1059;console[_0xee1d57(0x1ae)](_0x307184?a7_0x30355b[_0xee1d57(0x1b9)](_0x6f64d0):_0x6f64d0);}else console[_0xee1d57(0x1ae)](a7_0x30355b[_0xee1d57(0x1b9)](_0xee1d57(0x1d9)));try{const _0x15ec10=await _0x36b8b8[_0xee1d57(0x19c)][_0xee1d57(0x1c2)]();return console['log'](a7_0x30355b[_0xee1d57(0x1ba)]('✓\x20Authentication\x20successful\x0a')),console[_0xee1d57(0x1ae)](_0xee1d57(0x1a5)+_0x15ec10['email']),(_0x15ec10[_0xee1d57(0x1da)]||_0x15ec10[_0xee1d57(0x1e1)])&&console[_0xee1d57(0x1ae)](_0xee1d57(0x1b6)+[_0x15ec10['first_name'],_0x15ec10[_0xee1d57(0x1e1)]][_0xee1d57(0x19d)](Boolean)[_0xee1d57(0x1a9)]('\x20')),0x0;}catch(_0x347417){return _0x347417 instanceof HTTPClientError&&_0x347417[_0xee1d57(0x1cc)]===0x191?printAuthError(_0x347417,!![],_0x960d24):console[_0xee1d57(0x19a)](a7_0x30355b[_0xee1d57(0x1b5)](_0xee1d57(0x1c9)+(_0x347417 instanceof Error?_0x347417['message']:String(_0x347417)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x31d674(0x1dc)]=a7_0x31d674(0x1cf);['description']='Remove\x20API\x20key\x20from\x20system\x20keychain';async[a7_0x31d674(0x1a4)](_0x1707a4){const _0x22a694=a7_0x31d674,{options:_0x1f0866}=_0x1707a4,_0x42908f=_0x1f0866[_0x22a694(0x1bb)];console[_0x22a694(0x1ae)](a7_0x30355b[_0x22a694(0x19f)](_0x22a694(0x1c6)));const _0x1a488d=await isKeychainAvailable();if(!_0x1a488d)return console['error'](a7_0x30355b[_0x22a694(0x1b5)]('System\x20keychain\x20is\x20not\x20available')),0x1;const _0x5a4569=await deleteKeychainAPIKey(_0x42908f);return _0x5a4569?(clearCredentialCache(),console[_0x22a694(0x1ae)](_0x22a694(0x1d7)+(_0x42908f?_0x22a694(0x1a3)+_0x42908f+')':'')),0x0):(console['log'](_0x22a694(0x1aa)+(_0x42908f?'\x20for\x20profile:\x20'+_0x42908f:'')),0x1);}}
1
+ const a7_0x533bce=a7_0x4512;(function(_0x2abe04,_0x41c05a){const _0xf1dc47=a7_0x4512,_0x5e5f11=_0x2abe04();while(!![]){try{const _0x58f520=parseInt(_0xf1dc47(0x221))/0x1+parseInt(_0xf1dc47(0x20d))/0x2*(-parseInt(_0xf1dc47(0x200))/0x3)+-parseInt(_0xf1dc47(0x1f9))/0x4+parseInt(_0xf1dc47(0x226))/0x5+-parseInt(_0xf1dc47(0x21b))/0x6+-parseInt(_0xf1dc47(0x1f8))/0x7+parseInt(_0xf1dc47(0x1ef))/0x8*(parseInt(_0xf1dc47(0x201))/0x9);if(_0x58f520===_0x41c05a)break;else _0x5e5f11['push'](_0x5e5f11['shift']());}catch(_0x4dd51b){_0x5e5f11['push'](_0x5e5f11['shift']());}}}(a7_0x37d9,0xaebbc));function a7_0x4512(_0x2c3510,_0x40391f){_0x2c3510=_0x2c3510-0x1e7;const _0x37d97f=a7_0x37d9();let _0x45124f=_0x37d97f[_0x2c3510];return _0x45124f;}import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';import{buildSiteChoices}from'../core/constants.js';import a7_0x1108af 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_0x25ca08 from'chalk';export class AuthSetupCommand extends BaseCommand{[a7_0x533bce(0x204)]=a7_0x533bce(0x1f4);[a7_0x533bce(0x1f3)]=a7_0x533bce(0x20f);async[a7_0x533bce(0x219)](_0x17115c){const _0x5d1b1b=a7_0x533bce,{options:_0x35576d}=_0x17115c,_0x5568d4=_0x35576d[_0x5d1b1b(0x218)];console[_0x5d1b1b(0x1ea)](a7_0x25ca08[_0x5d1b1b(0x1fd)]('tdx:\x20auth\x20setup'));const _0x277624=_0x35576d[_0x5d1b1b(0x1e9)]||'us01',{choices:_0x53945e,initialIndex:_0x5b00e8}=buildSiteChoices(_0x277624),_0x2ffc4d=_0x5568d4?'Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20'+_0x5568d4+'):':_0x5d1b1b(0x1fa),_0x2c2807=await a7_0x1108af({'type':'select','name':'site','message':_0x2ffc4d,'choices':_0x53945e,'initial':_0x5b00e8});if(!_0x2c2807[_0x5d1b1b(0x1e9)])return console['log']('\x0aSetup\x20cancelled'),0x1;let _0x11b11a;if(_0x2c2807[_0x5d1b1b(0x1e9)]===_0x5d1b1b(0x1f6)){const _0x540f41=await a7_0x1108af({'type':_0x5d1b1b(0x21e),'name':'customSite','message':_0x5d1b1b(0x21d),'initial':_0x5d1b1b(0x22b),'validate':_0x5d8af6=>{const _0x3cfb3d=_0x5d1b1b;if(!_0x5d8af6||!_0x5d8af6[_0x3cfb3d(0x21a)]())return _0x3cfb3d(0x215);if(!/^[a-z0-9-]+$/[_0x3cfb3d(0x1eb)](_0x5d8af6['trim']()))return _0x3cfb3d(0x1ed);return!![];}});if(!_0x540f41[_0x5d1b1b(0x211)])return console[_0x5d1b1b(0x1ea)]('\x0aSetup\x20cancelled'),0x1;_0x11b11a=_0x540f41[_0x5d1b1b(0x211)];}else _0x11b11a=_0x2c2807[_0x5d1b1b(0x1e9)];const _0x370781=resolveSite(_0x11b11a);console[_0x5d1b1b(0x1ea)](_0x5d1b1b(0x205)+_0x370781),console[_0x5d1b1b(0x1ea)](_0x5d1b1b(0x229)),console['log']('\x20\x20'+getConsoleUrl(_0x370781,'/app/mp/ak'));const _0x5825f8=await a7_0x1108af({'type':'password','name':_0x5d1b1b(0x224),'message':_0x5d1b1b(0x222),'validate':_0x337511=>{if(!_0x337511||!_0x337511['trim']())return'API\x20key\x20cannot\x20be\x20empty';return!![];}});if(!_0x5825f8[_0x5d1b1b(0x224)])return console[_0x5d1b1b(0x1ea)](_0x5d1b1b(0x212)),0x1;const _0x4c4df0=_0x5825f8[_0x5d1b1b(0x224)];console[_0x5d1b1b(0x1ea)]('Validating\x20API\x20key...');try{const _0x1ebb60=TDX['create']({'site':_0x370781,'apiKey':_0x4c4df0[_0x5d1b1b(0x21a)](),'logLevel':_0x35576d[_0x5d1b1b(0x203)]??LogLevel[_0x5d1b1b(0x213)]}),_0x421798=await _0x1ebb60['jobs'][_0x5d1b1b(0x20b)]();console[_0x5d1b1b(0x1ea)](_0x5d1b1b(0x223)+_0x421798[_0x5d1b1b(0x207)]+')');const _0x1b0177=await isKeychainAvailable();_0x1b0177?(await saveAPIKeyAsync(_0x4c4df0[_0x5d1b1b(0x21a)](),_0x370781,_0x5568d4),console[_0x5d1b1b(0x1ea)]('✓\x20API\x20key\x20saved\x20to\x20system\x20keychain'+(_0x5568d4?'\x20(profile:\x20'+_0x5568d4+')':''))):(console[_0x5d1b1b(0x22a)](a7_0x25ca08[_0x5d1b1b(0x216)]('⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.')),console[_0x5d1b1b(0x22a)](a7_0x25ca08['yellow'](_0x5d1b1b(0x220))));if(_0x5568d4){const _0x770b46={'site':_0x370781};saveProfileToUserConfig(_0x5568d4,_0x770b46),console['log'](_0x5d1b1b(0x21f)+_0x5568d4+_0x5d1b1b(0x20e));}else saveDefaultSiteToUserConfig(_0x370781),console[_0x5d1b1b(0x1ea)]('✓\x20Default\x20site\x20set\x20to\x20'+_0x370781);const _0x4b43af=_0x5568d4?_0x5d1b1b(0x1f7)+_0x5568d4:'';return console['log'](),console[_0x5d1b1b(0x1ea)](_0x5d1b1b(0x225)),console[_0x5d1b1b(0x1ea)]('\x20\x20tdx'+_0x4b43af+_0x5d1b1b(0x1fb)),console[_0x5d1b1b(0x1ea)](_0x5d1b1b(0x1e8)+_0x4b43af+_0x5d1b1b(0x1f1)),0x0;}catch(_0x18efce){if(_0x18efce instanceof HTTPClientError&&_0x18efce[_0x5d1b1b(0x206)]===0x191)return printAuthError(_0x18efce),0x1;return console[_0x5d1b1b(0x21c)](a7_0x25ca08[_0x5d1b1b(0x1f2)](_0x5d1b1b(0x20c)+(_0x18efce instanceof Error?_0x18efce[_0x5d1b1b(0x227)]:String(_0x18efce)))),console[_0x5d1b1b(0x21c)]('API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.'),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x533bce(0x204)]=a7_0x533bce(0x1fc);[a7_0x533bce(0x1f3)]='Show\x20authentication\x20status\x20and\x20validate\x20API\x20key';async['execute'](_0x166cbf){const _0x56a10c=a7_0x533bce,{options:_0x446bbe,tdx:_0x334133}=_0x166cbf,_0x2dec42=_0x446bbe[_0x56a10c(0x1e9)],_0x187ac8=_0x446bbe['profile'],_0x4b3c1d=_0x187ac8?_0x187ac8:'N/A';console['log'](_0x56a10c(0x1e7)+_0x4b3c1d+_0x56a10c(0x202)+_0x2dec42+')');const _0x1729cf=await resolveAPIKeyAsync(_0x2dec42,_0x187ac8);if(_0x1729cf){const {source:_0x1ca0a5,isDeprecated:_0x4d72cd}=_0x1729cf,_0x431635='Read\x20credential\x20from\x20'+_0x1ca0a5;console[_0x56a10c(0x1ea)](_0x4d72cd?a7_0x25ca08[_0x56a10c(0x216)](_0x431635):_0x431635);}else console[_0x56a10c(0x1ea)](a7_0x25ca08[_0x56a10c(0x216)](_0x56a10c(0x1f0)));try{const _0x5d1b49=await _0x334133[_0x56a10c(0x209)]['getUserInfo']();return console['log'](a7_0x25ca08['green'](_0x56a10c(0x1ee))),console[_0x56a10c(0x1ea)](_0x56a10c(0x208)+_0x5d1b49[_0x56a10c(0x207)]),(_0x5d1b49['first_name']||_0x5d1b49['last_name'])&&console[_0x56a10c(0x1ea)]('Name:\x20'+[_0x5d1b49[_0x56a10c(0x1fe)],_0x5d1b49[_0x56a10c(0x1f5)]]['filter'](Boolean)[_0x56a10c(0x1ff)]('\x20')),0x0;}catch(_0x1c69a7){return _0x1c69a7 instanceof HTTPClientError&&_0x1c69a7[_0x56a10c(0x206)]===0x191?printAuthError(_0x1c69a7,!![],_0x187ac8):console[_0x56a10c(0x21c)](a7_0x25ca08[_0x56a10c(0x1f2)](_0x56a10c(0x20c)+(_0x1c69a7 instanceof Error?_0x1c69a7[_0x56a10c(0x227)]:String(_0x1c69a7)))),0x1;}}}function a7_0x37d9(){const _0x1af95e=['Site\x20name\x20cannot\x20be\x20empty','yellow','tdx:\x20auth\x20clear','profile','execute','trim','5749398RmaDpk','error','Enter\x20site\x20name:','text','✓\x20Profile\x20\x27','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','1356264QnYAum','Enter\x20your\x20TD\x20API\x20key:','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','apiKey','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','1082175tJoCMT','message','\x20for\x20profile:\x20','You\x20can\x20find\x20your\x20API\x20key\x20at:','warn','us01','tdx\x20profile:\x20','\x20\x20tdx','site','log','test','\x20(profile:\x20','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','✓\x20Authentication\x20successful\x0a','7496fYOund','No\x20credential\x20found','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','red','description','auth:setup','last_name','other','\x20--profile\x20','8194858HtaLPw','4959156izmnLw','Select\x20your\x20Treasure\x20Data\x20site:','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','auth','bold','first_name','join','1209288bbdDXH','31869PEONBH','\x20(site:\x20','logLevel','name','Setting\x20up\x20authentication\x20for\x20site:\x20','status','email','User:\x20','jobs','✓\x20API\x20key\x20removed\x20from\x20keychain','getUserInfo','✗\x20Validation\x20failed:\x20','4KSlILo','\x27\x20registered','Setup\x20API\x20key\x20authentication\x20interactively','System\x20keychain\x20is\x20not\x20available','customSite','\x0aSetup\x20cancelled','ERROR','No\x20API\x20key\x20found\x20in\x20keychain'];a7_0x37d9=function(){return _0x1af95e;};return a7_0x37d9();}export class AuthClearCommand extends BaseCommand{[a7_0x533bce(0x204)]='auth:clear';['description']='Remove\x20API\x20key\x20from\x20system\x20keychain';async[a7_0x533bce(0x219)](_0x58f980){const _0x3d6474=a7_0x533bce,{options:_0x21e841}=_0x58f980,_0x856e7c=_0x21e841['profile'];console['log'](a7_0x25ca08['bold'](_0x3d6474(0x217)));const _0x7fc551=await isKeychainAvailable();if(!_0x7fc551)return console[_0x3d6474(0x21c)](a7_0x25ca08[_0x3d6474(0x1f2)](_0x3d6474(0x210))),0x1;const _0x1ed321=await deleteKeychainAPIKey(_0x856e7c);return _0x1ed321?(clearCredentialCache(),console['log'](_0x3d6474(0x20a)+(_0x856e7c?_0x3d6474(0x1ec)+_0x856e7c+')':'')),0x0):(console[_0x3d6474(0x1ea)](_0x3d6474(0x214)+(_0x856e7c?_0x3d6474(0x228)+_0x856e7c:'')),0x1);}}
@@ -1 +1 @@
1
- function a8_0x5d97(){const _0x2d80c3=['10026LTZCSV','string','includes','54710PzmcJn','description','Using\x20cached\x20default\x20agent:\x20','1760Ffmqxi','context','73xeBvBo','metadata','Getting\x20default\x20agent...','chatId','Resolving\x20agent\x20\x27','\x27\x20not\x20found','error','targetFunction','2194584dDrSeG','Continuing\x20chat:\x20','Resolving\x20project\x20\x27','args','Error:\x20Chat\x20session\x20\x27','stream','stringify','handleChatEvent','resolveProjectId','310Hgktgk','slice','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22','llmAgent','streamChat','log','chat','targetKnowledgeBase','5039064UwjeHW','agentId','tool_call','content','llm','Using\x20agent\x20from\x20','tool','new','288gpVngS','name','chat-create','Chat\x20session:\x20','\x20\x20Cause:\x20','\x0aStack\x20trace:','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','1053866YAROBI','projectId','options','data','type','targetWebSearchTool','startChat','targetAgent','agent','404','claude-4.5-haiku','message','cause','validate','functionName','write','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','join','done','stack','1988sChHbE','resolveAgentId','verbose','event','llmProject','--agent\x20flag','streamChatJsonl','session\x20context','1767792jRrjVM'];a8_0x5d97=function(){return _0x2d80c3;};return a8_0x5d97();}const a8_0x437b92=a8_0x10a7;(function(_0x31f34b,_0x46ab22){const _0x222494=a8_0x10a7,_0x32ee79=_0x31f34b();while(!![]){try{const _0x3f95b4=-parseInt(_0x222494(0xb5))/0x1*(parseInt(_0x222494(0xad))/0x2)+-parseInt(_0x222494(0xbd))/0x3+-parseInt(_0x222494(0xac))/0x4+-parseInt(_0x222494(0xb0))/0x5*(parseInt(_0x222494(0x89))/0x6)+parseInt(_0x222494(0xa4))/0x7*(parseInt(_0x222494(0xb3))/0x8)+-parseInt(_0x222494(0xcf))/0x9+-parseInt(_0x222494(0xc6))/0xa*(-parseInt(_0x222494(0x90))/0xb);if(_0x3f95b4===_0x46ab22)break;else _0x32ee79['push'](_0x32ee79['shift']());}catch(_0x4d2ad0){_0x32ee79['push'](_0x32ee79['shift']());}}}(a8_0x5d97,0x63979));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 a8_0x10a7(_0x45c153,_0x47aeba){_0x45c153=_0x45c153-0x86;const _0x5d9736=a8_0x5d97();let _0x10a7a3=_0x5d9736[_0x45c153];return _0x10a7a3;}import{saveLastChatId,loadLastChatId}from'../sdk/llm/chat-cache.js';import{getLLMConversationUrl}from'../sdk/client/endpoints.js';function handleSDKError(_0x35983d,_0x17fb7c){const _0x54bcf7=a8_0x10a7;if(_0x35983d instanceof SDKError)console[_0x54bcf7(0xbb)]('Error:\x20'+_0x35983d['message']),_0x17fb7c[_0x54bcf7(0xa6)]&&(_0x35983d[_0x54bcf7(0x9c)]&&console['error'](_0x54bcf7(0x8d)+_0x35983d[_0x54bcf7(0x9c)]),_0x35983d[_0x54bcf7(0xa3)]&&(console[_0x54bcf7(0xbb)](_0x54bcf7(0x8e)),console[_0x54bcf7(0xbb)](_0x35983d[_0x54bcf7(0xa3)])));else throw _0x35983d;}async function resolveAgentId(_0x4a4bb1,_0x31a758,_0x18cb4b,_0x28d819,_0x35b355){const _0x215984=a8_0x10a7,_0x422862=_0x31a758||_0x18cb4b;if(_0x422862){const {projectName:_0x2c42f1,agentName:_0x3e672e}=parseAgentRef(_0x422862),_0x3378b5=_0x3e672e||_0x422862,_0x3a8d84=_0x3e672e?_0x2c42f1:_0x28d819;if(!_0x3a8d84)throw new Error('No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22');if(_0x35b355){const _0x32c7d7=_0x31a758?_0x215984(0xa9):_0x215984(0xab);console[_0x215984(0xbb)](_0x215984(0x86)+_0x32c7d7+':\x20'+_0x3a8d84+'/'+_0x3378b5);}const _0x178ef8=await withSpinner(_0x215984(0xbf)+_0x3a8d84+'\x27...',()=>_0x4a4bb1[_0x215984(0xd3)][_0x215984(0xc5)](_0x3a8d84),{'verbose':_0x35b355}),_0xc8ea6d=await withSpinner(_0x215984(0xb9)+_0x3378b5+'\x27...',()=>_0x4a4bb1[_0x215984(0xd3)][_0x215984(0xa5)](_0x3378b5,_0x178ef8[_0x215984(0x93)]),{'verbose':_0x35b355});return _0xc8ea6d[_0x215984(0x93)];}else{const _0x483c99=_0x4a4bb1['llm']['getDefaultAgent']();if(_0x483c99)return _0x35b355&&console[_0x215984(0xbb)](_0x215984(0xb2)+_0x483c99[_0x215984(0x8a)]),_0x483c99['id'];const _0x1138ec=await withSpinner(_0x215984(0xb7),()=>_0x4a4bb1[_0x215984(0xd3)]['getOrCreateDefaultAgent'](_0x215984(0x9a),0x0),{'verbose':_0x35b355});return _0x1138ec[_0x215984(0x93)]['id'];}}export class ChatCommand extends BaseCommand{[a8_0x437b92(0x8a)]=a8_0x437b92(0xcd);[a8_0x437b92(0xb1)]=a8_0x437b92(0x8f);[a8_0x437b92(0x9d)](_0x313308){const _0x8549b1=a8_0x437b92,_0x32971d=_0x313308[_0x8549b1(0xc0)][_0x8549b1(0xa1)]('\x20');if(!_0x32971d)return _0x8549b1(0xc8);return undefined;}async['streamChat'](_0xad969a,_0x38f26d,_0x193b35,_0x38c7f7,_0x5d67a9){const _0xf28647=a8_0x437b92;for await(const _0x39939a of _0xad969a[_0xf28647(0xd3)][_0xf28647(0xcd)](_0x38f26d,{'agentId':_0x193b35,'chatId':_0x38c7f7})){if(_0x39939a[_0xf28647(0x94)]===_0xf28647(0xb6)){const _0x35fbd=_0x39939a['data'][_0xf28647(0xb8)];saveLastChatId(_0x35fbd),_0x5d67a9&&console[_0xf28647(0xbb)](_0xf28647(0x8c)+_0x35fbd);}else _0x39939a[_0xf28647(0x94)]===_0xf28647(0xa7)&&this[_0xf28647(0xc4)](_0x39939a[_0xf28647(0x93)]);}}async[a8_0x437b92(0xaa)](_0x443a5f,_0x3ee6fa,_0x4c34b4,_0x108811){const _0x153046=a8_0x437b92,_0x54e496=_0x443a5f[_0x153046(0xb4)]['site'];let _0x192a04=![];for await(const _0x188460 of _0x443a5f['llm'][_0x153046(0xcd)](_0x3ee6fa,{'agentId':_0x4c34b4,'chatId':_0x108811})){if(_0x188460[_0x153046(0x94)]===_0x153046(0xb6)){const _0x1b0777=_0x188460['data'];saveLastChatId(_0x1b0777['chatId']);const _0x3755d4=_0x1b0777[_0x153046(0x91)]&&_0x1b0777[_0x153046(0xd0)]?getLLMConversationUrl(_0x54e496,_0x1b0777['projectId'],_0x1b0777[_0x153046(0xd0)],_0x1b0777['chatId']):undefined;console[_0x153046(0xcc)](JSON[_0x153046(0xc3)]({'type':_0x153046(0xb6),'data':{'chatId':_0x1b0777['chatId'],'agentId':_0x1b0777[_0x153046(0xd0)],'consoleUrl':_0x3755d4}})),_0x192a04=!![];}else{if(_0x188460['type']===_0x153046(0xa7)){!_0x192a04&&_0x108811&&(console['log'](JSON['stringify']({'type':_0x153046(0xb6),'data':{'chatId':_0x108811}})),_0x192a04=!![]);const _0x1c6036=_0x188460[_0x153046(0x93)];if(_0x153046(0xd2)in _0x1c6036)console[_0x153046(0xcc)](JSON[_0x153046(0xc3)]({'type':_0x153046(0xd2),'data':{'content':_0x1c6036[_0x153046(0xd2)]}}));else{if(_0x153046(0xd1)in _0x1c6036){const _0x8382ad=_0x1c6036['tool_call'];console['log'](JSON[_0x153046(0xc3)]({'type':_0x153046(0xd1),'data':{'id':_0x8382ad['id'],'name':_0x8382ad[_0x153046(0x9e)],'target':_0x8382ad[_0x153046(0xce)]?.[_0x153046(0x8a)]||_0x8382ad[_0x153046(0x97)]?.[_0x153046(0x8a)]||_0x8382ad[_0x153046(0x95)]?.[_0x153046(0x8a)]||_0x8382ad[_0x153046(0xbc)]}}));}else{if(_0x153046(0x87)in _0x1c6036)console[_0x153046(0xcc)](JSON[_0x153046(0xc3)]({'type':'tool_result','data':{'id':_0x1c6036[_0x153046(0x87)]['id'],'name':_0x1c6036[_0x153046(0x87)][_0x153046(0x9e)],'result':typeof _0x1c6036[_0x153046(0x87)][_0x153046(0xd2)]===_0x153046(0xae)?_0x1c6036[_0x153046(0x87)]['content'][_0x153046(0xc7)](0x0,0x1f4):''}}));else _0x153046(0xbb)in _0x1c6036&&console['log'](JSON[_0x153046(0xc3)]({'type':_0x153046(0xbb),'data':{'error':_0x1c6036[_0x153046(0xbb)]}}));}}}}}console[_0x153046(0xcc)](JSON[_0x153046(0xc3)]({'type':_0x153046(0xa2)}));}async['execute'](_0x2b7836){const _0x2ddc10=a8_0x437b92,{options:_0x45747b,args:_0x33d620,tdx:_0x2d6b7c}=_0x2b7836,_0x2bfd92=_0x33d620[_0x2ddc10(0xa1)]('\x20'),_0x159025=_0x45747b,_0x59ee7b=_0x159025[_0x2ddc10(0x98)],_0xd1ceb9=_0x159025[_0x2ddc10(0xca)],_0x15794c=_0x159025[_0x2ddc10(0xa8)],_0x434947=_0x159025[_0x2ddc10(0x88)],_0x12f6d8=_0x159025[_0x2ddc10(0xb8)],_0x579aca=_0x159025[_0x2ddc10(0xc2)];if(_0x434947&&_0x12f6d8)return console[_0x2ddc10(0xbb)]('Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together'),0x1;try{let _0x3a4b35,_0x387c4a;if(_0x12f6d8)_0x387c4a=_0x12f6d8;else!_0x434947&&(_0x387c4a=loadLastChatId(),_0x387c4a&&_0x45747b[_0x2ddc10(0xa6)]&&console[_0x2ddc10(0xbb)](_0x2ddc10(0xbe)+_0x387c4a));!_0x12f6d8&&(_0x434947||!_0x387c4a)&&(_0x3a4b35=await resolveAgentId(_0x2d6b7c,_0x59ee7b,_0xd1ceb9,_0x15794c,_0x45747b[_0x2ddc10(0xa6)]));const _0x121a70=_0x579aca?(_0x5849aa,_0x566263,_0x3c5f7e)=>this[_0x2ddc10(0xaa)](_0x2d6b7c,_0x5849aa,_0x566263,_0x3c5f7e):(_0x5cdc66,_0x2b5b06,_0x52699c)=>this[_0x2ddc10(0xcb)](_0x2d6b7c,_0x5cdc66,_0x2b5b06,_0x52699c,_0x45747b[_0x2ddc10(0xa6)]);try{await _0x121a70(_0x2bfd92,_0x3a4b35,_0x387c4a);}catch(_0x2f9e64){const _0x53f18a=_0x2f9e64 instanceof SDKError&&_0x2f9e64['code']===ErrorCode['CHAT_NOT_FOUND']||_0x2f9e64 instanceof Error&&_0x2f9e64[_0x2ddc10(0x9b)][_0x2ddc10(0xaf)](_0x2ddc10(0x99));if(_0x53f18a&&_0x12f6d8)return console[_0x2ddc10(0xbb)](_0x2ddc10(0xc1)+_0x12f6d8+_0x2ddc10(0xba)),0x1;if(_0x53f18a)_0x45747b[_0x2ddc10(0xa6)]&&console[_0x2ddc10(0xbb)](_0x2ddc10(0xa0)),!_0x3a4b35&&(_0x3a4b35=await resolveAgentId(_0x2d6b7c,_0x59ee7b,_0xd1ceb9,_0x15794c,_0x45747b[_0x2ddc10(0xa6)])),await _0x121a70(_0x2bfd92,_0x3a4b35,undefined);else throw _0x2f9e64;}return!_0x579aca&&console[_0x2ddc10(0xcc)](),0x0;}catch(_0x2ddec4){return console[_0x2ddc10(0xbb)](),handleSDKError(_0x2ddec4,_0x45747b),0x1;}}['handleChatEvent'](_0xd4140f){const _0x199d53=a8_0x437b92;if(_0x199d53(0xd2)in _0xd4140f)process['stdout'][_0x199d53(0x9f)](_0xd4140f[_0x199d53(0xd2)]);else'error'in _0xd4140f&&console[_0x199d53(0xbb)]('\x0aError:\x20'+_0xd4140f[_0x199d53(0xbb)]);}}export class ChatCreateCommand extends BaseCommand{[a8_0x437b92(0x8a)]=a8_0x437b92(0x8b);[a8_0x437b92(0xb1)]='Create\x20a\x20new\x20chat\x20session';[a8_0x437b92(0x9d)](_0x166b65){const _0x32e85c=a8_0x437b92,_0xa0d23f=_0x166b65[_0x32e85c(0x92)],_0x560627=_0xa0d23f[_0x32e85c(0x98)],_0x1a431b=_0xa0d23f[_0x32e85c(0xca)];if(!_0x560627&&!_0x1a431b)return _0x32e85c(0xc9);return undefined;}async['execute'](_0xc9e265){const _0x56053f=a8_0x437b92,{options:_0x1e9fd7,tdx:_0xefa17}=_0xc9e265,_0x58c760=_0x1e9fd7,_0x41e59b=_0x58c760[_0x56053f(0x98)],_0xd64382=_0x58c760[_0x56053f(0xca)],_0x387985=_0x58c760[_0x56053f(0xa8)];try{const _0x1722ef=await resolveAgentId(_0xefa17,_0x41e59b,_0xd64382,_0x387985,_0x1e9fd7[_0x56053f(0xa6)]),_0x2ab7ae=await _0xefa17['llm'][_0x56053f(0x96)](_0x1722ef);return saveLastChatId(_0x2ab7ae['id']),console[_0x56053f(0xcc)](JSON[_0x56053f(0xc3)]({'chatId':_0x2ab7ae['id'],'agentId':_0x1722ef})),0x0;}catch(_0x57baa5){return handleSDKError(_0x57baa5,_0x1e9fd7),0x1;}}}
1
+ function a8_0x549d(_0x540afc,_0x57b201){_0x540afc=_0x540afc-0x71;const _0x5a2fba=a8_0x5a2f();let _0x549d7e=_0x5a2fba[_0x540afc];return _0x549d7e;}const a8_0x4faa2f=a8_0x549d;(function(_0x5d4561,_0x39c6f7){const _0x3e025e=a8_0x549d,_0x1b8438=_0x5d4561();while(!![]){try{const _0x393640=parseInt(_0x3e025e(0xaa))/0x1+parseInt(_0x3e025e(0xbe))/0x2+parseInt(_0x3e025e(0x80))/0x3*(parseInt(_0x3e025e(0x8e))/0x4)+parseInt(_0x3e025e(0x8b))/0x5*(parseInt(_0x3e025e(0x7a))/0x6)+parseInt(_0x3e025e(0x85))/0x7*(parseInt(_0x3e025e(0x7c))/0x8)+parseInt(_0x3e025e(0xbb))/0x9*(-parseInt(_0x3e025e(0xb0))/0xa)+parseInt(_0x3e025e(0x95))/0xb*(-parseInt(_0x3e025e(0x89))/0xc);if(_0x393640===_0x39c6f7)break;else _0x1b8438['push'](_0x1b8438['shift']());}catch(_0x5f5c9a){_0x1b8438['push'](_0x1b8438['shift']());}}}(a8_0x5a2f,0xe2e20));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 a8_0x5a2f(){const _0x542057=['16JgNFiK','Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together','stack','targetWebSearchTool','tool','description','CHAT_NOT_FOUND','12518KofdPn','type','code','functionName','session\x20context','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','write','targetAgent','Using\x20cached\x20default\x20agent:\x20','stream','handleChatEvent','stdout','llm','\x27...','Continuing\x20chat:\x20','stringify','chatId','Using\x20agent\x20from\x20','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','error','No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22','150343oJLPEH','join','tool_call','\x20\x20Cause:\x20','projectId','llmAgent','12499870GHZZgW','verbose','tool_result','claude-4.5-haiku','event','content','streamChat','name','cause','chat','404','9dLbynh','Error:\x20','Create\x20a\x20new\x20chat\x20session','16310zNHUVl','args','includes','validate','Error:\x20Chat\x20session\x20\x27','resolveProjectId','chat-create','Getting\x20default\x20agent...','llmProject','\x0aStack\x20trace:','3832764XevJxv','execute','13233416TmHNrk','targetKnowledgeBase','streamChatJsonl','metadata','1143549DrbBvX','done','agent','getOrCreateDefaultAgent','\x0aError:\x20','7JZpVJH','\x27\x20not\x20found','data','log','18948OFzieB','Chat\x20session:\x20','5PqQiQx','string','agentId'];a8_0x5a2f=function(){return _0x542057;};return a8_0x5a2f();}import{saveLastChatId,loadLastChatId}from'../sdk/llm/chat-cache.js';import{getLLMConversationUrl}from'../sdk/client/endpoints.js';function handleSDKError(_0x37ae54,_0x4a0de8){const _0x532691=a8_0x549d;if(_0x37ae54 instanceof SDKError)console[_0x532691(0xa8)](_0x532691(0xbc)+_0x37ae54['message']),_0x4a0de8[_0x532691(0xb1)]&&(_0x37ae54[_0x532691(0xb8)]&&console['error'](_0x532691(0xad)+_0x37ae54[_0x532691(0xb8)]),_0x37ae54[_0x532691(0x90)]&&(console['error'](_0x532691(0x79)),console['error'](_0x37ae54[_0x532691(0x90)])));else throw _0x37ae54;}async function resolveAgentId(_0x3ae219,_0x3ebf7f,_0x1122ab,_0x28e442,_0xaa13b){const _0x378d5e=a8_0x549d,_0x459425=_0x3ebf7f||_0x1122ab;if(_0x459425){const {projectName:_0x33588c,agentName:_0x5dae6f}=parseAgentRef(_0x459425),_0x215f39=_0x5dae6f||_0x459425,_0x567f58=_0x5dae6f?_0x33588c:_0x28e442;if(!_0x567f58)throw new Error(_0x378d5e(0xa9));if(_0xaa13b){const _0x801817=_0x3ebf7f?'--agent\x20flag':_0x378d5e(0x99);console['error'](_0x378d5e(0xa6)+_0x801817+':\x20'+_0x567f58+'/'+_0x215f39);}const _0x1966da=await withSpinner('Resolving\x20project\x20\x27'+_0x567f58+_0x378d5e(0xa2),()=>_0x3ae219[_0x378d5e(0xa1)][_0x378d5e(0x75)](_0x567f58),{'verbose':_0xaa13b}),_0x177f47=await withSpinner('Resolving\x20agent\x20\x27'+_0x215f39+_0x378d5e(0xa2),()=>_0x3ae219[_0x378d5e(0xa1)]['resolveAgentId'](_0x215f39,_0x1966da['data']),{'verbose':_0xaa13b});return _0x177f47[_0x378d5e(0x87)];}else{const _0x511082=_0x3ae219[_0x378d5e(0xa1)]['getDefaultAgent']();if(_0x511082)return _0xaa13b&&console[_0x378d5e(0xa8)](_0x378d5e(0x9d)+_0x511082[_0x378d5e(0xb7)]),_0x511082['id'];const _0x3be84e=await withSpinner(_0x378d5e(0x77),()=>_0x3ae219[_0x378d5e(0xa1)][_0x378d5e(0x83)](_0x378d5e(0xb3),0x0),{'verbose':_0xaa13b});return _0x3be84e['data']['id'];}}export class ChatCommand extends BaseCommand{[a8_0x4faa2f(0xb7)]='chat';[a8_0x4faa2f(0x93)]=a8_0x4faa2f(0x9a);[a8_0x4faa2f(0x73)](_0x5a02cb){const _0x5ed7e8=a8_0x4faa2f,_0x4fdb82=_0x5a02cb[_0x5ed7e8(0x71)][_0x5ed7e8(0xab)]('\x20');if(!_0x4fdb82)return'Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options';return undefined;}async[a8_0x4faa2f(0xb6)](_0x4ccc4c,_0x452620,_0x161c2e,_0x2b5e01,_0x13f1d8){const _0x440b02=a8_0x4faa2f;for await(const _0x37ff5b of _0x4ccc4c['llm'][_0x440b02(0xb9)](_0x452620,{'agentId':_0x161c2e,'chatId':_0x2b5e01})){if(_0x37ff5b[_0x440b02(0x96)]==='metadata'){const _0x59df9d=_0x37ff5b[_0x440b02(0x87)][_0x440b02(0xa5)];saveLastChatId(_0x59df9d),_0x13f1d8&&console[_0x440b02(0xa8)](_0x440b02(0x8a)+_0x59df9d);}else _0x37ff5b[_0x440b02(0x96)]===_0x440b02(0xb4)&&this[_0x440b02(0x9f)](_0x37ff5b[_0x440b02(0x87)]);}}async['streamChatJsonl'](_0x256ef5,_0x336aac,_0x4379ac,_0x5a9d13){const _0x19197a=a8_0x4faa2f,_0x3edf7c=_0x256ef5['context']['site'];let _0x1f4fc2=![];for await(const _0xa2bded of _0x256ef5['llm']['chat'](_0x336aac,{'agentId':_0x4379ac,'chatId':_0x5a9d13})){if(_0xa2bded[_0x19197a(0x96)]===_0x19197a(0x7f)){const _0xbb67f9=_0xa2bded['data'];saveLastChatId(_0xbb67f9[_0x19197a(0xa5)]);const _0x289b3e=_0xbb67f9['projectId']&&_0xbb67f9[_0x19197a(0x8d)]?getLLMConversationUrl(_0x3edf7c,_0xbb67f9[_0x19197a(0xae)],_0xbb67f9['agentId'],_0xbb67f9['chatId']):undefined;console[_0x19197a(0x88)](JSON[_0x19197a(0xa4)]({'type':'metadata','data':{'chatId':_0xbb67f9[_0x19197a(0xa5)],'agentId':_0xbb67f9['agentId'],'consoleUrl':_0x289b3e}})),_0x1f4fc2=!![];}else{if(_0xa2bded[_0x19197a(0x96)]===_0x19197a(0xb4)){!_0x1f4fc2&&_0x5a9d13&&(console['log'](JSON['stringify']({'type':_0x19197a(0x7f),'data':{'chatId':_0x5a9d13}})),_0x1f4fc2=!![]);const _0x5bc147=_0xa2bded[_0x19197a(0x87)];if('content'in _0x5bc147)console[_0x19197a(0x88)](JSON['stringify']({'type':'content','data':{'content':_0x5bc147[_0x19197a(0xb5)]}}));else{if(_0x19197a(0xac)in _0x5bc147){const _0x4bef04=_0x5bc147[_0x19197a(0xac)];console[_0x19197a(0x88)](JSON[_0x19197a(0xa4)]({'type':_0x19197a(0xac),'data':{'id':_0x4bef04['id'],'name':_0x4bef04[_0x19197a(0x98)],'target':_0x4bef04[_0x19197a(0x7d)]?.[_0x19197a(0xb7)]||_0x4bef04[_0x19197a(0x9c)]?.[_0x19197a(0xb7)]||_0x4bef04[_0x19197a(0x91)]?.['name']||_0x4bef04['targetFunction']}}));}else{if('tool'in _0x5bc147)console[_0x19197a(0x88)](JSON[_0x19197a(0xa4)]({'type':_0x19197a(0xb2),'data':{'id':_0x5bc147['tool']['id'],'name':_0x5bc147[_0x19197a(0x92)][_0x19197a(0x98)],'result':typeof _0x5bc147[_0x19197a(0x92)][_0x19197a(0xb5)]===_0x19197a(0x8c)?_0x5bc147[_0x19197a(0x92)][_0x19197a(0xb5)]['slice'](0x0,0x1f4):''}}));else'error'in _0x5bc147&&console['log'](JSON['stringify']({'type':_0x19197a(0xa8),'data':{'error':_0x5bc147['error']}}));}}}}}console['log'](JSON['stringify']({'type':_0x19197a(0x81)}));}async['execute'](_0x11dd3f){const _0x269a18=a8_0x4faa2f,{options:_0x12541c,args:_0x160f65,tdx:_0x2747b6}=_0x11dd3f,_0x128d28=_0x160f65[_0x269a18(0xab)]('\x20'),_0x18b4ea=_0x12541c,_0x41531f=_0x18b4ea[_0x269a18(0x82)],_0x4e70bc=_0x18b4ea[_0x269a18(0xaf)],_0x37439d=_0x18b4ea['llmProject'],_0x3375ca=_0x18b4ea['new'],_0x4ad92b=_0x18b4ea['chatId'],_0xf61c23=_0x18b4ea[_0x269a18(0x9e)];if(_0x3375ca&&_0x4ad92b)return console[_0x269a18(0xa8)](_0x269a18(0x8f)),0x1;try{let _0x2dff60,_0x219995;if(_0x4ad92b)_0x219995=_0x4ad92b;else!_0x3375ca&&(_0x219995=loadLastChatId(),_0x219995&&_0x12541c[_0x269a18(0xb1)]&&console[_0x269a18(0xa8)](_0x269a18(0xa3)+_0x219995));!_0x4ad92b&&(_0x3375ca||!_0x219995)&&(_0x2dff60=await resolveAgentId(_0x2747b6,_0x41531f,_0x4e70bc,_0x37439d,_0x12541c['verbose']));const _0x4c9f22=_0xf61c23?(_0x2b2dc2,_0x5dde45,_0x2394af)=>this[_0x269a18(0x7e)](_0x2747b6,_0x2b2dc2,_0x5dde45,_0x2394af):(_0x3cdd43,_0xbfbbc7,_0x3ef45d)=>this[_0x269a18(0xb6)](_0x2747b6,_0x3cdd43,_0xbfbbc7,_0x3ef45d,_0x12541c[_0x269a18(0xb1)]);try{await _0x4c9f22(_0x128d28,_0x2dff60,_0x219995);}catch(_0x475bf8){const _0x372edd=_0x475bf8 instanceof SDKError&&_0x475bf8[_0x269a18(0x97)]===ErrorCode[_0x269a18(0x94)]||_0x475bf8 instanceof Error&&_0x475bf8['message'][_0x269a18(0x72)](_0x269a18(0xba));if(_0x372edd&&_0x4ad92b)return console[_0x269a18(0xa8)](_0x269a18(0x74)+_0x4ad92b+_0x269a18(0x86)),0x1;if(_0x372edd)_0x12541c['verbose']&&console[_0x269a18(0xa8)](_0x269a18(0xa7)),!_0x2dff60&&(_0x2dff60=await resolveAgentId(_0x2747b6,_0x41531f,_0x4e70bc,_0x37439d,_0x12541c[_0x269a18(0xb1)])),await _0x4c9f22(_0x128d28,_0x2dff60,undefined);else throw _0x475bf8;}return!_0xf61c23&&console['log'](),0x0;}catch(_0x172fcd){return console[_0x269a18(0xa8)](),handleSDKError(_0x172fcd,_0x12541c),0x1;}}['handleChatEvent'](_0x8659cd){const _0x4e43b0=a8_0x4faa2f;if(_0x4e43b0(0xb5)in _0x8659cd)process[_0x4e43b0(0xa0)][_0x4e43b0(0x9b)](_0x8659cd[_0x4e43b0(0xb5)]);else'error'in _0x8659cd&&console['error'](_0x4e43b0(0x84)+_0x8659cd[_0x4e43b0(0xa8)]);}}export class ChatCreateCommand extends BaseCommand{[a8_0x4faa2f(0xb7)]=a8_0x4faa2f(0x76);['description']=a8_0x4faa2f(0xbd);[a8_0x4faa2f(0x73)](_0x15f242){const _0x294e31=a8_0x4faa2f,_0x1bcda9=_0x15f242['options'],_0x40308e=_0x1bcda9[_0x294e31(0x82)],_0x3c3210=_0x1bcda9['llmAgent'];if(!_0x40308e&&!_0x3c3210)return'Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22';return undefined;}async[a8_0x4faa2f(0x7b)](_0x2ab10f){const _0x117d6d=a8_0x4faa2f,{options:_0x4d61ac,tdx:_0x36253e}=_0x2ab10f,_0x550dac=_0x4d61ac,_0x4ccca=_0x550dac['agent'],_0x24dc3f=_0x550dac[_0x117d6d(0xaf)],_0x117027=_0x550dac[_0x117d6d(0x78)];try{const _0x274301=await resolveAgentId(_0x36253e,_0x4ccca,_0x24dc3f,_0x117027,_0x4d61ac['verbose']),_0x291cbb=await _0x36253e['llm']['startChat'](_0x274301);return saveLastChatId(_0x291cbb['id']),console[_0x117d6d(0x88)](JSON['stringify']({'chatId':_0x291cbb['id'],'agentId':_0x274301})),0x0;}catch(_0x4c036f){return handleSDKError(_0x4c036f,_0x4d61ac),0x1;}}}