@treasuredata/tdx 0.28.1 → 0.28.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 (181) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/chat-command.js +1 -1
  11. package/dist/commands/claude-command.js +1 -1
  12. package/dist/commands/claude-statusline-command.js +1 -1
  13. package/dist/commands/claude-usage-command.js +1 -1
  14. package/dist/commands/command.js +1 -1
  15. package/dist/commands/connection-command.js +1 -1
  16. package/dist/commands/databases.js +1 -1
  17. package/dist/commands/delivery-command.js +1 -1
  18. package/dist/commands/describe.js +1 -1
  19. package/dist/commands/engage-campaign-pull-command.js +1 -1
  20. package/dist/commands/engage-campaign-push-command.js +1 -1
  21. package/dist/commands/engage-campaign-validate-command.js +1 -1
  22. package/dist/commands/engage-command.js +1 -1
  23. package/dist/commands/job-command.js +1 -1
  24. package/dist/commands/journey-command.js +1 -1
  25. package/dist/commands/journey-validate-command.js +1 -1
  26. package/dist/commands/llm-command.js +1 -1
  27. package/dist/commands/mcp-command.js +1 -1
  28. package/dist/commands/parent-segment-command.js +1 -1
  29. package/dist/commands/profile-command.js +1 -1
  30. package/dist/commands/profiles-command.js +1 -1
  31. package/dist/commands/query-command.js +1 -1
  32. package/dist/commands/schedule-command.js +1 -1
  33. package/dist/commands/segment-command.js +1 -1
  34. package/dist/commands/segment-create-command.js +1 -1
  35. package/dist/commands/segment-fields-command.js +1 -1
  36. package/dist/commands/segment-pull-command.js +1 -1
  37. package/dist/commands/segment-push-command.js +1 -1
  38. package/dist/commands/segment-update-command.js +1 -1
  39. package/dist/commands/segment-use-command.js +1 -1
  40. package/dist/commands/segment-validate-command.js +1 -1
  41. package/dist/commands/segments.js +1 -1
  42. package/dist/commands/show.js +1 -1
  43. package/dist/commands/status-command.js +1 -1
  44. package/dist/commands/tables.js +1 -1
  45. package/dist/commands/unset-command.js +1 -1
  46. package/dist/commands/use-command.js +1 -1
  47. package/dist/commands/user-command.js +1 -1
  48. package/dist/commands/workflow-command.js +1 -1
  49. package/dist/core/auth.js +1 -1
  50. package/dist/core/command-output.js +1 -1
  51. package/dist/core/config.js +1 -1
  52. package/dist/core/connection-cache.js +1 -1
  53. package/dist/core/constants.js +1 -1
  54. package/dist/core/credential-cache.js +1 -1
  55. package/dist/core/global-context.js +1 -1
  56. package/dist/core/keychain.js +1 -1
  57. package/dist/core/profile.js +1 -1
  58. package/dist/core/project-config.js +1 -1
  59. package/dist/core/session.js +1 -1
  60. package/dist/core/user-cache.js +1 -1
  61. package/dist/core/version.js +1 -1
  62. package/dist/index.js +1 -1
  63. package/dist/mcp/server.js +1 -1
  64. package/dist/mcp/tools/index.js +1 -1
  65. package/dist/mcp/tools/tdx-run.js +1 -1
  66. package/dist/mcp/tools/tdx-search.js +1 -1
  67. package/dist/mcp/utils.js +1 -1
  68. package/dist/proxy/claude-usage-tracker.js +1 -1
  69. package/dist/proxy/passthrough-server.js +1 -1
  70. package/dist/proxy/sse-usage-parser.js +1 -1
  71. package/dist/sdk/agent/agent-config.js +1 -1
  72. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  73. package/dist/sdk/agent/agent-yaml.js +1 -1
  74. package/dist/sdk/agent/test/evaluator.js +1 -1
  75. package/dist/sdk/agent/test/executor.js +1 -1
  76. package/dist/sdk/agent/test/index.js +1 -1
  77. package/dist/sdk/agent/test/output.js +1 -1
  78. package/dist/sdk/agent/test/parser.js +1 -1
  79. package/dist/sdk/agent/tool-target-registry.js +1 -1
  80. package/dist/sdk/api.js +1 -1
  81. package/dist/sdk/client/cdp-api-client.js +1 -1
  82. package/dist/sdk/client/delivery-api-client.js +1 -1
  83. package/dist/sdk/client/endpoints.js +1 -1
  84. package/dist/sdk/client/engage-api-client.js +1 -1
  85. package/dist/sdk/client/http-client.js +1 -1
  86. package/dist/sdk/client/llm-api-client.js +1 -1
  87. package/dist/sdk/client/rate-limiter.js +1 -1
  88. package/dist/sdk/client/td-api-client.js +1 -1
  89. package/dist/sdk/client/trino-api-client.js +1 -1
  90. package/dist/sdk/client/workflow-client.js +1 -1
  91. package/dist/sdk/connection-validator.js +1 -1
  92. package/dist/sdk/connection.js +1 -1
  93. package/dist/sdk/delivery.js +1 -1
  94. package/dist/sdk/engage/campaign-pull.js +1 -1
  95. package/dist/sdk/engage/campaign-push.js +1 -1
  96. package/dist/sdk/engage/campaign-validator.js +1 -1
  97. package/dist/sdk/engage/campaign-yaml.js +1 -1
  98. package/dist/sdk/engage/types/campaign-def.js +1 -1
  99. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  100. package/dist/sdk/engage.js +1 -1
  101. package/dist/sdk/errors.js +1 -1
  102. package/dist/sdk/index.js +1 -1
  103. package/dist/sdk/io/index.js +1 -1
  104. package/dist/sdk/io/node-filesystem.js +1 -1
  105. package/dist/sdk/job.js +1 -1
  106. package/dist/sdk/journey.js +1 -1
  107. package/dist/sdk/llm/chat-cache.js +1 -1
  108. package/dist/sdk/llm/index.js +1 -1
  109. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  110. package/dist/sdk/llm/model-factors.js +1 -1
  111. package/dist/sdk/personalization.js +1 -1
  112. package/dist/sdk/query/index.js +1 -1
  113. package/dist/sdk/query/sql-parser.js +1 -1
  114. package/dist/sdk/realtime.js +1 -1
  115. package/dist/sdk/schedule.js +1 -1
  116. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  117. package/dist/sdk/segment/fields-display.js +1 -1
  118. package/dist/sdk/segment/file-discovery.js +1 -1
  119. package/dist/sdk/segment/journey-utils.js +1 -1
  120. package/dist/sdk/segment/journey-validator.d.ts.map +1 -1
  121. package/dist/sdk/segment/journey-validator.js +1 -1
  122. package/dist/sdk/segment/journey-validator.js.map +1 -1
  123. package/dist/sdk/segment/journey-yaml.js +1 -1
  124. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  125. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  126. package/dist/sdk/segment/pull-workflow.js +1 -1
  127. package/dist/sdk/segment/push-recovery.js +1 -1
  128. package/dist/sdk/segment/push-workflow.js +1 -1
  129. package/dist/sdk/segment/resolution-context.js +1 -1
  130. package/dist/sdk/segment/segment-path-parser.js +1 -1
  131. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  132. package/dist/sdk/segment/target-resolution.js +1 -1
  133. package/dist/sdk/segment/tdx-config.js +1 -1
  134. package/dist/sdk/segment/validate-files.js +1 -1
  135. package/dist/sdk/segment/yaml-validator.js +1 -1
  136. package/dist/sdk/segment.js +1 -1
  137. package/dist/sdk/types/index.js +1 -1
  138. package/dist/sdk/types/progress.js +1 -1
  139. package/dist/sdk/user.js +1 -1
  140. package/dist/sdk/util/format-detector.js +1 -1
  141. package/dist/sdk/util/formatters.js +1 -1
  142. package/dist/sdk/util/index.js +1 -1
  143. package/dist/sdk/util/tree-formatter.js +1 -1
  144. package/dist/sdk/workflow/archive-validation.js +1 -1
  145. package/dist/sdk/workflow/clone-workflow.js +1 -1
  146. package/dist/sdk/workflow/index.js +1 -1
  147. package/dist/sdk/workflow/pull-workflow.js +1 -1
  148. package/dist/sdk/workflow/push-workflow.js +1 -1
  149. package/dist/sdk/workflow/tdx-config.js +1 -1
  150. package/dist/sdk/workflow/workflow-utils.js +1 -1
  151. package/dist/test-utils/command-runner.js +1 -1
  152. package/dist/test-utils/factories.js +1 -1
  153. package/dist/test-utils/fixtures.js +1 -1
  154. package/dist/test-utils/http-mock.js +1 -1
  155. package/dist/test-utils/index.js +1 -1
  156. package/dist/utils/async.js +1 -1
  157. package/dist/utils/colors.js +1 -1
  158. package/dist/utils/diff.js +1 -1
  159. package/dist/utils/file-permissions.js +1 -1
  160. package/dist/utils/global-cache.js +1 -1
  161. package/dist/utils/json-loader.js +1 -1
  162. package/dist/utils/local-cache.js +1 -1
  163. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  164. package/dist/utils/logger/formatters/index.js +1 -1
  165. package/dist/utils/logger/handlers/console-handler.js +1 -1
  166. package/dist/utils/logger/handlers/file-handler.js +1 -1
  167. package/dist/utils/logger/handlers/index.js +1 -1
  168. package/dist/utils/logger/handlers/null-handler.js +1 -1
  169. package/dist/utils/logger/index.js +1 -1
  170. package/dist/utils/logger/logger.js +1 -1
  171. package/dist/utils/logger/types.js +1 -1
  172. package/dist/utils/option-validation.js +1 -1
  173. package/dist/utils/process.js +1 -1
  174. package/dist/utils/prompt.js +1 -1
  175. package/dist/utils/spinner.js +1 -1
  176. package/dist/utils/sse-parser.js +1 -1
  177. package/dist/utils/string-utils.js +1 -1
  178. package/dist/utils/table-ref-parser.js +1 -1
  179. package/dist/utils/tdx-logger.js +1 -1
  180. package/dist/utils/version-check.js +1 -1
  181. package/package.json +1 -1
@@ -1 +1 @@
1
- const a3_0x457390=a3_0x52a6;(function(_0x242fa6,_0x1e448a){const _0x30d648=a3_0x52a6,_0x541f84=_0x242fa6();while(!![]){try{const _0x389671=parseInt(_0x30d648(0x143))/0x1+parseInt(_0x30d648(0x132))/0x2*(-parseInt(_0x30d648(0x140))/0x3)+-parseInt(_0x30d648(0x13c))/0x4+-parseInt(_0x30d648(0x13a))/0x5*(-parseInt(_0x30d648(0x151))/0x6)+-parseInt(_0x30d648(0x152))/0x7+parseInt(_0x30d648(0x134))/0x8*(parseInt(_0x30d648(0x150))/0x9)+parseInt(_0x30d648(0x137))/0xa*(parseInt(_0x30d648(0x13b))/0xb);if(_0x389671===_0x1e448a)break;else _0x541f84['push'](_0x541f84['shift']());}catch(_0x39e2cb){_0x541f84['push'](_0x541f84['shift']());}}}(a3_0x4973,0x79e31));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a3_0x4973(){const _0x872246=['54uJxGtk','data','Resolved\x20child\x20ID:\x20','370266FyjqGA','description','\x27...','verbose','\x20\x20Cause:\x20','message','Resolved\x20parent\x20ID:\x20','resolveParentId','listActivations','segment','✔\x20Found\x20','activations','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','881910OMaJqY','150GWxZQE','6481993hyGrOV','Error:\x20','Resolving\x20parent\x20segment\x20\x27','cause','\x20activation','Error:\x20Segment\x20name\x20is\x20required','List\x20activations\x20for\x20a\x20segment','35542bsCwWk','length','72vhWEfa','error','execute','11246750zKxoiY','Resolving\x20child\x20segment\x20\x27','Site:\x20','41320JZZrXX','11ZHwWfV','3353300sgJyrE','Listing\x20activations\x20for\x20segment\x20\x27','name','site'];a3_0x4973=function(){return _0x872246;};return a3_0x4973();}import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';function a3_0x52a6(_0x4f06c6,_0x426643){_0x4f06c6=_0x4f06c6-0x12f;const _0x4973ac=a3_0x4973();let _0x52a60f=_0x4973ac[_0x4f06c6];return _0x52a60f;}export class ActivationsCommand extends BaseCommand{[a3_0x457390(0x13e)]=a3_0x457390(0x14e);[a3_0x457390(0x144)]=a3_0x457390(0x131);async[a3_0x457390(0x136)](_0x5ef62a){const _0x478921=a3_0x457390,{options:_0x5f2075,args:_0x40082a,tdx:_0x5e581e}=_0x5ef62a;if(_0x40082a['length']===0x0)return console[_0x478921(0x135)](_0x478921(0x130)),console[_0x478921(0x135)](_0x478921(0x14f)),0x1;try{const {parentId:_0x187810,childId:_0x10c6b1}=parseSegmentRef(_0x40082a[0x0]);if(!_0x10c6b1)return console[_0x478921(0x135)]('Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations'),console[_0x478921(0x135)](_0x478921(0x14f)),0x1;_0x5f2075[_0x478921(0x146)]&&(console[_0x478921(0x135)](_0x478921(0x139)+_0x5f2075[_0x478921(0x13f)]),console[_0x478921(0x135)]('Parent\x20name:\x20'+_0x187810),console[_0x478921(0x135)]('Child\x20name:\x20'+_0x10c6b1));const _0x15c65e=await withSpinner(_0x478921(0x154)+_0x187810+_0x478921(0x145),()=>_0x5e581e[_0x478921(0x14c)][_0x478921(0x14a)](_0x187810),{'verbose':_0x5f2075[_0x478921(0x146)]}),_0x24a141=_0x15c65e['data'];_0x5f2075[_0x478921(0x146)]&&console[_0x478921(0x135)](_0x478921(0x149)+_0x24a141);const _0x17549d=await withSpinner(_0x478921(0x138)+_0x10c6b1+_0x478921(0x145),()=>_0x5e581e[_0x478921(0x14c)]['resolveSegmentId'](_0x24a141,_0x10c6b1),{'verbose':_0x5f2075[_0x478921(0x146)]}),_0x5f04d1=_0x17549d[_0x478921(0x141)];_0x5f2075[_0x478921(0x146)]&&console[_0x478921(0x135)](_0x478921(0x142)+_0x5f04d1);const _0x3f075d=await withSpinner(_0x478921(0x13d)+_0x10c6b1+'\x27...',()=>_0x5e581e['segment'][_0x478921(0x14b)](_0x24a141,_0x5f04d1),{'verbose':_0x5f2075[_0x478921(0x146)]}),_0x338044=_0x3f075d['data'];return console[_0x478921(0x135)](_0x478921(0x14d)+_0x338044[_0x478921(0x133)]+_0x478921(0x12f)+(_0x338044[_0x478921(0x133)]!==0x1?'s':'')),await handleSDKOutput(_0x338044,_0x5f2075),0x0;}catch(_0x121326){if(_0x121326 instanceof SDKError)return console[_0x478921(0x135)](_0x478921(0x153)+_0x121326[_0x478921(0x148)]),_0x121326[_0x478921(0x155)]&&console['error'](_0x478921(0x147)+_0x121326[_0x478921(0x155)]),0x1;throw _0x121326;}}}
1
+ const a3_0x3e2bc0=a3_0x34ad;(function(_0x32482a,_0x42729b){const _0x2c2a91=a3_0x34ad,_0x3b887d=_0x32482a();while(!![]){try{const _0x1e679b=-parseInt(_0x2c2a91(0x18a))/0x1*(parseInt(_0x2c2a91(0x195))/0x2)+parseInt(_0x2c2a91(0x189))/0x3*(parseInt(_0x2c2a91(0x185))/0x4)+-parseInt(_0x2c2a91(0x1a1))/0x5*(-parseInt(_0x2c2a91(0x1a4))/0x6)+parseInt(_0x2c2a91(0x19b))/0x7*(-parseInt(_0x2c2a91(0x192))/0x8)+-parseInt(_0x2c2a91(0x19c))/0x9+parseInt(_0x2c2a91(0x190))/0xa+parseInt(_0x2c2a91(0x1a3))/0xb*(-parseInt(_0x2c2a91(0x183))/0xc);if(_0x1e679b===_0x42729b)break;else _0x3b887d['push'](_0x3b887d['shift']());}catch(_0x5eaa7c){_0x3b887d['push'](_0x3b887d['shift']());}}}(a3_0x1418,0x402d1));import{BaseCommand}from'./command.js';function a3_0x34ad(_0x261472,_0x135b96){_0x261472=_0x261472-0x183;const _0x141868=a3_0x1418();let _0x34adf7=_0x141868[_0x261472];return _0x34adf7;}import{SDKError}from'../sdk/index.js';function a3_0x1418(){const _0xb9cdfb=['Listing\x20activations\x20for\x20segment\x20\x27','18264QBhxiS','\x20activation','resolveParentId','22IMbmws','Resolving\x20parent\x20segment\x20\x27','Error:\x20Segment\x20name\x20is\x20required','verbose','Error:\x20','length','210UOlaZj','3093336CRnYPI','resolveSegmentId','description','name','listActivations','89575SQfXNM','Site:\x20','11lkQuBK','114ZzLtLD','execute','Child\x20name:\x20','Resolving\x20child\x20segment\x20\x27','message','segment','2584380miKxdM','error','2708Tvnenu','\x27...','\x20\x20Cause:\x20','Resolved\x20child\x20ID:\x20','2256UxgdOh','39027eqwzkz','✔\x20Found\x20','cause','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','data','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','4702320ENhhqV'];a3_0x1418=function(){return _0xb9cdfb;};return a3_0x1418();}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_0x3e2bc0(0x19f)]='activations';[a3_0x3e2bc0(0x19e)]='List\x20activations\x20for\x20a\x20segment';async[a3_0x3e2bc0(0x1a5)](_0x1355d4){const _0x11c7e4=a3_0x3e2bc0,{options:_0x4e3683,args:_0x2b2909,tdx:_0x17c0b1}=_0x1355d4;if(_0x2b2909[_0x11c7e4(0x19a)]===0x0)return console[_0x11c7e4(0x184)](_0x11c7e4(0x197)),console[_0x11c7e4(0x184)]('Usage:\x20tdx\x20activations\x20<parent_name/child_name>'),0x1;try{const {parentId:_0x2f9945,childId:_0x477054}=parseSegmentRef(_0x2b2909[0x0]);if(!_0x477054)return console[_0x11c7e4(0x184)](_0x11c7e4(0x18f)),console['error'](_0x11c7e4(0x18d)),0x1;_0x4e3683[_0x11c7e4(0x198)]&&(console[_0x11c7e4(0x184)](_0x11c7e4(0x1a2)+_0x4e3683['site']),console[_0x11c7e4(0x184)]('Parent\x20name:\x20'+_0x2f9945),console[_0x11c7e4(0x184)](_0x11c7e4(0x1a6)+_0x477054));const _0x354e01=await withSpinner(_0x11c7e4(0x196)+_0x2f9945+'\x27...',()=>_0x17c0b1[_0x11c7e4(0x1a9)][_0x11c7e4(0x194)](_0x2f9945),{'verbose':_0x4e3683[_0x11c7e4(0x198)]}),_0x5a8a72=_0x354e01['data'];_0x4e3683[_0x11c7e4(0x198)]&&console['error']('Resolved\x20parent\x20ID:\x20'+_0x5a8a72);const _0xebc3c8=await withSpinner(_0x11c7e4(0x1a7)+_0x477054+_0x11c7e4(0x186),()=>_0x17c0b1[_0x11c7e4(0x1a9)][_0x11c7e4(0x19d)](_0x5a8a72,_0x477054),{'verbose':_0x4e3683['verbose']}),_0x3b797a=_0xebc3c8[_0x11c7e4(0x18e)];_0x4e3683['verbose']&&console['error'](_0x11c7e4(0x188)+_0x3b797a);const _0xe6a832=await withSpinner(_0x11c7e4(0x191)+_0x477054+_0x11c7e4(0x186),()=>_0x17c0b1['segment'][_0x11c7e4(0x1a0)](_0x5a8a72,_0x3b797a),{'verbose':_0x4e3683[_0x11c7e4(0x198)]}),_0x25cb95=_0xe6a832[_0x11c7e4(0x18e)];return console[_0x11c7e4(0x184)](_0x11c7e4(0x18b)+_0x25cb95[_0x11c7e4(0x19a)]+_0x11c7e4(0x193)+(_0x25cb95[_0x11c7e4(0x19a)]!==0x1?'s':'')),await handleSDKOutput(_0x25cb95,_0x4e3683),0x0;}catch(_0x145ad9){if(_0x145ad9 instanceof SDKError)return console['error'](_0x11c7e4(0x199)+_0x145ad9[_0x11c7e4(0x1a8)]),_0x145ad9[_0x11c7e4(0x18c)]&&console[_0x11c7e4(0x184)](_0x11c7e4(0x187)+_0x145ad9[_0x11c7e4(0x18c)]),0x1;throw _0x145ad9;}}}
@@ -1 +1 @@
1
- const a4_0x3146ec=a4_0x4249;(function(_0x3ea5dd,_0x1c3eba){const _0x541e91=a4_0x4249,_0x32c102=_0x3ea5dd();while(!![]){try{const _0x570d6c=parseInt(_0x541e91(0x171))/0x1+-parseInt(_0x541e91(0x19f))/0x2*(-parseInt(_0x541e91(0x160))/0x3)+parseInt(_0x541e91(0x1a1))/0x4+parseInt(_0x541e91(0x175))/0x5+-parseInt(_0x541e91(0x150))/0x6+-parseInt(_0x541e91(0x1de))/0x7*(parseInt(_0x541e91(0x182))/0x8)+parseInt(_0x541e91(0x19c))/0x9;if(_0x570d6c===_0x1c3eba)break;else _0x32c102['push'](_0x32c102['shift']());}catch(_0x30b400){_0x32c102['push'](_0x32c102['shift']());}}}(a4_0x5757,0x5fa9a));import a4_0x354290 from'chalk';import a4_0x41daea from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a4_0x4249(_0x2d0360,_0x5d4a3c){_0x2d0360=_0x2d0360-0x143;const _0x575787=a4_0x5757();let _0x424918=_0x575787[_0x2d0360];return _0x424918;}import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext,resolveAgentPullArgs}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x2e1cdc){const _0x131a97=a4_0x4249,_0x1ad19d=[];if(_0x2e1cdc[_0x131a97(0x1bf)]!==undefined)_0x1ad19d[_0x131a97(0x190)](_0x2e1cdc[_0x131a97(0x1bf)]+_0x131a97(0x196));if(_0x2e1cdc['new']!==undefined&&_0x2e1cdc[_0x131a97(0x1d9)]>0x0)_0x1ad19d['push'](a4_0x354290[_0x131a97(0x16a)](_0x2e1cdc['new']+'\x20new'));if(_0x2e1cdc[_0x131a97(0x151)]!==undefined&&_0x2e1cdc[_0x131a97(0x151)]>0x0)_0x1ad19d[_0x131a97(0x190)](a4_0x354290['green'](_0x2e1cdc[_0x131a97(0x151)]+'\x20created'));if(_0x2e1cdc[_0x131a97(0x183)]!==undefined&&_0x2e1cdc[_0x131a97(0x183)]>0x0)_0x1ad19d[_0x131a97(0x190)](a4_0x354290['yellow'](_0x2e1cdc[_0x131a97(0x183)]+_0x131a97(0x157)));if(_0x2e1cdc['unchanged']!==undefined&&_0x2e1cdc[_0x131a97(0x1d6)]>0x0)_0x1ad19d[_0x131a97(0x190)](a4_0x354290[_0x131a97(0x1a0)](_0x2e1cdc[_0x131a97(0x1d6)]+_0x131a97(0x174)));if(_0x2e1cdc[_0x131a97(0x16b)]!==undefined&&_0x2e1cdc['errors']>0x0)_0x1ad19d[_0x131a97(0x190)](a4_0x354290['red'](_0x2e1cdc[_0x131a97(0x16b)]+'\x20errors'));return _0x1ad19d['join'](',\x20');}function a4_0x5757(){const _0x592d85=['\x20\x20Agents:\x20','Using\x20local\x20project:\x20','dirname','\x20--profile\x20','total','description','<new-name>','agent','\x20|\x20','llmProject','projectName','error','textKnowledgeBases','Cannot\x20clone\x20from\x20context\x20project\x20\x22','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','Using\x20project\x20from\x20','Pushing\x20agent\x20from\x20\x22','✔\x20Context\x20set:\x20','\x22\x20to\x20\x22','\x20--name\x20','\x20\x20Target:\x20','integrations','sourceProjectName','cyan','Errors:','force','knowledgeBases','unchanged','projectId','Usage:\x20tdx\x20agent\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20project\x20(requires\x20context\x20or\x20tdx.json)','new','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','\x22:\x20','\x0aPush\x20','counts','71169tzCboe','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','name','Failed\x20to\x20push\x20agent:\x20','Would\x20pull\x20agent:\x20','session','found','\x20\x20Knowledge\x20Base\x20\x22','\x0aChanges\x20to\x20prompt\x20\x27','prompts','no_context','pushProject','Cloning\x20\x22','newProjectName','Summary:','\x20\x20Prompts:\x20','experimentalArtifacts','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Using\x20current\x20project:\x20','no_local_folder','\x0aChanges\x20to\x20integration\x20\x27','agentName','\x0aError:','isNew','\x20\x20Knowledge\x20Bases:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project','New\x20project\x20ID:\x20','INVALID_ARGUMENT','Using\x20context\x20project:\x20','Using\x20project\x20from\x20context:\x20','cwd-config','\x20files?','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','Writing\x20files...','projectDir','Agent:\x20','pushAgent','\x20\x20Integrations:\x20','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','4482342qERCmd','created','context','parse','\x20\x20Agent\x20\x22','outputPath','Status:\x20','\x20updated','diff','pullAgent','\x20changed','hasChanges','Output:\x20','llm','\x0aProject\x20pushed\x20with\x20errors','utf-8','402myEDQn','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','Using\x20project:\x20','\x0a✔\x20Pulled\x20','\x22...','\x20\x20tdx\x20agent\x20clone\x20agents/','Analyzing\x20changes\x20to\x20push...','-\x20nothing\x20pushed','Cancelled','agentId','green','errors','dryRun','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','cloneProject','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','New\x20project:\x20','412584RYaefr','llm_project','\x20new','\x20unchanged','3460590DMwlSg','reason','\x0aWrite\x20','yes','pullProject','\x20\x20Experimental\x20Artifacts:\x20','red','execute','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','Clone\x20\x22','join','\x0aChanges\x20to\x20agent\x20\x27','Output\x20path:\x20','616pvfiKQ','updated','\x27\x20to\x20create\x20the\x20folder\x20structure.','profile','Would\x20push\x20agent:\x20','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','tdx.json','\x20resources\x20to\x20\x27','log','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20--agent\x20<name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20context\x20project','\x22\x20to\x20new\x20project\x20\x22','\x20\x20Experimental\x20Artifact\x20\x22','push','\x20resources?','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','-\x20no\x20files\x20written','\x20\x20Source:\x20','dim','\x20total','agent.yml','Project:\x20','agents','\x20\x20Text\x20Knowledge\x20Bases:\x20','\x20\x20Prompt\x20\x22','4352949xCXqIy','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','action','106ssLIeX','gray','1305140lOPHVf','No\x20tdx.json\x20found\x20in\x20','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','\x0aErrors\x20found:','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','cwd','MISSING_ARGUMENT','outputDir','newProjectId','repeat','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','Pulling\x20agent\x20\x22','agent:pull','yellow','Dry\x20run\x20-\x20no\x20changes\x20made','output','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','\x20=\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','experimentalKnowledgeBases','\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)','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','Source:\x20','site'];a4_0x5757=function(){return _0x592d85;};return a4_0x5757();}function displayDiffs(_0x18c049,_0x2701d4,_0x325a99,_0x1a63ab,_0x3b8d07,_0x35ff31,_0x93ff00){const _0x335307=a4_0x4249;for(const _0x7f874d of _0x18c049){if(_0x7f874d[_0x335307(0x158)]){const _0x52508f=_0x7f874d[_0x335307(0x1f4)]||_0x7f874d[_0x335307(0x1e1)];console[_0x335307(0x18a)](_0x335307(0x180)+_0x52508f+'\x27:'),console[_0x335307(0x18a)]('─'[_0x335307(0x1ab)](0x3c)),console['log'](_0x7f874d[_0x335307(0x158)]),console[_0x335307(0x18a)]('─'[_0x335307(0x1ab)](0x3c));}}for(const _0x46c5cf of _0x2701d4){_0x46c5cf[_0x335307(0x158)]&&(console[_0x335307(0x18a)]('\x0aChanges\x20to\x20knowledge\x20base\x20\x27'+_0x46c5cf['name']+'\x27:'),console[_0x335307(0x18a)]('─'['repeat'](0x3c)),console[_0x335307(0x18a)](_0x46c5cf['diff']),console[_0x335307(0x18a)]('─'[_0x335307(0x1ab)](0x3c)));}for(const _0x1ac27e of _0x325a99){_0x1ac27e[_0x335307(0x158)]&&(console[_0x335307(0x18a)]('\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27'+_0x1ac27e[_0x335307(0x1e1)]+'\x27:'),console[_0x335307(0x18a)]('─'[_0x335307(0x1ab)](0x3c)),console['log'](_0x1ac27e[_0x335307(0x158)]),console[_0x335307(0x18a)]('─'[_0x335307(0x1ab)](0x3c)));}for(const _0x4b4093 of _0x1a63ab){_0x4b4093[_0x335307(0x158)]&&(console['log'](_0x335307(0x1e7)+_0x4b4093[_0x335307(0x1e1)]+'\x27:'),console[_0x335307(0x18a)]('─'[_0x335307(0x1ab)](0x3c)),console[_0x335307(0x18a)](_0x4b4093['diff']),console[_0x335307(0x18a)]('─'['repeat'](0x3c)));}for(const _0x1a6af3 of _0x3b8d07){_0x1a6af3[_0x335307(0x158)]&&(console[_0x335307(0x18a)](_0x335307(0x1f3)+_0x1a6af3[_0x335307(0x1e1)]+'\x27:'),console[_0x335307(0x18a)]('─'[_0x335307(0x1ab)](0x3c)),console[_0x335307(0x18a)](_0x1a6af3[_0x335307(0x158)]),console[_0x335307(0x18a)]('─'[_0x335307(0x1ab)](0x3c)));}for(const _0x8e7af4 of _0x35ff31){_0x8e7af4[_0x335307(0x158)]&&(console['log'](_0x335307(0x17d)+_0x8e7af4[_0x335307(0x1e1)]+'\x27:'),console[_0x335307(0x18a)]('─'[_0x335307(0x1ab)](0x3c)),console[_0x335307(0x18a)](_0x8e7af4['diff']),console[_0x335307(0x18a)]('─'[_0x335307(0x1ab)](0x3c)));}for(const _0x55248b of _0x93ff00){_0x55248b[_0x335307(0x158)]&&(console['log'](_0x335307(0x1ad)+_0x55248b[_0x335307(0x1e1)]+'\x27:'),console[_0x335307(0x18a)]('─'[_0x335307(0x1ab)](0x3c)),console[_0x335307(0x18a)](_0x55248b[_0x335307(0x158)]),console['log']('─'[_0x335307(0x1ab)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x3146ec(0x1e1)]=a4_0x3146ec(0x1af);[a4_0x3146ec(0x1c0)]=a4_0x3146ec(0x1b3);async['execute'](_0x3b0f68){const _0x2a8ead=a4_0x3146ec,{options:_0x220b20,args:_0x56268f,tdx:_0x4267f8}=_0x3b0f68,_0x15e47a=_0x56268f[0x0],_0x5eddde=_0x56268f[0x1],_0x4d3919=_0x220b20[_0x2a8ead(0x1b2)],_0x47d1cc=_0x220b20[_0x2a8ead(0x16c)],_0x49d913=_0x220b20[_0x2a8ead(0x1d4)],_0x339475=_0x220b20[_0x2a8ead(0x178)],_0x233aea=_0x220b20[_0x2a8ead(0x1c4)],_0x5bdd99=_0x220b20[_0x2a8ead(0x1c2)];let _0x54d48a;if(_0x15e47a){const _0x47f9cd=a4_0x41daea[_0x2a8ead(0x17f)](_0x15e47a,_0x2a8ead(0x188));if(existsSync(_0x47f9cd))try{const _0x511c0b=JSON[_0x2a8ead(0x153)](readFileSync(_0x47f9cd,_0x2a8ead(0x15f)));_0x511c0b[_0x2a8ead(0x172)]&&(_0x54d48a={'llm_project':_0x511c0b[_0x2a8ead(0x172)]});}catch{}}const _0x50275d=findAgentConfigPath(process[_0x2a8ead(0x1a7)]());let _0x3bd9cd;if(_0x50275d)try{const _0x8af4f7=JSON[_0x2a8ead(0x153)](readFileSync(_0x50275d,'utf-8'));_0x8af4f7['llm_project']&&(_0x3bd9cd={'llm_project':_0x8af4f7['llm_project']});}catch{}const _0x152602=resolveAgentPullArgs({'arg':_0x15e47a,'agentNameArg':_0x5eddde,'agentFlag':_0x5bdd99,'contextProject':_0x233aea,'argDirConfig':_0x54d48a,'cwdConfigPath':_0x50275d||undefined,'cwdConfig':_0x3bd9cd}),{projectNameOrId:_0xde9b12,targetAgentName:_0x32983b,existingOutputDir:_0x5c0156,source:_0x5bc567}=_0x152602;if(_0x5bc567==='arg-dir')console[_0x2a8ead(0x18a)](a4_0x354290[_0x2a8ead(0x195)](_0x2a8ead(0x1ca)+a4_0x41daea[_0x2a8ead(0x17f)](_0x15e47a,_0x2a8ead(0x188))+':\x20'+_0xde9b12));else{if(_0x5bc567===_0x2a8ead(0x147))console[_0x2a8ead(0x18a)](a4_0x354290[_0x2a8ead(0x195)](_0x2a8ead(0x162)+_0xde9b12));else _0x5bc567===_0x2a8ead(0x152)&&console[_0x2a8ead(0x18a)](a4_0x354290[_0x2a8ead(0x195)](_0x2a8ead(0x146)+_0xde9b12));}if(!_0xde9b12)return _0x5bdd99?(console[_0x2a8ead(0x18a)](a4_0x354290['yellow'](_0x2a8ead(0x187))),console['log'](_0x2a8ead(0x1a3)),console[_0x2a8ead(0x18a)]('Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>')):(console[_0x2a8ead(0x18a)](a4_0x354290[_0x2a8ead(0x1b0)]('llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a')),console[_0x2a8ead(0x18a)](_0x2a8ead(0x1d8)),console[_0x2a8ead(0x18a)](_0x2a8ead(0x1f8)),console[_0x2a8ead(0x18a)](_0x2a8ead(0x1ac)),console['log'](_0x2a8ead(0x18d)),console[_0x2a8ead(0x18a)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20project')),0x1;if(_0x32983b){const {data:_0x411215}=await withSpinner(_0x2a8ead(0x1ae)+_0x32983b+'\x22\x20from\x20project\x20\x22'+_0xde9b12+_0x2a8ead(0x164),()=>_0x4267f8[_0x2a8ead(0x15d)][_0x2a8ead(0x159)](_0xde9b12,_0x32983b,_0x4d3919,{'dryRun':_0x47d1cc,'force':_0x49d913}));if(_0x47d1cc)return console[_0x2a8ead(0x18a)](a4_0x354290[_0x2a8ead(0x1b0)]('Dry\x20run\x20-\x20no\x20files\x20written')),console[_0x2a8ead(0x18a)](_0x2a8ead(0x1e3)+_0x411215[_0x2a8ead(0x1f4)]),console[_0x2a8ead(0x18a)](_0x2a8ead(0x181)+_0x411215[_0x2a8ead(0x155)]),_0x411215['diff']&&(console['log']('\x0aChanges:'),console[_0x2a8ead(0x18a)]('─'[_0x2a8ead(0x1ab)](0x3c)),console[_0x2a8ead(0x18a)](_0x411215[_0x2a8ead(0x158)]),console[_0x2a8ead(0x18a)]('─'['repeat'](0x3c))),0x0;return console[_0x2a8ead(0x18a)](a4_0x354290[_0x2a8ead(0x16a)]('Agent\x20pulled\x20successfully')),console[_0x2a8ead(0x18a)]('Agent:\x20'+_0x411215[_0x2a8ead(0x1f4)]),console['log'](_0x2a8ead(0x15c)+_0x411215[_0x2a8ead(0x155)]),console[_0x2a8ead(0x18a)](_0x2a8ead(0x156)+(_0x411215[_0x2a8ead(0x1f6)]?a4_0x354290[_0x2a8ead(0x16a)](_0x2a8ead(0x1d9)):_0x411215[_0x2a8ead(0x15b)]?a4_0x354290[_0x2a8ead(0x1b0)](_0x2a8ead(0x183)):a4_0x354290['gray'](_0x2a8ead(0x1d6)))),0x0;}const _0xd4fb27=_0x5c0156||_0x4d3919,{data:_0x376a6e}=await withSpinner('Analyzing\x20project\x20\x22'+_0xde9b12+_0x2a8ead(0x164),()=>_0x4267f8[_0x2a8ead(0x15d)][_0x2a8ead(0x179)](_0xde9b12,_0xd4fb27,{'dryRun':!![]})),_0x4b9bb1=_0x376a6e['counts'][_0x2a8ead(0x199)][_0x2a8ead(0x1d9)]+_0x376a6e['counts'][_0x2a8ead(0x1d5)][_0x2a8ead(0x1d9)]+_0x376a6e[_0x2a8ead(0x1dd)]['textKnowledgeBases']['new']+_0x376a6e[_0x2a8ead(0x1dd)][_0x2a8ead(0x1e8)][_0x2a8ead(0x1d9)]+_0x376a6e['counts'][_0x2a8ead(0x1d0)]['new']+_0x376a6e[_0x2a8ead(0x1dd)][_0x2a8ead(0x1b6)][_0x2a8ead(0x1d9)]+_0x376a6e[_0x2a8ead(0x1dd)][_0x2a8ead(0x1ef)][_0x2a8ead(0x1d9)],_0x511862=_0x376a6e[_0x2a8ead(0x1dd)]['agents'][_0x2a8ead(0x183)]+_0x376a6e[_0x2a8ead(0x1dd)][_0x2a8ead(0x1d5)]['updated']+_0x376a6e[_0x2a8ead(0x1dd)][_0x2a8ead(0x1c7)][_0x2a8ead(0x183)]+_0x376a6e[_0x2a8ead(0x1dd)]['prompts'][_0x2a8ead(0x183)]+_0x376a6e[_0x2a8ead(0x1dd)]['integrations'][_0x2a8ead(0x183)]+_0x376a6e['counts'][_0x2a8ead(0x1b6)]['updated']+_0x376a6e['counts']['experimentalArtifacts'][_0x2a8ead(0x183)],_0x2330ba=_0x376a6e[_0x2a8ead(0x1dd)]['agents']['unchanged']+_0x376a6e['counts'][_0x2a8ead(0x1d5)][_0x2a8ead(0x1d6)]+_0x376a6e[_0x2a8ead(0x1dd)][_0x2a8ead(0x1c7)][_0x2a8ead(0x1d6)]+_0x376a6e[_0x2a8ead(0x1dd)][_0x2a8ead(0x1e8)][_0x2a8ead(0x1d6)]+_0x376a6e[_0x2a8ead(0x1dd)][_0x2a8ead(0x1d0)][_0x2a8ead(0x1d6)]+_0x376a6e['counts'][_0x2a8ead(0x1b6)]['unchanged']+_0x376a6e[_0x2a8ead(0x1dd)][_0x2a8ead(0x1ef)][_0x2a8ead(0x1d6)];console[_0x2a8ead(0x18a)]('\x0aPull\x20summary\x20for\x20\x27'+_0x376a6e[_0x2a8ead(0x1c5)]+'\x27:'),console[_0x2a8ead(0x18a)]('\x20\x20'+a4_0x354290[_0x2a8ead(0x16a)]('+\x20'+_0x4b9bb1+_0x2a8ead(0x173))+_0x2a8ead(0x1c3)+a4_0x354290[_0x2a8ead(0x1b0)]('~\x20'+_0x511862+_0x2a8ead(0x15a))+'\x20|\x20'+a4_0x354290['dim']('=\x20'+_0x2330ba+_0x2a8ead(0x174))),console[_0x2a8ead(0x18a)](_0x2a8ead(0x1bb)+formatCountSummary(_0x376a6e['counts']['agents'])),console[_0x2a8ead(0x18a)](_0x2a8ead(0x1f7)+formatCountSummary(_0x376a6e[_0x2a8ead(0x1dd)][_0x2a8ead(0x1d5)])),console[_0x2a8ead(0x18a)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x376a6e['counts'][_0x2a8ead(0x1c7)])),console['log'](_0x2a8ead(0x1ee)+formatCountSummary(_0x376a6e['counts'][_0x2a8ead(0x1e8)])),console[_0x2a8ead(0x18a)](_0x2a8ead(0x14e)+formatCountSummary(_0x376a6e[_0x2a8ead(0x1dd)][_0x2a8ead(0x1d0)]));const _0x356943=_0x376a6e['counts'][_0x2a8ead(0x1b6)][_0x2a8ead(0x1bf)]>0x0||_0x376a6e[_0x2a8ead(0x1dd)][_0x2a8ead(0x1ef)][_0x2a8ead(0x1bf)]>0x0;_0x356943&&(console[_0x2a8ead(0x18a)](_0x2a8ead(0x18b)+formatCountSummary(_0x376a6e['counts']['experimentalKnowledgeBases'])),console[_0x2a8ead(0x18a)](_0x2a8ead(0x17a)+formatCountSummary(_0x376a6e[_0x2a8ead(0x1dd)][_0x2a8ead(0x1ef)])));console[_0x2a8ead(0x18a)](_0x2a8ead(0x1cf)+a4_0x354290['cyan'](_0x376a6e[_0x2a8ead(0x1a9)])),displayDiffs(_0x376a6e[_0x2a8ead(0x199)],_0x376a6e['knowledgeBases'],_0x376a6e[_0x2a8ead(0x1c7)],_0x376a6e[_0x2a8ead(0x1e8)],_0x376a6e[_0x2a8ead(0x1d0)],_0x376a6e[_0x2a8ead(0x1b6)],_0x376a6e['experimentalArtifacts']);if(_0x47d1cc)return console['log'](a4_0x354290[_0x2a8ead(0x1b0)](_0x2a8ead(0x149))),0x0;if(_0x4b9bb1===0x0&&_0x511862===0x0)return console['log'](a4_0x354290[_0x2a8ead(0x16a)](_0x2a8ead(0x19d))),saveSessionContext({'llm_project':_0x376a6e[_0x2a8ead(0x1c5)]},_0x220b20[_0x2a8ead(0x1e4)]),console[_0x2a8ead(0x18a)](a4_0x354290[_0x2a8ead(0x16a)](_0x2a8ead(0x1cc)+a4_0x354290[_0x2a8ead(0x195)]('llm_project')+_0x2a8ead(0x1b4)+a4_0x354290[_0x2a8ead(0x1d2)](_0x376a6e[_0x2a8ead(0x1c5)]))),0x0;if(!_0x339475&&!_0x49d913){if(!isInteractive())return console[_0x2a8ead(0x1c6)](a4_0x354290[_0x2a8ead(0x17b)](_0x2a8ead(0x1f5)),_0x2a8ead(0x1f0)),console[_0x2a8ead(0x1c6)](a4_0x354290[_0x2a8ead(0x195)](_0x2a8ead(0x1b5))),0x1;const _0x1b3609=await confirmKey(_0x2a8ead(0x177)+(_0x4b9bb1+_0x511862)+_0x2a8ead(0x148));if(!_0x1b3609)return console[_0x2a8ead(0x18a)](a4_0x354290['yellow'](_0x2a8ead(0x168)),_0x2a8ead(0x193)),0x1;}const {data:_0x3270c6}=await withSpinner(_0x2a8ead(0x14a),()=>_0x4267f8[_0x2a8ead(0x15d)][_0x2a8ead(0x179)](_0xde9b12,_0xd4fb27,{'force':_0x49d913}));return console[_0x2a8ead(0x18a)](a4_0x354290[_0x2a8ead(0x16a)](_0x2a8ead(0x163)+(_0x4b9bb1+_0x511862)+'\x20files\x20to\x20'+_0x3270c6[_0x2a8ead(0x1a9)])),saveSessionContext({'llm_project':_0x3270c6[_0x2a8ead(0x1c5)]},_0x220b20[_0x2a8ead(0x1e4)]),console[_0x2a8ead(0x18a)](a4_0x354290['green'](_0x2a8ead(0x1cc)+a4_0x354290[_0x2a8ead(0x195)](_0x2a8ead(0x172))+'\x20=\x20'+a4_0x354290['cyan'](_0x3270c6[_0x2a8ead(0x1c5)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x3146ec(0x1e1)]='agent:clone';[a4_0x3146ec(0x1c0)]=a4_0x3146ec(0x1b8);async[a4_0x3146ec(0x17c)](_0x36cbdf){const _0xbff662=a4_0x3146ec,{options:_0x47475c,args:_0x20cf6c,tdx:_0x4a2c79}=_0x36cbdf,_0x4591cb=_0x20cf6c[0x0],_0x1d0a34=_0x47475c[_0xbff662(0x1e1)],_0x2668bf=_0x47475c[_0xbff662(0x16c)],_0x426f11=_0x47475c[_0xbff662(0x178)],_0x5334fd=_0x47475c[_0xbff662(0x1ba)],_0x3b04aa=_0x47475c[_0xbff662(0x1c4)];let _0x3e3d8e;const _0x5bb188=findAgentConfigPath(process[_0xbff662(0x1a7)]());if(_0x4591cb){const _0x4fa0d9=a4_0x41daea['join'](_0x4591cb,_0xbff662(0x188));existsSync(_0x4fa0d9)?(_0x3e3d8e=_0x4591cb,console[_0xbff662(0x18a)](a4_0x354290[_0xbff662(0x195)](_0xbff662(0x1bc)+_0x4591cb))):_0x3e3d8e=_0x4591cb;}else{if(_0x5bb188)_0x3e3d8e=a4_0x41daea[_0xbff662(0x1bd)](_0x5bb188),console[_0xbff662(0x18a)](a4_0x354290['dim'](_0xbff662(0x1f1)+_0x3e3d8e));else{if(_0x3b04aa){const _0x3c4268=sanitizeForFilesystem(_0x3b04aa);let _0xc1933a=_0x3c4268,_0x293119=a4_0x41daea['join'](process['cwd'](),_0xbff662(0x199),_0x3c4268,_0xbff662(0x188));if(!existsSync(_0x293119)){const _0x7eca6d=normalizeName(_0x3b04aa),_0x16a848=a4_0x41daea[_0xbff662(0x17f)](process[_0xbff662(0x1a7)](),_0xbff662(0x199),_0x7eca6d,_0xbff662(0x188));existsSync(_0x16a848)&&(_0xc1933a=_0x7eca6d,_0x293119=_0x16a848);}if(existsSync(_0x293119))_0x3e3d8e=a4_0x41daea['dirname'](_0x293119),console[_0xbff662(0x18a)](a4_0x354290[_0xbff662(0x195)]('Using\x20local\x20project:\x20'+_0x3e3d8e));else{const _0x4acc9d=_0x47475c[_0xbff662(0x185)];if(_0x4acc9d)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0xbff662(0x1c8)+_0x3b04aa+'\x22\x20to\x20a\x20different\x20profile',undefined,{'helpText':_0xbff662(0x1df)+_0xbff662(0x1c9)+('\x20\x20tdx\x20agent\x20pull\x20'+_0x3b04aa+'\x0a')+(_0xbff662(0x165)+_0xc1933a+_0xbff662(0x1ce)+(_0x1d0a34||_0xbff662(0x1c1))+_0xbff662(0x1be)+_0x4acc9d)});_0x3e3d8e=_0x3b04aa,console['log'](a4_0x354290[_0xbff662(0x195)](_0xbff662(0x145)+_0x3b04aa));}}}}if(!_0x3e3d8e)return console[_0xbff662(0x18a)](a4_0x354290[_0xbff662(0x1b0)](_0xbff662(0x16d))),console[_0xbff662(0x18a)](_0xbff662(0x1a4)),console[_0xbff662(0x18a)](_0xbff662(0x16f)),console[_0xbff662(0x18a)](_0xbff662(0x1b7)),console[_0xbff662(0x18a)](_0xbff662(0x14f)),0x1;if(!_0x1d0a34)throw new SDKError(ErrorCode[_0xbff662(0x1a8)],'New\x20project\x20name\x20is\x20required',undefined,{'helpText':_0xbff662(0x1da)});if(!_0x426f11&&!_0x2668bf){if(!isInteractive())return console[_0xbff662(0x1c6)](a4_0x354290['red'](_0xbff662(0x1f5)),_0xbff662(0x1f0)),console[_0xbff662(0x1c6)](a4_0x354290[_0xbff662(0x195)](_0xbff662(0x1b5))),0x1;const _0x52187c=await confirmKey(_0xbff662(0x17e)+_0x3e3d8e+_0xbff662(0x18e)+_0x1d0a34+'\x22?');if(!_0x52187c)return console['log'](a4_0x354290[_0xbff662(0x1b0)]('Cancelled')),0x1;}const {data:_0x583f5e}=await withSpinner(_0xbff662(0x1eb)+_0x3e3d8e+_0xbff662(0x1cd)+_0x1d0a34+_0xbff662(0x164),()=>_0x4a2c79[_0xbff662(0x15d)][_0xbff662(0x16e)](_0x3e3d8e,_0x1d0a34,{'dryRun':_0x2668bf}));if(_0x2668bf){console[_0xbff662(0x18a)](a4_0x354290[_0xbff662(0x1b0)](_0xbff662(0x1b1))),console[_0xbff662(0x18a)](_0xbff662(0x1b9)+_0x583f5e[_0xbff662(0x1d1)]),console[_0xbff662(0x18a)](_0xbff662(0x170)+_0x1d0a34),console[_0xbff662(0x18a)]('Would\x20clone:'),console['log']('\x20\x20Agents:\x20'+_0x583f5e[_0xbff662(0x1dd)][_0xbff662(0x199)][_0xbff662(0x151)]),console[_0xbff662(0x18a)](_0xbff662(0x1f7)+_0x583f5e[_0xbff662(0x1dd)][_0xbff662(0x1d5)]['created']),console[_0xbff662(0x18a)](_0xbff662(0x1ee)+_0x583f5e['counts'][_0xbff662(0x1e8)][_0xbff662(0x151)]);const _0x300473=_0x583f5e[_0xbff662(0x1dd)][_0xbff662(0x1b6)][_0xbff662(0x151)]>0x0||_0x583f5e[_0xbff662(0x1dd)][_0xbff662(0x1ef)]['created']>0x0;return _0x300473&&(console[_0xbff662(0x18a)](_0xbff662(0x18b)+_0x583f5e[_0xbff662(0x1dd)][_0xbff662(0x1b6)]['created']),console[_0xbff662(0x18a)](_0xbff662(0x17a)+_0x583f5e[_0xbff662(0x1dd)][_0xbff662(0x1ef)][_0xbff662(0x151)])),0x0;}const _0x36fcb0=_0x583f5e['counts'][_0xbff662(0x199)]['errors']>0x0||_0x583f5e[_0xbff662(0x1dd)][_0xbff662(0x1d5)]['errors']>0x0||_0x583f5e['counts'][_0xbff662(0x1e8)][_0xbff662(0x16b)]>0x0||_0x583f5e[_0xbff662(0x1dd)][_0xbff662(0x1b6)][_0xbff662(0x16b)]>0x0||_0x583f5e['counts'][_0xbff662(0x1ef)][_0xbff662(0x16b)]>0x0;_0x36fcb0?console[_0xbff662(0x18a)](a4_0x354290['yellow']('Project\x20cloned\x20with\x20errors')):console[_0xbff662(0x18a)](a4_0x354290[_0xbff662(0x16a)]('Project\x20cloned\x20successfully'));console[_0xbff662(0x18a)]('Source:\x20'+_0x583f5e['sourceProjectName']),console['log'](_0xbff662(0x170)+_0x583f5e[_0xbff662(0x1ec)]),console[_0xbff662(0x18a)](_0xbff662(0x143)+_0x583f5e['newProjectId']),console[_0xbff662(0x18a)](),console[_0xbff662(0x18a)](_0xbff662(0x1ed)),console[_0xbff662(0x18a)](_0xbff662(0x1bb)+formatCountSummary(_0x583f5e[_0xbff662(0x1dd)][_0xbff662(0x199)])),console[_0xbff662(0x18a)](_0xbff662(0x1f7)+formatCountSummary(_0x583f5e[_0xbff662(0x1dd)][_0xbff662(0x1d5)])),console['log'](_0xbff662(0x1ee)+formatCountSummary(_0x583f5e[_0xbff662(0x1dd)][_0xbff662(0x1e8)])),console[_0xbff662(0x18a)](_0xbff662(0x14e)+formatCountSummary(_0x583f5e[_0xbff662(0x1dd)][_0xbff662(0x1d0)]));const _0x1009ad=_0x583f5e[_0xbff662(0x1dd)][_0xbff662(0x1b6)]['created']>0x0||_0x583f5e[_0xbff662(0x1dd)][_0xbff662(0x1b6)]['updated']>0x0||_0x583f5e[_0xbff662(0x1dd)]['experimentalKnowledgeBases'][_0xbff662(0x1d6)]>0x0||_0x583f5e['counts']['experimentalArtifacts'][_0xbff662(0x151)]>0x0||_0x583f5e[_0xbff662(0x1dd)][_0xbff662(0x1ef)][_0xbff662(0x183)]>0x0||_0x583f5e['counts']['experimentalArtifacts'][_0xbff662(0x1d6)]>0x0;_0x1009ad&&(console[_0xbff662(0x18a)](_0xbff662(0x18b)+formatCountSummary(_0x583f5e['counts'][_0xbff662(0x1b6)])),console[_0xbff662(0x18a)](_0xbff662(0x17a)+formatCountSummary(_0x583f5e[_0xbff662(0x1dd)]['experimentalArtifacts'])));if(_0x36fcb0){console[_0xbff662(0x18a)](),console['log'](a4_0x354290['red'](_0xbff662(0x1d3)));for(const _0x908772 of _0x583f5e['agents']){_0x908772['action']==='error'&&console[_0xbff662(0x18a)](a4_0x354290['red'](_0xbff662(0x154)+_0x908772[_0xbff662(0x1f4)]+_0xbff662(0x1db)+_0x908772[_0xbff662(0x1c6)]));}for(const _0x308bac of _0x583f5e[_0xbff662(0x1d5)]){_0x308bac[_0xbff662(0x19e)]===_0xbff662(0x1c6)&&console[_0xbff662(0x18a)](a4_0x354290['red'](_0xbff662(0x1e6)+_0x308bac[_0xbff662(0x1e1)]+_0xbff662(0x1db)+_0x308bac[_0xbff662(0x1c6)]));}for(const _0x2a7ba2 of _0x583f5e[_0xbff662(0x1e8)]){_0x2a7ba2['action']===_0xbff662(0x1c6)&&console['log'](a4_0x354290[_0xbff662(0x17b)]('\x20\x20Prompt\x20\x22'+_0x2a7ba2[_0xbff662(0x1e1)]+'\x22:\x20'+_0x2a7ba2[_0xbff662(0x1c6)]));}for(const _0x1e66b0 of _0x583f5e['integrations']){_0x1e66b0[_0xbff662(0x19e)]===_0xbff662(0x1c6)&&console['log'](a4_0x354290['red']('\x20\x20Integration\x20\x22'+_0x1e66b0[_0xbff662(0x1e1)]+_0xbff662(0x1db)+_0x1e66b0[_0xbff662(0x1c6)]));}for(const _0x42d3fa of _0x583f5e[_0xbff662(0x1b6)]){_0x42d3fa[_0xbff662(0x19e)]===_0xbff662(0x1c6)&&console['log'](a4_0x354290[_0xbff662(0x17b)]('\x20\x20Experimental\x20Knowledge\x20Base\x20\x22'+_0x42d3fa[_0xbff662(0x1e1)]+'\x22:\x20'+_0x42d3fa[_0xbff662(0x1c6)]));}for(const _0xc48b5c of _0x583f5e[_0xbff662(0x1ef)]){_0xc48b5c[_0xbff662(0x19e)]===_0xbff662(0x1c6)&&console['log'](a4_0x354290['red'](_0xbff662(0x18f)+_0xc48b5c[_0xbff662(0x1e1)]+_0xbff662(0x1db)+_0xc48b5c[_0xbff662(0x1c6)]));}return 0x1;}console[_0xbff662(0x18a)]();const _0x347245=getLLMProjectUrl(_0x5334fd,_0x583f5e[_0xbff662(0x1aa)]);return console['log'](_0xbff662(0x198)+a4_0x354290['cyan'](_0x347245)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x3146ec(0x1e1)]='agent:push';[a4_0x3146ec(0x1c0)]=a4_0x3146ec(0x1e0);async[a4_0x3146ec(0x17c)](_0x20843f){const _0x4668c5=a4_0x3146ec,{options:_0x1bc55a,args:_0x5e1027,tdx:_0x5462e8}=_0x20843f;let _0x581feb=_0x5e1027[0x0]||process[_0x4668c5(0x1a7)]();const _0xcb81a0=_0x1bc55a[_0x4668c5(0x16c)],_0x10117a=_0x1bc55a[_0x4668c5(0x1d4)],_0x53d8d8=_0x1bc55a[_0x4668c5(0x178)],_0x4db10f=_0x1bc55a[_0x4668c5(0x1ba)],_0x5d4a23=a4_0x41daea['join'](_0x581feb,_0x4668c5(0x197)),_0x533235=existsSync(_0x5d4a23);if(_0x533235){const {data:_0x2695a8}=await withSpinner(_0x4668c5(0x1cb)+_0x581feb+_0x4668c5(0x164),()=>_0x5462e8[_0x4668c5(0x15d)][_0x4668c5(0x14d)](_0x581feb,{'dryRun':_0xcb81a0,'force':_0x10117a}));if(_0xcb81a0)return console[_0x4668c5(0x18a)](a4_0x354290[_0x4668c5(0x1b0)](_0x4668c5(0x1b1))),console[_0x4668c5(0x18a)](_0x4668c5(0x186)+_0x2695a8[_0x4668c5(0x1f4)]),0x0;if(_0x2695a8[_0x4668c5(0x19e)]==='error')return console[_0x4668c5(0x18a)](a4_0x354290[_0x4668c5(0x17b)](_0x4668c5(0x1e2)+_0x2695a8[_0x4668c5(0x1c6)])),0x1;console[_0x4668c5(0x18a)](a4_0x354290[_0x4668c5(0x16a)]('Agent\x20'+_0x2695a8[_0x4668c5(0x19e)]+'\x20successfully')),console[_0x4668c5(0x18a)](_0x4668c5(0x14c)+_0x2695a8[_0x4668c5(0x1f4)]);if(_0x2695a8['agentId']&&_0x2695a8[_0x4668c5(0x1d7)]){const _0x491c5a=getLLMAgentChatUrl(_0x4db10f,_0x2695a8[_0x4668c5(0x1d7)],_0x2695a8[_0x4668c5(0x169)]);console[_0x4668c5(0x18a)]('Chat:\x20'+a4_0x354290[_0x4668c5(0x1d2)](_0x491c5a));}return 0x0;}const _0x1c8d10=_0x1bc55a['llmProject'],_0x194a0d=resolveProjectFromContext(_0x581feb,_0x1c8d10);if(_0x194a0d[_0x4668c5(0x1e5)])_0x581feb=_0x194a0d[_0x4668c5(0x14b)],_0x194a0d['source']===_0x4668c5(0x152)&&console[_0x4668c5(0x18a)](a4_0x354290[_0x4668c5(0x195)](_0x4668c5(0x162)+_0x581feb));else{let _0x27b8b5=_0x4668c5(0x1a6);_0x194a0d[_0x4668c5(0x176)]===_0x4668c5(0x1f2)&&(_0x27b8b5=_0x194a0d['message']+_0x4668c5(0x18c)+_0x194a0d[_0x4668c5(0x1c4)]+_0x4668c5(0x184));throw new SDKError(ErrorCode[_0x4668c5(0x144)],_0x194a0d['reason']===_0x4668c5(0x1e9)?_0x194a0d['message']:_0x4668c5(0x1a2)+_0x581feb,undefined,{'helpText':_0x27b8b5});}const {data:_0x2a9186}=await withSpinner(_0x4668c5(0x166),()=>_0x5462e8[_0x4668c5(0x15d)][_0x4668c5(0x1ea)](_0x581feb,{'dryRun':!![]})),_0x4c92ec=_0x2a9186[_0x4668c5(0x1dd)][_0x4668c5(0x199)][_0x4668c5(0x16b)]>0x0;if(_0x4c92ec){console[_0x4668c5(0x18a)](a4_0x354290[_0x4668c5(0x17b)](_0x4668c5(0x1a5)));for(const _0x12fc8a of _0x2a9186[_0x4668c5(0x199)]){_0x12fc8a[_0x4668c5(0x19e)]==='error'&&console[_0x4668c5(0x18a)](a4_0x354290[_0x4668c5(0x17b)](_0x4668c5(0x154)+_0x12fc8a[_0x4668c5(0x1f4)]+_0x4668c5(0x1db)+_0x12fc8a[_0x4668c5(0x1c6)]));}return 0x1;}const _0x246fba=_0x2a9186['counts'][_0x4668c5(0x199)][_0x4668c5(0x151)]+_0x2a9186[_0x4668c5(0x1dd)][_0x4668c5(0x1d5)][_0x4668c5(0x151)]+_0x2a9186[_0x4668c5(0x1dd)]['textKnowledgeBases'][_0x4668c5(0x151)]+_0x2a9186['counts'][_0x4668c5(0x1e8)][_0x4668c5(0x151)]+_0x2a9186[_0x4668c5(0x1dd)][_0x4668c5(0x1d0)][_0x4668c5(0x151)]+_0x2a9186[_0x4668c5(0x1dd)][_0x4668c5(0x1b6)][_0x4668c5(0x151)]+_0x2a9186[_0x4668c5(0x1dd)][_0x4668c5(0x1ef)][_0x4668c5(0x151)],_0x289197=_0x2a9186[_0x4668c5(0x1dd)]['agents'][_0x4668c5(0x183)]+_0x2a9186[_0x4668c5(0x1dd)][_0x4668c5(0x1d5)][_0x4668c5(0x183)]+_0x2a9186[_0x4668c5(0x1dd)]['textKnowledgeBases'][_0x4668c5(0x183)]+_0x2a9186['counts']['prompts'][_0x4668c5(0x183)]+_0x2a9186[_0x4668c5(0x1dd)]['integrations'][_0x4668c5(0x183)]+_0x2a9186[_0x4668c5(0x1dd)]['experimentalKnowledgeBases']['updated']+_0x2a9186[_0x4668c5(0x1dd)][_0x4668c5(0x1ef)][_0x4668c5(0x183)],_0x340c52=_0x2a9186[_0x4668c5(0x1dd)][_0x4668c5(0x199)][_0x4668c5(0x1d6)]+_0x2a9186['counts'][_0x4668c5(0x1d5)][_0x4668c5(0x1d6)]+_0x2a9186[_0x4668c5(0x1dd)]['textKnowledgeBases']['unchanged']+_0x2a9186['counts']['prompts'][_0x4668c5(0x1d6)]+_0x2a9186[_0x4668c5(0x1dd)][_0x4668c5(0x1d0)][_0x4668c5(0x1d6)]+_0x2a9186[_0x4668c5(0x1dd)][_0x4668c5(0x1b6)]['unchanged']+_0x2a9186[_0x4668c5(0x1dd)][_0x4668c5(0x1ef)]['unchanged'];console[_0x4668c5(0x18a)]('\x0aPush\x20summary\x20for\x20\x27'+_0x2a9186[_0x4668c5(0x1c5)]+'\x27:'),console[_0x4668c5(0x18a)]('\x20\x20'+a4_0x354290[_0x4668c5(0x16a)]('+\x20'+_0x246fba+_0x4668c5(0x173))+_0x4668c5(0x1c3)+a4_0x354290['yellow']('~\x20'+_0x289197+_0x4668c5(0x15a))+_0x4668c5(0x1c3)+a4_0x354290[_0x4668c5(0x195)]('=\x20'+_0x340c52+_0x4668c5(0x174))),console[_0x4668c5(0x18a)](_0x4668c5(0x1bb)+formatCountSummary(_0x2a9186['counts'][_0x4668c5(0x199)])),console[_0x4668c5(0x18a)](_0x4668c5(0x1f7)+formatCountSummary(_0x2a9186['counts'][_0x4668c5(0x1d5)])),console[_0x4668c5(0x18a)](_0x4668c5(0x19a)+formatCountSummary(_0x2a9186[_0x4668c5(0x1dd)]['textKnowledgeBases'])),console[_0x4668c5(0x18a)](_0x4668c5(0x1ee)+formatCountSummary(_0x2a9186['counts']['prompts'])),console[_0x4668c5(0x18a)](_0x4668c5(0x14e)+formatCountSummary(_0x2a9186['counts'][_0x4668c5(0x1d0)]));const _0x2f6b74=_0x2a9186['counts'][_0x4668c5(0x1b6)][_0x4668c5(0x151)]>0x0||_0x2a9186['counts'][_0x4668c5(0x1b6)][_0x4668c5(0x183)]>0x0||_0x2a9186[_0x4668c5(0x1dd)]['experimentalKnowledgeBases'][_0x4668c5(0x1d6)]>0x0||_0x2a9186['counts'][_0x4668c5(0x1ef)][_0x4668c5(0x151)]>0x0||_0x2a9186[_0x4668c5(0x1dd)][_0x4668c5(0x1ef)][_0x4668c5(0x183)]>0x0||_0x2a9186[_0x4668c5(0x1dd)]['experimentalArtifacts'][_0x4668c5(0x1d6)]>0x0;_0x2f6b74&&(console[_0x4668c5(0x18a)](_0x4668c5(0x18b)+formatCountSummary(_0x2a9186[_0x4668c5(0x1dd)][_0x4668c5(0x1b6)])),console[_0x4668c5(0x18a)](_0x4668c5(0x17a)+formatCountSummary(_0x2a9186['counts'][_0x4668c5(0x1ef)])));console['log'](_0x4668c5(0x194)+a4_0x354290[_0x4668c5(0x1d2)](_0x581feb)),displayDiffs(_0x2a9186['agents'],_0x2a9186[_0x4668c5(0x1d5)],_0x2a9186[_0x4668c5(0x1c7)],_0x2a9186['prompts'],_0x2a9186[_0x4668c5(0x1d0)],_0x2a9186[_0x4668c5(0x1b6)],_0x2a9186[_0x4668c5(0x1ef)]);if(_0xcb81a0)return console[_0x4668c5(0x18a)](a4_0x354290['yellow'](_0x4668c5(0x192))),0x0;if(_0x246fba===0x0&&_0x289197===0x0){console['log'](a4_0x354290[_0x4668c5(0x16a)](_0x4668c5(0x161)));const _0x491864=getLLMProjectUrl(_0x4db10f,_0x2a9186[_0x4668c5(0x1d7)]);return console['log']('Project:\x20'+a4_0x354290[_0x4668c5(0x1d2)](_0x491864)),0x0;}if(!_0x53d8d8&&!_0x10117a){if(!isInteractive())return console[_0x4668c5(0x1c6)](a4_0x354290[_0x4668c5(0x17b)]('\x0aError:'),_0x4668c5(0x1f0)),console['error'](a4_0x354290['dim'](_0x4668c5(0x1b5))),0x1;const _0x1fe675=await confirmKey(_0x4668c5(0x1dc)+(_0x246fba+_0x289197)+_0x4668c5(0x191));if(!_0x1fe675)return console[_0x4668c5(0x18a)](a4_0x354290[_0x4668c5(0x1b0)](_0x4668c5(0x168)),_0x4668c5(0x167)),0x1;}const {data:_0x43e87f}=await withSpinner('Pushing\x20to\x20project...',()=>_0x5462e8[_0x4668c5(0x15d)][_0x4668c5(0x1ea)](_0x581feb,{'force':_0x10117a})),_0x16711a=_0x43e87f[_0x4668c5(0x1dd)][_0x4668c5(0x199)][_0x4668c5(0x16b)]>0x0||_0x43e87f[_0x4668c5(0x1dd)]['knowledgeBases']['errors']>0x0||_0x43e87f[_0x4668c5(0x1dd)][_0x4668c5(0x1c7)][_0x4668c5(0x16b)]>0x0||_0x43e87f['counts'][_0x4668c5(0x1e8)][_0x4668c5(0x16b)]>0x0;if(_0x16711a){console[_0x4668c5(0x18a)](a4_0x354290['yellow'](_0x4668c5(0x15e))),console['log'](),console[_0x4668c5(0x18a)](a4_0x354290[_0x4668c5(0x17b)](_0x4668c5(0x1d3)));for(const _0x40fad8 of _0x43e87f[_0x4668c5(0x199)]){_0x40fad8['action']===_0x4668c5(0x1c6)&&console['log'](a4_0x354290['red'](_0x4668c5(0x154)+_0x40fad8[_0x4668c5(0x1f4)]+_0x4668c5(0x1db)+_0x40fad8['error']));}for(const _0x55ea88 of _0x43e87f['knowledgeBases']){_0x55ea88[_0x4668c5(0x19e)]===_0x4668c5(0x1c6)&&console[_0x4668c5(0x18a)](a4_0x354290[_0x4668c5(0x17b)]('\x20\x20Knowledge\x20Base\x20\x22'+_0x55ea88[_0x4668c5(0x1e1)]+'\x22:\x20'+_0x55ea88[_0x4668c5(0x1c6)]));}for(const _0x57690c of _0x43e87f[_0x4668c5(0x1c7)]){_0x57690c[_0x4668c5(0x19e)]==='error'&&console[_0x4668c5(0x18a)](a4_0x354290['red']('\x20\x20Text\x20Knowledge\x20Base\x20\x22'+_0x57690c['name']+_0x4668c5(0x1db)+_0x57690c[_0x4668c5(0x1c6)]));}for(const _0x4e82ad of _0x43e87f[_0x4668c5(0x1e8)]){_0x4e82ad['action']===_0x4668c5(0x1c6)&&console[_0x4668c5(0x18a)](a4_0x354290[_0x4668c5(0x17b)](_0x4668c5(0x19b)+_0x4e82ad['name']+_0x4668c5(0x1db)+_0x4e82ad['error']));}for(const _0x143193 of _0x43e87f[_0x4668c5(0x1d0)]){_0x143193[_0x4668c5(0x19e)]===_0x4668c5(0x1c6)&&console[_0x4668c5(0x18a)](a4_0x354290[_0x4668c5(0x17b)]('\x20\x20Integration\x20\x22'+_0x143193['name']+_0x4668c5(0x1db)+_0x143193['error']));}return 0x1;}console['log'](a4_0x354290[_0x4668c5(0x16a)]('\x0a✔\x20Pushed\x20'+(_0x246fba+_0x289197)+_0x4668c5(0x189)+_0x43e87f[_0x4668c5(0x1c5)]+'\x27'));const _0x31af81=getLLMProjectUrl(_0x4db10f,_0x43e87f[_0x4668c5(0x1d7)]);return console[_0x4668c5(0x18a)]('Project:\x20'+a4_0x354290[_0x4668c5(0x1d2)](_0x31af81)),0x0;}}
1
+ const a4_0x5e331e=a4_0x4ea7;(function(_0x17fab6,_0x45f891){const _0x35a218=a4_0x4ea7,_0x33c602=_0x17fab6();while(!![]){try{const _0x1a4069=parseInt(_0x35a218(0x172))/0x1*(-parseInt(_0x35a218(0x13e))/0x2)+-parseInt(_0x35a218(0x18b))/0x3*(parseInt(_0x35a218(0x1a2))/0x4)+parseInt(_0x35a218(0x194))/0x5*(-parseInt(_0x35a218(0x133))/0x6)+-parseInt(_0x35a218(0x171))/0x7*(parseInt(_0x35a218(0x199))/0x8)+-parseInt(_0x35a218(0x112))/0x9+parseInt(_0x35a218(0x1ab))/0xa+-parseInt(_0x35a218(0x1a7))/0xb*(-parseInt(_0x35a218(0x16a))/0xc);if(_0x1a4069===_0x45f891)break;else _0x33c602['push'](_0x33c602['shift']());}catch(_0x1b3ce5){_0x33c602['push'](_0x33c602['shift']());}}}(a4_0x24d1,0xcbfc1));import a4_0x1aedd1 from'chalk';import a4_0x2fba22 from'path';import{existsSync,readFileSync}from'fs';function a4_0x24d1(){const _0x132479=['\x20--name\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory','agentId','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','Cancelled','site','103070MtoiHo','Status:\x20','total','New\x20project:\x20','isNew','654232vuqifn','\x22...','\x0aProject\x20pushed\x20with\x20errors','Source:\x20','textKnowledgeBases','agent','Using\x20current\x20project:\x20','red','\x20\x20Knowledge\x20Bases:\x20','92uPphQm','Agent:\x20','cyan','agent:clone','Project:\x20','8195uNQwEj','profile','Summary:','outputPath','5161210RkGWlA','pullAgent','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project','projectName','\x22\x20to\x20\x22','yellow','\x22\x20to\x20a\x20different\x20profile','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','\x20\x20Text\x20Knowledge\x20Bases:\x20','repeat','new','parse','prompts','\x20resources\x20to\x20\x27','source','dryRun','green','push','Pushing\x20to\x20project...','Pulling\x20agent\x20\x22','\x0aErrors\x20found:','cwd','output','found','session','agentName','\x20\x20tdx\x20agent\x20clone\x20agents/','force','log','Errors:','\x0aWrite\x20','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','\x20new','2150271JygmNe','\x22:\x20','no_context','\x20\x20Integration\x20\x22','\x20created','\x20|\x20','Project\x20cloned\x20successfully','agents','llmProject','Would\x20push\x20agent:\x20','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','-\x20nothing\x20pushed','Dry\x20run\x20-\x20no\x20files\x20written','\x20files\x20to\x20','updated','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20\x20Agents:\x20','context','Agent\x20','\x20\x20Target:\x20','INVALID_ARGUMENT','unchanged','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Failed\x20to\x20push\x20agent:\x20','created','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','Analyzing\x20changes\x20to\x20push...','\x20successfully','\x20\x20Text\x20Knowledge\x20Base\x20\x22','dim','\x20changed','arg-dir','66ZRqPYj','\x20\x20tdx\x20agent\x20pull\x20','experimentalArtifacts','integrations','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','Using\x20project\x20from\x20context:\x20','\x20=\x20','\x20total','projectDir','\x22\x20to\x20new\x20project\x20\x22','✔\x20Context\x20set:\x20','10nJDKvV','name','no_local_folder','\x22\x20from\x20project\x20\x22','\x0aPush\x20summary\x20for\x20\x27','\x0aChanges\x20to\x20agent\x20\x27','action','\x0aError:','Dry\x20run\x20-\x20no\x20changes\x20made','gray','\x27\x20to\x20create\x20the\x20folder\x20structure.','error','\x20\x20Agent\x20\x22','Writing\x20files...','execute','newProjectName','diff','\x0aChanges\x20to\x20integration\x20\x27','\x20resources?','llm','errors','Using\x20context\x20project:\x20','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','pushAgent','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','Chat:\x20','cwd-config','\x0aChanges:','description','Output:\x20','Using\x20project:\x20','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','pullProject','cloneProject','\x20unchanged','join','Agent\x20pulled\x20successfully','knowledgeBases','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20--agent\x20<name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20context\x20project','newProjectId','hasChanges','\x0aPush\x20','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','\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)','75300BJDLtV','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','\x20\x20Prompt\x20\x22','Output\x20path:\x20','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','\x0aChanges\x20to\x20prompt\x20\x27','tdx.json','133vlXMEB','234178ldzUFr','Pushing\x20agent\x20from\x20\x22','yes','experimentalKnowledgeBases','reason','utf-8','Analyzing\x20project\x20\x22','llm_project','\x20\x20Prompts:\x20','pushProject','projectId','<new-name>','dirname','\x20\x20Integrations:\x20','message','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','counts','No\x20tdx.json\x20found\x20in\x20','-\x20no\x20files\x20written','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','outputDir','Would\x20pull\x20agent:\x20','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','\x20\x20Experimental\x20Artifacts:\x20','\x20\x20Knowledge\x20Base\x20\x22','151971lIpxYZ','sourceProjectName'];a4_0x24d1=function(){return _0x132479;};return a4_0x24d1();}import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext,resolveAgentPullArgs}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';function a4_0x4ea7(_0x13c9ed,_0x29c767){_0x13c9ed=_0x13c9ed-0x109;const _0x24d1ca=a4_0x24d1();let _0x4ea73a=_0x24d1ca[_0x13c9ed];return _0x4ea73a;}import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x42c839){const _0xf7201=a4_0x4ea7,_0x4c6dc1=[];if(_0x42c839[_0xf7201(0x196)]!==undefined)_0x4c6dc1[_0xf7201(0x1bc)](_0x42c839[_0xf7201(0x196)]+_0xf7201(0x13a));if(_0x42c839['new']!==undefined&&_0x42c839['new']>0x0)_0x4c6dc1['push'](a4_0x1aedd1['green'](_0x42c839[_0xf7201(0x1b5)]+_0xf7201(0x111)));if(_0x42c839['created']!==undefined&&_0x42c839[_0xf7201(0x12b)]>0x0)_0x4c6dc1[_0xf7201(0x1bc)](a4_0x1aedd1['green'](_0x42c839['created']+_0xf7201(0x116)));if(_0x42c839['updated']!==undefined&&_0x42c839[_0xf7201(0x120)]>0x0)_0x4c6dc1[_0xf7201(0x1bc)](a4_0x1aedd1[_0xf7201(0x1b0)](_0x42c839[_0xf7201(0x120)]+'\x20updated'));if(_0x42c839[_0xf7201(0x127)]!==undefined&&_0x42c839[_0xf7201(0x127)]>0x0)_0x4c6dc1[_0xf7201(0x1bc)](a4_0x1aedd1['gray'](_0x42c839[_0xf7201(0x127)]+'\x20unchanged'));if(_0x42c839[_0xf7201(0x152)]!==undefined&&_0x42c839['errors']>0x0)_0x4c6dc1['push'](a4_0x1aedd1['red'](_0x42c839[_0xf7201(0x152)]+'\x20errors'));return _0x4c6dc1[_0xf7201(0x161)](',\x20');}function displayDiffs(_0x25d2e6,_0x4e483c,_0x3b8502,_0x56e8ea,_0x5b012f,_0x45dfff,_0x208a65){const _0x29dc06=a4_0x4ea7;for(const _0x5ea96b of _0x25d2e6){if(_0x5ea96b[_0x29dc06(0x14e)]){const _0x29bf1a=_0x5ea96b['agentName']||_0x5ea96b[_0x29dc06(0x13f)];console['log'](_0x29dc06(0x143)+_0x29bf1a+'\x27:'),console[_0x29dc06(0x10d)]('─'[_0x29dc06(0x1b4)](0x3c)),console[_0x29dc06(0x10d)](_0x5ea96b['diff']),console[_0x29dc06(0x10d)]('─'[_0x29dc06(0x1b4)](0x3c));}}for(const _0x52cc86 of _0x4e483c){_0x52cc86[_0x29dc06(0x14e)]&&(console[_0x29dc06(0x10d)](_0x29dc06(0x188)+_0x52cc86['name']+'\x27:'),console[_0x29dc06(0x10d)]('─'[_0x29dc06(0x1b4)](0x3c)),console[_0x29dc06(0x10d)](_0x52cc86[_0x29dc06(0x14e)]),console[_0x29dc06(0x10d)]('─'['repeat'](0x3c)));}for(const _0x2e38b8 of _0x3b8502){_0x2e38b8['diff']&&(console[_0x29dc06(0x10d)](_0x29dc06(0x154)+_0x2e38b8['name']+'\x27:'),console[_0x29dc06(0x10d)]('─'[_0x29dc06(0x1b4)](0x3c)),console[_0x29dc06(0x10d)](_0x2e38b8[_0x29dc06(0x14e)]),console[_0x29dc06(0x10d)]('─'[_0x29dc06(0x1b4)](0x3c)));}for(const _0x27cefa of _0x56e8ea){_0x27cefa[_0x29dc06(0x14e)]&&(console[_0x29dc06(0x10d)](_0x29dc06(0x16f)+_0x27cefa[_0x29dc06(0x13f)]+'\x27:'),console[_0x29dc06(0x10d)]('─'['repeat'](0x3c)),console[_0x29dc06(0x10d)](_0x27cefa[_0x29dc06(0x14e)]),console[_0x29dc06(0x10d)]('─'[_0x29dc06(0x1b4)](0x3c)));}for(const _0x8537f7 of _0x5b012f){_0x8537f7[_0x29dc06(0x14e)]&&(console[_0x29dc06(0x10d)](_0x29dc06(0x14f)+_0x8537f7['name']+'\x27:'),console[_0x29dc06(0x10d)]('─'['repeat'](0x3c)),console[_0x29dc06(0x10d)](_0x8537f7['diff']),console['log']('─'[_0x29dc06(0x1b4)](0x3c)));}for(const _0x57cf97 of _0x45dfff){_0x57cf97['diff']&&(console[_0x29dc06(0x10d)](_0x29dc06(0x15d)+_0x57cf97[_0x29dc06(0x13f)]+'\x27:'),console[_0x29dc06(0x10d)]('─'[_0x29dc06(0x1b4)](0x3c)),console[_0x29dc06(0x10d)](_0x57cf97[_0x29dc06(0x14e)]),console['log']('─'[_0x29dc06(0x1b4)](0x3c)));}for(const _0x37e6b8 of _0x208a65){_0x37e6b8[_0x29dc06(0x14e)]&&(console[_0x29dc06(0x10d)]('\x0aChanges\x20to\x20experimental\x20artifact\x20\x27'+_0x37e6b8['name']+'\x27:'),console[_0x29dc06(0x10d)]('─'['repeat'](0x3c)),console[_0x29dc06(0x10d)](_0x37e6b8[_0x29dc06(0x14e)]),console[_0x29dc06(0x10d)]('─'[_0x29dc06(0x1b4)](0x3c)));}}export class AgentPullCommand extends BaseCommand{['name']='agent:pull';[a4_0x5e331e(0x15a)]=a4_0x5e331e(0x16e);async[a4_0x5e331e(0x14c)](_0x379eec){const _0x3b39b8=a4_0x5e331e,{options:_0x4c732f,args:_0x3e93ce,tdx:_0x361e69}=_0x379eec,_0x299b96=_0x3e93ce[0x0],_0x143815=_0x3e93ce[0x1],_0x23f3fd=_0x4c732f[_0x3b39b8(0x1c1)],_0x4c989d=_0x4c732f['dryRun'],_0xe37ca6=_0x4c732f[_0x3b39b8(0x10c)],_0x4567e4=_0x4c732f['yes'],_0x14313d=_0x4c732f['llmProject'],_0x23d825=_0x4c732f[_0x3b39b8(0x19e)];let _0x2274fd;if(_0x299b96){const _0x43e48c=a4_0x2fba22[_0x3b39b8(0x161)](_0x299b96,'tdx.json');if(existsSync(_0x43e48c))try{const _0x299081=JSON[_0x3b39b8(0x1b6)](readFileSync(_0x43e48c,_0x3b39b8(0x177)));_0x299081[_0x3b39b8(0x179)]&&(_0x2274fd={'llm_project':_0x299081[_0x3b39b8(0x179)]});}catch{}}const _0x2c7bd8=findAgentConfigPath(process['cwd']());let _0x30fadd;if(_0x2c7bd8)try{const _0x1385f1=JSON['parse'](readFileSync(_0x2c7bd8,_0x3b39b8(0x177)));_0x1385f1[_0x3b39b8(0x179)]&&(_0x30fadd={'llm_project':_0x1385f1['llm_project']});}catch{}const _0x2668bc=resolveAgentPullArgs({'arg':_0x299b96,'agentNameArg':_0x143815,'agentFlag':_0x23d825,'contextProject':_0x14313d,'argDirConfig':_0x2274fd,'cwdConfigPath':_0x2c7bd8||undefined,'cwdConfig':_0x30fadd}),{projectNameOrId:_0x487e67,targetAgentName:_0x2a4d4c,existingOutputDir:_0x207665,source:_0xbdf84b}=_0x2668bc;if(_0xbdf84b===_0x3b39b8(0x132))console[_0x3b39b8(0x10d)](a4_0x1aedd1[_0x3b39b8(0x130)]('Using\x20project\x20from\x20'+a4_0x2fba22[_0x3b39b8(0x161)](_0x299b96,_0x3b39b8(0x170))+':\x20'+_0x487e67));else{if(_0xbdf84b===_0x3b39b8(0x158))console[_0x3b39b8(0x10d)](a4_0x1aedd1[_0x3b39b8(0x130)]('Using\x20project:\x20'+_0x487e67));else _0xbdf84b===_0x3b39b8(0x123)&&console[_0x3b39b8(0x10d)](a4_0x1aedd1[_0x3b39b8(0x130)](_0x3b39b8(0x138)+_0x487e67));}if(!_0x487e67)return _0x23d825?(console[_0x3b39b8(0x10d)](a4_0x1aedd1[_0x3b39b8(0x1b0)]('The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a')),console[_0x3b39b8(0x10d)](_0x3b39b8(0x16b)),console[_0x3b39b8(0x10d)](_0x3b39b8(0x11c))):(console['log'](a4_0x1aedd1[_0x3b39b8(0x1b0)](_0x3b39b8(0x137))),console[_0x3b39b8(0x10d)]('Usage:\x20tdx\x20agent\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20project\x20(requires\x20context\x20or\x20tdx.json)'),console[_0x3b39b8(0x10d)](_0x3b39b8(0x1ad)),console[_0x3b39b8(0x10d)](_0x3b39b8(0x18e)),console[_0x3b39b8(0x10d)](_0x3b39b8(0x164)),console[_0x3b39b8(0x10d)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20project')),0x1;if(_0x2a4d4c){const {data:_0x282b04}=await withSpinner(_0x3b39b8(0x1be)+_0x2a4d4c+_0x3b39b8(0x141)+_0x487e67+_0x3b39b8(0x19a),()=>_0x361e69[_0x3b39b8(0x151)][_0x3b39b8(0x1ac)](_0x487e67,_0x2a4d4c,_0x23f3fd,{'dryRun':_0x4c989d,'force':_0xe37ca6}));if(_0x4c989d)return console[_0x3b39b8(0x10d)](a4_0x1aedd1[_0x3b39b8(0x1b0)](_0x3b39b8(0x11e))),console['log'](_0x3b39b8(0x187)+_0x282b04['agentName']),console[_0x3b39b8(0x10d)](_0x3b39b8(0x16d)+_0x282b04[_0x3b39b8(0x1aa)]),_0x282b04[_0x3b39b8(0x14e)]&&(console[_0x3b39b8(0x10d)](_0x3b39b8(0x159)),console['log']('─'[_0x3b39b8(0x1b4)](0x3c)),console['log'](_0x282b04[_0x3b39b8(0x14e)]),console[_0x3b39b8(0x10d)]('─'[_0x3b39b8(0x1b4)](0x3c))),0x0;return console['log'](a4_0x1aedd1[_0x3b39b8(0x1bb)](_0x3b39b8(0x162))),console[_0x3b39b8(0x10d)](_0x3b39b8(0x1a3)+_0x282b04[_0x3b39b8(0x10a)]),console[_0x3b39b8(0x10d)](_0x3b39b8(0x15b)+_0x282b04[_0x3b39b8(0x1aa)]),console[_0x3b39b8(0x10d)](_0x3b39b8(0x195)+(_0x282b04[_0x3b39b8(0x198)]?a4_0x1aedd1['green'](_0x3b39b8(0x1b5)):_0x282b04[_0x3b39b8(0x166)]?a4_0x1aedd1['yellow'](_0x3b39b8(0x120)):a4_0x1aedd1[_0x3b39b8(0x147)](_0x3b39b8(0x127)))),0x0;}const _0x16f5ca=_0x207665||_0x23f3fd,{data:_0x5aceb8}=await withSpinner(_0x3b39b8(0x178)+_0x487e67+_0x3b39b8(0x19a),()=>_0x361e69['llm'][_0x3b39b8(0x15e)](_0x487e67,_0x16f5ca,{'dryRun':!![]})),_0x5545ff=_0x5aceb8[_0x3b39b8(0x182)][_0x3b39b8(0x119)][_0x3b39b8(0x1b5)]+_0x5aceb8[_0x3b39b8(0x182)][_0x3b39b8(0x163)][_0x3b39b8(0x1b5)]+_0x5aceb8[_0x3b39b8(0x182)]['textKnowledgeBases'][_0x3b39b8(0x1b5)]+_0x5aceb8['counts'][_0x3b39b8(0x1b7)][_0x3b39b8(0x1b5)]+_0x5aceb8[_0x3b39b8(0x182)]['integrations'][_0x3b39b8(0x1b5)]+_0x5aceb8[_0x3b39b8(0x182)][_0x3b39b8(0x175)]['new']+_0x5aceb8[_0x3b39b8(0x182)][_0x3b39b8(0x135)][_0x3b39b8(0x1b5)],_0x826ee8=_0x5aceb8[_0x3b39b8(0x182)][_0x3b39b8(0x119)]['updated']+_0x5aceb8[_0x3b39b8(0x182)][_0x3b39b8(0x163)][_0x3b39b8(0x120)]+_0x5aceb8[_0x3b39b8(0x182)][_0x3b39b8(0x19d)]['updated']+_0x5aceb8[_0x3b39b8(0x182)][_0x3b39b8(0x1b7)][_0x3b39b8(0x120)]+_0x5aceb8['counts'][_0x3b39b8(0x136)][_0x3b39b8(0x120)]+_0x5aceb8['counts'][_0x3b39b8(0x175)][_0x3b39b8(0x120)]+_0x5aceb8[_0x3b39b8(0x182)][_0x3b39b8(0x135)][_0x3b39b8(0x120)],_0x408c2f=_0x5aceb8[_0x3b39b8(0x182)][_0x3b39b8(0x119)]['unchanged']+_0x5aceb8[_0x3b39b8(0x182)][_0x3b39b8(0x163)]['unchanged']+_0x5aceb8[_0x3b39b8(0x182)][_0x3b39b8(0x19d)]['unchanged']+_0x5aceb8[_0x3b39b8(0x182)][_0x3b39b8(0x1b7)][_0x3b39b8(0x127)]+_0x5aceb8[_0x3b39b8(0x182)][_0x3b39b8(0x136)][_0x3b39b8(0x127)]+_0x5aceb8[_0x3b39b8(0x182)][_0x3b39b8(0x175)][_0x3b39b8(0x127)]+_0x5aceb8[_0x3b39b8(0x182)][_0x3b39b8(0x135)][_0x3b39b8(0x127)];console[_0x3b39b8(0x10d)]('\x0aPull\x20summary\x20for\x20\x27'+_0x5aceb8[_0x3b39b8(0x1ae)]+'\x27:'),console[_0x3b39b8(0x10d)]('\x20\x20'+a4_0x1aedd1['green']('+\x20'+_0x5545ff+'\x20new')+_0x3b39b8(0x117)+a4_0x1aedd1['yellow']('~\x20'+_0x826ee8+_0x3b39b8(0x131))+_0x3b39b8(0x117)+a4_0x1aedd1[_0x3b39b8(0x130)]('=\x20'+_0x408c2f+_0x3b39b8(0x160))),console[_0x3b39b8(0x10d)](_0x3b39b8(0x122)+formatCountSummary(_0x5aceb8['counts'][_0x3b39b8(0x119)])),console['log'](_0x3b39b8(0x1a1)+formatCountSummary(_0x5aceb8[_0x3b39b8(0x182)][_0x3b39b8(0x163)])),console[_0x3b39b8(0x10d)](_0x3b39b8(0x1b3)+formatCountSummary(_0x5aceb8[_0x3b39b8(0x182)][_0x3b39b8(0x19d)])),console[_0x3b39b8(0x10d)](_0x3b39b8(0x17a)+formatCountSummary(_0x5aceb8['counts'][_0x3b39b8(0x1b7)])),console[_0x3b39b8(0x10d)](_0x3b39b8(0x17f)+formatCountSummary(_0x5aceb8[_0x3b39b8(0x182)][_0x3b39b8(0x136)]));const _0x395c77=_0x5aceb8['counts'][_0x3b39b8(0x175)]['total']>0x0||_0x5aceb8['counts'][_0x3b39b8(0x135)]['total']>0x0;_0x395c77&&(console[_0x3b39b8(0x10d)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x5aceb8[_0x3b39b8(0x182)][_0x3b39b8(0x175)])),console[_0x3b39b8(0x10d)](_0x3b39b8(0x189)+formatCountSummary(_0x5aceb8[_0x3b39b8(0x182)][_0x3b39b8(0x135)])));console[_0x3b39b8(0x10d)](_0x3b39b8(0x125)+a4_0x1aedd1[_0x3b39b8(0x1a4)](_0x5aceb8[_0x3b39b8(0x186)])),displayDiffs(_0x5aceb8[_0x3b39b8(0x119)],_0x5aceb8[_0x3b39b8(0x163)],_0x5aceb8['textKnowledgeBases'],_0x5aceb8[_0x3b39b8(0x1b7)],_0x5aceb8[_0x3b39b8(0x136)],_0x5aceb8[_0x3b39b8(0x175)],_0x5aceb8[_0x3b39b8(0x135)]);if(_0x4c989d)return console[_0x3b39b8(0x10d)](a4_0x1aedd1[_0x3b39b8(0x1b0)](_0x3b39b8(0x12c))),0x0;if(_0x5545ff===0x0&&_0x826ee8===0x0)return console[_0x3b39b8(0x10d)](a4_0x1aedd1[_0x3b39b8(0x1bb)]('\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'llm_project':_0x5aceb8[_0x3b39b8(0x1ae)]},_0x4c732f[_0x3b39b8(0x109)]),console['log'](a4_0x1aedd1[_0x3b39b8(0x1bb)](_0x3b39b8(0x13d)+a4_0x1aedd1[_0x3b39b8(0x130)](_0x3b39b8(0x179))+_0x3b39b8(0x139)+a4_0x1aedd1[_0x3b39b8(0x1a4)](_0x5aceb8[_0x3b39b8(0x1ae)]))),0x0;if(!_0x4567e4&&!_0xe37ca6){if(!isInteractive())return console['error'](a4_0x1aedd1[_0x3b39b8(0x1a0)](_0x3b39b8(0x145)),_0x3b39b8(0x121)),console[_0x3b39b8(0x149)](a4_0x1aedd1[_0x3b39b8(0x130)](_0x3b39b8(0x129))),0x1;const _0x379c1b=await confirmKey(_0x3b39b8(0x10f)+(_0x5545ff+_0x826ee8)+'\x20files?');if(!_0x379c1b)return console[_0x3b39b8(0x10d)](a4_0x1aedd1['yellow'](_0x3b39b8(0x192)),_0x3b39b8(0x184)),0x1;}const {data:_0x39eb83}=await withSpinner(_0x3b39b8(0x14b),()=>_0x361e69[_0x3b39b8(0x151)][_0x3b39b8(0x15e)](_0x487e67,_0x16f5ca,{'force':_0xe37ca6}));return console[_0x3b39b8(0x10d)](a4_0x1aedd1[_0x3b39b8(0x1bb)]('\x0a✔\x20Pulled\x20'+(_0x5545ff+_0x826ee8)+_0x3b39b8(0x11f)+_0x39eb83[_0x3b39b8(0x186)])),saveSessionContext({'llm_project':_0x39eb83[_0x3b39b8(0x1ae)]},_0x4c732f['session']),console['log'](a4_0x1aedd1[_0x3b39b8(0x1bb)](_0x3b39b8(0x13d)+a4_0x1aedd1[_0x3b39b8(0x130)](_0x3b39b8(0x179))+_0x3b39b8(0x139)+a4_0x1aedd1[_0x3b39b8(0x1a4)](_0x39eb83[_0x3b39b8(0x1ae)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x5e331e(0x13f)]=a4_0x5e331e(0x1a5);[a4_0x5e331e(0x15a)]='Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project';async[a4_0x5e331e(0x14c)](_0x5062c3){const _0x4b8cd4=a4_0x5e331e,{options:_0x7467a6,args:_0x349c7f,tdx:_0x2e03b5}=_0x5062c3,_0xde1a5a=_0x349c7f[0x0],_0xe0262a=_0x7467a6[_0x4b8cd4(0x13f)],_0xf80e30=_0x7467a6[_0x4b8cd4(0x1ba)],_0x3f8853=_0x7467a6['yes'],_0x449e66=_0x7467a6['site'],_0x1ad36f=_0x7467a6[_0x4b8cd4(0x11a)];let _0x3a9310;const _0x5d44c7=findAgentConfigPath(process[_0x4b8cd4(0x1c0)]());if(_0xde1a5a){const _0x18cc38=a4_0x2fba22[_0x4b8cd4(0x161)](_0xde1a5a,_0x4b8cd4(0x170));existsSync(_0x18cc38)?(_0x3a9310=_0xde1a5a,console['log'](a4_0x1aedd1['dim']('Using\x20local\x20project:\x20'+_0xde1a5a))):_0x3a9310=_0xde1a5a;}else{if(_0x5d44c7)_0x3a9310=a4_0x2fba22['dirname'](_0x5d44c7),console[_0x4b8cd4(0x10d)](a4_0x1aedd1['dim'](_0x4b8cd4(0x19f)+_0x3a9310));else{if(_0x1ad36f){const _0xca969d=sanitizeForFilesystem(_0x1ad36f);let _0x949de2=_0xca969d,_0x42c427=a4_0x2fba22[_0x4b8cd4(0x161)](process[_0x4b8cd4(0x1c0)](),_0x4b8cd4(0x119),_0xca969d,_0x4b8cd4(0x170));if(!existsSync(_0x42c427)){const _0x4d1cac=normalizeName(_0x1ad36f),_0x31e1bf=a4_0x2fba22['join'](process[_0x4b8cd4(0x1c0)](),_0x4b8cd4(0x119),_0x4d1cac,_0x4b8cd4(0x170));existsSync(_0x31e1bf)&&(_0x949de2=_0x4d1cac,_0x42c427=_0x31e1bf);}if(existsSync(_0x42c427))_0x3a9310=a4_0x2fba22[_0x4b8cd4(0x17e)](_0x42c427),console[_0x4b8cd4(0x10d)](a4_0x1aedd1['dim']('Using\x20local\x20project:\x20'+_0x3a9310));else{const _0x5df09d=_0x7467a6[_0x4b8cd4(0x1a8)];if(_0x5df09d)throw new SDKError(ErrorCode[_0x4b8cd4(0x126)],'Cannot\x20clone\x20from\x20context\x20project\x20\x22'+_0x1ad36f+_0x4b8cd4(0x1b1),undefined,{'helpText':_0x4b8cd4(0x110)+_0x4b8cd4(0x128)+(_0x4b8cd4(0x134)+_0x1ad36f+'\x0a')+(_0x4b8cd4(0x10b)+_0x949de2+_0x4b8cd4(0x18d)+(_0xe0262a||_0x4b8cd4(0x17d))+'\x20--profile\x20'+_0x5df09d)});_0x3a9310=_0x1ad36f,console[_0x4b8cd4(0x10d)](a4_0x1aedd1['dim'](_0x4b8cd4(0x153)+_0x1ad36f));}}}}if(!_0x3a9310)return console[_0x4b8cd4(0x10d)](a4_0x1aedd1[_0x4b8cd4(0x1b0)]('No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a')),console['log'](_0x4b8cd4(0x191)),console[_0x4b8cd4(0x10d)]('\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory'),console['log'](_0x4b8cd4(0x169)),console[_0x4b8cd4(0x10d)](_0x4b8cd4(0x190)),0x1;if(!_0xe0262a)throw new SDKError(ErrorCode['MISSING_ARGUMENT'],'New\x20project\x20name\x20is\x20required',undefined,{'helpText':'Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>'});if(!_0x3f8853&&!_0xf80e30){if(!isInteractive())return console['error'](a4_0x1aedd1[_0x4b8cd4(0x1a0)]('\x0aError:'),_0x4b8cd4(0x121)),console['error'](a4_0x1aedd1[_0x4b8cd4(0x130)](_0x4b8cd4(0x129))),0x1;const _0x510ba5=await confirmKey('Clone\x20\x22'+_0x3a9310+_0x4b8cd4(0x13c)+_0xe0262a+'\x22?');if(!_0x510ba5)return console['log'](a4_0x1aedd1['yellow'](_0x4b8cd4(0x192))),0x1;}const {data:_0x278aad}=await withSpinner('Cloning\x20\x22'+_0x3a9310+_0x4b8cd4(0x1af)+_0xe0262a+_0x4b8cd4(0x19a),()=>_0x2e03b5[_0x4b8cd4(0x151)][_0x4b8cd4(0x15f)](_0x3a9310,_0xe0262a,{'dryRun':_0xf80e30}));if(_0xf80e30){console['log'](a4_0x1aedd1['yellow'](_0x4b8cd4(0x146))),console[_0x4b8cd4(0x10d)](_0x4b8cd4(0x19c)+_0x278aad[_0x4b8cd4(0x18c)]),console[_0x4b8cd4(0x10d)](_0x4b8cd4(0x197)+_0xe0262a),console[_0x4b8cd4(0x10d)]('Would\x20clone:'),console[_0x4b8cd4(0x10d)](_0x4b8cd4(0x122)+_0x278aad[_0x4b8cd4(0x182)][_0x4b8cd4(0x119)][_0x4b8cd4(0x12b)]),console[_0x4b8cd4(0x10d)]('\x20\x20Knowledge\x20Bases:\x20'+_0x278aad[_0x4b8cd4(0x182)][_0x4b8cd4(0x163)][_0x4b8cd4(0x12b)]),console[_0x4b8cd4(0x10d)](_0x4b8cd4(0x17a)+_0x278aad[_0x4b8cd4(0x182)][_0x4b8cd4(0x1b7)][_0x4b8cd4(0x12b)]);const _0x2f257a=_0x278aad['counts']['experimentalKnowledgeBases'][_0x4b8cd4(0x12b)]>0x0||_0x278aad[_0x4b8cd4(0x182)]['experimentalArtifacts']['created']>0x0;return _0x2f257a&&(console[_0x4b8cd4(0x10d)](_0x4b8cd4(0x185)+_0x278aad['counts'][_0x4b8cd4(0x175)][_0x4b8cd4(0x12b)]),console[_0x4b8cd4(0x10d)](_0x4b8cd4(0x189)+_0x278aad[_0x4b8cd4(0x182)][_0x4b8cd4(0x135)][_0x4b8cd4(0x12b)])),0x0;}const _0x488e73=_0x278aad[_0x4b8cd4(0x182)][_0x4b8cd4(0x119)][_0x4b8cd4(0x152)]>0x0||_0x278aad[_0x4b8cd4(0x182)][_0x4b8cd4(0x163)][_0x4b8cd4(0x152)]>0x0||_0x278aad[_0x4b8cd4(0x182)][_0x4b8cd4(0x1b7)][_0x4b8cd4(0x152)]>0x0||_0x278aad[_0x4b8cd4(0x182)][_0x4b8cd4(0x175)][_0x4b8cd4(0x152)]>0x0||_0x278aad[_0x4b8cd4(0x182)][_0x4b8cd4(0x135)]['errors']>0x0;_0x488e73?console[_0x4b8cd4(0x10d)](a4_0x1aedd1['yellow']('Project\x20cloned\x20with\x20errors')):console[_0x4b8cd4(0x10d)](a4_0x1aedd1[_0x4b8cd4(0x1bb)](_0x4b8cd4(0x118)));console[_0x4b8cd4(0x10d)]('Source:\x20'+_0x278aad[_0x4b8cd4(0x18c)]),console['log'](_0x4b8cd4(0x197)+_0x278aad[_0x4b8cd4(0x14d)]),console[_0x4b8cd4(0x10d)]('New\x20project\x20ID:\x20'+_0x278aad['newProjectId']),console[_0x4b8cd4(0x10d)](),console[_0x4b8cd4(0x10d)](_0x4b8cd4(0x1a9)),console[_0x4b8cd4(0x10d)](_0x4b8cd4(0x122)+formatCountSummary(_0x278aad[_0x4b8cd4(0x182)][_0x4b8cd4(0x119)])),console[_0x4b8cd4(0x10d)](_0x4b8cd4(0x1a1)+formatCountSummary(_0x278aad['counts'][_0x4b8cd4(0x163)])),console['log'](_0x4b8cd4(0x17a)+formatCountSummary(_0x278aad[_0x4b8cd4(0x182)][_0x4b8cd4(0x1b7)])),console[_0x4b8cd4(0x10d)](_0x4b8cd4(0x17f)+formatCountSummary(_0x278aad['counts'][_0x4b8cd4(0x136)]));const _0xe54f1c=_0x278aad['counts'][_0x4b8cd4(0x175)][_0x4b8cd4(0x12b)]>0x0||_0x278aad[_0x4b8cd4(0x182)][_0x4b8cd4(0x175)][_0x4b8cd4(0x120)]>0x0||_0x278aad[_0x4b8cd4(0x182)][_0x4b8cd4(0x175)][_0x4b8cd4(0x127)]>0x0||_0x278aad[_0x4b8cd4(0x182)][_0x4b8cd4(0x135)]['created']>0x0||_0x278aad['counts'][_0x4b8cd4(0x135)]['updated']>0x0||_0x278aad[_0x4b8cd4(0x182)][_0x4b8cd4(0x135)][_0x4b8cd4(0x127)]>0x0;_0xe54f1c&&(console[_0x4b8cd4(0x10d)](_0x4b8cd4(0x185)+formatCountSummary(_0x278aad['counts'][_0x4b8cd4(0x175)])),console['log'](_0x4b8cd4(0x189)+formatCountSummary(_0x278aad[_0x4b8cd4(0x182)]['experimentalArtifacts'])));if(_0x488e73){console[_0x4b8cd4(0x10d)](),console['log'](a4_0x1aedd1[_0x4b8cd4(0x1a0)]('Errors:'));for(const _0x3b50e4 of _0x278aad['agents']){_0x3b50e4[_0x4b8cd4(0x144)]===_0x4b8cd4(0x149)&&console[_0x4b8cd4(0x10d)](a4_0x1aedd1[_0x4b8cd4(0x1a0)](_0x4b8cd4(0x14a)+_0x3b50e4[_0x4b8cd4(0x10a)]+_0x4b8cd4(0x113)+_0x3b50e4[_0x4b8cd4(0x149)]));}for(const _0x36b563 of _0x278aad[_0x4b8cd4(0x163)]){_0x36b563[_0x4b8cd4(0x144)]===_0x4b8cd4(0x149)&&console[_0x4b8cd4(0x10d)](a4_0x1aedd1[_0x4b8cd4(0x1a0)](_0x4b8cd4(0x18a)+_0x36b563[_0x4b8cd4(0x13f)]+_0x4b8cd4(0x113)+_0x36b563['error']));}for(const _0x1fdb4d of _0x278aad[_0x4b8cd4(0x1b7)]){_0x1fdb4d[_0x4b8cd4(0x144)]==='error'&&console[_0x4b8cd4(0x10d)](a4_0x1aedd1[_0x4b8cd4(0x1a0)](_0x4b8cd4(0x16c)+_0x1fdb4d['name']+'\x22:\x20'+_0x1fdb4d[_0x4b8cd4(0x149)]));}for(const _0x4c2227 of _0x278aad[_0x4b8cd4(0x136)]){_0x4c2227['action']==='error'&&console[_0x4b8cd4(0x10d)](a4_0x1aedd1[_0x4b8cd4(0x1a0)]('\x20\x20Integration\x20\x22'+_0x4c2227[_0x4b8cd4(0x13f)]+'\x22:\x20'+_0x4c2227[_0x4b8cd4(0x149)]));}for(const _0x4b70a4 of _0x278aad[_0x4b8cd4(0x175)]){_0x4b70a4[_0x4b8cd4(0x144)]===_0x4b8cd4(0x149)&&console[_0x4b8cd4(0x10d)](a4_0x1aedd1['red'](_0x4b8cd4(0x1b2)+_0x4b70a4['name']+_0x4b8cd4(0x113)+_0x4b70a4[_0x4b8cd4(0x149)]));}for(const _0x3e565f of _0x278aad[_0x4b8cd4(0x135)]){_0x3e565f[_0x4b8cd4(0x144)]===_0x4b8cd4(0x149)&&console[_0x4b8cd4(0x10d)](a4_0x1aedd1[_0x4b8cd4(0x1a0)]('\x20\x20Experimental\x20Artifact\x20\x22'+_0x3e565f[_0x4b8cd4(0x13f)]+_0x4b8cd4(0x113)+_0x3e565f[_0x4b8cd4(0x149)]));}return 0x1;}console['log']();const _0x548a42=getLLMProjectUrl(_0x449e66,_0x278aad[_0x4b8cd4(0x165)]);return console['log'](_0x4b8cd4(0x1a6)+a4_0x1aedd1[_0x4b8cd4(0x1a4)](_0x548a42)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x5e331e(0x13f)]='agent:push';[a4_0x5e331e(0x15a)]=a4_0x5e331e(0x156);async[a4_0x5e331e(0x14c)](_0x5083d8){const _0x4f1c26=a4_0x5e331e,{options:_0x493b0c,args:_0x203ada,tdx:_0x3ee319}=_0x5083d8;let _0x8949db=_0x203ada[0x0]||process[_0x4f1c26(0x1c0)]();const _0x48027d=_0x493b0c[_0x4f1c26(0x1ba)],_0x1ac105=_0x493b0c[_0x4f1c26(0x10c)],_0x4bc10d=_0x493b0c[_0x4f1c26(0x174)],_0x2d98f2=_0x493b0c[_0x4f1c26(0x193)],_0x36dbc2=a4_0x2fba22['join'](_0x8949db,'agent.yml'),_0x3dde9c=existsSync(_0x36dbc2);if(_0x3dde9c){const {data:_0x40ea65}=await withSpinner(_0x4f1c26(0x173)+_0x8949db+_0x4f1c26(0x19a),()=>_0x3ee319[_0x4f1c26(0x151)][_0x4f1c26(0x155)](_0x8949db,{'dryRun':_0x48027d,'force':_0x1ac105}));if(_0x48027d)return console[_0x4f1c26(0x10d)](a4_0x1aedd1[_0x4f1c26(0x1b0)](_0x4f1c26(0x146))),console[_0x4f1c26(0x10d)](_0x4f1c26(0x11b)+_0x40ea65[_0x4f1c26(0x10a)]),0x0;if(_0x40ea65[_0x4f1c26(0x144)]===_0x4f1c26(0x149))return console['log'](a4_0x1aedd1[_0x4f1c26(0x1a0)](_0x4f1c26(0x12a)+_0x40ea65[_0x4f1c26(0x149)])),0x1;console[_0x4f1c26(0x10d)](a4_0x1aedd1[_0x4f1c26(0x1bb)](_0x4f1c26(0x124)+_0x40ea65[_0x4f1c26(0x144)]+_0x4f1c26(0x12e))),console[_0x4f1c26(0x10d)]('Agent:\x20'+_0x40ea65[_0x4f1c26(0x10a)]);if(_0x40ea65[_0x4f1c26(0x18f)]&&_0x40ea65[_0x4f1c26(0x17c)]){const _0x251773=getLLMAgentChatUrl(_0x2d98f2,_0x40ea65[_0x4f1c26(0x17c)],_0x40ea65['agentId']);console[_0x4f1c26(0x10d)](_0x4f1c26(0x157)+a4_0x1aedd1[_0x4f1c26(0x1a4)](_0x251773));}return 0x0;}const _0x5e012d=_0x493b0c[_0x4f1c26(0x11a)],_0x58f0b0=resolveProjectFromContext(_0x8949db,_0x5e012d);if(_0x58f0b0[_0x4f1c26(0x1c2)])_0x8949db=_0x58f0b0[_0x4f1c26(0x13b)],_0x58f0b0[_0x4f1c26(0x1b9)]===_0x4f1c26(0x123)&&console[_0x4f1c26(0x10d)](a4_0x1aedd1[_0x4f1c26(0x130)](_0x4f1c26(0x15c)+_0x8949db));else{let _0x58f515=_0x4f1c26(0x168);_0x58f0b0['reason']===_0x4f1c26(0x140)&&(_0x58f515=_0x58f0b0[_0x4f1c26(0x180)]+'\x0aRun\x20\x27tdx\x20agent\x20pull\x20'+_0x58f0b0['llmProject']+_0x4f1c26(0x148));throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x58f0b0[_0x4f1c26(0x176)]===_0x4f1c26(0x114)?_0x58f0b0[_0x4f1c26(0x180)]:_0x4f1c26(0x183)+_0x8949db,undefined,{'helpText':_0x58f515});}const {data:_0x53d400}=await withSpinner(_0x4f1c26(0x12d),()=>_0x3ee319[_0x4f1c26(0x151)][_0x4f1c26(0x17b)](_0x8949db,{'dryRun':!![]})),_0x4f2123=_0x53d400[_0x4f1c26(0x182)][_0x4f1c26(0x119)][_0x4f1c26(0x152)]>0x0;if(_0x4f2123){console['log'](a4_0x1aedd1[_0x4f1c26(0x1a0)](_0x4f1c26(0x1bf)));for(const _0x4ef222 of _0x53d400[_0x4f1c26(0x119)]){_0x4ef222[_0x4f1c26(0x144)]===_0x4f1c26(0x149)&&console['log'](a4_0x1aedd1[_0x4f1c26(0x1a0)](_0x4f1c26(0x14a)+_0x4ef222[_0x4f1c26(0x10a)]+_0x4f1c26(0x113)+_0x4ef222[_0x4f1c26(0x149)]));}return 0x1;}const _0x5c7b6d=_0x53d400[_0x4f1c26(0x182)][_0x4f1c26(0x119)]['created']+_0x53d400[_0x4f1c26(0x182)][_0x4f1c26(0x163)][_0x4f1c26(0x12b)]+_0x53d400[_0x4f1c26(0x182)][_0x4f1c26(0x19d)]['created']+_0x53d400[_0x4f1c26(0x182)][_0x4f1c26(0x1b7)]['created']+_0x53d400[_0x4f1c26(0x182)][_0x4f1c26(0x136)]['created']+_0x53d400[_0x4f1c26(0x182)][_0x4f1c26(0x175)]['created']+_0x53d400[_0x4f1c26(0x182)]['experimentalArtifacts'][_0x4f1c26(0x12b)],_0x2ac15c=_0x53d400[_0x4f1c26(0x182)][_0x4f1c26(0x119)][_0x4f1c26(0x120)]+_0x53d400[_0x4f1c26(0x182)][_0x4f1c26(0x163)]['updated']+_0x53d400[_0x4f1c26(0x182)]['textKnowledgeBases'][_0x4f1c26(0x120)]+_0x53d400[_0x4f1c26(0x182)][_0x4f1c26(0x1b7)][_0x4f1c26(0x120)]+_0x53d400['counts']['integrations'][_0x4f1c26(0x120)]+_0x53d400[_0x4f1c26(0x182)]['experimentalKnowledgeBases']['updated']+_0x53d400['counts']['experimentalArtifacts'][_0x4f1c26(0x120)],_0x88d0f1=_0x53d400[_0x4f1c26(0x182)][_0x4f1c26(0x119)]['unchanged']+_0x53d400[_0x4f1c26(0x182)]['knowledgeBases'][_0x4f1c26(0x127)]+_0x53d400['counts']['textKnowledgeBases'][_0x4f1c26(0x127)]+_0x53d400[_0x4f1c26(0x182)]['prompts'][_0x4f1c26(0x127)]+_0x53d400[_0x4f1c26(0x182)]['integrations']['unchanged']+_0x53d400['counts'][_0x4f1c26(0x175)][_0x4f1c26(0x127)]+_0x53d400['counts']['experimentalArtifacts'][_0x4f1c26(0x127)];console['log'](_0x4f1c26(0x142)+_0x53d400[_0x4f1c26(0x1ae)]+'\x27:'),console['log']('\x20\x20'+a4_0x1aedd1['green']('+\x20'+_0x5c7b6d+_0x4f1c26(0x111))+_0x4f1c26(0x117)+a4_0x1aedd1[_0x4f1c26(0x1b0)]('~\x20'+_0x2ac15c+'\x20changed')+_0x4f1c26(0x117)+a4_0x1aedd1['dim']('=\x20'+_0x88d0f1+_0x4f1c26(0x160))),console[_0x4f1c26(0x10d)](_0x4f1c26(0x122)+formatCountSummary(_0x53d400[_0x4f1c26(0x182)]['agents'])),console[_0x4f1c26(0x10d)](_0x4f1c26(0x1a1)+formatCountSummary(_0x53d400[_0x4f1c26(0x182)][_0x4f1c26(0x163)])),console[_0x4f1c26(0x10d)](_0x4f1c26(0x1b3)+formatCountSummary(_0x53d400['counts'][_0x4f1c26(0x19d)])),console[_0x4f1c26(0x10d)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x53d400[_0x4f1c26(0x182)][_0x4f1c26(0x1b7)])),console['log']('\x20\x20Integrations:\x20'+formatCountSummary(_0x53d400[_0x4f1c26(0x182)][_0x4f1c26(0x136)]));const _0x391ef0=_0x53d400[_0x4f1c26(0x182)][_0x4f1c26(0x175)][_0x4f1c26(0x12b)]>0x0||_0x53d400['counts'][_0x4f1c26(0x175)][_0x4f1c26(0x120)]>0x0||_0x53d400[_0x4f1c26(0x182)][_0x4f1c26(0x175)]['unchanged']>0x0||_0x53d400[_0x4f1c26(0x182)][_0x4f1c26(0x135)][_0x4f1c26(0x12b)]>0x0||_0x53d400[_0x4f1c26(0x182)][_0x4f1c26(0x135)]['updated']>0x0||_0x53d400[_0x4f1c26(0x182)][_0x4f1c26(0x135)][_0x4f1c26(0x127)]>0x0;_0x391ef0&&(console[_0x4f1c26(0x10d)](_0x4f1c26(0x185)+formatCountSummary(_0x53d400[_0x4f1c26(0x182)]['experimentalKnowledgeBases'])),console['log'](_0x4f1c26(0x189)+formatCountSummary(_0x53d400[_0x4f1c26(0x182)][_0x4f1c26(0x135)])));console[_0x4f1c26(0x10d)]('\x20\x20Source:\x20'+a4_0x1aedd1[_0x4f1c26(0x1a4)](_0x8949db)),displayDiffs(_0x53d400[_0x4f1c26(0x119)],_0x53d400[_0x4f1c26(0x163)],_0x53d400[_0x4f1c26(0x19d)],_0x53d400['prompts'],_0x53d400[_0x4f1c26(0x136)],_0x53d400[_0x4f1c26(0x175)],_0x53d400[_0x4f1c26(0x135)]);if(_0x48027d)return console['log'](a4_0x1aedd1[_0x4f1c26(0x1b0)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed')),0x0;if(_0x5c7b6d===0x0&&_0x2ac15c===0x0){console[_0x4f1c26(0x10d)](a4_0x1aedd1[_0x4f1c26(0x1bb)](_0x4f1c26(0x181)));const _0x29dc5c=getLLMProjectUrl(_0x2d98f2,_0x53d400['projectId']);return console['log']('Project:\x20'+a4_0x1aedd1[_0x4f1c26(0x1a4)](_0x29dc5c)),0x0;}if(!_0x4bc10d&&!_0x1ac105){if(!isInteractive())return console['error'](a4_0x1aedd1[_0x4f1c26(0x1a0)](_0x4f1c26(0x145)),_0x4f1c26(0x121)),console[_0x4f1c26(0x149)](a4_0x1aedd1[_0x4f1c26(0x130)](_0x4f1c26(0x129))),0x1;const _0x17b4b2=await confirmKey(_0x4f1c26(0x167)+(_0x5c7b6d+_0x2ac15c)+_0x4f1c26(0x150));if(!_0x17b4b2)return console[_0x4f1c26(0x10d)](a4_0x1aedd1[_0x4f1c26(0x1b0)]('Cancelled'),_0x4f1c26(0x11d)),0x1;}const {data:_0x3d5c4f}=await withSpinner(_0x4f1c26(0x1bd),()=>_0x3ee319['llm'][_0x4f1c26(0x17b)](_0x8949db,{'force':_0x1ac105})),_0x4129e8=_0x3d5c4f['counts'][_0x4f1c26(0x119)][_0x4f1c26(0x152)]>0x0||_0x3d5c4f[_0x4f1c26(0x182)][_0x4f1c26(0x163)][_0x4f1c26(0x152)]>0x0||_0x3d5c4f['counts'][_0x4f1c26(0x19d)][_0x4f1c26(0x152)]>0x0||_0x3d5c4f[_0x4f1c26(0x182)]['prompts'][_0x4f1c26(0x152)]>0x0;if(_0x4129e8){console['log'](a4_0x1aedd1['yellow'](_0x4f1c26(0x19b))),console[_0x4f1c26(0x10d)](),console[_0x4f1c26(0x10d)](a4_0x1aedd1[_0x4f1c26(0x1a0)](_0x4f1c26(0x10e)));for(const _0x385e47 of _0x3d5c4f['agents']){_0x385e47[_0x4f1c26(0x144)]===_0x4f1c26(0x149)&&console[_0x4f1c26(0x10d)](a4_0x1aedd1[_0x4f1c26(0x1a0)](_0x4f1c26(0x14a)+_0x385e47[_0x4f1c26(0x10a)]+_0x4f1c26(0x113)+_0x385e47[_0x4f1c26(0x149)]));}for(const _0x572f3a of _0x3d5c4f['knowledgeBases']){_0x572f3a['action']==='error'&&console['log'](a4_0x1aedd1['red'](_0x4f1c26(0x18a)+_0x572f3a['name']+'\x22:\x20'+_0x572f3a[_0x4f1c26(0x149)]));}for(const _0x41343b of _0x3d5c4f['textKnowledgeBases']){_0x41343b[_0x4f1c26(0x144)]===_0x4f1c26(0x149)&&console[_0x4f1c26(0x10d)](a4_0x1aedd1[_0x4f1c26(0x1a0)](_0x4f1c26(0x12f)+_0x41343b[_0x4f1c26(0x13f)]+_0x4f1c26(0x113)+_0x41343b['error']));}for(const _0x28c3eb of _0x3d5c4f[_0x4f1c26(0x1b7)]){_0x28c3eb[_0x4f1c26(0x144)]===_0x4f1c26(0x149)&&console['log'](a4_0x1aedd1['red']('\x20\x20Prompt\x20\x22'+_0x28c3eb[_0x4f1c26(0x13f)]+'\x22:\x20'+_0x28c3eb[_0x4f1c26(0x149)]));}for(const _0x2b0b58 of _0x3d5c4f['integrations']){_0x2b0b58[_0x4f1c26(0x144)]===_0x4f1c26(0x149)&&console[_0x4f1c26(0x10d)](a4_0x1aedd1['red'](_0x4f1c26(0x115)+_0x2b0b58[_0x4f1c26(0x13f)]+_0x4f1c26(0x113)+_0x2b0b58['error']));}return 0x1;}console['log'](a4_0x1aedd1[_0x4f1c26(0x1bb)]('\x0a✔\x20Pushed\x20'+(_0x5c7b6d+_0x2ac15c)+_0x4f1c26(0x1b8)+_0x3d5c4f['projectName']+'\x27'));const _0x53aaaa=getLLMProjectUrl(_0x2d98f2,_0x3d5c4f[_0x4f1c26(0x17c)]);return console[_0x4f1c26(0x10d)](_0x4f1c26(0x1a6)+a4_0x1aedd1[_0x4f1c26(0x1a4)](_0x53aaaa)),0x0;}}
@@ -1 +1 @@
1
- const a5_0x2454f6=a5_0x52f9;(function(_0x506b6a,_0x488dc1){const _0x369275=a5_0x52f9,_0x5adf92=_0x506b6a();while(!![]){try{const _0x38b1c6=parseInt(_0x369275(0x20b))/0x1*(parseInt(_0x369275(0x220))/0x2)+parseInt(_0x369275(0x224))/0x3+-parseInt(_0x369275(0x22f))/0x4*(parseInt(_0x369275(0x235))/0x5)+parseInt(_0x369275(0x1bc))/0x6*(parseInt(_0x369275(0x23f))/0x7)+parseInt(_0x369275(0x20f))/0x8*(parseInt(_0x369275(0x223))/0x9)+-parseInt(_0x369275(0x1cd))/0xa*(parseInt(_0x369275(0x237))/0xb)+parseInt(_0x369275(0x24f))/0xc*(parseInt(_0x369275(0x1d8))/0xd);if(_0x38b1c6===_0x488dc1)break;else _0x5adf92['push'](_0x5adf92['shift']());}catch(_0x1a4b56){_0x5adf92['push'](_0x5adf92['shift']());}}}(a5_0x443f,0x1f655));import*as a5_0x2d3417 from'node:fs';function a5_0x443f(){const _0x5c784e=['Test\x20Configuration:','json','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','conversation_url','length','FAIL','Round\x20','Output\x20written\x20to:\x20','Tests\x20found:\x20','Running\x20test:\x20','Usage:','\x20\x20Conversation:\x20','Failed\x20Tests:','llm','\x20-\x20','✓\x20PASS:\x20','execute','Run\x20tests\x20for\x20an\x20LLM\x20agent','add','repeat','No\x20tests\x20have\x20tags\x20defined.','substring','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','Using\x20agent:\x20','testName','resolve','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','tests','6MkZEbL','forEach','basename','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','176pMPNiT','not\x20found','site','projectName','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','size','includes','\x20\x20Round\x20','jsonl','join','Failed:\x20\x20\x20','resolveProjectId','table','\x22:\x20','Passed:\x20\x20\x20','Errors:\x20\x20\x20','Total:\x20\x20\x20\x20','46740tpWFti','no_context','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','7200hgnElN','213345ghWQQS','cyan','ERROR','New\x20tests\x20to\x20execute:\x20','Error\x20writing\x20output\x20file:\x20',':\x20Sending\x20user\x20input...','No\x20tests\x20found\x20with\x20tags:\x20','reason','find','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','\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','4RoAaZv','now','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','testYmlPath','✗\x20ERROR:\x20','eval','1103975MRsTqi','green','11ZzcyId','agentName','Duration:\x20','output','stop','Re-evaluation\x20Summary','Test\x20','push','1266251XJcicM','split','...\x20','utf-8','status','\x27\x20to\x20create\x20the\x20folder\x20structure.','map','⚠\x20SKIPPED:\x20','Cached\x20run\x20from:\x20','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','yellow','Available\x20tests:\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','✗\x20ERROR:\x20Project\x20not\x20found:\x20','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','dryRun','1270452zbQFrY','Project\x20path:\x20','Round\x201/','/<agent-name>','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','white','Running:\x20','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','isSpinning','Cached\x20run\x20is\x20from\x20site\x20\x22','context','dim','\x20\x20Agent:\x20','6fKLWMD','existsSync','resolveAgentId','trim','start','writeFileSync','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','verbose','Re-evaluating\x20','Run\x20\x27tdx\x20agent\x20pull\x20','red','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','projectDir','Evaluating\x20response...','reeval','agent','test.yml','1663070JjDUTF','name','\x20(cached)','Either\x20switch\x20to\x20the\x20\x22','Error:\x20No\x20previous\x20test\x20run\x20found.','filter','has','...','rounds','message','conversations','13MvJKSJ','text','toLowerCase','✗\x20FAIL:\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)','tags','found','Re-evaluating...','description','\x22,\x20but\x20current\x20site\x20is\x20\x22','some','PASS','round','Agent:\x20','tsv','no_local_folder','log','llmProject','Test\x20Summary','toISOString','executeReeval','multiple_agents','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22'];a5_0x443f=function(){return _0x5c784e;};return a5_0x443f();}import*as a5_0x3ddb56 from'node:path';function a5_0x52f9(_0x1b2c01,_0x51d391){_0x1b2c01=_0x1b2c01-0x1b9;const _0x443fd2=a5_0x443f();let _0x52f9d1=_0x443fd2[_0x1b2c01];return _0x52f9d1;}import a5_0x456702 from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x2454f6(0x1ce)]='agent:test';[a5_0x2454f6(0x1e0)]=a5_0x2454f6(0x200);async[a5_0x2454f6(0x1ff)](_0x449ad8){const _0x1c8c8c=a5_0x2454f6,{options:_0x530040,args:_0xc0ae14,tdx:_0x3f8772}=_0x449ad8,_0x24f452=_0xc0ae14[0x0]||'.',_0x285ba2=_0x530040[_0x1c8c8c(0x24e)],_0x1b6329=_0x530040,_0x13daf8=_0x1b6329[_0x1c8c8c(0x234)]===![],_0x545d7e=_0x1b6329[_0x1c8c8c(0x1ca)],_0x5e8ffd=_0x1b6329[_0x1c8c8c(0x1ce)],_0x12d9ca=_0x1b6329[_0x1c8c8c(0x1dd)],_0x56214d=_0x530040['site'],_0x463193=_0x1b6329[_0x1c8c8c(0x23a)];if(_0x545d7e&&_0x13daf8)return console[_0x1c8c8c(0x1e8)](a5_0x456702[_0x1c8c8c(0x1c6)](_0x1c8c8c(0x20e))),0x1;let _0x25a404='table';if(_0x1b6329[_0x1c8c8c(0x1f0)])_0x25a404=_0x1c8c8c(0x1f0);else{if(_0x1b6329[_0x1c8c8c(0x217)])_0x25a404='jsonl';else{if(_0x1b6329['tsv'])_0x25a404=_0x1c8c8c(0x1e6);else{if(_0x1b6329[_0x1c8c8c(0x21b)])_0x25a404='table';}}}const _0x28dbeb=_0x1b6329['llmProject'];let _0x2b48b4=_0x24f452;const _0xeeb6b3=a5_0x2d3417[_0x1c8c8c(0x1bd)](_0x24f452),_0x3cae44=_0x24f452==='.';if(!_0xeeb6b3||_0x3cae44){const _0x3029b5=resolveProjectFromContext(_0x24f452,_0x28dbeb,{'requireFile':_0x1c8c8c(0x1cc)});if(_0x3029b5[_0x1c8c8c(0x1de)])_0x2b48b4=_0x3029b5[_0x1c8c8c(0x1c8)],_0x3029b5['source']===_0x1c8c8c(0x1b9)&&console[_0x1c8c8c(0x1e8)](a5_0x456702['dim'](_0x1c8c8c(0x206)+_0x2b48b4));else switch(_0x3029b5[_0x1c8c8c(0x22b)]){case _0x1c8c8c(0x221):console['log'](a5_0x456702['yellow'](_0x3029b5[_0x1c8c8c(0x1d6)])),console['log'](),console[_0x1c8c8c(0x1e8)](_0x1c8c8c(0x1f9)),console[_0x1c8c8c(0x1e8)](_0x1c8c8c(0x22e)),console[_0x1c8c8c(0x1e8)](_0x1c8c8c(0x1dc)),console[_0x1c8c8c(0x1e8)](),console[_0x1c8c8c(0x1e8)](_0x1c8c8c(0x1c7));return 0x1;case _0x1c8c8c(0x1e7):console['log'](a5_0x456702['yellow'](_0x3029b5[_0x1c8c8c(0x1d6)])),console[_0x1c8c8c(0x1e8)](),console[_0x1c8c8c(0x1e8)](_0x1c8c8c(0x1c5)+_0x3029b5[_0x1c8c8c(0x1e9)]+_0x1c8c8c(0x244));return 0x1;case _0x1c8c8c(0x1ed):{const _0x1b3964=a5_0x3ddb56[_0x1c8c8c(0x20d)](_0x3029b5['projectDir']);console[_0x1c8c8c(0x1e8)](a5_0x456702['yellow'](_0x1c8c8c(0x22d)+_0x3029b5[_0x1c8c8c(0x1e9)]+'\x22:'));for(const _0x5cac04 of _0x3029b5['agentDirs']){console[_0x1c8c8c(0x1e8)]('\x20\x20-\x20'+_0x5cac04);}return console[_0x1c8c8c(0x1e8)](),console[_0x1c8c8c(0x1e8)](_0x1c8c8c(0x253)+_0x1b3964+_0x1c8c8c(0x252)),0x1;}case'no_tests':console[_0x1c8c8c(0x1e8)](a5_0x456702[_0x1c8c8c(0x249)](_0x1c8c8c(0x222)+_0x3029b5[_0x1c8c8c(0x1e9)]+'\x22.')),console[_0x1c8c8c(0x1e8)](a5_0x456702[_0x1c8c8c(0x1ba)](_0x1c8c8c(0x250)+_0x3029b5[_0x1c8c8c(0x1c8)])),console[_0x1c8c8c(0x1e8)](),console[_0x1c8c8c(0x1e8)](_0x1c8c8c(0x231));return 0x1;}}const {definition:_0x13c876,agentInfo:_0x40c80c}=parseTestFile(_0x2b48b4);let _0x215965=_0x13c876[_0x1c8c8c(0x20a)];if(_0x5e8ffd){const _0x1caa7d=_0x5e8ffd[_0x1c8c8c(0x240)](',')[_0x1c8c8c(0x245)](_0x1f893b=>_0x1f893b[_0x1c8c8c(0x1bf)]());_0x215965=_0x13c876[_0x1c8c8c(0x20a)][_0x1c8c8c(0x1d2)](_0x3182cf=>_0x1caa7d[_0x1c8c8c(0x215)](_0x3182cf[_0x1c8c8c(0x1ce)]));if(_0x215965[_0x1c8c8c(0x1f3)]===0x0)return console['log'](a5_0x456702[_0x1c8c8c(0x249)]('No\x20tests\x20found\x20matching:\x20'+_0x5e8ffd)),console[_0x1c8c8c(0x1e8)](a5_0x456702[_0x1c8c8c(0x1ba)](_0x1c8c8c(0x24a)+_0x13c876[_0x1c8c8c(0x20a)][_0x1c8c8c(0x245)](_0x431993=>_0x431993[_0x1c8c8c(0x1ce)])[_0x1c8c8c(0x218)](',\x20'))),0x1;}if(_0x12d9ca){const _0x3e3948=_0x12d9ca[_0x1c8c8c(0x240)](',')['map'](_0x359c53=>_0x359c53[_0x1c8c8c(0x1bf)]()[_0x1c8c8c(0x1da)]());_0x215965=_0x215965[_0x1c8c8c(0x1d2)](_0x556051=>_0x556051[_0x1c8c8c(0x1dd)]?.[_0x1c8c8c(0x1e2)](_0x4d7afc=>_0x3e3948[_0x1c8c8c(0x215)](_0x4d7afc['toLowerCase']())));if(_0x215965[_0x1c8c8c(0x1f3)]===0x0){console['log'](a5_0x456702[_0x1c8c8c(0x249)](_0x1c8c8c(0x22a)+_0x12d9ca));const _0x175b5d=new Set();return _0x13c876[_0x1c8c8c(0x20a)][_0x1c8c8c(0x20c)](_0x269ae4=>_0x269ae4[_0x1c8c8c(0x1dd)]?.[_0x1c8c8c(0x20c)](_0x2c7268=>_0x175b5d[_0x1c8c8c(0x201)](_0x2c7268))),_0x175b5d[_0x1c8c8c(0x214)]>0x0?console[_0x1c8c8c(0x1e8)](a5_0x456702[_0x1c8c8c(0x1ba)]('Available\x20tags:\x20'+[..._0x175b5d][_0x1c8c8c(0x218)](',\x20'))):console[_0x1c8c8c(0x1e8)](a5_0x456702[_0x1c8c8c(0x1ba)](_0x1c8c8c(0x203))),0x1;}}if(_0x545d7e)return this[_0x1c8c8c(0x1ec)](_0x449ad8,{'definition':{'tests':_0x215965},'agentInfo':_0x40c80c,'outputFormat':_0x25a404,'outputFile':_0x463193,'testNames':_0x5e8ffd});if(_0x285ba2){console['log'](a5_0x456702[_0x1c8c8c(0x225)](_0x1c8c8c(0x1ef))),console[_0x1c8c8c(0x1e8)]('\x20\x20Site:\x20'+a5_0x456702[_0x1c8c8c(0x254)](_0x56214d)),console['log']('\x20\x20Project:\x20'+a5_0x456702[_0x1c8c8c(0x254)](_0x40c80c[_0x1c8c8c(0x212)])),console[_0x1c8c8c(0x1e8)](_0x1c8c8c(0x1bb)+a5_0x456702[_0x1c8c8c(0x254)](_0x40c80c['agentName'])),console[_0x1c8c8c(0x1e8)](),console[_0x1c8c8c(0x1e8)](_0x1c8c8c(0x1f7)+a5_0x456702[_0x1c8c8c(0x254)](_0x215965[_0x1c8c8c(0x1f3)]));for(let _0x41589e=0x0;_0x41589e<_0x215965['length'];_0x41589e++){const _0x224daf=_0x215965[_0x41589e],_0x3445af=_0x224daf['rounds'][_0x1c8c8c(0x1f3)]===0x1?_0x1c8c8c(0x1e4):'rounds',_0x169301=_0x224daf['tags']?.[_0x1c8c8c(0x1f3)]?'\x20['+_0x224daf[_0x1c8c8c(0x1dd)][_0x1c8c8c(0x218)](',\x20')+']':'';console['log']('\x20\x20'+(_0x41589e+0x1)+'.\x20'+a5_0x456702[_0x1c8c8c(0x254)](_0x224daf[_0x1c8c8c(0x1ce)])+'\x20('+_0x224daf['rounds'][_0x1c8c8c(0x1f3)]+'\x20'+_0x3445af+')'+a5_0x456702['dim'](_0x169301));}return 0x0;}let _0x53c3cd,_0x39af23;try{_0x53c3cd=await _0x3f8772[_0x1c8c8c(0x1fc)][_0x1c8c8c(0x21a)](_0x40c80c[_0x1c8c8c(0x212)]);}catch(_0x3ccb32){const _0x149d3a=_0x3ccb32 instanceof Error?_0x3ccb32[_0x1c8c8c(0x1d6)]:String(_0x3ccb32);return _0x149d3a[_0x1c8c8c(0x215)]('404')||_0x149d3a[_0x1c8c8c(0x1da)]()['includes'](_0x1c8c8c(0x210))?console['log'](a5_0x456702[_0x1c8c8c(0x1c6)](_0x1c8c8c(0x24c)+_0x40c80c[_0x1c8c8c(0x212)])):console['log'](a5_0x456702['red'](_0x1c8c8c(0x24b)+_0x40c80c[_0x1c8c8c(0x212)]+_0x1c8c8c(0x21c)+_0x149d3a)),0x1;}try{_0x39af23=await _0x3f8772[_0x1c8c8c(0x1fc)][_0x1c8c8c(0x1be)](_0x40c80c[_0x1c8c8c(0x238)],_0x53c3cd);}catch(_0x23b2d6){const _0x255bb5=_0x23b2d6 instanceof Error?_0x23b2d6[_0x1c8c8c(0x1d6)]:String(_0x23b2d6);return _0x255bb5[_0x1c8c8c(0x215)]('404')||_0x255bb5[_0x1c8c8c(0x1da)]()[_0x1c8c8c(0x215)](_0x1c8c8c(0x210))?console[_0x1c8c8c(0x1e8)](a5_0x456702[_0x1c8c8c(0x1c6)](_0x1c8c8c(0x256)+_0x40c80c[_0x1c8c8c(0x238)])):console[_0x1c8c8c(0x1e8)](a5_0x456702[_0x1c8c8c(0x1c6)](_0x1c8c8c(0x1ee)+_0x40c80c['agentName']+_0x1c8c8c(0x21c)+_0x255bb5)),0x1;}let _0x2fd25d;if(!_0x13daf8)try{_0x2fd25d=await setupEvaluatorAgent(_0x3f8772['llm'],_0x530040[_0x1c8c8c(0x1c3)]);}catch(_0x5ee50b){const _0xad1ecd=_0x5ee50b instanceof Error?_0x5ee50b['message']:String(_0x5ee50b);return console[_0x1c8c8c(0x1e8)](a5_0x456702[_0x1c8c8c(0x1c6)](_0x1c8c8c(0x24d)+_0xad1ecd)),0x1;}console['log'](a5_0x456702[_0x1c8c8c(0x225)]('Running\x20agent\x20tests...')),console[_0x1c8c8c(0x1e8)]('Site:\x20'+a5_0x456702[_0x1c8c8c(0x254)](_0x56214d)),console[_0x1c8c8c(0x1e8)](_0x1c8c8c(0x1e5)+a5_0x456702[_0x1c8c8c(0x254)](_0x40c80c[_0x1c8c8c(0x212)]+'/'+_0x40c80c['agentName'])),console[_0x1c8c8c(0x1e8)]();const _0x7c0368=[],_0x3584ce=[],_0x45c287=Date[_0x1c8c8c(0x230)]();for(let _0x4fcf99=0x0;_0x4fcf99<_0x215965['length'];_0x4fcf99++){const _0x36fd63=_0x215965[_0x4fcf99];_0x215965['length']>0x1?console[_0x1c8c8c(0x1e8)](_0x1c8c8c(0x23d)+(_0x4fcf99+0x1)+'/'+_0x215965[_0x1c8c8c(0x1f3)]+':\x20'+a5_0x456702['white'](_0x36fd63['name'])):console[_0x1c8c8c(0x1e8)](_0x1c8c8c(0x1f8)+a5_0x456702['white'](_0x36fd63[_0x1c8c8c(0x1ce)]));const _0x494078=createCommandSpinner(_0x1c8c8c(0x251)+_0x36fd63['rounds']['length']+':\x20Sending\x20user\x20input...');_0x494078[_0x1c8c8c(0x1c0)]();try{const {result:_0x3751d4,conversation:_0x4e1758}=await runTest(_0x3f8772['llm'],_0x36fd63,{'agentId':_0x39af23,'projectId':_0x53c3cd,'site':_0x56214d,'noEval':_0x13daf8,'evaluatorId':_0x2fd25d,'onRoundStart':(_0x9bee17,_0x4435bf)=>{const _0x19b6e6=_0x1c8c8c;_0x494078[_0x19b6e6(0x1d9)]=_0x19b6e6(0x1f5)+(_0x9bee17+0x1)+'/'+_0x4435bf+_0x19b6e6(0x229);},'onRoundComplete':(_0x2920e3,_0x1b57c0,_0xec206f)=>{const _0x2eaf66=_0x1c8c8c,_0x4fbea2=formatElapsed(_0x1b57c0);_0xec206f?console[_0x2eaf66(0x1e8)](_0x2eaf66(0x216)+(_0x2920e3+0x1)+'/'+_0x36fd63[_0x2eaf66(0x1d5)]['length']+_0x2eaf66(0x241)+a5_0x456702[_0x2eaf66(0x236)]('✓')+'\x20('+_0x4fbea2+')'):console['log']('\x20\x20Round\x20'+(_0x2920e3+0x1)+'/'+_0x36fd63[_0x2eaf66(0x1d5)][_0x2eaf66(0x1f3)]+_0x2eaf66(0x241)+a5_0x456702[_0x2eaf66(0x1c6)]('✗'));},'onEvaluationStart':()=>{_0x494078['text']='Evaluating\x20response...';},'onEvaluationComplete':_0x190471=>{const _0x3647ed=_0x1c8c8c,_0x43fb9f=formatElapsed(_0x190471);console[_0x3647ed(0x1e8)]('\x20\x20Evaluating...\x20'+a5_0x456702['green']('✓')+'\x20('+_0x43fb9f+')');}});_0x494078[_0x1c8c8c(0x23b)](),_0x7c0368['push'](_0x3751d4),_0x3584ce[_0x1c8c8c(0x23e)](_0x4e1758);if(_0x3751d4[_0x1c8c8c(0x243)]===_0x1c8c8c(0x1e3))console[_0x1c8c8c(0x1e8)](a5_0x456702[_0x1c8c8c(0x236)](_0x1c8c8c(0x1fe)+_0x3751d4[_0x1c8c8c(0x22b)]));else _0x3751d4[_0x1c8c8c(0x243)]===_0x1c8c8c(0x1f4)?console[_0x1c8c8c(0x1e8)](a5_0x456702[_0x1c8c8c(0x1c6)](_0x1c8c8c(0x1db)+_0x3751d4[_0x1c8c8c(0x22b)])):console[_0x1c8c8c(0x1e8)](a5_0x456702[_0x1c8c8c(0x1c6)](_0x1c8c8c(0x233)+_0x3751d4[_0x1c8c8c(0x22b)]));_0x3751d4[_0x1c8c8c(0x1f2)]&&console[_0x1c8c8c(0x1e8)](a5_0x456702[_0x1c8c8c(0x1ba)]('Conversation\x20URL:\x20'+_0x3751d4[_0x1c8c8c(0x1f2)])),console[_0x1c8c8c(0x1e8)]();}catch(_0x1c346f){_0x494078[_0x1c8c8c(0x23b)]();const _0x52c8ff=_0x1c346f instanceof Error?_0x1c346f[_0x1c8c8c(0x1d6)]:String(_0x1c346f);console[_0x1c8c8c(0x1e8)](a5_0x456702[_0x1c8c8c(0x1c6)]('✗\x20ERROR:\x20'+_0x52c8ff)),console[_0x1c8c8c(0x1e8)](),_0x7c0368[_0x1c8c8c(0x23e)]({'name':_0x36fd63[_0x1c8c8c(0x1ce)],'status':_0x1c8c8c(0x226),'reason':_0x52c8ff,'timestamp':new Date()[_0x1c8c8c(0x1eb)](),'duration_ms':0x0});}}const _0x145492=Date[_0x1c8c8c(0x230)]()-_0x45c287,_0x14e984=_0x7c0368[_0x1c8c8c(0x1d2)](_0x2456ff=>_0x2456ff[_0x1c8c8c(0x243)]===_0x1c8c8c(0x1e3))[_0x1c8c8c(0x1f3)],_0x2aebf7=_0x7c0368[_0x1c8c8c(0x1d2)](_0x28bfb9=>_0x28bfb9[_0x1c8c8c(0x243)]===_0x1c8c8c(0x1f4))[_0x1c8c8c(0x1f3)],_0x10d1a0=_0x7c0368[_0x1c8c8c(0x1d2)](_0x561d01=>_0x561d01[_0x1c8c8c(0x243)]===_0x1c8c8c(0x226))[_0x1c8c8c(0x1f3)];console[_0x1c8c8c(0x1e8)]('━'['repeat'](0x3c)),console[_0x1c8c8c(0x1e8)](_0x1c8c8c(0x1ea)),console[_0x1c8c8c(0x1e8)]('━'['repeat'](0x3c)),console[_0x1c8c8c(0x1e8)](_0x1c8c8c(0x21f)+_0x7c0368[_0x1c8c8c(0x1f3)]),console[_0x1c8c8c(0x1e8)](_0x1c8c8c(0x21d)+a5_0x456702['green'](_0x14e984)),console[_0x1c8c8c(0x1e8)](_0x1c8c8c(0x219)+a5_0x456702[_0x1c8c8c(0x1c6)](_0x2aebf7));_0x10d1a0>0x0&&console[_0x1c8c8c(0x1e8)](_0x1c8c8c(0x21e)+a5_0x456702['red'](_0x10d1a0));console[_0x1c8c8c(0x1e8)]('Duration:\x20'+formatElapsed(_0x145492)),console[_0x1c8c8c(0x1e8)]('━'[_0x1c8c8c(0x202)](0x3c));const _0xb6f268=_0x7c0368[_0x1c8c8c(0x1d2)](_0x4a1c09=>_0x4a1c09[_0x1c8c8c(0x243)]!=='PASS');if(_0xb6f268['length']>0x0){console[_0x1c8c8c(0x1e8)](),console[_0x1c8c8c(0x1e8)](_0x1c8c8c(0x1fb));for(const _0x1a1b37 of _0xb6f268){const _0x252a1f=a5_0x456702['red']('✗'),_0x4177cd=_0x1a1b37[_0x1c8c8c(0x22b)][_0x1c8c8c(0x1f3)]>0x32?_0x1a1b37[_0x1c8c8c(0x22b)][_0x1c8c8c(0x204)](0x0,0x32)+_0x1c8c8c(0x1d4):_0x1a1b37[_0x1c8c8c(0x22b)];console[_0x1c8c8c(0x1e8)]('\x20\x20'+_0x252a1f+'\x20'+_0x1a1b37['name']+':\x20'+_0x4177cd);}}const _0x2e6d95={'summary':{'total':_0x7c0368[_0x1c8c8c(0x1f3)],'passed':_0x14e984,'failed':_0x2aebf7,'errors':_0x10d1a0>0x0?_0x10d1a0:undefined,'duration_ms':_0x145492},'tests':_0x7c0368,'agent':{'project':_0x40c80c[_0x1c8c8c(0x212)],'name':_0x40c80c['agentName'],'site':_0x56214d},'timestamp':new Date(_0x45c287)['toISOString']()};try{const _0x428675=buildCachedTestRun(_0x3584ce,{'site':_0x56214d,'projectId':_0x53c3cd,'projectName':_0x40c80c['projectName'],'agentId':_0x39af23,'agentName':_0x40c80c[_0x1c8c8c(0x238)],'testYmlPath':a5_0x3ddb56[_0x1c8c8c(0x208)](_0x40c80c[_0x1c8c8c(0x232)])});saveLastTestRun(_0x428675);}catch{}if(_0x25a404!==_0x1c8c8c(0x21b)||_0x463193){const _0x20ecb6=formatResults(_0x2e6d95,_0x25a404);if(_0x463193)try{a5_0x2d3417[_0x1c8c8c(0x1c1)](_0x463193,_0x20ecb6,_0x1c8c8c(0x242)),console[_0x1c8c8c(0x1e8)](),console[_0x1c8c8c(0x1e8)](a5_0x456702[_0x1c8c8c(0x1ba)](_0x1c8c8c(0x1f6)+_0x463193));}catch(_0x3b5da5){return console[_0x1c8c8c(0x1e8)](),console[_0x1c8c8c(0x1e8)](a5_0x456702[_0x1c8c8c(0x1c6)](_0x1c8c8c(0x228)+_0x3b5da5)),0x1;}else console['log'](),console['log'](_0x20ecb6);}return _0xb6f268['length']>0x0?0x1:0x0;}async[a5_0x2454f6(0x1ec)](_0x788d8,_0x35702c){const _0x531be0=a5_0x2454f6,{options:_0x237433,tdx:_0x138883}=_0x788d8,{definition:_0x958278,agentInfo:_0x580f3f,outputFormat:_0x3fe019,outputFile:_0x39ee81}=_0x35702c,_0x22db50=_0x237433[_0x531be0(0x211)],_0x3811ef=loadLastTestRun();if(!_0x3811ef)return console[_0x531be0(0x1e8)](a5_0x456702[_0x531be0(0x1c6)](_0x531be0(0x1d1))),console[_0x531be0(0x1e8)](a5_0x456702['dim'](_0x531be0(0x209))),0x1;if(_0x3811ef[_0x531be0(0x1cb)][_0x531be0(0x238)]!==_0x580f3f[_0x531be0(0x238)])return console[_0x531be0(0x1e8)](a5_0x456702[_0x531be0(0x1c6)](_0x531be0(0x213)+_0x3811ef[_0x531be0(0x1cb)]['agentName']+_0x531be0(0x1c2)+_0x580f3f[_0x531be0(0x238)]+'\x22.')),console[_0x531be0(0x1e8)](a5_0x456702[_0x531be0(0x1ba)](_0x531be0(0x205))),0x1;const _0x3e6cb0=new Set(_0x3811ef[_0x531be0(0x1d7)][_0x531be0(0x245)](_0xf2bbb0=>_0xf2bbb0[_0x531be0(0x207)])),_0x5b8505=_0x958278['tests'][_0x531be0(0x1d2)](_0x3c6e19=>!_0x3e6cb0['has'](_0x3c6e19['name']));if(_0x5b8505[_0x531be0(0x1f3)]>0x0&&_0x3811ef[_0x531be0(0x211)]!==_0x22db50)return console[_0x531be0(0x1e8)](a5_0x456702[_0x531be0(0x1c6)](_0x531be0(0x248))),console[_0x531be0(0x1e8)](a5_0x456702[_0x531be0(0x1ba)](_0x531be0(0x258)+_0x3811ef[_0x531be0(0x211)]+_0x531be0(0x1e1)+_0x22db50+'\x22.')),console['log'](a5_0x456702[_0x531be0(0x1ba)](_0x531be0(0x1d0)+_0x3811ef['site']+_0x531be0(0x1f1))),0x1;const _0x17480c=_0x958278[_0x531be0(0x20a)][_0x531be0(0x1d2)](_0x2757f6=>_0x3e6cb0[_0x531be0(0x1d3)](_0x2757f6[_0x531be0(0x1ce)])),_0xaf0485=_0x5b8505;let _0x5b91bc;try{_0x5b91bc=await setupEvaluatorAgent(_0x138883[_0x531be0(0x1fc)],_0x237433['verbose']);}catch(_0xdf09fa){const _0x47923e=_0xdf09fa instanceof Error?_0xdf09fa['message']:String(_0xdf09fa);return console['log'](a5_0x456702[_0x531be0(0x1c6)](_0x531be0(0x24d)+_0x47923e)),0x1;}console[_0x531be0(0x1e8)](a5_0x456702[_0x531be0(0x225)]('Re-evaluating\x20cached\x20test\x20run...')),console['log'](_0x531be0(0x247)+a5_0x456702['white'](_0x3811ef['timestamp'])),console[_0x531be0(0x1e8)](_0x531be0(0x1e5)+a5_0x456702[_0x531be0(0x254)](_0x3811ef[_0x531be0(0x1cb)]['projectName']+'/'+_0x3811ef['agent'][_0x531be0(0x238)]));_0xaf0485[_0x531be0(0x1f3)]>0x0&&console[_0x531be0(0x1e8)](_0x531be0(0x227)+a5_0x456702[_0x531be0(0x249)](_0xaf0485[_0x531be0(0x1f3)]));console[_0x531be0(0x1e8)]();const _0xe97ed6=[],_0x4a2444=Date[_0x531be0(0x230)](),_0x3f5993=createCommandSpinner(_0x531be0(0x1df));if(_0x17480c[_0x531be0(0x1f3)]>0x0)try{const _0x270f36=await reevaluateFromCache(_0x138883['llm'],_0x3811ef,{'tests':_0x17480c},{'evaluatorId':_0x5b91bc,'onTestStart':(_0x55cc31,_0x322f33,_0x15416c)=>{const _0x5953e7=_0x531be0;_0x3f5993[_0x5953e7(0x1d9)]=_0x5953e7(0x1c4)+(_0x322f33+0x1)+'/'+_0x15416c+':\x20'+_0x55cc31+_0x5953e7(0x1d4);if(!_0x3f5993[_0x5953e7(0x257)])_0x3f5993[_0x5953e7(0x1c0)]();},'onTestComplete':(_0x106698,_0x5de411)=>{const _0x21047a=_0x531be0;_0x3f5993[_0x21047a(0x23b)]();if(_0x5de411[_0x21047a(0x243)]===_0x21047a(0x1e3))console[_0x21047a(0x1e8)](a5_0x456702[_0x21047a(0x236)](_0x21047a(0x1fe)+_0x106698)+a5_0x456702[_0x21047a(0x1ba)](_0x21047a(0x1cf)));else _0x5de411['status']===_0x21047a(0x1f4)?console[_0x21047a(0x1e8)](a5_0x456702['red'](_0x21047a(0x1db)+_0x106698+_0x21047a(0x1fd)+_0x5de411['reason'])+a5_0x456702[_0x21047a(0x1ba)](_0x21047a(0x1cf))):console['log'](a5_0x456702[_0x21047a(0x1c6)]('✗\x20ERROR:\x20'+_0x106698+_0x21047a(0x1fd)+_0x5de411['reason']));_0x5de411['conversation_url']&&console['log'](a5_0x456702[_0x21047a(0x1ba)](_0x21047a(0x1fa)+_0x5de411[_0x21047a(0x1f2)])),_0xe97ed6['push'](_0x5de411);},'onTestSkipped':(_0x4a4235,_0x3840bb)=>{const _0xfd8efd=_0x531be0;_0x3f5993[_0xfd8efd(0x23b)](),console[_0xfd8efd(0x1e8)](a5_0x456702[_0xfd8efd(0x249)](_0xfd8efd(0x246)+_0x4a4235+_0xfd8efd(0x1fd)+_0x3840bb));}});for(const _0x36ceb8 of _0x270f36){!_0xe97ed6[_0x531be0(0x22c)](_0x106827=>_0x106827[_0x531be0(0x1ce)]===_0x36ceb8[_0x531be0(0x1ce)])&&_0xe97ed6[_0x531be0(0x23e)](_0x36ceb8);}}catch(_0x1f3908){_0x3f5993[_0x531be0(0x23b)]();const _0x344908=_0x1f3908 instanceof Error?_0x1f3908[_0x531be0(0x1d6)]:String(_0x1f3908);return console[_0x531be0(0x1e8)](a5_0x456702[_0x531be0(0x1c6)]('✗\x20ERROR:\x20Re-evaluation\x20failed:\x20'+_0x344908)),0x1;}_0x3f5993[_0x531be0(0x23b)]();if(_0xaf0485[_0x531be0(0x1f3)]>0x0){console[_0x531be0(0x1e8)](),console[_0x531be0(0x1e8)](a5_0x456702[_0x531be0(0x225)]('Executing\x20new\x20tests...'));const {projectId:_0x5b9091,agentId:_0x4f6fe9}=_0x3811ef[_0x531be0(0x1cb)];for(const _0x542ebb of _0xaf0485){console['log'](_0x531be0(0x255)+a5_0x456702[_0x531be0(0x254)](_0x542ebb[_0x531be0(0x1ce)]));const _0x1822e1=createCommandSpinner(_0x531be0(0x251)+_0x542ebb[_0x531be0(0x1d5)][_0x531be0(0x1f3)]+_0x531be0(0x229));_0x1822e1[_0x531be0(0x1c0)]();try{const {result:_0x5b3a96}=await runTest(_0x138883[_0x531be0(0x1fc)],_0x542ebb,{'agentId':_0x4f6fe9,'projectId':_0x5b9091,'site':_0x3811ef['site'],'noEval':![],'evaluatorId':_0x5b91bc,'onRoundStart':(_0x3dabf2,_0x21b28f)=>{const _0xbb192a=_0x531be0;_0x1822e1[_0xbb192a(0x1d9)]=_0xbb192a(0x1f5)+(_0x3dabf2+0x1)+'/'+_0x21b28f+_0xbb192a(0x229);},'onRoundComplete':(_0x2b0e4a,_0x13d581,_0x5b61c9)=>{const _0x2279ed=_0x531be0,_0x33ce0c=formatElapsed(_0x13d581);_0x5b61c9?console['log'](_0x2279ed(0x216)+(_0x2b0e4a+0x1)+'/'+_0x542ebb[_0x2279ed(0x1d5)]['length']+'...\x20'+a5_0x456702[_0x2279ed(0x236)]('✓')+'\x20('+_0x33ce0c+')'):console[_0x2279ed(0x1e8)](_0x2279ed(0x216)+(_0x2b0e4a+0x1)+'/'+_0x542ebb['rounds'][_0x2279ed(0x1f3)]+_0x2279ed(0x241)+a5_0x456702[_0x2279ed(0x1c6)]('✗'));},'onEvaluationStart':()=>{const _0x3d8411=_0x531be0;_0x1822e1[_0x3d8411(0x1d9)]=_0x3d8411(0x1c9);},'onEvaluationComplete':_0x4a8c5e=>{const _0x998dfc=_0x531be0,_0x1d5ef6=formatElapsed(_0x4a8c5e);console['log']('\x20\x20Evaluating...\x20'+a5_0x456702[_0x998dfc(0x236)]('✓')+'\x20('+_0x1d5ef6+')');}});_0x1822e1[_0x531be0(0x23b)](),_0xe97ed6[_0x531be0(0x23e)](_0x5b3a96);if(_0x5b3a96[_0x531be0(0x243)]===_0x531be0(0x1e3))console['log'](a5_0x456702[_0x531be0(0x236)](_0x531be0(0x1fe)+_0x5b3a96[_0x531be0(0x22b)])+a5_0x456702['dim']('\x20(new)'));else _0x5b3a96[_0x531be0(0x243)]===_0x531be0(0x1f4)?console[_0x531be0(0x1e8)](a5_0x456702[_0x531be0(0x1c6)](_0x531be0(0x1db)+_0x5b3a96[_0x531be0(0x22b)])+a5_0x456702['dim']('\x20(new)')):console[_0x531be0(0x1e8)](a5_0x456702[_0x531be0(0x1c6)](_0x531be0(0x233)+_0x5b3a96[_0x531be0(0x22b)]));_0x5b3a96[_0x531be0(0x1f2)]&&console[_0x531be0(0x1e8)](a5_0x456702['dim'](_0x531be0(0x1fa)+_0x5b3a96[_0x531be0(0x1f2)]));}catch(_0xea99d3){_0x1822e1[_0x531be0(0x23b)]();const _0x3f66f7=_0xea99d3 instanceof Error?_0xea99d3[_0x531be0(0x1d6)]:String(_0xea99d3);console[_0x531be0(0x1e8)](a5_0x456702[_0x531be0(0x1c6)](_0x531be0(0x233)+_0x3f66f7)),_0xe97ed6[_0x531be0(0x23e)]({'name':_0x542ebb['name'],'status':'ERROR','reason':_0x3f66f7,'timestamp':new Date()[_0x531be0(0x1eb)](),'duration_ms':0x0});}}}console[_0x531be0(0x1e8)]();const _0x1476d8=Date[_0x531be0(0x230)]()-_0x4a2444,_0x2e6346=_0xe97ed6[_0x531be0(0x1d2)](_0x181ca3=>_0x181ca3[_0x531be0(0x243)]==='PASS')[_0x531be0(0x1f3)],_0x547a08=_0xe97ed6[_0x531be0(0x1d2)](_0x220a33=>_0x220a33[_0x531be0(0x243)]===_0x531be0(0x1f4))[_0x531be0(0x1f3)],_0x154202=_0xe97ed6['filter'](_0x20b19a=>_0x20b19a[_0x531be0(0x243)]===_0x531be0(0x226))[_0x531be0(0x1f3)];console[_0x531be0(0x1e8)]('━'[_0x531be0(0x202)](0x3c)),console[_0x531be0(0x1e8)](_0x531be0(0x23c)),console[_0x531be0(0x1e8)]('━'[_0x531be0(0x202)](0x3c)),console[_0x531be0(0x1e8)]('Total:\x20\x20\x20\x20'+_0xe97ed6[_0x531be0(0x1f3)]),console['log'](_0x531be0(0x21d)+a5_0x456702[_0x531be0(0x236)](_0x2e6346)),console[_0x531be0(0x1e8)](_0x531be0(0x219)+a5_0x456702[_0x531be0(0x1c6)](_0x547a08));_0x154202>0x0&&console[_0x531be0(0x1e8)](_0x531be0(0x21e)+a5_0x456702[_0x531be0(0x1c6)](_0x154202));console['log'](_0x531be0(0x239)+formatElapsed(_0x1476d8)),console[_0x531be0(0x1e8)]('━'[_0x531be0(0x202)](0x3c));const _0x409cdc={'summary':{'total':_0xe97ed6['length'],'passed':_0x2e6346,'failed':_0x547a08,'errors':_0x154202>0x0?_0x154202:undefined,'duration_ms':_0x1476d8},'tests':_0xe97ed6,'agent':{'project':_0x580f3f[_0x531be0(0x212)],'name':_0x580f3f[_0x531be0(0x238)],'site':_0x22db50},'timestamp':new Date(_0x4a2444)[_0x531be0(0x1eb)]()};if(_0x3fe019!=='table'||_0x39ee81){const _0xccfef2=formatResults(_0x409cdc,_0x3fe019);if(_0x39ee81)try{a5_0x2d3417[_0x531be0(0x1c1)](_0x39ee81,_0xccfef2,_0x531be0(0x242)),console[_0x531be0(0x1e8)](),console[_0x531be0(0x1e8)](a5_0x456702['dim'](_0x531be0(0x1f6)+_0x39ee81));}catch(_0x17daa6){return console[_0x531be0(0x1e8)](),console[_0x531be0(0x1e8)](a5_0x456702[_0x531be0(0x1c6)](_0x531be0(0x228)+_0x17daa6)),0x1;}else console[_0x531be0(0x1e8)](),console[_0x531be0(0x1e8)](_0xccfef2);}const _0x499fa5=_0xe97ed6['filter'](_0x1fa2d2=>_0x1fa2d2[_0x531be0(0x243)]!==_0x531be0(0x1e3));return _0x499fa5[_0x531be0(0x1f3)]>0x0?0x1:0x0;}}
1
+ function a5_0xcf51(_0x1ea3ec,_0x5875a4){_0x1ea3ec=_0x1ea3ec-0xd0;const _0x52c49c=a5_0x52c4();let _0xcf51=_0x52c49c[_0x1ea3ec];return _0xcf51;}const a5_0x1ddf43=a5_0xcf51;(function(_0x254742,_0x1bdb98){const _0x132a37=a5_0xcf51,_0x122435=_0x254742();while(!![]){try{const _0x12d838=-parseInt(_0x132a37(0xe2))/0x1*(parseInt(_0x132a37(0x14b))/0x2)+parseInt(_0x132a37(0x13e))/0x3+parseInt(_0x132a37(0x15b))/0x4*(-parseInt(_0x132a37(0x105))/0x5)+parseInt(_0x132a37(0x122))/0x6+parseInt(_0x132a37(0xed))/0x7*(-parseInt(_0x132a37(0x15d))/0x8)+parseInt(_0x132a37(0xe4))/0x9+-parseInt(_0x132a37(0x10d))/0xa;if(_0x12d838===_0x1bdb98)break;else _0x122435['push'](_0x122435['shift']());}catch(_0x5127d5){_0x122435['push'](_0x122435['shift']());}}}(a5_0x52c4,0x931ce));import*as a5_0x5187c7 from'node:fs';import*as a5_0x71a21a from'node:path';import a5_0x57ac79 from'chalk';import{BaseCommand}from'./command.js';function a5_0x52c4(){const _0x584a08=['ERROR','Error\x20writing\x20output\x20file:\x20','FAIL','resolve','Failed:\x20\x20\x20','1511562jjaTSF','No\x20tests\x20have\x20tags\x20defined.','resolveProjectId','site','tags','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','llmProject','cyan','split','projectDir','Cached\x20run\x20is\x20from\x20site\x20\x22','Errors:\x20\x20\x20','Re-evaluating...','306yxlJNZ','trim','Executing\x20new\x20tests...','no_local_folder','filter','found','log','length','✓\x20PASS:\x20','substring','not\x20found','Evaluating\x20response...','Usage:','add','⚠\x20SKIPPED:\x20','join','3340904phhxMI','has','278456KouxJo','conversation_url','Running:\x20','dryRun','status','rounds','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','reason','\x20\x20Evaluating...\x20','Round\x20','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','timestamp','Test\x20','...\x20','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','Round\x201/','Re-evaluation\x20Summary','stop','conversations','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','no_tests','\x22:\x20','\x22,\x20but\x20current\x20site\x20is\x20\x22','white','Duration:\x20','tests','3823zieDQj','\x20\x20Round\x20','7819659eFNTaV','test.yml','✗\x20ERROR:\x20','Agent:\x20','testYmlPath','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','projectName','Either\x20switch\x20to\x20the\x20\x22','\x27\x20to\x20create\x20the\x20folder\x20structure.','63QNyHZR','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','executeReeval','\x20\x20-\x20','✗\x20FAIL:\x20','description','Test\x20Configuration:','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','Failed\x20Tests:','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','\x20\x20Site:\x20','agent','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','table','start','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','utf-8','Test\x20Summary','Total:\x20\x20\x20\x20','json','toISOString','round','Conversation\x20URL:\x20','green','5SYzIrS','Output\x20written\x20to:\x20','repeat','includes','\x20\x20Agent:\x20','message','\x20(new)','dim','190100XyoPzn','isSpinning','Error:\x20No\x20previous\x20test\x20run\x20found.','\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)',':\x20Sending\x20user\x20input...','\x20\x20Conversation:\x20','/<agent-name>','Cached\x20run\x20from:\x20','Tests\x20found:\x20','execute','push','map','name','Re-evaluating\x20','some','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','existsSync','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','Using\x20agent:\x20','✗\x20ERROR:\x20Project\x20not\x20found:\x20','Running\x20agent\x20tests...','5893722gaTsZG','now','output','Project\x20path:\x20','toLowerCase','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','\x20-\x20','PASS','jsonl','reeval','text','yellow','agentName','\x20(cached)','Re-evaluating\x20cached\x20test\x20run...','red','eval','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','...','llm','tsv','writeFileSync','Passed:\x20\x20\x20'];a5_0x52c4=function(){return _0x584a08;};return a5_0x52c4();}import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x1ddf43(0x119)]='agent:test';[a5_0x1ddf43(0xf2)]='Run\x20tests\x20for\x20an\x20LLM\x20agent';async[a5_0x1ddf43(0x116)](_0x436a7d){const _0x244010=a5_0x1ddf43,{options:_0x5f1f06,args:_0x555d7b,tdx:_0x3d4b86}=_0x436a7d,_0x22f1cb=_0x555d7b[0x0]||'.',_0x11faa5=_0x5f1f06[_0x244010(0x160)],_0x4b4443=_0x5f1f06,_0x2f078b=_0x4b4443[_0x244010(0x132)]===![],_0x4c3fbe=_0x4b4443[_0x244010(0x12b)],_0x4e2662=_0x4b4443[_0x244010(0x119)],_0x59c1e9=_0x4b4443[_0x244010(0x142)],_0x38de0d=_0x5f1f06[_0x244010(0x141)],_0x251c33=_0x4b4443[_0x244010(0x124)];if(_0x4c3fbe&&_0x2f078b)return console[_0x244010(0x151)](a5_0x57ac79[_0x244010(0x131)](_0x244010(0x143))),0x1;let _0x397542='table';if(_0x4b4443['json'])_0x397542=_0x244010(0x100);else{if(_0x4b4443[_0x244010(0x12a)])_0x397542=_0x244010(0x12a);else{if(_0x4b4443[_0x244010(0x136)])_0x397542=_0x244010(0x136);else{if(_0x4b4443[_0x244010(0xfa)])_0x397542=_0x244010(0xfa);}}}const _0x93612c=_0x4b4443[_0x244010(0x144)];let _0x31c4da=_0x22f1cb;const _0x418f1e=a5_0x5187c7[_0x244010(0x11d)](_0x22f1cb),_0x278d52=_0x22f1cb==='.';if(!_0x418f1e||_0x278d52){const _0x147706=resolveProjectFromContext(_0x22f1cb,_0x93612c,{'requireFile':_0x244010(0xe5)});if(_0x147706[_0x244010(0x150)])_0x31c4da=_0x147706[_0x244010(0x147)],_0x147706['source']==='context'&&console[_0x244010(0x151)](a5_0x57ac79['dim'](_0x244010(0x11f)+_0x31c4da));else switch(_0x147706[_0x244010(0x164)]){case'no_context':console[_0x244010(0x151)](a5_0x57ac79[_0x244010(0x12d)](_0x147706[_0x244010(0x10a)])),console[_0x244010(0x151)](),console['log'](_0x244010(0x157)),console[_0x244010(0x151)]('\x20\x20tdx\x20agent\x20test\x20<path>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20from\x20path'),console[_0x244010(0x151)](_0x244010(0x110)),console[_0x244010(0x151)](),console[_0x244010(0x151)](_0x244010(0x11e));return 0x1;case _0x244010(0x14e):console[_0x244010(0x151)](a5_0x57ac79[_0x244010(0x12d)](_0x147706[_0x244010(0x10a)])),console['log'](),console['log']('Run\x20\x27tdx\x20agent\x20pull\x20'+_0x147706[_0x244010(0x144)]+_0x244010(0xec));return 0x1;case'multiple_agents':{const _0x1fc11c=a5_0x71a21a['basename'](_0x147706[_0x244010(0x147)]);console[_0x244010(0x151)](a5_0x57ac79[_0x244010(0x12d)](_0x244010(0x127)+_0x147706['llmProject']+'\x22:'));for(const _0x19253a of _0x147706['agentDirs']){console['log'](_0x244010(0xf0)+_0x19253a);}return console[_0x244010(0x151)](),console[_0x244010(0x151)](_0x244010(0xd6)+_0x1fc11c+_0x244010(0x113)),0x1;}case _0x244010(0xdc):console[_0x244010(0x151)](a5_0x57ac79['yellow'](_0x244010(0xf6)+_0x147706[_0x244010(0x144)]+'\x22.')),console[_0x244010(0x151)](a5_0x57ac79[_0x244010(0x10c)](_0x244010(0x125)+_0x147706[_0x244010(0x147)])),console[_0x244010(0x151)](),console['log'](_0x244010(0xfc));return 0x1;}}const {definition:_0x5d64c7,agentInfo:_0x90876c}=parseTestFile(_0x31c4da);let _0x278cb6=_0x5d64c7[_0x244010(0xe1)];if(_0x4e2662){const _0x49b8ce=_0x4e2662[_0x244010(0x146)](',')[_0x244010(0x118)](_0x1d2267=>_0x1d2267[_0x244010(0x14c)]());_0x278cb6=_0x5d64c7[_0x244010(0xe1)][_0x244010(0x14f)](_0x4ce465=>_0x49b8ce[_0x244010(0x108)](_0x4ce465['name']));if(_0x278cb6[_0x244010(0x152)]===0x0)return console[_0x244010(0x151)](a5_0x57ac79[_0x244010(0x12d)]('No\x20tests\x20found\x20matching:\x20'+_0x4e2662)),console[_0x244010(0x151)](a5_0x57ac79[_0x244010(0x10c)]('Available\x20tests:\x20'+_0x5d64c7[_0x244010(0xe1)]['map'](_0xc59f11=>_0xc59f11[_0x244010(0x119)])[_0x244010(0x15a)](',\x20'))),0x1;}if(_0x59c1e9){const _0x361187=_0x59c1e9['split'](',')['map'](_0x6176c=>_0x6176c[_0x244010(0x14c)]()[_0x244010(0x126)]());_0x278cb6=_0x278cb6[_0x244010(0x14f)](_0xa37319=>_0xa37319['tags']?.[_0x244010(0x11b)](_0x35970a=>_0x361187[_0x244010(0x108)](_0x35970a[_0x244010(0x126)]())));if(_0x278cb6[_0x244010(0x152)]===0x0){console[_0x244010(0x151)](a5_0x57ac79[_0x244010(0x12d)]('No\x20tests\x20found\x20with\x20tags:\x20'+_0x59c1e9));const _0x395867=new Set();return _0x5d64c7[_0x244010(0xe1)]['forEach'](_0x45a58d=>_0x45a58d[_0x244010(0x142)]?.['forEach'](_0x5bdf5a=>_0x395867[_0x244010(0x158)](_0x5bdf5a))),_0x395867['size']>0x0?console[_0x244010(0x151)](a5_0x57ac79[_0x244010(0x10c)]('Available\x20tags:\x20'+[..._0x395867][_0x244010(0x15a)](',\x20'))):console['log'](a5_0x57ac79[_0x244010(0x10c)](_0x244010(0x13f))),0x1;}}if(_0x4c3fbe)return this[_0x244010(0xef)](_0x436a7d,{'definition':{'tests':_0x278cb6},'agentInfo':_0x90876c,'outputFormat':_0x397542,'outputFile':_0x251c33,'testNames':_0x4e2662});if(_0x11faa5){console['log'](a5_0x57ac79[_0x244010(0x145)](_0x244010(0xf3))),console[_0x244010(0x151)](_0x244010(0xf7)+a5_0x57ac79[_0x244010(0xdf)](_0x38de0d)),console[_0x244010(0x151)]('\x20\x20Project:\x20'+a5_0x57ac79[_0x244010(0xdf)](_0x90876c['projectName'])),console[_0x244010(0x151)](_0x244010(0x109)+a5_0x57ac79[_0x244010(0xdf)](_0x90876c[_0x244010(0x12e)])),console[_0x244010(0x151)](),console[_0x244010(0x151)](_0x244010(0x115)+a5_0x57ac79[_0x244010(0xdf)](_0x278cb6[_0x244010(0x152)]));for(let _0x45e9df=0x0;_0x45e9df<_0x278cb6[_0x244010(0x152)];_0x45e9df++){const _0x53fbd3=_0x278cb6[_0x45e9df],_0x2c3df1=_0x53fbd3['rounds'][_0x244010(0x152)]===0x1?_0x244010(0x102):_0x244010(0x162),_0x2e0184=_0x53fbd3[_0x244010(0x142)]?.[_0x244010(0x152)]?'\x20['+_0x53fbd3[_0x244010(0x142)][_0x244010(0x15a)](',\x20')+']':'';console[_0x244010(0x151)]('\x20\x20'+(_0x45e9df+0x1)+'.\x20'+a5_0x57ac79[_0x244010(0xdf)](_0x53fbd3[_0x244010(0x119)])+'\x20('+_0x53fbd3['rounds'][_0x244010(0x152)]+'\x20'+_0x2c3df1+')'+a5_0x57ac79[_0x244010(0x10c)](_0x2e0184));}return 0x0;}let _0x2a7fe9,_0x22656f;try{_0x2a7fe9=await _0x3d4b86[_0x244010(0x135)][_0x244010(0x140)](_0x90876c[_0x244010(0xea)]);}catch(_0x4a83cb){const _0x54cf33=_0x4a83cb instanceof Error?_0x4a83cb[_0x244010(0x10a)]:String(_0x4a83cb);return _0x54cf33[_0x244010(0x108)]('404')||_0x54cf33[_0x244010(0x126)]()[_0x244010(0x108)](_0x244010(0x155))?console[_0x244010(0x151)](a5_0x57ac79[_0x244010(0x131)](_0x244010(0x120)+_0x90876c[_0x244010(0xea)])):console[_0x244010(0x151)](a5_0x57ac79['red'](_0x244010(0xf9)+_0x90876c[_0x244010(0xea)]+'\x22:\x20'+_0x54cf33)),0x1;}try{_0x22656f=await _0x3d4b86['llm']['resolveAgentId'](_0x90876c['agentName'],_0x2a7fe9);}catch(_0x60680b){const _0x52af50=_0x60680b instanceof Error?_0x60680b['message']:String(_0x60680b);return _0x52af50['includes']('404')||_0x52af50[_0x244010(0x126)]()[_0x244010(0x108)]('not\x20found')?console[_0x244010(0x151)](a5_0x57ac79[_0x244010(0x131)]('✗\x20ERROR:\x20Agent\x20not\x20found:\x20'+_0x90876c[_0x244010(0x12e)])):console[_0x244010(0x151)](a5_0x57ac79[_0x244010(0x131)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22'+_0x90876c[_0x244010(0x12e)]+_0x244010(0xdd)+_0x52af50)),0x1;}let _0x14fcba;if(!_0x2f078b)try{_0x14fcba=await setupEvaluatorAgent(_0x3d4b86[_0x244010(0x135)],_0x5f1f06['verbose']);}catch(_0x20cd43){const _0xd6dda0=_0x20cd43 instanceof Error?_0x20cd43[_0x244010(0x10a)]:String(_0x20cd43);return console['log'](a5_0x57ac79[_0x244010(0x131)](_0x244010(0x11c)+_0xd6dda0)),0x1;}console[_0x244010(0x151)](a5_0x57ac79[_0x244010(0x145)](_0x244010(0x121))),console[_0x244010(0x151)]('Site:\x20'+a5_0x57ac79[_0x244010(0xdf)](_0x38de0d)),console[_0x244010(0x151)](_0x244010(0xe7)+a5_0x57ac79['white'](_0x90876c[_0x244010(0xea)]+'/'+_0x90876c[_0x244010(0x12e)])),console[_0x244010(0x151)]();const _0x14f855=[],_0x340a5e=[],_0x506291=Date[_0x244010(0x123)]();for(let _0x3c3e29=0x0;_0x3c3e29<_0x278cb6[_0x244010(0x152)];_0x3c3e29++){const _0x5c5e56=_0x278cb6[_0x3c3e29];_0x278cb6[_0x244010(0x152)]>0x1?console[_0x244010(0x151)](_0x244010(0xd4)+(_0x3c3e29+0x1)+'/'+_0x278cb6['length']+':\x20'+a5_0x57ac79[_0x244010(0xdf)](_0x5c5e56['name'])):console[_0x244010(0x151)]('Running\x20test:\x20'+a5_0x57ac79[_0x244010(0xdf)](_0x5c5e56[_0x244010(0x119)]));const _0x274895=createCommandSpinner('Round\x201/'+_0x5c5e56['rounds'][_0x244010(0x152)]+_0x244010(0x111));_0x274895[_0x244010(0xfb)]();try{const {result:_0x409913,conversation:_0x2c1135}=await runTest(_0x3d4b86[_0x244010(0x135)],_0x5c5e56,{'agentId':_0x22656f,'projectId':_0x2a7fe9,'site':_0x38de0d,'noEval':_0x2f078b,'evaluatorId':_0x14fcba,'onRoundStart':(_0x25144e,_0x4c039f)=>{const _0x17df44=_0x244010;_0x274895[_0x17df44(0x12c)]=_0x17df44(0xd1)+(_0x25144e+0x1)+'/'+_0x4c039f+_0x17df44(0x111);},'onRoundComplete':(_0x583d6f,_0x2cac35,_0x379bda)=>{const _0x46520b=_0x244010,_0x30e7d4=formatElapsed(_0x2cac35);_0x379bda?console[_0x46520b(0x151)](_0x46520b(0xe3)+(_0x583d6f+0x1)+'/'+_0x5c5e56[_0x46520b(0x162)][_0x46520b(0x152)]+_0x46520b(0xd5)+a5_0x57ac79[_0x46520b(0x104)]('✓')+'\x20('+_0x30e7d4+')'):console[_0x46520b(0x151)](_0x46520b(0xe3)+(_0x583d6f+0x1)+'/'+_0x5c5e56['rounds'][_0x46520b(0x152)]+'...\x20'+a5_0x57ac79[_0x46520b(0x131)]('✗'));},'onEvaluationStart':()=>{const _0xa76980=_0x244010;_0x274895['text']=_0xa76980(0x156);},'onEvaluationComplete':_0x5e9d43=>{const _0x1448d0=_0x244010,_0x1c9a23=formatElapsed(_0x5e9d43);console['log'](_0x1448d0(0xd0)+a5_0x57ac79[_0x1448d0(0x104)]('✓')+'\x20('+_0x1c9a23+')');}});_0x274895[_0x244010(0xd9)](),_0x14f855['push'](_0x409913),_0x340a5e[_0x244010(0x117)](_0x2c1135);if(_0x409913['status']===_0x244010(0x129))console['log'](a5_0x57ac79[_0x244010(0x104)](_0x244010(0x153)+_0x409913[_0x244010(0x164)]));else _0x409913[_0x244010(0x161)]==='FAIL'?console[_0x244010(0x151)](a5_0x57ac79[_0x244010(0x131)]('✗\x20FAIL:\x20'+_0x409913[_0x244010(0x164)])):console[_0x244010(0x151)](a5_0x57ac79[_0x244010(0x131)](_0x244010(0xe6)+_0x409913[_0x244010(0x164)]));_0x409913[_0x244010(0x15e)]&&console[_0x244010(0x151)](a5_0x57ac79[_0x244010(0x10c)](_0x244010(0x103)+_0x409913[_0x244010(0x15e)])),console['log']();}catch(_0x53002d){_0x274895[_0x244010(0xd9)]();const _0x29ecb6=_0x53002d instanceof Error?_0x53002d['message']:String(_0x53002d);console[_0x244010(0x151)](a5_0x57ac79['red'](_0x244010(0xe6)+_0x29ecb6)),console['log'](),_0x14f855['push']({'name':_0x5c5e56[_0x244010(0x119)],'status':'ERROR','reason':_0x29ecb6,'timestamp':new Date()[_0x244010(0x101)](),'duration_ms':0x0});}}const _0x5886f1=Date[_0x244010(0x123)]()-_0x506291,_0x1cdbb3=_0x14f855[_0x244010(0x14f)](_0x48723d=>_0x48723d[_0x244010(0x161)]===_0x244010(0x129))[_0x244010(0x152)],_0x4cb43c=_0x14f855[_0x244010(0x14f)](_0x244ba7=>_0x244ba7[_0x244010(0x161)]===_0x244010(0x13b))[_0x244010(0x152)],_0x226882=_0x14f855[_0x244010(0x14f)](_0x1419f7=>_0x1419f7[_0x244010(0x161)]===_0x244010(0x139))['length'];console[_0x244010(0x151)]('━'[_0x244010(0x107)](0x3c)),console['log'](_0x244010(0xfe)),console[_0x244010(0x151)]('━'['repeat'](0x3c)),console[_0x244010(0x151)](_0x244010(0xff)+_0x14f855['length']),console[_0x244010(0x151)](_0x244010(0x138)+a5_0x57ac79['green'](_0x1cdbb3)),console[_0x244010(0x151)]('Failed:\x20\x20\x20'+a5_0x57ac79['red'](_0x4cb43c));_0x226882>0x0&&console[_0x244010(0x151)]('Errors:\x20\x20\x20'+a5_0x57ac79['red'](_0x226882));console[_0x244010(0x151)](_0x244010(0xe0)+formatElapsed(_0x5886f1)),console[_0x244010(0x151)]('━'[_0x244010(0x107)](0x3c));const _0x207b30=_0x14f855[_0x244010(0x14f)](_0xc2ac2b=>_0xc2ac2b[_0x244010(0x161)]!==_0x244010(0x129));if(_0x207b30[_0x244010(0x152)]>0x0){console['log'](),console['log'](_0x244010(0xf5));for(const _0x45eab7 of _0x207b30){const _0x599303=a5_0x57ac79[_0x244010(0x131)]('✗'),_0x5e2694=_0x45eab7['reason'][_0x244010(0x152)]>0x32?_0x45eab7[_0x244010(0x164)][_0x244010(0x154)](0x0,0x32)+_0x244010(0x134):_0x45eab7[_0x244010(0x164)];console[_0x244010(0x151)]('\x20\x20'+_0x599303+'\x20'+_0x45eab7[_0x244010(0x119)]+':\x20'+_0x5e2694);}}const _0x1fbace={'summary':{'total':_0x14f855[_0x244010(0x152)],'passed':_0x1cdbb3,'failed':_0x4cb43c,'errors':_0x226882>0x0?_0x226882:undefined,'duration_ms':_0x5886f1},'tests':_0x14f855,'agent':{'project':_0x90876c[_0x244010(0xea)],'name':_0x90876c[_0x244010(0x12e)],'site':_0x38de0d},'timestamp':new Date(_0x506291)[_0x244010(0x101)]()};try{const _0x25d040=buildCachedTestRun(_0x340a5e,{'site':_0x38de0d,'projectId':_0x2a7fe9,'projectName':_0x90876c[_0x244010(0xea)],'agentId':_0x22656f,'agentName':_0x90876c[_0x244010(0x12e)],'testYmlPath':a5_0x71a21a[_0x244010(0x13c)](_0x90876c[_0x244010(0xe8)])});saveLastTestRun(_0x25d040);}catch{}if(_0x397542!==_0x244010(0xfa)||_0x251c33){const _0x4c617f=formatResults(_0x1fbace,_0x397542);if(_0x251c33)try{a5_0x5187c7[_0x244010(0x137)](_0x251c33,_0x4c617f,_0x244010(0xfd)),console[_0x244010(0x151)](),console['log'](a5_0x57ac79['dim']('Output\x20written\x20to:\x20'+_0x251c33));}catch(_0x3aebc9){return console[_0x244010(0x151)](),console[_0x244010(0x151)](a5_0x57ac79[_0x244010(0x131)](_0x244010(0x13a)+_0x3aebc9)),0x1;}else console[_0x244010(0x151)](),console[_0x244010(0x151)](_0x4c617f);}return _0x207b30[_0x244010(0x152)]>0x0?0x1:0x0;}async[a5_0x1ddf43(0xef)](_0x241587,_0x411730){const _0x15f408=a5_0x1ddf43,{options:_0x453ced,tdx:_0x42abb7}=_0x241587,{definition:_0x1e6233,agentInfo:_0x584b4c,outputFormat:_0x3f3460,outputFile:_0xd6200a}=_0x411730,_0x2b4dad=_0x453ced[_0x15f408(0x141)],_0x32f5e3=loadLastTestRun();if(!_0x32f5e3)return console['log'](a5_0x57ac79[_0x15f408(0x131)](_0x15f408(0x10f))),console[_0x15f408(0x151)](a5_0x57ac79[_0x15f408(0x10c)](_0x15f408(0x133))),0x1;if(_0x32f5e3[_0x15f408(0xf8)][_0x15f408(0x12e)]!==_0x584b4c[_0x15f408(0x12e)])return console[_0x15f408(0x151)](a5_0x57ac79[_0x15f408(0x131)](_0x15f408(0xdb)+_0x32f5e3[_0x15f408(0xf8)][_0x15f408(0x12e)]+_0x15f408(0xf4)+_0x584b4c[_0x15f408(0x12e)]+'\x22.')),console[_0x15f408(0x151)](a5_0x57ac79[_0x15f408(0x10c)](_0x15f408(0x163))),0x1;const _0xbde1d1=new Set(_0x32f5e3[_0x15f408(0xda)][_0x15f408(0x118)](_0xc14fe7=>_0xc14fe7['testName'])),_0x353cf8=_0x1e6233[_0x15f408(0xe1)][_0x15f408(0x14f)](_0x1b274f=>!_0xbde1d1[_0x15f408(0x15c)](_0x1b274f[_0x15f408(0x119)]));if(_0x353cf8[_0x15f408(0x152)]>0x0&&_0x32f5e3[_0x15f408(0x141)]!==_0x2b4dad)return console[_0x15f408(0x151)](a5_0x57ac79[_0x15f408(0x131)](_0x15f408(0xe9))),console[_0x15f408(0x151)](a5_0x57ac79[_0x15f408(0x10c)](_0x15f408(0x148)+_0x32f5e3[_0x15f408(0x141)]+_0x15f408(0xde)+_0x2b4dad+'\x22.')),console['log'](a5_0x57ac79['dim'](_0x15f408(0xeb)+_0x32f5e3[_0x15f408(0x141)]+_0x15f408(0xd2))),0x1;const _0xb04c4a=_0x1e6233[_0x15f408(0xe1)][_0x15f408(0x14f)](_0x3d68da=>_0xbde1d1[_0x15f408(0x15c)](_0x3d68da[_0x15f408(0x119)])),_0xd20de6=_0x353cf8;let _0x11cf96;try{_0x11cf96=await setupEvaluatorAgent(_0x42abb7[_0x15f408(0x135)],_0x453ced['verbose']);}catch(_0x284719){const _0x17221c=_0x284719 instanceof Error?_0x284719[_0x15f408(0x10a)]:String(_0x284719);return console[_0x15f408(0x151)](a5_0x57ac79[_0x15f408(0x131)](_0x15f408(0x11c)+_0x17221c)),0x1;}console['log'](a5_0x57ac79['cyan'](_0x15f408(0x130))),console[_0x15f408(0x151)](_0x15f408(0x114)+a5_0x57ac79[_0x15f408(0xdf)](_0x32f5e3[_0x15f408(0xd3)])),console[_0x15f408(0x151)](_0x15f408(0xe7)+a5_0x57ac79[_0x15f408(0xdf)](_0x32f5e3[_0x15f408(0xf8)][_0x15f408(0xea)]+'/'+_0x32f5e3['agent'][_0x15f408(0x12e)]));_0xd20de6[_0x15f408(0x152)]>0x0&&console[_0x15f408(0x151)]('New\x20tests\x20to\x20execute:\x20'+a5_0x57ac79[_0x15f408(0x12d)](_0xd20de6['length']));console['log']();const _0x14643d=[],_0x46e46d=Date[_0x15f408(0x123)](),_0x52a02b=createCommandSpinner(_0x15f408(0x14a));if(_0xb04c4a[_0x15f408(0x152)]>0x0)try{const _0x3d41d7=await reevaluateFromCache(_0x42abb7[_0x15f408(0x135)],_0x32f5e3,{'tests':_0xb04c4a},{'evaluatorId':_0x11cf96,'onTestStart':(_0x30c47b,_0x44c11,_0x5a3748)=>{const _0x3030f9=_0x15f408;_0x52a02b['text']=_0x3030f9(0x11a)+(_0x44c11+0x1)+'/'+_0x5a3748+':\x20'+_0x30c47b+_0x3030f9(0x134);if(!_0x52a02b[_0x3030f9(0x10e)])_0x52a02b[_0x3030f9(0xfb)]();},'onTestComplete':(_0x1f8307,_0x279373)=>{const _0x396da4=_0x15f408;_0x52a02b['stop']();if(_0x279373[_0x396da4(0x161)]===_0x396da4(0x129))console[_0x396da4(0x151)](a5_0x57ac79[_0x396da4(0x104)]('✓\x20PASS:\x20'+_0x1f8307)+a5_0x57ac79['dim'](_0x396da4(0x12f)));else _0x279373['status']===_0x396da4(0x13b)?console['log'](a5_0x57ac79[_0x396da4(0x131)](_0x396da4(0xf1)+_0x1f8307+_0x396da4(0x128)+_0x279373[_0x396da4(0x164)])+a5_0x57ac79[_0x396da4(0x10c)](_0x396da4(0x12f))):console[_0x396da4(0x151)](a5_0x57ac79['red']('✗\x20ERROR:\x20'+_0x1f8307+_0x396da4(0x128)+_0x279373[_0x396da4(0x164)]));_0x279373[_0x396da4(0x15e)]&&console[_0x396da4(0x151)](a5_0x57ac79[_0x396da4(0x10c)](_0x396da4(0x112)+_0x279373[_0x396da4(0x15e)])),_0x14643d[_0x396da4(0x117)](_0x279373);},'onTestSkipped':(_0x17cc35,_0x46231a)=>{const _0x3d65fd=_0x15f408;_0x52a02b[_0x3d65fd(0xd9)](),console[_0x3d65fd(0x151)](a5_0x57ac79[_0x3d65fd(0x12d)](_0x3d65fd(0x159)+_0x17cc35+_0x3d65fd(0x128)+_0x46231a));}});for(const _0x2bd7ad of _0x3d41d7){!_0x14643d['find'](_0x3b2546=>_0x3b2546['name']===_0x2bd7ad[_0x15f408(0x119)])&&_0x14643d[_0x15f408(0x117)](_0x2bd7ad);}}catch(_0x308e5b){_0x52a02b['stop']();const _0x2c398e=_0x308e5b instanceof Error?_0x308e5b[_0x15f408(0x10a)]:String(_0x308e5b);return console[_0x15f408(0x151)](a5_0x57ac79[_0x15f408(0x131)](_0x15f408(0xee)+_0x2c398e)),0x1;}_0x52a02b['stop']();if(_0xd20de6[_0x15f408(0x152)]>0x0){console[_0x15f408(0x151)](),console[_0x15f408(0x151)](a5_0x57ac79[_0x15f408(0x145)](_0x15f408(0x14d)));const {projectId:_0x527c39,agentId:_0x4f439c}=_0x32f5e3[_0x15f408(0xf8)];for(const _0x4a3583 of _0xd20de6){console[_0x15f408(0x151)](_0x15f408(0x15f)+a5_0x57ac79['white'](_0x4a3583['name']));const _0x1fba74=createCommandSpinner(_0x15f408(0xd7)+_0x4a3583[_0x15f408(0x162)][_0x15f408(0x152)]+_0x15f408(0x111));_0x1fba74['start']();try{const {result:_0x49fb99}=await runTest(_0x42abb7[_0x15f408(0x135)],_0x4a3583,{'agentId':_0x4f439c,'projectId':_0x527c39,'site':_0x32f5e3['site'],'noEval':![],'evaluatorId':_0x11cf96,'onRoundStart':(_0x4e5412,_0x2b6acd)=>{const _0x3594d2=_0x15f408;_0x1fba74[_0x3594d2(0x12c)]=_0x3594d2(0xd1)+(_0x4e5412+0x1)+'/'+_0x2b6acd+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x4b2996,_0x3fbe15,_0x4d0ba1)=>{const _0x527d31=_0x15f408,_0x20283d=formatElapsed(_0x3fbe15);_0x4d0ba1?console[_0x527d31(0x151)](_0x527d31(0xe3)+(_0x4b2996+0x1)+'/'+_0x4a3583[_0x527d31(0x162)][_0x527d31(0x152)]+_0x527d31(0xd5)+a5_0x57ac79[_0x527d31(0x104)]('✓')+'\x20('+_0x20283d+')'):console[_0x527d31(0x151)]('\x20\x20Round\x20'+(_0x4b2996+0x1)+'/'+_0x4a3583['rounds'][_0x527d31(0x152)]+'...\x20'+a5_0x57ac79['red']('✗'));},'onEvaluationStart':()=>{const _0x13f9e6=_0x15f408;_0x1fba74[_0x13f9e6(0x12c)]=_0x13f9e6(0x156);},'onEvaluationComplete':_0x36ff56=>{const _0x24ac42=_0x15f408,_0x268e6c=formatElapsed(_0x36ff56);console['log'](_0x24ac42(0xd0)+a5_0x57ac79['green']('✓')+'\x20('+_0x268e6c+')');}});_0x1fba74[_0x15f408(0xd9)](),_0x14643d[_0x15f408(0x117)](_0x49fb99);if(_0x49fb99[_0x15f408(0x161)]===_0x15f408(0x129))console[_0x15f408(0x151)](a5_0x57ac79[_0x15f408(0x104)](_0x15f408(0x153)+_0x49fb99[_0x15f408(0x164)])+a5_0x57ac79[_0x15f408(0x10c)](_0x15f408(0x10b)));else _0x49fb99['status']===_0x15f408(0x13b)?console['log'](a5_0x57ac79[_0x15f408(0x131)](_0x15f408(0xf1)+_0x49fb99[_0x15f408(0x164)])+a5_0x57ac79[_0x15f408(0x10c)](_0x15f408(0x10b))):console[_0x15f408(0x151)](a5_0x57ac79[_0x15f408(0x131)](_0x15f408(0xe6)+_0x49fb99[_0x15f408(0x164)]));_0x49fb99[_0x15f408(0x15e)]&&console[_0x15f408(0x151)](a5_0x57ac79['dim'](_0x15f408(0x112)+_0x49fb99[_0x15f408(0x15e)]));}catch(_0x3c9f05){_0x1fba74[_0x15f408(0xd9)]();const _0x54ab9b=_0x3c9f05 instanceof Error?_0x3c9f05[_0x15f408(0x10a)]:String(_0x3c9f05);console[_0x15f408(0x151)](a5_0x57ac79[_0x15f408(0x131)]('✗\x20ERROR:\x20'+_0x54ab9b)),_0x14643d['push']({'name':_0x4a3583[_0x15f408(0x119)],'status':_0x15f408(0x139),'reason':_0x54ab9b,'timestamp':new Date()[_0x15f408(0x101)](),'duration_ms':0x0});}}}console[_0x15f408(0x151)]();const _0x9ffa0f=Date['now']()-_0x46e46d,_0x5d41e5=_0x14643d[_0x15f408(0x14f)](_0x28cccb=>_0x28cccb[_0x15f408(0x161)]==='PASS')[_0x15f408(0x152)],_0xb37796=_0x14643d[_0x15f408(0x14f)](_0x307ee6=>_0x307ee6[_0x15f408(0x161)]===_0x15f408(0x13b))[_0x15f408(0x152)],_0x29adfc=_0x14643d[_0x15f408(0x14f)](_0x16abc2=>_0x16abc2['status']==='ERROR')[_0x15f408(0x152)];console[_0x15f408(0x151)]('━'[_0x15f408(0x107)](0x3c)),console[_0x15f408(0x151)](_0x15f408(0xd8)),console['log']('━'[_0x15f408(0x107)](0x3c)),console[_0x15f408(0x151)]('Total:\x20\x20\x20\x20'+_0x14643d[_0x15f408(0x152)]),console[_0x15f408(0x151)](_0x15f408(0x138)+a5_0x57ac79[_0x15f408(0x104)](_0x5d41e5)),console['log'](_0x15f408(0x13d)+a5_0x57ac79[_0x15f408(0x131)](_0xb37796));_0x29adfc>0x0&&console['log'](_0x15f408(0x149)+a5_0x57ac79[_0x15f408(0x131)](_0x29adfc));console[_0x15f408(0x151)](_0x15f408(0xe0)+formatElapsed(_0x9ffa0f)),console[_0x15f408(0x151)]('━'[_0x15f408(0x107)](0x3c));const _0x55169f={'summary':{'total':_0x14643d[_0x15f408(0x152)],'passed':_0x5d41e5,'failed':_0xb37796,'errors':_0x29adfc>0x0?_0x29adfc:undefined,'duration_ms':_0x9ffa0f},'tests':_0x14643d,'agent':{'project':_0x584b4c[_0x15f408(0xea)],'name':_0x584b4c['agentName'],'site':_0x2b4dad},'timestamp':new Date(_0x46e46d)['toISOString']()};if(_0x3f3460!==_0x15f408(0xfa)||_0xd6200a){const _0x4389df=formatResults(_0x55169f,_0x3f3460);if(_0xd6200a)try{a5_0x5187c7[_0x15f408(0x137)](_0xd6200a,_0x4389df,_0x15f408(0xfd)),console['log'](),console['log'](a5_0x57ac79['dim'](_0x15f408(0x106)+_0xd6200a));}catch(_0x542f52){return console['log'](),console['log'](a5_0x57ac79[_0x15f408(0x131)](_0x15f408(0x13a)+_0x542f52)),0x1;}else console[_0x15f408(0x151)](),console[_0x15f408(0x151)](_0x4389df);}const _0x4d3806=_0x14643d[_0x15f408(0x14f)](_0x58fbed=>_0x58fbed[_0x15f408(0x161)]!==_0x15f408(0x129));return _0x4d3806['length']>0x0?0x1:0x0;}}
@@ -1 +1 @@
1
- const a6_0x1d5f03=a6_0x2c57;(function(_0x8e71c6,_0xf4e135){const _0x1bbac3=a6_0x2c57,_0x4cf04c=_0x8e71c6();while(!![]){try{const _0x4911f1=parseInt(_0x1bbac3(0x141))/0x1*(-parseInt(_0x1bbac3(0x13c))/0x2)+parseInt(_0x1bbac3(0x144))/0x3+-parseInt(_0x1bbac3(0x165))/0x4+-parseInt(_0x1bbac3(0x16a))/0x5*(parseInt(_0x1bbac3(0x133))/0x6)+-parseInt(_0x1bbac3(0x166))/0x7*(parseInt(_0x1bbac3(0x153))/0x8)+-parseInt(_0x1bbac3(0x16c))/0x9*(-parseInt(_0x1bbac3(0x15c))/0xa)+parseInt(_0x1bbac3(0x14c))/0xb;if(_0x4911f1===_0xf4e135)break;else _0x4cf04c['push'](_0x4cf04c['shift']());}catch(_0x3ac16f){_0x4cf04c['push'](_0x4cf04c['shift']());}}}(a6_0x1a76,0x33334));function a6_0x1a76(){const _0x493ba9=['length','109818FWABVi','method','toUpperCase','cdp','status','workflow','cookie','has','message','534110CgAIlJ','Results\x20saved\x20to\x20','<\x20HTTP/1.1\x20','validate','entries','1BQPdoP','llm-proxy','set-cookie2','687444qYRSQW','stack','\x22.\x20','readBodyFromFile','indexOf','file','x-auth-token','GET','9227064kViAfb','output','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','includes','color','.\x20Valid\x20types:\x20','proxy-authorization','824RfFiKS','substring','headers','header','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','verbose','join','type','noColor','250lXeCXc','request','trino','PUT','error','DELETE','x-trino-user','api','Error:\x20','1387712VdCGXy','26313YExnss','body','site','POST','35rnsjrI','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','97569aHMCGj','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','Invalid\x20API\x20type:\x20','data','log','name','Invalid\x20header\x20format:\x20\x22','llm','Endpoint\x20must\x20start\x20with\x20/:\x20','PATCH','description','toLowerCase','keys'];a6_0x1a76=function(){return _0x493ba9;};return a6_0x1a76();}import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set(['authorization',a6_0x1d5f03(0x152),a6_0x1d5f03(0x139),'set-cookie',a6_0x1d5f03(0x143),'x-xsrf-token',a6_0x1d5f03(0x14a),a6_0x1d5f03(0x162)]);function isSensitiveHeader(_0x38aa46){const _0x3dbf8d=a6_0x1d5f03;return SENSITIVE_HEADERS[_0x3dbf8d(0x13a)](_0x38aa46[_0x3dbf8d(0x177)]());}function a6_0x2c57(_0x25f0b9,_0x447d25){_0x25f0b9=_0x25f0b9-0x132;const _0x1a76c9=a6_0x1a76();let _0x2c57dc=_0x1a76c9[_0x25f0b9];return _0x2c57dc;}function parseHeader(_0x531884){const _0x45d09f=a6_0x1d5f03,_0x5e797b=_0x531884[_0x45d09f(0x148)](':');if(_0x5e797b===-0x1)throw new Error(_0x45d09f(0x172)+_0x531884+_0x45d09f(0x146)+_0x45d09f(0x157));const _0x26a406=_0x531884[_0x45d09f(0x154)](0x0,_0x5e797b)['trim'](),_0x518ef9=_0x531884[_0x45d09f(0x154)](_0x5e797b+0x1)['trim']();if(!_0x26a406)throw new Error(_0x45d09f(0x14e)+_0x531884+'\x22');return[_0x26a406,_0x518ef9];}export class ApiCommand extends BaseCommand{[a6_0x1d5f03(0x171)]=a6_0x1d5f03(0x163);[a6_0x1d5f03(0x176)]='Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs';[a6_0x1d5f03(0x13f)](_0x3a6bf0){const _0x3ed715=a6_0x1d5f03,{args:_0x2171f3,options:_0x680439}=_0x3a6bf0,_0x31bb6d=_0x680439;if(_0x2171f3['length']===0x0)return _0x3ed715(0x16b);const _0x45cfeb=_0x2171f3[0x0];if(!_0x45cfeb['startsWith']('/'))return _0x3ed715(0x174)+_0x45cfeb;const _0x6edb8b=_0x31bb6d[_0x3ed715(0x16f)],_0x497263=_0x31bb6d['file'];if(_0x6edb8b&&_0x497263)return _0x3ed715(0x16d);const _0x1e2acd=_0x31bb6d[_0x3ed715(0x134)]||_0x3ed715(0x14b),_0x7a31ba=[_0x3ed715(0x14b),_0x3ed715(0x169),_0x3ed715(0x15f),_0x3ed715(0x161),_0x3ed715(0x175)];if(!_0x7a31ba[_0x3ed715(0x14f)](_0x1e2acd[_0x3ed715(0x135)]()))return'Invalid\x20HTTP\x20method:\x20'+_0x1e2acd+'.\x20Valid\x20methods:\x20'+_0x7a31ba[_0x3ed715(0x159)](',\x20');const _0x1e0079=_0x31bb6d[_0x3ed715(0x15a)]||'td',_0x23cac7=['td',_0x3ed715(0x136),_0x3ed715(0x138),_0x3ed715(0x15e),_0x3ed715(0x173),_0x3ed715(0x142)];if(!_0x23cac7[_0x3ed715(0x14f)](_0x1e0079))return _0x3ed715(0x16e)+_0x1e0079+_0x3ed715(0x151)+_0x23cac7['join'](',\x20');return undefined;}async['execute'](_0x2565ff){const _0x2463a8=a6_0x1d5f03,{options:_0x4a3d97,args:_0x4cb067,tdx:_0x46a0dd}=_0x2565ff,_0x33338d=_0x4a3d97,_0x2517ba=_0x4cb067[0x0],_0x307792=(_0x33338d[_0x2463a8(0x134)]||_0x2463a8(0x14b))['toUpperCase'](),_0x513fa1=_0x33338d[_0x2463a8(0x16f)],_0x2db66a=_0x33338d[_0x2463a8(0x149)],_0x291bd8=_0x33338d[_0x2463a8(0x156)],_0x5a17d7=_0x33338d[_0x2463a8(0x15a)]||'td';try{const _0x43af81={};if(_0x291bd8){const _0x17662f=Array['isArray'](_0x291bd8)?_0x291bd8:[_0x291bd8];for(const _0x5c4da5 of _0x17662f){const [_0x3e8a56,_0x2fdf2b]=parseHeader(_0x5c4da5);_0x43af81[_0x3e8a56]=_0x2fdf2b;}}let _0x2ad376;if(_0x513fa1)_0x2ad376=_0x513fa1;else{if(_0x2db66a)try{_0x2ad376=RawAPI[_0x2463a8(0x147)](_0x2db66a);}catch(_0x1ede0d){return console[_0x2463a8(0x160)](_0x2463a8(0x164)+(_0x1ede0d instanceof Error?_0x1ede0d[_0x2463a8(0x13b)]:String(_0x1ede0d))),0x1;}}const _0xf13bb5={'method':_0x307792,'apiType':_0x5a17d7,'includeHeaders':_0x4a3d97[_0x2463a8(0x158)]};_0x2ad376&&(_0xf13bb5[_0x2463a8(0x167)]=_0x2ad376);Object[_0x2463a8(0x178)](_0x43af81)[_0x2463a8(0x132)]>0x0&&(_0xf13bb5[_0x2463a8(0x155)]=_0x43af81);if(_0x4a3d97[_0x2463a8(0x158)]){const _0x4ecdfc=resolveSite(_0x4a3d97[_0x2463a8(0x168)]),_0x42afc6=getEndpoint(_0x4ecdfc,_0x5a17d7),_0x292c46=''+_0x42afc6+_0x2517ba;console[_0x2463a8(0x160)]('>\x20'+_0x307792+'\x20'+_0x292c46);const _0x2410bb=getAuthHeaders(_0x4ecdfc),_0x48e419={..._0x2410bb,..._0x43af81};for(const [_0x1f5807,_0x1ed810]of Object['entries'](_0x48e419)){!isSensitiveHeader(_0x1f5807)&&console[_0x2463a8(0x160)]('>\x20'+_0x1f5807+':\x20'+_0x1ed810);}_0x2ad376&&console[_0x2463a8(0x160)]('>'),console[_0x2463a8(0x160)]('');}const _0x5299bb=await _0x46a0dd['api'][_0x2463a8(0x15d)](_0x2517ba,_0xf13bb5);if(_0x4a3d97[_0x2463a8(0x158)]&&_0x5299bb['headers']){console[_0x2463a8(0x160)](_0x2463a8(0x13e)+_0x5299bb[_0x2463a8(0x137)]);for(const [_0x561e7b,_0x431106]of Object[_0x2463a8(0x140)](_0x5299bb[_0x2463a8(0x155)])){!isSensitiveHeader(_0x561e7b)&&console[_0x2463a8(0x160)]('<\x20'+_0x561e7b+':\x20'+_0x431106);}console[_0x2463a8(0x160)]('');}const _0x19a045=Boolean(_0x4a3d97[_0x2463a8(0x14d)]),_0x128646={'color':_0x4a3d97[_0x2463a8(0x150)],'noColor':_0x4a3d97[_0x2463a8(0x15b)]||_0x19a045&&!_0x4a3d97['color']},_0x5d6695=colorizeJSON(_0x5299bb[_0x2463a8(0x16f)],_0x128646);return _0x4a3d97[_0x2463a8(0x14d)]?(writeFileSync(_0x4a3d97[_0x2463a8(0x14d)],_0x5d6695),console[_0x2463a8(0x160)](_0x2463a8(0x13d)+_0x4a3d97[_0x2463a8(0x14d)])):console[_0x2463a8(0x170)](_0x5d6695),0x0;}catch(_0x353dc5){return _0x353dc5 instanceof Error?(console[_0x2463a8(0x160)](_0x2463a8(0x164)+_0x353dc5[_0x2463a8(0x13b)]),_0x4a3d97[_0x2463a8(0x158)]&&_0x353dc5[_0x2463a8(0x145)]&&console['error']('\x0aStack\x20trace:\x0a'+_0x353dc5[_0x2463a8(0x145)])):console['error'](_0x2463a8(0x164)+String(_0x353dc5)),0x1;}}}
1
+ const a6_0x500da4=a6_0x21a4;function a6_0x21a4(_0x21df0e,_0x3889a4){_0x21df0e=_0x21df0e-0x1e7;const _0x5d44b6=a6_0x5d44();let _0x21a415=_0x5d44b6[_0x21df0e];return _0x21a415;}(function(_0x3ceea7,_0x1aec84){const _0x37aa3a=a6_0x21a4,_0x190f97=_0x3ceea7();while(!![]){try{const _0x2213a0=parseInt(_0x37aa3a(0x1f9))/0x1*(parseInt(_0x37aa3a(0x200))/0x2)+-parseInt(_0x37aa3a(0x1f6))/0x3*(parseInt(_0x37aa3a(0x1fa))/0x4)+-parseInt(_0x37aa3a(0x208))/0x5+-parseInt(_0x37aa3a(0x21c))/0x6*(-parseInt(_0x37aa3a(0x210))/0x7)+parseInt(_0x37aa3a(0x1ef))/0x8+-parseInt(_0x37aa3a(0x20f))/0x9*(parseInt(_0x37aa3a(0x21e))/0xa)+-parseInt(_0x37aa3a(0x20d))/0xb*(parseInt(_0x37aa3a(0x203))/0xc);if(_0x2213a0===_0x1aec84)break;else _0x190f97['push'](_0x190f97['shift']());}catch(_0x510ba4){_0x190f97['push'](_0x190f97['shift']());}}}(a6_0x5d44,0x5188c));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a6_0x500da4(0x201),a6_0x500da4(0x20c),a6_0x500da4(0x20e),a6_0x500da4(0x1ea),a6_0x500da4(0x1fc),a6_0x500da4(0x207),a6_0x500da4(0x21b),a6_0x500da4(0x1eb)]);function isSensitiveHeader(_0xd97c3d){const _0x4e4818=a6_0x500da4;return SENSITIVE_HEADERS[_0x4e4818(0x21f)](_0xd97c3d[_0x4e4818(0x209)]());}function parseHeader(_0x3cf57c){const _0x3f8120=a6_0x500da4,_0x4da487=_0x3cf57c[_0x3f8120(0x1ed)](':');if(_0x4da487===-0x1)throw new Error(_0x3f8120(0x1ec)+_0x3cf57c+_0x3f8120(0x1f7)+'Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22');const _0x5dbdfb=_0x3cf57c[_0x3f8120(0x213)](0x0,_0x4da487)[_0x3f8120(0x202)](),_0x1354ef=_0x3cf57c[_0x3f8120(0x213)](_0x4da487+0x1)[_0x3f8120(0x202)]();if(!_0x5dbdfb)throw new Error(_0x3f8120(0x225)+_0x3cf57c+'\x22');return[_0x5dbdfb,_0x1354ef];}function a6_0x5d44(){const _0x33e0bf=['15288CaFnqm','POST','.\x20Valid\x20methods:\x20','name','x-xsrf-token','1411485TcBlJk','toLowerCase','error','site','proxy-authorization','275kFUdaW','cookie','9TOCiPX','58107vmNyqW','Invalid\x20HTTP\x20method:\x20','status','substring','data','PATCH','api','entries','readBodyFromFile','execute','method','x-auth-token','414DfugQT','description','3256570DPFFkh','has','includes','join','Results\x20saved\x20to\x20','validate','headers','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','\x0aStack\x20trace:\x0a','output','log','toUpperCase','cdp','message','set-cookie','x-trino-user','Invalid\x20header\x20format:\x20\x22','indexOf','request','3701272JbJewx','trino','GET','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','body','<\x20HTTP/1.1\x20','verbose','614316rpjIMJ','\x22.\x20','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','536pskrcK','4ixqACA','Error:\x20','set-cookie2','type','workflow','noColor','534aItwZL','authorization','trim'];a6_0x5d44=function(){return _0x33e0bf;};return a6_0x5d44();}export class ApiCommand extends BaseCommand{[a6_0x500da4(0x206)]=a6_0x500da4(0x216);[a6_0x500da4(0x21d)]=a6_0x500da4(0x1f2);[a6_0x500da4(0x223)](_0x254d10){const _0xe7cb9d=a6_0x500da4,{args:_0x393b99,options:_0x1e8290}=_0x254d10,_0xf1af23=_0x1e8290;if(_0x393b99['length']===0x0)return'Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list';const _0x5ef053=_0x393b99[0x0];if(!_0x5ef053['startsWith']('/'))return'Endpoint\x20must\x20start\x20with\x20/:\x20'+_0x5ef053;const _0x286263=_0xf1af23['data'],_0x272de8=_0xf1af23['file'];if(_0x286263&&_0x272de8)return _0xe7cb9d(0x1f8);const _0x270a8b=_0xf1af23[_0xe7cb9d(0x21a)]||'GET',_0x363661=[_0xe7cb9d(0x1f1),_0xe7cb9d(0x204),'PUT','DELETE',_0xe7cb9d(0x215)];if(!_0x363661[_0xe7cb9d(0x220)](_0x270a8b[_0xe7cb9d(0x1e7)]()))return _0xe7cb9d(0x211)+_0x270a8b+_0xe7cb9d(0x205)+_0x363661[_0xe7cb9d(0x221)](',\x20');const _0x21af86=_0xf1af23[_0xe7cb9d(0x1fd)]||'td',_0x2d1d90=['td',_0xe7cb9d(0x1e8),_0xe7cb9d(0x1fe),_0xe7cb9d(0x1f0),'llm','llm-proxy'];if(!_0x2d1d90[_0xe7cb9d(0x220)](_0x21af86))return'Invalid\x20API\x20type:\x20'+_0x21af86+'.\x20Valid\x20types:\x20'+_0x2d1d90[_0xe7cb9d(0x221)](',\x20');return undefined;}async[a6_0x500da4(0x219)](_0x1cb796){const _0x13d0c3=a6_0x500da4,{options:_0x3901b6,args:_0x55db36,tdx:_0x211113}=_0x1cb796,_0x277402=_0x3901b6,_0x489da1=_0x55db36[0x0],_0x3ff223=(_0x277402[_0x13d0c3(0x21a)]||_0x13d0c3(0x1f1))[_0x13d0c3(0x1e7)](),_0x6d4427=_0x277402[_0x13d0c3(0x214)],_0xf6ef2f=_0x277402['file'],_0xd5d818=_0x277402['header'],_0x2a729f=_0x277402[_0x13d0c3(0x1fd)]||'td';try{const _0x9a47b7={};if(_0xd5d818){const _0x48f164=Array['isArray'](_0xd5d818)?_0xd5d818:[_0xd5d818];for(const _0x18bd60 of _0x48f164){const [_0x419c8b,_0x5db9d5]=parseHeader(_0x18bd60);_0x9a47b7[_0x419c8b]=_0x5db9d5;}}let _0x38a803;if(_0x6d4427)_0x38a803=_0x6d4427;else{if(_0xf6ef2f)try{_0x38a803=RawAPI[_0x13d0c3(0x218)](_0xf6ef2f);}catch(_0x43b420){return console[_0x13d0c3(0x20a)](_0x13d0c3(0x1fb)+(_0x43b420 instanceof Error?_0x43b420[_0x13d0c3(0x1e9)]:String(_0x43b420))),0x1;}}const _0x51a20a={'method':_0x3ff223,'apiType':_0x2a729f,'includeHeaders':_0x3901b6[_0x13d0c3(0x1f5)]};_0x38a803&&(_0x51a20a[_0x13d0c3(0x1f3)]=_0x38a803);Object['keys'](_0x9a47b7)['length']>0x0&&(_0x51a20a[_0x13d0c3(0x224)]=_0x9a47b7);if(_0x3901b6[_0x13d0c3(0x1f5)]){const _0x2f7260=resolveSite(_0x3901b6[_0x13d0c3(0x20b)]),_0x26197e=getEndpoint(_0x2f7260,_0x2a729f),_0x47a2ff=''+_0x26197e+_0x489da1;console['error']('>\x20'+_0x3ff223+'\x20'+_0x47a2ff);const _0x41fc22=getAuthHeaders(_0x2f7260),_0x5ccdcc={..._0x41fc22,..._0x9a47b7};for(const [_0x2bc818,_0x3e0de3]of Object[_0x13d0c3(0x217)](_0x5ccdcc)){!isSensitiveHeader(_0x2bc818)&&console[_0x13d0c3(0x20a)]('>\x20'+_0x2bc818+':\x20'+_0x3e0de3);}_0x38a803&&console[_0x13d0c3(0x20a)]('>'),console['error']('');}const _0xc3c185=await _0x211113[_0x13d0c3(0x216)][_0x13d0c3(0x1ee)](_0x489da1,_0x51a20a);if(_0x3901b6['verbose']&&_0xc3c185[_0x13d0c3(0x224)]){console['error'](_0x13d0c3(0x1f4)+_0xc3c185[_0x13d0c3(0x212)]);for(const [_0x572a48,_0x17b55b]of Object[_0x13d0c3(0x217)](_0xc3c185['headers'])){!isSensitiveHeader(_0x572a48)&&console[_0x13d0c3(0x20a)]('<\x20'+_0x572a48+':\x20'+_0x17b55b);}console['error']('');}const _0x4a9f08=Boolean(_0x3901b6[_0x13d0c3(0x227)]),_0xc85376={'color':_0x3901b6['color'],'noColor':_0x3901b6[_0x13d0c3(0x1ff)]||_0x4a9f08&&!_0x3901b6['color']},_0x33e1ed=colorizeJSON(_0xc3c185['data'],_0xc85376);return _0x3901b6[_0x13d0c3(0x227)]?(writeFileSync(_0x3901b6[_0x13d0c3(0x227)],_0x33e1ed),console[_0x13d0c3(0x20a)](_0x13d0c3(0x222)+_0x3901b6[_0x13d0c3(0x227)])):console[_0x13d0c3(0x228)](_0x33e1ed),0x0;}catch(_0x32f445){return _0x32f445 instanceof Error?(console[_0x13d0c3(0x20a)](_0x13d0c3(0x1fb)+_0x32f445[_0x13d0c3(0x1e9)]),_0x3901b6[_0x13d0c3(0x1f5)]&&_0x32f445['stack']&&console[_0x13d0c3(0x20a)](_0x13d0c3(0x226)+_0x32f445['stack'])):console[_0x13d0c3(0x20a)](_0x13d0c3(0x1fb)+String(_0x32f445)),0x1;}}}
@@ -1 +1 @@
1
- const a7_0x3683e3=a7_0x5902;(function(_0x48e66a,_0xbe9309){const _0x31ca08=a7_0x5902,_0x111f36=_0x48e66a();while(!![]){try{const _0x325d1a=-parseInt(_0x31ca08(0x1af))/0x1+-parseInt(_0x31ca08(0x1c9))/0x2*(parseInt(_0x31ca08(0x19a))/0x3)+parseInt(_0x31ca08(0x1dd))/0x4+-parseInt(_0x31ca08(0x1cd))/0x5*(parseInt(_0x31ca08(0x1bf))/0x6)+-parseInt(_0x31ca08(0x1dc))/0x7*(parseInt(_0x31ca08(0x1d7))/0x8)+-parseInt(_0x31ca08(0x1c2))/0x9+parseInt(_0x31ca08(0x1c3))/0xa;if(_0x325d1a===_0xbe9309)break;else _0x111f36['push'](_0x111f36['shift']());}catch(_0x5900a7){_0x111f36['push'](_0x111f36['shift']());}}}(a7_0x2097,0xcb748));import{BaseCommand,printAuthError}from'./command.js';function a7_0x5902(_0x5e468e,_0x5f114f){_0x5e468e=_0x5e468e-0x195;const _0x209729=a7_0x2097();let _0x590206=_0x209729[_0x5e468e];return _0x590206;}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_0x1831ce 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_0x464769 from'chalk';export class AuthSetupCommand extends BaseCommand{['name']='auth:setup';[a7_0x3683e3(0x1d1)]='Setup\x20API\x20key\x20authentication\x20interactively';async[a7_0x3683e3(0x1b1)](_0x492280){const _0x39da15=a7_0x3683e3,{options:_0x2b2fbd}=_0x492280,_0x555d63=_0x2b2fbd[_0x39da15(0x1a0)];console[_0x39da15(0x1d9)](a7_0x464769[_0x39da15(0x1ab)](_0x39da15(0x197)));const _0x359d36=_0x2b2fbd[_0x39da15(0x198)]||_0x39da15(0x1a3),{choices:_0x529516,initialIndex:_0x4a0d02}=buildSiteChoices(_0x359d36),_0x3bca0f=_0x555d63?_0x39da15(0x1d6)+_0x555d63+'):':_0x39da15(0x1b4),_0x2c4508=await a7_0x1831ce({'type':'select','name':_0x39da15(0x198),'message':_0x3bca0f,'choices':_0x529516,'initial':_0x4a0d02});if(!_0x2c4508[_0x39da15(0x198)])return console[_0x39da15(0x1d9)](_0x39da15(0x1d0)),0x1;let _0x5baa83;if(_0x2c4508[_0x39da15(0x198)]===_0x39da15(0x19e)){const _0x1d3017=await a7_0x1831ce({'type':_0x39da15(0x1ad),'name':_0x39da15(0x1bd),'message':_0x39da15(0x1a2),'initial':'us01','validate':_0x27c8f6=>{const _0x381358=_0x39da15;if(!_0x27c8f6||!_0x27c8f6['trim']())return _0x381358(0x1cb);if(!/^[a-z0-9-]+$/[_0x381358(0x199)](_0x27c8f6['trim']()))return'Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens';return!![];}});if(!_0x1d3017['customSite'])return console[_0x39da15(0x1d9)]('\x0aSetup\x20cancelled'),0x1;_0x5baa83=_0x1d3017[_0x39da15(0x1bd)];}else _0x5baa83=_0x2c4508['site'];const _0x28809a=resolveSite(_0x5baa83);console[_0x39da15(0x1d9)](_0x39da15(0x1ac)+_0x28809a),console[_0x39da15(0x1d9)](_0x39da15(0x1da)),console['log']('\x20\x20'+getConsoleUrl(_0x28809a,_0x39da15(0x1b3)));const _0x4f89b4=await a7_0x1831ce({'type':'password','name':'apiKey','message':_0x39da15(0x1c1),'validate':_0x13423f=>{const _0x3c7010=_0x39da15;if(!_0x13423f||!_0x13423f['trim']())return _0x3c7010(0x1b6);return!![];}});if(!_0x4f89b4[_0x39da15(0x1c8)])return console[_0x39da15(0x1d9)](_0x39da15(0x1d0)),0x1;const _0x4f579c=_0x4f89b4[_0x39da15(0x1c8)];console[_0x39da15(0x1d9)](_0x39da15(0x19b));try{const _0x1fdb0a=TDX['create']({'site':_0x28809a,'apiKey':_0x4f579c[_0x39da15(0x1d2)](),'logLevel':_0x2b2fbd['logLevel']??LogLevel['ERROR']}),_0x49492b=await _0x1fdb0a[_0x39da15(0x1bb)][_0x39da15(0x1c0)]();console[_0x39da15(0x1d9)]('✓\x20API\x20key\x20is\x20valid\x20(User:\x20'+_0x49492b[_0x39da15(0x1b0)]+')');const _0x476d69=await isKeychainAvailable();_0x476d69?(await saveAPIKeyAsync(_0x4f579c[_0x39da15(0x1d2)](),_0x28809a,_0x555d63),console[_0x39da15(0x1d9)](_0x39da15(0x1a5)+(_0x555d63?_0x39da15(0x195)+_0x555d63+')':''))):(console[_0x39da15(0x1db)](a7_0x464769[_0x39da15(0x1d4)](_0x39da15(0x19d))),console[_0x39da15(0x1db)](a7_0x464769[_0x39da15(0x1d4)](_0x39da15(0x1b7))));if(_0x555d63){const _0x2d8b5f={'site':_0x28809a};saveProfileToUserConfig(_0x555d63,_0x2d8b5f),console[_0x39da15(0x1d9)](_0x39da15(0x1ce)+_0x555d63+'\x27\x20registered');}else saveDefaultSiteToUserConfig(_0x28809a),console[_0x39da15(0x1d9)]('✓\x20Default\x20site\x20set\x20to\x20'+_0x28809a);const _0x45a44f=_0x555d63?_0x39da15(0x19f)+_0x555d63:'';return console['log'](),console[_0x39da15(0x1d9)](_0x39da15(0x1a6)),console[_0x39da15(0x1d9)](_0x39da15(0x1a8)+_0x45a44f+_0x39da15(0x1b5)),console[_0x39da15(0x1d9)](_0x39da15(0x1a8)+_0x45a44f+_0x39da15(0x1a4)),0x0;}catch(_0x30fd44){if(_0x30fd44 instanceof HTTPClientError&&_0x30fd44[_0x39da15(0x1c4)]===0x191)return printAuthError(_0x30fd44),0x1;return console[_0x39da15(0x1d5)](a7_0x464769[_0x39da15(0x1c7)](_0x39da15(0x1aa)+(_0x30fd44 instanceof Error?_0x30fd44[_0x39da15(0x1ba)]:String(_0x30fd44)))),console[_0x39da15(0x1d5)](_0x39da15(0x1ca)),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x3683e3(0x1a1)]=a7_0x3683e3(0x1cf);[a7_0x3683e3(0x1d1)]=a7_0x3683e3(0x1bc);async[a7_0x3683e3(0x1b1)](_0x26c0e8){const _0x1d32e3=a7_0x3683e3,{options:_0x186b7d,tdx:_0x17cff6}=_0x26c0e8,_0x5a7817=_0x186b7d[_0x1d32e3(0x198)],_0x4cf542=_0x186b7d['profile'],_0x3a853c=_0x4cf542?_0x4cf542:'N/A';console['log'](_0x1d32e3(0x1c5)+_0x3a853c+_0x1d32e3(0x1b2)+_0x5a7817+')');const _0x5331ba=await resolveAPIKeyAsync(_0x5a7817,_0x4cf542);if(_0x5331ba){const {source:_0x34b546,isDeprecated:_0x581194}=_0x5331ba,_0x2cd4bb=_0x1d32e3(0x1ae)+_0x34b546;console[_0x1d32e3(0x1d9)](_0x581194?a7_0x464769[_0x1d32e3(0x1d4)](_0x2cd4bb):_0x2cd4bb);}else console[_0x1d32e3(0x1d9)](a7_0x464769[_0x1d32e3(0x1d4)](_0x1d32e3(0x1b8)));try{const _0x201dd2=await _0x17cff6[_0x1d32e3(0x1bb)][_0x1d32e3(0x1c0)]();return console[_0x1d32e3(0x1d9)](a7_0x464769[_0x1d32e3(0x1a9)](_0x1d32e3(0x1a7))),console['log'](_0x1d32e3(0x19c)+_0x201dd2[_0x1d32e3(0x1b0)]),(_0x201dd2[_0x1d32e3(0x1c6)]||_0x201dd2[_0x1d32e3(0x1d8)])&&console[_0x1d32e3(0x1d9)](_0x1d32e3(0x1cc)+[_0x201dd2['first_name'],_0x201dd2[_0x1d32e3(0x1d8)]][_0x1d32e3(0x196)](Boolean)[_0x1d32e3(0x1d3)]('\x20')),0x0;}catch(_0x8596b3){return _0x8596b3 instanceof HTTPClientError&&_0x8596b3[_0x1d32e3(0x1c4)]===0x191?printAuthError(_0x8596b3,!![],_0x4cf542):console['error'](a7_0x464769[_0x1d32e3(0x1c7)](_0x1d32e3(0x1aa)+(_0x8596b3 instanceof Error?_0x8596b3[_0x1d32e3(0x1ba)]:String(_0x8596b3)))),0x1;}}}function a7_0x2097(){const _0x384c00=['log','You\x20can\x20find\x20your\x20API\x20key\x20at:','warn','1939csPrNX','3189708TxeQuQ','\x20(profile:\x20','filter','tdx:\x20auth\x20setup','site','test','6NIbiSd','Validating\x20API\x20key...','User:\x20','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','other','\x20--profile\x20','profile','name','Enter\x20site\x20name:','us01','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','✓\x20Authentication\x20successful\x0a','\x20\x20tdx','green','✗\x20Validation\x20failed:\x20','bold','Setting\x20up\x20authentication\x20for\x20site:\x20','text','Read\x20credential\x20from\x20','64260EoknFF','email','execute','\x20(site:\x20','/app/mp/ak','Select\x20your\x20Treasure\x20Data\x20site:','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','API\x20key\x20cannot\x20be\x20empty','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','No\x20credential\x20found','No\x20API\x20key\x20found\x20in\x20keychain','message','jobs','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','customSite','✓\x20API\x20key\x20removed\x20from\x20keychain','2106fiXjNv','getUserInfo','Enter\x20your\x20TD\x20API\x20key:','6060069zWdxpo','21521180DieGmT','status','tdx\x20profile:\x20','first_name','red','apiKey','257350YiFWHx','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','Site\x20name\x20cannot\x20be\x20empty','Name:\x20','9055bxqowq','✓\x20Profile\x20\x27','auth','\x0aSetup\x20cancelled','description','trim','join','yellow','error','Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20','14024dFqUks','last_name'];a7_0x2097=function(){return _0x384c00;};return a7_0x2097();}export class AuthClearCommand extends BaseCommand{[a7_0x3683e3(0x1a1)]='auth:clear';['description']='Remove\x20API\x20key\x20from\x20system\x20keychain';async[a7_0x3683e3(0x1b1)](_0x2b3f70){const _0x5df942=a7_0x3683e3,{options:_0x69d928}=_0x2b3f70,_0x4cbac9=_0x69d928['profile'];console['log'](a7_0x464769['bold']('tdx:\x20auth\x20clear'));const _0x2fc4b4=await isKeychainAvailable();if(!_0x2fc4b4)return console[_0x5df942(0x1d5)](a7_0x464769[_0x5df942(0x1c7)]('System\x20keychain\x20is\x20not\x20available')),0x1;const _0x2cd148=await deleteKeychainAPIKey(_0x4cbac9);return _0x2cd148?(clearCredentialCache(),console[_0x5df942(0x1d9)](_0x5df942(0x1be)+(_0x4cbac9?_0x5df942(0x195)+_0x4cbac9+')':'')),0x0):(console[_0x5df942(0x1d9)](_0x5df942(0x1b9)+(_0x4cbac9?'\x20for\x20profile:\x20'+_0x4cbac9:'')),0x1);}}
1
+ const a7_0x30d347=a7_0x1fdb;function a7_0x1953(){const _0x3c79b5=['Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20','join','us01','auth:setup','jobs','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','getUserInfo','5561660IRcdwt','167466QXssQn','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','384282mcXuTD','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','\x27\x20registered','\x20\x20tdx','apiKey','✓\x20Default\x20site\x20set\x20to\x20','error','create','bold','red','Name:\x20','execute','trim','ERROR','email','logLevel','site','profile','System\x20keychain\x20is\x20not\x20available','status','\x20(profile:\x20','last_name','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','name','147012umdVvo','Setup\x20API\x20key\x20authentication\x20interactively','Remove\x20API\x20key\x20from\x20system\x20keychain','\x20(site:\x20','log','\x0aSetup\x20cancelled','Select\x20your\x20Treasure\x20Data\x20site:','✗\x20Validation\x20failed:\x20','auth','tdx:\x20auth\x20clear','39RdVpZm','68594vxmsVT','✓\x20Authentication\x20successful\x0a','/app/mp/ak','first_name','N/A','\x20--profile\x20','auth:clear','description','36333DAqODC','Setting\x20up\x20authentication\x20for\x20site:\x20','\x20for\x20profile:\x20','Validating\x20API\x20key...','other','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','yellow','No\x20credential\x20found','55UnupZw','password','select','2005591fmYjnY','API\x20key\x20cannot\x20be\x20empty','warn','Site\x20name\x20cannot\x20be\x20empty','You\x20can\x20find\x20your\x20API\x20key\x20at:','filter','customSite','856pGVZvT'];a7_0x1953=function(){return _0x3c79b5;};return a7_0x1953();}(function(_0x37ae4a,_0x26ee23){const _0x3b9e5e=a7_0x1fdb,_0x484027=_0x37ae4a();while(!![]){try{const _0x1c4fe2=parseInt(_0x3b9e5e(0x113))/0x1+parseInt(_0x3b9e5e(0x139))/0x2+-parseInt(_0x3b9e5e(0x112))/0x3*(parseInt(_0x3b9e5e(0x108))/0x4)+parseInt(_0x3b9e5e(0x123))/0x5*(parseInt(_0x3b9e5e(0x137))/0x6)+parseInt(_0x3b9e5e(0x126))/0x7+parseInt(_0x3b9e5e(0x12d))/0x8*(parseInt(_0x3b9e5e(0x11b))/0x9)+-parseInt(_0x3b9e5e(0x136))/0xa;if(_0x1c4fe2===_0x26ee23)break;else _0x484027['push'](_0x484027['shift']());}catch(_0x2f7144){_0x484027['push'](_0x484027['shift']());}}}(a7_0x1953,0x3d971));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_0x1c8667 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_0x4480ae from'chalk';export class AuthSetupCommand extends BaseCommand{['name']=a7_0x30d347(0x132);['description']=a7_0x30d347(0x109);async[a7_0x30d347(0x144)](_0x40e41e){const _0x19ec0d=a7_0x30d347,{options:_0x9d3325}=_0x40e41e,_0x2488cb=_0x9d3325[_0x19ec0d(0x101)];console[_0x19ec0d(0x10c)](a7_0x4480ae[_0x19ec0d(0x141)]('tdx:\x20auth\x20setup'));const _0x32506b=_0x9d3325[_0x19ec0d(0x100)]||_0x19ec0d(0x131),{choices:_0x17736b,initialIndex:_0x550045}=buildSiteChoices(_0x32506b),_0x43d1d0=_0x2488cb?_0x19ec0d(0x12f)+_0x2488cb+'):':_0x19ec0d(0x10e),_0x2dfc1b=await a7_0x1c8667({'type':_0x19ec0d(0x125),'name':'site','message':_0x43d1d0,'choices':_0x17736b,'initial':_0x550045});if(!_0x2dfc1b[_0x19ec0d(0x100)])return console[_0x19ec0d(0x10c)]('\x0aSetup\x20cancelled'),0x1;let _0x466c91;if(_0x2dfc1b['site']===_0x19ec0d(0x11f)){const _0x54b149=await a7_0x1c8667({'type':'text','name':_0x19ec0d(0x12c),'message':'Enter\x20site\x20name:','initial':_0x19ec0d(0x131),'validate':_0x2ca9d9=>{const _0x5adc14=_0x19ec0d;if(!_0x2ca9d9||!_0x2ca9d9[_0x5adc14(0x145)]())return _0x5adc14(0x129);if(!/^[a-z0-9-]+$/['test'](_0x2ca9d9[_0x5adc14(0x145)]()))return _0x5adc14(0x12e);return!![];}});if(!_0x54b149['customSite'])return console[_0x19ec0d(0x10c)](_0x19ec0d(0x10d)),0x1;_0x466c91=_0x54b149['customSite'];}else _0x466c91=_0x2dfc1b[_0x19ec0d(0x100)];const _0x45a93a=resolveSite(_0x466c91);console[_0x19ec0d(0x10c)](_0x19ec0d(0x11c)+_0x45a93a),console[_0x19ec0d(0x10c)](_0x19ec0d(0x12a)),console[_0x19ec0d(0x10c)]('\x20\x20'+getConsoleUrl(_0x45a93a,_0x19ec0d(0x115)));const _0x114428=await a7_0x1c8667({'type':_0x19ec0d(0x124),'name':_0x19ec0d(0x13d),'message':'Enter\x20your\x20TD\x20API\x20key:','validate':_0x4a7276=>{const _0xa0d8e1=_0x19ec0d;if(!_0x4a7276||!_0x4a7276['trim']())return _0xa0d8e1(0x127);return!![];}});if(!_0x114428[_0x19ec0d(0x13d)])return console['log']('\x0aSetup\x20cancelled'),0x1;const _0x21e955=_0x114428['apiKey'];console[_0x19ec0d(0x10c)](_0x19ec0d(0x11e));try{const _0x20866b=TDX[_0x19ec0d(0x140)]({'site':_0x45a93a,'apiKey':_0x21e955[_0x19ec0d(0x145)](),'logLevel':_0x9d3325[_0x19ec0d(0x148)]??LogLevel[_0x19ec0d(0x146)]}),_0x385f2f=await _0x20866b[_0x19ec0d(0x133)][_0x19ec0d(0x135)]();console[_0x19ec0d(0x10c)](_0x19ec0d(0x13a)+_0x385f2f[_0x19ec0d(0x147)]+')');const _0x32c565=await isKeychainAvailable();_0x32c565?(await saveAPIKeyAsync(_0x21e955[_0x19ec0d(0x145)](),_0x45a93a,_0x2488cb),console['log'](_0x19ec0d(0x138)+(_0x2488cb?_0x19ec0d(0x104)+_0x2488cb+')':''))):(console['warn'](a7_0x4480ae[_0x19ec0d(0x121)](_0x19ec0d(0x106))),console[_0x19ec0d(0x128)](a7_0x4480ae[_0x19ec0d(0x121)]('\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.')));if(_0x2488cb){const _0x5a2f8c={'site':_0x45a93a};saveProfileToUserConfig(_0x2488cb,_0x5a2f8c),console[_0x19ec0d(0x10c)]('✓\x20Profile\x20\x27'+_0x2488cb+_0x19ec0d(0x13b));}else saveDefaultSiteToUserConfig(_0x45a93a),console[_0x19ec0d(0x10c)](_0x19ec0d(0x13e)+_0x45a93a);const _0x34a5f1=_0x2488cb?_0x19ec0d(0x118)+_0x2488cb:'';return console[_0x19ec0d(0x10c)](),console[_0x19ec0d(0x10c)](_0x19ec0d(0x120)),console[_0x19ec0d(0x10c)](_0x19ec0d(0x13c)+_0x34a5f1+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console[_0x19ec0d(0x10c)](_0x19ec0d(0x13c)+_0x34a5f1+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases'),0x0;}catch(_0x266673){if(_0x266673 instanceof HTTPClientError&&_0x266673[_0x19ec0d(0x103)]===0x191)return printAuthError(_0x266673),0x1;return console['error'](a7_0x4480ae[_0x19ec0d(0x142)](_0x19ec0d(0x10f)+(_0x266673 instanceof Error?_0x266673['message']:String(_0x266673)))),console[_0x19ec0d(0x13f)](_0x19ec0d(0x134)),0x1;}}}function a7_0x1fdb(_0x50f825,_0x4fa967){_0x50f825=_0x50f825-0x100;const _0x19535e=a7_0x1953();let _0x1fdb33=_0x19535e[_0x50f825];return _0x1fdb33;}export class AuthStatusCommand extends BaseCommand{['name']=a7_0x30d347(0x110);[a7_0x30d347(0x11a)]='Show\x20authentication\x20status\x20and\x20validate\x20API\x20key';async['execute'](_0x31cc3e){const _0x53f450=a7_0x30d347,{options:_0x13545c,tdx:_0x50954f}=_0x31cc3e,_0x389e36=_0x13545c[_0x53f450(0x100)],_0x11abfb=_0x13545c[_0x53f450(0x101)],_0x176f48=_0x11abfb?_0x11abfb:_0x53f450(0x117);console['log']('tdx\x20profile:\x20'+_0x176f48+_0x53f450(0x10b)+_0x389e36+')');const _0x420d57=await resolveAPIKeyAsync(_0x389e36,_0x11abfb);if(_0x420d57){const {source:_0x4d3bf3,isDeprecated:_0x16e695}=_0x420d57,_0x47f072='Read\x20credential\x20from\x20'+_0x4d3bf3;console['log'](_0x16e695?a7_0x4480ae['yellow'](_0x47f072):_0x47f072);}else console[_0x53f450(0x10c)](a7_0x4480ae['yellow'](_0x53f450(0x122)));try{const _0x472a60=await _0x50954f['jobs'][_0x53f450(0x135)]();return console[_0x53f450(0x10c)](a7_0x4480ae['green'](_0x53f450(0x114))),console[_0x53f450(0x10c)]('User:\x20'+_0x472a60[_0x53f450(0x147)]),(_0x472a60[_0x53f450(0x116)]||_0x472a60['last_name'])&&console['log'](_0x53f450(0x143)+[_0x472a60[_0x53f450(0x116)],_0x472a60[_0x53f450(0x105)]][_0x53f450(0x12b)](Boolean)[_0x53f450(0x130)]('\x20')),0x0;}catch(_0x123f9e){return _0x123f9e instanceof HTTPClientError&&_0x123f9e[_0x53f450(0x103)]===0x191?printAuthError(_0x123f9e,!![],_0x11abfb):console[_0x53f450(0x13f)](a7_0x4480ae[_0x53f450(0x142)](_0x53f450(0x10f)+(_0x123f9e instanceof Error?_0x123f9e['message']:String(_0x123f9e)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x30d347(0x107)]=a7_0x30d347(0x119);[a7_0x30d347(0x11a)]=a7_0x30d347(0x10a);async[a7_0x30d347(0x144)](_0xfb06d7){const _0x33ee9c=a7_0x30d347,{options:_0x2fa074}=_0xfb06d7,_0x4b3a20=_0x2fa074[_0x33ee9c(0x101)];console[_0x33ee9c(0x10c)](a7_0x4480ae[_0x33ee9c(0x141)](_0x33ee9c(0x111)));const _0xaf2046=await isKeychainAvailable();if(!_0xaf2046)return console[_0x33ee9c(0x13f)](a7_0x4480ae[_0x33ee9c(0x142)](_0x33ee9c(0x102))),0x1;const _0x10b401=await deleteKeychainAPIKey(_0x4b3a20);return _0x10b401?(clearCredentialCache(),console[_0x33ee9c(0x10c)]('✓\x20API\x20key\x20removed\x20from\x20keychain'+(_0x4b3a20?_0x33ee9c(0x104)+_0x4b3a20+')':'')),0x0):(console['log']('No\x20API\x20key\x20found\x20in\x20keychain'+(_0x4b3a20?_0x33ee9c(0x11d)+_0x4b3a20:'')),0x1);}}
@@ -1 +1 @@
1
- const a8_0x3f07a1=a8_0x4a68;(function(_0x320f37,_0x272523){const _0x16f0b4=a8_0x4a68,_0x5f53fc=_0x320f37();while(!![]){try{const _0x1eade9=parseInt(_0x16f0b4(0x182))/0x1+-parseInt(_0x16f0b4(0x173))/0x2*(-parseInt(_0x16f0b4(0x14c))/0x3)+-parseInt(_0x16f0b4(0x160))/0x4*(parseInt(_0x16f0b4(0x162))/0x5)+parseInt(_0x16f0b4(0x176))/0x6+-parseInt(_0x16f0b4(0x181))/0x7*(parseInt(_0x16f0b4(0x16b))/0x8)+-parseInt(_0x16f0b4(0x16f))/0x9+-parseInt(_0x16f0b4(0x179))/0xa*(parseInt(_0x16f0b4(0x17b))/0xb);if(_0x1eade9===_0x272523)break;else _0x5f53fc['push'](_0x5f53fc['shift']());}catch(_0xf4a8c0){_0x5f53fc['push'](_0x5f53fc['shift']());}}}(a8_0x2894,0xe7616));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{withSpinner}from'../utils/spinner.js';import{parseAgentRef}from'../sdk/agent/agent-ref-parser.js';import{saveLastChatId,loadLastChatId}from'../sdk/llm/chat-cache.js';function a8_0x2894(){const _0x260ccb=['message','25358oCtmle','options','projectId','8935614LwFvFK','new','content','10VjaepZ','resolveProjectId','3713369RvIUKB','stringify','metadata','validate','event','Resolving\x20project\x20\x27','595VuHDnq','736731jRitDh','done','description','llmProject','chatId','tool_result','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','targetKnowledgeBase','Resolving\x20agent\x20\x27','site','error','Using\x20cached\x20default\x20agent:\x20','tool','Continuing\x20chat:\x20','includes','streamChat','agent','handleChatEvent','llm','targetWebSearchTool','\x20\x20Cause:\x20','3fFjAPd','No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22','CHAT_NOT_FOUND','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','stack','functionName','targetFunction','Chat\x20session:\x20','Getting\x20default\x20agent...','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','join','--agent\x20flag','verbose','Error:\x20Chat\x20session\x20\x27','startChat','agentId','getOrCreateDefaultAgent','write','chat','name','137652iDVNft','llmAgent','75bCDZKy','string','stdout','data','cause','\x27...','tool_call','\x0aStack\x20trace:','execute','31704PJaAiV','streamChatJsonl','getDefaultAgent','log','902844SXHxjD','resolveAgentId','type'];a8_0x2894=function(){return _0x260ccb;};return a8_0x2894();}import{getLLMConversationUrl}from'../sdk/client/endpoints.js';function handleSDKError(_0x2d75f8,_0x202739){const _0x4ec126=a8_0x4a68;if(_0x2d75f8 instanceof SDKError)console[_0x4ec126(0x18c)]('Error:\x20'+_0x2d75f8[_0x4ec126(0x172)]),_0x202739[_0x4ec126(0x158)]&&(_0x2d75f8[_0x4ec126(0x166)]&&console['error'](_0x4ec126(0x14b)+_0x2d75f8[_0x4ec126(0x166)]),_0x2d75f8[_0x4ec126(0x150)]&&(console[_0x4ec126(0x18c)](_0x4ec126(0x169)),console['error'](_0x2d75f8[_0x4ec126(0x150)])));else throw _0x2d75f8;}async function resolveAgentId(_0x8cce8c,_0x168632,_0x2f00df,_0x16edad,_0x29f2a7){const _0x4b42de=a8_0x4a68,_0x553aae=_0x168632||_0x2f00df;if(_0x553aae){const {projectName:_0x344548,agentName:_0x1b0076}=parseAgentRef(_0x553aae),_0x1d8300=_0x1b0076||_0x553aae,_0x6e5a66=_0x1b0076?_0x344548:_0x16edad;if(!_0x6e5a66)throw new Error(_0x4b42de(0x14d));if(_0x29f2a7){const _0x497328=_0x168632?_0x4b42de(0x157):'session\x20context';console[_0x4b42de(0x18c)]('Using\x20agent\x20from\x20'+_0x497328+':\x20'+_0x6e5a66+'/'+_0x1d8300);}const _0x5c8eb8=await withSpinner(_0x4b42de(0x180)+_0x6e5a66+_0x4b42de(0x167),()=>_0x8cce8c[_0x4b42de(0x149)][_0x4b42de(0x17a)](_0x6e5a66),{'verbose':_0x29f2a7}),_0x515cae=await withSpinner(_0x4b42de(0x18a)+_0x1d8300+'\x27...',()=>_0x8cce8c['llm'][_0x4b42de(0x170)](_0x1d8300,_0x5c8eb8['data']),{'verbose':_0x29f2a7});return _0x515cae[_0x4b42de(0x165)];}else{const _0x1e8add=_0x8cce8c['llm'][_0x4b42de(0x16d)]();if(_0x1e8add)return _0x29f2a7&&console[_0x4b42de(0x18c)](_0x4b42de(0x18d)+_0x1e8add['name']),_0x1e8add['id'];const _0xdada0e=await withSpinner(_0x4b42de(0x154),()=>_0x8cce8c[_0x4b42de(0x149)][_0x4b42de(0x15c)]('claude-4.5-haiku',0x0),{'verbose':_0x29f2a7});return _0xdada0e[_0x4b42de(0x165)]['id'];}}function a8_0x4a68(_0x2e7718,_0x5e2061){_0x2e7718=_0x2e7718-0x146;const _0x28942d=a8_0x2894();let _0x4a6844=_0x28942d[_0x2e7718];return _0x4a6844;}export class ChatCommand extends BaseCommand{[a8_0x3f07a1(0x15f)]=a8_0x3f07a1(0x15e);[a8_0x3f07a1(0x184)]=a8_0x3f07a1(0x14f);[a8_0x3f07a1(0x17e)](_0x3ea07c){const _0x779f1a=a8_0x3f07a1,_0x54d6a8=_0x3ea07c['args']['join']('\x20');if(!_0x54d6a8)return _0x779f1a(0x188);return undefined;}async[a8_0x3f07a1(0x146)](_0x7696eb,_0x40bfed,_0x389ee3,_0xa22f8e,_0x4bac66){const _0x4fbe6e=a8_0x3f07a1;for await(const _0x19f948 of _0x7696eb[_0x4fbe6e(0x149)][_0x4fbe6e(0x15e)](_0x40bfed,{'agentId':_0x389ee3,'chatId':_0xa22f8e})){if(_0x19f948[_0x4fbe6e(0x171)]===_0x4fbe6e(0x17d)){const _0x47fac6=_0x19f948['data'][_0x4fbe6e(0x186)];saveLastChatId(_0x47fac6),_0x4bac66&&console[_0x4fbe6e(0x18c)](_0x4fbe6e(0x153)+_0x47fac6);}else _0x19f948[_0x4fbe6e(0x171)]===_0x4fbe6e(0x17f)&&this[_0x4fbe6e(0x148)](_0x19f948[_0x4fbe6e(0x165)]);}}async['streamChatJsonl'](_0x3dd976,_0x451596,_0x1a415f,_0x21d694){const _0x377e4f=a8_0x3f07a1,_0x526374=_0x3dd976['context'][_0x377e4f(0x18b)];let _0x305d32=![];for await(const _0xef4a5 of _0x3dd976[_0x377e4f(0x149)]['chat'](_0x451596,{'agentId':_0x1a415f,'chatId':_0x21d694})){if(_0xef4a5[_0x377e4f(0x171)]===_0x377e4f(0x17d)){const _0x5106da=_0xef4a5['data'];saveLastChatId(_0x5106da[_0x377e4f(0x186)]);const _0x47ec7f=_0x5106da[_0x377e4f(0x175)]&&_0x5106da[_0x377e4f(0x15b)]?getLLMConversationUrl(_0x526374,_0x5106da[_0x377e4f(0x175)],_0x5106da[_0x377e4f(0x15b)],_0x5106da['chatId']):undefined;console[_0x377e4f(0x16e)](JSON[_0x377e4f(0x17c)]({'type':'metadata','data':{'chatId':_0x5106da[_0x377e4f(0x186)],'agentId':_0x5106da[_0x377e4f(0x15b)],'consoleUrl':_0x47ec7f}})),_0x305d32=!![];}else{if(_0xef4a5[_0x377e4f(0x171)]==='event'){!_0x305d32&&_0x21d694&&(console[_0x377e4f(0x16e)](JSON[_0x377e4f(0x17c)]({'type':_0x377e4f(0x17d),'data':{'chatId':_0x21d694}})),_0x305d32=!![]);const _0x415331=_0xef4a5['data'];if('content'in _0x415331)console['log'](JSON[_0x377e4f(0x17c)]({'type':_0x377e4f(0x178),'data':{'content':_0x415331[_0x377e4f(0x178)]}}));else{if(_0x377e4f(0x168)in _0x415331){const _0x2a0195=_0x415331[_0x377e4f(0x168)];console[_0x377e4f(0x16e)](JSON[_0x377e4f(0x17c)]({'type':_0x377e4f(0x168),'data':{'id':_0x2a0195['id'],'name':_0x2a0195['functionName'],'target':_0x2a0195[_0x377e4f(0x189)]?.[_0x377e4f(0x15f)]||_0x2a0195['targetAgent']?.[_0x377e4f(0x15f)]||_0x2a0195[_0x377e4f(0x14a)]?.[_0x377e4f(0x15f)]||_0x2a0195[_0x377e4f(0x152)]}}));}else{if(_0x377e4f(0x18e)in _0x415331)console[_0x377e4f(0x16e)](JSON[_0x377e4f(0x17c)]({'type':_0x377e4f(0x187),'data':{'id':_0x415331[_0x377e4f(0x18e)]['id'],'name':_0x415331['tool'][_0x377e4f(0x151)],'result':typeof _0x415331[_0x377e4f(0x18e)][_0x377e4f(0x178)]===_0x377e4f(0x163)?_0x415331[_0x377e4f(0x18e)][_0x377e4f(0x178)]['slice'](0x0,0x1f4):''}}));else _0x377e4f(0x18c)in _0x415331&&console[_0x377e4f(0x16e)](JSON[_0x377e4f(0x17c)]({'type':_0x377e4f(0x18c),'data':{'error':_0x415331[_0x377e4f(0x18c)]}}));}}}}}console[_0x377e4f(0x16e)](JSON[_0x377e4f(0x17c)]({'type':_0x377e4f(0x183)}));}async[a8_0x3f07a1(0x16a)](_0x1d85b9){const _0x48d9c4=a8_0x3f07a1,{options:_0x5d4663,args:_0x83b192,tdx:_0x305747}=_0x1d85b9,_0x5d1bf4=_0x83b192[_0x48d9c4(0x156)]('\x20'),_0x4fd24e=_0x5d4663,_0x1f6a08=_0x4fd24e[_0x48d9c4(0x147)],_0x4251d=_0x4fd24e[_0x48d9c4(0x161)],_0x416ff0=_0x4fd24e[_0x48d9c4(0x185)],_0x2b5ba6=_0x4fd24e[_0x48d9c4(0x177)],_0x5968a0=_0x4fd24e[_0x48d9c4(0x186)],_0xbba169=_0x4fd24e['stream'];if(_0x2b5ba6&&_0x5968a0)return console[_0x48d9c4(0x18c)]('Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together'),0x1;try{let _0x16a998,_0x1ac17c;if(_0x5968a0)_0x1ac17c=_0x5968a0;else!_0x2b5ba6&&(_0x1ac17c=loadLastChatId(),_0x1ac17c&&_0x5d4663[_0x48d9c4(0x158)]&&console[_0x48d9c4(0x18c)](_0x48d9c4(0x18f)+_0x1ac17c));!_0x5968a0&&(_0x2b5ba6||!_0x1ac17c)&&(_0x16a998=await resolveAgentId(_0x305747,_0x1f6a08,_0x4251d,_0x416ff0,_0x5d4663[_0x48d9c4(0x158)]));const _0x5cc5a4=_0xbba169?(_0x226864,_0x4a0b72,_0x186b7c)=>this[_0x48d9c4(0x16c)](_0x305747,_0x226864,_0x4a0b72,_0x186b7c):(_0x46745a,_0xbef74c,_0x4e215f)=>this[_0x48d9c4(0x146)](_0x305747,_0x46745a,_0xbef74c,_0x4e215f,_0x5d4663[_0x48d9c4(0x158)]);try{await _0x5cc5a4(_0x5d1bf4,_0x16a998,_0x1ac17c);}catch(_0x2ab376){const _0x4217f6=_0x2ab376 instanceof SDKError&&_0x2ab376['code']===ErrorCode[_0x48d9c4(0x14e)]||_0x2ab376 instanceof Error&&_0x2ab376[_0x48d9c4(0x172)][_0x48d9c4(0x190)]('404');if(_0x4217f6&&_0x5968a0)return console[_0x48d9c4(0x18c)](_0x48d9c4(0x159)+_0x5968a0+'\x27\x20not\x20found'),0x1;if(_0x4217f6)_0x5d4663['verbose']&&console[_0x48d9c4(0x18c)](_0x48d9c4(0x155)),!_0x16a998&&(_0x16a998=await resolveAgentId(_0x305747,_0x1f6a08,_0x4251d,_0x416ff0,_0x5d4663[_0x48d9c4(0x158)])),await _0x5cc5a4(_0x5d1bf4,_0x16a998,undefined);else throw _0x2ab376;}return!_0xbba169&&console[_0x48d9c4(0x16e)](),0x0;}catch(_0x493389){return console[_0x48d9c4(0x18c)](),handleSDKError(_0x493389,_0x5d4663),0x1;}}[a8_0x3f07a1(0x148)](_0x5e98ed){const _0x3be5d5=a8_0x3f07a1;if(_0x3be5d5(0x178)in _0x5e98ed)process[_0x3be5d5(0x164)][_0x3be5d5(0x15d)](_0x5e98ed[_0x3be5d5(0x178)]);else _0x3be5d5(0x18c)in _0x5e98ed&&console[_0x3be5d5(0x18c)]('\x0aError:\x20'+_0x5e98ed['error']);}}export class ChatCreateCommand extends BaseCommand{['name']='chat-create';['description']='Create\x20a\x20new\x20chat\x20session';[a8_0x3f07a1(0x17e)](_0x5968d1){const _0x55ae07=a8_0x3f07a1,_0x4a3638=_0x5968d1[_0x55ae07(0x174)],_0x12cd8b=_0x4a3638[_0x55ae07(0x147)],_0x15601b=_0x4a3638[_0x55ae07(0x161)];if(!_0x12cd8b&&!_0x15601b)return'Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22';return undefined;}async[a8_0x3f07a1(0x16a)](_0x1b786b){const _0x21c2ed=a8_0x3f07a1,{options:_0x247dcd,tdx:_0xaa2490}=_0x1b786b,_0x8ed3f7=_0x247dcd,_0x2acb52=_0x8ed3f7['agent'],_0x259f38=_0x8ed3f7['llmAgent'],_0x274f5e=_0x8ed3f7['llmProject'];try{const _0x32b1c5=await resolveAgentId(_0xaa2490,_0x2acb52,_0x259f38,_0x274f5e,_0x247dcd[_0x21c2ed(0x158)]),_0x227fb8=await _0xaa2490[_0x21c2ed(0x149)][_0x21c2ed(0x15a)](_0x32b1c5);return saveLastChatId(_0x227fb8['id']),console[_0x21c2ed(0x16e)](JSON[_0x21c2ed(0x17c)]({'chatId':_0x227fb8['id'],'agentId':_0x32b1c5})),0x0;}catch(_0x24b643){return handleSDKError(_0x24b643,_0x247dcd),0x1;}}}
1
+ const a8_0x3df821=a8_0x1d09;(function(_0x31ff49,_0x53ba19){const _0xdac20f=a8_0x1d09,_0x1e69c8=_0x31ff49();while(!![]){try{const _0x586534=-parseInt(_0xdac20f(0x1b1))/0x1+parseInt(_0xdac20f(0x1a2))/0x2*(parseInt(_0xdac20f(0x1b8))/0x3)+parseInt(_0xdac20f(0x197))/0x4+-parseInt(_0xdac20f(0x1c5))/0x5+parseInt(_0xdac20f(0x1b9))/0x6*(parseInt(_0xdac20f(0x1a3))/0x7)+parseInt(_0xdac20f(0x1a5))/0x8*(parseInt(_0xdac20f(0x1d2))/0x9)+-parseInt(_0xdac20f(0x1d6))/0xa;if(_0x586534===_0x53ba19)break;else _0x1e69c8['push'](_0x1e69c8['shift']());}catch(_0x277360){_0x1e69c8['push'](_0x1e69c8['shift']());}}}(a8_0x4885,0xc800f));function a8_0x1d09(_0x1e6748,_0x255b9e){_0x1e6748=_0x1e6748-0x18c;const _0x4885f6=a8_0x4885();let _0x1d0928=_0x4885f6[_0x1e6748];return _0x1d0928;}import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/errors.js';function a8_0x4885(){const _0x26bfdb=['write','chat','projectId','tool','targetFunction','Chat\x20session:\x20','cause','event','Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22','name','134humJfH','3256862XqVTPc','message','8FgZVLX','claude-4.5-haiku','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','new','Getting\x20default\x20agent...','agentId','targetAgent','startChat','string','\x0aStack\x20trace:','error','context','684356aRtkjc','type','stream','includes','log','llmAgent','Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together','61839KKEVbx','12PgWwjb','targetWebSearchTool','handleChatEvent','Continuing\x20chat:\x20','metadata','description','stack','\x20\x20Cause:\x20','llm','llmProject','--agent\x20flag','agent','7176900mUNxIj','\x27...','slice','join','data','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','CHAT_NOT_FOUND','tool_call','Create\x20a\x20new\x20chat\x20session','streamChatJsonl','Resolving\x20project\x20\x27','chat-create','getDefaultAgent','12984858bbUAnv','validate','execute','Error:\x20','21969050nXogTq','streamChat','getOrCreateDefaultAgent','content','verbose','done','functionName','stringify','chatId','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','Resolving\x20agent\x20\x27','args','resolveAgentId','\x0aError:\x20','Using\x20cached\x20default\x20agent:\x20','5525964ZVrglF'];a8_0x4885=function(){return _0x26bfdb;};return a8_0x4885();}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(_0x59c0f1,_0x34b434){const _0x33a8ed=a8_0x1d09;if(_0x59c0f1 instanceof SDKError)console[_0x33a8ed(0x1af)](_0x33a8ed(0x1d5)+_0x59c0f1[_0x33a8ed(0x1a4)]),_0x34b434[_0x33a8ed(0x18c)]&&(_0x59c0f1[_0x33a8ed(0x19e)]&&console[_0x33a8ed(0x1af)](_0x33a8ed(0x1c0)+_0x59c0f1[_0x33a8ed(0x19e)]),_0x59c0f1[_0x33a8ed(0x1bf)]&&(console[_0x33a8ed(0x1af)](_0x33a8ed(0x1ae)),console[_0x33a8ed(0x1af)](_0x59c0f1[_0x33a8ed(0x1bf)])));else throw _0x59c0f1;}async function resolveAgentId(_0x9c4614,_0x370212,_0x95ce2,_0x5022c9,_0x50e40f){const _0x48448b=a8_0x1d09,_0x46693d=_0x370212||_0x95ce2;if(_0x46693d){const {projectName:_0x156b70,agentName:_0x498eaf}=parseAgentRef(_0x46693d),_0x57f7f2=_0x498eaf||_0x46693d,_0x2067c4=_0x498eaf?_0x156b70:_0x5022c9;if(!_0x2067c4)throw new Error('No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22');if(_0x50e40f){const _0x54681c=_0x370212?_0x48448b(0x1c3):'session\x20context';console[_0x48448b(0x1af)]('Using\x20agent\x20from\x20'+_0x54681c+':\x20'+_0x2067c4+'/'+_0x57f7f2);}const _0x557094=await withSpinner(_0x48448b(0x1cf)+_0x2067c4+_0x48448b(0x1c6),()=>_0x9c4614['llm']['resolveProjectId'](_0x2067c4),{'verbose':_0x50e40f}),_0x307f6e=await withSpinner(_0x48448b(0x192)+_0x57f7f2+'\x27...',()=>_0x9c4614[_0x48448b(0x1c1)][_0x48448b(0x194)](_0x57f7f2,_0x557094[_0x48448b(0x1c9)]),{'verbose':_0x50e40f});return _0x307f6e[_0x48448b(0x1c9)];}else{const _0x2b1ca8=_0x9c4614[_0x48448b(0x1c1)][_0x48448b(0x1d1)]();if(_0x2b1ca8)return _0x50e40f&&console[_0x48448b(0x1af)](_0x48448b(0x196)+_0x2b1ca8[_0x48448b(0x1a1)]),_0x2b1ca8['id'];const _0x47925e=await withSpinner(_0x48448b(0x1a9),()=>_0x9c4614[_0x48448b(0x1c1)][_0x48448b(0x1d8)](_0x48448b(0x1a6),0x0),{'verbose':_0x50e40f});return _0x47925e[_0x48448b(0x1c9)]['id'];}}export class ChatCommand extends BaseCommand{[a8_0x3df821(0x1a1)]=a8_0x3df821(0x199);[a8_0x3df821(0x1be)]=a8_0x3df821(0x1ca);[a8_0x3df821(0x1d3)](_0x4bff54){const _0x4d40ce=a8_0x3df821,_0x292cf1=_0x4bff54[_0x4d40ce(0x193)][_0x4d40ce(0x1c8)]('\x20');if(!_0x292cf1)return _0x4d40ce(0x1a7);return undefined;}async[a8_0x3df821(0x1d7)](_0x5545e4,_0x5476b2,_0x562e3b,_0x2fc7c9,_0x3ed4cc){const _0xda48d9=a8_0x3df821;for await(const _0x164428 of _0x5545e4['llm'][_0xda48d9(0x199)](_0x5476b2,{'agentId':_0x562e3b,'chatId':_0x2fc7c9})){if(_0x164428[_0xda48d9(0x1b2)]===_0xda48d9(0x1bd)){const _0x5c09b7=_0x164428[_0xda48d9(0x1c9)]['chatId'];saveLastChatId(_0x5c09b7),_0x3ed4cc&&console[_0xda48d9(0x1af)](_0xda48d9(0x19d)+_0x5c09b7);}else _0x164428[_0xda48d9(0x1b2)]===_0xda48d9(0x19f)&&this[_0xda48d9(0x1bb)](_0x164428[_0xda48d9(0x1c9)]);}}async[a8_0x3df821(0x1ce)](_0x26ca59,_0x2265d5,_0x344586,_0x4a8b75){const _0x9dab71=a8_0x3df821,_0x2675cf=_0x26ca59[_0x9dab71(0x1b0)]['site'];let _0x4e68f3=![];for await(const _0x4dd990 of _0x26ca59[_0x9dab71(0x1c1)][_0x9dab71(0x199)](_0x2265d5,{'agentId':_0x344586,'chatId':_0x4a8b75})){if(_0x4dd990[_0x9dab71(0x1b2)]==='metadata'){const _0x3deeee=_0x4dd990[_0x9dab71(0x1c9)];saveLastChatId(_0x3deeee['chatId']);const _0x558570=_0x3deeee[_0x9dab71(0x19a)]&&_0x3deeee['agentId']?getLLMConversationUrl(_0x2675cf,_0x3deeee[_0x9dab71(0x19a)],_0x3deeee[_0x9dab71(0x1aa)],_0x3deeee[_0x9dab71(0x190)]):undefined;console[_0x9dab71(0x1b5)](JSON[_0x9dab71(0x18f)]({'type':_0x9dab71(0x1bd),'data':{'chatId':_0x3deeee[_0x9dab71(0x190)],'agentId':_0x3deeee[_0x9dab71(0x1aa)],'consoleUrl':_0x558570}})),_0x4e68f3=!![];}else{if(_0x4dd990[_0x9dab71(0x1b2)]===_0x9dab71(0x19f)){!_0x4e68f3&&_0x4a8b75&&(console[_0x9dab71(0x1b5)](JSON[_0x9dab71(0x18f)]({'type':_0x9dab71(0x1bd),'data':{'chatId':_0x4a8b75}})),_0x4e68f3=!![]);const _0x17c0fc=_0x4dd990[_0x9dab71(0x1c9)];if(_0x9dab71(0x1d9)in _0x17c0fc)console['log'](JSON[_0x9dab71(0x18f)]({'type':_0x9dab71(0x1d9),'data':{'content':_0x17c0fc[_0x9dab71(0x1d9)]}}));else{if(_0x9dab71(0x1cc)in _0x17c0fc){const _0x3c9a49=_0x17c0fc[_0x9dab71(0x1cc)];console[_0x9dab71(0x1b5)](JSON['stringify']({'type':_0x9dab71(0x1cc),'data':{'id':_0x3c9a49['id'],'name':_0x3c9a49['functionName'],'target':_0x3c9a49['targetKnowledgeBase']?.['name']||_0x3c9a49[_0x9dab71(0x1ab)]?.[_0x9dab71(0x1a1)]||_0x3c9a49[_0x9dab71(0x1ba)]?.[_0x9dab71(0x1a1)]||_0x3c9a49[_0x9dab71(0x19c)]}}));}else{if(_0x9dab71(0x19b)in _0x17c0fc)console[_0x9dab71(0x1b5)](JSON['stringify']({'type':'tool_result','data':{'id':_0x17c0fc[_0x9dab71(0x19b)]['id'],'name':_0x17c0fc[_0x9dab71(0x19b)][_0x9dab71(0x18e)],'result':typeof _0x17c0fc[_0x9dab71(0x19b)][_0x9dab71(0x1d9)]===_0x9dab71(0x1ad)?_0x17c0fc[_0x9dab71(0x19b)][_0x9dab71(0x1d9)][_0x9dab71(0x1c7)](0x0,0x1f4):''}}));else _0x9dab71(0x1af)in _0x17c0fc&&console['log'](JSON[_0x9dab71(0x18f)]({'type':_0x9dab71(0x1af),'data':{'error':_0x17c0fc['error']}}));}}}}}console[_0x9dab71(0x1b5)](JSON[_0x9dab71(0x18f)]({'type':_0x9dab71(0x18d)}));}async['execute'](_0x5c2564){const _0x3b6f96=a8_0x3df821,{options:_0x542061,args:_0x15b944,tdx:_0x4b6f94}=_0x5c2564,_0x4ad207=_0x15b944[_0x3b6f96(0x1c8)]('\x20'),_0x1661b0=_0x542061,_0x20ecca=_0x1661b0[_0x3b6f96(0x1c4)],_0xb78ff7=_0x1661b0[_0x3b6f96(0x1b6)],_0x52047c=_0x1661b0[_0x3b6f96(0x1c2)],_0x593871=_0x1661b0[_0x3b6f96(0x1a8)],_0x4e892a=_0x1661b0[_0x3b6f96(0x190)],_0xd4d2b=_0x1661b0[_0x3b6f96(0x1b3)];if(_0x593871&&_0x4e892a)return console['error'](_0x3b6f96(0x1b7)),0x1;try{let _0x8cb137,_0x3db936;if(_0x4e892a)_0x3db936=_0x4e892a;else!_0x593871&&(_0x3db936=loadLastChatId(),_0x3db936&&_0x542061['verbose']&&console[_0x3b6f96(0x1af)](_0x3b6f96(0x1bc)+_0x3db936));!_0x4e892a&&(_0x593871||!_0x3db936)&&(_0x8cb137=await resolveAgentId(_0x4b6f94,_0x20ecca,_0xb78ff7,_0x52047c,_0x542061['verbose']));const _0x416ac5=_0xd4d2b?(_0x20eee0,_0xc32365,_0x293d3c)=>this[_0x3b6f96(0x1ce)](_0x4b6f94,_0x20eee0,_0xc32365,_0x293d3c):(_0x2fddb8,_0x5a1478,_0x578318)=>this[_0x3b6f96(0x1d7)](_0x4b6f94,_0x2fddb8,_0x5a1478,_0x578318,_0x542061['verbose']);try{await _0x416ac5(_0x4ad207,_0x8cb137,_0x3db936);}catch(_0x594a69){const _0xa63c43=_0x594a69 instanceof SDKError&&_0x594a69['code']===ErrorCode[_0x3b6f96(0x1cb)]||_0x594a69 instanceof Error&&_0x594a69[_0x3b6f96(0x1a4)][_0x3b6f96(0x1b4)]('404');if(_0xa63c43&&_0x4e892a)return console[_0x3b6f96(0x1af)]('Error:\x20Chat\x20session\x20\x27'+_0x4e892a+'\x27\x20not\x20found'),0x1;if(_0xa63c43)_0x542061[_0x3b6f96(0x18c)]&&console[_0x3b6f96(0x1af)](_0x3b6f96(0x191)),!_0x8cb137&&(_0x8cb137=await resolveAgentId(_0x4b6f94,_0x20ecca,_0xb78ff7,_0x52047c,_0x542061['verbose'])),await _0x416ac5(_0x4ad207,_0x8cb137,undefined);else throw _0x594a69;}return!_0xd4d2b&&console['log'](),0x0;}catch(_0x4caa99){return console[_0x3b6f96(0x1af)](),handleSDKError(_0x4caa99,_0x542061),0x1;}}['handleChatEvent'](_0x19f936){const _0x427c04=a8_0x3df821;if('content'in _0x19f936)process['stdout'][_0x427c04(0x198)](_0x19f936['content']);else _0x427c04(0x1af)in _0x19f936&&console[_0x427c04(0x1af)](_0x427c04(0x195)+_0x19f936['error']);}}export class ChatCreateCommand extends BaseCommand{[a8_0x3df821(0x1a1)]=a8_0x3df821(0x1d0);[a8_0x3df821(0x1be)]=a8_0x3df821(0x1cd);[a8_0x3df821(0x1d3)](_0x3d341a){const _0x5549b4=a8_0x3df821,_0x515e9a=_0x3d341a['options'],_0x4e0940=_0x515e9a['agent'],_0x597d2e=_0x515e9a['llmAgent'];if(!_0x4e0940&&!_0x597d2e)return _0x5549b4(0x1a0);return undefined;}async[a8_0x3df821(0x1d4)](_0x591213){const _0x3dffb0=a8_0x3df821,{options:_0x4a28a3,tdx:_0x174adb}=_0x591213,_0x14d955=_0x4a28a3,_0x4f3052=_0x14d955['agent'],_0x4146e8=_0x14d955[_0x3dffb0(0x1b6)],_0x59c940=_0x14d955[_0x3dffb0(0x1c2)];try{const _0x591626=await resolveAgentId(_0x174adb,_0x4f3052,_0x4146e8,_0x59c940,_0x4a28a3['verbose']),_0x420138=await _0x174adb['llm'][_0x3dffb0(0x1ac)](_0x591626);return saveLastChatId(_0x420138['id']),console[_0x3dffb0(0x1b5)](JSON[_0x3dffb0(0x18f)]({'chatId':_0x420138['id'],'agentId':_0x591626})),0x0;}catch(_0x2f2b83){return handleSDKError(_0x2f2b83,_0x4a28a3),0x1;}}}