@treasuredata/tdx 0.28.2 → 0.28.4

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 (184) 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.d.ts.map +1 -1
  120. package/dist/sdk/segment/journey-utils.js +1 -1
  121. package/dist/sdk/segment/journey-utils.js.map +1 -1
  122. package/dist/sdk/segment/journey-validator.js +1 -1
  123. package/dist/sdk/segment/journey-validator.js.map +1 -1
  124. package/dist/sdk/segment/journey-yaml.d.ts.map +1 -1
  125. package/dist/sdk/segment/journey-yaml.js +1 -1
  126. package/dist/sdk/segment/journey-yaml.js.map +1 -1
  127. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  128. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  129. package/dist/sdk/segment/pull-workflow.js +1 -1
  130. package/dist/sdk/segment/push-recovery.js +1 -1
  131. package/dist/sdk/segment/push-workflow.js +1 -1
  132. package/dist/sdk/segment/resolution-context.js +1 -1
  133. package/dist/sdk/segment/segment-path-parser.js +1 -1
  134. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  135. package/dist/sdk/segment/target-resolution.js +1 -1
  136. package/dist/sdk/segment/tdx-config.js +1 -1
  137. package/dist/sdk/segment/validate-files.js +1 -1
  138. package/dist/sdk/segment/yaml-validator.js +1 -1
  139. package/dist/sdk/segment.js +1 -1
  140. package/dist/sdk/types/index.js +1 -1
  141. package/dist/sdk/types/progress.js +1 -1
  142. package/dist/sdk/user.js +1 -1
  143. package/dist/sdk/util/format-detector.js +1 -1
  144. package/dist/sdk/util/formatters.js +1 -1
  145. package/dist/sdk/util/index.js +1 -1
  146. package/dist/sdk/util/tree-formatter.js +1 -1
  147. package/dist/sdk/workflow/archive-validation.js +1 -1
  148. package/dist/sdk/workflow/clone-workflow.js +1 -1
  149. package/dist/sdk/workflow/index.js +1 -1
  150. package/dist/sdk/workflow/pull-workflow.js +1 -1
  151. package/dist/sdk/workflow/push-workflow.js +1 -1
  152. package/dist/sdk/workflow/tdx-config.js +1 -1
  153. package/dist/sdk/workflow/workflow-utils.js +1 -1
  154. package/dist/test-utils/command-runner.js +1 -1
  155. package/dist/test-utils/factories.js +1 -1
  156. package/dist/test-utils/fixtures.js +1 -1
  157. package/dist/test-utils/http-mock.js +1 -1
  158. package/dist/test-utils/index.js +1 -1
  159. package/dist/utils/async.js +1 -1
  160. package/dist/utils/colors.js +1 -1
  161. package/dist/utils/diff.js +1 -1
  162. package/dist/utils/file-permissions.js +1 -1
  163. package/dist/utils/global-cache.js +1 -1
  164. package/dist/utils/json-loader.js +1 -1
  165. package/dist/utils/local-cache.js +1 -1
  166. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  167. package/dist/utils/logger/formatters/index.js +1 -1
  168. package/dist/utils/logger/handlers/console-handler.js +1 -1
  169. package/dist/utils/logger/handlers/file-handler.js +1 -1
  170. package/dist/utils/logger/handlers/index.js +1 -1
  171. package/dist/utils/logger/handlers/null-handler.js +1 -1
  172. package/dist/utils/logger/index.js +1 -1
  173. package/dist/utils/logger/logger.js +1 -1
  174. package/dist/utils/logger/types.js +1 -1
  175. package/dist/utils/option-validation.js +1 -1
  176. package/dist/utils/process.js +1 -1
  177. package/dist/utils/prompt.js +1 -1
  178. package/dist/utils/spinner.js +1 -1
  179. package/dist/utils/sse-parser.js +1 -1
  180. package/dist/utils/string-utils.js +1 -1
  181. package/dist/utils/table-ref-parser.js +1 -1
  182. package/dist/utils/tdx-logger.js +1 -1
  183. package/dist/utils/version-check.js +1 -1
  184. package/package.json +1 -1
@@ -1 +1 @@
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
+ function a3_0x1f56(){const _0x30c5c4=['name','resolveParentId','Listing\x20activations\x20for\x20segment\x20\x27','Resolving\x20parent\x20segment\x20\x27','resolveSegmentId','Parent\x20name:\x20','4477476CTfNkW','Child\x20name:\x20','verbose','9hwZQNT','execute','128378fBfIFa','Resolved\x20child\x20ID:\x20','length','11iXpJSP','listActivations','List\x20activations\x20for\x20a\x20segment','963AUYSos','error','Error:\x20','cause','description','5cruEtV','✔\x20Found\x20','Resolved\x20parent\x20ID:\x20','Resolving\x20child\x20segment\x20\x27','10201416UISrjE','1662720gOkwds','data','9344fmxqsY','83932qwOCiS','\x27...','547344crUPOL','segment','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','13ecFdrK'];a3_0x1f56=function(){return _0x30c5c4;};return a3_0x1f56();}const a3_0x396d41=a3_0x5a63;(function(_0x104fc1,_0x2b28f8){const _0x447083=a3_0x5a63,_0x302b8f=_0x104fc1();while(!![]){try{const _0x49bcb0=-parseInt(_0x447083(0x10b))/0x1*(-parseInt(_0x447083(0xf3))/0x2)+-parseInt(_0x447083(0xf1))/0x3*(parseInt(_0x447083(0x106))/0x4)+parseInt(_0x447083(0xfe))/0x5*(parseInt(_0x447083(0xee))/0x6)+parseInt(_0x447083(0x108))/0x7+-parseInt(_0x447083(0x105))/0x8*(parseInt(_0x447083(0xf9))/0x9)+-parseInt(_0x447083(0x103))/0xa+parseInt(_0x447083(0xf6))/0xb*(-parseInt(_0x447083(0x102))/0xc);if(_0x49bcb0===_0x2b28f8)break;else _0x302b8f['push'](_0x302b8f['shift']());}catch(_0x8dc87b){_0x302b8f['push'](_0x302b8f['shift']());}}}(a3_0x1f56,0x6efb4));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a3_0x5a63(_0x5865ad,_0x32f74c){_0x5865ad=_0x5865ad-0xe8;const _0x1f56e1=a3_0x1f56();let _0x5a631d=_0x1f56e1[_0x5865ad];return _0x5a631d;}import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';export class ActivationsCommand extends BaseCommand{[a3_0x396d41(0xe8)]='activations';[a3_0x396d41(0xfd)]=a3_0x396d41(0xf8);async[a3_0x396d41(0xf2)](_0x5c1bb5){const _0xcdbdc7=a3_0x396d41,{options:_0x3f612f,args:_0x1b6348,tdx:_0x5e0db2}=_0x5c1bb5;if(_0x1b6348[_0xcdbdc7(0xf5)]===0x0)return console['error']('Error:\x20Segment\x20name\x20is\x20required'),console[_0xcdbdc7(0xfa)]('Usage:\x20tdx\x20activations\x20<parent_name/child_name>'),0x1;try{const {parentId:_0xcc8043,childId:_0x729601}=parseSegmentRef(_0x1b6348[0x0]);if(!_0x729601)return console['error'](_0xcdbdc7(0x10a)),console[_0xcdbdc7(0xfa)]('Usage:\x20tdx\x20activations\x20<parent_name/child_name>'),0x1;_0x3f612f[_0xcdbdc7(0xf0)]&&(console['error']('Site:\x20'+_0x3f612f['site']),console[_0xcdbdc7(0xfa)](_0xcdbdc7(0xed)+_0xcc8043),console[_0xcdbdc7(0xfa)](_0xcdbdc7(0xef)+_0x729601));const _0x4968cd=await withSpinner(_0xcdbdc7(0xeb)+_0xcc8043+'\x27...',()=>_0x5e0db2['segment'][_0xcdbdc7(0xe9)](_0xcc8043),{'verbose':_0x3f612f[_0xcdbdc7(0xf0)]}),_0x3e0088=_0x4968cd[_0xcdbdc7(0x104)];_0x3f612f[_0xcdbdc7(0xf0)]&&console[_0xcdbdc7(0xfa)](_0xcdbdc7(0x100)+_0x3e0088);const _0x46df3b=await withSpinner(_0xcdbdc7(0x101)+_0x729601+'\x27...',()=>_0x5e0db2['segment'][_0xcdbdc7(0xec)](_0x3e0088,_0x729601),{'verbose':_0x3f612f[_0xcdbdc7(0xf0)]}),_0x543ec4=_0x46df3b[_0xcdbdc7(0x104)];_0x3f612f[_0xcdbdc7(0xf0)]&&console[_0xcdbdc7(0xfa)](_0xcdbdc7(0xf4)+_0x543ec4);const _0x12bda0=await withSpinner(_0xcdbdc7(0xea)+_0x729601+_0xcdbdc7(0x107),()=>_0x5e0db2[_0xcdbdc7(0x109)][_0xcdbdc7(0xf7)](_0x3e0088,_0x543ec4),{'verbose':_0x3f612f['verbose']}),_0x31a825=_0x12bda0[_0xcdbdc7(0x104)];return console[_0xcdbdc7(0xfa)](_0xcdbdc7(0xff)+_0x31a825['length']+'\x20activation'+(_0x31a825['length']!==0x1?'s':'')),await handleSDKOutput(_0x31a825,_0x3f612f),0x0;}catch(_0x3ba6e9){if(_0x3ba6e9 instanceof SDKError)return console[_0xcdbdc7(0xfa)](_0xcdbdc7(0xfb)+_0x3ba6e9['message']),_0x3ba6e9[_0xcdbdc7(0xfc)]&&console[_0xcdbdc7(0xfa)]('\x20\x20Cause:\x20'+_0x3ba6e9['cause']),0x1;throw _0x3ba6e9;}}}
@@ -1 +1 @@
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
+ const a4_0x11cca1=a4_0x20d5;function a4_0x337d(){const _0x1562a1=['\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','created','new','\x20\x20Agent\x20\x22','dryRun','\x20\x20Integrations:\x20','errors','✔\x20Context\x20set:\x20','force','Using\x20project\x20from\x20context:\x20','\x20--profile\x20','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','unchanged','agents','\x22:\x20','Source:\x20','yellow','\x20\x20Text\x20Knowledge\x20Base\x20\x22','\x0aChanges:','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','Would\x20clone:','\x0aChanges\x20to\x20agent\x20\x27','agentId','142uxgHYz','Output\x20path:\x20','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','dim','error','\x20\x20tdx\x20agent\x20clone\x20agents/','Using\x20context\x20project:\x20','\x27\x20to\x20create\x20the\x20folder\x20structure.','utf-8','gray','outputPath','Dry\x20run\x20-\x20no\x20files\x20written','cloneProject','prompts','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','join','\x20\x20tdx\x20agent\x20pull\x20','Cancelled','agent:clone','\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','isNew','agent','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x0aProject\x20pushed\x20with\x20errors','cwd-config','Project\x20cloned\x20successfully','outputDir','\x20new','llmProject','name','diff','reason','\x20created','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','execute','Pulling\x20agent\x20\x22','\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','pushProject','Using\x20project\x20from\x20','Analyzing\x20project\x20\x22','\x0aError:','\x0aPull\x20summary\x20for\x20\x27','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','agent:push','2694288ANdBql','\x0aPush\x20','1973070WrPHRc','\x20\x20Prompts:\x20','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','hasChanges','context','\x20\x20Agents:\x20','Analyzing\x20changes\x20to\x20push...','red','message','newProjectId','\x22...','Status:\x20','New\x20project\x20name\x20is\x20required','466980EpDHew','Project:\x20','Errors:','Agent:\x20','experimentalKnowledgeBases','knowledgeBases','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','output','green','agent:pull','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','INVALID_ARGUMENT','Failed\x20to\x20push\x20agent:\x20','Using\x20current\x20project:\x20','Summary:','\x20=\x20','\x20\x20Prompt\x20\x22','sourceProjectName','3180tXeaCa','profile','54364MFoPpn','Chat:\x20','\x20\x20Knowledge\x20Bases:\x20','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','repeat','counts','projectName','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','1338690vLfhoo','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','parse','\x20\x20Knowledge\x20Base\x20\x22','description','pullAgent','source','\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)','\x20\x20Text\x20Knowledge\x20Bases:\x20','\x0aErrors\x20found:','action','integrations','\x20updated','experimentalArtifacts','\x20errors','\x20resources\x20to\x20\x27','Agent\x20pulled\x20successfully','1703168FKQlOZ','Would\x20pull\x20agent:\x20','New\x20project:\x20','log','pushAgent','total','\x0aChanges\x20to\x20integration\x20\x27','tdx.json','\x20\x20Source:\x20','Project\x20cloned\x20with\x20errors','\x20\x20Experimental\x20Artifact\x20\x22','Output:\x20','arg-dir','\x20\x20Integration\x20\x22','\x0a✔\x20Pulled\x20','\x20--name\x20','found','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<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','site','textKnowledgeBases','75mTNtcU','Using\x20local\x20project:\x20','agent.yml','push','\x22\x20from\x20project\x20\x22','Writing\x20files...','\x20unchanged','llm','no_context','7dfNhOA','\x20|\x20','cyan','agentName','Using\x20project:\x20','\x20\x20Target:\x20','no_local_folder','session','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','MISSING_ARGUMENT','\x22\x20to\x20new\x20project\x20\x22','pullProject','Cannot\x20clone\x20from\x20context\x20project\x20\x22','Cloning\x20\x22','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','yes','projectDir','\x20\x20Experimental\x20Artifacts:\x20','updated','\x20successfully','Dry\x20run\x20-\x20no\x20changes\x20made','llm_project','\x0a✔\x20Pushed\x20','projectId','dirname','New\x20project\x20ID:\x20'];a4_0x337d=function(){return _0x1562a1;};return a4_0x337d();}(function(_0x377d0b,_0x2d4bee){const _0xa77b56=a4_0x20d5,_0x24b16f=_0x377d0b();while(!![]){try{const _0x129e1a=parseInt(_0xa77b56(0x183))/0x1*(-parseInt(_0xa77b56(0x1d2))/0x2)+parseInt(_0xa77b56(0x202))/0x3*(parseInt(_0xa77b56(0x1d4))/0x4)+-parseInt(_0xa77b56(0x1dc))/0x5+-parseInt(_0xa77b56(0x1b1))/0x6*(-parseInt(_0xa77b56(0x20b))/0x7)+-parseInt(_0xa77b56(0x1ed))/0x8+parseInt(_0xa77b56(0x1b3))/0x9+-parseInt(_0xa77b56(0x1c0))/0xa;if(_0x129e1a===_0x2d4bee)break;else _0x24b16f['push'](_0x24b16f['shift']());}catch(_0xe47665){_0x24b16f['push'](_0x24b16f['shift']());}}}(a4_0x337d,0x3e3dd));import a4_0xcb3dcc from'chalk';function a4_0x20d5(_0x39f9a5,_0x183855){_0x39f9a5=_0x39f9a5-0x183;const _0x337dbf=a4_0x337d();let _0x20d56f=_0x337dbf[_0x39f9a5];return _0x20d56f;}import a4_0x909fdc from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext,resolveAgentPullArgs}from'../sdk/agent/agent-config.js';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(_0x17a707){const _0x466367=a4_0x20d5,_0x47675d=[];if(_0x17a707[_0x466367(0x1f2)]!==undefined)_0x47675d[_0x466367(0x205)](_0x17a707[_0x466367(0x1f2)]+'\x20total');if(_0x17a707[_0x466367(0x228)]!==undefined&&_0x17a707[_0x466367(0x228)]>0x0)_0x47675d['push'](a4_0xcb3dcc[_0x466367(0x1c8)](_0x17a707[_0x466367(0x228)]+_0x466367(0x19f)));if(_0x17a707[_0x466367(0x227)]!==undefined&&_0x17a707[_0x466367(0x227)]>0x0)_0x47675d[_0x466367(0x205)](a4_0xcb3dcc[_0x466367(0x1c8)](_0x17a707[_0x466367(0x227)]+_0x466367(0x1a4)));if(_0x17a707['updated']!==undefined&&_0x17a707['updated']>0x0)_0x47675d[_0x466367(0x205)](a4_0xcb3dcc[_0x466367(0x236)](_0x17a707['updated']+_0x466367(0x1e8)));if(_0x17a707[_0x466367(0x232)]!==undefined&&_0x17a707[_0x466367(0x232)]>0x0)_0x47675d[_0x466367(0x205)](a4_0xcb3dcc[_0x466367(0x18c)](_0x17a707['unchanged']+_0x466367(0x208)));if(_0x17a707['errors']!==undefined&&_0x17a707['errors']>0x0)_0x47675d['push'](a4_0xcb3dcc[_0x466367(0x1ba)](_0x17a707['errors']+_0x466367(0x1ea)));return _0x47675d[_0x466367(0x193)](',\x20');}function displayDiffs(_0x1efd01,_0x6bbcea,_0x393279,_0x464cca,_0x3e396e,_0x2ce197,_0x44007c){const _0x4f4834=a4_0x20d5;for(const _0x2a84c0 of _0x1efd01){if(_0x2a84c0[_0x4f4834(0x1a2)]){const _0x215dbf=_0x2a84c0[_0x4f4834(0x20e)]||_0x2a84c0[_0x4f4834(0x1a1)];console['log'](_0x4f4834(0x23b)+_0x215dbf+'\x27:'),console['log']('─'[_0x4f4834(0x1d8)](0x3c)),console['log'](_0x2a84c0[_0x4f4834(0x1a2)]),console[_0x4f4834(0x1f0)]('─'[_0x4f4834(0x1d8)](0x3c));}}for(const _0x42959a of _0x6bbcea){_0x42959a[_0x4f4834(0x1a2)]&&(console[_0x4f4834(0x1f0)]('\x0aChanges\x20to\x20knowledge\x20base\x20\x27'+_0x42959a[_0x4f4834(0x1a1)]+'\x27:'),console[_0x4f4834(0x1f0)]('─'[_0x4f4834(0x1d8)](0x3c)),console[_0x4f4834(0x1f0)](_0x42959a[_0x4f4834(0x1a2)]),console[_0x4f4834(0x1f0)]('─'[_0x4f4834(0x1d8)](0x3c)));}for(const _0x5ea6d5 of _0x393279){_0x5ea6d5['diff']&&(console[_0x4f4834(0x1f0)](_0x4f4834(0x239)+_0x5ea6d5[_0x4f4834(0x1a1)]+'\x27:'),console[_0x4f4834(0x1f0)]('─'[_0x4f4834(0x1d8)](0x3c)),console['log'](_0x5ea6d5['diff']),console['log']('─'[_0x4f4834(0x1d8)](0x3c)));}for(const _0x9bac44 of _0x464cca){_0x9bac44[_0x4f4834(0x1a2)]&&(console[_0x4f4834(0x1f0)]('\x0aChanges\x20to\x20prompt\x20\x27'+_0x9bac44[_0x4f4834(0x1a1)]+'\x27:'),console['log']('─'[_0x4f4834(0x1d8)](0x3c)),console[_0x4f4834(0x1f0)](_0x9bac44[_0x4f4834(0x1a2)]),console[_0x4f4834(0x1f0)]('─'[_0x4f4834(0x1d8)](0x3c)));}for(const _0x53e1f9 of _0x3e396e){_0x53e1f9[_0x4f4834(0x1a2)]&&(console[_0x4f4834(0x1f0)](_0x4f4834(0x1f3)+_0x53e1f9[_0x4f4834(0x1a1)]+'\x27:'),console[_0x4f4834(0x1f0)]('─'[_0x4f4834(0x1d8)](0x3c)),console[_0x4f4834(0x1f0)](_0x53e1f9[_0x4f4834(0x1a2)]),console[_0x4f4834(0x1f0)]('─'['repeat'](0x3c)));}for(const _0x5c09eb of _0x2ce197){_0x5c09eb[_0x4f4834(0x1a2)]&&(console[_0x4f4834(0x1f0)](_0x4f4834(0x225)+_0x5c09eb['name']+'\x27:'),console[_0x4f4834(0x1f0)]('─'[_0x4f4834(0x1d8)](0x3c)),console[_0x4f4834(0x1f0)](_0x5c09eb['diff']),console[_0x4f4834(0x1f0)]('─'['repeat'](0x3c)));}for(const _0x4020b7 of _0x44007c){_0x4020b7[_0x4f4834(0x1a2)]&&(console[_0x4f4834(0x1f0)]('\x0aChanges\x20to\x20experimental\x20artifact\x20\x27'+_0x4020b7[_0x4f4834(0x1a1)]+'\x27:'),console['log']('─'[_0x4f4834(0x1d8)](0x3c)),console[_0x4f4834(0x1f0)](_0x4020b7[_0x4f4834(0x1a2)]),console[_0x4f4834(0x1f0)]('─'['repeat'](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x11cca1(0x1a1)]=a4_0x11cca1(0x1c9);[a4_0x11cca1(0x1e0)]=a4_0x11cca1(0x1af);async[a4_0x11cca1(0x1a6)](_0x56ad8d){const _0x1fe002=a4_0x11cca1,{options:_0x3c9e83,args:_0x511bf1,tdx:_0xb35a00}=_0x56ad8d,_0x5466d1=_0x511bf1[0x0],_0x18553c=_0x511bf1[0x1],_0x5ee4cd=_0x3c9e83[_0x1fe002(0x1c7)],_0x368ac7=_0x3c9e83[_0x1fe002(0x22a)],_0x52ad99=_0x3c9e83[_0x1fe002(0x22e)],_0xdab032=_0x3c9e83[_0x1fe002(0x21a)],_0x1124ea=_0x3c9e83[_0x1fe002(0x1a0)],_0x588e86=_0x3c9e83[_0x1fe002(0x199)];let _0x18b022;if(_0x5466d1){const _0x5c4a28=a4_0x909fdc['join'](_0x5466d1,_0x1fe002(0x1f4));if(existsSync(_0x5c4a28))try{const _0x4ac49e=JSON[_0x1fe002(0x1de)](readFileSync(_0x5c4a28,_0x1fe002(0x18b)));_0x4ac49e[_0x1fe002(0x220)]&&(_0x18b022={'llm_project':_0x4ac49e[_0x1fe002(0x220)]});}catch{}}const _0x1f5a84=findAgentConfigPath(process['cwd']());let _0x41e133;if(_0x1f5a84)try{const _0x5b54d9=JSON[_0x1fe002(0x1de)](readFileSync(_0x1f5a84,_0x1fe002(0x18b)));_0x5b54d9[_0x1fe002(0x220)]&&(_0x41e133={'llm_project':_0x5b54d9[_0x1fe002(0x220)]});}catch{}const _0x30d358=resolveAgentPullArgs({'arg':_0x5466d1,'agentNameArg':_0x18553c,'agentFlag':_0x588e86,'contextProject':_0x1124ea,'argDirConfig':_0x18b022,'cwdConfigPath':_0x1f5a84||undefined,'cwdConfig':_0x41e133}),{projectNameOrId:_0x49ac35,targetAgentName:_0x3ce6a4,existingOutputDir:_0x5954d2,source:_0x4faad3}=_0x30d358;if(_0x4faad3===_0x1fe002(0x1f9))console['log'](a4_0xcb3dcc['dim'](_0x1fe002(0x1aa)+a4_0x909fdc[_0x1fe002(0x193)](_0x5466d1,_0x1fe002(0x1f4))+':\x20'+_0x49ac35));else{if(_0x4faad3===_0x1fe002(0x19c))console[_0x1fe002(0x1f0)](a4_0xcb3dcc[_0x1fe002(0x186)](_0x1fe002(0x20f)+_0x49ac35));else _0x4faad3===_0x1fe002(0x1b7)&&console['log'](a4_0xcb3dcc[_0x1fe002(0x186)](_0x1fe002(0x22f)+_0x49ac35));}if(!_0x49ac35)return _0x588e86?(console[_0x1fe002(0x1f0)](a4_0xcb3dcc[_0x1fe002(0x236)](_0x1fe002(0x191))),console[_0x1fe002(0x1f0)]('Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>'),console['log']('Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>')):(console[_0x1fe002(0x1f0)](a4_0xcb3dcc['yellow'](_0x1fe002(0x1db))),console['log']('Usage:\x20tdx\x20agent\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20project\x20(requires\x20context\x20or\x20tdx.json)'),console[_0x1fe002(0x1f0)](_0x1fe002(0x1a8)),console[_0x1fe002(0x1f0)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory'),console[_0x1fe002(0x1f0)](_0x1fe002(0x197)),console[_0x1fe002(0x1f0)]('\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(_0x3ce6a4){const {data:_0x16b529}=await withSpinner(_0x1fe002(0x1a7)+_0x3ce6a4+_0x1fe002(0x206)+_0x49ac35+_0x1fe002(0x1bd),()=>_0xb35a00[_0x1fe002(0x209)][_0x1fe002(0x1e1)](_0x49ac35,_0x3ce6a4,_0x5ee4cd,{'dryRun':_0x368ac7,'force':_0x52ad99}));if(_0x368ac7)return console[_0x1fe002(0x1f0)](a4_0xcb3dcc[_0x1fe002(0x236)](_0x1fe002(0x18e))),console['log'](_0x1fe002(0x1ee)+_0x16b529[_0x1fe002(0x20e)]),console[_0x1fe002(0x1f0)](_0x1fe002(0x184)+_0x16b529[_0x1fe002(0x18d)]),_0x16b529[_0x1fe002(0x1a2)]&&(console[_0x1fe002(0x1f0)](_0x1fe002(0x238)),console['log']('─'[_0x1fe002(0x1d8)](0x3c)),console[_0x1fe002(0x1f0)](_0x16b529[_0x1fe002(0x1a2)]),console[_0x1fe002(0x1f0)]('─'[_0x1fe002(0x1d8)](0x3c))),0x0;return console[_0x1fe002(0x1f0)](a4_0xcb3dcc[_0x1fe002(0x1c8)](_0x1fe002(0x1ec))),console['log'](_0x1fe002(0x1c3)+_0x16b529[_0x1fe002(0x20e)]),console['log'](_0x1fe002(0x1f8)+_0x16b529[_0x1fe002(0x18d)]),console[_0x1fe002(0x1f0)](_0x1fe002(0x1be)+(_0x16b529[_0x1fe002(0x198)]?a4_0xcb3dcc['green'](_0x1fe002(0x228)):_0x16b529[_0x1fe002(0x1b6)]?a4_0xcb3dcc['yellow']('updated'):a4_0xcb3dcc['gray'](_0x1fe002(0x232)))),0x0;}const _0x4fe0f2=_0x5954d2||_0x5ee4cd,{data:_0x176989}=await withSpinner(_0x1fe002(0x1ab)+_0x49ac35+'\x22...',()=>_0xb35a00['llm'][_0x1fe002(0x216)](_0x49ac35,_0x4fe0f2,{'dryRun':!![]})),_0x3a71a6=_0x176989[_0x1fe002(0x1d9)]['agents']['new']+_0x176989[_0x1fe002(0x1d9)]['knowledgeBases'][_0x1fe002(0x228)]+_0x176989['counts']['textKnowledgeBases']['new']+_0x176989[_0x1fe002(0x1d9)][_0x1fe002(0x190)]['new']+_0x176989[_0x1fe002(0x1d9)][_0x1fe002(0x1e7)][_0x1fe002(0x228)]+_0x176989['counts'][_0x1fe002(0x1c4)]['new']+_0x176989[_0x1fe002(0x1d9)][_0x1fe002(0x1e9)]['new'],_0x566feb=_0x176989['counts'][_0x1fe002(0x233)][_0x1fe002(0x21d)]+_0x176989['counts'][_0x1fe002(0x1c5)][_0x1fe002(0x21d)]+_0x176989[_0x1fe002(0x1d9)][_0x1fe002(0x201)][_0x1fe002(0x21d)]+_0x176989['counts'][_0x1fe002(0x190)][_0x1fe002(0x21d)]+_0x176989[_0x1fe002(0x1d9)][_0x1fe002(0x1e7)][_0x1fe002(0x21d)]+_0x176989['counts'][_0x1fe002(0x1c4)][_0x1fe002(0x21d)]+_0x176989[_0x1fe002(0x1d9)][_0x1fe002(0x1e9)][_0x1fe002(0x21d)],_0xc3295d=_0x176989[_0x1fe002(0x1d9)]['agents'][_0x1fe002(0x232)]+_0x176989[_0x1fe002(0x1d9)][_0x1fe002(0x1c5)]['unchanged']+_0x176989[_0x1fe002(0x1d9)][_0x1fe002(0x201)]['unchanged']+_0x176989[_0x1fe002(0x1d9)][_0x1fe002(0x190)][_0x1fe002(0x232)]+_0x176989['counts'][_0x1fe002(0x1e7)][_0x1fe002(0x232)]+_0x176989['counts'][_0x1fe002(0x1c4)]['unchanged']+_0x176989['counts'][_0x1fe002(0x1e9)][_0x1fe002(0x232)];console[_0x1fe002(0x1f0)](_0x1fe002(0x1ad)+_0x176989[_0x1fe002(0x1da)]+'\x27:'),console['log']('\x20\x20'+a4_0xcb3dcc['green']('+\x20'+_0x3a71a6+_0x1fe002(0x19f))+'\x20|\x20'+a4_0xcb3dcc[_0x1fe002(0x236)]('~\x20'+_0x566feb+'\x20changed')+_0x1fe002(0x20c)+a4_0xcb3dcc[_0x1fe002(0x186)]('=\x20'+_0xc3295d+_0x1fe002(0x208))),console[_0x1fe002(0x1f0)](_0x1fe002(0x1b8)+formatCountSummary(_0x176989[_0x1fe002(0x1d9)][_0x1fe002(0x233)])),console[_0x1fe002(0x1f0)](_0x1fe002(0x1d6)+formatCountSummary(_0x176989[_0x1fe002(0x1d9)][_0x1fe002(0x1c5)])),console['log'](_0x1fe002(0x1e4)+formatCountSummary(_0x176989[_0x1fe002(0x1d9)][_0x1fe002(0x201)])),console[_0x1fe002(0x1f0)](_0x1fe002(0x1b4)+formatCountSummary(_0x176989['counts'][_0x1fe002(0x190)])),console[_0x1fe002(0x1f0)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x176989[_0x1fe002(0x1d9)][_0x1fe002(0x1e7)]));const _0x26388c=_0x176989[_0x1fe002(0x1d9)][_0x1fe002(0x1c4)][_0x1fe002(0x1f2)]>0x0||_0x176989[_0x1fe002(0x1d9)][_0x1fe002(0x1e9)]['total']>0x0;_0x26388c&&(console[_0x1fe002(0x1f0)](_0x1fe002(0x1ae)+formatCountSummary(_0x176989[_0x1fe002(0x1d9)]['experimentalKnowledgeBases'])),console[_0x1fe002(0x1f0)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x176989[_0x1fe002(0x1d9)][_0x1fe002(0x1e9)])));console['log'](_0x1fe002(0x210)+a4_0xcb3dcc['cyan'](_0x176989[_0x1fe002(0x19e)])),displayDiffs(_0x176989[_0x1fe002(0x233)],_0x176989[_0x1fe002(0x1c5)],_0x176989[_0x1fe002(0x201)],_0x176989['prompts'],_0x176989['integrations'],_0x176989[_0x1fe002(0x1c4)],_0x176989[_0x1fe002(0x1e9)]);if(_0x368ac7)return console[_0x1fe002(0x1f0)](a4_0xcb3dcc[_0x1fe002(0x236)](_0x1fe002(0x219))),0x0;if(_0x3a71a6===0x0&&_0x566feb===0x0)return console[_0x1fe002(0x1f0)](a4_0xcb3dcc[_0x1fe002(0x1c8)](_0x1fe002(0x1a5))),saveSessionContext({'llm_project':_0x176989[_0x1fe002(0x1da)]},_0x3c9e83[_0x1fe002(0x212)]),console['log'](a4_0xcb3dcc[_0x1fe002(0x1c8)](_0x1fe002(0x22d)+a4_0xcb3dcc[_0x1fe002(0x186)](_0x1fe002(0x220))+_0x1fe002(0x1cf)+a4_0xcb3dcc['cyan'](_0x176989[_0x1fe002(0x1da)]))),0x0;if(!_0xdab032&&!_0x52ad99){if(!isInteractive())return console[_0x1fe002(0x187)](a4_0xcb3dcc[_0x1fe002(0x1ba)](_0x1fe002(0x1ac)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x1fe002(0x187)](a4_0xcb3dcc[_0x1fe002(0x186)](_0x1fe002(0x19a))),0x1;const _0x1ba43e=await confirmKey('\x0aWrite\x20'+(_0x3a71a6+_0x566feb)+'\x20files?');if(!_0x1ba43e)return console[_0x1fe002(0x1f0)](a4_0xcb3dcc[_0x1fe002(0x236)](_0x1fe002(0x195)),'-\x20no\x20files\x20written'),0x1;}const {data:_0x8d24fa}=await withSpinner(_0x1fe002(0x207),()=>_0xb35a00['llm'][_0x1fe002(0x216)](_0x49ac35,_0x4fe0f2,{'force':_0x52ad99}));return console['log'](a4_0xcb3dcc[_0x1fe002(0x1c8)](_0x1fe002(0x1fb)+(_0x3a71a6+_0x566feb)+'\x20files\x20to\x20'+_0x8d24fa[_0x1fe002(0x19e)])),saveSessionContext({'llm_project':_0x8d24fa['projectName']},_0x3c9e83[_0x1fe002(0x212)]),console[_0x1fe002(0x1f0)](a4_0xcb3dcc[_0x1fe002(0x1c8)](_0x1fe002(0x22d)+a4_0xcb3dcc['dim']('llm_project')+_0x1fe002(0x1cf)+a4_0xcb3dcc['cyan'](_0x8d24fa[_0x1fe002(0x1da)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{['name']=a4_0x11cca1(0x196);['description']=a4_0x11cca1(0x185);async[a4_0x11cca1(0x1a6)](_0x26b8d3){const _0x194468=a4_0x11cca1,{options:_0x67f519,args:_0x4e78b7,tdx:_0x109bc0}=_0x26b8d3,_0x4644d8=_0x4e78b7[0x0],_0x413009=_0x67f519['name'],_0x4e2a71=_0x67f519[_0x194468(0x22a)],_0x5ca1f7=_0x67f519[_0x194468(0x21a)],_0x2c67f1=_0x67f519[_0x194468(0x200)],_0x49a59c=_0x67f519['llmProject'];let _0x5ea773;const _0x2e4f87=findAgentConfigPath(process['cwd']());if(_0x4644d8){const _0x244c91=a4_0x909fdc['join'](_0x4644d8,_0x194468(0x1f4));existsSync(_0x244c91)?(_0x5ea773=_0x4644d8,console['log'](a4_0xcb3dcc[_0x194468(0x186)](_0x194468(0x203)+_0x4644d8))):_0x5ea773=_0x4644d8;}else{if(_0x2e4f87)_0x5ea773=a4_0x909fdc[_0x194468(0x223)](_0x2e4f87),console[_0x194468(0x1f0)](a4_0xcb3dcc[_0x194468(0x186)](_0x194468(0x1cd)+_0x5ea773));else{if(_0x49a59c){const _0x821c82=sanitizeForFilesystem(_0x49a59c);let _0x15508e=_0x821c82,_0xba9314=a4_0x909fdc[_0x194468(0x193)](process['cwd'](),_0x194468(0x233),_0x821c82,_0x194468(0x1f4));if(!existsSync(_0xba9314)){const _0x85c274=normalizeName(_0x49a59c),_0x8669d5=a4_0x909fdc[_0x194468(0x193)](process['cwd'](),_0x194468(0x233),_0x85c274,_0x194468(0x1f4));existsSync(_0x8669d5)&&(_0x15508e=_0x85c274,_0xba9314=_0x8669d5);}if(existsSync(_0xba9314))_0x5ea773=a4_0x909fdc[_0x194468(0x223)](_0xba9314),console[_0x194468(0x1f0)](a4_0xcb3dcc[_0x194468(0x186)](_0x194468(0x203)+_0x5ea773));else{const _0x5da3a7=_0x67f519[_0x194468(0x1d3)];if(_0x5da3a7)throw new SDKError(ErrorCode[_0x194468(0x1cb)],_0x194468(0x217)+_0x49a59c+'\x22\x20to\x20a\x20different\x20profile',undefined,{'helpText':'When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a'+_0x194468(0x213)+(_0x194468(0x194)+_0x49a59c+'\x0a')+(_0x194468(0x188)+_0x15508e+_0x194468(0x1fc)+(_0x413009||'<new-name>')+_0x194468(0x230)+_0x5da3a7)});_0x5ea773=_0x49a59c,console[_0x194468(0x1f0)](a4_0xcb3dcc['dim'](_0x194468(0x189)+_0x49a59c));}}}}if(!_0x5ea773)return console[_0x194468(0x1f0)](a4_0xcb3dcc[_0x194468(0x236)](_0x194468(0x1b5))),console[_0x194468(0x1f0)](_0x194468(0x1dd)),console[_0x194468(0x1f0)](_0x194468(0x1ff)),console[_0x194468(0x1f0)](_0x194468(0x1e3)),console[_0x194468(0x1f0)](_0x194468(0x1d7)),0x1;if(!_0x413009)throw new SDKError(ErrorCode[_0x194468(0x214)],_0x194468(0x1bf),undefined,{'helpText':_0x194468(0x231)});if(!_0x5ca1f7&&!_0x4e2a71){if(!isInteractive())return console[_0x194468(0x187)](a4_0xcb3dcc[_0x194468(0x1ba)](_0x194468(0x1ac)),_0x194468(0x192)),console['error'](a4_0xcb3dcc[_0x194468(0x186)](_0x194468(0x19a))),0x1;const _0x1168b3=await confirmKey('Clone\x20\x22'+_0x5ea773+_0x194468(0x215)+_0x413009+'\x22?');if(!_0x1168b3)return console[_0x194468(0x1f0)](a4_0xcb3dcc[_0x194468(0x236)](_0x194468(0x195))),0x1;}const {data:_0x2e1a17}=await withSpinner(_0x194468(0x218)+_0x5ea773+'\x22\x20to\x20\x22'+_0x413009+_0x194468(0x1bd),()=>_0x109bc0[_0x194468(0x209)][_0x194468(0x18f)](_0x5ea773,_0x413009,{'dryRun':_0x4e2a71}));if(_0x4e2a71){console[_0x194468(0x1f0)](a4_0xcb3dcc['yellow'](_0x194468(0x21f))),console[_0x194468(0x1f0)](_0x194468(0x235)+_0x2e1a17[_0x194468(0x1d1)]),console['log'](_0x194468(0x1ef)+_0x413009),console[_0x194468(0x1f0)](_0x194468(0x23a)),console[_0x194468(0x1f0)]('\x20\x20Agents:\x20'+_0x2e1a17['counts'][_0x194468(0x233)][_0x194468(0x227)]),console[_0x194468(0x1f0)]('\x20\x20Knowledge\x20Bases:\x20'+_0x2e1a17['counts'][_0x194468(0x1c5)][_0x194468(0x227)]),console[_0x194468(0x1f0)](_0x194468(0x1b4)+_0x2e1a17['counts']['prompts']['created']);const _0x50702f=_0x2e1a17[_0x194468(0x1d9)][_0x194468(0x1c4)]['created']>0x0||_0x2e1a17[_0x194468(0x1d9)][_0x194468(0x1e9)][_0x194468(0x227)]>0x0;return _0x50702f&&(console[_0x194468(0x1f0)](_0x194468(0x1ae)+_0x2e1a17[_0x194468(0x1d9)][_0x194468(0x1c4)][_0x194468(0x227)]),console[_0x194468(0x1f0)](_0x194468(0x21c)+_0x2e1a17['counts'][_0x194468(0x1e9)]['created'])),0x0;}const _0x2bcd6b=_0x2e1a17['counts'][_0x194468(0x233)][_0x194468(0x22c)]>0x0||_0x2e1a17[_0x194468(0x1d9)]['knowledgeBases']['errors']>0x0||_0x2e1a17[_0x194468(0x1d9)][_0x194468(0x190)][_0x194468(0x22c)]>0x0||_0x2e1a17[_0x194468(0x1d9)][_0x194468(0x1c4)][_0x194468(0x22c)]>0x0||_0x2e1a17['counts'][_0x194468(0x1e9)]['errors']>0x0;_0x2bcd6b?console[_0x194468(0x1f0)](a4_0xcb3dcc[_0x194468(0x236)](_0x194468(0x1f6))):console['log'](a4_0xcb3dcc['green'](_0x194468(0x19d)));console[_0x194468(0x1f0)]('Source:\x20'+_0x2e1a17[_0x194468(0x1d1)]),console[_0x194468(0x1f0)]('New\x20project:\x20'+_0x2e1a17['newProjectName']),console[_0x194468(0x1f0)](_0x194468(0x224)+_0x2e1a17[_0x194468(0x1bc)]),console['log'](),console[_0x194468(0x1f0)](_0x194468(0x1ce)),console[_0x194468(0x1f0)](_0x194468(0x1b8)+formatCountSummary(_0x2e1a17[_0x194468(0x1d9)][_0x194468(0x233)])),console['log'](_0x194468(0x1d6)+formatCountSummary(_0x2e1a17[_0x194468(0x1d9)][_0x194468(0x1c5)])),console[_0x194468(0x1f0)](_0x194468(0x1b4)+formatCountSummary(_0x2e1a17[_0x194468(0x1d9)]['prompts'])),console[_0x194468(0x1f0)](_0x194468(0x22b)+formatCountSummary(_0x2e1a17[_0x194468(0x1d9)][_0x194468(0x1e7)]));const _0x4f6bb3=_0x2e1a17[_0x194468(0x1d9)][_0x194468(0x1c4)][_0x194468(0x227)]>0x0||_0x2e1a17[_0x194468(0x1d9)]['experimentalKnowledgeBases'][_0x194468(0x21d)]>0x0||_0x2e1a17[_0x194468(0x1d9)][_0x194468(0x1c4)][_0x194468(0x232)]>0x0||_0x2e1a17[_0x194468(0x1d9)][_0x194468(0x1e9)]['created']>0x0||_0x2e1a17[_0x194468(0x1d9)][_0x194468(0x1e9)]['updated']>0x0||_0x2e1a17['counts'][_0x194468(0x1e9)][_0x194468(0x232)]>0x0;_0x4f6bb3&&(console[_0x194468(0x1f0)](_0x194468(0x1ae)+formatCountSummary(_0x2e1a17[_0x194468(0x1d9)][_0x194468(0x1c4)])),console[_0x194468(0x1f0)](_0x194468(0x21c)+formatCountSummary(_0x2e1a17[_0x194468(0x1d9)][_0x194468(0x1e9)])));if(_0x2bcd6b){console['log'](),console[_0x194468(0x1f0)](a4_0xcb3dcc[_0x194468(0x1ba)](_0x194468(0x1c2)));for(const _0x5003ca of _0x2e1a17['agents']){_0x5003ca[_0x194468(0x1e6)]==='error'&&console[_0x194468(0x1f0)](a4_0xcb3dcc[_0x194468(0x1ba)]('\x20\x20Agent\x20\x22'+_0x5003ca[_0x194468(0x20e)]+'\x22:\x20'+_0x5003ca['error']));}for(const _0x1570d2 of _0x2e1a17[_0x194468(0x1c5)]){_0x1570d2[_0x194468(0x1e6)]===_0x194468(0x187)&&console[_0x194468(0x1f0)](a4_0xcb3dcc['red'](_0x194468(0x1df)+_0x1570d2[_0x194468(0x1a1)]+'\x22:\x20'+_0x1570d2[_0x194468(0x187)]));}for(const _0x435406 of _0x2e1a17[_0x194468(0x190)]){_0x435406[_0x194468(0x1e6)]===_0x194468(0x187)&&console[_0x194468(0x1f0)](a4_0xcb3dcc[_0x194468(0x1ba)](_0x194468(0x1d0)+_0x435406[_0x194468(0x1a1)]+_0x194468(0x234)+_0x435406[_0x194468(0x187)]));}for(const _0x1d6b7b of _0x2e1a17[_0x194468(0x1e7)]){_0x1d6b7b[_0x194468(0x1e6)]==='error'&&console['log'](a4_0xcb3dcc[_0x194468(0x1ba)]('\x20\x20Integration\x20\x22'+_0x1d6b7b[_0x194468(0x1a1)]+_0x194468(0x234)+_0x1d6b7b[_0x194468(0x187)]));}for(const _0x58e468 of _0x2e1a17[_0x194468(0x1c4)]){_0x58e468[_0x194468(0x1e6)]===_0x194468(0x187)&&console[_0x194468(0x1f0)](a4_0xcb3dcc[_0x194468(0x1ba)]('\x20\x20Experimental\x20Knowledge\x20Base\x20\x22'+_0x58e468['name']+_0x194468(0x234)+_0x58e468[_0x194468(0x187)]));}for(const _0x2b4a7a of _0x2e1a17['experimentalArtifacts']){_0x2b4a7a['action']===_0x194468(0x187)&&console[_0x194468(0x1f0)](a4_0xcb3dcc[_0x194468(0x1ba)](_0x194468(0x1f7)+_0x2b4a7a[_0x194468(0x1a1)]+'\x22:\x20'+_0x2b4a7a[_0x194468(0x187)]));}return 0x1;}console[_0x194468(0x1f0)]();const _0xbe031e=getLLMProjectUrl(_0x2c67f1,_0x2e1a17['newProjectId']);return console[_0x194468(0x1f0)](_0x194468(0x1c1)+a4_0xcb3dcc[_0x194468(0x20d)](_0xbe031e)),0x0;}}export class AgentPushCommand extends BaseCommand{['name']=a4_0x11cca1(0x1b0);[a4_0x11cca1(0x1e0)]=a4_0x11cca1(0x1ca);async['execute'](_0x2a74c1){const _0x1f0da7=a4_0x11cca1,{options:_0x22fa82,args:_0x130b29,tdx:_0x2998a7}=_0x2a74c1;let _0x176f22=_0x130b29[0x0]||process['cwd']();const _0x4d57b1=_0x22fa82[_0x1f0da7(0x22a)],_0x3c3b1a=_0x22fa82[_0x1f0da7(0x22e)],_0x2bb35c=_0x22fa82[_0x1f0da7(0x21a)],_0x227ff2=_0x22fa82['site'],_0x55a6f9=a4_0x909fdc[_0x1f0da7(0x193)](_0x176f22,_0x1f0da7(0x204)),_0x3989d1=existsSync(_0x55a6f9);if(_0x3989d1){const {data:_0x78d069}=await withSpinner('Pushing\x20agent\x20from\x20\x22'+_0x176f22+_0x1f0da7(0x1bd),()=>_0x2998a7[_0x1f0da7(0x209)][_0x1f0da7(0x1f1)](_0x176f22,{'dryRun':_0x4d57b1,'force':_0x3c3b1a}));if(_0x4d57b1)return console[_0x1f0da7(0x1f0)](a4_0xcb3dcc[_0x1f0da7(0x236)](_0x1f0da7(0x21f))),console['log']('Would\x20push\x20agent:\x20'+_0x78d069['agentName']),0x0;if(_0x78d069['action']===_0x1f0da7(0x187))return console[_0x1f0da7(0x1f0)](a4_0xcb3dcc[_0x1f0da7(0x1ba)](_0x1f0da7(0x1cc)+_0x78d069[_0x1f0da7(0x187)])),0x1;console[_0x1f0da7(0x1f0)](a4_0xcb3dcc[_0x1f0da7(0x1c8)]('Agent\x20'+_0x78d069['action']+_0x1f0da7(0x21e))),console[_0x1f0da7(0x1f0)](_0x1f0da7(0x1c3)+_0x78d069[_0x1f0da7(0x20e)]);if(_0x78d069[_0x1f0da7(0x23c)]&&_0x78d069['projectId']){const _0x52c020=getLLMAgentChatUrl(_0x227ff2,_0x78d069[_0x1f0da7(0x222)],_0x78d069[_0x1f0da7(0x23c)]);console[_0x1f0da7(0x1f0)](_0x1f0da7(0x1d5)+a4_0xcb3dcc['cyan'](_0x52c020));}return 0x0;}const _0x172c49=_0x22fa82['llmProject'],_0x43375e=resolveProjectFromContext(_0x176f22,_0x172c49);if(_0x43375e[_0x1f0da7(0x1fd)])_0x176f22=_0x43375e[_0x1f0da7(0x21b)],_0x43375e[_0x1f0da7(0x1e2)]==='context'&&console['log'](a4_0xcb3dcc[_0x1f0da7(0x186)]('Using\x20project:\x20'+_0x176f22));else{let _0x187997=_0x1f0da7(0x1fe);_0x43375e['reason']===_0x1f0da7(0x211)&&(_0x187997=_0x43375e[_0x1f0da7(0x1bb)]+'\x0aRun\x20\x27tdx\x20agent\x20pull\x20'+_0x43375e[_0x1f0da7(0x1a0)]+_0x1f0da7(0x18a));throw new SDKError(ErrorCode[_0x1f0da7(0x1cb)],_0x43375e[_0x1f0da7(0x1a3)]===_0x1f0da7(0x20a)?_0x43375e[_0x1f0da7(0x1bb)]:'No\x20tdx.json\x20found\x20in\x20'+_0x176f22,undefined,{'helpText':_0x187997});}const {data:_0x188458}=await withSpinner(_0x1f0da7(0x1b9),()=>_0x2998a7['llm'][_0x1f0da7(0x1a9)](_0x176f22,{'dryRun':!![]})),_0x5c91ce=_0x188458[_0x1f0da7(0x1d9)][_0x1f0da7(0x233)]['errors']>0x0;if(_0x5c91ce){console[_0x1f0da7(0x1f0)](a4_0xcb3dcc[_0x1f0da7(0x1ba)](_0x1f0da7(0x1e5)));for(const _0x2bd433 of _0x188458['agents']){_0x2bd433[_0x1f0da7(0x1e6)]===_0x1f0da7(0x187)&&console[_0x1f0da7(0x1f0)](a4_0xcb3dcc[_0x1f0da7(0x1ba)](_0x1f0da7(0x229)+_0x2bd433[_0x1f0da7(0x20e)]+_0x1f0da7(0x234)+_0x2bd433['error']));}return 0x1;}const _0x33ece3=_0x188458[_0x1f0da7(0x1d9)][_0x1f0da7(0x233)][_0x1f0da7(0x227)]+_0x188458['counts'][_0x1f0da7(0x1c5)][_0x1f0da7(0x227)]+_0x188458[_0x1f0da7(0x1d9)][_0x1f0da7(0x201)][_0x1f0da7(0x227)]+_0x188458[_0x1f0da7(0x1d9)]['prompts'][_0x1f0da7(0x227)]+_0x188458[_0x1f0da7(0x1d9)][_0x1f0da7(0x1e7)]['created']+_0x188458[_0x1f0da7(0x1d9)][_0x1f0da7(0x1c4)]['created']+_0x188458['counts'][_0x1f0da7(0x1e9)][_0x1f0da7(0x227)],_0x25a3b5=_0x188458[_0x1f0da7(0x1d9)][_0x1f0da7(0x233)][_0x1f0da7(0x21d)]+_0x188458[_0x1f0da7(0x1d9)]['knowledgeBases'][_0x1f0da7(0x21d)]+_0x188458[_0x1f0da7(0x1d9)][_0x1f0da7(0x201)][_0x1f0da7(0x21d)]+_0x188458['counts'][_0x1f0da7(0x190)][_0x1f0da7(0x21d)]+_0x188458[_0x1f0da7(0x1d9)][_0x1f0da7(0x1e7)][_0x1f0da7(0x21d)]+_0x188458['counts'][_0x1f0da7(0x1c4)]['updated']+_0x188458[_0x1f0da7(0x1d9)][_0x1f0da7(0x1e9)][_0x1f0da7(0x21d)],_0x238f75=_0x188458['counts'][_0x1f0da7(0x233)]['unchanged']+_0x188458[_0x1f0da7(0x1d9)]['knowledgeBases'][_0x1f0da7(0x232)]+_0x188458[_0x1f0da7(0x1d9)][_0x1f0da7(0x201)][_0x1f0da7(0x232)]+_0x188458[_0x1f0da7(0x1d9)][_0x1f0da7(0x190)][_0x1f0da7(0x232)]+_0x188458['counts']['integrations']['unchanged']+_0x188458[_0x1f0da7(0x1d9)][_0x1f0da7(0x1c4)][_0x1f0da7(0x232)]+_0x188458['counts'][_0x1f0da7(0x1e9)][_0x1f0da7(0x232)];console['log']('\x0aPush\x20summary\x20for\x20\x27'+_0x188458[_0x1f0da7(0x1da)]+'\x27:'),console['log']('\x20\x20'+a4_0xcb3dcc[_0x1f0da7(0x1c8)]('+\x20'+_0x33ece3+_0x1f0da7(0x19f))+'\x20|\x20'+a4_0xcb3dcc[_0x1f0da7(0x236)]('~\x20'+_0x25a3b5+'\x20changed')+'\x20|\x20'+a4_0xcb3dcc[_0x1f0da7(0x186)]('=\x20'+_0x238f75+'\x20unchanged')),console[_0x1f0da7(0x1f0)](_0x1f0da7(0x1b8)+formatCountSummary(_0x188458[_0x1f0da7(0x1d9)][_0x1f0da7(0x233)])),console[_0x1f0da7(0x1f0)](_0x1f0da7(0x1d6)+formatCountSummary(_0x188458['counts'][_0x1f0da7(0x1c5)])),console[_0x1f0da7(0x1f0)](_0x1f0da7(0x1e4)+formatCountSummary(_0x188458[_0x1f0da7(0x1d9)]['textKnowledgeBases'])),console[_0x1f0da7(0x1f0)](_0x1f0da7(0x1b4)+formatCountSummary(_0x188458[_0x1f0da7(0x1d9)]['prompts'])),console['log'](_0x1f0da7(0x22b)+formatCountSummary(_0x188458[_0x1f0da7(0x1d9)]['integrations']));const _0x1b4219=_0x188458['counts'][_0x1f0da7(0x1c4)][_0x1f0da7(0x227)]>0x0||_0x188458[_0x1f0da7(0x1d9)]['experimentalKnowledgeBases'][_0x1f0da7(0x21d)]>0x0||_0x188458['counts'][_0x1f0da7(0x1c4)][_0x1f0da7(0x232)]>0x0||_0x188458['counts'][_0x1f0da7(0x1e9)][_0x1f0da7(0x227)]>0x0||_0x188458[_0x1f0da7(0x1d9)][_0x1f0da7(0x1e9)][_0x1f0da7(0x21d)]>0x0||_0x188458['counts'][_0x1f0da7(0x1e9)][_0x1f0da7(0x232)]>0x0;_0x1b4219&&(console['log'](_0x1f0da7(0x1ae)+formatCountSummary(_0x188458[_0x1f0da7(0x1d9)][_0x1f0da7(0x1c4)])),console['log'](_0x1f0da7(0x21c)+formatCountSummary(_0x188458[_0x1f0da7(0x1d9)]['experimentalArtifacts'])));console[_0x1f0da7(0x1f0)](_0x1f0da7(0x1f5)+a4_0xcb3dcc[_0x1f0da7(0x20d)](_0x176f22)),displayDiffs(_0x188458[_0x1f0da7(0x233)],_0x188458[_0x1f0da7(0x1c5)],_0x188458[_0x1f0da7(0x201)],_0x188458['prompts'],_0x188458[_0x1f0da7(0x1e7)],_0x188458[_0x1f0da7(0x1c4)],_0x188458[_0x1f0da7(0x1e9)]);if(_0x4d57b1)return console[_0x1f0da7(0x1f0)](a4_0xcb3dcc[_0x1f0da7(0x236)](_0x1f0da7(0x1c6))),0x0;if(_0x33ece3===0x0&&_0x25a3b5===0x0){console[_0x1f0da7(0x1f0)](a4_0xcb3dcc['green'](_0x1f0da7(0x226)));const _0x16f04b=getLLMProjectUrl(_0x227ff2,_0x188458[_0x1f0da7(0x222)]);return console[_0x1f0da7(0x1f0)](_0x1f0da7(0x1c1)+a4_0xcb3dcc[_0x1f0da7(0x20d)](_0x16f04b)),0x0;}if(!_0x2bb35c&&!_0x3c3b1a){if(!isInteractive())return console[_0x1f0da7(0x187)](a4_0xcb3dcc[_0x1f0da7(0x1ba)](_0x1f0da7(0x1ac)),_0x1f0da7(0x192)),console[_0x1f0da7(0x187)](a4_0xcb3dcc['dim'](_0x1f0da7(0x19a))),0x1;const _0x250aa0=await confirmKey(_0x1f0da7(0x1b2)+(_0x33ece3+_0x25a3b5)+'\x20resources?');if(!_0x250aa0)return console[_0x1f0da7(0x1f0)](a4_0xcb3dcc[_0x1f0da7(0x236)](_0x1f0da7(0x195)),'-\x20nothing\x20pushed'),0x1;}const {data:_0x5607f8}=await withSpinner('Pushing\x20to\x20project...',()=>_0x2998a7['llm'][_0x1f0da7(0x1a9)](_0x176f22,{'force':_0x3c3b1a})),_0x17fb4e=_0x5607f8['counts']['agents']['errors']>0x0||_0x5607f8[_0x1f0da7(0x1d9)][_0x1f0da7(0x1c5)][_0x1f0da7(0x22c)]>0x0||_0x5607f8[_0x1f0da7(0x1d9)]['textKnowledgeBases'][_0x1f0da7(0x22c)]>0x0||_0x5607f8[_0x1f0da7(0x1d9)][_0x1f0da7(0x190)][_0x1f0da7(0x22c)]>0x0;if(_0x17fb4e){console[_0x1f0da7(0x1f0)](a4_0xcb3dcc[_0x1f0da7(0x236)](_0x1f0da7(0x19b))),console['log'](),console['log'](a4_0xcb3dcc[_0x1f0da7(0x1ba)](_0x1f0da7(0x1c2)));for(const _0x4bc547 of _0x5607f8[_0x1f0da7(0x233)]){_0x4bc547[_0x1f0da7(0x1e6)]===_0x1f0da7(0x187)&&console['log'](a4_0xcb3dcc[_0x1f0da7(0x1ba)](_0x1f0da7(0x229)+_0x4bc547[_0x1f0da7(0x20e)]+'\x22:\x20'+_0x4bc547['error']));}for(const _0x1617f0 of _0x5607f8[_0x1f0da7(0x1c5)]){_0x1617f0[_0x1f0da7(0x1e6)]==='error'&&console[_0x1f0da7(0x1f0)](a4_0xcb3dcc[_0x1f0da7(0x1ba)](_0x1f0da7(0x1df)+_0x1617f0['name']+'\x22:\x20'+_0x1617f0[_0x1f0da7(0x187)]));}for(const _0x3bf86e of _0x5607f8[_0x1f0da7(0x201)]){_0x3bf86e[_0x1f0da7(0x1e6)]===_0x1f0da7(0x187)&&console[_0x1f0da7(0x1f0)](a4_0xcb3dcc[_0x1f0da7(0x1ba)](_0x1f0da7(0x237)+_0x3bf86e[_0x1f0da7(0x1a1)]+_0x1f0da7(0x234)+_0x3bf86e[_0x1f0da7(0x187)]));}for(const _0x1f0d2b of _0x5607f8[_0x1f0da7(0x190)]){_0x1f0d2b['action']==='error'&&console[_0x1f0da7(0x1f0)](a4_0xcb3dcc[_0x1f0da7(0x1ba)](_0x1f0da7(0x1d0)+_0x1f0d2b[_0x1f0da7(0x1a1)]+_0x1f0da7(0x234)+_0x1f0d2b[_0x1f0da7(0x187)]));}for(const _0x3f96b8 of _0x5607f8[_0x1f0da7(0x1e7)]){_0x3f96b8['action']===_0x1f0da7(0x187)&&console['log'](a4_0xcb3dcc[_0x1f0da7(0x1ba)](_0x1f0da7(0x1fa)+_0x3f96b8[_0x1f0da7(0x1a1)]+_0x1f0da7(0x234)+_0x3f96b8[_0x1f0da7(0x187)]));}return 0x1;}console['log'](a4_0xcb3dcc['green'](_0x1f0da7(0x221)+(_0x33ece3+_0x25a3b5)+_0x1f0da7(0x1eb)+_0x5607f8[_0x1f0da7(0x1da)]+'\x27'));const _0x1dd703=getLLMProjectUrl(_0x227ff2,_0x5607f8[_0x1f0da7(0x222)]);return console[_0x1f0da7(0x1f0)](_0x1f0da7(0x1c1)+a4_0xcb3dcc['cyan'](_0x1dd703)),0x0;}}
@@ -1 +1 @@
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
+ const a5_0x4e1639=a5_0x407e;(function(_0x1852e6,_0x51554f){const _0xf2f2c5=a5_0x407e,_0x460f8c=_0x1852e6();while(!![]){try{const _0x13bd9c=parseInt(_0xf2f2c5(0xe6))/0x1+-parseInt(_0xf2f2c5(0xcc))/0x2*(parseInt(_0xf2f2c5(0x85))/0x3)+-parseInt(_0xf2f2c5(0x8c))/0x4+parseInt(_0xf2f2c5(0xdd))/0x5+parseInt(_0xf2f2c5(0xa4))/0x6*(-parseInt(_0xf2f2c5(0x6f))/0x7)+-parseInt(_0xf2f2c5(0xa6))/0x8+parseInt(_0xf2f2c5(0xf2))/0x9*(parseInt(_0xf2f2c5(0x98))/0xa);if(_0x13bd9c===_0x51554f)break;else _0x460f8c['push'](_0x460f8c['shift']());}catch(_0x83220e){_0x460f8c['push'](_0x460f8c['shift']());}}}(a5_0x2c0c,0x62fbd));function a5_0x2c0c(){const _0x53b89d=['✓\x20PASS:\x20','agentName','no_tests','stop','Evaluating\x20response...','isSpinning','Running\x20agent\x20tests...','Cached\x20run\x20is\x20from\x20site\x20\x22','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','size','FAIL','no_local_folder','...','Executing\x20new\x20tests...','forEach','Running\x20test:\x20','now','✗\x20ERROR:\x20','jsonl','red','No\x20tests\x20have\x20tags\x20defined.','log','Run\x20\x27tdx\x20agent\x20pull\x20','round','testName','\x20\x20tdx\x20agent\x20test\x20<path>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20from\x20path','Error\x20writing\x20output\x20file:\x20','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','no_context','Duration:\x20','90028ruEoYi','map','\x20-\x20','projectName','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','Re-evaluating...','name','toISOString','Total:\x20\x20\x20\x20','agent','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','has','tags','PASS','split','tests','3540105BNqdIJ','basename','execute','conversation_url','Re-evaluating\x20cached\x20test\x20run...','Test\x20Configuration:','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','timestamp','635722QnYSCQ','Available\x20tags:\x20','push','site','dryRun','includes','repeat','llm','Either\x20switch\x20to\x20the\x20\x22','404','testYmlPath','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','1203480zlVkyp','substring','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','executeReeval','message','rounds','\x20\x20Agent:\x20','projectDir','Failed:\x20\x20\x20','\x20\x20Evaluating...\x20','dim','Errors:\x20\x20\x20','test.yml',':\x20Sending\x20user\x20input...','verbose','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','writeFileSync','1253kpzEWR','filter','yellow','No\x20tests\x20found\x20matching:\x20','toLowerCase','output','\x22:\x20','resolveAgentId','/<agent-name>','reason','json','Error:\x20No\x20previous\x20test\x20run\x20found.','...\x20','multiple_agents','status','green','Round\x20','No\x20tests\x20found\x20with\x20tags:\x20','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','Output\x20written\x20to:\x20','white','Usage:','33PLrhQt','find','\x20(new)','add','resolve','Site:\x20','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','1193560qMjKqK','llmProject','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','Using\x20agent:\x20','✗\x20FAIL:\x20','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','✗\x20ERROR:\x20Project\x20not\x20found:\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)','\x20(cached)','\x27\x20to\x20create\x20the\x20folder\x20structure.','agent:test','Passed:\x20\x20\x20','80ISfkgk','\x20\x20Round\x20','utf-8','ERROR','Re-evaluation\x20Summary','table','\x20\x20Conversation:\x20','text','cyan','length','start','not\x20found','20598GbNjaX','Agent:\x20','4800120RVmibu','tsv','Cached\x20run\x20from:\x20','trim','Test\x20','\x22,\x20but\x20current\x20site\x20is\x20\x22','Round\x201/','agentDirs'];a5_0x2c0c=function(){return _0x53b89d;};return a5_0x2c0c();}function a5_0x407e(_0x5ed5b8,_0x185201){_0x5ed5b8=_0x5ed5b8-0x6e;const _0x2c0c8a=a5_0x2c0c();let _0x407e32=_0x2c0c8a[_0x5ed5b8];return _0x407e32;}import*as a5_0x98918f from'node:fs';import*as a5_0x426331 from'node:path';import a5_0x4b905d 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{['name']=a5_0x4e1639(0x96);['description']='Run\x20tests\x20for\x20an\x20LLM\x20agent';async[a5_0x4e1639(0xdf)](_0x218d6f){const _0x304fa2=a5_0x4e1639,{options:_0x588bc8,args:_0x127207,tdx:_0x2ffeba}=_0x218d6f,_0x13e72f=_0x127207[0x0]||'.',_0x5449bb=_0x588bc8[_0x304fa2(0xea)],_0x3bc4e6=_0x588bc8,_0x491732=_0x3bc4e6['eval']===![],_0x547b4f=_0x3bc4e6['reeval'],_0x406397=_0x3bc4e6[_0x304fa2(0xd3)],_0x47e2b5=_0x3bc4e6[_0x304fa2(0xd9)],_0x42741d=_0x588bc8['site'],_0x16e2fb=_0x3bc4e6[_0x304fa2(0x74)];if(_0x547b4f&&_0x491732)return console[_0x304fa2(0xc3)](a5_0x4b905d[_0x304fa2(0xc1)](_0x304fa2(0x81))),0x1;let _0x7c2dfa=_0x304fa2(0x9d);if(_0x3bc4e6[_0x304fa2(0x79)])_0x7c2dfa='json';else{if(_0x3bc4e6[_0x304fa2(0xc0)])_0x7c2dfa='jsonl';else{if(_0x3bc4e6['tsv'])_0x7c2dfa=_0x304fa2(0xa7);else{if(_0x3bc4e6[_0x304fa2(0x9d)])_0x7c2dfa=_0x304fa2(0x9d);}}}const _0x8410cc=_0x3bc4e6['llmProject'];let _0x15ac14=_0x13e72f;const _0xb91e29=a5_0x98918f['existsSync'](_0x13e72f),_0x5de1ae=_0x13e72f==='.';if(!_0xb91e29||_0x5de1ae){const _0x3921f3=resolveProjectFromContext(_0x13e72f,_0x8410cc,{'requireFile':_0x304fa2(0xfe)});if(_0x3921f3['found'])_0x15ac14=_0x3921f3['projectDir'],_0x3921f3['source']==='context'&&console[_0x304fa2(0xc3)](a5_0x4b905d[_0x304fa2(0xfc)](_0x304fa2(0x8f)+_0x15ac14));else switch(_0x3921f3['reason']){case _0x304fa2(0xca):console[_0x304fa2(0xc3)](a5_0x4b905d[_0x304fa2(0x71)](_0x3921f3[_0x304fa2(0xf6)])),console['log'](),console[_0x304fa2(0xc3)](_0x304fa2(0x84)),console[_0x304fa2(0xc3)](_0x304fa2(0xc7)),console['log'](_0x304fa2(0x93)),console[_0x304fa2(0xc3)](),console[_0x304fa2(0xc3)](_0x304fa2(0x8b));return 0x1;case _0x304fa2(0xb9):console[_0x304fa2(0xc3)](a5_0x4b905d[_0x304fa2(0x71)](_0x3921f3[_0x304fa2(0xf6)])),console[_0x304fa2(0xc3)](),console[_0x304fa2(0xc3)](_0x304fa2(0xc4)+_0x3921f3[_0x304fa2(0x8d)]+_0x304fa2(0x95));return 0x1;case _0x304fa2(0x7c):{const _0x3560e6=a5_0x426331[_0x304fa2(0xde)](_0x3921f3[_0x304fa2(0xf9)]);console[_0x304fa2(0xc3)](a5_0x4b905d['yellow'](_0x304fa2(0xd0)+_0x3921f3[_0x304fa2(0x8d)]+'\x22:'));for(const _0x2f8a43 of _0x3921f3[_0x304fa2(0xad)]){console['log']('\x20\x20-\x20'+_0x2f8a43);}return console['log'](),console[_0x304fa2(0xc3)](_0x304fa2(0xb6)+_0x3560e6+_0x304fa2(0x77)),0x1;}case _0x304fa2(0xb0):console[_0x304fa2(0xc3)](a5_0x4b905d[_0x304fa2(0x71)]('No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22'+_0x3921f3['llmProject']+'\x22.')),console[_0x304fa2(0xc3)](a5_0x4b905d[_0x304fa2(0xfc)]('Project\x20path:\x20'+_0x3921f3[_0x304fa2(0xf9)])),console[_0x304fa2(0xc3)](),console[_0x304fa2(0xc3)](_0x304fa2(0xd7));return 0x1;}}const {definition:_0xd36abe,agentInfo:_0x1f43eb}=parseTestFile(_0x15ac14);let _0x126b3d=_0xd36abe[_0x304fa2(0xdc)];if(_0x406397){const _0xbd0263=_0x406397['split'](',')[_0x304fa2(0xcd)](_0x4d95ab=>_0x4d95ab['trim']());_0x126b3d=_0xd36abe[_0x304fa2(0xdc)]['filter'](_0x16e3eb=>_0xbd0263[_0x304fa2(0xeb)](_0x16e3eb[_0x304fa2(0xd3)]));if(_0x126b3d[_0x304fa2(0xa1)]===0x0)return console[_0x304fa2(0xc3)](a5_0x4b905d['yellow'](_0x304fa2(0x72)+_0x406397)),console['log'](a5_0x4b905d['dim']('Available\x20tests:\x20'+_0xd36abe[_0x304fa2(0xdc)][_0x304fa2(0xcd)](_0x5f3674=>_0x5f3674['name'])['join'](',\x20'))),0x1;}if(_0x47e2b5){const _0x2d8739=_0x47e2b5[_0x304fa2(0xdb)](',')['map'](_0xf0674=>_0xf0674[_0x304fa2(0xa9)]()[_0x304fa2(0x73)]());_0x126b3d=_0x126b3d[_0x304fa2(0x70)](_0x3e5930=>_0x3e5930[_0x304fa2(0xd9)]?.['some'](_0x4aac9f=>_0x2d8739[_0x304fa2(0xeb)](_0x4aac9f['toLowerCase']())));if(_0x126b3d['length']===0x0){console[_0x304fa2(0xc3)](a5_0x4b905d['yellow'](_0x304fa2(0x80)+_0x47e2b5));const _0x4ddca8=new Set();return _0xd36abe['tests'][_0x304fa2(0xbc)](_0x5d82e9=>_0x5d82e9[_0x304fa2(0xd9)]?.['forEach'](_0x3434f1=>_0x4ddca8[_0x304fa2(0x88)](_0x3434f1))),_0x4ddca8[_0x304fa2(0xb7)]>0x0?console[_0x304fa2(0xc3)](a5_0x4b905d[_0x304fa2(0xfc)](_0x304fa2(0xe7)+[..._0x4ddca8]['join'](',\x20'))):console[_0x304fa2(0xc3)](a5_0x4b905d[_0x304fa2(0xfc)](_0x304fa2(0xc2))),0x1;}}if(_0x547b4f)return this['executeReeval'](_0x218d6f,{'definition':{'tests':_0x126b3d},'agentInfo':_0x1f43eb,'outputFormat':_0x7c2dfa,'outputFile':_0x16e2fb,'testNames':_0x406397});if(_0x5449bb){console[_0x304fa2(0xc3)](a5_0x4b905d[_0x304fa2(0xa0)](_0x304fa2(0xe2))),console[_0x304fa2(0xc3)]('\x20\x20Site:\x20'+a5_0x4b905d[_0x304fa2(0x83)](_0x42741d)),console[_0x304fa2(0xc3)]('\x20\x20Project:\x20'+a5_0x4b905d['white'](_0x1f43eb[_0x304fa2(0xcf)])),console[_0x304fa2(0xc3)](_0x304fa2(0xf8)+a5_0x4b905d[_0x304fa2(0x83)](_0x1f43eb[_0x304fa2(0xaf)])),console[_0x304fa2(0xc3)](),console['log']('Tests\x20found:\x20'+a5_0x4b905d[_0x304fa2(0x83)](_0x126b3d[_0x304fa2(0xa1)]));for(let _0x96db5d=0x0;_0x96db5d<_0x126b3d['length'];_0x96db5d++){const _0x1e16cf=_0x126b3d[_0x96db5d],_0x3c9aa2=_0x1e16cf[_0x304fa2(0xf7)][_0x304fa2(0xa1)]===0x1?_0x304fa2(0xc5):'rounds',_0x439816=_0x1e16cf[_0x304fa2(0xd9)]?.[_0x304fa2(0xa1)]?'\x20['+_0x1e16cf[_0x304fa2(0xd9)]['join'](',\x20')+']':'';console[_0x304fa2(0xc3)]('\x20\x20'+(_0x96db5d+0x1)+'.\x20'+a5_0x4b905d[_0x304fa2(0x83)](_0x1e16cf[_0x304fa2(0xd3)])+'\x20('+_0x1e16cf['rounds'][_0x304fa2(0xa1)]+'\x20'+_0x3c9aa2+')'+a5_0x4b905d[_0x304fa2(0xfc)](_0x439816));}return 0x0;}let _0x2c1279,_0x16bc52;try{_0x2c1279=await _0x2ffeba[_0x304fa2(0xed)]['resolveProjectId'](_0x1f43eb[_0x304fa2(0xcf)]);}catch(_0x2558a3){const _0x2b9357=_0x2558a3 instanceof Error?_0x2558a3[_0x304fa2(0xf6)]:String(_0x2558a3);return _0x2b9357[_0x304fa2(0xeb)](_0x304fa2(0xef))||_0x2b9357[_0x304fa2(0x73)]()[_0x304fa2(0xeb)](_0x304fa2(0xa3))?console['log'](a5_0x4b905d[_0x304fa2(0xc1)](_0x304fa2(0x92)+_0x1f43eb[_0x304fa2(0xcf)])):console['log'](a5_0x4b905d[_0x304fa2(0xc1)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22'+_0x1f43eb[_0x304fa2(0xcf)]+_0x304fa2(0x75)+_0x2b9357)),0x1;}try{_0x16bc52=await _0x2ffeba[_0x304fa2(0xed)][_0x304fa2(0x76)](_0x1f43eb[_0x304fa2(0xaf)],_0x2c1279);}catch(_0x28880c){const _0x297591=_0x28880c instanceof Error?_0x28880c[_0x304fa2(0xf6)]:String(_0x28880c);return _0x297591[_0x304fa2(0xeb)](_0x304fa2(0xef))||_0x297591[_0x304fa2(0x73)]()[_0x304fa2(0xeb)]('not\x20found')?console[_0x304fa2(0xc3)](a5_0x4b905d[_0x304fa2(0xc1)](_0x304fa2(0x91)+_0x1f43eb['agentName'])):console[_0x304fa2(0xc3)](a5_0x4b905d[_0x304fa2(0xc1)](_0x304fa2(0xe4)+_0x1f43eb['agentName']+_0x304fa2(0x75)+_0x297591)),0x1;}let _0x25be47;if(!_0x491732)try{_0x25be47=await setupEvaluatorAgent(_0x2ffeba[_0x304fa2(0xed)],_0x588bc8[_0x304fa2(0x100)]);}catch(_0x4858cc){const _0x37382f=_0x4858cc instanceof Error?_0x4858cc[_0x304fa2(0xf6)]:String(_0x4858cc);return console[_0x304fa2(0xc3)](a5_0x4b905d['red']('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x37382f)),0x1;}console[_0x304fa2(0xc3)](a5_0x4b905d[_0x304fa2(0xa0)](_0x304fa2(0xb4))),console['log'](_0x304fa2(0x8a)+a5_0x4b905d[_0x304fa2(0x83)](_0x42741d)),console[_0x304fa2(0xc3)](_0x304fa2(0xa5)+a5_0x4b905d[_0x304fa2(0x83)](_0x1f43eb[_0x304fa2(0xcf)]+'/'+_0x1f43eb[_0x304fa2(0xaf)])),console[_0x304fa2(0xc3)]();const _0x888e72=[],_0x3033ae=[],_0x43f04e=Date['now']();for(let _0xdd72a3=0x0;_0xdd72a3<_0x126b3d[_0x304fa2(0xa1)];_0xdd72a3++){const _0xb4dba5=_0x126b3d[_0xdd72a3];_0x126b3d[_0x304fa2(0xa1)]>0x1?console[_0x304fa2(0xc3)](_0x304fa2(0xaa)+(_0xdd72a3+0x1)+'/'+_0x126b3d[_0x304fa2(0xa1)]+':\x20'+a5_0x4b905d[_0x304fa2(0x83)](_0xb4dba5[_0x304fa2(0xd3)])):console[_0x304fa2(0xc3)](_0x304fa2(0xbd)+a5_0x4b905d[_0x304fa2(0x83)](_0xb4dba5[_0x304fa2(0xd3)]));const _0x4c80e2=createCommandSpinner(_0x304fa2(0xac)+_0xb4dba5[_0x304fa2(0xf7)][_0x304fa2(0xa1)]+':\x20Sending\x20user\x20input...');_0x4c80e2[_0x304fa2(0xa2)]();try{const {result:_0x5d2ba8,conversation:_0x28562a}=await runTest(_0x2ffeba[_0x304fa2(0xed)],_0xb4dba5,{'agentId':_0x16bc52,'projectId':_0x2c1279,'site':_0x42741d,'noEval':_0x491732,'evaluatorId':_0x25be47,'onRoundStart':(_0x53bdcc,_0x2aab92)=>{const _0x6ec75c=_0x304fa2;_0x4c80e2[_0x6ec75c(0x9f)]='Round\x20'+(_0x53bdcc+0x1)+'/'+_0x2aab92+_0x6ec75c(0xff);},'onRoundComplete':(_0x580c9c,_0x2d2e65,_0x323061)=>{const _0x2b64a3=_0x304fa2,_0x4f3a62=formatElapsed(_0x2d2e65);_0x323061?console[_0x2b64a3(0xc3)](_0x2b64a3(0x99)+(_0x580c9c+0x1)+'/'+_0xb4dba5['rounds'][_0x2b64a3(0xa1)]+'...\x20'+a5_0x4b905d[_0x2b64a3(0x7e)]('✓')+'\x20('+_0x4f3a62+')'):console[_0x2b64a3(0xc3)](_0x2b64a3(0x99)+(_0x580c9c+0x1)+'/'+_0xb4dba5[_0x2b64a3(0xf7)][_0x2b64a3(0xa1)]+_0x2b64a3(0x7b)+a5_0x4b905d[_0x2b64a3(0xc1)]('✗'));},'onEvaluationStart':()=>{const _0x551b21=_0x304fa2;_0x4c80e2[_0x551b21(0x9f)]=_0x551b21(0xb2);},'onEvaluationComplete':_0x22d312=>{const _0x508030=_0x304fa2,_0xf3e8b8=formatElapsed(_0x22d312);console[_0x508030(0xc3)](_0x508030(0xfb)+a5_0x4b905d[_0x508030(0x7e)]('✓')+'\x20('+_0xf3e8b8+')');}});_0x4c80e2[_0x304fa2(0xb1)](),_0x888e72[_0x304fa2(0xe8)](_0x5d2ba8),_0x3033ae['push'](_0x28562a);if(_0x5d2ba8['status']===_0x304fa2(0xda))console[_0x304fa2(0xc3)](a5_0x4b905d[_0x304fa2(0x7e)](_0x304fa2(0xae)+_0x5d2ba8[_0x304fa2(0x78)]));else _0x5d2ba8['status']===_0x304fa2(0xb8)?console['log'](a5_0x4b905d[_0x304fa2(0xc1)](_0x304fa2(0x90)+_0x5d2ba8[_0x304fa2(0x78)])):console[_0x304fa2(0xc3)](a5_0x4b905d[_0x304fa2(0xc1)](_0x304fa2(0xbf)+_0x5d2ba8[_0x304fa2(0x78)]));_0x5d2ba8['conversation_url']&&console[_0x304fa2(0xc3)](a5_0x4b905d[_0x304fa2(0xfc)]('Conversation\x20URL:\x20'+_0x5d2ba8[_0x304fa2(0xe0)])),console[_0x304fa2(0xc3)]();}catch(_0x57079d){_0x4c80e2[_0x304fa2(0xb1)]();const _0xa26af5=_0x57079d instanceof Error?_0x57079d[_0x304fa2(0xf6)]:String(_0x57079d);console[_0x304fa2(0xc3)](a5_0x4b905d[_0x304fa2(0xc1)]('✗\x20ERROR:\x20'+_0xa26af5)),console[_0x304fa2(0xc3)](),_0x888e72[_0x304fa2(0xe8)]({'name':_0xb4dba5[_0x304fa2(0xd3)],'status':_0x304fa2(0x9b),'reason':_0xa26af5,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}const _0xdd75e=Date[_0x304fa2(0xbe)]()-_0x43f04e,_0x28da63=_0x888e72[_0x304fa2(0x70)](_0x5f2913=>_0x5f2913[_0x304fa2(0x7d)]===_0x304fa2(0xda))['length'],_0xd1050d=_0x888e72[_0x304fa2(0x70)](_0x2ba0fb=>_0x2ba0fb[_0x304fa2(0x7d)]===_0x304fa2(0xb8))[_0x304fa2(0xa1)],_0x262c23=_0x888e72[_0x304fa2(0x70)](_0x304613=>_0x304613[_0x304fa2(0x7d)]===_0x304fa2(0x9b))[_0x304fa2(0xa1)];console[_0x304fa2(0xc3)]('━'[_0x304fa2(0xec)](0x3c)),console[_0x304fa2(0xc3)]('Test\x20Summary'),console['log']('━'['repeat'](0x3c)),console['log'](_0x304fa2(0xd5)+_0x888e72[_0x304fa2(0xa1)]),console[_0x304fa2(0xc3)](_0x304fa2(0x97)+a5_0x4b905d[_0x304fa2(0x7e)](_0x28da63)),console['log'](_0x304fa2(0xfa)+a5_0x4b905d['red'](_0xd1050d));_0x262c23>0x0&&console[_0x304fa2(0xc3)]('Errors:\x20\x20\x20'+a5_0x4b905d['red'](_0x262c23));console[_0x304fa2(0xc3)](_0x304fa2(0xcb)+formatElapsed(_0xdd75e)),console[_0x304fa2(0xc3)]('━'['repeat'](0x3c));const _0x4d4c8f=_0x888e72[_0x304fa2(0x70)](_0x1818d5=>_0x1818d5[_0x304fa2(0x7d)]!==_0x304fa2(0xda));if(_0x4d4c8f[_0x304fa2(0xa1)]>0x0){console['log'](),console[_0x304fa2(0xc3)]('Failed\x20Tests:');for(const _0x5a2c9c of _0x4d4c8f){const _0x33497a=a5_0x4b905d[_0x304fa2(0xc1)]('✗'),_0x3ec1fe=_0x5a2c9c['reason'][_0x304fa2(0xa1)]>0x32?_0x5a2c9c[_0x304fa2(0x78)][_0x304fa2(0xf3)](0x0,0x32)+_0x304fa2(0xba):_0x5a2c9c[_0x304fa2(0x78)];console[_0x304fa2(0xc3)]('\x20\x20'+_0x33497a+'\x20'+_0x5a2c9c[_0x304fa2(0xd3)]+':\x20'+_0x3ec1fe);}}const _0x5d79c4={'summary':{'total':_0x888e72['length'],'passed':_0x28da63,'failed':_0xd1050d,'errors':_0x262c23>0x0?_0x262c23:undefined,'duration_ms':_0xdd75e},'tests':_0x888e72,'agent':{'project':_0x1f43eb['projectName'],'name':_0x1f43eb['agentName'],'site':_0x42741d},'timestamp':new Date(_0x43f04e)[_0x304fa2(0xd4)]()};try{const _0x38dee6=buildCachedTestRun(_0x3033ae,{'site':_0x42741d,'projectId':_0x2c1279,'projectName':_0x1f43eb[_0x304fa2(0xcf)],'agentId':_0x16bc52,'agentName':_0x1f43eb[_0x304fa2(0xaf)],'testYmlPath':a5_0x426331[_0x304fa2(0x89)](_0x1f43eb[_0x304fa2(0xf0)])});saveLastTestRun(_0x38dee6);}catch{}if(_0x7c2dfa!=='table'||_0x16e2fb){const _0x3d89a3=formatResults(_0x5d79c4,_0x7c2dfa);if(_0x16e2fb)try{a5_0x98918f[_0x304fa2(0x6e)](_0x16e2fb,_0x3d89a3,_0x304fa2(0x9a)),console['log'](),console[_0x304fa2(0xc3)](a5_0x4b905d[_0x304fa2(0xfc)](_0x304fa2(0x82)+_0x16e2fb));}catch(_0x1f28b6){return console[_0x304fa2(0xc3)](),console[_0x304fa2(0xc3)](a5_0x4b905d['red']('Error\x20writing\x20output\x20file:\x20'+_0x1f28b6)),0x1;}else console[_0x304fa2(0xc3)](),console['log'](_0x3d89a3);}return _0x4d4c8f['length']>0x0?0x1:0x0;}async[a5_0x4e1639(0xf5)](_0x170cb0,_0x291b7e){const _0x9c7a72=a5_0x4e1639,{options:_0x2b5d49,tdx:_0x2ae47f}=_0x170cb0,{definition:_0x2325ae,agentInfo:_0x988345,outputFormat:_0x132311,outputFile:_0x1c032f}=_0x291b7e,_0x3bfa93=_0x2b5d49[_0x9c7a72(0xe9)],_0x3e13e0=loadLastTestRun();if(!_0x3e13e0)return console[_0x9c7a72(0xc3)](a5_0x4b905d['red'](_0x9c7a72(0x7a))),console[_0x9c7a72(0xc3)](a5_0x4b905d[_0x9c7a72(0xfc)](_0x9c7a72(0x8e))),0x1;if(_0x3e13e0[_0x9c7a72(0xd6)]['agentName']!==_0x988345[_0x9c7a72(0xaf)])return console[_0x9c7a72(0xc3)](a5_0x4b905d[_0x9c7a72(0xc1)]('Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22'+_0x3e13e0[_0x9c7a72(0xd6)]['agentName']+_0x9c7a72(0xf4)+_0x988345[_0x9c7a72(0xaf)]+'\x22.')),console['log'](a5_0x4b905d[_0x9c7a72(0xfc)](_0x9c7a72(0xc9))),0x1;const _0x3bbd89=new Set(_0x3e13e0['conversations'][_0x9c7a72(0xcd)](_0x4600bc=>_0x4600bc[_0x9c7a72(0xc6)])),_0x2bfbc4=_0x2325ae[_0x9c7a72(0xdc)][_0x9c7a72(0x70)](_0x13bf5c=>!_0x3bbd89[_0x9c7a72(0xd8)](_0x13bf5c[_0x9c7a72(0xd3)]));if(_0x2bfbc4[_0x9c7a72(0xa1)]>0x0&&_0x3e13e0['site']!==_0x3bfa93)return console['log'](a5_0x4b905d[_0x9c7a72(0xc1)](_0x9c7a72(0xe3))),console[_0x9c7a72(0xc3)](a5_0x4b905d[_0x9c7a72(0xfc)](_0x9c7a72(0xb5)+_0x3e13e0[_0x9c7a72(0xe9)]+_0x9c7a72(0xab)+_0x3bfa93+'\x22.')),console[_0x9c7a72(0xc3)](a5_0x4b905d[_0x9c7a72(0xfc)](_0x9c7a72(0xee)+_0x3e13e0[_0x9c7a72(0xe9)]+_0x9c7a72(0xd1))),0x1;const _0x2b2291=_0x2325ae[_0x9c7a72(0xdc)][_0x9c7a72(0x70)](_0x4d5e62=>_0x3bbd89[_0x9c7a72(0xd8)](_0x4d5e62[_0x9c7a72(0xd3)])),_0x3fb64f=_0x2bfbc4;let _0x2490f2;try{_0x2490f2=await setupEvaluatorAgent(_0x2ae47f[_0x9c7a72(0xed)],_0x2b5d49[_0x9c7a72(0x100)]);}catch(_0x15b674){const _0x1c1804=_0x15b674 instanceof Error?_0x15b674['message']:String(_0x15b674);return console[_0x9c7a72(0xc3)](a5_0x4b905d[_0x9c7a72(0xc1)](_0x9c7a72(0xf1)+_0x1c1804)),0x1;}console[_0x9c7a72(0xc3)](a5_0x4b905d[_0x9c7a72(0xa0)](_0x9c7a72(0xe1))),console[_0x9c7a72(0xc3)](_0x9c7a72(0xa8)+a5_0x4b905d['white'](_0x3e13e0[_0x9c7a72(0xe5)])),console[_0x9c7a72(0xc3)](_0x9c7a72(0xa5)+a5_0x4b905d[_0x9c7a72(0x83)](_0x3e13e0['agent']['projectName']+'/'+_0x3e13e0[_0x9c7a72(0xd6)][_0x9c7a72(0xaf)]));_0x3fb64f[_0x9c7a72(0xa1)]>0x0&&console[_0x9c7a72(0xc3)]('New\x20tests\x20to\x20execute:\x20'+a5_0x4b905d[_0x9c7a72(0x71)](_0x3fb64f[_0x9c7a72(0xa1)]));console[_0x9c7a72(0xc3)]();const _0x40d8f8=[],_0x2dc1e1=Date['now'](),_0x39aaf1=createCommandSpinner(_0x9c7a72(0xd2));if(_0x2b2291[_0x9c7a72(0xa1)]>0x0)try{const _0x110d05=await reevaluateFromCache(_0x2ae47f['llm'],_0x3e13e0,{'tests':_0x2b2291},{'evaluatorId':_0x2490f2,'onTestStart':(_0xe50ae7,_0x29b50e,_0x3eca47)=>{const _0x2c8855=_0x9c7a72;_0x39aaf1[_0x2c8855(0x9f)]='Re-evaluating\x20'+(_0x29b50e+0x1)+'/'+_0x3eca47+':\x20'+_0xe50ae7+_0x2c8855(0xba);if(!_0x39aaf1[_0x2c8855(0xb3)])_0x39aaf1[_0x2c8855(0xa2)]();},'onTestComplete':(_0x4f5b7a,_0x4a1ab9)=>{const _0x2140db=_0x9c7a72;_0x39aaf1[_0x2140db(0xb1)]();if(_0x4a1ab9['status']===_0x2140db(0xda))console[_0x2140db(0xc3)](a5_0x4b905d['green'](_0x2140db(0xae)+_0x4f5b7a)+a5_0x4b905d[_0x2140db(0xfc)](_0x2140db(0x94)));else _0x4a1ab9[_0x2140db(0x7d)]===_0x2140db(0xb8)?console[_0x2140db(0xc3)](a5_0x4b905d[_0x2140db(0xc1)](_0x2140db(0x90)+_0x4f5b7a+_0x2140db(0xce)+_0x4a1ab9[_0x2140db(0x78)])+a5_0x4b905d['dim']('\x20(cached)')):console[_0x2140db(0xc3)](a5_0x4b905d[_0x2140db(0xc1)](_0x2140db(0xbf)+_0x4f5b7a+_0x2140db(0xce)+_0x4a1ab9['reason']));_0x4a1ab9[_0x2140db(0xe0)]&&console['log'](a5_0x4b905d[_0x2140db(0xfc)](_0x2140db(0x9e)+_0x4a1ab9['conversation_url'])),_0x40d8f8[_0x2140db(0xe8)](_0x4a1ab9);},'onTestSkipped':(_0x4d6892,_0x21927a)=>{const _0x5dbb1d=_0x9c7a72;_0x39aaf1['stop'](),console[_0x5dbb1d(0xc3)](a5_0x4b905d[_0x5dbb1d(0x71)]('⚠\x20SKIPPED:\x20'+_0x4d6892+'\x20-\x20'+_0x21927a));}});for(const _0x3beffe of _0x110d05){!_0x40d8f8[_0x9c7a72(0x86)](_0x58b4d0=>_0x58b4d0['name']===_0x3beffe[_0x9c7a72(0xd3)])&&_0x40d8f8['push'](_0x3beffe);}}catch(_0xaa9984){_0x39aaf1[_0x9c7a72(0xb1)]();const _0x4e7425=_0xaa9984 instanceof Error?_0xaa9984['message']:String(_0xaa9984);return console[_0x9c7a72(0xc3)](a5_0x4b905d[_0x9c7a72(0xc1)](_0x9c7a72(0x101)+_0x4e7425)),0x1;}_0x39aaf1[_0x9c7a72(0xb1)]();if(_0x3fb64f[_0x9c7a72(0xa1)]>0x0){console['log'](),console[_0x9c7a72(0xc3)](a5_0x4b905d['cyan'](_0x9c7a72(0xbb)));const {projectId:_0xb0b6b9,agentId:_0x5794e9}=_0x3e13e0[_0x9c7a72(0xd6)];for(const _0x4b7c43 of _0x3fb64f){console[_0x9c7a72(0xc3)]('Running:\x20'+a5_0x4b905d[_0x9c7a72(0x83)](_0x4b7c43[_0x9c7a72(0xd3)]));const _0x53a057=createCommandSpinner('Round\x201/'+_0x4b7c43[_0x9c7a72(0xf7)][_0x9c7a72(0xa1)]+_0x9c7a72(0xff));_0x53a057[_0x9c7a72(0xa2)]();try{const {result:_0x358d44}=await runTest(_0x2ae47f[_0x9c7a72(0xed)],_0x4b7c43,{'agentId':_0x5794e9,'projectId':_0xb0b6b9,'site':_0x3e13e0[_0x9c7a72(0xe9)],'noEval':![],'evaluatorId':_0x2490f2,'onRoundStart':(_0x1df3b7,_0x47aeb0)=>{const _0x4ce6b6=_0x9c7a72;_0x53a057[_0x4ce6b6(0x9f)]=_0x4ce6b6(0x7f)+(_0x1df3b7+0x1)+'/'+_0x47aeb0+_0x4ce6b6(0xff);},'onRoundComplete':(_0x5dd6f1,_0x692a19,_0xbd14d2)=>{const _0x85121a=_0x9c7a72,_0x320f6f=formatElapsed(_0x692a19);_0xbd14d2?console[_0x85121a(0xc3)](_0x85121a(0x99)+(_0x5dd6f1+0x1)+'/'+_0x4b7c43[_0x85121a(0xf7)][_0x85121a(0xa1)]+_0x85121a(0x7b)+a5_0x4b905d[_0x85121a(0x7e)]('✓')+'\x20('+_0x320f6f+')'):console[_0x85121a(0xc3)](_0x85121a(0x99)+(_0x5dd6f1+0x1)+'/'+_0x4b7c43[_0x85121a(0xf7)][_0x85121a(0xa1)]+_0x85121a(0x7b)+a5_0x4b905d[_0x85121a(0xc1)]('✗'));},'onEvaluationStart':()=>{const _0x1291e8=_0x9c7a72;_0x53a057[_0x1291e8(0x9f)]='Evaluating\x20response...';},'onEvaluationComplete':_0x30a1f3=>{const _0x291d79=_0x9c7a72,_0x44f771=formatElapsed(_0x30a1f3);console['log'](_0x291d79(0xfb)+a5_0x4b905d[_0x291d79(0x7e)]('✓')+'\x20('+_0x44f771+')');}});_0x53a057[_0x9c7a72(0xb1)](),_0x40d8f8[_0x9c7a72(0xe8)](_0x358d44);if(_0x358d44[_0x9c7a72(0x7d)]===_0x9c7a72(0xda))console['log'](a5_0x4b905d[_0x9c7a72(0x7e)](_0x9c7a72(0xae)+_0x358d44[_0x9c7a72(0x78)])+a5_0x4b905d[_0x9c7a72(0xfc)](_0x9c7a72(0x87)));else _0x358d44['status']===_0x9c7a72(0xb8)?console[_0x9c7a72(0xc3)](a5_0x4b905d['red'](_0x9c7a72(0x90)+_0x358d44[_0x9c7a72(0x78)])+a5_0x4b905d['dim'](_0x9c7a72(0x87))):console[_0x9c7a72(0xc3)](a5_0x4b905d[_0x9c7a72(0xc1)]('✗\x20ERROR:\x20'+_0x358d44[_0x9c7a72(0x78)]));_0x358d44[_0x9c7a72(0xe0)]&&console[_0x9c7a72(0xc3)](a5_0x4b905d[_0x9c7a72(0xfc)](_0x9c7a72(0x9e)+_0x358d44['conversation_url']));}catch(_0xed26bd){_0x53a057['stop']();const _0x1b61bb=_0xed26bd instanceof Error?_0xed26bd[_0x9c7a72(0xf6)]:String(_0xed26bd);console['log'](a5_0x4b905d[_0x9c7a72(0xc1)](_0x9c7a72(0xbf)+_0x1b61bb)),_0x40d8f8[_0x9c7a72(0xe8)]({'name':_0x4b7c43[_0x9c7a72(0xd3)],'status':_0x9c7a72(0x9b),'reason':_0x1b61bb,'timestamp':new Date()[_0x9c7a72(0xd4)](),'duration_ms':0x0});}}}console[_0x9c7a72(0xc3)]();const _0x32b7e4=Date[_0x9c7a72(0xbe)]()-_0x2dc1e1,_0x162627=_0x40d8f8['filter'](_0x4a1e38=>_0x4a1e38[_0x9c7a72(0x7d)]==='PASS')[_0x9c7a72(0xa1)],_0x268290=_0x40d8f8['filter'](_0xc48990=>_0xc48990[_0x9c7a72(0x7d)]===_0x9c7a72(0xb8))[_0x9c7a72(0xa1)],_0x55a82c=_0x40d8f8[_0x9c7a72(0x70)](_0x446411=>_0x446411[_0x9c7a72(0x7d)]===_0x9c7a72(0x9b))['length'];console['log']('━'[_0x9c7a72(0xec)](0x3c)),console['log'](_0x9c7a72(0x9c)),console[_0x9c7a72(0xc3)]('━'[_0x9c7a72(0xec)](0x3c)),console[_0x9c7a72(0xc3)](_0x9c7a72(0xd5)+_0x40d8f8[_0x9c7a72(0xa1)]),console['log'](_0x9c7a72(0x97)+a5_0x4b905d['green'](_0x162627)),console[_0x9c7a72(0xc3)](_0x9c7a72(0xfa)+a5_0x4b905d[_0x9c7a72(0xc1)](_0x268290));_0x55a82c>0x0&&console['log'](_0x9c7a72(0xfd)+a5_0x4b905d[_0x9c7a72(0xc1)](_0x55a82c));console[_0x9c7a72(0xc3)](_0x9c7a72(0xcb)+formatElapsed(_0x32b7e4)),console[_0x9c7a72(0xc3)]('━'[_0x9c7a72(0xec)](0x3c));const _0x5d2e03={'summary':{'total':_0x40d8f8[_0x9c7a72(0xa1)],'passed':_0x162627,'failed':_0x268290,'errors':_0x55a82c>0x0?_0x55a82c:undefined,'duration_ms':_0x32b7e4},'tests':_0x40d8f8,'agent':{'project':_0x988345[_0x9c7a72(0xcf)],'name':_0x988345[_0x9c7a72(0xaf)],'site':_0x3bfa93},'timestamp':new Date(_0x2dc1e1)[_0x9c7a72(0xd4)]()};if(_0x132311!==_0x9c7a72(0x9d)||_0x1c032f){const _0x36a5d5=formatResults(_0x5d2e03,_0x132311);if(_0x1c032f)try{a5_0x98918f[_0x9c7a72(0x6e)](_0x1c032f,_0x36a5d5,_0x9c7a72(0x9a)),console[_0x9c7a72(0xc3)](),console[_0x9c7a72(0xc3)](a5_0x4b905d['dim'](_0x9c7a72(0x82)+_0x1c032f));}catch(_0x574664){return console[_0x9c7a72(0xc3)](),console[_0x9c7a72(0xc3)](a5_0x4b905d['red'](_0x9c7a72(0xc8)+_0x574664)),0x1;}else console[_0x9c7a72(0xc3)](),console[_0x9c7a72(0xc3)](_0x36a5d5);}const _0x56ed72=_0x40d8f8['filter'](_0x25ebac=>_0x25ebac['status']!==_0x9c7a72(0xda));return _0x56ed72[_0x9c7a72(0xa1)]>0x0?0x1:0x0;}}
@@ -1 +1 @@
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
+ function a6_0x5774(){const _0x526299=['1989fLxErC','data','execute','100NZiSzE','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','join','body','error','3827964zdIQtq','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','172982UTjfyH','x-xsrf-token','entries','Endpoint\x20must\x20start\x20with\x20/:\x20','Invalid\x20API\x20type:\x20','description','output','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','GET','method','354535cZQAVu','status','.\x20Valid\x20types:\x20','PATCH','verbose','POST','request','Invalid\x20header\x20format:\x20\x22','site','llm','set-cookie','Error:\x20','header','\x22.\x20','headers','cdp','set-cookie2','keys','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','trim','proxy-authorization','Invalid\x20HTTP\x20method:\x20','message','indexOf','color','Results\x20saved\x20to\x20','type','api','substring','authorization','isArray','DELETE','stack','toUpperCase','includes','noColor','1660TTHfPh','24912syotWB','90054uTpttv','workflow','\x0aStack\x20trace:\x0a','startsWith','3706386plBHWR','x-auth-token'];a6_0x5774=function(){return _0x526299;};return a6_0x5774();}function a6_0x24fd(_0x221181,_0x57cffb){_0x221181=_0x221181-0x1b5;const _0x57740e=a6_0x5774();let _0x24fd83=_0x57740e[_0x221181];return _0x24fd83;}const a6_0x48be7d=a6_0x24fd;(function(_0x3fe4fc,_0x51aa1d){const _0x3a1bf5=a6_0x24fd,_0xf18443=_0x3fe4fc();while(!![]){try{const _0x41cf1f=-parseInt(_0x3a1bf5(0x1cc))/0x1+-parseInt(_0x3a1bf5(0x1c2))/0x2+parseInt(_0x3a1bf5(0x1f2))/0x3+parseInt(_0x3a1bf5(0x1f0))/0x4*(-parseInt(_0x3a1bf5(0x1bb))/0x5)+parseInt(_0x3a1bf5(0x1b6))/0x6+-parseInt(_0x3a1bf5(0x1c0))/0x7+-parseInt(_0x3a1bf5(0x1f1))/0x8*(-parseInt(_0x3a1bf5(0x1b8))/0x9);if(_0x41cf1f===_0x51aa1d)break;else _0xf18443['push'](_0xf18443['shift']());}catch(_0x248330){_0xf18443['push'](_0xf18443['shift']());}}}(a6_0x5774,0x52f35));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_0x48be7d(0x1e9),a6_0x48be7d(0x1e0),'cookie',a6_0x48be7d(0x1d6),a6_0x48be7d(0x1dc),a6_0x48be7d(0x1c3),a6_0x48be7d(0x1b7),'x-trino-user']);function isSensitiveHeader(_0x198c5b){return SENSITIVE_HEADERS['has'](_0x198c5b['toLowerCase']());}function parseHeader(_0x18e422){const _0x425761=a6_0x48be7d,_0x5cd624=_0x18e422[_0x425761(0x1e3)](':');if(_0x5cd624===-0x1)throw new Error(_0x425761(0x1d3)+_0x18e422+_0x425761(0x1d9)+_0x425761(0x1de));const _0x2b417b=_0x18e422['substring'](0x0,_0x5cd624)[_0x425761(0x1df)](),_0x39cbba=_0x18e422[_0x425761(0x1e8)](_0x5cd624+0x1)['trim']();if(!_0x2b417b)throw new Error('Header\x20key\x20cannot\x20be\x20empty:\x20\x22'+_0x18e422+'\x22');return[_0x2b417b,_0x39cbba];}export class ApiCommand extends BaseCommand{['name']=a6_0x48be7d(0x1e7);[a6_0x48be7d(0x1c7)]=a6_0x48be7d(0x1bc);['validate'](_0x5b7ef4){const _0x660a0f=a6_0x48be7d,{args:_0x59db06,options:_0x447551}=_0x5b7ef4,_0x337447=_0x447551;if(_0x59db06['length']===0x0)return _0x660a0f(0x1c1);const _0x1040d6=_0x59db06[0x0];if(!_0x1040d6[_0x660a0f(0x1b5)]('/'))return _0x660a0f(0x1c5)+_0x1040d6;const _0x2333ce=_0x337447[_0x660a0f(0x1b9)],_0x234936=_0x337447['file'];if(_0x2333ce&&_0x234936)return _0x660a0f(0x1c9);const _0x5b313c=_0x337447[_0x660a0f(0x1cb)]||'GET',_0x2ce91b=[_0x660a0f(0x1ca),_0x660a0f(0x1d1),'PUT',_0x660a0f(0x1eb),_0x660a0f(0x1cf)];if(!_0x2ce91b[_0x660a0f(0x1ee)](_0x5b313c[_0x660a0f(0x1ed)]()))return _0x660a0f(0x1e1)+_0x5b313c+'.\x20Valid\x20methods:\x20'+_0x2ce91b[_0x660a0f(0x1bd)](',\x20');const _0x2443a2=_0x337447['type']||'td',_0x5dc9c3=['td',_0x660a0f(0x1db),_0x660a0f(0x1f3),'trino',_0x660a0f(0x1d5),'llm-proxy'];if(!_0x5dc9c3['includes'](_0x2443a2))return _0x660a0f(0x1c6)+_0x2443a2+_0x660a0f(0x1ce)+_0x5dc9c3[_0x660a0f(0x1bd)](',\x20');return undefined;}async[a6_0x48be7d(0x1ba)](_0x28f1db){const _0x5bc0e1=a6_0x48be7d,{options:_0xc1527,args:_0x19b369,tdx:_0x2f945e}=_0x28f1db,_0x35b9b0=_0xc1527,_0x3878f6=_0x19b369[0x0],_0x3bb8e6=(_0x35b9b0[_0x5bc0e1(0x1cb)]||_0x5bc0e1(0x1ca))[_0x5bc0e1(0x1ed)](),_0x5376ba=_0x35b9b0[_0x5bc0e1(0x1b9)],_0x471784=_0x35b9b0['file'],_0x35122d=_0x35b9b0[_0x5bc0e1(0x1d8)],_0x144baf=_0x35b9b0[_0x5bc0e1(0x1e6)]||'td';try{const _0x22463e={};if(_0x35122d){const _0x1db7a8=Array[_0x5bc0e1(0x1ea)](_0x35122d)?_0x35122d:[_0x35122d];for(const _0x3a42c3 of _0x1db7a8){const [_0x2aa344,_0x37bb48]=parseHeader(_0x3a42c3);_0x22463e[_0x2aa344]=_0x37bb48;}}let _0x48d62b;if(_0x5376ba)_0x48d62b=_0x5376ba;else{if(_0x471784)try{_0x48d62b=RawAPI['readBodyFromFile'](_0x471784);}catch(_0x9aec40){return console[_0x5bc0e1(0x1bf)](_0x5bc0e1(0x1d7)+(_0x9aec40 instanceof Error?_0x9aec40[_0x5bc0e1(0x1e2)]:String(_0x9aec40))),0x1;}}const _0x3d5622={'method':_0x3bb8e6,'apiType':_0x144baf,'includeHeaders':_0xc1527[_0x5bc0e1(0x1d0)]};_0x48d62b&&(_0x3d5622[_0x5bc0e1(0x1be)]=_0x48d62b);Object[_0x5bc0e1(0x1dd)](_0x22463e)['length']>0x0&&(_0x3d5622['headers']=_0x22463e);if(_0xc1527[_0x5bc0e1(0x1d0)]){const _0x456688=resolveSite(_0xc1527[_0x5bc0e1(0x1d4)]),_0x146375=getEndpoint(_0x456688,_0x144baf),_0x3bce23=''+_0x146375+_0x3878f6;console[_0x5bc0e1(0x1bf)]('>\x20'+_0x3bb8e6+'\x20'+_0x3bce23);const _0x484cbc=getAuthHeaders(_0x456688),_0x2d489d={..._0x484cbc,..._0x22463e};for(const [_0x2abb1a,_0x2af929]of Object[_0x5bc0e1(0x1c4)](_0x2d489d)){!isSensitiveHeader(_0x2abb1a)&&console[_0x5bc0e1(0x1bf)]('>\x20'+_0x2abb1a+':\x20'+_0x2af929);}_0x48d62b&&console[_0x5bc0e1(0x1bf)]('>'),console[_0x5bc0e1(0x1bf)]('');}const _0x259ebb=await _0x2f945e[_0x5bc0e1(0x1e7)][_0x5bc0e1(0x1d2)](_0x3878f6,_0x3d5622);if(_0xc1527[_0x5bc0e1(0x1d0)]&&_0x259ebb[_0x5bc0e1(0x1da)]){console['error']('<\x20HTTP/1.1\x20'+_0x259ebb[_0x5bc0e1(0x1cd)]);for(const [_0x13a6f8,_0x5c1031]of Object['entries'](_0x259ebb[_0x5bc0e1(0x1da)])){!isSensitiveHeader(_0x13a6f8)&&console[_0x5bc0e1(0x1bf)]('<\x20'+_0x13a6f8+':\x20'+_0x5c1031);}console['error']('');}const _0x527887=Boolean(_0xc1527[_0x5bc0e1(0x1c8)]),_0x1e6b5d={'color':_0xc1527['color'],'noColor':_0xc1527[_0x5bc0e1(0x1ef)]||_0x527887&&!_0xc1527[_0x5bc0e1(0x1e4)]},_0x47fb9d=colorizeJSON(_0x259ebb[_0x5bc0e1(0x1b9)],_0x1e6b5d);return _0xc1527[_0x5bc0e1(0x1c8)]?(writeFileSync(_0xc1527['output'],_0x47fb9d),console['error'](_0x5bc0e1(0x1e5)+_0xc1527[_0x5bc0e1(0x1c8)])):console['log'](_0x47fb9d),0x0;}catch(_0x2e890f){return _0x2e890f instanceof Error?(console['error'](_0x5bc0e1(0x1d7)+_0x2e890f[_0x5bc0e1(0x1e2)]),_0xc1527[_0x5bc0e1(0x1d0)]&&_0x2e890f[_0x5bc0e1(0x1ec)]&&console[_0x5bc0e1(0x1bf)](_0x5bc0e1(0x1f4)+_0x2e890f[_0x5bc0e1(0x1ec)])):console[_0x5bc0e1(0x1bf)](_0x5bc0e1(0x1d7)+String(_0x2e890f)),0x1;}}}
@@ -1 +1 @@
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
+ const a7_0x5394f6=a7_0x7c40;(function(_0x54f013,_0x238e62){const _0x54b2d7=a7_0x7c40,_0xaa8d4c=_0x54f013();while(!![]){try{const _0x1bba33=-parseInt(_0x54b2d7(0x85))/0x1*(parseInt(_0x54b2d7(0xa3))/0x2)+parseInt(_0x54b2d7(0x88))/0x3*(-parseInt(_0x54b2d7(0xa8))/0x4)+parseInt(_0x54b2d7(0xa4))/0x5+parseInt(_0x54b2d7(0x76))/0x6+parseInt(_0x54b2d7(0xa0))/0x7*(-parseInt(_0x54b2d7(0x87))/0x8)+-parseInt(_0x54b2d7(0x97))/0x9+parseInt(_0x54b2d7(0x7b))/0xa;if(_0x1bba33===_0x238e62)break;else _0xaa8d4c['push'](_0xaa8d4c['shift']());}catch(_0x227ad9){_0xaa8d4c['push'](_0xaa8d4c['shift']());}}}(a7_0x19b2,0x86032));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';function a7_0x19b2(){const _0x212ecf=['1925268eJCJnt','apiKey','name','log','\x20(site:\x20','jobs','User:\x20','Setting\x20up\x20authentication\x20for\x20site:\x20','trim','yellow','No\x20API\x20key\x20found\x20in\x20keychain','auth:setup','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','site','bold','tdx:\x20auth\x20clear','✗\x20Validation\x20failed:\x20','warn','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','getUserInfo','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','3274488SwEnJn','description','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','No\x20credential\x20found','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','9894120rdqjNZ','API\x20key\x20cannot\x20be\x20empty','\x27\x20registered','\x20(profile:\x20','customSite','Name:\x20','N/A','tdx\x20profile:\x20','ERROR','text','4WBrbUW','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','14176QVgQtx','3uatfgb','auth:clear','green','email','red','\x0aSetup\x20cancelled','us01','join','filter','System\x20keychain\x20is\x20not\x20available','create','Enter\x20site\x20name:','Validating\x20API\x20key...','Site\x20name\x20cannot\x20be\x20empty','\x20--profile\x20','2138634ELGvFH','✓\x20Authentication\x20successful\x0a','other','last_name','first_name','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','\x20\x20tdx','Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20','execute','2079DOpbXG','status','error','299432QmNEaS','4289225qdTRde','You\x20can\x20find\x20your\x20API\x20key\x20at:','select','test'];a7_0x19b2=function(){return _0x212ecf;};return a7_0x19b2();}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_0x5ed195 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_0x2d272a from'chalk';export class AuthSetupCommand extends BaseCommand{[a7_0x5394f6(0xaa)]=a7_0x5394f6(0xb3);['description']='Setup\x20API\x20key\x20authentication\x20interactively';async[a7_0x5394f6(0x9f)](_0x58a378){const _0x228d94=a7_0x5394f6,{options:_0x46e4af}=_0x58a378,_0x1a24e5=_0x46e4af['profile'];console[_0x228d94(0xab)](a7_0x2d272a[_0x228d94(0xb6)]('tdx:\x20auth\x20setup'));const _0x20301b=_0x46e4af[_0x228d94(0xb5)]||_0x228d94(0x8e),{choices:_0x5e239b,initialIndex:_0x80d527}=buildSiteChoices(_0x20301b),_0x5d018f=_0x1a24e5?_0x228d94(0x9e)+_0x1a24e5+'):':'Select\x20your\x20Treasure\x20Data\x20site:',_0x16efc9=await a7_0x5ed195({'type':_0x228d94(0xa6),'name':_0x228d94(0xb5),'message':_0x5d018f,'choices':_0x5e239b,'initial':_0x80d527});if(!_0x16efc9[_0x228d94(0xb5)])return console['log'](_0x228d94(0x8d)),0x1;let _0x26c983;if(_0x16efc9[_0x228d94(0xb5)]===_0x228d94(0x99)){const _0x49607f=await a7_0x5ed195({'type':_0x228d94(0x84),'name':_0x228d94(0x7f),'message':_0x228d94(0x93),'initial':_0x228d94(0x8e),'validate':_0x4f8e12=>{const _0x2c945c=_0x228d94;if(!_0x4f8e12||!_0x4f8e12[_0x2c945c(0xb0)]())return _0x2c945c(0x95);if(!/^[a-z0-9-]+$/[_0x2c945c(0xa7)](_0x4f8e12[_0x2c945c(0xb0)]()))return _0x2c945c(0x75);return!![];}});if(!_0x49607f['customSite'])return console[_0x228d94(0xab)](_0x228d94(0x8d)),0x1;_0x26c983=_0x49607f[_0x228d94(0x7f)];}else _0x26c983=_0x16efc9['site'];const _0x28e654=resolveSite(_0x26c983);console['log'](_0x228d94(0xaf)+_0x28e654),console[_0x228d94(0xab)](_0x228d94(0xa5)),console[_0x228d94(0xab)]('\x20\x20'+getConsoleUrl(_0x28e654,'/app/mp/ak'));const _0x4feefb=await a7_0x5ed195({'type':'password','name':'apiKey','message':'Enter\x20your\x20TD\x20API\x20key:','validate':_0x3642d4=>{const _0x433ee8=_0x228d94;if(!_0x3642d4||!_0x3642d4[_0x433ee8(0xb0)]())return _0x433ee8(0x7c);return!![];}});if(!_0x4feefb[_0x228d94(0xa9)])return console['log'](_0x228d94(0x8d)),0x1;const _0x5441e4=_0x4feefb[_0x228d94(0xa9)];console[_0x228d94(0xab)](_0x228d94(0x94));try{const _0xcf578b=TDX[_0x228d94(0x92)]({'site':_0x28e654,'apiKey':_0x5441e4[_0x228d94(0xb0)](),'logLevel':_0x46e4af['logLevel']??LogLevel[_0x228d94(0x83)]}),_0x326bce=await _0xcf578b[_0x228d94(0xad)][_0x228d94(0x74)]();console[_0x228d94(0xab)]('✓\x20API\x20key\x20is\x20valid\x20(User:\x20'+_0x326bce[_0x228d94(0x8b)]+')');const _0x2b1d80=await isKeychainAvailable();_0x2b1d80?(await saveAPIKeyAsync(_0x5441e4['trim'](),_0x28e654,_0x1a24e5),console[_0x228d94(0xab)](_0x228d94(0xb4)+(_0x1a24e5?_0x228d94(0x7e)+_0x1a24e5+')':''))):(console[_0x228d94(0x72)](a7_0x2d272a[_0x228d94(0xb1)](_0x228d94(0x78))),console[_0x228d94(0x72)](a7_0x2d272a[_0x228d94(0xb1)](_0x228d94(0x7a))));if(_0x1a24e5){const _0x4e1aa4={'site':_0x28e654};saveProfileToUserConfig(_0x1a24e5,_0x4e1aa4),console['log']('✓\x20Profile\x20\x27'+_0x1a24e5+_0x228d94(0x7d));}else saveDefaultSiteToUserConfig(_0x28e654),console['log']('✓\x20Default\x20site\x20set\x20to\x20'+_0x28e654);const _0xb4ea7b=_0x1a24e5?_0x228d94(0x96)+_0x1a24e5:'';return console[_0x228d94(0xab)](),console['log'](_0x228d94(0x86)),console['log']('\x20\x20tdx'+_0xb4ea7b+_0x228d94(0x9c)),console[_0x228d94(0xab)](_0x228d94(0x9d)+_0xb4ea7b+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases'),0x0;}catch(_0x1f308e){if(_0x1f308e instanceof HTTPClientError&&_0x1f308e[_0x228d94(0xa1)]===0x191)return printAuthError(_0x1f308e),0x1;return console[_0x228d94(0xa2)](a7_0x2d272a['red'](_0x228d94(0x71)+(_0x1f308e instanceof Error?_0x1f308e['message']:String(_0x1f308e)))),console[_0x228d94(0xa2)]('API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.'),0x1;}}}function a7_0x7c40(_0x2c3595,_0x5d4527){_0x2c3595=_0x2c3595-0x71;const _0x19b24d=a7_0x19b2();let _0x7c400f=_0x19b24d[_0x2c3595];return _0x7c400f;}export class AuthStatusCommand extends BaseCommand{[a7_0x5394f6(0xaa)]='auth';[a7_0x5394f6(0x77)]=a7_0x5394f6(0x73);async[a7_0x5394f6(0x9f)](_0x54b794){const _0x226b6c=a7_0x5394f6,{options:_0x2a73a3,tdx:_0x232feb}=_0x54b794,_0x385e69=_0x2a73a3[_0x226b6c(0xb5)],_0x439fa1=_0x2a73a3['profile'],_0x131b65=_0x439fa1?_0x439fa1:_0x226b6c(0x81);console['log'](_0x226b6c(0x82)+_0x131b65+_0x226b6c(0xac)+_0x385e69+')');const _0x1485cb=await resolveAPIKeyAsync(_0x385e69,_0x439fa1);if(_0x1485cb){const {source:_0x5de7b8,isDeprecated:_0x39ccb9}=_0x1485cb,_0x5eee8d='Read\x20credential\x20from\x20'+_0x5de7b8;console[_0x226b6c(0xab)](_0x39ccb9?a7_0x2d272a['yellow'](_0x5eee8d):_0x5eee8d);}else console[_0x226b6c(0xab)](a7_0x2d272a['yellow'](_0x226b6c(0x79)));try{const _0x3578c1=await _0x232feb[_0x226b6c(0xad)]['getUserInfo']();return console['log'](a7_0x2d272a[_0x226b6c(0x8a)](_0x226b6c(0x98))),console[_0x226b6c(0xab)](_0x226b6c(0xae)+_0x3578c1[_0x226b6c(0x8b)]),(_0x3578c1[_0x226b6c(0x9b)]||_0x3578c1[_0x226b6c(0x9a)])&&console[_0x226b6c(0xab)](_0x226b6c(0x80)+[_0x3578c1[_0x226b6c(0x9b)],_0x3578c1[_0x226b6c(0x9a)]][_0x226b6c(0x90)](Boolean)[_0x226b6c(0x8f)]('\x20')),0x0;}catch(_0x687343){return _0x687343 instanceof HTTPClientError&&_0x687343[_0x226b6c(0xa1)]===0x191?printAuthError(_0x687343,!![],_0x439fa1):console[_0x226b6c(0xa2)](a7_0x2d272a[_0x226b6c(0x8c)]('✗\x20Validation\x20failed:\x20'+(_0x687343 instanceof Error?_0x687343['message']:String(_0x687343)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x5394f6(0xaa)]=a7_0x5394f6(0x89);[a7_0x5394f6(0x77)]='Remove\x20API\x20key\x20from\x20system\x20keychain';async[a7_0x5394f6(0x9f)](_0x5b84c0){const _0x38f48b=a7_0x5394f6,{options:_0x3d440d}=_0x5b84c0,_0x13129d=_0x3d440d['profile'];console['log'](a7_0x2d272a[_0x38f48b(0xb6)](_0x38f48b(0xb7)));const _0x5b8386=await isKeychainAvailable();if(!_0x5b8386)return console['error'](a7_0x2d272a[_0x38f48b(0x8c)](_0x38f48b(0x91))),0x1;const _0xcd3447=await deleteKeychainAPIKey(_0x13129d);return _0xcd3447?(clearCredentialCache(),console[_0x38f48b(0xab)]('✓\x20API\x20key\x20removed\x20from\x20keychain'+(_0x13129d?_0x38f48b(0x7e)+_0x13129d+')':'')),0x0):(console['log'](_0x38f48b(0xb2)+(_0x13129d?'\x20for\x20profile:\x20'+_0x13129d:'')),0x1);}}
@@ -1 +1 @@
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;}}}
1
+ const a8_0x16d471=a8_0x5377;(function(_0x395e9f,_0xc575e4){const _0x571937=a8_0x5377,_0x51724b=_0x395e9f();while(!![]){try{const _0x3d2a2f=-parseInt(_0x571937(0x21e))/0x1+parseInt(_0x571937(0x214))/0x2+parseInt(_0x571937(0x222))/0x3+-parseInt(_0x571937(0x211))/0x4*(-parseInt(_0x571937(0x1f5))/0x5)+-parseInt(_0x571937(0x213))/0x6+parseInt(_0x571937(0x1e8))/0x7+-parseInt(_0x571937(0x1e9))/0x8*(parseInt(_0x571937(0x1e7))/0x9);if(_0x3d2a2f===_0xc575e4)break;else _0x51724b['push'](_0x51724b['shift']());}catch(_0x26502f){_0x51724b['push'](_0x51724b['shift']());}}}(a8_0x5105,0x40fb9));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/errors.js';function a8_0x5377(_0x34bb83,_0x48c918){_0x34bb83=_0x34bb83-0x1e1;const _0x51056f=a8_0x5105();let _0x5377bc=_0x51056f[_0x34bb83];return _0x5377bc;}import{withSpinner}from'../utils/spinner.js';import{parseAgentRef}from'../sdk/agent/agent-ref-parser.js';function a8_0x5105(){const _0x20774c=['new','name','description','\x20\x20Cause:\x20','content','code','message','Create\x20a\x20new\x20chat\x20session','llmAgent','Getting\x20default\x20agent...','options','Resolving\x20project\x20\x27','agentId','No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22','handleChatEvent','tool','streamChatJsonl','error','execute','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','cause','Continuing\x20chat:\x20','chatId','args','functionName','\x0aError:\x20','249296kQXWut','llm','1842846yVTeAD','843060YVCQVZ','join','stringify','log','stdout','llmProject','tool_result','tool_call','streamChat','event','124189OgXrof','targetFunction','getDefaultAgent','stack','356385oTwKxj','getOrCreateDefaultAgent','metadata','write','agent','type','verbose','data','chat-create','targetWebSearchTool','Using\x20agent\x20from\x20','validate','CHAT_NOT_FOUND','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','18jfKtLl','2289966RYkDlg','2175632MWsVCz','Chat\x20session:\x20','session\x20context','context','Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22','includes','--agent\x20flag','Error:\x20Chat\x20session\x20\x27','resolveProjectId','chat','string','projectId','30lKJaYF','\x27...'];a8_0x5105=function(){return _0x20774c;};return a8_0x5105();}import{saveLastChatId,loadLastChatId}from'../sdk/llm/chat-cache.js';import{getLLMConversationUrl}from'../sdk/client/endpoints.js';function handleSDKError(_0x3f554a,_0x3f6ed8){const _0x583467=a8_0x5377;if(_0x3f554a instanceof SDKError)console[_0x583467(0x208)]('Error:\x20'+_0x3f554a[_0x583467(0x1fd)]),_0x3f6ed8[_0x583467(0x228)]&&(_0x3f554a[_0x583467(0x20b)]&&console[_0x583467(0x208)](_0x583467(0x1fa)+_0x3f554a['cause']),_0x3f554a[_0x583467(0x221)]&&(console[_0x583467(0x208)]('\x0aStack\x20trace:'),console[_0x583467(0x208)](_0x3f554a['stack'])));else throw _0x3f554a;}async function resolveAgentId(_0x8fdd9b,_0x288544,_0x492b73,_0x14b562,_0x5d015c){const _0x48c3c6=a8_0x5377,_0x3416aa=_0x288544||_0x492b73;if(_0x3416aa){const {projectName:_0x1b59ab,agentName:_0x55a5ed}=parseAgentRef(_0x3416aa),_0x4f8751=_0x55a5ed||_0x3416aa,_0x611e28=_0x55a5ed?_0x1b59ab:_0x14b562;if(!_0x611e28)throw new Error(_0x48c3c6(0x204));if(_0x5d015c){const _0x7f053=_0x288544?_0x48c3c6(0x1ef):_0x48c3c6(0x1eb);console[_0x48c3c6(0x208)](_0x48c3c6(0x1e3)+_0x7f053+':\x20'+_0x611e28+'/'+_0x4f8751);}const _0x48dff9=await withSpinner(_0x48c3c6(0x202)+_0x611e28+_0x48c3c6(0x1f6),()=>_0x8fdd9b[_0x48c3c6(0x212)][_0x48c3c6(0x1f1)](_0x611e28),{'verbose':_0x5d015c}),_0x463b2c=await withSpinner('Resolving\x20agent\x20\x27'+_0x4f8751+'\x27...',()=>_0x8fdd9b[_0x48c3c6(0x212)]['resolveAgentId'](_0x4f8751,_0x48dff9[_0x48c3c6(0x229)]),{'verbose':_0x5d015c});return _0x463b2c['data'];}else{const _0x4f53be=_0x8fdd9b[_0x48c3c6(0x212)][_0x48c3c6(0x220)]();if(_0x4f53be)return _0x5d015c&&console['error']('Using\x20cached\x20default\x20agent:\x20'+_0x4f53be['name']),_0x4f53be['id'];const _0x10db00=await withSpinner(_0x48c3c6(0x200),()=>_0x8fdd9b[_0x48c3c6(0x212)][_0x48c3c6(0x223)]('claude-4.5-haiku',0x0),{'verbose':_0x5d015c});return _0x10db00[_0x48c3c6(0x229)]['id'];}}export class ChatCommand extends BaseCommand{[a8_0x16d471(0x1f8)]=a8_0x16d471(0x1f2);[a8_0x16d471(0x1f9)]=a8_0x16d471(0x1e6);[a8_0x16d471(0x1e4)](_0x1850ba){const _0x11e1b2=a8_0x16d471,_0x1ab9f0=_0x1850ba[_0x11e1b2(0x20e)]['join']('\x20');if(!_0x1ab9f0)return'Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options';return undefined;}async[a8_0x16d471(0x21c)](_0x50b4a7,_0x5cdc9a,_0x121cb1,_0x5e0c50,_0x5d19bb){const _0x457a1a=a8_0x16d471;for await(const _0x3db3b7 of _0x50b4a7[_0x457a1a(0x212)][_0x457a1a(0x1f2)](_0x5cdc9a,{'agentId':_0x121cb1,'chatId':_0x5e0c50})){if(_0x3db3b7['type']===_0x457a1a(0x224)){const _0x5e8343=_0x3db3b7['data']['chatId'];saveLastChatId(_0x5e8343),_0x5d19bb&&console[_0x457a1a(0x208)](_0x457a1a(0x1ea)+_0x5e8343);}else _0x3db3b7[_0x457a1a(0x227)]===_0x457a1a(0x21d)&&this[_0x457a1a(0x205)](_0x3db3b7[_0x457a1a(0x229)]);}}async[a8_0x16d471(0x207)](_0x5af078,_0x31d434,_0xb51106,_0xfa2ef7){const _0x50098a=a8_0x16d471,_0x334643=_0x5af078[_0x50098a(0x1ec)]['site'];let _0xcf3cea=![];for await(const _0x4a3f10 of _0x5af078['llm'][_0x50098a(0x1f2)](_0x31d434,{'agentId':_0xb51106,'chatId':_0xfa2ef7})){if(_0x4a3f10['type']===_0x50098a(0x224)){const _0x4a3ad9=_0x4a3f10[_0x50098a(0x229)];saveLastChatId(_0x4a3ad9['chatId']);const _0x30a3a3=_0x4a3ad9[_0x50098a(0x1f4)]&&_0x4a3ad9[_0x50098a(0x203)]?getLLMConversationUrl(_0x334643,_0x4a3ad9[_0x50098a(0x1f4)],_0x4a3ad9[_0x50098a(0x203)],_0x4a3ad9[_0x50098a(0x20d)]):undefined;console[_0x50098a(0x217)](JSON[_0x50098a(0x216)]({'type':'metadata','data':{'chatId':_0x4a3ad9['chatId'],'agentId':_0x4a3ad9['agentId'],'consoleUrl':_0x30a3a3}})),_0xcf3cea=!![];}else{if(_0x4a3f10[_0x50098a(0x227)]===_0x50098a(0x21d)){!_0xcf3cea&&_0xfa2ef7&&(console[_0x50098a(0x217)](JSON[_0x50098a(0x216)]({'type':_0x50098a(0x224),'data':{'chatId':_0xfa2ef7}})),_0xcf3cea=!![]);const _0x5e23ca=_0x4a3f10[_0x50098a(0x229)];if('content'in _0x5e23ca)console[_0x50098a(0x217)](JSON[_0x50098a(0x216)]({'type':'content','data':{'content':_0x5e23ca[_0x50098a(0x1fb)]}}));else{if(_0x50098a(0x21b)in _0x5e23ca){const _0xe0c905=_0x5e23ca[_0x50098a(0x21b)];console[_0x50098a(0x217)](JSON[_0x50098a(0x216)]({'type':_0x50098a(0x21b),'data':{'id':_0xe0c905['id'],'name':_0xe0c905[_0x50098a(0x20f)],'target':_0xe0c905['targetKnowledgeBase']?.[_0x50098a(0x1f8)]||_0xe0c905['targetAgent']?.[_0x50098a(0x1f8)]||_0xe0c905[_0x50098a(0x1e2)]?.['name']||_0xe0c905[_0x50098a(0x21f)]}}));}else{if(_0x50098a(0x206)in _0x5e23ca)console['log'](JSON[_0x50098a(0x216)]({'type':_0x50098a(0x21a),'data':{'id':_0x5e23ca[_0x50098a(0x206)]['id'],'name':_0x5e23ca[_0x50098a(0x206)][_0x50098a(0x20f)],'result':typeof _0x5e23ca['tool'][_0x50098a(0x1fb)]===_0x50098a(0x1f3)?_0x5e23ca[_0x50098a(0x206)][_0x50098a(0x1fb)]['slice'](0x0,0x1f4):''}}));else _0x50098a(0x208)in _0x5e23ca&&console[_0x50098a(0x217)](JSON['stringify']({'type':_0x50098a(0x208),'data':{'error':_0x5e23ca[_0x50098a(0x208)]}}));}}}}}console['log'](JSON[_0x50098a(0x216)]({'type':'done'}));}async['execute'](_0x2e1996){const _0x251432=a8_0x16d471,{options:_0x37fb31,args:_0x4b3231,tdx:_0x47113a}=_0x2e1996,_0x4bd800=_0x4b3231[_0x251432(0x215)]('\x20'),_0x23b51d=_0x37fb31,_0x28fb76=_0x23b51d[_0x251432(0x226)],_0x129d92=_0x23b51d[_0x251432(0x1ff)],_0x5e9ff6=_0x23b51d[_0x251432(0x219)],_0x4d511a=_0x23b51d[_0x251432(0x1f7)],_0x4f46a2=_0x23b51d[_0x251432(0x20d)],_0x2a3f62=_0x23b51d['stream'];if(_0x4d511a&&_0x4f46a2)return console['error']('Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together'),0x1;try{let _0x5551d0,_0x14c6a;if(_0x4f46a2)_0x14c6a=_0x4f46a2;else!_0x4d511a&&(_0x14c6a=loadLastChatId(),_0x14c6a&&_0x37fb31[_0x251432(0x228)]&&console['error'](_0x251432(0x20c)+_0x14c6a));!_0x4f46a2&&(_0x4d511a||!_0x14c6a)&&(_0x5551d0=await resolveAgentId(_0x47113a,_0x28fb76,_0x129d92,_0x5e9ff6,_0x37fb31[_0x251432(0x228)]));const _0x63c34=_0x2a3f62?(_0x16c48f,_0x2b57e1,_0x1c15ef)=>this[_0x251432(0x207)](_0x47113a,_0x16c48f,_0x2b57e1,_0x1c15ef):(_0x48d645,_0x529a8b,_0x3b8d0)=>this[_0x251432(0x21c)](_0x47113a,_0x48d645,_0x529a8b,_0x3b8d0,_0x37fb31['verbose']);try{await _0x63c34(_0x4bd800,_0x5551d0,_0x14c6a);}catch(_0x2bbf4e){const _0xdfdd88=_0x2bbf4e instanceof SDKError&&_0x2bbf4e[_0x251432(0x1fc)]===ErrorCode[_0x251432(0x1e5)]||_0x2bbf4e instanceof Error&&_0x2bbf4e[_0x251432(0x1fd)][_0x251432(0x1ee)]('404');if(_0xdfdd88&&_0x4f46a2)return console[_0x251432(0x208)](_0x251432(0x1f0)+_0x4f46a2+'\x27\x20not\x20found'),0x1;if(_0xdfdd88)_0x37fb31[_0x251432(0x228)]&&console['error'](_0x251432(0x20a)),!_0x5551d0&&(_0x5551d0=await resolveAgentId(_0x47113a,_0x28fb76,_0x129d92,_0x5e9ff6,_0x37fb31[_0x251432(0x228)])),await _0x63c34(_0x4bd800,_0x5551d0,undefined);else throw _0x2bbf4e;}return!_0x2a3f62&&console[_0x251432(0x217)](),0x0;}catch(_0x581008){return console['error'](),handleSDKError(_0x581008,_0x37fb31),0x1;}}[a8_0x16d471(0x205)](_0x44773b){const _0x587ab1=a8_0x16d471;if(_0x587ab1(0x1fb)in _0x44773b)process[_0x587ab1(0x218)][_0x587ab1(0x225)](_0x44773b[_0x587ab1(0x1fb)]);else _0x587ab1(0x208)in _0x44773b&&console[_0x587ab1(0x208)](_0x587ab1(0x210)+_0x44773b[_0x587ab1(0x208)]);}}export class ChatCreateCommand extends BaseCommand{[a8_0x16d471(0x1f8)]=a8_0x16d471(0x1e1);[a8_0x16d471(0x1f9)]=a8_0x16d471(0x1fe);[a8_0x16d471(0x1e4)](_0xd7c40b){const _0x321c64=a8_0x16d471,_0x2a3f9e=_0xd7c40b[_0x321c64(0x201)],_0x274cac=_0x2a3f9e[_0x321c64(0x226)],_0x33f514=_0x2a3f9e[_0x321c64(0x1ff)];if(!_0x274cac&&!_0x33f514)return _0x321c64(0x1ed);return undefined;}async[a8_0x16d471(0x209)](_0x297c63){const _0xf28474=a8_0x16d471,{options:_0x6352c9,tdx:_0x231819}=_0x297c63,_0xa858e4=_0x6352c9,_0x2859ca=_0xa858e4['agent'],_0x2985ef=_0xa858e4[_0xf28474(0x1ff)],_0x57a3e4=_0xa858e4['llmProject'];try{const _0x166594=await resolveAgentId(_0x231819,_0x2859ca,_0x2985ef,_0x57a3e4,_0x6352c9['verbose']),_0x2053e7=await _0x231819[_0xf28474(0x212)]['startChat'](_0x166594);return saveLastChatId(_0x2053e7['id']),console['log'](JSON[_0xf28474(0x216)]({'chatId':_0x2053e7['id'],'agentId':_0x166594})),0x0;}catch(_0x1e9ae4){return handleSDKError(_0x1e9ae4,_0x6352c9),0x1;}}}