@treasuredata/tdx 0.28.4 → 0.28.5

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 (179) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/chat-command.js +1 -1
  11. package/dist/commands/claude-command.js +1 -1
  12. package/dist/commands/claude-statusline-command.js +1 -1
  13. package/dist/commands/claude-usage-command.js +1 -1
  14. package/dist/commands/command.js +1 -1
  15. package/dist/commands/connection-command.js +1 -1
  16. package/dist/commands/databases.js +1 -1
  17. package/dist/commands/delivery-command.js +1 -1
  18. package/dist/commands/describe.js +1 -1
  19. package/dist/commands/engage-campaign-pull-command.js +1 -1
  20. package/dist/commands/engage-campaign-push-command.js +1 -1
  21. package/dist/commands/engage-campaign-validate-command.js +1 -1
  22. package/dist/commands/engage-command.js +1 -1
  23. package/dist/commands/job-command.js +1 -1
  24. package/dist/commands/journey-command.js +1 -1
  25. package/dist/commands/journey-validate-command.js +1 -1
  26. package/dist/commands/llm-command.js +1 -1
  27. package/dist/commands/mcp-command.js +1 -1
  28. package/dist/commands/parent-segment-command.js +1 -1
  29. package/dist/commands/profile-command.js +1 -1
  30. package/dist/commands/profiles-command.js +1 -1
  31. package/dist/commands/query-command.js +1 -1
  32. package/dist/commands/schedule-command.js +1 -1
  33. package/dist/commands/segment-command.js +1 -1
  34. package/dist/commands/segment-create-command.js +1 -1
  35. package/dist/commands/segment-fields-command.js +1 -1
  36. package/dist/commands/segment-pull-command.js +1 -1
  37. package/dist/commands/segment-push-command.js +1 -1
  38. package/dist/commands/segment-update-command.js +1 -1
  39. package/dist/commands/segment-use-command.js +1 -1
  40. package/dist/commands/segment-validate-command.js +1 -1
  41. package/dist/commands/segments.js +1 -1
  42. package/dist/commands/show.js +1 -1
  43. package/dist/commands/status-command.js +1 -1
  44. package/dist/commands/tables.js +1 -1
  45. package/dist/commands/unset-command.js +1 -1
  46. package/dist/commands/use-command.js +1 -1
  47. package/dist/commands/user-command.js +1 -1
  48. package/dist/commands/workflow-command.js +1 -1
  49. package/dist/core/auth.js +1 -1
  50. package/dist/core/command-output.js +1 -1
  51. package/dist/core/config.js +1 -1
  52. package/dist/core/connection-cache.js +1 -1
  53. package/dist/core/constants.js +1 -1
  54. package/dist/core/credential-cache.js +1 -1
  55. package/dist/core/global-context.js +1 -1
  56. package/dist/core/keychain.js +1 -1
  57. package/dist/core/profile.js +1 -1
  58. package/dist/core/project-config.js +1 -1
  59. package/dist/core/session.js +1 -1
  60. package/dist/core/user-cache.js +1 -1
  61. package/dist/core/version.js +1 -1
  62. package/dist/index.js +1 -1
  63. package/dist/mcp/server.js +1 -1
  64. package/dist/mcp/tools/index.js +1 -1
  65. package/dist/mcp/tools/tdx-run.js +1 -1
  66. package/dist/mcp/tools/tdx-search.js +1 -1
  67. package/dist/mcp/utils.js +1 -1
  68. package/dist/proxy/claude-usage-tracker.js +1 -1
  69. package/dist/proxy/passthrough-server.js +1 -1
  70. package/dist/proxy/sse-usage-parser.js +1 -1
  71. package/dist/sdk/agent/agent-config.js +1 -1
  72. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  73. package/dist/sdk/agent/agent-yaml.js +1 -1
  74. package/dist/sdk/agent/test/evaluator.js +1 -1
  75. package/dist/sdk/agent/test/executor.js +1 -1
  76. package/dist/sdk/agent/test/index.js +1 -1
  77. package/dist/sdk/agent/test/output.js +1 -1
  78. package/dist/sdk/agent/test/parser.js +1 -1
  79. package/dist/sdk/agent/tool-target-registry.js +1 -1
  80. package/dist/sdk/api.js +1 -1
  81. package/dist/sdk/client/cdp-api-client.js +1 -1
  82. package/dist/sdk/client/delivery-api-client.js +1 -1
  83. package/dist/sdk/client/endpoints.js +1 -1
  84. package/dist/sdk/client/engage-api-client.js +1 -1
  85. package/dist/sdk/client/http-client.js +1 -1
  86. package/dist/sdk/client/llm-api-client.js +1 -1
  87. package/dist/sdk/client/rate-limiter.js +1 -1
  88. package/dist/sdk/client/td-api-client.js +1 -1
  89. package/dist/sdk/client/trino-api-client.js +1 -1
  90. package/dist/sdk/client/workflow-client.js +1 -1
  91. package/dist/sdk/connection-validator.js +1 -1
  92. package/dist/sdk/connection.js +1 -1
  93. package/dist/sdk/delivery.js +1 -1
  94. package/dist/sdk/engage/campaign-pull.js +1 -1
  95. package/dist/sdk/engage/campaign-push.js +1 -1
  96. package/dist/sdk/engage/campaign-validator.js +1 -1
  97. package/dist/sdk/engage/campaign-yaml.js +1 -1
  98. package/dist/sdk/engage/types/campaign-def.js +1 -1
  99. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  100. package/dist/sdk/engage.js +1 -1
  101. package/dist/sdk/errors.js +1 -1
  102. package/dist/sdk/index.js +1 -1
  103. package/dist/sdk/io/index.js +1 -1
  104. package/dist/sdk/io/node-filesystem.js +1 -1
  105. package/dist/sdk/job.js +1 -1
  106. package/dist/sdk/journey.js +1 -1
  107. package/dist/sdk/llm/chat-cache.js +1 -1
  108. package/dist/sdk/llm/index.js +1 -1
  109. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  110. package/dist/sdk/llm/model-factors.js +1 -1
  111. package/dist/sdk/personalization.js +1 -1
  112. package/dist/sdk/query/index.js +1 -1
  113. package/dist/sdk/query/sql-parser.js +1 -1
  114. package/dist/sdk/realtime.js +1 -1
  115. package/dist/sdk/schedule.js +1 -1
  116. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  117. package/dist/sdk/segment/fields-display.js +1 -1
  118. package/dist/sdk/segment/file-discovery.js +1 -1
  119. package/dist/sdk/segment/journey-utils.js +1 -1
  120. package/dist/sdk/segment/journey-validator.js +1 -1
  121. package/dist/sdk/segment/journey-yaml.js +1 -1
  122. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  123. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  124. package/dist/sdk/segment/pull-workflow.js +1 -1
  125. package/dist/sdk/segment/push-recovery.js +1 -1
  126. package/dist/sdk/segment/push-workflow.js +1 -1
  127. package/dist/sdk/segment/resolution-context.js +1 -1
  128. package/dist/sdk/segment/segment-path-parser.js +1 -1
  129. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  130. package/dist/sdk/segment/target-resolution.js +1 -1
  131. package/dist/sdk/segment/tdx-config.js +1 -1
  132. package/dist/sdk/segment/validate-files.js +1 -1
  133. package/dist/sdk/segment/yaml-validator.js +1 -1
  134. package/dist/sdk/segment.js +1 -1
  135. package/dist/sdk/types/index.js +1 -1
  136. package/dist/sdk/types/progress.js +1 -1
  137. package/dist/sdk/user.js +1 -1
  138. package/dist/sdk/util/format-detector.js +1 -1
  139. package/dist/sdk/util/formatters.js +1 -1
  140. package/dist/sdk/util/index.js +1 -1
  141. package/dist/sdk/util/tree-formatter.js +1 -1
  142. package/dist/sdk/workflow/archive-validation.js +1 -1
  143. package/dist/sdk/workflow/clone-workflow.js +1 -1
  144. package/dist/sdk/workflow/index.js +1 -1
  145. package/dist/sdk/workflow/pull-workflow.js +1 -1
  146. package/dist/sdk/workflow/push-workflow.js +1 -1
  147. package/dist/sdk/workflow/tdx-config.js +1 -1
  148. package/dist/sdk/workflow/workflow-utils.js +1 -1
  149. package/dist/test-utils/command-runner.js +1 -1
  150. package/dist/test-utils/factories.js +1 -1
  151. package/dist/test-utils/fixtures.js +1 -1
  152. package/dist/test-utils/http-mock.js +1 -1
  153. package/dist/test-utils/index.js +1 -1
  154. package/dist/utils/async.js +1 -1
  155. package/dist/utils/colors.js +1 -1
  156. package/dist/utils/diff.js +1 -1
  157. package/dist/utils/file-permissions.js +1 -1
  158. package/dist/utils/global-cache.js +1 -1
  159. package/dist/utils/json-loader.js +1 -1
  160. package/dist/utils/local-cache.js +1 -1
  161. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  162. package/dist/utils/logger/formatters/index.js +1 -1
  163. package/dist/utils/logger/handlers/console-handler.js +1 -1
  164. package/dist/utils/logger/handlers/file-handler.js +1 -1
  165. package/dist/utils/logger/handlers/index.js +1 -1
  166. package/dist/utils/logger/handlers/null-handler.js +1 -1
  167. package/dist/utils/logger/index.js +1 -1
  168. package/dist/utils/logger/logger.js +1 -1
  169. package/dist/utils/logger/types.js +1 -1
  170. package/dist/utils/option-validation.js +1 -1
  171. package/dist/utils/process.js +1 -1
  172. package/dist/utils/prompt.js +1 -1
  173. package/dist/utils/spinner.js +1 -1
  174. package/dist/utils/sse-parser.js +1 -1
  175. package/dist/utils/string-utils.js +1 -1
  176. package/dist/utils/table-ref-parser.js +1 -1
  177. package/dist/utils/tdx-logger.js +1 -1
  178. package/dist/utils/version-check.js +1 -1
  179. package/package.json +1 -1
@@ -1 +1 @@
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
+ const a3_0xf0be3d=a3_0x54bc;(function(_0x56f690,_0x4923b1){const _0x19223c=a3_0x54bc,_0x300312=_0x56f690();while(!![]){try{const _0x12ce18=parseInt(_0x19223c(0x195))/0x1+parseInt(_0x19223c(0x1a4))/0x2+parseInt(_0x19223c(0x19e))/0x3+-parseInt(_0x19223c(0x197))/0x4+-parseInt(_0x19223c(0x19c))/0x5+-parseInt(_0x19223c(0x1af))/0x6+parseInt(_0x19223c(0x19b))/0x7*(parseInt(_0x19223c(0x194))/0x8);if(_0x12ce18===_0x4923b1)break;else _0x300312['push'](_0x300312['shift']());}catch(_0x399e4c){_0x300312['push'](_0x300312['shift']());}}}(a3_0x5b8f,0xee170));function a3_0x54bc(_0x4aa86a,_0x406eed){_0x4aa86a=_0x4aa86a-0x194;const _0x5b8f79=a3_0x5b8f();let _0x54bca6=_0x5b8f79[_0x4aa86a];return _0x54bca6;}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';function a3_0x5b8f(){const _0x5442cd=['150128agOGhZ','891761iURIIh','data','2050636Suyulv','resolveParentId','cause','resolveSegmentId','553UszfxD','8111275cfqgct','\x27...','1556739AHUvvE','execute','activations','listActivations','description','verbose','3040284fborOF','error','Child\x20name:\x20','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','site','segment','Listing\x20activations\x20for\x20segment\x20\x27','Resolving\x20child\x20segment\x20\x27','Error:\x20Segment\x20name\x20is\x20required','Error:\x20','\x20\x20Cause:\x20','7819200sdIXux','Resolved\x20child\x20ID:\x20','message','Resolving\x20parent\x20segment\x20\x27','List\x20activations\x20for\x20a\x20segment','length','Resolved\x20parent\x20ID:\x20'];a3_0x5b8f=function(){return _0x5442cd;};return a3_0x5b8f();}export class ActivationsCommand extends BaseCommand{['name']=a3_0xf0be3d(0x1a0);[a3_0xf0be3d(0x1a2)]=a3_0xf0be3d(0x1b3);async[a3_0xf0be3d(0x19f)](_0xb5353d){const _0x1956a2=a3_0xf0be3d,{options:_0x52e6e1,args:_0x3f0445,tdx:_0x577097}=_0xb5353d;if(_0x3f0445[_0x1956a2(0x1b4)]===0x0)return console[_0x1956a2(0x1a5)](_0x1956a2(0x1ac)),console['error'](_0x1956a2(0x1a7)),0x1;try{const {parentId:_0x1a0530,childId:_0x238ed3}=parseSegmentRef(_0x3f0445[0x0]);if(!_0x238ed3)return console[_0x1956a2(0x1a5)]('Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations'),console[_0x1956a2(0x1a5)](_0x1956a2(0x1a7)),0x1;_0x52e6e1[_0x1956a2(0x1a3)]&&(console[_0x1956a2(0x1a5)]('Site:\x20'+_0x52e6e1[_0x1956a2(0x1a8)]),console[_0x1956a2(0x1a5)]('Parent\x20name:\x20'+_0x1a0530),console[_0x1956a2(0x1a5)](_0x1956a2(0x1a6)+_0x238ed3));const _0x2dbd31=await withSpinner(_0x1956a2(0x1b2)+_0x1a0530+_0x1956a2(0x19d),()=>_0x577097['segment'][_0x1956a2(0x198)](_0x1a0530),{'verbose':_0x52e6e1['verbose']}),_0xc76334=_0x2dbd31['data'];_0x52e6e1[_0x1956a2(0x1a3)]&&console['error'](_0x1956a2(0x1b5)+_0xc76334);const _0x5112f4=await withSpinner(_0x1956a2(0x1ab)+_0x238ed3+_0x1956a2(0x19d),()=>_0x577097[_0x1956a2(0x1a9)][_0x1956a2(0x19a)](_0xc76334,_0x238ed3),{'verbose':_0x52e6e1[_0x1956a2(0x1a3)]}),_0x36405c=_0x5112f4[_0x1956a2(0x196)];_0x52e6e1['verbose']&&console[_0x1956a2(0x1a5)](_0x1956a2(0x1b0)+_0x36405c);const _0x13ae5b=await withSpinner(_0x1956a2(0x1aa)+_0x238ed3+_0x1956a2(0x19d),()=>_0x577097[_0x1956a2(0x1a9)][_0x1956a2(0x1a1)](_0xc76334,_0x36405c),{'verbose':_0x52e6e1[_0x1956a2(0x1a3)]}),_0x434752=_0x13ae5b[_0x1956a2(0x196)];return console[_0x1956a2(0x1a5)]('✔\x20Found\x20'+_0x434752[_0x1956a2(0x1b4)]+'\x20activation'+(_0x434752['length']!==0x1?'s':'')),await handleSDKOutput(_0x434752,_0x52e6e1),0x0;}catch(_0x2d5593){if(_0x2d5593 instanceof SDKError)return console['error'](_0x1956a2(0x1ad)+_0x2d5593[_0x1956a2(0x1b1)]),_0x2d5593['cause']&&console[_0x1956a2(0x1a5)](_0x1956a2(0x1ae)+_0x2d5593[_0x1956a2(0x199)]),0x1;throw _0x2d5593;}}}
@@ -1 +1 @@
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
+ const a4_0x42b121=a4_0x5a8f;(function(_0xa38978,_0x3fcd8e){const _0x223eca=a4_0x5a8f,_0x21edbd=_0xa38978();while(!![]){try{const _0x498f31=-parseInt(_0x223eca(0x1e0))/0x1+parseInt(_0x223eca(0x258))/0x2*(parseInt(_0x223eca(0x200))/0x3)+-parseInt(_0x223eca(0x23b))/0x4*(-parseInt(_0x223eca(0x211))/0x5)+-parseInt(_0x223eca(0x1fb))/0x6+parseInt(_0x223eca(0x20e))/0x7+parseInt(_0x223eca(0x240))/0x8+-parseInt(_0x223eca(0x233))/0x9;if(_0x498f31===_0x3fcd8e)break;else _0x21edbd['push'](_0x21edbd['shift']());}catch(_0xbae396){_0x21edbd['push'](_0x21edbd['shift']());}}}(a4_0x565a,0x43a42));import a4_0x14c24b from'chalk';import a4_0xf2d30d from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';function a4_0x565a(){const _0x5362f5=['knowledgeBases','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','\x20total','\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','total','\x0aWrite\x20','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','outputPath','updated','description','dryRun','\x20\x20Source:\x20','Project\x20cloned\x20with\x20errors','Agent\x20','Pulling\x20agent\x20\x22','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','green','\x0aErrors\x20found:','unchanged','Using\x20current\x20project:\x20','created','\x22:\x20','Using\x20local\x20project:\x20','3200760hQVjOg','\x0aPull\x20summary\x20for\x20\x27','execute','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','\x22\x20to\x20\x22','369351OPzDhL','\x20\x20Prompts:\x20','found','llmProject','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project','<new-name>','\x0aChanges:','\x22...','textKnowledgeBases','session','experimentalArtifacts','force','Chat:\x20','sourceProjectName','3678507MMOSzZ','\x20\x20Knowledge\x20Base\x20\x22','errors','4670IYbTzM','newProjectId','\x22\x20from\x20project\x20\x22','Would\x20pull\x20agent:\x20','Would\x20clone:','\x20changed','pullAgent','\x20|\x20','Usage:\x20tdx\x20agent\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20project\x20(requires\x20context\x20or\x20tdx.json)','\x20created','Project:\x20','repeat','llm','pushProject','action','\x20\x20tdx\x20agent\x20clone\x20agents/','Cannot\x20clone\x20from\x20context\x20project\x20\x22','No\x20tdx.json\x20found\x20in\x20','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','\x20\x20Integration\x20\x22','Dry\x20run\x20-\x20no\x20files\x20written','agent:pull','New\x20project\x20name\x20is\x20required','\x20--name\x20','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','Agent\x20pulled\x20successfully','agent:clone','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','red','projectDir','\x20=\x20','1647999yfgwZv','New\x20project:\x20','pullProject','Pushing\x20agent\x20from\x20\x22','\x0aError:','new','Dry\x20run\x20-\x20no\x20changes\x20made','\x0aPush\x20','116UOCQNK','✔\x20Context\x20set:\x20','\x20\x20Experimental\x20Artifact\x20\x22','context','\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','1139576FlGFUS','outputDir','Source:\x20','integrations','dim','\x20\x20Prompt\x20\x22','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','profile','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','message','\x0aPush\x20summary\x20for\x20\x27','\x20--profile\x20','\x0a✔\x20Pulled\x20','Project\x20cloned\x20successfully','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','diff','\x20\x20Integrations:\x20','reason','join','agent.yml','\x0aChanges\x20to\x20prompt\x20\x27','site','Errors:','Using\x20project:\x20','8ooqALI','llm_project','push','\x22\x20to\x20a\x20different\x20profile','Output\x20path:\x20','\x22\x20to\x20new\x20project\x20\x22','name','dirname','\x20errors','Cloning\x20\x22','error','Clone\x20\x22','cyan','yes','agentId','counts','newProjectName','cwd','Agent:\x20','yellow','\x20\x20Agent\x20\x22','\x20unchanged','Pushing\x20to\x20project...','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','\x20\x20tdx\x20agent\x20pull\x20','agent:push','pushAgent','projectId','parse','New\x20project\x20ID:\x20','gray','\x20\x20Knowledge\x20Bases:\x20','-\x20nothing\x20pushed','-\x20no\x20files\x20written','utf-8','tdx.json','agents','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','experimentalKnowledgeBases','prompts','\x20new','\x20successfully','Using\x20project\x20from\x20','no_local_folder','agentName','projectName','\x20\x20Experimental\x20Artifacts:\x20','\x20files?','arg-dir','INVALID_ARGUMENT','\x20\x20Agents:\x20','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','agent','Failed\x20to\x20push\x20agent:\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','cwd-config','\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','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','193873ngnJBg','output','no_context','log'];a4_0x565a=function(){return _0x5362f5;};return a4_0x565a();}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';function a4_0x5a8f(_0x417694,_0x7c4405){_0x417694=_0x417694-0x1bc;const _0x565ade=a4_0x565a();let _0x5a8f24=_0x565ade[_0x417694];return _0x5a8f24;}import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x185d46){const _0x4a1cf5=a4_0x5a8f,_0x566f77=[];if(_0x185d46['total']!==undefined)_0x566f77[_0x4a1cf5(0x25a)](_0x185d46['total']+_0x4a1cf5(0x1e6));if(_0x185d46[_0x4a1cf5(0x238)]!==undefined&&_0x185d46[_0x4a1cf5(0x238)]>0x0)_0x566f77[_0x4a1cf5(0x25a)](a4_0x14c24b[_0x4a1cf5(0x1f4)](_0x185d46[_0x4a1cf5(0x238)]+'\x20new'));if(_0x185d46['created']!==undefined&&_0x185d46[_0x4a1cf5(0x1f8)]>0x0)_0x566f77[_0x4a1cf5(0x25a)](a4_0x14c24b[_0x4a1cf5(0x1f4)](_0x185d46[_0x4a1cf5(0x1f8)]+_0x4a1cf5(0x21a)));if(_0x185d46['updated']!==undefined&&_0x185d46[_0x4a1cf5(0x1ec)]>0x0)_0x566f77[_0x4a1cf5(0x25a)](a4_0x14c24b[_0x4a1cf5(0x26b)](_0x185d46[_0x4a1cf5(0x1ec)]+'\x20updated'));if(_0x185d46[_0x4a1cf5(0x1f6)]!==undefined&&_0x185d46[_0x4a1cf5(0x1f6)]>0x0)_0x566f77[_0x4a1cf5(0x25a)](a4_0x14c24b[_0x4a1cf5(0x1c1)](_0x185d46['unchanged']+_0x4a1cf5(0x26d)));if(_0x185d46[_0x4a1cf5(0x210)]!==undefined&&_0x185d46[_0x4a1cf5(0x210)]>0x0)_0x566f77[_0x4a1cf5(0x25a)](a4_0x14c24b['red'](_0x185d46[_0x4a1cf5(0x210)]+_0x4a1cf5(0x260)));return _0x566f77[_0x4a1cf5(0x252)](',\x20');}function displayDiffs(_0x4e4579,_0x438803,_0x4b676e,_0x182d40,_0x222aa9,_0x595825,_0x3fd68d){const _0x5bfcec=a4_0x5a8f;for(const _0x5221b7 of _0x4e4579){if(_0x5221b7[_0x5bfcec(0x24f)]){const _0xdd1b8f=_0x5221b7[_0x5bfcec(0x1cf)]||_0x5221b7[_0x5bfcec(0x25e)];console[_0x5bfcec(0x1e3)]('\x0aChanges\x20to\x20agent\x20\x27'+_0xdd1b8f+'\x27:'),console['log']('─'['repeat'](0x3c)),console[_0x5bfcec(0x1e3)](_0x5221b7[_0x5bfcec(0x24f)]),console[_0x5bfcec(0x1e3)]('─'[_0x5bfcec(0x21c)](0x3c));}}for(const _0x5c8c41 of _0x438803){_0x5c8c41['diff']&&(console[_0x5bfcec(0x1e3)](_0x5bfcec(0x1ea)+_0x5c8c41[_0x5bfcec(0x25e)]+'\x27:'),console[_0x5bfcec(0x1e3)]('─'[_0x5bfcec(0x21c)](0x3c)),console['log'](_0x5c8c41[_0x5bfcec(0x24f)]),console[_0x5bfcec(0x1e3)]('─'[_0x5bfcec(0x21c)](0x3c)));}for(const _0x43edba of _0x4b676e){_0x43edba['diff']&&(console['log']('\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27'+_0x43edba['name']+'\x27:'),console[_0x5bfcec(0x1e3)]('─'['repeat'](0x3c)),console['log'](_0x43edba['diff']),console[_0x5bfcec(0x1e3)]('─'[_0x5bfcec(0x21c)](0x3c)));}for(const _0x44ceb4 of _0x182d40){_0x44ceb4[_0x5bfcec(0x24f)]&&(console[_0x5bfcec(0x1e3)](_0x5bfcec(0x254)+_0x44ceb4['name']+'\x27:'),console[_0x5bfcec(0x1e3)]('─'['repeat'](0x3c)),console[_0x5bfcec(0x1e3)](_0x44ceb4['diff']),console[_0x5bfcec(0x1e3)]('─'[_0x5bfcec(0x21c)](0x3c)));}for(const _0x50d17a of _0x222aa9){_0x50d17a['diff']&&(console[_0x5bfcec(0x1e3)]('\x0aChanges\x20to\x20integration\x20\x27'+_0x50d17a[_0x5bfcec(0x25e)]+'\x27:'),console[_0x5bfcec(0x1e3)]('─'[_0x5bfcec(0x21c)](0x3c)),console['log'](_0x50d17a[_0x5bfcec(0x24f)]),console[_0x5bfcec(0x1e3)]('─'[_0x5bfcec(0x21c)](0x3c)));}for(const _0x584d2d of _0x595825){_0x584d2d[_0x5bfcec(0x24f)]&&(console[_0x5bfcec(0x1e3)](_0x5bfcec(0x1df)+_0x584d2d['name']+'\x27:'),console[_0x5bfcec(0x1e3)]('─'[_0x5bfcec(0x21c)](0x3c)),console[_0x5bfcec(0x1e3)](_0x584d2d[_0x5bfcec(0x24f)]),console[_0x5bfcec(0x1e3)]('─'[_0x5bfcec(0x21c)](0x3c)));}for(const _0xea8ee7 of _0x3fd68d){_0xea8ee7[_0x5bfcec(0x24f)]&&(console[_0x5bfcec(0x1e3)](_0x5bfcec(0x22d)+_0xea8ee7[_0x5bfcec(0x25e)]+'\x27:'),console[_0x5bfcec(0x1e3)]('─'['repeat'](0x3c)),console[_0x5bfcec(0x1e3)](_0xea8ee7[_0x5bfcec(0x24f)]),console[_0x5bfcec(0x1e3)]('─'['repeat'](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x42b121(0x25e)]=a4_0x42b121(0x226);['description']=a4_0x42b121(0x22c);async[a4_0x42b121(0x1fd)](_0x22ac40){const _0x59fbaa=a4_0x42b121,{options:_0x12eec4,args:_0x585e49,tdx:_0x419f7f}=_0x22ac40,_0x2af625=_0x585e49[0x0],_0x47a083=_0x585e49[0x1],_0x490eaf=_0x12eec4[_0x59fbaa(0x1e1)],_0x17e343=_0x12eec4[_0x59fbaa(0x1ee)],_0x39cdef=_0x12eec4[_0x59fbaa(0x20b)],_0x1f4942=_0x12eec4['yes'],_0x341123=_0x12eec4[_0x59fbaa(0x203)],_0x282db2=_0x12eec4[_0x59fbaa(0x1d9)];let _0x41cbe0;if(_0x2af625){const _0x293c0a=a4_0xf2d30d[_0x59fbaa(0x252)](_0x2af625,'tdx.json');if(existsSync(_0x293c0a))try{const _0x25f81f=JSON[_0x59fbaa(0x1bf)](readFileSync(_0x293c0a,_0x59fbaa(0x1c5)));_0x25f81f[_0x59fbaa(0x259)]&&(_0x41cbe0={'llm_project':_0x25f81f[_0x59fbaa(0x259)]});}catch{}}const _0x97e1af=findAgentConfigPath(process[_0x59fbaa(0x269)]());let _0x39f1d3;if(_0x97e1af)try{const _0x4084df=JSON['parse'](readFileSync(_0x97e1af,_0x59fbaa(0x1c5)));_0x4084df['llm_project']&&(_0x39f1d3={'llm_project':_0x4084df['llm_project']});}catch{}const _0x2d3234=resolveAgentPullArgs({'arg':_0x2af625,'agentNameArg':_0x47a083,'agentFlag':_0x282db2,'contextProject':_0x341123,'argDirConfig':_0x41cbe0,'cwdConfigPath':_0x97e1af||undefined,'cwdConfig':_0x39f1d3}),{projectNameOrId:_0x11ce59,targetAgentName:_0xdcf05f,existingOutputDir:_0x57d655,source:_0x407da1}=_0x2d3234;if(_0x407da1===_0x59fbaa(0x1d3))console[_0x59fbaa(0x1e3)](a4_0x14c24b[_0x59fbaa(0x244)](_0x59fbaa(0x1cd)+a4_0xf2d30d['join'](_0x2af625,'tdx.json')+':\x20'+_0x11ce59));else{if(_0x407da1===_0x59fbaa(0x1dc))console[_0x59fbaa(0x1e3)](a4_0x14c24b[_0x59fbaa(0x244)](_0x59fbaa(0x257)+_0x11ce59));else _0x407da1==='context'&&console[_0x59fbaa(0x1e3)](a4_0x14c24b[_0x59fbaa(0x244)]('Using\x20project\x20from\x20context:\x20'+_0x11ce59));}if(!_0x11ce59)return _0x282db2?(console['log'](a4_0x14c24b[_0x59fbaa(0x26b)](_0x59fbaa(0x1c8))),console[_0x59fbaa(0x1e3)](_0x59fbaa(0x1de)),console[_0x59fbaa(0x1e3)](_0x59fbaa(0x1d8))):(console[_0x59fbaa(0x1e3)](a4_0x14c24b[_0x59fbaa(0x26b)](_0x59fbaa(0x1f3))),console['log'](_0x59fbaa(0x219)),console[_0x59fbaa(0x1e3)](_0x59fbaa(0x204)),console[_0x59fbaa(0x1e3)](_0x59fbaa(0x1e7)),console[_0x59fbaa(0x1e3)](_0x59fbaa(0x23f)),console['log'](_0x59fbaa(0x1dd))),0x1;if(_0xdcf05f){const {data:_0xd167}=await withSpinner(_0x59fbaa(0x1f2)+_0xdcf05f+_0x59fbaa(0x213)+_0x11ce59+'\x22...',()=>_0x419f7f[_0x59fbaa(0x21d)][_0x59fbaa(0x217)](_0x11ce59,_0xdcf05f,_0x490eaf,{'dryRun':_0x17e343,'force':_0x39cdef}));if(_0x17e343)return console[_0x59fbaa(0x1e3)](a4_0x14c24b[_0x59fbaa(0x26b)](_0x59fbaa(0x225))),console['log'](_0x59fbaa(0x214)+_0xd167['agentName']),console['log'](_0x59fbaa(0x25c)+_0xd167[_0x59fbaa(0x1eb)]),_0xd167[_0x59fbaa(0x24f)]&&(console[_0x59fbaa(0x1e3)](_0x59fbaa(0x206)),console[_0x59fbaa(0x1e3)]('─'[_0x59fbaa(0x21c)](0x3c)),console[_0x59fbaa(0x1e3)](_0xd167[_0x59fbaa(0x24f)]),console[_0x59fbaa(0x1e3)]('─'['repeat'](0x3c))),0x0;return console[_0x59fbaa(0x1e3)](a4_0x14c24b['green'](_0x59fbaa(0x22a))),console[_0x59fbaa(0x1e3)]('Agent:\x20'+_0xd167[_0x59fbaa(0x1cf)]),console[_0x59fbaa(0x1e3)]('Output:\x20'+_0xd167[_0x59fbaa(0x1eb)]),console['log']('Status:\x20'+(_0xd167['isNew']?a4_0x14c24b[_0x59fbaa(0x1f4)](_0x59fbaa(0x238)):_0xd167['hasChanges']?a4_0x14c24b[_0x59fbaa(0x26b)](_0x59fbaa(0x1ec)):a4_0x14c24b[_0x59fbaa(0x1c1)](_0x59fbaa(0x1f6)))),0x0;}const _0x3cd72f=_0x57d655||_0x490eaf,{data:_0x132c55}=await withSpinner('Analyzing\x20project\x20\x22'+_0x11ce59+_0x59fbaa(0x207),()=>_0x419f7f[_0x59fbaa(0x21d)][_0x59fbaa(0x235)](_0x11ce59,_0x3cd72f,{'dryRun':!![]})),_0xc42f0=_0x132c55['counts']['agents'][_0x59fbaa(0x238)]+_0x132c55[_0x59fbaa(0x267)][_0x59fbaa(0x1e4)][_0x59fbaa(0x238)]+_0x132c55[_0x59fbaa(0x267)][_0x59fbaa(0x208)][_0x59fbaa(0x238)]+_0x132c55[_0x59fbaa(0x267)]['prompts']['new']+_0x132c55['counts']['integrations'][_0x59fbaa(0x238)]+_0x132c55[_0x59fbaa(0x267)][_0x59fbaa(0x1c9)][_0x59fbaa(0x238)]+_0x132c55['counts']['experimentalArtifacts']['new'],_0x152330=_0x132c55[_0x59fbaa(0x267)][_0x59fbaa(0x1c7)][_0x59fbaa(0x1ec)]+_0x132c55[_0x59fbaa(0x267)][_0x59fbaa(0x1e4)][_0x59fbaa(0x1ec)]+_0x132c55['counts'][_0x59fbaa(0x208)][_0x59fbaa(0x1ec)]+_0x132c55['counts'][_0x59fbaa(0x1ca)][_0x59fbaa(0x1ec)]+_0x132c55[_0x59fbaa(0x267)][_0x59fbaa(0x243)][_0x59fbaa(0x1ec)]+_0x132c55['counts'][_0x59fbaa(0x1c9)][_0x59fbaa(0x1ec)]+_0x132c55['counts']['experimentalArtifacts'][_0x59fbaa(0x1ec)],_0x1c6fc9=_0x132c55[_0x59fbaa(0x267)][_0x59fbaa(0x1c7)]['unchanged']+_0x132c55['counts'][_0x59fbaa(0x1e4)]['unchanged']+_0x132c55[_0x59fbaa(0x267)][_0x59fbaa(0x208)][_0x59fbaa(0x1f6)]+_0x132c55[_0x59fbaa(0x267)]['prompts'][_0x59fbaa(0x1f6)]+_0x132c55['counts']['integrations'][_0x59fbaa(0x1f6)]+_0x132c55[_0x59fbaa(0x267)]['experimentalKnowledgeBases'][_0x59fbaa(0x1f6)]+_0x132c55[_0x59fbaa(0x267)]['experimentalArtifacts'][_0x59fbaa(0x1f6)];console[_0x59fbaa(0x1e3)](_0x59fbaa(0x1fc)+_0x132c55[_0x59fbaa(0x1d0)]+'\x27:'),console[_0x59fbaa(0x1e3)]('\x20\x20'+a4_0x14c24b[_0x59fbaa(0x1f4)]('+\x20'+_0xc42f0+_0x59fbaa(0x1cb))+_0x59fbaa(0x218)+a4_0x14c24b['yellow']('~\x20'+_0x152330+_0x59fbaa(0x216))+'\x20|\x20'+a4_0x14c24b[_0x59fbaa(0x244)]('=\x20'+_0x1c6fc9+_0x59fbaa(0x26d))),console[_0x59fbaa(0x1e3)]('\x20\x20Agents:\x20'+formatCountSummary(_0x132c55['counts'][_0x59fbaa(0x1c7)])),console['log'](_0x59fbaa(0x1c2)+formatCountSummary(_0x132c55[_0x59fbaa(0x267)]['knowledgeBases'])),console['log']('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x132c55[_0x59fbaa(0x267)][_0x59fbaa(0x208)])),console[_0x59fbaa(0x1e3)](_0x59fbaa(0x201)+formatCountSummary(_0x132c55['counts']['prompts'])),console[_0x59fbaa(0x1e3)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x132c55[_0x59fbaa(0x267)][_0x59fbaa(0x243)]));const _0x46032f=_0x132c55['counts']['experimentalKnowledgeBases']['total']>0x0||_0x132c55[_0x59fbaa(0x267)][_0x59fbaa(0x20a)][_0x59fbaa(0x1e8)]>0x0;_0x46032f&&(console[_0x59fbaa(0x1e3)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x132c55[_0x59fbaa(0x267)][_0x59fbaa(0x1c9)])),console[_0x59fbaa(0x1e3)](_0x59fbaa(0x1d1)+formatCountSummary(_0x132c55['counts']['experimentalArtifacts'])));console[_0x59fbaa(0x1e3)]('\x20\x20Target:\x20'+a4_0x14c24b[_0x59fbaa(0x264)](_0x132c55[_0x59fbaa(0x241)])),displayDiffs(_0x132c55[_0x59fbaa(0x1c7)],_0x132c55[_0x59fbaa(0x1e4)],_0x132c55[_0x59fbaa(0x208)],_0x132c55['prompts'],_0x132c55[_0x59fbaa(0x243)],_0x132c55[_0x59fbaa(0x1c9)],_0x132c55[_0x59fbaa(0x20a)]);if(_0x17e343)return console['log'](a4_0x14c24b[_0x59fbaa(0x26b)](_0x59fbaa(0x1fe))),0x0;if(_0xc42f0===0x0&&_0x152330===0x0)return console['log'](a4_0x14c24b['green'](_0x59fbaa(0x24e))),saveSessionContext({'llm_project':_0x132c55[_0x59fbaa(0x1d0)]},_0x12eec4['session']),console[_0x59fbaa(0x1e3)](a4_0x14c24b[_0x59fbaa(0x1f4)](_0x59fbaa(0x23c)+a4_0x14c24b[_0x59fbaa(0x244)](_0x59fbaa(0x259))+'\x20=\x20'+a4_0x14c24b['cyan'](_0x132c55[_0x59fbaa(0x1d0)]))),0x0;if(!_0x1f4942&&!_0x39cdef){if(!isInteractive())return console[_0x59fbaa(0x262)](a4_0x14c24b[_0x59fbaa(0x230)](_0x59fbaa(0x237)),_0x59fbaa(0x248)),console['error'](a4_0x14c24b[_0x59fbaa(0x244)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x37d479=await confirmKey(_0x59fbaa(0x1e9)+(_0xc42f0+_0x152330)+_0x59fbaa(0x1d2));if(!_0x37d479)return console[_0x59fbaa(0x1e3)](a4_0x14c24b[_0x59fbaa(0x26b)]('Cancelled'),_0x59fbaa(0x1c4)),0x1;}const {data:_0x893c88}=await withSpinner('Writing\x20files...',()=>_0x419f7f[_0x59fbaa(0x21d)]['pullProject'](_0x11ce59,_0x3cd72f,{'force':_0x39cdef}));return console[_0x59fbaa(0x1e3)](a4_0x14c24b[_0x59fbaa(0x1f4)](_0x59fbaa(0x24c)+(_0xc42f0+_0x152330)+'\x20files\x20to\x20'+_0x893c88[_0x59fbaa(0x241)])),saveSessionContext({'llm_project':_0x893c88['projectName']},_0x12eec4[_0x59fbaa(0x209)]),console[_0x59fbaa(0x1e3)](a4_0x14c24b[_0x59fbaa(0x1f4)](_0x59fbaa(0x23c)+a4_0x14c24b[_0x59fbaa(0x244)](_0x59fbaa(0x259))+_0x59fbaa(0x232)+a4_0x14c24b[_0x59fbaa(0x264)](_0x893c88[_0x59fbaa(0x1d0)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x42b121(0x25e)]=a4_0x42b121(0x22b);[a4_0x42b121(0x1ed)]=a4_0x42b121(0x229);async[a4_0x42b121(0x1fd)](_0x33e6f0){const _0x1e9c6e=a4_0x42b121,{options:_0x33f69b,args:_0x38a042,tdx:_0x214c76}=_0x33e6f0,_0x5d2966=_0x38a042[0x0],_0x1339ad=_0x33f69b[_0x1e9c6e(0x25e)],_0x53a883=_0x33f69b['dryRun'],_0x5a6ee3=_0x33f69b[_0x1e9c6e(0x265)],_0x5c1da4=_0x33f69b[_0x1e9c6e(0x255)],_0x3378ae=_0x33f69b[_0x1e9c6e(0x203)];let _0x5169d7;const _0x52eb77=findAgentConfigPath(process['cwd']());if(_0x5d2966){const _0x1ae341=a4_0xf2d30d['join'](_0x5d2966,_0x1e9c6e(0x1c6));existsSync(_0x1ae341)?(_0x5169d7=_0x5d2966,console[_0x1e9c6e(0x1e3)](a4_0x14c24b[_0x1e9c6e(0x244)](_0x1e9c6e(0x1fa)+_0x5d2966))):_0x5169d7=_0x5d2966;}else{if(_0x52eb77)_0x5169d7=a4_0xf2d30d[_0x1e9c6e(0x25f)](_0x52eb77),console[_0x1e9c6e(0x1e3)](a4_0x14c24b['dim'](_0x1e9c6e(0x1f7)+_0x5169d7));else{if(_0x3378ae){const _0xbabdba=sanitizeForFilesystem(_0x3378ae);let _0xfddd5c=_0xbabdba,_0x45180e=a4_0xf2d30d['join'](process['cwd'](),'agents',_0xbabdba,_0x1e9c6e(0x1c6));if(!existsSync(_0x45180e)){const _0x2298a2=normalizeName(_0x3378ae),_0x1fe044=a4_0xf2d30d[_0x1e9c6e(0x252)](process[_0x1e9c6e(0x269)](),_0x1e9c6e(0x1c7),_0x2298a2,_0x1e9c6e(0x1c6));existsSync(_0x1fe044)&&(_0xfddd5c=_0x2298a2,_0x45180e=_0x1fe044);}if(existsSync(_0x45180e))_0x5169d7=a4_0xf2d30d[_0x1e9c6e(0x25f)](_0x45180e),console[_0x1e9c6e(0x1e3)](a4_0x14c24b[_0x1e9c6e(0x244)](_0x1e9c6e(0x1fa)+_0x5169d7));else{const _0x14f147=_0x33f69b[_0x1e9c6e(0x247)];if(_0x14f147)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x1e9c6e(0x221)+_0x3378ae+_0x1e9c6e(0x25b),undefined,{'helpText':_0x1e9c6e(0x1e5)+'First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a'+(_0x1e9c6e(0x270)+_0x3378ae+'\x0a')+(_0x1e9c6e(0x220)+_0xfddd5c+_0x1e9c6e(0x228)+(_0x1339ad||_0x1e9c6e(0x205))+_0x1e9c6e(0x24b)+_0x14f147)});_0x5169d7=_0x3378ae,console['log'](a4_0x14c24b[_0x1e9c6e(0x244)]('Using\x20context\x20project:\x20'+_0x3378ae));}}}}if(!_0x5169d7)return console[_0x1e9c6e(0x1e3)](a4_0x14c24b['yellow'](_0x1e9c6e(0x1d6))),console['log'](_0x1e9c6e(0x223)),console[_0x1e9c6e(0x1e3)](_0x1e9c6e(0x1d7)),console['log']('\x20\x20tdx\x20agent\x20clone\x20--name\x20<new-name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clone\x20from\x20context\x20(llm_project)'),console[_0x1e9c6e(0x1e3)]('\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>'),0x1;if(!_0x1339ad)throw new SDKError(ErrorCode['MISSING_ARGUMENT'],_0x1e9c6e(0x227),undefined,{'helpText':'Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>'});if(!_0x5a6ee3&&!_0x53a883){if(!isInteractive())return console[_0x1e9c6e(0x262)](a4_0x14c24b[_0x1e9c6e(0x230)]('\x0aError:'),_0x1e9c6e(0x248)),console['error'](a4_0x14c24b[_0x1e9c6e(0x244)](_0x1e9c6e(0x1db))),0x1;const _0x1add98=await confirmKey(_0x1e9c6e(0x263)+_0x5169d7+_0x1e9c6e(0x25d)+_0x1339ad+'\x22?');if(!_0x1add98)return console[_0x1e9c6e(0x1e3)](a4_0x14c24b['yellow']('Cancelled')),0x1;}const {data:_0xfddfe3}=await withSpinner(_0x1e9c6e(0x261)+_0x5169d7+_0x1e9c6e(0x1ff)+_0x1339ad+_0x1e9c6e(0x207),()=>_0x214c76['llm']['cloneProject'](_0x5169d7,_0x1339ad,{'dryRun':_0x53a883}));if(_0x53a883){console[_0x1e9c6e(0x1e3)](a4_0x14c24b['yellow'](_0x1e9c6e(0x239))),console[_0x1e9c6e(0x1e3)]('Source:\x20'+_0xfddfe3[_0x1e9c6e(0x20d)]),console[_0x1e9c6e(0x1e3)](_0x1e9c6e(0x234)+_0x1339ad),console['log'](_0x1e9c6e(0x215)),console[_0x1e9c6e(0x1e3)](_0x1e9c6e(0x1d5)+_0xfddfe3[_0x1e9c6e(0x267)][_0x1e9c6e(0x1c7)][_0x1e9c6e(0x1f8)]),console[_0x1e9c6e(0x1e3)](_0x1e9c6e(0x1c2)+_0xfddfe3[_0x1e9c6e(0x267)][_0x1e9c6e(0x1e4)][_0x1e9c6e(0x1f8)]),console[_0x1e9c6e(0x1e3)](_0x1e9c6e(0x201)+_0xfddfe3[_0x1e9c6e(0x267)]['prompts'][_0x1e9c6e(0x1f8)]);const _0xe9e8e7=_0xfddfe3[_0x1e9c6e(0x267)][_0x1e9c6e(0x1c9)][_0x1e9c6e(0x1f8)]>0x0||_0xfddfe3[_0x1e9c6e(0x267)]['experimentalArtifacts'][_0x1e9c6e(0x1f8)]>0x0;return _0xe9e8e7&&(console[_0x1e9c6e(0x1e3)](_0x1e9c6e(0x22e)+_0xfddfe3['counts'][_0x1e9c6e(0x1c9)]['created']),console[_0x1e9c6e(0x1e3)](_0x1e9c6e(0x1d1)+_0xfddfe3[_0x1e9c6e(0x267)][_0x1e9c6e(0x20a)]['created'])),0x0;}const _0x5a3794=_0xfddfe3['counts'][_0x1e9c6e(0x1c7)][_0x1e9c6e(0x210)]>0x0||_0xfddfe3['counts'][_0x1e9c6e(0x1e4)][_0x1e9c6e(0x210)]>0x0||_0xfddfe3[_0x1e9c6e(0x267)][_0x1e9c6e(0x1ca)][_0x1e9c6e(0x210)]>0x0||_0xfddfe3[_0x1e9c6e(0x267)]['experimentalKnowledgeBases'][_0x1e9c6e(0x210)]>0x0||_0xfddfe3[_0x1e9c6e(0x267)]['experimentalArtifacts'][_0x1e9c6e(0x210)]>0x0;_0x5a3794?console[_0x1e9c6e(0x1e3)](a4_0x14c24b[_0x1e9c6e(0x26b)](_0x1e9c6e(0x1f0))):console['log'](a4_0x14c24b[_0x1e9c6e(0x1f4)](_0x1e9c6e(0x24d)));console['log'](_0x1e9c6e(0x242)+_0xfddfe3[_0x1e9c6e(0x20d)]),console[_0x1e9c6e(0x1e3)](_0x1e9c6e(0x234)+_0xfddfe3[_0x1e9c6e(0x268)]),console[_0x1e9c6e(0x1e3)](_0x1e9c6e(0x1c0)+_0xfddfe3[_0x1e9c6e(0x212)]),console[_0x1e9c6e(0x1e3)](),console[_0x1e9c6e(0x1e3)]('Summary:'),console['log'](_0x1e9c6e(0x1d5)+formatCountSummary(_0xfddfe3[_0x1e9c6e(0x267)][_0x1e9c6e(0x1c7)])),console[_0x1e9c6e(0x1e3)](_0x1e9c6e(0x1c2)+formatCountSummary(_0xfddfe3['counts'][_0x1e9c6e(0x1e4)])),console[_0x1e9c6e(0x1e3)](_0x1e9c6e(0x201)+formatCountSummary(_0xfddfe3[_0x1e9c6e(0x267)][_0x1e9c6e(0x1ca)])),console['log'](_0x1e9c6e(0x250)+formatCountSummary(_0xfddfe3[_0x1e9c6e(0x267)][_0x1e9c6e(0x243)]));const _0x4c9988=_0xfddfe3[_0x1e9c6e(0x267)]['experimentalKnowledgeBases'][_0x1e9c6e(0x1f8)]>0x0||_0xfddfe3[_0x1e9c6e(0x267)][_0x1e9c6e(0x1c9)][_0x1e9c6e(0x1ec)]>0x0||_0xfddfe3['counts']['experimentalKnowledgeBases'][_0x1e9c6e(0x1f6)]>0x0||_0xfddfe3[_0x1e9c6e(0x267)][_0x1e9c6e(0x20a)][_0x1e9c6e(0x1f8)]>0x0||_0xfddfe3[_0x1e9c6e(0x267)][_0x1e9c6e(0x20a)][_0x1e9c6e(0x1ec)]>0x0||_0xfddfe3['counts'][_0x1e9c6e(0x20a)][_0x1e9c6e(0x1f6)]>0x0;_0x4c9988&&(console[_0x1e9c6e(0x1e3)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0xfddfe3[_0x1e9c6e(0x267)][_0x1e9c6e(0x1c9)])),console[_0x1e9c6e(0x1e3)](_0x1e9c6e(0x1d1)+formatCountSummary(_0xfddfe3[_0x1e9c6e(0x267)][_0x1e9c6e(0x20a)])));if(_0x5a3794){console[_0x1e9c6e(0x1e3)](),console['log'](a4_0x14c24b[_0x1e9c6e(0x230)](_0x1e9c6e(0x256)));for(const _0x466bcc of _0xfddfe3['agents']){_0x466bcc[_0x1e9c6e(0x21f)]===_0x1e9c6e(0x262)&&console['log'](a4_0x14c24b[_0x1e9c6e(0x230)](_0x1e9c6e(0x26c)+_0x466bcc[_0x1e9c6e(0x1cf)]+_0x1e9c6e(0x1f9)+_0x466bcc[_0x1e9c6e(0x262)]));}for(const _0xc3182f of _0xfddfe3[_0x1e9c6e(0x1e4)]){_0xc3182f[_0x1e9c6e(0x21f)]===_0x1e9c6e(0x262)&&console[_0x1e9c6e(0x1e3)](a4_0x14c24b[_0x1e9c6e(0x230)]('\x20\x20Knowledge\x20Base\x20\x22'+_0xc3182f[_0x1e9c6e(0x25e)]+_0x1e9c6e(0x1f9)+_0xc3182f[_0x1e9c6e(0x262)]));}for(const _0x3a8464 of _0xfddfe3[_0x1e9c6e(0x1ca)]){_0x3a8464[_0x1e9c6e(0x21f)]===_0x1e9c6e(0x262)&&console[_0x1e9c6e(0x1e3)](a4_0x14c24b['red'](_0x1e9c6e(0x245)+_0x3a8464[_0x1e9c6e(0x25e)]+'\x22:\x20'+_0x3a8464[_0x1e9c6e(0x262)]));}for(const _0x2975fd of _0xfddfe3[_0x1e9c6e(0x243)]){_0x2975fd[_0x1e9c6e(0x21f)]===_0x1e9c6e(0x262)&&console['log'](a4_0x14c24b['red']('\x20\x20Integration\x20\x22'+_0x2975fd[_0x1e9c6e(0x25e)]+_0x1e9c6e(0x1f9)+_0x2975fd[_0x1e9c6e(0x262)]));}for(const _0x479c47 of _0xfddfe3[_0x1e9c6e(0x1c9)]){_0x479c47[_0x1e9c6e(0x21f)]===_0x1e9c6e(0x262)&&console[_0x1e9c6e(0x1e3)](a4_0x14c24b[_0x1e9c6e(0x230)]('\x20\x20Experimental\x20Knowledge\x20Base\x20\x22'+_0x479c47[_0x1e9c6e(0x25e)]+_0x1e9c6e(0x1f9)+_0x479c47[_0x1e9c6e(0x262)]));}for(const _0x36802d of _0xfddfe3[_0x1e9c6e(0x20a)]){_0x36802d[_0x1e9c6e(0x21f)]===_0x1e9c6e(0x262)&&console[_0x1e9c6e(0x1e3)](a4_0x14c24b[_0x1e9c6e(0x230)](_0x1e9c6e(0x23d)+_0x36802d[_0x1e9c6e(0x25e)]+_0x1e9c6e(0x1f9)+_0x36802d[_0x1e9c6e(0x262)]));}return 0x1;}console[_0x1e9c6e(0x1e3)]();const _0x58d20c=getLLMProjectUrl(_0x5c1da4,_0xfddfe3['newProjectId']);return console[_0x1e9c6e(0x1e3)](_0x1e9c6e(0x21b)+a4_0x14c24b[_0x1e9c6e(0x264)](_0x58d20c)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x42b121(0x25e)]=a4_0x42b121(0x1bc);['description']='Push\x20local\x20agent\x20files\x20to\x20LLM\x20project';async[a4_0x42b121(0x1fd)](_0x50d0f1){const _0x594888=a4_0x42b121,{options:_0x5ae694,args:_0x4686a,tdx:_0x578475}=_0x50d0f1;let _0x44b6fe=_0x4686a[0x0]||process[_0x594888(0x269)]();const _0x51090d=_0x5ae694[_0x594888(0x1ee)],_0x7a46b4=_0x5ae694[_0x594888(0x20b)],_0x5c0187=_0x5ae694[_0x594888(0x265)],_0x587cc1=_0x5ae694[_0x594888(0x255)],_0x5aa82b=a4_0xf2d30d['join'](_0x44b6fe,_0x594888(0x253)),_0x7f2b97=existsSync(_0x5aa82b);if(_0x7f2b97){const {data:_0x30291b}=await withSpinner(_0x594888(0x236)+_0x44b6fe+_0x594888(0x207),()=>_0x578475[_0x594888(0x21d)][_0x594888(0x1bd)](_0x44b6fe,{'dryRun':_0x51090d,'force':_0x7a46b4}));if(_0x51090d)return console[_0x594888(0x1e3)](a4_0x14c24b[_0x594888(0x26b)](_0x594888(0x239))),console[_0x594888(0x1e3)]('Would\x20push\x20agent:\x20'+_0x30291b['agentName']),0x0;if(_0x30291b[_0x594888(0x21f)]==='error')return console['log'](a4_0x14c24b[_0x594888(0x230)](_0x594888(0x1da)+_0x30291b['error'])),0x1;console[_0x594888(0x1e3)](a4_0x14c24b[_0x594888(0x1f4)](_0x594888(0x1f1)+_0x30291b[_0x594888(0x21f)]+_0x594888(0x1cc))),console[_0x594888(0x1e3)](_0x594888(0x26a)+_0x30291b[_0x594888(0x1cf)]);if(_0x30291b[_0x594888(0x266)]&&_0x30291b[_0x594888(0x1be)]){const _0x329e78=getLLMAgentChatUrl(_0x587cc1,_0x30291b[_0x594888(0x1be)],_0x30291b[_0x594888(0x266)]);console['log'](_0x594888(0x20c)+a4_0x14c24b[_0x594888(0x264)](_0x329e78));}return 0x0;}const _0x22f386=_0x5ae694[_0x594888(0x203)],_0x14c029=resolveProjectFromContext(_0x44b6fe,_0x22f386);if(_0x14c029[_0x594888(0x202)])_0x44b6fe=_0x14c029[_0x594888(0x231)],_0x14c029['source']===_0x594888(0x23e)&&console[_0x594888(0x1e3)](a4_0x14c24b[_0x594888(0x244)](_0x594888(0x257)+_0x44b6fe));else{let _0x1ea1ed=_0x594888(0x26f);_0x14c029[_0x594888(0x251)]===_0x594888(0x1ce)&&(_0x1ea1ed=_0x14c029[_0x594888(0x249)]+_0x594888(0x22f)+_0x14c029[_0x594888(0x203)]+'\x27\x20to\x20create\x20the\x20folder\x20structure.');throw new SDKError(ErrorCode[_0x594888(0x1d4)],_0x14c029[_0x594888(0x251)]===_0x594888(0x1e2)?_0x14c029['message']:_0x594888(0x222)+_0x44b6fe,undefined,{'helpText':_0x1ea1ed});}const {data:_0x4311b2}=await withSpinner('Analyzing\x20changes\x20to\x20push...',()=>_0x578475['llm'][_0x594888(0x21e)](_0x44b6fe,{'dryRun':!![]})),_0x58c2e5=_0x4311b2[_0x594888(0x267)][_0x594888(0x1c7)][_0x594888(0x210)]>0x0;if(_0x58c2e5){console[_0x594888(0x1e3)](a4_0x14c24b['red'](_0x594888(0x1f5)));for(const _0x4fc229 of _0x4311b2[_0x594888(0x1c7)]){_0x4fc229['action']===_0x594888(0x262)&&console[_0x594888(0x1e3)](a4_0x14c24b[_0x594888(0x230)](_0x594888(0x26c)+_0x4fc229[_0x594888(0x1cf)]+'\x22:\x20'+_0x4fc229[_0x594888(0x262)]));}return 0x1;}const _0x4f269d=_0x4311b2['counts'][_0x594888(0x1c7)][_0x594888(0x1f8)]+_0x4311b2[_0x594888(0x267)][_0x594888(0x1e4)][_0x594888(0x1f8)]+_0x4311b2['counts'][_0x594888(0x208)]['created']+_0x4311b2[_0x594888(0x267)][_0x594888(0x1ca)][_0x594888(0x1f8)]+_0x4311b2['counts'][_0x594888(0x243)]['created']+_0x4311b2[_0x594888(0x267)][_0x594888(0x1c9)]['created']+_0x4311b2[_0x594888(0x267)][_0x594888(0x20a)][_0x594888(0x1f8)],_0x299115=_0x4311b2[_0x594888(0x267)]['agents'][_0x594888(0x1ec)]+_0x4311b2[_0x594888(0x267)][_0x594888(0x1e4)][_0x594888(0x1ec)]+_0x4311b2['counts']['textKnowledgeBases']['updated']+_0x4311b2[_0x594888(0x267)][_0x594888(0x1ca)][_0x594888(0x1ec)]+_0x4311b2[_0x594888(0x267)][_0x594888(0x243)][_0x594888(0x1ec)]+_0x4311b2['counts']['experimentalKnowledgeBases'][_0x594888(0x1ec)]+_0x4311b2[_0x594888(0x267)][_0x594888(0x20a)]['updated'],_0xe711d1=_0x4311b2[_0x594888(0x267)]['agents'][_0x594888(0x1f6)]+_0x4311b2['counts']['knowledgeBases'][_0x594888(0x1f6)]+_0x4311b2[_0x594888(0x267)][_0x594888(0x208)][_0x594888(0x1f6)]+_0x4311b2[_0x594888(0x267)]['prompts']['unchanged']+_0x4311b2[_0x594888(0x267)][_0x594888(0x243)]['unchanged']+_0x4311b2[_0x594888(0x267)][_0x594888(0x1c9)][_0x594888(0x1f6)]+_0x4311b2[_0x594888(0x267)]['experimentalArtifacts'][_0x594888(0x1f6)];console['log'](_0x594888(0x24a)+_0x4311b2[_0x594888(0x1d0)]+'\x27:'),console[_0x594888(0x1e3)]('\x20\x20'+a4_0x14c24b['green']('+\x20'+_0x4f269d+_0x594888(0x1cb))+'\x20|\x20'+a4_0x14c24b[_0x594888(0x26b)]('~\x20'+_0x299115+_0x594888(0x216))+'\x20|\x20'+a4_0x14c24b[_0x594888(0x244)]('=\x20'+_0xe711d1+_0x594888(0x26d))),console[_0x594888(0x1e3)](_0x594888(0x1d5)+formatCountSummary(_0x4311b2[_0x594888(0x267)][_0x594888(0x1c7)])),console[_0x594888(0x1e3)](_0x594888(0x1c2)+formatCountSummary(_0x4311b2[_0x594888(0x267)][_0x594888(0x1e4)])),console['log']('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x4311b2[_0x594888(0x267)][_0x594888(0x208)])),console[_0x594888(0x1e3)](_0x594888(0x201)+formatCountSummary(_0x4311b2[_0x594888(0x267)][_0x594888(0x1ca)])),console[_0x594888(0x1e3)](_0x594888(0x250)+formatCountSummary(_0x4311b2[_0x594888(0x267)][_0x594888(0x243)]));const _0x6dc28f=_0x4311b2[_0x594888(0x267)][_0x594888(0x1c9)][_0x594888(0x1f8)]>0x0||_0x4311b2[_0x594888(0x267)]['experimentalKnowledgeBases'][_0x594888(0x1ec)]>0x0||_0x4311b2[_0x594888(0x267)][_0x594888(0x1c9)][_0x594888(0x1f6)]>0x0||_0x4311b2['counts'][_0x594888(0x20a)][_0x594888(0x1f8)]>0x0||_0x4311b2[_0x594888(0x267)][_0x594888(0x20a)][_0x594888(0x1ec)]>0x0||_0x4311b2[_0x594888(0x267)]['experimentalArtifacts']['unchanged']>0x0;_0x6dc28f&&(console[_0x594888(0x1e3)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x4311b2[_0x594888(0x267)][_0x594888(0x1c9)])),console[_0x594888(0x1e3)](_0x594888(0x1d1)+formatCountSummary(_0x4311b2[_0x594888(0x267)][_0x594888(0x20a)])));console[_0x594888(0x1e3)](_0x594888(0x1ef)+a4_0x14c24b[_0x594888(0x264)](_0x44b6fe)),displayDiffs(_0x4311b2[_0x594888(0x1c7)],_0x4311b2[_0x594888(0x1e4)],_0x4311b2[_0x594888(0x208)],_0x4311b2[_0x594888(0x1ca)],_0x4311b2[_0x594888(0x243)],_0x4311b2['experimentalKnowledgeBases'],_0x4311b2[_0x594888(0x20a)]);if(_0x51090d)return console[_0x594888(0x1e3)](a4_0x14c24b[_0x594888(0x26b)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed')),0x0;if(_0x4f269d===0x0&&_0x299115===0x0){console['log'](a4_0x14c24b[_0x594888(0x1f4)](_0x594888(0x246)));const _0x14b0dc=getLLMProjectUrl(_0x587cc1,_0x4311b2[_0x594888(0x1be)]);return console[_0x594888(0x1e3)](_0x594888(0x21b)+a4_0x14c24b[_0x594888(0x264)](_0x14b0dc)),0x0;}if(!_0x5c0187&&!_0x7a46b4){if(!isInteractive())return console['error'](a4_0x14c24b[_0x594888(0x230)](_0x594888(0x237)),_0x594888(0x248)),console[_0x594888(0x262)](a4_0x14c24b['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x5b80f0=await confirmKey(_0x594888(0x23a)+(_0x4f269d+_0x299115)+'\x20resources?');if(!_0x5b80f0)return console[_0x594888(0x1e3)](a4_0x14c24b['yellow']('Cancelled'),_0x594888(0x1c3)),0x1;}const {data:_0x2f63b5}=await withSpinner(_0x594888(0x26e),()=>_0x578475[_0x594888(0x21d)]['pushProject'](_0x44b6fe,{'force':_0x7a46b4})),_0x479532=_0x2f63b5[_0x594888(0x267)][_0x594888(0x1c7)][_0x594888(0x210)]>0x0||_0x2f63b5[_0x594888(0x267)]['knowledgeBases'][_0x594888(0x210)]>0x0||_0x2f63b5[_0x594888(0x267)][_0x594888(0x208)]['errors']>0x0||_0x2f63b5[_0x594888(0x267)]['prompts'][_0x594888(0x210)]>0x0;if(_0x479532){console[_0x594888(0x1e3)](a4_0x14c24b['yellow']('\x0aProject\x20pushed\x20with\x20errors')),console[_0x594888(0x1e3)](),console['log'](a4_0x14c24b[_0x594888(0x230)](_0x594888(0x256)));for(const _0x38f29e of _0x2f63b5['agents']){_0x38f29e[_0x594888(0x21f)]===_0x594888(0x262)&&console['log'](a4_0x14c24b[_0x594888(0x230)](_0x594888(0x26c)+_0x38f29e[_0x594888(0x1cf)]+_0x594888(0x1f9)+_0x38f29e[_0x594888(0x262)]));}for(const _0x8b7cf3 of _0x2f63b5[_0x594888(0x1e4)]){_0x8b7cf3[_0x594888(0x21f)]===_0x594888(0x262)&&console[_0x594888(0x1e3)](a4_0x14c24b[_0x594888(0x230)](_0x594888(0x20f)+_0x8b7cf3[_0x594888(0x25e)]+_0x594888(0x1f9)+_0x8b7cf3[_0x594888(0x262)]));}for(const _0xcd3e95 of _0x2f63b5[_0x594888(0x208)]){_0xcd3e95[_0x594888(0x21f)]===_0x594888(0x262)&&console[_0x594888(0x1e3)](a4_0x14c24b['red']('\x20\x20Text\x20Knowledge\x20Base\x20\x22'+_0xcd3e95[_0x594888(0x25e)]+_0x594888(0x1f9)+_0xcd3e95[_0x594888(0x262)]));}for(const _0x18de36 of _0x2f63b5[_0x594888(0x1ca)]){_0x18de36[_0x594888(0x21f)]===_0x594888(0x262)&&console['log'](a4_0x14c24b[_0x594888(0x230)](_0x594888(0x245)+_0x18de36[_0x594888(0x25e)]+_0x594888(0x1f9)+_0x18de36[_0x594888(0x262)]));}for(const _0x4552ef of _0x2f63b5[_0x594888(0x243)]){_0x4552ef[_0x594888(0x21f)]===_0x594888(0x262)&&console[_0x594888(0x1e3)](a4_0x14c24b[_0x594888(0x230)](_0x594888(0x224)+_0x4552ef[_0x594888(0x25e)]+_0x594888(0x1f9)+_0x4552ef[_0x594888(0x262)]));}return 0x1;}console[_0x594888(0x1e3)](a4_0x14c24b[_0x594888(0x1f4)]('\x0a✔\x20Pushed\x20'+(_0x4f269d+_0x299115)+'\x20resources\x20to\x20\x27'+_0x2f63b5[_0x594888(0x1d0)]+'\x27'));const _0x4bc102=getLLMProjectUrl(_0x587cc1,_0x2f63b5[_0x594888(0x1be)]);return console[_0x594888(0x1e3)]('Project:\x20'+a4_0x14c24b[_0x594888(0x264)](_0x4bc102)),0x0;}}
@@ -1 +1 @@
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
+ const a5_0x39f585=a5_0x30f2;function a5_0x5325(){const _0x133bbc=['verbose','dryRun','projectName','basename','\x27\x20to\x20create\x20the\x20folder\x20structure.','\x20\x20-\x20','\x20\x20Project:\x20','\x20-\x20','projectDir','✗\x20ERROR:\x20','round','conversations','49736fYavKl','8mepwXh','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','writeFileSync','name','1519797OzoHWu','conversation_url','Round\x20','Site:\x20','repeat','73451ZSGDox','agentDirs','404','Running:\x20','log','Re-evaluation\x20Summary','PASS','\x22:\x20','\x20\x20Evaluating...\x20','Cached\x20run\x20is\x20from\x20site\x20\x22','cyan','llmProject','status','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','length','tests','split','resolveProjectId','jsonl','text','\x20(new)','\x20(cached)','13952081oaAZeC','map','stop','Re-evaluating\x20cached\x20test\x20run...','ERROR','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','agent:test','\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','dim','start','Re-evaluating\x20','✓\x20PASS:\x20','green','table','push','Error:\x20No\x20previous\x20test\x20run\x20found.','message','utf-8','Executing\x20new\x20tests...','source','isSpinning','description','no_context','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','agent','now','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','existsSync','\x20\x20Site:\x20','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','Total:\x20\x20\x20\x20','Running\x20agent\x20tests...','Evaluating\x20response...','trim',':\x20Sending\x20user\x20input...','Available\x20tags:\x20','156efEQqQ','Cached\x20run\x20from:\x20','Round\x201/','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','substring','Tests\x20found:\x20','timestamp','filter','Agent:\x20','executeReeval','423oaaMTW','yellow','Conversation\x20URL:\x20','agentName','Error\x20writing\x20output\x20file:\x20','llm','⚠\x20SKIPPED:\x20','Passed:\x20\x20\x20','red','New\x20tests\x20to\x20execute:\x20','some','size','reason','add','toLowerCase','2377490hfItdB','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','42946fSWvhF','4584TueQBH','Failed:\x20\x20\x20','Re-evaluating...','no_local_folder','Failed\x20Tests:','Project\x20path:\x20','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','execute','\x20\x20Conversation:\x20','✗\x20FAIL:\x20','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','No\x20tests\x20found\x20matching:\x20','find','site','tags','join','Using\x20agent:\x20','not\x20found','toISOString','Output\x20written\x20to:\x20','forEach','includes','Duration:\x20','Usage:','rounds','Errors:\x20\x20\x20','has','\x20\x20Round\x20','Test\x20','...\x20','No\x20tests\x20found\x20with\x20tags:\x20','no_tests','Running\x20test:\x20','json','...','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','tsv','FAIL','185yyiXMX','test.yml','white'];a5_0x5325=function(){return _0x133bbc;};return a5_0x5325();}(function(_0x4b0b55,_0x879f81){const _0x3742ef=a5_0x30f2,_0x4a1236=_0x4b0b55();while(!![]){try{const _0x4d9128=-parseInt(_0x3742ef(0xc8))/0x1*(-parseInt(_0x3742ef(0xff))/0x2)+parseInt(_0x3742ef(0x103))/0x3+-parseInt(_0x3742ef(0xfe))/0x4*(-parseInt(_0x3742ef(0xef))/0x5)+parseInt(_0x3742ef(0xad))/0x6*(parseInt(_0x3742ef(0x108))/0x7)+parseInt(_0x3742ef(0xc9))/0x8*(-parseInt(_0x3742ef(0xb7))/0x9)+parseInt(_0x3742ef(0xc6))/0xa+-parseInt(_0x3742ef(0x89))/0xb;if(_0x4d9128===_0x879f81)break;else _0x4a1236['push'](_0x4a1236['shift']());}catch(_0x1c8643){_0x4a1236['push'](_0x4a1236['shift']());}}}(a5_0x5325,0x565aa));import*as a5_0x29dcd8 from'node:fs';import*as a5_0x28dcdc from'node:path';import a5_0x5d7a3c from'chalk';function a5_0x30f2(_0x470728,_0x2d407a){_0x470728=_0x470728-0x86;const _0x5325f3=a5_0x5325();let _0x30f224=_0x5325f3[_0x470728];return _0x30f224;}import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x39f585(0x102)]=a5_0x39f585(0x8f);[a5_0x39f585(0x9e)]='Run\x20tests\x20for\x20an\x20LLM\x20agent';async[a5_0x39f585(0xd0)](_0x3c8bce){const _0x432e6a=a5_0x39f585,{options:_0x485f8b,args:_0x4fb542,tdx:_0xb21d83}=_0x3c8bce,_0x22ab57=_0x4fb542[0x0]||'.',_0x2e669d=_0x485f8b[_0x432e6a(0xf3)],_0x1c1cfc=_0x485f8b,_0x27c160=_0x1c1cfc['eval']===![],_0x1419e2=_0x1c1cfc['reeval'],_0x175ae8=_0x1c1cfc[_0x432e6a(0x102)],_0x5afe20=_0x1c1cfc[_0x432e6a(0xd7)],_0x1c2cc0=_0x485f8b[_0x432e6a(0xd6)],_0x1dbfca=_0x1c1cfc['output'];if(_0x1419e2&&_0x27c160)return console[_0x432e6a(0x10c)](a5_0x5d7a3c[_0x432e6a(0xbf)]('Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval')),0x1;let _0x19953e='table';if(_0x1c1cfc[_0x432e6a(0xea)])_0x19953e=_0x432e6a(0xea);else{if(_0x1c1cfc['jsonl'])_0x19953e=_0x432e6a(0x11a);else{if(_0x1c1cfc[_0x432e6a(0xed)])_0x19953e=_0x432e6a(0xed);else{if(_0x1c1cfc[_0x432e6a(0x96)])_0x19953e=_0x432e6a(0x96);}}}const _0x491911=_0x1c1cfc[_0x432e6a(0x113)];let _0x3d2a65=_0x22ab57;const _0x397323=a5_0x29dcd8[_0x432e6a(0xa4)](_0x22ab57),_0x35b17b=_0x22ab57==='.';if(!_0x397323||_0x35b17b){const _0x4abe16=resolveProjectFromContext(_0x22ab57,_0x491911,{'requireFile':_0x432e6a(0xf0)});if(_0x4abe16['found'])_0x3d2a65=_0x4abe16[_0x432e6a(0xfa)],_0x4abe16[_0x432e6a(0x9c)]==='context'&&console[_0x432e6a(0x10c)](a5_0x5d7a3c[_0x432e6a(0x91)](_0x432e6a(0xd9)+_0x3d2a65));else switch(_0x4abe16[_0x432e6a(0xc3)]){case _0x432e6a(0x9f):console['log'](a5_0x5d7a3c[_0x432e6a(0xb8)](_0x4abe16[_0x432e6a(0x99)])),console['log'](),console[_0x432e6a(0x10c)](_0x432e6a(0xe0)),console[_0x432e6a(0x10c)](_0x432e6a(0x90)),console[_0x432e6a(0x10c)]('\x20\x20tdx\x20agent\x20test\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20(requires\x20context\x20or\x20tdx.json)'),console[_0x432e6a(0x10c)](),console['log'](_0x432e6a(0xd3));return 0x1;case _0x432e6a(0xcc):console[_0x432e6a(0x10c)](a5_0x5d7a3c['yellow'](_0x4abe16[_0x432e6a(0x99)])),console['log'](),console[_0x432e6a(0x10c)]('Run\x20\x27tdx\x20agent\x20pull\x20'+_0x4abe16['llmProject']+_0x432e6a(0xf6));return 0x1;case'multiple_agents':{const _0x35ecf1=a5_0x28dcdc[_0x432e6a(0xf5)](_0x4abe16[_0x432e6a(0xfa)]);console[_0x432e6a(0x10c)](a5_0x5d7a3c[_0x432e6a(0xb8)]('Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22'+_0x4abe16['llmProject']+'\x22:'));for(const _0x25dc4d of _0x4abe16[_0x432e6a(0x109)]){console[_0x432e6a(0x10c)](_0x432e6a(0xf7)+_0x25dc4d);}return console[_0x432e6a(0x10c)](),console[_0x432e6a(0x10c)](_0x432e6a(0xa0)+_0x35ecf1+'/<agent-name>'),0x1;}case _0x432e6a(0xe8):console[_0x432e6a(0x10c)](a5_0x5d7a3c[_0x432e6a(0xb8)](_0x432e6a(0xb0)+_0x4abe16[_0x432e6a(0x113)]+'\x22.')),console['log'](a5_0x5d7a3c[_0x432e6a(0x91)](_0x432e6a(0xce)+_0x4abe16[_0x432e6a(0xfa)])),console['log'](),console[_0x432e6a(0x10c)]('Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.');return 0x1;}}const {definition:_0x3f1840,agentInfo:_0x4e74c9}=parseTestFile(_0x3d2a65);let _0x2401f0=_0x3f1840[_0x432e6a(0x117)];if(_0x175ae8){const _0x5d4df6=_0x175ae8[_0x432e6a(0x118)](',')[_0x432e6a(0x8a)](_0x20669b=>_0x20669b[_0x432e6a(0xaa)]());_0x2401f0=_0x3f1840[_0x432e6a(0x117)][_0x432e6a(0xb4)](_0x40645e=>_0x5d4df6['includes'](_0x40645e[_0x432e6a(0x102)]));if(_0x2401f0[_0x432e6a(0x116)]===0x0)return console[_0x432e6a(0x10c)](a5_0x5d7a3c[_0x432e6a(0xb8)](_0x432e6a(0xd4)+_0x175ae8)),console[_0x432e6a(0x10c)](a5_0x5d7a3c['dim']('Available\x20tests:\x20'+_0x3f1840[_0x432e6a(0x117)][_0x432e6a(0x8a)](_0x994907=>_0x994907[_0x432e6a(0x102)])[_0x432e6a(0xd8)](',\x20'))),0x1;}if(_0x5afe20){const _0x3b903d=_0x5afe20[_0x432e6a(0x118)](',')[_0x432e6a(0x8a)](_0x2047cb=>_0x2047cb[_0x432e6a(0xaa)]()[_0x432e6a(0xc5)]());_0x2401f0=_0x2401f0['filter'](_0xf8fbeb=>_0xf8fbeb[_0x432e6a(0xd7)]?.[_0x432e6a(0xc1)](_0x2e609a=>_0x3b903d[_0x432e6a(0xde)](_0x2e609a[_0x432e6a(0xc5)]())));if(_0x2401f0[_0x432e6a(0x116)]===0x0){console[_0x432e6a(0x10c)](a5_0x5d7a3c[_0x432e6a(0xb8)](_0x432e6a(0xe7)+_0x5afe20));const _0x2968e7=new Set();return _0x3f1840['tests']['forEach'](_0x3226d5=>_0x3226d5[_0x432e6a(0xd7)]?.[_0x432e6a(0xdd)](_0x4e3375=>_0x2968e7[_0x432e6a(0xc4)](_0x4e3375))),_0x2968e7[_0x432e6a(0xc2)]>0x0?console[_0x432e6a(0x10c)](a5_0x5d7a3c[_0x432e6a(0x91)](_0x432e6a(0xac)+[..._0x2968e7][_0x432e6a(0xd8)](',\x20'))):console[_0x432e6a(0x10c)](a5_0x5d7a3c[_0x432e6a(0x91)]('No\x20tests\x20have\x20tags\x20defined.')),0x1;}}if(_0x1419e2)return this['executeReeval'](_0x3c8bce,{'definition':{'tests':_0x2401f0},'agentInfo':_0x4e74c9,'outputFormat':_0x19953e,'outputFile':_0x1dbfca,'testNames':_0x175ae8});if(_0x2e669d){console[_0x432e6a(0x10c)](a5_0x5d7a3c[_0x432e6a(0x112)]('Test\x20Configuration:')),console[_0x432e6a(0x10c)](_0x432e6a(0xa5)+a5_0x5d7a3c['white'](_0x1c2cc0)),console[_0x432e6a(0x10c)](_0x432e6a(0xf8)+a5_0x5d7a3c[_0x432e6a(0xf1)](_0x4e74c9[_0x432e6a(0xf4)])),console[_0x432e6a(0x10c)]('\x20\x20Agent:\x20'+a5_0x5d7a3c['white'](_0x4e74c9['agentName'])),console['log'](),console['log'](_0x432e6a(0xb2)+a5_0x5d7a3c['white'](_0x2401f0[_0x432e6a(0x116)]));for(let _0x2624df=0x0;_0x2624df<_0x2401f0[_0x432e6a(0x116)];_0x2624df++){const _0x8f47c6=_0x2401f0[_0x2624df],_0x42496e=_0x8f47c6[_0x432e6a(0xe1)][_0x432e6a(0x116)]===0x1?_0x432e6a(0xfc):_0x432e6a(0xe1),_0x4da055=_0x8f47c6[_0x432e6a(0xd7)]?.[_0x432e6a(0x116)]?'\x20['+_0x8f47c6[_0x432e6a(0xd7)][_0x432e6a(0xd8)](',\x20')+']':'';console[_0x432e6a(0x10c)]('\x20\x20'+(_0x2624df+0x1)+'.\x20'+a5_0x5d7a3c['white'](_0x8f47c6[_0x432e6a(0x102)])+'\x20('+_0x8f47c6['rounds'][_0x432e6a(0x116)]+'\x20'+_0x42496e+')'+a5_0x5d7a3c[_0x432e6a(0x91)](_0x4da055));}return 0x0;}let _0x40af81,_0x56a2b1;try{_0x40af81=await _0xb21d83[_0x432e6a(0xbc)][_0x432e6a(0x119)](_0x4e74c9[_0x432e6a(0xf4)]);}catch(_0x1e61ce){const _0x5e5bd1=_0x1e61ce instanceof Error?_0x1e61ce[_0x432e6a(0x99)]:String(_0x1e61ce);return _0x5e5bd1[_0x432e6a(0xde)](_0x432e6a(0x10a))||_0x5e5bd1[_0x432e6a(0xc5)]()[_0x432e6a(0xde)](_0x432e6a(0xda))?console[_0x432e6a(0x10c)](a5_0x5d7a3c[_0x432e6a(0xbf)]('✗\x20ERROR:\x20Project\x20not\x20found:\x20'+_0x4e74c9[_0x432e6a(0xf4)])):console[_0x432e6a(0x10c)](a5_0x5d7a3c['red'](_0x432e6a(0x8e)+_0x4e74c9['projectName']+_0x432e6a(0x10f)+_0x5e5bd1)),0x1;}try{_0x56a2b1=await _0xb21d83['llm']['resolveAgentId'](_0x4e74c9['agentName'],_0x40af81);}catch(_0x227d1e){const _0x9158c5=_0x227d1e instanceof Error?_0x227d1e['message']:String(_0x227d1e);return _0x9158c5[_0x432e6a(0xde)](_0x432e6a(0x10a))||_0x9158c5[_0x432e6a(0xc5)]()['includes'](_0x432e6a(0xda))?console[_0x432e6a(0x10c)](a5_0x5d7a3c[_0x432e6a(0xbf)](_0x432e6a(0xa6)+_0x4e74c9[_0x432e6a(0xba)])):console['log'](a5_0x5d7a3c[_0x432e6a(0xbf)](_0x432e6a(0xec)+_0x4e74c9[_0x432e6a(0xba)]+'\x22:\x20'+_0x9158c5)),0x1;}let _0x5c1da9;if(!_0x27c160)try{_0x5c1da9=await setupEvaluatorAgent(_0xb21d83['llm'],_0x485f8b[_0x432e6a(0xf2)]);}catch(_0x387296){const _0x470107=_0x387296 instanceof Error?_0x387296['message']:String(_0x387296);return console['log'](a5_0x5d7a3c['red'](_0x432e6a(0xcf)+_0x470107)),0x1;}console['log'](a5_0x5d7a3c['cyan'](_0x432e6a(0xa8))),console[_0x432e6a(0x10c)](_0x432e6a(0x106)+a5_0x5d7a3c[_0x432e6a(0xf1)](_0x1c2cc0)),console['log'](_0x432e6a(0xb5)+a5_0x5d7a3c[_0x432e6a(0xf1)](_0x4e74c9[_0x432e6a(0xf4)]+'/'+_0x4e74c9[_0x432e6a(0xba)])),console[_0x432e6a(0x10c)]();const _0x346253=[],_0x472586=[],_0x55ebd8=Date[_0x432e6a(0xa2)]();for(let _0x243fb6=0x0;_0x243fb6<_0x2401f0['length'];_0x243fb6++){const _0x511d98=_0x2401f0[_0x243fb6];_0x2401f0['length']>0x1?console[_0x432e6a(0x10c)](_0x432e6a(0xe5)+(_0x243fb6+0x1)+'/'+_0x2401f0[_0x432e6a(0x116)]+':\x20'+a5_0x5d7a3c[_0x432e6a(0xf1)](_0x511d98['name'])):console[_0x432e6a(0x10c)](_0x432e6a(0xe9)+a5_0x5d7a3c['white'](_0x511d98['name']));const _0x36abf8=createCommandSpinner('Round\x201/'+_0x511d98[_0x432e6a(0xe1)][_0x432e6a(0x116)]+_0x432e6a(0xab));_0x36abf8[_0x432e6a(0x92)]();try{const {result:_0x1f618b,conversation:_0x248a13}=await runTest(_0xb21d83[_0x432e6a(0xbc)],_0x511d98,{'agentId':_0x56a2b1,'projectId':_0x40af81,'site':_0x1c2cc0,'noEval':_0x27c160,'evaluatorId':_0x5c1da9,'onRoundStart':(_0x3a2447,_0xe151bc)=>{const _0x4046d5=_0x432e6a;_0x36abf8[_0x4046d5(0x86)]=_0x4046d5(0x105)+(_0x3a2447+0x1)+'/'+_0xe151bc+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x34163f,_0xe1cd02,_0x14b2a2)=>{const _0xb29fa3=_0x432e6a,_0x2f0d73=formatElapsed(_0xe1cd02);_0x14b2a2?console[_0xb29fa3(0x10c)](_0xb29fa3(0xe4)+(_0x34163f+0x1)+'/'+_0x511d98[_0xb29fa3(0xe1)][_0xb29fa3(0x116)]+_0xb29fa3(0xe6)+a5_0x5d7a3c[_0xb29fa3(0x95)]('✓')+'\x20('+_0x2f0d73+')'):console[_0xb29fa3(0x10c)]('\x20\x20Round\x20'+(_0x34163f+0x1)+'/'+_0x511d98[_0xb29fa3(0xe1)]['length']+'...\x20'+a5_0x5d7a3c['red']('✗'));},'onEvaluationStart':()=>{const _0x15b358=_0x432e6a;_0x36abf8[_0x15b358(0x86)]=_0x15b358(0xa9);},'onEvaluationComplete':_0x3b2acc=>{const _0x2ca145=_0x432e6a,_0x1465df=formatElapsed(_0x3b2acc);console[_0x2ca145(0x10c)](_0x2ca145(0x110)+a5_0x5d7a3c['green']('✓')+'\x20('+_0x1465df+')');}});_0x36abf8[_0x432e6a(0x8b)](),_0x346253['push'](_0x1f618b),_0x472586[_0x432e6a(0x97)](_0x248a13);if(_0x1f618b[_0x432e6a(0x114)]===_0x432e6a(0x10e))console['log'](a5_0x5d7a3c[_0x432e6a(0x95)](_0x432e6a(0x94)+_0x1f618b['reason']));else _0x1f618b[_0x432e6a(0x114)]===_0x432e6a(0xee)?console[_0x432e6a(0x10c)](a5_0x5d7a3c[_0x432e6a(0xbf)](_0x432e6a(0xd2)+_0x1f618b[_0x432e6a(0xc3)])):console[_0x432e6a(0x10c)](a5_0x5d7a3c[_0x432e6a(0xbf)](_0x432e6a(0xfb)+_0x1f618b[_0x432e6a(0xc3)]));_0x1f618b[_0x432e6a(0x104)]&&console['log'](a5_0x5d7a3c[_0x432e6a(0x91)](_0x432e6a(0xb9)+_0x1f618b[_0x432e6a(0x104)])),console['log']();}catch(_0x24cfea){_0x36abf8['stop']();const _0xfcf35d=_0x24cfea instanceof Error?_0x24cfea[_0x432e6a(0x99)]:String(_0x24cfea);console[_0x432e6a(0x10c)](a5_0x5d7a3c['red'](_0x432e6a(0xfb)+_0xfcf35d)),console[_0x432e6a(0x10c)](),_0x346253[_0x432e6a(0x97)]({'name':_0x511d98[_0x432e6a(0x102)],'status':_0x432e6a(0x8d),'reason':_0xfcf35d,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}const _0x2a00e=Date[_0x432e6a(0xa2)]()-_0x55ebd8,_0x321acb=_0x346253[_0x432e6a(0xb4)](_0x4cdd57=>_0x4cdd57[_0x432e6a(0x114)]==='PASS')[_0x432e6a(0x116)],_0x145817=_0x346253[_0x432e6a(0xb4)](_0x5e7792=>_0x5e7792[_0x432e6a(0x114)]===_0x432e6a(0xee))[_0x432e6a(0x116)],_0x7d6831=_0x346253[_0x432e6a(0xb4)](_0x2ac35d=>_0x2ac35d['status']==='ERROR')[_0x432e6a(0x116)];console[_0x432e6a(0x10c)]('━'[_0x432e6a(0x107)](0x3c)),console[_0x432e6a(0x10c)]('Test\x20Summary'),console[_0x432e6a(0x10c)]('━'[_0x432e6a(0x107)](0x3c)),console['log'](_0x432e6a(0xa7)+_0x346253[_0x432e6a(0x116)]),console[_0x432e6a(0x10c)](_0x432e6a(0xbe)+a5_0x5d7a3c[_0x432e6a(0x95)](_0x321acb)),console[_0x432e6a(0x10c)](_0x432e6a(0xca)+a5_0x5d7a3c[_0x432e6a(0xbf)](_0x145817));_0x7d6831>0x0&&console['log'](_0x432e6a(0xe2)+a5_0x5d7a3c[_0x432e6a(0xbf)](_0x7d6831));console['log'](_0x432e6a(0xdf)+formatElapsed(_0x2a00e)),console[_0x432e6a(0x10c)]('━'[_0x432e6a(0x107)](0x3c));const _0x6baec7=_0x346253['filter'](_0x1f0493=>_0x1f0493[_0x432e6a(0x114)]!=='PASS');if(_0x6baec7[_0x432e6a(0x116)]>0x0){console[_0x432e6a(0x10c)](),console[_0x432e6a(0x10c)](_0x432e6a(0xcd));for(const _0x294bac of _0x6baec7){const _0xc2801e=a5_0x5d7a3c[_0x432e6a(0xbf)]('✗'),_0x46e7d2=_0x294bac[_0x432e6a(0xc3)][_0x432e6a(0x116)]>0x32?_0x294bac[_0x432e6a(0xc3)][_0x432e6a(0xb1)](0x0,0x32)+_0x432e6a(0xeb):_0x294bac[_0x432e6a(0xc3)];console[_0x432e6a(0x10c)]('\x20\x20'+_0xc2801e+'\x20'+_0x294bac[_0x432e6a(0x102)]+':\x20'+_0x46e7d2);}}const _0x578e73={'summary':{'total':_0x346253[_0x432e6a(0x116)],'passed':_0x321acb,'failed':_0x145817,'errors':_0x7d6831>0x0?_0x7d6831:undefined,'duration_ms':_0x2a00e},'tests':_0x346253,'agent':{'project':_0x4e74c9[_0x432e6a(0xf4)],'name':_0x4e74c9[_0x432e6a(0xba)],'site':_0x1c2cc0},'timestamp':new Date(_0x55ebd8)['toISOString']()};try{const _0x3a03ea=buildCachedTestRun(_0x472586,{'site':_0x1c2cc0,'projectId':_0x40af81,'projectName':_0x4e74c9[_0x432e6a(0xf4)],'agentId':_0x56a2b1,'agentName':_0x4e74c9[_0x432e6a(0xba)],'testYmlPath':a5_0x28dcdc['resolve'](_0x4e74c9['testYmlPath'])});saveLastTestRun(_0x3a03ea);}catch{}if(_0x19953e!==_0x432e6a(0x96)||_0x1dbfca){const _0x5cd6e0=formatResults(_0x578e73,_0x19953e);if(_0x1dbfca)try{a5_0x29dcd8[_0x432e6a(0x101)](_0x1dbfca,_0x5cd6e0,_0x432e6a(0x9a)),console[_0x432e6a(0x10c)](),console['log'](a5_0x5d7a3c['dim'](_0x432e6a(0xdc)+_0x1dbfca));}catch(_0x22b344){return console[_0x432e6a(0x10c)](),console['log'](a5_0x5d7a3c[_0x432e6a(0xbf)]('Error\x20writing\x20output\x20file:\x20'+_0x22b344)),0x1;}else console['log'](),console['log'](_0x5cd6e0);}return _0x6baec7[_0x432e6a(0x116)]>0x0?0x1:0x0;}async[a5_0x39f585(0xb6)](_0xe10355,_0x20f834){const _0x54e5f6=a5_0x39f585,{options:_0x47b7a0,tdx:_0x42ded1}=_0xe10355,{definition:_0x361162,agentInfo:_0x4d39e8,outputFormat:_0x5ecc42,outputFile:_0x214370}=_0x20f834,_0x3f9755=_0x47b7a0[_0x54e5f6(0xd6)],_0x4e8eb6=loadLastTestRun();if(!_0x4e8eb6)return console[_0x54e5f6(0x10c)](a5_0x5d7a3c[_0x54e5f6(0xbf)](_0x54e5f6(0x98))),console[_0x54e5f6(0x10c)](a5_0x5d7a3c[_0x54e5f6(0x91)]('Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.')),0x1;if(_0x4e8eb6[_0x54e5f6(0xa1)][_0x54e5f6(0xba)]!==_0x4d39e8['agentName'])return console['log'](a5_0x5d7a3c[_0x54e5f6(0xbf)]('Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22'+_0x4e8eb6[_0x54e5f6(0xa1)][_0x54e5f6(0xba)]+_0x54e5f6(0xc7)+_0x4d39e8[_0x54e5f6(0xba)]+'\x22.')),console[_0x54e5f6(0x10c)](a5_0x5d7a3c[_0x54e5f6(0x91)](_0x54e5f6(0xa3))),0x1;const _0x2aad19=new Set(_0x4e8eb6[_0x54e5f6(0xfd)]['map'](_0x37a477=>_0x37a477['testName'])),_0x37fe63=_0x361162[_0x54e5f6(0x117)]['filter'](_0xb80f98=>!_0x2aad19['has'](_0xb80f98[_0x54e5f6(0x102)]));if(_0x37fe63[_0x54e5f6(0x116)]>0x0&&_0x4e8eb6[_0x54e5f6(0xd6)]!==_0x3f9755)return console[_0x54e5f6(0x10c)](a5_0x5d7a3c[_0x54e5f6(0xbf)]('Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.')),console['log'](a5_0x5d7a3c[_0x54e5f6(0x91)](_0x54e5f6(0x111)+_0x4e8eb6['site']+'\x22,\x20but\x20current\x20site\x20is\x20\x22'+_0x3f9755+'\x22.')),console[_0x54e5f6(0x10c)](a5_0x5d7a3c['dim']('Either\x20switch\x20to\x20the\x20\x22'+_0x4e8eb6[_0x54e5f6(0xd6)]+_0x54e5f6(0x100))),0x1;const _0x4e6f5d=_0x361162[_0x54e5f6(0x117)][_0x54e5f6(0xb4)](_0x2af592=>_0x2aad19[_0x54e5f6(0xe3)](_0x2af592[_0x54e5f6(0x102)])),_0x1b6d62=_0x37fe63;let _0x405446;try{_0x405446=await setupEvaluatorAgent(_0x42ded1['llm'],_0x47b7a0[_0x54e5f6(0xf2)]);}catch(_0xe77088){const _0x527f55=_0xe77088 instanceof Error?_0xe77088[_0x54e5f6(0x99)]:String(_0xe77088);return console[_0x54e5f6(0x10c)](a5_0x5d7a3c[_0x54e5f6(0xbf)](_0x54e5f6(0xcf)+_0x527f55)),0x1;}console[_0x54e5f6(0x10c)](a5_0x5d7a3c[_0x54e5f6(0x112)](_0x54e5f6(0x8c))),console[_0x54e5f6(0x10c)](_0x54e5f6(0xae)+a5_0x5d7a3c[_0x54e5f6(0xf1)](_0x4e8eb6[_0x54e5f6(0xb3)])),console[_0x54e5f6(0x10c)](_0x54e5f6(0xb5)+a5_0x5d7a3c[_0x54e5f6(0xf1)](_0x4e8eb6['agent'][_0x54e5f6(0xf4)]+'/'+_0x4e8eb6[_0x54e5f6(0xa1)][_0x54e5f6(0xba)]));_0x1b6d62['length']>0x0&&console[_0x54e5f6(0x10c)](_0x54e5f6(0xc0)+a5_0x5d7a3c['yellow'](_0x1b6d62[_0x54e5f6(0x116)]));console['log']();const _0x34480a=[],_0x45aec6=Date[_0x54e5f6(0xa2)](),_0x1fdbf4=createCommandSpinner(_0x54e5f6(0xcb));if(_0x4e6f5d['length']>0x0)try{const _0x536d6d=await reevaluateFromCache(_0x42ded1['llm'],_0x4e8eb6,{'tests':_0x4e6f5d},{'evaluatorId':_0x405446,'onTestStart':(_0x323206,_0x6e488b,_0x417778)=>{const _0x2414f4=_0x54e5f6;_0x1fdbf4[_0x2414f4(0x86)]=_0x2414f4(0x93)+(_0x6e488b+0x1)+'/'+_0x417778+':\x20'+_0x323206+_0x2414f4(0xeb);if(!_0x1fdbf4[_0x2414f4(0x9d)])_0x1fdbf4['start']();},'onTestComplete':(_0xfbaa24,_0x1cb592)=>{const _0x181866=_0x54e5f6;_0x1fdbf4[_0x181866(0x8b)]();if(_0x1cb592[_0x181866(0x114)]==='PASS')console[_0x181866(0x10c)](a5_0x5d7a3c[_0x181866(0x95)](_0x181866(0x94)+_0xfbaa24)+a5_0x5d7a3c[_0x181866(0x91)]('\x20(cached)'));else _0x1cb592['status']==='FAIL'?console['log'](a5_0x5d7a3c[_0x181866(0xbf)]('✗\x20FAIL:\x20'+_0xfbaa24+_0x181866(0xf9)+_0x1cb592['reason'])+a5_0x5d7a3c[_0x181866(0x91)](_0x181866(0x88))):console[_0x181866(0x10c)](a5_0x5d7a3c[_0x181866(0xbf)]('✗\x20ERROR:\x20'+_0xfbaa24+_0x181866(0xf9)+_0x1cb592['reason']));_0x1cb592['conversation_url']&&console['log'](a5_0x5d7a3c['dim']('\x20\x20Conversation:\x20'+_0x1cb592[_0x181866(0x104)])),_0x34480a[_0x181866(0x97)](_0x1cb592);},'onTestSkipped':(_0x13b6e2,_0x1bf677)=>{const _0x4a853d=_0x54e5f6;_0x1fdbf4[_0x4a853d(0x8b)](),console[_0x4a853d(0x10c)](a5_0x5d7a3c[_0x4a853d(0xb8)](_0x4a853d(0xbd)+_0x13b6e2+_0x4a853d(0xf9)+_0x1bf677));}});for(const _0xabdedd of _0x536d6d){!_0x34480a[_0x54e5f6(0xd5)](_0x4e3c75=>_0x4e3c75[_0x54e5f6(0x102)]===_0xabdedd['name'])&&_0x34480a[_0x54e5f6(0x97)](_0xabdedd);}}catch(_0x36c5e3){_0x1fdbf4[_0x54e5f6(0x8b)]();const _0x250198=_0x36c5e3 instanceof Error?_0x36c5e3['message']:String(_0x36c5e3);return console[_0x54e5f6(0x10c)](a5_0x5d7a3c['red'](_0x54e5f6(0x115)+_0x250198)),0x1;}_0x1fdbf4[_0x54e5f6(0x8b)]();if(_0x1b6d62[_0x54e5f6(0x116)]>0x0){console[_0x54e5f6(0x10c)](),console[_0x54e5f6(0x10c)](a5_0x5d7a3c[_0x54e5f6(0x112)](_0x54e5f6(0x9b)));const {projectId:_0x4c1104,agentId:_0x3793c8}=_0x4e8eb6[_0x54e5f6(0xa1)];for(const _0x5a3741 of _0x1b6d62){console[_0x54e5f6(0x10c)](_0x54e5f6(0x10b)+a5_0x5d7a3c[_0x54e5f6(0xf1)](_0x5a3741[_0x54e5f6(0x102)]));const _0x366782=createCommandSpinner(_0x54e5f6(0xaf)+_0x5a3741['rounds'][_0x54e5f6(0x116)]+_0x54e5f6(0xab));_0x366782[_0x54e5f6(0x92)]();try{const {result:_0x4f3d14}=await runTest(_0x42ded1['llm'],_0x5a3741,{'agentId':_0x3793c8,'projectId':_0x4c1104,'site':_0x4e8eb6['site'],'noEval':![],'evaluatorId':_0x405446,'onRoundStart':(_0x53cd2f,_0x2f411d)=>{const _0x20a5cf=_0x54e5f6;_0x366782['text']=_0x20a5cf(0x105)+(_0x53cd2f+0x1)+'/'+_0x2f411d+_0x20a5cf(0xab);},'onRoundComplete':(_0x5f1239,_0x3aa0b9,_0x33416e)=>{const _0x590004=_0x54e5f6,_0x4a125a=formatElapsed(_0x3aa0b9);_0x33416e?console[_0x590004(0x10c)]('\x20\x20Round\x20'+(_0x5f1239+0x1)+'/'+_0x5a3741[_0x590004(0xe1)][_0x590004(0x116)]+_0x590004(0xe6)+a5_0x5d7a3c[_0x590004(0x95)]('✓')+'\x20('+_0x4a125a+')'):console[_0x590004(0x10c)]('\x20\x20Round\x20'+(_0x5f1239+0x1)+'/'+_0x5a3741[_0x590004(0xe1)]['length']+'...\x20'+a5_0x5d7a3c[_0x590004(0xbf)]('✗'));},'onEvaluationStart':()=>{const _0x49fffd=_0x54e5f6;_0x366782['text']=_0x49fffd(0xa9);},'onEvaluationComplete':_0x37daf8=>{const _0x5604a4=_0x54e5f6,_0x155738=formatElapsed(_0x37daf8);console[_0x5604a4(0x10c)](_0x5604a4(0x110)+a5_0x5d7a3c[_0x5604a4(0x95)]('✓')+'\x20('+_0x155738+')');}});_0x366782[_0x54e5f6(0x8b)](),_0x34480a[_0x54e5f6(0x97)](_0x4f3d14);if(_0x4f3d14[_0x54e5f6(0x114)]===_0x54e5f6(0x10e))console['log'](a5_0x5d7a3c[_0x54e5f6(0x95)](_0x54e5f6(0x94)+_0x4f3d14[_0x54e5f6(0xc3)])+a5_0x5d7a3c[_0x54e5f6(0x91)](_0x54e5f6(0x87)));else _0x4f3d14[_0x54e5f6(0x114)]===_0x54e5f6(0xee)?console[_0x54e5f6(0x10c)](a5_0x5d7a3c[_0x54e5f6(0xbf)](_0x54e5f6(0xd2)+_0x4f3d14[_0x54e5f6(0xc3)])+a5_0x5d7a3c['dim'](_0x54e5f6(0x87))):console[_0x54e5f6(0x10c)](a5_0x5d7a3c['red']('✗\x20ERROR:\x20'+_0x4f3d14[_0x54e5f6(0xc3)]));_0x4f3d14[_0x54e5f6(0x104)]&&console[_0x54e5f6(0x10c)](a5_0x5d7a3c[_0x54e5f6(0x91)](_0x54e5f6(0xd1)+_0x4f3d14['conversation_url']));}catch(_0x3bb71c){_0x366782[_0x54e5f6(0x8b)]();const _0x3d742d=_0x3bb71c instanceof Error?_0x3bb71c[_0x54e5f6(0x99)]:String(_0x3bb71c);console[_0x54e5f6(0x10c)](a5_0x5d7a3c[_0x54e5f6(0xbf)]('✗\x20ERROR:\x20'+_0x3d742d)),_0x34480a['push']({'name':_0x5a3741[_0x54e5f6(0x102)],'status':'ERROR','reason':_0x3d742d,'timestamp':new Date()[_0x54e5f6(0xdb)](),'duration_ms':0x0});}}}console[_0x54e5f6(0x10c)]();const _0x2e502b=Date[_0x54e5f6(0xa2)]()-_0x45aec6,_0x18f28b=_0x34480a[_0x54e5f6(0xb4)](_0x53e1d9=>_0x53e1d9[_0x54e5f6(0x114)]===_0x54e5f6(0x10e))[_0x54e5f6(0x116)],_0xdd4fe=_0x34480a[_0x54e5f6(0xb4)](_0x43e9ab=>_0x43e9ab['status']===_0x54e5f6(0xee))[_0x54e5f6(0x116)],_0x193a9d=_0x34480a[_0x54e5f6(0xb4)](_0x1550d9=>_0x1550d9[_0x54e5f6(0x114)]===_0x54e5f6(0x8d))['length'];console['log']('━'['repeat'](0x3c)),console[_0x54e5f6(0x10c)](_0x54e5f6(0x10d)),console['log']('━'[_0x54e5f6(0x107)](0x3c)),console[_0x54e5f6(0x10c)]('Total:\x20\x20\x20\x20'+_0x34480a[_0x54e5f6(0x116)]),console[_0x54e5f6(0x10c)]('Passed:\x20\x20\x20'+a5_0x5d7a3c[_0x54e5f6(0x95)](_0x18f28b)),console[_0x54e5f6(0x10c)]('Failed:\x20\x20\x20'+a5_0x5d7a3c[_0x54e5f6(0xbf)](_0xdd4fe));_0x193a9d>0x0&&console[_0x54e5f6(0x10c)](_0x54e5f6(0xe2)+a5_0x5d7a3c[_0x54e5f6(0xbf)](_0x193a9d));console['log']('Duration:\x20'+formatElapsed(_0x2e502b)),console[_0x54e5f6(0x10c)]('━'[_0x54e5f6(0x107)](0x3c));const _0x5f4502={'summary':{'total':_0x34480a[_0x54e5f6(0x116)],'passed':_0x18f28b,'failed':_0xdd4fe,'errors':_0x193a9d>0x0?_0x193a9d:undefined,'duration_ms':_0x2e502b},'tests':_0x34480a,'agent':{'project':_0x4d39e8[_0x54e5f6(0xf4)],'name':_0x4d39e8[_0x54e5f6(0xba)],'site':_0x3f9755},'timestamp':new Date(_0x45aec6)['toISOString']()};if(_0x5ecc42!==_0x54e5f6(0x96)||_0x214370){const _0x977541=formatResults(_0x5f4502,_0x5ecc42);if(_0x214370)try{a5_0x29dcd8[_0x54e5f6(0x101)](_0x214370,_0x977541,_0x54e5f6(0x9a)),console[_0x54e5f6(0x10c)](),console[_0x54e5f6(0x10c)](a5_0x5d7a3c[_0x54e5f6(0x91)]('Output\x20written\x20to:\x20'+_0x214370));}catch(_0x5030e3){return console[_0x54e5f6(0x10c)](),console[_0x54e5f6(0x10c)](a5_0x5d7a3c[_0x54e5f6(0xbf)](_0x54e5f6(0xbb)+_0x5030e3)),0x1;}else console[_0x54e5f6(0x10c)](),console[_0x54e5f6(0x10c)](_0x977541);}const _0x4ec5ea=_0x34480a[_0x54e5f6(0xb4)](_0x28e990=>_0x28e990[_0x54e5f6(0x114)]!==_0x54e5f6(0x10e));return _0x4ec5ea['length']>0x0?0x1:0x0;}}
@@ -1 +1 @@
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
+ const a6_0x2d38b5=a6_0x2cea;(function(_0x56ed0f,_0x1b2b7e){const _0xb28efe=a6_0x2cea,_0x4e9305=_0x56ed0f();while(!![]){try{const _0x2cfb0d=parseInt(_0xb28efe(0xdc))/0x1*(parseInt(_0xb28efe(0xcf))/0x2)+-parseInt(_0xb28efe(0xc9))/0x3+-parseInt(_0xb28efe(0xac))/0x4+-parseInt(_0xb28efe(0xce))/0x5*(-parseInt(_0xb28efe(0xa9))/0x6)+parseInt(_0xb28efe(0xca))/0x7+-parseInt(_0xb28efe(0xa4))/0x8+parseInt(_0xb28efe(0xcc))/0x9*(parseInt(_0xb28efe(0xa8))/0xa);if(_0x2cfb0d===_0x1b2b7e)break;else _0x4e9305['push'](_0x4e9305['shift']());}catch(_0x502b7a){_0x4e9305['push'](_0x4e9305['shift']());}}}(a6_0x5ea2,0x54191));import{BaseCommand}from'./command.js';function a6_0x2cea(_0x28b1cc,_0xae8260){_0x28b1cc=_0x28b1cc-0x9d;const _0x5ea26a=a6_0x5ea2();let _0x2cea1c=_0x5ea26a[_0x28b1cc];return _0x2cea1c;}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_0x2d38b5(0xd0),a6_0x2d38b5(0xa3),'cookie',a6_0x2d38b5(0xb5),a6_0x2d38b5(0xb7),a6_0x2d38b5(0xc0),a6_0x2d38b5(0xa0),'x-trino-user']);function a6_0x5ea2(){const _0x31aff6=['header','<\x20HTTP/1.1\x20','join','937390EetNBV','11334jMChiD','PATCH','DELETE','2685816HNRKlh','Error:\x20','entries','includes','verbose','validate','GET','headers','site','set-cookie','status','set-cookie2','trim','name','Invalid\x20header\x20format:\x20\x22','Endpoint\x20must\x20start\x20with\x20/:\x20','\x0aStack\x20trace:\x0a','isArray','file','llm-proxy','x-xsrf-token','error','Results\x20saved\x20to\x20','has','trino','request','log','output','color','1104549nFZGPb','3638278ThNVfz','indexOf','27qjFJjx','length','1630rGazLr','587762EVjkgg','authorization','\x22.\x20','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','workflow','cdp','Invalid\x20API\x20type:\x20','toUpperCase','message','readBodyFromFile','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','POST','method','1YxKfkv','substring','keys','execute','startsWith','x-auth-token','stack','data','proxy-authorization','2612512ICuakR'];a6_0x5ea2=function(){return _0x31aff6;};return a6_0x5ea2();}function isSensitiveHeader(_0x33302e){const _0x289d49=a6_0x2d38b5;return SENSITIVE_HEADERS[_0x289d49(0xc3)](_0x33302e['toLowerCase']());}function parseHeader(_0x2a36dc){const _0x25cd9b=a6_0x2d38b5,_0x5b2780=_0x2a36dc[_0x25cd9b(0xcb)](':');if(_0x5b2780===-0x1)throw new Error(_0x25cd9b(0xba)+_0x2a36dc+_0x25cd9b(0xd1)+_0x25cd9b(0xd9));const _0x17e8d1=_0x2a36dc[_0x25cd9b(0xdd)](0x0,_0x5b2780)[_0x25cd9b(0xb8)](),_0x1cfd44=_0x2a36dc[_0x25cd9b(0xdd)](_0x5b2780+0x1)[_0x25cd9b(0xb8)]();if(!_0x17e8d1)throw new Error('Header\x20key\x20cannot\x20be\x20empty:\x20\x22'+_0x2a36dc+'\x22');return[_0x17e8d1,_0x1cfd44];}export class ApiCommand extends BaseCommand{[a6_0x2d38b5(0xb9)]='api';['description']=a6_0x2d38b5(0xd2);[a6_0x2d38b5(0xb1)](_0x230493){const _0x406a85=a6_0x2d38b5,{args:_0x5a91b9,options:_0x5ded52}=_0x230493,_0x7f0a88=_0x5ded52;if(_0x5a91b9[_0x406a85(0xcd)]===0x0)return'Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list';const _0x319e6e=_0x5a91b9[0x0];if(!_0x319e6e[_0x406a85(0x9f)]('/'))return _0x406a85(0xbb)+_0x319e6e;const _0x37ec2b=_0x7f0a88[_0x406a85(0xa2)],_0x15de6b=_0x7f0a88[_0x406a85(0xbe)];if(_0x37ec2b&&_0x15de6b)return'Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.';const _0x19fc7a=_0x7f0a88[_0x406a85(0xdb)]||'GET',_0x49dcea=[_0x406a85(0xb2),_0x406a85(0xda),'PUT',_0x406a85(0xab),_0x406a85(0xaa)];if(!_0x49dcea['includes'](_0x19fc7a[_0x406a85(0xd6)]()))return'Invalid\x20HTTP\x20method:\x20'+_0x19fc7a+'.\x20Valid\x20methods:\x20'+_0x49dcea[_0x406a85(0xa7)](',\x20');const _0xd4c5f4=_0x7f0a88['type']||'td',_0xd4abae=['td',_0x406a85(0xd4),_0x406a85(0xd3),_0x406a85(0xc4),'llm',_0x406a85(0xbf)];if(!_0xd4abae[_0x406a85(0xaf)](_0xd4c5f4))return _0x406a85(0xd5)+_0xd4c5f4+'.\x20Valid\x20types:\x20'+_0xd4abae[_0x406a85(0xa7)](',\x20');return undefined;}async[a6_0x2d38b5(0x9e)](_0xa4e3ec){const _0x271b45=a6_0x2d38b5,{options:_0x24ca00,args:_0x33c89e,tdx:_0x320953}=_0xa4e3ec,_0x328e62=_0x24ca00,_0xb36278=_0x33c89e[0x0],_0x140843=(_0x328e62[_0x271b45(0xdb)]||_0x271b45(0xb2))[_0x271b45(0xd6)](),_0x39f262=_0x328e62[_0x271b45(0xa2)],_0x4fa02a=_0x328e62['file'],_0x4c24b8=_0x328e62[_0x271b45(0xa5)],_0x118805=_0x328e62['type']||'td';try{const _0x2de8cd={};if(_0x4c24b8){const _0x46e328=Array[_0x271b45(0xbd)](_0x4c24b8)?_0x4c24b8:[_0x4c24b8];for(const _0x57a0db of _0x46e328){const [_0x3db4cb,_0x82e7f]=parseHeader(_0x57a0db);_0x2de8cd[_0x3db4cb]=_0x82e7f;}}let _0x385d50;if(_0x39f262)_0x385d50=_0x39f262;else{if(_0x4fa02a)try{_0x385d50=RawAPI[_0x271b45(0xd8)](_0x4fa02a);}catch(_0x22fd2d){return console[_0x271b45(0xc1)](_0x271b45(0xad)+(_0x22fd2d instanceof Error?_0x22fd2d[_0x271b45(0xd7)]:String(_0x22fd2d))),0x1;}}const _0x3ba0bc={'method':_0x140843,'apiType':_0x118805,'includeHeaders':_0x24ca00[_0x271b45(0xb0)]};_0x385d50&&(_0x3ba0bc['body']=_0x385d50);Object[_0x271b45(0x9d)](_0x2de8cd)[_0x271b45(0xcd)]>0x0&&(_0x3ba0bc[_0x271b45(0xb3)]=_0x2de8cd);if(_0x24ca00[_0x271b45(0xb0)]){const _0xbdeb08=resolveSite(_0x24ca00[_0x271b45(0xb4)]),_0x33084d=getEndpoint(_0xbdeb08,_0x118805),_0x9c0c4=''+_0x33084d+_0xb36278;console[_0x271b45(0xc1)]('>\x20'+_0x140843+'\x20'+_0x9c0c4);const _0x2c1e3f=getAuthHeaders(_0xbdeb08),_0x1e7bff={..._0x2c1e3f,..._0x2de8cd};for(const [_0x900faa,_0x4d9d24]of Object[_0x271b45(0xae)](_0x1e7bff)){!isSensitiveHeader(_0x900faa)&&console[_0x271b45(0xc1)]('>\x20'+_0x900faa+':\x20'+_0x4d9d24);}_0x385d50&&console['error']('>'),console[_0x271b45(0xc1)]('');}const _0x41e926=await _0x320953['api'][_0x271b45(0xc5)](_0xb36278,_0x3ba0bc);if(_0x24ca00[_0x271b45(0xb0)]&&_0x41e926[_0x271b45(0xb3)]){console[_0x271b45(0xc1)](_0x271b45(0xa6)+_0x41e926[_0x271b45(0xb6)]);for(const [_0x3c629a,_0x24665b]of Object['entries'](_0x41e926[_0x271b45(0xb3)])){!isSensitiveHeader(_0x3c629a)&&console['error']('<\x20'+_0x3c629a+':\x20'+_0x24665b);}console[_0x271b45(0xc1)]('');}const _0x433eaa=Boolean(_0x24ca00[_0x271b45(0xc7)]),_0x3dc6ef={'color':_0x24ca00[_0x271b45(0xc8)],'noColor':_0x24ca00['noColor']||_0x433eaa&&!_0x24ca00[_0x271b45(0xc8)]},_0xddad7f=colorizeJSON(_0x41e926['data'],_0x3dc6ef);return _0x24ca00[_0x271b45(0xc7)]?(writeFileSync(_0x24ca00[_0x271b45(0xc7)],_0xddad7f),console[_0x271b45(0xc1)](_0x271b45(0xc2)+_0x24ca00[_0x271b45(0xc7)])):console[_0x271b45(0xc6)](_0xddad7f),0x0;}catch(_0x12c368){return _0x12c368 instanceof Error?(console[_0x271b45(0xc1)](_0x271b45(0xad)+_0x12c368['message']),_0x24ca00['verbose']&&_0x12c368[_0x271b45(0xa1)]&&console[_0x271b45(0xc1)](_0x271b45(0xbc)+_0x12c368[_0x271b45(0xa1)])):console[_0x271b45(0xc1)](_0x271b45(0xad)+String(_0x12c368)),0x1;}}}
@@ -1 +1 @@
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
+ const a7_0x2fb048=a7_0xb4e5;(function(_0x2af309,_0x4f648c){const _0x2d0c7f=a7_0xb4e5,_0x8c57f7=_0x2af309();while(!![]){try{const _0x42b800=-parseInt(_0x2d0c7f(0x1d2))/0x1+parseInt(_0x2d0c7f(0x1d9))/0x2*(parseInt(_0x2d0c7f(0x1cf))/0x3)+parseInt(_0x2d0c7f(0x1ae))/0x4+parseInt(_0x2d0c7f(0x1c9))/0x5*(-parseInt(_0x2d0c7f(0x1cb))/0x6)+-parseInt(_0x2d0c7f(0x1c6))/0x7+parseInt(_0x2d0c7f(0x1b0))/0x8*(parseInt(_0x2d0c7f(0x1af))/0x9)+parseInt(_0x2d0c7f(0x1d7))/0xa*(parseInt(_0x2d0c7f(0x1dc))/0xb);if(_0x42b800===_0x4f648c)break;else _0x8c57f7['push'](_0x8c57f7['shift']());}catch(_0x1ff944){_0x8c57f7['push'](_0x8c57f7['shift']());}}}(a7_0x34fd,0x3841a));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';function a7_0xb4e5(_0x176e05,_0x1814fa){_0x176e05=_0x176e05-0x1a8;const _0x34fd4b=a7_0x34fd();let _0xb4e51d=_0x34fd4b[_0x176e05];return _0xb4e51d;}import{buildSiteChoices}from'../core/constants.js';import a7_0x274e6a 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_0x24dcdf from'chalk';export class AuthSetupCommand extends BaseCommand{['name']=a7_0x2fb048(0x1e0);['description']=a7_0x2fb048(0x1b4);async[a7_0x2fb048(0x1de)](_0x735e4f){const _0x531671=a7_0x2fb048,{options:_0x4eac30}=_0x735e4f,_0x48c8aa=_0x4eac30[_0x531671(0x1dd)];console[_0x531671(0x1ac)](a7_0x24dcdf[_0x531671(0x1ed)]('tdx:\x20auth\x20setup'));const _0x3b8707=_0x4eac30[_0x531671(0x1c7)]||_0x531671(0x1cd),{choices:_0x1743f9,initialIndex:_0x56c558}=buildSiteChoices(_0x3b8707),_0x509bc2=_0x48c8aa?'Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20'+_0x48c8aa+'):':_0x531671(0x1d5),_0x5a7973=await a7_0x274e6a({'type':_0x531671(0x1c1),'name':_0x531671(0x1c7),'message':_0x509bc2,'choices':_0x1743f9,'initial':_0x56c558});if(!_0x5a7973['site'])return console['log'](_0x531671(0x1b1)),0x1;let _0x375bc0;if(_0x5a7973['site']===_0x531671(0x1e9)){const _0x2a3072=await a7_0x274e6a({'type':'text','name':_0x531671(0x1e3),'message':_0x531671(0x1ef),'initial':'us01','validate':_0xe733fb=>{const _0x2aea13=_0x531671;if(!_0xe733fb||!_0xe733fb[_0x2aea13(0x1ba)]())return _0x2aea13(0x1b7);if(!/^[a-z0-9-]+$/[_0x2aea13(0x1d1)](_0xe733fb[_0x2aea13(0x1ba)]()))return _0x2aea13(0x1d4);return!![];}});if(!_0x2a3072[_0x531671(0x1e3)])return console['log'](_0x531671(0x1b1)),0x1;_0x375bc0=_0x2a3072['customSite'];}else _0x375bc0=_0x5a7973[_0x531671(0x1c7)];const _0x538016=resolveSite(_0x375bc0);console[_0x531671(0x1ac)](_0x531671(0x1bb)+_0x538016),console[_0x531671(0x1ac)]('You\x20can\x20find\x20your\x20API\x20key\x20at:'),console[_0x531671(0x1ac)]('\x20\x20'+getConsoleUrl(_0x538016,'/app/mp/ak'));const _0x44f7ec=await a7_0x274e6a({'type':_0x531671(0x1ee),'name':_0x531671(0x1ad),'message':'Enter\x20your\x20TD\x20API\x20key:','validate':_0x1a76e4=>{const _0x2c9fd6=_0x531671;if(!_0x1a76e4||!_0x1a76e4[_0x2c9fd6(0x1ba)]())return'API\x20key\x20cannot\x20be\x20empty';return!![];}});if(!_0x44f7ec[_0x531671(0x1ad)])return console[_0x531671(0x1ac)](_0x531671(0x1b1)),0x1;const _0x47d8c5=_0x44f7ec['apiKey'];console[_0x531671(0x1ac)]('Validating\x20API\x20key...');try{const _0x1718c7=TDX[_0x531671(0x1d0)]({'site':_0x538016,'apiKey':_0x47d8c5['trim'](),'logLevel':_0x4eac30[_0x531671(0x1b8)]??LogLevel[_0x531671(0x1b5)]}),_0x28614c=await _0x1718c7['jobs'][_0x531671(0x1db)]();console[_0x531671(0x1ac)]('✓\x20API\x20key\x20is\x20valid\x20(User:\x20'+_0x28614c[_0x531671(0x1e6)]+')');const _0x54828c=await isKeychainAvailable();_0x54828c?(await saveAPIKeyAsync(_0x47d8c5['trim'](),_0x538016,_0x48c8aa),console[_0x531671(0x1ac)](_0x531671(0x1b9)+(_0x48c8aa?_0x531671(0x1e4)+_0x48c8aa+')':''))):(console['warn'](a7_0x24dcdf[_0x531671(0x1c5)]('⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.')),console[_0x531671(0x1e8)](a7_0x24dcdf[_0x531671(0x1c5)](_0x531671(0x1d6))));if(_0x48c8aa){const _0x2dd20d={'site':_0x538016};saveProfileToUserConfig(_0x48c8aa,_0x2dd20d),console[_0x531671(0x1ac)](_0x531671(0x1cc)+_0x48c8aa+_0x531671(0x1e1));}else saveDefaultSiteToUserConfig(_0x538016),console[_0x531671(0x1ac)](_0x531671(0x1bd)+_0x538016);const _0x4d89c8=_0x48c8aa?_0x531671(0x1bc)+_0x48c8aa:'';return console[_0x531671(0x1ac)](),console[_0x531671(0x1ac)](_0x531671(0x1ca)),console['log']('\x20\x20tdx'+_0x4d89c8+_0x531671(0x1e5)),console[_0x531671(0x1ac)](_0x531671(0x1c3)+_0x4d89c8+_0x531671(0x1ec)),0x0;}catch(_0x3f21b7){if(_0x3f21b7 instanceof HTTPClientError&&_0x3f21b7[_0x531671(0x1aa)]===0x191)return printAuthError(_0x3f21b7),0x1;return console[_0x531671(0x1c4)](a7_0x24dcdf['red'](_0x531671(0x1a9)+(_0x3f21b7 instanceof Error?_0x3f21b7[_0x531671(0x1b3)]:String(_0x3f21b7)))),console[_0x531671(0x1c4)]('API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.'),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x2fb048(0x1be)]=a7_0x2fb048(0x1c0);[a7_0x2fb048(0x1ce)]=a7_0x2fb048(0x1ea);async[a7_0x2fb048(0x1de)](_0x2d80d4){const _0x2108d6=a7_0x2fb048,{options:_0xd53f26,tdx:_0x28811e}=_0x2d80d4,_0x45da3c=_0xd53f26[_0x2108d6(0x1c7)],_0x3e9354=_0xd53f26['profile'],_0x2079f0=_0x3e9354?_0x3e9354:'N/A';console[_0x2108d6(0x1ac)]('tdx\x20profile:\x20'+_0x2079f0+_0x2108d6(0x1d8)+_0x45da3c+')');const _0x9dbd19=await resolveAPIKeyAsync(_0x45da3c,_0x3e9354);if(_0x9dbd19){const {source:_0x5b4eb4,isDeprecated:_0x4e5155}=_0x9dbd19,_0x1c04c6='Read\x20credential\x20from\x20'+_0x5b4eb4;console[_0x2108d6(0x1ac)](_0x4e5155?a7_0x24dcdf[_0x2108d6(0x1c5)](_0x1c04c6):_0x1c04c6);}else console[_0x2108d6(0x1ac)](a7_0x24dcdf[_0x2108d6(0x1c5)](_0x2108d6(0x1df)));try{const _0x5331a8=await _0x28811e['jobs'][_0x2108d6(0x1db)]();return console['log'](a7_0x24dcdf[_0x2108d6(0x1bf)](_0x2108d6(0x1ab))),console[_0x2108d6(0x1ac)](_0x2108d6(0x1a8)+_0x5331a8[_0x2108d6(0x1e6)]),(_0x5331a8[_0x2108d6(0x1b2)]||_0x5331a8[_0x2108d6(0x1da)])&&console[_0x2108d6(0x1ac)](_0x2108d6(0x1f0)+[_0x5331a8['first_name'],_0x5331a8[_0x2108d6(0x1da)]]['filter'](Boolean)[_0x2108d6(0x1c8)]('\x20')),0x0;}catch(_0x368671){return _0x368671 instanceof HTTPClientError&&_0x368671[_0x2108d6(0x1aa)]===0x191?printAuthError(_0x368671,!![],_0x3e9354):console[_0x2108d6(0x1c4)](a7_0x24dcdf['red']('✗\x20Validation\x20failed:\x20'+(_0x368671 instanceof Error?_0x368671[_0x2108d6(0x1b3)]:String(_0x368671)))),0x1;}}}function a7_0x34fd(){const _0x3d3393=['select','✓\x20API\x20key\x20removed\x20from\x20keychain','\x20\x20tdx','error','yellow','400155QPjekT','site','join','2525OZfrii','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','5322QXSAGz','✓\x20Profile\x20\x27','us01','description','3aRGYrZ','create','test','373130sznxNU','auth:clear','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','Select\x20your\x20Treasure\x20Data\x20site:','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','6577530ahZibO','\x20(site:\x20','234986GaCZBZ','last_name','getUserInfo','11NhxARU','profile','execute','No\x20credential\x20found','auth:setup','\x27\x20registered','\x20for\x20profile:\x20','customSite','\x20(profile:\x20','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','email','Remove\x20API\x20key\x20from\x20system\x20keychain','warn','other','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','tdx:\x20auth\x20clear','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','bold','password','Enter\x20site\x20name:','Name:\x20','User:\x20','✗\x20Validation\x20failed:\x20','status','✓\x20Authentication\x20successful\x0a','log','apiKey','1325324QpkXrK','9TDlcFi','16632zsAifJ','\x0aSetup\x20cancelled','first_name','message','Setup\x20API\x20key\x20authentication\x20interactively','ERROR','No\x20API\x20key\x20found\x20in\x20keychain','Site\x20name\x20cannot\x20be\x20empty','logLevel','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','trim','Setting\x20up\x20authentication\x20for\x20site:\x20','\x20--profile\x20','✓\x20Default\x20site\x20set\x20to\x20','name','green','auth'];a7_0x34fd=function(){return _0x3d3393;};return a7_0x34fd();}export class AuthClearCommand extends BaseCommand{[a7_0x2fb048(0x1be)]=a7_0x2fb048(0x1d3);[a7_0x2fb048(0x1ce)]=a7_0x2fb048(0x1e7);async['execute'](_0x33b378){const _0x524548=a7_0x2fb048,{options:_0x13cd7f}=_0x33b378,_0x4c67c9=_0x13cd7f[_0x524548(0x1dd)];console[_0x524548(0x1ac)](a7_0x24dcdf[_0x524548(0x1ed)](_0x524548(0x1eb)));const _0x86e0e1=await isKeychainAvailable();if(!_0x86e0e1)return console[_0x524548(0x1c4)](a7_0x24dcdf['red']('System\x20keychain\x20is\x20not\x20available')),0x1;const _0x2c3dd4=await deleteKeychainAPIKey(_0x4c67c9);return _0x2c3dd4?(clearCredentialCache(),console[_0x524548(0x1ac)](_0x524548(0x1c2)+(_0x4c67c9?_0x524548(0x1e4)+_0x4c67c9+')':'')),0x0):(console['log'](_0x524548(0x1b6)+(_0x4c67c9?_0x524548(0x1e2)+_0x4c67c9:'')),0x1);}}
@@ -1 +1 @@
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;}}}
1
+ const a8_0x2b89eb=a8_0x50aa;(function(_0x144193,_0x46f179){const _0x2cb4c8=a8_0x50aa,_0x4451cc=_0x144193();while(!![]){try{const _0x2ef97e=-parseInt(_0x2cb4c8(0x208))/0x1+parseInt(_0x2cb4c8(0x1f8))/0x2*(-parseInt(_0x2cb4c8(0x1c9))/0x3)+-parseInt(_0x2cb4c8(0x1d9))/0x4+parseInt(_0x2cb4c8(0x1fa))/0x5*(parseInt(_0x2cb4c8(0x1fb))/0x6)+parseInt(_0x2cb4c8(0x1e7))/0x7+-parseInt(_0x2cb4c8(0x204))/0x8+parseInt(_0x2cb4c8(0x1ef))/0x9;if(_0x2ef97e===_0x46f179)break;else _0x4451cc['push'](_0x4451cc['shift']());}catch(_0x2e77c7){_0x4451cc['push'](_0x4451cc['shift']());}}}(a8_0x2672,0x9f0b2));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{withSpinner}from'../utils/spinner.js';function a8_0x2672(){const _0x169cda=['stream','Continuing\x20chat:\x20','Using\x20cached\x20default\x20agent:\x20','args','chatId','name','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','2284272kqEaQw','CHAT_NOT_FOUND','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','streamChatJsonl','execute','Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','tool_result','metadata','\x27\x20not\x20found','streamChat','done','404','description','3326463rvhpZC','site','stdout','\x20\x20Cause:\x20','Error:\x20Chat\x20session\x20\x27','agent','verbose','type','21329973itBXNN','content','join','getDefaultAgent','data','llmProject','cause','stack','stringify','1608twDLcq','Resolving\x20project\x20\x27','245rXoktR','117498ZfKnbQ','Create\x20a\x20new\x20chat\x20session','functionName','session\x20context','claude-4.5-haiku','message','\x0aError:\x20','No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22','handleChatEvent','9705184mfQrZD','projectId','slice','new','77087EenjGE','\x0aStack\x20trace:','Chat\x20session:\x20','tool','agentId','tool_call','includes','error','targetAgent','validate','code','getOrCreateDefaultAgent','log','Using\x20agent\x20from\x20','4821ZWUcCg','Getting\x20default\x20agent...','context','chat','llmAgent','llm','\x27...','string','targetFunction'];a8_0x2672=function(){return _0x169cda;};return a8_0x2672();}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(_0x2d6780,_0x43745e){const _0x85f8d8=a8_0x50aa;if(_0x2d6780 instanceof SDKError)console[_0x85f8d8(0x1c2)]('Error:\x20'+_0x2d6780[_0x85f8d8(0x200)]),_0x43745e[_0x85f8d8(0x1ed)]&&(_0x2d6780['cause']&&console[_0x85f8d8(0x1c2)](_0x85f8d8(0x1ea)+_0x2d6780[_0x85f8d8(0x1f5)]),_0x2d6780[_0x85f8d8(0x1f6)]&&(console[_0x85f8d8(0x1c2)](_0x85f8d8(0x209)),console[_0x85f8d8(0x1c2)](_0x2d6780['stack'])));else throw _0x2d6780;}function a8_0x50aa(_0x1ee84e,_0x2bc31b){_0x1ee84e=_0x1ee84e-0x1c1;const _0x2672dd=a8_0x2672();let _0x50aa20=_0x2672dd[_0x1ee84e];return _0x50aa20;}async function resolveAgentId(_0x363253,_0x5870e1,_0xb3eaa6,_0x1a00e2,_0x4e27ca){const _0x5449fc=a8_0x50aa,_0x45747d=_0x5870e1||_0xb3eaa6;if(_0x45747d){const {projectName:_0x25853c,agentName:_0x941d1f}=parseAgentRef(_0x45747d),_0xc93ea=_0x941d1f||_0x45747d,_0x4ba3d0=_0x941d1f?_0x25853c:_0x1a00e2;if(!_0x4ba3d0)throw new Error(_0x5449fc(0x202));if(_0x4e27ca){const _0x21c52e=_0x5870e1?'--agent\x20flag':_0x5449fc(0x1fe);console[_0x5449fc(0x1c2)](_0x5449fc(0x1c8)+_0x21c52e+':\x20'+_0x4ba3d0+'/'+_0xc93ea);}const _0x1bc55f=await withSpinner(_0x5449fc(0x1f9)+_0x4ba3d0+_0x5449fc(0x1cf),()=>_0x363253['llm']['resolveProjectId'](_0x4ba3d0),{'verbose':_0x4e27ca}),_0x11a5ac=await withSpinner('Resolving\x20agent\x20\x27'+_0xc93ea+'\x27...',()=>_0x363253[_0x5449fc(0x1ce)]['resolveAgentId'](_0xc93ea,_0x1bc55f[_0x5449fc(0x1f3)]),{'verbose':_0x4e27ca});return _0x11a5ac[_0x5449fc(0x1f3)];}else{const _0xbb532d=_0x363253[_0x5449fc(0x1ce)][_0x5449fc(0x1f2)]();if(_0xbb532d)return _0x4e27ca&&console[_0x5449fc(0x1c2)](_0x5449fc(0x1d4)+_0xbb532d[_0x5449fc(0x1d7)]),_0xbb532d['id'];const _0x350776=await withSpinner(_0x5449fc(0x1ca),()=>_0x363253[_0x5449fc(0x1ce)][_0x5449fc(0x1c6)](_0x5449fc(0x1ff),0x0),{'verbose':_0x4e27ca});return _0x350776[_0x5449fc(0x1f3)]['id'];}}export class ChatCommand extends BaseCommand{[a8_0x2b89eb(0x1d7)]=a8_0x2b89eb(0x1cc);[a8_0x2b89eb(0x1e6)]=a8_0x2b89eb(0x1d8);[a8_0x2b89eb(0x1c4)](_0x29f2f0){const _0x1372b7=a8_0x2b89eb,_0x598066=_0x29f2f0[_0x1372b7(0x1d5)][_0x1372b7(0x1f1)]('\x20');if(!_0x598066)return _0x1372b7(0x1df);return undefined;}async[a8_0x2b89eb(0x1e3)](_0x2c6e74,_0x5152f3,_0x4c3a7d,_0x204fbf,_0x524081){const _0x2e3c11=a8_0x2b89eb;for await(const _0x31c44f of _0x2c6e74['llm'][_0x2e3c11(0x1cc)](_0x5152f3,{'agentId':_0x4c3a7d,'chatId':_0x204fbf})){if(_0x31c44f[_0x2e3c11(0x1ee)]===_0x2e3c11(0x1e1)){const _0x108bf8=_0x31c44f[_0x2e3c11(0x1f3)][_0x2e3c11(0x1d6)];saveLastChatId(_0x108bf8),_0x524081&&console[_0x2e3c11(0x1c2)](_0x2e3c11(0x20a)+_0x108bf8);}else _0x31c44f[_0x2e3c11(0x1ee)]==='event'&&this['handleChatEvent'](_0x31c44f[_0x2e3c11(0x1f3)]);}}async[a8_0x2b89eb(0x1dc)](_0x4710c1,_0x5bf79a,_0x21d3c9,_0x53a910){const _0x4a1704=a8_0x2b89eb,_0x2b137c=_0x4710c1[_0x4a1704(0x1cb)][_0x4a1704(0x1e8)];let _0x246147=![];for await(const _0x231762 of _0x4710c1['llm']['chat'](_0x5bf79a,{'agentId':_0x21d3c9,'chatId':_0x53a910})){if(_0x231762[_0x4a1704(0x1ee)]===_0x4a1704(0x1e1)){const _0x358f00=_0x231762[_0x4a1704(0x1f3)];saveLastChatId(_0x358f00['chatId']);const _0x42dd1d=_0x358f00[_0x4a1704(0x205)]&&_0x358f00[_0x4a1704(0x20c)]?getLLMConversationUrl(_0x2b137c,_0x358f00[_0x4a1704(0x205)],_0x358f00['agentId'],_0x358f00[_0x4a1704(0x1d6)]):undefined;console['log'](JSON[_0x4a1704(0x1f7)]({'type':'metadata','data':{'chatId':_0x358f00['chatId'],'agentId':_0x358f00[_0x4a1704(0x20c)],'consoleUrl':_0x42dd1d}})),_0x246147=!![];}else{if(_0x231762[_0x4a1704(0x1ee)]==='event'){!_0x246147&&_0x53a910&&(console[_0x4a1704(0x1c7)](JSON[_0x4a1704(0x1f7)]({'type':_0x4a1704(0x1e1),'data':{'chatId':_0x53a910}})),_0x246147=!![]);const _0x5d38c9=_0x231762[_0x4a1704(0x1f3)];if(_0x4a1704(0x1f0)in _0x5d38c9)console[_0x4a1704(0x1c7)](JSON[_0x4a1704(0x1f7)]({'type':_0x4a1704(0x1f0),'data':{'content':_0x5d38c9['content']}}));else{if(_0x4a1704(0x20d)in _0x5d38c9){const _0x282e14=_0x5d38c9['tool_call'];console[_0x4a1704(0x1c7)](JSON[_0x4a1704(0x1f7)]({'type':_0x4a1704(0x20d),'data':{'id':_0x282e14['id'],'name':_0x282e14[_0x4a1704(0x1fd)],'target':_0x282e14['targetKnowledgeBase']?.[_0x4a1704(0x1d7)]||_0x282e14[_0x4a1704(0x1c3)]?.[_0x4a1704(0x1d7)]||_0x282e14['targetWebSearchTool']?.['name']||_0x282e14[_0x4a1704(0x1d1)]}}));}else{if(_0x4a1704(0x20b)in _0x5d38c9)console['log'](JSON[_0x4a1704(0x1f7)]({'type':_0x4a1704(0x1e0),'data':{'id':_0x5d38c9[_0x4a1704(0x20b)]['id'],'name':_0x5d38c9['tool'][_0x4a1704(0x1fd)],'result':typeof _0x5d38c9[_0x4a1704(0x20b)]['content']===_0x4a1704(0x1d0)?_0x5d38c9[_0x4a1704(0x20b)]['content'][_0x4a1704(0x206)](0x0,0x1f4):''}}));else _0x4a1704(0x1c2)in _0x5d38c9&&console[_0x4a1704(0x1c7)](JSON[_0x4a1704(0x1f7)]({'type':_0x4a1704(0x1c2),'data':{'error':_0x5d38c9['error']}}));}}}}}console[_0x4a1704(0x1c7)](JSON[_0x4a1704(0x1f7)]({'type':_0x4a1704(0x1e4)}));}async[a8_0x2b89eb(0x1dd)](_0x518703){const _0x1b04ce=a8_0x2b89eb,{options:_0x33caa7,args:_0x34a592,tdx:_0x33f20a}=_0x518703,_0x383bc6=_0x34a592['join']('\x20'),_0x30779f=_0x33caa7,_0x432992=_0x30779f['agent'],_0x4d5da3=_0x30779f[_0x1b04ce(0x1cd)],_0x17a369=_0x30779f[_0x1b04ce(0x1f4)],_0xffe06b=_0x30779f[_0x1b04ce(0x207)],_0xc34c44=_0x30779f[_0x1b04ce(0x1d6)],_0x1af795=_0x30779f[_0x1b04ce(0x1d2)];if(_0xffe06b&&_0xc34c44)return console['error']('Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together'),0x1;try{let _0x2a4508,_0x4a07bc;if(_0xc34c44)_0x4a07bc=_0xc34c44;else!_0xffe06b&&(_0x4a07bc=loadLastChatId(),_0x4a07bc&&_0x33caa7[_0x1b04ce(0x1ed)]&&console[_0x1b04ce(0x1c2)](_0x1b04ce(0x1d3)+_0x4a07bc));!_0xc34c44&&(_0xffe06b||!_0x4a07bc)&&(_0x2a4508=await resolveAgentId(_0x33f20a,_0x432992,_0x4d5da3,_0x17a369,_0x33caa7[_0x1b04ce(0x1ed)]));const _0x456c05=_0x1af795?(_0x190cb8,_0x460f26,_0x502483)=>this[_0x1b04ce(0x1dc)](_0x33f20a,_0x190cb8,_0x460f26,_0x502483):(_0x3964c9,_0x200c9b,_0x38caf9)=>this[_0x1b04ce(0x1e3)](_0x33f20a,_0x3964c9,_0x200c9b,_0x38caf9,_0x33caa7['verbose']);try{await _0x456c05(_0x383bc6,_0x2a4508,_0x4a07bc);}catch(_0x374e05){const _0x3a5b9b=_0x374e05 instanceof SDKError&&_0x374e05[_0x1b04ce(0x1c5)]===ErrorCode[_0x1b04ce(0x1da)]||_0x374e05 instanceof Error&&_0x374e05[_0x1b04ce(0x200)][_0x1b04ce(0x1c1)](_0x1b04ce(0x1e5));if(_0x3a5b9b&&_0xc34c44)return console['error'](_0x1b04ce(0x1eb)+_0xc34c44+_0x1b04ce(0x1e2)),0x1;if(_0x3a5b9b)_0x33caa7[_0x1b04ce(0x1ed)]&&console['error'](_0x1b04ce(0x1db)),!_0x2a4508&&(_0x2a4508=await resolveAgentId(_0x33f20a,_0x432992,_0x4d5da3,_0x17a369,_0x33caa7[_0x1b04ce(0x1ed)])),await _0x456c05(_0x383bc6,_0x2a4508,undefined);else throw _0x374e05;}return!_0x1af795&&console[_0x1b04ce(0x1c7)](),0x0;}catch(_0x17e8f8){return console[_0x1b04ce(0x1c2)](),handleSDKError(_0x17e8f8,_0x33caa7),0x1;}}[a8_0x2b89eb(0x203)](_0x11f590){const _0x31f850=a8_0x2b89eb;if('content'in _0x11f590)process[_0x31f850(0x1e9)]['write'](_0x11f590[_0x31f850(0x1f0)]);else'error'in _0x11f590&&console[_0x31f850(0x1c2)](_0x31f850(0x201)+_0x11f590[_0x31f850(0x1c2)]);}}export class ChatCreateCommand extends BaseCommand{[a8_0x2b89eb(0x1d7)]='chat-create';[a8_0x2b89eb(0x1e6)]=a8_0x2b89eb(0x1fc);[a8_0x2b89eb(0x1c4)](_0x573200){const _0x303065=a8_0x2b89eb,_0x571067=_0x573200['options'],_0x11e2bd=_0x571067[_0x303065(0x1ec)],_0x143ac4=_0x571067[_0x303065(0x1cd)];if(!_0x11e2bd&&!_0x143ac4)return _0x303065(0x1de);return undefined;}async[a8_0x2b89eb(0x1dd)](_0x5a21a2){const _0x33c040=a8_0x2b89eb,{options:_0x4d6155,tdx:_0x2fb101}=_0x5a21a2,_0x5d9fa7=_0x4d6155,_0x33baab=_0x5d9fa7['agent'],_0x49d819=_0x5d9fa7[_0x33c040(0x1cd)],_0x27bc2b=_0x5d9fa7[_0x33c040(0x1f4)];try{const _0x10e3e3=await resolveAgentId(_0x2fb101,_0x33baab,_0x49d819,_0x27bc2b,_0x4d6155[_0x33c040(0x1ed)]),_0x4bbe83=await _0x2fb101[_0x33c040(0x1ce)]['startChat'](_0x10e3e3);return saveLastChatId(_0x4bbe83['id']),console[_0x33c040(0x1c7)](JSON[_0x33c040(0x1f7)]({'chatId':_0x4bbe83['id'],'agentId':_0x10e3e3})),0x0;}catch(_0x139234){return handleSDKError(_0x139234,_0x4d6155),0x1;}}}