@treasuredata/tdx 0.26.0 → 0.26.2

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 (170) 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/describe.js +1 -1
  18. package/dist/commands/engage-command.js +1 -1
  19. package/dist/commands/job-command.js +1 -1
  20. package/dist/commands/journey-command.js +1 -1
  21. package/dist/commands/journey-validate-command.js +1 -1
  22. package/dist/commands/llm-command.js +1 -1
  23. package/dist/commands/mcp-command.js +1 -1
  24. package/dist/commands/parent-segment-command.js +1 -1
  25. package/dist/commands/profile-command.js +1 -1
  26. package/dist/commands/profiles-command.js +1 -1
  27. package/dist/commands/query-command.js +1 -1
  28. package/dist/commands/schedule-command.js +1 -1
  29. package/dist/commands/segment-command.js +1 -1
  30. package/dist/commands/segment-create-command.js +1 -1
  31. package/dist/commands/segment-fields-command.js +1 -1
  32. package/dist/commands/segment-pull-command.js +1 -1
  33. package/dist/commands/segment-push-command.js +1 -1
  34. package/dist/commands/segment-update-command.js +1 -1
  35. package/dist/commands/segment-use-command.js +1 -1
  36. package/dist/commands/segment-validate-command.js +1 -1
  37. package/dist/commands/segments.js +1 -1
  38. package/dist/commands/show.js +1 -1
  39. package/dist/commands/status-command.js +1 -1
  40. package/dist/commands/tables.js +1 -1
  41. package/dist/commands/unset-command.js +1 -1
  42. package/dist/commands/use-command.js +1 -1
  43. package/dist/commands/user-command.js +1 -1
  44. package/dist/commands/workflow-command.js +1 -1
  45. package/dist/core/auth.js +1 -1
  46. package/dist/core/command-output.js +1 -1
  47. package/dist/core/config.js +1 -1
  48. package/dist/core/connection-cache.js +1 -1
  49. package/dist/core/constants.js +1 -1
  50. package/dist/core/credential-cache.js +1 -1
  51. package/dist/core/global-context.js +1 -1
  52. package/dist/core/keychain.js +1 -1
  53. package/dist/core/profile.js +1 -1
  54. package/dist/core/project-config.js +1 -1
  55. package/dist/core/session.js +1 -1
  56. package/dist/core/user-cache.js +1 -1
  57. package/dist/core/version.js +1 -1
  58. package/dist/index.js +1 -1
  59. package/dist/mcp/server.js +1 -1
  60. package/dist/mcp/tools/index.js +1 -1
  61. package/dist/mcp/tools/tdx-run.js +1 -1
  62. package/dist/mcp/tools/tdx-search.js +1 -1
  63. package/dist/mcp/utils.js +1 -1
  64. package/dist/proxy/claude-usage-tracker.js +1 -1
  65. package/dist/proxy/passthrough-server.js +1 -1
  66. package/dist/proxy/sse-usage-parser.js +1 -1
  67. package/dist/sdk/agent/agent-config.js +1 -1
  68. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  69. package/dist/sdk/agent/agent-yaml.js +1 -1
  70. package/dist/sdk/agent/test/evaluator.js +1 -1
  71. package/dist/sdk/agent/test/executor.js +1 -1
  72. package/dist/sdk/agent/test/index.js +1 -1
  73. package/dist/sdk/agent/test/output.js +1 -1
  74. package/dist/sdk/agent/test/parser.js +1 -1
  75. package/dist/sdk/api.js +1 -1
  76. package/dist/sdk/client/cdp-api-client.js +1 -1
  77. package/dist/sdk/client/endpoints.js +1 -1
  78. package/dist/sdk/client/engage-api-client.js +1 -1
  79. package/dist/sdk/client/http-client.js +1 -1
  80. package/dist/sdk/client/llm-api-client.js +1 -1
  81. package/dist/sdk/client/rate-limiter.js +1 -1
  82. package/dist/sdk/client/td-api-client.js +1 -1
  83. package/dist/sdk/client/trino-api-client.js +1 -1
  84. package/dist/sdk/client/workflow-client.js +1 -1
  85. package/dist/sdk/connection-validator.js +1 -1
  86. package/dist/sdk/connection.js +1 -1
  87. package/dist/sdk/engage.js +1 -1
  88. package/dist/sdk/errors.js +1 -1
  89. package/dist/sdk/index.js +1 -1
  90. package/dist/sdk/io/index.js +1 -1
  91. package/dist/sdk/io/node-filesystem.js +1 -1
  92. package/dist/sdk/job.js +1 -1
  93. package/dist/sdk/journey.js +1 -1
  94. package/dist/sdk/llm/chat-cache.js +1 -1
  95. package/dist/sdk/llm/index.js +1 -1
  96. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  97. package/dist/sdk/llm/model-factors.js +1 -1
  98. package/dist/sdk/personalization.js +1 -1
  99. package/dist/sdk/query/index.js +1 -1
  100. package/dist/sdk/query/sql-parser.js +1 -1
  101. package/dist/sdk/realtime.js +1 -1
  102. package/dist/sdk/schedule.js +1 -1
  103. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  104. package/dist/sdk/segment/fields-display.js +1 -1
  105. package/dist/sdk/segment/file-discovery.js +1 -1
  106. package/dist/sdk/segment/journey-utils.js +1 -1
  107. package/dist/sdk/segment/journey-validator.js +1 -1
  108. package/dist/sdk/segment/journey-yaml.js +1 -1
  109. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  110. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  111. package/dist/sdk/segment/pull-workflow.js +1 -1
  112. package/dist/sdk/segment/push-recovery.js +1 -1
  113. package/dist/sdk/segment/push-workflow.js +1 -1
  114. package/dist/sdk/segment/resolution-context.js +1 -1
  115. package/dist/sdk/segment/segment-path-parser.js +1 -1
  116. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  117. package/dist/sdk/segment/target-resolution.js +1 -1
  118. package/dist/sdk/segment/tdx-config.js +1 -1
  119. package/dist/sdk/segment/validate-files.js +1 -1
  120. package/dist/sdk/segment/yaml-validator.js +1 -1
  121. package/dist/sdk/segment.js +1 -1
  122. package/dist/sdk/types/index.js +1 -1
  123. package/dist/sdk/types/progress.js +1 -1
  124. package/dist/sdk/user.js +1 -1
  125. package/dist/sdk/util/format-detector.js +1 -1
  126. package/dist/sdk/util/formatters.js +1 -1
  127. package/dist/sdk/util/index.js +1 -1
  128. package/dist/sdk/util/tree-formatter.js +1 -1
  129. package/dist/sdk/workflow/archive-validation.js +1 -1
  130. package/dist/sdk/workflow/clone-workflow.js +1 -1
  131. package/dist/sdk/workflow/index.js +1 -1
  132. package/dist/sdk/workflow/pull-workflow.js +1 -1
  133. package/dist/sdk/workflow/push-workflow.js +1 -1
  134. package/dist/sdk/workflow/tdx-config.js +1 -1
  135. package/dist/sdk/workflow/workflow-utils.js +1 -1
  136. package/dist/test-utils/command-runner.js +1 -1
  137. package/dist/test-utils/factories.js +1 -1
  138. package/dist/test-utils/fixtures.js +1 -1
  139. package/dist/test-utils/http-mock.js +1 -1
  140. package/dist/test-utils/index.js +1 -1
  141. package/dist/utils/async.js +1 -1
  142. package/dist/utils/colors.js +1 -1
  143. package/dist/utils/diff.js +1 -1
  144. package/dist/utils/file-permissions.js +1 -1
  145. package/dist/utils/global-cache.js +1 -1
  146. package/dist/utils/json-loader.js +1 -1
  147. package/dist/utils/local-cache.d.ts +2 -1
  148. package/dist/utils/local-cache.d.ts.map +1 -1
  149. package/dist/utils/local-cache.js +1 -1
  150. package/dist/utils/local-cache.js.map +1 -1
  151. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  152. package/dist/utils/logger/formatters/index.js +1 -1
  153. package/dist/utils/logger/handlers/console-handler.js +1 -1
  154. package/dist/utils/logger/handlers/file-handler.js +1 -1
  155. package/dist/utils/logger/handlers/index.js +1 -1
  156. package/dist/utils/logger/handlers/null-handler.js +1 -1
  157. package/dist/utils/logger/index.js +1 -1
  158. package/dist/utils/logger/logger.js +1 -1
  159. package/dist/utils/logger/types.js +1 -1
  160. package/dist/utils/option-validation.js +1 -1
  161. package/dist/utils/port.js +1 -1
  162. package/dist/utils/process.js +1 -1
  163. package/dist/utils/prompt.js +1 -1
  164. package/dist/utils/spinner.js +1 -1
  165. package/dist/utils/sse-parser.js +1 -1
  166. package/dist/utils/string-utils.js +1 -1
  167. package/dist/utils/table-ref-parser.js +1 -1
  168. package/dist/utils/tdx-logger.js +1 -1
  169. package/dist/utils/version-check.js +1 -1
  170. package/package.json +1 -1
@@ -1 +1 @@
1
- const a3_0x201de4=a3_0x448e;(function(_0x427d17,_0x242251){const _0x34c359=a3_0x448e,_0x5c5b48=_0x427d17();while(!![]){try{const _0x4bf0fe=-parseInt(_0x34c359(0x1e8))/0x1*(-parseInt(_0x34c359(0x1ce))/0x2)+parseInt(_0x34c359(0x1f0))/0x3*(parseInt(_0x34c359(0x1f1))/0x4)+-parseInt(_0x34c359(0x1db))/0x5*(-parseInt(_0x34c359(0x1ef))/0x6)+parseInt(_0x34c359(0x1d8))/0x7*(-parseInt(_0x34c359(0x1dc))/0x8)+-parseInt(_0x34c359(0x1e2))/0x9+parseInt(_0x34c359(0x1e1))/0xa*(-parseInt(_0x34c359(0x1d1))/0xb)+-parseInt(_0x34c359(0x1d2))/0xc*(-parseInt(_0x34c359(0x1e3))/0xd);if(_0x4bf0fe===_0x242251)break;else _0x5c5b48['push'](_0x5c5b48['shift']());}catch(_0x3cce78){_0x5c5b48['push'](_0x5c5b48['shift']());}}}(a3_0x5bd3,0x85c68));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a3_0x5bd3(){const _0x42a5e2=['13452ilyOya','240HGDbtr','\x20\x20Cause:\x20','length','Error:\x20','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','82sncIgB','Parent\x20name:\x20','cause','11iAfLpd','12CuGzia','Resolved\x20child\x20ID:\x20','\x27...','Resolved\x20parent\x20ID:\x20','data','listActivations','14juFnGu','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','error','5abPboQ','4181384JwZCtW','Child\x20name:\x20','verbose','execute','description','7330970FWTzWi','7025616GGZBaC','17027049iyJBCK','\x20activation','name','segment','List\x20activations\x20for\x20a\x20segment','16063PXgICd','Error:\x20Segment\x20name\x20is\x20required','resolveSegmentId','Site:\x20','✔\x20Found\x20','Resolving\x20child\x20segment\x20\x27','Listing\x20activations\x20for\x20segment\x20\x27','5217690LMosWx'];a3_0x5bd3=function(){return _0x42a5e2;};return a3_0x5bd3();}import{handleSDKOutput}from'../core/command-output.js';function a3_0x448e(_0x550d2e,_0x3625ed){_0x550d2e=_0x550d2e-0x1cb;const _0x5bd3d5=a3_0x5bd3();let _0x448e51=_0x5bd3d5[_0x550d2e];return _0x448e51;}import{withSpinner}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';export class ActivationsCommand extends BaseCommand{[a3_0x201de4(0x1e5)]='activations';[a3_0x201de4(0x1e0)]=a3_0x201de4(0x1e7);async[a3_0x201de4(0x1df)](_0x563612){const _0x5947e0=a3_0x201de4,{options:_0x331702,args:_0x3738da,tdx:_0x3fd1a3}=_0x563612;if(_0x3738da[_0x5947e0(0x1cb)]===0x0)return console[_0x5947e0(0x1da)](_0x5947e0(0x1e9)),console['error'](_0x5947e0(0x1d9)),0x1;try{const {parentId:_0x4a4630,childId:_0x347632}=parseSegmentRef(_0x3738da[0x0]);if(!_0x347632)return console[_0x5947e0(0x1da)](_0x5947e0(0x1cd)),console[_0x5947e0(0x1da)](_0x5947e0(0x1d9)),0x1;_0x331702['verbose']&&(console[_0x5947e0(0x1da)](_0x5947e0(0x1eb)+_0x331702['site']),console['error'](_0x5947e0(0x1cf)+_0x4a4630),console[_0x5947e0(0x1da)](_0x5947e0(0x1dd)+_0x347632));const _0x209c53=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x4a4630+'\x27...',()=>_0x3fd1a3[_0x5947e0(0x1e6)]['resolveParentId'](_0x4a4630),{'verbose':_0x331702[_0x5947e0(0x1de)]}),_0x49099b=_0x209c53[_0x5947e0(0x1d6)];_0x331702[_0x5947e0(0x1de)]&&console[_0x5947e0(0x1da)](_0x5947e0(0x1d5)+_0x49099b);const _0x3feddf=await withSpinner(_0x5947e0(0x1ed)+_0x347632+_0x5947e0(0x1d4),()=>_0x3fd1a3[_0x5947e0(0x1e6)][_0x5947e0(0x1ea)](_0x49099b,_0x347632),{'verbose':_0x331702[_0x5947e0(0x1de)]}),_0x31787b=_0x3feddf[_0x5947e0(0x1d6)];_0x331702[_0x5947e0(0x1de)]&&console[_0x5947e0(0x1da)](_0x5947e0(0x1d3)+_0x31787b);const _0x4a61ce=await withSpinner(_0x5947e0(0x1ee)+_0x347632+'\x27...',()=>_0x3fd1a3[_0x5947e0(0x1e6)][_0x5947e0(0x1d7)](_0x49099b,_0x31787b),{'verbose':_0x331702[_0x5947e0(0x1de)]}),_0x424fa7=_0x4a61ce[_0x5947e0(0x1d6)];return console[_0x5947e0(0x1da)](_0x5947e0(0x1ec)+_0x424fa7['length']+_0x5947e0(0x1e4)+(_0x424fa7[_0x5947e0(0x1cb)]!==0x1?'s':'')),await handleSDKOutput(_0x424fa7,_0x331702),0x0;}catch(_0x365212){if(_0x365212 instanceof SDKError)return console[_0x5947e0(0x1da)](_0x5947e0(0x1cc)+_0x365212['message']),_0x365212[_0x5947e0(0x1d0)]&&console[_0x5947e0(0x1da)](_0x5947e0(0x1f2)+_0x365212['cause']),0x1;throw _0x365212;}}}
1
+ const a3_0x298da5=a3_0x57c9;(function(_0xfcbcd2,_0x219dec){const _0x5cb858=a3_0x57c9,_0x57d99a=_0xfcbcd2();while(!![]){try{const _0x567163=-parseInt(_0x5cb858(0x162))/0x1+-parseInt(_0x5cb858(0x164))/0x2+parseInt(_0x5cb858(0x14d))/0x3+parseInt(_0x5cb858(0x151))/0x4+parseInt(_0x5cb858(0x152))/0x5*(parseInt(_0x5cb858(0x155))/0x6)+parseInt(_0x5cb858(0x146))/0x7+parseInt(_0x5cb858(0x160))/0x8;if(_0x567163===_0x219dec)break;else _0x57d99a['push'](_0x57d99a['shift']());}catch(_0x158820){_0x57d99a['push'](_0x57d99a['shift']());}}}(a3_0x2d10,0xe0f62));function a3_0x57c9(_0x4623a1,_0x5d3374){_0x4623a1=_0x4623a1-0x146;const _0x2d1031=a3_0x2d10();let _0x57c99f=_0x2d1031[_0x4623a1];return _0x57c99f;}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a3_0x2d10(){const _0xfe9d2d=['error','Resolved\x20parent\x20ID:\x20','resolveSegmentId','data','message','name','Site:\x20','verbose','2367224wminRS','execute','1109761hZWOzq','Child\x20name:\x20','502130QsNEGj','description','listActivations','Error:\x20','\x20\x20Cause:\x20','6811182ZROuuO','site','Error:\x20Segment\x20name\x20is\x20required','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','resolveParentId','cause','Resolved\x20child\x20ID:\x20','759354XmMBYW','segment','length','\x27...','1832664KVKRGA','975EUCtCs','activations','Parent\x20name:\x20','9294HONzsD','✔\x20Found\x20','\x20activation'];a3_0x2d10=function(){return _0xfe9d2d;};return a3_0x2d10();}import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';export class ActivationsCommand extends BaseCommand{[a3_0x298da5(0x15d)]=a3_0x298da5(0x153);[a3_0x298da5(0x165)]='List\x20activations\x20for\x20a\x20segment';async[a3_0x298da5(0x161)](_0x146bf8){const _0x71a47f=a3_0x298da5,{options:_0x1f30c4,args:_0x6c17a8,tdx:_0x1d767f}=_0x146bf8;if(_0x6c17a8[_0x71a47f(0x14f)]===0x0)return console[_0x71a47f(0x158)](_0x71a47f(0x148)),console[_0x71a47f(0x158)]('Usage:\x20tdx\x20activations\x20<parent_name/child_name>'),0x1;try{const {parentId:_0x572925,childId:_0x1e2508}=parseSegmentRef(_0x6c17a8[0x0]);if(!_0x1e2508)return console['error']('Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations'),console[_0x71a47f(0x158)](_0x71a47f(0x149)),0x1;_0x1f30c4[_0x71a47f(0x15f)]&&(console[_0x71a47f(0x158)](_0x71a47f(0x15e)+_0x1f30c4[_0x71a47f(0x147)]),console['error'](_0x71a47f(0x154)+_0x572925),console[_0x71a47f(0x158)](_0x71a47f(0x163)+_0x1e2508));const _0x7191c=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x572925+'\x27...',()=>_0x1d767f[_0x71a47f(0x14e)][_0x71a47f(0x14a)](_0x572925),{'verbose':_0x1f30c4['verbose']}),_0x23bead=_0x7191c[_0x71a47f(0x15b)];_0x1f30c4[_0x71a47f(0x15f)]&&console[_0x71a47f(0x158)](_0x71a47f(0x159)+_0x23bead);const _0x3562d1=await withSpinner('Resolving\x20child\x20segment\x20\x27'+_0x1e2508+'\x27...',()=>_0x1d767f['segment'][_0x71a47f(0x15a)](_0x23bead,_0x1e2508),{'verbose':_0x1f30c4['verbose']}),_0x3dc078=_0x3562d1[_0x71a47f(0x15b)];_0x1f30c4[_0x71a47f(0x15f)]&&console[_0x71a47f(0x158)](_0x71a47f(0x14c)+_0x3dc078);const _0x2e1899=await withSpinner('Listing\x20activations\x20for\x20segment\x20\x27'+_0x1e2508+_0x71a47f(0x150),()=>_0x1d767f[_0x71a47f(0x14e)][_0x71a47f(0x166)](_0x23bead,_0x3dc078),{'verbose':_0x1f30c4['verbose']}),_0x41cb6e=_0x2e1899['data'];return console[_0x71a47f(0x158)](_0x71a47f(0x156)+_0x41cb6e[_0x71a47f(0x14f)]+_0x71a47f(0x157)+(_0x41cb6e[_0x71a47f(0x14f)]!==0x1?'s':'')),await handleSDKOutput(_0x41cb6e,_0x1f30c4),0x0;}catch(_0x47f38f){if(_0x47f38f instanceof SDKError)return console['error'](_0x71a47f(0x167)+_0x47f38f[_0x71a47f(0x15c)]),_0x47f38f[_0x71a47f(0x14b)]&&console[_0x71a47f(0x158)](_0x71a47f(0x168)+_0x47f38f['cause']),0x1;throw _0x47f38f;}}}
@@ -1 +1 @@
1
- const a4_0x289b8c=a4_0x4f9e;(function(_0x2c108c,_0x428ab8){const _0x2a39c0=a4_0x4f9e,_0x1dd082=_0x2c108c();while(!![]){try{const _0x55b33c=parseInt(_0x2a39c0(0x247))/0x1+parseInt(_0x2a39c0(0x26b))/0x2+parseInt(_0x2a39c0(0x202))/0x3*(parseInt(_0x2a39c0(0x1ef))/0x4)+-parseInt(_0x2a39c0(0x28c))/0x5*(-parseInt(_0x2a39c0(0x254))/0x6)+parseInt(_0x2a39c0(0x282))/0x7*(parseInt(_0x2a39c0(0x225))/0x8)+-parseInt(_0x2a39c0(0x1e6))/0x9+-parseInt(_0x2a39c0(0x21f))/0xa*(parseInt(_0x2a39c0(0x219))/0xb);if(_0x55b33c===_0x428ab8)break;else _0x1dd082['push'](_0x1dd082['shift']());}catch(_0x4f93e4){_0x1dd082['push'](_0x1dd082['shift']());}}}(a4_0x4376,0x209f6));import a4_0x1d1f14 from'chalk';import a4_0x32317e 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';function a4_0x4376(){const _0x24c834=['profile','pushAgent','\x20\x20Text\x20Knowledge\x20Bases:\x20','\x20updated','180bYzEtJ','\x0a✔\x20Pushed\x20','Agent:\x20','name','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','INVALID_ARGUMENT','Clone\x20\x22','push','Analyzing\x20changes\x20to\x20push...','\x20\x20Knowledge\x20Bases:\x20','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','Agent\x20','Summary:','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','llmProject','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','cloneProject','textKnowledgeBases','parse','counts','\x20\x20Prompts:\x20','log','1440813MkmJQR','gray','Using\x20current\x20project:\x20','isNew','\x22\x20to\x20a\x20different\x20profile','agentId','30IAocGg','-\x20nothing\x20pushed','integrations','<new-name>','\x20errors','found','1633688BgXluC','Using\x20project:\x20','dirname','errors','new','\x20\x20Agents:\x20','\x20\x20Agent\x20\x22','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project','\x20--profile\x20','prompts','\x20\x20Prompt\x20\x22','Output\x20path:\x20','yellow','\x20\x20Text\x20Knowledge\x20Base\x20\x22','New\x20project\x20name\x20is\x20required','execute','Would\x20push\x20agent:\x20','Pushing\x20to\x20project...','action','sourceProjectName','no_local_folder','\x20\x20Source:\x20','\x0aPush\x20','\x27\x20to\x20create\x20the\x20folder\x20structure.','\x20unchanged','join','Using\x20context\x20project:\x20','\x20successfully','message','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','dryRun','\x20files\x20to\x20','\x20resources?','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','90274dVEpOs','pullProject','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','unchanged','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','reason','utf-8','diff','agents','\x0aChanges:','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','experimentalKnowledgeBases','\x0aError:','606mohyiv','\x0a✔\x20Pulled\x20','Usage:\x20tdx\x20agent\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20project\x20(requires\x20context\x20or\x20tdx.json)','cwd','Dry\x20run\x20-\x20no\x20changes\x20made','agent:push','updated','\x0aWrite\x20','newProjectName','\x20|\x20','error','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','Dry\x20run\x20-\x20no\x20files\x20written','output','\x20resources\x20to\x20\x27','Using\x20local\x20project:\x20','Agent\x20pulled\x20successfully','outputPath','\x20total','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','\x20\x20Experimental\x20Artifact\x20\x22','Chat:\x20','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','94540hZuhKM','agent:clone','Output:\x20','llm','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','yes','cyan','no_context','Cancelled','\x20\x20Integrations:\x20','\x22\x20to\x20new\x20project\x20\x22','hasChanges','created','llm_project','✔\x20Context\x20set:\x20','Pulling\x20agent\x20\x22','outputDir','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','\x22\x20from\x20project\x20\x22','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','No\x20tdx.json\x20found\x20in\x20','\x22\x20to\x20\x22','7iDcZEU','New\x20project:\x20','\x20\x20Target:\x20','\x0aChanges\x20to\x20integration\x20\x27','\x0aProject\x20pushed\x20with\x20errors','\x0aPush\x20summary\x20for\x20\x27','agentName','description','\x22:\x20','Status:\x20','8135dhZvam','Source:\x20','\x20\x20Experimental\x20Artifacts:\x20','\x20changed','site','MISSING_ARGUMENT','force','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','projectId','Cloning\x20\x22','projectDir','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','\x20\x20Knowledge\x20Base\x20\x22','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','\x0aErrors\x20found:','\x0aChanges\x20to\x20prompt\x20\x27','\x20new','source','agent.yml','pullAgent','repeat','tdx.json','2007999lRKgaR','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','\x20=\x20','\x22...','pushProject','experimentalArtifacts','Project\x20cloned\x20successfully','New\x20project\x20ID:\x20','\x0aPull\x20summary\x20for\x20\x27','16240KZOhHi','Analyzing\x20project\x20\x22','\x20files?','knowledgeBases','green','session','Project\x20cloned\x20with\x20errors','Would\x20clone:','newProjectId','red','Failed\x20to\x20push\x20agent:\x20','total','projectName','\x20\x20Integration\x20\x22','dim'];a4_0x4376=function(){return _0x24c834;};return a4_0x4376();}import{findAgentConfigPath,resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x2aa1c5){const _0x46fdb8=a4_0x4f9e,_0xa6d87a=[];if(_0x2aa1c5[_0x46fdb8(0x1fa)]!==undefined)_0xa6d87a[_0x46fdb8(0x209)](_0x2aa1c5[_0x46fdb8(0x1fa)]+_0x46fdb8(0x266));if(_0x2aa1c5[_0x46fdb8(0x229)]!==undefined&&_0x2aa1c5[_0x46fdb8(0x229)]>0x0)_0xa6d87a['push'](a4_0x1d1f14[_0x46fdb8(0x1f3)](_0x2aa1c5['new']+_0x46fdb8(0x29c)));if(_0x2aa1c5[_0x46fdb8(0x278)]!==undefined&&_0x2aa1c5[_0x46fdb8(0x278)]>0x0)_0xa6d87a[_0x46fdb8(0x209)](a4_0x1d1f14[_0x46fdb8(0x1f3)](_0x2aa1c5[_0x46fdb8(0x278)]+'\x20created'));if(_0x2aa1c5[_0x46fdb8(0x25a)]!==undefined&&_0x2aa1c5['updated']>0x0)_0xa6d87a[_0x46fdb8(0x209)](a4_0x1d1f14[_0x46fdb8(0x231)](_0x2aa1c5[_0x46fdb8(0x25a)]+_0x46fdb8(0x201)));if(_0x2aa1c5['unchanged']!==undefined&&_0x2aa1c5[_0x46fdb8(0x24a)]>0x0)_0xa6d87a['push'](a4_0x1d1f14[_0x46fdb8(0x21a)](_0x2aa1c5['unchanged']+_0x46fdb8(0x23d)));if(_0x2aa1c5['errors']!==undefined&&_0x2aa1c5[_0x46fdb8(0x228)]>0x0)_0xa6d87a['push'](a4_0x1d1f14[_0x46fdb8(0x1f8)](_0x2aa1c5[_0x46fdb8(0x228)]+_0x46fdb8(0x223)));return _0xa6d87a['join'](',\x20');}function displayDiffs(_0x3169c3,_0x499fa9,_0x5d4fcd,_0x333a9b,_0x54c949,_0x5e4e69,_0x3796c5){const _0x1249f6=a4_0x4f9e;for(const _0x44d7e6 of _0x3169c3){if(_0x44d7e6[_0x1249f6(0x24e)]){const _0x3e7849=_0x44d7e6[_0x1249f6(0x288)]||_0x44d7e6[_0x1249f6(0x205)];console[_0x1249f6(0x218)]('\x0aChanges\x20to\x20agent\x20\x27'+_0x3e7849+'\x27:'),console[_0x1249f6(0x218)]('─'[_0x1249f6(0x1e4)](0x3c)),console[_0x1249f6(0x218)](_0x44d7e6[_0x1249f6(0x24e)]),console[_0x1249f6(0x218)]('─'[_0x1249f6(0x1e4)](0x3c));}}for(const _0xb900d2 of _0x499fa9){_0xb900d2[_0x1249f6(0x24e)]&&(console[_0x1249f6(0x218)](_0x1249f6(0x27d)+_0xb900d2[_0x1249f6(0x205)]+'\x27:'),console[_0x1249f6(0x218)]('─'[_0x1249f6(0x1e4)](0x3c)),console[_0x1249f6(0x218)](_0xb900d2[_0x1249f6(0x24e)]),console['log']('─'['repeat'](0x3c)));}for(const _0x529161 of _0x5d4fcd){_0x529161[_0x1249f6(0x24e)]&&(console[_0x1249f6(0x218)](_0x1249f6(0x26f)+_0x529161[_0x1249f6(0x205)]+'\x27:'),console[_0x1249f6(0x218)]('─'[_0x1249f6(0x1e4)](0x3c)),console[_0x1249f6(0x218)](_0x529161[_0x1249f6(0x24e)]),console[_0x1249f6(0x218)]('─'[_0x1249f6(0x1e4)](0x3c)));}for(const _0x47784f of _0x333a9b){_0x47784f[_0x1249f6(0x24e)]&&(console[_0x1249f6(0x218)](_0x1249f6(0x29b)+_0x47784f[_0x1249f6(0x205)]+'\x27:'),console['log']('─'['repeat'](0x3c)),console[_0x1249f6(0x218)](_0x47784f[_0x1249f6(0x24e)]),console[_0x1249f6(0x218)]('─'[_0x1249f6(0x1e4)](0x3c)));}for(const _0x141bdf of _0x54c949){_0x141bdf['diff']&&(console[_0x1249f6(0x218)](_0x1249f6(0x285)+_0x141bdf['name']+'\x27:'),console[_0x1249f6(0x218)]('─'[_0x1249f6(0x1e4)](0x3c)),console[_0x1249f6(0x218)](_0x141bdf[_0x1249f6(0x24e)]),console[_0x1249f6(0x218)]('─'[_0x1249f6(0x1e4)](0x3c)));}for(const _0x3b67e2 of _0x5e4e69){_0x3b67e2['diff']&&(console['log'](_0x1249f6(0x299)+_0x3b67e2[_0x1249f6(0x205)]+'\x27:'),console[_0x1249f6(0x218)]('─'[_0x1249f6(0x1e4)](0x3c)),console[_0x1249f6(0x218)](_0x3b67e2[_0x1249f6(0x24e)]),console[_0x1249f6(0x218)]('─'[_0x1249f6(0x1e4)](0x3c)));}for(const _0x4f381c of _0x3796c5){_0x4f381c[_0x1249f6(0x24e)]&&(console[_0x1249f6(0x218)](_0x1249f6(0x20c)+_0x4f381c['name']+'\x27:'),console[_0x1249f6(0x218)]('─'[_0x1249f6(0x1e4)](0x3c)),console['log'](_0x4f381c[_0x1249f6(0x24e)]),console['log']('─'[_0x1249f6(0x1e4)](0x3c)));}}function a4_0x4f9e(_0x5a9bd8,_0x6551c9){_0x5a9bd8=_0x5a9bd8-0x1e3;const _0x437646=a4_0x4376();let _0x4f9ec6=_0x437646[_0x5a9bd8];return _0x4f9ec6;}export class AgentPullCommand extends BaseCommand{[a4_0x289b8c(0x205)]='agent:pull';[a4_0x289b8c(0x289)]='Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files';async[a4_0x289b8c(0x234)](_0x558ff3){const _0x2cbcd8=a4_0x289b8c,{options:_0x40610c,args:_0x265e1f,tdx:_0xcc76d1}=_0x558ff3,_0x3e7b09=_0x265e1f[0x0],_0x4e8709=_0x265e1f[0x1],_0x33e414=_0x40610c[_0x2cbcd8(0x261)],_0x1b38ee=_0x40610c['dryRun'],_0x43b43b=_0x40610c[_0x2cbcd8(0x292)],_0x4d70ef=_0x40610c[_0x2cbcd8(0x271)],_0x3067a4=_0x40610c[_0x2cbcd8(0x211)];let _0x522a67,_0x425dd3;const _0x599c1b=findAgentConfigPath(process[_0x2cbcd8(0x257)]());if(_0x3e7b09){const _0x1538a7=a4_0x32317e['join'](_0x3e7b09,_0x2cbcd8(0x1e5));if(existsSync(_0x1538a7))try{const _0x32b49a=JSON[_0x2cbcd8(0x215)](readFileSync(_0x1538a7,_0x2cbcd8(0x24d)));_0x522a67=_0x32b49a[_0x2cbcd8(0x279)],_0x425dd3=_0x3e7b09,console[_0x2cbcd8(0x218)](a4_0x1d1f14['dim']('Using\x20project\x20from\x20'+_0x1538a7+':\x20'+_0x522a67));}catch{_0x522a67=_0x3e7b09;}else _0x522a67=_0x3e7b09;}else{if(_0x599c1b)try{const _0x47a48e=JSON[_0x2cbcd8(0x215)](readFileSync(_0x599c1b,_0x2cbcd8(0x24d)));_0x522a67=_0x47a48e[_0x2cbcd8(0x279)],_0x425dd3=a4_0x32317e[_0x2cbcd8(0x227)](_0x599c1b),console['log'](a4_0x1d1f14['dim'](_0x2cbcd8(0x226)+_0x522a67));}catch{_0x522a67=_0x3067a4;}else _0x522a67=_0x3067a4;}if(!_0x522a67)return console[_0x2cbcd8(0x218)](a4_0x1d1f14[_0x2cbcd8(0x231)](_0x2cbcd8(0x26a))),console['log'](_0x2cbcd8(0x256)),console[_0x2cbcd8(0x218)](_0x2cbcd8(0x22c)),console[_0x2cbcd8(0x218)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory'),console[_0x2cbcd8(0x218)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20#\x20Pull\x20specific\x20agent'),0x1;if(_0x4e8709){const {data:_0x26a3c5}=await withSpinner(_0x2cbcd8(0x27b)+_0x4e8709+_0x2cbcd8(0x27e)+_0x522a67+_0x2cbcd8(0x1e9),()=>_0xcc76d1[_0x2cbcd8(0x26e)][_0x2cbcd8(0x1e3)](_0x522a67,_0x4e8709,_0x33e414,{'dryRun':_0x1b38ee,'force':_0x43b43b}));if(_0x1b38ee)return console[_0x2cbcd8(0x218)](a4_0x1d1f14[_0x2cbcd8(0x231)](_0x2cbcd8(0x260))),console[_0x2cbcd8(0x218)]('Would\x20pull\x20agent:\x20'+_0x26a3c5[_0x2cbcd8(0x288)]),console[_0x2cbcd8(0x218)](_0x2cbcd8(0x230)+_0x26a3c5[_0x2cbcd8(0x265)]),_0x26a3c5['diff']&&(console[_0x2cbcd8(0x218)](_0x2cbcd8(0x250)),console[_0x2cbcd8(0x218)]('─'[_0x2cbcd8(0x1e4)](0x3c)),console[_0x2cbcd8(0x218)](_0x26a3c5[_0x2cbcd8(0x24e)]),console[_0x2cbcd8(0x218)]('─'[_0x2cbcd8(0x1e4)](0x3c))),0x0;return console[_0x2cbcd8(0x218)](a4_0x1d1f14[_0x2cbcd8(0x1f3)](_0x2cbcd8(0x264))),console['log'](_0x2cbcd8(0x204)+_0x26a3c5[_0x2cbcd8(0x288)]),console[_0x2cbcd8(0x218)](_0x2cbcd8(0x26d)+_0x26a3c5[_0x2cbcd8(0x265)]),console[_0x2cbcd8(0x218)](_0x2cbcd8(0x28b)+(_0x26a3c5[_0x2cbcd8(0x21c)]?a4_0x1d1f14[_0x2cbcd8(0x1f3)](_0x2cbcd8(0x229)):_0x26a3c5[_0x2cbcd8(0x277)]?a4_0x1d1f14[_0x2cbcd8(0x231)](_0x2cbcd8(0x25a)):a4_0x1d1f14[_0x2cbcd8(0x21a)]('unchanged'))),0x0;}const _0x5285a9=_0x425dd3||_0x33e414,{data:_0x5667f5}=await withSpinner(_0x2cbcd8(0x1f0)+_0x522a67+_0x2cbcd8(0x1e9),()=>_0xcc76d1[_0x2cbcd8(0x26e)][_0x2cbcd8(0x248)](_0x522a67,_0x5285a9,{'dryRun':!![]})),_0x1610d6=_0x5667f5[_0x2cbcd8(0x216)]['agents'][_0x2cbcd8(0x229)]+_0x5667f5[_0x2cbcd8(0x216)]['knowledgeBases'][_0x2cbcd8(0x229)]+_0x5667f5[_0x2cbcd8(0x216)]['textKnowledgeBases'][_0x2cbcd8(0x229)]+_0x5667f5[_0x2cbcd8(0x216)]['prompts'][_0x2cbcd8(0x229)]+_0x5667f5['counts'][_0x2cbcd8(0x221)][_0x2cbcd8(0x229)]+_0x5667f5[_0x2cbcd8(0x216)][_0x2cbcd8(0x252)][_0x2cbcd8(0x229)]+_0x5667f5['counts']['experimentalArtifacts'][_0x2cbcd8(0x229)],_0x139f3e=_0x5667f5[_0x2cbcd8(0x216)]['agents'][_0x2cbcd8(0x25a)]+_0x5667f5[_0x2cbcd8(0x216)][_0x2cbcd8(0x1f2)]['updated']+_0x5667f5[_0x2cbcd8(0x216)][_0x2cbcd8(0x214)][_0x2cbcd8(0x25a)]+_0x5667f5[_0x2cbcd8(0x216)][_0x2cbcd8(0x22e)][_0x2cbcd8(0x25a)]+_0x5667f5[_0x2cbcd8(0x216)]['integrations'][_0x2cbcd8(0x25a)]+_0x5667f5[_0x2cbcd8(0x216)]['experimentalKnowledgeBases'][_0x2cbcd8(0x25a)]+_0x5667f5['counts'][_0x2cbcd8(0x1eb)][_0x2cbcd8(0x25a)],_0x33e688=_0x5667f5[_0x2cbcd8(0x216)][_0x2cbcd8(0x24f)]['unchanged']+_0x5667f5['counts']['knowledgeBases'][_0x2cbcd8(0x24a)]+_0x5667f5[_0x2cbcd8(0x216)]['textKnowledgeBases'][_0x2cbcd8(0x24a)]+_0x5667f5[_0x2cbcd8(0x216)]['prompts'][_0x2cbcd8(0x24a)]+_0x5667f5[_0x2cbcd8(0x216)][_0x2cbcd8(0x221)][_0x2cbcd8(0x24a)]+_0x5667f5[_0x2cbcd8(0x216)][_0x2cbcd8(0x252)][_0x2cbcd8(0x24a)]+_0x5667f5[_0x2cbcd8(0x216)][_0x2cbcd8(0x1eb)]['unchanged'];console['log'](_0x2cbcd8(0x1ee)+_0x5667f5[_0x2cbcd8(0x1fb)]+'\x27:'),console[_0x2cbcd8(0x218)]('\x20\x20'+a4_0x1d1f14[_0x2cbcd8(0x1f3)]('+\x20'+_0x1610d6+_0x2cbcd8(0x29c))+_0x2cbcd8(0x25d)+a4_0x1d1f14[_0x2cbcd8(0x231)]('~\x20'+_0x139f3e+_0x2cbcd8(0x28f))+_0x2cbcd8(0x25d)+a4_0x1d1f14[_0x2cbcd8(0x1fd)]('=\x20'+_0x33e688+_0x2cbcd8(0x23d))),console[_0x2cbcd8(0x218)]('\x20\x20Agents:\x20'+formatCountSummary(_0x5667f5[_0x2cbcd8(0x216)][_0x2cbcd8(0x24f)])),console[_0x2cbcd8(0x218)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x5667f5[_0x2cbcd8(0x216)][_0x2cbcd8(0x1f2)])),console['log'](_0x2cbcd8(0x200)+formatCountSummary(_0x5667f5[_0x2cbcd8(0x216)]['textKnowledgeBases'])),console[_0x2cbcd8(0x218)](_0x2cbcd8(0x217)+formatCountSummary(_0x5667f5[_0x2cbcd8(0x216)][_0x2cbcd8(0x22e)])),console[_0x2cbcd8(0x218)](_0x2cbcd8(0x275)+formatCountSummary(_0x5667f5[_0x2cbcd8(0x216)][_0x2cbcd8(0x221)]));const _0x1d99f7=_0x5667f5['counts'][_0x2cbcd8(0x252)][_0x2cbcd8(0x1fa)]>0x0||_0x5667f5[_0x2cbcd8(0x216)][_0x2cbcd8(0x1eb)][_0x2cbcd8(0x1fa)]>0x0;_0x1d99f7&&(console[_0x2cbcd8(0x218)](_0x2cbcd8(0x267)+formatCountSummary(_0x5667f5['counts'][_0x2cbcd8(0x252)])),console[_0x2cbcd8(0x218)](_0x2cbcd8(0x28e)+formatCountSummary(_0x5667f5[_0x2cbcd8(0x216)][_0x2cbcd8(0x1eb)])));console[_0x2cbcd8(0x218)](_0x2cbcd8(0x284)+a4_0x1d1f14['cyan'](_0x5667f5['outputDir'])),displayDiffs(_0x5667f5[_0x2cbcd8(0x24f)],_0x5667f5[_0x2cbcd8(0x1f2)],_0x5667f5[_0x2cbcd8(0x214)],_0x5667f5[_0x2cbcd8(0x22e)],_0x5667f5[_0x2cbcd8(0x221)],_0x5667f5[_0x2cbcd8(0x252)],_0x5667f5[_0x2cbcd8(0x1eb)]);if(_0x1b38ee)return console[_0x2cbcd8(0x218)](a4_0x1d1f14['yellow'](_0x2cbcd8(0x27f))),0x0;if(_0x1610d6===0x0&&_0x139f3e===0x0)return console[_0x2cbcd8(0x218)](a4_0x1d1f14['green'](_0x2cbcd8(0x297))),saveSessionContext({'llm_project':_0x5667f5['projectName']},_0x40610c[_0x2cbcd8(0x1f4)]),console[_0x2cbcd8(0x218)](a4_0x1d1f14['green'](_0x2cbcd8(0x27a)+a4_0x1d1f14[_0x2cbcd8(0x1fd)](_0x2cbcd8(0x279))+_0x2cbcd8(0x1e8)+a4_0x1d1f14[_0x2cbcd8(0x272)](_0x5667f5['projectName']))),0x0;if(!_0x4d70ef&&!_0x43b43b){if(!isInteractive())return console[_0x2cbcd8(0x25e)](a4_0x1d1f14[_0x2cbcd8(0x1f8)](_0x2cbcd8(0x253)),_0x2cbcd8(0x24b)),console[_0x2cbcd8(0x25e)](a4_0x1d1f14[_0x2cbcd8(0x1fd)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x180ea5=await confirmKey(_0x2cbcd8(0x25b)+(_0x1610d6+_0x139f3e)+_0x2cbcd8(0x1f1));if(!_0x180ea5)return console['log'](a4_0x1d1f14[_0x2cbcd8(0x231)](_0x2cbcd8(0x274)),'-\x20no\x20files\x20written'),0x1;}const {data:_0x219497}=await withSpinner('Writing\x20files...',()=>_0xcc76d1[_0x2cbcd8(0x26e)][_0x2cbcd8(0x248)](_0x522a67,_0x5285a9,{'force':_0x43b43b}));return console[_0x2cbcd8(0x218)](a4_0x1d1f14[_0x2cbcd8(0x1f3)](_0x2cbcd8(0x255)+(_0x1610d6+_0x139f3e)+_0x2cbcd8(0x244)+_0x219497[_0x2cbcd8(0x27c)])),saveSessionContext({'llm_project':_0x219497[_0x2cbcd8(0x1fb)]},_0x40610c[_0x2cbcd8(0x1f4)]),console[_0x2cbcd8(0x218)](a4_0x1d1f14[_0x2cbcd8(0x1f3)](_0x2cbcd8(0x27a)+a4_0x1d1f14[_0x2cbcd8(0x1fd)]('llm_project')+_0x2cbcd8(0x1e8)+a4_0x1d1f14['cyan'](_0x219497[_0x2cbcd8(0x1fb)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{['name']=a4_0x289b8c(0x26c);[a4_0x289b8c(0x289)]=a4_0x289b8c(0x242);async[a4_0x289b8c(0x234)](_0x57770e){const _0x1013f4=a4_0x289b8c,{options:_0x362ffb,args:_0x4581f7,tdx:_0x2fb9de}=_0x57770e,_0x46736d=_0x4581f7[0x0],_0x50924c=_0x362ffb[_0x1013f4(0x205)],_0x22d53b=_0x362ffb[_0x1013f4(0x243)],_0x290963=_0x362ffb[_0x1013f4(0x271)],_0x549564=_0x362ffb[_0x1013f4(0x290)],_0x2c8f17=_0x362ffb['llmProject'];let _0x37d1a5;const _0x818d01=findAgentConfigPath(process[_0x1013f4(0x257)]());if(_0x46736d){const _0x5eb487=a4_0x32317e['join'](_0x46736d,'tdx.json');existsSync(_0x5eb487)?(_0x37d1a5=_0x46736d,console['log'](a4_0x1d1f14[_0x1013f4(0x1fd)](_0x1013f4(0x263)+_0x46736d))):_0x37d1a5=_0x46736d;}else{if(_0x818d01)_0x37d1a5=a4_0x32317e['dirname'](_0x818d01),console['log'](a4_0x1d1f14[_0x1013f4(0x1fd)](_0x1013f4(0x21b)+_0x37d1a5));else{if(_0x2c8f17){const _0x32a06d=sanitizeForFilesystem(_0x2c8f17);let _0x426c8d=_0x32a06d,_0x38abfe=a4_0x32317e[_0x1013f4(0x23e)](process[_0x1013f4(0x257)](),_0x1013f4(0x24f),_0x32a06d,_0x1013f4(0x1e5));if(!existsSync(_0x38abfe)){const _0x4b993c=normalizeName(_0x2c8f17),_0x571cd2=a4_0x32317e['join'](process['cwd'](),_0x1013f4(0x24f),_0x4b993c,_0x1013f4(0x1e5));existsSync(_0x571cd2)&&(_0x426c8d=_0x4b993c,_0x38abfe=_0x571cd2);}if(existsSync(_0x38abfe))_0x37d1a5=a4_0x32317e[_0x1013f4(0x227)](_0x38abfe),console['log'](a4_0x1d1f14[_0x1013f4(0x1fd)]('Using\x20local\x20project:\x20'+_0x37d1a5));else{const _0x487506=_0x362ffb[_0x1013f4(0x1fe)];if(_0x487506)throw new SDKError(ErrorCode[_0x1013f4(0x207)],'Cannot\x20clone\x20from\x20context\x20project\x20\x22'+_0x2c8f17+_0x1013f4(0x21d),undefined,{'helpText':_0x1013f4(0x20d)+_0x1013f4(0x1e7)+('\x20\x20tdx\x20agent\x20pull\x20'+_0x2c8f17+'\x0a')+('\x20\x20tdx\x20agent\x20clone\x20agents/'+_0x426c8d+'\x20--name\x20'+(_0x50924c||_0x1013f4(0x222))+_0x1013f4(0x22d)+_0x487506)});_0x37d1a5=_0x2c8f17,console['log'](a4_0x1d1f14['dim'](_0x1013f4(0x23f)+_0x2c8f17));}}}}if(!_0x37d1a5)return console[_0x1013f4(0x218)](a4_0x1d1f14[_0x1013f4(0x231)](_0x1013f4(0x293))),console['log']('\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project'),console[_0x1013f4(0x218)](_0x1013f4(0x251)),console[_0x1013f4(0x218)]('\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[_0x1013f4(0x218)]('\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>'),0x1;if(!_0x50924c)throw new SDKError(ErrorCode[_0x1013f4(0x291)],_0x1013f4(0x233),undefined,{'helpText':_0x1013f4(0x210)});if(!_0x290963&&!_0x22d53b){if(!isInteractive())return console[_0x1013f4(0x25e)](a4_0x1d1f14[_0x1013f4(0x1f8)](_0x1013f4(0x253)),_0x1013f4(0x24b)),console[_0x1013f4(0x25e)](a4_0x1d1f14[_0x1013f4(0x1fd)](_0x1013f4(0x212))),0x1;const _0x173dfd=await confirmKey(_0x1013f4(0x208)+_0x37d1a5+_0x1013f4(0x276)+_0x50924c+'\x22?');if(!_0x173dfd)return console[_0x1013f4(0x218)](a4_0x1d1f14[_0x1013f4(0x231)](_0x1013f4(0x274))),0x1;}const {data:_0x2ea9e9}=await withSpinner(_0x1013f4(0x295)+_0x37d1a5+_0x1013f4(0x281)+_0x50924c+_0x1013f4(0x1e9),()=>_0x2fb9de['llm'][_0x1013f4(0x213)](_0x37d1a5,_0x50924c,{'dryRun':_0x22d53b}));if(_0x22d53b){console[_0x1013f4(0x218)](a4_0x1d1f14[_0x1013f4(0x231)](_0x1013f4(0x258))),console[_0x1013f4(0x218)](_0x1013f4(0x28d)+_0x2ea9e9[_0x1013f4(0x238)]),console[_0x1013f4(0x218)](_0x1013f4(0x283)+_0x50924c),console[_0x1013f4(0x218)](_0x1013f4(0x1f6)),console[_0x1013f4(0x218)](_0x1013f4(0x22a)+_0x2ea9e9[_0x1013f4(0x216)]['agents'][_0x1013f4(0x278)]),console[_0x1013f4(0x218)](_0x1013f4(0x20b)+_0x2ea9e9[_0x1013f4(0x216)]['knowledgeBases'][_0x1013f4(0x278)]),console[_0x1013f4(0x218)](_0x1013f4(0x217)+_0x2ea9e9[_0x1013f4(0x216)][_0x1013f4(0x22e)][_0x1013f4(0x278)]);const _0x128089=_0x2ea9e9[_0x1013f4(0x216)][_0x1013f4(0x252)]['created']>0x0||_0x2ea9e9['counts'][_0x1013f4(0x1eb)]['created']>0x0;return _0x128089&&(console['log'](_0x1013f4(0x267)+_0x2ea9e9[_0x1013f4(0x216)][_0x1013f4(0x252)]['created']),console[_0x1013f4(0x218)]('\x20\x20Experimental\x20Artifacts:\x20'+_0x2ea9e9['counts']['experimentalArtifacts'][_0x1013f4(0x278)])),0x0;}const _0x45bdad=_0x2ea9e9[_0x1013f4(0x216)][_0x1013f4(0x24f)][_0x1013f4(0x228)]>0x0||_0x2ea9e9['counts'][_0x1013f4(0x1f2)][_0x1013f4(0x228)]>0x0||_0x2ea9e9[_0x1013f4(0x216)][_0x1013f4(0x22e)][_0x1013f4(0x228)]>0x0||_0x2ea9e9[_0x1013f4(0x216)]['experimentalKnowledgeBases'][_0x1013f4(0x228)]>0x0||_0x2ea9e9[_0x1013f4(0x216)][_0x1013f4(0x1eb)]['errors']>0x0;_0x45bdad?console[_0x1013f4(0x218)](a4_0x1d1f14[_0x1013f4(0x231)](_0x1013f4(0x1f5))):console[_0x1013f4(0x218)](a4_0x1d1f14[_0x1013f4(0x1f3)](_0x1013f4(0x1ec)));console[_0x1013f4(0x218)](_0x1013f4(0x28d)+_0x2ea9e9['sourceProjectName']),console[_0x1013f4(0x218)](_0x1013f4(0x283)+_0x2ea9e9[_0x1013f4(0x25c)]),console[_0x1013f4(0x218)](_0x1013f4(0x1ed)+_0x2ea9e9[_0x1013f4(0x1f7)]),console[_0x1013f4(0x218)](),console['log'](_0x1013f4(0x20f)),console[_0x1013f4(0x218)](_0x1013f4(0x22a)+formatCountSummary(_0x2ea9e9[_0x1013f4(0x216)]['agents'])),console[_0x1013f4(0x218)](_0x1013f4(0x20b)+formatCountSummary(_0x2ea9e9[_0x1013f4(0x216)][_0x1013f4(0x1f2)])),console[_0x1013f4(0x218)](_0x1013f4(0x217)+formatCountSummary(_0x2ea9e9[_0x1013f4(0x216)][_0x1013f4(0x22e)])),console[_0x1013f4(0x218)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x2ea9e9[_0x1013f4(0x216)][_0x1013f4(0x221)]));const _0x2b597e=_0x2ea9e9[_0x1013f4(0x216)][_0x1013f4(0x252)][_0x1013f4(0x278)]>0x0||_0x2ea9e9[_0x1013f4(0x216)][_0x1013f4(0x252)][_0x1013f4(0x25a)]>0x0||_0x2ea9e9[_0x1013f4(0x216)][_0x1013f4(0x252)][_0x1013f4(0x24a)]>0x0||_0x2ea9e9[_0x1013f4(0x216)][_0x1013f4(0x1eb)][_0x1013f4(0x278)]>0x0||_0x2ea9e9[_0x1013f4(0x216)][_0x1013f4(0x1eb)][_0x1013f4(0x25a)]>0x0||_0x2ea9e9['counts'][_0x1013f4(0x1eb)]['unchanged']>0x0;_0x2b597e&&(console[_0x1013f4(0x218)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x2ea9e9[_0x1013f4(0x216)][_0x1013f4(0x252)])),console['log'](_0x1013f4(0x28e)+formatCountSummary(_0x2ea9e9[_0x1013f4(0x216)]['experimentalArtifacts'])));if(_0x45bdad){console[_0x1013f4(0x218)](),console[_0x1013f4(0x218)](a4_0x1d1f14[_0x1013f4(0x1f8)]('Errors:'));for(const _0x2105bb of _0x2ea9e9[_0x1013f4(0x24f)]){_0x2105bb[_0x1013f4(0x237)]===_0x1013f4(0x25e)&&console[_0x1013f4(0x218)](a4_0x1d1f14[_0x1013f4(0x1f8)](_0x1013f4(0x22b)+_0x2105bb['agentName']+_0x1013f4(0x28a)+_0x2105bb[_0x1013f4(0x25e)]));}for(const _0x3ecb53 of _0x2ea9e9['knowledgeBases']){_0x3ecb53['action']===_0x1013f4(0x25e)&&console[_0x1013f4(0x218)](a4_0x1d1f14[_0x1013f4(0x1f8)]('\x20\x20Knowledge\x20Base\x20\x22'+_0x3ecb53[_0x1013f4(0x205)]+_0x1013f4(0x28a)+_0x3ecb53[_0x1013f4(0x25e)]));}for(const _0x7841a8 of _0x2ea9e9[_0x1013f4(0x22e)]){_0x7841a8[_0x1013f4(0x237)]===_0x1013f4(0x25e)&&console[_0x1013f4(0x218)](a4_0x1d1f14['red'](_0x1013f4(0x22f)+_0x7841a8['name']+'\x22:\x20'+_0x7841a8['error']));}for(const _0x2d7fad of _0x2ea9e9[_0x1013f4(0x221)]){_0x2d7fad[_0x1013f4(0x237)]===_0x1013f4(0x25e)&&console[_0x1013f4(0x218)](a4_0x1d1f14['red'](_0x1013f4(0x1fc)+_0x2d7fad[_0x1013f4(0x205)]+_0x1013f4(0x28a)+_0x2d7fad[_0x1013f4(0x25e)]));}for(const _0x4b1769 of _0x2ea9e9['experimentalKnowledgeBases']){_0x4b1769[_0x1013f4(0x237)]===_0x1013f4(0x25e)&&console[_0x1013f4(0x218)](a4_0x1d1f14[_0x1013f4(0x1f8)](_0x1013f4(0x246)+_0x4b1769['name']+'\x22:\x20'+_0x4b1769[_0x1013f4(0x25e)]));}for(const _0x51f169 of _0x2ea9e9[_0x1013f4(0x1eb)]){_0x51f169['action']===_0x1013f4(0x25e)&&console['log'](a4_0x1d1f14[_0x1013f4(0x1f8)](_0x1013f4(0x268)+_0x51f169[_0x1013f4(0x205)]+_0x1013f4(0x28a)+_0x51f169[_0x1013f4(0x25e)]));}return 0x1;}console['log']();const _0x24081c=getLLMProjectUrl(_0x549564,_0x2ea9e9[_0x1013f4(0x1f7)]);return console['log']('Project:\x20'+a4_0x1d1f14[_0x1013f4(0x272)](_0x24081c)),0x0;}}export class AgentPushCommand extends BaseCommand{['name']=a4_0x289b8c(0x259);[a4_0x289b8c(0x289)]=a4_0x289b8c(0x206);async['execute'](_0x56a013){const _0x38471c=a4_0x289b8c,{options:_0x564073,args:_0x2dbe16,tdx:_0x6c24f}=_0x56a013;let _0x206f0b=_0x2dbe16[0x0]||process[_0x38471c(0x257)]();const _0x48535e=_0x564073['dryRun'],_0x37f94f=_0x564073[_0x38471c(0x292)],_0x47e386=_0x564073[_0x38471c(0x271)],_0x5c5d8b=_0x564073[_0x38471c(0x290)],_0x18a5e9=a4_0x32317e[_0x38471c(0x23e)](_0x206f0b,_0x38471c(0x29e)),_0xc96b04=existsSync(_0x18a5e9);if(_0xc96b04){const {data:_0x4968fc}=await withSpinner('Pushing\x20agent\x20from\x20\x22'+_0x206f0b+'\x22...',()=>_0x6c24f[_0x38471c(0x26e)][_0x38471c(0x1ff)](_0x206f0b,{'dryRun':_0x48535e,'force':_0x37f94f}));if(_0x48535e)return console[_0x38471c(0x218)](a4_0x1d1f14[_0x38471c(0x231)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x38471c(0x218)](_0x38471c(0x235)+_0x4968fc[_0x38471c(0x288)]),0x0;if(_0x4968fc[_0x38471c(0x237)]===_0x38471c(0x25e))return console[_0x38471c(0x218)](a4_0x1d1f14[_0x38471c(0x1f8)](_0x38471c(0x1f9)+_0x4968fc[_0x38471c(0x25e)])),0x1;console[_0x38471c(0x218)](a4_0x1d1f14[_0x38471c(0x1f3)](_0x38471c(0x20e)+_0x4968fc[_0x38471c(0x237)]+_0x38471c(0x240))),console['log'](_0x38471c(0x204)+_0x4968fc[_0x38471c(0x288)]);if(_0x4968fc['agentId']&&_0x4968fc[_0x38471c(0x294)]){const _0x5001a1=getLLMAgentChatUrl(_0x5c5d8b,_0x4968fc[_0x38471c(0x294)],_0x4968fc[_0x38471c(0x21e)]);console[_0x38471c(0x218)](_0x38471c(0x269)+a4_0x1d1f14[_0x38471c(0x272)](_0x5001a1));}return 0x0;}const _0x1570eb=_0x564073['llmProject'],_0x30eddb=resolveProjectFromContext(_0x206f0b,_0x1570eb);if(_0x30eddb[_0x38471c(0x224)])_0x206f0b=_0x30eddb[_0x38471c(0x296)],_0x30eddb[_0x38471c(0x29d)]==='context'&&console[_0x38471c(0x218)](a4_0x1d1f14[_0x38471c(0x1fd)](_0x38471c(0x226)+_0x206f0b));else{let _0x555b45=_0x38471c(0x25f);_0x30eddb[_0x38471c(0x24c)]===_0x38471c(0x239)&&(_0x555b45=_0x30eddb[_0x38471c(0x241)]+_0x38471c(0x249)+_0x30eddb[_0x38471c(0x211)]+_0x38471c(0x23c));throw new SDKError(ErrorCode[_0x38471c(0x207)],_0x30eddb[_0x38471c(0x24c)]===_0x38471c(0x273)?_0x30eddb['message']:_0x38471c(0x280)+_0x206f0b,undefined,{'helpText':_0x555b45});}const {data:_0x29ef0c}=await withSpinner(_0x38471c(0x20a),()=>_0x6c24f[_0x38471c(0x26e)][_0x38471c(0x1ea)](_0x206f0b,{'dryRun':!![]})),_0x4aeb44=_0x29ef0c['counts'][_0x38471c(0x24f)][_0x38471c(0x228)]>0x0;if(_0x4aeb44){console['log'](a4_0x1d1f14['red'](_0x38471c(0x29a)));for(const _0x3383e0 of _0x29ef0c['agents']){_0x3383e0[_0x38471c(0x237)]===_0x38471c(0x25e)&&console['log'](a4_0x1d1f14['red'](_0x38471c(0x22b)+_0x3383e0[_0x38471c(0x288)]+_0x38471c(0x28a)+_0x3383e0['error']));}return 0x1;}const _0x2023f0=_0x29ef0c[_0x38471c(0x216)]['agents'][_0x38471c(0x278)]+_0x29ef0c['counts'][_0x38471c(0x1f2)][_0x38471c(0x278)]+_0x29ef0c[_0x38471c(0x216)][_0x38471c(0x214)][_0x38471c(0x278)]+_0x29ef0c[_0x38471c(0x216)][_0x38471c(0x22e)][_0x38471c(0x278)]+_0x29ef0c[_0x38471c(0x216)]['integrations'][_0x38471c(0x278)]+_0x29ef0c['counts']['experimentalKnowledgeBases'][_0x38471c(0x278)]+_0x29ef0c['counts']['experimentalArtifacts']['created'],_0xb2101b=_0x29ef0c[_0x38471c(0x216)][_0x38471c(0x24f)][_0x38471c(0x25a)]+_0x29ef0c['counts'][_0x38471c(0x1f2)][_0x38471c(0x25a)]+_0x29ef0c[_0x38471c(0x216)]['textKnowledgeBases'][_0x38471c(0x25a)]+_0x29ef0c['counts'][_0x38471c(0x22e)][_0x38471c(0x25a)]+_0x29ef0c['counts'][_0x38471c(0x221)][_0x38471c(0x25a)]+_0x29ef0c[_0x38471c(0x216)][_0x38471c(0x252)][_0x38471c(0x25a)]+_0x29ef0c['counts'][_0x38471c(0x1eb)]['updated'],_0x5f03bf=_0x29ef0c[_0x38471c(0x216)][_0x38471c(0x24f)][_0x38471c(0x24a)]+_0x29ef0c[_0x38471c(0x216)][_0x38471c(0x1f2)][_0x38471c(0x24a)]+_0x29ef0c[_0x38471c(0x216)][_0x38471c(0x214)][_0x38471c(0x24a)]+_0x29ef0c[_0x38471c(0x216)][_0x38471c(0x22e)][_0x38471c(0x24a)]+_0x29ef0c[_0x38471c(0x216)]['integrations']['unchanged']+_0x29ef0c[_0x38471c(0x216)]['experimentalKnowledgeBases'][_0x38471c(0x24a)]+_0x29ef0c[_0x38471c(0x216)][_0x38471c(0x1eb)][_0x38471c(0x24a)];console[_0x38471c(0x218)](_0x38471c(0x287)+_0x29ef0c['projectName']+'\x27:'),console[_0x38471c(0x218)]('\x20\x20'+a4_0x1d1f14[_0x38471c(0x1f3)]('+\x20'+_0x2023f0+_0x38471c(0x29c))+'\x20|\x20'+a4_0x1d1f14['yellow']('~\x20'+_0xb2101b+_0x38471c(0x28f))+'\x20|\x20'+a4_0x1d1f14[_0x38471c(0x1fd)]('=\x20'+_0x5f03bf+_0x38471c(0x23d))),console[_0x38471c(0x218)](_0x38471c(0x22a)+formatCountSummary(_0x29ef0c['counts'][_0x38471c(0x24f)])),console[_0x38471c(0x218)](_0x38471c(0x20b)+formatCountSummary(_0x29ef0c[_0x38471c(0x216)]['knowledgeBases'])),console[_0x38471c(0x218)](_0x38471c(0x200)+formatCountSummary(_0x29ef0c[_0x38471c(0x216)]['textKnowledgeBases'])),console[_0x38471c(0x218)](_0x38471c(0x217)+formatCountSummary(_0x29ef0c[_0x38471c(0x216)][_0x38471c(0x22e)])),console[_0x38471c(0x218)](_0x38471c(0x275)+formatCountSummary(_0x29ef0c[_0x38471c(0x216)][_0x38471c(0x221)]));const _0x30390c=_0x29ef0c[_0x38471c(0x216)][_0x38471c(0x252)]['created']>0x0||_0x29ef0c[_0x38471c(0x216)][_0x38471c(0x252)][_0x38471c(0x25a)]>0x0||_0x29ef0c[_0x38471c(0x216)][_0x38471c(0x252)][_0x38471c(0x24a)]>0x0||_0x29ef0c[_0x38471c(0x216)][_0x38471c(0x1eb)][_0x38471c(0x278)]>0x0||_0x29ef0c[_0x38471c(0x216)][_0x38471c(0x1eb)]['updated']>0x0||_0x29ef0c[_0x38471c(0x216)][_0x38471c(0x1eb)][_0x38471c(0x24a)]>0x0;_0x30390c&&(console[_0x38471c(0x218)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x29ef0c[_0x38471c(0x216)][_0x38471c(0x252)])),console[_0x38471c(0x218)](_0x38471c(0x28e)+formatCountSummary(_0x29ef0c['counts'][_0x38471c(0x1eb)])));console['log'](_0x38471c(0x23a)+a4_0x1d1f14['cyan'](_0x206f0b)),displayDiffs(_0x29ef0c[_0x38471c(0x24f)],_0x29ef0c[_0x38471c(0x1f2)],_0x29ef0c['textKnowledgeBases'],_0x29ef0c[_0x38471c(0x22e)],_0x29ef0c[_0x38471c(0x221)],_0x29ef0c[_0x38471c(0x252)],_0x29ef0c['experimentalArtifacts']);if(_0x48535e)return console[_0x38471c(0x218)](a4_0x1d1f14[_0x38471c(0x231)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed')),0x0;if(_0x2023f0===0x0&&_0xb2101b===0x0){console['log'](a4_0x1d1f14[_0x38471c(0x1f3)](_0x38471c(0x270)));const _0x2bf16a=getLLMProjectUrl(_0x5c5d8b,_0x29ef0c['projectId']);return console['log']('Project:\x20'+a4_0x1d1f14['cyan'](_0x2bf16a)),0x0;}if(!_0x47e386&&!_0x37f94f){if(!isInteractive())return console[_0x38471c(0x25e)](a4_0x1d1f14[_0x38471c(0x1f8)](_0x38471c(0x253)),_0x38471c(0x24b)),console[_0x38471c(0x25e)](a4_0x1d1f14[_0x38471c(0x1fd)](_0x38471c(0x212))),0x1;const _0xc1c682=await confirmKey(_0x38471c(0x23b)+(_0x2023f0+_0xb2101b)+_0x38471c(0x245));if(!_0xc1c682)return console[_0x38471c(0x218)](a4_0x1d1f14[_0x38471c(0x231)](_0x38471c(0x274)),_0x38471c(0x220)),0x1;}const {data:_0x39c098}=await withSpinner(_0x38471c(0x236),()=>_0x6c24f[_0x38471c(0x26e)][_0x38471c(0x1ea)](_0x206f0b,{'force':_0x37f94f})),_0x18bde=_0x39c098[_0x38471c(0x216)][_0x38471c(0x24f)][_0x38471c(0x228)]>0x0||_0x39c098[_0x38471c(0x216)][_0x38471c(0x1f2)][_0x38471c(0x228)]>0x0||_0x39c098[_0x38471c(0x216)][_0x38471c(0x214)][_0x38471c(0x228)]>0x0||_0x39c098['counts'][_0x38471c(0x22e)][_0x38471c(0x228)]>0x0;if(_0x18bde){console['log'](a4_0x1d1f14[_0x38471c(0x231)](_0x38471c(0x286))),console['log'](),console[_0x38471c(0x218)](a4_0x1d1f14[_0x38471c(0x1f8)]('Errors:'));for(const _0x255b1f of _0x39c098[_0x38471c(0x24f)]){_0x255b1f[_0x38471c(0x237)]===_0x38471c(0x25e)&&console[_0x38471c(0x218)](a4_0x1d1f14['red'](_0x38471c(0x22b)+_0x255b1f[_0x38471c(0x288)]+_0x38471c(0x28a)+_0x255b1f[_0x38471c(0x25e)]));}for(const _0x436f5e of _0x39c098[_0x38471c(0x1f2)]){_0x436f5e[_0x38471c(0x237)]===_0x38471c(0x25e)&&console['log'](a4_0x1d1f14[_0x38471c(0x1f8)](_0x38471c(0x298)+_0x436f5e[_0x38471c(0x205)]+_0x38471c(0x28a)+_0x436f5e['error']));}for(const _0x3b4ffc of _0x39c098[_0x38471c(0x214)]){_0x3b4ffc[_0x38471c(0x237)]===_0x38471c(0x25e)&&console[_0x38471c(0x218)](a4_0x1d1f14[_0x38471c(0x1f8)](_0x38471c(0x232)+_0x3b4ffc[_0x38471c(0x205)]+_0x38471c(0x28a)+_0x3b4ffc['error']));}for(const _0x57d09a of _0x39c098[_0x38471c(0x22e)]){_0x57d09a[_0x38471c(0x237)]===_0x38471c(0x25e)&&console[_0x38471c(0x218)](a4_0x1d1f14['red'](_0x38471c(0x22f)+_0x57d09a[_0x38471c(0x205)]+_0x38471c(0x28a)+_0x57d09a['error']));}for(const _0x9fb8f0 of _0x39c098[_0x38471c(0x221)]){_0x9fb8f0[_0x38471c(0x237)]==='error'&&console[_0x38471c(0x218)](a4_0x1d1f14[_0x38471c(0x1f8)]('\x20\x20Integration\x20\x22'+_0x9fb8f0[_0x38471c(0x205)]+_0x38471c(0x28a)+_0x9fb8f0['error']));}return 0x1;}console[_0x38471c(0x218)](a4_0x1d1f14[_0x38471c(0x1f3)](_0x38471c(0x203)+(_0x2023f0+_0xb2101b)+_0x38471c(0x262)+_0x39c098['projectName']+'\x27'));const _0x1b0e99=getLLMProjectUrl(_0x5c5d8b,_0x39c098['projectId']);return console['log']('Project:\x20'+a4_0x1d1f14[_0x38471c(0x272)](_0x1b0e99)),0x0;}}
1
+ const a4_0x266ed6=a4_0x173b;(function(_0x4cb0ca,_0x47065d){const _0x180463=a4_0x173b,_0x1a49e9=_0x4cb0ca();while(!![]){try{const _0x26be3c=-parseInt(_0x180463(0xbb))/0x1*(-parseInt(_0x180463(0xd5))/0x2)+-parseInt(_0x180463(0x103))/0x3+-parseInt(_0x180463(0xdf))/0x4+-parseInt(_0x180463(0xed))/0x5*(parseInt(_0x180463(0x10b))/0x6)+-parseInt(_0x180463(0xc4))/0x7*(parseInt(_0x180463(0xe0))/0x8)+-parseInt(_0x180463(0xaf))/0x9*(-parseInt(_0x180463(0xe7))/0xa)+parseInt(_0x180463(0xdb))/0xb;if(_0x26be3c===_0x47065d)break;else _0x1a49e9['push'](_0x1a49e9['shift']());}catch(_0x163ed8){_0x1a49e9['push'](_0x1a49e9['shift']());}}}(a4_0xb399,0xf381c));import a4_0x51ad2e from'chalk';import a4_0x53d24e from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';function a4_0xb399(){const _0x1b033d=['Status:\x20','Cloning\x20\x22','experimentalArtifacts','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','agent:push','join','execute','\x20\x20Agent\x20\x22','\x20\x20tdx\x20agent\x20pull\x20','parse','\x20files?','\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)','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','Failed\x20to\x20push\x20agent:\x20','projectName','agent:pull','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','\x0aError:','pushProject','23058rjtdbj','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','push','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','outputPath','Would\x20push\x20agent:\x20','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','llm','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','Dry\x20run\x20-\x20no\x20files\x20written','Agent\x20pulled\x20successfully','Project\x20cloned\x20successfully','241027REQhaY','Cancelled','\x0a✔\x20Pulled\x20','knowledgeBases','yes','Using\x20context\x20project:\x20','\x20unchanged','\x20\x20Target:\x20','new','124145ovUqUc','\x20updated','site','cloneProject','\x20\x20Integration\x20\x22','prompts','yellow','\x20new','\x20successfully','dim','dryRun','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','total','found','\x20errors','diff','description','16JijLPi','agent.yml','agentName','\x20\x20Text\x20Knowledge\x20Bases:\x20','\x20\x20Agents:\x20','MISSING_ARGUMENT','23485286ZTiFTo','Analyzing\x20changes\x20to\x20push...','Analyzing\x20project\x20\x22','Pushing\x20to\x20project...','927384nNtcGQ','272xiDgtZ','✔\x20Context\x20set:\x20','pullAgent','Pushing\x20agent\x20from\x20\x22','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','Errors:','\x0aErrors\x20found:','170yNgEdk','Source:\x20','hasChanges','Output\x20path:\x20','\x20\x20Experimental\x20Artifacts:\x20','tdx.json','46245qNONPR','\x22\x20to\x20\x22','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','Writing\x20files...','Chat:\x20','no_local_folder','cwd','Would\x20clone:','Would\x20pull\x20agent:\x20','\x0aProject\x20pushed\x20with\x20errors','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','-\x20no\x20files\x20written','\x20--name\x20','agentId','sourceProjectName','Project:\x20','force','unchanged','no_context','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','textKnowledgeBases','\x20\x20tdx\x20agent\x20clone\x20agents/','4132209hufUPb','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','\x0aChanges\x20to\x20integration\x20\x27','newProjectName','\x20|\x20','Using\x20local\x20project:\x20','action','\x0a✔\x20Pushed\x20','582bVYVSE','New\x20project\x20ID:\x20','\x20created','llmProject','Summary:','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','log','reason','projectId','cyan','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','updated','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','\x20\x20Knowledge\x20Base\x20\x22','outputDir','pullProject','green','integrations','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','\x20changed','error','\x20--profile\x20','\x20=\x20','Project\x20cloned\x20with\x20errors','\x0aChanges\x20to\x20agent\x20\x27','\x22...','\x20\x20Source:\x20','\x20\x20Knowledge\x20Bases:\x20','newProjectId','Agent\x20','message','Pulling\x20agent\x20\x22','agents','gray','errors','source','Cannot\x20clone\x20from\x20context\x20project\x20\x22','\x20\x20Prompts:\x20','\x0aPush\x20','session','repeat','red','New\x20project:\x20','No\x20tdx.json\x20found\x20in\x20','counts','New\x20project\x20name\x20is\x20required','\x0aPush\x20summary\x20for\x20\x27','experimentalKnowledgeBases','name','\x20\x20Integrations:\x20','\x22\x20to\x20a\x20different\x20profile','\x20\x20Experimental\x20Artifact\x20\x22','llm_project','\x22\x20to\x20new\x20project\x20\x22','created','\x0aPull\x20summary\x20for\x20\x27','\x22:\x20','dirname','utf-8','Using\x20current\x20project:\x20','Using\x20project\x20from\x20','context','Using\x20project:\x20','pushAgent','\x0aChanges\x20to\x20prompt\x20\x27','\x20\x20Prompt\x20\x22','\x0aWrite\x20','\x20\x20Experimental\x20Knowledge\x20Bases:\x20'];a4_0xb399=function(){return _0x1b033d;};return a4_0xb399();}function a4_0x173b(_0x5ecf81,_0x2c8e95){_0x5ecf81=_0x5ecf81-0x8c;const _0xb399d0=a4_0xb399();let _0x173ba1=_0xb399d0[_0x5ecf81];return _0x173ba1;}import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x4f536b){const _0xc3672e=a4_0x173b,_0x4abf57=[];if(_0x4f536b[_0xc3672e(0xd0)]!==undefined)_0x4abf57['push'](_0x4f536b[_0xc3672e(0xd0)]+'\x20total');if(_0x4f536b[_0xc3672e(0xc3)]!==undefined&&_0x4f536b['new']>0x0)_0x4abf57[_0xc3672e(0xb1)](a4_0x51ad2e[_0xc3672e(0x11b)](_0x4f536b[_0xc3672e(0xc3)]+'\x20new'));if(_0x4f536b[_0xc3672e(0x8d)]!==undefined&&_0x4f536b[_0xc3672e(0x8d)]>0x0)_0x4abf57[_0xc3672e(0xb1)](a4_0x51ad2e[_0xc3672e(0x11b)](_0x4f536b['created']+_0xc3672e(0x10d)));if(_0x4f536b['updated']!==undefined&&_0x4f536b[_0xc3672e(0x116)]>0x0)_0x4abf57[_0xc3672e(0xb1)](a4_0x51ad2e[_0xc3672e(0xca)](_0x4f536b[_0xc3672e(0x116)]+_0xc3672e(0xc5)));if(_0x4f536b['unchanged']!==undefined&&_0x4f536b[_0xc3672e(0xfe)]>0x0)_0x4abf57[_0xc3672e(0xb1)](a4_0x51ad2e['gray'](_0x4f536b[_0xc3672e(0xfe)]+_0xc3672e(0xc1)));if(_0x4f536b[_0xc3672e(0x12d)]!==undefined&&_0x4f536b[_0xc3672e(0x12d)]>0x0)_0x4abf57[_0xc3672e(0xb1)](a4_0x51ad2e[_0xc3672e(0x134)](_0x4f536b[_0xc3672e(0x12d)]+_0xc3672e(0xd2)));return _0x4abf57[_0xc3672e(0xa0)](',\x20');}function displayDiffs(_0x1ded88,_0x3bab3a,_0x2be646,_0x141ee1,_0xa2fcf9,_0x2356c6,_0xbe6080){const _0x25121f=a4_0x173b;for(const _0x2ae0cb of _0x1ded88){if(_0x2ae0cb[_0x25121f(0xd3)]){const _0x4d1048=_0x2ae0cb[_0x25121f(0xd7)]||_0x2ae0cb[_0x25121f(0x13b)];console[_0x25121f(0x111)](_0x25121f(0x123)+_0x4d1048+'\x27:'),console[_0x25121f(0x111)]('─'[_0x25121f(0x133)](0x3c)),console['log'](_0x2ae0cb[_0x25121f(0xd3)]),console[_0x25121f(0x111)]('─'['repeat'](0x3c));}}for(const _0x27702c of _0x3bab3a){_0x27702c[_0x25121f(0xd3)]&&(console[_0x25121f(0x111)](_0x25121f(0x104)+_0x27702c[_0x25121f(0x13b)]+'\x27:'),console[_0x25121f(0x111)]('─'[_0x25121f(0x133)](0x3c)),console[_0x25121f(0x111)](_0x27702c[_0x25121f(0xd3)]),console[_0x25121f(0x111)]('─'[_0x25121f(0x133)](0x3c)));}for(const _0xf8abd of _0x2be646){_0xf8abd[_0x25121f(0xd3)]&&(console['log'](_0x25121f(0xb0)+_0xf8abd['name']+'\x27:'),console['log']('─'['repeat'](0x3c)),console[_0x25121f(0x111)](_0xf8abd['diff']),console[_0x25121f(0x111)]('─'[_0x25121f(0x133)](0x3c)));}for(const _0x5222a0 of _0x141ee1){_0x5222a0[_0x25121f(0xd3)]&&(console['log'](_0x25121f(0x97)+_0x5222a0[_0x25121f(0x13b)]+'\x27:'),console[_0x25121f(0x111)]('─'[_0x25121f(0x133)](0x3c)),console[_0x25121f(0x111)](_0x5222a0['diff']),console[_0x25121f(0x111)]('─'[_0x25121f(0x133)](0x3c)));}for(const _0xbf7362 of _0xa2fcf9){_0xbf7362[_0x25121f(0xd3)]&&(console[_0x25121f(0x111)](_0x25121f(0x105)+_0xbf7362[_0x25121f(0x13b)]+'\x27:'),console[_0x25121f(0x111)]('─'[_0x25121f(0x133)](0x3c)),console['log'](_0xbf7362[_0x25121f(0xd3)]),console[_0x25121f(0x111)]('─'[_0x25121f(0x133)](0x3c)));}for(const _0x5a553e of _0x2356c6){_0x5a553e[_0x25121f(0xd3)]&&(console['log'](_0x25121f(0xef)+_0x5a553e[_0x25121f(0x13b)]+'\x27:'),console['log']('─'[_0x25121f(0x133)](0x3c)),console[_0x25121f(0x111)](_0x5a553e[_0x25121f(0xd3)]),console['log']('─'[_0x25121f(0x133)](0x3c)));}for(const _0xbd6801 of _0xbe6080){_0xbd6801[_0x25121f(0xd3)]&&(console['log'](_0x25121f(0x11d)+_0xbd6801['name']+'\x27:'),console['log']('─'[_0x25121f(0x133)](0x3c)),console['log'](_0xbd6801['diff']),console[_0x25121f(0x111)]('─'['repeat'](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x266ed6(0x13b)]=a4_0x266ed6(0xab);[a4_0x266ed6(0xd4)]=a4_0x266ed6(0xb5);async[a4_0x266ed6(0xa1)](_0x3e17c9){const _0x3320d7=a4_0x266ed6,{options:_0x567d27,args:_0x5eefe6,tdx:_0x1a0f2d}=_0x3e17c9,_0x160ea1=_0x5eefe6[0x0],_0x1bcf69=_0x5eefe6[0x1],_0xfc93ce=_0x567d27['output'],_0x22688b=_0x567d27[_0x3320d7(0xce)],_0x4506b4=_0x567d27[_0x3320d7(0xfd)],_0x2c8d14=_0x567d27['yes'],_0x2a8633=_0x567d27[_0x3320d7(0x10e)];let _0x1012e2,_0x22696e;const _0x373cbc=findAgentConfigPath(process[_0x3320d7(0xf3)]());if(_0x160ea1){const _0x533c69=a4_0x53d24e[_0x3320d7(0xa0)](_0x160ea1,'tdx.json');if(existsSync(_0x533c69))try{const _0x20bc70=JSON['parse'](readFileSync(_0x533c69,'utf-8'));_0x1012e2=_0x20bc70[_0x3320d7(0x13f)],_0x22696e=_0x160ea1,console['log'](a4_0x51ad2e['dim'](_0x3320d7(0x93)+_0x533c69+':\x20'+_0x1012e2));}catch{_0x1012e2=_0x160ea1;}else _0x1012e2=_0x160ea1;}else{if(_0x373cbc)try{const _0x26209b=JSON[_0x3320d7(0xa4)](readFileSync(_0x373cbc,_0x3320d7(0x91)));_0x1012e2=_0x26209b['llm_project'],_0x22696e=a4_0x53d24e[_0x3320d7(0x90)](_0x373cbc),console[_0x3320d7(0x111)](a4_0x51ad2e[_0x3320d7(0xcd)](_0x3320d7(0x95)+_0x1012e2));}catch{_0x1012e2=_0x2a8633;}else _0x1012e2=_0x2a8633;}if(!_0x1012e2)return console['log'](a4_0x51ad2e[_0x3320d7(0xca)]('llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a')),console[_0x3320d7(0x111)]('Usage:\x20tdx\x20agent\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20project\x20(requires\x20context\x20or\x20tdx.json)'),console[_0x3320d7(0x111)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project'),console[_0x3320d7(0x111)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory'),console[_0x3320d7(0x111)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20#\x20Pull\x20specific\x20agent'),0x1;if(_0x1bcf69){const {data:_0x163548}=await withSpinner(_0x3320d7(0x12a)+_0x1bcf69+'\x22\x20from\x20project\x20\x22'+_0x1012e2+_0x3320d7(0x124),()=>_0x1a0f2d[_0x3320d7(0xb6)][_0x3320d7(0xe2)](_0x1012e2,_0x1bcf69,_0xfc93ce,{'dryRun':_0x22688b,'force':_0x4506b4}));if(_0x22688b)return console[_0x3320d7(0x111)](a4_0x51ad2e[_0x3320d7(0xca)](_0x3320d7(0xb8))),console[_0x3320d7(0x111)](_0x3320d7(0xf5)+_0x163548[_0x3320d7(0xd7)]),console[_0x3320d7(0x111)](_0x3320d7(0xea)+_0x163548[_0x3320d7(0xb3)]),_0x163548['diff']&&(console[_0x3320d7(0x111)]('\x0aChanges:'),console[_0x3320d7(0x111)]('─'[_0x3320d7(0x133)](0x3c)),console[_0x3320d7(0x111)](_0x163548[_0x3320d7(0xd3)]),console['log']('─'[_0x3320d7(0x133)](0x3c))),0x0;return console[_0x3320d7(0x111)](a4_0x51ad2e['green'](_0x3320d7(0xb9))),console['log']('Agent:\x20'+_0x163548[_0x3320d7(0xd7)]),console[_0x3320d7(0x111)]('Output:\x20'+_0x163548[_0x3320d7(0xb3)]),console[_0x3320d7(0x111)](_0x3320d7(0x9b)+(_0x163548['isNew']?a4_0x51ad2e[_0x3320d7(0x11b)]('new'):_0x163548[_0x3320d7(0xe9)]?a4_0x51ad2e[_0x3320d7(0xca)]('updated'):a4_0x51ad2e[_0x3320d7(0x12c)](_0x3320d7(0xfe)))),0x0;}const _0x1102d2=_0x22696e||_0xfc93ce,{data:_0x2d9792}=await withSpinner(_0x3320d7(0xdd)+_0x1012e2+_0x3320d7(0x124),()=>_0x1a0f2d[_0x3320d7(0xb6)][_0x3320d7(0x11a)](_0x1012e2,_0x1102d2,{'dryRun':!![]})),_0x500f85=_0x2d9792[_0x3320d7(0x137)][_0x3320d7(0x12b)][_0x3320d7(0xc3)]+_0x2d9792[_0x3320d7(0x137)]['knowledgeBases'][_0x3320d7(0xc3)]+_0x2d9792[_0x3320d7(0x137)][_0x3320d7(0x101)][_0x3320d7(0xc3)]+_0x2d9792[_0x3320d7(0x137)][_0x3320d7(0xc9)][_0x3320d7(0xc3)]+_0x2d9792[_0x3320d7(0x137)][_0x3320d7(0x11c)]['new']+_0x2d9792[_0x3320d7(0x137)][_0x3320d7(0x13a)][_0x3320d7(0xc3)]+_0x2d9792[_0x3320d7(0x137)][_0x3320d7(0x9d)][_0x3320d7(0xc3)],_0x37e9ff=_0x2d9792['counts'][_0x3320d7(0x12b)][_0x3320d7(0x116)]+_0x2d9792[_0x3320d7(0x137)][_0x3320d7(0xbe)][_0x3320d7(0x116)]+_0x2d9792['counts'][_0x3320d7(0x101)][_0x3320d7(0x116)]+_0x2d9792[_0x3320d7(0x137)][_0x3320d7(0xc9)][_0x3320d7(0x116)]+_0x2d9792[_0x3320d7(0x137)][_0x3320d7(0x11c)][_0x3320d7(0x116)]+_0x2d9792[_0x3320d7(0x137)][_0x3320d7(0x13a)][_0x3320d7(0x116)]+_0x2d9792[_0x3320d7(0x137)][_0x3320d7(0x9d)]['updated'],_0x420409=_0x2d9792[_0x3320d7(0x137)][_0x3320d7(0x12b)]['unchanged']+_0x2d9792[_0x3320d7(0x137)][_0x3320d7(0xbe)]['unchanged']+_0x2d9792[_0x3320d7(0x137)]['textKnowledgeBases'][_0x3320d7(0xfe)]+_0x2d9792[_0x3320d7(0x137)][_0x3320d7(0xc9)][_0x3320d7(0xfe)]+_0x2d9792[_0x3320d7(0x137)][_0x3320d7(0x11c)][_0x3320d7(0xfe)]+_0x2d9792['counts']['experimentalKnowledgeBases']['unchanged']+_0x2d9792[_0x3320d7(0x137)][_0x3320d7(0x9d)][_0x3320d7(0xfe)];console[_0x3320d7(0x111)](_0x3320d7(0x8e)+_0x2d9792[_0x3320d7(0xaa)]+'\x27:'),console[_0x3320d7(0x111)]('\x20\x20'+a4_0x51ad2e[_0x3320d7(0x11b)]('+\x20'+_0x500f85+_0x3320d7(0xcb))+_0x3320d7(0x107)+a4_0x51ad2e[_0x3320d7(0xca)]('~\x20'+_0x37e9ff+_0x3320d7(0x11e))+_0x3320d7(0x107)+a4_0x51ad2e['dim']('=\x20'+_0x420409+'\x20unchanged')),console['log'](_0x3320d7(0xd9)+formatCountSummary(_0x2d9792[_0x3320d7(0x137)][_0x3320d7(0x12b)])),console[_0x3320d7(0x111)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x2d9792[_0x3320d7(0x137)]['knowledgeBases'])),console[_0x3320d7(0x111)](_0x3320d7(0xd8)+formatCountSummary(_0x2d9792[_0x3320d7(0x137)][_0x3320d7(0x101)])),console[_0x3320d7(0x111)](_0x3320d7(0x130)+formatCountSummary(_0x2d9792[_0x3320d7(0x137)][_0x3320d7(0xc9)])),console[_0x3320d7(0x111)](_0x3320d7(0x13c)+formatCountSummary(_0x2d9792[_0x3320d7(0x137)][_0x3320d7(0x11c)]));const _0x5e260a=_0x2d9792[_0x3320d7(0x137)]['experimentalKnowledgeBases'][_0x3320d7(0xd0)]>0x0||_0x2d9792['counts'][_0x3320d7(0x9d)][_0x3320d7(0xd0)]>0x0;_0x5e260a&&(console[_0x3320d7(0x111)](_0x3320d7(0x9a)+formatCountSummary(_0x2d9792[_0x3320d7(0x137)][_0x3320d7(0x13a)])),console['log'](_0x3320d7(0xeb)+formatCountSummary(_0x2d9792[_0x3320d7(0x137)][_0x3320d7(0x9d)])));console['log'](_0x3320d7(0xc2)+a4_0x51ad2e[_0x3320d7(0x114)](_0x2d9792['outputDir'])),displayDiffs(_0x2d9792[_0x3320d7(0x12b)],_0x2d9792[_0x3320d7(0xbe)],_0x2d9792['textKnowledgeBases'],_0x2d9792[_0x3320d7(0xc9)],_0x2d9792['integrations'],_0x2d9792['experimentalKnowledgeBases'],_0x2d9792['experimentalArtifacts']);if(_0x22688b)return console[_0x3320d7(0x111)](a4_0x51ad2e[_0x3320d7(0xca)](_0x3320d7(0xa7))),0x0;if(_0x500f85===0x0&&_0x37e9ff===0x0)return console[_0x3320d7(0x111)](a4_0x51ad2e[_0x3320d7(0x11b)]('\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'llm_project':_0x2d9792[_0x3320d7(0xaa)]},_0x567d27[_0x3320d7(0x132)]),console['log'](a4_0x51ad2e[_0x3320d7(0x11b)](_0x3320d7(0xe1)+a4_0x51ad2e[_0x3320d7(0xcd)](_0x3320d7(0x13f))+_0x3320d7(0x121)+a4_0x51ad2e[_0x3320d7(0x114)](_0x2d9792[_0x3320d7(0xaa)]))),0x0;if(!_0x2c8d14&&!_0x4506b4){if(!isInteractive())return console[_0x3320d7(0x11f)](a4_0x51ad2e[_0x3320d7(0x134)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x3320d7(0x11f)](a4_0x51ad2e[_0x3320d7(0xcd)](_0x3320d7(0x115))),0x1;const _0x574d92=await confirmKey(_0x3320d7(0x99)+(_0x500f85+_0x37e9ff)+_0x3320d7(0xa5));if(!_0x574d92)return console[_0x3320d7(0x111)](a4_0x51ad2e[_0x3320d7(0xca)](_0x3320d7(0xbc)),_0x3320d7(0xf8)),0x1;}const {data:_0x28f4f5}=await withSpinner(_0x3320d7(0xf0),()=>_0x1a0f2d[_0x3320d7(0xb6)]['pullProject'](_0x1012e2,_0x1102d2,{'force':_0x4506b4}));return console['log'](a4_0x51ad2e[_0x3320d7(0x11b)](_0x3320d7(0xbd)+(_0x500f85+_0x37e9ff)+'\x20files\x20to\x20'+_0x28f4f5[_0x3320d7(0x119)])),saveSessionContext({'llm_project':_0x28f4f5[_0x3320d7(0xaa)]},_0x567d27['session']),console[_0x3320d7(0x111)](a4_0x51ad2e['green'](_0x3320d7(0xe1)+a4_0x51ad2e[_0x3320d7(0xcd)](_0x3320d7(0x13f))+_0x3320d7(0x121)+a4_0x51ad2e[_0x3320d7(0x114)](_0x28f4f5[_0x3320d7(0xaa)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x266ed6(0x13b)]='agent:clone';['description']=a4_0x266ed6(0xcf);async[a4_0x266ed6(0xa1)](_0x32325e){const _0x167934=a4_0x266ed6,{options:_0xab88fb,args:_0x1405a6,tdx:_0x49bc1b}=_0x32325e,_0x15fadb=_0x1405a6[0x0],_0x43317f=_0xab88fb['name'],_0x106324=_0xab88fb[_0x167934(0xce)],_0x2fd414=_0xab88fb[_0x167934(0xbf)],_0x52d5fc=_0xab88fb[_0x167934(0xc6)],_0x47aa0b=_0xab88fb[_0x167934(0x10e)];let _0x99ff21;const _0x432863=findAgentConfigPath(process[_0x167934(0xf3)]());if(_0x15fadb){const _0x2be10d=a4_0x53d24e[_0x167934(0xa0)](_0x15fadb,_0x167934(0xec));existsSync(_0x2be10d)?(_0x99ff21=_0x15fadb,console[_0x167934(0x111)](a4_0x51ad2e[_0x167934(0xcd)](_0x167934(0x108)+_0x15fadb))):_0x99ff21=_0x15fadb;}else{if(_0x432863)_0x99ff21=a4_0x53d24e[_0x167934(0x90)](_0x432863),console[_0x167934(0x111)](a4_0x51ad2e['dim'](_0x167934(0x92)+_0x99ff21));else{if(_0x47aa0b){const _0x56a3db=sanitizeForFilesystem(_0x47aa0b);let _0x22021a=_0x56a3db,_0x13e4e8=a4_0x53d24e[_0x167934(0xa0)](process['cwd'](),_0x167934(0x12b),_0x56a3db,'tdx.json');if(!existsSync(_0x13e4e8)){const _0x148aa6=normalizeName(_0x47aa0b),_0x26a5b9=a4_0x53d24e[_0x167934(0xa0)](process[_0x167934(0xf3)](),_0x167934(0x12b),_0x148aa6,_0x167934(0xec));existsSync(_0x26a5b9)&&(_0x22021a=_0x148aa6,_0x13e4e8=_0x26a5b9);}if(existsSync(_0x13e4e8))_0x99ff21=a4_0x53d24e['dirname'](_0x13e4e8),console[_0x167934(0x111)](a4_0x51ad2e[_0x167934(0xcd)]('Using\x20local\x20project:\x20'+_0x99ff21));else{const _0x45a7a7=_0xab88fb['profile'];if(_0x45a7a7)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x167934(0x12f)+_0x47aa0b+_0x167934(0x13d),undefined,{'helpText':_0x167934(0x117)+'First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a'+(_0x167934(0xa3)+_0x47aa0b+'\x0a')+(_0x167934(0x102)+_0x22021a+_0x167934(0xf9)+(_0x43317f||'<new-name>')+_0x167934(0x120)+_0x45a7a7)});_0x99ff21=_0x47aa0b,console[_0x167934(0x111)](a4_0x51ad2e['dim'](_0x167934(0xc0)+_0x47aa0b));}}}}if(!_0x99ff21)return console['log'](a4_0x51ad2e[_0x167934(0xca)](_0x167934(0xb2))),console[_0x167934(0x111)]('\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project'),console[_0x167934(0x111)](_0x167934(0xe4)),console['log'](_0x167934(0xa6)),console['log']('\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>'),0x1;if(!_0x43317f)throw new SDKError(ErrorCode[_0x167934(0xda)],_0x167934(0x138),undefined,{'helpText':_0x167934(0xa8)});if(!_0x2fd414&&!_0x106324){if(!isInteractive())return console[_0x167934(0x11f)](a4_0x51ad2e[_0x167934(0x134)]('\x0aError:'),_0x167934(0x9e)),console[_0x167934(0x11f)](a4_0x51ad2e['dim'](_0x167934(0x115))),0x1;const _0x38144e=await confirmKey('Clone\x20\x22'+_0x99ff21+_0x167934(0x8c)+_0x43317f+'\x22?');if(!_0x38144e)return console[_0x167934(0x111)](a4_0x51ad2e[_0x167934(0xca)](_0x167934(0xbc))),0x1;}const {data:_0x2c3d17}=await withSpinner(_0x167934(0x9c)+_0x99ff21+_0x167934(0xee)+_0x43317f+_0x167934(0x124),()=>_0x49bc1b[_0x167934(0xb6)][_0x167934(0xc7)](_0x99ff21,_0x43317f,{'dryRun':_0x106324}));if(_0x106324){console[_0x167934(0x111)](a4_0x51ad2e['yellow']('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x167934(0x111)](_0x167934(0xe8)+_0x2c3d17[_0x167934(0xfb)]),console[_0x167934(0x111)](_0x167934(0x135)+_0x43317f),console['log'](_0x167934(0xf4)),console['log'](_0x167934(0xd9)+_0x2c3d17[_0x167934(0x137)][_0x167934(0x12b)][_0x167934(0x8d)]),console[_0x167934(0x111)]('\x20\x20Knowledge\x20Bases:\x20'+_0x2c3d17[_0x167934(0x137)][_0x167934(0xbe)]['created']),console[_0x167934(0x111)](_0x167934(0x130)+_0x2c3d17[_0x167934(0x137)][_0x167934(0xc9)]['created']);const _0x42376b=_0x2c3d17[_0x167934(0x137)]['experimentalKnowledgeBases'][_0x167934(0x8d)]>0x0||_0x2c3d17[_0x167934(0x137)][_0x167934(0x9d)][_0x167934(0x8d)]>0x0;return _0x42376b&&(console['log']('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+_0x2c3d17[_0x167934(0x137)][_0x167934(0x13a)]['created']),console['log'](_0x167934(0xeb)+_0x2c3d17[_0x167934(0x137)]['experimentalArtifacts']['created'])),0x0;}const _0x58aff6=_0x2c3d17[_0x167934(0x137)]['agents'][_0x167934(0x12d)]>0x0||_0x2c3d17[_0x167934(0x137)][_0x167934(0xbe)][_0x167934(0x12d)]>0x0||_0x2c3d17['counts']['prompts'][_0x167934(0x12d)]>0x0||_0x2c3d17[_0x167934(0x137)][_0x167934(0x13a)][_0x167934(0x12d)]>0x0||_0x2c3d17['counts'][_0x167934(0x9d)][_0x167934(0x12d)]>0x0;_0x58aff6?console[_0x167934(0x111)](a4_0x51ad2e[_0x167934(0xca)](_0x167934(0x122))):console['log'](a4_0x51ad2e[_0x167934(0x11b)](_0x167934(0xba)));console[_0x167934(0x111)](_0x167934(0xe8)+_0x2c3d17[_0x167934(0xfb)]),console[_0x167934(0x111)]('New\x20project:\x20'+_0x2c3d17[_0x167934(0x106)]),console['log'](_0x167934(0x10c)+_0x2c3d17[_0x167934(0x127)]),console[_0x167934(0x111)](),console[_0x167934(0x111)](_0x167934(0x10f)),console[_0x167934(0x111)](_0x167934(0xd9)+formatCountSummary(_0x2c3d17[_0x167934(0x137)][_0x167934(0x12b)])),console[_0x167934(0x111)](_0x167934(0x126)+formatCountSummary(_0x2c3d17[_0x167934(0x137)][_0x167934(0xbe)])),console['log']('\x20\x20Prompts:\x20'+formatCountSummary(_0x2c3d17[_0x167934(0x137)][_0x167934(0xc9)])),console[_0x167934(0x111)](_0x167934(0x13c)+formatCountSummary(_0x2c3d17['counts'][_0x167934(0x11c)]));const _0x35b633=_0x2c3d17['counts'][_0x167934(0x13a)]['created']>0x0||_0x2c3d17[_0x167934(0x137)]['experimentalKnowledgeBases'][_0x167934(0x116)]>0x0||_0x2c3d17['counts']['experimentalKnowledgeBases'][_0x167934(0xfe)]>0x0||_0x2c3d17[_0x167934(0x137)][_0x167934(0x9d)][_0x167934(0x8d)]>0x0||_0x2c3d17[_0x167934(0x137)]['experimentalArtifacts'][_0x167934(0x116)]>0x0||_0x2c3d17[_0x167934(0x137)]['experimentalArtifacts'][_0x167934(0xfe)]>0x0;_0x35b633&&(console[_0x167934(0x111)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x2c3d17[_0x167934(0x137)][_0x167934(0x13a)])),console['log'](_0x167934(0xeb)+formatCountSummary(_0x2c3d17['counts']['experimentalArtifacts'])));if(_0x58aff6){console[_0x167934(0x111)](),console[_0x167934(0x111)](a4_0x51ad2e['red'](_0x167934(0xe5)));for(const _0x51a3f6 of _0x2c3d17['agents']){_0x51a3f6[_0x167934(0x109)]===_0x167934(0x11f)&&console['log'](a4_0x51ad2e[_0x167934(0x134)](_0x167934(0xa2)+_0x51a3f6[_0x167934(0xd7)]+_0x167934(0x8f)+_0x51a3f6[_0x167934(0x11f)]));}for(const _0x150cd5 of _0x2c3d17[_0x167934(0xbe)]){_0x150cd5['action']==='error'&&console[_0x167934(0x111)](a4_0x51ad2e['red']('\x20\x20Knowledge\x20Base\x20\x22'+_0x150cd5['name']+_0x167934(0x8f)+_0x150cd5['error']));}for(const _0x54bc6f of _0x2c3d17[_0x167934(0xc9)]){_0x54bc6f['action']===_0x167934(0x11f)&&console[_0x167934(0x111)](a4_0x51ad2e[_0x167934(0x134)](_0x167934(0x98)+_0x54bc6f[_0x167934(0x13b)]+_0x167934(0x8f)+_0x54bc6f[_0x167934(0x11f)]));}for(const _0x422f62 of _0x2c3d17[_0x167934(0x11c)]){_0x422f62['action']===_0x167934(0x11f)&&console[_0x167934(0x111)](a4_0x51ad2e['red'](_0x167934(0xc8)+_0x422f62[_0x167934(0x13b)]+'\x22:\x20'+_0x422f62[_0x167934(0x11f)]));}for(const _0xf35ff4 of _0x2c3d17[_0x167934(0x13a)]){_0xf35ff4[_0x167934(0x109)]===_0x167934(0x11f)&&console['log'](a4_0x51ad2e['red'](_0x167934(0xb7)+_0xf35ff4['name']+_0x167934(0x8f)+_0xf35ff4['error']));}for(const _0x2ebca6 of _0x2c3d17[_0x167934(0x9d)]){_0x2ebca6[_0x167934(0x109)]===_0x167934(0x11f)&&console[_0x167934(0x111)](a4_0x51ad2e[_0x167934(0x134)](_0x167934(0x13e)+_0x2ebca6[_0x167934(0x13b)]+_0x167934(0x8f)+_0x2ebca6[_0x167934(0x11f)]));}return 0x1;}console[_0x167934(0x111)]();const _0x264671=getLLMProjectUrl(_0x52d5fc,_0x2c3d17['newProjectId']);return console[_0x167934(0x111)](_0x167934(0xfc)+a4_0x51ad2e[_0x167934(0x114)](_0x264671)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x266ed6(0x13b)]=a4_0x266ed6(0x9f);[a4_0x266ed6(0xd4)]='Push\x20local\x20agent\x20files\x20to\x20LLM\x20project';async[a4_0x266ed6(0xa1)](_0x21ee5b){const _0x45d6f6=a4_0x266ed6,{options:_0x374b5a,args:_0x113ebc,tdx:_0x330062}=_0x21ee5b;let _0x47a256=_0x113ebc[0x0]||process['cwd']();const _0x5e24e0=_0x374b5a['dryRun'],_0x6c3886=_0x374b5a[_0x45d6f6(0xfd)],_0x569e1f=_0x374b5a[_0x45d6f6(0xbf)],_0x11815a=_0x374b5a[_0x45d6f6(0xc6)],_0x52db83=a4_0x53d24e[_0x45d6f6(0xa0)](_0x47a256,_0x45d6f6(0xd6)),_0x209cd4=existsSync(_0x52db83);if(_0x209cd4){const {data:_0x3a6bcc}=await withSpinner(_0x45d6f6(0xe3)+_0x47a256+_0x45d6f6(0x124),()=>_0x330062[_0x45d6f6(0xb6)][_0x45d6f6(0x96)](_0x47a256,{'dryRun':_0x5e24e0,'force':_0x6c3886}));if(_0x5e24e0)return console[_0x45d6f6(0x111)](a4_0x51ad2e[_0x45d6f6(0xca)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x45d6f6(0x111)](_0x45d6f6(0xb4)+_0x3a6bcc[_0x45d6f6(0xd7)]),0x0;if(_0x3a6bcc[_0x45d6f6(0x109)]==='error')return console[_0x45d6f6(0x111)](a4_0x51ad2e[_0x45d6f6(0x134)](_0x45d6f6(0xa9)+_0x3a6bcc[_0x45d6f6(0x11f)])),0x1;console['log'](a4_0x51ad2e[_0x45d6f6(0x11b)](_0x45d6f6(0x128)+_0x3a6bcc[_0x45d6f6(0x109)]+_0x45d6f6(0xcc))),console['log']('Agent:\x20'+_0x3a6bcc[_0x45d6f6(0xd7)]);if(_0x3a6bcc[_0x45d6f6(0xfa)]&&_0x3a6bcc[_0x45d6f6(0x113)]){const _0x487a78=getLLMAgentChatUrl(_0x11815a,_0x3a6bcc['projectId'],_0x3a6bcc['agentId']);console[_0x45d6f6(0x111)](_0x45d6f6(0xf1)+a4_0x51ad2e[_0x45d6f6(0x114)](_0x487a78));}return 0x0;}const _0x515694=_0x374b5a[_0x45d6f6(0x10e)],_0x569f43=resolveProjectFromContext(_0x47a256,_0x515694);if(_0x569f43[_0x45d6f6(0xd1)])_0x47a256=_0x569f43['projectDir'],_0x569f43[_0x45d6f6(0x12e)]===_0x45d6f6(0x94)&&console['log'](a4_0x51ad2e[_0x45d6f6(0xcd)](_0x45d6f6(0x95)+_0x47a256));else{let _0x269832=_0x45d6f6(0x110);_0x569f43[_0x45d6f6(0x112)]===_0x45d6f6(0xf2)&&(_0x269832=_0x569f43[_0x45d6f6(0x129)]+_0x45d6f6(0x100)+_0x569f43[_0x45d6f6(0x10e)]+'\x27\x20to\x20create\x20the\x20folder\x20structure.');throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x569f43[_0x45d6f6(0x112)]===_0x45d6f6(0xff)?_0x569f43[_0x45d6f6(0x129)]:_0x45d6f6(0x136)+_0x47a256,undefined,{'helpText':_0x269832});}const {data:_0x4f9496}=await withSpinner(_0x45d6f6(0xdc),()=>_0x330062[_0x45d6f6(0xb6)][_0x45d6f6(0xae)](_0x47a256,{'dryRun':!![]})),_0x1a9645=_0x4f9496[_0x45d6f6(0x137)][_0x45d6f6(0x12b)][_0x45d6f6(0x12d)]>0x0;if(_0x1a9645){console[_0x45d6f6(0x111)](a4_0x51ad2e[_0x45d6f6(0x134)](_0x45d6f6(0xe6)));for(const _0x327125 of _0x4f9496[_0x45d6f6(0x12b)]){_0x327125[_0x45d6f6(0x109)]==='error'&&console['log'](a4_0x51ad2e['red']('\x20\x20Agent\x20\x22'+_0x327125[_0x45d6f6(0xd7)]+_0x45d6f6(0x8f)+_0x327125[_0x45d6f6(0x11f)]));}return 0x1;}const _0x540b2c=_0x4f9496['counts'][_0x45d6f6(0x12b)][_0x45d6f6(0x8d)]+_0x4f9496[_0x45d6f6(0x137)][_0x45d6f6(0xbe)]['created']+_0x4f9496['counts']['textKnowledgeBases'][_0x45d6f6(0x8d)]+_0x4f9496['counts'][_0x45d6f6(0xc9)]['created']+_0x4f9496[_0x45d6f6(0x137)][_0x45d6f6(0x11c)][_0x45d6f6(0x8d)]+_0x4f9496[_0x45d6f6(0x137)]['experimentalKnowledgeBases']['created']+_0x4f9496[_0x45d6f6(0x137)][_0x45d6f6(0x9d)]['created'],_0x376418=_0x4f9496[_0x45d6f6(0x137)][_0x45d6f6(0x12b)][_0x45d6f6(0x116)]+_0x4f9496['counts'][_0x45d6f6(0xbe)][_0x45d6f6(0x116)]+_0x4f9496[_0x45d6f6(0x137)]['textKnowledgeBases'][_0x45d6f6(0x116)]+_0x4f9496[_0x45d6f6(0x137)][_0x45d6f6(0xc9)]['updated']+_0x4f9496[_0x45d6f6(0x137)]['integrations']['updated']+_0x4f9496['counts'][_0x45d6f6(0x13a)][_0x45d6f6(0x116)]+_0x4f9496[_0x45d6f6(0x137)][_0x45d6f6(0x9d)][_0x45d6f6(0x116)],_0x4dc5cb=_0x4f9496[_0x45d6f6(0x137)][_0x45d6f6(0x12b)][_0x45d6f6(0xfe)]+_0x4f9496[_0x45d6f6(0x137)]['knowledgeBases'][_0x45d6f6(0xfe)]+_0x4f9496[_0x45d6f6(0x137)][_0x45d6f6(0x101)][_0x45d6f6(0xfe)]+_0x4f9496['counts'][_0x45d6f6(0xc9)]['unchanged']+_0x4f9496['counts'][_0x45d6f6(0x11c)][_0x45d6f6(0xfe)]+_0x4f9496[_0x45d6f6(0x137)][_0x45d6f6(0x13a)][_0x45d6f6(0xfe)]+_0x4f9496[_0x45d6f6(0x137)][_0x45d6f6(0x9d)][_0x45d6f6(0xfe)];console[_0x45d6f6(0x111)](_0x45d6f6(0x139)+_0x4f9496[_0x45d6f6(0xaa)]+'\x27:'),console[_0x45d6f6(0x111)]('\x20\x20'+a4_0x51ad2e[_0x45d6f6(0x11b)]('+\x20'+_0x540b2c+_0x45d6f6(0xcb))+'\x20|\x20'+a4_0x51ad2e[_0x45d6f6(0xca)]('~\x20'+_0x376418+_0x45d6f6(0x11e))+'\x20|\x20'+a4_0x51ad2e[_0x45d6f6(0xcd)]('=\x20'+_0x4dc5cb+_0x45d6f6(0xc1))),console['log']('\x20\x20Agents:\x20'+formatCountSummary(_0x4f9496['counts'][_0x45d6f6(0x12b)])),console[_0x45d6f6(0x111)](_0x45d6f6(0x126)+formatCountSummary(_0x4f9496['counts'][_0x45d6f6(0xbe)])),console[_0x45d6f6(0x111)](_0x45d6f6(0xd8)+formatCountSummary(_0x4f9496[_0x45d6f6(0x137)]['textKnowledgeBases'])),console['log'](_0x45d6f6(0x130)+formatCountSummary(_0x4f9496[_0x45d6f6(0x137)][_0x45d6f6(0xc9)])),console['log'](_0x45d6f6(0x13c)+formatCountSummary(_0x4f9496[_0x45d6f6(0x137)][_0x45d6f6(0x11c)]));const _0x5bbd62=_0x4f9496[_0x45d6f6(0x137)]['experimentalKnowledgeBases'][_0x45d6f6(0x8d)]>0x0||_0x4f9496[_0x45d6f6(0x137)][_0x45d6f6(0x13a)]['updated']>0x0||_0x4f9496['counts'][_0x45d6f6(0x13a)][_0x45d6f6(0xfe)]>0x0||_0x4f9496[_0x45d6f6(0x137)][_0x45d6f6(0x9d)][_0x45d6f6(0x8d)]>0x0||_0x4f9496[_0x45d6f6(0x137)][_0x45d6f6(0x9d)]['updated']>0x0||_0x4f9496['counts'][_0x45d6f6(0x9d)][_0x45d6f6(0xfe)]>0x0;_0x5bbd62&&(console[_0x45d6f6(0x111)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x4f9496[_0x45d6f6(0x137)]['experimentalKnowledgeBases'])),console['log'](_0x45d6f6(0xeb)+formatCountSummary(_0x4f9496['counts'][_0x45d6f6(0x9d)])));console[_0x45d6f6(0x111)](_0x45d6f6(0x125)+a4_0x51ad2e[_0x45d6f6(0x114)](_0x47a256)),displayDiffs(_0x4f9496[_0x45d6f6(0x12b)],_0x4f9496[_0x45d6f6(0xbe)],_0x4f9496['textKnowledgeBases'],_0x4f9496[_0x45d6f6(0xc9)],_0x4f9496[_0x45d6f6(0x11c)],_0x4f9496[_0x45d6f6(0x13a)],_0x4f9496[_0x45d6f6(0x9d)]);if(_0x5e24e0)return console[_0x45d6f6(0x111)](a4_0x51ad2e[_0x45d6f6(0xca)](_0x45d6f6(0xac))),0x0;if(_0x540b2c===0x0&&_0x376418===0x0){console[_0x45d6f6(0x111)](a4_0x51ad2e[_0x45d6f6(0x11b)](_0x45d6f6(0xf7)));const _0x1117d1=getLLMProjectUrl(_0x11815a,_0x4f9496[_0x45d6f6(0x113)]);return console[_0x45d6f6(0x111)](_0x45d6f6(0xfc)+a4_0x51ad2e['cyan'](_0x1117d1)),0x0;}if(!_0x569e1f&&!_0x6c3886){if(!isInteractive())return console[_0x45d6f6(0x11f)](a4_0x51ad2e['red'](_0x45d6f6(0xad)),_0x45d6f6(0x9e)),console[_0x45d6f6(0x11f)](a4_0x51ad2e[_0x45d6f6(0xcd)](_0x45d6f6(0x115))),0x1;const _0x5e9055=await confirmKey(_0x45d6f6(0x131)+(_0x540b2c+_0x376418)+'\x20resources?');if(!_0x5e9055)return console[_0x45d6f6(0x111)](a4_0x51ad2e[_0x45d6f6(0xca)](_0x45d6f6(0xbc)),'-\x20nothing\x20pushed'),0x1;}const {data:_0x19768e}=await withSpinner(_0x45d6f6(0xde),()=>_0x330062[_0x45d6f6(0xb6)][_0x45d6f6(0xae)](_0x47a256,{'force':_0x6c3886})),_0x2dd39c=_0x19768e[_0x45d6f6(0x137)][_0x45d6f6(0x12b)][_0x45d6f6(0x12d)]>0x0||_0x19768e['counts'][_0x45d6f6(0xbe)][_0x45d6f6(0x12d)]>0x0||_0x19768e['counts'][_0x45d6f6(0x101)][_0x45d6f6(0x12d)]>0x0||_0x19768e['counts'][_0x45d6f6(0xc9)][_0x45d6f6(0x12d)]>0x0;if(_0x2dd39c){console['log'](a4_0x51ad2e['yellow'](_0x45d6f6(0xf6))),console[_0x45d6f6(0x111)](),console[_0x45d6f6(0x111)](a4_0x51ad2e['red'](_0x45d6f6(0xe5)));for(const _0x42423e of _0x19768e[_0x45d6f6(0x12b)]){_0x42423e[_0x45d6f6(0x109)]==='error'&&console['log'](a4_0x51ad2e[_0x45d6f6(0x134)]('\x20\x20Agent\x20\x22'+_0x42423e[_0x45d6f6(0xd7)]+_0x45d6f6(0x8f)+_0x42423e[_0x45d6f6(0x11f)]));}for(const _0x23f493 of _0x19768e[_0x45d6f6(0xbe)]){_0x23f493[_0x45d6f6(0x109)]===_0x45d6f6(0x11f)&&console[_0x45d6f6(0x111)](a4_0x51ad2e[_0x45d6f6(0x134)](_0x45d6f6(0x118)+_0x23f493['name']+_0x45d6f6(0x8f)+_0x23f493[_0x45d6f6(0x11f)]));}for(const _0x1feb4d of _0x19768e[_0x45d6f6(0x101)]){_0x1feb4d['action']===_0x45d6f6(0x11f)&&console[_0x45d6f6(0x111)](a4_0x51ad2e[_0x45d6f6(0x134)]('\x20\x20Text\x20Knowledge\x20Base\x20\x22'+_0x1feb4d[_0x45d6f6(0x13b)]+_0x45d6f6(0x8f)+_0x1feb4d[_0x45d6f6(0x11f)]));}for(const _0x533e1a of _0x19768e['prompts']){_0x533e1a[_0x45d6f6(0x109)]===_0x45d6f6(0x11f)&&console[_0x45d6f6(0x111)](a4_0x51ad2e[_0x45d6f6(0x134)](_0x45d6f6(0x98)+_0x533e1a[_0x45d6f6(0x13b)]+_0x45d6f6(0x8f)+_0x533e1a[_0x45d6f6(0x11f)]));}for(const _0x38f7cc of _0x19768e[_0x45d6f6(0x11c)]){_0x38f7cc[_0x45d6f6(0x109)]==='error'&&console['log'](a4_0x51ad2e[_0x45d6f6(0x134)]('\x20\x20Integration\x20\x22'+_0x38f7cc['name']+_0x45d6f6(0x8f)+_0x38f7cc['error']));}return 0x1;}console['log'](a4_0x51ad2e['green'](_0x45d6f6(0x10a)+(_0x540b2c+_0x376418)+'\x20resources\x20to\x20\x27'+_0x19768e['projectName']+'\x27'));const _0x29e9e0=getLLMProjectUrl(_0x11815a,_0x19768e[_0x45d6f6(0x113)]);return console[_0x45d6f6(0x111)](_0x45d6f6(0xfc)+a4_0x51ad2e[_0x45d6f6(0x114)](_0x29e9e0)),0x0;}}
@@ -1 +1 @@
1
- const a5_0x27bec5=a5_0xa3f2;(function(_0x20a027,_0x17a998){const _0xf60ad6=a5_0xa3f2,_0x5a7d1b=_0x20a027();while(!![]){try{const _0xa0d2fe=-parseInt(_0xf60ad6(0x1e0))/0x1+-parseInt(_0xf60ad6(0x17e))/0x2*(-parseInt(_0xf60ad6(0x1d1))/0x3)+-parseInt(_0xf60ad6(0x175))/0x4+parseInt(_0xf60ad6(0x1ed))/0x5*(-parseInt(_0xf60ad6(0x1de))/0x6)+parseInt(_0xf60ad6(0x16e))/0x7*(parseInt(_0xf60ad6(0x1b0))/0x8)+parseInt(_0xf60ad6(0x161))/0x9+parseInt(_0xf60ad6(0x1f2))/0xa*(parseInt(_0xf60ad6(0x182))/0xb);if(_0xa0d2fe===_0x17a998)break;else _0x5a7d1b['push'](_0x5a7d1b['shift']());}catch(_0x4cd38e){_0x5a7d1b['push'](_0x5a7d1b['shift']());}}}(a5_0x206b,0x48d28));import*as a5_0x3a4f3b from'node:fs';import*as a5_0x4f309b from'node:path';function a5_0x206b(){const _0x9880be=['New\x20tests\x20to\x20execute:\x20','add','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','...\x20','text','Evaluating\x20response...','678995oMsPRe','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','repeat','Re-evaluating\x20','Test\x20Configuration:','3010NRefvg','...','green','✓\x20PASS:\x20','dryRun','reason','3591234bOWTTM','no_local_folder','Duration:\x20','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','Re-evaluating...','projectName','Executing\x20new\x20tests...','✗\x20FAIL:\x20','tests','resolveAgentId','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','Round\x201/','existsSync','21hmvQUy','log','Either\x20switch\x20to\x20the\x20\x22','has','basename','stop','writeFileSync','1234044CubSGa','\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','Round\x20','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','Usage:','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','push','join','verbose','2hlzTLq','map','/<agent-name>',':\x20Sending\x20user\x20input...','21857CLBdpD','\x20\x20Site:\x20','tsv','substring','includes','trim','now','Total:\x20\x20\x20\x20','\x22:\x20','table','No\x20tests\x20have\x20tags\x20defined.','FAIL','Site:\x20','Error\x20writing\x20output\x20file:\x20','\x20\x20-\x20','conversation_url','✗\x20ERROR:\x20Project\x20not\x20found:\x20','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','site','Error:\x20No\x20previous\x20test\x20run\x20found.','cyan','size','llm','\x20\x20Project:\x20','llmProject','find','no_context','testName','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','white','length','resolve','yellow','status','json','\x20(new)','executeReeval','found','\x22,\x20but\x20current\x20site\x20is\x20\x22','tags','ERROR','\x20(cached)','utf-8','no_tests','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','531464UEdlRh','red','conversations','name','Errors:\x20\x20\x20','Available\x20tests:\x20','forEach','404','Passed:\x20\x20\x20','⚠\x20SKIPPED:\x20','Running\x20agent\x20tests...','Re-evaluation\x20Summary','agent','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','filter','Conversation\x20URL:\x20','message','agent:test','\x20\x20Round\x20','Agent:\x20','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','Available\x20tags:\x20','✗\x20ERROR:\x20','\x20\x20Agent:\x20','\x20\x20Conversation:\x20','Project\x20path:\x20','\x20-\x20','agentName','dim','output','Failed:\x20\x20\x20','toLowerCase','not\x20found','306753hKdsxH','rounds','Running:\x20','PASS','start','reeval','Running\x20test:\x20','projectDir','jsonl','split','multiple_agents','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','6bHbTyD','\x20\x20Evaluating...\x20','556073CrNkAj','toISOString','description','Output\x20written\x20to:\x20','eval','testYmlPath','Cached\x20run\x20from:\x20'];a5_0x206b=function(){return _0x9880be;};return a5_0x206b();}import a5_0x62ff5b from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';function a5_0xa3f2(_0x4fd4cc,_0x3945a1){_0x4fd4cc=_0x4fd4cc-0x15c;const _0x206b81=a5_0x206b();let _0xa3f28e=_0x206b81[_0x4fd4cc];return _0xa3f28e;}import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{['name']=a5_0x27bec5(0x1c1);[a5_0x27bec5(0x1e2)]='Run\x20tests\x20for\x20an\x20LLM\x20agent';async['execute'](_0x22af3e){const _0x3ef561=a5_0x27bec5,{options:_0x4172af,args:_0x4a9095,tdx:_0x11b5a9}=_0x22af3e,_0x52d90b=_0x4a9095[0x0]||'.',_0x43bdd9=_0x4172af[_0x3ef561(0x15f)],_0xdf7ef2=_0x4172af,_0x5acf33=_0xdf7ef2[_0x3ef561(0x1e4)]===![],_0x4a99d4=_0xdf7ef2[_0x3ef561(0x1d6)],_0x265590=_0xdf7ef2[_0x3ef561(0x1b3)],_0x4893f3=_0xdf7ef2[_0x3ef561(0x1a9)],_0x465425=_0x4172af[_0x3ef561(0x194)],_0x4e2c27=_0xdf7ef2[_0x3ef561(0x1cd)];if(_0x4a99d4&&_0x5acf33)return console[_0x3ef561(0x16f)](a5_0x62ff5b[_0x3ef561(0x1b1)](_0x3ef561(0x17a))),0x1;let _0x1c30dc='table';if(_0xdf7ef2[_0x3ef561(0x1a4)])_0x1c30dc=_0x3ef561(0x1a4);else{if(_0xdf7ef2[_0x3ef561(0x1d9)])_0x1c30dc=_0x3ef561(0x1d9);else{if(_0xdf7ef2[_0x3ef561(0x184)])_0x1c30dc=_0x3ef561(0x184);else{if(_0xdf7ef2['table'])_0x1c30dc='table';}}}const _0x3d903e=_0xdf7ef2[_0x3ef561(0x19a)];let _0x53efe0=_0x52d90b;const _0x3e9d17=a5_0x3a4f3b[_0x3ef561(0x16d)](_0x52d90b),_0x57bd5e=_0x52d90b==='.';if(!_0x3e9d17||_0x57bd5e){const _0x47ac2c=resolveProjectFromContext(_0x52d90b,_0x3d903e,{'requireFile':'test.yml'});if(_0x47ac2c[_0x3ef561(0x1a7)])_0x53efe0=_0x47ac2c['projectDir'],_0x47ac2c['source']==='context'&&console[_0x3ef561(0x16f)](a5_0x62ff5b[_0x3ef561(0x1cc)]('Using\x20agent:\x20'+_0x53efe0));else switch(_0x47ac2c['reason']){case _0x3ef561(0x19c):console['log'](a5_0x62ff5b[_0x3ef561(0x1a2)](_0x47ac2c[_0x3ef561(0x1c0)])),console['log'](),console[_0x3ef561(0x16f)](_0x3ef561(0x179)),console['log'](_0x3ef561(0x176)),console[_0x3ef561(0x16f)]('\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[_0x3ef561(0x16f)](),console[_0x3ef561(0x16f)]('Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>');return 0x1;case _0x3ef561(0x162):console['log'](a5_0x62ff5b['yellow'](_0x47ac2c[_0x3ef561(0x1c0)])),console[_0x3ef561(0x16f)](),console[_0x3ef561(0x16f)]('Run\x20\x27tdx\x20agent\x20pull\x20'+_0x47ac2c[_0x3ef561(0x19a)]+'\x27\x20to\x20create\x20the\x20folder\x20structure.');return 0x1;case _0x3ef561(0x1db):{const _0x39911a=a5_0x4f309b[_0x3ef561(0x172)](_0x47ac2c[_0x3ef561(0x1d8)]);console[_0x3ef561(0x16f)](a5_0x62ff5b[_0x3ef561(0x1a2)](_0x3ef561(0x1dc)+_0x47ac2c['llmProject']+'\x22:'));for(const _0x13eb0b of _0x47ac2c['agentDirs']){console[_0x3ef561(0x16f)](_0x3ef561(0x190)+_0x13eb0b);}return console['log'](),console[_0x3ef561(0x16f)](_0x3ef561(0x1c4)+_0x39911a+_0x3ef561(0x180)),0x1;}case _0x3ef561(0x1ad):console[_0x3ef561(0x16f)](a5_0x62ff5b['yellow'](_0x3ef561(0x1af)+_0x47ac2c['llmProject']+'\x22.')),console[_0x3ef561(0x16f)](a5_0x62ff5b[_0x3ef561(0x1cc)](_0x3ef561(0x1c9)+_0x47ac2c[_0x3ef561(0x1d8)])),console[_0x3ef561(0x16f)](),console[_0x3ef561(0x16f)](_0x3ef561(0x1e9));return 0x1;}}const {definition:_0x536897,agentInfo:_0x120090}=parseTestFile(_0x53efe0);let _0x2e3d06=_0x536897[_0x3ef561(0x169)];if(_0x265590){const _0x51b5b4=_0x265590['split'](',')[_0x3ef561(0x17f)](_0x45ebcc=>_0x45ebcc[_0x3ef561(0x187)]());_0x2e3d06=_0x536897[_0x3ef561(0x169)][_0x3ef561(0x1be)](_0x5f1783=>_0x51b5b4['includes'](_0x5f1783[_0x3ef561(0x1b3)]));if(_0x2e3d06[_0x3ef561(0x1a0)]===0x0)return console[_0x3ef561(0x16f)](a5_0x62ff5b[_0x3ef561(0x1a2)]('No\x20tests\x20found\x20matching:\x20'+_0x265590)),console[_0x3ef561(0x16f)](a5_0x62ff5b[_0x3ef561(0x1cc)](_0x3ef561(0x1b5)+_0x536897[_0x3ef561(0x169)][_0x3ef561(0x17f)](_0x37781d=>_0x37781d[_0x3ef561(0x1b3)])[_0x3ef561(0x17c)](',\x20'))),0x1;}if(_0x4893f3){const _0xa8441a=_0x4893f3[_0x3ef561(0x1da)](',')[_0x3ef561(0x17f)](_0x23b69b=>_0x23b69b[_0x3ef561(0x187)]()[_0x3ef561(0x1cf)]());_0x2e3d06=_0x2e3d06['filter'](_0xfb85b1=>_0xfb85b1['tags']?.['some'](_0x204e28=>_0xa8441a['includes'](_0x204e28['toLowerCase']())));if(_0x2e3d06[_0x3ef561(0x1a0)]===0x0){console['log'](a5_0x62ff5b[_0x3ef561(0x1a2)]('No\x20tests\x20found\x20with\x20tags:\x20'+_0x4893f3));const _0x4afadd=new Set();return _0x536897['tests'][_0x3ef561(0x1b6)](_0x2dfdec=>_0x2dfdec['tags']?.[_0x3ef561(0x1b6)](_0xfeab33=>_0x4afadd[_0x3ef561(0x1e8)](_0xfeab33))),_0x4afadd[_0x3ef561(0x197)]>0x0?console['log'](a5_0x62ff5b[_0x3ef561(0x1cc)](_0x3ef561(0x1c5)+[..._0x4afadd][_0x3ef561(0x17c)](',\x20'))):console[_0x3ef561(0x16f)](a5_0x62ff5b[_0x3ef561(0x1cc)](_0x3ef561(0x18c))),0x1;}}if(_0x4a99d4)return this[_0x3ef561(0x1a6)](_0x22af3e,{'definition':{'tests':_0x2e3d06},'agentInfo':_0x120090,'outputFormat':_0x1c30dc,'outputFile':_0x4e2c27,'testNames':_0x265590});if(_0x43bdd9){console[_0x3ef561(0x16f)](a5_0x62ff5b[_0x3ef561(0x196)](_0x3ef561(0x1f1))),console[_0x3ef561(0x16f)](_0x3ef561(0x183)+a5_0x62ff5b['white'](_0x465425)),console[_0x3ef561(0x16f)](_0x3ef561(0x199)+a5_0x62ff5b[_0x3ef561(0x19f)](_0x120090['projectName'])),console[_0x3ef561(0x16f)](_0x3ef561(0x1c7)+a5_0x62ff5b[_0x3ef561(0x19f)](_0x120090[_0x3ef561(0x1cb)])),console[_0x3ef561(0x16f)](),console[_0x3ef561(0x16f)]('Tests\x20found:\x20'+a5_0x62ff5b['white'](_0x2e3d06[_0x3ef561(0x1a0)]));for(let _0x5ea299=0x0;_0x5ea299<_0x2e3d06[_0x3ef561(0x1a0)];_0x5ea299++){const _0xc299f1=_0x2e3d06[_0x5ea299],_0x4b640f=_0xc299f1[_0x3ef561(0x1d2)][_0x3ef561(0x1a0)]===0x1?'round':_0x3ef561(0x1d2),_0x4bf1b8=_0xc299f1['tags']?.['length']?'\x20['+_0xc299f1[_0x3ef561(0x1a9)][_0x3ef561(0x17c)](',\x20')+']':'';console[_0x3ef561(0x16f)]('\x20\x20'+(_0x5ea299+0x1)+'.\x20'+a5_0x62ff5b['white'](_0xc299f1[_0x3ef561(0x1b3)])+'\x20('+_0xc299f1[_0x3ef561(0x1d2)][_0x3ef561(0x1a0)]+'\x20'+_0x4b640f+')'+a5_0x62ff5b['dim'](_0x4bf1b8));}return 0x0;}let _0x2e55ca,_0x2518a9;try{_0x2e55ca=await _0x11b5a9['llm']['resolveProjectId'](_0x120090['projectName']);}catch(_0x1a6fcd){const _0x66732c=_0x1a6fcd instanceof Error?_0x1a6fcd[_0x3ef561(0x1c0)]:String(_0x1a6fcd);return _0x66732c[_0x3ef561(0x186)](_0x3ef561(0x1b7))||_0x66732c[_0x3ef561(0x1cf)]()['includes'](_0x3ef561(0x1d0))?console[_0x3ef561(0x16f)](a5_0x62ff5b['red'](_0x3ef561(0x192)+_0x120090[_0x3ef561(0x166)])):console[_0x3ef561(0x16f)](a5_0x62ff5b[_0x3ef561(0x1b1)](_0x3ef561(0x1ee)+_0x120090['projectName']+_0x3ef561(0x18a)+_0x66732c)),0x1;}try{_0x2518a9=await _0x11b5a9[_0x3ef561(0x198)][_0x3ef561(0x16a)](_0x120090['agentName'],_0x2e55ca);}catch(_0xbffe70){const _0x11c994=_0xbffe70 instanceof Error?_0xbffe70['message']:String(_0xbffe70);return _0x11c994[_0x3ef561(0x186)](_0x3ef561(0x1b7))||_0x11c994[_0x3ef561(0x1cf)]()[_0x3ef561(0x186)](_0x3ef561(0x1d0))?console[_0x3ef561(0x16f)](a5_0x62ff5b[_0x3ef561(0x1b1)](_0x3ef561(0x1dd)+_0x120090[_0x3ef561(0x1cb)])):console[_0x3ef561(0x16f)](a5_0x62ff5b['red']('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22'+_0x120090[_0x3ef561(0x1cb)]+_0x3ef561(0x18a)+_0x11c994)),0x1;}let _0x71ec56;if(!_0x5acf33)try{_0x71ec56=await setupEvaluatorAgent(_0x11b5a9['llm'],_0x4172af[_0x3ef561(0x17d)]);}catch(_0x59042a){const _0x1d1f9a=_0x59042a instanceof Error?_0x59042a[_0x3ef561(0x1c0)]:String(_0x59042a);return console[_0x3ef561(0x16f)](a5_0x62ff5b[_0x3ef561(0x1b1)](_0x3ef561(0x1ae)+_0x1d1f9a)),0x1;}console[_0x3ef561(0x16f)](a5_0x62ff5b[_0x3ef561(0x196)](_0x3ef561(0x1ba))),console[_0x3ef561(0x16f)](_0x3ef561(0x18e)+a5_0x62ff5b[_0x3ef561(0x19f)](_0x465425)),console['log'](_0x3ef561(0x1c3)+a5_0x62ff5b[_0x3ef561(0x19f)](_0x120090[_0x3ef561(0x166)]+'/'+_0x120090[_0x3ef561(0x1cb)])),console[_0x3ef561(0x16f)]();const _0x451a49=[],_0x1fcdbf=[],_0x116f80=Date['now']();for(let _0x402d22=0x0;_0x402d22<_0x2e3d06['length'];_0x402d22++){const _0x5b1042=_0x2e3d06[_0x402d22];_0x2e3d06['length']>0x1?console[_0x3ef561(0x16f)]('Test\x20'+(_0x402d22+0x1)+'/'+_0x2e3d06[_0x3ef561(0x1a0)]+':\x20'+a5_0x62ff5b[_0x3ef561(0x19f)](_0x5b1042[_0x3ef561(0x1b3)])):console[_0x3ef561(0x16f)](_0x3ef561(0x1d7)+a5_0x62ff5b[_0x3ef561(0x19f)](_0x5b1042['name']));const _0x2b4744=createCommandSpinner(_0x3ef561(0x16c)+_0x5b1042[_0x3ef561(0x1d2)][_0x3ef561(0x1a0)]+':\x20Sending\x20user\x20input...');_0x2b4744['start']();try{const {result:_0x2635d5,conversation:_0x40390d}=await runTest(_0x11b5a9[_0x3ef561(0x198)],_0x5b1042,{'agentId':_0x2518a9,'projectId':_0x2e55ca,'site':_0x465425,'noEval':_0x5acf33,'evaluatorId':_0x71ec56,'onRoundStart':(_0x255189,_0x59fedd)=>{const _0x320829=_0x3ef561;_0x2b4744[_0x320829(0x1eb)]=_0x320829(0x177)+(_0x255189+0x1)+'/'+_0x59fedd+_0x320829(0x181);},'onRoundComplete':(_0xc689c0,_0x4dfa11,_0x426f2e)=>{const _0x5b440e=_0x3ef561,_0x55fdc3=formatElapsed(_0x4dfa11);_0x426f2e?console[_0x5b440e(0x16f)](_0x5b440e(0x1c2)+(_0xc689c0+0x1)+'/'+_0x5b1042[_0x5b440e(0x1d2)][_0x5b440e(0x1a0)]+_0x5b440e(0x1ea)+a5_0x62ff5b[_0x5b440e(0x15d)]('✓')+'\x20('+_0x55fdc3+')'):console[_0x5b440e(0x16f)](_0x5b440e(0x1c2)+(_0xc689c0+0x1)+'/'+_0x5b1042[_0x5b440e(0x1d2)][_0x5b440e(0x1a0)]+_0x5b440e(0x1ea)+a5_0x62ff5b[_0x5b440e(0x1b1)]('✗'));},'onEvaluationStart':()=>{const _0x332406=_0x3ef561;_0x2b4744['text']=_0x332406(0x1ec);},'onEvaluationComplete':_0x9f712=>{const _0x22078c=_0x3ef561,_0x1adbcb=formatElapsed(_0x9f712);console[_0x22078c(0x16f)]('\x20\x20Evaluating...\x20'+a5_0x62ff5b['green']('✓')+'\x20('+_0x1adbcb+')');}});_0x2b4744[_0x3ef561(0x173)](),_0x451a49[_0x3ef561(0x17b)](_0x2635d5),_0x1fcdbf[_0x3ef561(0x17b)](_0x40390d);if(_0x2635d5[_0x3ef561(0x1a3)]==='PASS')console[_0x3ef561(0x16f)](a5_0x62ff5b[_0x3ef561(0x15d)](_0x3ef561(0x15e)+_0x2635d5['reason']));else _0x2635d5[_0x3ef561(0x1a3)]===_0x3ef561(0x18d)?console[_0x3ef561(0x16f)](a5_0x62ff5b[_0x3ef561(0x1b1)](_0x3ef561(0x168)+_0x2635d5[_0x3ef561(0x160)])):console['log'](a5_0x62ff5b[_0x3ef561(0x1b1)](_0x3ef561(0x1c6)+_0x2635d5[_0x3ef561(0x160)]));_0x2635d5[_0x3ef561(0x191)]&&console[_0x3ef561(0x16f)](a5_0x62ff5b[_0x3ef561(0x1cc)](_0x3ef561(0x1bf)+_0x2635d5['conversation_url'])),console[_0x3ef561(0x16f)]();}catch(_0x307a20){_0x2b4744['stop']();const _0x420959=_0x307a20 instanceof Error?_0x307a20['message']:String(_0x307a20);console[_0x3ef561(0x16f)](a5_0x62ff5b[_0x3ef561(0x1b1)](_0x3ef561(0x1c6)+_0x420959)),console[_0x3ef561(0x16f)](),_0x451a49[_0x3ef561(0x17b)]({'name':_0x5b1042[_0x3ef561(0x1b3)],'status':_0x3ef561(0x1aa),'reason':_0x420959,'timestamp':new Date()[_0x3ef561(0x1e1)](),'duration_ms':0x0});}}const _0x35cfe3=Date[_0x3ef561(0x188)]()-_0x116f80,_0x38ef6d=_0x451a49[_0x3ef561(0x1be)](_0x115675=>_0x115675[_0x3ef561(0x1a3)]===_0x3ef561(0x1d4))[_0x3ef561(0x1a0)],_0x5bb4bd=_0x451a49[_0x3ef561(0x1be)](_0xa3b43d=>_0xa3b43d[_0x3ef561(0x1a3)]==='FAIL')[_0x3ef561(0x1a0)],_0x4501ec=_0x451a49[_0x3ef561(0x1be)](_0x35f4c5=>_0x35f4c5[_0x3ef561(0x1a3)]==='ERROR')[_0x3ef561(0x1a0)];console[_0x3ef561(0x16f)]('━'['repeat'](0x3c)),console[_0x3ef561(0x16f)]('Test\x20Summary'),console[_0x3ef561(0x16f)]('━'[_0x3ef561(0x1ef)](0x3c)),console[_0x3ef561(0x16f)](_0x3ef561(0x189)+_0x451a49[_0x3ef561(0x1a0)]),console[_0x3ef561(0x16f)](_0x3ef561(0x1b8)+a5_0x62ff5b[_0x3ef561(0x15d)](_0x38ef6d)),console[_0x3ef561(0x16f)](_0x3ef561(0x1ce)+a5_0x62ff5b[_0x3ef561(0x1b1)](_0x5bb4bd));_0x4501ec>0x0&&console[_0x3ef561(0x16f)]('Errors:\x20\x20\x20'+a5_0x62ff5b[_0x3ef561(0x1b1)](_0x4501ec));console[_0x3ef561(0x16f)](_0x3ef561(0x163)+formatElapsed(_0x35cfe3)),console['log']('━'[_0x3ef561(0x1ef)](0x3c));const _0x2876a2=_0x451a49[_0x3ef561(0x1be)](_0x52fa18=>_0x52fa18[_0x3ef561(0x1a3)]!==_0x3ef561(0x1d4));if(_0x2876a2['length']>0x0){console[_0x3ef561(0x16f)](),console[_0x3ef561(0x16f)]('Failed\x20Tests:');for(const _0xc93f96 of _0x2876a2){const _0x32371c=a5_0x62ff5b[_0x3ef561(0x1b1)]('✗'),_0x1ef93f=_0xc93f96[_0x3ef561(0x160)][_0x3ef561(0x1a0)]>0x32?_0xc93f96[_0x3ef561(0x160)][_0x3ef561(0x185)](0x0,0x32)+'...':_0xc93f96['reason'];console[_0x3ef561(0x16f)]('\x20\x20'+_0x32371c+'\x20'+_0xc93f96['name']+':\x20'+_0x1ef93f);}}const _0x5271b5={'summary':{'total':_0x451a49[_0x3ef561(0x1a0)],'passed':_0x38ef6d,'failed':_0x5bb4bd,'errors':_0x4501ec>0x0?_0x4501ec:undefined,'duration_ms':_0x35cfe3},'tests':_0x451a49,'agent':{'project':_0x120090['projectName'],'name':_0x120090['agentName'],'site':_0x465425},'timestamp':new Date(_0x116f80)[_0x3ef561(0x1e1)]()};try{const _0x4dcb5d=buildCachedTestRun(_0x1fcdbf,{'site':_0x465425,'projectId':_0x2e55ca,'projectName':_0x120090[_0x3ef561(0x166)],'agentId':_0x2518a9,'agentName':_0x120090[_0x3ef561(0x1cb)],'testYmlPath':a5_0x4f309b[_0x3ef561(0x1a1)](_0x120090[_0x3ef561(0x1e5)])});saveLastTestRun(_0x4dcb5d);}catch{}if(_0x1c30dc!==_0x3ef561(0x18b)||_0x4e2c27){const _0x105d1c=formatResults(_0x5271b5,_0x1c30dc);if(_0x4e2c27)try{a5_0x3a4f3b[_0x3ef561(0x174)](_0x4e2c27,_0x105d1c,_0x3ef561(0x1ac)),console[_0x3ef561(0x16f)](),console[_0x3ef561(0x16f)](a5_0x62ff5b[_0x3ef561(0x1cc)](_0x3ef561(0x1e3)+_0x4e2c27));}catch(_0x2fb664){return console[_0x3ef561(0x16f)](),console['log'](a5_0x62ff5b['red'](_0x3ef561(0x18f)+_0x2fb664)),0x1;}else console['log'](),console[_0x3ef561(0x16f)](_0x105d1c);}return _0x2876a2['length']>0x0?0x1:0x0;}async[a5_0x27bec5(0x1a6)](_0x27d0bb,_0x657db6){const _0xa1c9ea=a5_0x27bec5,{options:_0x2a342e,tdx:_0xe24a55}=_0x27d0bb,{definition:_0x2fc2ff,agentInfo:_0x2c1dcd,outputFormat:_0x3879f3,outputFile:_0x570353}=_0x657db6,_0x38bd59=_0x2a342e[_0xa1c9ea(0x194)],_0x5cc04f=loadLastTestRun();if(!_0x5cc04f)return console[_0xa1c9ea(0x16f)](a5_0x62ff5b[_0xa1c9ea(0x1b1)](_0xa1c9ea(0x195))),console[_0xa1c9ea(0x16f)](a5_0x62ff5b[_0xa1c9ea(0x1cc)](_0xa1c9ea(0x16b))),0x1;if(_0x5cc04f[_0xa1c9ea(0x1bc)][_0xa1c9ea(0x1cb)]!==_0x2c1dcd[_0xa1c9ea(0x1cb)])return console['log'](a5_0x62ff5b[_0xa1c9ea(0x1b1)](_0xa1c9ea(0x178)+_0x5cc04f[_0xa1c9ea(0x1bc)][_0xa1c9ea(0x1cb)]+_0xa1c9ea(0x193)+_0x2c1dcd[_0xa1c9ea(0x1cb)]+'\x22.')),console['log'](a5_0x62ff5b[_0xa1c9ea(0x1cc)]('Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.')),0x1;const _0x42ae3b=new Set(_0x5cc04f[_0xa1c9ea(0x1b2)][_0xa1c9ea(0x17f)](_0x4666e3=>_0x4666e3[_0xa1c9ea(0x19d)])),_0xbc421d=_0x2fc2ff[_0xa1c9ea(0x169)][_0xa1c9ea(0x1be)](_0x17d6f7=>!_0x42ae3b[_0xa1c9ea(0x171)](_0x17d6f7[_0xa1c9ea(0x1b3)]));if(_0xbc421d[_0xa1c9ea(0x1a0)]>0x0&&_0x5cc04f['site']!==_0x38bd59)return console[_0xa1c9ea(0x16f)](a5_0x62ff5b[_0xa1c9ea(0x1b1)](_0xa1c9ea(0x19e))),console[_0xa1c9ea(0x16f)](a5_0x62ff5b[_0xa1c9ea(0x1cc)]('Cached\x20run\x20is\x20from\x20site\x20\x22'+_0x5cc04f['site']+_0xa1c9ea(0x1a8)+_0x38bd59+'\x22.')),console[_0xa1c9ea(0x16f)](a5_0x62ff5b[_0xa1c9ea(0x1cc)](_0xa1c9ea(0x170)+_0x5cc04f[_0xa1c9ea(0x194)]+_0xa1c9ea(0x164))),0x1;const _0x5d600c=_0x2fc2ff['tests'][_0xa1c9ea(0x1be)](_0x42cf69=>_0x42ae3b[_0xa1c9ea(0x171)](_0x42cf69['name'])),_0x4b9368=_0xbc421d;let _0x48cc1f;try{_0x48cc1f=await setupEvaluatorAgent(_0xe24a55['llm'],_0x2a342e['verbose']);}catch(_0x46e4a3){const _0x21eda0=_0x46e4a3 instanceof Error?_0x46e4a3[_0xa1c9ea(0x1c0)]:String(_0x46e4a3);return console[_0xa1c9ea(0x16f)](a5_0x62ff5b[_0xa1c9ea(0x1b1)](_0xa1c9ea(0x1ae)+_0x21eda0)),0x1;}console[_0xa1c9ea(0x16f)](a5_0x62ff5b[_0xa1c9ea(0x196)]('Re-evaluating\x20cached\x20test\x20run...')),console[_0xa1c9ea(0x16f)](_0xa1c9ea(0x1e6)+a5_0x62ff5b['white'](_0x5cc04f['timestamp'])),console['log'](_0xa1c9ea(0x1c3)+a5_0x62ff5b['white'](_0x5cc04f[_0xa1c9ea(0x1bc)][_0xa1c9ea(0x166)]+'/'+_0x5cc04f[_0xa1c9ea(0x1bc)][_0xa1c9ea(0x1cb)]));_0x4b9368[_0xa1c9ea(0x1a0)]>0x0&&console['log'](_0xa1c9ea(0x1e7)+a5_0x62ff5b[_0xa1c9ea(0x1a2)](_0x4b9368['length']));console['log']();const _0x33fca7=[],_0x48c8ff=Date[_0xa1c9ea(0x188)](),_0x14d2fe=createCommandSpinner(_0xa1c9ea(0x165));if(_0x5d600c['length']>0x0)try{const _0x1565d7=await reevaluateFromCache(_0xe24a55[_0xa1c9ea(0x198)],_0x5cc04f,{'tests':_0x5d600c},{'evaluatorId':_0x48cc1f,'onTestStart':(_0x104eeb,_0x5572b4,_0xb35913)=>{const _0x4f82f0=_0xa1c9ea;_0x14d2fe['text']=_0x4f82f0(0x1f0)+(_0x5572b4+0x1)+'/'+_0xb35913+':\x20'+_0x104eeb+_0x4f82f0(0x15c);if(!_0x14d2fe['isSpinning'])_0x14d2fe['start']();},'onTestComplete':(_0x4aeb1b,_0x4b5759)=>{const _0x3571e9=_0xa1c9ea;_0x14d2fe[_0x3571e9(0x173)]();if(_0x4b5759[_0x3571e9(0x1a3)]===_0x3571e9(0x1d4))console[_0x3571e9(0x16f)](a5_0x62ff5b[_0x3571e9(0x15d)](_0x3571e9(0x15e)+_0x4aeb1b)+a5_0x62ff5b['dim']('\x20(cached)'));else _0x4b5759['status']===_0x3571e9(0x18d)?console[_0x3571e9(0x16f)](a5_0x62ff5b[_0x3571e9(0x1b1)](_0x3571e9(0x168)+_0x4aeb1b+'\x20-\x20'+_0x4b5759[_0x3571e9(0x160)])+a5_0x62ff5b['dim'](_0x3571e9(0x1ab))):console[_0x3571e9(0x16f)](a5_0x62ff5b['red']('✗\x20ERROR:\x20'+_0x4aeb1b+_0x3571e9(0x1ca)+_0x4b5759[_0x3571e9(0x160)]));_0x4b5759[_0x3571e9(0x191)]&&console[_0x3571e9(0x16f)](a5_0x62ff5b[_0x3571e9(0x1cc)](_0x3571e9(0x1c8)+_0x4b5759[_0x3571e9(0x191)])),_0x33fca7[_0x3571e9(0x17b)](_0x4b5759);},'onTestSkipped':(_0x2b3172,_0x27beca)=>{const _0x46563a=_0xa1c9ea;_0x14d2fe[_0x46563a(0x173)](),console[_0x46563a(0x16f)](a5_0x62ff5b[_0x46563a(0x1a2)](_0x46563a(0x1b9)+_0x2b3172+_0x46563a(0x1ca)+_0x27beca));}});for(const _0x4394c8 of _0x1565d7){!_0x33fca7[_0xa1c9ea(0x19b)](_0x1cd89e=>_0x1cd89e[_0xa1c9ea(0x1b3)]===_0x4394c8[_0xa1c9ea(0x1b3)])&&_0x33fca7['push'](_0x4394c8);}}catch(_0x39a29c){_0x14d2fe[_0xa1c9ea(0x173)]();const _0xcb0225=_0x39a29c instanceof Error?_0x39a29c[_0xa1c9ea(0x1c0)]:String(_0x39a29c);return console[_0xa1c9ea(0x16f)](a5_0x62ff5b[_0xa1c9ea(0x1b1)](_0xa1c9ea(0x1bd)+_0xcb0225)),0x1;}_0x14d2fe[_0xa1c9ea(0x173)]();if(_0x4b9368['length']>0x0){console['log'](),console[_0xa1c9ea(0x16f)](a5_0x62ff5b[_0xa1c9ea(0x196)](_0xa1c9ea(0x167)));const {projectId:_0x5896b1,agentId:_0x4c30a2}=_0x5cc04f[_0xa1c9ea(0x1bc)];for(const _0x4fd2ca of _0x4b9368){console[_0xa1c9ea(0x16f)](_0xa1c9ea(0x1d3)+a5_0x62ff5b[_0xa1c9ea(0x19f)](_0x4fd2ca[_0xa1c9ea(0x1b3)]));const _0x59a8ad=createCommandSpinner(_0xa1c9ea(0x16c)+_0x4fd2ca[_0xa1c9ea(0x1d2)][_0xa1c9ea(0x1a0)]+_0xa1c9ea(0x181));_0x59a8ad[_0xa1c9ea(0x1d5)]();try{const {result:_0x418b0f}=await runTest(_0xe24a55[_0xa1c9ea(0x198)],_0x4fd2ca,{'agentId':_0x4c30a2,'projectId':_0x5896b1,'site':_0x5cc04f['site'],'noEval':![],'evaluatorId':_0x48cc1f,'onRoundStart':(_0x33960a,_0x2914b9)=>{const _0x32b3a0=_0xa1c9ea;_0x59a8ad['text']='Round\x20'+(_0x33960a+0x1)+'/'+_0x2914b9+_0x32b3a0(0x181);},'onRoundComplete':(_0x4eeafa,_0x1ee335,_0x906844)=>{const _0x54b6ca=_0xa1c9ea,_0x10dfac=formatElapsed(_0x1ee335);_0x906844?console[_0x54b6ca(0x16f)](_0x54b6ca(0x1c2)+(_0x4eeafa+0x1)+'/'+_0x4fd2ca[_0x54b6ca(0x1d2)][_0x54b6ca(0x1a0)]+_0x54b6ca(0x1ea)+a5_0x62ff5b[_0x54b6ca(0x15d)]('✓')+'\x20('+_0x10dfac+')'):console['log'](_0x54b6ca(0x1c2)+(_0x4eeafa+0x1)+'/'+_0x4fd2ca[_0x54b6ca(0x1d2)]['length']+'...\x20'+a5_0x62ff5b[_0x54b6ca(0x1b1)]('✗'));},'onEvaluationStart':()=>{const _0x58a063=_0xa1c9ea;_0x59a8ad[_0x58a063(0x1eb)]='Evaluating\x20response...';},'onEvaluationComplete':_0x5b5515=>{const _0x4ab58d=_0xa1c9ea,_0x4bea76=formatElapsed(_0x5b5515);console['log'](_0x4ab58d(0x1df)+a5_0x62ff5b['green']('✓')+'\x20('+_0x4bea76+')');}});_0x59a8ad[_0xa1c9ea(0x173)](),_0x33fca7[_0xa1c9ea(0x17b)](_0x418b0f);if(_0x418b0f[_0xa1c9ea(0x1a3)]===_0xa1c9ea(0x1d4))console['log'](a5_0x62ff5b[_0xa1c9ea(0x15d)]('✓\x20PASS:\x20'+_0x418b0f['reason'])+a5_0x62ff5b[_0xa1c9ea(0x1cc)](_0xa1c9ea(0x1a5)));else _0x418b0f[_0xa1c9ea(0x1a3)]===_0xa1c9ea(0x18d)?console['log'](a5_0x62ff5b[_0xa1c9ea(0x1b1)](_0xa1c9ea(0x168)+_0x418b0f[_0xa1c9ea(0x160)])+a5_0x62ff5b[_0xa1c9ea(0x1cc)](_0xa1c9ea(0x1a5))):console[_0xa1c9ea(0x16f)](a5_0x62ff5b['red'](_0xa1c9ea(0x1c6)+_0x418b0f[_0xa1c9ea(0x160)]));_0x418b0f[_0xa1c9ea(0x191)]&&console[_0xa1c9ea(0x16f)](a5_0x62ff5b[_0xa1c9ea(0x1cc)](_0xa1c9ea(0x1c8)+_0x418b0f[_0xa1c9ea(0x191)]));}catch(_0x527e84){_0x59a8ad[_0xa1c9ea(0x173)]();const _0x4637a1=_0x527e84 instanceof Error?_0x527e84['message']:String(_0x527e84);console[_0xa1c9ea(0x16f)](a5_0x62ff5b[_0xa1c9ea(0x1b1)]('✗\x20ERROR:\x20'+_0x4637a1)),_0x33fca7['push']({'name':_0x4fd2ca[_0xa1c9ea(0x1b3)],'status':_0xa1c9ea(0x1aa),'reason':_0x4637a1,'timestamp':new Date()[_0xa1c9ea(0x1e1)](),'duration_ms':0x0});}}}console[_0xa1c9ea(0x16f)]();const _0x370021=Date[_0xa1c9ea(0x188)]()-_0x48c8ff,_0x402335=_0x33fca7['filter'](_0x58a235=>_0x58a235[_0xa1c9ea(0x1a3)]===_0xa1c9ea(0x1d4))['length'],_0x15a50a=_0x33fca7['filter'](_0x102103=>_0x102103[_0xa1c9ea(0x1a3)]===_0xa1c9ea(0x18d))['length'],_0x536c35=_0x33fca7[_0xa1c9ea(0x1be)](_0x26e420=>_0x26e420[_0xa1c9ea(0x1a3)]==='ERROR')[_0xa1c9ea(0x1a0)];console[_0xa1c9ea(0x16f)]('━'[_0xa1c9ea(0x1ef)](0x3c)),console[_0xa1c9ea(0x16f)](_0xa1c9ea(0x1bb)),console[_0xa1c9ea(0x16f)]('━'[_0xa1c9ea(0x1ef)](0x3c)),console[_0xa1c9ea(0x16f)](_0xa1c9ea(0x189)+_0x33fca7[_0xa1c9ea(0x1a0)]),console[_0xa1c9ea(0x16f)](_0xa1c9ea(0x1b8)+a5_0x62ff5b['green'](_0x402335)),console[_0xa1c9ea(0x16f)](_0xa1c9ea(0x1ce)+a5_0x62ff5b[_0xa1c9ea(0x1b1)](_0x15a50a));_0x536c35>0x0&&console['log'](_0xa1c9ea(0x1b4)+a5_0x62ff5b[_0xa1c9ea(0x1b1)](_0x536c35));console[_0xa1c9ea(0x16f)](_0xa1c9ea(0x163)+formatElapsed(_0x370021)),console['log']('━'['repeat'](0x3c));const _0x1bba62={'summary':{'total':_0x33fca7[_0xa1c9ea(0x1a0)],'passed':_0x402335,'failed':_0x15a50a,'errors':_0x536c35>0x0?_0x536c35:undefined,'duration_ms':_0x370021},'tests':_0x33fca7,'agent':{'project':_0x2c1dcd[_0xa1c9ea(0x166)],'name':_0x2c1dcd[_0xa1c9ea(0x1cb)],'site':_0x38bd59},'timestamp':new Date(_0x48c8ff)['toISOString']()};if(_0x3879f3!==_0xa1c9ea(0x18b)||_0x570353){const _0x37f8ad=formatResults(_0x1bba62,_0x3879f3);if(_0x570353)try{a5_0x3a4f3b['writeFileSync'](_0x570353,_0x37f8ad,_0xa1c9ea(0x1ac)),console[_0xa1c9ea(0x16f)](),console[_0xa1c9ea(0x16f)](a5_0x62ff5b[_0xa1c9ea(0x1cc)](_0xa1c9ea(0x1e3)+_0x570353));}catch(_0x45a1b3){return console[_0xa1c9ea(0x16f)](),console[_0xa1c9ea(0x16f)](a5_0x62ff5b[_0xa1c9ea(0x1b1)](_0xa1c9ea(0x18f)+_0x45a1b3)),0x1;}else console[_0xa1c9ea(0x16f)](),console['log'](_0x37f8ad);}const _0x33c4f2=_0x33fca7[_0xa1c9ea(0x1be)](_0x3b71dc=>_0x3b71dc['status']!=='PASS');return _0x33c4f2[_0xa1c9ea(0x1a0)]>0x0?0x1:0x0;}}
1
+ const a5_0x47d17d=a5_0x30ad;(function(_0x4e6c8a,_0x2c2aed){const _0x23c632=a5_0x30ad,_0x28d395=_0x4e6c8a();while(!![]){try{const _0x3f86df=-parseInt(_0x23c632(0x230))/0x1*(-parseInt(_0x23c632(0x222))/0x2)+parseInt(_0x23c632(0x1ef))/0x3+parseInt(_0x23c632(0x257))/0x4*(parseInt(_0x23c632(0x23a))/0x5)+-parseInt(_0x23c632(0x1d7))/0x6+-parseInt(_0x23c632(0x207))/0x7+-parseInt(_0x23c632(0x1dd))/0x8+parseInt(_0x23c632(0x266))/0x9;if(_0x3f86df===_0x2c2aed)break;else _0x28d395['push'](_0x28d395['shift']());}catch(_0x1d7544){_0x28d395['push'](_0x28d395['shift']());}}}(a5_0xfe96,0xb0b9c));import*as a5_0x3baeb1 from'node:fs';import*as a5_0x39557c from'node:path';import a5_0x32ce2e from'chalk';import{BaseCommand}from'./command.js';function a5_0xfe96(){const _0x4754df=['No\x20tests\x20have\x20tags\x20defined.','Evaluating\x20response...','404','multiple_agents','llmProject','Duration:\x20','6FCuVDo','projectDir','testName','has','name','tests','Available\x20tests:\x20','\x20\x20Round\x20','writeFileSync','Site:\x20','map','✓\x20PASS:\x20','repeat','testYmlPath','60077mGRYpP','llm','eval','resolveProjectId','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','Tests\x20found:\x20','log','reeval','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','Running:\x20','5691815avUkPq','execute','\x20(cached)','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','Failed:\x20\x20\x20','forEach','status','dryRun','\x20\x20Project:\x20','\x20\x20-\x20','includes','test.yml','Re-evaluating...','✗\x20ERROR:\x20','executeReeval','push','\x22:\x20','green','\x20\x20Agent:\x20',':\x20Sending\x20user\x20input...','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','projectName','output','start','\x20-\x20','now','rounds','Error\x20writing\x20output\x20file:\x20','jsonl','4uSNJGd','white','/<agent-name>','agentDirs','agent','FAIL','Round\x20','Project\x20path:\x20','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','agentName','Run\x20\x27tdx\x20agent\x20pull\x20','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','context','ERROR','17099865cowFkb','Passed:\x20\x20\x20','reason','Either\x20switch\x20to\x20the\x20\x22','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','No\x20tests\x20found\x20with\x20tags:\x20','Conversation\x20URL:\x20','\x20(new)','message','Re-evaluating\x20','find','join','dim','5060706QpczmK','Available\x20tags:\x20','red','Output\x20written\x20to:\x20','\x20\x20Evaluating...\x20','✗\x20ERROR:\x20Project\x20not\x20found:\x20','9824312VOduJt','Re-evaluation\x20Summary','\x20\x20Site:\x20','Agent:\x20','text','Errors:\x20\x20\x20','✗\x20FAIL:\x20','Running\x20test:\x20','\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)','resolve','...','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','split','verbose','Test\x20Summary','Round\x201/','site','737400Ocfmyp','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','not\x20found','yellow','Running\x20agent\x20tests...','some','\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','conversation_url','found','json','toISOString','New\x20tests\x20to\x20execute:\x20','length','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','...\x20','no_context','cyan','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','size','stop','Failed\x20Tests:','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','no_local_folder','toLowerCase','4683147gqrfNj','\x20\x20Conversation:\x20','substring','tags','Error:\x20No\x20previous\x20test\x20run\x20found.','add','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','PASS','round','Cached\x20run\x20is\x20from\x20site\x20\x22','agent:test','filter','trim','resolveAgentId','description','Executing\x20new\x20tests...','tsv','Total:\x20\x20\x20\x20','table','source','Using\x20agent:\x20'];a5_0xfe96=function(){return _0x4754df;};return a5_0xfe96();}import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';function a5_0x30ad(_0x226f4e,_0x10b3e1){_0x226f4e=_0x226f4e-0x1d1;const _0xfe96d1=a5_0xfe96();let _0x30ad2e=_0xfe96d1[_0x226f4e];return _0x30ad2e;}import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{['name']=a5_0x47d17d(0x211);[a5_0x47d17d(0x215)]='Run\x20tests\x20for\x20an\x20LLM\x20agent';async[a5_0x47d17d(0x23b)](_0x1e3d50){const _0x498abf=a5_0x47d17d,{options:_0x93395b,args:_0x3e7ad5,tdx:_0x507d21}=_0x1e3d50,_0x36676c=_0x3e7ad5[0x0]||'.',_0x275aa7=_0x93395b[_0x498abf(0x241)],_0x50ff84=_0x93395b,_0x3371ae=_0x50ff84[_0x498abf(0x232)]===![],_0x2bd6ba=_0x50ff84[_0x498abf(0x237)],_0x4375d3=_0x50ff84[_0x498abf(0x226)],_0x55b139=_0x50ff84['tags'],_0xb25139=_0x93395b['site'],_0x2d91bb=_0x50ff84[_0x498abf(0x250)];if(_0x2bd6ba&&_0x3371ae)return console[_0x498abf(0x236)](a5_0x32ce2e[_0x498abf(0x1d9)]('Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval')),0x1;let _0x3dfcc9=_0x498abf(0x219);if(_0x50ff84['json'])_0x3dfcc9=_0x498abf(0x1f8);else{if(_0x50ff84[_0x498abf(0x256)])_0x3dfcc9=_0x498abf(0x256);else{if(_0x50ff84[_0x498abf(0x217)])_0x3dfcc9=_0x498abf(0x217);else{if(_0x50ff84[_0x498abf(0x219)])_0x3dfcc9=_0x498abf(0x219);}}}const _0x5ed81d=_0x50ff84[_0x498abf(0x220)];let _0x40e361=_0x36676c;const _0x223745=a5_0x3baeb1['existsSync'](_0x36676c),_0x5e582=_0x36676c==='.';if(!_0x223745||_0x5e582){const _0x143d35=resolveProjectFromContext(_0x36676c,_0x5ed81d,{'requireFile':_0x498abf(0x245)});if(_0x143d35[_0x498abf(0x1f7)])_0x40e361=_0x143d35[_0x498abf(0x223)],_0x143d35[_0x498abf(0x21a)]===_0x498abf(0x264)&&console[_0x498abf(0x236)](a5_0x32ce2e[_0x498abf(0x1d6)](_0x498abf(0x21b)+_0x40e361));else switch(_0x143d35[_0x498abf(0x268)]){case _0x498abf(0x1fe):console['log'](a5_0x32ce2e[_0x498abf(0x1f2)](_0x143d35['message'])),console[_0x498abf(0x236)](),console[_0x498abf(0x236)]('Usage:'),console['log'](_0x498abf(0x1f5)),console[_0x498abf(0x236)](_0x498abf(0x1e5)),console[_0x498abf(0x236)](),console[_0x498abf(0x236)](_0x498abf(0x23d));return 0x1;case _0x498abf(0x205):console[_0x498abf(0x236)](a5_0x32ce2e['yellow'](_0x143d35[_0x498abf(0x1d2)])),console[_0x498abf(0x236)](),console[_0x498abf(0x236)](_0x498abf(0x261)+_0x143d35[_0x498abf(0x220)]+'\x27\x20to\x20create\x20the\x20folder\x20structure.');return 0x1;case _0x498abf(0x21f):{const _0x4a5e1f=a5_0x39557c['basename'](_0x143d35[_0x498abf(0x223)]);console['log'](a5_0x32ce2e[_0x498abf(0x1f2)](_0x498abf(0x1e8)+_0x143d35[_0x498abf(0x220)]+'\x22:'));for(const _0x35ef62 of _0x143d35[_0x498abf(0x25a)]){console[_0x498abf(0x236)](_0x498abf(0x243)+_0x35ef62);}return console[_0x498abf(0x236)](),console[_0x498abf(0x236)](_0x498abf(0x20d)+_0x4a5e1f+_0x498abf(0x259)),0x1;}case'no_tests':console[_0x498abf(0x236)](a5_0x32ce2e[_0x498abf(0x1f2)](_0x498abf(0x24e)+_0x143d35['llmProject']+'\x22.')),console['log'](a5_0x32ce2e[_0x498abf(0x1d6)](_0x498abf(0x25e)+_0x143d35['projectDir'])),console[_0x498abf(0x236)](),console[_0x498abf(0x236)](_0x498abf(0x238));return 0x1;}}const {definition:_0x1960a7,agentInfo:_0x4d19e2}=parseTestFile(_0x40e361);let _0x53837e=_0x1960a7[_0x498abf(0x227)];if(_0x4375d3){const _0x32ae1e=_0x4375d3[_0x498abf(0x1ea)](',')[_0x498abf(0x22c)](_0x4e050a=>_0x4e050a[_0x498abf(0x213)]());_0x53837e=_0x1960a7[_0x498abf(0x227)][_0x498abf(0x212)](_0x163ddd=>_0x32ae1e[_0x498abf(0x244)](_0x163ddd['name']));if(_0x53837e['length']===0x0)return console[_0x498abf(0x236)](a5_0x32ce2e['yellow']('No\x20tests\x20found\x20matching:\x20'+_0x4375d3)),console['log'](a5_0x32ce2e[_0x498abf(0x1d6)](_0x498abf(0x228)+_0x1960a7[_0x498abf(0x227)][_0x498abf(0x22c)](_0x4b0199=>_0x4b0199['name'])['join'](',\x20'))),0x1;}if(_0x55b139){const _0x574622=_0x55b139['split'](',')[_0x498abf(0x22c)](_0x207fb9=>_0x207fb9[_0x498abf(0x213)]()[_0x498abf(0x206)]());_0x53837e=_0x53837e[_0x498abf(0x212)](_0x16a9de=>_0x16a9de[_0x498abf(0x20a)]?.[_0x498abf(0x1f4)](_0x5ea4c8=>_0x574622[_0x498abf(0x244)](_0x5ea4c8['toLowerCase']())));if(_0x53837e[_0x498abf(0x1fb)]===0x0){console[_0x498abf(0x236)](a5_0x32ce2e['yellow'](_0x498abf(0x26b)+_0x55b139));const _0x1e520c=new Set();return _0x1960a7['tests']['forEach'](_0x3ff392=>_0x3ff392[_0x498abf(0x20a)]?.[_0x498abf(0x23f)](_0x5165c7=>_0x1e520c[_0x498abf(0x20c)](_0x5165c7))),_0x1e520c[_0x498abf(0x201)]>0x0?console[_0x498abf(0x236)](a5_0x32ce2e[_0x498abf(0x1d6)](_0x498abf(0x1d8)+[..._0x1e520c][_0x498abf(0x1d5)](',\x20'))):console[_0x498abf(0x236)](a5_0x32ce2e[_0x498abf(0x1d6)](_0x498abf(0x21c))),0x1;}}if(_0x2bd6ba)return this[_0x498abf(0x248)](_0x1e3d50,{'definition':{'tests':_0x53837e},'agentInfo':_0x4d19e2,'outputFormat':_0x3dfcc9,'outputFile':_0x2d91bb,'testNames':_0x4375d3});if(_0x275aa7){console[_0x498abf(0x236)](a5_0x32ce2e[_0x498abf(0x1ff)]('Test\x20Configuration:')),console[_0x498abf(0x236)](_0x498abf(0x1df)+a5_0x32ce2e[_0x498abf(0x258)](_0xb25139)),console[_0x498abf(0x236)](_0x498abf(0x242)+a5_0x32ce2e[_0x498abf(0x258)](_0x4d19e2[_0x498abf(0x24f)])),console[_0x498abf(0x236)](_0x498abf(0x24c)+a5_0x32ce2e['white'](_0x4d19e2[_0x498abf(0x260)])),console[_0x498abf(0x236)](),console[_0x498abf(0x236)](_0x498abf(0x235)+a5_0x32ce2e[_0x498abf(0x258)](_0x53837e['length']));for(let _0x222d54=0x0;_0x222d54<_0x53837e[_0x498abf(0x1fb)];_0x222d54++){const _0x72d836=_0x53837e[_0x222d54],_0x4fa7f1=_0x72d836[_0x498abf(0x254)][_0x498abf(0x1fb)]===0x1?_0x498abf(0x20f):_0x498abf(0x254),_0x2763fa=_0x72d836[_0x498abf(0x20a)]?.[_0x498abf(0x1fb)]?'\x20['+_0x72d836['tags']['join'](',\x20')+']':'';console[_0x498abf(0x236)]('\x20\x20'+(_0x222d54+0x1)+'.\x20'+a5_0x32ce2e['white'](_0x72d836[_0x498abf(0x226)])+'\x20('+_0x72d836[_0x498abf(0x254)][_0x498abf(0x1fb)]+'\x20'+_0x4fa7f1+')'+a5_0x32ce2e['dim'](_0x2763fa));}return 0x0;}let _0x491b8d,_0xe9ce0a;try{_0x491b8d=await _0x507d21[_0x498abf(0x231)][_0x498abf(0x233)](_0x4d19e2[_0x498abf(0x24f)]);}catch(_0x439583){const _0x3bb6a5=_0x439583 instanceof Error?_0x439583[_0x498abf(0x1d2)]:String(_0x439583);return _0x3bb6a5[_0x498abf(0x244)](_0x498abf(0x21e))||_0x3bb6a5[_0x498abf(0x206)]()[_0x498abf(0x244)](_0x498abf(0x1f1))?console['log'](a5_0x32ce2e[_0x498abf(0x1d9)](_0x498abf(0x1dc)+_0x4d19e2[_0x498abf(0x24f)])):console['log'](a5_0x32ce2e['red'](_0x498abf(0x263)+_0x4d19e2[_0x498abf(0x24f)]+_0x498abf(0x24a)+_0x3bb6a5)),0x1;}try{_0xe9ce0a=await _0x507d21[_0x498abf(0x231)][_0x498abf(0x214)](_0x4d19e2[_0x498abf(0x260)],_0x491b8d);}catch(_0x2fb472){const _0x52a618=_0x2fb472 instanceof Error?_0x2fb472[_0x498abf(0x1d2)]:String(_0x2fb472);return _0x52a618[_0x498abf(0x244)](_0x498abf(0x21e))||_0x52a618['toLowerCase']()['includes'](_0x498abf(0x1f1))?console[_0x498abf(0x236)](a5_0x32ce2e[_0x498abf(0x1d9)](_0x498abf(0x1fc)+_0x4d19e2[_0x498abf(0x260)])):console['log'](a5_0x32ce2e[_0x498abf(0x1d9)](_0x498abf(0x26a)+_0x4d19e2[_0x498abf(0x260)]+_0x498abf(0x24a)+_0x52a618)),0x1;}let _0x27cac9;if(!_0x3371ae)try{_0x27cac9=await setupEvaluatorAgent(_0x507d21[_0x498abf(0x231)],_0x93395b[_0x498abf(0x1eb)]);}catch(_0xf47f80){const _0x5adfc2=_0xf47f80 instanceof Error?_0xf47f80[_0x498abf(0x1d2)]:String(_0xf47f80);return console[_0x498abf(0x236)](a5_0x32ce2e['red'](_0x498abf(0x1f0)+_0x5adfc2)),0x1;}console[_0x498abf(0x236)](a5_0x32ce2e['cyan'](_0x498abf(0x1f3))),console[_0x498abf(0x236)](_0x498abf(0x22b)+a5_0x32ce2e[_0x498abf(0x258)](_0xb25139)),console['log'](_0x498abf(0x1e0)+a5_0x32ce2e[_0x498abf(0x258)](_0x4d19e2[_0x498abf(0x24f)]+'/'+_0x4d19e2[_0x498abf(0x260)])),console[_0x498abf(0x236)]();const _0x3a2f1f=[],_0x1c3974=[],_0x865854=Date[_0x498abf(0x253)]();for(let _0x46e4ad=0x0;_0x46e4ad<_0x53837e[_0x498abf(0x1fb)];_0x46e4ad++){const _0x2369a0=_0x53837e[_0x46e4ad];_0x53837e[_0x498abf(0x1fb)]>0x1?console[_0x498abf(0x236)]('Test\x20'+(_0x46e4ad+0x1)+'/'+_0x53837e[_0x498abf(0x1fb)]+':\x20'+a5_0x32ce2e['white'](_0x2369a0[_0x498abf(0x226)])):console[_0x498abf(0x236)](_0x498abf(0x1e4)+a5_0x32ce2e[_0x498abf(0x258)](_0x2369a0[_0x498abf(0x226)]));const _0x8a5a44=createCommandSpinner(_0x498abf(0x1ed)+_0x2369a0[_0x498abf(0x254)][_0x498abf(0x1fb)]+_0x498abf(0x24d));_0x8a5a44[_0x498abf(0x251)]();try{const {result:_0x2977dd,conversation:_0x199a9e}=await runTest(_0x507d21[_0x498abf(0x231)],_0x2369a0,{'agentId':_0xe9ce0a,'projectId':_0x491b8d,'site':_0xb25139,'noEval':_0x3371ae,'evaluatorId':_0x27cac9,'onRoundStart':(_0x14b73e,_0x2563c4)=>{const _0x4a72d7=_0x498abf;_0x8a5a44[_0x4a72d7(0x1e1)]=_0x4a72d7(0x25d)+(_0x14b73e+0x1)+'/'+_0x2563c4+_0x4a72d7(0x24d);},'onRoundComplete':(_0x29f382,_0x4cd42e,_0x5ceb0f)=>{const _0x23813f=_0x498abf,_0x49507b=formatElapsed(_0x4cd42e);_0x5ceb0f?console[_0x23813f(0x236)](_0x23813f(0x229)+(_0x29f382+0x1)+'/'+_0x2369a0[_0x23813f(0x254)][_0x23813f(0x1fb)]+'...\x20'+a5_0x32ce2e['green']('✓')+'\x20('+_0x49507b+')'):console[_0x23813f(0x236)](_0x23813f(0x229)+(_0x29f382+0x1)+'/'+_0x2369a0[_0x23813f(0x254)]['length']+'...\x20'+a5_0x32ce2e[_0x23813f(0x1d9)]('✗'));},'onEvaluationStart':()=>{const _0x2f9351=_0x498abf;_0x8a5a44['text']=_0x2f9351(0x21d);},'onEvaluationComplete':_0x19adc4=>{const _0x347221=_0x498abf,_0x261e04=formatElapsed(_0x19adc4);console[_0x347221(0x236)](_0x347221(0x1db)+a5_0x32ce2e[_0x347221(0x24b)]('✓')+'\x20('+_0x261e04+')');}});_0x8a5a44[_0x498abf(0x202)](),_0x3a2f1f[_0x498abf(0x249)](_0x2977dd),_0x1c3974[_0x498abf(0x249)](_0x199a9e);if(_0x2977dd[_0x498abf(0x240)]===_0x498abf(0x20e))console[_0x498abf(0x236)](a5_0x32ce2e['green']('✓\x20PASS:\x20'+_0x2977dd[_0x498abf(0x268)]));else _0x2977dd[_0x498abf(0x240)]===_0x498abf(0x25c)?console[_0x498abf(0x236)](a5_0x32ce2e[_0x498abf(0x1d9)](_0x498abf(0x1e3)+_0x2977dd[_0x498abf(0x268)])):console[_0x498abf(0x236)](a5_0x32ce2e[_0x498abf(0x1d9)](_0x498abf(0x247)+_0x2977dd['reason']));_0x2977dd[_0x498abf(0x1f6)]&&console[_0x498abf(0x236)](a5_0x32ce2e['dim'](_0x498abf(0x26c)+_0x2977dd[_0x498abf(0x1f6)])),console['log']();}catch(_0x19e6eb){_0x8a5a44[_0x498abf(0x202)]();const _0x958c74=_0x19e6eb instanceof Error?_0x19e6eb[_0x498abf(0x1d2)]:String(_0x19e6eb);console[_0x498abf(0x236)](a5_0x32ce2e[_0x498abf(0x1d9)](_0x498abf(0x247)+_0x958c74)),console[_0x498abf(0x236)](),_0x3a2f1f['push']({'name':_0x2369a0['name'],'status':'ERROR','reason':_0x958c74,'timestamp':new Date()[_0x498abf(0x1f9)](),'duration_ms':0x0});}}const _0xcd3c7f=Date[_0x498abf(0x253)]()-_0x865854,_0x58a2c6=_0x3a2f1f['filter'](_0x119535=>_0x119535['status']==='PASS')[_0x498abf(0x1fb)],_0x45197a=_0x3a2f1f[_0x498abf(0x212)](_0x4d954d=>_0x4d954d[_0x498abf(0x240)]===_0x498abf(0x25c))['length'],_0x210d47=_0x3a2f1f[_0x498abf(0x212)](_0x51d9b6=>_0x51d9b6[_0x498abf(0x240)]===_0x498abf(0x265))['length'];console[_0x498abf(0x236)]('━'[_0x498abf(0x22e)](0x3c)),console[_0x498abf(0x236)](_0x498abf(0x1ec)),console['log']('━'['repeat'](0x3c)),console[_0x498abf(0x236)](_0x498abf(0x218)+_0x3a2f1f[_0x498abf(0x1fb)]),console['log'](_0x498abf(0x267)+a5_0x32ce2e[_0x498abf(0x24b)](_0x58a2c6)),console[_0x498abf(0x236)](_0x498abf(0x23e)+a5_0x32ce2e[_0x498abf(0x1d9)](_0x45197a));_0x210d47>0x0&&console[_0x498abf(0x236)](_0x498abf(0x1e2)+a5_0x32ce2e['red'](_0x210d47));console[_0x498abf(0x236)](_0x498abf(0x221)+formatElapsed(_0xcd3c7f)),console[_0x498abf(0x236)]('━'['repeat'](0x3c));const _0x404eff=_0x3a2f1f[_0x498abf(0x212)](_0x5965ed=>_0x5965ed[_0x498abf(0x240)]!==_0x498abf(0x20e));if(_0x404eff[_0x498abf(0x1fb)]>0x0){console[_0x498abf(0x236)](),console[_0x498abf(0x236)](_0x498abf(0x203));for(const _0x2738fa of _0x404eff){const _0x479659=a5_0x32ce2e[_0x498abf(0x1d9)]('✗'),_0x4456a7=_0x2738fa[_0x498abf(0x268)][_0x498abf(0x1fb)]>0x32?_0x2738fa[_0x498abf(0x268)][_0x498abf(0x209)](0x0,0x32)+_0x498abf(0x1e7):_0x2738fa[_0x498abf(0x268)];console['log']('\x20\x20'+_0x479659+'\x20'+_0x2738fa[_0x498abf(0x226)]+':\x20'+_0x4456a7);}}const _0xc6822b={'summary':{'total':_0x3a2f1f[_0x498abf(0x1fb)],'passed':_0x58a2c6,'failed':_0x45197a,'errors':_0x210d47>0x0?_0x210d47:undefined,'duration_ms':_0xcd3c7f},'tests':_0x3a2f1f,'agent':{'project':_0x4d19e2['projectName'],'name':_0x4d19e2[_0x498abf(0x260)],'site':_0xb25139},'timestamp':new Date(_0x865854)[_0x498abf(0x1f9)]()};try{const _0x2d0fe3=buildCachedTestRun(_0x1c3974,{'site':_0xb25139,'projectId':_0x491b8d,'projectName':_0x4d19e2[_0x498abf(0x24f)],'agentId':_0xe9ce0a,'agentName':_0x4d19e2['agentName'],'testYmlPath':a5_0x39557c[_0x498abf(0x1e6)](_0x4d19e2[_0x498abf(0x22f)])});saveLastTestRun(_0x2d0fe3);}catch{}if(_0x3dfcc9!==_0x498abf(0x219)||_0x2d91bb){const _0x48bdeb=formatResults(_0xc6822b,_0x3dfcc9);if(_0x2d91bb)try{a5_0x3baeb1['writeFileSync'](_0x2d91bb,_0x48bdeb,'utf-8'),console['log'](),console['log'](a5_0x32ce2e[_0x498abf(0x1d6)](_0x498abf(0x1da)+_0x2d91bb));}catch(_0x3bb1bc){return console[_0x498abf(0x236)](),console[_0x498abf(0x236)](a5_0x32ce2e[_0x498abf(0x1d9)](_0x498abf(0x255)+_0x3bb1bc)),0x1;}else console['log'](),console['log'](_0x48bdeb);}return _0x404eff[_0x498abf(0x1fb)]>0x0?0x1:0x0;}async[a5_0x47d17d(0x248)](_0x47e6df,_0x36b4ed){const _0x445cb6=a5_0x47d17d,{options:_0x5a2c2c,tdx:_0x3b71a0}=_0x47e6df,{definition:_0x1457fc,agentInfo:_0x2ed787,outputFormat:_0x1b34b4,outputFile:_0x48249d}=_0x36b4ed,_0x1594f4=_0x5a2c2c[_0x445cb6(0x1ee)],_0x14354f=loadLastTestRun();if(!_0x14354f)return console[_0x445cb6(0x236)](a5_0x32ce2e[_0x445cb6(0x1d9)](_0x445cb6(0x20b))),console[_0x445cb6(0x236)](a5_0x32ce2e[_0x445cb6(0x1d6)]('Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.')),0x1;if(_0x14354f[_0x445cb6(0x25b)][_0x445cb6(0x260)]!==_0x2ed787[_0x445cb6(0x260)])return console[_0x445cb6(0x236)](a5_0x32ce2e[_0x445cb6(0x1d9)](_0x445cb6(0x262)+_0x14354f[_0x445cb6(0x25b)][_0x445cb6(0x260)]+_0x445cb6(0x234)+_0x2ed787['agentName']+'\x22.')),console[_0x445cb6(0x236)](a5_0x32ce2e[_0x445cb6(0x1d6)](_0x445cb6(0x200))),0x1;const _0x1def45=new Set(_0x14354f['conversations']['map'](_0x3eb91e=>_0x3eb91e[_0x445cb6(0x224)])),_0x404116=_0x1457fc[_0x445cb6(0x227)][_0x445cb6(0x212)](_0x18e6c8=>!_0x1def45['has'](_0x18e6c8[_0x445cb6(0x226)]));if(_0x404116[_0x445cb6(0x1fb)]>0x0&&_0x14354f[_0x445cb6(0x1ee)]!==_0x1594f4)return console['log'](a5_0x32ce2e[_0x445cb6(0x1d9)](_0x445cb6(0x204))),console[_0x445cb6(0x236)](a5_0x32ce2e[_0x445cb6(0x1d6)](_0x445cb6(0x210)+_0x14354f[_0x445cb6(0x1ee)]+'\x22,\x20but\x20current\x20site\x20is\x20\x22'+_0x1594f4+'\x22.')),console[_0x445cb6(0x236)](a5_0x32ce2e['dim'](_0x445cb6(0x269)+_0x14354f[_0x445cb6(0x1ee)]+_0x445cb6(0x1e9))),0x1;const _0x32b86e=_0x1457fc[_0x445cb6(0x227)]['filter'](_0x538fad=>_0x1def45[_0x445cb6(0x225)](_0x538fad[_0x445cb6(0x226)])),_0x309d3e=_0x404116;let _0x498dbb;try{_0x498dbb=await setupEvaluatorAgent(_0x3b71a0['llm'],_0x5a2c2c['verbose']);}catch(_0x23e879){const _0x53f45c=_0x23e879 instanceof Error?_0x23e879['message']:String(_0x23e879);return console[_0x445cb6(0x236)](a5_0x32ce2e['red'](_0x445cb6(0x1f0)+_0x53f45c)),0x1;}console['log'](a5_0x32ce2e[_0x445cb6(0x1ff)]('Re-evaluating\x20cached\x20test\x20run...')),console['log']('Cached\x20run\x20from:\x20'+a5_0x32ce2e[_0x445cb6(0x258)](_0x14354f['timestamp'])),console[_0x445cb6(0x236)](_0x445cb6(0x1e0)+a5_0x32ce2e[_0x445cb6(0x258)](_0x14354f['agent'][_0x445cb6(0x24f)]+'/'+_0x14354f['agent'][_0x445cb6(0x260)]));_0x309d3e['length']>0x0&&console['log'](_0x445cb6(0x1fa)+a5_0x32ce2e['yellow'](_0x309d3e[_0x445cb6(0x1fb)]));console[_0x445cb6(0x236)]();const _0x58e204=[],_0xd717d5=Date['now'](),_0x1822c1=createCommandSpinner(_0x445cb6(0x246));if(_0x32b86e[_0x445cb6(0x1fb)]>0x0)try{const _0x8e6c1a=await reevaluateFromCache(_0x3b71a0[_0x445cb6(0x231)],_0x14354f,{'tests':_0x32b86e},{'evaluatorId':_0x498dbb,'onTestStart':(_0x87a367,_0x2b0db6,_0x3b72ba)=>{const _0x4064cb=_0x445cb6;_0x1822c1['text']=_0x4064cb(0x1d3)+(_0x2b0db6+0x1)+'/'+_0x3b72ba+':\x20'+_0x87a367+'...';if(!_0x1822c1['isSpinning'])_0x1822c1[_0x4064cb(0x251)]();},'onTestComplete':(_0x2af094,_0x460253)=>{const _0x3093ee=_0x445cb6;_0x1822c1[_0x3093ee(0x202)]();if(_0x460253['status']===_0x3093ee(0x20e))console[_0x3093ee(0x236)](a5_0x32ce2e[_0x3093ee(0x24b)](_0x3093ee(0x22d)+_0x2af094)+a5_0x32ce2e[_0x3093ee(0x1d6)](_0x3093ee(0x23c)));else _0x460253['status']===_0x3093ee(0x25c)?console[_0x3093ee(0x236)](a5_0x32ce2e['red'](_0x3093ee(0x1e3)+_0x2af094+_0x3093ee(0x252)+_0x460253[_0x3093ee(0x268)])+a5_0x32ce2e['dim'](_0x3093ee(0x23c))):console['log'](a5_0x32ce2e[_0x3093ee(0x1d9)]('✗\x20ERROR:\x20'+_0x2af094+'\x20-\x20'+_0x460253[_0x3093ee(0x268)]));_0x460253[_0x3093ee(0x1f6)]&&console[_0x3093ee(0x236)](a5_0x32ce2e['dim'](_0x3093ee(0x208)+_0x460253[_0x3093ee(0x1f6)])),_0x58e204['push'](_0x460253);},'onTestSkipped':(_0x1be6fe,_0x17e5ea)=>{const _0xbb5252=_0x445cb6;_0x1822c1[_0xbb5252(0x202)](),console[_0xbb5252(0x236)](a5_0x32ce2e['yellow']('⚠\x20SKIPPED:\x20'+_0x1be6fe+'\x20-\x20'+_0x17e5ea));}});for(const _0x32ba2d of _0x8e6c1a){!_0x58e204[_0x445cb6(0x1d4)](_0x3bf75f=>_0x3bf75f[_0x445cb6(0x226)]===_0x32ba2d[_0x445cb6(0x226)])&&_0x58e204['push'](_0x32ba2d);}}catch(_0x268fc3){_0x1822c1[_0x445cb6(0x202)]();const _0xb6e2da=_0x268fc3 instanceof Error?_0x268fc3['message']:String(_0x268fc3);return console[_0x445cb6(0x236)](a5_0x32ce2e[_0x445cb6(0x1d9)](_0x445cb6(0x25f)+_0xb6e2da)),0x1;}_0x1822c1[_0x445cb6(0x202)]();if(_0x309d3e['length']>0x0){console[_0x445cb6(0x236)](),console[_0x445cb6(0x236)](a5_0x32ce2e[_0x445cb6(0x1ff)](_0x445cb6(0x216)));const {projectId:_0x555f4f,agentId:_0x440240}=_0x14354f[_0x445cb6(0x25b)];for(const _0x2f96b3 of _0x309d3e){console[_0x445cb6(0x236)](_0x445cb6(0x239)+a5_0x32ce2e['white'](_0x2f96b3[_0x445cb6(0x226)]));const _0x37649e=createCommandSpinner(_0x445cb6(0x1ed)+_0x2f96b3[_0x445cb6(0x254)][_0x445cb6(0x1fb)]+_0x445cb6(0x24d));_0x37649e[_0x445cb6(0x251)]();try{const {result:_0xfa277d}=await runTest(_0x3b71a0[_0x445cb6(0x231)],_0x2f96b3,{'agentId':_0x440240,'projectId':_0x555f4f,'site':_0x14354f[_0x445cb6(0x1ee)],'noEval':![],'evaluatorId':_0x498dbb,'onRoundStart':(_0x232b42,_0x50b8a8)=>{const _0x3ab2e1=_0x445cb6;_0x37649e[_0x3ab2e1(0x1e1)]='Round\x20'+(_0x232b42+0x1)+'/'+_0x50b8a8+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x10707b,_0x105dc5,_0x2b27fa)=>{const _0x3dbefe=_0x445cb6,_0x303e93=formatElapsed(_0x105dc5);_0x2b27fa?console[_0x3dbefe(0x236)](_0x3dbefe(0x229)+(_0x10707b+0x1)+'/'+_0x2f96b3[_0x3dbefe(0x254)][_0x3dbefe(0x1fb)]+_0x3dbefe(0x1fd)+a5_0x32ce2e['green']('✓')+'\x20('+_0x303e93+')'):console[_0x3dbefe(0x236)](_0x3dbefe(0x229)+(_0x10707b+0x1)+'/'+_0x2f96b3[_0x3dbefe(0x254)]['length']+'...\x20'+a5_0x32ce2e[_0x3dbefe(0x1d9)]('✗'));},'onEvaluationStart':()=>{const _0x391e01=_0x445cb6;_0x37649e[_0x391e01(0x1e1)]='Evaluating\x20response...';},'onEvaluationComplete':_0x313feb=>{const _0x37b388=_0x445cb6,_0x5512fa=formatElapsed(_0x313feb);console['log'](_0x37b388(0x1db)+a5_0x32ce2e[_0x37b388(0x24b)]('✓')+'\x20('+_0x5512fa+')');}});_0x37649e['stop'](),_0x58e204[_0x445cb6(0x249)](_0xfa277d);if(_0xfa277d[_0x445cb6(0x240)]==='PASS')console['log'](a5_0x32ce2e[_0x445cb6(0x24b)](_0x445cb6(0x22d)+_0xfa277d[_0x445cb6(0x268)])+a5_0x32ce2e['dim'](_0x445cb6(0x1d1)));else _0xfa277d['status']===_0x445cb6(0x25c)?console['log'](a5_0x32ce2e[_0x445cb6(0x1d9)](_0x445cb6(0x1e3)+_0xfa277d[_0x445cb6(0x268)])+a5_0x32ce2e[_0x445cb6(0x1d6)](_0x445cb6(0x1d1))):console['log'](a5_0x32ce2e['red']('✗\x20ERROR:\x20'+_0xfa277d[_0x445cb6(0x268)]));_0xfa277d['conversation_url']&&console['log'](a5_0x32ce2e[_0x445cb6(0x1d6)](_0x445cb6(0x208)+_0xfa277d[_0x445cb6(0x1f6)]));}catch(_0x22dd76){_0x37649e['stop']();const _0x1262fd=_0x22dd76 instanceof Error?_0x22dd76[_0x445cb6(0x1d2)]:String(_0x22dd76);console['log'](a5_0x32ce2e['red'](_0x445cb6(0x247)+_0x1262fd)),_0x58e204[_0x445cb6(0x249)]({'name':_0x2f96b3['name'],'status':'ERROR','reason':_0x1262fd,'timestamp':new Date()[_0x445cb6(0x1f9)](),'duration_ms':0x0});}}}console[_0x445cb6(0x236)]();const _0x228ef8=Date[_0x445cb6(0x253)]()-_0xd717d5,_0xefb3fb=_0x58e204['filter'](_0x10ec5b=>_0x10ec5b['status']===_0x445cb6(0x20e))['length'],_0x540994=_0x58e204[_0x445cb6(0x212)](_0x232a62=>_0x232a62[_0x445cb6(0x240)]===_0x445cb6(0x25c))[_0x445cb6(0x1fb)],_0x2f01d0=_0x58e204['filter'](_0x226354=>_0x226354['status']===_0x445cb6(0x265))[_0x445cb6(0x1fb)];console['log']('━'[_0x445cb6(0x22e)](0x3c)),console[_0x445cb6(0x236)](_0x445cb6(0x1de)),console[_0x445cb6(0x236)]('━'['repeat'](0x3c)),console[_0x445cb6(0x236)](_0x445cb6(0x218)+_0x58e204[_0x445cb6(0x1fb)]),console[_0x445cb6(0x236)](_0x445cb6(0x267)+a5_0x32ce2e[_0x445cb6(0x24b)](_0xefb3fb)),console[_0x445cb6(0x236)](_0x445cb6(0x23e)+a5_0x32ce2e[_0x445cb6(0x1d9)](_0x540994));_0x2f01d0>0x0&&console[_0x445cb6(0x236)](_0x445cb6(0x1e2)+a5_0x32ce2e[_0x445cb6(0x1d9)](_0x2f01d0));console[_0x445cb6(0x236)](_0x445cb6(0x221)+formatElapsed(_0x228ef8)),console[_0x445cb6(0x236)]('━'[_0x445cb6(0x22e)](0x3c));const _0x4e1d0c={'summary':{'total':_0x58e204[_0x445cb6(0x1fb)],'passed':_0xefb3fb,'failed':_0x540994,'errors':_0x2f01d0>0x0?_0x2f01d0:undefined,'duration_ms':_0x228ef8},'tests':_0x58e204,'agent':{'project':_0x2ed787[_0x445cb6(0x24f)],'name':_0x2ed787[_0x445cb6(0x260)],'site':_0x1594f4},'timestamp':new Date(_0xd717d5)[_0x445cb6(0x1f9)]()};if(_0x1b34b4!==_0x445cb6(0x219)||_0x48249d){const _0x5c1855=formatResults(_0x4e1d0c,_0x1b34b4);if(_0x48249d)try{a5_0x3baeb1[_0x445cb6(0x22a)](_0x48249d,_0x5c1855,'utf-8'),console[_0x445cb6(0x236)](),console[_0x445cb6(0x236)](a5_0x32ce2e['dim'](_0x445cb6(0x1da)+_0x48249d));}catch(_0x4f87b6){return console[_0x445cb6(0x236)](),console[_0x445cb6(0x236)](a5_0x32ce2e[_0x445cb6(0x1d9)](_0x445cb6(0x255)+_0x4f87b6)),0x1;}else console[_0x445cb6(0x236)](),console[_0x445cb6(0x236)](_0x5c1855);}const _0x536dcb=_0x58e204[_0x445cb6(0x212)](_0x1a86d0=>_0x1a86d0[_0x445cb6(0x240)]!=='PASS');return _0x536dcb[_0x445cb6(0x1fb)]>0x0?0x1:0x0;}}
@@ -1 +1 @@
1
- function a6_0x222b(){const _0x1d2ec2=['POST','llm-proxy','isArray','Results\x20saved\x20to\x20','3FIfWPR','length','trim','GET','.\x20Valid\x20types:\x20','740OWDJrV','Invalid\x20header\x20format:\x20\x22','name','Invalid\x20HTTP\x20method:\x20','341308DevZxU','11209cGMFmo','stack','proxy-authorization','9ankxqw','cookie','x-xsrf-token','564yTLCQN','1426915zJMZoP','25777320wIzlNP','\x22.\x20','color','output','Invalid\x20API\x20type:\x20','request','x-trino-user','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','llm','keys','log','\x0aStack\x20trace:\x0a','trino','message','x-auth-token','validate','body','171464SWEOyL','data','status','headers','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','has','error','Endpoint\x20must\x20start\x20with\x20/:\x20','<\x20HTTP/1.1\x20','authorization','readBodyFromFile','file','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','DELETE','50LfjHko','includes','toUpperCase','startsWith','Error:\x20','substring','7091994jiLxGM','api','entries','execute','join','PUT','6NsIOgq','site','verbose','cdp','type','indexOf','header','toLowerCase','set-cookie','noColor'];a6_0x222b=function(){return _0x1d2ec2;};return a6_0x222b();}const a6_0x474195=a6_0x37d8;(function(_0x1511e6,_0x32c145){const _0x20a538=a6_0x37d8,_0x54e15f=_0x1511e6();while(!![]){try{const _0x1d0e45=parseInt(_0x20a538(0x19d))/0x1*(-parseInt(_0x20a538(0x192))/0x2)+parseInt(_0x20a538(0x18d))/0x3*(-parseInt(_0x20a538(0x196))/0x4)+-parseInt(_0x20a538(0x19e))/0x5*(parseInt(_0x20a538(0x17f))/0x6)+-parseInt(_0x20a538(0x179))/0x7+parseInt(_0x20a538(0x1b0))/0x8*(-parseInt(_0x20a538(0x19a))/0x9)+parseInt(_0x20a538(0x1be))/0xa*(-parseInt(_0x20a538(0x197))/0xb)+parseInt(_0x20a538(0x19f))/0xc;if(_0x1d0e45===_0x32c145)break;else _0x54e15f['push'](_0x54e15f['shift']());}catch(_0x139cd3){_0x54e15f['push'](_0x54e15f['shift']());}}}(a6_0x222b,0x8129a));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';function a6_0x37d8(_0x4e6ba6,_0x4da6cb){_0x4e6ba6=_0x4e6ba6-0x175;const _0x222b61=a6_0x222b();let _0x37d895=_0x222b61[_0x4e6ba6];return _0x37d895;}import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a6_0x474195(0x1b9),a6_0x474195(0x199),a6_0x474195(0x19b),a6_0x474195(0x187),'set-cookie2',a6_0x474195(0x19c),a6_0x474195(0x1ad),a6_0x474195(0x1a5)]);function isSensitiveHeader(_0x5e7dff){const _0x5a033f=a6_0x474195;return SENSITIVE_HEADERS[_0x5a033f(0x1b5)](_0x5e7dff[_0x5a033f(0x186)]());}function parseHeader(_0x4eac1a){const _0x3be392=a6_0x474195,_0x45959e=_0x4eac1a[_0x3be392(0x184)](':');if(_0x45959e===-0x1)throw new Error(_0x3be392(0x193)+_0x4eac1a+_0x3be392(0x1a0)+'Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22');const _0x52365e=_0x4eac1a[_0x3be392(0x178)](0x0,_0x45959e)[_0x3be392(0x18f)](),_0x52f4b0=_0x4eac1a[_0x3be392(0x178)](_0x45959e+0x1)[_0x3be392(0x18f)]();if(!_0x52365e)throw new Error(_0x3be392(0x1a6)+_0x4eac1a+'\x22');return[_0x52365e,_0x52f4b0];}export class ApiCommand extends BaseCommand{[a6_0x474195(0x194)]=a6_0x474195(0x17a);['description']=a6_0x474195(0x1bc);[a6_0x474195(0x1ae)](_0x4cb898){const _0x527fe9=a6_0x474195,{args:_0x337274,options:_0x938817}=_0x4cb898,_0x24dcad=_0x938817;if(_0x337274['length']===0x0)return _0x527fe9(0x1b4);const _0x8806e5=_0x337274[0x0];if(!_0x8806e5[_0x527fe9(0x176)]('/'))return _0x527fe9(0x1b7)+_0x8806e5;const _0x290ca6=_0x24dcad[_0x527fe9(0x1b1)],_0x1117c3=_0x24dcad[_0x527fe9(0x1bb)];if(_0x290ca6&&_0x1117c3)return'Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.';const _0x58e952=_0x24dcad['method']||_0x527fe9(0x190),_0x3de64c=[_0x527fe9(0x190),_0x527fe9(0x189),_0x527fe9(0x17e),_0x527fe9(0x1bd),'PATCH'];if(!_0x3de64c[_0x527fe9(0x1bf)](_0x58e952[_0x527fe9(0x175)]()))return _0x527fe9(0x195)+_0x58e952+'.\x20Valid\x20methods:\x20'+_0x3de64c[_0x527fe9(0x17d)](',\x20');const _0x4739da=_0x24dcad[_0x527fe9(0x183)]||'td',_0x3cc9bf=['td',_0x527fe9(0x182),'workflow',_0x527fe9(0x1ab),_0x527fe9(0x1a7),_0x527fe9(0x18a)];if(!_0x3cc9bf['includes'](_0x4739da))return _0x527fe9(0x1a3)+_0x4739da+_0x527fe9(0x191)+_0x3cc9bf[_0x527fe9(0x17d)](',\x20');return undefined;}async[a6_0x474195(0x17c)](_0x50f3d0){const _0x123c81=a6_0x474195,{options:_0x5e8c0f,args:_0x237256,tdx:_0x3654d0}=_0x50f3d0,_0x2e4714=_0x5e8c0f,_0x1d2842=_0x237256[0x0],_0x3e4df3=(_0x2e4714['method']||_0x123c81(0x190))[_0x123c81(0x175)](),_0x45946d=_0x2e4714[_0x123c81(0x1b1)],_0x376d61=_0x2e4714[_0x123c81(0x1bb)],_0x4739a1=_0x2e4714[_0x123c81(0x185)],_0x22c75f=_0x2e4714['type']||'td';try{const _0x1456a9={};if(_0x4739a1){const _0x34ed55=Array[_0x123c81(0x18b)](_0x4739a1)?_0x4739a1:[_0x4739a1];for(const _0x935ffa of _0x34ed55){const [_0x269d6d,_0x224324]=parseHeader(_0x935ffa);_0x1456a9[_0x269d6d]=_0x224324;}}let _0x5f2c66;if(_0x45946d)_0x5f2c66=_0x45946d;else{if(_0x376d61)try{_0x5f2c66=RawAPI[_0x123c81(0x1ba)](_0x376d61);}catch(_0x4f1ef3){return console[_0x123c81(0x1b6)](_0x123c81(0x177)+(_0x4f1ef3 instanceof Error?_0x4f1ef3[_0x123c81(0x1ac)]:String(_0x4f1ef3))),0x1;}}const _0x3f86f2={'method':_0x3e4df3,'apiType':_0x22c75f,'includeHeaders':_0x5e8c0f[_0x123c81(0x181)]};_0x5f2c66&&(_0x3f86f2[_0x123c81(0x1af)]=_0x5f2c66);Object[_0x123c81(0x1a8)](_0x1456a9)[_0x123c81(0x18e)]>0x0&&(_0x3f86f2[_0x123c81(0x1b3)]=_0x1456a9);if(_0x5e8c0f[_0x123c81(0x181)]){const _0x4a6f8e=resolveSite(_0x5e8c0f[_0x123c81(0x180)]),_0xa6ba52=getEndpoint(_0x4a6f8e,_0x22c75f),_0x13d439=''+_0xa6ba52+_0x1d2842;console[_0x123c81(0x1b6)]('>\x20'+_0x3e4df3+'\x20'+_0x13d439);const _0x400302=getAuthHeaders(_0x4a6f8e),_0x21d917={..._0x400302,..._0x1456a9};for(const [_0x27d474,_0x375ac7]of Object['entries'](_0x21d917)){!isSensitiveHeader(_0x27d474)&&console[_0x123c81(0x1b6)]('>\x20'+_0x27d474+':\x20'+_0x375ac7);}_0x5f2c66&&console[_0x123c81(0x1b6)]('>'),console[_0x123c81(0x1b6)]('');}const _0x539d9d=await _0x3654d0[_0x123c81(0x17a)][_0x123c81(0x1a4)](_0x1d2842,_0x3f86f2);if(_0x5e8c0f[_0x123c81(0x181)]&&_0x539d9d[_0x123c81(0x1b3)]){console[_0x123c81(0x1b6)](_0x123c81(0x1b8)+_0x539d9d[_0x123c81(0x1b2)]);for(const [_0x4ff9ce,_0x50546b]of Object[_0x123c81(0x17b)](_0x539d9d[_0x123c81(0x1b3)])){!isSensitiveHeader(_0x4ff9ce)&&console[_0x123c81(0x1b6)]('<\x20'+_0x4ff9ce+':\x20'+_0x50546b);}console['error']('');}const _0x3fa372=Boolean(_0x5e8c0f[_0x123c81(0x1a2)]),_0x4b4f67={'color':_0x5e8c0f[_0x123c81(0x1a1)],'noColor':_0x5e8c0f[_0x123c81(0x188)]||_0x3fa372&&!_0x5e8c0f[_0x123c81(0x1a1)]},_0x126af9=colorizeJSON(_0x539d9d[_0x123c81(0x1b1)],_0x4b4f67);return _0x5e8c0f[_0x123c81(0x1a2)]?(writeFileSync(_0x5e8c0f[_0x123c81(0x1a2)],_0x126af9),console[_0x123c81(0x1b6)](_0x123c81(0x18c)+_0x5e8c0f[_0x123c81(0x1a2)])):console[_0x123c81(0x1a9)](_0x126af9),0x0;}catch(_0x41e407){return _0x41e407 instanceof Error?(console[_0x123c81(0x1b6)](_0x123c81(0x177)+_0x41e407[_0x123c81(0x1ac)]),_0x5e8c0f[_0x123c81(0x181)]&&_0x41e407[_0x123c81(0x198)]&&console['error'](_0x123c81(0x1aa)+_0x41e407[_0x123c81(0x198)])):console[_0x123c81(0x1b6)](_0x123c81(0x177)+String(_0x41e407)),0x1;}}}
1
+ const a6_0x401f4a=a6_0x41e1;(function(_0x5bb0dc,_0x32de5c){const _0x7069c7=a6_0x41e1,_0x5aec1c=_0x5bb0dc();while(!![]){try{const _0x387c2e=-parseInt(_0x7069c7(0xaa))/0x1*(-parseInt(_0x7069c7(0xe4))/0x2)+parseInt(_0x7069c7(0xc0))/0x3+parseInt(_0x7069c7(0xda))/0x4*(parseInt(_0x7069c7(0xb2))/0x5)+-parseInt(_0x7069c7(0xba))/0x6*(-parseInt(_0x7069c7(0xe3))/0x7)+-parseInt(_0x7069c7(0xa9))/0x8+parseInt(_0x7069c7(0xd5))/0x9+parseInt(_0x7069c7(0xdc))/0xa*(-parseInt(_0x7069c7(0xa8))/0xb);if(_0x387c2e===_0x32de5c)break;else _0x5aec1c['push'](_0x5aec1c['shift']());}catch(_0x337bde){_0x5aec1c['push'](_0x5aec1c['shift']());}}}(a6_0x4fe6,0xb3b65));import{BaseCommand}from'./command.js';function a6_0x41e1(_0x1e74d2,_0x3f2ccc){_0x1e74d2=_0x1e74d2-0xa1;const _0x4fe67f=a6_0x4fe6();let _0x41e104=_0x4fe67f[_0x1e74d2];return _0x41e104;}import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a6_0x401f4a(0xa7),a6_0x401f4a(0xcc),'cookie',a6_0x401f4a(0xe8),'set-cookie2','x-xsrf-token',a6_0x401f4a(0xb3),a6_0x401f4a(0xa1)]);function isSensitiveHeader(_0x2cbd66){const _0x1f14ce=a6_0x401f4a;return SENSITIVE_HEADERS[_0x1f14ce(0xd0)](_0x2cbd66[_0x1f14ce(0xcf)]());}function a6_0x4fe6(){const _0x389a16=['type','4884633zOJdOA','status','headers','body','Endpoint\x20must\x20start\x20with\x20/:\x20','18740CSyrYn','join','12065870DhjpTZ','api','.\x20Valid\x20types:\x20','length','site','workflow','file','1357412XvGVmD','44WhwzRx','POST','startsWith','cdp','set-cookie','noColor','x-trino-user','PUT','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','trino','data','color','authorization','11HktARU','10311736RqDqca','10787YZupsq','<\x20HTTP/1.1\x20','request','llm','GET','validate','isArray','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','180iqIxhD','x-auth-token','Invalid\x20HTTP\x20method:\x20','name','trim','\x0aStack\x20trace:\x0a','keys','includes','42EFqKDu','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','stack','header','.\x20Valid\x20methods:\x20','execute','2776596tBiaKc','log','output','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','readBodyFromFile','method','Error:\x20','error','substring','llm-proxy','indexOf','verbose','proxy-authorization','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','PATCH','toLowerCase','has','toUpperCase','entries','Results\x20saved\x20to\x20'];a6_0x4fe6=function(){return _0x389a16;};return a6_0x4fe6();}function parseHeader(_0x5481c0){const _0x26f114=a6_0x401f4a,_0x43b762=_0x5481c0[_0x26f114(0xca)](':');if(_0x43b762===-0x1)throw new Error('Invalid\x20header\x20format:\x20\x22'+_0x5481c0+'\x22.\x20'+_0x26f114(0xbb));const _0x1f95ff=_0x5481c0[_0x26f114(0xc8)](0x0,_0x43b762)[_0x26f114(0xb6)](),_0x287bf1=_0x5481c0[_0x26f114(0xc8)](_0x43b762+0x1)['trim']();if(!_0x1f95ff)throw new Error(_0x26f114(0xc3)+_0x5481c0+'\x22');return[_0x1f95ff,_0x287bf1];}export class ApiCommand extends BaseCommand{[a6_0x401f4a(0xb5)]=a6_0x401f4a(0xdd);['description']=a6_0x401f4a(0xb1);[a6_0x401f4a(0xaf)](_0x25335d){const _0x111320=a6_0x401f4a,{args:_0x5919df,options:_0x135ba4}=_0x25335d,_0x4c1649=_0x135ba4;if(_0x5919df[_0x111320(0xdf)]===0x0)return _0x111320(0xcd);const _0x395323=_0x5919df[0x0];if(!_0x395323[_0x111320(0xe6)]('/'))return _0x111320(0xd9)+_0x395323;const _0xc7fb48=_0x4c1649[_0x111320(0xa5)],_0x4ae5e9=_0x4c1649[_0x111320(0xe2)];if(_0xc7fb48&&_0x4ae5e9)return _0x111320(0xa3);const _0x25a6ac=_0x4c1649[_0x111320(0xc5)]||_0x111320(0xae),_0x211322=[_0x111320(0xae),_0x111320(0xe5),_0x111320(0xa2),'DELETE',_0x111320(0xce)];if(!_0x211322[_0x111320(0xb9)](_0x25a6ac[_0x111320(0xd1)]()))return _0x111320(0xb4)+_0x25a6ac+_0x111320(0xbe)+_0x211322[_0x111320(0xdb)](',\x20');const _0x4b4394=_0x4c1649[_0x111320(0xd4)]||'td',_0x1c5edf=['td',_0x111320(0xe7),_0x111320(0xe1),_0x111320(0xa4),_0x111320(0xad),_0x111320(0xc9)];if(!_0x1c5edf['includes'](_0x4b4394))return'Invalid\x20API\x20type:\x20'+_0x4b4394+_0x111320(0xde)+_0x1c5edf[_0x111320(0xdb)](',\x20');return undefined;}async[a6_0x401f4a(0xbf)](_0x41ad13){const _0x28212a=a6_0x401f4a,{options:_0x559bb9,args:_0x10bbc4,tdx:_0x2274fc}=_0x41ad13,_0x10ced4=_0x559bb9,_0x2d9360=_0x10bbc4[0x0],_0x2ddb02=(_0x10ced4['method']||_0x28212a(0xae))[_0x28212a(0xd1)](),_0x277a23=_0x10ced4['data'],_0x5b9a6d=_0x10ced4[_0x28212a(0xe2)],_0x314734=_0x10ced4[_0x28212a(0xbd)],_0x2a11b2=_0x10ced4[_0x28212a(0xd4)]||'td';try{const _0x5650a1={};if(_0x314734){const _0x501c3a=Array[_0x28212a(0xb0)](_0x314734)?_0x314734:[_0x314734];for(const _0x105e8a of _0x501c3a){const [_0x5d5dd2,_0x4213a8]=parseHeader(_0x105e8a);_0x5650a1[_0x5d5dd2]=_0x4213a8;}}let _0x1ffb4d;if(_0x277a23)_0x1ffb4d=_0x277a23;else{if(_0x5b9a6d)try{_0x1ffb4d=RawAPI[_0x28212a(0xc4)](_0x5b9a6d);}catch(_0x246b49){return console[_0x28212a(0xc7)](_0x28212a(0xc6)+(_0x246b49 instanceof Error?_0x246b49['message']:String(_0x246b49))),0x1;}}const _0x542b1c={'method':_0x2ddb02,'apiType':_0x2a11b2,'includeHeaders':_0x559bb9[_0x28212a(0xcb)]};_0x1ffb4d&&(_0x542b1c[_0x28212a(0xd8)]=_0x1ffb4d);Object[_0x28212a(0xb8)](_0x5650a1)['length']>0x0&&(_0x542b1c[_0x28212a(0xd7)]=_0x5650a1);if(_0x559bb9[_0x28212a(0xcb)]){const _0x5b839d=resolveSite(_0x559bb9[_0x28212a(0xe0)]),_0x13cc99=getEndpoint(_0x5b839d,_0x2a11b2),_0x473be2=''+_0x13cc99+_0x2d9360;console[_0x28212a(0xc7)]('>\x20'+_0x2ddb02+'\x20'+_0x473be2);const _0x5bcdb8=getAuthHeaders(_0x5b839d),_0x3d750c={..._0x5bcdb8,..._0x5650a1};for(const [_0x48f0e0,_0x1cbba6]of Object[_0x28212a(0xd2)](_0x3d750c)){!isSensitiveHeader(_0x48f0e0)&&console[_0x28212a(0xc7)]('>\x20'+_0x48f0e0+':\x20'+_0x1cbba6);}_0x1ffb4d&&console[_0x28212a(0xc7)]('>'),console[_0x28212a(0xc7)]('');}const _0x58aced=await _0x2274fc['api'][_0x28212a(0xac)](_0x2d9360,_0x542b1c);if(_0x559bb9['verbose']&&_0x58aced['headers']){console[_0x28212a(0xc7)](_0x28212a(0xab)+_0x58aced[_0x28212a(0xd6)]);for(const [_0x2ea67d,_0x3a9df7]of Object['entries'](_0x58aced[_0x28212a(0xd7)])){!isSensitiveHeader(_0x2ea67d)&&console[_0x28212a(0xc7)]('<\x20'+_0x2ea67d+':\x20'+_0x3a9df7);}console[_0x28212a(0xc7)]('');}const _0x4b4870=Boolean(_0x559bb9[_0x28212a(0xc2)]),_0x50c1f9={'color':_0x559bb9[_0x28212a(0xa6)],'noColor':_0x559bb9[_0x28212a(0xe9)]||_0x4b4870&&!_0x559bb9[_0x28212a(0xa6)]},_0x4a08ac=colorizeJSON(_0x58aced[_0x28212a(0xa5)],_0x50c1f9);return _0x559bb9[_0x28212a(0xc2)]?(writeFileSync(_0x559bb9[_0x28212a(0xc2)],_0x4a08ac),console['error'](_0x28212a(0xd3)+_0x559bb9[_0x28212a(0xc2)])):console[_0x28212a(0xc1)](_0x4a08ac),0x0;}catch(_0x34ecd6){return _0x34ecd6 instanceof Error?(console[_0x28212a(0xc7)](_0x28212a(0xc6)+_0x34ecd6['message']),_0x559bb9[_0x28212a(0xcb)]&&_0x34ecd6[_0x28212a(0xbc)]&&console[_0x28212a(0xc7)](_0x28212a(0xb7)+_0x34ecd6[_0x28212a(0xbc)])):console['error'](_0x28212a(0xc6)+String(_0x34ecd6)),0x1;}}}
@@ -1 +1 @@
1
- function a7_0x656e(){const _0x32b1c4=['Name:\x20','test','110kTLMjJ','7762NDlfAJ','✓\x20API\x20key\x20removed\x20from\x20keychain','Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','API\x20key\x20cannot\x20be\x20empty','customSite','email','bold','us01','✓\x20Profile\x20\x27','auth:setup','execute','status','Enter\x20site\x20name:','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','11963jYReYE','site','You\x20can\x20find\x20your\x20API\x20key\x20at:','getUserInfo','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','N/A','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','apiKey','jobs','/app/mp/ak','auth:clear','1432BvUAlB','Remove\x20API\x20key\x20from\x20system\x20keychain','red','\x20(site:\x20','Setup\x20API\x20key\x20authentication\x20interactively','\x27\x20registered','first_name','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','User:\x20','3128653VpfBvx','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','yellow','Select\x20your\x20Treasure\x20Data\x20site:','Validating\x20API\x20key...','\x0aSetup\x20cancelled','1274286GOAZCw','last_name','name','✓\x20Authentication\x20successful\x0a','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','description','✓\x20Default\x20site\x20set\x20to\x20','1089295buWqcX','password','\x20for\x20profile:\x20','Setting\x20up\x20authentication\x20for\x20site:\x20','16143xFOJhh','84HzZnOq','\x20\x20tdx','trim','No\x20API\x20key\x20found\x20in\x20keychain','✗\x20Validation\x20failed:\x20','filter','6SQhtCg','error','System\x20keychain\x20is\x20not\x20available','logLevel','10QEKHvl','12miFRid','126nIdzAQ','message','other','Read\x20credential\x20from\x20','log','\x20(profile:\x20','Site\x20name\x20cannot\x20be\x20empty','select','profile','create','191439KGdWIn','text','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','warn'];a7_0x656e=function(){return _0x32b1c4;};return a7_0x656e();}const a7_0x4ebd71=a7_0x1de1;(function(_0x41414f,_0x4098d3){const _0x1e61d5=a7_0x1de1,_0x5ce83d=_0x41414f();while(!![]){try{const _0x3eb6dc=-parseInt(_0x1e61d5(0x157))/0x1*(parseInt(_0x1e61d5(0x16a))/0x2)+parseInt(_0x1e61d5(0x14c))/0x3*(-parseInt(_0x1e61d5(0x14d))/0x4)+parseInt(_0x1e61d5(0x148))/0x5*(-parseInt(_0x1e61d5(0x153))/0x6)+-parseInt(_0x1e61d5(0x127))/0x7*(parseInt(_0x1e61d5(0x132))/0x8)+parseInt(_0x1e61d5(0x163))/0x9*(parseInt(_0x1e61d5(0x169))/0xa)+parseInt(_0x1e61d5(0x13b))/0xb*(-parseInt(_0x1e61d5(0x158))/0xc)+-parseInt(_0x1e61d5(0x141))/0xd*(-parseInt(_0x1e61d5(0x159))/0xe);if(_0x3eb6dc===_0x4098d3)break;else _0x5ce83d['push'](_0x5ce83d['shift']());}catch(_0x10a31f){_0x5ce83d['push'](_0x5ce83d['shift']());}}}(a7_0x656e,0x2620f));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';function a7_0x1de1(_0x54ac66,_0x1bddce){_0x54ac66=_0x54ac66-0x126;const _0x656e82=a7_0x656e();let _0x1de1be=_0x656e82[_0x54ac66];return _0x1de1be;}import a7_0x453012 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_0x520b62 from'chalk';export class AuthSetupCommand extends BaseCommand{[a7_0x4ebd71(0x143)]=a7_0x4ebd71(0x174);[a7_0x4ebd71(0x146)]=a7_0x4ebd71(0x136);async[a7_0x4ebd71(0x175)](_0x101fe5){const _0x2ea2d0=a7_0x4ebd71,{options:_0x513a6d}=_0x101fe5,_0x5eba7a=_0x513a6d[_0x2ea2d0(0x161)];console['log'](a7_0x520b62[_0x2ea2d0(0x171)]('tdx:\x20auth\x20setup'));const _0x4bac4f=_0x513a6d[_0x2ea2d0(0x128)]||_0x2ea2d0(0x172),{choices:_0x379c84,initialIndex:_0x18918d}=buildSiteChoices(_0x4bac4f),_0x1fb559=_0x5eba7a?_0x2ea2d0(0x16c)+_0x5eba7a+'):':_0x2ea2d0(0x13e),_0x7a6e86=await a7_0x453012({'type':_0x2ea2d0(0x160),'name':_0x2ea2d0(0x128),'message':_0x1fb559,'choices':_0x379c84,'initial':_0x18918d});if(!_0x7a6e86[_0x2ea2d0(0x128)])return console[_0x2ea2d0(0x15d)](_0x2ea2d0(0x140)),0x1;let _0x51dc48;if(_0x7a6e86[_0x2ea2d0(0x128)]===_0x2ea2d0(0x15b)){const _0x4fa9e9=await a7_0x453012({'type':_0x2ea2d0(0x164),'name':_0x2ea2d0(0x16f),'message':_0x2ea2d0(0x177),'initial':'us01','validate':_0xf6c3d0=>{const _0x1be0a4=_0x2ea2d0;if(!_0xf6c3d0||!_0xf6c3d0[_0x1be0a4(0x14f)]())return _0x1be0a4(0x15f);if(!/^[a-z0-9-]+$/[_0x1be0a4(0x168)](_0xf6c3d0[_0x1be0a4(0x14f)]()))return _0x1be0a4(0x139);return!![];}});if(!_0x4fa9e9[_0x2ea2d0(0x16f)])return console[_0x2ea2d0(0x15d)](_0x2ea2d0(0x140)),0x1;_0x51dc48=_0x4fa9e9[_0x2ea2d0(0x16f)];}else _0x51dc48=_0x7a6e86[_0x2ea2d0(0x128)];const _0x1fa0df=resolveSite(_0x51dc48);console[_0x2ea2d0(0x15d)](_0x2ea2d0(0x14b)+_0x1fa0df),console[_0x2ea2d0(0x15d)](_0x2ea2d0(0x129)),console[_0x2ea2d0(0x15d)]('\x20\x20'+getConsoleUrl(_0x1fa0df,_0x2ea2d0(0x130)));const _0x5c15e9=await a7_0x453012({'type':_0x2ea2d0(0x149),'name':_0x2ea2d0(0x12e),'message':'Enter\x20your\x20TD\x20API\x20key:','validate':_0x42a8c4=>{const _0x469371=_0x2ea2d0;if(!_0x42a8c4||!_0x42a8c4['trim']())return _0x469371(0x16e);return!![];}});if(!_0x5c15e9[_0x2ea2d0(0x12e)])return console['log'](_0x2ea2d0(0x140)),0x1;const _0x486cd2=_0x5c15e9[_0x2ea2d0(0x12e)];console[_0x2ea2d0(0x15d)](_0x2ea2d0(0x13f));try{const _0x2ab45b=TDX[_0x2ea2d0(0x162)]({'site':_0x1fa0df,'apiKey':_0x486cd2[_0x2ea2d0(0x14f)](),'logLevel':_0x513a6d[_0x2ea2d0(0x156)]??LogLevel['ERROR']}),_0x1da97e=await _0x2ab45b[_0x2ea2d0(0x12f)][_0x2ea2d0(0x12a)]();console[_0x2ea2d0(0x15d)]('✓\x20API\x20key\x20is\x20valid\x20(User:\x20'+_0x1da97e[_0x2ea2d0(0x170)]+')');const _0x44e98a=await isKeychainAvailable();_0x44e98a?(await saveAPIKeyAsync(_0x486cd2[_0x2ea2d0(0x14f)](),_0x1fa0df,_0x5eba7a),console['log'](_0x2ea2d0(0x16d)+(_0x5eba7a?_0x2ea2d0(0x15e)+_0x5eba7a+')':''))):(console['warn'](a7_0x520b62[_0x2ea2d0(0x13d)](_0x2ea2d0(0x12b))),console[_0x2ea2d0(0x166)](a7_0x520b62[_0x2ea2d0(0x13d)](_0x2ea2d0(0x165))));if(_0x5eba7a){const _0x5af637={'site':_0x1fa0df};saveProfileToUserConfig(_0x5eba7a,_0x5af637),console[_0x2ea2d0(0x15d)](_0x2ea2d0(0x173)+_0x5eba7a+_0x2ea2d0(0x137));}else saveDefaultSiteToUserConfig(_0x1fa0df),console[_0x2ea2d0(0x15d)](_0x2ea2d0(0x147)+_0x1fa0df);const _0xee5af=_0x5eba7a?'\x20--profile\x20'+_0x5eba7a:'';return console[_0x2ea2d0(0x15d)](),console[_0x2ea2d0(0x15d)](_0x2ea2d0(0x145)),console[_0x2ea2d0(0x15d)]('\x20\x20tdx'+_0xee5af+_0x2ea2d0(0x12d)),console['log'](_0x2ea2d0(0x14e)+_0xee5af+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases'),0x0;}catch(_0x115797){if(_0x115797 instanceof HTTPClientError&&_0x115797[_0x2ea2d0(0x176)]===0x191)return printAuthError(_0x115797),0x1;return console[_0x2ea2d0(0x154)](a7_0x520b62[_0x2ea2d0(0x134)]('✗\x20Validation\x20failed:\x20'+(_0x115797 instanceof Error?_0x115797[_0x2ea2d0(0x15a)]:String(_0x115797)))),console[_0x2ea2d0(0x154)](_0x2ea2d0(0x13c)),0x1;}}}export class AuthStatusCommand extends BaseCommand{['name']='auth';['description']=a7_0x4ebd71(0x126);async[a7_0x4ebd71(0x175)](_0xa72498){const _0x4987da=a7_0x4ebd71,{options:_0x4ad4ce,tdx:_0x4234f9}=_0xa72498,_0x238fff=_0x4ad4ce[_0x4987da(0x128)],_0x509d00=_0x4ad4ce['profile'],_0x2d8268=_0x509d00?_0x509d00:_0x4987da(0x12c);console['log']('tdx\x20profile:\x20'+_0x2d8268+_0x4987da(0x135)+_0x238fff+')');const _0x54bfb1=await resolveAPIKeyAsync(_0x238fff,_0x509d00);if(_0x54bfb1){const {source:_0x29c7cc,isDeprecated:_0x53d562}=_0x54bfb1,_0x451e92=_0x4987da(0x15c)+_0x29c7cc;console[_0x4987da(0x15d)](_0x53d562?a7_0x520b62[_0x4987da(0x13d)](_0x451e92):_0x451e92);}else console[_0x4987da(0x15d)](a7_0x520b62[_0x4987da(0x13d)]('No\x20credential\x20found'));try{const _0x124d4e=await _0x4234f9[_0x4987da(0x12f)][_0x4987da(0x12a)]();return console[_0x4987da(0x15d)](a7_0x520b62['green'](_0x4987da(0x144))),console[_0x4987da(0x15d)](_0x4987da(0x13a)+_0x124d4e['email']),(_0x124d4e['first_name']||_0x124d4e[_0x4987da(0x142)])&&console[_0x4987da(0x15d)](_0x4987da(0x167)+[_0x124d4e[_0x4987da(0x138)],_0x124d4e[_0x4987da(0x142)]][_0x4987da(0x152)](Boolean)['join']('\x20')),0x0;}catch(_0x3d8ba1){return _0x3d8ba1 instanceof HTTPClientError&&_0x3d8ba1['status']===0x191?printAuthError(_0x3d8ba1,!![],_0x509d00):console['error'](a7_0x520b62[_0x4987da(0x134)](_0x4987da(0x151)+(_0x3d8ba1 instanceof Error?_0x3d8ba1['message']:String(_0x3d8ba1)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x4ebd71(0x143)]=a7_0x4ebd71(0x131);[a7_0x4ebd71(0x146)]=a7_0x4ebd71(0x133);async[a7_0x4ebd71(0x175)](_0x49d8d){const _0x1f4cb4=a7_0x4ebd71,{options:_0xd35784}=_0x49d8d,_0x379ffd=_0xd35784[_0x1f4cb4(0x161)];console[_0x1f4cb4(0x15d)](a7_0x520b62[_0x1f4cb4(0x171)]('tdx:\x20auth\x20clear'));const _0x5e7367=await isKeychainAvailable();if(!_0x5e7367)return console[_0x1f4cb4(0x154)](a7_0x520b62[_0x1f4cb4(0x134)](_0x1f4cb4(0x155))),0x1;const _0xcd3bb4=await deleteKeychainAPIKey(_0x379ffd);return _0xcd3bb4?(clearCredentialCache(),console[_0x1f4cb4(0x15d)](_0x1f4cb4(0x16b)+(_0x379ffd?'\x20(profile:\x20'+_0x379ffd+')':'')),0x0):(console[_0x1f4cb4(0x15d)](_0x1f4cb4(0x150)+(_0x379ffd?_0x1f4cb4(0x14a)+_0x379ffd:'')),0x1);}}
1
+ function a7_0x1bdc(){const _0x158cda=['\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','No\x20credential\x20found','error','Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20','Remove\x20API\x20key\x20from\x20system\x20keychain','✓\x20Authentication\x20successful\x0a','4605237uXDXtg','red','apiKey','auth:clear','join','Site\x20name\x20cannot\x20be\x20empty','9740isOEWV','Setting\x20up\x20authentication\x20for\x20site:\x20','N/A','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','✓\x20Default\x20site\x20set\x20to\x20','other','API\x20key\x20cannot\x20be\x20empty','✗\x20Validation\x20failed:\x20','name','text','\x20\x20tdx','yellow','✓\x20API\x20key\x20removed\x20from\x20keychain','Enter\x20site\x20name:','filter','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','✓\x20Profile\x20\x27','warn','161ZONDir','2tApzVL','first_name','auth:setup','1503mTbhup','\x0aSetup\x20cancelled','password','\x20for\x20profile:\x20','trim','3585KnYLKN','1565118kpjdOC','log','message','bold','Setup\x20API\x20key\x20authentication\x20interactively','execute','User:\x20','customSite','last_name','10090omYtwF','\x20(profile:\x20','437624axZPVh','profile','jobs','description','select','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','ERROR','site','getUserInfo','status','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','us01','green','68385834ZgMnKJ','\x20(site:\x20','279447ujhfPX','\x20--profile\x20','Enter\x20your\x20TD\x20API\x20key:','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','tdx:\x20auth\x20setup','email','tdx:\x20auth\x20clear','Read\x20credential\x20from\x20','/app/mp/ak','You\x20can\x20find\x20your\x20API\x20key\x20at:'];a7_0x1bdc=function(){return _0x158cda;};return a7_0x1bdc();}const a7_0xeee2e2=a7_0x52ff;(function(_0x5624d2,_0x4fe843){const _0xc456ac=a7_0x52ff,_0x23c210=_0x5624d2();while(!![]){try{const _0x49eac3=-parseInt(_0xc456ac(0xf6))/0x1+-parseInt(_0xc456ac(0xd3))/0x2*(parseInt(_0xc456ac(0x106))/0x3)+parseInt(_0xc456ac(0x10c))/0x4*(-parseInt(_0xc456ac(0xdb))/0x5)+-parseInt(_0xc456ac(0xdc))/0x6+-parseInt(_0xc456ac(0xd2))/0x7*(parseInt(_0xc456ac(0xe7))/0x8)+parseInt(_0xc456ac(0xd6))/0x9*(-parseInt(_0xc456ac(0xe5))/0xa)+parseInt(_0xc456ac(0xf4))/0xb;if(_0x49eac3===_0x4fe843)break;else _0x23c210['push'](_0x23c210['shift']());}catch(_0x3d3d89){_0x23c210['push'](_0x23c210['shift']());}}}(a7_0x1bdc,0xec8f4));function a7_0x52ff(_0x3ead46,_0x244485){_0x3ead46=_0x3ead46-0xcb;const _0x1bdc69=a7_0x1bdc();let _0x52ff30=_0x1bdc69[_0x3ead46];return _0x52ff30;}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_0x3602fb 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_0x5585e8 from'chalk';export class AuthSetupCommand extends BaseCommand{[a7_0xeee2e2(0x114)]=a7_0xeee2e2(0xd5);[a7_0xeee2e2(0xea)]=a7_0xeee2e2(0xe0);async[a7_0xeee2e2(0xe1)](_0x527124){const _0x192010=a7_0xeee2e2,{options:_0xe2536c}=_0x527124,_0x1fa9a=_0xe2536c['profile'];console[_0x192010(0xdd)](a7_0x5585e8[_0x192010(0xdf)](_0x192010(0xfa)));const _0x56883c=_0xe2536c[_0x192010(0xee)]||_0x192010(0xf2),{choices:_0x3d11e5,initialIndex:_0x439cae}=buildSiteChoices(_0x56883c),_0x455aad=_0x1fa9a?_0x192010(0x103)+_0x1fa9a+'):':'Select\x20your\x20Treasure\x20Data\x20site:',_0x52c5db=await a7_0x3602fb({'type':_0x192010(0xeb),'name':_0x192010(0xee),'message':_0x455aad,'choices':_0x3d11e5,'initial':_0x439cae});if(!_0x52c5db[_0x192010(0xee)])return console['log'](_0x192010(0xd7)),0x1;let _0x45c1a6;if(_0x52c5db[_0x192010(0xee)]===_0x192010(0x111)){const _0x59d5bc=await a7_0x3602fb({'type':_0x192010(0x115),'name':_0x192010(0xe3),'message':_0x192010(0xcd),'initial':_0x192010(0xf2),'validate':_0x43b9ee=>{const _0x38d99d=_0x192010;if(!_0x43b9ee||!_0x43b9ee[_0x38d99d(0xda)]())return _0x38d99d(0x10b);if(!/^[a-z0-9-]+$/['test'](_0x43b9ee[_0x38d99d(0xda)]()))return'Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens';return!![];}});if(!_0x59d5bc[_0x192010(0xe3)])return console[_0x192010(0xdd)](_0x192010(0xd7)),0x1;_0x45c1a6=_0x59d5bc[_0x192010(0xe3)];}else _0x45c1a6=_0x52c5db[_0x192010(0xee)];const _0x3af228=resolveSite(_0x45c1a6);console['log'](_0x192010(0x10d)+_0x3af228),console['log'](_0x192010(0xff)),console[_0x192010(0xdd)]('\x20\x20'+getConsoleUrl(_0x3af228,_0x192010(0xfe)));const _0x56de81=await a7_0x3602fb({'type':_0x192010(0xd8),'name':'apiKey','message':_0x192010(0xf8),'validate':_0x2af638=>{const _0x44a974=_0x192010;if(!_0x2af638||!_0x2af638[_0x44a974(0xda)]())return _0x44a974(0x112);return!![];}});if(!_0x56de81[_0x192010(0x108)])return console[_0x192010(0xdd)](_0x192010(0xd7)),0x1;const _0x1d76bb=_0x56de81['apiKey'];console[_0x192010(0xdd)]('Validating\x20API\x20key...');try{const _0x3779e2=TDX['create']({'site':_0x3af228,'apiKey':_0x1d76bb[_0x192010(0xda)](),'logLevel':_0xe2536c['logLevel']??LogLevel[_0x192010(0xed)]}),_0xe41608=await _0x3779e2[_0x192010(0xe9)][_0x192010(0xef)]();console['log'](_0x192010(0xec)+_0xe41608[_0x192010(0xfb)]+')');const _0x75216b=await isKeychainAvailable();_0x75216b?(await saveAPIKeyAsync(_0x1d76bb[_0x192010(0xda)](),_0x3af228,_0x1fa9a),console[_0x192010(0xdd)]('✓\x20API\x20key\x20saved\x20to\x20system\x20keychain'+(_0x1fa9a?_0x192010(0xe6)+_0x1fa9a+')':''))):(console[_0x192010(0xd1)](a7_0x5585e8['yellow'](_0x192010(0xf9))),console[_0x192010(0xd1)](a7_0x5585e8[_0x192010(0xcb)]('\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.')));if(_0x1fa9a){const _0xbd29be={'site':_0x3af228};saveProfileToUserConfig(_0x1fa9a,_0xbd29be),console['log'](_0x192010(0xd0)+_0x1fa9a+'\x27\x20registered');}else saveDefaultSiteToUserConfig(_0x3af228),console[_0x192010(0xdd)](_0x192010(0x110)+_0x3af228);const _0x5af00d=_0x1fa9a?_0x192010(0xf7)+_0x1fa9a:'';return console[_0x192010(0xdd)](),console[_0x192010(0xdd)](_0x192010(0xf1)),console['log']('\x20\x20tdx'+_0x5af00d+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console[_0x192010(0xdd)](_0x192010(0x116)+_0x5af00d+_0x192010(0x100)),0x0;}catch(_0x13d53d){if(_0x13d53d instanceof HTTPClientError&&_0x13d53d[_0x192010(0xf0)]===0x191)return printAuthError(_0x13d53d),0x1;return console[_0x192010(0x102)](a7_0x5585e8[_0x192010(0x107)](_0x192010(0x113)+(_0x13d53d instanceof Error?_0x13d53d[_0x192010(0xde)]:String(_0x13d53d)))),console[_0x192010(0x102)](_0x192010(0x10f)),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0xeee2e2(0x114)]='auth';['description']=a7_0xeee2e2(0xcf);async[a7_0xeee2e2(0xe1)](_0xe9c8db){const _0x1f614c=a7_0xeee2e2,{options:_0x116cc1,tdx:_0x51f148}=_0xe9c8db,_0x213f7d=_0x116cc1[_0x1f614c(0xee)],_0x31f85e=_0x116cc1[_0x1f614c(0xe8)],_0x33bb56=_0x31f85e?_0x31f85e:_0x1f614c(0x10e);console['log']('tdx\x20profile:\x20'+_0x33bb56+_0x1f614c(0xf5)+_0x213f7d+')');const _0x1fc3e7=await resolveAPIKeyAsync(_0x213f7d,_0x31f85e);if(_0x1fc3e7){const {source:_0x4bbea4,isDeprecated:_0x9843e2}=_0x1fc3e7,_0x12e544=_0x1f614c(0xfd)+_0x4bbea4;console['log'](_0x9843e2?a7_0x5585e8[_0x1f614c(0xcb)](_0x12e544):_0x12e544);}else console[_0x1f614c(0xdd)](a7_0x5585e8['yellow'](_0x1f614c(0x101)));try{const _0x159bf8=await _0x51f148['jobs'][_0x1f614c(0xef)]();return console[_0x1f614c(0xdd)](a7_0x5585e8[_0x1f614c(0xf3)](_0x1f614c(0x105))),console[_0x1f614c(0xdd)](_0x1f614c(0xe2)+_0x159bf8[_0x1f614c(0xfb)]),(_0x159bf8['first_name']||_0x159bf8['last_name'])&&console[_0x1f614c(0xdd)]('Name:\x20'+[_0x159bf8[_0x1f614c(0xd4)],_0x159bf8[_0x1f614c(0xe4)]][_0x1f614c(0xce)](Boolean)[_0x1f614c(0x10a)]('\x20')),0x0;}catch(_0x1391ec){return _0x1391ec instanceof HTTPClientError&&_0x1391ec[_0x1f614c(0xf0)]===0x191?printAuthError(_0x1391ec,!![],_0x31f85e):console[_0x1f614c(0x102)](a7_0x5585e8['red'](_0x1f614c(0x113)+(_0x1391ec instanceof Error?_0x1391ec[_0x1f614c(0xde)]:String(_0x1391ec)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0xeee2e2(0x114)]=a7_0xeee2e2(0x109);['description']=a7_0xeee2e2(0x104);async['execute'](_0x4311c6){const _0x116a9a=a7_0xeee2e2,{options:_0x5cec5d}=_0x4311c6,_0x3997e8=_0x5cec5d[_0x116a9a(0xe8)];console[_0x116a9a(0xdd)](a7_0x5585e8[_0x116a9a(0xdf)](_0x116a9a(0xfc)));const _0x2dba7d=await isKeychainAvailable();if(!_0x2dba7d)return console[_0x116a9a(0x102)](a7_0x5585e8[_0x116a9a(0x107)]('System\x20keychain\x20is\x20not\x20available')),0x1;const _0x18b781=await deleteKeychainAPIKey(_0x3997e8);return _0x18b781?(clearCredentialCache(),console[_0x116a9a(0xdd)](_0x116a9a(0xcc)+(_0x3997e8?_0x116a9a(0xe6)+_0x3997e8+')':'')),0x0):(console['log']('No\x20API\x20key\x20found\x20in\x20keychain'+(_0x3997e8?_0x116a9a(0xd9)+_0x3997e8:'')),0x1);}}
@@ -1 +1 @@
1
- const a8_0x1e44fc=a8_0x2758;(function(_0x4df30e,_0x186ef4){const _0x3f9930=a8_0x2758,_0x47c5a7=_0x4df30e();while(!![]){try{const _0x4e47bb=-parseInt(_0x3f9930(0x130))/0x1*(parseInt(_0x3f9930(0x12b))/0x2)+-parseInt(_0x3f9930(0x156))/0x3*(parseInt(_0x3f9930(0x16a))/0x4)+-parseInt(_0x3f9930(0x161))/0x5*(-parseInt(_0x3f9930(0x140))/0x6)+parseInt(_0x3f9930(0x141))/0x7*(parseInt(_0x3f9930(0x158))/0x8)+parseInt(_0x3f9930(0x136))/0x9+-parseInt(_0x3f9930(0x12e))/0xa*(parseInt(_0x3f9930(0x167))/0xb)+parseInt(_0x3f9930(0x142))/0xc;if(_0x4e47bb===_0x186ef4)break;else _0x47c5a7['push'](_0x47c5a7['shift']());}catch(_0x33a5e3){_0x47c5a7['push'](_0x47c5a7['shift']());}}}(a8_0x1a88,0x8763e));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{withSpinner}from'../utils/spinner.js';import{parseAgentRef}from'../sdk/agent/agent-ref-parser.js';import{saveLastChatId,loadLastChatId}from'../sdk/llm/chat-cache.js';import{getLLMConversationUrl}from'../sdk/client/endpoints.js';function handleSDKError(_0x5d10a0,_0x19e3f9){const _0x55c0a9=a8_0x2758;if(_0x5d10a0 instanceof SDKError)console['error'](_0x55c0a9(0x151)+_0x5d10a0[_0x55c0a9(0x15b)]),_0x19e3f9[_0x55c0a9(0x145)]&&(_0x5d10a0['cause']&&console[_0x55c0a9(0x14b)](_0x55c0a9(0x14c)+_0x5d10a0[_0x55c0a9(0x126)]),_0x5d10a0[_0x55c0a9(0x15a)]&&(console[_0x55c0a9(0x14b)]('\x0aStack\x20trace:'),console[_0x55c0a9(0x14b)](_0x5d10a0[_0x55c0a9(0x15a)])));else throw _0x5d10a0;}function a8_0x1a88(){const _0x329e01=['Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','session\x20context','event','6qsuGVc','streamChat','8EMiOXX','stdout','stack','message','llmProject','Using\x20agent\x20from\x20','Resolving\x20agent\x20\x27','streamChatJsonl','type','2203655gpvKxh','Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together','resolveAgentId','\x0aError:\x20','projectId','targetAgent','7898SYEoNy','slice','description','1103092Uobaja','execute','args','Continuing\x20chat:\x20','llm','new','metadata','write','chatId','cause','join','getDefaultAgent','agentId','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','102rlZnsD','chat','data','100QHUsMg','functionName','20609UyVSYk','\x27...','tool_call','Error:\x20Chat\x20session\x20\x27','\x27\x20not\x20found','resolveProjectId','3986370bzRbdi','targetKnowledgeBase','validate','Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22','404','stringify','content','claude-4.5-haiku','CHAT_NOT_FOUND','tool_result','6MFjKpy','7662109ldkKSQ','2233140zzhaCw','log','Resolving\x20project\x20\x27','verbose','llmAgent','stream','startChat','name','Chat\x20session:\x20','error','\x20\x20Cause:\x20','agent','tool','code','handleChatEvent','Error:\x20','options'];a8_0x1a88=function(){return _0x329e01;};return a8_0x1a88();}async function resolveAgentId(_0x248645,_0x2a0530,_0x46e91a,_0x368d78,_0x28fc2f){const _0xef23b1=a8_0x2758,_0x4ec523=_0x2a0530||_0x46e91a;if(_0x4ec523){const {projectName:_0xb7021b,agentName:_0x19914e}=parseAgentRef(_0x4ec523),_0x2b02a6=_0x19914e||_0x4ec523,_0x400599=_0x19914e?_0xb7021b:_0x368d78;if(!_0x400599)throw new Error('No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22');if(_0x28fc2f){const _0x3d0044=_0x2a0530?'--agent\x20flag':_0xef23b1(0x154);console[_0xef23b1(0x14b)](_0xef23b1(0x15d)+_0x3d0044+':\x20'+_0x400599+'/'+_0x2b02a6);}const _0x97e1bc=await withSpinner(_0xef23b1(0x144)+_0x400599+_0xef23b1(0x131),()=>_0x248645['llm'][_0xef23b1(0x135)](_0x400599),{'verbose':_0x28fc2f}),_0x286402=await withSpinner(_0xef23b1(0x15e)+_0x2b02a6+_0xef23b1(0x131),()=>_0x248645[_0xef23b1(0x16e)][_0xef23b1(0x163)](_0x2b02a6,_0x97e1bc['data']),{'verbose':_0x28fc2f});return _0x286402[_0xef23b1(0x12d)];}else{const _0x13d24c=_0x248645['llm'][_0xef23b1(0x128)]();if(_0x13d24c)return _0x28fc2f&&console[_0xef23b1(0x14b)]('Using\x20cached\x20default\x20agent:\x20'+_0x13d24c[_0xef23b1(0x149)]),_0x13d24c['id'];const _0x12af3e=await withSpinner('Getting\x20default\x20agent...',()=>_0x248645[_0xef23b1(0x16e)]['getOrCreateDefaultAgent'](_0xef23b1(0x13d),0x0),{'verbose':_0x28fc2f});return _0x12af3e[_0xef23b1(0x12d)]['id'];}}export class ChatCommand extends BaseCommand{[a8_0x1e44fc(0x149)]=a8_0x1e44fc(0x12c);[a8_0x1e44fc(0x169)]=a8_0x1e44fc(0x153);[a8_0x1e44fc(0x138)](_0x43dd59){const _0x1c30a3=a8_0x1e44fc,_0x1a79cf=_0x43dd59[_0x1c30a3(0x16c)][_0x1c30a3(0x127)]('\x20');if(!_0x1a79cf)return _0x1c30a3(0x12a);return undefined;}async[a8_0x1e44fc(0x157)](_0xbbcc38,_0x5774b1,_0x4c6142,_0x44eb83,_0x44571c){const _0x3e3a04=a8_0x1e44fc;for await(const _0x11a4d8 of _0xbbcc38['llm']['chat'](_0x5774b1,{'agentId':_0x4c6142,'chatId':_0x44eb83})){if(_0x11a4d8['type']===_0x3e3a04(0x170)){const _0x213edb=_0x11a4d8[_0x3e3a04(0x12d)][_0x3e3a04(0x125)];saveLastChatId(_0x213edb),_0x44571c&&console[_0x3e3a04(0x14b)](_0x3e3a04(0x14a)+_0x213edb);}else _0x11a4d8[_0x3e3a04(0x160)]===_0x3e3a04(0x155)&&this[_0x3e3a04(0x150)](_0x11a4d8[_0x3e3a04(0x12d)]);}}async[a8_0x1e44fc(0x15f)](_0x5d7119,_0x1398d5,_0x288a6c,_0x4b39bb){const _0x4834ef=a8_0x1e44fc,_0x3bcca6=_0x5d7119['context']['site'];let _0x51491a=![];for await(const _0x433871 of _0x5d7119[_0x4834ef(0x16e)][_0x4834ef(0x12c)](_0x1398d5,{'agentId':_0x288a6c,'chatId':_0x4b39bb})){if(_0x433871[_0x4834ef(0x160)]===_0x4834ef(0x170)){const _0x262c87=_0x433871[_0x4834ef(0x12d)];saveLastChatId(_0x262c87[_0x4834ef(0x125)]);const _0x40a312=_0x262c87[_0x4834ef(0x165)]&&_0x262c87[_0x4834ef(0x129)]?getLLMConversationUrl(_0x3bcca6,_0x262c87['projectId'],_0x262c87[_0x4834ef(0x129)],_0x262c87[_0x4834ef(0x125)]):undefined;console['log'](JSON[_0x4834ef(0x13b)]({'type':_0x4834ef(0x170),'data':{'chatId':_0x262c87[_0x4834ef(0x125)],'agentId':_0x262c87['agentId'],'consoleUrl':_0x40a312}})),_0x51491a=!![];}else{if(_0x433871[_0x4834ef(0x160)]===_0x4834ef(0x155)){!_0x51491a&&_0x4b39bb&&(console['log'](JSON[_0x4834ef(0x13b)]({'type':_0x4834ef(0x170),'data':{'chatId':_0x4b39bb}})),_0x51491a=!![]);const _0x34873a=_0x433871['data'];if('content'in _0x34873a)console[_0x4834ef(0x143)](JSON[_0x4834ef(0x13b)]({'type':'content','data':{'content':_0x34873a[_0x4834ef(0x13c)]}}));else{if('tool_call'in _0x34873a){const _0x152876=_0x34873a[_0x4834ef(0x132)];console['log'](JSON[_0x4834ef(0x13b)]({'type':_0x4834ef(0x132),'data':{'id':_0x152876['id'],'name':_0x152876['functionName'],'target':_0x152876[_0x4834ef(0x137)]?.[_0x4834ef(0x149)]||_0x152876[_0x4834ef(0x166)]?.[_0x4834ef(0x149)]||_0x152876['targetWebSearchTool']?.[_0x4834ef(0x149)]||_0x152876['targetFunction']}}));}else{if(_0x4834ef(0x14e)in _0x34873a)console[_0x4834ef(0x143)](JSON[_0x4834ef(0x13b)]({'type':_0x4834ef(0x13f),'data':{'id':_0x34873a[_0x4834ef(0x14e)]['id'],'name':_0x34873a[_0x4834ef(0x14e)][_0x4834ef(0x12f)],'result':typeof _0x34873a[_0x4834ef(0x14e)][_0x4834ef(0x13c)]==='string'?_0x34873a[_0x4834ef(0x14e)]['content'][_0x4834ef(0x168)](0x0,0x1f4):''}}));else _0x4834ef(0x14b)in _0x34873a&&console['log'](JSON[_0x4834ef(0x13b)]({'type':'error','data':{'error':_0x34873a[_0x4834ef(0x14b)]}}));}}}}}console[_0x4834ef(0x143)](JSON['stringify']({'type':'done'}));}async['execute'](_0xc78a41){const _0x3d6f82=a8_0x1e44fc,{options:_0x5e0ada,args:_0x3dd1bc,tdx:_0x59c948}=_0xc78a41,_0x1561f3=_0x3dd1bc['join']('\x20'),_0x4ed7dd=_0x5e0ada,_0x39e473=_0x4ed7dd[_0x3d6f82(0x14d)],_0x4ef85b=_0x4ed7dd[_0x3d6f82(0x146)],_0x48523b=_0x4ed7dd[_0x3d6f82(0x15c)],_0x4c3be9=_0x4ed7dd[_0x3d6f82(0x16f)],_0x5d0531=_0x4ed7dd['chatId'],_0x329989=_0x4ed7dd[_0x3d6f82(0x147)];if(_0x4c3be9&&_0x5d0531)return console[_0x3d6f82(0x14b)](_0x3d6f82(0x162)),0x1;try{let _0x895f69,_0x5540e7;if(_0x5d0531)_0x5540e7=_0x5d0531;else!_0x4c3be9&&(_0x5540e7=loadLastChatId(),_0x5540e7&&_0x5e0ada[_0x3d6f82(0x145)]&&console[_0x3d6f82(0x14b)](_0x3d6f82(0x16d)+_0x5540e7));!_0x5d0531&&(_0x4c3be9||!_0x5540e7)&&(_0x895f69=await resolveAgentId(_0x59c948,_0x39e473,_0x4ef85b,_0x48523b,_0x5e0ada[_0x3d6f82(0x145)]));const _0xaca040=_0x329989?(_0x14517a,_0x32c05d,_0x1ed5e3)=>this[_0x3d6f82(0x15f)](_0x59c948,_0x14517a,_0x32c05d,_0x1ed5e3):(_0x4c008f,_0x31ebfa,_0x47142f)=>this['streamChat'](_0x59c948,_0x4c008f,_0x31ebfa,_0x47142f,_0x5e0ada[_0x3d6f82(0x145)]);try{await _0xaca040(_0x1561f3,_0x895f69,_0x5540e7);}catch(_0x58893d){const _0xcffafd=_0x58893d instanceof SDKError&&_0x58893d[_0x3d6f82(0x14f)]===ErrorCode[_0x3d6f82(0x13e)]||_0x58893d instanceof Error&&_0x58893d[_0x3d6f82(0x15b)]['includes'](_0x3d6f82(0x13a));if(_0xcffafd&&_0x5d0531)return console[_0x3d6f82(0x14b)](_0x3d6f82(0x133)+_0x5d0531+_0x3d6f82(0x134)),0x1;if(_0xcffafd)_0x5e0ada[_0x3d6f82(0x145)]&&console['error']('Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...'),!_0x895f69&&(_0x895f69=await resolveAgentId(_0x59c948,_0x39e473,_0x4ef85b,_0x48523b,_0x5e0ada[_0x3d6f82(0x145)])),await _0xaca040(_0x1561f3,_0x895f69,undefined);else throw _0x58893d;}return!_0x329989&&console[_0x3d6f82(0x143)](),0x0;}catch(_0x356456){return console[_0x3d6f82(0x14b)](),handleSDKError(_0x356456,_0x5e0ada),0x1;}}['handleChatEvent'](_0x59bf89){const _0x1c2d22=a8_0x1e44fc;if(_0x1c2d22(0x13c)in _0x59bf89)process[_0x1c2d22(0x159)][_0x1c2d22(0x171)](_0x59bf89[_0x1c2d22(0x13c)]);else _0x1c2d22(0x14b)in _0x59bf89&&console[_0x1c2d22(0x14b)](_0x1c2d22(0x164)+_0x59bf89['error']);}}function a8_0x2758(_0xec0f4e,_0x2de789){_0xec0f4e=_0xec0f4e-0x125;const _0x1a88dc=a8_0x1a88();let _0x2758f9=_0x1a88dc[_0xec0f4e];return _0x2758f9;}export class ChatCreateCommand extends BaseCommand{['name']='chat-create';['description']='Create\x20a\x20new\x20chat\x20session';[a8_0x1e44fc(0x138)](_0xfef9dc){const _0x16670a=a8_0x1e44fc,_0x45e56f=_0xfef9dc[_0x16670a(0x152)],_0x5270fa=_0x45e56f['agent'],_0x57506e=_0x45e56f[_0x16670a(0x146)];if(!_0x5270fa&&!_0x57506e)return _0x16670a(0x139);return undefined;}async[a8_0x1e44fc(0x16b)](_0x22dede){const _0x14c8ff=a8_0x1e44fc,{options:_0x250b5e,tdx:_0x337559}=_0x22dede,_0x364176=_0x250b5e,_0x1c5e47=_0x364176['agent'],_0x3dbf2b=_0x364176[_0x14c8ff(0x146)],_0x2d56f0=_0x364176[_0x14c8ff(0x15c)];try{const _0x2dd042=await resolveAgentId(_0x337559,_0x1c5e47,_0x3dbf2b,_0x2d56f0,_0x250b5e[_0x14c8ff(0x145)]),_0x200c23=await _0x337559[_0x14c8ff(0x16e)][_0x14c8ff(0x148)](_0x2dd042);return saveLastChatId(_0x200c23['id']),console[_0x14c8ff(0x143)](JSON['stringify']({'chatId':_0x200c23['id'],'agentId':_0x2dd042})),0x0;}catch(_0x303e53){return handleSDKError(_0x303e53,_0x250b5e),0x1;}}}
1
+ const a8_0x2ba85d=a8_0x4f25;(function(_0x47e55a,_0x2a3f1c){const _0x4e06a8=a8_0x4f25,_0x5f4961=_0x47e55a();while(!![]){try{const _0x245ca0=-parseInt(_0x4e06a8(0x1bb))/0x1+-parseInt(_0x4e06a8(0x1c3))/0x2*(parseInt(_0x4e06a8(0x180))/0x3)+-parseInt(_0x4e06a8(0x191))/0x4*(-parseInt(_0x4e06a8(0x1bd))/0x5)+parseInt(_0x4e06a8(0x17b))/0x6*(-parseInt(_0x4e06a8(0x195))/0x7)+-parseInt(_0x4e06a8(0x1a2))/0x8*(parseInt(_0x4e06a8(0x17f))/0x9)+-parseInt(_0x4e06a8(0x1b7))/0xa*(parseInt(_0x4e06a8(0x181))/0xb)+parseInt(_0x4e06a8(0x1a8))/0xc;if(_0x245ca0===_0x2a3f1c)break;else _0x5f4961['push'](_0x5f4961['shift']());}catch(_0x40bb0b){_0x5f4961['push'](_0x5f4961['shift']());}}}(a8_0x3fa2,0xdafa1));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{withSpinner}from'../utils/spinner.js';function a8_0x3fa2(){const _0x4c702d=['Error:\x20Chat\x20session\x20\x27','targetWebSearchTool','Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together','type','name','Continuing\x20chat:\x20','4417750kKSkCk','metadata','404','streamChatJsonl','837418XtJatl','No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22','305815OVtOhf','options','\x0aStack\x20trace:','claude-4.5-haiku','getDefaultAgent','session\x20context','688570jJSOQg','Resolving\x20agent\x20\x27','tool','content','\x27...','verbose','llmAgent','handleChatEvent','774yosTJA','context','string','error','4179096zNIHgU','3KxrxaL','22XmdSzW','projectId','agent','chatId','stream','llmProject','Resolving\x20project\x20\x27','Using\x20agent\x20from\x20','new','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','description','targetFunction','targetAgent','startChat','code','stdout','32tWGqHH','Create\x20a\x20new\x20chat\x20session','data','execute','55888PHEeMw','cause','streamChat','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','Chat\x20session:\x20','--agent\x20flag','tool_call','Getting\x20default\x20agent...','\x20\x20Cause:\x20','Using\x20cached\x20default\x20agent:\x20','functionName','stringify','\x27\x20not\x20found','8MAJgWW','args','message','llm','log','site','47605896ddKZhW','getOrCreateDefaultAgent','chat','stack','join','\x0aError:\x20','resolveProjectId','event','agentId'];a8_0x3fa2=function(){return _0x4c702d;};return a8_0x3fa2();}import{parseAgentRef}from'../sdk/agent/agent-ref-parser.js';import{saveLastChatId,loadLastChatId}from'../sdk/llm/chat-cache.js';import{getLLMConversationUrl}from'../sdk/client/endpoints.js';function handleSDKError(_0x10797e,_0x498d8c){const _0x574289=a8_0x4f25;if(_0x10797e instanceof SDKError)console['error']('Error:\x20'+_0x10797e[_0x574289(0x1a4)]),_0x498d8c[_0x574289(0x178)]&&(_0x10797e[_0x574289(0x196)]&&console['error'](_0x574289(0x19d)+_0x10797e['cause']),_0x10797e['stack']&&(console[_0x574289(0x17e)](_0x574289(0x1bf)),console['error'](_0x10797e[_0x574289(0x1ab)])));else throw _0x10797e;}function a8_0x4f25(_0x4ddb1c,_0x52d011){_0x4ddb1c=_0x4ddb1c-0x174;const _0x3fa248=a8_0x3fa2();let _0x4f25da=_0x3fa248[_0x4ddb1c];return _0x4f25da;}async function resolveAgentId(_0x57c604,_0x31c2c4,_0x551268,_0x43808e,_0x4960ff){const _0x542205=a8_0x4f25,_0x1704ae=_0x31c2c4||_0x551268;if(_0x1704ae){const {projectName:_0x4b9874,agentName:_0x242ac6}=parseAgentRef(_0x1704ae),_0x19b26d=_0x242ac6||_0x1704ae,_0x3d5988=_0x242ac6?_0x4b9874:_0x43808e;if(!_0x3d5988)throw new Error(_0x542205(0x1bc));if(_0x4960ff){const _0x43adee=_0x31c2c4?_0x542205(0x19a):_0x542205(0x1c2);console[_0x542205(0x17e)](_0x542205(0x188)+_0x43adee+':\x20'+_0x3d5988+'/'+_0x19b26d);}const _0x2d3463=await withSpinner(_0x542205(0x187)+_0x3d5988+'\x27...',()=>_0x57c604[_0x542205(0x1a5)][_0x542205(0x1ae)](_0x3d5988),{'verbose':_0x4960ff}),_0x498649=await withSpinner(_0x542205(0x174)+_0x19b26d+_0x542205(0x177),()=>_0x57c604[_0x542205(0x1a5)]['resolveAgentId'](_0x19b26d,_0x2d3463['data']),{'verbose':_0x4960ff});return _0x498649['data'];}else{const _0x41a818=_0x57c604[_0x542205(0x1a5)][_0x542205(0x1c1)]();if(_0x41a818)return _0x4960ff&&console['error'](_0x542205(0x19e)+_0x41a818[_0x542205(0x1b5)]),_0x41a818['id'];const _0x268285=await withSpinner(_0x542205(0x19c),()=>_0x57c604[_0x542205(0x1a5)][_0x542205(0x1a9)](_0x542205(0x1c0),0x0),{'verbose':_0x4960ff});return _0x268285[_0x542205(0x193)]['id'];}}export class ChatCommand extends BaseCommand{[a8_0x2ba85d(0x1b5)]='chat';['description']=a8_0x2ba85d(0x198);['validate'](_0x52066f){const _0x2a9ef4=a8_0x2ba85d,_0x575b41=_0x52066f[_0x2a9ef4(0x1a3)]['join']('\x20');if(!_0x575b41)return _0x2a9ef4(0x18a);return undefined;}async[a8_0x2ba85d(0x197)](_0x2c09bb,_0x392f33,_0x1ced2b,_0xb7237f,_0x4b2140){const _0x231ac7=a8_0x2ba85d;for await(const _0x399597 of _0x2c09bb[_0x231ac7(0x1a5)][_0x231ac7(0x1aa)](_0x392f33,{'agentId':_0x1ced2b,'chatId':_0xb7237f})){if(_0x399597['type']===_0x231ac7(0x1b8)){const _0x3b5f1d=_0x399597[_0x231ac7(0x193)][_0x231ac7(0x184)];saveLastChatId(_0x3b5f1d),_0x4b2140&&console[_0x231ac7(0x17e)](_0x231ac7(0x199)+_0x3b5f1d);}else _0x399597[_0x231ac7(0x1b4)]===_0x231ac7(0x1af)&&this[_0x231ac7(0x17a)](_0x399597[_0x231ac7(0x193)]);}}async['streamChatJsonl'](_0x55ca1d,_0x4e5cf7,_0xadd353,_0x1c80cd){const _0x1ec9f1=a8_0x2ba85d,_0xa94581=_0x55ca1d[_0x1ec9f1(0x17c)][_0x1ec9f1(0x1a7)];let _0x90a980=![];for await(const _0x3836fe of _0x55ca1d[_0x1ec9f1(0x1a5)][_0x1ec9f1(0x1aa)](_0x4e5cf7,{'agentId':_0xadd353,'chatId':_0x1c80cd})){if(_0x3836fe[_0x1ec9f1(0x1b4)]==='metadata'){const _0x1f685d=_0x3836fe[_0x1ec9f1(0x193)];saveLastChatId(_0x1f685d[_0x1ec9f1(0x184)]);const _0x54dda7=_0x1f685d['projectId']&&_0x1f685d[_0x1ec9f1(0x1b0)]?getLLMConversationUrl(_0xa94581,_0x1f685d[_0x1ec9f1(0x182)],_0x1f685d[_0x1ec9f1(0x1b0)],_0x1f685d[_0x1ec9f1(0x184)]):undefined;console['log'](JSON[_0x1ec9f1(0x1a0)]({'type':_0x1ec9f1(0x1b8),'data':{'chatId':_0x1f685d[_0x1ec9f1(0x184)],'agentId':_0x1f685d[_0x1ec9f1(0x1b0)],'consoleUrl':_0x54dda7}})),_0x90a980=!![];}else{if(_0x3836fe[_0x1ec9f1(0x1b4)]==='event'){!_0x90a980&&_0x1c80cd&&(console['log'](JSON[_0x1ec9f1(0x1a0)]({'type':_0x1ec9f1(0x1b8),'data':{'chatId':_0x1c80cd}})),_0x90a980=!![]);const _0x3ad241=_0x3836fe[_0x1ec9f1(0x193)];if(_0x1ec9f1(0x176)in _0x3ad241)console[_0x1ec9f1(0x1a6)](JSON[_0x1ec9f1(0x1a0)]({'type':'content','data':{'content':_0x3ad241[_0x1ec9f1(0x176)]}}));else{if(_0x1ec9f1(0x19b)in _0x3ad241){const _0x5b1aa5=_0x3ad241[_0x1ec9f1(0x19b)];console[_0x1ec9f1(0x1a6)](JSON['stringify']({'type':_0x1ec9f1(0x19b),'data':{'id':_0x5b1aa5['id'],'name':_0x5b1aa5[_0x1ec9f1(0x19f)],'target':_0x5b1aa5['targetKnowledgeBase']?.[_0x1ec9f1(0x1b5)]||_0x5b1aa5[_0x1ec9f1(0x18d)]?.['name']||_0x5b1aa5[_0x1ec9f1(0x1b2)]?.[_0x1ec9f1(0x1b5)]||_0x5b1aa5[_0x1ec9f1(0x18c)]}}));}else{if(_0x1ec9f1(0x175)in _0x3ad241)console[_0x1ec9f1(0x1a6)](JSON[_0x1ec9f1(0x1a0)]({'type':'tool_result','data':{'id':_0x3ad241[_0x1ec9f1(0x175)]['id'],'name':_0x3ad241['tool'][_0x1ec9f1(0x19f)],'result':typeof _0x3ad241[_0x1ec9f1(0x175)][_0x1ec9f1(0x176)]===_0x1ec9f1(0x17d)?_0x3ad241[_0x1ec9f1(0x175)][_0x1ec9f1(0x176)]['slice'](0x0,0x1f4):''}}));else _0x1ec9f1(0x17e)in _0x3ad241&&console[_0x1ec9f1(0x1a6)](JSON[_0x1ec9f1(0x1a0)]({'type':'error','data':{'error':_0x3ad241[_0x1ec9f1(0x17e)]}}));}}}}}console[_0x1ec9f1(0x1a6)](JSON[_0x1ec9f1(0x1a0)]({'type':'done'}));}async[a8_0x2ba85d(0x194)](_0x5021cb){const _0xbcd81=a8_0x2ba85d,{options:_0x339e0e,args:_0x41e09b,tdx:_0x4d53c6}=_0x5021cb,_0x24125d=_0x41e09b[_0xbcd81(0x1ac)]('\x20'),_0x40dc14=_0x339e0e,_0x53a447=_0x40dc14['agent'],_0x314ef8=_0x40dc14[_0xbcd81(0x179)],_0x397b5a=_0x40dc14[_0xbcd81(0x186)],_0x772747=_0x40dc14[_0xbcd81(0x189)],_0x2a7367=_0x40dc14['chatId'],_0xf2c724=_0x40dc14[_0xbcd81(0x185)];if(_0x772747&&_0x2a7367)return console[_0xbcd81(0x17e)](_0xbcd81(0x1b3)),0x1;try{let _0x515978,_0x543d71;if(_0x2a7367)_0x543d71=_0x2a7367;else!_0x772747&&(_0x543d71=loadLastChatId(),_0x543d71&&_0x339e0e[_0xbcd81(0x178)]&&console[_0xbcd81(0x17e)](_0xbcd81(0x1b6)+_0x543d71));!_0x2a7367&&(_0x772747||!_0x543d71)&&(_0x515978=await resolveAgentId(_0x4d53c6,_0x53a447,_0x314ef8,_0x397b5a,_0x339e0e[_0xbcd81(0x178)]));const _0x42a330=_0xf2c724?(_0x30c1a5,_0x57002f,_0x41e1a5)=>this[_0xbcd81(0x1ba)](_0x4d53c6,_0x30c1a5,_0x57002f,_0x41e1a5):(_0x88be6,_0x3d0f30,_0x272f00)=>this[_0xbcd81(0x197)](_0x4d53c6,_0x88be6,_0x3d0f30,_0x272f00,_0x339e0e[_0xbcd81(0x178)]);try{await _0x42a330(_0x24125d,_0x515978,_0x543d71);}catch(_0x21259b){const _0x3e633b=_0x21259b instanceof SDKError&&_0x21259b[_0xbcd81(0x18f)]===ErrorCode['CHAT_NOT_FOUND']||_0x21259b instanceof Error&&_0x21259b[_0xbcd81(0x1a4)]['includes'](_0xbcd81(0x1b9));if(_0x3e633b&&_0x2a7367)return console['error'](_0xbcd81(0x1b1)+_0x2a7367+_0xbcd81(0x1a1)),0x1;if(_0x3e633b)_0x339e0e[_0xbcd81(0x178)]&&console['error']('Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...'),!_0x515978&&(_0x515978=await resolveAgentId(_0x4d53c6,_0x53a447,_0x314ef8,_0x397b5a,_0x339e0e[_0xbcd81(0x178)])),await _0x42a330(_0x24125d,_0x515978,undefined);else throw _0x21259b;}return!_0xf2c724&&console[_0xbcd81(0x1a6)](),0x0;}catch(_0xa19879){return console['error'](),handleSDKError(_0xa19879,_0x339e0e),0x1;}}['handleChatEvent'](_0x13c7ce){const _0x5e2ab4=a8_0x2ba85d;if(_0x5e2ab4(0x176)in _0x13c7ce)process[_0x5e2ab4(0x190)]['write'](_0x13c7ce[_0x5e2ab4(0x176)]);else _0x5e2ab4(0x17e)in _0x13c7ce&&console['error'](_0x5e2ab4(0x1ad)+_0x13c7ce[_0x5e2ab4(0x17e)]);}}export class ChatCreateCommand extends BaseCommand{[a8_0x2ba85d(0x1b5)]='chat-create';[a8_0x2ba85d(0x18b)]=a8_0x2ba85d(0x192);['validate'](_0x515bf2){const _0x585b40=a8_0x2ba85d,_0x24cd2e=_0x515bf2[_0x585b40(0x1be)],_0x32828e=_0x24cd2e[_0x585b40(0x183)],_0x308f79=_0x24cd2e[_0x585b40(0x179)];if(!_0x32828e&&!_0x308f79)return'Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22';return undefined;}async['execute'](_0x1cbfb8){const _0x558a6f=a8_0x2ba85d,{options:_0x7198bb,tdx:_0x2a5a0e}=_0x1cbfb8,_0x8d9fb6=_0x7198bb,_0x6b0a11=_0x8d9fb6[_0x558a6f(0x183)],_0x26a96a=_0x8d9fb6['llmAgent'],_0x3e4c03=_0x8d9fb6['llmProject'];try{const _0x2352ed=await resolveAgentId(_0x2a5a0e,_0x6b0a11,_0x26a96a,_0x3e4c03,_0x7198bb[_0x558a6f(0x178)]),_0x6dab1f=await _0x2a5a0e['llm'][_0x558a6f(0x18e)](_0x2352ed);return saveLastChatId(_0x6dab1f['id']),console[_0x558a6f(0x1a6)](JSON[_0x558a6f(0x1a0)]({'chatId':_0x6dab1f['id'],'agentId':_0x2352ed})),0x0;}catch(_0x4d20de){return handleSDKError(_0x4d20de,_0x7198bb),0x1;}}}