@treasuredata/tdx 2026.3.4 → 2026.3.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 (197) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/chat-command.js +1 -1
  11. package/dist/commands/claude-command.js +1 -1
  12. package/dist/commands/claude-statusline-command.js +1 -1
  13. package/dist/commands/claude-usage-command.js +1 -1
  14. package/dist/commands/command.js +1 -1
  15. package/dist/commands/connection-command.js +1 -1
  16. package/dist/commands/databases.js +1 -1
  17. package/dist/commands/delivery-command.js +1 -1
  18. package/dist/commands/describe.js +1 -1
  19. package/dist/commands/engage-campaign-pull-command.js +1 -1
  20. package/dist/commands/engage-campaign-push-command.js +1 -1
  21. package/dist/commands/engage-campaign-validate-command.js +1 -1
  22. package/dist/commands/engage-command.js +1 -1
  23. package/dist/commands/engage-template-pull-command.js +1 -1
  24. package/dist/commands/engage-template-push-command.js +1 -1
  25. package/dist/commands/engage-template-validate-command.js +1 -1
  26. package/dist/commands/job-command.js +1 -1
  27. package/dist/commands/journey-command.js +1 -1
  28. package/dist/commands/journey-validate-command.js +1 -1
  29. package/dist/commands/llm-command.js +1 -1
  30. package/dist/commands/mcp-command.js +1 -1
  31. package/dist/commands/parent-segment-command.js +1 -1
  32. package/dist/commands/profile-command.js +1 -1
  33. package/dist/commands/profiles-command.js +1 -1
  34. package/dist/commands/query-command.js +1 -1
  35. package/dist/commands/schedule-command.js +1 -1
  36. package/dist/commands/segment-command.js +1 -1
  37. package/dist/commands/segment-create-command.js +1 -1
  38. package/dist/commands/segment-fields-command.js +1 -1
  39. package/dist/commands/segment-pull-command.js +1 -1
  40. package/dist/commands/segment-push-command.js +1 -1
  41. package/dist/commands/segment-update-command.js +1 -1
  42. package/dist/commands/segment-use-command.js +1 -1
  43. package/dist/commands/segment-validate-command.js +1 -1
  44. package/dist/commands/segments.js +1 -1
  45. package/dist/commands/show.js +1 -1
  46. package/dist/commands/status-command.js +1 -1
  47. package/dist/commands/tables.js +1 -1
  48. package/dist/commands/unset-command.js +1 -1
  49. package/dist/commands/upgrade-command.js +1 -1
  50. package/dist/commands/use-command.js +1 -1
  51. package/dist/commands/user-command.js +1 -1
  52. package/dist/commands/workflow-command.js +1 -1
  53. package/dist/core/auth.js +1 -1
  54. package/dist/core/command-output.js +1 -1
  55. package/dist/core/config.js +1 -1
  56. package/dist/core/connection-cache.js +1 -1
  57. package/dist/core/constants.js +1 -1
  58. package/dist/core/credential-cache.js +1 -1
  59. package/dist/core/global-context.js +1 -1
  60. package/dist/core/keychain.js +1 -1
  61. package/dist/core/profile.js +1 -1
  62. package/dist/core/project-config.js +1 -1
  63. package/dist/core/session.js +1 -1
  64. package/dist/core/user-cache.js +1 -1
  65. package/dist/core/version.js +1 -1
  66. package/dist/index.js +1 -1
  67. package/dist/mcp/server.js +1 -1
  68. package/dist/mcp/tools/index.js +1 -1
  69. package/dist/mcp/tools/tdx-run.js +1 -1
  70. package/dist/mcp/tools/tdx-search.js +1 -1
  71. package/dist/mcp/utils.js +1 -1
  72. package/dist/proxy/claude-usage-tracker.js +1 -1
  73. package/dist/proxy/passthrough-server.js +1 -1
  74. package/dist/proxy/sse-usage-parser.js +1 -1
  75. package/dist/sdk/agent/agent-config.js +1 -1
  76. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  77. package/dist/sdk/agent/agent-yaml.js +1 -1
  78. package/dist/sdk/agent/test/evaluator.js +1 -1
  79. package/dist/sdk/agent/test/executor.js +1 -1
  80. package/dist/sdk/agent/test/index.js +1 -1
  81. package/dist/sdk/agent/test/output.js +1 -1
  82. package/dist/sdk/agent/test/parser.js +1 -1
  83. package/dist/sdk/agent/tool-target-registry.js +1 -1
  84. package/dist/sdk/api.js +1 -1
  85. package/dist/sdk/client/cdp-api-client.js +1 -1
  86. package/dist/sdk/client/delivery-api-client.js +1 -1
  87. package/dist/sdk/client/endpoints.js +1 -1
  88. package/dist/sdk/client/engage-api-client.js +1 -1
  89. package/dist/sdk/client/http-client.js +1 -1
  90. package/dist/sdk/client/llm-api-client.js +1 -1
  91. package/dist/sdk/client/rate-limiter.js +1 -1
  92. package/dist/sdk/client/td-api-client.js +1 -1
  93. package/dist/sdk/client/trino-api-client.js +1 -1
  94. package/dist/sdk/client/workflow-client.js +1 -1
  95. package/dist/sdk/connection-validator.js +1 -1
  96. package/dist/sdk/connection.js +1 -1
  97. package/dist/sdk/delivery.js +1 -1
  98. package/dist/sdk/engage/campaign-pull.js +1 -1
  99. package/dist/sdk/engage/campaign-push.js +1 -1
  100. package/dist/sdk/engage/campaign-validator.js +1 -1
  101. package/dist/sdk/engage/campaign-yaml.js +1 -1
  102. package/dist/sdk/engage/template-pull.js +1 -1
  103. package/dist/sdk/engage/template-push.js +1 -1
  104. package/dist/sdk/engage/template-validator.js +1 -1
  105. package/dist/sdk/engage/template-yaml.js +1 -1
  106. package/dist/sdk/engage/types/campaign-def.js +1 -1
  107. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  108. package/dist/sdk/engage/types/template-schema.js +1 -1
  109. package/dist/sdk/engage.js +1 -1
  110. package/dist/sdk/errors.js +1 -1
  111. package/dist/sdk/index.js +1 -1
  112. package/dist/sdk/io/index.js +1 -1
  113. package/dist/sdk/io/node-filesystem.js +1 -1
  114. package/dist/sdk/job.js +1 -1
  115. package/dist/sdk/journey.js +1 -1
  116. package/dist/sdk/llm/chat-cache.js +1 -1
  117. package/dist/sdk/llm/index.js +1 -1
  118. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  119. package/dist/sdk/llm/model-factors.js +1 -1
  120. package/dist/sdk/personalization.js +1 -1
  121. package/dist/sdk/query/index.js +1 -1
  122. package/dist/sdk/query/sql-parser.js +1 -1
  123. package/dist/sdk/realtime.js +1 -1
  124. package/dist/sdk/schedule.js +1 -1
  125. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  126. package/dist/sdk/segment/fields-display.js +1 -1
  127. package/dist/sdk/segment/file-discovery.js +1 -1
  128. package/dist/sdk/segment/journey-utils.js +1 -1
  129. package/dist/sdk/segment/journey-validator.js +1 -1
  130. package/dist/sdk/segment/journey-yaml.js +1 -1
  131. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  132. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  133. package/dist/sdk/segment/pull-workflow.js +1 -1
  134. package/dist/sdk/segment/push-recovery.js +1 -1
  135. package/dist/sdk/segment/push-workflow.js +1 -1
  136. package/dist/sdk/segment/resolution-context.js +1 -1
  137. package/dist/sdk/segment/segment-path-parser.js +1 -1
  138. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  139. package/dist/sdk/segment/segment-validator.js +1 -1
  140. package/dist/sdk/segment/target-resolution.js +1 -1
  141. package/dist/sdk/segment/tdx-config.js +1 -1
  142. package/dist/sdk/segment/types/activation-schema.js +1 -1
  143. package/dist/sdk/segment/types/journey-def.js +1 -1
  144. package/dist/sdk/segment/types/journey-schema.js +1 -1
  145. package/dist/sdk/segment/types/segment-def.js +1 -1
  146. package/dist/sdk/segment/types/segment-schema.js +1 -1
  147. package/dist/sdk/segment/validate-files.js +1 -1
  148. package/dist/sdk/segment/yaml-validator.js +1 -1
  149. package/dist/sdk/segment.js +1 -1
  150. package/dist/sdk/types/index.js +1 -1
  151. package/dist/sdk/types/progress.js +1 -1
  152. package/dist/sdk/user.js +1 -1
  153. package/dist/sdk/util/format-detector.js +1 -1
  154. package/dist/sdk/util/formatters.js +1 -1
  155. package/dist/sdk/util/index.js +1 -1
  156. package/dist/sdk/util/paginate.js +1 -1
  157. package/dist/sdk/util/tree-formatter.js +1 -1
  158. package/dist/sdk/workflow/archive-validation.js +1 -1
  159. package/dist/sdk/workflow/clone-workflow.js +1 -1
  160. package/dist/sdk/workflow/index.js +1 -1
  161. package/dist/sdk/workflow/pull-workflow.js +1 -1
  162. package/dist/sdk/workflow/push-workflow.js +1 -1
  163. package/dist/sdk/workflow/tdx-config.js +1 -1
  164. package/dist/sdk/workflow/workflow-utils.js +1 -1
  165. package/dist/test-utils/command-runner.js +1 -1
  166. package/dist/test-utils/factories.js +1 -1
  167. package/dist/test-utils/fixtures.js +1 -1
  168. package/dist/test-utils/http-mock.js +1 -1
  169. package/dist/test-utils/index.js +1 -1
  170. package/dist/utils/async.js +1 -1
  171. package/dist/utils/colors.js +1 -1
  172. package/dist/utils/diff.js +1 -1
  173. package/dist/utils/file-permissions.js +1 -1
  174. package/dist/utils/file-reader.js +1 -1
  175. package/dist/utils/github-releases.js +1 -1
  176. package/dist/utils/global-cache.js +1 -1
  177. package/dist/utils/json-loader.js +1 -1
  178. package/dist/utils/local-cache.js +1 -1
  179. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  180. package/dist/utils/logger/formatters/index.js +1 -1
  181. package/dist/utils/logger/handlers/console-handler.js +1 -1
  182. package/dist/utils/logger/handlers/file-handler.js +1 -1
  183. package/dist/utils/logger/handlers/index.js +1 -1
  184. package/dist/utils/logger/handlers/null-handler.js +1 -1
  185. package/dist/utils/logger/index.js +1 -1
  186. package/dist/utils/logger/logger.js +1 -1
  187. package/dist/utils/logger/types.js +1 -1
  188. package/dist/utils/option-validation.js +1 -1
  189. package/dist/utils/process.js +1 -1
  190. package/dist/utils/prompt.js +1 -1
  191. package/dist/utils/spinner.js +1 -1
  192. package/dist/utils/sse-parser.js +1 -1
  193. package/dist/utils/string-utils.js +1 -1
  194. package/dist/utils/table-ref-parser.js +1 -1
  195. package/dist/utils/tdx-logger.js +1 -1
  196. package/dist/utils/version-check.js +1 -1
  197. package/package.json +1 -1
@@ -1 +1 @@
1
- const a3_0x2b96f3=a3_0x1159;(function(_0x1f3d58,_0x1d3005){const _0x15926e=a3_0x1159,_0xd3f17e=_0x1f3d58();while(!![]){try{const _0xbf04c4=parseInt(_0x15926e(0x112))/0x1*(parseInt(_0x15926e(0x10a))/0x2)+-parseInt(_0x15926e(0x117))/0x3*(-parseInt(_0x15926e(0x11e))/0x4)+-parseInt(_0x15926e(0x11b))/0x5+parseInt(_0x15926e(0x11c))/0x6+-parseInt(_0x15926e(0x120))/0x7*(-parseInt(_0x15926e(0x116))/0x8)+-parseInt(_0x15926e(0x115))/0x9+parseInt(_0x15926e(0x11a))/0xa;if(_0xbf04c4===_0x1d3005)break;else _0xd3f17e['push'](_0xd3f17e['shift']());}catch(_0x51915e){_0xd3f17e['push'](_0xd3f17e['shift']());}}}(a3_0x1e5b,0x50191));function a3_0x1e5b(){const _0x190a86=['4470903sxraTo','19160VmcYPz','1054209ocpbdU','site','resolveParentId','2654470eEojIZ','745445IjdhQe','337722wbsTMX','Child\x20name:\x20','4VGjhqN','name','630fCSrUB','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','segment','\x27...','listActivations','verbose','error','✔\x20Found\x20','Listing\x20activations\x20for\x20segment\x20\x27','data','\x20\x20Cause:\x20','6820MLPKDj','Error:\x20','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','List\x20activations\x20for\x20a\x20segment','Resolved\x20parent\x20ID:\x20','\x20activation','Parent\x20name:\x20','cause','25KPEnKs','Site:\x20','length'];a3_0x1e5b=function(){return _0x190a86;};return a3_0x1e5b();}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_0x1159(_0x2fb7a7,_0x5ae43d){_0x2fb7a7=_0x2fb7a7-0x10a;const _0x1e5b5a=a3_0x1e5b();let _0x115931=_0x1e5b5a[_0x2fb7a7];return _0x115931;}export class ActivationsCommand extends BaseCommand{[a3_0x2b96f3(0x11f)]='activations';['description']=a3_0x2b96f3(0x10d);async['execute'](_0x13fe1c){const _0x5bc649=a3_0x2b96f3,{options:_0x25dc62,args:_0x11c056,tdx:_0x2c7623}=_0x13fe1c;if(_0x11c056[_0x5bc649(0x114)]===0x0)return console[_0x5bc649(0x126)]('Error:\x20Segment\x20name\x20is\x20required'),console[_0x5bc649(0x126)]('Usage:\x20tdx\x20activations\x20<parent_name/child_name>'),0x1;try{const {parentId:_0x1ed33b,childId:_0x408847}=parseSegmentRef(_0x11c056[0x0]);if(!_0x408847)return console[_0x5bc649(0x126)](_0x5bc649(0x10c)),console[_0x5bc649(0x126)](_0x5bc649(0x121)),0x1;_0x25dc62[_0x5bc649(0x125)]&&(console[_0x5bc649(0x126)](_0x5bc649(0x113)+_0x25dc62[_0x5bc649(0x118)]),console['error'](_0x5bc649(0x110)+_0x1ed33b),console[_0x5bc649(0x126)](_0x5bc649(0x11d)+_0x408847));const _0x1fa993=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x1ed33b+_0x5bc649(0x123),()=>_0x2c7623[_0x5bc649(0x122)][_0x5bc649(0x119)](_0x1ed33b),{'verbose':_0x25dc62[_0x5bc649(0x125)]}),_0x6b43fd=_0x1fa993[_0x5bc649(0x129)];_0x25dc62[_0x5bc649(0x125)]&&console[_0x5bc649(0x126)](_0x5bc649(0x10e)+_0x6b43fd);const _0x19bf3c=await withSpinner('Resolving\x20child\x20segment\x20\x27'+_0x408847+_0x5bc649(0x123),()=>_0x2c7623[_0x5bc649(0x122)]['resolveSegmentId'](_0x6b43fd,_0x408847),{'verbose':_0x25dc62['verbose']}),_0x2e74da=_0x19bf3c[_0x5bc649(0x129)];_0x25dc62[_0x5bc649(0x125)]&&console[_0x5bc649(0x126)]('Resolved\x20child\x20ID:\x20'+_0x2e74da);const _0x371c97=await withSpinner(_0x5bc649(0x128)+_0x408847+_0x5bc649(0x123),()=>_0x2c7623[_0x5bc649(0x122)][_0x5bc649(0x124)](_0x6b43fd,_0x2e74da),{'verbose':_0x25dc62['verbose']}),_0x3ef594=_0x371c97[_0x5bc649(0x129)];return console[_0x5bc649(0x126)](_0x5bc649(0x127)+_0x3ef594[_0x5bc649(0x114)]+_0x5bc649(0x10f)+(_0x3ef594[_0x5bc649(0x114)]!==0x1?'s':'')),await handleSDKOutput(_0x3ef594,_0x25dc62),0x0;}catch(_0x54384d){if(_0x54384d instanceof SDKError)return console[_0x5bc649(0x126)](_0x5bc649(0x10b)+_0x54384d['message']),_0x54384d[_0x5bc649(0x111)]&&console['error'](_0x5bc649(0x12a)+_0x54384d[_0x5bc649(0x111)]),0x1;throw _0x54384d;}}}
1
+ const a3_0x1a7a0f=a3_0x393d;(function(_0x428bde,_0x413ecd){const _0x14be65=a3_0x393d,_0x5a1e50=_0x428bde();while(!![]){try{const _0x1eec72=-parseInt(_0x14be65(0x1c4))/0x1*(-parseInt(_0x14be65(0x1d5))/0x2)+-parseInt(_0x14be65(0x1d8))/0x3+-parseInt(_0x14be65(0x1d4))/0x4+parseInt(_0x14be65(0x1de))/0x5*(-parseInt(_0x14be65(0x1c6))/0x6)+-parseInt(_0x14be65(0x1cd))/0x7*(-parseInt(_0x14be65(0x1dd))/0x8)+-parseInt(_0x14be65(0x1c3))/0x9+parseInt(_0x14be65(0x1cb))/0xa;if(_0x1eec72===_0x413ecd)break;else _0x5a1e50['push'](_0x5a1e50['shift']());}catch(_0xda1291){_0x5a1e50['push'](_0x5a1e50['shift']());}}}(a3_0x11e3,0xdc5e7));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';function a3_0x393d(_0x23ea30,_0xbcdbc4){_0x23ea30=_0x23ea30-0x1c3;const _0x11e302=a3_0x11e3();let _0x393d67=_0x11e302[_0x23ea30];return _0x393d67;}import{withSpinner}from'../utils/spinner.js';function a3_0x11e3(){const _0x2c64ef=['Resolved\x20parent\x20ID:\x20','listActivations','13790223OLpYpK','1gWkVMg','Resolved\x20child\x20ID:\x20','366BUrnYu','Resolving\x20child\x20segment\x20\x27','verbose','Error:\x20','segment','39610650kICrqT','✔\x20Found\x20','7gyWDlD','Listing\x20activations\x20for\x20segment\x20\x27','cause','resolveParentId','description','Resolving\x20parent\x20segment\x20\x27','data','4697312SPYSoF','185602KnvxwH','execute','name','2089062XHfayV','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','\x20activation','Child\x20name:\x20','activations','9024648oLSFjg','71835bocQnR','\x27...','error','\x20\x20Cause:\x20','resolveSegmentId','message','length'];a3_0x11e3=function(){return _0x2c64ef;};return a3_0x11e3();}import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';export class ActivationsCommand extends BaseCommand{[a3_0x1a7a0f(0x1d7)]=a3_0x1a7a0f(0x1dc);[a3_0x1a7a0f(0x1d1)]='List\x20activations\x20for\x20a\x20segment';async[a3_0x1a7a0f(0x1d6)](_0x3ef615){const _0x153be3=a3_0x1a7a0f,{options:_0x1aae67,args:_0x4a6a53,tdx:_0x5416b0}=_0x3ef615;if(_0x4a6a53[_0x153be3(0x1e4)]===0x0)return console[_0x153be3(0x1e0)]('Error:\x20Segment\x20name\x20is\x20required'),console[_0x153be3(0x1e0)]('Usage:\x20tdx\x20activations\x20<parent_name/child_name>'),0x1;try{const {parentId:_0x19f2f0,childId:_0x3c1996}=parseSegmentRef(_0x4a6a53[0x0]);if(!_0x3c1996)return console['error'](_0x153be3(0x1d9)),console[_0x153be3(0x1e0)]('Usage:\x20tdx\x20activations\x20<parent_name/child_name>'),0x1;_0x1aae67[_0x153be3(0x1c8)]&&(console[_0x153be3(0x1e0)]('Site:\x20'+_0x1aae67['site']),console['error']('Parent\x20name:\x20'+_0x19f2f0),console[_0x153be3(0x1e0)](_0x153be3(0x1db)+_0x3c1996));const _0x3dd73e=await withSpinner(_0x153be3(0x1d2)+_0x19f2f0+_0x153be3(0x1df),()=>_0x5416b0[_0x153be3(0x1ca)][_0x153be3(0x1d0)](_0x19f2f0),{'verbose':_0x1aae67[_0x153be3(0x1c8)]}),_0x24ea85=_0x3dd73e['data'];_0x1aae67['verbose']&&console[_0x153be3(0x1e0)](_0x153be3(0x1e5)+_0x24ea85);const _0x4759d5=await withSpinner(_0x153be3(0x1c7)+_0x3c1996+_0x153be3(0x1df),()=>_0x5416b0[_0x153be3(0x1ca)][_0x153be3(0x1e2)](_0x24ea85,_0x3c1996),{'verbose':_0x1aae67[_0x153be3(0x1c8)]}),_0x3a8205=_0x4759d5['data'];_0x1aae67[_0x153be3(0x1c8)]&&console['error'](_0x153be3(0x1c5)+_0x3a8205);const _0x351206=await withSpinner(_0x153be3(0x1ce)+_0x3c1996+_0x153be3(0x1df),()=>_0x5416b0[_0x153be3(0x1ca)][_0x153be3(0x1e6)](_0x24ea85,_0x3a8205),{'verbose':_0x1aae67[_0x153be3(0x1c8)]}),_0x3fc32c=_0x351206[_0x153be3(0x1d3)];return console['error'](_0x153be3(0x1cc)+_0x3fc32c['length']+_0x153be3(0x1da)+(_0x3fc32c[_0x153be3(0x1e4)]!==0x1?'s':'')),await handleSDKOutput(_0x3fc32c,_0x1aae67),0x0;}catch(_0x55b672){if(_0x55b672 instanceof SDKError)return console[_0x153be3(0x1e0)](_0x153be3(0x1c9)+_0x55b672[_0x153be3(0x1e3)]),_0x55b672[_0x153be3(0x1cf)]&&console[_0x153be3(0x1e0)](_0x153be3(0x1e1)+_0x55b672[_0x153be3(0x1cf)]),0x1;throw _0x55b672;}}}
@@ -1 +1 @@
1
- const a4_0x4c6313=a4_0x3fa1;(function(_0x38faf0,_0x2786f4){const _0x36f61a=a4_0x3fa1,_0x19eb22=_0x38faf0();while(!![]){try{const _0x415ce9=-parseInt(_0x36f61a(0x14d))/0x1+-parseInt(_0x36f61a(0x197))/0x2+parseInt(_0x36f61a(0x1a5))/0x3+-parseInt(_0x36f61a(0x17b))/0x4+-parseInt(_0x36f61a(0x161))/0x5+parseInt(_0x36f61a(0x14b))/0x6+parseInt(_0x36f61a(0x151))/0x7*(parseInt(_0x36f61a(0x134))/0x8);if(_0x415ce9===_0x2786f4)break;else _0x19eb22['push'](_0x19eb22['shift']());}catch(_0x4f8bc1){_0x19eb22['push'](_0x19eb22['shift']());}}}(a4_0x65f0,0xe4782));import a4_0x24f95e from'chalk';import a4_0x11987e 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(_0x4cfa15){const _0x5123f6=a4_0x3fa1,_0x3a2fdb=[];if(_0x4cfa15[_0x5123f6(0x13b)]!==undefined)_0x3a2fdb[_0x5123f6(0x100)](_0x4cfa15[_0x5123f6(0x13b)]+_0x5123f6(0x10a));if(_0x4cfa15['new']!==undefined&&_0x4cfa15[_0x5123f6(0x15c)]>0x0)_0x3a2fdb[_0x5123f6(0x100)](a4_0x24f95e[_0x5123f6(0x199)](_0x4cfa15[_0x5123f6(0x15c)]+'\x20new'));if(_0x4cfa15['created']!==undefined&&_0x4cfa15['created']>0x0)_0x3a2fdb[_0x5123f6(0x100)](a4_0x24f95e[_0x5123f6(0x199)](_0x4cfa15[_0x5123f6(0x124)]+_0x5123f6(0x10b)));if(_0x4cfa15['updated']!==undefined&&_0x4cfa15['updated']>0x0)_0x3a2fdb[_0x5123f6(0x100)](a4_0x24f95e[_0x5123f6(0x143)](_0x4cfa15[_0x5123f6(0x179)]+'\x20updated'));if(_0x4cfa15['unchanged']!==undefined&&_0x4cfa15['unchanged']>0x0)_0x3a2fdb[_0x5123f6(0x100)](a4_0x24f95e[_0x5123f6(0x101)](_0x4cfa15[_0x5123f6(0x154)]+'\x20unchanged'));if(_0x4cfa15[_0x5123f6(0xfe)]!==undefined&&_0x4cfa15[_0x5123f6(0xfe)]>0x0)_0x3a2fdb[_0x5123f6(0x100)](a4_0x24f95e[_0x5123f6(0x186)](_0x4cfa15[_0x5123f6(0xfe)]+_0x5123f6(0x105)));return _0x3a2fdb['join'](',\x20');}function displayDiffs(_0x43e494,_0x1c0073,_0x1c902d,_0x27c63d,_0x1ac871,_0x44bff9,_0x309244){const _0x309efa=a4_0x3fa1;for(const _0x3ad4f6 of _0x43e494){if(_0x3ad4f6[_0x309efa(0x195)]){const _0x6eee96=_0x3ad4f6[_0x309efa(0x168)]||_0x3ad4f6[_0x309efa(0x104)];console[_0x309efa(0x17e)](_0x309efa(0x138)+_0x6eee96+'\x27:'),console[_0x309efa(0x17e)]('─'['repeat'](0x3c)),console[_0x309efa(0x17e)](_0x3ad4f6['diff']),console[_0x309efa(0x17e)]('─'['repeat'](0x3c));}}for(const _0xae3470 of _0x1c0073){_0xae3470['diff']&&(console[_0x309efa(0x17e)](_0x309efa(0x106)+_0xae3470[_0x309efa(0x104)]+'\x27:'),console[_0x309efa(0x17e)]('─'[_0x309efa(0x131)](0x3c)),console[_0x309efa(0x17e)](_0xae3470[_0x309efa(0x195)]),console[_0x309efa(0x17e)]('─'['repeat'](0x3c)));}for(const _0x278be9 of _0x1c902d){_0x278be9[_0x309efa(0x195)]&&(console['log'](_0x309efa(0x1a0)+_0x278be9['name']+'\x27:'),console['log']('─'['repeat'](0x3c)),console[_0x309efa(0x17e)](_0x278be9[_0x309efa(0x195)]),console['log']('─'[_0x309efa(0x131)](0x3c)));}for(const _0x55f037 of _0x27c63d){_0x55f037[_0x309efa(0x195)]&&(console['log'](_0x309efa(0x112)+_0x55f037[_0x309efa(0x104)]+'\x27:'),console[_0x309efa(0x17e)]('─'[_0x309efa(0x131)](0x3c)),console[_0x309efa(0x17e)](_0x55f037[_0x309efa(0x195)]),console[_0x309efa(0x17e)]('─'[_0x309efa(0x131)](0x3c)));}for(const _0x4372df of _0x1ac871){_0x4372df[_0x309efa(0x195)]&&(console[_0x309efa(0x17e)](_0x309efa(0x15b)+_0x4372df[_0x309efa(0x104)]+'\x27:'),console[_0x309efa(0x17e)]('─'[_0x309efa(0x131)](0x3c)),console['log'](_0x4372df['diff']),console['log']('─'[_0x309efa(0x131)](0x3c)));}for(const _0x36620c of _0x44bff9){_0x36620c[_0x309efa(0x195)]&&(console['log'](_0x309efa(0x137)+_0x36620c[_0x309efa(0x104)]+'\x27:'),console[_0x309efa(0x17e)]('─'[_0x309efa(0x131)](0x3c)),console[_0x309efa(0x17e)](_0x36620c['diff']),console['log']('─'[_0x309efa(0x131)](0x3c)));}for(const _0x198013 of _0x309244){_0x198013['diff']&&(console[_0x309efa(0x17e)]('\x0aChanges\x20to\x20experimental\x20artifact\x20\x27'+_0x198013['name']+'\x27:'),console[_0x309efa(0x17e)]('─'[_0x309efa(0x131)](0x3c)),console[_0x309efa(0x17e)](_0x198013['diff']),console[_0x309efa(0x17e)]('─'[_0x309efa(0x131)](0x3c)));}}function a4_0x65f0(){const _0x297ec5=['integrations','7EEzVfV','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Clone\x20\x22','unchanged','\x20\x20Text\x20Knowledge\x20Bases:\x20','utf-8','Agent\x20','experimentalArtifacts','\x20\x20Experimental\x20Artifacts:\x20','\x20files\x20to\x20','\x0aChanges\x20to\x20integration\x20\x27','new','\x20\x20Integrations:\x20','force','\x20--profile\x20','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','3783060eOAHcF','-\x20no\x20files\x20written','dryRun','\x0a✔\x20Pushed\x20','Writing\x20files...','projectName','\x20changed','agentName','Agent:\x20','\x20resources\x20to\x20\x27','\x20\x20Agent\x20\x22','Pushing\x20agent\x20from\x20\x22','Dry\x20run\x20-\x20no\x20files\x20written','join','Using\x20current\x20project:\x20','llm_project','agent:push','Project\x20cloned\x20successfully','execute','Status:\x20','✔\x20Context\x20set:\x20','\x0aWrite\x20','\x22\x20to\x20a\x20different\x20profile','\x20\x20Knowledge\x20Base\x20\x22','updated','source','2260884OkKhkn','experimentalKnowledgeBases','New\x20project:\x20','log','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','\x22\x20to\x20\x22','pushAgent','\x20\x20tdx\x20agent\x20clone\x20agents/','\x20|\x20','\x0aProject\x20pushed\x20with\x20errors','\x20\x20Prompt\x20\x22','red','agentId','no_context','parse','agents','Project\x20cloned\x20with\x20errors','\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','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','MISSING_ARGUMENT','\x20new','counts','newProjectId','projectId','New\x20project\x20name\x20is\x20required','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','diff','\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','631674aTDKwB','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','green','cloneProject','\x22\x20to\x20new\x20project\x20\x22','dirname','Output:\x20','Analyzing\x20changes\x20to\x20push...','\x0aError:','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','outputPath','outputDir','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','Chat:\x20','1024734zWrfaI','llmProject','\x20=\x20','sourceProjectName','dim','newProjectName','\x20\x20Text\x20Knowledge\x20Base\x20\x22','Dry\x20run\x20-\x20no\x20changes\x20made','found','textKnowledgeBases','\x0aChanges:','profile','errors','\x0aPush\x20','push','gray','pullProject','agent','name','\x20errors','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','prompts','\x0aErrors\x20found:','llm','\x20total','\x20created','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','tdx.json','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','description','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','\x20\x20Knowledge\x20Bases:\x20','\x0aChanges\x20to\x20prompt\x20\x27','reason','\x20--name\x20','yes','\x20\x20Target:\x20','\x22...','\x20\x20Agents:\x20','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','Cannot\x20clone\x20from\x20context\x20project\x20\x22','cwd','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','pullAgent','agent:clone','\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','\x20resources?','INVALID_ARGUMENT','Pushing\x20to\x20project...','cyan','created','New\x20project\x20ID:\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)','error','arg-dir','action','Failed\x20to\x20push\x20agent:\x20','Summary:','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','session','Using\x20local\x20project:\x20','\x20files?','Cancelled','repeat','\x0aPull\x20summary\x20for\x20\x27','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','11299048fersWU','context','cwd-config','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','\x0aChanges\x20to\x20agent\x20\x27','Would\x20push\x20agent:\x20','hasChanges','total','\x20\x20Integration\x20\x22','Source:\x20','Pulling\x20agent\x20\x22','knowledgeBases','\x22:\x20','\x0a✔\x20Pulled\x20','\x22\x20from\x20project\x20\x22','yellow','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','\x0aPush\x20summary\x20for\x20\x27','agent:pull','Output\x20path:\x20','projectDir','Project:\x20','pushProject','5709336umXezB','\x20unchanged','132035GLSsOd','No\x20tdx.json\x20found\x20in\x20','Errors:'];a4_0x65f0=function(){return _0x297ec5;};return a4_0x65f0();}function a4_0x3fa1(_0x72cc34,_0x466428){_0x72cc34=_0x72cc34-0xf9;const _0x65f0e1=a4_0x65f0();let _0x3fa116=_0x65f0e1[_0x72cc34];return _0x3fa116;}export class AgentPullCommand extends BaseCommand{[a4_0x4c6313(0x104)]=a4_0x4c6313(0x146);[a4_0x4c6313(0x10f)]='Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files';async[a4_0x4c6313(0x173)](_0x515cb2){const _0xc829ce=a4_0x4c6313,{options:_0x3c7d06,args:_0x2b0882,tdx:_0x4301ea}=_0x515cb2,_0x2996e2=_0x2b0882[0x0],_0x9ef9ef=_0x2b0882[0x1],_0x54492a=_0x3c7d06['output'],_0x5e63bd=_0x3c7d06[_0xc829ce(0x163)],_0x53f331=_0x3c7d06[_0xc829ce(0x15e)],_0x54258d=_0x3c7d06['yes'],_0x34e892=_0x3c7d06[_0xc829ce(0x1a6)],_0x481ca2=_0x3c7d06[_0xc829ce(0x103)];let _0x5c9826;if(_0x2996e2){const _0x2c8c0e=a4_0x11987e[_0xc829ce(0x16e)](_0x2996e2,_0xc829ce(0x10d));if(existsSync(_0x2c8c0e))try{const _0x2adc6d=JSON['parse'](readFileSync(_0x2c8c0e,_0xc829ce(0x156)));_0x2adc6d[_0xc829ce(0x170)]&&(_0x5c9826={'llm_project':_0x2adc6d[_0xc829ce(0x170)]});}catch{}}const _0x3bc787=findAgentConfigPath(process[_0xc829ce(0x11b)]());let _0x3c5849;if(_0x3bc787)try{const _0x33a276=JSON[_0xc829ce(0x189)](readFileSync(_0x3bc787,_0xc829ce(0x156)));_0x33a276[_0xc829ce(0x170)]&&(_0x3c5849={'llm_project':_0x33a276[_0xc829ce(0x170)]});}catch{}const _0x5bec4a=resolveAgentPullArgs({'arg':_0x2996e2,'agentNameArg':_0x9ef9ef,'agentFlag':_0x481ca2,'contextProject':_0x34e892,'argDirConfig':_0x5c9826,'cwdConfigPath':_0x3bc787||undefined,'cwdConfig':_0x3c5849}),{projectNameOrId:_0x486258,targetAgentName:_0x481349,existingOutputDir:_0x5718b3,source:_0x20ef31}=_0x5bec4a;if(_0x20ef31===_0xc829ce(0x128))console[_0xc829ce(0x17e)](a4_0x24f95e[_0xc829ce(0x1a9)]('Using\x20project\x20from\x20'+a4_0x11987e[_0xc829ce(0x16e)](_0x2996e2,_0xc829ce(0x10d))+':\x20'+_0x486258));else{if(_0x20ef31===_0xc829ce(0x136))console[_0xc829ce(0x17e)](a4_0x24f95e['dim']('Using\x20project:\x20'+_0x486258));else _0x20ef31===_0xc829ce(0x135)&&console['log'](a4_0x24f95e[_0xc829ce(0x1a9)]('Using\x20project\x20from\x20context:\x20'+_0x486258));}if(!_0x486258)return _0x481ca2?(console[_0xc829ce(0x17e)](a4_0x24f95e['yellow']('The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a')),console[_0xc829ce(0x17e)](_0xc829ce(0x133)),console[_0xc829ce(0x17e)](_0xc829ce(0x160))):(console[_0xc829ce(0x17e)](a4_0x24f95e['yellow'](_0xc829ce(0x144))),console[_0xc829ce(0x17e)](_0xc829ce(0x126)),console[_0xc829ce(0x17e)](_0xc829ce(0x18c)),console[_0xc829ce(0x17e)](_0xc829ce(0x11f)),console['log'](_0xc829ce(0x196)),console[_0xc829ce(0x17e)]('\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(_0x481349){const {data:_0x173fd3}=await withSpinner(_0xc829ce(0x13e)+_0x481349+_0xc829ce(0x142)+_0x486258+'\x22...',()=>_0x4301ea['llm'][_0xc829ce(0x11d)](_0x486258,_0x481349,_0x54492a,{'dryRun':_0x5e63bd,'force':_0x53f331}));if(_0x5e63bd)return console['log'](a4_0x24f95e[_0xc829ce(0x143)](_0xc829ce(0x16d))),console['log']('Would\x20pull\x20agent:\x20'+_0x173fd3[_0xc829ce(0x168)]),console[_0xc829ce(0x17e)](_0xc829ce(0x147)+_0x173fd3[_0xc829ce(0x1a1)]),_0x173fd3[_0xc829ce(0x195)]&&(console[_0xc829ce(0x17e)](_0xc829ce(0xfc)),console[_0xc829ce(0x17e)]('─'[_0xc829ce(0x131)](0x3c)),console[_0xc829ce(0x17e)](_0x173fd3[_0xc829ce(0x195)]),console[_0xc829ce(0x17e)]('─'[_0xc829ce(0x131)](0x3c))),0x0;return console['log'](a4_0x24f95e[_0xc829ce(0x199)]('Agent\x20pulled\x20successfully')),console[_0xc829ce(0x17e)](_0xc829ce(0x169)+_0x173fd3[_0xc829ce(0x168)]),console[_0xc829ce(0x17e)](_0xc829ce(0x19d)+_0x173fd3[_0xc829ce(0x1a1)]),console[_0xc829ce(0x17e)](_0xc829ce(0x174)+(_0x173fd3['isNew']?a4_0x24f95e['green'](_0xc829ce(0x15c)):_0x173fd3[_0xc829ce(0x13a)]?a4_0x24f95e['yellow']('updated'):a4_0x24f95e['gray']('unchanged'))),0x0;}const _0x53919c=_0x5718b3||_0x54492a,{data:_0x19de28}=await withSpinner('Analyzing\x20project\x20\x22'+_0x486258+_0xc829ce(0x117),()=>_0x4301ea[_0xc829ce(0x109)][_0xc829ce(0x102)](_0x486258,_0x53919c,{'dryRun':!![]})),_0x9f59b1=_0x19de28['counts'][_0xc829ce(0x18a)][_0xc829ce(0x15c)]+_0x19de28[_0xc829ce(0x190)][_0xc829ce(0x13f)][_0xc829ce(0x15c)]+_0x19de28[_0xc829ce(0x190)]['textKnowledgeBases'][_0xc829ce(0x15c)]+_0x19de28['counts'][_0xc829ce(0x107)][_0xc829ce(0x15c)]+_0x19de28[_0xc829ce(0x190)][_0xc829ce(0x150)][_0xc829ce(0x15c)]+_0x19de28['counts'][_0xc829ce(0x17c)]['new']+_0x19de28['counts'][_0xc829ce(0x158)]['new'],_0x132218=_0x19de28[_0xc829ce(0x190)]['agents'][_0xc829ce(0x179)]+_0x19de28[_0xc829ce(0x190)][_0xc829ce(0x13f)]['updated']+_0x19de28['counts'][_0xc829ce(0xfb)][_0xc829ce(0x179)]+_0x19de28[_0xc829ce(0x190)][_0xc829ce(0x107)][_0xc829ce(0x179)]+_0x19de28[_0xc829ce(0x190)]['integrations'][_0xc829ce(0x179)]+_0x19de28[_0xc829ce(0x190)][_0xc829ce(0x17c)][_0xc829ce(0x179)]+_0x19de28[_0xc829ce(0x190)][_0xc829ce(0x158)][_0xc829ce(0x179)],_0x2be1ba=_0x19de28[_0xc829ce(0x190)]['agents'][_0xc829ce(0x154)]+_0x19de28['counts']['knowledgeBases'][_0xc829ce(0x154)]+_0x19de28['counts'][_0xc829ce(0xfb)][_0xc829ce(0x154)]+_0x19de28[_0xc829ce(0x190)]['prompts'][_0xc829ce(0x154)]+_0x19de28[_0xc829ce(0x190)]['integrations'][_0xc829ce(0x154)]+_0x19de28[_0xc829ce(0x190)][_0xc829ce(0x17c)][_0xc829ce(0x154)]+_0x19de28['counts']['experimentalArtifacts']['unchanged'];console[_0xc829ce(0x17e)](_0xc829ce(0x132)+_0x19de28[_0xc829ce(0x166)]+'\x27:'),console[_0xc829ce(0x17e)]('\x20\x20'+a4_0x24f95e[_0xc829ce(0x199)]('+\x20'+_0x9f59b1+_0xc829ce(0x18f))+_0xc829ce(0x183)+a4_0x24f95e[_0xc829ce(0x143)]('~\x20'+_0x132218+'\x20changed')+_0xc829ce(0x183)+a4_0x24f95e[_0xc829ce(0x1a9)]('=\x20'+_0x2be1ba+_0xc829ce(0x14c))),console[_0xc829ce(0x17e)](_0xc829ce(0x118)+formatCountSummary(_0x19de28[_0xc829ce(0x190)][_0xc829ce(0x18a)])),console['log']('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x19de28[_0xc829ce(0x190)]['knowledgeBases'])),console[_0xc829ce(0x17e)](_0xc829ce(0x155)+formatCountSummary(_0x19de28['counts']['textKnowledgeBases'])),console[_0xc829ce(0x17e)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x19de28['counts']['prompts'])),console[_0xc829ce(0x17e)](_0xc829ce(0x15d)+formatCountSummary(_0x19de28[_0xc829ce(0x190)]['integrations']));const _0x3728a0=_0x19de28[_0xc829ce(0x190)]['experimentalKnowledgeBases']['total']>0x0||_0x19de28[_0xc829ce(0x190)][_0xc829ce(0x158)][_0xc829ce(0x13b)]>0x0;_0x3728a0&&(console[_0xc829ce(0x17e)](_0xc829ce(0x12c)+formatCountSummary(_0x19de28[_0xc829ce(0x190)][_0xc829ce(0x17c)])),console[_0xc829ce(0x17e)](_0xc829ce(0x159)+formatCountSummary(_0x19de28[_0xc829ce(0x190)][_0xc829ce(0x158)])));console[_0xc829ce(0x17e)](_0xc829ce(0x116)+a4_0x24f95e[_0xc829ce(0x123)](_0x19de28[_0xc829ce(0x1a2)])),displayDiffs(_0x19de28[_0xc829ce(0x18a)],_0x19de28[_0xc829ce(0x13f)],_0x19de28[_0xc829ce(0xfb)],_0x19de28['prompts'],_0x19de28[_0xc829ce(0x150)],_0x19de28['experimentalKnowledgeBases'],_0x19de28['experimentalArtifacts']);if(_0x5e63bd)return console[_0xc829ce(0x17e)](a4_0x24f95e['yellow'](_0xc829ce(0x11c))),0x0;if(_0x9f59b1===0x0&&_0x132218===0x0)return console['log'](a4_0x24f95e[_0xc829ce(0x199)]('\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'llm_project':_0x19de28[_0xc829ce(0x166)]},_0x3c7d06[_0xc829ce(0x12d)]),console[_0xc829ce(0x17e)](a4_0x24f95e[_0xc829ce(0x199)](_0xc829ce(0x175)+a4_0x24f95e[_0xc829ce(0x1a9)](_0xc829ce(0x170))+_0xc829ce(0x1a7)+a4_0x24f95e[_0xc829ce(0x123)](_0x19de28['projectName']))),0x0;if(!_0x54258d&&!_0x53f331){if(!isInteractive())return console[_0xc829ce(0x127)](a4_0x24f95e['red']('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0xc829ce(0x127)](a4_0x24f95e[_0xc829ce(0x1a9)](_0xc829ce(0x152))),0x1;const _0x290359=await confirmKey(_0xc829ce(0x176)+(_0x9f59b1+_0x132218)+_0xc829ce(0x12f));if(!_0x290359)return console[_0xc829ce(0x17e)](a4_0x24f95e['yellow'](_0xc829ce(0x130)),_0xc829ce(0x162)),0x1;}const {data:_0x2764af}=await withSpinner(_0xc829ce(0x165),()=>_0x4301ea[_0xc829ce(0x109)]['pullProject'](_0x486258,_0x53919c,{'force':_0x53f331}));return console[_0xc829ce(0x17e)](a4_0x24f95e[_0xc829ce(0x199)](_0xc829ce(0x141)+(_0x9f59b1+_0x132218)+_0xc829ce(0x15a)+_0x2764af[_0xc829ce(0x1a2)])),saveSessionContext({'llm_project':_0x2764af['projectName']},_0x3c7d06['session']),console[_0xc829ce(0x17e)](a4_0x24f95e[_0xc829ce(0x199)](_0xc829ce(0x175)+a4_0x24f95e[_0xc829ce(0x1a9)](_0xc829ce(0x170))+'\x20=\x20'+a4_0x24f95e[_0xc829ce(0x123)](_0x2764af[_0xc829ce(0x166)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x4c6313(0x104)]=a4_0x4c6313(0x11e);[a4_0x4c6313(0x10f)]='Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project';async[a4_0x4c6313(0x173)](_0x499614){const _0x17b47a=a4_0x4c6313,{options:_0x30e53d,args:_0x21649f,tdx:_0x36845f}=_0x499614,_0x7bf6ba=_0x21649f[0x0],_0x1d8f47=_0x30e53d[_0x17b47a(0x104)],_0x52c3c9=_0x30e53d[_0x17b47a(0x163)],_0xb7418e=_0x30e53d['yes'],_0x2f7e96=_0x30e53d['site'],_0x32187a=_0x30e53d['llmProject'];let _0x345517;const _0x1a4363=findAgentConfigPath(process[_0x17b47a(0x11b)]());if(_0x7bf6ba){const _0x4d836b=a4_0x11987e[_0x17b47a(0x16e)](_0x7bf6ba,_0x17b47a(0x10d));existsSync(_0x4d836b)?(_0x345517=_0x7bf6ba,console[_0x17b47a(0x17e)](a4_0x24f95e['dim'](_0x17b47a(0x12e)+_0x7bf6ba))):_0x345517=_0x7bf6ba;}else{if(_0x1a4363)_0x345517=a4_0x11987e[_0x17b47a(0x19c)](_0x1a4363),console['log'](a4_0x24f95e[_0x17b47a(0x1a9)](_0x17b47a(0x16f)+_0x345517));else{if(_0x32187a){const _0x3ede4a=sanitizeForFilesystem(_0x32187a);let _0x33ffac=_0x3ede4a,_0x5240fe=a4_0x11987e[_0x17b47a(0x16e)](process[_0x17b47a(0x11b)](),_0x17b47a(0x18a),_0x3ede4a,_0x17b47a(0x10d));if(!existsSync(_0x5240fe)){const _0x2ce657=normalizeName(_0x32187a),_0x427ac6=a4_0x11987e[_0x17b47a(0x16e)](process[_0x17b47a(0x11b)](),'agents',_0x2ce657,'tdx.json');existsSync(_0x427ac6)&&(_0x33ffac=_0x2ce657,_0x5240fe=_0x427ac6);}if(existsSync(_0x5240fe))_0x345517=a4_0x11987e[_0x17b47a(0x19c)](_0x5240fe),console[_0x17b47a(0x17e)](a4_0x24f95e[_0x17b47a(0x1a9)](_0x17b47a(0x12e)+_0x345517));else{const _0x142a69=_0x30e53d[_0x17b47a(0xfd)];if(_0x142a69)throw new SDKError(ErrorCode[_0x17b47a(0x121)],_0x17b47a(0x11a)+_0x32187a+_0x17b47a(0x177),undefined,{'helpText':_0x17b47a(0x10e)+_0x17b47a(0x17f)+('\x20\x20tdx\x20agent\x20pull\x20'+_0x32187a+'\x0a')+(_0x17b47a(0x182)+_0x33ffac+_0x17b47a(0x114)+(_0x1d8f47||'<new-name>')+_0x17b47a(0x15f)+_0x142a69)});_0x345517=_0x32187a,console[_0x17b47a(0x17e)](a4_0x24f95e['dim']('Using\x20context\x20project:\x20'+_0x32187a));}}}}if(!_0x345517)return console[_0x17b47a(0x17e)](a4_0x24f95e[_0x17b47a(0x143)](_0x17b47a(0x119))),console[_0x17b47a(0x17e)]('\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project'),console[_0x17b47a(0x17e)](_0x17b47a(0x194)),console[_0x17b47a(0x17e)]('\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['log'](_0x17b47a(0x1a3)),0x1;if(!_0x1d8f47)throw new SDKError(ErrorCode[_0x17b47a(0x18e)],_0x17b47a(0x193),undefined,{'helpText':_0x17b47a(0x110)});if(!_0xb7418e&&!_0x52c3c9){if(!isInteractive())return console[_0x17b47a(0x127)](a4_0x24f95e['red'](_0x17b47a(0x19f)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a4_0x24f95e['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x372024=await confirmKey(_0x17b47a(0x153)+_0x345517+_0x17b47a(0x19b)+_0x1d8f47+'\x22?');if(!_0x372024)return console[_0x17b47a(0x17e)](a4_0x24f95e[_0x17b47a(0x143)]('Cancelled')),0x1;}const {data:_0x2cd52b}=await withSpinner('Cloning\x20\x22'+_0x345517+_0x17b47a(0x180)+_0x1d8f47+_0x17b47a(0x117),()=>_0x36845f['llm'][_0x17b47a(0x19a)](_0x345517,_0x1d8f47,{'dryRun':_0x52c3c9}));if(_0x52c3c9){console[_0x17b47a(0x17e)](a4_0x24f95e[_0x17b47a(0x143)](_0x17b47a(0xf9))),console[_0x17b47a(0x17e)](_0x17b47a(0x13d)+_0x2cd52b[_0x17b47a(0x1a8)]),console[_0x17b47a(0x17e)](_0x17b47a(0x17d)+_0x1d8f47),console[_0x17b47a(0x17e)]('Would\x20clone:'),console[_0x17b47a(0x17e)]('\x20\x20Agents:\x20'+_0x2cd52b[_0x17b47a(0x190)][_0x17b47a(0x18a)]['created']),console[_0x17b47a(0x17e)](_0x17b47a(0x111)+_0x2cd52b[_0x17b47a(0x190)][_0x17b47a(0x13f)][_0x17b47a(0x124)]),console['log']('\x20\x20Prompts:\x20'+_0x2cd52b[_0x17b47a(0x190)][_0x17b47a(0x107)][_0x17b47a(0x124)]);const _0x48e93d=_0x2cd52b[_0x17b47a(0x190)][_0x17b47a(0x17c)][_0x17b47a(0x124)]>0x0||_0x2cd52b[_0x17b47a(0x190)][_0x17b47a(0x158)]['created']>0x0;return _0x48e93d&&(console['log'](_0x17b47a(0x12c)+_0x2cd52b[_0x17b47a(0x190)][_0x17b47a(0x17c)]['created']),console[_0x17b47a(0x17e)](_0x17b47a(0x159)+_0x2cd52b[_0x17b47a(0x190)][_0x17b47a(0x158)][_0x17b47a(0x124)])),0x0;}const _0x54f386=_0x2cd52b['counts'][_0x17b47a(0x18a)][_0x17b47a(0xfe)]>0x0||_0x2cd52b[_0x17b47a(0x190)][_0x17b47a(0x13f)][_0x17b47a(0xfe)]>0x0||_0x2cd52b[_0x17b47a(0x190)][_0x17b47a(0x107)][_0x17b47a(0xfe)]>0x0||_0x2cd52b['counts'][_0x17b47a(0x17c)][_0x17b47a(0xfe)]>0x0||_0x2cd52b[_0x17b47a(0x190)]['experimentalArtifacts'][_0x17b47a(0xfe)]>0x0;_0x54f386?console['log'](a4_0x24f95e['yellow'](_0x17b47a(0x18b))):console['log'](a4_0x24f95e[_0x17b47a(0x199)](_0x17b47a(0x172)));console[_0x17b47a(0x17e)](_0x17b47a(0x13d)+_0x2cd52b[_0x17b47a(0x1a8)]),console['log'](_0x17b47a(0x17d)+_0x2cd52b[_0x17b47a(0x1aa)]),console[_0x17b47a(0x17e)](_0x17b47a(0x125)+_0x2cd52b[_0x17b47a(0x191)]),console[_0x17b47a(0x17e)](),console['log'](_0x17b47a(0x12b)),console['log'](_0x17b47a(0x118)+formatCountSummary(_0x2cd52b[_0x17b47a(0x190)]['agents'])),console[_0x17b47a(0x17e)](_0x17b47a(0x111)+formatCountSummary(_0x2cd52b[_0x17b47a(0x190)][_0x17b47a(0x13f)])),console[_0x17b47a(0x17e)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x2cd52b[_0x17b47a(0x190)][_0x17b47a(0x107)])),console['log']('\x20\x20Integrations:\x20'+formatCountSummary(_0x2cd52b[_0x17b47a(0x190)][_0x17b47a(0x150)]));const _0x449829=_0x2cd52b[_0x17b47a(0x190)]['experimentalKnowledgeBases'][_0x17b47a(0x124)]>0x0||_0x2cd52b['counts'][_0x17b47a(0x17c)][_0x17b47a(0x179)]>0x0||_0x2cd52b[_0x17b47a(0x190)][_0x17b47a(0x17c)]['unchanged']>0x0||_0x2cd52b[_0x17b47a(0x190)][_0x17b47a(0x158)][_0x17b47a(0x124)]>0x0||_0x2cd52b[_0x17b47a(0x190)]['experimentalArtifacts'][_0x17b47a(0x179)]>0x0||_0x2cd52b[_0x17b47a(0x190)][_0x17b47a(0x158)][_0x17b47a(0x154)]>0x0;_0x449829&&(console[_0x17b47a(0x17e)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x2cd52b[_0x17b47a(0x190)]['experimentalKnowledgeBases'])),console[_0x17b47a(0x17e)](_0x17b47a(0x159)+formatCountSummary(_0x2cd52b[_0x17b47a(0x190)][_0x17b47a(0x158)])));if(_0x54f386){console['log'](),console[_0x17b47a(0x17e)](a4_0x24f95e[_0x17b47a(0x186)](_0x17b47a(0x14f)));for(const _0x2e2184 of _0x2cd52b['agents']){_0x2e2184[_0x17b47a(0x129)]===_0x17b47a(0x127)&&console[_0x17b47a(0x17e)](a4_0x24f95e['red']('\x20\x20Agent\x20\x22'+_0x2e2184[_0x17b47a(0x168)]+_0x17b47a(0x140)+_0x2e2184[_0x17b47a(0x127)]));}for(const _0x142fc8 of _0x2cd52b[_0x17b47a(0x13f)]){_0x142fc8[_0x17b47a(0x129)]===_0x17b47a(0x127)&&console[_0x17b47a(0x17e)](a4_0x24f95e[_0x17b47a(0x186)](_0x17b47a(0x178)+_0x142fc8[_0x17b47a(0x104)]+_0x17b47a(0x140)+_0x142fc8['error']));}for(const _0x2cdfc1 of _0x2cd52b[_0x17b47a(0x107)]){_0x2cdfc1['action']===_0x17b47a(0x127)&&console[_0x17b47a(0x17e)](a4_0x24f95e[_0x17b47a(0x186)](_0x17b47a(0x185)+_0x2cdfc1[_0x17b47a(0x104)]+_0x17b47a(0x140)+_0x2cdfc1[_0x17b47a(0x127)]));}for(const _0x590441 of _0x2cd52b[_0x17b47a(0x150)]){_0x590441[_0x17b47a(0x129)]===_0x17b47a(0x127)&&console['log'](a4_0x24f95e['red'](_0x17b47a(0x13c)+_0x590441['name']+'\x22:\x20'+_0x590441[_0x17b47a(0x127)]));}for(const _0xa7c8b9 of _0x2cd52b['experimentalKnowledgeBases']){_0xa7c8b9['action']==='error'&&console[_0x17b47a(0x17e)](a4_0x24f95e[_0x17b47a(0x186)]('\x20\x20Experimental\x20Knowledge\x20Base\x20\x22'+_0xa7c8b9[_0x17b47a(0x104)]+_0x17b47a(0x140)+_0xa7c8b9[_0x17b47a(0x127)]));}for(const _0x108ad4 of _0x2cd52b[_0x17b47a(0x158)]){_0x108ad4[_0x17b47a(0x129)]===_0x17b47a(0x127)&&console['log'](a4_0x24f95e[_0x17b47a(0x186)]('\x20\x20Experimental\x20Artifact\x20\x22'+_0x108ad4[_0x17b47a(0x104)]+_0x17b47a(0x140)+_0x108ad4[_0x17b47a(0x127)]));}return 0x1;}console[_0x17b47a(0x17e)]();const _0x41e44d=getLLMProjectUrl(_0x2f7e96,_0x2cd52b[_0x17b47a(0x191)]);return console[_0x17b47a(0x17e)](_0x17b47a(0x149)+a4_0x24f95e[_0x17b47a(0x123)](_0x41e44d)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x4c6313(0x104)]=a4_0x4c6313(0x171);[a4_0x4c6313(0x10f)]='Push\x20local\x20agent\x20files\x20to\x20LLM\x20project';async[a4_0x4c6313(0x173)](_0x1f4fc5){const _0x4f3501=a4_0x4c6313,{options:_0x2eedce,args:_0x5e75ec,tdx:_0x1cc923}=_0x1f4fc5;let _0x51ffcb=_0x5e75ec[0x0]||process['cwd']();const _0x12af4b=_0x2eedce[_0x4f3501(0x163)],_0x313f6a=_0x2eedce[_0x4f3501(0x15e)],_0x5f23f4=_0x2eedce[_0x4f3501(0x115)],_0x24fcdd=_0x2eedce['site'],_0x5ac792=a4_0x11987e[_0x4f3501(0x16e)](_0x51ffcb,'agent.yml'),_0x3d615b=existsSync(_0x5ac792);if(_0x3d615b){const {data:_0x44dd46}=await withSpinner(_0x4f3501(0x16c)+_0x51ffcb+_0x4f3501(0x117),()=>_0x1cc923['llm'][_0x4f3501(0x181)](_0x51ffcb,{'dryRun':_0x12af4b,'force':_0x313f6a}));if(_0x12af4b)return console['log'](a4_0x24f95e[_0x4f3501(0x143)](_0x4f3501(0xf9))),console[_0x4f3501(0x17e)](_0x4f3501(0x139)+_0x44dd46[_0x4f3501(0x168)]),0x0;if(_0x44dd46[_0x4f3501(0x129)]==='error')return console['log'](a4_0x24f95e['red'](_0x4f3501(0x12a)+_0x44dd46['error'])),0x1;console[_0x4f3501(0x17e)](a4_0x24f95e[_0x4f3501(0x199)](_0x4f3501(0x157)+_0x44dd46['action']+'\x20successfully')),console[_0x4f3501(0x17e)]('Agent:\x20'+_0x44dd46[_0x4f3501(0x168)]);if(_0x44dd46[_0x4f3501(0x187)]&&_0x44dd46['projectId']){const _0x2112af=getLLMAgentChatUrl(_0x24fcdd,_0x44dd46[_0x4f3501(0x192)],_0x44dd46['agentId']);console['log'](_0x4f3501(0x1a4)+a4_0x24f95e[_0x4f3501(0x123)](_0x2112af));}return 0x0;}const _0x5af246=_0x2eedce[_0x4f3501(0x1a6)],_0x23b29c=resolveProjectFromContext(_0x51ffcb,_0x5af246);if(_0x23b29c[_0x4f3501(0xfa)])_0x51ffcb=_0x23b29c[_0x4f3501(0x148)],_0x23b29c[_0x4f3501(0x17a)]===_0x4f3501(0x135)&&console[_0x4f3501(0x17e)](a4_0x24f95e[_0x4f3501(0x1a9)]('Using\x20project:\x20'+_0x51ffcb));else{let _0x392cbd=_0x4f3501(0x10c);_0x23b29c[_0x4f3501(0x113)]==='no_local_folder'&&(_0x392cbd=_0x23b29c['message']+'\x0aRun\x20\x27tdx\x20agent\x20pull\x20'+_0x23b29c[_0x4f3501(0x1a6)]+'\x27\x20to\x20create\x20the\x20folder\x20structure.');throw new SDKError(ErrorCode[_0x4f3501(0x121)],_0x23b29c[_0x4f3501(0x113)]===_0x4f3501(0x188)?_0x23b29c['message']:_0x4f3501(0x14e)+_0x51ffcb,undefined,{'helpText':_0x392cbd});}const {data:_0x1fb0a2}=await withSpinner(_0x4f3501(0x19e),()=>_0x1cc923['llm'][_0x4f3501(0x14a)](_0x51ffcb,{'dryRun':!![]})),_0x34977d=_0x1fb0a2[_0x4f3501(0x190)]['agents'][_0x4f3501(0xfe)]>0x0;if(_0x34977d){console[_0x4f3501(0x17e)](a4_0x24f95e[_0x4f3501(0x186)](_0x4f3501(0x108)));for(const _0x5c1ce4 of _0x1fb0a2[_0x4f3501(0x18a)]){_0x5c1ce4[_0x4f3501(0x129)]===_0x4f3501(0x127)&&console['log'](a4_0x24f95e[_0x4f3501(0x186)](_0x4f3501(0x16b)+_0x5c1ce4[_0x4f3501(0x168)]+_0x4f3501(0x140)+_0x5c1ce4[_0x4f3501(0x127)]));}return 0x1;}const _0x25bd9c=_0x1fb0a2['counts'][_0x4f3501(0x18a)][_0x4f3501(0x124)]+_0x1fb0a2[_0x4f3501(0x190)][_0x4f3501(0x13f)][_0x4f3501(0x124)]+_0x1fb0a2[_0x4f3501(0x190)][_0x4f3501(0xfb)][_0x4f3501(0x124)]+_0x1fb0a2[_0x4f3501(0x190)][_0x4f3501(0x107)][_0x4f3501(0x124)]+_0x1fb0a2[_0x4f3501(0x190)][_0x4f3501(0x150)][_0x4f3501(0x124)]+_0x1fb0a2[_0x4f3501(0x190)]['experimentalKnowledgeBases'][_0x4f3501(0x124)]+_0x1fb0a2[_0x4f3501(0x190)][_0x4f3501(0x158)][_0x4f3501(0x124)],_0x560932=_0x1fb0a2['counts'][_0x4f3501(0x18a)][_0x4f3501(0x179)]+_0x1fb0a2[_0x4f3501(0x190)][_0x4f3501(0x13f)][_0x4f3501(0x179)]+_0x1fb0a2[_0x4f3501(0x190)][_0x4f3501(0xfb)][_0x4f3501(0x179)]+_0x1fb0a2[_0x4f3501(0x190)][_0x4f3501(0x107)]['updated']+_0x1fb0a2[_0x4f3501(0x190)]['integrations'][_0x4f3501(0x179)]+_0x1fb0a2[_0x4f3501(0x190)][_0x4f3501(0x17c)][_0x4f3501(0x179)]+_0x1fb0a2[_0x4f3501(0x190)][_0x4f3501(0x158)][_0x4f3501(0x179)],_0x32db71=_0x1fb0a2[_0x4f3501(0x190)][_0x4f3501(0x18a)][_0x4f3501(0x154)]+_0x1fb0a2[_0x4f3501(0x190)][_0x4f3501(0x13f)][_0x4f3501(0x154)]+_0x1fb0a2[_0x4f3501(0x190)][_0x4f3501(0xfb)][_0x4f3501(0x154)]+_0x1fb0a2['counts']['prompts'][_0x4f3501(0x154)]+_0x1fb0a2[_0x4f3501(0x190)][_0x4f3501(0x150)][_0x4f3501(0x154)]+_0x1fb0a2[_0x4f3501(0x190)][_0x4f3501(0x17c)][_0x4f3501(0x154)]+_0x1fb0a2['counts']['experimentalArtifacts'][_0x4f3501(0x154)];console[_0x4f3501(0x17e)](_0x4f3501(0x145)+_0x1fb0a2['projectName']+'\x27:'),console[_0x4f3501(0x17e)]('\x20\x20'+a4_0x24f95e[_0x4f3501(0x199)]('+\x20'+_0x25bd9c+_0x4f3501(0x18f))+_0x4f3501(0x183)+a4_0x24f95e['yellow']('~\x20'+_0x560932+_0x4f3501(0x167))+'\x20|\x20'+a4_0x24f95e[_0x4f3501(0x1a9)]('=\x20'+_0x32db71+_0x4f3501(0x14c))),console['log']('\x20\x20Agents:\x20'+formatCountSummary(_0x1fb0a2[_0x4f3501(0x190)][_0x4f3501(0x18a)])),console[_0x4f3501(0x17e)](_0x4f3501(0x111)+formatCountSummary(_0x1fb0a2['counts']['knowledgeBases'])),console[_0x4f3501(0x17e)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x1fb0a2[_0x4f3501(0x190)][_0x4f3501(0xfb)])),console['log']('\x20\x20Prompts:\x20'+formatCountSummary(_0x1fb0a2[_0x4f3501(0x190)]['prompts'])),console['log'](_0x4f3501(0x15d)+formatCountSummary(_0x1fb0a2[_0x4f3501(0x190)]['integrations']));const _0x50cf74=_0x1fb0a2[_0x4f3501(0x190)]['experimentalKnowledgeBases'][_0x4f3501(0x124)]>0x0||_0x1fb0a2[_0x4f3501(0x190)][_0x4f3501(0x17c)][_0x4f3501(0x179)]>0x0||_0x1fb0a2[_0x4f3501(0x190)][_0x4f3501(0x17c)][_0x4f3501(0x154)]>0x0||_0x1fb0a2['counts'][_0x4f3501(0x158)]['created']>0x0||_0x1fb0a2[_0x4f3501(0x190)][_0x4f3501(0x158)][_0x4f3501(0x179)]>0x0||_0x1fb0a2[_0x4f3501(0x190)]['experimentalArtifacts']['unchanged']>0x0;_0x50cf74&&(console[_0x4f3501(0x17e)](_0x4f3501(0x12c)+formatCountSummary(_0x1fb0a2[_0x4f3501(0x190)][_0x4f3501(0x17c)])),console['log'](_0x4f3501(0x159)+formatCountSummary(_0x1fb0a2['counts']['experimentalArtifacts'])));console[_0x4f3501(0x17e)]('\x20\x20Source:\x20'+a4_0x24f95e[_0x4f3501(0x123)](_0x51ffcb)),displayDiffs(_0x1fb0a2[_0x4f3501(0x18a)],_0x1fb0a2[_0x4f3501(0x13f)],_0x1fb0a2[_0x4f3501(0xfb)],_0x1fb0a2[_0x4f3501(0x107)],_0x1fb0a2['integrations'],_0x1fb0a2[_0x4f3501(0x17c)],_0x1fb0a2[_0x4f3501(0x158)]);if(_0x12af4b)return console[_0x4f3501(0x17e)](a4_0x24f95e[_0x4f3501(0x143)](_0x4f3501(0x198))),0x0;if(_0x25bd9c===0x0&&_0x560932===0x0){console[_0x4f3501(0x17e)](a4_0x24f95e[_0x4f3501(0x199)](_0x4f3501(0x18d)));const _0x3c280d=getLLMProjectUrl(_0x24fcdd,_0x1fb0a2['projectId']);return console[_0x4f3501(0x17e)](_0x4f3501(0x149)+a4_0x24f95e[_0x4f3501(0x123)](_0x3c280d)),0x0;}if(!_0x5f23f4&&!_0x313f6a){if(!isInteractive())return console[_0x4f3501(0x127)](a4_0x24f95e[_0x4f3501(0x186)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a4_0x24f95e['dim'](_0x4f3501(0x152))),0x1;const _0x11ebb3=await confirmKey(_0x4f3501(0xff)+(_0x25bd9c+_0x560932)+_0x4f3501(0x120));if(!_0x11ebb3)return console[_0x4f3501(0x17e)](a4_0x24f95e[_0x4f3501(0x143)]('Cancelled'),'-\x20nothing\x20pushed'),0x1;}const {data:_0x5b6b66}=await withSpinner(_0x4f3501(0x122),()=>_0x1cc923[_0x4f3501(0x109)][_0x4f3501(0x14a)](_0x51ffcb,{'force':_0x313f6a})),_0x52d90a=_0x5b6b66[_0x4f3501(0x190)][_0x4f3501(0x18a)]['errors']>0x0||_0x5b6b66[_0x4f3501(0x190)][_0x4f3501(0x13f)]['errors']>0x0||_0x5b6b66['counts'][_0x4f3501(0xfb)][_0x4f3501(0xfe)]>0x0||_0x5b6b66[_0x4f3501(0x190)][_0x4f3501(0x107)][_0x4f3501(0xfe)]>0x0;if(_0x52d90a){console['log'](a4_0x24f95e[_0x4f3501(0x143)](_0x4f3501(0x184))),console['log'](),console[_0x4f3501(0x17e)](a4_0x24f95e[_0x4f3501(0x186)]('Errors:'));for(const _0x3f7c6d of _0x5b6b66[_0x4f3501(0x18a)]){_0x3f7c6d['action']==='error'&&console['log'](a4_0x24f95e['red'](_0x4f3501(0x16b)+_0x3f7c6d[_0x4f3501(0x168)]+'\x22:\x20'+_0x3f7c6d[_0x4f3501(0x127)]));}for(const _0x3eb218 of _0x5b6b66[_0x4f3501(0x13f)]){_0x3eb218[_0x4f3501(0x129)]===_0x4f3501(0x127)&&console[_0x4f3501(0x17e)](a4_0x24f95e[_0x4f3501(0x186)](_0x4f3501(0x178)+_0x3eb218[_0x4f3501(0x104)]+_0x4f3501(0x140)+_0x3eb218[_0x4f3501(0x127)]));}for(const _0x49285b of _0x5b6b66[_0x4f3501(0xfb)]){_0x49285b['action']===_0x4f3501(0x127)&&console[_0x4f3501(0x17e)](a4_0x24f95e['red'](_0x4f3501(0x1ab)+_0x49285b[_0x4f3501(0x104)]+_0x4f3501(0x140)+_0x49285b[_0x4f3501(0x127)]));}for(const _0x20d985 of _0x5b6b66[_0x4f3501(0x107)]){_0x20d985[_0x4f3501(0x129)]===_0x4f3501(0x127)&&console[_0x4f3501(0x17e)](a4_0x24f95e[_0x4f3501(0x186)]('\x20\x20Prompt\x20\x22'+_0x20d985[_0x4f3501(0x104)]+'\x22:\x20'+_0x20d985[_0x4f3501(0x127)]));}for(const _0x411456 of _0x5b6b66['integrations']){_0x411456[_0x4f3501(0x129)]===_0x4f3501(0x127)&&console[_0x4f3501(0x17e)](a4_0x24f95e[_0x4f3501(0x186)](_0x4f3501(0x13c)+_0x411456[_0x4f3501(0x104)]+_0x4f3501(0x140)+_0x411456[_0x4f3501(0x127)]));}return 0x1;}console[_0x4f3501(0x17e)](a4_0x24f95e[_0x4f3501(0x199)](_0x4f3501(0x164)+(_0x25bd9c+_0x560932)+_0x4f3501(0x16a)+_0x5b6b66[_0x4f3501(0x166)]+'\x27'));const _0x6706af=getLLMProjectUrl(_0x24fcdd,_0x5b6b66[_0x4f3501(0x192)]);return console[_0x4f3501(0x17e)](_0x4f3501(0x149)+a4_0x24f95e[_0x4f3501(0x123)](_0x6706af)),0x0;}}
1
+ const a4_0x5f1e4e=a4_0x43b2;(function(_0x13f495,_0x16c91c){const _0x4722f9=a4_0x43b2,_0x23c69c=_0x13f495();while(!![]){try{const _0xd4c7b6=parseInt(_0x4722f9(0x170))/0x1*(parseInt(_0x4722f9(0x1b1))/0x2)+parseInt(_0x4722f9(0x1af))/0x3*(-parseInt(_0x4722f9(0x165))/0x4)+parseInt(_0x4722f9(0x16b))/0x5+-parseInt(_0x4722f9(0x1a7))/0x6*(-parseInt(_0x4722f9(0x10b))/0x7)+parseInt(_0x4722f9(0x101))/0x8*(-parseInt(_0x4722f9(0x18c))/0x9)+-parseInt(_0x4722f9(0x102))/0xa*(parseInt(_0x4722f9(0x10c))/0xb)+parseInt(_0x4722f9(0x196))/0xc;if(_0xd4c7b6===_0x16c91c)break;else _0x23c69c['push'](_0x23c69c['shift']());}catch(_0x17cb3b){_0x23c69c['push'](_0x23c69c['shift']());}}}(a4_0x2463,0x6d0d0));import a4_0x187973 from'chalk';import a4_0x1e3af3 from'path';function a4_0x2463(){const _0x54b839=['created','profile','reason','Clone\x20\x22','\x20files?','\x20\x20Knowledge\x20Bases:\x20','output','Source:\x20','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','9LpGWHf','\x20total','\x0aChanges\x20to\x20prompt\x20\x27','✔\x20Context\x20set:\x20','Using\x20local\x20project:\x20','dirname','\x0aPush\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\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','Chat:\x20','5724624EjLJwu','force','prompts','\x20\x20Text\x20Knowledge\x20Bases:\x20','\x20new','\x20created','no_context','\x0aChanges\x20to\x20agent\x20\x27','hasChanges','newProjectId','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','\x20\x20Agents:\x20','utf-8','errors','Using\x20project\x20from\x20','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','found','4126242KYMckb','parse','context','pushProject','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','\x20--name\x20','join','name','458727VFrTuV','unchanged','146wqFufD','\x20\x20tdx\x20agent\x20pull\x20','\x0aChanges:','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','Output:\x20','\x20\x20Knowledge\x20Base\x20\x22','agents','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','405896oIIuul','120ekYGRA','\x22\x20to\x20\x22','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','Would\x20clone:','\x20\x20Agent\x20\x22','MISSING_ARGUMENT','\x0a✔\x20Pushed\x20','agent:pull','updated','7LXeWrr','723569wUkjtS','Errors:','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','INVALID_ARGUMENT','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','\x20\x20Integration\x20\x22','\x0aError:','Agent\x20','error','log','Project:\x20','\x0a✔\x20Pulled\x20','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','\x20\x20tdx\x20agent\x20clone\x20agents/','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','Output\x20path:\x20','-\x20no\x20files\x20written','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','yes','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','agent','tdx.json','\x0aWrite\x20','site','\x0aChanges\x20to\x20integration\x20\x27','\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','\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','\x20|\x20','cwd','Dry\x20run\x20-\x20no\x20changes\x20made','session','yellow','projectDir','dryRun','sourceProjectName','\x20\x20Prompt\x20\x22','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','\x22...','counts','cyan','total','green','agentId','llm','New\x20project\x20name\x20is\x20required','\x22\x20to\x20a\x20different\x20profile','\x20\x20Text\x20Knowledge\x20Base\x20\x22','projectId','message','agent:push','\x20\x20Integrations:\x20','llmProject','llm_project','\x20--profile\x20','New\x20project\x20ID:\x20','cwd-config','push','Failed\x20to\x20push\x20agent:\x20','\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)','new','\x20=\x20','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','\x20\x20Experimental\x20Artifact\x20\x22','\x20\x20Experimental\x20Artifacts:\x20','Agent:\x20','Using\x20context\x20project:\x20','Cancelled','\x20unchanged','execute','Agent\x20pulled\x20successfully','Dry\x20run\x20-\x20no\x20files\x20written','Writing\x20files...','\x22:\x20','gray','outputDir','Cloning\x20\x22','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','pullProject','agentName','Pushing\x20agent\x20from\x20\x22','projectName','\x20files\x20to\x20','pullAgent','Would\x20pull\x20agent:\x20','\x20resources?','isNew','experimentalArtifacts','4PAjAVn','arg-dir','\x20\x20Prompts:\x20','experimentalKnowledgeBases','description','diff','1315040KdbIye','Using\x20current\x20project:\x20','New\x20project:\x20','\x20successfully','\x0aPush\x20summary\x20for\x20\x27','163oEIcTK','Using\x20project:\x20','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','\x20updated','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','\x22\x20to\x20new\x20project\x20\x22','red','Summary:','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','integrations','textKnowledgeBases','action','cloneProject','\x20errors','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','dim','knowledgeBases','repeat'];a4_0x2463=function(){return _0x54b839;};return a4_0x2463();}function a4_0x43b2(_0x4f87b9,_0x4494fa){_0x4f87b9=_0x4f87b9-0xfb;const _0x246387=a4_0x2463();let _0x43b22f=_0x246387[_0x4f87b9];return _0x43b22f;}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(_0x51cfbd){const _0x43b419=a4_0x43b2,_0x3c9c92=[];if(_0x51cfbd[_0x43b419(0x135)]!==undefined)_0x3c9c92[_0x43b419(0x145)](_0x51cfbd[_0x43b419(0x135)]+_0x43b419(0x18d));if(_0x51cfbd[_0x43b419(0x148)]!==undefined&&_0x51cfbd['new']>0x0)_0x3c9c92[_0x43b419(0x145)](a4_0x187973[_0x43b419(0x136)](_0x51cfbd[_0x43b419(0x148)]+'\x20new'));if(_0x51cfbd[_0x43b419(0x183)]!==undefined&&_0x51cfbd['created']>0x0)_0x3c9c92[_0x43b419(0x145)](a4_0x187973['green'](_0x51cfbd[_0x43b419(0x183)]+_0x43b419(0x19b)));if(_0x51cfbd[_0x43b419(0x10a)]!==undefined&&_0x51cfbd[_0x43b419(0x10a)]>0x0)_0x3c9c92[_0x43b419(0x145)](a4_0x187973['yellow'](_0x51cfbd['updated']+_0x43b419(0x173)));if(_0x51cfbd[_0x43b419(0x1b0)]!==undefined&&_0x51cfbd[_0x43b419(0x1b0)]>0x0)_0x3c9c92[_0x43b419(0x145)](a4_0x187973[_0x43b419(0x156)](_0x51cfbd[_0x43b419(0x1b0)]+_0x43b419(0x150)));if(_0x51cfbd[_0x43b419(0x1a3)]!==undefined&&_0x51cfbd[_0x43b419(0x1a3)]>0x0)_0x3c9c92[_0x43b419(0x145)](a4_0x187973[_0x43b419(0x176)](_0x51cfbd['errors']+_0x43b419(0x17d)));return _0x3c9c92[_0x43b419(0x1ad)](',\x20');}function displayDiffs(_0x559fa3,_0xba8e8d,_0x100227,_0x3a2cc2,_0x4b4925,_0x39d62e,_0x1327b5){const _0x1315af=a4_0x43b2;for(const _0x35f9b0 of _0x559fa3){if(_0x35f9b0[_0x1315af(0x16a)]){const _0x430d76=_0x35f9b0['agentName']||_0x35f9b0[_0x1315af(0x1ae)];console[_0x1315af(0x115)](_0x1315af(0x19d)+_0x430d76+'\x27:'),console['log']('─'[_0x1315af(0x182)](0x3c)),console[_0x1315af(0x115)](_0x35f9b0[_0x1315af(0x16a)]),console[_0x1315af(0x115)]('─'[_0x1315af(0x182)](0x3c));}}for(const _0x1d1ada of _0xba8e8d){_0x1d1ada[_0x1315af(0x16a)]&&(console['log'](_0x1315af(0x174)+_0x1d1ada[_0x1315af(0x1ae)]+'\x27:'),console[_0x1315af(0x115)]('─'[_0x1315af(0x182)](0x3c)),console['log'](_0x1d1ada[_0x1315af(0x16a)]),console[_0x1315af(0x115)]('─'[_0x1315af(0x182)](0x3c)));}for(const _0xeae45d of _0x100227){_0xeae45d[_0x1315af(0x16a)]&&(console[_0x1315af(0x115)](_0x1315af(0x17f)+_0xeae45d[_0x1315af(0x1ae)]+'\x27:'),console[_0x1315af(0x115)]('─'[_0x1315af(0x182)](0x3c)),console[_0x1315af(0x115)](_0xeae45d['diff']),console['log']('─'[_0x1315af(0x182)](0x3c)));}for(const _0x587050 of _0x3a2cc2){_0x587050[_0x1315af(0x16a)]&&(console['log'](_0x1315af(0x18e)+_0x587050['name']+'\x27:'),console[_0x1315af(0x115)]('─'[_0x1315af(0x182)](0x3c)),console[_0x1315af(0x115)](_0x587050[_0x1315af(0x16a)]),console['log']('─'[_0x1315af(0x182)](0x3c)));}for(const _0x549479 of _0x4b4925){_0x549479['diff']&&(console['log'](_0x1315af(0x125)+_0x549479['name']+'\x27:'),console[_0x1315af(0x115)]('─'[_0x1315af(0x182)](0x3c)),console[_0x1315af(0x115)](_0x549479['diff']),console[_0x1315af(0x115)]('─'[_0x1315af(0x182)](0x3c)));}for(const _0x409ea0 of _0x39d62e){_0x409ea0[_0x1315af(0x16a)]&&(console[_0x1315af(0x115)](_0x1315af(0x18b)+_0x409ea0['name']+'\x27:'),console[_0x1315af(0x115)]('─'[_0x1315af(0x182)](0x3c)),console['log'](_0x409ea0[_0x1315af(0x16a)]),console[_0x1315af(0x115)]('─'[_0x1315af(0x182)](0x3c)));}for(const _0x4e6479 of _0x1327b5){_0x4e6479[_0x1315af(0x16a)]&&(console[_0x1315af(0x115)](_0x1315af(0x172)+_0x4e6479[_0x1315af(0x1ae)]+'\x27:'),console[_0x1315af(0x115)]('─'[_0x1315af(0x182)](0x3c)),console[_0x1315af(0x115)](_0x4e6479[_0x1315af(0x16a)]),console['log']('─'[_0x1315af(0x182)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x5f1e4e(0x1ae)]=a4_0x5f1e4e(0x109);[a4_0x5f1e4e(0x169)]=a4_0x5f1e4e(0xfc);async[a4_0x5f1e4e(0x151)](_0x13a64e){const _0x4900d6=a4_0x5f1e4e,{options:_0x1c06e1,args:_0xb796e4,tdx:_0x26a4ba}=_0x13a64e,_0x534879=_0xb796e4[0x0],_0x1e5ae5=_0xb796e4[0x1],_0x384f38=_0x1c06e1[_0x4900d6(0x189)],_0x4f633a=_0x1c06e1['dryRun'],_0x285aae=_0x1c06e1['force'],_0x3cca24=_0x1c06e1['yes'],_0xc787a9=_0x1c06e1[_0x4900d6(0x140)],_0x29ee0d=_0x1c06e1[_0x4900d6(0x121)];let _0x30f79d;if(_0x534879){const _0x31e482=a4_0x1e3af3[_0x4900d6(0x1ad)](_0x534879,_0x4900d6(0x122));if(existsSync(_0x31e482))try{const _0x30ae3d=JSON[_0x4900d6(0x1a8)](readFileSync(_0x31e482,_0x4900d6(0x1a2)));_0x30ae3d['llm_project']&&(_0x30f79d={'llm_project':_0x30ae3d[_0x4900d6(0x141)]});}catch{}}const _0x5d36c4=findAgentConfigPath(process['cwd']());let _0x26df98;if(_0x5d36c4)try{const _0xa43dd0=JSON[_0x4900d6(0x1a8)](readFileSync(_0x5d36c4,_0x4900d6(0x1a2)));_0xa43dd0[_0x4900d6(0x141)]&&(_0x26df98={'llm_project':_0xa43dd0['llm_project']});}catch{}const _0x2c4887=resolveAgentPullArgs({'arg':_0x534879,'agentNameArg':_0x1e5ae5,'agentFlag':_0x29ee0d,'contextProject':_0xc787a9,'argDirConfig':_0x30f79d,'cwdConfigPath':_0x5d36c4||undefined,'cwdConfig':_0x26df98}),{projectNameOrId:_0x58b1cc,targetAgentName:_0x39b8fe,existingOutputDir:_0xeeeff7,source:_0x278334}=_0x2c4887;if(_0x278334===_0x4900d6(0x166))console[_0x4900d6(0x115)](a4_0x187973[_0x4900d6(0x180)](_0x4900d6(0x1a4)+a4_0x1e3af3[_0x4900d6(0x1ad)](_0x534879,_0x4900d6(0x122))+':\x20'+_0x58b1cc));else{if(_0x278334===_0x4900d6(0x144))console['log'](a4_0x187973[_0x4900d6(0x180)](_0x4900d6(0x171)+_0x58b1cc));else _0x278334==='context'&&console[_0x4900d6(0x115)](a4_0x187973['dim']('Using\x20project\x20from\x20context:\x20'+_0x58b1cc));}if(!_0x58b1cc)return _0x29ee0d?(console['log'](a4_0x187973[_0x4900d6(0x12c)](_0x4900d6(0x100))),console[_0x4900d6(0x115)](_0x4900d6(0x104)),console['log'](_0x4900d6(0x110))):(console[_0x4900d6(0x115)](a4_0x187973[_0x4900d6(0x12c)]('llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a')),console[_0x4900d6(0x115)]('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[_0x4900d6(0x115)](_0x4900d6(0x127)),console[_0x4900d6(0x115)](_0x4900d6(0x126)),console[_0x4900d6(0x115)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20--agent\x20<name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20context\x20project'),console[_0x4900d6(0x115)](_0x4900d6(0x194))),0x1;if(_0x39b8fe){const {data:_0x1d8daf}=await withSpinner('Pulling\x20agent\x20\x22'+_0x39b8fe+'\x22\x20from\x20project\x20\x22'+_0x58b1cc+_0x4900d6(0x132),()=>_0x26a4ba['llm'][_0x4900d6(0x160)](_0x58b1cc,_0x39b8fe,_0x384f38,{'dryRun':_0x4f633a,'force':_0x285aae}));if(_0x4f633a)return console['log'](a4_0x187973[_0x4900d6(0x12c)](_0x4900d6(0x153))),console['log'](_0x4900d6(0x161)+_0x1d8daf[_0x4900d6(0x15c)]),console[_0x4900d6(0x115)](_0x4900d6(0x11b)+_0x1d8daf['outputPath']),_0x1d8daf[_0x4900d6(0x16a)]&&(console['log'](_0x4900d6(0xfb)),console['log']('─'[_0x4900d6(0x182)](0x3c)),console[_0x4900d6(0x115)](_0x1d8daf['diff']),console[_0x4900d6(0x115)]('─'['repeat'](0x3c))),0x0;return console[_0x4900d6(0x115)](a4_0x187973['green'](_0x4900d6(0x152))),console['log'](_0x4900d6(0x14d)+_0x1d8daf[_0x4900d6(0x15c)]),console[_0x4900d6(0x115)](_0x4900d6(0xfd)+_0x1d8daf['outputPath']),console['log']('Status:\x20'+(_0x1d8daf[_0x4900d6(0x163)]?a4_0x187973[_0x4900d6(0x136)](_0x4900d6(0x148)):_0x1d8daf[_0x4900d6(0x19e)]?a4_0x187973[_0x4900d6(0x12c)]('updated'):a4_0x187973[_0x4900d6(0x156)]('unchanged'))),0x0;}const _0x1374cf=_0xeeeff7||_0x384f38,{data:_0x49a315}=await withSpinner('Analyzing\x20project\x20\x22'+_0x58b1cc+_0x4900d6(0x132),()=>_0x26a4ba['llm'][_0x4900d6(0x15b)](_0x58b1cc,_0x1374cf,{'dryRun':!![]})),_0xea32d=_0x49a315['counts'][_0x4900d6(0xff)][_0x4900d6(0x148)]+_0x49a315[_0x4900d6(0x133)][_0x4900d6(0x181)][_0x4900d6(0x148)]+_0x49a315[_0x4900d6(0x133)][_0x4900d6(0x17a)][_0x4900d6(0x148)]+_0x49a315[_0x4900d6(0x133)][_0x4900d6(0x198)][_0x4900d6(0x148)]+_0x49a315[_0x4900d6(0x133)][_0x4900d6(0x179)][_0x4900d6(0x148)]+_0x49a315[_0x4900d6(0x133)]['experimentalKnowledgeBases'][_0x4900d6(0x148)]+_0x49a315[_0x4900d6(0x133)][_0x4900d6(0x164)][_0x4900d6(0x148)],_0x3b9997=_0x49a315[_0x4900d6(0x133)][_0x4900d6(0xff)]['updated']+_0x49a315['counts'][_0x4900d6(0x181)][_0x4900d6(0x10a)]+_0x49a315[_0x4900d6(0x133)][_0x4900d6(0x17a)]['updated']+_0x49a315['counts'][_0x4900d6(0x198)][_0x4900d6(0x10a)]+_0x49a315[_0x4900d6(0x133)][_0x4900d6(0x179)][_0x4900d6(0x10a)]+_0x49a315[_0x4900d6(0x133)]['experimentalKnowledgeBases'][_0x4900d6(0x10a)]+_0x49a315['counts'][_0x4900d6(0x164)]['updated'],_0x5deb7b=_0x49a315[_0x4900d6(0x133)][_0x4900d6(0xff)]['unchanged']+_0x49a315[_0x4900d6(0x133)][_0x4900d6(0x181)][_0x4900d6(0x1b0)]+_0x49a315['counts'][_0x4900d6(0x17a)][_0x4900d6(0x1b0)]+_0x49a315[_0x4900d6(0x133)]['prompts'][_0x4900d6(0x1b0)]+_0x49a315['counts'][_0x4900d6(0x179)][_0x4900d6(0x1b0)]+_0x49a315[_0x4900d6(0x133)][_0x4900d6(0x168)][_0x4900d6(0x1b0)]+_0x49a315[_0x4900d6(0x133)][_0x4900d6(0x164)][_0x4900d6(0x1b0)];console[_0x4900d6(0x115)]('\x0aPull\x20summary\x20for\x20\x27'+_0x49a315[_0x4900d6(0x15e)]+'\x27:'),console[_0x4900d6(0x115)]('\x20\x20'+a4_0x187973[_0x4900d6(0x136)]('+\x20'+_0xea32d+_0x4900d6(0x19a))+_0x4900d6(0x128)+a4_0x187973[_0x4900d6(0x12c)]('~\x20'+_0x3b9997+'\x20changed')+_0x4900d6(0x128)+a4_0x187973[_0x4900d6(0x180)]('=\x20'+_0x5deb7b+'\x20unchanged')),console[_0x4900d6(0x115)](_0x4900d6(0x1a1)+formatCountSummary(_0x49a315[_0x4900d6(0x133)][_0x4900d6(0xff)])),console['log']('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x49a315['counts']['knowledgeBases'])),console[_0x4900d6(0x115)](_0x4900d6(0x199)+formatCountSummary(_0x49a315[_0x4900d6(0x133)][_0x4900d6(0x17a)])),console[_0x4900d6(0x115)](_0x4900d6(0x167)+formatCountSummary(_0x49a315['counts'][_0x4900d6(0x198)])),console[_0x4900d6(0x115)](_0x4900d6(0x13f)+formatCountSummary(_0x49a315[_0x4900d6(0x133)]['integrations']));const _0x2f5ed2=_0x49a315[_0x4900d6(0x133)][_0x4900d6(0x168)][_0x4900d6(0x135)]>0x0||_0x49a315[_0x4900d6(0x133)][_0x4900d6(0x164)][_0x4900d6(0x135)]>0x0;_0x2f5ed2&&(console['log'](_0x4900d6(0x1a5)+formatCountSummary(_0x49a315['counts']['experimentalKnowledgeBases'])),console[_0x4900d6(0x115)](_0x4900d6(0x14c)+formatCountSummary(_0x49a315[_0x4900d6(0x133)]['experimentalArtifacts'])));console[_0x4900d6(0x115)]('\x20\x20Target:\x20'+a4_0x187973[_0x4900d6(0x134)](_0x49a315[_0x4900d6(0x157)])),displayDiffs(_0x49a315[_0x4900d6(0xff)],_0x49a315[_0x4900d6(0x181)],_0x49a315[_0x4900d6(0x17a)],_0x49a315[_0x4900d6(0x198)],_0x49a315['integrations'],_0x49a315[_0x4900d6(0x168)],_0x49a315[_0x4900d6(0x164)]);if(_0x4f633a)return console[_0x4900d6(0x115)](a4_0x187973['yellow']('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0xea32d===0x0&&_0x3b9997===0x0)return console[_0x4900d6(0x115)](a4_0x187973['green']('\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'llm_project':_0x49a315[_0x4900d6(0x15e)]},_0x1c06e1[_0x4900d6(0x12b)]),console[_0x4900d6(0x115)](a4_0x187973[_0x4900d6(0x136)](_0x4900d6(0x18f)+a4_0x187973[_0x4900d6(0x180)](_0x4900d6(0x141))+_0x4900d6(0x149)+a4_0x187973[_0x4900d6(0x134)](_0x49a315[_0x4900d6(0x15e)]))),0x0;if(!_0x3cca24&&!_0x285aae){if(!isInteractive())return console['error'](a4_0x187973['red'](_0x4900d6(0x112)),_0x4900d6(0x15a)),console['error'](a4_0x187973[_0x4900d6(0x180)](_0x4900d6(0x193))),0x1;const _0x4e608b=await confirmKey(_0x4900d6(0x123)+(_0xea32d+_0x3b9997)+_0x4900d6(0x187));if(!_0x4e608b)return console[_0x4900d6(0x115)](a4_0x187973[_0x4900d6(0x12c)](_0x4900d6(0x14f)),_0x4900d6(0x11c)),0x1;}const {data:_0x365be2}=await withSpinner(_0x4900d6(0x154),()=>_0x26a4ba[_0x4900d6(0x138)]['pullProject'](_0x58b1cc,_0x1374cf,{'force':_0x285aae}));return console[_0x4900d6(0x115)](a4_0x187973[_0x4900d6(0x136)](_0x4900d6(0x117)+(_0xea32d+_0x3b9997)+_0x4900d6(0x15f)+_0x365be2[_0x4900d6(0x157)])),saveSessionContext({'llm_project':_0x365be2[_0x4900d6(0x15e)]},_0x1c06e1['session']),console[_0x4900d6(0x115)](a4_0x187973[_0x4900d6(0x136)]('✔\x20Context\x20set:\x20'+a4_0x187973[_0x4900d6(0x180)](_0x4900d6(0x141))+_0x4900d6(0x149)+a4_0x187973[_0x4900d6(0x134)](_0x365be2['projectName']))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x5f1e4e(0x1ae)]='agent:clone';[a4_0x5f1e4e(0x169)]=a4_0x5f1e4e(0x178);async[a4_0x5f1e4e(0x151)](_0x4e5c09){const _0x17c2c6=a4_0x5f1e4e,{options:_0x184d35,args:_0x2f5749,tdx:_0x21eacd}=_0x4e5c09,_0x45ec7e=_0x2f5749[0x0],_0xc7a0bd=_0x184d35[_0x17c2c6(0x1ae)],_0x2f9388=_0x184d35[_0x17c2c6(0x12e)],_0x237704=_0x184d35[_0x17c2c6(0x11f)],_0x2a7fb5=_0x184d35[_0x17c2c6(0x124)],_0x2cbe98=_0x184d35['llmProject'];let _0xf2983f;const _0x5849d8=findAgentConfigPath(process[_0x17c2c6(0x129)]());if(_0x45ec7e){const _0x2b59a8=a4_0x1e3af3[_0x17c2c6(0x1ad)](_0x45ec7e,_0x17c2c6(0x122));existsSync(_0x2b59a8)?(_0xf2983f=_0x45ec7e,console['log'](a4_0x187973[_0x17c2c6(0x180)](_0x17c2c6(0x190)+_0x45ec7e))):_0xf2983f=_0x45ec7e;}else{if(_0x5849d8)_0xf2983f=a4_0x1e3af3['dirname'](_0x5849d8),console[_0x17c2c6(0x115)](a4_0x187973[_0x17c2c6(0x180)](_0x17c2c6(0x16c)+_0xf2983f));else{if(_0x2cbe98){const _0x335895=sanitizeForFilesystem(_0x2cbe98);let _0x3e05d2=_0x335895,_0x3acddb=a4_0x1e3af3[_0x17c2c6(0x1ad)](process[_0x17c2c6(0x129)](),_0x17c2c6(0xff),_0x335895,_0x17c2c6(0x122));if(!existsSync(_0x3acddb)){const _0x4c2d83=normalizeName(_0x2cbe98),_0x58bf9d=a4_0x1e3af3[_0x17c2c6(0x1ad)](process[_0x17c2c6(0x129)](),_0x17c2c6(0xff),_0x4c2d83,_0x17c2c6(0x122));existsSync(_0x58bf9d)&&(_0x3e05d2=_0x4c2d83,_0x3acddb=_0x58bf9d);}if(existsSync(_0x3acddb))_0xf2983f=a4_0x1e3af3[_0x17c2c6(0x191)](_0x3acddb),console[_0x17c2c6(0x115)](a4_0x187973[_0x17c2c6(0x180)]('Using\x20local\x20project:\x20'+_0xf2983f));else{const _0x304340=_0x184d35[_0x17c2c6(0x184)];if(_0x304340)throw new SDKError(ErrorCode[_0x17c2c6(0x10f)],'Cannot\x20clone\x20from\x20context\x20project\x20\x22'+_0x2cbe98+_0x17c2c6(0x13a),undefined,{'helpText':_0x17c2c6(0x118)+_0x17c2c6(0x11a)+(_0x17c2c6(0x1b2)+_0x2cbe98+'\x0a')+(_0x17c2c6(0x119)+_0x3e05d2+_0x17c2c6(0x1ac)+(_0xc7a0bd||'<new-name>')+_0x17c2c6(0x142)+_0x304340)});_0xf2983f=_0x2cbe98,console[_0x17c2c6(0x115)](a4_0x187973['dim'](_0x17c2c6(0x14e)+_0x2cbe98));}}}}if(!_0xf2983f)return console[_0x17c2c6(0x115)](a4_0x187973['yellow'](_0x17c2c6(0x159))),console[_0x17c2c6(0x115)](_0x17c2c6(0x17e)),console[_0x17c2c6(0x115)](_0x17c2c6(0x131)),console[_0x17c2c6(0x115)](_0x17c2c6(0x147)),console[_0x17c2c6(0x115)](_0x17c2c6(0x14a)),0x1;if(!_0xc7a0bd)throw new SDKError(ErrorCode[_0x17c2c6(0x107)],_0x17c2c6(0x139),undefined,{'helpText':_0x17c2c6(0x11e)});if(!_0x237704&&!_0x2f9388){if(!isInteractive())return console[_0x17c2c6(0x114)](a4_0x187973[_0x17c2c6(0x176)](_0x17c2c6(0x112)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x17c2c6(0x114)](a4_0x187973[_0x17c2c6(0x180)](_0x17c2c6(0x193))),0x1;const _0x443c48=await confirmKey(_0x17c2c6(0x186)+_0xf2983f+_0x17c2c6(0x175)+_0xc7a0bd+'\x22?');if(!_0x443c48)return console['log'](a4_0x187973[_0x17c2c6(0x12c)](_0x17c2c6(0x14f))),0x1;}const {data:_0x33a0de}=await withSpinner(_0x17c2c6(0x158)+_0xf2983f+_0x17c2c6(0x103)+_0xc7a0bd+'\x22...',()=>_0x21eacd['llm'][_0x17c2c6(0x17c)](_0xf2983f,_0xc7a0bd,{'dryRun':_0x2f9388}));if(_0x2f9388){console[_0x17c2c6(0x115)](a4_0x187973[_0x17c2c6(0x12c)](_0x17c2c6(0x12a))),console[_0x17c2c6(0x115)](_0x17c2c6(0x18a)+_0x33a0de[_0x17c2c6(0x12f)]),console['log'](_0x17c2c6(0x16d)+_0xc7a0bd),console[_0x17c2c6(0x115)](_0x17c2c6(0x105)),console[_0x17c2c6(0x115)](_0x17c2c6(0x1a1)+_0x33a0de[_0x17c2c6(0x133)][_0x17c2c6(0xff)]['created']),console[_0x17c2c6(0x115)](_0x17c2c6(0x188)+_0x33a0de[_0x17c2c6(0x133)][_0x17c2c6(0x181)][_0x17c2c6(0x183)]),console[_0x17c2c6(0x115)](_0x17c2c6(0x167)+_0x33a0de[_0x17c2c6(0x133)][_0x17c2c6(0x198)]['created']);const _0x3890e2=_0x33a0de[_0x17c2c6(0x133)]['experimentalKnowledgeBases'][_0x17c2c6(0x183)]>0x0||_0x33a0de['counts'][_0x17c2c6(0x164)][_0x17c2c6(0x183)]>0x0;return _0x3890e2&&(console[_0x17c2c6(0x115)](_0x17c2c6(0x1a5)+_0x33a0de[_0x17c2c6(0x133)][_0x17c2c6(0x168)][_0x17c2c6(0x183)]),console[_0x17c2c6(0x115)](_0x17c2c6(0x14c)+_0x33a0de[_0x17c2c6(0x133)]['experimentalArtifacts'][_0x17c2c6(0x183)])),0x0;}const _0x2b30a4=_0x33a0de[_0x17c2c6(0x133)][_0x17c2c6(0xff)][_0x17c2c6(0x1a3)]>0x0||_0x33a0de['counts']['knowledgeBases'][_0x17c2c6(0x1a3)]>0x0||_0x33a0de[_0x17c2c6(0x133)][_0x17c2c6(0x198)][_0x17c2c6(0x1a3)]>0x0||_0x33a0de[_0x17c2c6(0x133)]['experimentalKnowledgeBases'][_0x17c2c6(0x1a3)]>0x0||_0x33a0de[_0x17c2c6(0x133)][_0x17c2c6(0x164)]['errors']>0x0;_0x2b30a4?console[_0x17c2c6(0x115)](a4_0x187973['yellow']('Project\x20cloned\x20with\x20errors')):console[_0x17c2c6(0x115)](a4_0x187973[_0x17c2c6(0x136)]('Project\x20cloned\x20successfully'));console[_0x17c2c6(0x115)](_0x17c2c6(0x18a)+_0x33a0de[_0x17c2c6(0x12f)]),console[_0x17c2c6(0x115)](_0x17c2c6(0x16d)+_0x33a0de['newProjectName']),console[_0x17c2c6(0x115)](_0x17c2c6(0x143)+_0x33a0de['newProjectId']),console[_0x17c2c6(0x115)](),console['log'](_0x17c2c6(0x177)),console[_0x17c2c6(0x115)]('\x20\x20Agents:\x20'+formatCountSummary(_0x33a0de[_0x17c2c6(0x133)][_0x17c2c6(0xff)])),console[_0x17c2c6(0x115)](_0x17c2c6(0x188)+formatCountSummary(_0x33a0de['counts'][_0x17c2c6(0x181)])),console[_0x17c2c6(0x115)](_0x17c2c6(0x167)+formatCountSummary(_0x33a0de['counts'][_0x17c2c6(0x198)])),console[_0x17c2c6(0x115)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x33a0de[_0x17c2c6(0x133)]['integrations']));const _0x19c6fb=_0x33a0de[_0x17c2c6(0x133)][_0x17c2c6(0x168)][_0x17c2c6(0x183)]>0x0||_0x33a0de[_0x17c2c6(0x133)][_0x17c2c6(0x168)][_0x17c2c6(0x10a)]>0x0||_0x33a0de[_0x17c2c6(0x133)][_0x17c2c6(0x168)]['unchanged']>0x0||_0x33a0de[_0x17c2c6(0x133)]['experimentalArtifacts'][_0x17c2c6(0x183)]>0x0||_0x33a0de[_0x17c2c6(0x133)]['experimentalArtifacts'][_0x17c2c6(0x10a)]>0x0||_0x33a0de[_0x17c2c6(0x133)]['experimentalArtifacts'][_0x17c2c6(0x1b0)]>0x0;_0x19c6fb&&(console['log'](_0x17c2c6(0x1a5)+formatCountSummary(_0x33a0de['counts']['experimentalKnowledgeBases'])),console[_0x17c2c6(0x115)](_0x17c2c6(0x14c)+formatCountSummary(_0x33a0de['counts']['experimentalArtifacts'])));if(_0x2b30a4){console[_0x17c2c6(0x115)](),console[_0x17c2c6(0x115)](a4_0x187973[_0x17c2c6(0x176)](_0x17c2c6(0x10d)));for(const _0x58599c of _0x33a0de[_0x17c2c6(0xff)]){_0x58599c[_0x17c2c6(0x17b)]===_0x17c2c6(0x114)&&console[_0x17c2c6(0x115)](a4_0x187973[_0x17c2c6(0x176)](_0x17c2c6(0x106)+_0x58599c[_0x17c2c6(0x15c)]+_0x17c2c6(0x155)+_0x58599c[_0x17c2c6(0x114)]));}for(const _0x8cfeb8 of _0x33a0de['knowledgeBases']){_0x8cfeb8[_0x17c2c6(0x17b)]===_0x17c2c6(0x114)&&console[_0x17c2c6(0x115)](a4_0x187973[_0x17c2c6(0x176)](_0x17c2c6(0xfe)+_0x8cfeb8[_0x17c2c6(0x1ae)]+'\x22:\x20'+_0x8cfeb8['error']));}for(const _0x311c0a of _0x33a0de[_0x17c2c6(0x198)]){_0x311c0a[_0x17c2c6(0x17b)]===_0x17c2c6(0x114)&&console[_0x17c2c6(0x115)](a4_0x187973[_0x17c2c6(0x176)]('\x20\x20Prompt\x20\x22'+_0x311c0a[_0x17c2c6(0x1ae)]+_0x17c2c6(0x155)+_0x311c0a[_0x17c2c6(0x114)]));}for(const _0xf9f9f0 of _0x33a0de['integrations']){_0xf9f9f0['action']===_0x17c2c6(0x114)&&console[_0x17c2c6(0x115)](a4_0x187973['red'](_0x17c2c6(0x111)+_0xf9f9f0[_0x17c2c6(0x1ae)]+'\x22:\x20'+_0xf9f9f0['error']));}for(const _0x39d273 of _0x33a0de['experimentalKnowledgeBases']){_0x39d273['action']==='error'&&console[_0x17c2c6(0x115)](a4_0x187973[_0x17c2c6(0x176)](_0x17c2c6(0x11d)+_0x39d273['name']+'\x22:\x20'+_0x39d273[_0x17c2c6(0x114)]));}for(const _0x561a97 of _0x33a0de['experimentalArtifacts']){_0x561a97[_0x17c2c6(0x17b)]===_0x17c2c6(0x114)&&console[_0x17c2c6(0x115)](a4_0x187973[_0x17c2c6(0x176)](_0x17c2c6(0x14b)+_0x561a97[_0x17c2c6(0x1ae)]+_0x17c2c6(0x155)+_0x561a97['error']));}return 0x1;}console[_0x17c2c6(0x115)]();const _0x18d37e=getLLMProjectUrl(_0x2a7fb5,_0x33a0de[_0x17c2c6(0x19f)]);return console[_0x17c2c6(0x115)](_0x17c2c6(0x116)+a4_0x187973[_0x17c2c6(0x134)](_0x18d37e)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x5f1e4e(0x1ae)]=a4_0x5f1e4e(0x13e);[a4_0x5f1e4e(0x169)]=a4_0x5f1e4e(0x1a0);async[a4_0x5f1e4e(0x151)](_0x161319){const _0x113bbb=a4_0x5f1e4e,{options:_0x329f27,args:_0x35b9e0,tdx:_0x55dc89}=_0x161319;let _0x49ade1=_0x35b9e0[0x0]||process[_0x113bbb(0x129)]();const _0x874292=_0x329f27[_0x113bbb(0x12e)],_0x19561c=_0x329f27[_0x113bbb(0x197)],_0x34b921=_0x329f27[_0x113bbb(0x11f)],_0xc1b2ad=_0x329f27[_0x113bbb(0x124)],_0x4d6771=a4_0x1e3af3[_0x113bbb(0x1ad)](_0x49ade1,'agent.yml'),_0x54f2e7=existsSync(_0x4d6771);if(_0x54f2e7){const {data:_0x2abc38}=await withSpinner(_0x113bbb(0x15d)+_0x49ade1+_0x113bbb(0x132),()=>_0x55dc89[_0x113bbb(0x138)]['pushAgent'](_0x49ade1,{'dryRun':_0x874292,'force':_0x19561c}));if(_0x874292)return console[_0x113bbb(0x115)](a4_0x187973[_0x113bbb(0x12c)](_0x113bbb(0x12a))),console[_0x113bbb(0x115)]('Would\x20push\x20agent:\x20'+_0x2abc38[_0x113bbb(0x15c)]),0x0;if(_0x2abc38['action']===_0x113bbb(0x114))return console[_0x113bbb(0x115)](a4_0x187973['red'](_0x113bbb(0x146)+_0x2abc38[_0x113bbb(0x114)])),0x1;console[_0x113bbb(0x115)](a4_0x187973['green'](_0x113bbb(0x113)+_0x2abc38[_0x113bbb(0x17b)]+_0x113bbb(0x16e))),console['log'](_0x113bbb(0x14d)+_0x2abc38[_0x113bbb(0x15c)]);if(_0x2abc38[_0x113bbb(0x137)]&&_0x2abc38[_0x113bbb(0x13c)]){const _0x51dab7=getLLMAgentChatUrl(_0xc1b2ad,_0x2abc38[_0x113bbb(0x13c)],_0x2abc38[_0x113bbb(0x137)]);console[_0x113bbb(0x115)](_0x113bbb(0x195)+a4_0x187973['cyan'](_0x51dab7));}return 0x0;}const _0x997b82=_0x329f27[_0x113bbb(0x140)],_0x4d3451=resolveProjectFromContext(_0x49ade1,_0x997b82);if(_0x4d3451[_0x113bbb(0x1a6)])_0x49ade1=_0x4d3451[_0x113bbb(0x12d)],_0x4d3451['source']===_0x113bbb(0x1a9)&&console[_0x113bbb(0x115)](a4_0x187973[_0x113bbb(0x180)](_0x113bbb(0x171)+_0x49ade1));else{let _0x290116=_0x113bbb(0x120);_0x4d3451[_0x113bbb(0x185)]==='no_local_folder'&&(_0x290116=_0x4d3451[_0x113bbb(0x13d)]+'\x0aRun\x20\x27tdx\x20agent\x20pull\x20'+_0x4d3451[_0x113bbb(0x140)]+'\x27\x20to\x20create\x20the\x20folder\x20structure.');throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x4d3451['reason']===_0x113bbb(0x19c)?_0x4d3451[_0x113bbb(0x13d)]:'No\x20tdx.json\x20found\x20in\x20'+_0x49ade1,undefined,{'helpText':_0x290116});}const {data:_0x349f16}=await withSpinner('Analyzing\x20changes\x20to\x20push...',()=>_0x55dc89[_0x113bbb(0x138)][_0x113bbb(0x1aa)](_0x49ade1,{'dryRun':!![]})),_0x1f249c=_0x349f16[_0x113bbb(0x133)][_0x113bbb(0xff)]['errors']>0x0;if(_0x1f249c){console[_0x113bbb(0x115)](a4_0x187973[_0x113bbb(0x176)]('\x0aErrors\x20found:'));for(const _0x4409c2 of _0x349f16[_0x113bbb(0xff)]){_0x4409c2[_0x113bbb(0x17b)]===_0x113bbb(0x114)&&console[_0x113bbb(0x115)](a4_0x187973[_0x113bbb(0x176)](_0x113bbb(0x106)+_0x4409c2[_0x113bbb(0x15c)]+_0x113bbb(0x155)+_0x4409c2['error']));}return 0x1;}const _0x2941bb=_0x349f16[_0x113bbb(0x133)]['agents'][_0x113bbb(0x183)]+_0x349f16[_0x113bbb(0x133)][_0x113bbb(0x181)]['created']+_0x349f16[_0x113bbb(0x133)]['textKnowledgeBases'][_0x113bbb(0x183)]+_0x349f16[_0x113bbb(0x133)][_0x113bbb(0x198)][_0x113bbb(0x183)]+_0x349f16['counts']['integrations']['created']+_0x349f16['counts'][_0x113bbb(0x168)][_0x113bbb(0x183)]+_0x349f16[_0x113bbb(0x133)][_0x113bbb(0x164)]['created'],_0x43166f=_0x349f16[_0x113bbb(0x133)][_0x113bbb(0xff)][_0x113bbb(0x10a)]+_0x349f16[_0x113bbb(0x133)]['knowledgeBases'][_0x113bbb(0x10a)]+_0x349f16[_0x113bbb(0x133)][_0x113bbb(0x17a)][_0x113bbb(0x10a)]+_0x349f16[_0x113bbb(0x133)][_0x113bbb(0x198)][_0x113bbb(0x10a)]+_0x349f16[_0x113bbb(0x133)][_0x113bbb(0x179)]['updated']+_0x349f16[_0x113bbb(0x133)][_0x113bbb(0x168)][_0x113bbb(0x10a)]+_0x349f16[_0x113bbb(0x133)][_0x113bbb(0x164)]['updated'],_0x6238ed=_0x349f16[_0x113bbb(0x133)][_0x113bbb(0xff)]['unchanged']+_0x349f16[_0x113bbb(0x133)][_0x113bbb(0x181)][_0x113bbb(0x1b0)]+_0x349f16[_0x113bbb(0x133)][_0x113bbb(0x17a)]['unchanged']+_0x349f16['counts'][_0x113bbb(0x198)][_0x113bbb(0x1b0)]+_0x349f16[_0x113bbb(0x133)][_0x113bbb(0x179)][_0x113bbb(0x1b0)]+_0x349f16['counts'][_0x113bbb(0x168)]['unchanged']+_0x349f16[_0x113bbb(0x133)]['experimentalArtifacts'][_0x113bbb(0x1b0)];console['log'](_0x113bbb(0x16f)+_0x349f16[_0x113bbb(0x15e)]+'\x27:'),console[_0x113bbb(0x115)]('\x20\x20'+a4_0x187973[_0x113bbb(0x136)]('+\x20'+_0x2941bb+_0x113bbb(0x19a))+_0x113bbb(0x128)+a4_0x187973['yellow']('~\x20'+_0x43166f+'\x20changed')+'\x20|\x20'+a4_0x187973[_0x113bbb(0x180)]('=\x20'+_0x6238ed+_0x113bbb(0x150))),console[_0x113bbb(0x115)](_0x113bbb(0x1a1)+formatCountSummary(_0x349f16[_0x113bbb(0x133)][_0x113bbb(0xff)])),console[_0x113bbb(0x115)](_0x113bbb(0x188)+formatCountSummary(_0x349f16[_0x113bbb(0x133)][_0x113bbb(0x181)])),console[_0x113bbb(0x115)](_0x113bbb(0x199)+formatCountSummary(_0x349f16[_0x113bbb(0x133)][_0x113bbb(0x17a)])),console[_0x113bbb(0x115)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x349f16[_0x113bbb(0x133)][_0x113bbb(0x198)])),console[_0x113bbb(0x115)](_0x113bbb(0x13f)+formatCountSummary(_0x349f16[_0x113bbb(0x133)][_0x113bbb(0x179)]));const _0x4820dd=_0x349f16[_0x113bbb(0x133)][_0x113bbb(0x168)]['created']>0x0||_0x349f16[_0x113bbb(0x133)][_0x113bbb(0x168)][_0x113bbb(0x10a)]>0x0||_0x349f16[_0x113bbb(0x133)]['experimentalKnowledgeBases']['unchanged']>0x0||_0x349f16[_0x113bbb(0x133)][_0x113bbb(0x164)][_0x113bbb(0x183)]>0x0||_0x349f16[_0x113bbb(0x133)][_0x113bbb(0x164)][_0x113bbb(0x10a)]>0x0||_0x349f16[_0x113bbb(0x133)][_0x113bbb(0x164)][_0x113bbb(0x1b0)]>0x0;_0x4820dd&&(console['log'](_0x113bbb(0x1a5)+formatCountSummary(_0x349f16[_0x113bbb(0x133)][_0x113bbb(0x168)])),console[_0x113bbb(0x115)](_0x113bbb(0x14c)+formatCountSummary(_0x349f16['counts'][_0x113bbb(0x164)])));console[_0x113bbb(0x115)]('\x20\x20Source:\x20'+a4_0x187973[_0x113bbb(0x134)](_0x49ade1)),displayDiffs(_0x349f16['agents'],_0x349f16['knowledgeBases'],_0x349f16[_0x113bbb(0x17a)],_0x349f16[_0x113bbb(0x198)],_0x349f16[_0x113bbb(0x179)],_0x349f16[_0x113bbb(0x168)],_0x349f16[_0x113bbb(0x164)]);if(_0x874292)return console[_0x113bbb(0x115)](a4_0x187973[_0x113bbb(0x12c)](_0x113bbb(0x10e))),0x0;if(_0x2941bb===0x0&&_0x43166f===0x0){console[_0x113bbb(0x115)](a4_0x187973[_0x113bbb(0x136)](_0x113bbb(0x1ab)));const _0x5bf455=getLLMProjectUrl(_0xc1b2ad,_0x349f16[_0x113bbb(0x13c)]);return console['log'](_0x113bbb(0x116)+a4_0x187973[_0x113bbb(0x134)](_0x5bf455)),0x0;}if(!_0x34b921&&!_0x19561c){if(!isInteractive())return console['error'](a4_0x187973['red'](_0x113bbb(0x112)),_0x113bbb(0x15a)),console[_0x113bbb(0x114)](a4_0x187973[_0x113bbb(0x180)](_0x113bbb(0x193))),0x1;const _0x32074a=await confirmKey(_0x113bbb(0x192)+(_0x2941bb+_0x43166f)+_0x113bbb(0x162));if(!_0x32074a)return console[_0x113bbb(0x115)](a4_0x187973[_0x113bbb(0x12c)](_0x113bbb(0x14f)),'-\x20nothing\x20pushed'),0x1;}const {data:_0x404b77}=await withSpinner('Pushing\x20to\x20project...',()=>_0x55dc89[_0x113bbb(0x138)][_0x113bbb(0x1aa)](_0x49ade1,{'force':_0x19561c})),_0x363eae=_0x404b77[_0x113bbb(0x133)][_0x113bbb(0xff)][_0x113bbb(0x1a3)]>0x0||_0x404b77[_0x113bbb(0x133)]['knowledgeBases'][_0x113bbb(0x1a3)]>0x0||_0x404b77[_0x113bbb(0x133)]['textKnowledgeBases'][_0x113bbb(0x1a3)]>0x0||_0x404b77[_0x113bbb(0x133)][_0x113bbb(0x198)][_0x113bbb(0x1a3)]>0x0;if(_0x363eae){console[_0x113bbb(0x115)](a4_0x187973[_0x113bbb(0x12c)]('\x0aProject\x20pushed\x20with\x20errors')),console['log'](),console[_0x113bbb(0x115)](a4_0x187973['red'](_0x113bbb(0x10d)));for(const _0x46a03c of _0x404b77['agents']){_0x46a03c[_0x113bbb(0x17b)]===_0x113bbb(0x114)&&console['log'](a4_0x187973[_0x113bbb(0x176)](_0x113bbb(0x106)+_0x46a03c[_0x113bbb(0x15c)]+_0x113bbb(0x155)+_0x46a03c[_0x113bbb(0x114)]));}for(const _0x31fb4e of _0x404b77[_0x113bbb(0x181)]){_0x31fb4e['action']==='error'&&console['log'](a4_0x187973[_0x113bbb(0x176)](_0x113bbb(0xfe)+_0x31fb4e['name']+_0x113bbb(0x155)+_0x31fb4e[_0x113bbb(0x114)]));}for(const _0x11c821 of _0x404b77['textKnowledgeBases']){_0x11c821[_0x113bbb(0x17b)]===_0x113bbb(0x114)&&console[_0x113bbb(0x115)](a4_0x187973[_0x113bbb(0x176)](_0x113bbb(0x13b)+_0x11c821[_0x113bbb(0x1ae)]+_0x113bbb(0x155)+_0x11c821[_0x113bbb(0x114)]));}for(const _0x3e2d20 of _0x404b77['prompts']){_0x3e2d20[_0x113bbb(0x17b)]===_0x113bbb(0x114)&&console[_0x113bbb(0x115)](a4_0x187973['red'](_0x113bbb(0x130)+_0x3e2d20[_0x113bbb(0x1ae)]+_0x113bbb(0x155)+_0x3e2d20[_0x113bbb(0x114)]));}for(const _0x4caffe of _0x404b77['integrations']){_0x4caffe['action']===_0x113bbb(0x114)&&console['log'](a4_0x187973[_0x113bbb(0x176)]('\x20\x20Integration\x20\x22'+_0x4caffe[_0x113bbb(0x1ae)]+_0x113bbb(0x155)+_0x4caffe[_0x113bbb(0x114)]));}return 0x1;}console[_0x113bbb(0x115)](a4_0x187973[_0x113bbb(0x136)](_0x113bbb(0x108)+(_0x2941bb+_0x43166f)+'\x20resources\x20to\x20\x27'+_0x404b77[_0x113bbb(0x15e)]+'\x27'));const _0x937255=getLLMProjectUrl(_0xc1b2ad,_0x404b77[_0x113bbb(0x13c)]);return console[_0x113bbb(0x115)](_0x113bbb(0x116)+a4_0x187973[_0x113bbb(0x134)](_0x937255)),0x0;}}
@@ -1 +1 @@
1
- const a5_0x39835e=a5_0x4d91;(function(_0x7df38e,_0x5ed4a1){const _0x36f21d=a5_0x4d91,_0x3c68f6=_0x7df38e();while(!![]){try{const _0x3d25b9=-parseInt(_0x36f21d(0xa1))/0x1*(parseInt(_0x36f21d(0x8e))/0x2)+parseInt(_0x36f21d(0x6a))/0x3*(parseInt(_0x36f21d(0x73))/0x4)+parseInt(_0x36f21d(0xee))/0x5*(-parseInt(_0x36f21d(0x8f))/0x6)+-parseInt(_0x36f21d(0x98))/0x7+-parseInt(_0x36f21d(0x99))/0x8+parseInt(_0x36f21d(0xd6))/0x9*(parseInt(_0x36f21d(0xbb))/0xa)+parseInt(_0x36f21d(0x72))/0xb;if(_0x3d25b9===_0x5ed4a1)break;else _0x3c68f6['push'](_0x3c68f6['shift']());}catch(_0x69865e){_0x3c68f6['push'](_0x3c68f6['shift']());}}}(a5_0x5454,0xd6cbc));import*as a5_0x21de67 from'node:fs';import*as a5_0x177f6e from'node:path';import a5_0x300f74 from'chalk';import{BaseCommand}from'./command.js';function a5_0x4d91(_0x5ed756,_0x51832e){_0x5ed756=_0x5ed756-0x65;const _0x545463=a5_0x5454();let _0x4d916d=_0x545463[_0x5ed756];return _0x4d916d;}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_0x39835e(0xad)]=a5_0x39835e(0xd5);[a5_0x39835e(0x84)]=a5_0x39835e(0xbf);async[a5_0x39835e(0xb7)](_0x38246b){const _0x51c87c=a5_0x39835e,{options:_0x1b3925,args:_0x34e9f2,tdx:_0x4ade85}=_0x38246b,_0x3c329a=_0x34e9f2[0x0]||'.',_0x88a8cf=_0x1b3925[_0x51c87c(0x8c)],_0x36ec4e=_0x1b3925,_0x39c222=_0x36ec4e[_0x51c87c(0x9d)]===![],_0x572afe=_0x36ec4e[_0x51c87c(0x77)],_0x10a792=_0x36ec4e['name'],_0x3f8793=_0x36ec4e[_0x51c87c(0x86)],_0x5089cf=_0x1b3925['site'],_0x218eb0=_0x36ec4e['output'];if(_0x572afe&&_0x39c222)return console[_0x51c87c(0xc4)](a5_0x300f74['red'](_0x51c87c(0xf1))),0x1;let _0xd50ebe=_0x51c87c(0xe6);if(_0x36ec4e[_0x51c87c(0xc6)])_0xd50ebe=_0x51c87c(0xc6);else{if(_0x36ec4e[_0x51c87c(0x89)])_0xd50ebe=_0x51c87c(0x89);else{if(_0x36ec4e[_0x51c87c(0xb0)])_0xd50ebe=_0x51c87c(0xb0);else{if(_0x36ec4e['table'])_0xd50ebe=_0x51c87c(0xe6);}}}const _0x1eed49=_0x36ec4e[_0x51c87c(0xf8)];let _0xb06d39=_0x3c329a;const _0x40877f=a5_0x21de67[_0x51c87c(0x80)](_0x3c329a),_0x5a4b27=_0x3c329a==='.';if(!_0x40877f||_0x5a4b27){const _0x1c9552=resolveProjectFromContext(_0x3c329a,_0x1eed49,{'requireFile':_0x51c87c(0xb1)});if(_0x1c9552[_0x51c87c(0xe0)])_0xb06d39=_0x1c9552['projectDir'],_0x1c9552[_0x51c87c(0x7c)]===_0x51c87c(0x8b)&&console['log'](a5_0x300f74['dim'](_0x51c87c(0xab)+_0xb06d39));else switch(_0x1c9552[_0x51c87c(0xda)]){case'no_context':console['log'](a5_0x300f74[_0x51c87c(0x6c)](_0x1c9552[_0x51c87c(0xea)])),console[_0x51c87c(0xc4)](),console[_0x51c87c(0xc4)](_0x51c87c(0x8d)),console[_0x51c87c(0xc4)](_0x51c87c(0xbd)),console[_0x51c87c(0xc4)](_0x51c87c(0x83)),console['log'](),console['log'](_0x51c87c(0xb3));return 0x1;case _0x51c87c(0xa7):console[_0x51c87c(0xc4)](a5_0x300f74[_0x51c87c(0x6c)](_0x1c9552[_0x51c87c(0xea)])),console['log'](),console['log']('Run\x20\x27tdx\x20agent\x20pull\x20'+_0x1c9552[_0x51c87c(0xf8)]+_0x51c87c(0x75));return 0x1;case _0x51c87c(0x81):{const _0x2f4749=a5_0x177f6e['basename'](_0x1c9552['projectDir']);console[_0x51c87c(0xc4)](a5_0x300f74[_0x51c87c(0x6c)](_0x51c87c(0xd0)+_0x1c9552[_0x51c87c(0xf8)]+'\x22:'));for(const _0x3b7bea of _0x1c9552['agentDirs']){console[_0x51c87c(0xc4)](_0x51c87c(0xa8)+_0x3b7bea);}return console[_0x51c87c(0xc4)](),console[_0x51c87c(0xc4)]('Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/'+_0x2f4749+_0x51c87c(0xdf)),0x1;}case'no_tests':console[_0x51c87c(0xc4)](a5_0x300f74[_0x51c87c(0x6c)](_0x51c87c(0xba)+_0x1c9552[_0x51c87c(0xf8)]+'\x22.')),console[_0x51c87c(0xc4)](a5_0x300f74[_0x51c87c(0x70)](_0x51c87c(0x6b)+_0x1c9552['projectDir'])),console['log'](),console[_0x51c87c(0xc4)](_0x51c87c(0xdd));return 0x1;}}const {definition:_0x138d45,agentInfo:_0x21dad2}=parseTestFile(_0xb06d39);let _0x952c6=_0x138d45[_0x51c87c(0xc7)];if(_0x10a792){const _0x42077f=_0x10a792[_0x51c87c(0xf3)](',')['map'](_0x2c8451=>_0x2c8451[_0x51c87c(0x79)]());_0x952c6=_0x138d45[_0x51c87c(0xc7)][_0x51c87c(0xce)](_0x68f804=>_0x42077f[_0x51c87c(0xe4)](_0x68f804[_0x51c87c(0xad)]));if(_0x952c6[_0x51c87c(0xb8)]===0x0)return console[_0x51c87c(0xc4)](a5_0x300f74[_0x51c87c(0x6c)](_0x51c87c(0xb9)+_0x10a792)),console[_0x51c87c(0xc4)](a5_0x300f74[_0x51c87c(0x70)](_0x51c87c(0x76)+_0x138d45[_0x51c87c(0xc7)][_0x51c87c(0xef)](_0x3b9f03=>_0x3b9f03[_0x51c87c(0xad)])[_0x51c87c(0xdb)](',\x20'))),0x1;}if(_0x3f8793){const _0x475094=_0x3f8793[_0x51c87c(0xf3)](',')['map'](_0x4733bd=>_0x4733bd[_0x51c87c(0x79)]()[_0x51c87c(0xb6)]());_0x952c6=_0x952c6[_0x51c87c(0xce)](_0x7ba073=>_0x7ba073['tags']?.['some'](_0x21cb18=>_0x475094[_0x51c87c(0xe4)](_0x21cb18[_0x51c87c(0xb6)]())));if(_0x952c6['length']===0x0){console[_0x51c87c(0xc4)](a5_0x300f74[_0x51c87c(0x6c)](_0x51c87c(0xde)+_0x3f8793));const _0x360fec=new Set();return _0x138d45[_0x51c87c(0xc7)][_0x51c87c(0xf9)](_0x473195=>_0x473195[_0x51c87c(0x86)]?.[_0x51c87c(0xf9)](_0x272909=>_0x360fec[_0x51c87c(0xc9)](_0x272909))),_0x360fec[_0x51c87c(0xec)]>0x0?console[_0x51c87c(0xc4)](a5_0x300f74[_0x51c87c(0x70)](_0x51c87c(0x91)+[..._0x360fec][_0x51c87c(0xdb)](',\x20'))):console['log'](a5_0x300f74['dim'](_0x51c87c(0x7e))),0x1;}}if(_0x572afe)return this[_0x51c87c(0xe8)](_0x38246b,{'definition':{'tests':_0x952c6},'agentInfo':_0x21dad2,'outputFormat':_0xd50ebe,'outputFile':_0x218eb0,'testNames':_0x10a792});if(_0x88a8cf){console[_0x51c87c(0xc4)](a5_0x300f74['cyan'](_0x51c87c(0xa2))),console[_0x51c87c(0xc4)](_0x51c87c(0x65)+a5_0x300f74[_0x51c87c(0xcb)](_0x5089cf)),console[_0x51c87c(0xc4)](_0x51c87c(0xc2)+a5_0x300f74['white'](_0x21dad2[_0x51c87c(0x94)])),console[_0x51c87c(0xc4)](_0x51c87c(0xe1)+a5_0x300f74[_0x51c87c(0xcb)](_0x21dad2['agentName'])),console[_0x51c87c(0xc4)](),console[_0x51c87c(0xc4)](_0x51c87c(0xfa)+a5_0x300f74[_0x51c87c(0xcb)](_0x952c6['length']));for(let _0x1d3115=0x0;_0x1d3115<_0x952c6[_0x51c87c(0xb8)];_0x1d3115++){const _0x45b204=_0x952c6[_0x1d3115],_0x214acf=_0x45b204[_0x51c87c(0xc5)][_0x51c87c(0xb8)]===0x1?_0x51c87c(0x82):_0x51c87c(0xc5),_0x30b0f8=_0x45b204[_0x51c87c(0x86)]?.['length']?'\x20['+_0x45b204['tags'][_0x51c87c(0xdb)](',\x20')+']':'';console[_0x51c87c(0xc4)]('\x20\x20'+(_0x1d3115+0x1)+'.\x20'+a5_0x300f74[_0x51c87c(0xcb)](_0x45b204[_0x51c87c(0xad)])+'\x20('+_0x45b204[_0x51c87c(0xc5)]['length']+'\x20'+_0x214acf+')'+a5_0x300f74[_0x51c87c(0x70)](_0x30b0f8));}return 0x0;}let _0x4f463c,_0x1cb256;try{_0x4f463c=await _0x4ade85['llm'][_0x51c87c(0x93)](_0x21dad2[_0x51c87c(0x94)]);}catch(_0x160d1c){const _0x1d6d71=_0x160d1c instanceof Error?_0x160d1c[_0x51c87c(0xea)]:String(_0x160d1c);return _0x1d6d71['includes'](_0x51c87c(0xc8))||_0x1d6d71[_0x51c87c(0xb6)]()[_0x51c87c(0xe4)](_0x51c87c(0xd9))?console[_0x51c87c(0xc4)](a5_0x300f74[_0x51c87c(0x7a)]('✗\x20ERROR:\x20Project\x20not\x20found:\x20'+_0x21dad2[_0x51c87c(0x94)])):console[_0x51c87c(0xc4)](a5_0x300f74[_0x51c87c(0x7a)](_0x51c87c(0x7b)+_0x21dad2[_0x51c87c(0x94)]+_0x51c87c(0xa9)+_0x1d6d71)),0x1;}try{_0x1cb256=await _0x4ade85[_0x51c87c(0x69)][_0x51c87c(0x7f)](_0x21dad2[_0x51c87c(0x87)],_0x4f463c);}catch(_0x8c6e62){const _0x27f740=_0x8c6e62 instanceof Error?_0x8c6e62[_0x51c87c(0xea)]:String(_0x8c6e62);return _0x27f740['includes']('404')||_0x27f740[_0x51c87c(0xb6)]()[_0x51c87c(0xe4)](_0x51c87c(0xd9))?console[_0x51c87c(0xc4)](a5_0x300f74[_0x51c87c(0x7a)](_0x51c87c(0xfb)+_0x21dad2[_0x51c87c(0x87)])):console['log'](a5_0x300f74[_0x51c87c(0x7a)](_0x51c87c(0xe2)+_0x21dad2[_0x51c87c(0x87)]+_0x51c87c(0xa9)+_0x27f740)),0x1;}let _0x368400;if(!_0x39c222)try{_0x368400=await setupEvaluatorAgent(_0x4ade85[_0x51c87c(0x69)],_0x1b3925[_0x51c87c(0x6d)]);}catch(_0x6029af){const _0x6c5040=_0x6029af instanceof Error?_0x6029af[_0x51c87c(0xea)]:String(_0x6029af);return console[_0x51c87c(0xc4)](a5_0x300f74[_0x51c87c(0x7a)](_0x51c87c(0xcd)+_0x6c5040)),0x1;}console[_0x51c87c(0xc4)](a5_0x300f74['cyan'](_0x51c87c(0xbe))),console[_0x51c87c(0xc4)]('Site:\x20'+a5_0x300f74[_0x51c87c(0xcb)](_0x5089cf)),console[_0x51c87c(0xc4)](_0x51c87c(0xed)+a5_0x300f74[_0x51c87c(0xcb)](_0x21dad2[_0x51c87c(0x94)]+'/'+_0x21dad2[_0x51c87c(0x87)])),console[_0x51c87c(0xc4)]();const _0x14cda8=[],_0x34c7e1=[],_0x5f69f8=Date[_0x51c87c(0xc1)]();for(let _0x48a7d0=0x0;_0x48a7d0<_0x952c6[_0x51c87c(0xb8)];_0x48a7d0++){const _0x2efa18=_0x952c6[_0x48a7d0];_0x952c6[_0x51c87c(0xb8)]>0x1?console[_0x51c87c(0xc4)](_0x51c87c(0xbc)+(_0x48a7d0+0x1)+'/'+_0x952c6[_0x51c87c(0xb8)]+':\x20'+a5_0x300f74[_0x51c87c(0xcb)](_0x2efa18[_0x51c87c(0xad)])):console['log']('Running\x20test:\x20'+a5_0x300f74[_0x51c87c(0xcb)](_0x2efa18[_0x51c87c(0xad)]));const _0x31f92a=createCommandSpinner(_0x51c87c(0xf0)+_0x2efa18[_0x51c87c(0xc5)]['length']+':\x20Sending\x20user\x20input...');_0x31f92a[_0x51c87c(0xb5)]();try{const {result:_0x2c8cb3,conversation:_0x1ae4ed}=await runTest(_0x4ade85[_0x51c87c(0x69)],_0x2efa18,{'agentId':_0x1cb256,'projectId':_0x4f463c,'site':_0x5089cf,'noEval':_0x39c222,'evaluatorId':_0x368400,'onRoundStart':(_0xa763fb,_0x537903)=>{const _0x3495c9=_0x51c87c;_0x31f92a[_0x3495c9(0x66)]='Round\x20'+(_0xa763fb+0x1)+'/'+_0x537903+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x3469c3,_0xfe8b44,_0x4f1174)=>{const _0x16ec3c=_0x51c87c,_0x2b26c6=formatElapsed(_0xfe8b44);_0x4f1174?console[_0x16ec3c(0xc4)]('\x20\x20Round\x20'+(_0x3469c3+0x1)+'/'+_0x2efa18[_0x16ec3c(0xc5)][_0x16ec3c(0xb8)]+'...\x20'+a5_0x300f74['green']('✓')+'\x20('+_0x2b26c6+')'):console[_0x16ec3c(0xc4)](_0x16ec3c(0xd8)+(_0x3469c3+0x1)+'/'+_0x2efa18[_0x16ec3c(0xc5)]['length']+_0x16ec3c(0x7d)+a5_0x300f74['red']('✗'));},'onEvaluationStart':()=>{const _0x3b0f64=_0x51c87c;_0x31f92a[_0x3b0f64(0x66)]=_0x3b0f64(0x68);},'onEvaluationComplete':_0x2282f2=>{const _0x1876f6=_0x51c87c,_0x37143a=formatElapsed(_0x2282f2);console[_0x1876f6(0xc4)](_0x1876f6(0xd7)+a5_0x300f74[_0x1876f6(0xd2)]('✓')+'\x20('+_0x37143a+')');}});_0x31f92a['stop'](),_0x14cda8['push'](_0x2c8cb3),_0x34c7e1['push'](_0x1ae4ed);if(_0x2c8cb3['status']===_0x51c87c(0xac))console['log'](a5_0x300f74[_0x51c87c(0xd2)](_0x51c87c(0xe3)+_0x2c8cb3[_0x51c87c(0xda)]));else _0x2c8cb3[_0x51c87c(0xa3)]===_0x51c87c(0xca)?console[_0x51c87c(0xc4)](a5_0x300f74['red'](_0x51c87c(0xa4)+_0x2c8cb3[_0x51c87c(0xda)])):console['log'](a5_0x300f74[_0x51c87c(0x7a)](_0x51c87c(0xa5)+_0x2c8cb3[_0x51c87c(0xda)]));_0x2c8cb3['conversation_url']&&console[_0x51c87c(0xc4)](a5_0x300f74[_0x51c87c(0x70)]('Conversation\x20URL:\x20'+_0x2c8cb3['conversation_url'])),console[_0x51c87c(0xc4)]();}catch(_0x39f1f6){_0x31f92a['stop']();const _0x4a7af9=_0x39f1f6 instanceof Error?_0x39f1f6[_0x51c87c(0xea)]:String(_0x39f1f6);console[_0x51c87c(0xc4)](a5_0x300f74[_0x51c87c(0x7a)](_0x51c87c(0xa5)+_0x4a7af9)),console[_0x51c87c(0xc4)](),_0x14cda8[_0x51c87c(0xd4)]({'name':_0x2efa18[_0x51c87c(0xad)],'status':'ERROR','reason':_0x4a7af9,'timestamp':new Date()[_0x51c87c(0x95)](),'duration_ms':0x0});}}const _0xe41957=Date[_0x51c87c(0xc1)]()-_0x5f69f8,_0x51ba5f=_0x14cda8[_0x51c87c(0xce)](_0x468b8f=>_0x468b8f[_0x51c87c(0xa3)]===_0x51c87c(0xac))[_0x51c87c(0xb8)],_0x1ef35e=_0x14cda8[_0x51c87c(0xce)](_0x2a052a=>_0x2a052a[_0x51c87c(0xa3)]===_0x51c87c(0xca))[_0x51c87c(0xb8)],_0x3a2f0d=_0x14cda8[_0x51c87c(0xce)](_0x477413=>_0x477413[_0x51c87c(0xa3)]==='ERROR')[_0x51c87c(0xb8)];console[_0x51c87c(0xc4)]('━'[_0x51c87c(0x67)](0x3c)),console['log'](_0x51c87c(0xe5)),console['log']('━'['repeat'](0x3c)),console['log']('Total:\x20\x20\x20\x20'+_0x14cda8[_0x51c87c(0xb8)]),console['log']('Passed:\x20\x20\x20'+a5_0x300f74['green'](_0x51ba5f)),console[_0x51c87c(0xc4)]('Failed:\x20\x20\x20'+a5_0x300f74[_0x51c87c(0x7a)](_0x1ef35e));_0x3a2f0d>0x0&&console[_0x51c87c(0xc4)](_0x51c87c(0xd1)+a5_0x300f74[_0x51c87c(0x7a)](_0x3a2f0d));console['log'](_0x51c87c(0xcc)+formatElapsed(_0xe41957)),console[_0x51c87c(0xc4)]('━'[_0x51c87c(0x67)](0x3c));const _0xa2340a=_0x14cda8['filter'](_0x4488c8=>_0x4488c8[_0x51c87c(0xa3)]!=='PASS');if(_0xa2340a[_0x51c87c(0xb8)]>0x0){console[_0x51c87c(0xc4)](),console[_0x51c87c(0xc4)](_0x51c87c(0xdc));for(const _0xbb5874 of _0xa2340a){const _0xd1f8f2=a5_0x300f74['red']('✗'),_0x577700=_0xbb5874[_0x51c87c(0xda)]['length']>0x32?_0xbb5874[_0x51c87c(0xda)][_0x51c87c(0x74)](0x0,0x32)+'...':_0xbb5874[_0x51c87c(0xda)];console[_0x51c87c(0xc4)]('\x20\x20'+_0xd1f8f2+'\x20'+_0xbb5874['name']+':\x20'+_0x577700);}}const _0x1dba30={'summary':{'total':_0x14cda8['length'],'passed':_0x51ba5f,'failed':_0x1ef35e,'errors':_0x3a2f0d>0x0?_0x3a2f0d:undefined,'duration_ms':_0xe41957},'tests':_0x14cda8,'agent':{'project':_0x21dad2[_0x51c87c(0x94)],'name':_0x21dad2['agentName'],'site':_0x5089cf},'timestamp':new Date(_0x5f69f8)[_0x51c87c(0x95)]()};try{const _0x34069e=buildCachedTestRun(_0x34c7e1,{'site':_0x5089cf,'projectId':_0x4f463c,'projectName':_0x21dad2[_0x51c87c(0x94)],'agentId':_0x1cb256,'agentName':_0x21dad2[_0x51c87c(0x87)],'testYmlPath':a5_0x177f6e[_0x51c87c(0xf7)](_0x21dad2[_0x51c87c(0xf2)])});saveLastTestRun(_0x34069e);}catch{}if(_0xd50ebe!==_0x51c87c(0xe6)||_0x218eb0){const _0x2d0a7b=formatResults(_0x1dba30,_0xd50ebe);if(_0x218eb0)try{a5_0x21de67[_0x51c87c(0x8a)](_0x218eb0,_0x2d0a7b,'utf-8'),console['log'](),console[_0x51c87c(0xc4)](a5_0x300f74['dim'](_0x51c87c(0x9e)+_0x218eb0));}catch(_0x33f9e3){return console[_0x51c87c(0xc4)](),console[_0x51c87c(0xc4)](a5_0x300f74['red']('Error\x20writing\x20output\x20file:\x20'+_0x33f9e3)),0x1;}else console[_0x51c87c(0xc4)](),console[_0x51c87c(0xc4)](_0x2d0a7b);}return _0xa2340a[_0x51c87c(0xb8)]>0x0?0x1:0x0;}async[a5_0x39835e(0xe8)](_0x3a85b5,_0x3affae){const _0x27970e=a5_0x39835e,{options:_0x330512,tdx:_0x5d32e4}=_0x3a85b5,{definition:_0x409138,agentInfo:_0x203879,outputFormat:_0x7f4cfd,outputFile:_0x311f3c}=_0x3affae,_0x3bb1c0=_0x330512[_0x27970e(0xae)],_0x5612e8=loadLastTestRun();if(!_0x5612e8)return console['log'](a5_0x300f74[_0x27970e(0x7a)]('Error:\x20No\x20previous\x20test\x20run\x20found.')),console['log'](a5_0x300f74[_0x27970e(0x70)](_0x27970e(0xe9))),0x1;if(_0x5612e8['agent']['agentName']!==_0x203879[_0x27970e(0x87)])return console[_0x27970e(0xc4)](a5_0x300f74[_0x27970e(0x7a)](_0x27970e(0x88)+_0x5612e8[_0x27970e(0x92)]['agentName']+'\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22'+_0x203879[_0x27970e(0x87)]+'\x22.')),console[_0x27970e(0xc4)](a5_0x300f74['dim'](_0x27970e(0xaa))),0x1;const _0x15396f=new Set(_0x5612e8[_0x27970e(0xc0)][_0x27970e(0xef)](_0x265b5d=>_0x265b5d['testName'])),_0x13fd15=_0x409138[_0x27970e(0xc7)]['filter'](_0xe5e64d=>!_0x15396f[_0x27970e(0xcf)](_0xe5e64d[_0x27970e(0xad)]));if(_0x13fd15['length']>0x0&&_0x5612e8[_0x27970e(0xae)]!==_0x3bb1c0)return console[_0x27970e(0xc4)](a5_0x300f74[_0x27970e(0x7a)]('Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.')),console[_0x27970e(0xc4)](a5_0x300f74[_0x27970e(0x70)](_0x27970e(0xf4)+_0x5612e8[_0x27970e(0xae)]+_0x27970e(0xf6)+_0x3bb1c0+'\x22.')),console['log'](a5_0x300f74[_0x27970e(0x70)](_0x27970e(0x71)+_0x5612e8['site']+_0x27970e(0x9c))),0x1;const _0x3567e8=_0x409138[_0x27970e(0xc7)][_0x27970e(0xce)](_0x41712d=>_0x15396f['has'](_0x41712d[_0x27970e(0xad)])),_0x365de0=_0x13fd15;let _0x2a1648;try{_0x2a1648=await setupEvaluatorAgent(_0x5d32e4['llm'],_0x330512['verbose']);}catch(_0x47ece5){const _0x4efb86=_0x47ece5 instanceof Error?_0x47ece5[_0x27970e(0xea)]:String(_0x47ece5);return console[_0x27970e(0xc4)](a5_0x300f74[_0x27970e(0x7a)](_0x27970e(0xcd)+_0x4efb86)),0x1;}console[_0x27970e(0xc4)](a5_0x300f74['cyan']('Re-evaluating\x20cached\x20test\x20run...')),console[_0x27970e(0xc4)]('Cached\x20run\x20from:\x20'+a5_0x300f74[_0x27970e(0xcb)](_0x5612e8[_0x27970e(0xd3)])),console[_0x27970e(0xc4)](_0x27970e(0xed)+a5_0x300f74[_0x27970e(0xcb)](_0x5612e8['agent']['projectName']+'/'+_0x5612e8[_0x27970e(0x92)][_0x27970e(0x87)]));_0x365de0[_0x27970e(0xb8)]>0x0&&console[_0x27970e(0xc4)](_0x27970e(0x9b)+a5_0x300f74[_0x27970e(0x6c)](_0x365de0[_0x27970e(0xb8)]));console[_0x27970e(0xc4)]();const _0x375f3e=[],_0x402708=Date[_0x27970e(0xc1)](),_0xd2d5cb=createCommandSpinner('Re-evaluating...');if(_0x3567e8['length']>0x0)try{const _0x4814b7=await reevaluateFromCache(_0x5d32e4[_0x27970e(0x69)],_0x5612e8,{'tests':_0x3567e8},{'evaluatorId':_0x2a1648,'onTestStart':(_0x2b7d17,_0x24bab2,_0x32bc8b)=>{const _0x3569ac=_0x27970e;_0xd2d5cb['text']='Re-evaluating\x20'+(_0x24bab2+0x1)+'/'+_0x32bc8b+':\x20'+_0x2b7d17+'...';if(!_0xd2d5cb['isSpinning'])_0xd2d5cb[_0x3569ac(0xb5)]();},'onTestComplete':(_0x2dc9b3,_0x4b3b11)=>{const _0x3a5f97=_0x27970e;_0xd2d5cb[_0x3a5f97(0xf5)]();if(_0x4b3b11[_0x3a5f97(0xa3)]===_0x3a5f97(0xac))console[_0x3a5f97(0xc4)](a5_0x300f74['green']('✓\x20PASS:\x20'+_0x2dc9b3)+a5_0x300f74[_0x3a5f97(0x70)](_0x3a5f97(0x78)));else _0x4b3b11[_0x3a5f97(0xa3)]===_0x3a5f97(0xca)?console[_0x3a5f97(0xc4)](a5_0x300f74[_0x3a5f97(0x7a)]('✗\x20FAIL:\x20'+_0x2dc9b3+_0x3a5f97(0x97)+_0x4b3b11[_0x3a5f97(0xda)])+a5_0x300f74[_0x3a5f97(0x70)](_0x3a5f97(0x78))):console[_0x3a5f97(0xc4)](a5_0x300f74[_0x3a5f97(0x7a)](_0x3a5f97(0xa5)+_0x2dc9b3+_0x3a5f97(0x97)+_0x4b3b11[_0x3a5f97(0xda)]));_0x4b3b11['conversation_url']&&console[_0x3a5f97(0xc4)](a5_0x300f74[_0x3a5f97(0x70)](_0x3a5f97(0xa0)+_0x4b3b11[_0x3a5f97(0xa6)])),_0x375f3e[_0x3a5f97(0xd4)](_0x4b3b11);},'onTestSkipped':(_0xee9a14,_0x270655)=>{const _0x5b2d26=_0x27970e;_0xd2d5cb[_0x5b2d26(0xf5)](),console[_0x5b2d26(0xc4)](a5_0x300f74[_0x5b2d26(0x6c)](_0x5b2d26(0xeb)+_0xee9a14+'\x20-\x20'+_0x270655));}});for(const _0x33c9b3 of _0x4814b7){!_0x375f3e[_0x27970e(0xb2)](_0x2d4e34=>_0x2d4e34[_0x27970e(0xad)]===_0x33c9b3[_0x27970e(0xad)])&&_0x375f3e[_0x27970e(0xd4)](_0x33c9b3);}}catch(_0x117c2e){_0xd2d5cb['stop']();const _0x26a0fc=_0x117c2e instanceof Error?_0x117c2e[_0x27970e(0xea)]:String(_0x117c2e);return console[_0x27970e(0xc4)](a5_0x300f74[_0x27970e(0x7a)](_0x27970e(0x96)+_0x26a0fc)),0x1;}_0xd2d5cb[_0x27970e(0xf5)]();if(_0x365de0[_0x27970e(0xb8)]>0x0){console['log'](),console[_0x27970e(0xc4)](a5_0x300f74['cyan'](_0x27970e(0x6f)));const {projectId:_0x12b5f9,agentId:_0x24ba8c}=_0x5612e8[_0x27970e(0x92)];for(const _0x17f38c of _0x365de0){console[_0x27970e(0xc4)](_0x27970e(0x85)+a5_0x300f74[_0x27970e(0xcb)](_0x17f38c[_0x27970e(0xad)]));const _0xcb6fa2=createCommandSpinner('Round\x201/'+_0x17f38c[_0x27970e(0xc5)][_0x27970e(0xb8)]+':\x20Sending\x20user\x20input...');_0xcb6fa2['start']();try{const {result:_0x186753}=await runTest(_0x5d32e4[_0x27970e(0x69)],_0x17f38c,{'agentId':_0x24ba8c,'projectId':_0x12b5f9,'site':_0x5612e8[_0x27970e(0xae)],'noEval':![],'evaluatorId':_0x2a1648,'onRoundStart':(_0x1e0ce3,_0x24fd5a)=>{const _0x279f70=_0x27970e;_0xcb6fa2[_0x279f70(0x66)]=_0x279f70(0xe7)+(_0x1e0ce3+0x1)+'/'+_0x24fd5a+_0x279f70(0xc3);},'onRoundComplete':(_0x531547,_0x26ba7b,_0x3d5b09)=>{const _0xd926b0=_0x27970e,_0xbf9350=formatElapsed(_0x26ba7b);_0x3d5b09?console[_0xd926b0(0xc4)](_0xd926b0(0xd8)+(_0x531547+0x1)+'/'+_0x17f38c['rounds'][_0xd926b0(0xb8)]+'...\x20'+a5_0x300f74[_0xd926b0(0xd2)]('✓')+'\x20('+_0xbf9350+')'):console[_0xd926b0(0xc4)](_0xd926b0(0xd8)+(_0x531547+0x1)+'/'+_0x17f38c[_0xd926b0(0xc5)][_0xd926b0(0xb8)]+_0xd926b0(0x7d)+a5_0x300f74['red']('✗'));},'onEvaluationStart':()=>{_0xcb6fa2['text']='Evaluating\x20response...';},'onEvaluationComplete':_0x16faff=>{const _0x207bbe=formatElapsed(_0x16faff);console['log']('\x20\x20Evaluating...\x20'+a5_0x300f74['green']('✓')+'\x20('+_0x207bbe+')');}});_0xcb6fa2['stop'](),_0x375f3e['push'](_0x186753);if(_0x186753['status']===_0x27970e(0xac))console['log'](a5_0x300f74['green'](_0x27970e(0xe3)+_0x186753[_0x27970e(0xda)])+a5_0x300f74[_0x27970e(0x70)](_0x27970e(0xaf)));else _0x186753[_0x27970e(0xa3)]===_0x27970e(0xca)?console[_0x27970e(0xc4)](a5_0x300f74[_0x27970e(0x7a)]('✗\x20FAIL:\x20'+_0x186753[_0x27970e(0xda)])+a5_0x300f74[_0x27970e(0x70)](_0x27970e(0xaf))):console[_0x27970e(0xc4)](a5_0x300f74[_0x27970e(0x7a)]('✗\x20ERROR:\x20'+_0x186753[_0x27970e(0xda)]));_0x186753[_0x27970e(0xa6)]&&console['log'](a5_0x300f74[_0x27970e(0x70)](_0x27970e(0xa0)+_0x186753[_0x27970e(0xa6)]));}catch(_0x362710){_0xcb6fa2['stop']();const _0x4f9ee2=_0x362710 instanceof Error?_0x362710['message']:String(_0x362710);console[_0x27970e(0xc4)](a5_0x300f74[_0x27970e(0x7a)]('✗\x20ERROR:\x20'+_0x4f9ee2)),_0x375f3e[_0x27970e(0xd4)]({'name':_0x17f38c['name'],'status':'ERROR','reason':_0x4f9ee2,'timestamp':new Date()[_0x27970e(0x95)](),'duration_ms':0x0});}}}console['log']();const _0x2bc1cb=Date['now']()-_0x402708,_0x3d30ad=_0x375f3e[_0x27970e(0xce)](_0x58657e=>_0x58657e[_0x27970e(0xa3)]===_0x27970e(0xac))['length'],_0x412d80=_0x375f3e[_0x27970e(0xce)](_0x11f25a=>_0x11f25a[_0x27970e(0xa3)]===_0x27970e(0xca))[_0x27970e(0xb8)],_0x435193=_0x375f3e[_0x27970e(0xce)](_0x54bb53=>_0x54bb53[_0x27970e(0xa3)]==='ERROR')[_0x27970e(0xb8)];console[_0x27970e(0xc4)]('━'[_0x27970e(0x67)](0x3c)),console['log'](_0x27970e(0xb4)),console[_0x27970e(0xc4)]('━'['repeat'](0x3c)),console[_0x27970e(0xc4)](_0x27970e(0x9a)+_0x375f3e['length']),console[_0x27970e(0xc4)]('Passed:\x20\x20\x20'+a5_0x300f74[_0x27970e(0xd2)](_0x3d30ad)),console['log'](_0x27970e(0x9f)+a5_0x300f74[_0x27970e(0x7a)](_0x412d80));_0x435193>0x0&&console[_0x27970e(0xc4)](_0x27970e(0xd1)+a5_0x300f74['red'](_0x435193));console[_0x27970e(0xc4)]('Duration:\x20'+formatElapsed(_0x2bc1cb)),console[_0x27970e(0xc4)]('━'[_0x27970e(0x67)](0x3c));const _0x1ddb57={'summary':{'total':_0x375f3e[_0x27970e(0xb8)],'passed':_0x3d30ad,'failed':_0x412d80,'errors':_0x435193>0x0?_0x435193:undefined,'duration_ms':_0x2bc1cb},'tests':_0x375f3e,'agent':{'project':_0x203879['projectName'],'name':_0x203879[_0x27970e(0x87)],'site':_0x3bb1c0},'timestamp':new Date(_0x402708)[_0x27970e(0x95)]()};if(_0x7f4cfd!==_0x27970e(0xe6)||_0x311f3c){const _0x35d084=formatResults(_0x1ddb57,_0x7f4cfd);if(_0x311f3c)try{a5_0x21de67[_0x27970e(0x8a)](_0x311f3c,_0x35d084,_0x27970e(0x90)),console['log'](),console[_0x27970e(0xc4)](a5_0x300f74[_0x27970e(0x70)](_0x27970e(0x9e)+_0x311f3c));}catch(_0x53e21e){return console[_0x27970e(0xc4)](),console['log'](a5_0x300f74[_0x27970e(0x7a)](_0x27970e(0x6e)+_0x53e21e)),0x1;}else console[_0x27970e(0xc4)](),console[_0x27970e(0xc4)](_0x35d084);}const _0x4a8382=_0x375f3e['filter'](_0x30cc4b=>_0x30cc4b['status']!=='PASS');return _0x4a8382[_0x27970e(0xb8)]>0x0?0x1:0x0;}}function a5_0x5454(){const _0x133f51=['stop','\x22,\x20but\x20current\x20site\x20is\x20\x22','resolve','llmProject','forEach','Tests\x20found:\x20','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','\x20\x20Site:\x20','text','repeat','Evaluating\x20response...','llm','29289rGAGOy','Project\x20path:\x20','yellow','verbose','Error\x20writing\x20output\x20file:\x20','Executing\x20new\x20tests...','dim','Either\x20switch\x20to\x20the\x20\x22','41039944GGKzrh','504hEyOFF','substring','\x27\x20to\x20create\x20the\x20folder\x20structure.','Available\x20tests:\x20','reeval','\x20(cached)','trim','red','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','source','...\x20','No\x20tests\x20have\x20tags\x20defined.','resolveAgentId','existsSync','multiple_agents','round','\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)','description','Running:\x20','tags','agentName','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','jsonl','writeFileSync','context','dryRun','Usage:','478cVZJUX','6eDfiPc','utf-8','Available\x20tags:\x20','agent','resolveProjectId','projectName','toISOString','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','\x20-\x20','8102024tjlhjs','11861952CGWITy','Total:\x20\x20\x20\x20','New\x20tests\x20to\x20execute:\x20','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','eval','Output\x20written\x20to:\x20','Failed:\x20\x20\x20','\x20\x20Conversation:\x20','2693qLZMoG','Test\x20Configuration:','status','✗\x20FAIL:\x20','✗\x20ERROR:\x20','conversation_url','no_local_folder','\x20\x20-\x20','\x22:\x20','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','Using\x20agent:\x20','PASS','name','site','\x20(new)','tsv','test.yml','find','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','Re-evaluation\x20Summary','start','toLowerCase','execute','length','No\x20tests\x20found\x20matching:\x20','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','10730bHYppp','Test\x20','\x20\x20tdx\x20agent\x20test\x20<path>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20from\x20path','Running\x20agent\x20tests...','Run\x20tests\x20for\x20an\x20LLM\x20agent','conversations','now','\x20\x20Project:\x20',':\x20Sending\x20user\x20input...','log','rounds','json','tests','404','add','FAIL','white','Duration:\x20','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','filter','has','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','Errors:\x20\x20\x20','green','timestamp','push','agent:test','7623rizkAJ','\x20\x20Evaluating...\x20','\x20\x20Round\x20','not\x20found','reason','join','Failed\x20Tests:','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','No\x20tests\x20found\x20with\x20tags:\x20','/<agent-name>','found','\x20\x20Agent:\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','✓\x20PASS:\x20','includes','Test\x20Summary','table','Round\x20','executeReeval','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','message','⚠\x20SKIPPED:\x20','size','Agent:\x20','8531330imWyDM','map','Round\x201/','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','testYmlPath','split','Cached\x20run\x20is\x20from\x20site\x20\x22'];a5_0x5454=function(){return _0x133f51;};return a5_0x5454();}
1
+ const a5_0x7b37=a5_0x5bfe;(function(_0x2a3e29,_0x6aaf94){const _0x377cf6=a5_0x5bfe,_0x5545db=_0x2a3e29();while(!![]){try{const _0x5b759c=-parseInt(_0x377cf6(0x1ca))/0x1*(parseInt(_0x377cf6(0x1d8))/0x2)+parseInt(_0x377cf6(0x1c4))/0x3+-parseInt(_0x377cf6(0x223))/0x4+-parseInt(_0x377cf6(0x1cd))/0x5+-parseInt(_0x377cf6(0x1b1))/0x6*(-parseInt(_0x377cf6(0x1f9))/0x7)+-parseInt(_0x377cf6(0x1e6))/0x8+parseInt(_0x377cf6(0x1e9))/0x9;if(_0x5b759c===_0x6aaf94)break;else _0x5545db['push'](_0x5545db['shift']());}catch(_0x783425){_0x5545db['push'](_0x5545db['shift']());}}}(a5_0x1c5d,0x757ea));import*as a5_0x21bf8d from'node:fs';import*as a5_0x4eae37 from'node:path';function a5_0x5bfe(_0x35eea3,_0x4092ee){_0x35eea3=_0x35eea3-0x1ae;const _0x1c5d46=a5_0x1c5d();let _0x5bfe6d=_0x1c5d46[_0x35eea3];return _0x5bfe6d;}import a5_0x3ae7c1 from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';function a5_0x1c5d(){const _0x846273=['basename','Run\x20\x27tdx\x20agent\x20pull\x20','\x20\x20tdx\x20agent\x20test\x20<path>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20from\x20path','no_local_folder','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','No\x20tests\x20found\x20with\x20tags:\x20','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','tsv','dryRun','map','context','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','stop','isSpinning','conversation_url','Duration:\x20','12ulHdAX','conversations','✗\x20ERROR:\x20','site','...','\x20(cached)','reason','Error\x20writing\x20output\x20file:\x20','Project\x20path:\x20','projectDir','no_tests','toLowerCase','FAIL','resolveProjectId','json','join','Running:\x20','...\x20','404','119004KMowOW','includes','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','eval','Total:\x20\x20\x20\x20','round','32143KGfvDt','Tests\x20found:\x20','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','3313260JaPlzF','Cached\x20run\x20is\x20from\x20site\x20\x22','writeFileSync','\x20\x20Conversation:\x20','New\x20tests\x20to\x20execute:\x20','Output\x20written\x20to:\x20','agentName','Failed\x20Tests:','Passed:\x20\x20\x20','verbose','projectName','4sUUsQF','test.yml','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','cyan','add','No\x20tests\x20found\x20matching:\x20','\x20\x20Project:\x20','Failed:\x20\x20\x20','find','⚠\x20SKIPPED:\x20','testYmlPath','output',':\x20Sending\x20user\x20input...','has','2754032VOcOSi','agentDirs','Re-evaluating\x20','16841466oYVdpA','some','✗\x20ERROR:\x20Project\x20not\x20found:\x20','existsSync','text','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','jsonl','now','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','toISOString','push','\x22,\x20but\x20current\x20site\x20is\x20\x22','Conversation\x20URL:\x20','table','\x20\x20Round\x20','Available\x20tags:\x20','1966279FFgJey','✗\x20FAIL:\x20','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','Running\x20test:\x20','length','Test\x20Configuration:','start','not\x20found','Test\x20','execute','Usage:','executeReeval','\x20(new)','source','timestamp','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','Evaluating\x20response...','size','ERROR','llmProject','Available\x20tests:\x20','tests','\x20\x20Site:\x20','message','white','Agent:\x20','filter','tags','split','yellow','dim','Round\x20','agent','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','Either\x20switch\x20to\x20the\x20\x22','\x22:\x20','\x20\x20Agent:\x20','trim','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','✓\x20PASS:\x20','repeat','3681144FsDlLs','Re-evaluation\x20Summary','\x20\x20-\x20','PASS','rounds','Error:\x20No\x20previous\x20test\x20run\x20found.','Running\x20agent\x20tests...','Cached\x20run\x20from:\x20','description','llm','found','Re-evaluating\x20cached\x20test\x20run...','Test\x20Summary','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','green','status','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','\x20\x20Evaluating...\x20','log','\x20-\x20','Round\x201/','red','forEach','name','resolve'];a5_0x1c5d=function(){return _0x846273;};return a5_0x1c5d();}import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x7b37(0x23a)]='agent:test';[a5_0x7b37(0x22b)]='Run\x20tests\x20for\x20an\x20LLM\x20agent';async[a5_0x7b37(0x202)](_0x1a24f1){const _0x5450a2=a5_0x7b37,{options:_0x3aa8f4,args:_0x5c7972,tdx:_0x45fe97}=_0x1a24f1,_0x1ac850=_0x5c7972[0x0]||'.',_0x5eccc5=_0x3aa8f4[_0x5450a2(0x244)],_0x333bde=_0x3aa8f4,_0x2e8730=_0x333bde[_0x5450a2(0x1c7)]===![],_0x4451c9=_0x333bde['reeval'],_0x85b4b7=_0x333bde[_0x5450a2(0x23a)],_0xf81afb=_0x333bde[_0x5450a2(0x214)],_0x3b1552=_0x3aa8f4['site'],_0x3e7b3d=_0x333bde[_0x5450a2(0x1e3)];if(_0x4451c9&&_0x2e8730)return console['log'](a5_0x3ae7c1[_0x5450a2(0x238)](_0x5450a2(0x1c6))),0x1;let _0x15c566='table';if(_0x333bde[_0x5450a2(0x1bf)])_0x15c566=_0x5450a2(0x1bf);else{if(_0x333bde['jsonl'])_0x15c566=_0x5450a2(0x1ef);else{if(_0x333bde[_0x5450a2(0x243)])_0x15c566=_0x5450a2(0x243);else{if(_0x333bde[_0x5450a2(0x1f6)])_0x15c566=_0x5450a2(0x1f6);}}}const _0x4c2eff=_0x333bde[_0x5450a2(0x20c)];let _0x16f177=_0x1ac850;const _0x54f482=a5_0x21bf8d[_0x5450a2(0x1ec)](_0x1ac850),_0x49d014=_0x1ac850==='.';if(!_0x54f482||_0x49d014){const _0x99e248=resolveProjectFromContext(_0x1ac850,_0x4c2eff,{'requireFile':_0x5450a2(0x1d9)});if(_0x99e248[_0x5450a2(0x22d)])_0x16f177=_0x99e248['projectDir'],_0x99e248[_0x5450a2(0x206)]===_0x5450a2(0x246)&&console['log'](a5_0x3ae7c1['dim']('Using\x20agent:\x20'+_0x16f177));else switch(_0x99e248['reason']){case'no_context':console[_0x5450a2(0x235)](a5_0x3ae7c1[_0x5450a2(0x216)](_0x99e248[_0x5450a2(0x210)])),console[_0x5450a2(0x235)](),console[_0x5450a2(0x235)](_0x5450a2(0x203)),console[_0x5450a2(0x235)](_0x5450a2(0x23e)),console[_0x5450a2(0x235)]('\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[_0x5450a2(0x235)](),console['log'](_0x5450a2(0x242));return 0x1;case _0x5450a2(0x23f):console['log'](a5_0x3ae7c1['yellow'](_0x99e248[_0x5450a2(0x210)])),console[_0x5450a2(0x235)](),console[_0x5450a2(0x235)](_0x5450a2(0x23d)+_0x99e248[_0x5450a2(0x20c)]+'\x27\x20to\x20create\x20the\x20folder\x20structure.');return 0x1;case'multiple_agents':{const _0x39075f=a5_0x4eae37[_0x5450a2(0x23c)](_0x99e248[_0x5450a2(0x1ba)]);console[_0x5450a2(0x235)](a5_0x3ae7c1[_0x5450a2(0x216)](_0x5450a2(0x1ee)+_0x99e248[_0x5450a2(0x20c)]+'\x22:'));for(const _0x58c8e4 of _0x99e248[_0x5450a2(0x1e7)]){console[_0x5450a2(0x235)](_0x5450a2(0x225)+_0x58c8e4);}return console[_0x5450a2(0x235)](),console['log'](_0x5450a2(0x230)+_0x39075f+'/<agent-name>'),0x1;}case _0x5450a2(0x1bb):console[_0x5450a2(0x235)](a5_0x3ae7c1[_0x5450a2(0x216)](_0x5450a2(0x220)+_0x99e248['llmProject']+'\x22.')),console['log'](a5_0x3ae7c1[_0x5450a2(0x217)](_0x5450a2(0x1b9)+_0x99e248[_0x5450a2(0x1ba)])),console[_0x5450a2(0x235)](),console['log'](_0x5450a2(0x21a));return 0x1;}}const {definition:_0x7b49a3,agentInfo:_0x41e50c}=parseTestFile(_0x16f177);let _0x515795=_0x7b49a3[_0x5450a2(0x20e)];if(_0x85b4b7){const _0x4ed3a7=_0x85b4b7[_0x5450a2(0x215)](',')[_0x5450a2(0x245)](_0x3f1964=>_0x3f1964[_0x5450a2(0x21f)]());_0x515795=_0x7b49a3[_0x5450a2(0x20e)][_0x5450a2(0x213)](_0x324094=>_0x4ed3a7[_0x5450a2(0x1c5)](_0x324094[_0x5450a2(0x23a)]));if(_0x515795['length']===0x0)return console[_0x5450a2(0x235)](a5_0x3ae7c1[_0x5450a2(0x216)](_0x5450a2(0x1dd)+_0x85b4b7)),console[_0x5450a2(0x235)](a5_0x3ae7c1[_0x5450a2(0x217)](_0x5450a2(0x20d)+_0x7b49a3[_0x5450a2(0x20e)][_0x5450a2(0x245)](_0xcdfab0=>_0xcdfab0[_0x5450a2(0x23a)])[_0x5450a2(0x1c0)](',\x20'))),0x1;}if(_0xf81afb){const _0x4dc4c3=_0xf81afb[_0x5450a2(0x215)](',')['map'](_0x121f22=>_0x121f22[_0x5450a2(0x21f)]()[_0x5450a2(0x1bc)]());_0x515795=_0x515795[_0x5450a2(0x213)](_0x439bc6=>_0x439bc6[_0x5450a2(0x214)]?.[_0x5450a2(0x1ea)](_0x35655c=>_0x4dc4c3[_0x5450a2(0x1c5)](_0x35655c[_0x5450a2(0x1bc)]())));if(_0x515795[_0x5450a2(0x1fd)]===0x0){console['log'](a5_0x3ae7c1[_0x5450a2(0x216)](_0x5450a2(0x241)+_0xf81afb));const _0x309a7b=new Set();return _0x7b49a3['tests'][_0x5450a2(0x239)](_0x4c2488=>_0x4c2488[_0x5450a2(0x214)]?.[_0x5450a2(0x239)](_0x4505f2=>_0x309a7b[_0x5450a2(0x1dc)](_0x4505f2))),_0x309a7b[_0x5450a2(0x20a)]>0x0?console[_0x5450a2(0x235)](a5_0x3ae7c1[_0x5450a2(0x217)](_0x5450a2(0x1f8)+[..._0x309a7b][_0x5450a2(0x1c0)](',\x20'))):console['log'](a5_0x3ae7c1[_0x5450a2(0x217)]('No\x20tests\x20have\x20tags\x20defined.')),0x1;}}if(_0x4451c9)return this[_0x5450a2(0x204)](_0x1a24f1,{'definition':{'tests':_0x515795},'agentInfo':_0x41e50c,'outputFormat':_0x15c566,'outputFile':_0x3e7b3d,'testNames':_0x85b4b7});if(_0x5eccc5){console['log'](a5_0x3ae7c1[_0x5450a2(0x1db)](_0x5450a2(0x1fe))),console['log'](_0x5450a2(0x20f)+a5_0x3ae7c1[_0x5450a2(0x211)](_0x3b1552)),console['log'](_0x5450a2(0x1de)+a5_0x3ae7c1[_0x5450a2(0x211)](_0x41e50c[_0x5450a2(0x1d7)])),console['log'](_0x5450a2(0x21e)+a5_0x3ae7c1['white'](_0x41e50c[_0x5450a2(0x1d3)])),console[_0x5450a2(0x235)](),console['log'](_0x5450a2(0x1cb)+a5_0x3ae7c1['white'](_0x515795[_0x5450a2(0x1fd)]));for(let _0x57d82a=0x0;_0x57d82a<_0x515795[_0x5450a2(0x1fd)];_0x57d82a++){const _0x3ceffc=_0x515795[_0x57d82a],_0x303c3c=_0x3ceffc[_0x5450a2(0x227)]['length']===0x1?_0x5450a2(0x1c9):_0x5450a2(0x227),_0x2e4d0d=_0x3ceffc[_0x5450a2(0x214)]?.['length']?'\x20['+_0x3ceffc[_0x5450a2(0x214)]['join'](',\x20')+']':'';console['log']('\x20\x20'+(_0x57d82a+0x1)+'.\x20'+a5_0x3ae7c1[_0x5450a2(0x211)](_0x3ceffc[_0x5450a2(0x23a)])+'\x20('+_0x3ceffc[_0x5450a2(0x227)]['length']+'\x20'+_0x303c3c+')'+a5_0x3ae7c1['dim'](_0x2e4d0d));}return 0x0;}let _0x3796c1,_0xca3ec1;try{_0x3796c1=await _0x45fe97[_0x5450a2(0x22c)][_0x5450a2(0x1be)](_0x41e50c[_0x5450a2(0x1d7)]);}catch(_0x24bbfd){const _0xb91eb6=_0x24bbfd instanceof Error?_0x24bbfd[_0x5450a2(0x210)]:String(_0x24bbfd);return _0xb91eb6['includes']('404')||_0xb91eb6['toLowerCase']()['includes'](_0x5450a2(0x200))?console[_0x5450a2(0x235)](a5_0x3ae7c1['red'](_0x5450a2(0x1eb)+_0x41e50c[_0x5450a2(0x1d7)])):console['log'](a5_0x3ae7c1[_0x5450a2(0x238)](_0x5450a2(0x1f1)+_0x41e50c['projectName']+_0x5450a2(0x21d)+_0xb91eb6)),0x1;}try{_0xca3ec1=await _0x45fe97['llm']['resolveAgentId'](_0x41e50c[_0x5450a2(0x1d3)],_0x3796c1);}catch(_0xb4a1f4){const _0x4a8b1e=_0xb4a1f4 instanceof Error?_0xb4a1f4[_0x5450a2(0x210)]:String(_0xb4a1f4);return _0x4a8b1e[_0x5450a2(0x1c5)](_0x5450a2(0x1c3))||_0x4a8b1e[_0x5450a2(0x1bc)]()[_0x5450a2(0x1c5)](_0x5450a2(0x200))?console[_0x5450a2(0x235)](a5_0x3ae7c1['red'](_0x5450a2(0x247)+_0x41e50c[_0x5450a2(0x1d3)])):console['log'](a5_0x3ae7c1[_0x5450a2(0x238)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22'+_0x41e50c['agentName']+_0x5450a2(0x21d)+_0x4a8b1e)),0x1;}let _0x39ef77;if(!_0x2e8730)try{_0x39ef77=await setupEvaluatorAgent(_0x45fe97['llm'],_0x3aa8f4[_0x5450a2(0x1d6)]);}catch(_0x3ffb10){const _0x3e817c=_0x3ffb10 instanceof Error?_0x3ffb10['message']:String(_0x3ffb10);return console[_0x5450a2(0x235)](a5_0x3ae7c1[_0x5450a2(0x238)](_0x5450a2(0x233)+_0x3e817c)),0x1;}console[_0x5450a2(0x235)](a5_0x3ae7c1['cyan'](_0x5450a2(0x229))),console[_0x5450a2(0x235)]('Site:\x20'+a5_0x3ae7c1[_0x5450a2(0x211)](_0x3b1552)),console[_0x5450a2(0x235)](_0x5450a2(0x212)+a5_0x3ae7c1[_0x5450a2(0x211)](_0x41e50c[_0x5450a2(0x1d7)]+'/'+_0x41e50c[_0x5450a2(0x1d3)])),console[_0x5450a2(0x235)]();const _0xf434b8=[],_0x36acec=[],_0x10e3f1=Date[_0x5450a2(0x1f0)]();for(let _0x130c31=0x0;_0x130c31<_0x515795[_0x5450a2(0x1fd)];_0x130c31++){const _0x4aaf0f=_0x515795[_0x130c31];_0x515795[_0x5450a2(0x1fd)]>0x1?console[_0x5450a2(0x235)](_0x5450a2(0x201)+(_0x130c31+0x1)+'/'+_0x515795[_0x5450a2(0x1fd)]+':\x20'+a5_0x3ae7c1[_0x5450a2(0x211)](_0x4aaf0f[_0x5450a2(0x23a)])):console['log'](_0x5450a2(0x1fc)+a5_0x3ae7c1['white'](_0x4aaf0f[_0x5450a2(0x23a)]));const _0x3377da=createCommandSpinner(_0x5450a2(0x237)+_0x4aaf0f['rounds'][_0x5450a2(0x1fd)]+_0x5450a2(0x1e4));_0x3377da[_0x5450a2(0x1ff)]();try{const {result:_0x3ff843,conversation:_0x3eac06}=await runTest(_0x45fe97[_0x5450a2(0x22c)],_0x4aaf0f,{'agentId':_0xca3ec1,'projectId':_0x3796c1,'site':_0x3b1552,'noEval':_0x2e8730,'evaluatorId':_0x39ef77,'onRoundStart':(_0x30695f,_0x3c6cc2)=>{const _0x4c9cfe=_0x5450a2;_0x3377da['text']=_0x4c9cfe(0x218)+(_0x30695f+0x1)+'/'+_0x3c6cc2+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x4ab084,_0x33eb6c,_0x13546c)=>{const _0x9fe178=_0x5450a2,_0x1b529d=formatElapsed(_0x33eb6c);_0x13546c?console['log'](_0x9fe178(0x1f7)+(_0x4ab084+0x1)+'/'+_0x4aaf0f[_0x9fe178(0x227)]['length']+_0x9fe178(0x1c2)+a5_0x3ae7c1[_0x9fe178(0x231)]('✓')+'\x20('+_0x1b529d+')'):console[_0x9fe178(0x235)](_0x9fe178(0x1f7)+(_0x4ab084+0x1)+'/'+_0x4aaf0f[_0x9fe178(0x227)]['length']+_0x9fe178(0x1c2)+a5_0x3ae7c1[_0x9fe178(0x238)]('✗'));},'onEvaluationStart':()=>{const _0x4997dd=_0x5450a2;_0x3377da[_0x4997dd(0x1ed)]=_0x4997dd(0x209);},'onEvaluationComplete':_0x55e90e=>{const _0x375afc=_0x5450a2,_0x424972=formatElapsed(_0x55e90e);console[_0x375afc(0x235)](_0x375afc(0x234)+a5_0x3ae7c1['green']('✓')+'\x20('+_0x424972+')');}});_0x3377da['stop'](),_0xf434b8['push'](_0x3ff843),_0x36acec['push'](_0x3eac06);if(_0x3ff843[_0x5450a2(0x232)]===_0x5450a2(0x226))console[_0x5450a2(0x235)](a5_0x3ae7c1[_0x5450a2(0x231)](_0x5450a2(0x221)+_0x3ff843[_0x5450a2(0x1b7)]));else _0x3ff843[_0x5450a2(0x232)]==='FAIL'?console['log'](a5_0x3ae7c1[_0x5450a2(0x238)](_0x5450a2(0x1fa)+_0x3ff843['reason'])):console[_0x5450a2(0x235)](a5_0x3ae7c1[_0x5450a2(0x238)](_0x5450a2(0x1b3)+_0x3ff843[_0x5450a2(0x1b7)]));_0x3ff843[_0x5450a2(0x1af)]&&console[_0x5450a2(0x235)](a5_0x3ae7c1['dim'](_0x5450a2(0x1f5)+_0x3ff843[_0x5450a2(0x1af)])),console['log']();}catch(_0xdcebca){_0x3377da['stop']();const _0x51d2fd=_0xdcebca instanceof Error?_0xdcebca[_0x5450a2(0x210)]:String(_0xdcebca);console['log'](a5_0x3ae7c1[_0x5450a2(0x238)](_0x5450a2(0x1b3)+_0x51d2fd)),console[_0x5450a2(0x235)](),_0xf434b8[_0x5450a2(0x1f3)]({'name':_0x4aaf0f['name'],'status':_0x5450a2(0x20b),'reason':_0x51d2fd,'timestamp':new Date()[_0x5450a2(0x1f2)](),'duration_ms':0x0});}}const _0x5d7b1d=Date['now']()-_0x10e3f1,_0x1f0a69=_0xf434b8['filter'](_0x4d52b6=>_0x4d52b6[_0x5450a2(0x232)]===_0x5450a2(0x226))['length'],_0x4c1fc3=_0xf434b8['filter'](_0x4fa89e=>_0x4fa89e['status']===_0x5450a2(0x1bd))[_0x5450a2(0x1fd)],_0x258d64=_0xf434b8[_0x5450a2(0x213)](_0x3102ae=>_0x3102ae['status']===_0x5450a2(0x20b))[_0x5450a2(0x1fd)];console[_0x5450a2(0x235)]('━'['repeat'](0x3c)),console[_0x5450a2(0x235)](_0x5450a2(0x22f)),console[_0x5450a2(0x235)]('━'[_0x5450a2(0x222)](0x3c)),console['log']('Total:\x20\x20\x20\x20'+_0xf434b8[_0x5450a2(0x1fd)]),console[_0x5450a2(0x235)](_0x5450a2(0x1d5)+a5_0x3ae7c1[_0x5450a2(0x231)](_0x1f0a69)),console[_0x5450a2(0x235)](_0x5450a2(0x1df)+a5_0x3ae7c1[_0x5450a2(0x238)](_0x4c1fc3));_0x258d64>0x0&&console[_0x5450a2(0x235)]('Errors:\x20\x20\x20'+a5_0x3ae7c1[_0x5450a2(0x238)](_0x258d64));console[_0x5450a2(0x235)](_0x5450a2(0x1b0)+formatElapsed(_0x5d7b1d)),console[_0x5450a2(0x235)]('━'[_0x5450a2(0x222)](0x3c));const _0x2f6755=_0xf434b8[_0x5450a2(0x213)](_0x16273c=>_0x16273c['status']!=='PASS');if(_0x2f6755['length']>0x0){console[_0x5450a2(0x235)](),console[_0x5450a2(0x235)](_0x5450a2(0x1d4));for(const _0x5c4980 of _0x2f6755){const _0xc2431f=a5_0x3ae7c1[_0x5450a2(0x238)]('✗'),_0x246a08=_0x5c4980['reason']['length']>0x32?_0x5c4980[_0x5450a2(0x1b7)]['substring'](0x0,0x32)+_0x5450a2(0x1b5):_0x5c4980['reason'];console['log']('\x20\x20'+_0xc2431f+'\x20'+_0x5c4980['name']+':\x20'+_0x246a08);}}const _0xe0091d={'summary':{'total':_0xf434b8[_0x5450a2(0x1fd)],'passed':_0x1f0a69,'failed':_0x4c1fc3,'errors':_0x258d64>0x0?_0x258d64:undefined,'duration_ms':_0x5d7b1d},'tests':_0xf434b8,'agent':{'project':_0x41e50c[_0x5450a2(0x1d7)],'name':_0x41e50c[_0x5450a2(0x1d3)],'site':_0x3b1552},'timestamp':new Date(_0x10e3f1)[_0x5450a2(0x1f2)]()};try{const _0x5d5aea=buildCachedTestRun(_0x36acec,{'site':_0x3b1552,'projectId':_0x3796c1,'projectName':_0x41e50c['projectName'],'agentId':_0xca3ec1,'agentName':_0x41e50c[_0x5450a2(0x1d3)],'testYmlPath':a5_0x4eae37[_0x5450a2(0x23b)](_0x41e50c[_0x5450a2(0x1e2)])});saveLastTestRun(_0x5d5aea);}catch{}if(_0x15c566!==_0x5450a2(0x1f6)||_0x3e7b3d){const _0x5d5b32=formatResults(_0xe0091d,_0x15c566);if(_0x3e7b3d)try{a5_0x21bf8d[_0x5450a2(0x1cf)](_0x3e7b3d,_0x5d5b32,'utf-8'),console[_0x5450a2(0x235)](),console[_0x5450a2(0x235)](a5_0x3ae7c1['dim'](_0x5450a2(0x1d2)+_0x3e7b3d));}catch(_0x3f4c04){return console['log'](),console[_0x5450a2(0x235)](a5_0x3ae7c1[_0x5450a2(0x238)](_0x5450a2(0x1b8)+_0x3f4c04)),0x1;}else console[_0x5450a2(0x235)](),console[_0x5450a2(0x235)](_0x5d5b32);}return _0x2f6755[_0x5450a2(0x1fd)]>0x0?0x1:0x0;}async['executeReeval'](_0x1f8e85,_0x9c9084){const _0x571e3d=a5_0x7b37,{options:_0xb04b1a,tdx:_0x106349}=_0x1f8e85,{definition:_0xede042,agentInfo:_0x5098b5,outputFormat:_0x9d5236,outputFile:_0x50c87c}=_0x9c9084,_0x2bae20=_0xb04b1a[_0x571e3d(0x1b4)],_0x36f9d1=loadLastTestRun();if(!_0x36f9d1)return console['log'](a5_0x3ae7c1['red'](_0x571e3d(0x228))),console[_0x571e3d(0x235)](a5_0x3ae7c1['dim'](_0x571e3d(0x21b))),0x1;if(_0x36f9d1[_0x571e3d(0x219)][_0x571e3d(0x1d3)]!==_0x5098b5[_0x571e3d(0x1d3)])return console[_0x571e3d(0x235)](a5_0x3ae7c1[_0x571e3d(0x238)]('Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22'+_0x36f9d1[_0x571e3d(0x219)][_0x571e3d(0x1d3)]+_0x571e3d(0x1fb)+_0x5098b5['agentName']+'\x22.')),console[_0x571e3d(0x235)](a5_0x3ae7c1[_0x571e3d(0x217)](_0x571e3d(0x1da))),0x1;const _0x42211c=new Set(_0x36f9d1[_0x571e3d(0x1b2)][_0x571e3d(0x245)](_0x256800=>_0x256800['testName'])),_0x42a0af=_0xede042[_0x571e3d(0x20e)][_0x571e3d(0x213)](_0x4d5cbf=>!_0x42211c[_0x571e3d(0x1e5)](_0x4d5cbf[_0x571e3d(0x23a)]));if(_0x42a0af['length']>0x0&&_0x36f9d1[_0x571e3d(0x1b4)]!==_0x2bae20)return console[_0x571e3d(0x235)](a5_0x3ae7c1[_0x571e3d(0x238)](_0x571e3d(0x240))),console[_0x571e3d(0x235)](a5_0x3ae7c1['dim'](_0x571e3d(0x1ce)+_0x36f9d1[_0x571e3d(0x1b4)]+_0x571e3d(0x1f4)+_0x2bae20+'\x22.')),console[_0x571e3d(0x235)](a5_0x3ae7c1[_0x571e3d(0x217)](_0x571e3d(0x21c)+_0x36f9d1['site']+_0x571e3d(0x1cc))),0x1;const _0xb9b70d=_0xede042[_0x571e3d(0x20e)]['filter'](_0x2a59c3=>_0x42211c[_0x571e3d(0x1e5)](_0x2a59c3['name'])),_0x2cb2e6=_0x42a0af;let _0x4ec8dc;try{_0x4ec8dc=await setupEvaluatorAgent(_0x106349['llm'],_0xb04b1a[_0x571e3d(0x1d6)]);}catch(_0x18746a){const _0x4d292a=_0x18746a instanceof Error?_0x18746a[_0x571e3d(0x210)]:String(_0x18746a);return console[_0x571e3d(0x235)](a5_0x3ae7c1['red']('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x4d292a)),0x1;}console[_0x571e3d(0x235)](a5_0x3ae7c1[_0x571e3d(0x1db)](_0x571e3d(0x22e))),console['log'](_0x571e3d(0x22a)+a5_0x3ae7c1['white'](_0x36f9d1[_0x571e3d(0x207)])),console['log'](_0x571e3d(0x212)+a5_0x3ae7c1[_0x571e3d(0x211)](_0x36f9d1[_0x571e3d(0x219)][_0x571e3d(0x1d7)]+'/'+_0x36f9d1['agent'][_0x571e3d(0x1d3)]));_0x2cb2e6[_0x571e3d(0x1fd)]>0x0&&console['log'](_0x571e3d(0x1d1)+a5_0x3ae7c1[_0x571e3d(0x216)](_0x2cb2e6[_0x571e3d(0x1fd)]));console[_0x571e3d(0x235)]();const _0x187c59=[],_0x4385cb=Date[_0x571e3d(0x1f0)](),_0x2ba543=createCommandSpinner('Re-evaluating...');if(_0xb9b70d['length']>0x0)try{const _0x2ba735=await reevaluateFromCache(_0x106349['llm'],_0x36f9d1,{'tests':_0xb9b70d},{'evaluatorId':_0x4ec8dc,'onTestStart':(_0x2e5565,_0x9bbafe,_0x1a80bb)=>{const _0x26a5d0=_0x571e3d;_0x2ba543['text']=_0x26a5d0(0x1e8)+(_0x9bbafe+0x1)+'/'+_0x1a80bb+':\x20'+_0x2e5565+'...';if(!_0x2ba543[_0x26a5d0(0x1ae)])_0x2ba543['start']();},'onTestComplete':(_0x50196e,_0x47f3dc)=>{const _0xb6cf36=_0x571e3d;_0x2ba543[_0xb6cf36(0x248)]();if(_0x47f3dc[_0xb6cf36(0x232)]==='PASS')console[_0xb6cf36(0x235)](a5_0x3ae7c1[_0xb6cf36(0x231)](_0xb6cf36(0x221)+_0x50196e)+a5_0x3ae7c1[_0xb6cf36(0x217)]('\x20(cached)'));else _0x47f3dc['status']===_0xb6cf36(0x1bd)?console[_0xb6cf36(0x235)](a5_0x3ae7c1[_0xb6cf36(0x238)](_0xb6cf36(0x1fa)+_0x50196e+'\x20-\x20'+_0x47f3dc[_0xb6cf36(0x1b7)])+a5_0x3ae7c1[_0xb6cf36(0x217)](_0xb6cf36(0x1b6))):console['log'](a5_0x3ae7c1[_0xb6cf36(0x238)](_0xb6cf36(0x1b3)+_0x50196e+_0xb6cf36(0x236)+_0x47f3dc[_0xb6cf36(0x1b7)]));_0x47f3dc[_0xb6cf36(0x1af)]&&console[_0xb6cf36(0x235)](a5_0x3ae7c1[_0xb6cf36(0x217)](_0xb6cf36(0x1d0)+_0x47f3dc[_0xb6cf36(0x1af)])),_0x187c59['push'](_0x47f3dc);},'onTestSkipped':(_0x3beca1,_0x1751a5)=>{const _0x3ab88e=_0x571e3d;_0x2ba543[_0x3ab88e(0x248)](),console['log'](a5_0x3ae7c1['yellow'](_0x3ab88e(0x1e1)+_0x3beca1+_0x3ab88e(0x236)+_0x1751a5));}});for(const _0x376660 of _0x2ba735){!_0x187c59[_0x571e3d(0x1e0)](_0x1b62d0=>_0x1b62d0[_0x571e3d(0x23a)]===_0x376660[_0x571e3d(0x23a)])&&_0x187c59[_0x571e3d(0x1f3)](_0x376660);}}catch(_0x230d42){_0x2ba543[_0x571e3d(0x248)]();const _0x2fc01f=_0x230d42 instanceof Error?_0x230d42[_0x571e3d(0x210)]:String(_0x230d42);return console[_0x571e3d(0x235)](a5_0x3ae7c1[_0x571e3d(0x238)](_0x571e3d(0x208)+_0x2fc01f)),0x1;}_0x2ba543[_0x571e3d(0x248)]();if(_0x2cb2e6[_0x571e3d(0x1fd)]>0x0){console[_0x571e3d(0x235)](),console[_0x571e3d(0x235)](a5_0x3ae7c1['cyan']('Executing\x20new\x20tests...'));const {projectId:_0x1043e5,agentId:_0x6d6704}=_0x36f9d1['agent'];for(const _0x219c55 of _0x2cb2e6){console[_0x571e3d(0x235)](_0x571e3d(0x1c1)+a5_0x3ae7c1['white'](_0x219c55[_0x571e3d(0x23a)]));const _0x4ac277=createCommandSpinner(_0x571e3d(0x237)+_0x219c55[_0x571e3d(0x227)][_0x571e3d(0x1fd)]+_0x571e3d(0x1e4));_0x4ac277[_0x571e3d(0x1ff)]();try{const {result:_0x50009e}=await runTest(_0x106349['llm'],_0x219c55,{'agentId':_0x6d6704,'projectId':_0x1043e5,'site':_0x36f9d1[_0x571e3d(0x1b4)],'noEval':![],'evaluatorId':_0x4ec8dc,'onRoundStart':(_0x9499cb,_0x3f9efb)=>{const _0x448e1d=_0x571e3d;_0x4ac277[_0x448e1d(0x1ed)]='Round\x20'+(_0x9499cb+0x1)+'/'+_0x3f9efb+_0x448e1d(0x1e4);},'onRoundComplete':(_0x59d6fb,_0x1532a,_0x41f9e2)=>{const _0x2c16e3=_0x571e3d,_0x1e34b6=formatElapsed(_0x1532a);_0x41f9e2?console[_0x2c16e3(0x235)](_0x2c16e3(0x1f7)+(_0x59d6fb+0x1)+'/'+_0x219c55[_0x2c16e3(0x227)][_0x2c16e3(0x1fd)]+_0x2c16e3(0x1c2)+a5_0x3ae7c1[_0x2c16e3(0x231)]('✓')+'\x20('+_0x1e34b6+')'):console[_0x2c16e3(0x235)]('\x20\x20Round\x20'+(_0x59d6fb+0x1)+'/'+_0x219c55['rounds'][_0x2c16e3(0x1fd)]+_0x2c16e3(0x1c2)+a5_0x3ae7c1['red']('✗'));},'onEvaluationStart':()=>{const _0x4dee05=_0x571e3d;_0x4ac277[_0x4dee05(0x1ed)]=_0x4dee05(0x209);},'onEvaluationComplete':_0x2bbd69=>{const _0x53d77a=_0x571e3d,_0x300239=formatElapsed(_0x2bbd69);console['log'](_0x53d77a(0x234)+a5_0x3ae7c1[_0x53d77a(0x231)]('✓')+'\x20('+_0x300239+')');}});_0x4ac277[_0x571e3d(0x248)](),_0x187c59['push'](_0x50009e);if(_0x50009e['status']===_0x571e3d(0x226))console[_0x571e3d(0x235)](a5_0x3ae7c1[_0x571e3d(0x231)](_0x571e3d(0x221)+_0x50009e[_0x571e3d(0x1b7)])+a5_0x3ae7c1[_0x571e3d(0x217)]('\x20(new)'));else _0x50009e[_0x571e3d(0x232)]===_0x571e3d(0x1bd)?console[_0x571e3d(0x235)](a5_0x3ae7c1[_0x571e3d(0x238)](_0x571e3d(0x1fa)+_0x50009e['reason'])+a5_0x3ae7c1[_0x571e3d(0x217)](_0x571e3d(0x205))):console[_0x571e3d(0x235)](a5_0x3ae7c1[_0x571e3d(0x238)](_0x571e3d(0x1b3)+_0x50009e['reason']));_0x50009e[_0x571e3d(0x1af)]&&console[_0x571e3d(0x235)](a5_0x3ae7c1['dim'](_0x571e3d(0x1d0)+_0x50009e[_0x571e3d(0x1af)]));}catch(_0x5adf55){_0x4ac277[_0x571e3d(0x248)]();const _0x387f08=_0x5adf55 instanceof Error?_0x5adf55[_0x571e3d(0x210)]:String(_0x5adf55);console[_0x571e3d(0x235)](a5_0x3ae7c1[_0x571e3d(0x238)](_0x571e3d(0x1b3)+_0x387f08)),_0x187c59['push']({'name':_0x219c55[_0x571e3d(0x23a)],'status':_0x571e3d(0x20b),'reason':_0x387f08,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}}console[_0x571e3d(0x235)]();const _0x13a1a7=Date[_0x571e3d(0x1f0)]()-_0x4385cb,_0x3c0712=_0x187c59['filter'](_0x35dc2e=>_0x35dc2e[_0x571e3d(0x232)]===_0x571e3d(0x226))[_0x571e3d(0x1fd)],_0x4842a4=_0x187c59[_0x571e3d(0x213)](_0x592308=>_0x592308[_0x571e3d(0x232)]===_0x571e3d(0x1bd))[_0x571e3d(0x1fd)],_0x2bac20=_0x187c59[_0x571e3d(0x213)](_0x1f2882=>_0x1f2882[_0x571e3d(0x232)]==='ERROR')[_0x571e3d(0x1fd)];console['log']('━'[_0x571e3d(0x222)](0x3c)),console[_0x571e3d(0x235)](_0x571e3d(0x224)),console[_0x571e3d(0x235)]('━'['repeat'](0x3c)),console['log'](_0x571e3d(0x1c8)+_0x187c59['length']),console[_0x571e3d(0x235)](_0x571e3d(0x1d5)+a5_0x3ae7c1[_0x571e3d(0x231)](_0x3c0712)),console[_0x571e3d(0x235)](_0x571e3d(0x1df)+a5_0x3ae7c1[_0x571e3d(0x238)](_0x4842a4));_0x2bac20>0x0&&console[_0x571e3d(0x235)]('Errors:\x20\x20\x20'+a5_0x3ae7c1['red'](_0x2bac20));console[_0x571e3d(0x235)](_0x571e3d(0x1b0)+formatElapsed(_0x13a1a7)),console[_0x571e3d(0x235)]('━'[_0x571e3d(0x222)](0x3c));const _0x5706cf={'summary':{'total':_0x187c59['length'],'passed':_0x3c0712,'failed':_0x4842a4,'errors':_0x2bac20>0x0?_0x2bac20:undefined,'duration_ms':_0x13a1a7},'tests':_0x187c59,'agent':{'project':_0x5098b5[_0x571e3d(0x1d7)],'name':_0x5098b5['agentName'],'site':_0x2bae20},'timestamp':new Date(_0x4385cb)[_0x571e3d(0x1f2)]()};if(_0x9d5236!==_0x571e3d(0x1f6)||_0x50c87c){const _0x3da27d=formatResults(_0x5706cf,_0x9d5236);if(_0x50c87c)try{a5_0x21bf8d[_0x571e3d(0x1cf)](_0x50c87c,_0x3da27d,'utf-8'),console[_0x571e3d(0x235)](),console['log'](a5_0x3ae7c1['dim']('Output\x20written\x20to:\x20'+_0x50c87c));}catch(_0xedfdc){return console['log'](),console[_0x571e3d(0x235)](a5_0x3ae7c1[_0x571e3d(0x238)]('Error\x20writing\x20output\x20file:\x20'+_0xedfdc)),0x1;}else console[_0x571e3d(0x235)](),console[_0x571e3d(0x235)](_0x3da27d);}const _0x1aaa2c=_0x187c59[_0x571e3d(0x213)](_0x4cd286=>_0x4cd286[_0x571e3d(0x232)]!==_0x571e3d(0x226));return _0x1aaa2c[_0x571e3d(0x1fd)]>0x0?0x1:0x0;}}
@@ -1 +1 @@
1
- const a6_0x1028c2=a6_0x3445;(function(_0xa365ec,_0x3a766e){const _0x59acbf=a6_0x3445,_0x2a0831=_0xa365ec();while(!![]){try{const _0x549997=parseInt(_0x59acbf(0x9b))/0x1*(-parseInt(_0x59acbf(0x87))/0x2)+parseInt(_0x59acbf(0xaa))/0x3+-parseInt(_0x59acbf(0x73))/0x4*(-parseInt(_0x59acbf(0x9f))/0x5)+parseInt(_0x59acbf(0x8d))/0x6*(parseInt(_0x59acbf(0x97))/0x7)+-parseInt(_0x59acbf(0x91))/0x8*(-parseInt(_0x59acbf(0xa6))/0x9)+-parseInt(_0x59acbf(0x71))/0xa*(parseInt(_0x59acbf(0x81))/0xb)+-parseInt(_0x59acbf(0x7c))/0xc;if(_0x549997===_0x3a766e)break;else _0x2a0831['push'](_0x2a0831['shift']());}catch(_0x4ec64e){_0x2a0831['push'](_0x2a0831['shift']());}}}(a6_0x4027,0x5172c));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';function a6_0x4027(){const _0x15b77a=['3889452sshWNu','type','body','authorization','GET','5313DvuZPC','data','toUpperCase','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','Results\x20saved\x20to\x20','workflow','93586DxCViS','method','headers','substring','output','llm-proxy','3159258PZiStC','Invalid\x20HTTP\x20method:\x20','POST','Invalid\x20header\x20format:\x20\x22','8SivYGd','error','DELETE','.\x20Valid\x20types:\x20','toLowerCase','x-auth-token','7RQcpjV','api','entries','name','11SaMdwJ','Endpoint\x20must\x20start\x20with\x20/:\x20','<\x20HTTP/1.1\x20','PUT','65FqcIVU','trino','length','trim','execute','cdp','header','3173535EdVyOZ','request','join','file','156342pJlEbA','x-trino-user','PATCH','includes','status','x-xsrf-token','Invalid\x20API\x20type:\x20','description','Error:\x20','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','keys','log','3340pDOXoI','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','123848vZwpeR','color','verbose','isArray','readBodyFromFile','\x0aStack\x20trace:\x0a','has','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','cookie'];a6_0x4027=function(){return _0x15b77a;};return a6_0x4027();}function a6_0x3445(_0x1e5122,_0x204b22){_0x1e5122=_0x1e5122-0x68;const _0x402764=a6_0x4027();let _0x344541=_0x402764[_0x1e5122];return _0x344541;}import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a6_0x1028c2(0x7f),'proxy-authorization',a6_0x1028c2(0x7b),'set-cookie','set-cookie2',a6_0x1028c2(0x6a),a6_0x1028c2(0x96),a6_0x1028c2(0xab)]);function isSensitiveHeader(_0x50044f){const _0x4ae771=a6_0x1028c2;return SENSITIVE_HEADERS[_0x4ae771(0x79)](_0x50044f[_0x4ae771(0x95)]());}function parseHeader(_0x19abc8){const _0x5247f8=a6_0x1028c2,_0x55a0f1=_0x19abc8['indexOf'](':');if(_0x55a0f1===-0x1)throw new Error(_0x5247f8(0x90)+_0x19abc8+'\x22.\x20'+'Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22');const _0x4a6f2d=_0x19abc8[_0x5247f8(0x8a)](0x0,_0x55a0f1)[_0x5247f8(0xa2)](),_0x28d6be=_0x19abc8[_0x5247f8(0x8a)](_0x55a0f1+0x1)['trim']();if(!_0x4a6f2d)throw new Error(_0x5247f8(0x84)+_0x19abc8+'\x22');return[_0x4a6f2d,_0x28d6be];}export class ApiCommand extends BaseCommand{[a6_0x1028c2(0x9a)]=a6_0x1028c2(0x98);[a6_0x1028c2(0x6c)]=a6_0x1028c2(0x6e);['validate'](_0x4cb529){const _0x467ba2=a6_0x1028c2,{args:_0x281244,options:_0x158b14}=_0x4cb529,_0x52f3b8=_0x158b14;if(_0x281244[_0x467ba2(0xa1)]===0x0)return _0x467ba2(0x72);const _0x142b69=_0x281244[0x0];if(!_0x142b69['startsWith']('/'))return _0x467ba2(0x9c)+_0x142b69;const _0x4dd955=_0x52f3b8['data'],_0x5dcb43=_0x52f3b8[_0x467ba2(0xa9)];if(_0x4dd955&&_0x5dcb43)return _0x467ba2(0x7a);const _0x90700e=_0x52f3b8['method']||_0x467ba2(0x80),_0x6a3f25=[_0x467ba2(0x80),_0x467ba2(0x8f),_0x467ba2(0x9e),_0x467ba2(0x93),_0x467ba2(0xac)];if(!_0x6a3f25[_0x467ba2(0x68)](_0x90700e[_0x467ba2(0x83)]()))return _0x467ba2(0x8e)+_0x90700e+'.\x20Valid\x20methods:\x20'+_0x6a3f25['join'](',\x20');const _0x30bd9e=_0x52f3b8[_0x467ba2(0x7d)]||'td',_0x5e79ea=['td',_0x467ba2(0xa4),_0x467ba2(0x86),_0x467ba2(0xa0),'llm',_0x467ba2(0x8c)];if(!_0x5e79ea[_0x467ba2(0x68)](_0x30bd9e))return _0x467ba2(0x6b)+_0x30bd9e+_0x467ba2(0x94)+_0x5e79ea[_0x467ba2(0xa8)](',\x20');return undefined;}async[a6_0x1028c2(0xa3)](_0x1a72ac){const _0x10cb31=a6_0x1028c2,{options:_0x494b0a,args:_0x362741,tdx:_0x23d7a8}=_0x1a72ac,_0x20bb03=_0x494b0a,_0x182c2c=_0x362741[0x0],_0x12b691=(_0x20bb03[_0x10cb31(0x88)]||_0x10cb31(0x80))[_0x10cb31(0x83)](),_0x361986=_0x20bb03[_0x10cb31(0x82)],_0x189d05=_0x20bb03[_0x10cb31(0xa9)],_0x3d8b9e=_0x20bb03[_0x10cb31(0xa5)],_0x1d1223=_0x20bb03[_0x10cb31(0x7d)]||'td';try{const _0x20cf72={};if(_0x3d8b9e){const _0x1645ff=Array[_0x10cb31(0x76)](_0x3d8b9e)?_0x3d8b9e:[_0x3d8b9e];for(const _0x2b2a45 of _0x1645ff){const [_0xe938be,_0x1a4cc4]=parseHeader(_0x2b2a45);_0x20cf72[_0xe938be]=_0x1a4cc4;}}let _0xbc22d4;if(_0x361986)_0xbc22d4=_0x361986;else{if(_0x189d05)try{_0xbc22d4=RawAPI[_0x10cb31(0x77)](_0x189d05);}catch(_0x2e791c){return console[_0x10cb31(0x92)]('Error:\x20'+(_0x2e791c instanceof Error?_0x2e791c['message']:String(_0x2e791c))),0x1;}}const _0x34b0eb={'method':_0x12b691,'apiType':_0x1d1223,'includeHeaders':_0x494b0a['verbose']};_0xbc22d4&&(_0x34b0eb[_0x10cb31(0x7e)]=_0xbc22d4);Object[_0x10cb31(0x6f)](_0x20cf72)[_0x10cb31(0xa1)]>0x0&&(_0x34b0eb['headers']=_0x20cf72);if(_0x494b0a[_0x10cb31(0x75)]){const _0x8bc111=resolveSite(_0x494b0a['site']),_0xc5a46a=getEndpoint(_0x8bc111,_0x1d1223),_0x1ef8ef=''+_0xc5a46a+_0x182c2c;console[_0x10cb31(0x92)]('>\x20'+_0x12b691+'\x20'+_0x1ef8ef);const _0x361277=getAuthHeaders(_0x8bc111),_0x3eae2f={..._0x361277,..._0x20cf72};for(const [_0x2943ee,_0x16bd73]of Object[_0x10cb31(0x99)](_0x3eae2f)){!isSensitiveHeader(_0x2943ee)&&console[_0x10cb31(0x92)]('>\x20'+_0x2943ee+':\x20'+_0x16bd73);}_0xbc22d4&&console['error']('>'),console['error']('');}const _0xa2fa55=await _0x23d7a8[_0x10cb31(0x98)][_0x10cb31(0xa7)](_0x182c2c,_0x34b0eb);if(_0x494b0a[_0x10cb31(0x75)]&&_0xa2fa55[_0x10cb31(0x89)]){console[_0x10cb31(0x92)](_0x10cb31(0x9d)+_0xa2fa55[_0x10cb31(0x69)]);for(const [_0x2feffb,_0x26eb11]of Object[_0x10cb31(0x99)](_0xa2fa55['headers'])){!isSensitiveHeader(_0x2feffb)&&console[_0x10cb31(0x92)]('<\x20'+_0x2feffb+':\x20'+_0x26eb11);}console[_0x10cb31(0x92)]('');}const _0x410d9c=Boolean(_0x494b0a[_0x10cb31(0x8b)]),_0x33b7f5={'color':_0x494b0a[_0x10cb31(0x74)],'noColor':_0x494b0a['noColor']||_0x410d9c&&!_0x494b0a[_0x10cb31(0x74)]},_0x303495=colorizeJSON(_0xa2fa55[_0x10cb31(0x82)],_0x33b7f5);return _0x494b0a[_0x10cb31(0x8b)]?(writeFileSync(_0x494b0a[_0x10cb31(0x8b)],_0x303495),console[_0x10cb31(0x92)](_0x10cb31(0x85)+_0x494b0a[_0x10cb31(0x8b)])):console[_0x10cb31(0x70)](_0x303495),0x0;}catch(_0x576b8c){return _0x576b8c instanceof Error?(console['error'](_0x10cb31(0x6d)+_0x576b8c['message']),_0x494b0a[_0x10cb31(0x75)]&&_0x576b8c['stack']&&console['error'](_0x10cb31(0x78)+_0x576b8c['stack'])):console[_0x10cb31(0x92)](_0x10cb31(0x6d)+String(_0x576b8c)),0x1;}}}
1
+ const a6_0x16eaf9=a6_0x2fed;(function(_0x1113d1,_0x5ee8ea){const _0xa33628=a6_0x2fed,_0x4cc70f=_0x1113d1();while(!![]){try{const _0x48cb92=-parseInt(_0xa33628(0xe6))/0x1+parseInt(_0xa33628(0x116))/0x2+parseInt(_0xa33628(0xf1))/0x3+-parseInt(_0xa33628(0xfe))/0x4+-parseInt(_0xa33628(0xef))/0x5*(-parseInt(_0xa33628(0xf2))/0x6)+-parseInt(_0xa33628(0x101))/0x7*(-parseInt(_0xa33628(0x11a))/0x8)+-parseInt(_0xa33628(0x103))/0x9;if(_0x48cb92===_0x5ee8ea)break;else _0x4cc70f['push'](_0x4cc70f['shift']());}catch(_0x255d1c){_0x4cc70f['push'](_0x4cc70f['shift']());}}}(a6_0x3b6e,0x427ed));import{BaseCommand}from'./command.js';function a6_0x2fed(_0x375814,_0x533fcf){_0x375814=_0x375814-0xe1;const _0x3b6e07=a6_0x3b6e();let _0x2fed2d=_0x3b6e07[_0x375814];return _0x2fed2d;}import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';function a6_0x3b6e(){const _0x1a5cfa=['stack','includes','header','81829pPjIMF','Invalid\x20header\x20format:\x20\x22','set-cookie2','data','type','Endpoint\x20must\x20start\x20with\x20/:\x20','POST','error','\x22.\x20','25anqmaY','isArray','220746IqFzaC','567048CflKWG','workflow','entries','trim','log','proxy-authorization','cookie','GET','length','set-cookie','keys','trino','1259548uqqzLP','.\x20Valid\x20methods:\x20','name','680092RRSgrc','PATCH','6691878VtvdMS','body','description','api','llm','file','request','color','has','headers','noColor','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','join','Error:\x20','DELETE','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','site','toUpperCase','toLowerCase','955754nYrafl','message','verbose','x-trino-user','32DAHkCE','x-auth-token','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','status','authorization','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','method','llm-proxy','execute','.\x20Valid\x20types:\x20','startsWith','output','validate'];a6_0x3b6e=function(){return _0x1a5cfa;};return a6_0x3b6e();}import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a6_0x16eaf9(0x11e),a6_0x16eaf9(0xf7),a6_0x16eaf9(0xf8),a6_0x16eaf9(0xfb),a6_0x16eaf9(0xe8),'x-xsrf-token',a6_0x16eaf9(0x11b),a6_0x16eaf9(0x119)]);function isSensitiveHeader(_0x3e7b9b){const _0x26eb29=a6_0x16eaf9;return SENSITIVE_HEADERS[_0x26eb29(0x10b)](_0x3e7b9b[_0x26eb29(0x115)]());}function parseHeader(_0x3d709b){const _0x12d6ec=a6_0x16eaf9,_0x30bd30=_0x3d709b['indexOf'](':');if(_0x30bd30===-0x1)throw new Error(_0x12d6ec(0xe7)+_0x3d709b+_0x12d6ec(0xee)+_0x12d6ec(0x10e));const _0x1acd4e=_0x3d709b['substring'](0x0,_0x30bd30)['trim'](),_0x2efe51=_0x3d709b['substring'](_0x30bd30+0x1)[_0x12d6ec(0xf5)]();if(!_0x1acd4e)throw new Error('Header\x20key\x20cannot\x20be\x20empty:\x20\x22'+_0x3d709b+'\x22');return[_0x1acd4e,_0x2efe51];}export class ApiCommand extends BaseCommand{[a6_0x16eaf9(0x100)]=a6_0x16eaf9(0x106);[a6_0x16eaf9(0x105)]=a6_0x16eaf9(0x11c);[a6_0x16eaf9(0xe2)](_0x557d6c){const _0x346cf0=a6_0x16eaf9,{args:_0x106514,options:_0x283c33}=_0x557d6c,_0xa4f5e3=_0x283c33;if(_0x106514[_0x346cf0(0xfa)]===0x0)return _0x346cf0(0x112);const _0x5212d6=_0x106514[0x0];if(!_0x5212d6[_0x346cf0(0x124)]('/'))return _0x346cf0(0xeb)+_0x5212d6;const _0xae474=_0xa4f5e3[_0x346cf0(0xe9)],_0x5f601d=_0xa4f5e3[_0x346cf0(0x108)];if(_0xae474&&_0x5f601d)return _0x346cf0(0x11f);const _0x410516=_0xa4f5e3[_0x346cf0(0x120)]||_0x346cf0(0xf9),_0x36306d=[_0x346cf0(0xf9),_0x346cf0(0xec),'PUT',_0x346cf0(0x111),_0x346cf0(0x102)];if(!_0x36306d['includes'](_0x410516[_0x346cf0(0x114)]()))return'Invalid\x20HTTP\x20method:\x20'+_0x410516+_0x346cf0(0xff)+_0x36306d[_0x346cf0(0x10f)](',\x20');const _0x3a4b91=_0xa4f5e3[_0x346cf0(0xea)]||'td',_0x54faa0=['td','cdp',_0x346cf0(0xf3),_0x346cf0(0xfd),_0x346cf0(0x107),_0x346cf0(0x121)];if(!_0x54faa0[_0x346cf0(0xe4)](_0x3a4b91))return'Invalid\x20API\x20type:\x20'+_0x3a4b91+_0x346cf0(0x123)+_0x54faa0[_0x346cf0(0x10f)](',\x20');return undefined;}async[a6_0x16eaf9(0x122)](_0x563c63){const _0xbb15a4=a6_0x16eaf9,{options:_0x355358,args:_0x2e3b27,tdx:_0x164616}=_0x563c63,_0x5691b8=_0x355358,_0x5cfbdf=_0x2e3b27[0x0],_0x533b2c=(_0x5691b8[_0xbb15a4(0x120)]||_0xbb15a4(0xf9))[_0xbb15a4(0x114)](),_0xee80bc=_0x5691b8[_0xbb15a4(0xe9)],_0x1d4eb0=_0x5691b8[_0xbb15a4(0x108)],_0x146a0c=_0x5691b8[_0xbb15a4(0xe5)],_0x1d49f2=_0x5691b8['type']||'td';try{const _0x5875ec={};if(_0x146a0c){const _0x253e9c=Array[_0xbb15a4(0xf0)](_0x146a0c)?_0x146a0c:[_0x146a0c];for(const _0x1a5746 of _0x253e9c){const [_0x5ec3fb,_0x1d12ba]=parseHeader(_0x1a5746);_0x5875ec[_0x5ec3fb]=_0x1d12ba;}}let _0x29de8b;if(_0xee80bc)_0x29de8b=_0xee80bc;else{if(_0x1d4eb0)try{_0x29de8b=RawAPI['readBodyFromFile'](_0x1d4eb0);}catch(_0xdce887){return console[_0xbb15a4(0xed)](_0xbb15a4(0x110)+(_0xdce887 instanceof Error?_0xdce887[_0xbb15a4(0x117)]:String(_0xdce887))),0x1;}}const _0x14f003={'method':_0x533b2c,'apiType':_0x1d49f2,'includeHeaders':_0x355358['verbose']};_0x29de8b&&(_0x14f003[_0xbb15a4(0x104)]=_0x29de8b);Object[_0xbb15a4(0xfc)](_0x5875ec)[_0xbb15a4(0xfa)]>0x0&&(_0x14f003[_0xbb15a4(0x10c)]=_0x5875ec);if(_0x355358[_0xbb15a4(0x118)]){const _0x3c4dc0=resolveSite(_0x355358[_0xbb15a4(0x113)]),_0x53c8f3=getEndpoint(_0x3c4dc0,_0x1d49f2),_0x1446ab=''+_0x53c8f3+_0x5cfbdf;console['error']('>\x20'+_0x533b2c+'\x20'+_0x1446ab);const _0x2c96cc=getAuthHeaders(_0x3c4dc0),_0x394d21={..._0x2c96cc,..._0x5875ec};for(const [_0x4ffd1a,_0x271df9]of Object[_0xbb15a4(0xf4)](_0x394d21)){!isSensitiveHeader(_0x4ffd1a)&&console[_0xbb15a4(0xed)]('>\x20'+_0x4ffd1a+':\x20'+_0x271df9);}_0x29de8b&&console[_0xbb15a4(0xed)]('>'),console[_0xbb15a4(0xed)]('');}const _0x481257=await _0x164616[_0xbb15a4(0x106)][_0xbb15a4(0x109)](_0x5cfbdf,_0x14f003);if(_0x355358[_0xbb15a4(0x118)]&&_0x481257[_0xbb15a4(0x10c)]){console[_0xbb15a4(0xed)]('<\x20HTTP/1.1\x20'+_0x481257[_0xbb15a4(0x11d)]);for(const [_0x130091,_0x145202]of Object[_0xbb15a4(0xf4)](_0x481257[_0xbb15a4(0x10c)])){!isSensitiveHeader(_0x130091)&&console[_0xbb15a4(0xed)]('<\x20'+_0x130091+':\x20'+_0x145202);}console[_0xbb15a4(0xed)]('');}const _0x1c0a02=Boolean(_0x355358[_0xbb15a4(0xe1)]),_0x4f4477={'color':_0x355358['color'],'noColor':_0x355358[_0xbb15a4(0x10d)]||_0x1c0a02&&!_0x355358[_0xbb15a4(0x10a)]},_0x4cc890=colorizeJSON(_0x481257[_0xbb15a4(0xe9)],_0x4f4477);return _0x355358[_0xbb15a4(0xe1)]?(writeFileSync(_0x355358[_0xbb15a4(0xe1)],_0x4cc890),console[_0xbb15a4(0xed)]('Results\x20saved\x20to\x20'+_0x355358[_0xbb15a4(0xe1)])):console[_0xbb15a4(0xf6)](_0x4cc890),0x0;}catch(_0x9ebeaa){return _0x9ebeaa instanceof Error?(console[_0xbb15a4(0xed)](_0xbb15a4(0x110)+_0x9ebeaa[_0xbb15a4(0x117)]),_0x355358['verbose']&&_0x9ebeaa[_0xbb15a4(0xe3)]&&console['error']('\x0aStack\x20trace:\x0a'+_0x9ebeaa[_0xbb15a4(0xe3)])):console[_0xbb15a4(0xed)](_0xbb15a4(0x110)+String(_0x9ebeaa)),0x1;}}}
@@ -1 +1 @@
1
- const a7_0x4c0923=a7_0x196d;(function(_0xa23a14,_0x1c1f23){const _0x1bbad3=a7_0x196d,_0x421c35=_0xa23a14();while(!![]){try{const _0x221a9b=parseInt(_0x1bbad3(0xa8))/0x1*(-parseInt(_0x1bbad3(0xa5))/0x2)+-parseInt(_0x1bbad3(0xbf))/0x3+parseInt(_0x1bbad3(0xaa))/0x4*(-parseInt(_0x1bbad3(0xc6))/0x5)+parseInt(_0x1bbad3(0xc0))/0x6*(-parseInt(_0x1bbad3(0xd7))/0x7)+parseInt(_0x1bbad3(0xa9))/0x8*(-parseInt(_0x1bbad3(0xa4))/0x9)+-parseInt(_0x1bbad3(0x9f))/0xa*(-parseInt(_0x1bbad3(0xd5))/0xb)+-parseInt(_0x1bbad3(0xdd))/0xc*(-parseInt(_0x1bbad3(0xea))/0xd);if(_0x221a9b===_0x1c1f23)break;else _0x421c35['push'](_0x421c35['shift']());}catch(_0x58b77f){_0x421c35['push'](_0x421c35['shift']());}}}(a7_0x3b89,0x3e4aa));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';import{buildSiteChoices}from'../core/constants.js';import a7_0x203b87 from'prompts';import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';function a7_0x196d(_0xf29f1d,_0x57e2a1){_0xf29f1d=_0xf29f1d-0x9c;const _0x3b89ef=a7_0x3b89();let _0x196d8c=_0x3b89ef[_0xf29f1d];return _0x196d8c;}import{LogLevel}from'../utils/tdx-logger.js';import a7_0x423afa from'chalk';export class AuthSetupCommand extends BaseCommand{[a7_0x4c0923(0xcd)]=a7_0x4c0923(0xe7);['description']=a7_0x4c0923(0xbb);async[a7_0x4c0923(0xaf)](_0x2b894d){const _0x44a4b1=a7_0x4c0923,{options:_0x108023}=_0x2b894d,_0x5bd66e=_0x108023['profile'];console[_0x44a4b1(0xc5)](a7_0x423afa['bold'](_0x44a4b1(0xad)));const _0x5d4df8=_0x108023['site']||_0x44a4b1(0xa7),{choices:_0x3dd86d,initialIndex:_0x3ef9e1}=buildSiteChoices(_0x5d4df8),_0x29f756=_0x5bd66e?_0x44a4b1(0xdc)+_0x5bd66e+'):':_0x44a4b1(0xc3),_0x216f86=await a7_0x203b87({'type':_0x44a4b1(0xdb),'name':_0x44a4b1(0xb2),'message':_0x29f756,'choices':_0x3dd86d,'initial':_0x3ef9e1});if(!_0x216f86[_0x44a4b1(0xb2)])return console[_0x44a4b1(0xc5)]('\x0aSetup\x20cancelled'),0x1;let _0x4c65d4;if(_0x216f86['site']===_0x44a4b1(0xd3)){const _0x116601=await a7_0x203b87({'type':'text','name':'customSite','message':_0x44a4b1(0xc8),'initial':_0x44a4b1(0xa7),'validate':_0x88e058=>{const _0x225336=_0x44a4b1;if(!_0x88e058||!_0x88e058[_0x225336(0xa6)]())return _0x225336(0xe9);if(!/^[a-z0-9-]+$/[_0x225336(0xa2)](_0x88e058[_0x225336(0xa6)]()))return _0x225336(0xc1);return!![];}});if(!_0x116601['customSite'])return console[_0x44a4b1(0xc5)]('\x0aSetup\x20cancelled'),0x1;_0x4c65d4=_0x116601[_0x44a4b1(0xcf)];}else _0x4c65d4=_0x216f86[_0x44a4b1(0xb2)];const _0x12076e=resolveSite(_0x4c65d4);console['log']('Setting\x20up\x20authentication\x20for\x20site:\x20'+_0x12076e),console['log'](_0x44a4b1(0xe4)),console[_0x44a4b1(0xc5)]('\x20\x20'+getConsoleUrl(_0x12076e,_0x44a4b1(0xba)));const _0x385e39=await a7_0x203b87({'type':'password','name':_0x44a4b1(0xb4),'message':_0x44a4b1(0xb5),'validate':_0xe60f49=>{const _0x1dff75=_0x44a4b1;if(!_0xe60f49||!_0xe60f49['trim']())return _0x1dff75(0xc7);return!![];}});if(!_0x385e39[_0x44a4b1(0xb4)])return console[_0x44a4b1(0xc5)](_0x44a4b1(0xd1)),0x1;const _0x1ab50a=_0x385e39[_0x44a4b1(0xb4)];console[_0x44a4b1(0xc5)](_0x44a4b1(0xa3));try{const _0xa6eba4=TDX[_0x44a4b1(0xe5)]({'site':_0x12076e,'apiKey':_0x1ab50a[_0x44a4b1(0xa6)](),'logLevel':_0x108023[_0x44a4b1(0xb3)]??LogLevel[_0x44a4b1(0xbc)]}),_0x1c613c=await _0xa6eba4['jobs'][_0x44a4b1(0xb0)]();console[_0x44a4b1(0xc5)]('✓\x20API\x20key\x20is\x20valid\x20(User:\x20'+_0x1c613c[_0x44a4b1(0xcb)]+')');const _0x28f483=await isKeychainAvailable();_0x28f483?(await saveAPIKeyAsync(_0x1ab50a['trim'](),_0x12076e,_0x5bd66e),console['log'](_0x44a4b1(0xe1)+(_0x5bd66e?_0x44a4b1(0xd0)+_0x5bd66e+')':''))):(console[_0x44a4b1(0xdf)](a7_0x423afa[_0x44a4b1(0xd4)](_0x44a4b1(0xcc))),console['warn'](a7_0x423afa['yellow'](_0x44a4b1(0x9c))));if(_0x5bd66e){const _0x5ee3ee={'site':_0x12076e};saveProfileToUserConfig(_0x5bd66e,_0x5ee3ee),console[_0x44a4b1(0xc5)](_0x44a4b1(0xe0)+_0x5bd66e+_0x44a4b1(0xd9));}else saveDefaultSiteToUserConfig(_0x12076e),console[_0x44a4b1(0xc5)](_0x44a4b1(0xd2)+_0x12076e);const _0x1e799a=_0x5bd66e?_0x44a4b1(0xe2)+_0x5bd66e:'';return console[_0x44a4b1(0xc5)](),console[_0x44a4b1(0xc5)]('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console[_0x44a4b1(0xc5)](_0x44a4b1(0xe3)+_0x1e799a+_0x44a4b1(0xde)),console[_0x44a4b1(0xc5)](_0x44a4b1(0xe3)+_0x1e799a+_0x44a4b1(0xc4)),0x0;}catch(_0x360127){if(_0x360127 instanceof HTTPClientError&&_0x360127['status']===0x191)return printAuthError(_0x360127),0x1;return console[_0x44a4b1(0xb1)](a7_0x423afa[_0x44a4b1(0xb7)](_0x44a4b1(0x9d)+(_0x360127 instanceof Error?_0x360127[_0x44a4b1(0xd8)]:String(_0x360127)))),console['error'](_0x44a4b1(0xc9)),0x1;}}}function a7_0x3b89(){const _0x3dadc8=['apiKey','Enter\x20your\x20TD\x20API\x20key:','auth:clear','red','status','N/A','/app/mp/ak','Setup\x20API\x20key\x20authentication\x20interactively','ERROR','✓\x20API\x20key\x20removed\x20from\x20keychain','No\x20credential\x20found','878487eqimgZ','12AKKsWe','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','jobs','Select\x20your\x20Treasure\x20Data\x20site:','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','log','2020HasOlo','API\x20key\x20cannot\x20be\x20empty','Enter\x20site\x20name:','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','description','email','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','name','User:\x20','customSite','\x20(profile:\x20','\x0aSetup\x20cancelled','✓\x20Default\x20site\x20set\x20to\x20','other','yellow','12309VPYZct','System\x20keychain\x20is\x20not\x20available','74809QMIisd','message','\x27\x20registered','Name:\x20','select','Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20','708hzZXnH','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','warn','✓\x20Profile\x20\x27','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','\x20--profile\x20','\x20\x20tdx','You\x20can\x20find\x20your\x20API\x20key\x20at:','create','first_name','auth:setup','auth','Site\x20name\x20cannot\x20be\x20empty','348582fMTJoY','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','✗\x20Validation\x20failed:\x20','Remove\x20API\x20key\x20from\x20system\x20keychain','1090BPFnkk','last_name','tdx:\x20auth\x20clear','test','Validating\x20API\x20key...','18CoEiwp','86FOlJWV','trim','us01','11034UvYZER','1509544aeYivq','2800AqiLRJ','No\x20API\x20key\x20found\x20in\x20keychain','bold','tdx:\x20auth\x20setup','\x20for\x20profile:\x20','execute','getUserInfo','error','site','logLevel'];a7_0x3b89=function(){return _0x3dadc8;};return a7_0x3b89();}export class AuthStatusCommand extends BaseCommand{['name']=a7_0x4c0923(0xe8);[a7_0x4c0923(0xca)]='Show\x20authentication\x20status\x20and\x20validate\x20API\x20key';async[a7_0x4c0923(0xaf)](_0x583898){const _0x289025=a7_0x4c0923,{options:_0x2d5fe5,tdx:_0xf954b5}=_0x583898,_0x508dfe=_0x2d5fe5[_0x289025(0xb2)],_0x1c74e8=_0x2d5fe5['profile'],_0x512f11=_0x1c74e8?_0x1c74e8:_0x289025(0xb9);console[_0x289025(0xc5)]('tdx\x20profile:\x20'+_0x512f11+'\x20(site:\x20'+_0x508dfe+')');const _0x267a25=await resolveAPIKeyAsync(_0x508dfe,_0x1c74e8);if(_0x267a25){const {source:_0xe8b8da,isDeprecated:_0x302dd0}=_0x267a25,_0x4f3de6='Read\x20credential\x20from\x20'+_0xe8b8da;console[_0x289025(0xc5)](_0x302dd0?a7_0x423afa['yellow'](_0x4f3de6):_0x4f3de6);}else console['log'](a7_0x423afa[_0x289025(0xd4)](_0x289025(0xbe)));try{const _0xcd5d64=await _0xf954b5[_0x289025(0xc2)][_0x289025(0xb0)]();return console[_0x289025(0xc5)](a7_0x423afa['green']('✓\x20Authentication\x20successful\x0a')),console[_0x289025(0xc5)](_0x289025(0xce)+_0xcd5d64[_0x289025(0xcb)]),(_0xcd5d64['first_name']||_0xcd5d64[_0x289025(0xa0)])&&console[_0x289025(0xc5)](_0x289025(0xda)+[_0xcd5d64[_0x289025(0xe6)],_0xcd5d64[_0x289025(0xa0)]]['filter'](Boolean)['join']('\x20')),0x0;}catch(_0x37141b){return _0x37141b instanceof HTTPClientError&&_0x37141b[_0x289025(0xb8)]===0x191?printAuthError(_0x37141b,!![],_0x1c74e8):console[_0x289025(0xb1)](a7_0x423afa['red'](_0x289025(0x9d)+(_0x37141b instanceof Error?_0x37141b[_0x289025(0xd8)]:String(_0x37141b)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x4c0923(0xcd)]=a7_0x4c0923(0xb6);[a7_0x4c0923(0xca)]=a7_0x4c0923(0x9e);async[a7_0x4c0923(0xaf)](_0xd1a833){const _0x7abd9b=a7_0x4c0923,{options:_0x132c01}=_0xd1a833,_0x182f47=_0x132c01['profile'];console[_0x7abd9b(0xc5)](a7_0x423afa[_0x7abd9b(0xac)](_0x7abd9b(0xa1)));const _0x421e24=await isKeychainAvailable();if(!_0x421e24)return console['error'](a7_0x423afa[_0x7abd9b(0xb7)](_0x7abd9b(0xd6))),0x1;const _0x15ecf5=await deleteKeychainAPIKey(_0x182f47);return _0x15ecf5?(clearCredentialCache(),console[_0x7abd9b(0xc5)](_0x7abd9b(0xbd)+(_0x182f47?_0x7abd9b(0xd0)+_0x182f47+')':'')),0x0):(console[_0x7abd9b(0xc5)](_0x7abd9b(0xab)+(_0x182f47?_0x7abd9b(0xae)+_0x182f47:'')),0x1);}}
1
+ const a7_0x15f73c=a7_0x17ae;(function(_0x50b42f,_0x199f68){const _0x3a262f=a7_0x17ae,_0x3030dd=_0x50b42f();while(!![]){try{const _0x141a1d=-parseInt(_0x3a262f(0x1a1))/0x1*(-parseInt(_0x3a262f(0x1b7))/0x2)+parseInt(_0x3a262f(0x1a0))/0x3*(parseInt(_0x3a262f(0x1c3))/0x4)+parseInt(_0x3a262f(0x1cf))/0x5+parseInt(_0x3a262f(0x1bf))/0x6*(parseInt(_0x3a262f(0x1c7))/0x7)+parseInt(_0x3a262f(0x19e))/0x8+parseInt(_0x3a262f(0x1b3))/0x9+-parseInt(_0x3a262f(0x1b6))/0xa;if(_0x141a1d===_0x199f68)break;else _0x3030dd['push'](_0x3030dd['shift']());}catch(_0x98f966){_0x3030dd['push'](_0x3030dd['shift']());}}}(a7_0x30fa,0x35409));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';function a7_0x30fa(){const _0x1773f8=['\x20(profile:\x20','✗\x20Validation\x20failed:\x20','Enter\x20site\x20name:','Select\x20your\x20Treasure\x20Data\x20site:','No\x20API\x20key\x20found\x20in\x20keychain','auth:clear','3366528mRburS','text','1187469xXJMeH','41569nnmwBs','Setup\x20API\x20key\x20authentication\x20interactively','message','Remove\x20API\x20key\x20from\x20system\x20keychain','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','join','jobs','Read\x20credential\x20from\x20','\x20\x20tdx','getUserInfo','error','first_name','System\x20keychain\x20is\x20not\x20available','green','tdx:\x20auth\x20clear','password','site','bold','1767015xjmRAE','us01','✓\x20Default\x20site\x20set\x20to\x20','11235550uFXvBV','6GBbDHO','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','description','Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20','\x20for\x20profile:\x20','status','filter','30BUDwsl','execute','Name:\x20','red','4rkqDdK','No\x20credential\x20found','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','apiKey','283801ZIWeRf','trim','\x0aSetup\x20cancelled','profile','other','✓\x20Authentication\x20successful\x0a','customSite','You\x20can\x20find\x20your\x20API\x20key\x20at:','6400NSqING','Enter\x20your\x20TD\x20API\x20key:','yellow','log','test','warn','auth:setup','✓\x20Profile\x20\x27','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','N/A','ERROR','auth','name','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','logLevel','User:\x20','email'];a7_0x30fa=function(){return _0x1773f8;};return a7_0x30fa();}import{clearCredentialCache}from'../core/credential-cache.js';import{buildSiteChoices}from'../core/constants.js';import a7_0x428331 from'prompts';import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';function a7_0x17ae(_0x1b0c09,_0x185524){_0x1b0c09=_0x1b0c09-0x18b;const _0x30fa3f=a7_0x30fa();let _0x17aea6=_0x30fa3f[_0x1b0c09];return _0x17aea6;}import{LogLevel}from'../utils/tdx-logger.js';import a7_0x4ac8c1 from'chalk';export class AuthSetupCommand extends BaseCommand{[a7_0x15f73c(0x193)]=a7_0x15f73c(0x18c);[a7_0x15f73c(0x1ba)]=a7_0x15f73c(0x1a2);async['execute'](_0x5a747e){const _0x1417a9=a7_0x15f73c,{options:_0x32a60b}=_0x5a747e,_0x125682=_0x32a60b[_0x1417a9(0x1ca)];console[_0x1417a9(0x1d2)](a7_0x4ac8c1[_0x1417a9(0x1b2)]('tdx:\x20auth\x20setup'));const _0x44021f=_0x32a60b['site']||_0x1417a9(0x1b4),{choices:_0x40c80f,initialIndex:_0x4b803e}=buildSiteChoices(_0x44021f),_0x8e5144=_0x125682?_0x1417a9(0x1bb)+_0x125682+'):':_0x1417a9(0x19b),_0x5aba2b=await a7_0x428331({'type':'select','name':_0x1417a9(0x1b1),'message':_0x8e5144,'choices':_0x40c80f,'initial':_0x4b803e});if(!_0x5aba2b[_0x1417a9(0x1b1)])return console['log'](_0x1417a9(0x1c9)),0x1;let _0x4ae7b3;if(_0x5aba2b[_0x1417a9(0x1b1)]===_0x1417a9(0x1cb)){const _0x4955cb=await a7_0x428331({'type':_0x1417a9(0x19f),'name':_0x1417a9(0x1cd),'message':_0x1417a9(0x19a),'initial':'us01','validate':_0x2fe72e=>{const _0x5c9dbb=_0x1417a9;if(!_0x2fe72e||!_0x2fe72e[_0x5c9dbb(0x1c8)]())return'Site\x20name\x20cannot\x20be\x20empty';if(!/^[a-z0-9-]+$/[_0x5c9dbb(0x1d3)](_0x2fe72e[_0x5c9dbb(0x1c8)]()))return _0x5c9dbb(0x1b8);return!![];}});if(!_0x4955cb['customSite'])return console[_0x1417a9(0x1d2)](_0x1417a9(0x1c9)),0x1;_0x4ae7b3=_0x4955cb[_0x1417a9(0x1cd)];}else _0x4ae7b3=_0x5aba2b[_0x1417a9(0x1b1)];const _0x2741b9=resolveSite(_0x4ae7b3);console['log']('Setting\x20up\x20authentication\x20for\x20site:\x20'+_0x2741b9),console[_0x1417a9(0x1d2)](_0x1417a9(0x1ce)),console[_0x1417a9(0x1d2)]('\x20\x20'+getConsoleUrl(_0x2741b9,'/app/mp/ak'));const _0x47e0e4=await a7_0x428331({'type':_0x1417a9(0x1b0),'name':_0x1417a9(0x1c6),'message':_0x1417a9(0x1d0),'validate':_0x4b679c=>{const _0x1fb83c=_0x1417a9;if(!_0x4b679c||!_0x4b679c[_0x1fb83c(0x1c8)]())return'API\x20key\x20cannot\x20be\x20empty';return!![];}});if(!_0x47e0e4[_0x1417a9(0x1c6)])return console[_0x1417a9(0x1d2)](_0x1417a9(0x1c9)),0x1;const _0x42599c=_0x47e0e4[_0x1417a9(0x1c6)];console[_0x1417a9(0x1d2)]('Validating\x20API\x20key...');try{const _0x2bd4ab=TDX['create']({'site':_0x2741b9,'apiKey':_0x42599c[_0x1417a9(0x1c8)](),'logLevel':_0x32a60b[_0x1417a9(0x195)]??LogLevel[_0x1417a9(0x191)]}),_0x11f972=await _0x2bd4ab[_0x1417a9(0x1a7)][_0x1417a9(0x1aa)]();console[_0x1417a9(0x1d2)](_0x1417a9(0x18f)+_0x11f972[_0x1417a9(0x197)]+')');const _0x1cca7a=await isKeychainAvailable();_0x1cca7a?(await saveAPIKeyAsync(_0x42599c[_0x1417a9(0x1c8)](),_0x2741b9,_0x125682),console[_0x1417a9(0x1d2)](_0x1417a9(0x1c5)+(_0x125682?_0x1417a9(0x198)+_0x125682+')':''))):(console[_0x1417a9(0x18b)](a7_0x4ac8c1['yellow'](_0x1417a9(0x18e))),console[_0x1417a9(0x18b)](a7_0x4ac8c1[_0x1417a9(0x1d1)](_0x1417a9(0x1a5))));if(_0x125682){const _0xa5493f={'site':_0x2741b9};saveProfileToUserConfig(_0x125682,_0xa5493f),console[_0x1417a9(0x1d2)](_0x1417a9(0x18d)+_0x125682+'\x27\x20registered');}else saveDefaultSiteToUserConfig(_0x2741b9),console['log'](_0x1417a9(0x1b5)+_0x2741b9);const _0x558435=_0x125682?'\x20--profile\x20'+_0x125682:'';return console[_0x1417a9(0x1d2)](),console[_0x1417a9(0x1d2)](_0x1417a9(0x194)),console[_0x1417a9(0x1d2)](_0x1417a9(0x1a9)+_0x558435+_0x1417a9(0x1b9)),console['log'](_0x1417a9(0x1a9)+_0x558435+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases'),0x0;}catch(_0x50d3b0){if(_0x50d3b0 instanceof HTTPClientError&&_0x50d3b0[_0x1417a9(0x1bd)]===0x191)return printAuthError(_0x50d3b0),0x1;return console[_0x1417a9(0x1ab)](a7_0x4ac8c1[_0x1417a9(0x1c2)](_0x1417a9(0x199)+(_0x50d3b0 instanceof Error?_0x50d3b0[_0x1417a9(0x1a3)]:String(_0x50d3b0)))),console[_0x1417a9(0x1ab)]('API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.'),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x15f73c(0x193)]=a7_0x15f73c(0x192);[a7_0x15f73c(0x1ba)]='Show\x20authentication\x20status\x20and\x20validate\x20API\x20key';async[a7_0x15f73c(0x1c0)](_0x2e0e48){const _0x42894d=a7_0x15f73c,{options:_0x429ab6,tdx:_0x484883}=_0x2e0e48,_0x2f56c7=_0x429ab6[_0x42894d(0x1b1)],_0x185d52=_0x429ab6[_0x42894d(0x1ca)],_0x478a44=_0x185d52?_0x185d52:_0x42894d(0x190);console['log']('tdx\x20profile:\x20'+_0x478a44+'\x20(site:\x20'+_0x2f56c7+')');const _0x493319=await resolveAPIKeyAsync(_0x2f56c7,_0x185d52);if(_0x493319){const {source:_0x4c3a7d,isDeprecated:_0x2b5bd2}=_0x493319,_0x78f8bf=_0x42894d(0x1a8)+_0x4c3a7d;console[_0x42894d(0x1d2)](_0x2b5bd2?a7_0x4ac8c1['yellow'](_0x78f8bf):_0x78f8bf);}else console[_0x42894d(0x1d2)](a7_0x4ac8c1[_0x42894d(0x1d1)](_0x42894d(0x1c4)));try{const _0x560000=await _0x484883[_0x42894d(0x1a7)][_0x42894d(0x1aa)]();return console[_0x42894d(0x1d2)](a7_0x4ac8c1[_0x42894d(0x1ae)](_0x42894d(0x1cc))),console[_0x42894d(0x1d2)](_0x42894d(0x196)+_0x560000['email']),(_0x560000['first_name']||_0x560000['last_name'])&&console[_0x42894d(0x1d2)](_0x42894d(0x1c1)+[_0x560000[_0x42894d(0x1ac)],_0x560000['last_name']][_0x42894d(0x1be)](Boolean)[_0x42894d(0x1a6)]('\x20')),0x0;}catch(_0x1f20a6){return _0x1f20a6 instanceof HTTPClientError&&_0x1f20a6['status']===0x191?printAuthError(_0x1f20a6,!![],_0x185d52):console[_0x42894d(0x1ab)](a7_0x4ac8c1[_0x42894d(0x1c2)](_0x42894d(0x199)+(_0x1f20a6 instanceof Error?_0x1f20a6[_0x42894d(0x1a3)]:String(_0x1f20a6)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x15f73c(0x193)]=a7_0x15f73c(0x19d);[a7_0x15f73c(0x1ba)]=a7_0x15f73c(0x1a4);async['execute'](_0x201b11){const _0x2b47ad=a7_0x15f73c,{options:_0x58cca4}=_0x201b11,_0x408e73=_0x58cca4[_0x2b47ad(0x1ca)];console[_0x2b47ad(0x1d2)](a7_0x4ac8c1[_0x2b47ad(0x1b2)](_0x2b47ad(0x1af)));const _0x18fe15=await isKeychainAvailable();if(!_0x18fe15)return console[_0x2b47ad(0x1ab)](a7_0x4ac8c1[_0x2b47ad(0x1c2)](_0x2b47ad(0x1ad))),0x1;const _0x1764dd=await deleteKeychainAPIKey(_0x408e73);return _0x1764dd?(clearCredentialCache(),console['log']('✓\x20API\x20key\x20removed\x20from\x20keychain'+(_0x408e73?_0x2b47ad(0x198)+_0x408e73+')':'')),0x0):(console[_0x2b47ad(0x1d2)](_0x2b47ad(0x19c)+(_0x408e73?_0x2b47ad(0x1bc)+_0x408e73:'')),0x1);}}
@@ -1 +1 @@
1
- const a8_0xdb5a19=a8_0xc593;(function(_0x4a40e6,_0x7eb159){const _0x4d3a3d=a8_0xc593,_0x3c1543=_0x4a40e6();while(!![]){try{const _0x412719=-parseInt(_0x4d3a3d(0x190))/0x1*(-parseInt(_0x4d3a3d(0x1b9))/0x2)+parseInt(_0x4d3a3d(0x1ac))/0x3*(-parseInt(_0x4d3a3d(0x1c2))/0x4)+parseInt(_0x4d3a3d(0x192))/0x5+-parseInt(_0x4d3a3d(0x183))/0x6+parseInt(_0x4d3a3d(0x197))/0x7+-parseInt(_0x4d3a3d(0x193))/0x8+-parseInt(_0x4d3a3d(0x19b))/0x9*(-parseInt(_0x4d3a3d(0x1ae))/0xa);if(_0x412719===_0x7eb159)break;else _0x3c1543['push'](_0x3c1543['shift']());}catch(_0x302bcb){_0x3c1543['push'](_0x3c1543['shift']());}}}(a8_0xdb14,0x99a6b));function a8_0xdb14(){const _0x26e65c=['claude-4.5-haiku','functionName','\x27\x20not\x20found','log','join','targetAgent','code','handleChatEvent','chatId','No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22','args','7227798gfSDGq','string','streamChatJsonl','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','tool_call','verbose','tool','event','agent','tool_result','error','done','\x0aStack\x20trace:','23yEJySq','Error:\x20Chat\x20session\x20\x27','5323665diEYuA','3145912yQaUqE','name','content','projectId','2505426DjfCOl','Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','execute','9wgxlhx','Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together','llmProject','message','Using\x20agent\x20from\x20','targetFunction','data','Resolving\x20agent\x20\x27','description','Chat\x20session:\x20','startChat','llm','metadata','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','validate','stringify','chat-create','113220eGuTRz','Continuing\x20chat:\x20','3440230hJZgJs','agentId','stack','Error:\x20','\x20\x20Cause:\x20','stdout','chat','cause','type','\x27...','Using\x20cached\x20default\x20agent:\x20','66302UOYdwB','llmAgent','Create\x20a\x20new\x20chat\x20session','site','targetKnowledgeBase','404','new','Resolving\x20project\x20\x27','streamChat','32GfGljV','\x0aError:\x20'];a8_0xdb14=function(){return _0x26e65c;};return a8_0xdb14();}import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/errors.js';function a8_0xc593(_0x25435f,_0x2746cf){_0x25435f=_0x25435f-0x17e;const _0xdb1470=a8_0xdb14();let _0xc59345=_0xdb1470[_0x25435f];return _0xc59345;}import{withSpinner}from'../utils/spinner.js';import{parseAgentRef}from'../sdk/agent/agent-ref-parser.js';import{saveLastChatId,loadLastChatId}from'../sdk/llm/chat-cache.js';import{getLLMConversationUrl}from'../sdk/client/endpoints.js';function handleSDKError(_0x2481b2,_0xb03f17){const _0x4902fa=a8_0xc593;if(_0x2481b2 instanceof SDKError)console['error'](_0x4902fa(0x1b1)+_0x2481b2[_0x4902fa(0x19e)]),_0xb03f17['verbose']&&(_0x2481b2[_0x4902fa(0x1b5)]&&console[_0x4902fa(0x18d)](_0x4902fa(0x1b2)+_0x2481b2[_0x4902fa(0x1b5)]),_0x2481b2['stack']&&(console['error'](_0x4902fa(0x18f)),console[_0x4902fa(0x18d)](_0x2481b2[_0x4902fa(0x1b0)])));else throw _0x2481b2;}async function resolveAgentId(_0x421a3d,_0x26d7bb,_0x35ebac,_0x45b2cc,_0x4eb360){const _0x2ffd3c=a8_0xc593,_0x32eeb9=_0x26d7bb||_0x35ebac;if(_0x32eeb9){const {projectName:_0x33df50,agentName:_0x57031e}=parseAgentRef(_0x32eeb9),_0x50ad60=_0x57031e||_0x32eeb9,_0x4bf5e6=_0x57031e?_0x33df50:_0x45b2cc;if(!_0x4bf5e6)throw new Error(_0x2ffd3c(0x181));if(_0x4eb360){const _0x5a2918=_0x26d7bb?'--agent\x20flag':'session\x20context';console['error'](_0x2ffd3c(0x19f)+_0x5a2918+':\x20'+_0x4bf5e6+'/'+_0x50ad60);}const _0x273878=await withSpinner(_0x2ffd3c(0x1c0)+_0x4bf5e6+_0x2ffd3c(0x1b7),()=>_0x421a3d['llm']['resolveProjectId'](_0x4bf5e6),{'verbose':_0x4eb360}),_0x3b5b62=await withSpinner(_0x2ffd3c(0x1a2)+_0x50ad60+_0x2ffd3c(0x1b7),()=>_0x421a3d['llm']['resolveAgentId'](_0x50ad60,_0x273878[_0x2ffd3c(0x1a1)]),{'verbose':_0x4eb360});return _0x3b5b62[_0x2ffd3c(0x1a1)];}else{const _0x2a23a2=_0x421a3d[_0x2ffd3c(0x1a6)]['getDefaultAgent']();if(_0x2a23a2)return _0x4eb360&&console[_0x2ffd3c(0x18d)](_0x2ffd3c(0x1b8)+_0x2a23a2[_0x2ffd3c(0x194)]),_0x2a23a2['id'];const _0x4e16f5=await withSpinner('Getting\x20default\x20agent...',()=>_0x421a3d[_0x2ffd3c(0x1a6)]['getOrCreateDefaultAgent'](_0x2ffd3c(0x1c4),0x0),{'verbose':_0x4eb360});return _0x4e16f5[_0x2ffd3c(0x1a1)]['id'];}}export class ChatCommand extends BaseCommand{[a8_0xdb5a19(0x194)]='chat';['description']=a8_0xdb5a19(0x199);[a8_0xdb5a19(0x1a9)](_0x1ae6d2){const _0x5ea12a=a8_0xdb5a19,_0x444b36=_0x1ae6d2[_0x5ea12a(0x182)][_0x5ea12a(0x1c8)]('\x20');if(!_0x444b36)return _0x5ea12a(0x186);return undefined;}async[a8_0xdb5a19(0x1c1)](_0x3f54eb,_0x459a84,_0x1f6aa5,_0x4b90ce,_0x48e986){const _0x48797b=a8_0xdb5a19;for await(const _0x10156d of _0x3f54eb[_0x48797b(0x1a6)][_0x48797b(0x1b4)](_0x459a84,{'agentId':_0x1f6aa5,'chatId':_0x4b90ce})){if(_0x10156d['type']===_0x48797b(0x1a7)){const _0x5b816f=_0x10156d['data']['chatId'];saveLastChatId(_0x5b816f),_0x48e986&&console[_0x48797b(0x18d)](_0x48797b(0x1a4)+_0x5b816f);}else _0x10156d[_0x48797b(0x1b6)]===_0x48797b(0x18a)&&this['handleChatEvent'](_0x10156d[_0x48797b(0x1a1)]);}}async[a8_0xdb5a19(0x185)](_0x2ba045,_0x1e5f33,_0x2965f8,_0x39e742){const _0x442205=a8_0xdb5a19,_0x4a6fcc=_0x2ba045['context'][_0x442205(0x1bc)];let _0x12c46b=![];for await(const _0x4063a9 of _0x2ba045[_0x442205(0x1a6)][_0x442205(0x1b4)](_0x1e5f33,{'agentId':_0x2965f8,'chatId':_0x39e742})){if(_0x4063a9[_0x442205(0x1b6)]==='metadata'){const _0x420ee5=_0x4063a9[_0x442205(0x1a1)];saveLastChatId(_0x420ee5[_0x442205(0x180)]);const _0x4ed872=_0x420ee5[_0x442205(0x196)]&&_0x420ee5[_0x442205(0x1af)]?getLLMConversationUrl(_0x4a6fcc,_0x420ee5[_0x442205(0x196)],_0x420ee5['agentId'],_0x420ee5[_0x442205(0x180)]):undefined;console['log'](JSON[_0x442205(0x1aa)]({'type':_0x442205(0x1a7),'data':{'chatId':_0x420ee5['chatId'],'agentId':_0x420ee5[_0x442205(0x1af)],'consoleUrl':_0x4ed872}})),_0x12c46b=!![];}else{if(_0x4063a9['type']==='event'){!_0x12c46b&&_0x39e742&&(console[_0x442205(0x1c7)](JSON[_0x442205(0x1aa)]({'type':_0x442205(0x1a7),'data':{'chatId':_0x39e742}})),_0x12c46b=!![]);const _0x31f183=_0x4063a9[_0x442205(0x1a1)];if(_0x442205(0x195)in _0x31f183)console[_0x442205(0x1c7)](JSON[_0x442205(0x1aa)]({'type':_0x442205(0x195),'data':{'content':_0x31f183[_0x442205(0x195)]}}));else{if(_0x442205(0x187)in _0x31f183){const _0x4357c5=_0x31f183[_0x442205(0x187)];console[_0x442205(0x1c7)](JSON['stringify']({'type':_0x442205(0x187),'data':{'id':_0x4357c5['id'],'name':_0x4357c5['functionName'],'target':_0x4357c5[_0x442205(0x1bd)]?.[_0x442205(0x194)]||_0x4357c5[_0x442205(0x1c9)]?.['name']||_0x4357c5['targetWebSearchTool']?.[_0x442205(0x194)]||_0x4357c5[_0x442205(0x1a0)]}}));}else{if(_0x442205(0x189)in _0x31f183)console[_0x442205(0x1c7)](JSON[_0x442205(0x1aa)]({'type':_0x442205(0x18c),'data':{'id':_0x31f183[_0x442205(0x189)]['id'],'name':_0x31f183[_0x442205(0x189)][_0x442205(0x1c5)],'result':typeof _0x31f183[_0x442205(0x189)][_0x442205(0x195)]===_0x442205(0x184)?_0x31f183['tool'][_0x442205(0x195)]['slice'](0x0,0x1f4):''}}));else _0x442205(0x18d)in _0x31f183&&console[_0x442205(0x1c7)](JSON[_0x442205(0x1aa)]({'type':_0x442205(0x18d),'data':{'error':_0x31f183[_0x442205(0x18d)]}}));}}}}}console[_0x442205(0x1c7)](JSON[_0x442205(0x1aa)]({'type':_0x442205(0x18e)}));}async[a8_0xdb5a19(0x19a)](_0x30e3ec){const _0x4ef88b=a8_0xdb5a19,{options:_0x4d73cd,args:_0x4506a7,tdx:_0xdefa5f}=_0x30e3ec,_0x40be28=_0x4506a7[_0x4ef88b(0x1c8)]('\x20'),_0x3e5574=_0x4d73cd,_0x36cf68=_0x3e5574[_0x4ef88b(0x18b)],_0x36ee88=_0x3e5574[_0x4ef88b(0x1ba)],_0x54298a=_0x3e5574[_0x4ef88b(0x19d)],_0x31e795=_0x3e5574[_0x4ef88b(0x1bf)],_0x4f7244=_0x3e5574['chatId'],_0x3ed714=_0x3e5574['stream'];if(_0x31e795&&_0x4f7244)return console[_0x4ef88b(0x18d)](_0x4ef88b(0x19c)),0x1;try{let _0x18eae7,_0x58d1a4;if(_0x4f7244)_0x58d1a4=_0x4f7244;else!_0x31e795&&(_0x58d1a4=loadLastChatId(),_0x58d1a4&&_0x4d73cd['verbose']&&console[_0x4ef88b(0x18d)](_0x4ef88b(0x1ad)+_0x58d1a4));!_0x4f7244&&(_0x31e795||!_0x58d1a4)&&(_0x18eae7=await resolveAgentId(_0xdefa5f,_0x36cf68,_0x36ee88,_0x54298a,_0x4d73cd['verbose']));const _0x1a0ea2=_0x3ed714?(_0x49ede1,_0x2fb92e,_0x5d9518)=>this[_0x4ef88b(0x185)](_0xdefa5f,_0x49ede1,_0x2fb92e,_0x5d9518):(_0x50679d,_0x13e8e0,_0x15c33d)=>this[_0x4ef88b(0x1c1)](_0xdefa5f,_0x50679d,_0x13e8e0,_0x15c33d,_0x4d73cd[_0x4ef88b(0x188)]);try{await _0x1a0ea2(_0x40be28,_0x18eae7,_0x58d1a4);}catch(_0x340e2c){const _0x5a149e=_0x340e2c instanceof SDKError&&_0x340e2c[_0x4ef88b(0x17e)]===ErrorCode['CHAT_NOT_FOUND']||_0x340e2c instanceof Error&&_0x340e2c[_0x4ef88b(0x19e)]['includes'](_0x4ef88b(0x1be));if(_0x5a149e&&_0x4f7244)return console[_0x4ef88b(0x18d)](_0x4ef88b(0x191)+_0x4f7244+_0x4ef88b(0x1c6)),0x1;if(_0x5a149e)_0x4d73cd[_0x4ef88b(0x188)]&&console[_0x4ef88b(0x18d)](_0x4ef88b(0x1a8)),!_0x18eae7&&(_0x18eae7=await resolveAgentId(_0xdefa5f,_0x36cf68,_0x36ee88,_0x54298a,_0x4d73cd[_0x4ef88b(0x188)])),await _0x1a0ea2(_0x40be28,_0x18eae7,undefined);else throw _0x340e2c;}return!_0x3ed714&&console[_0x4ef88b(0x1c7)](),0x0;}catch(_0x3dc935){return console[_0x4ef88b(0x18d)](),handleSDKError(_0x3dc935,_0x4d73cd),0x1;}}[a8_0xdb5a19(0x17f)](_0x58303f){const _0x4b6636=a8_0xdb5a19;if(_0x4b6636(0x195)in _0x58303f)process[_0x4b6636(0x1b3)]['write'](_0x58303f['content']);else _0x4b6636(0x18d)in _0x58303f&&console['error'](_0x4b6636(0x1c3)+_0x58303f[_0x4b6636(0x18d)]);}}export class ChatCreateCommand extends BaseCommand{['name']=a8_0xdb5a19(0x1ab);[a8_0xdb5a19(0x1a3)]=a8_0xdb5a19(0x1bb);[a8_0xdb5a19(0x1a9)](_0x2e0a6e){const _0xe9f6a8=a8_0xdb5a19,_0x147216=_0x2e0a6e['options'],_0x34187c=_0x147216[_0xe9f6a8(0x18b)],_0x2226c9=_0x147216[_0xe9f6a8(0x1ba)];if(!_0x34187c&&!_0x2226c9)return _0xe9f6a8(0x198);return undefined;}async[a8_0xdb5a19(0x19a)](_0x4eb020){const _0xe8b446=a8_0xdb5a19,{options:_0x319eb2,tdx:_0x4ba420}=_0x4eb020,_0x2d0a45=_0x319eb2,_0x1275e6=_0x2d0a45[_0xe8b446(0x18b)],_0x544ca0=_0x2d0a45['llmAgent'],_0x533559=_0x2d0a45[_0xe8b446(0x19d)];try{const _0x4e78a3=await resolveAgentId(_0x4ba420,_0x1275e6,_0x544ca0,_0x533559,_0x319eb2[_0xe8b446(0x188)]),_0x325128=await _0x4ba420[_0xe8b446(0x1a6)][_0xe8b446(0x1a5)](_0x4e78a3);return saveLastChatId(_0x325128['id']),console['log'](JSON[_0xe8b446(0x1aa)]({'chatId':_0x325128['id'],'agentId':_0x4e78a3})),0x0;}catch(_0xc94ff0){return handleSDKError(_0xc94ff0,_0x319eb2),0x1;}}}
1
+ const a8_0xbb12b7=a8_0x59c1;(function(_0x4320ce,_0x379db4){const _0x3b88c8=a8_0x59c1,_0x959638=_0x4320ce();while(!![]){try{const _0x4c0d9d=parseInt(_0x3b88c8(0x194))/0x1*(-parseInt(_0x3b88c8(0x195))/0x2)+-parseInt(_0x3b88c8(0x17e))/0x3*(parseInt(_0x3b88c8(0x151))/0x4)+parseInt(_0x3b88c8(0x190))/0x5*(-parseInt(_0x3b88c8(0x183))/0x6)+parseInt(_0x3b88c8(0x189))/0x7+parseInt(_0x3b88c8(0x15a))/0x8+parseInt(_0x3b88c8(0x17b))/0x9*(parseInt(_0x3b88c8(0x167))/0xa)+parseInt(_0x3b88c8(0x160))/0xb;if(_0x4c0d9d===_0x379db4)break;else _0x959638['push'](_0x959638['shift']());}catch(_0x55753f){_0x959638['push'](_0x959638['shift']());}}}(a8_0x304c,0x25b0b));import{BaseCommand}from'./command.js';function a8_0x59c1(_0x452366,_0x246466){_0x452366=_0x452366-0x148;const _0x304c04=a8_0x304c();let _0x59c16f=_0x304c04[_0x452366];return _0x59c16f;}import{SDKError,ErrorCode}from'../sdk/errors.js';import{withSpinner}from'../utils/spinner.js';import{parseAgentRef}from'../sdk/agent/agent-ref-parser.js';import{saveLastChatId,loadLastChatId}from'../sdk/llm/chat-cache.js';import{getLLMConversationUrl}from'../sdk/client/endpoints.js';function handleSDKError(_0x6cee05,_0x23e7f3){const _0x51f8fe=a8_0x59c1;if(_0x6cee05 instanceof SDKError)console[_0x51f8fe(0x161)](_0x51f8fe(0x162)+_0x6cee05[_0x51f8fe(0x150)]),_0x23e7f3[_0x51f8fe(0x16b)]&&(_0x6cee05['cause']&&console[_0x51f8fe(0x161)](_0x51f8fe(0x179)+_0x6cee05[_0x51f8fe(0x18d)]),_0x6cee05[_0x51f8fe(0x152)]&&(console['error'](_0x51f8fe(0x169)),console['error'](_0x6cee05[_0x51f8fe(0x152)])));else throw _0x6cee05;}function a8_0x304c(){const _0x25d195=['message','8NVmDaO','stack','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','tool_result','args','stringify','Create\x20a\x20new\x20chat\x20session','site','streamChat','1740936uLtKoY','validate','getOrCreateDefaultAgent','streamChatJsonl','resolveProjectId','chat-create','2730816ExPZxr','error','Error:\x20','\x27\x20not\x20found','projectId','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','content','1910YYfGHy','Continuing\x20chat:\x20','\x0aStack\x20trace:','metadata','verbose','chat','tool_call','agentId','chatId','join','llmAgent','startChat','string','Getting\x20default\x20agent...','getDefaultAgent','new','\x27...','handleChatEvent','\x20\x20Cause:\x20','No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22','10413CkJZDE','functionName','execute','48894ysBLwQ','tool','type','Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22','CHAT_NOT_FOUND','3414vojgzA','description','Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together','stdout','Using\x20agent\x20from\x20','llmProject','302491tJOFjY','llm','\x0aError:\x20','data','cause','Chat\x20session:\x20','name','2375pfkHUV','log','context','stream','272823dUbwhW','2Vtnfdj','code','event','targetKnowledgeBase','404','targetWebSearchTool','claude-4.5-haiku','slice','targetFunction','agent'];a8_0x304c=function(){return _0x25d195;};return a8_0x304c();}async function resolveAgentId(_0x51567d,_0x64076e,_0x1ef8c4,_0x9e9b8d,_0x2a2c43){const _0x15de73=a8_0x59c1,_0x244a67=_0x64076e||_0x1ef8c4;if(_0x244a67){const {projectName:_0x30903a,agentName:_0x35814f}=parseAgentRef(_0x244a67),_0x173c05=_0x35814f||_0x244a67,_0x463630=_0x35814f?_0x30903a:_0x9e9b8d;if(!_0x463630)throw new Error(_0x15de73(0x17a));if(_0x2a2c43){const _0x5d1296=_0x64076e?'--agent\x20flag':'session\x20context';console[_0x15de73(0x161)](_0x15de73(0x187)+_0x5d1296+':\x20'+_0x463630+'/'+_0x173c05);}const _0x53d2fd=await withSpinner('Resolving\x20project\x20\x27'+_0x463630+_0x15de73(0x177),()=>_0x51567d[_0x15de73(0x18a)][_0x15de73(0x15e)](_0x463630),{'verbose':_0x2a2c43}),_0x567ff2=await withSpinner('Resolving\x20agent\x20\x27'+_0x173c05+_0x15de73(0x177),()=>_0x51567d[_0x15de73(0x18a)]['resolveAgentId'](_0x173c05,_0x53d2fd[_0x15de73(0x18c)]),{'verbose':_0x2a2c43});return _0x567ff2[_0x15de73(0x18c)];}else{const _0x474803=_0x51567d['llm'][_0x15de73(0x175)]();if(_0x474803)return _0x2a2c43&&console[_0x15de73(0x161)]('Using\x20cached\x20default\x20agent:\x20'+_0x474803[_0x15de73(0x18f)]),_0x474803['id'];const _0x4d39c9=await withSpinner(_0x15de73(0x174),()=>_0x51567d[_0x15de73(0x18a)][_0x15de73(0x15c)](_0x15de73(0x14c),0x0),{'verbose':_0x2a2c43});return _0x4d39c9['data']['id'];}}export class ChatCommand extends BaseCommand{[a8_0xbb12b7(0x18f)]=a8_0xbb12b7(0x16c);[a8_0xbb12b7(0x184)]='Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)';[a8_0xbb12b7(0x15b)](_0x5575e8){const _0x26158e=a8_0xbb12b7,_0x4220e7=_0x5575e8[_0x26158e(0x155)]['join']('\x20');if(!_0x4220e7)return _0x26158e(0x165);return undefined;}async['streamChat'](_0x56cd73,_0x31bcd0,_0x652382,_0x3b541e,_0x3e2fa4){const _0x3893c6=a8_0xbb12b7;for await(const _0x5b2c7d of _0x56cd73['llm']['chat'](_0x31bcd0,{'agentId':_0x652382,'chatId':_0x3b541e})){if(_0x5b2c7d[_0x3893c6(0x180)]===_0x3893c6(0x16a)){const _0x161626=_0x5b2c7d['data'][_0x3893c6(0x16f)];saveLastChatId(_0x161626),_0x3e2fa4&&console['error'](_0x3893c6(0x18e)+_0x161626);}else _0x5b2c7d['type']===_0x3893c6(0x148)&&this['handleChatEvent'](_0x5b2c7d[_0x3893c6(0x18c)]);}}async[a8_0xbb12b7(0x15d)](_0x48caac,_0x1f67e9,_0x3f4369,_0xf88cf3){const _0x5afaca=a8_0xbb12b7,_0x509509=_0x48caac[_0x5afaca(0x192)][_0x5afaca(0x158)];let _0x7184b7=![];for await(const _0x46e478 of _0x48caac[_0x5afaca(0x18a)][_0x5afaca(0x16c)](_0x1f67e9,{'agentId':_0x3f4369,'chatId':_0xf88cf3})){if(_0x46e478[_0x5afaca(0x180)]===_0x5afaca(0x16a)){const _0x302c9a=_0x46e478['data'];saveLastChatId(_0x302c9a[_0x5afaca(0x16f)]);const _0x2bf61c=_0x302c9a[_0x5afaca(0x164)]&&_0x302c9a[_0x5afaca(0x16e)]?getLLMConversationUrl(_0x509509,_0x302c9a[_0x5afaca(0x164)],_0x302c9a[_0x5afaca(0x16e)],_0x302c9a[_0x5afaca(0x16f)]):undefined;console['log'](JSON[_0x5afaca(0x156)]({'type':_0x5afaca(0x16a),'data':{'chatId':_0x302c9a[_0x5afaca(0x16f)],'agentId':_0x302c9a[_0x5afaca(0x16e)],'consoleUrl':_0x2bf61c}})),_0x7184b7=!![];}else{if(_0x46e478[_0x5afaca(0x180)]===_0x5afaca(0x148)){!_0x7184b7&&_0xf88cf3&&(console['log'](JSON[_0x5afaca(0x156)]({'type':_0x5afaca(0x16a),'data':{'chatId':_0xf88cf3}})),_0x7184b7=!![]);const _0xef839c=_0x46e478[_0x5afaca(0x18c)];if('content'in _0xef839c)console[_0x5afaca(0x191)](JSON['stringify']({'type':'content','data':{'content':_0xef839c['content']}}));else{if(_0x5afaca(0x16d)in _0xef839c){const _0x108b39=_0xef839c['tool_call'];console['log'](JSON['stringify']({'type':_0x5afaca(0x16d),'data':{'id':_0x108b39['id'],'name':_0x108b39[_0x5afaca(0x17c)],'target':_0x108b39[_0x5afaca(0x149)]?.['name']||_0x108b39['targetAgent']?.['name']||_0x108b39[_0x5afaca(0x14b)]?.[_0x5afaca(0x18f)]||_0x108b39[_0x5afaca(0x14e)]}}));}else{if(_0x5afaca(0x17f)in _0xef839c)console[_0x5afaca(0x191)](JSON[_0x5afaca(0x156)]({'type':_0x5afaca(0x154),'data':{'id':_0xef839c[_0x5afaca(0x17f)]['id'],'name':_0xef839c[_0x5afaca(0x17f)][_0x5afaca(0x17c)],'result':typeof _0xef839c[_0x5afaca(0x17f)]['content']===_0x5afaca(0x173)?_0xef839c[_0x5afaca(0x17f)][_0x5afaca(0x166)][_0x5afaca(0x14d)](0x0,0x1f4):''}}));else'error'in _0xef839c&&console[_0x5afaca(0x191)](JSON[_0x5afaca(0x156)]({'type':_0x5afaca(0x161),'data':{'error':_0xef839c[_0x5afaca(0x161)]}}));}}}}}console[_0x5afaca(0x191)](JSON[_0x5afaca(0x156)]({'type':'done'}));}async[a8_0xbb12b7(0x17d)](_0x4b6c3f){const _0x2d3a59=a8_0xbb12b7,{options:_0xcdf4bc,args:_0x4cbcb3,tdx:_0x49ab48}=_0x4b6c3f,_0x14550b=_0x4cbcb3[_0x2d3a59(0x170)]('\x20'),_0x244657=_0xcdf4bc,_0x24e41b=_0x244657[_0x2d3a59(0x14f)],_0x2e63b5=_0x244657[_0x2d3a59(0x171)],_0x2620bc=_0x244657['llmProject'],_0x52799b=_0x244657[_0x2d3a59(0x176)],_0x1a3dac=_0x244657[_0x2d3a59(0x16f)],_0x587324=_0x244657[_0x2d3a59(0x193)];if(_0x52799b&&_0x1a3dac)return console[_0x2d3a59(0x161)](_0x2d3a59(0x185)),0x1;try{let _0x32b78d,_0x3ecea8;if(_0x1a3dac)_0x3ecea8=_0x1a3dac;else!_0x52799b&&(_0x3ecea8=loadLastChatId(),_0x3ecea8&&_0xcdf4bc[_0x2d3a59(0x16b)]&&console[_0x2d3a59(0x161)](_0x2d3a59(0x168)+_0x3ecea8));!_0x1a3dac&&(_0x52799b||!_0x3ecea8)&&(_0x32b78d=await resolveAgentId(_0x49ab48,_0x24e41b,_0x2e63b5,_0x2620bc,_0xcdf4bc[_0x2d3a59(0x16b)]));const _0x5d7178=_0x587324?(_0x2bc43d,_0x458d2a,_0x33b341)=>this[_0x2d3a59(0x15d)](_0x49ab48,_0x2bc43d,_0x458d2a,_0x33b341):(_0x231eaa,_0xd0a986,_0x26bce2)=>this[_0x2d3a59(0x159)](_0x49ab48,_0x231eaa,_0xd0a986,_0x26bce2,_0xcdf4bc['verbose']);try{await _0x5d7178(_0x14550b,_0x32b78d,_0x3ecea8);}catch(_0x42ed06){const _0x4dcf64=_0x42ed06 instanceof SDKError&&_0x42ed06[_0x2d3a59(0x196)]===ErrorCode[_0x2d3a59(0x182)]||_0x42ed06 instanceof Error&&_0x42ed06[_0x2d3a59(0x150)]['includes'](_0x2d3a59(0x14a));if(_0x4dcf64&&_0x1a3dac)return console[_0x2d3a59(0x161)]('Error:\x20Chat\x20session\x20\x27'+_0x1a3dac+_0x2d3a59(0x163)),0x1;if(_0x4dcf64)_0xcdf4bc[_0x2d3a59(0x16b)]&&console[_0x2d3a59(0x161)](_0x2d3a59(0x153)),!_0x32b78d&&(_0x32b78d=await resolveAgentId(_0x49ab48,_0x24e41b,_0x2e63b5,_0x2620bc,_0xcdf4bc[_0x2d3a59(0x16b)])),await _0x5d7178(_0x14550b,_0x32b78d,undefined);else throw _0x42ed06;}return!_0x587324&&console[_0x2d3a59(0x191)](),0x0;}catch(_0x18a87f){return console[_0x2d3a59(0x161)](),handleSDKError(_0x18a87f,_0xcdf4bc),0x1;}}[a8_0xbb12b7(0x178)](_0x17dcac){const _0x46a251=a8_0xbb12b7;if(_0x46a251(0x166)in _0x17dcac)process[_0x46a251(0x186)]['write'](_0x17dcac[_0x46a251(0x166)]);else _0x46a251(0x161)in _0x17dcac&&console[_0x46a251(0x161)](_0x46a251(0x18b)+_0x17dcac[_0x46a251(0x161)]);}}export class ChatCreateCommand extends BaseCommand{['name']=a8_0xbb12b7(0x15f);[a8_0xbb12b7(0x184)]=a8_0xbb12b7(0x157);[a8_0xbb12b7(0x15b)](_0x3b6a68){const _0x3ed7f3=a8_0xbb12b7,_0x2cdbd9=_0x3b6a68['options'],_0x550671=_0x2cdbd9[_0x3ed7f3(0x14f)],_0x592668=_0x2cdbd9[_0x3ed7f3(0x171)];if(!_0x550671&&!_0x592668)return _0x3ed7f3(0x181);return undefined;}async[a8_0xbb12b7(0x17d)](_0xb73e30){const _0x50f941=a8_0xbb12b7,{options:_0x251e06,tdx:_0x262d4c}=_0xb73e30,_0x219488=_0x251e06,_0x5b527f=_0x219488[_0x50f941(0x14f)],_0x261272=_0x219488[_0x50f941(0x171)],_0x283945=_0x219488[_0x50f941(0x188)];try{const _0x5376f2=await resolveAgentId(_0x262d4c,_0x5b527f,_0x261272,_0x283945,_0x251e06['verbose']),_0x25ac72=await _0x262d4c['llm'][_0x50f941(0x172)](_0x5376f2);return saveLastChatId(_0x25ac72['id']),console[_0x50f941(0x191)](JSON['stringify']({'chatId':_0x25ac72['id'],'agentId':_0x5376f2})),0x0;}catch(_0x564406){return handleSDKError(_0x564406,_0x251e06),0x1;}}}