@treasuredata/tdx 0.19.2 → 0.20.0

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 (182) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/chat-command.js +1 -1
  11. package/dist/commands/claude-command.js +1 -1
  12. package/dist/commands/claude-statusline-command.js +1 -1
  13. package/dist/commands/claude-usage-command.js +1 -1
  14. package/dist/commands/command.js +1 -1
  15. package/dist/commands/connection-command.js +1 -1
  16. package/dist/commands/databases.js +1 -1
  17. package/dist/commands/describe.js +1 -1
  18. package/dist/commands/engage-command.js +1 -1
  19. package/dist/commands/job-command.js +1 -1
  20. package/dist/commands/journey-command.js +1 -1
  21. package/dist/commands/journey-validate-command.js +1 -1
  22. package/dist/commands/llm-command.js +1 -1
  23. package/dist/commands/llm-proxy.js +1 -1
  24. package/dist/commands/mcp-command.js +1 -1
  25. package/dist/commands/parent-segment-command.js +1 -1
  26. package/dist/commands/profile-command.js +1 -1
  27. package/dist/commands/profiles-command.js +1 -1
  28. package/dist/commands/query-command.js +1 -1
  29. package/dist/commands/schedule-command.js +1 -1
  30. package/dist/commands/segment-command.js +1 -1
  31. package/dist/commands/segment-create-command.js +1 -1
  32. package/dist/commands/segment-fields-command.js +1 -1
  33. package/dist/commands/segment-pull-command.js +1 -1
  34. package/dist/commands/segment-push-command.js +1 -1
  35. package/dist/commands/segment-update-command.js +1 -1
  36. package/dist/commands/segment-use-command.js +1 -1
  37. package/dist/commands/segment-validate-command.js +1 -1
  38. package/dist/commands/segments.js +1 -1
  39. package/dist/commands/show.js +1 -1
  40. package/dist/commands/status-command.d.ts.map +1 -1
  41. package/dist/commands/status-command.js +1 -1
  42. package/dist/commands/status-command.js.map +1 -1
  43. package/dist/commands/tables.js +1 -1
  44. package/dist/commands/unset-command.js +1 -1
  45. package/dist/commands/use-command.js +1 -1
  46. package/dist/commands/user-command.js +1 -1
  47. package/dist/commands/workflow-command.js +1 -1
  48. package/dist/core/auth.d.ts +2 -2
  49. package/dist/core/auth.d.ts.map +1 -1
  50. package/dist/core/auth.js +1 -1
  51. package/dist/core/auth.js.map +1 -1
  52. package/dist/core/command-output.js +1 -1
  53. package/dist/core/config.d.ts +12 -20
  54. package/dist/core/config.d.ts.map +1 -1
  55. package/dist/core/config.js +1 -1
  56. package/dist/core/config.js.map +1 -1
  57. package/dist/core/connection-cache.js +1 -1
  58. package/dist/core/constants.js +1 -1
  59. package/dist/core/credential-cache.js +1 -1
  60. package/dist/core/global-context.d.ts +3 -0
  61. package/dist/core/global-context.d.ts.map +1 -1
  62. package/dist/core/global-context.js +1 -1
  63. package/dist/core/global-context.js.map +1 -1
  64. package/dist/core/keychain.js +1 -1
  65. package/dist/core/profile.js +1 -1
  66. package/dist/core/project-config.js +1 -1
  67. package/dist/core/session.js +1 -1
  68. package/dist/core/user-cache.js +1 -1
  69. package/dist/core/version.js +1 -1
  70. package/dist/index.js +1 -1
  71. package/dist/mcp/server.js +1 -1
  72. package/dist/mcp/tools/index.js +1 -1
  73. package/dist/mcp/tools/tdx-run.js +1 -1
  74. package/dist/mcp/tools/tdx-search.js +1 -1
  75. package/dist/mcp/utils.js +1 -1
  76. package/dist/proxy/anthropic-adapter.js +1 -1
  77. package/dist/proxy/claude-usage-tracker.js +1 -1
  78. package/dist/proxy/context-signature.js +1 -1
  79. package/dist/proxy/conversation-utils.js +1 -1
  80. package/dist/proxy/passthrough-server.js +1 -1
  81. package/dist/proxy/server.js +1 -1
  82. package/dist/proxy/session-cache.js +1 -1
  83. package/dist/proxy/sse-usage-parser.js +1 -1
  84. package/dist/sdk/agent/agent-config.js +1 -1
  85. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  86. package/dist/sdk/agent/agent-yaml.js +1 -1
  87. package/dist/sdk/agent/test/evaluator.js +1 -1
  88. package/dist/sdk/agent/test/executor.js +1 -1
  89. package/dist/sdk/agent/test/index.js +1 -1
  90. package/dist/sdk/agent/test/output.js +1 -1
  91. package/dist/sdk/agent/test/parser.js +1 -1
  92. package/dist/sdk/api.js +1 -1
  93. package/dist/sdk/client/cdp-api-client.js +1 -1
  94. package/dist/sdk/client/endpoints.js +1 -1
  95. package/dist/sdk/client/engage-api-client.js +1 -1
  96. package/dist/sdk/client/http-client.js +1 -1
  97. package/dist/sdk/client/llm-api-client.js +1 -1
  98. package/dist/sdk/client/rate-limiter.js +1 -1
  99. package/dist/sdk/client/td-api-client.js +1 -1
  100. package/dist/sdk/client/trino-api-client.js +1 -1
  101. package/dist/sdk/client/workflow-client.js +1 -1
  102. package/dist/sdk/connection-validator.js +1 -1
  103. package/dist/sdk/connection.js +1 -1
  104. package/dist/sdk/engage.js +1 -1
  105. package/dist/sdk/errors.js +1 -1
  106. package/dist/sdk/index.js +1 -1
  107. package/dist/sdk/index.js.map +1 -1
  108. package/dist/sdk/io/index.js +1 -1
  109. package/dist/sdk/io/node-filesystem.js +1 -1
  110. package/dist/sdk/job.js +1 -1
  111. package/dist/sdk/journey.js +1 -1
  112. package/dist/sdk/llm/chat-cache.js +1 -1
  113. package/dist/sdk/llm/index.js +1 -1
  114. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  115. package/dist/sdk/llm/model-aliases.js +1 -1
  116. package/dist/sdk/llm/model-factors.js +1 -1
  117. package/dist/sdk/query/index.js +1 -1
  118. package/dist/sdk/query/sql-parser.js +1 -1
  119. package/dist/sdk/schedule.js +1 -1
  120. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  121. package/dist/sdk/segment/fields-display.js +1 -1
  122. package/dist/sdk/segment/file-discovery.js +1 -1
  123. package/dist/sdk/segment/journey-utils.js +1 -1
  124. package/dist/sdk/segment/journey-yaml.js +1 -1
  125. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  126. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  127. package/dist/sdk/segment/pull-workflow.js +1 -1
  128. package/dist/sdk/segment/push-workflow.js +1 -1
  129. package/dist/sdk/segment/resolution-context.js +1 -1
  130. package/dist/sdk/segment/segment-path-parser.js +1 -1
  131. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  132. package/dist/sdk/segment/target-resolution.js +1 -1
  133. package/dist/sdk/segment/tdx-config.js +1 -1
  134. package/dist/sdk/segment/validate-files.js +1 -1
  135. package/dist/sdk/segment/yaml-validator.js +1 -1
  136. package/dist/sdk/segment.js +1 -1
  137. package/dist/sdk/types/index.js +1 -1
  138. package/dist/sdk/types/progress.js +1 -1
  139. package/dist/sdk/user.js +1 -1
  140. package/dist/sdk/util/format-detector.js +1 -1
  141. package/dist/sdk/util/formatters.js +1 -1
  142. package/dist/sdk/util/index.js +1 -1
  143. package/dist/sdk/util/tree-formatter.js +1 -1
  144. package/dist/sdk/workflow/archive-validation.js +1 -1
  145. package/dist/sdk/workflow/clone-workflow.js +1 -1
  146. package/dist/sdk/workflow/index.js +1 -1
  147. package/dist/sdk/workflow/pull-workflow.js +1 -1
  148. package/dist/sdk/workflow/push-workflow.js +1 -1
  149. package/dist/sdk/workflow/tdx-config.js +1 -1
  150. package/dist/sdk/workflow/workflow-utils.js +1 -1
  151. package/dist/test-utils/command-runner.js +1 -1
  152. package/dist/test-utils/factories.js +1 -1
  153. package/dist/test-utils/fixtures.js +1 -1
  154. package/dist/test-utils/http-mock.js +1 -1
  155. package/dist/test-utils/index.js +1 -1
  156. package/dist/utils/async.js +1 -1
  157. package/dist/utils/colors.js +1 -1
  158. package/dist/utils/diff.js +1 -1
  159. package/dist/utils/file-permissions.js +1 -1
  160. package/dist/utils/global-cache.js +1 -1
  161. package/dist/utils/json-loader.js +1 -1
  162. package/dist/utils/local-cache.js +1 -1
  163. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  164. package/dist/utils/logger/formatters/index.js +1 -1
  165. package/dist/utils/logger/handlers/console-handler.js +1 -1
  166. package/dist/utils/logger/handlers/file-handler.js +1 -1
  167. package/dist/utils/logger/handlers/index.js +1 -1
  168. package/dist/utils/logger/handlers/null-handler.js +1 -1
  169. package/dist/utils/logger/index.js +1 -1
  170. package/dist/utils/logger/logger.js +1 -1
  171. package/dist/utils/logger/types.js +1 -1
  172. package/dist/utils/option-validation.js +1 -1
  173. package/dist/utils/port.js +1 -1
  174. package/dist/utils/process.js +1 -1
  175. package/dist/utils/prompt.js +1 -1
  176. package/dist/utils/spinner.js +1 -1
  177. package/dist/utils/sse-parser.js +1 -1
  178. package/dist/utils/string-utils.js +1 -1
  179. package/dist/utils/table-ref-parser.js +1 -1
  180. package/dist/utils/tdx-logger.js +1 -1
  181. package/dist/utils/version-check.js +1 -1
  182. package/package.json +1 -1
@@ -1 +1 @@
1
- const a3_0x64c1c=a3_0x6e5f;(function(_0x10e442,_0x583242){const _0x4ca286=a3_0x6e5f,_0x5e3a39=_0x10e442();while(!![]){try{const _0x5dc30d=parseInt(_0x4ca286(0x10f))/0x1+parseInt(_0x4ca286(0x110))/0x2+-parseInt(_0x4ca286(0x111))/0x3+-parseInt(_0x4ca286(0xff))/0x4+parseInt(_0x4ca286(0xf4))/0x5+parseInt(_0x4ca286(0x109))/0x6*(-parseInt(_0x4ca286(0xfe))/0x7)+parseInt(_0x4ca286(0xf5))/0x8*(parseInt(_0x4ca286(0x105))/0x9);if(_0x5dc30d===_0x583242)break;else _0x5e3a39['push'](_0x5e3a39['shift']());}catch(_0x3d8e16){_0x5e3a39['push'](_0x5e3a39['shift']());}}}(a3_0x3e79,0xe6632));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';function a3_0x6e5f(_0x20bb59,_0x1231b6){_0x20bb59=_0x20bb59-0xf3;const _0x3e7906=a3_0x3e79();let _0x6e5f6f=_0x3e7906[_0x20bb59];return _0x6e5f6f;}import{withSpinner}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';function a3_0x3e79(){const _0x493aa4=['Site:\x20','Child\x20name:\x20','name','data','1699553OcOfNE','1548992UHdVnp','3150279DRGuhl','verbose','List\x20activations\x20for\x20a\x20segment','\x20\x20Cause:\x20','4234235YKLGsk','12488ywFqJT','Resolved\x20parent\x20ID:\x20','cause','resolveSegmentId','Listing\x20activations\x20for\x20segment\x20\x27','segment','message','error','\x20activation','203JcITzC','2816528EvjLOp','Parent\x20name:\x20','site','✔\x20Found\x20','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','\x27...','2763IRzuAp','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','activations','length','228048EQOiyM','description'];a3_0x3e79=function(){return _0x493aa4;};return a3_0x3e79();}export class ActivationsCommand extends BaseCommand{[a3_0x64c1c(0x10d)]=a3_0x64c1c(0x107);[a3_0x64c1c(0x10a)]=a3_0x64c1c(0x113);async['execute'](_0x2f4910){const _0x8f970=a3_0x64c1c,{options:_0x44ef15,args:_0x5c7cae,tdx:_0x3fae70}=_0x2f4910;if(_0x5c7cae['length']===0x0)return console[_0x8f970(0xfc)]('Error:\x20Segment\x20name\x20is\x20required'),console[_0x8f970(0xfc)](_0x8f970(0x106)),0x1;try{const {parentId:_0x4f1b96,childId:_0x918b1b}=parseSegmentRef(_0x5c7cae[0x0]);if(!_0x918b1b)return console[_0x8f970(0xfc)](_0x8f970(0x103)),console['error']('Usage:\x20tdx\x20activations\x20<parent_name/child_name>'),0x1;_0x44ef15[_0x8f970(0x112)]&&(console[_0x8f970(0xfc)](_0x8f970(0x10b)+_0x44ef15[_0x8f970(0x101)]),console['error'](_0x8f970(0x100)+_0x4f1b96),console[_0x8f970(0xfc)](_0x8f970(0x10c)+_0x918b1b));const _0x42b9ff=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x4f1b96+_0x8f970(0x104),()=>_0x3fae70[_0x8f970(0xfa)]['resolveParentId'](_0x4f1b96),{'verbose':_0x44ef15[_0x8f970(0x112)]}),_0x50561d=_0x42b9ff['data'];_0x44ef15[_0x8f970(0x112)]&&console[_0x8f970(0xfc)](_0x8f970(0xf6)+_0x50561d);const _0x36b92e=await withSpinner('Resolving\x20child\x20segment\x20\x27'+_0x918b1b+_0x8f970(0x104),()=>_0x3fae70[_0x8f970(0xfa)][_0x8f970(0xf8)](_0x50561d,_0x918b1b),{'verbose':_0x44ef15[_0x8f970(0x112)]}),_0x4a5ebb=_0x36b92e[_0x8f970(0x10e)];_0x44ef15[_0x8f970(0x112)]&&console[_0x8f970(0xfc)]('Resolved\x20child\x20ID:\x20'+_0x4a5ebb);const _0xf5a1e5=await withSpinner(_0x8f970(0xf9)+_0x918b1b+_0x8f970(0x104),()=>_0x3fae70[_0x8f970(0xfa)]['listActivations'](_0x50561d,_0x4a5ebb),{'verbose':_0x44ef15[_0x8f970(0x112)]}),_0x443ada=_0xf5a1e5[_0x8f970(0x10e)];return console[_0x8f970(0xfc)](_0x8f970(0x102)+_0x443ada['length']+_0x8f970(0xfd)+(_0x443ada[_0x8f970(0x108)]!==0x1?'s':'')),await handleSDKOutput(_0x443ada,_0x44ef15),0x0;}catch(_0x471e0e){if(_0x471e0e instanceof SDKError)return console[_0x8f970(0xfc)]('Error:\x20'+_0x471e0e[_0x8f970(0xfb)]),_0x471e0e[_0x8f970(0xf7)]&&console[_0x8f970(0xfc)](_0x8f970(0xf3)+_0x471e0e['cause']),0x1;throw _0x471e0e;}}}
1
+ const a3_0x4fb3ef=a3_0xf13c;(function(_0x72ad89,_0x30a396){const _0x52f6ec=a3_0xf13c,_0x270e08=_0x72ad89();while(!![]){try{const _0x99c10b=parseInt(_0x52f6ec(0x121))/0x1*(-parseInt(_0x52f6ec(0x11c))/0x2)+parseInt(_0x52f6ec(0x120))/0x3+-parseInt(_0x52f6ec(0x110))/0x4+parseInt(_0x52f6ec(0x129))/0x5*(parseInt(_0x52f6ec(0x114))/0x6)+-parseInt(_0x52f6ec(0x125))/0x7+parseInt(_0x52f6ec(0x10e))/0x8*(parseInt(_0x52f6ec(0x124))/0x9)+-parseInt(_0x52f6ec(0x123))/0xa;if(_0x99c10b===_0x30a396)break;else _0x270e08['push'](_0x270e08['shift']());}catch(_0x2b18c9){_0x270e08['push'](_0x270e08['shift']());}}}(a3_0x4427,0x937da));import{BaseCommand}from'./command.js';function a3_0xf13c(_0x4d7ec6,_0x942e51){_0x4d7ec6=_0x4d7ec6-0x106;const _0x44278a=a3_0x4427();let _0xf13cae=_0x44278a[_0x4d7ec6];return _0xf13cae;}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_0x4427(){const _0x1c1a02=['36AxpXjT','resolveParentId','listActivations','execute','resolveSegmentId','error','Site:\x20','activations','231590JLcoQW','name','Resolved\x20child\x20ID:\x20','Child\x20name:\x20','712431SOOvnN','2joktJT','length','1982850VjmrMT','387GCnLHa','3627848AFHUzX','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','verbose','segment','745520zHtDPm','cause','Resolved\x20parent\x20ID:\x20','Resolving\x20child\x20segment\x20\x27','Parent\x20name:\x20','data','site','\x27...','\x20activation','message','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','Listing\x20activations\x20for\x20segment\x20\x27','167976tRDzVz','List\x20activations\x20for\x20a\x20segment','1930844oObyoP','✔\x20Found\x20','\x20\x20Cause:\x20','Error:\x20Segment\x20name\x20is\x20required'];a3_0x4427=function(){return _0x1c1a02;};return a3_0x4427();}export class ActivationsCommand extends BaseCommand{[a3_0x4fb3ef(0x11d)]=a3_0x4fb3ef(0x11b);['description']=a3_0x4fb3ef(0x10f);async[a3_0x4fb3ef(0x117)](_0x4452a6){const _0x2b7aa5=a3_0x4fb3ef,{options:_0x5c7d0d,args:_0x12b7de,tdx:_0x27f6db}=_0x4452a6;if(_0x12b7de[_0x2b7aa5(0x122)]===0x0)return console[_0x2b7aa5(0x119)](_0x2b7aa5(0x113)),console[_0x2b7aa5(0x119)](_0x2b7aa5(0x126)),0x1;try{const {parentId:_0x37a1fa,childId:_0x54ddd7}=parseSegmentRef(_0x12b7de[0x0]);if(!_0x54ddd7)return console[_0x2b7aa5(0x119)](_0x2b7aa5(0x10c)),console[_0x2b7aa5(0x119)](_0x2b7aa5(0x126)),0x1;_0x5c7d0d[_0x2b7aa5(0x127)]&&(console[_0x2b7aa5(0x119)](_0x2b7aa5(0x11a)+_0x5c7d0d[_0x2b7aa5(0x108)]),console[_0x2b7aa5(0x119)](_0x2b7aa5(0x106)+_0x37a1fa),console[_0x2b7aa5(0x119)](_0x2b7aa5(0x11f)+_0x54ddd7));const _0x1507a8=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x37a1fa+_0x2b7aa5(0x109),()=>_0x27f6db['segment'][_0x2b7aa5(0x115)](_0x37a1fa),{'verbose':_0x5c7d0d[_0x2b7aa5(0x127)]}),_0x46af57=_0x1507a8[_0x2b7aa5(0x107)];_0x5c7d0d[_0x2b7aa5(0x127)]&&console[_0x2b7aa5(0x119)](_0x2b7aa5(0x12b)+_0x46af57);const _0x5296b2=await withSpinner(_0x2b7aa5(0x12c)+_0x54ddd7+_0x2b7aa5(0x109),()=>_0x27f6db[_0x2b7aa5(0x128)][_0x2b7aa5(0x118)](_0x46af57,_0x54ddd7),{'verbose':_0x5c7d0d['verbose']}),_0x2118cd=_0x5296b2[_0x2b7aa5(0x107)];_0x5c7d0d['verbose']&&console[_0x2b7aa5(0x119)](_0x2b7aa5(0x11e)+_0x2118cd);const _0x27174d=await withSpinner(_0x2b7aa5(0x10d)+_0x54ddd7+'\x27...',()=>_0x27f6db[_0x2b7aa5(0x128)][_0x2b7aa5(0x116)](_0x46af57,_0x2118cd),{'verbose':_0x5c7d0d[_0x2b7aa5(0x127)]}),_0xb72d70=_0x27174d[_0x2b7aa5(0x107)];return console['error'](_0x2b7aa5(0x111)+_0xb72d70[_0x2b7aa5(0x122)]+_0x2b7aa5(0x10a)+(_0xb72d70['length']!==0x1?'s':'')),await handleSDKOutput(_0xb72d70,_0x5c7d0d),0x0;}catch(_0x32f5b4){if(_0x32f5b4 instanceof SDKError)return console['error']('Error:\x20'+_0x32f5b4[_0x2b7aa5(0x10b)]),_0x32f5b4['cause']&&console[_0x2b7aa5(0x119)](_0x2b7aa5(0x112)+_0x32f5b4[_0x2b7aa5(0x12a)]),0x1;throw _0x32f5b4;}}}
@@ -1 +1 @@
1
- const a4_0x1fde4e=a4_0x1c7e;(function(_0x5c9eec,_0xeb75d1){const _0x2a8664=a4_0x1c7e,_0x1fb746=_0x5c9eec();while(!![]){try{const _0x347a66=-parseInt(_0x2a8664(0xef))/0x1+-parseInt(_0x2a8664(0xff))/0x2*(-parseInt(_0x2a8664(0x15c))/0x3)+parseInt(_0x2a8664(0x143))/0x4+-parseInt(_0x2a8664(0x142))/0x5+-parseInt(_0x2a8664(0xed))/0x6*(parseInt(_0x2a8664(0x158))/0x7)+parseInt(_0x2a8664(0x117))/0x8*(parseInt(_0x2a8664(0x165))/0x9)+-parseInt(_0x2a8664(0x164))/0xa*(parseInt(_0x2a8664(0x14b))/0xb);if(_0x347a66===_0xeb75d1)break;else _0x1fb746['push'](_0x1fb746['shift']());}catch(_0x360669){_0x1fb746['push'](_0x1fb746['shift']());}}}(a4_0x1f45,0xc2bc0));import a4_0x578549 from'chalk';import a4_0xadd226 from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';function a4_0x1c7e(_0x16ff9b,_0x3a35f7){_0x16ff9b=_0x16ff9b-0xc6;const _0x1f4589=a4_0x1f45();let _0x1c7e81=_0x1f4589[_0x16ff9b];return _0x1c7e81;}import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';function a4_0x1f45(){const _0x3d7dd6=['\x20\x20Knowledge\x20Base\x20\x22','log','force','Cancelled','sourceProjectName','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','description','yellow','46724smBSXv','\x20--profile\x20','\x20updated','unchanged','pullAgent','Analyzing\x20changes\x20to\x20push...','textKnowledgeBases','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','\x0aChanges\x20to\x20agent\x20\x27','agentId','\x20resources?','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','dryRun','\x22...','Agent:\x20','\x0aPush\x20summary\x20for\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project','Would\x20pull\x20agent:\x20','\x20\x20Text\x20Knowledge\x20Base\x20\x22','\x20\x20tdx\x20agent\x20clone\x20agents/','INVALID_ARGUMENT','\x0aErrors\x20found:','Clone\x20\x22','profile','8KYDSfS','outputPath','\x20=\x20','yes','push','isNew','errors','reason','new','\x20\x20Prompts:\x20','\x20\x20Integrations:\x20','\x20files?','Writing\x20files...','session','\x0aError:','agent:clone','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','Dry\x20run\x20-\x20no\x20files\x20written','Using\x20local\x20project:\x20','llm_project','utf-8','\x20resources\x20to\x20\x27','cloneProject','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','agentName','New\x20project\x20name\x20is\x20required','cwd','dim','\x0aPull\x20summary\x20for\x20\x27','Project:\x20','\x20\x20Prompt\x20\x22','Agent\x20','join','Failed\x20to\x20push\x20agent:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20#\x20Pull\x20specific\x20agent','\x0aChanges\x20to\x20prompt\x20\x27','Status:\x20','Cannot\x20clone\x20from\x20context\x20project\x20\x22','pushAgent','cyan','\x20changed','\x22:\x20','no_context','296475nzNdix','5000412KNTjUc','\x20\x20Integration\x20\x22','red','\x20total','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','pullProject','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','Using\x20project:\x20','286XXvwkg','Output:\x20','\x20\x20Text\x20Knowledge\x20Bases:\x20','updated','New\x20project:\x20','green','projectName','error','source','\x20\x20Knowledge\x20Bases:\x20','Agent\x20pulled\x20successfully','total','agent.yml','91AreFql','Errors:','llmProject','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','27SIRRJp','\x20unchanged','message','output','llm','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','-\x20nothing\x20pushed','New\x20project\x20ID:\x20','183130wwReHD','7938819HcFNFR','newProjectName','name','repeat','execute','-\x20no\x20files\x20written','\x0a✔\x20Pushed\x20','projectId','projectDir','\x0aProject\x20pushed\x20with\x20errors','pushProject','Output\x20path:\x20','\x0aChanges:','\x20created','\x22\x20to\x20\x22','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','dirname','\x20new','Using\x20project\x20from\x20','integrations','counts','<new-name>','diff','\x20files\x20to\x20','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','context','agents','newProjectId','Summary:','site','Would\x20push\x20agent:\x20','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','gray','\x0a✔\x20Pulled\x20','Project\x20cloned\x20successfully','Pushing\x20to\x20project...','Usage:\x20tdx\x20agent\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20project\x20(requires\x20context\x20or\x20tdx.json)','\x20\x20Agent\x20\x22','Pulling\x20agent\x20\x22','No\x20tdx.json\x20found\x20in\x20','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','✔\x20Context\x20set:\x20','\x20\x20Agents:\x20','action','created','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','knowledgeBases','\x20|\x20','176814adincv','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','626290JoFgfI','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','\x22\x20to\x20new\x20project\x20\x22','\x0aPush\x20','\x20errors','tdx.json','prompts','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory'];a4_0x1f45=function(){return _0x3d7dd6;};return a4_0x1f45();}import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x3ec005){const _0x15076a=a4_0x1c7e,_0xc62214=[];if(_0x3ec005[_0x15076a(0x156)]!==undefined)_0xc62214[_0x15076a(0x11b)](_0x3ec005[_0x15076a(0x156)]+_0x15076a(0x146));if(_0x3ec005[_0x15076a(0x11f)]!==undefined&&_0x3ec005[_0x15076a(0x11f)]>0x0)_0xc62214['push'](a4_0x578549[_0x15076a(0x150)](_0x3ec005[_0x15076a(0x11f)]+_0x15076a(0xce)));if(_0x3ec005[_0x15076a(0xe9)]!==undefined&&_0x3ec005[_0x15076a(0xe9)]>0x0)_0xc62214[_0x15076a(0x11b)](a4_0x578549[_0x15076a(0x150)](_0x3ec005[_0x15076a(0xe9)]+_0x15076a(0xca)));if(_0x3ec005['updated']!==undefined&&_0x3ec005[_0x15076a(0x14e)]>0x0)_0xc62214[_0x15076a(0x11b)](a4_0x578549['yellow'](_0x3ec005[_0x15076a(0x14e)]+_0x15076a(0x101)));if(_0x3ec005[_0x15076a(0x102)]!==undefined&&_0x3ec005[_0x15076a(0x102)]>0x0)_0xc62214[_0x15076a(0x11b)](a4_0x578549[_0x15076a(0xdd)](_0x3ec005[_0x15076a(0x102)]+_0x15076a(0x15d)));if(_0x3ec005[_0x15076a(0x11d)]!==undefined&&_0x3ec005[_0x15076a(0x11d)]>0x0)_0xc62214[_0x15076a(0x11b)](a4_0x578549[_0x15076a(0x145)](_0x3ec005[_0x15076a(0x11d)]+_0x15076a(0xf3)));return _0xc62214[_0x15076a(0x137)](',\x20');}function displayDiffs(_0x59ab01,_0x36f8da,_0x494a92,_0x3fc21b,_0x346da4=[]){const _0x278b9f=a4_0x1c7e;for(const _0x57098c of _0x59ab01){if(_0x57098c[_0x278b9f(0xd3)]){const _0x55fc65=_0x57098c[_0x278b9f(0x12f)]||_0x57098c['name'];console[_0x278b9f(0xf8)](_0x278b9f(0x107)+_0x55fc65+'\x27:'),console[_0x278b9f(0xf8)]('─'[_0x278b9f(0x168)](0x3c)),console['log'](_0x57098c['diff']),console['log']('─'[_0x278b9f(0x168)](0x3c));}}for(const _0xc08bb8 of _0x36f8da){_0xc08bb8[_0x278b9f(0xd3)]&&(console[_0x278b9f(0xf8)](_0x278b9f(0xfc)+_0xc08bb8[_0x278b9f(0x167)]+'\x27:'),console[_0x278b9f(0xf8)]('─'[_0x278b9f(0x168)](0x3c)),console['log'](_0xc08bb8[_0x278b9f(0xd3)]),console[_0x278b9f(0xf8)]('─'['repeat'](0x3c)));}for(const _0x5d5157 of _0x494a92){_0x5d5157[_0x278b9f(0xd3)]&&(console['log'](_0x278b9f(0xea)+_0x5d5157[_0x278b9f(0x167)]+'\x27:'),console[_0x278b9f(0xf8)]('─'['repeat'](0x3c)),console['log'](_0x5d5157[_0x278b9f(0xd3)]),console[_0x278b9f(0xf8)]('─'[_0x278b9f(0x168)](0x3c)));}for(const _0x5bc5f3 of _0x3fc21b){_0x5bc5f3[_0x278b9f(0xd3)]&&(console['log'](_0x278b9f(0x13a)+_0x5bc5f3[_0x278b9f(0x167)]+'\x27:'),console[_0x278b9f(0xf8)]('─'[_0x278b9f(0x168)](0x3c)),console[_0x278b9f(0xf8)](_0x5bc5f3[_0x278b9f(0xd3)]),console['log']('─'[_0x278b9f(0x168)](0x3c)));}for(const _0x188318 of _0x346da4){_0x188318[_0x278b9f(0xd3)]&&(console['log']('\x0aChanges\x20to\x20integration\x20\x27'+_0x188318[_0x278b9f(0x167)]+'\x27:'),console[_0x278b9f(0xf8)]('─'['repeat'](0x3c)),console[_0x278b9f(0xf8)](_0x188318[_0x278b9f(0xd3)]),console['log']('─'[_0x278b9f(0x168)](0x3c)));}}export class AgentPullCommand extends BaseCommand{['name']='agent:pull';[a4_0x1fde4e(0xfd)]=a4_0x1fde4e(0x147);async[a4_0x1fde4e(0x169)](_0x4f4671){const _0x2c020a=a4_0x1fde4e,{options:_0x478f27,args:_0x3c7477,tdx:_0x38e892}=_0x4f4671,_0x3e3d72=_0x3c7477[0x0],_0x5505bf=_0x3c7477[0x1],_0x1eb093=_0x478f27[_0x2c020a(0x15f)],_0x2662c2=_0x478f27['dryRun'],_0x4fca08=_0x478f27['force'],_0x80c081=_0x478f27[_0x2c020a(0x11a)],_0x2bc87c=_0x478f27['llmProject'];let _0x101604,_0x1e0a39;const _0x375b2a=findAgentConfigPath(process[_0x2c020a(0x131)]());if(_0x3e3d72){const _0x11af09=a4_0xadd226['join'](_0x3e3d72,_0x2c020a(0xf4));if(existsSync(_0x11af09))try{const _0x4c69f3=JSON['parse'](readFileSync(_0x11af09,_0x2c020a(0x12b)));_0x101604=_0x4c69f3[_0x2c020a(0x12a)],_0x1e0a39=_0x3e3d72,console[_0x2c020a(0xf8)](a4_0x578549[_0x2c020a(0x132)](_0x2c020a(0xcf)+_0x11af09+':\x20'+_0x101604));}catch{_0x101604=_0x3e3d72;}else _0x101604=_0x3e3d72;}else{if(_0x375b2a)try{const _0x26c4d5=JSON['parse'](readFileSync(_0x375b2a,_0x2c020a(0x12b)));_0x101604=_0x26c4d5['llm_project'],_0x1e0a39=a4_0xadd226[_0x2c020a(0xcd)](_0x375b2a),console['log'](a4_0x578549[_0x2c020a(0x132)]('Using\x20project:\x20'+_0x101604));}catch{_0x101604=_0x2bc87c;}else _0x101604=_0x2bc87c;}if(!_0x101604)return console[_0x2c020a(0xf8)](a4_0x578549['yellow']('llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a')),console[_0x2c020a(0xf8)](_0x2c020a(0xe1)),console[_0x2c020a(0xf8)](_0x2c020a(0x10f)),console[_0x2c020a(0xf8)](_0x2c020a(0xf6)),console[_0x2c020a(0xf8)](_0x2c020a(0x139)),0x1;if(_0x5505bf){const {data:_0x24cd24}=await withSpinner(_0x2c020a(0xe3)+_0x5505bf+'\x22\x20from\x20project\x20\x22'+_0x101604+_0x2c020a(0x10c),()=>_0x38e892[_0x2c020a(0x160)][_0x2c020a(0x103)](_0x101604,_0x5505bf,_0x1eb093,{'dryRun':_0x2662c2,'force':_0x4fca08}));if(_0x2662c2)return console[_0x2c020a(0xf8)](a4_0x578549[_0x2c020a(0xfe)](_0x2c020a(0x128))),console[_0x2c020a(0xf8)](_0x2c020a(0x110)+_0x24cd24['agentName']),console[_0x2c020a(0xf8)](_0x2c020a(0xc8)+_0x24cd24[_0x2c020a(0x118)]),_0x24cd24['diff']&&(console['log'](_0x2c020a(0xc9)),console['log']('─'[_0x2c020a(0x168)](0x3c)),console[_0x2c020a(0xf8)](_0x24cd24[_0x2c020a(0xd3)]),console['log']('─'[_0x2c020a(0x168)](0x3c))),0x0;return console[_0x2c020a(0xf8)](a4_0x578549[_0x2c020a(0x150)](_0x2c020a(0x155))),console['log']('Agent:\x20'+_0x24cd24[_0x2c020a(0x12f)]),console[_0x2c020a(0xf8)](_0x2c020a(0x14c)+_0x24cd24[_0x2c020a(0x118)]),console[_0x2c020a(0xf8)](_0x2c020a(0x13b)+(_0x24cd24[_0x2c020a(0x11c)]?a4_0x578549['green'](_0x2c020a(0x11f)):_0x24cd24['hasChanges']?a4_0x578549[_0x2c020a(0xfe)](_0x2c020a(0x14e)):a4_0x578549[_0x2c020a(0xdd)]('unchanged'))),0x0;}const _0x12fa0c=_0x1e0a39||_0x1eb093,{data:_0x57db61}=await withSpinner('Analyzing\x20project\x20\x22'+_0x101604+_0x2c020a(0x10c),()=>_0x38e892[_0x2c020a(0x160)][_0x2c020a(0x148)](_0x101604,_0x12fa0c,{'dryRun':!![]})),_0x3f19ab=_0x57db61[_0x2c020a(0xd1)][_0x2c020a(0xd7)][_0x2c020a(0x11f)]+_0x57db61[_0x2c020a(0xd1)][_0x2c020a(0xeb)]['new']+_0x57db61[_0x2c020a(0xd1)][_0x2c020a(0x105)][_0x2c020a(0x11f)]+_0x57db61[_0x2c020a(0xd1)][_0x2c020a(0xf5)][_0x2c020a(0x11f)]+_0x57db61['counts']['integrations']['new'],_0x314b05=_0x57db61[_0x2c020a(0xd1)]['agents']['updated']+_0x57db61[_0x2c020a(0xd1)][_0x2c020a(0xeb)]['updated']+_0x57db61[_0x2c020a(0xd1)][_0x2c020a(0x105)][_0x2c020a(0x14e)]+_0x57db61[_0x2c020a(0xd1)][_0x2c020a(0xf5)]['updated']+_0x57db61[_0x2c020a(0xd1)][_0x2c020a(0xd0)][_0x2c020a(0x14e)],_0x3a3153=_0x57db61['counts'][_0x2c020a(0xd7)][_0x2c020a(0x102)]+_0x57db61[_0x2c020a(0xd1)][_0x2c020a(0xeb)][_0x2c020a(0x102)]+_0x57db61[_0x2c020a(0xd1)][_0x2c020a(0x105)][_0x2c020a(0x102)]+_0x57db61[_0x2c020a(0xd1)][_0x2c020a(0xf5)][_0x2c020a(0x102)]+_0x57db61['counts'][_0x2c020a(0xd0)][_0x2c020a(0x102)];console[_0x2c020a(0xf8)](_0x2c020a(0x133)+_0x57db61[_0x2c020a(0x151)]+'\x27:'),console[_0x2c020a(0xf8)]('\x20\x20'+a4_0x578549[_0x2c020a(0x150)]('+\x20'+_0x3f19ab+_0x2c020a(0xce))+_0x2c020a(0xec)+a4_0x578549[_0x2c020a(0xfe)]('~\x20'+_0x314b05+_0x2c020a(0x13f))+_0x2c020a(0xec)+a4_0x578549[_0x2c020a(0x132)]('=\x20'+_0x3a3153+_0x2c020a(0x15d))),console[_0x2c020a(0xf8)](_0x2c020a(0xe7)+formatCountSummary(_0x57db61[_0x2c020a(0xd1)][_0x2c020a(0xd7)])),console[_0x2c020a(0xf8)](_0x2c020a(0x154)+formatCountSummary(_0x57db61[_0x2c020a(0xd1)]['knowledgeBases'])),console[_0x2c020a(0xf8)](_0x2c020a(0x14d)+formatCountSummary(_0x57db61[_0x2c020a(0xd1)]['textKnowledgeBases'])),console[_0x2c020a(0xf8)](_0x2c020a(0x120)+formatCountSummary(_0x57db61[_0x2c020a(0xd1)][_0x2c020a(0xf5)])),console[_0x2c020a(0xf8)](_0x2c020a(0x121)+formatCountSummary(_0x57db61[_0x2c020a(0xd1)][_0x2c020a(0xd0)])),console[_0x2c020a(0xf8)]('\x20\x20Target:\x20'+a4_0x578549[_0x2c020a(0x13e)](_0x57db61['outputDir'])),displayDiffs(_0x57db61[_0x2c020a(0xd7)],_0x57db61['knowledgeBases'],_0x57db61[_0x2c020a(0x105)],_0x57db61['prompts'],_0x57db61[_0x2c020a(0xd0)]);if(_0x2662c2)return console[_0x2c020a(0xf8)](a4_0x578549['yellow'](_0x2c020a(0xd5))),0x0;if(_0x3f19ab===0x0&&_0x314b05===0x0)return console['log'](a4_0x578549[_0x2c020a(0x150)](_0x2c020a(0x127))),saveSessionContext({'llm_project':_0x57db61[_0x2c020a(0x151)]},_0x478f27[_0x2c020a(0x124)]),console[_0x2c020a(0xf8)](a4_0x578549['green'](_0x2c020a(0xe6)+a4_0x578549[_0x2c020a(0x132)](_0x2c020a(0x12a))+_0x2c020a(0x119)+a4_0x578549[_0x2c020a(0x13e)](_0x57db61[_0x2c020a(0x151)]))),0x0;if(!_0x80c081&&!_0x4fca08){if(!isInteractive())return console['error'](a4_0x578549['red'](_0x2c020a(0x125)),_0x2c020a(0x12e)),console['error'](a4_0x578549[_0x2c020a(0x132)](_0x2c020a(0xcc))),0x1;const _0xacd19a=await confirmKey('\x0aWrite\x20'+(_0x3f19ab+_0x314b05)+_0x2c020a(0x122));if(!_0xacd19a)return console['log'](a4_0x578549[_0x2c020a(0xfe)](_0x2c020a(0xfa)),_0x2c020a(0x16a)),0x1;}const {data:_0x5c13df}=await withSpinner(_0x2c020a(0x123),()=>_0x38e892[_0x2c020a(0x160)][_0x2c020a(0x148)](_0x101604,_0x12fa0c,{'force':_0x4fca08}));return console['log'](a4_0x578549['green'](_0x2c020a(0xde)+(_0x3f19ab+_0x314b05)+_0x2c020a(0xd4)+_0x5c13df['outputDir'])),saveSessionContext({'llm_project':_0x5c13df[_0x2c020a(0x151)]},_0x478f27[_0x2c020a(0x124)]),console[_0x2c020a(0xf8)](a4_0x578549[_0x2c020a(0x150)](_0x2c020a(0xe6)+a4_0x578549[_0x2c020a(0x132)](_0x2c020a(0x12a))+'\x20=\x20'+a4_0x578549[_0x2c020a(0x13e)](_0x5c13df[_0x2c020a(0x151)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x1fde4e(0x167)]=a4_0x1fde4e(0x126);[a4_0x1fde4e(0xfd)]=a4_0x1fde4e(0x10a);async[a4_0x1fde4e(0x169)](_0x2f2a36){const _0xef36bf=a4_0x1fde4e,{options:_0x9058c5,args:_0x36175d,tdx:_0x1f1dce}=_0x2f2a36,_0x24623b=_0x36175d[0x0],_0x4117c0=_0x9058c5['name'],_0x54c3fa=_0x9058c5[_0xef36bf(0x10b)],_0x4ea334=_0x9058c5[_0xef36bf(0x11a)],_0xcf20e6=_0x9058c5[_0xef36bf(0xda)],_0x4034df=_0x9058c5[_0xef36bf(0x15a)];let _0x47040e;const _0x9989cc=findAgentConfigPath(process['cwd']());if(_0x24623b){const _0x49fbfa=a4_0xadd226['join'](_0x24623b,_0xef36bf(0xf4));existsSync(_0x49fbfa)?(_0x47040e=_0x24623b,console[_0xef36bf(0xf8)](a4_0x578549[_0xef36bf(0x132)](_0xef36bf(0x129)+_0x24623b))):_0x47040e=_0x24623b;}else{if(_0x9989cc)_0x47040e=a4_0xadd226['dirname'](_0x9989cc),console[_0xef36bf(0xf8)](a4_0x578549['dim']('Using\x20current\x20project:\x20'+_0x47040e));else{if(_0x4034df){const _0x4d060e=sanitizeForFilesystem(_0x4034df);let _0x4ef097=_0x4d060e,_0x595d46=a4_0xadd226[_0xef36bf(0x137)](process[_0xef36bf(0x131)](),_0xef36bf(0xd7),_0x4d060e,'tdx.json');if(!existsSync(_0x595d46)){const _0x49eca2=normalizeName(_0x4034df),_0x55716e=a4_0xadd226[_0xef36bf(0x137)](process[_0xef36bf(0x131)](),_0xef36bf(0xd7),_0x49eca2,'tdx.json');existsSync(_0x55716e)&&(_0x4ef097=_0x49eca2,_0x595d46=_0x55716e);}if(existsSync(_0x595d46))_0x47040e=a4_0xadd226[_0xef36bf(0xcd)](_0x595d46),console[_0xef36bf(0xf8)](a4_0x578549['dim']('Using\x20local\x20project:\x20'+_0x47040e));else{const _0x2b9754=_0x9058c5[_0xef36bf(0x116)];if(_0x2b9754)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0xef36bf(0x13c)+_0x4034df+'\x22\x20to\x20a\x20different\x20profile',undefined,{'helpText':_0xef36bf(0x106)+'First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a'+('\x20\x20tdx\x20agent\x20pull\x20'+_0x4034df+'\x0a')+(_0xef36bf(0x112)+_0x4ef097+'\x20--name\x20'+(_0x4117c0||_0xef36bf(0xd2))+_0xef36bf(0x100)+_0x2b9754)});_0x47040e=_0x4034df,console[_0xef36bf(0xf8)](a4_0x578549[_0xef36bf(0x132)]('Using\x20context\x20project:\x20'+_0x4034df));}}}}if(!_0x47040e)return console[_0xef36bf(0xf8)](a4_0x578549[_0xef36bf(0xfe)](_0xef36bf(0xee))),console[_0xef36bf(0xf8)](_0xef36bf(0xdc)),console['log']('\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory'),console[_0xef36bf(0xf8)]('\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'](_0xef36bf(0x161)),0x1;if(!_0x4117c0)throw new SDKError(ErrorCode['MISSING_ARGUMENT'],_0xef36bf(0x130),undefined,{'helpText':_0xef36bf(0xf0)});if(!_0x4ea334&&!_0x54c3fa){if(!isInteractive())return console['error'](a4_0x578549['red'](_0xef36bf(0x125)),_0xef36bf(0x12e)),console[_0xef36bf(0x152)](a4_0x578549[_0xef36bf(0x132)](_0xef36bf(0xcc))),0x1;const _0x1f77e5=await confirmKey(_0xef36bf(0x115)+_0x47040e+_0xef36bf(0xf1)+_0x4117c0+'\x22?');if(!_0x1f77e5)return console[_0xef36bf(0xf8)](a4_0x578549[_0xef36bf(0xfe)]('Cancelled')),0x1;}const {data:_0x12f4c9}=await withSpinner('Cloning\x20\x22'+_0x47040e+_0xef36bf(0xcb)+_0x4117c0+_0xef36bf(0x10c),()=>_0x1f1dce[_0xef36bf(0x160)][_0xef36bf(0x12d)](_0x47040e,_0x4117c0,{'dryRun':_0x54c3fa}));if(_0x54c3fa)return console[_0xef36bf(0xf8)](a4_0x578549[_0xef36bf(0xfe)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0xef36bf(0xf8)]('Source:\x20'+_0x12f4c9[_0xef36bf(0xfb)]),console['log'](_0xef36bf(0x14f)+_0x4117c0),console[_0xef36bf(0xf8)]('Would\x20clone:'),console['log']('\x20\x20Agents:\x20'+_0x12f4c9[_0xef36bf(0xd1)]['agents'][_0xef36bf(0xe9)]),console[_0xef36bf(0xf8)](_0xef36bf(0x154)+_0x12f4c9[_0xef36bf(0xd1)][_0xef36bf(0xeb)][_0xef36bf(0xe9)]),console[_0xef36bf(0xf8)](_0xef36bf(0x120)+_0x12f4c9[_0xef36bf(0xd1)]['prompts']['created']),0x0;const _0x473185=_0x12f4c9[_0xef36bf(0xd1)][_0xef36bf(0xd7)][_0xef36bf(0x11d)]>0x0||_0x12f4c9[_0xef36bf(0xd1)]['knowledgeBases'][_0xef36bf(0x11d)]>0x0||_0x12f4c9[_0xef36bf(0xd1)][_0xef36bf(0xf5)][_0xef36bf(0x11d)]>0x0;_0x473185?console[_0xef36bf(0xf8)](a4_0x578549[_0xef36bf(0xfe)]('Project\x20cloned\x20with\x20errors')):console[_0xef36bf(0xf8)](a4_0x578549[_0xef36bf(0x150)](_0xef36bf(0xdf)));console['log']('Source:\x20'+_0x12f4c9[_0xef36bf(0xfb)]),console[_0xef36bf(0xf8)](_0xef36bf(0x14f)+_0x12f4c9[_0xef36bf(0x166)]),console[_0xef36bf(0xf8)](_0xef36bf(0x163)+_0x12f4c9[_0xef36bf(0xd8)]),console[_0xef36bf(0xf8)](),console[_0xef36bf(0xf8)](_0xef36bf(0xd9)),console[_0xef36bf(0xf8)](_0xef36bf(0xe7)+formatCountSummary(_0x12f4c9[_0xef36bf(0xd1)][_0xef36bf(0xd7)])),console[_0xef36bf(0xf8)](_0xef36bf(0x154)+formatCountSummary(_0x12f4c9[_0xef36bf(0xd1)][_0xef36bf(0xeb)])),console[_0xef36bf(0xf8)](_0xef36bf(0x120)+formatCountSummary(_0x12f4c9[_0xef36bf(0xd1)]['prompts'])),console[_0xef36bf(0xf8)](_0xef36bf(0x121)+formatCountSummary(_0x12f4c9[_0xef36bf(0xd1)]['integrations']));if(_0x473185){console[_0xef36bf(0xf8)](),console[_0xef36bf(0xf8)](a4_0x578549[_0xef36bf(0x145)](_0xef36bf(0x159)));for(const _0x1070dc of _0x12f4c9[_0xef36bf(0xd7)]){_0x1070dc[_0xef36bf(0xe8)]===_0xef36bf(0x152)&&console['log'](a4_0x578549[_0xef36bf(0x145)](_0xef36bf(0xe2)+_0x1070dc[_0xef36bf(0x12f)]+_0xef36bf(0x140)+_0x1070dc['error']));}for(const _0x3e3f37 of _0x12f4c9[_0xef36bf(0xeb)]){_0x3e3f37['action']===_0xef36bf(0x152)&&console['log'](a4_0x578549[_0xef36bf(0x145)](_0xef36bf(0xf7)+_0x3e3f37[_0xef36bf(0x167)]+_0xef36bf(0x140)+_0x3e3f37['error']));}for(const _0x29e199 of _0x12f4c9[_0xef36bf(0xf5)]){_0x29e199[_0xef36bf(0xe8)]===_0xef36bf(0x152)&&console[_0xef36bf(0xf8)](a4_0x578549[_0xef36bf(0x145)](_0xef36bf(0x135)+_0x29e199[_0xef36bf(0x167)]+_0xef36bf(0x140)+_0x29e199[_0xef36bf(0x152)]));}for(const _0x38692f of _0x12f4c9[_0xef36bf(0xd0)]){_0x38692f[_0xef36bf(0xe8)]===_0xef36bf(0x152)&&console['log'](a4_0x578549['red'](_0xef36bf(0x144)+_0x38692f[_0xef36bf(0x167)]+'\x22:\x20'+_0x38692f[_0xef36bf(0x152)]));}return 0x1;}console[_0xef36bf(0xf8)]();const _0x3fc5d0=getLLMProjectUrl(_0xcf20e6,_0x12f4c9[_0xef36bf(0xd8)]);return console[_0xef36bf(0xf8)](_0xef36bf(0x134)+a4_0x578549[_0xef36bf(0x13e)](_0x3fc5d0)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x1fde4e(0x167)]='agent:push';[a4_0x1fde4e(0xfd)]=a4_0x1fde4e(0x15b);async['execute'](_0x474a3f){const _0x798e6=a4_0x1fde4e,{options:_0x4d026d,args:_0x2fe71f,tdx:_0x552c0f}=_0x474a3f;let _0x21e8b0=_0x2fe71f[0x0]||process['cwd']();const _0xe2680d=_0x4d026d[_0x798e6(0x10b)],_0x5867b4=_0x4d026d[_0x798e6(0xf9)],_0x592956=_0x4d026d[_0x798e6(0x11a)],_0x1698ee=_0x4d026d['site'],_0x144932=a4_0xadd226[_0x798e6(0x137)](_0x21e8b0,_0x798e6(0x157)),_0x51c835=existsSync(_0x144932);if(_0x51c835){const {data:_0x2e9761}=await withSpinner('Pushing\x20agent\x20from\x20\x22'+_0x21e8b0+_0x798e6(0x10c),()=>_0x552c0f[_0x798e6(0x160)][_0x798e6(0x13d)](_0x21e8b0,{'dryRun':_0xe2680d,'force':_0x5867b4}));if(_0xe2680d)return console[_0x798e6(0xf8)](a4_0x578549[_0x798e6(0xfe)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x798e6(0xf8)](_0x798e6(0xdb)+_0x2e9761[_0x798e6(0x12f)]),0x0;if(_0x2e9761['action']==='error')return console[_0x798e6(0xf8)](a4_0x578549[_0x798e6(0x145)](_0x798e6(0x138)+_0x2e9761['error'])),0x1;console[_0x798e6(0xf8)](a4_0x578549[_0x798e6(0x150)](_0x798e6(0x136)+_0x2e9761['action']+'\x20successfully')),console[_0x798e6(0xf8)](_0x798e6(0x10d)+_0x2e9761[_0x798e6(0x12f)]);if(_0x2e9761['agentId']&&_0x2e9761[_0x798e6(0x16c)]){const _0x49076b=getLLMAgentChatUrl(_0x1698ee,_0x2e9761[_0x798e6(0x16c)],_0x2e9761[_0x798e6(0x108)]);console[_0x798e6(0xf8)]('Chat:\x20'+a4_0x578549[_0x798e6(0x13e)](_0x49076b));}return 0x0;}const _0x199673=_0x4d026d[_0x798e6(0x15a)],_0x22c1e9=resolveProjectFromContext(_0x21e8b0,_0x199673);if(_0x22c1e9['found'])_0x21e8b0=_0x22c1e9[_0x798e6(0x16d)],_0x22c1e9[_0x798e6(0x153)]===_0x798e6(0xd6)&&console['log'](a4_0x578549['dim'](_0x798e6(0x14a)+_0x21e8b0));else{let _0xd51d64=_0x798e6(0x149);_0x22c1e9[_0x798e6(0x11e)]==='no_local_folder'&&(_0xd51d64=_0x22c1e9[_0x798e6(0x15e)]+'\x0aRun\x20\x27tdx\x20agent\x20pull\x20'+_0x22c1e9[_0x798e6(0x15a)]+'\x27\x20to\x20create\x20the\x20folder\x20structure.');throw new SDKError(ErrorCode[_0x798e6(0x113)],_0x22c1e9[_0x798e6(0x11e)]===_0x798e6(0x141)?_0x22c1e9[_0x798e6(0x15e)]:_0x798e6(0xe4)+_0x21e8b0,undefined,{'helpText':_0xd51d64});}const {data:_0xc5d0c8}=await withSpinner(_0x798e6(0x104),()=>_0x552c0f[_0x798e6(0x160)][_0x798e6(0xc7)](_0x21e8b0,{'dryRun':!![]})),_0x284a1e=_0xc5d0c8['counts'][_0x798e6(0xd7)][_0x798e6(0x11d)]>0x0;if(_0x284a1e){console[_0x798e6(0xf8)](a4_0x578549[_0x798e6(0x145)](_0x798e6(0x114)));for(const _0x205008 of _0xc5d0c8[_0x798e6(0xd7)]){_0x205008[_0x798e6(0xe8)]===_0x798e6(0x152)&&console[_0x798e6(0xf8)](a4_0x578549[_0x798e6(0x145)](_0x798e6(0xe2)+_0x205008[_0x798e6(0x12f)]+'\x22:\x20'+_0x205008[_0x798e6(0x152)]));}return 0x1;}const _0x1ac0e1=_0xc5d0c8[_0x798e6(0xd1)]['agents'][_0x798e6(0xe9)]+_0xc5d0c8[_0x798e6(0xd1)][_0x798e6(0xeb)][_0x798e6(0xe9)]+_0xc5d0c8[_0x798e6(0xd1)][_0x798e6(0x105)]['created']+_0xc5d0c8[_0x798e6(0xd1)]['prompts'][_0x798e6(0xe9)]+_0xc5d0c8[_0x798e6(0xd1)][_0x798e6(0xd0)][_0x798e6(0xe9)],_0x213ff4=_0xc5d0c8[_0x798e6(0xd1)][_0x798e6(0xd7)]['updated']+_0xc5d0c8[_0x798e6(0xd1)][_0x798e6(0xeb)][_0x798e6(0x14e)]+_0xc5d0c8[_0x798e6(0xd1)]['textKnowledgeBases'][_0x798e6(0x14e)]+_0xc5d0c8[_0x798e6(0xd1)][_0x798e6(0xf5)][_0x798e6(0x14e)]+_0xc5d0c8['counts']['integrations'][_0x798e6(0x14e)],_0x29a927=_0xc5d0c8[_0x798e6(0xd1)][_0x798e6(0xd7)]['unchanged']+_0xc5d0c8[_0x798e6(0xd1)][_0x798e6(0xeb)][_0x798e6(0x102)]+_0xc5d0c8[_0x798e6(0xd1)]['textKnowledgeBases']['unchanged']+_0xc5d0c8['counts'][_0x798e6(0xf5)][_0x798e6(0x102)]+_0xc5d0c8[_0x798e6(0xd1)][_0x798e6(0xd0)][_0x798e6(0x102)];console['log'](_0x798e6(0x10e)+_0xc5d0c8[_0x798e6(0x151)]+'\x27:'),console[_0x798e6(0xf8)]('\x20\x20'+a4_0x578549[_0x798e6(0x150)]('+\x20'+_0x1ac0e1+_0x798e6(0xce))+'\x20|\x20'+a4_0x578549[_0x798e6(0xfe)]('~\x20'+_0x213ff4+_0x798e6(0x13f))+_0x798e6(0xec)+a4_0x578549[_0x798e6(0x132)]('=\x20'+_0x29a927+_0x798e6(0x15d))),console[_0x798e6(0xf8)](_0x798e6(0xe7)+formatCountSummary(_0xc5d0c8['counts'][_0x798e6(0xd7)])),console[_0x798e6(0xf8)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0xc5d0c8['counts'][_0x798e6(0xeb)])),console[_0x798e6(0xf8)](_0x798e6(0x14d)+formatCountSummary(_0xc5d0c8[_0x798e6(0xd1)][_0x798e6(0x105)])),console[_0x798e6(0xf8)](_0x798e6(0x120)+formatCountSummary(_0xc5d0c8['counts'][_0x798e6(0xf5)])),console[_0x798e6(0xf8)](_0x798e6(0x121)+formatCountSummary(_0xc5d0c8[_0x798e6(0xd1)][_0x798e6(0xd0)])),console[_0x798e6(0xf8)]('\x20\x20Source:\x20'+a4_0x578549[_0x798e6(0x13e)](_0x21e8b0)),displayDiffs(_0xc5d0c8[_0x798e6(0xd7)],_0xc5d0c8[_0x798e6(0xeb)],_0xc5d0c8['textKnowledgeBases'],_0xc5d0c8['prompts'],_0xc5d0c8[_0x798e6(0xd0)]);if(_0xe2680d)return console[_0x798e6(0xf8)](a4_0x578549[_0x798e6(0xfe)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed')),0x0;if(_0x1ac0e1===0x0&&_0x213ff4===0x0){console['log'](a4_0x578549[_0x798e6(0x150)](_0x798e6(0xe5)));const _0xff7ae7=getLLMProjectUrl(_0x1698ee,_0xc5d0c8[_0x798e6(0x16c)]);return console[_0x798e6(0xf8)](_0x798e6(0x134)+a4_0x578549[_0x798e6(0x13e)](_0xff7ae7)),0x0;}if(!_0x592956&&!_0x5867b4){if(!isInteractive())return console['error'](a4_0x578549['red'](_0x798e6(0x125)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x798e6(0x152)](a4_0x578549[_0x798e6(0x132)](_0x798e6(0xcc))),0x1;const _0x53be6e=await confirmKey(_0x798e6(0xf2)+(_0x1ac0e1+_0x213ff4)+_0x798e6(0x109));if(!_0x53be6e)return console['log'](a4_0x578549[_0x798e6(0xfe)](_0x798e6(0xfa)),_0x798e6(0x162)),0x1;}const {data:_0x2bf2c6}=await withSpinner(_0x798e6(0xe0),()=>_0x552c0f['llm'][_0x798e6(0xc7)](_0x21e8b0,{'force':_0x5867b4})),_0x25baea=_0x2bf2c6[_0x798e6(0xd1)][_0x798e6(0xd7)]['errors']>0x0||_0x2bf2c6['counts']['knowledgeBases'][_0x798e6(0x11d)]>0x0||_0x2bf2c6[_0x798e6(0xd1)][_0x798e6(0x105)][_0x798e6(0x11d)]>0x0||_0x2bf2c6[_0x798e6(0xd1)][_0x798e6(0xf5)][_0x798e6(0x11d)]>0x0;if(_0x25baea){console[_0x798e6(0xf8)](a4_0x578549[_0x798e6(0xfe)](_0x798e6(0xc6))),console[_0x798e6(0xf8)](),console[_0x798e6(0xf8)](a4_0x578549[_0x798e6(0x145)](_0x798e6(0x159)));for(const _0x28b69a of _0x2bf2c6[_0x798e6(0xd7)]){_0x28b69a[_0x798e6(0xe8)]===_0x798e6(0x152)&&console['log'](a4_0x578549[_0x798e6(0x145)](_0x798e6(0xe2)+_0x28b69a[_0x798e6(0x12f)]+_0x798e6(0x140)+_0x28b69a['error']));}for(const _0x321efa of _0x2bf2c6[_0x798e6(0xeb)]){_0x321efa[_0x798e6(0xe8)]===_0x798e6(0x152)&&console['log'](a4_0x578549[_0x798e6(0x145)]('\x20\x20Knowledge\x20Base\x20\x22'+_0x321efa[_0x798e6(0x167)]+_0x798e6(0x140)+_0x321efa[_0x798e6(0x152)]));}for(const _0x3ff668 of _0x2bf2c6['textKnowledgeBases']){_0x3ff668[_0x798e6(0xe8)]===_0x798e6(0x152)&&console['log'](a4_0x578549[_0x798e6(0x145)](_0x798e6(0x111)+_0x3ff668[_0x798e6(0x167)]+'\x22:\x20'+_0x3ff668[_0x798e6(0x152)]));}for(const _0xfa8e9a of _0x2bf2c6[_0x798e6(0xf5)]){_0xfa8e9a[_0x798e6(0xe8)]===_0x798e6(0x152)&&console[_0x798e6(0xf8)](a4_0x578549['red'](_0x798e6(0x135)+_0xfa8e9a[_0x798e6(0x167)]+_0x798e6(0x140)+_0xfa8e9a['error']));}for(const _0xda0e1b of _0x2bf2c6[_0x798e6(0xd0)]){_0xda0e1b[_0x798e6(0xe8)]==='error'&&console['log'](a4_0x578549[_0x798e6(0x145)](_0x798e6(0x144)+_0xda0e1b[_0x798e6(0x167)]+_0x798e6(0x140)+_0xda0e1b[_0x798e6(0x152)]));}return 0x1;}console['log'](a4_0x578549[_0x798e6(0x150)](_0x798e6(0x16b)+(_0x1ac0e1+_0x213ff4)+_0x798e6(0x12c)+_0x2bf2c6[_0x798e6(0x151)]+'\x27'));const _0x402774=getLLMProjectUrl(_0x1698ee,_0x2bf2c6[_0x798e6(0x16c)]);return console['log']('Project:\x20'+a4_0x578549[_0x798e6(0x13e)](_0x402774)),0x0;}}
1
+ const a4_0x4cc0e1=a4_0x4cb5;(function(_0x31f11c,_0x1a4f39){const _0x17c71b=a4_0x4cb5,_0x650828=_0x31f11c();while(!![]){try{const _0x372c52=parseInt(_0x17c71b(0x1b2))/0x1*(parseInt(_0x17c71b(0x1ac))/0x2)+parseInt(_0x17c71b(0x1c9))/0x3*(parseInt(_0x17c71b(0x140))/0x4)+-parseInt(_0x17c71b(0x167))/0x5*(parseInt(_0x17c71b(0x12c))/0x6)+-parseInt(_0x17c71b(0x170))/0x7*(parseInt(_0x17c71b(0x18c))/0x8)+-parseInt(_0x17c71b(0x1bc))/0x9+parseInt(_0x17c71b(0x18e))/0xa+parseInt(_0x17c71b(0x13d))/0xb;if(_0x372c52===_0x1a4f39)break;else _0x650828['push'](_0x650828['shift']());}catch(_0x345b18){_0x650828['push'](_0x650828['shift']());}}}(a4_0x1954,0xc5db0));import a4_0x1b83d5 from'chalk';function a4_0x1954(){const _0x1573c3=['Source:\x20','dryRun','cloneProject','\x20\x20tdx\x20agent\x20pull\x20','\x20--name\x20','MISSING_ARGUMENT','\x0aPush\x20','\x20new','Output\x20path:\x20','unchanged','\x20\x20Target:\x20','Using\x20project:\x20','log','Agent:\x20','Agent\x20','842wHOuqa','dim','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory','Analyzing\x20project\x20\x22','Dry\x20run\x20-\x20no\x20files\x20written','newProjectName','2771iAUCNr','-\x20nothing\x20pushed','\x20resources?','\x22\x20to\x20\x22','gray','llm','outputDir','diff','agentId','\x20|\x20','14059683aFnlMX','\x27\x20to\x20create\x20the\x20folder\x20structure.','-\x20no\x20files\x20written','Project\x20cloned\x20with\x20errors','agent:push','\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)','Dry\x20run\x20-\x20no\x20changes\x20made','join','utf-8','\x20\x20Knowledge\x20Base\x20\x22','\x20files?','\x22...','isNew','1308uhUtMJ','dirname','New\x20project:\x20','\x20\x20Knowledge\x20Bases:\x20','Cannot\x20clone\x20from\x20context\x20project\x20\x22','\x20created','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Agent\x20pulled\x20successfully','cyan','\x20=\x20','INVALID_ARGUMENT','4599996Biuydu','sourceProjectName','Errors:','Failed\x20to\x20push\x20agent:\x20','\x20total','newProjectId','Clone\x20\x22','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project','llmProject','Pushing\x20to\x20project...','\x0aError:','red','agentName','\x20\x20Integration\x20\x22','projectId','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','found','28645067bUndLl','Would\x20clone:','yellow','3212rVMsbt','no_context','\x20errors','\x20\x20tdx\x20agent\x20clone\x20agents/','Using\x20local\x20project:\x20','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','prompts','counts','updated','error','Project\x20cloned\x20successfully','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','action','site','context','new','Pushing\x20agent\x20from\x20\x22','Using\x20current\x20project:\x20','green','\x20\x20Agents:\x20','force','\x22:\x20','\x20updated','repeat','\x0aChanges\x20to\x20integration\x20\x27','\x20\x20Prompt\x20\x22','pullProject','\x20unchanged','reason','pushProject','description','\x0aChanges\x20to\x20agent\x20\x27','New\x20project\x20ID:\x20','\x0aErrors\x20found:','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','Using\x20context\x20project:\x20','\x22\x20to\x20a\x20different\x20profile','\x22\x20from\x20project\x20\x22','projectName','5xYvUyJ','\x20\x20Integrations:\x20','parse','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','push','\x0aPush\x20summary\x20for\x20\x27','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','cwd','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','791fSQYqF','tdx.json','\x20\x20Text\x20Knowledge\x20Bases:\x20','✔\x20Context\x20set:\x20','\x20resources\x20to\x20\x27','Cloning\x20\x22','agents','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','knowledgeBases','profile','yes','Project:\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','textKnowledgeBases','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','hasChanges','message','errors','\x20\x20Agent\x20\x22','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','Writing\x20files...','Would\x20pull\x20agent:\x20','\x20changed','Summary:','Usage:\x20tdx\x20agent\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20project\x20(requires\x20context\x20or\x20tdx.json)','llm_project','pullAgent','No\x20tdx.json\x20found\x20in\x20','82448qTPqyT','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','1830510dFoOdY','outputPath','created','\x20--profile\x20','execute','\x20\x20Prompts:\x20','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','\x20\x20Text\x20Knowledge\x20Base\x20\x22','\x0aProject\x20pushed\x20with\x20errors','integrations','\x20\x20Source:\x20','agent:clone','name','New\x20project\x20name\x20is\x20required','session'];a4_0x1954=function(){return _0x1573c3;};return a4_0x1954();}import a4_0x353337 from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x49d517){const _0x38bc57=a4_0x4cb5,_0x261984=[];if(_0x49d517['total']!==undefined)_0x261984['push'](_0x49d517['total']+_0x38bc57(0x130));if(_0x49d517[_0x38bc57(0x14f)]!==undefined&&_0x49d517[_0x38bc57(0x14f)]>0x0)_0x261984[_0x38bc57(0x16b)](a4_0x1b83d5[_0x38bc57(0x152)](_0x49d517[_0x38bc57(0x14f)]+'\x20new'));if(_0x49d517[_0x38bc57(0x190)]!==undefined&&_0x49d517[_0x38bc57(0x190)]>0x0)_0x261984[_0x38bc57(0x16b)](a4_0x1b83d5['green'](_0x49d517[_0x38bc57(0x190)]+_0x38bc57(0x1ce)));if(_0x49d517['updated']!==undefined&&_0x49d517[_0x38bc57(0x148)]>0x0)_0x261984[_0x38bc57(0x16b)](a4_0x1b83d5['yellow'](_0x49d517[_0x38bc57(0x148)]+_0x38bc57(0x156)));if(_0x49d517[_0x38bc57(0x1a6)]!==undefined&&_0x49d517[_0x38bc57(0x1a6)]>0x0)_0x261984['push'](a4_0x1b83d5[_0x38bc57(0x1b6)](_0x49d517[_0x38bc57(0x1a6)]+'\x20unchanged'));if(_0x49d517[_0x38bc57(0x181)]!==undefined&&_0x49d517[_0x38bc57(0x181)]>0x0)_0x261984[_0x38bc57(0x16b)](a4_0x1b83d5[_0x38bc57(0x137)](_0x49d517[_0x38bc57(0x181)]+_0x38bc57(0x142)));return _0x261984[_0x38bc57(0x1c3)](',\x20');}function displayDiffs(_0x567f91,_0x2e6abe,_0x5d9afe,_0x3aa9b8,_0x2fdbd1=[]){const _0xc2d73d=a4_0x4cb5;for(const _0xefe497 of _0x567f91){if(_0xefe497[_0xc2d73d(0x1b9)]){const _0x5a5abd=_0xefe497['agentName']||_0xefe497[_0xc2d73d(0x19a)];console['log'](_0xc2d73d(0x15f)+_0x5a5abd+'\x27:'),console[_0xc2d73d(0x1a9)]('─'['repeat'](0x3c)),console[_0xc2d73d(0x1a9)](_0xefe497[_0xc2d73d(0x1b9)]),console[_0xc2d73d(0x1a9)]('─'['repeat'](0x3c));}}for(const _0x502c62 of _0x2e6abe){_0x502c62[_0xc2d73d(0x1b9)]&&(console[_0xc2d73d(0x1a9)](_0xc2d73d(0x17e)+_0x502c62[_0xc2d73d(0x19a)]+'\x27:'),console['log']('─'[_0xc2d73d(0x157)](0x3c)),console[_0xc2d73d(0x1a9)](_0x502c62[_0xc2d73d(0x1b9)]),console[_0xc2d73d(0x1a9)]('─'['repeat'](0x3c)));}for(const _0x23752e of _0x5d9afe){_0x23752e[_0xc2d73d(0x1b9)]&&(console[_0xc2d73d(0x1a9)](_0xc2d73d(0x183)+_0x23752e[_0xc2d73d(0x19a)]+'\x27:'),console[_0xc2d73d(0x1a9)]('─'['repeat'](0x3c)),console[_0xc2d73d(0x1a9)](_0x23752e['diff']),console[_0xc2d73d(0x1a9)]('─'['repeat'](0x3c)));}for(const _0x101a42 of _0x3aa9b8){_0x101a42[_0xc2d73d(0x1b9)]&&(console['log']('\x0aChanges\x20to\x20prompt\x20\x27'+_0x101a42['name']+'\x27:'),console[_0xc2d73d(0x1a9)]('─'[_0xc2d73d(0x157)](0x3c)),console['log'](_0x101a42[_0xc2d73d(0x1b9)]),console[_0xc2d73d(0x1a9)]('─'[_0xc2d73d(0x157)](0x3c)));}for(const _0x22da69 of _0x2fdbd1){_0x22da69[_0xc2d73d(0x1b9)]&&(console['log'](_0xc2d73d(0x158)+_0x22da69[_0xc2d73d(0x19a)]+'\x27:'),console[_0xc2d73d(0x1a9)]('─'[_0xc2d73d(0x157)](0x3c)),console[_0xc2d73d(0x1a9)](_0x22da69[_0xc2d73d(0x1b9)]),console['log']('─'['repeat'](0x3c)));}}export class AgentPullCommand extends BaseCommand{['name']='agent:pull';[a4_0x4cc0e1(0x15e)]='Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files';async[a4_0x4cc0e1(0x192)](_0x4a63dd){const _0xc7ad85=a4_0x4cc0e1,{options:_0x3d07cf,args:_0x251ba2,tdx:_0x5b98f8}=_0x4a63dd,_0x262b99=_0x251ba2[0x0],_0x46c353=_0x251ba2[0x1],_0x4b634c=_0x3d07cf['output'],_0x5d9268=_0x3d07cf['dryRun'],_0x318547=_0x3d07cf[_0xc7ad85(0x154)],_0x7d4557=_0x3d07cf[_0xc7ad85(0x17a)],_0x435cd0=_0x3d07cf['llmProject'];let _0x37af12,_0x173df9;const _0x2ba1ea=findAgentConfigPath(process['cwd']());if(_0x262b99){const _0x911cdd=a4_0x353337[_0xc7ad85(0x1c3)](_0x262b99,_0xc7ad85(0x171));if(existsSync(_0x911cdd))try{const _0x1c6460=JSON[_0xc7ad85(0x169)](readFileSync(_0x911cdd,_0xc7ad85(0x1c4)));_0x37af12=_0x1c6460[_0xc7ad85(0x189)],_0x173df9=_0x262b99,console[_0xc7ad85(0x1a9)](a4_0x1b83d5['dim']('Using\x20project\x20from\x20'+_0x911cdd+':\x20'+_0x37af12));}catch{_0x37af12=_0x262b99;}else _0x37af12=_0x262b99;}else{if(_0x2ba1ea)try{const _0x283998=JSON[_0xc7ad85(0x169)](readFileSync(_0x2ba1ea,_0xc7ad85(0x1c4)));_0x37af12=_0x283998[_0xc7ad85(0x189)],_0x173df9=a4_0x353337['dirname'](_0x2ba1ea),console[_0xc7ad85(0x1a9)](a4_0x1b83d5[_0xc7ad85(0x1ad)](_0xc7ad85(0x1a8)+_0x37af12));}catch{_0x37af12=_0x435cd0;}else _0x37af12=_0x435cd0;}if(!_0x37af12)return console[_0xc7ad85(0x1a9)](a4_0x1b83d5[_0xc7ad85(0x13f)](_0xc7ad85(0x13b))),console[_0xc7ad85(0x1a9)](_0xc7ad85(0x188)),console[_0xc7ad85(0x1a9)](_0xc7ad85(0x133)),console[_0xc7ad85(0x1a9)](_0xc7ad85(0x1ae)),console[_0xc7ad85(0x1a9)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20#\x20Pull\x20specific\x20agent'),0x1;if(_0x46c353){const {data:_0x22934e}=await withSpinner('Pulling\x20agent\x20\x22'+_0x46c353+_0xc7ad85(0x165)+_0x37af12+_0xc7ad85(0x1c7),()=>_0x5b98f8[_0xc7ad85(0x1b7)][_0xc7ad85(0x18a)](_0x37af12,_0x46c353,_0x4b634c,{'dryRun':_0x5d9268,'force':_0x318547}));if(_0x5d9268)return console[_0xc7ad85(0x1a9)](a4_0x1b83d5[_0xc7ad85(0x13f)](_0xc7ad85(0x1b0))),console[_0xc7ad85(0x1a9)](_0xc7ad85(0x185)+_0x22934e['agentName']),console['log'](_0xc7ad85(0x1a5)+_0x22934e[_0xc7ad85(0x18f)]),_0x22934e[_0xc7ad85(0x1b9)]&&(console[_0xc7ad85(0x1a9)]('\x0aChanges:'),console[_0xc7ad85(0x1a9)]('─'[_0xc7ad85(0x157)](0x3c)),console[_0xc7ad85(0x1a9)](_0x22934e[_0xc7ad85(0x1b9)]),console[_0xc7ad85(0x1a9)]('─'[_0xc7ad85(0x157)](0x3c))),0x0;return console[_0xc7ad85(0x1a9)](a4_0x1b83d5[_0xc7ad85(0x152)](_0xc7ad85(0x128))),console[_0xc7ad85(0x1a9)](_0xc7ad85(0x1aa)+_0x22934e['agentName']),console[_0xc7ad85(0x1a9)]('Output:\x20'+_0x22934e[_0xc7ad85(0x18f)]),console[_0xc7ad85(0x1a9)]('Status:\x20'+(_0x22934e[_0xc7ad85(0x1c8)]?a4_0x1b83d5['green'](_0xc7ad85(0x14f)):_0x22934e[_0xc7ad85(0x17f)]?a4_0x1b83d5[_0xc7ad85(0x13f)](_0xc7ad85(0x148)):a4_0x1b83d5[_0xc7ad85(0x1b6)](_0xc7ad85(0x1a6)))),0x0;}const _0xa60b8b=_0x173df9||_0x4b634c,{data:_0x414770}=await withSpinner(_0xc7ad85(0x1af)+_0x37af12+_0xc7ad85(0x1c7),()=>_0x5b98f8['llm'][_0xc7ad85(0x15a)](_0x37af12,_0xa60b8b,{'dryRun':!![]})),_0x5e4de7=_0x414770[_0xc7ad85(0x147)][_0xc7ad85(0x176)][_0xc7ad85(0x14f)]+_0x414770[_0xc7ad85(0x147)][_0xc7ad85(0x178)][_0xc7ad85(0x14f)]+_0x414770['counts'][_0xc7ad85(0x17d)][_0xc7ad85(0x14f)]+_0x414770['counts'][_0xc7ad85(0x146)][_0xc7ad85(0x14f)]+_0x414770[_0xc7ad85(0x147)][_0xc7ad85(0x197)][_0xc7ad85(0x14f)],_0xec8f37=_0x414770['counts'][_0xc7ad85(0x176)][_0xc7ad85(0x148)]+_0x414770['counts'][_0xc7ad85(0x178)][_0xc7ad85(0x148)]+_0x414770['counts'][_0xc7ad85(0x17d)][_0xc7ad85(0x148)]+_0x414770[_0xc7ad85(0x147)][_0xc7ad85(0x146)]['updated']+_0x414770[_0xc7ad85(0x147)]['integrations'][_0xc7ad85(0x148)],_0x4e47e9=_0x414770['counts'][_0xc7ad85(0x176)][_0xc7ad85(0x1a6)]+_0x414770[_0xc7ad85(0x147)][_0xc7ad85(0x178)][_0xc7ad85(0x1a6)]+_0x414770[_0xc7ad85(0x147)][_0xc7ad85(0x17d)][_0xc7ad85(0x1a6)]+_0x414770[_0xc7ad85(0x147)][_0xc7ad85(0x146)][_0xc7ad85(0x1a6)]+_0x414770[_0xc7ad85(0x147)]['integrations'][_0xc7ad85(0x1a6)];console['log']('\x0aPull\x20summary\x20for\x20\x27'+_0x414770[_0xc7ad85(0x166)]+'\x27:'),console[_0xc7ad85(0x1a9)]('\x20\x20'+a4_0x1b83d5['green']('+\x20'+_0x5e4de7+'\x20new')+'\x20|\x20'+a4_0x1b83d5[_0xc7ad85(0x13f)]('~\x20'+_0xec8f37+_0xc7ad85(0x186))+'\x20|\x20'+a4_0x1b83d5[_0xc7ad85(0x1ad)]('=\x20'+_0x4e47e9+_0xc7ad85(0x15b))),console[_0xc7ad85(0x1a9)]('\x20\x20Agents:\x20'+formatCountSummary(_0x414770[_0xc7ad85(0x147)][_0xc7ad85(0x176)])),console[_0xc7ad85(0x1a9)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x414770['counts']['knowledgeBases'])),console['log'](_0xc7ad85(0x172)+formatCountSummary(_0x414770[_0xc7ad85(0x147)][_0xc7ad85(0x17d)])),console[_0xc7ad85(0x1a9)](_0xc7ad85(0x193)+formatCountSummary(_0x414770['counts']['prompts'])),console[_0xc7ad85(0x1a9)](_0xc7ad85(0x168)+formatCountSummary(_0x414770[_0xc7ad85(0x147)]['integrations'])),console[_0xc7ad85(0x1a9)](_0xc7ad85(0x1a7)+a4_0x1b83d5['cyan'](_0x414770[_0xc7ad85(0x1b8)])),displayDiffs(_0x414770[_0xc7ad85(0x176)],_0x414770[_0xc7ad85(0x178)],_0x414770['textKnowledgeBases'],_0x414770[_0xc7ad85(0x146)],_0x414770[_0xc7ad85(0x197)]);if(_0x5d9268)return console['log'](a4_0x1b83d5[_0xc7ad85(0x13f)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x5e4de7===0x0&&_0xec8f37===0x0)return console[_0xc7ad85(0x1a9)](a4_0x1b83d5[_0xc7ad85(0x152)]('\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'llm_project':_0x414770[_0xc7ad85(0x166)]},_0x3d07cf['session']),console[_0xc7ad85(0x1a9)](a4_0x1b83d5['green'](_0xc7ad85(0x173)+a4_0x1b83d5[_0xc7ad85(0x1ad)](_0xc7ad85(0x189))+_0xc7ad85(0x12a)+a4_0x1b83d5[_0xc7ad85(0x129)](_0x414770[_0xc7ad85(0x166)]))),0x0;if(!_0x7d4557&&!_0x318547){if(!isInteractive())return console[_0xc7ad85(0x149)](a4_0x1b83d5[_0xc7ad85(0x137)](_0xc7ad85(0x136)),_0xc7ad85(0x127)),console['error'](a4_0x1b83d5[_0xc7ad85(0x1ad)](_0xc7ad85(0x17c))),0x1;const _0x1a9e37=await confirmKey('\x0aWrite\x20'+(_0x5e4de7+_0xec8f37)+_0xc7ad85(0x1c6));if(!_0x1a9e37)return console[_0xc7ad85(0x1a9)](a4_0x1b83d5[_0xc7ad85(0x13f)]('Cancelled'),_0xc7ad85(0x1be)),0x1;}const {data:_0x5f2872}=await withSpinner(_0xc7ad85(0x184),()=>_0x5b98f8[_0xc7ad85(0x1b7)][_0xc7ad85(0x15a)](_0x37af12,_0xa60b8b,{'force':_0x318547}));return console['log'](a4_0x1b83d5[_0xc7ad85(0x152)]('\x0a✔\x20Pulled\x20'+(_0x5e4de7+_0xec8f37)+'\x20files\x20to\x20'+_0x5f2872[_0xc7ad85(0x1b8)])),saveSessionContext({'llm_project':_0x5f2872[_0xc7ad85(0x166)]},_0x3d07cf[_0xc7ad85(0x19c)]),console[_0xc7ad85(0x1a9)](a4_0x1b83d5[_0xc7ad85(0x152)](_0xc7ad85(0x173)+a4_0x1b83d5[_0xc7ad85(0x1ad)]('llm_project')+_0xc7ad85(0x12a)+a4_0x1b83d5['cyan'](_0x5f2872[_0xc7ad85(0x166)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x4cc0e1(0x19a)]=a4_0x4cc0e1(0x199);[a4_0x4cc0e1(0x15e)]=a4_0x4cc0e1(0x16d);async[a4_0x4cc0e1(0x192)](_0x3fc91b){const _0xaae92a=a4_0x4cc0e1,{options:_0x352807,args:_0x3603ab,tdx:_0x431cf0}=_0x3fc91b,_0x12bcca=_0x3603ab[0x0],_0x182eae=_0x352807[_0xaae92a(0x19a)],_0x16ae02=_0x352807[_0xaae92a(0x19e)],_0x200be8=_0x352807[_0xaae92a(0x17a)],_0x1fc5dd=_0x352807['site'],_0x4f490e=_0x352807['llmProject'];let _0x2a7da7;const _0x992afe=findAgentConfigPath(process[_0xaae92a(0x16e)]());if(_0x12bcca){const _0x489f3e=a4_0x353337[_0xaae92a(0x1c3)](_0x12bcca,_0xaae92a(0x171));existsSync(_0x489f3e)?(_0x2a7da7=_0x12bcca,console[_0xaae92a(0x1a9)](a4_0x1b83d5[_0xaae92a(0x1ad)](_0xaae92a(0x144)+_0x12bcca))):_0x2a7da7=_0x12bcca;}else{if(_0x992afe)_0x2a7da7=a4_0x353337[_0xaae92a(0x1ca)](_0x992afe),console[_0xaae92a(0x1a9)](a4_0x1b83d5[_0xaae92a(0x1ad)](_0xaae92a(0x151)+_0x2a7da7));else{if(_0x4f490e){const _0x23be23=sanitizeForFilesystem(_0x4f490e);let _0x2ed744=_0x23be23,_0x134abd=a4_0x353337[_0xaae92a(0x1c3)](process[_0xaae92a(0x16e)](),'agents',_0x23be23,_0xaae92a(0x171));if(!existsSync(_0x134abd)){const _0x166723=normalizeName(_0x4f490e),_0x1ad317=a4_0x353337[_0xaae92a(0x1c3)](process[_0xaae92a(0x16e)](),_0xaae92a(0x176),_0x166723,'tdx.json');existsSync(_0x1ad317)&&(_0x2ed744=_0x166723,_0x134abd=_0x1ad317);}if(existsSync(_0x134abd))_0x2a7da7=a4_0x353337[_0xaae92a(0x1ca)](_0x134abd),console['log'](a4_0x1b83d5[_0xaae92a(0x1ad)](_0xaae92a(0x144)+_0x2a7da7));else{const _0x2722e5=_0x352807[_0xaae92a(0x179)];if(_0x2722e5)throw new SDKError(ErrorCode[_0xaae92a(0x12b)],_0xaae92a(0x1cd)+_0x4f490e+_0xaae92a(0x164),undefined,{'helpText':_0xaae92a(0x194)+_0xaae92a(0x162)+(_0xaae92a(0x1a0)+_0x4f490e+'\x0a')+(_0xaae92a(0x143)+_0x2ed744+_0xaae92a(0x1a1)+(_0x182eae||'<new-name>')+_0xaae92a(0x191)+_0x2722e5)});_0x2a7da7=_0x4f490e,console[_0xaae92a(0x1a9)](a4_0x1b83d5['dim'](_0xaae92a(0x163)+_0x4f490e));}}}}if(!_0x2a7da7)return console['log'](a4_0x1b83d5['yellow'](_0xaae92a(0x16f))),console[_0xaae92a(0x1a9)]('\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project'),console[_0xaae92a(0x1a9)](_0xaae92a(0x14b)),console[_0xaae92a(0x1a9)](_0xaae92a(0x1c1)),console[_0xaae92a(0x1a9)]('\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>'),0x1;if(!_0x182eae)throw new SDKError(ErrorCode[_0xaae92a(0x1a2)],_0xaae92a(0x19b),undefined,{'helpText':_0xaae92a(0x177)});if(!_0x200be8&&!_0x16ae02){if(!isInteractive())return console[_0xaae92a(0x149)](a4_0x1b83d5['red']('\x0aError:'),_0xaae92a(0x127)),console['error'](a4_0x1b83d5[_0xaae92a(0x1ad)](_0xaae92a(0x17c))),0x1;const _0x3585c8=await confirmKey(_0xaae92a(0x132)+_0x2a7da7+'\x22\x20to\x20new\x20project\x20\x22'+_0x182eae+'\x22?');if(!_0x3585c8)return console[_0xaae92a(0x1a9)](a4_0x1b83d5[_0xaae92a(0x13f)]('Cancelled')),0x1;}const {data:_0x1bdf19}=await withSpinner(_0xaae92a(0x175)+_0x2a7da7+_0xaae92a(0x1b5)+_0x182eae+'\x22...',()=>_0x431cf0['llm'][_0xaae92a(0x19f)](_0x2a7da7,_0x182eae,{'dryRun':_0x16ae02}));if(_0x16ae02)return console['log'](a4_0x1b83d5[_0xaae92a(0x13f)](_0xaae92a(0x1c2))),console[_0xaae92a(0x1a9)]('Source:\x20'+_0x1bdf19[_0xaae92a(0x12d)]),console['log']('New\x20project:\x20'+_0x182eae),console[_0xaae92a(0x1a9)](_0xaae92a(0x13e)),console[_0xaae92a(0x1a9)]('\x20\x20Agents:\x20'+_0x1bdf19['counts'][_0xaae92a(0x176)][_0xaae92a(0x190)]),console[_0xaae92a(0x1a9)]('\x20\x20Knowledge\x20Bases:\x20'+_0x1bdf19[_0xaae92a(0x147)][_0xaae92a(0x178)]['created']),console[_0xaae92a(0x1a9)](_0xaae92a(0x193)+_0x1bdf19[_0xaae92a(0x147)][_0xaae92a(0x146)][_0xaae92a(0x190)]),0x0;const _0x29835a=_0x1bdf19[_0xaae92a(0x147)][_0xaae92a(0x176)]['errors']>0x0||_0x1bdf19[_0xaae92a(0x147)][_0xaae92a(0x178)][_0xaae92a(0x181)]>0x0||_0x1bdf19[_0xaae92a(0x147)][_0xaae92a(0x146)][_0xaae92a(0x181)]>0x0;_0x29835a?console[_0xaae92a(0x1a9)](a4_0x1b83d5['yellow'](_0xaae92a(0x1bf))):console[_0xaae92a(0x1a9)](a4_0x1b83d5[_0xaae92a(0x152)](_0xaae92a(0x14a)));console['log'](_0xaae92a(0x19d)+_0x1bdf19[_0xaae92a(0x12d)]),console[_0xaae92a(0x1a9)](_0xaae92a(0x1cb)+_0x1bdf19[_0xaae92a(0x1b1)]),console[_0xaae92a(0x1a9)](_0xaae92a(0x160)+_0x1bdf19[_0xaae92a(0x131)]),console[_0xaae92a(0x1a9)](),console[_0xaae92a(0x1a9)](_0xaae92a(0x187)),console[_0xaae92a(0x1a9)](_0xaae92a(0x153)+formatCountSummary(_0x1bdf19['counts'][_0xaae92a(0x176)])),console['log']('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x1bdf19[_0xaae92a(0x147)][_0xaae92a(0x178)])),console[_0xaae92a(0x1a9)](_0xaae92a(0x193)+formatCountSummary(_0x1bdf19[_0xaae92a(0x147)][_0xaae92a(0x146)])),console[_0xaae92a(0x1a9)](_0xaae92a(0x168)+formatCountSummary(_0x1bdf19[_0xaae92a(0x147)][_0xaae92a(0x197)]));if(_0x29835a){console[_0xaae92a(0x1a9)](),console[_0xaae92a(0x1a9)](a4_0x1b83d5['red'](_0xaae92a(0x12e)));for(const _0x17662d of _0x1bdf19['agents']){_0x17662d[_0xaae92a(0x14c)]==='error'&&console['log'](a4_0x1b83d5[_0xaae92a(0x137)](_0xaae92a(0x182)+_0x17662d[_0xaae92a(0x138)]+_0xaae92a(0x155)+_0x17662d['error']));}for(const _0x5d4a51 of _0x1bdf19['knowledgeBases']){_0x5d4a51[_0xaae92a(0x14c)]===_0xaae92a(0x149)&&console[_0xaae92a(0x1a9)](a4_0x1b83d5[_0xaae92a(0x137)]('\x20\x20Knowledge\x20Base\x20\x22'+_0x5d4a51[_0xaae92a(0x19a)]+_0xaae92a(0x155)+_0x5d4a51[_0xaae92a(0x149)]));}for(const _0x299ec5 of _0x1bdf19[_0xaae92a(0x146)]){_0x299ec5[_0xaae92a(0x14c)]===_0xaae92a(0x149)&&console['log'](a4_0x1b83d5[_0xaae92a(0x137)]('\x20\x20Prompt\x20\x22'+_0x299ec5[_0xaae92a(0x19a)]+_0xaae92a(0x155)+_0x299ec5[_0xaae92a(0x149)]));}for(const _0x27e4ce of _0x1bdf19['integrations']){_0x27e4ce[_0xaae92a(0x14c)]===_0xaae92a(0x149)&&console[_0xaae92a(0x1a9)](a4_0x1b83d5['red'](_0xaae92a(0x139)+_0x27e4ce[_0xaae92a(0x19a)]+'\x22:\x20'+_0x27e4ce[_0xaae92a(0x149)]));}return 0x1;}console[_0xaae92a(0x1a9)]();const _0x2d058c=getLLMProjectUrl(_0x1fc5dd,_0x1bdf19['newProjectId']);return console[_0xaae92a(0x1a9)](_0xaae92a(0x17b)+a4_0x1b83d5[_0xaae92a(0x129)](_0x2d058c)),0x0;}}function a4_0x4cb5(_0x31242e,_0x355748){_0x31242e=_0x31242e-0x127;const _0x19545a=a4_0x1954();let _0x4cb521=_0x19545a[_0x31242e];return _0x4cb521;}export class AgentPushCommand extends BaseCommand{[a4_0x4cc0e1(0x19a)]=a4_0x4cc0e1(0x1c0);[a4_0x4cc0e1(0x15e)]=a4_0x4cc0e1(0x145);async[a4_0x4cc0e1(0x192)](_0x493af9){const _0x17831f=a4_0x4cc0e1,{options:_0xf71241,args:_0x64e008,tdx:_0x49eeb5}=_0x493af9;let _0x1b30c0=_0x64e008[0x0]||process[_0x17831f(0x16e)]();const _0x477f50=_0xf71241['dryRun'],_0x276612=_0xf71241[_0x17831f(0x154)],_0x9980ea=_0xf71241['yes'],_0x27b3e5=_0xf71241[_0x17831f(0x14d)],_0x142dee=a4_0x353337[_0x17831f(0x1c3)](_0x1b30c0,'agent.yml'),_0x57d44d=existsSync(_0x142dee);if(_0x57d44d){const {data:_0x3f230b}=await withSpinner(_0x17831f(0x150)+_0x1b30c0+_0x17831f(0x1c7),()=>_0x49eeb5['llm']['pushAgent'](_0x1b30c0,{'dryRun':_0x477f50,'force':_0x276612}));if(_0x477f50)return console[_0x17831f(0x1a9)](a4_0x1b83d5[_0x17831f(0x13f)](_0x17831f(0x1c2))),console[_0x17831f(0x1a9)]('Would\x20push\x20agent:\x20'+_0x3f230b['agentName']),0x0;if(_0x3f230b[_0x17831f(0x14c)]===_0x17831f(0x149))return console[_0x17831f(0x1a9)](a4_0x1b83d5[_0x17831f(0x137)](_0x17831f(0x12f)+_0x3f230b[_0x17831f(0x149)])),0x1;console[_0x17831f(0x1a9)](a4_0x1b83d5[_0x17831f(0x152)](_0x17831f(0x1ab)+_0x3f230b[_0x17831f(0x14c)]+'\x20successfully')),console[_0x17831f(0x1a9)]('Agent:\x20'+_0x3f230b[_0x17831f(0x138)]);if(_0x3f230b[_0x17831f(0x1ba)]&&_0x3f230b['projectId']){const _0xcb26c8=getLLMAgentChatUrl(_0x27b3e5,_0x3f230b['projectId'],_0x3f230b[_0x17831f(0x1ba)]);console[_0x17831f(0x1a9)]('Chat:\x20'+a4_0x1b83d5[_0x17831f(0x129)](_0xcb26c8));}return 0x0;}const _0x105bfb=_0xf71241[_0x17831f(0x134)],_0x3cc742=resolveProjectFromContext(_0x1b30c0,_0x105bfb);if(_0x3cc742[_0x17831f(0x13c)])_0x1b30c0=_0x3cc742['projectDir'],_0x3cc742['source']===_0x17831f(0x14e)&&console[_0x17831f(0x1a9)](a4_0x1b83d5[_0x17831f(0x1ad)](_0x17831f(0x1a8)+_0x1b30c0));else{let _0x31824c=_0x17831f(0x18d);_0x3cc742[_0x17831f(0x15c)]==='no_local_folder'&&(_0x31824c=_0x3cc742[_0x17831f(0x180)]+_0x17831f(0x16a)+_0x3cc742[_0x17831f(0x134)]+_0x17831f(0x1bd));throw new SDKError(ErrorCode[_0x17831f(0x12b)],_0x3cc742[_0x17831f(0x15c)]===_0x17831f(0x141)?_0x3cc742[_0x17831f(0x180)]:_0x17831f(0x18b)+_0x1b30c0,undefined,{'helpText':_0x31824c});}const {data:_0x531036}=await withSpinner('Analyzing\x20changes\x20to\x20push...',()=>_0x49eeb5[_0x17831f(0x1b7)]['pushProject'](_0x1b30c0,{'dryRun':!![]})),_0x2e2876=_0x531036[_0x17831f(0x147)]['agents'][_0x17831f(0x181)]>0x0;if(_0x2e2876){console[_0x17831f(0x1a9)](a4_0x1b83d5[_0x17831f(0x137)](_0x17831f(0x161)));for(const _0x210a4a of _0x531036['agents']){_0x210a4a[_0x17831f(0x14c)]===_0x17831f(0x149)&&console[_0x17831f(0x1a9)](a4_0x1b83d5[_0x17831f(0x137)](_0x17831f(0x182)+_0x210a4a[_0x17831f(0x138)]+'\x22:\x20'+_0x210a4a[_0x17831f(0x149)]));}return 0x1;}const _0x2b7e6b=_0x531036[_0x17831f(0x147)]['agents'][_0x17831f(0x190)]+_0x531036[_0x17831f(0x147)][_0x17831f(0x178)][_0x17831f(0x190)]+_0x531036[_0x17831f(0x147)]['textKnowledgeBases'][_0x17831f(0x190)]+_0x531036[_0x17831f(0x147)][_0x17831f(0x146)][_0x17831f(0x190)]+_0x531036[_0x17831f(0x147)]['integrations'][_0x17831f(0x190)],_0x293adc=_0x531036[_0x17831f(0x147)]['agents'][_0x17831f(0x148)]+_0x531036[_0x17831f(0x147)]['knowledgeBases'][_0x17831f(0x148)]+_0x531036[_0x17831f(0x147)][_0x17831f(0x17d)][_0x17831f(0x148)]+_0x531036['counts'][_0x17831f(0x146)][_0x17831f(0x148)]+_0x531036[_0x17831f(0x147)][_0x17831f(0x197)][_0x17831f(0x148)],_0xdc397a=_0x531036[_0x17831f(0x147)][_0x17831f(0x176)][_0x17831f(0x1a6)]+_0x531036[_0x17831f(0x147)][_0x17831f(0x178)]['unchanged']+_0x531036['counts'][_0x17831f(0x17d)]['unchanged']+_0x531036[_0x17831f(0x147)][_0x17831f(0x146)]['unchanged']+_0x531036['counts'][_0x17831f(0x197)][_0x17831f(0x1a6)];console[_0x17831f(0x1a9)](_0x17831f(0x16c)+_0x531036[_0x17831f(0x166)]+'\x27:'),console['log']('\x20\x20'+a4_0x1b83d5['green']('+\x20'+_0x2b7e6b+_0x17831f(0x1a4))+_0x17831f(0x1bb)+a4_0x1b83d5[_0x17831f(0x13f)]('~\x20'+_0x293adc+_0x17831f(0x186))+_0x17831f(0x1bb)+a4_0x1b83d5['dim']('=\x20'+_0xdc397a+_0x17831f(0x15b))),console[_0x17831f(0x1a9)](_0x17831f(0x153)+formatCountSummary(_0x531036[_0x17831f(0x147)][_0x17831f(0x176)])),console['log'](_0x17831f(0x1cc)+formatCountSummary(_0x531036['counts'][_0x17831f(0x178)])),console['log']('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x531036[_0x17831f(0x147)][_0x17831f(0x17d)])),console[_0x17831f(0x1a9)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x531036[_0x17831f(0x147)][_0x17831f(0x146)])),console[_0x17831f(0x1a9)](_0x17831f(0x168)+formatCountSummary(_0x531036[_0x17831f(0x147)][_0x17831f(0x197)])),console[_0x17831f(0x1a9)](_0x17831f(0x198)+a4_0x1b83d5[_0x17831f(0x129)](_0x1b30c0)),displayDiffs(_0x531036['agents'],_0x531036['knowledgeBases'],_0x531036[_0x17831f(0x17d)],_0x531036['prompts'],_0x531036[_0x17831f(0x197)]);if(_0x477f50)return console[_0x17831f(0x1a9)](a4_0x1b83d5[_0x17831f(0x13f)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed')),0x0;if(_0x2b7e6b===0x0&&_0x293adc===0x0){console[_0x17831f(0x1a9)](a4_0x1b83d5[_0x17831f(0x152)]('\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date'));const _0xc4f4d6=getLLMProjectUrl(_0x27b3e5,_0x531036[_0x17831f(0x13a)]);return console[_0x17831f(0x1a9)](_0x17831f(0x17b)+a4_0x1b83d5['cyan'](_0xc4f4d6)),0x0;}if(!_0x9980ea&&!_0x276612){if(!isInteractive())return console[_0x17831f(0x149)](a4_0x1b83d5[_0x17831f(0x137)](_0x17831f(0x136)),_0x17831f(0x127)),console[_0x17831f(0x149)](a4_0x1b83d5[_0x17831f(0x1ad)](_0x17831f(0x17c))),0x1;const _0x264fd3=await confirmKey(_0x17831f(0x1a3)+(_0x2b7e6b+_0x293adc)+_0x17831f(0x1b4));if(!_0x264fd3)return console[_0x17831f(0x1a9)](a4_0x1b83d5[_0x17831f(0x13f)]('Cancelled'),_0x17831f(0x1b3)),0x1;}const {data:_0x5e6721}=await withSpinner(_0x17831f(0x135),()=>_0x49eeb5[_0x17831f(0x1b7)][_0x17831f(0x15d)](_0x1b30c0,{'force':_0x276612})),_0xe5f1bc=_0x5e6721[_0x17831f(0x147)][_0x17831f(0x176)][_0x17831f(0x181)]>0x0||_0x5e6721[_0x17831f(0x147)][_0x17831f(0x178)][_0x17831f(0x181)]>0x0||_0x5e6721[_0x17831f(0x147)][_0x17831f(0x17d)][_0x17831f(0x181)]>0x0||_0x5e6721['counts'][_0x17831f(0x146)]['errors']>0x0;if(_0xe5f1bc){console[_0x17831f(0x1a9)](a4_0x1b83d5[_0x17831f(0x13f)](_0x17831f(0x196))),console[_0x17831f(0x1a9)](),console[_0x17831f(0x1a9)](a4_0x1b83d5[_0x17831f(0x137)](_0x17831f(0x12e)));for(const _0x5b0865 of _0x5e6721['agents']){_0x5b0865['action']===_0x17831f(0x149)&&console[_0x17831f(0x1a9)](a4_0x1b83d5[_0x17831f(0x137)]('\x20\x20Agent\x20\x22'+_0x5b0865[_0x17831f(0x138)]+'\x22:\x20'+_0x5b0865[_0x17831f(0x149)]));}for(const _0x38c00c of _0x5e6721[_0x17831f(0x178)]){_0x38c00c['action']===_0x17831f(0x149)&&console[_0x17831f(0x1a9)](a4_0x1b83d5[_0x17831f(0x137)](_0x17831f(0x1c5)+_0x38c00c[_0x17831f(0x19a)]+_0x17831f(0x155)+_0x38c00c[_0x17831f(0x149)]));}for(const _0x149e5d of _0x5e6721['textKnowledgeBases']){_0x149e5d[_0x17831f(0x14c)]===_0x17831f(0x149)&&console['log'](a4_0x1b83d5[_0x17831f(0x137)](_0x17831f(0x195)+_0x149e5d[_0x17831f(0x19a)]+_0x17831f(0x155)+_0x149e5d['error']));}for(const _0x2dc9dc of _0x5e6721[_0x17831f(0x146)]){_0x2dc9dc[_0x17831f(0x14c)]===_0x17831f(0x149)&&console[_0x17831f(0x1a9)](a4_0x1b83d5[_0x17831f(0x137)](_0x17831f(0x159)+_0x2dc9dc[_0x17831f(0x19a)]+_0x17831f(0x155)+_0x2dc9dc[_0x17831f(0x149)]));}for(const _0x268c9a of _0x5e6721['integrations']){_0x268c9a[_0x17831f(0x14c)]===_0x17831f(0x149)&&console[_0x17831f(0x1a9)](a4_0x1b83d5[_0x17831f(0x137)](_0x17831f(0x139)+_0x268c9a[_0x17831f(0x19a)]+_0x17831f(0x155)+_0x268c9a[_0x17831f(0x149)]));}return 0x1;}console[_0x17831f(0x1a9)](a4_0x1b83d5[_0x17831f(0x152)]('\x0a✔\x20Pushed\x20'+(_0x2b7e6b+_0x293adc)+_0x17831f(0x174)+_0x5e6721[_0x17831f(0x166)]+'\x27'));const _0x12eb36=getLLMProjectUrl(_0x27b3e5,_0x5e6721[_0x17831f(0x13a)]);return console[_0x17831f(0x1a9)](_0x17831f(0x17b)+a4_0x1b83d5[_0x17831f(0x129)](_0x12eb36)),0x0;}}
@@ -1 +1 @@
1
- const a5_0x2a0f41=a5_0x321b;(function(_0x40c072,_0x1db74c){const _0x266732=a5_0x321b,_0x12c6a6=_0x40c072();while(!![]){try{const _0x308ba4=-parseInt(_0x266732(0x23d))/0x1+-parseInt(_0x266732(0x209))/0x2+-parseInt(_0x266732(0x235))/0x3*(parseInt(_0x266732(0x263))/0x4)+parseInt(_0x266732(0x266))/0x5*(parseInt(_0x266732(0x271))/0x6)+parseInt(_0x266732(0x213))/0x7+-parseInt(_0x266732(0x26f))/0x8+parseInt(_0x266732(0x236))/0x9;if(_0x308ba4===_0x1db74c)break;else _0x12c6a6['push'](_0x12c6a6['shift']());}catch(_0xb72fd4){_0x12c6a6['push'](_0x12c6a6['shift']());}}}(a5_0x5aaf,0x33bae));import*as a5_0x7bc3f7 from'node:fs';import*as a5_0x1dae45 from'node:path';import a5_0xe253a2 from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';function a5_0x5aaf(){const _0x1834d5=['jsonl','\x20(cached)','text','source','resolveAgentId','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','status','filter','Total:\x20\x20\x20\x20','\x20\x20Round\x20','repeat','Available\x20tags:\x20','white','context','Test\x20Configuration:','push','add','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','green','trim','Failed\x20Tests:','agentName','Run\x20tests\x20for\x20an\x20LLM\x20agent','✗\x20ERROR:\x20Project\x20not\x20found:\x20','toLowerCase','json','cyan','projectName','site','tags','no_tests','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','Running\x20agent\x20tests...','stop','executeReeval','Tests\x20found:\x20','map','No\x20tests\x20found\x20with\x20tags:\x20','llmProject','✗\x20ERROR:\x20','testName','647288woPUpv','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','Failed:\x20\x20\x20','Errors:\x20\x20\x20','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','Error\x20writing\x20output\x20file:\x20','\x20\x20tdx\x20agent\x20test\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20(requires\x20context\x20or\x20tdx.json)','Passed:\x20\x20\x20','\x22,\x20but\x20current\x20site\x20is\x20\x22','1580068wThuTH','\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','found','output','yellow','has','message','name',':\x20Sending\x20user\x20input...','New\x20tests\x20to\x20execute:\x20','some','✗\x20FAIL:\x20','red','Test\x20Summary','Cached\x20run\x20is\x20from\x20site\x20\x22','round','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','tests','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','...','tsv','\x20\x20-\x20','execute','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','conversations','Run\x20\x27tdx\x20agent\x20pull\x20','Test\x20','no_context','eval','Evaluating\x20response...','start','forEach','Running:\x20','489bBweza','3421125dcfxIc','agent:test','testYmlPath','table','\x20-\x20','multiple_agents','Agent:\x20','7197AfSffg','...\x20','FAIL','Duration:\x20','substring','toISOString','find','log','now','agent','\x20\x20Conversation:\x20','\x27\x20to\x20create\x20the\x20folder\x20structure.','Re-evaluation\x20Summary','not\x20found','no_local_folder','No\x20tests\x20found\x20matching:\x20','utf-8','verbose','Running\x20test:\x20','Using\x20agent:\x20','split','dim','\x22:\x20','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','Round\x20','\x20\x20Agent:\x20','projectDir','PASS','Either\x20switch\x20to\x20the\x20\x22','reason','Output\x20written\x20to:\x20','includes','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','ERROR','length','/<agent-name>','Round\x201/','writeFileSync','2996mheAyW','✓\x20PASS:\x20','isSpinning','7575pjIFcS','llm','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','conversation_url','basename','join','Available\x20tests:\x20','rounds','Cached\x20run\x20from:\x20','2085600SBwLrg','test.yml','1266uxLFlF','Re-evaluating\x20','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','dryRun','Site:\x20','\x20\x20Evaluating...\x20','Conversation\x20URL:\x20','existsSync','\x20(new)'];a5_0x5aaf=function(){return _0x1834d5;};return a5_0x5aaf();}import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';function a5_0x321b(_0x4d6a05,_0x2da285){_0x4d6a05=_0x4d6a05-0x1e9;const _0x5aaf53=a5_0x5aaf();let _0x321ba1=_0x5aaf53[_0x4d6a05];return _0x321ba1;}import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x2a0f41(0x21a)]=a5_0x2a0f41(0x237);['description']=a5_0x2a0f41(0x1f6);async[a5_0x2a0f41(0x22a)](_0x6a23e8){const _0x4d0154=a5_0x2a0f41,{options:_0xa66248,args:_0x4a4463,tdx:_0x3383ea}=_0x6a23e8,_0x260f6f=_0x4a4463[0x0]||'.',_0x4918eb=_0xa66248[_0x4d0154(0x274)],_0x2ab866=_0xa66248,_0x63328a=_0x2ab866[_0x4d0154(0x230)]===![],_0x125c7b=_0x2ab866['reeval'],_0xb06a03=_0x2ab866[_0x4d0154(0x21a)],_0x3811ab=_0x2ab866[_0x4d0154(0x1fd)],_0x571dc3=_0xa66248[_0x4d0154(0x1fc)],_0x42b938=_0x2ab866[_0x4d0154(0x216)];if(_0x125c7b&&_0x63328a)return console[_0x4d0154(0x244)](a5_0xe253a2[_0x4d0154(0x21f)](_0x4d0154(0x1ff))),0x1;let _0x5b72f9='table';if(_0x2ab866['json'])_0x5b72f9=_0x4d0154(0x1f9);else{if(_0x2ab866[_0x4d0154(0x27a)])_0x5b72f9=_0x4d0154(0x27a);else{if(_0x2ab866[_0x4d0154(0x228)])_0x5b72f9='tsv';else{if(_0x2ab866[_0x4d0154(0x239)])_0x5b72f9=_0x4d0154(0x239);}}}const _0x4ce14c=_0x2ab866[_0x4d0154(0x206)];let _0x3add74=_0x260f6f;const _0x2f310b=a5_0x7bc3f7[_0x4d0154(0x278)](_0x260f6f),_0x2cb009=_0x260f6f==='.';if(!_0x2f310b||_0x2cb009){const _0x3a633d=resolveProjectFromContext(_0x260f6f,_0x4ce14c,{'requireFile':_0x4d0154(0x270)});if(_0x3a633d[_0x4d0154(0x215)])_0x3add74=_0x3a633d[_0x4d0154(0x257)],_0x3a633d[_0x4d0154(0x27d)]===_0x4d0154(0x1ed)&&console['log'](a5_0xe253a2[_0x4d0154(0x252)](_0x4d0154(0x250)+_0x3add74));else switch(_0x3a633d[_0x4d0154(0x25a)]){case _0x4d0154(0x22f):console[_0x4d0154(0x244)](a5_0xe253a2[_0x4d0154(0x217)](_0x3a633d['message'])),console['log'](),console[_0x4d0154(0x244)]('Usage:'),console['log'](_0x4d0154(0x214)),console[_0x4d0154(0x244)](_0x4d0154(0x210)),console[_0x4d0154(0x244)](),console[_0x4d0154(0x244)]('Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>');return 0x1;case _0x4d0154(0x24b):console[_0x4d0154(0x244)](a5_0xe253a2[_0x4d0154(0x217)](_0x3a633d[_0x4d0154(0x219)])),console[_0x4d0154(0x244)](),console[_0x4d0154(0x244)](_0x4d0154(0x22d)+_0x3a633d[_0x4d0154(0x206)]+_0x4d0154(0x248));return 0x1;case _0x4d0154(0x23b):{const _0x1c8619=a5_0x1dae45[_0x4d0154(0x26a)](_0x3a633d['projectDir']);console[_0x4d0154(0x244)](a5_0xe253a2[_0x4d0154(0x217)](_0x4d0154(0x226)+_0x3a633d[_0x4d0154(0x206)]+'\x22:'));for(const _0xb69950 of _0x3a633d['agentDirs']){console[_0x4d0154(0x244)](_0x4d0154(0x229)+_0xb69950);}return console[_0x4d0154(0x244)](),console['log'](_0x4d0154(0x1f1)+_0x1c8619+_0x4d0154(0x260)),0x1;}case _0x4d0154(0x1fe):console[_0x4d0154(0x244)](a5_0xe253a2['yellow']('No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22'+_0x3a633d[_0x4d0154(0x206)]+'\x22.')),console[_0x4d0154(0x244)](a5_0xe253a2[_0x4d0154(0x252)]('Project\x20path:\x20'+_0x3a633d[_0x4d0154(0x257)])),console[_0x4d0154(0x244)](),console[_0x4d0154(0x244)](_0x4d0154(0x273));return 0x1;}}const {definition:_0x197555,agentInfo:_0x45c262}=parseTestFile(_0x3add74);let _0x344878=_0x197555[_0x4d0154(0x225)];if(_0xb06a03){const _0x2b6960=_0xb06a03[_0x4d0154(0x251)](',')[_0x4d0154(0x204)](_0x3f9316=>_0x3f9316[_0x4d0154(0x1f3)]());_0x344878=_0x197555[_0x4d0154(0x225)][_0x4d0154(0x281)](_0x9d94db=>_0x2b6960[_0x4d0154(0x25c)](_0x9d94db[_0x4d0154(0x21a)]));if(_0x344878[_0x4d0154(0x25f)]===0x0)return console[_0x4d0154(0x244)](a5_0xe253a2[_0x4d0154(0x217)](_0x4d0154(0x24c)+_0xb06a03)),console[_0x4d0154(0x244)](a5_0xe253a2[_0x4d0154(0x252)](_0x4d0154(0x26c)+_0x197555[_0x4d0154(0x225)][_0x4d0154(0x204)](_0x5d8773=>_0x5d8773[_0x4d0154(0x21a)])['join'](',\x20'))),0x1;}if(_0x3811ab){const _0x24dfe8=_0x3811ab[_0x4d0154(0x251)](',')[_0x4d0154(0x204)](_0x26a53b=>_0x26a53b[_0x4d0154(0x1f3)]()[_0x4d0154(0x1f8)]());_0x344878=_0x344878[_0x4d0154(0x281)](_0x157c4f=>_0x157c4f[_0x4d0154(0x1fd)]?.[_0x4d0154(0x21d)](_0x3bf34f=>_0x24dfe8[_0x4d0154(0x25c)](_0x3bf34f[_0x4d0154(0x1f8)]())));if(_0x344878[_0x4d0154(0x25f)]===0x0){console[_0x4d0154(0x244)](a5_0xe253a2[_0x4d0154(0x217)](_0x4d0154(0x205)+_0x3811ab));const _0x1548b8=new Set();return _0x197555[_0x4d0154(0x225)][_0x4d0154(0x233)](_0x33e119=>_0x33e119['tags']?.[_0x4d0154(0x233)](_0x557015=>_0x1548b8[_0x4d0154(0x1f0)](_0x557015))),_0x1548b8['size']>0x0?console['log'](a5_0xe253a2[_0x4d0154(0x252)](_0x4d0154(0x1eb)+[..._0x1548b8][_0x4d0154(0x26b)](',\x20'))):console[_0x4d0154(0x244)](a5_0xe253a2[_0x4d0154(0x252)]('No\x20tests\x20have\x20tags\x20defined.')),0x1;}}if(_0x125c7b)return this[_0x4d0154(0x202)](_0x6a23e8,{'definition':{'tests':_0x344878},'agentInfo':_0x45c262,'outputFormat':_0x5b72f9,'outputFile':_0x42b938,'testNames':_0xb06a03});if(_0x4918eb){console[_0x4d0154(0x244)](a5_0xe253a2[_0x4d0154(0x1fa)](_0x4d0154(0x1ee))),console['log']('\x20\x20Site:\x20'+a5_0xe253a2[_0x4d0154(0x1ec)](_0x571dc3)),console['log']('\x20\x20Project:\x20'+a5_0xe253a2['white'](_0x45c262[_0x4d0154(0x1fb)])),console[_0x4d0154(0x244)](_0x4d0154(0x256)+a5_0xe253a2[_0x4d0154(0x1ec)](_0x45c262[_0x4d0154(0x1f5)])),console[_0x4d0154(0x244)](),console[_0x4d0154(0x244)](_0x4d0154(0x203)+a5_0xe253a2[_0x4d0154(0x1ec)](_0x344878['length']));for(let _0x4215a1=0x0;_0x4215a1<_0x344878['length'];_0x4215a1++){const _0x5e8cf2=_0x344878[_0x4215a1],_0x38501c=_0x5e8cf2[_0x4d0154(0x26d)][_0x4d0154(0x25f)]===0x1?_0x4d0154(0x222):'rounds',_0x5d70c1=_0x5e8cf2[_0x4d0154(0x1fd)]?.[_0x4d0154(0x25f)]?'\x20['+_0x5e8cf2[_0x4d0154(0x1fd)][_0x4d0154(0x26b)](',\x20')+']':'';console[_0x4d0154(0x244)]('\x20\x20'+(_0x4215a1+0x1)+'.\x20'+a5_0xe253a2[_0x4d0154(0x1ec)](_0x5e8cf2[_0x4d0154(0x21a)])+'\x20('+_0x5e8cf2[_0x4d0154(0x26d)]['length']+'\x20'+_0x38501c+')'+a5_0xe253a2[_0x4d0154(0x252)](_0x5d70c1));}return 0x0;}let _0x156816,_0x58596e;try{_0x156816=await _0x3383ea[_0x4d0154(0x267)]['resolveProjectId'](_0x45c262[_0x4d0154(0x1fb)]);}catch(_0x8f2f22){const _0x1428c0=_0x8f2f22 instanceof Error?_0x8f2f22[_0x4d0154(0x219)]:String(_0x8f2f22);return _0x1428c0[_0x4d0154(0x25c)]('404')||_0x1428c0[_0x4d0154(0x1f8)]()[_0x4d0154(0x25c)](_0x4d0154(0x24a))?console[_0x4d0154(0x244)](a5_0xe253a2[_0x4d0154(0x21f)](_0x4d0154(0x1f7)+_0x45c262[_0x4d0154(0x1fb)])):console['log'](a5_0xe253a2[_0x4d0154(0x21f)](_0x4d0154(0x27f)+_0x45c262[_0x4d0154(0x1fb)]+_0x4d0154(0x253)+_0x1428c0)),0x1;}try{_0x58596e=await _0x3383ea['llm'][_0x4d0154(0x27e)](_0x45c262[_0x4d0154(0x1f5)],_0x156816);}catch(_0x15bfa7){const _0x356ec5=_0x15bfa7 instanceof Error?_0x15bfa7['message']:String(_0x15bfa7);return _0x356ec5[_0x4d0154(0x25c)]('404')||_0x356ec5['toLowerCase']()['includes'](_0x4d0154(0x24a))?console[_0x4d0154(0x244)](a5_0xe253a2['red'](_0x4d0154(0x25d)+_0x45c262[_0x4d0154(0x1f5)])):console[_0x4d0154(0x244)](a5_0xe253a2['red'](_0x4d0154(0x223)+_0x45c262[_0x4d0154(0x1f5)]+'\x22:\x20'+_0x356ec5)),0x1;}let _0x52dfec;if(!_0x63328a)try{_0x52dfec=await setupEvaluatorAgent(_0x3383ea[_0x4d0154(0x267)],_0xa66248[_0x4d0154(0x24e)]);}catch(_0x58aff6){const _0x193c5b=_0x58aff6 instanceof Error?_0x58aff6['message']:String(_0x58aff6);return console[_0x4d0154(0x244)](a5_0xe253a2['red'](_0x4d0154(0x22b)+_0x193c5b)),0x1;}console[_0x4d0154(0x244)](a5_0xe253a2['cyan'](_0x4d0154(0x200))),console[_0x4d0154(0x244)](_0x4d0154(0x275)+a5_0xe253a2['white'](_0x571dc3)),console[_0x4d0154(0x244)](_0x4d0154(0x23c)+a5_0xe253a2[_0x4d0154(0x1ec)](_0x45c262['projectName']+'/'+_0x45c262[_0x4d0154(0x1f5)])),console[_0x4d0154(0x244)]();const _0x2d4c51=[],_0x5c5e69=[],_0x22eba4=Date[_0x4d0154(0x245)]();for(let _0x3d023b=0x0;_0x3d023b<_0x344878[_0x4d0154(0x25f)];_0x3d023b++){const _0x594d5b=_0x344878[_0x3d023b];_0x344878[_0x4d0154(0x25f)]>0x1?console[_0x4d0154(0x244)](_0x4d0154(0x22e)+(_0x3d023b+0x1)+'/'+_0x344878[_0x4d0154(0x25f)]+':\x20'+a5_0xe253a2[_0x4d0154(0x1ec)](_0x594d5b[_0x4d0154(0x21a)])):console[_0x4d0154(0x244)](_0x4d0154(0x24f)+a5_0xe253a2['white'](_0x594d5b[_0x4d0154(0x21a)]));const _0x1d163d=createCommandSpinner(_0x4d0154(0x261)+_0x594d5b[_0x4d0154(0x26d)]['length']+_0x4d0154(0x21b));_0x1d163d[_0x4d0154(0x232)]();try{const {result:_0x38cd62,conversation:_0x27d8f9}=await runTest(_0x3383ea['llm'],_0x594d5b,{'agentId':_0x58596e,'projectId':_0x156816,'site':_0x571dc3,'noEval':_0x63328a,'evaluatorId':_0x52dfec,'onRoundStart':(_0x5340df,_0x3e19e3)=>{const _0x239f97=_0x4d0154;_0x1d163d[_0x239f97(0x27c)]='Round\x20'+(_0x5340df+0x1)+'/'+_0x3e19e3+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x46fcf7,_0x4126e3,_0x1db417)=>{const _0x569e3d=_0x4d0154,_0x2c09d6=formatElapsed(_0x4126e3);_0x1db417?console[_0x569e3d(0x244)](_0x569e3d(0x1e9)+(_0x46fcf7+0x1)+'/'+_0x594d5b['rounds'][_0x569e3d(0x25f)]+_0x569e3d(0x23e)+a5_0xe253a2[_0x569e3d(0x1f2)]('✓')+'\x20('+_0x2c09d6+')'):console[_0x569e3d(0x244)](_0x569e3d(0x1e9)+(_0x46fcf7+0x1)+'/'+_0x594d5b['rounds']['length']+_0x569e3d(0x23e)+a5_0xe253a2['red']('✗'));},'onEvaluationStart':()=>{const _0x283a63=_0x4d0154;_0x1d163d['text']=_0x283a63(0x231);},'onEvaluationComplete':_0xc87c45=>{const _0x147be6=_0x4d0154,_0x24d738=formatElapsed(_0xc87c45);console['log'](_0x147be6(0x276)+a5_0xe253a2[_0x147be6(0x1f2)]('✓')+'\x20('+_0x24d738+')');}});_0x1d163d['stop'](),_0x2d4c51[_0x4d0154(0x1ef)](_0x38cd62),_0x5c5e69[_0x4d0154(0x1ef)](_0x27d8f9);if(_0x38cd62[_0x4d0154(0x280)]===_0x4d0154(0x258))console[_0x4d0154(0x244)](a5_0xe253a2[_0x4d0154(0x1f2)]('✓\x20PASS:\x20'+_0x38cd62[_0x4d0154(0x25a)]));else _0x38cd62[_0x4d0154(0x280)]===_0x4d0154(0x23f)?console[_0x4d0154(0x244)](a5_0xe253a2['red'](_0x4d0154(0x21e)+_0x38cd62[_0x4d0154(0x25a)])):console[_0x4d0154(0x244)](a5_0xe253a2[_0x4d0154(0x21f)]('✗\x20ERROR:\x20'+_0x38cd62[_0x4d0154(0x25a)]));_0x38cd62[_0x4d0154(0x269)]&&console['log'](a5_0xe253a2[_0x4d0154(0x252)](_0x4d0154(0x277)+_0x38cd62['conversation_url'])),console[_0x4d0154(0x244)]();}catch(_0x429d96){_0x1d163d[_0x4d0154(0x201)]();const _0x507695=_0x429d96 instanceof Error?_0x429d96[_0x4d0154(0x219)]:String(_0x429d96);console['log'](a5_0xe253a2[_0x4d0154(0x21f)](_0x4d0154(0x207)+_0x507695)),console[_0x4d0154(0x244)](),_0x2d4c51[_0x4d0154(0x1ef)]({'name':_0x594d5b[_0x4d0154(0x21a)],'status':_0x4d0154(0x25e),'reason':_0x507695,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}const _0x8de6f=Date[_0x4d0154(0x245)]()-_0x22eba4,_0x49b934=_0x2d4c51['filter'](_0x269501=>_0x269501[_0x4d0154(0x280)]===_0x4d0154(0x258))[_0x4d0154(0x25f)],_0x267457=_0x2d4c51['filter'](_0x3f6c33=>_0x3f6c33[_0x4d0154(0x280)]==='FAIL')[_0x4d0154(0x25f)],_0x289231=_0x2d4c51[_0x4d0154(0x281)](_0x4fce78=>_0x4fce78[_0x4d0154(0x280)]===_0x4d0154(0x25e))[_0x4d0154(0x25f)];console['log']('━'[_0x4d0154(0x1ea)](0x3c)),console[_0x4d0154(0x244)](_0x4d0154(0x220)),console['log']('━'[_0x4d0154(0x1ea)](0x3c)),console[_0x4d0154(0x244)](_0x4d0154(0x282)+_0x2d4c51[_0x4d0154(0x25f)]),console[_0x4d0154(0x244)](_0x4d0154(0x211)+a5_0xe253a2[_0x4d0154(0x1f2)](_0x49b934)),console[_0x4d0154(0x244)]('Failed:\x20\x20\x20'+a5_0xe253a2[_0x4d0154(0x21f)](_0x267457));_0x289231>0x0&&console[_0x4d0154(0x244)](_0x4d0154(0x20d)+a5_0xe253a2[_0x4d0154(0x21f)](_0x289231));console['log'](_0x4d0154(0x240)+formatElapsed(_0x8de6f)),console[_0x4d0154(0x244)]('━'[_0x4d0154(0x1ea)](0x3c));const _0x57e4de=_0x2d4c51[_0x4d0154(0x281)](_0x2c3363=>_0x2c3363[_0x4d0154(0x280)]!=='PASS');if(_0x57e4de[_0x4d0154(0x25f)]>0x0){console['log'](),console[_0x4d0154(0x244)](_0x4d0154(0x1f4));for(const _0xdb12ba of _0x57e4de){const _0x9a00c=a5_0xe253a2['red']('✗'),_0xb39cc9=_0xdb12ba[_0x4d0154(0x25a)][_0x4d0154(0x25f)]>0x32?_0xdb12ba[_0x4d0154(0x25a)][_0x4d0154(0x241)](0x0,0x32)+_0x4d0154(0x227):_0xdb12ba[_0x4d0154(0x25a)];console[_0x4d0154(0x244)]('\x20\x20'+_0x9a00c+'\x20'+_0xdb12ba[_0x4d0154(0x21a)]+':\x20'+_0xb39cc9);}}const _0x9452b0={'summary':{'total':_0x2d4c51[_0x4d0154(0x25f)],'passed':_0x49b934,'failed':_0x267457,'errors':_0x289231>0x0?_0x289231:undefined,'duration_ms':_0x8de6f},'tests':_0x2d4c51,'agent':{'project':_0x45c262[_0x4d0154(0x1fb)],'name':_0x45c262[_0x4d0154(0x1f5)],'site':_0x571dc3},'timestamp':new Date(_0x22eba4)[_0x4d0154(0x242)]()};try{const _0x264ce5=buildCachedTestRun(_0x5c5e69,{'site':_0x571dc3,'projectId':_0x156816,'projectName':_0x45c262[_0x4d0154(0x1fb)],'agentId':_0x58596e,'agentName':_0x45c262['agentName'],'testYmlPath':a5_0x1dae45['resolve'](_0x45c262[_0x4d0154(0x238)])});saveLastTestRun(_0x264ce5);}catch{}if(_0x5b72f9!==_0x4d0154(0x239)||_0x42b938){const _0x11ecad=formatResults(_0x9452b0,_0x5b72f9);if(_0x42b938)try{a5_0x7bc3f7[_0x4d0154(0x262)](_0x42b938,_0x11ecad,_0x4d0154(0x24d)),console[_0x4d0154(0x244)](),console[_0x4d0154(0x244)](a5_0xe253a2[_0x4d0154(0x252)]('Output\x20written\x20to:\x20'+_0x42b938));}catch(_0x13aa4a){return console[_0x4d0154(0x244)](),console['log'](a5_0xe253a2[_0x4d0154(0x21f)](_0x4d0154(0x20f)+_0x13aa4a)),0x1;}else console[_0x4d0154(0x244)](),console[_0x4d0154(0x244)](_0x11ecad);}return _0x57e4de['length']>0x0?0x1:0x0;}async[a5_0x2a0f41(0x202)](_0x48bfd8,_0x5e41b8){const _0x661d3c=a5_0x2a0f41,{options:_0x4b2c0d,tdx:_0x29d62d}=_0x48bfd8,{definition:_0x1804aa,agentInfo:_0x5882a5,outputFormat:_0x702ed8,outputFile:_0x257889}=_0x5e41b8,_0x247fa8=_0x4b2c0d[_0x661d3c(0x1fc)],_0x54a5c7=loadLastTestRun();if(!_0x54a5c7)return console[_0x661d3c(0x244)](a5_0xe253a2[_0x661d3c(0x21f)]('Error:\x20No\x20previous\x20test\x20run\x20found.')),console['log'](a5_0xe253a2[_0x661d3c(0x252)](_0x661d3c(0x20a))),0x1;if(_0x54a5c7['agent']['agentName']!==_0x5882a5[_0x661d3c(0x1f5)])return console[_0x661d3c(0x244)](a5_0xe253a2[_0x661d3c(0x21f)](_0x661d3c(0x20e)+_0x54a5c7[_0x661d3c(0x246)][_0x661d3c(0x1f5)]+_0x661d3c(0x254)+_0x5882a5[_0x661d3c(0x1f5)]+'\x22.')),console['log'](a5_0xe253a2[_0x661d3c(0x252)]('Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.')),0x1;const _0x2fadd5=new Set(_0x54a5c7[_0x661d3c(0x22c)][_0x661d3c(0x204)](_0x5c73fd=>_0x5c73fd[_0x661d3c(0x208)])),_0x3e9317=_0x1804aa[_0x661d3c(0x225)]['filter'](_0x2996c5=>!_0x2fadd5['has'](_0x2996c5['name']));if(_0x3e9317[_0x661d3c(0x25f)]>0x0&&_0x54a5c7[_0x661d3c(0x1fc)]!==_0x247fa8)return console[_0x661d3c(0x244)](a5_0xe253a2[_0x661d3c(0x21f)](_0x661d3c(0x20b))),console[_0x661d3c(0x244)](a5_0xe253a2[_0x661d3c(0x252)](_0x661d3c(0x221)+_0x54a5c7[_0x661d3c(0x1fc)]+_0x661d3c(0x212)+_0x247fa8+'\x22.')),console[_0x661d3c(0x244)](a5_0xe253a2[_0x661d3c(0x252)](_0x661d3c(0x259)+_0x54a5c7['site']+_0x661d3c(0x268))),0x1;const _0x443c51=_0x1804aa[_0x661d3c(0x225)][_0x661d3c(0x281)](_0x386a4b=>_0x2fadd5[_0x661d3c(0x218)](_0x386a4b[_0x661d3c(0x21a)])),_0x9dbcae=_0x3e9317;let _0x41e5c5;try{_0x41e5c5=await setupEvaluatorAgent(_0x29d62d['llm'],_0x4b2c0d[_0x661d3c(0x24e)]);}catch(_0x58f3db){const _0x14e2e9=_0x58f3db instanceof Error?_0x58f3db[_0x661d3c(0x219)]:String(_0x58f3db);return console[_0x661d3c(0x244)](a5_0xe253a2[_0x661d3c(0x21f)](_0x661d3c(0x22b)+_0x14e2e9)),0x1;}console[_0x661d3c(0x244)](a5_0xe253a2[_0x661d3c(0x1fa)]('Re-evaluating\x20cached\x20test\x20run...')),console[_0x661d3c(0x244)](_0x661d3c(0x26e)+a5_0xe253a2[_0x661d3c(0x1ec)](_0x54a5c7['timestamp'])),console[_0x661d3c(0x244)](_0x661d3c(0x23c)+a5_0xe253a2[_0x661d3c(0x1ec)](_0x54a5c7[_0x661d3c(0x246)]['projectName']+'/'+_0x54a5c7[_0x661d3c(0x246)][_0x661d3c(0x1f5)]));_0x9dbcae[_0x661d3c(0x25f)]>0x0&&console[_0x661d3c(0x244)](_0x661d3c(0x21c)+a5_0xe253a2[_0x661d3c(0x217)](_0x9dbcae[_0x661d3c(0x25f)]));console['log']();const _0x1728a1=[],_0x435cbf=Date[_0x661d3c(0x245)](),_0x2a8efb=createCommandSpinner('Re-evaluating...');if(_0x443c51[_0x661d3c(0x25f)]>0x0)try{const _0x2e7963=await reevaluateFromCache(_0x29d62d[_0x661d3c(0x267)],_0x54a5c7,{'tests':_0x443c51},{'evaluatorId':_0x41e5c5,'onTestStart':(_0x490b0e,_0x42ba50,_0x318017)=>{const _0x57b972=_0x661d3c;_0x2a8efb['text']=_0x57b972(0x272)+(_0x42ba50+0x1)+'/'+_0x318017+':\x20'+_0x490b0e+'...';if(!_0x2a8efb[_0x57b972(0x265)])_0x2a8efb[_0x57b972(0x232)]();},'onTestComplete':(_0x49b3d3,_0x198939)=>{const _0x1128a8=_0x661d3c;_0x2a8efb['stop']();if(_0x198939['status']===_0x1128a8(0x258))console['log'](a5_0xe253a2[_0x1128a8(0x1f2)](_0x1128a8(0x264)+_0x49b3d3)+a5_0xe253a2[_0x1128a8(0x252)](_0x1128a8(0x27b)));else _0x198939[_0x1128a8(0x280)]==='FAIL'?console['log'](a5_0xe253a2[_0x1128a8(0x21f)](_0x1128a8(0x21e)+_0x49b3d3+_0x1128a8(0x23a)+_0x198939[_0x1128a8(0x25a)])+a5_0xe253a2[_0x1128a8(0x252)](_0x1128a8(0x27b))):console['log'](a5_0xe253a2[_0x1128a8(0x21f)](_0x1128a8(0x207)+_0x49b3d3+_0x1128a8(0x23a)+_0x198939[_0x1128a8(0x25a)]));_0x198939[_0x1128a8(0x269)]&&console[_0x1128a8(0x244)](a5_0xe253a2['dim'](_0x1128a8(0x247)+_0x198939['conversation_url'])),_0x1728a1[_0x1128a8(0x1ef)](_0x198939);},'onTestSkipped':(_0x744ed9,_0x58a9d3)=>{const _0x2cb3d3=_0x661d3c;_0x2a8efb[_0x2cb3d3(0x201)](),console[_0x2cb3d3(0x244)](a5_0xe253a2[_0x2cb3d3(0x217)]('⚠\x20SKIPPED:\x20'+_0x744ed9+_0x2cb3d3(0x23a)+_0x58a9d3));}});for(const _0x5f2f48 of _0x2e7963){!_0x1728a1[_0x661d3c(0x243)](_0x1b71dd=>_0x1b71dd[_0x661d3c(0x21a)]===_0x5f2f48[_0x661d3c(0x21a)])&&_0x1728a1['push'](_0x5f2f48);}}catch(_0x21a0bf){_0x2a8efb[_0x661d3c(0x201)]();const _0x45ab2d=_0x21a0bf instanceof Error?_0x21a0bf[_0x661d3c(0x219)]:String(_0x21a0bf);return console[_0x661d3c(0x244)](a5_0xe253a2[_0x661d3c(0x21f)](_0x661d3c(0x224)+_0x45ab2d)),0x1;}_0x2a8efb['stop']();if(_0x9dbcae[_0x661d3c(0x25f)]>0x0){console[_0x661d3c(0x244)](),console[_0x661d3c(0x244)](a5_0xe253a2[_0x661d3c(0x1fa)]('Executing\x20new\x20tests...'));const {projectId:_0x907e4,agentId:_0x415263}=_0x54a5c7[_0x661d3c(0x246)];for(const _0x44df00 of _0x9dbcae){console[_0x661d3c(0x244)](_0x661d3c(0x234)+a5_0xe253a2[_0x661d3c(0x1ec)](_0x44df00[_0x661d3c(0x21a)]));const _0x96f8c8=createCommandSpinner(_0x661d3c(0x261)+_0x44df00[_0x661d3c(0x26d)][_0x661d3c(0x25f)]+_0x661d3c(0x21b));_0x96f8c8['start']();try{const {result:_0x476691}=await runTest(_0x29d62d[_0x661d3c(0x267)],_0x44df00,{'agentId':_0x415263,'projectId':_0x907e4,'site':_0x54a5c7[_0x661d3c(0x1fc)],'noEval':![],'evaluatorId':_0x41e5c5,'onRoundStart':(_0x407865,_0x5f240d)=>{const _0x4cc3b5=_0x661d3c;_0x96f8c8[_0x4cc3b5(0x27c)]=_0x4cc3b5(0x255)+(_0x407865+0x1)+'/'+_0x5f240d+_0x4cc3b5(0x21b);},'onRoundComplete':(_0x4258ac,_0x4da30a,_0x2afb84)=>{const _0x57dcdc=_0x661d3c,_0x3f980f=formatElapsed(_0x4da30a);_0x2afb84?console[_0x57dcdc(0x244)](_0x57dcdc(0x1e9)+(_0x4258ac+0x1)+'/'+_0x44df00[_0x57dcdc(0x26d)][_0x57dcdc(0x25f)]+_0x57dcdc(0x23e)+a5_0xe253a2[_0x57dcdc(0x1f2)]('✓')+'\x20('+_0x3f980f+')'):console['log'](_0x57dcdc(0x1e9)+(_0x4258ac+0x1)+'/'+_0x44df00['rounds'][_0x57dcdc(0x25f)]+_0x57dcdc(0x23e)+a5_0xe253a2['red']('✗'));},'onEvaluationStart':()=>{const _0x21d16c=_0x661d3c;_0x96f8c8['text']=_0x21d16c(0x231);},'onEvaluationComplete':_0x3ba3a8=>{const _0x238980=_0x661d3c,_0x52c5a9=formatElapsed(_0x3ba3a8);console[_0x238980(0x244)]('\x20\x20Evaluating...\x20'+a5_0xe253a2[_0x238980(0x1f2)]('✓')+'\x20('+_0x52c5a9+')');}});_0x96f8c8[_0x661d3c(0x201)](),_0x1728a1[_0x661d3c(0x1ef)](_0x476691);if(_0x476691[_0x661d3c(0x280)]===_0x661d3c(0x258))console['log'](a5_0xe253a2[_0x661d3c(0x1f2)](_0x661d3c(0x264)+_0x476691[_0x661d3c(0x25a)])+a5_0xe253a2['dim'](_0x661d3c(0x279)));else _0x476691[_0x661d3c(0x280)]==='FAIL'?console[_0x661d3c(0x244)](a5_0xe253a2[_0x661d3c(0x21f)](_0x661d3c(0x21e)+_0x476691['reason'])+a5_0xe253a2[_0x661d3c(0x252)](_0x661d3c(0x279))):console['log'](a5_0xe253a2[_0x661d3c(0x21f)](_0x661d3c(0x207)+_0x476691[_0x661d3c(0x25a)]));_0x476691[_0x661d3c(0x269)]&&console[_0x661d3c(0x244)](a5_0xe253a2[_0x661d3c(0x252)](_0x661d3c(0x247)+_0x476691[_0x661d3c(0x269)]));}catch(_0x5424c3){_0x96f8c8[_0x661d3c(0x201)]();const _0x373ba0=_0x5424c3 instanceof Error?_0x5424c3[_0x661d3c(0x219)]:String(_0x5424c3);console[_0x661d3c(0x244)](a5_0xe253a2['red']('✗\x20ERROR:\x20'+_0x373ba0)),_0x1728a1[_0x661d3c(0x1ef)]({'name':_0x44df00[_0x661d3c(0x21a)],'status':_0x661d3c(0x25e),'reason':_0x373ba0,'timestamp':new Date()[_0x661d3c(0x242)](),'duration_ms':0x0});}}}console[_0x661d3c(0x244)]();const _0x23a939=Date['now']()-_0x435cbf,_0x469a85=_0x1728a1['filter'](_0x447291=>_0x447291[_0x661d3c(0x280)]===_0x661d3c(0x258))[_0x661d3c(0x25f)],_0x3b3f31=_0x1728a1[_0x661d3c(0x281)](_0xe39222=>_0xe39222[_0x661d3c(0x280)]===_0x661d3c(0x23f))[_0x661d3c(0x25f)],_0x21ed3f=_0x1728a1[_0x661d3c(0x281)](_0x5b2e05=>_0x5b2e05[_0x661d3c(0x280)]==='ERROR')['length'];console[_0x661d3c(0x244)]('━'['repeat'](0x3c)),console[_0x661d3c(0x244)](_0x661d3c(0x249)),console[_0x661d3c(0x244)]('━'['repeat'](0x3c)),console[_0x661d3c(0x244)](_0x661d3c(0x282)+_0x1728a1[_0x661d3c(0x25f)]),console[_0x661d3c(0x244)]('Passed:\x20\x20\x20'+a5_0xe253a2[_0x661d3c(0x1f2)](_0x469a85)),console[_0x661d3c(0x244)](_0x661d3c(0x20c)+a5_0xe253a2[_0x661d3c(0x21f)](_0x3b3f31));_0x21ed3f>0x0&&console[_0x661d3c(0x244)](_0x661d3c(0x20d)+a5_0xe253a2[_0x661d3c(0x21f)](_0x21ed3f));console['log']('Duration:\x20'+formatElapsed(_0x23a939)),console[_0x661d3c(0x244)]('━'[_0x661d3c(0x1ea)](0x3c));const _0x21c22c={'summary':{'total':_0x1728a1[_0x661d3c(0x25f)],'passed':_0x469a85,'failed':_0x3b3f31,'errors':_0x21ed3f>0x0?_0x21ed3f:undefined,'duration_ms':_0x23a939},'tests':_0x1728a1,'agent':{'project':_0x5882a5[_0x661d3c(0x1fb)],'name':_0x5882a5[_0x661d3c(0x1f5)],'site':_0x247fa8},'timestamp':new Date(_0x435cbf)[_0x661d3c(0x242)]()};if(_0x702ed8!=='table'||_0x257889){const _0x2c1ef2=formatResults(_0x21c22c,_0x702ed8);if(_0x257889)try{a5_0x7bc3f7[_0x661d3c(0x262)](_0x257889,_0x2c1ef2,_0x661d3c(0x24d)),console[_0x661d3c(0x244)](),console['log'](a5_0xe253a2['dim'](_0x661d3c(0x25b)+_0x257889));}catch(_0x428cf0){return console[_0x661d3c(0x244)](),console['log'](a5_0xe253a2['red'](_0x661d3c(0x20f)+_0x428cf0)),0x1;}else console[_0x661d3c(0x244)](),console[_0x661d3c(0x244)](_0x2c1ef2);}const _0x7a5e06=_0x1728a1[_0x661d3c(0x281)](_0x263ac2=>_0x263ac2[_0x661d3c(0x280)]!==_0x661d3c(0x258));return _0x7a5e06[_0x661d3c(0x25f)]>0x0?0x1:0x0;}}
1
+ const a5_0x5d56ab=a5_0x48ac;(function(_0x1bbba3,_0x427c09){const _0x823ed1=a5_0x48ac,_0x139f40=_0x1bbba3();while(!![]){try{const _0x5a04d5=-parseInt(_0x823ed1(0x100))/0x1+parseInt(_0x823ed1(0xbc))/0x2+parseInt(_0x823ed1(0x98))/0x3+parseInt(_0x823ed1(0x6d))/0x4*(parseInt(_0x823ed1(0xcb))/0x5)+-parseInt(_0x823ed1(0xbb))/0x6+parseInt(_0x823ed1(0xf3))/0x7*(-parseInt(_0x823ed1(0xe0))/0x8)+-parseInt(_0x823ed1(0x9c))/0x9*(-parseInt(_0x823ed1(0x73))/0xa);if(_0x5a04d5===_0x427c09)break;else _0x139f40['push'](_0x139f40['shift']());}catch(_0x2ec1e6){_0x139f40['push'](_0x139f40['shift']());}}}(a5_0x8166,0xa9064));import*as a5_0x5e8169 from'node:fs';function a5_0x8166(){const _0x3b6f0a=['map','✗\x20FAIL:\x20','\x20(new)','Test\x20','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','FAIL','utf-8','\x20\x20Project:\x20','log','tags','Round\x201/','red','6735904AyPyMO','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','\x22:\x20','push','Running\x20test:\x20','tsv','agentDirs','✗\x20ERROR:\x20Project\x20not\x20found:\x20','...\x20','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','white','projectDir','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','519812nSmohU','filter','\x20\x20Evaluating...\x20','Test\x20Configuration:','318468hkyutY','Duration:\x20','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','isSpinning','Total:\x20\x20\x20\x20','timestamp','340vRMcCW','Usage:','resolve','Re-evaluating\x20','No\x20tests\x20found\x20with\x20tags:\x20','jsonl','some','multiple_agents','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','agentName','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','cyan','has','repeat',':\x20Sending\x20user\x20input...','Re-evaluation\x20Summary','\x20\x20Round\x20','llmProject','projectName','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','Test\x20Summary','Agent:\x20','✗\x20ERROR:\x20','trim','...','rounds','text','green','executeReeval','eval','join','Running\x20agent\x20tests...','json','dim','resolveAgentId','now','4011459XuPhhF','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','reason','Output\x20written\x20to:\x20','42489DclSgL','\x20\x20Site:\x20','Project\x20path:\x20','message','conversation_url','Error\x20writing\x20output\x20file:\x20','\x22,\x20but\x20current\x20site\x20is\x20\x22','includes','status','Errors:\x20\x20\x20','Available\x20tags:\x20','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','agent:test','Available\x20tests:\x20','Round\x20','\x20\x20Agent:\x20','⚠\x20SKIPPED:\x20','verbose','execute','no_context','\x20\x20-\x20','source','Tests\x20found:\x20','description','Evaluating\x20response...','Run\x20\x27tdx\x20agent\x20pull\x20','testYmlPath','not\x20found','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','\x20\x20Conversation:\x20','find','6476934cZGaOr','2079354EzDHaW','site','Re-evaluating...','No\x20tests\x20found\x20matching:\x20','llm','conversations','forEach','Either\x20switch\x20to\x20the\x20\x22','length','yellow','resolveProjectId','start','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','test.yml','split','45rMxOiz','tests','writeFileSync','stop','ERROR','reeval','agent','/<agent-name>','add','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','found','output','404','✓\x20PASS:\x20','Failed:\x20\x20\x20','name','no_local_folder','Run\x20tests\x20for\x20an\x20LLM\x20agent','Site:\x20','toLowerCase','\x20-\x20','8HKtMjZ','context','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','toISOString','table','PASS','round'];a5_0x8166=function(){return _0x3b6f0a;};return a5_0x8166();}import*as a5_0x24f176 from'node:path';import a5_0x3a9a3b from'chalk';import{BaseCommand}from'./command.js';function a5_0x48ac(_0x1ebbd5,_0x3206cf){_0x1ebbd5=_0x1ebbd5-0x6b;const _0x8166b5=a5_0x8166();let _0x48ac07=_0x8166b5[_0x1ebbd5];return _0x48ac07;}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_0x5d56ab(0xda)]=a5_0x5d56ab(0xa8);[a5_0x5d56ab(0xb3)]=a5_0x5d56ab(0xdc);async[a5_0x5d56ab(0xae)](_0x52bdad){const _0x36d18d=a5_0x5d56ab,{options:_0x5efbf1,args:_0xe7479b,tdx:_0x9f25e8}=_0x52bdad,_0x586a62=_0xe7479b[0x0]||'.',_0x578116=_0x5efbf1['dryRun'],_0x5dda2c=_0x5efbf1,_0x28d95e=_0x5dda2c[_0x36d18d(0x91)]===![],_0x20aff4=_0x5dda2c[_0x36d18d(0xd0)],_0x1c328b=_0x5dda2c[_0x36d18d(0xda)],_0x35be96=_0x5dda2c[_0x36d18d(0xf0)],_0x5f2131=_0x5efbf1[_0x36d18d(0xbd)],_0x2e706c=_0x5dda2c[_0x36d18d(0xd6)];if(_0x20aff4&&_0x28d95e)return console['log'](a5_0x3a9a3b[_0x36d18d(0xf2)](_0x36d18d(0xeb))),0x1;let _0x53f591=_0x36d18d(0xe4);if(_0x5dda2c[_0x36d18d(0x94)])_0x53f591=_0x36d18d(0x94);else{if(_0x5dda2c[_0x36d18d(0x78)])_0x53f591=_0x36d18d(0x78);else{if(_0x5dda2c['tsv'])_0x53f591=_0x36d18d(0xf8);else{if(_0x5dda2c['table'])_0x53f591=_0x36d18d(0xe4);}}}const _0x2e4138=_0x5dda2c[_0x36d18d(0x85)];let _0x18535c=_0x586a62;const _0x40253c=a5_0x5e8169['existsSync'](_0x586a62),_0x4231c9=_0x586a62==='.';if(!_0x40253c||_0x4231c9){const _0x3dade7=resolveProjectFromContext(_0x586a62,_0x2e4138,{'requireFile':_0x36d18d(0xc9)});if(_0x3dade7[_0x36d18d(0xd5)])_0x18535c=_0x3dade7[_0x36d18d(0xfe)],_0x3dade7[_0x36d18d(0xb1)]===_0x36d18d(0xe1)&&console[_0x36d18d(0xef)](a5_0x3a9a3b[_0x36d18d(0x95)]('Using\x20agent:\x20'+_0x18535c));else switch(_0x3dade7['reason']){case _0x36d18d(0xaf):console[_0x36d18d(0xef)](a5_0x3a9a3b[_0x36d18d(0xc5)](_0x3dade7[_0x36d18d(0x9f)])),console[_0x36d18d(0xef)](),console[_0x36d18d(0xef)](_0x36d18d(0x74)),console[_0x36d18d(0xef)]('\x20\x20tdx\x20agent\x20test\x20<path>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20from\x20path'),console['log']('\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[_0x36d18d(0xef)](),console['log'](_0x36d18d(0xe2));return 0x1;case _0x36d18d(0xdb):console[_0x36d18d(0xef)](a5_0x3a9a3b[_0x36d18d(0xc5)](_0x3dade7[_0x36d18d(0x9f)])),console[_0x36d18d(0xef)](),console[_0x36d18d(0xef)](_0x36d18d(0xb5)+_0x3dade7[_0x36d18d(0x85)]+'\x27\x20to\x20create\x20the\x20folder\x20structure.');return 0x1;case _0x36d18d(0x7a):{const _0x1f7224=a5_0x24f176['basename'](_0x3dade7['projectDir']);console[_0x36d18d(0xef)](a5_0x3a9a3b[_0x36d18d(0xc5)](_0x36d18d(0x7b)+_0x3dade7[_0x36d18d(0x85)]+'\x22:'));for(const _0x59a636 of _0x3dade7[_0x36d18d(0xf9)]){console['log'](_0x36d18d(0xb0)+_0x59a636);}return console[_0x36d18d(0xef)](),console[_0x36d18d(0xef)](_0x36d18d(0x99)+_0x1f7224+_0x36d18d(0xd2)),0x1;}case'no_tests':console[_0x36d18d(0xef)](a5_0x3a9a3b[_0x36d18d(0xc5)](_0x36d18d(0x87)+_0x3dade7[_0x36d18d(0x85)]+'\x22.')),console[_0x36d18d(0xef)](a5_0x3a9a3b[_0x36d18d(0x95)](_0x36d18d(0x9e)+_0x3dade7[_0x36d18d(0xfe)])),console[_0x36d18d(0xef)](),console[_0x36d18d(0xef)](_0x36d18d(0xb8));return 0x1;}}const {definition:_0xc7289b,agentInfo:_0x4b5fe4}=parseTestFile(_0x18535c);let _0x486166=_0xc7289b[_0x36d18d(0xcc)];if(_0x1c328b){const _0x222a34=_0x1c328b[_0x36d18d(0xca)](',')['map'](_0x2e946c=>_0x2e946c['trim']());_0x486166=_0xc7289b[_0x36d18d(0xcc)]['filter'](_0x2b7536=>_0x222a34[_0x36d18d(0xa3)](_0x2b7536['name']));if(_0x486166[_0x36d18d(0xc4)]===0x0)return console[_0x36d18d(0xef)](a5_0x3a9a3b[_0x36d18d(0xc5)](_0x36d18d(0xbf)+_0x1c328b)),console[_0x36d18d(0xef)](a5_0x3a9a3b[_0x36d18d(0x95)](_0x36d18d(0xa9)+_0xc7289b[_0x36d18d(0xcc)][_0x36d18d(0xe7)](_0x19f0f2=>_0x19f0f2['name'])[_0x36d18d(0x92)](',\x20'))),0x1;}if(_0x35be96){const _0x514e78=_0x35be96['split'](',')[_0x36d18d(0xe7)](_0x561bf5=>_0x561bf5[_0x36d18d(0x8b)]()[_0x36d18d(0xde)]());_0x486166=_0x486166['filter'](_0x2d33cc=>_0x2d33cc[_0x36d18d(0xf0)]?.[_0x36d18d(0x79)](_0x3027a8=>_0x514e78['includes'](_0x3027a8['toLowerCase']())));if(_0x486166[_0x36d18d(0xc4)]===0x0){console[_0x36d18d(0xef)](a5_0x3a9a3b[_0x36d18d(0xc5)](_0x36d18d(0x77)+_0x35be96));const _0x1ca491=new Set();return _0xc7289b['tests']['forEach'](_0x498d53=>_0x498d53['tags']?.[_0x36d18d(0xc2)](_0x5889d0=>_0x1ca491[_0x36d18d(0xd3)](_0x5889d0))),_0x1ca491['size']>0x0?console['log'](a5_0x3a9a3b['dim'](_0x36d18d(0xa6)+[..._0x1ca491]['join'](',\x20'))):console[_0x36d18d(0xef)](a5_0x3a9a3b[_0x36d18d(0x95)]('No\x20tests\x20have\x20tags\x20defined.')),0x1;}}if(_0x20aff4)return this[_0x36d18d(0x90)](_0x52bdad,{'definition':{'tests':_0x486166},'agentInfo':_0x4b5fe4,'outputFormat':_0x53f591,'outputFile':_0x2e706c,'testNames':_0x1c328b});if(_0x578116){console[_0x36d18d(0xef)](a5_0x3a9a3b[_0x36d18d(0x7f)](_0x36d18d(0x6c))),console[_0x36d18d(0xef)](_0x36d18d(0x9d)+a5_0x3a9a3b[_0x36d18d(0xfd)](_0x5f2131)),console[_0x36d18d(0xef)](_0x36d18d(0xee)+a5_0x3a9a3b[_0x36d18d(0xfd)](_0x4b5fe4['projectName'])),console['log'](_0x36d18d(0xab)+a5_0x3a9a3b[_0x36d18d(0xfd)](_0x4b5fe4['agentName'])),console['log'](),console['log'](_0x36d18d(0xb2)+a5_0x3a9a3b[_0x36d18d(0xfd)](_0x486166[_0x36d18d(0xc4)]));for(let _0xa79795=0x0;_0xa79795<_0x486166[_0x36d18d(0xc4)];_0xa79795++){const _0x1b2ac0=_0x486166[_0xa79795],_0x55234d=_0x1b2ac0[_0x36d18d(0x8d)]['length']===0x1?_0x36d18d(0xe6):_0x36d18d(0x8d),_0x41d13e=_0x1b2ac0[_0x36d18d(0xf0)]?.[_0x36d18d(0xc4)]?'\x20['+_0x1b2ac0[_0x36d18d(0xf0)][_0x36d18d(0x92)](',\x20')+']':'';console[_0x36d18d(0xef)]('\x20\x20'+(_0xa79795+0x1)+'.\x20'+a5_0x3a9a3b['white'](_0x1b2ac0['name'])+'\x20('+_0x1b2ac0['rounds']['length']+'\x20'+_0x55234d+')'+a5_0x3a9a3b['dim'](_0x41d13e));}return 0x0;}let _0x382d7c,_0x1ec3d;try{_0x382d7c=await _0x9f25e8[_0x36d18d(0xc0)][_0x36d18d(0xc6)](_0x4b5fe4['projectName']);}catch(_0x53b11a){const _0x51d269=_0x53b11a instanceof Error?_0x53b11a[_0x36d18d(0x9f)]:String(_0x53b11a);return _0x51d269[_0x36d18d(0xa3)](_0x36d18d(0xd7))||_0x51d269[_0x36d18d(0xde)]()[_0x36d18d(0xa3)](_0x36d18d(0xb7))?console['log'](a5_0x3a9a3b['red'](_0x36d18d(0xfa)+_0x4b5fe4[_0x36d18d(0x86)])):console['log'](a5_0x3a9a3b[_0x36d18d(0xf2)](_0x36d18d(0xf4)+_0x4b5fe4[_0x36d18d(0x86)]+_0x36d18d(0xf5)+_0x51d269)),0x1;}try{_0x1ec3d=await _0x9f25e8['llm'][_0x36d18d(0x96)](_0x4b5fe4[_0x36d18d(0x7d)],_0x382d7c);}catch(_0x583c88){const _0x2912a7=_0x583c88 instanceof Error?_0x583c88['message']:String(_0x583c88);return _0x2912a7['includes'](_0x36d18d(0xd7))||_0x2912a7['toLowerCase']()[_0x36d18d(0xa3)](_0x36d18d(0xb7))?console['log'](a5_0x3a9a3b[_0x36d18d(0xf2)](_0x36d18d(0x7c)+_0x4b5fe4[_0x36d18d(0x7d)])):console[_0x36d18d(0xef)](a5_0x3a9a3b[_0x36d18d(0xf2)](_0x36d18d(0xff)+_0x4b5fe4[_0x36d18d(0x7d)]+_0x36d18d(0xf5)+_0x2912a7)),0x1;}let _0x30af6a;if(!_0x28d95e)try{_0x30af6a=await setupEvaluatorAgent(_0x9f25e8[_0x36d18d(0xc0)],_0x5efbf1['verbose']);}catch(_0x124220){const _0xe9dab6=_0x124220 instanceof Error?_0x124220[_0x36d18d(0x9f)]:String(_0x124220);return console[_0x36d18d(0xef)](a5_0x3a9a3b['red'](_0x36d18d(0xd4)+_0xe9dab6)),0x1;}console[_0x36d18d(0xef)](a5_0x3a9a3b[_0x36d18d(0x7f)](_0x36d18d(0x93))),console[_0x36d18d(0xef)](_0x36d18d(0xdd)+a5_0x3a9a3b[_0x36d18d(0xfd)](_0x5f2131)),console['log'](_0x36d18d(0x89)+a5_0x3a9a3b['white'](_0x4b5fe4[_0x36d18d(0x86)]+'/'+_0x4b5fe4[_0x36d18d(0x7d)])),console['log']();const _0x1f12f4=[],_0x105962=[],_0x412b68=Date[_0x36d18d(0x97)]();for(let _0x27f7a9=0x0;_0x27f7a9<_0x486166[_0x36d18d(0xc4)];_0x27f7a9++){const _0x2dba0b=_0x486166[_0x27f7a9];_0x486166[_0x36d18d(0xc4)]>0x1?console[_0x36d18d(0xef)](_0x36d18d(0xea)+(_0x27f7a9+0x1)+'/'+_0x486166[_0x36d18d(0xc4)]+':\x20'+a5_0x3a9a3b[_0x36d18d(0xfd)](_0x2dba0b['name'])):console[_0x36d18d(0xef)](_0x36d18d(0xf7)+a5_0x3a9a3b[_0x36d18d(0xfd)](_0x2dba0b['name']));const _0x5a09a3=createCommandSpinner('Round\x201/'+_0x2dba0b[_0x36d18d(0x8d)][_0x36d18d(0xc4)]+_0x36d18d(0x82));_0x5a09a3[_0x36d18d(0xc7)]();try{const {result:_0x47996b,conversation:_0x3d0e82}=await runTest(_0x9f25e8['llm'],_0x2dba0b,{'agentId':_0x1ec3d,'projectId':_0x382d7c,'site':_0x5f2131,'noEval':_0x28d95e,'evaluatorId':_0x30af6a,'onRoundStart':(_0x295be3,_0xb3003c)=>{const _0x43c1bb=_0x36d18d;_0x5a09a3[_0x43c1bb(0x8e)]=_0x43c1bb(0xaa)+(_0x295be3+0x1)+'/'+_0xb3003c+_0x43c1bb(0x82);},'onRoundComplete':(_0xd20be1,_0x5ab8cb,_0x11cb95)=>{const _0x12e875=_0x36d18d,_0x1f8aa8=formatElapsed(_0x5ab8cb);_0x11cb95?console[_0x12e875(0xef)]('\x20\x20Round\x20'+(_0xd20be1+0x1)+'/'+_0x2dba0b[_0x12e875(0x8d)][_0x12e875(0xc4)]+_0x12e875(0xfb)+a5_0x3a9a3b[_0x12e875(0x8f)]('✓')+'\x20('+_0x1f8aa8+')'):console[_0x12e875(0xef)]('\x20\x20Round\x20'+(_0xd20be1+0x1)+'/'+_0x2dba0b[_0x12e875(0x8d)]['length']+_0x12e875(0xfb)+a5_0x3a9a3b['red']('✗'));},'onEvaluationStart':()=>{const _0x483574=_0x36d18d;_0x5a09a3[_0x483574(0x8e)]=_0x483574(0xb4);},'onEvaluationComplete':_0x4c6cbb=>{const _0x4b3cc1=_0x36d18d,_0x2cb763=formatElapsed(_0x4c6cbb);console['log'](_0x4b3cc1(0x6b)+a5_0x3a9a3b[_0x4b3cc1(0x8f)]('✓')+'\x20('+_0x2cb763+')');}});_0x5a09a3['stop'](),_0x1f12f4['push'](_0x47996b),_0x105962['push'](_0x3d0e82);if(_0x47996b['status']==='PASS')console[_0x36d18d(0xef)](a5_0x3a9a3b[_0x36d18d(0x8f)](_0x36d18d(0xd8)+_0x47996b[_0x36d18d(0x9a)]));else _0x47996b[_0x36d18d(0xa4)]===_0x36d18d(0xec)?console['log'](a5_0x3a9a3b[_0x36d18d(0xf2)](_0x36d18d(0xe8)+_0x47996b['reason'])):console[_0x36d18d(0xef)](a5_0x3a9a3b[_0x36d18d(0xf2)]('✗\x20ERROR:\x20'+_0x47996b[_0x36d18d(0x9a)]));_0x47996b[_0x36d18d(0xa0)]&&console[_0x36d18d(0xef)](a5_0x3a9a3b[_0x36d18d(0x95)]('Conversation\x20URL:\x20'+_0x47996b[_0x36d18d(0xa0)])),console[_0x36d18d(0xef)]();}catch(_0x4ad98c){_0x5a09a3[_0x36d18d(0xce)]();const _0x484d43=_0x4ad98c instanceof Error?_0x4ad98c['message']:String(_0x4ad98c);console[_0x36d18d(0xef)](a5_0x3a9a3b[_0x36d18d(0xf2)](_0x36d18d(0x8a)+_0x484d43)),console['log'](),_0x1f12f4[_0x36d18d(0xf6)]({'name':_0x2dba0b['name'],'status':'ERROR','reason':_0x484d43,'timestamp':new Date()[_0x36d18d(0xe3)](),'duration_ms':0x0});}}const _0x26eb7f=Date['now']()-_0x412b68,_0x38069e=_0x1f12f4[_0x36d18d(0x101)](_0x20df24=>_0x20df24[_0x36d18d(0xa4)]===_0x36d18d(0xe5))[_0x36d18d(0xc4)],_0x2378e8=_0x1f12f4[_0x36d18d(0x101)](_0x579e19=>_0x579e19[_0x36d18d(0xa4)]===_0x36d18d(0xec))[_0x36d18d(0xc4)],_0x1a6370=_0x1f12f4['filter'](_0x223a61=>_0x223a61[_0x36d18d(0xa4)]===_0x36d18d(0xcf))[_0x36d18d(0xc4)];console[_0x36d18d(0xef)]('━'['repeat'](0x3c)),console['log'](_0x36d18d(0x88)),console[_0x36d18d(0xef)]('━'['repeat'](0x3c)),console[_0x36d18d(0xef)](_0x36d18d(0x71)+_0x1f12f4['length']),console[_0x36d18d(0xef)]('Passed:\x20\x20\x20'+a5_0x3a9a3b[_0x36d18d(0x8f)](_0x38069e)),console['log'](_0x36d18d(0xd9)+a5_0x3a9a3b[_0x36d18d(0xf2)](_0x2378e8));_0x1a6370>0x0&&console[_0x36d18d(0xef)](_0x36d18d(0xa5)+a5_0x3a9a3b[_0x36d18d(0xf2)](_0x1a6370));console[_0x36d18d(0xef)]('Duration:\x20'+formatElapsed(_0x26eb7f)),console['log']('━'['repeat'](0x3c));const _0x6f8270=_0x1f12f4[_0x36d18d(0x101)](_0x1c5721=>_0x1c5721[_0x36d18d(0xa4)]!=='PASS');if(_0x6f8270[_0x36d18d(0xc4)]>0x0){console[_0x36d18d(0xef)](),console[_0x36d18d(0xef)]('Failed\x20Tests:');for(const _0x541d22 of _0x6f8270){const _0x4b00b3=a5_0x3a9a3b[_0x36d18d(0xf2)]('✗'),_0x44e118=_0x541d22[_0x36d18d(0x9a)][_0x36d18d(0xc4)]>0x32?_0x541d22[_0x36d18d(0x9a)]['substring'](0x0,0x32)+_0x36d18d(0x8c):_0x541d22[_0x36d18d(0x9a)];console[_0x36d18d(0xef)]('\x20\x20'+_0x4b00b3+'\x20'+_0x541d22[_0x36d18d(0xda)]+':\x20'+_0x44e118);}}const _0x3458b9={'summary':{'total':_0x1f12f4[_0x36d18d(0xc4)],'passed':_0x38069e,'failed':_0x2378e8,'errors':_0x1a6370>0x0?_0x1a6370:undefined,'duration_ms':_0x26eb7f},'tests':_0x1f12f4,'agent':{'project':_0x4b5fe4[_0x36d18d(0x86)],'name':_0x4b5fe4['agentName'],'site':_0x5f2131},'timestamp':new Date(_0x412b68)[_0x36d18d(0xe3)]()};try{const _0x5cc143=buildCachedTestRun(_0x105962,{'site':_0x5f2131,'projectId':_0x382d7c,'projectName':_0x4b5fe4[_0x36d18d(0x86)],'agentId':_0x1ec3d,'agentName':_0x4b5fe4[_0x36d18d(0x7d)],'testYmlPath':a5_0x24f176[_0x36d18d(0x75)](_0x4b5fe4[_0x36d18d(0xb6)])});saveLastTestRun(_0x5cc143);}catch{}if(_0x53f591!==_0x36d18d(0xe4)||_0x2e706c){const _0xb80559=formatResults(_0x3458b9,_0x53f591);if(_0x2e706c)try{a5_0x5e8169[_0x36d18d(0xcd)](_0x2e706c,_0xb80559,_0x36d18d(0xed)),console[_0x36d18d(0xef)](),console[_0x36d18d(0xef)](a5_0x3a9a3b[_0x36d18d(0x95)]('Output\x20written\x20to:\x20'+_0x2e706c));}catch(_0xf57a40){return console['log'](),console[_0x36d18d(0xef)](a5_0x3a9a3b[_0x36d18d(0xf2)](_0x36d18d(0xa1)+_0xf57a40)),0x1;}else console[_0x36d18d(0xef)](),console[_0x36d18d(0xef)](_0xb80559);}return _0x6f8270[_0x36d18d(0xc4)]>0x0?0x1:0x0;}async[a5_0x5d56ab(0x90)](_0x4f80be,_0x19db03){const _0x3f75c2=a5_0x5d56ab,{options:_0x71ca94,tdx:_0xe1d023}=_0x4f80be,{definition:_0x1a0c91,agentInfo:_0x4e62f0,outputFormat:_0x4a78e0,outputFile:_0x1f8581}=_0x19db03,_0x11778e=_0x71ca94[_0x3f75c2(0xbd)],_0xa62630=loadLastTestRun();if(!_0xa62630)return console['log'](a5_0x3a9a3b['red']('Error:\x20No\x20previous\x20test\x20run\x20found.')),console[_0x3f75c2(0xef)](a5_0x3a9a3b[_0x3f75c2(0x95)]('Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.')),0x1;if(_0xa62630[_0x3f75c2(0xd1)][_0x3f75c2(0x7d)]!==_0x4e62f0['agentName'])return console[_0x3f75c2(0xef)](a5_0x3a9a3b['red'](_0x3f75c2(0x7e)+_0xa62630['agent'][_0x3f75c2(0x7d)]+'\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22'+_0x4e62f0[_0x3f75c2(0x7d)]+'\x22.')),console[_0x3f75c2(0xef)](a5_0x3a9a3b[_0x3f75c2(0x95)](_0x3f75c2(0xfc))),0x1;const _0x4604ab=new Set(_0xa62630[_0x3f75c2(0xc1)][_0x3f75c2(0xe7)](_0x310a6e=>_0x310a6e['testName'])),_0x49c9eb=_0x1a0c91[_0x3f75c2(0xcc)]['filter'](_0x2c42d4=>!_0x4604ab['has'](_0x2c42d4[_0x3f75c2(0xda)]));if(_0x49c9eb['length']>0x0&&_0xa62630['site']!==_0x11778e)return console[_0x3f75c2(0xef)](a5_0x3a9a3b['red'](_0x3f75c2(0x6f))),console['log'](a5_0x3a9a3b[_0x3f75c2(0x95)]('Cached\x20run\x20is\x20from\x20site\x20\x22'+_0xa62630['site']+_0x3f75c2(0xa2)+_0x11778e+'\x22.')),console['log'](a5_0x3a9a3b[_0x3f75c2(0x95)](_0x3f75c2(0xc3)+_0xa62630[_0x3f75c2(0xbd)]+_0x3f75c2(0xa7))),0x1;const _0x60695a=_0x1a0c91[_0x3f75c2(0xcc)][_0x3f75c2(0x101)](_0x2acb12=>_0x4604ab[_0x3f75c2(0x80)](_0x2acb12['name'])),_0x346b12=_0x49c9eb;let _0x3fa731;try{_0x3fa731=await setupEvaluatorAgent(_0xe1d023[_0x3f75c2(0xc0)],_0x71ca94[_0x3f75c2(0xad)]);}catch(_0x5d52f8){const _0xaceb8b=_0x5d52f8 instanceof Error?_0x5d52f8[_0x3f75c2(0x9f)]:String(_0x5d52f8);return console[_0x3f75c2(0xef)](a5_0x3a9a3b[_0x3f75c2(0xf2)]('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0xaceb8b)),0x1;}console[_0x3f75c2(0xef)](a5_0x3a9a3b[_0x3f75c2(0x7f)]('Re-evaluating\x20cached\x20test\x20run...')),console['log']('Cached\x20run\x20from:\x20'+a5_0x3a9a3b[_0x3f75c2(0xfd)](_0xa62630[_0x3f75c2(0x72)])),console[_0x3f75c2(0xef)](_0x3f75c2(0x89)+a5_0x3a9a3b['white'](_0xa62630[_0x3f75c2(0xd1)][_0x3f75c2(0x86)]+'/'+_0xa62630[_0x3f75c2(0xd1)][_0x3f75c2(0x7d)]));_0x346b12['length']>0x0&&console['log']('New\x20tests\x20to\x20execute:\x20'+a5_0x3a9a3b[_0x3f75c2(0xc5)](_0x346b12[_0x3f75c2(0xc4)]));console['log']();const _0xa75041=[],_0x564ef5=Date[_0x3f75c2(0x97)](),_0x9182f9=createCommandSpinner(_0x3f75c2(0xbe));if(_0x60695a['length']>0x0)try{const _0x3d7552=await reevaluateFromCache(_0xe1d023['llm'],_0xa62630,{'tests':_0x60695a},{'evaluatorId':_0x3fa731,'onTestStart':(_0x1ce7c0,_0x4c525b,_0x41bb8d)=>{const _0x22fe8c=_0x3f75c2;_0x9182f9[_0x22fe8c(0x8e)]=_0x22fe8c(0x76)+(_0x4c525b+0x1)+'/'+_0x41bb8d+':\x20'+_0x1ce7c0+_0x22fe8c(0x8c);if(!_0x9182f9[_0x22fe8c(0x70)])_0x9182f9[_0x22fe8c(0xc7)]();},'onTestComplete':(_0x4f1b3c,_0x367fd0)=>{const _0x251683=_0x3f75c2;_0x9182f9['stop']();if(_0x367fd0[_0x251683(0xa4)]===_0x251683(0xe5))console[_0x251683(0xef)](a5_0x3a9a3b[_0x251683(0x8f)]('✓\x20PASS:\x20'+_0x4f1b3c)+a5_0x3a9a3b[_0x251683(0x95)]('\x20(cached)'));else _0x367fd0['status']===_0x251683(0xec)?console['log'](a5_0x3a9a3b[_0x251683(0xf2)](_0x251683(0xe8)+_0x4f1b3c+_0x251683(0xdf)+_0x367fd0[_0x251683(0x9a)])+a5_0x3a9a3b[_0x251683(0x95)]('\x20(cached)')):console[_0x251683(0xef)](a5_0x3a9a3b[_0x251683(0xf2)](_0x251683(0x8a)+_0x4f1b3c+_0x251683(0xdf)+_0x367fd0['reason']));_0x367fd0[_0x251683(0xa0)]&&console[_0x251683(0xef)](a5_0x3a9a3b[_0x251683(0x95)](_0x251683(0xb9)+_0x367fd0[_0x251683(0xa0)])),_0xa75041[_0x251683(0xf6)](_0x367fd0);},'onTestSkipped':(_0x52e8ec,_0x201b15)=>{const _0x4134d2=_0x3f75c2;_0x9182f9['stop'](),console[_0x4134d2(0xef)](a5_0x3a9a3b['yellow'](_0x4134d2(0xac)+_0x52e8ec+'\x20-\x20'+_0x201b15));}});for(const _0x15ef3d of _0x3d7552){!_0xa75041[_0x3f75c2(0xba)](_0x70b643=>_0x70b643[_0x3f75c2(0xda)]===_0x15ef3d['name'])&&_0xa75041[_0x3f75c2(0xf6)](_0x15ef3d);}}catch(_0x18fcf6){_0x9182f9[_0x3f75c2(0xce)]();const _0x20a281=_0x18fcf6 instanceof Error?_0x18fcf6[_0x3f75c2(0x9f)]:String(_0x18fcf6);return console[_0x3f75c2(0xef)](a5_0x3a9a3b[_0x3f75c2(0xf2)](_0x3f75c2(0xc8)+_0x20a281)),0x1;}_0x9182f9[_0x3f75c2(0xce)]();if(_0x346b12[_0x3f75c2(0xc4)]>0x0){console['log'](),console['log'](a5_0x3a9a3b['cyan']('Executing\x20new\x20tests...'));const {projectId:_0x33e045,agentId:_0x21e2a9}=_0xa62630[_0x3f75c2(0xd1)];for(const _0x42a26e of _0x346b12){console[_0x3f75c2(0xef)]('Running:\x20'+a5_0x3a9a3b[_0x3f75c2(0xfd)](_0x42a26e[_0x3f75c2(0xda)]));const _0x17ea58=createCommandSpinner(_0x3f75c2(0xf1)+_0x42a26e[_0x3f75c2(0x8d)][_0x3f75c2(0xc4)]+_0x3f75c2(0x82));_0x17ea58['start']();try{const {result:_0x462688}=await runTest(_0xe1d023['llm'],_0x42a26e,{'agentId':_0x21e2a9,'projectId':_0x33e045,'site':_0xa62630[_0x3f75c2(0xbd)],'noEval':![],'evaluatorId':_0x3fa731,'onRoundStart':(_0x16c735,_0x2b1719)=>{const _0x4ec706=_0x3f75c2;_0x17ea58['text']=_0x4ec706(0xaa)+(_0x16c735+0x1)+'/'+_0x2b1719+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x221708,_0x2ca076,_0xf3be91)=>{const _0x34f427=_0x3f75c2,_0x4eb725=formatElapsed(_0x2ca076);_0xf3be91?console[_0x34f427(0xef)]('\x20\x20Round\x20'+(_0x221708+0x1)+'/'+_0x42a26e[_0x34f427(0x8d)][_0x34f427(0xc4)]+_0x34f427(0xfb)+a5_0x3a9a3b['green']('✓')+'\x20('+_0x4eb725+')'):console[_0x34f427(0xef)](_0x34f427(0x84)+(_0x221708+0x1)+'/'+_0x42a26e['rounds']['length']+_0x34f427(0xfb)+a5_0x3a9a3b[_0x34f427(0xf2)]('✗'));},'onEvaluationStart':()=>{const _0x54aaa5=_0x3f75c2;_0x17ea58[_0x54aaa5(0x8e)]=_0x54aaa5(0xb4);},'onEvaluationComplete':_0x1e1764=>{const _0x12bfec=_0x3f75c2,_0x4bc2a3=formatElapsed(_0x1e1764);console['log']('\x20\x20Evaluating...\x20'+a5_0x3a9a3b[_0x12bfec(0x8f)]('✓')+'\x20('+_0x4bc2a3+')');}});_0x17ea58[_0x3f75c2(0xce)](),_0xa75041[_0x3f75c2(0xf6)](_0x462688);if(_0x462688[_0x3f75c2(0xa4)]===_0x3f75c2(0xe5))console[_0x3f75c2(0xef)](a5_0x3a9a3b[_0x3f75c2(0x8f)]('✓\x20PASS:\x20'+_0x462688[_0x3f75c2(0x9a)])+a5_0x3a9a3b[_0x3f75c2(0x95)](_0x3f75c2(0xe9)));else _0x462688['status']===_0x3f75c2(0xec)?console[_0x3f75c2(0xef)](a5_0x3a9a3b[_0x3f75c2(0xf2)]('✗\x20FAIL:\x20'+_0x462688[_0x3f75c2(0x9a)])+a5_0x3a9a3b[_0x3f75c2(0x95)](_0x3f75c2(0xe9))):console[_0x3f75c2(0xef)](a5_0x3a9a3b[_0x3f75c2(0xf2)](_0x3f75c2(0x8a)+_0x462688[_0x3f75c2(0x9a)]));_0x462688[_0x3f75c2(0xa0)]&&console[_0x3f75c2(0xef)](a5_0x3a9a3b['dim'](_0x3f75c2(0xb9)+_0x462688[_0x3f75c2(0xa0)]));}catch(_0x549301){_0x17ea58[_0x3f75c2(0xce)]();const _0x285c5b=_0x549301 instanceof Error?_0x549301[_0x3f75c2(0x9f)]:String(_0x549301);console['log'](a5_0x3a9a3b[_0x3f75c2(0xf2)](_0x3f75c2(0x8a)+_0x285c5b)),_0xa75041[_0x3f75c2(0xf6)]({'name':_0x42a26e[_0x3f75c2(0xda)],'status':_0x3f75c2(0xcf),'reason':_0x285c5b,'timestamp':new Date()[_0x3f75c2(0xe3)](),'duration_ms':0x0});}}}console[_0x3f75c2(0xef)]();const _0x164334=Date[_0x3f75c2(0x97)]()-_0x564ef5,_0x26f91d=_0xa75041[_0x3f75c2(0x101)](_0x1767fe=>_0x1767fe[_0x3f75c2(0xa4)]==='PASS')[_0x3f75c2(0xc4)],_0x4a1641=_0xa75041['filter'](_0xc2716f=>_0xc2716f['status']===_0x3f75c2(0xec))['length'],_0x5dc251=_0xa75041[_0x3f75c2(0x101)](_0x3b901c=>_0x3b901c[_0x3f75c2(0xa4)]===_0x3f75c2(0xcf))[_0x3f75c2(0xc4)];console[_0x3f75c2(0xef)]('━'[_0x3f75c2(0x81)](0x3c)),console[_0x3f75c2(0xef)](_0x3f75c2(0x83)),console['log']('━'['repeat'](0x3c)),console[_0x3f75c2(0xef)]('Total:\x20\x20\x20\x20'+_0xa75041[_0x3f75c2(0xc4)]),console[_0x3f75c2(0xef)]('Passed:\x20\x20\x20'+a5_0x3a9a3b[_0x3f75c2(0x8f)](_0x26f91d)),console[_0x3f75c2(0xef)](_0x3f75c2(0xd9)+a5_0x3a9a3b[_0x3f75c2(0xf2)](_0x4a1641));_0x5dc251>0x0&&console[_0x3f75c2(0xef)](_0x3f75c2(0xa5)+a5_0x3a9a3b[_0x3f75c2(0xf2)](_0x5dc251));console[_0x3f75c2(0xef)](_0x3f75c2(0x6e)+formatElapsed(_0x164334)),console['log']('━'[_0x3f75c2(0x81)](0x3c));const _0x40506e={'summary':{'total':_0xa75041[_0x3f75c2(0xc4)],'passed':_0x26f91d,'failed':_0x4a1641,'errors':_0x5dc251>0x0?_0x5dc251:undefined,'duration_ms':_0x164334},'tests':_0xa75041,'agent':{'project':_0x4e62f0[_0x3f75c2(0x86)],'name':_0x4e62f0[_0x3f75c2(0x7d)],'site':_0x11778e},'timestamp':new Date(_0x564ef5)[_0x3f75c2(0xe3)]()};if(_0x4a78e0!==_0x3f75c2(0xe4)||_0x1f8581){const _0x9d856f=formatResults(_0x40506e,_0x4a78e0);if(_0x1f8581)try{a5_0x5e8169['writeFileSync'](_0x1f8581,_0x9d856f,_0x3f75c2(0xed)),console['log'](),console[_0x3f75c2(0xef)](a5_0x3a9a3b[_0x3f75c2(0x95)](_0x3f75c2(0x9b)+_0x1f8581));}catch(_0x5863c0){return console[_0x3f75c2(0xef)](),console[_0x3f75c2(0xef)](a5_0x3a9a3b[_0x3f75c2(0xf2)](_0x3f75c2(0xa1)+_0x5863c0)),0x1;}else console['log'](),console[_0x3f75c2(0xef)](_0x9d856f);}const _0x51a9cc=_0xa75041[_0x3f75c2(0x101)](_0xf795f4=>_0xf795f4[_0x3f75c2(0xa4)]!==_0x3f75c2(0xe5));return _0x51a9cc[_0x3f75c2(0xc4)]>0x0?0x1:0x0;}}
@@ -1 +1 @@
1
- const a6_0x2ab87f=a6_0x4347;(function(_0x14389f,_0x31e01d){const _0x5e719a=a6_0x4347,_0x39c1c0=_0x14389f();while(!![]){try{const _0x5c3d48=-parseInt(_0x5e719a(0xe8))/0x1+parseInt(_0x5e719a(0xe2))/0x2+parseInt(_0x5e719a(0xc7))/0x3*(-parseInt(_0x5e719a(0xf8))/0x4)+-parseInt(_0x5e719a(0xe4))/0x5+parseInt(_0x5e719a(0xc2))/0x6+-parseInt(_0x5e719a(0xd6))/0x7*(parseInt(_0x5e719a(0xf3))/0x8)+parseInt(_0x5e719a(0xdf))/0x9;if(_0x5c3d48===_0x31e01d)break;else _0x39c1c0['push'](_0x39c1c0['shift']());}catch(_0x56d30f){_0x39c1c0['push'](_0x39c1c0['shift']());}}}(a6_0x4a7c,0x355ce));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';function a6_0x4a7c(){const _0x107344=['cookie','Results\x20saved\x20to\x20','api','message','color','trino','.\x20Valid\x20methods:\x20','output','x-xsrf-token','authorization','entries','GET','677327intvec','cdp','log','substring','includes','name','header','error','set-cookie','6604506ciIGvB','workflow','has','206178xcFmwt','file','1374930ijUKbe','join','DELETE','x-auth-token','213716AGSIgX','llm','stack','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','toUpperCase','data','body','indexOf','Error:\x20','x-trino-user','noColor','8EwfyMe','type','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','startsWith','validate','92XllhBS','PATCH','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','Invalid\x20header\x20format:\x20\x22','proxy-authorization','llm-proxy','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','PUT','POST','length','verbose','<\x20HTTP/1.1\x20','\x22.\x20','1864266ydpUcl','trim','headers','execute','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','44817pDtFAu','method','Endpoint\x20must\x20start\x20with\x20/:\x20'];a6_0x4a7c=function(){return _0x107344;};return a6_0x4a7c();}function a6_0x4347(_0x2bf691,_0x172ef2){_0x2bf691=_0x2bf691-0xba;const _0x4a7cd3=a6_0x4a7c();let _0x434739=_0x4a7cd3[_0x2bf691];return _0x434739;}import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a6_0x2ab87f(0xd3),a6_0x2ab87f(0xfc),a6_0x2ab87f(0xca),a6_0x2ab87f(0xde),'set-cookie2',a6_0x2ab87f(0xd2),a6_0x2ab87f(0xe7),a6_0x2ab87f(0xf1)]);function isSensitiveHeader(_0x257910){const _0x39e1ef=a6_0x2ab87f;return SENSITIVE_HEADERS[_0x39e1ef(0xe1)](_0x257910['toLowerCase']());}function parseHeader(_0x5e369b){const _0xf451aa=a6_0x2ab87f,_0x2d76d1=_0x5e369b[_0xf451aa(0xef)](':');if(_0x2d76d1===-0x1)throw new Error(_0xf451aa(0xfb)+_0x5e369b+_0xf451aa(0xc1)+_0xf451aa(0xbb));const _0x33c7fc=_0x5e369b[_0xf451aa(0xd9)](0x0,_0x2d76d1)[_0xf451aa(0xc3)](),_0x8b1e68=_0x5e369b[_0xf451aa(0xd9)](_0x2d76d1+0x1)['trim']();if(!_0x33c7fc)throw new Error(_0xf451aa(0xc6)+_0x5e369b+'\x22');return[_0x33c7fc,_0x8b1e68];}export class ApiCommand extends BaseCommand{[a6_0x2ab87f(0xdb)]=a6_0x2ab87f(0xcc);['description']=a6_0x2ab87f(0xeb);[a6_0x2ab87f(0xf7)](_0x25b51f){const _0x1b18df=a6_0x2ab87f,{args:_0x1b6478,options:_0x57d97e}=_0x25b51f,_0x2d4270=_0x57d97e;if(_0x1b6478[_0x1b18df(0xbe)]===0x0)return _0x1b18df(0xfa);const _0x1e5dd9=_0x1b6478[0x0];if(!_0x1e5dd9[_0x1b18df(0xf6)]('/'))return _0x1b18df(0xc9)+_0x1e5dd9;const _0x10360a=_0x2d4270['data'],_0x2f24d7=_0x2d4270[_0x1b18df(0xe3)];if(_0x10360a&&_0x2f24d7)return _0x1b18df(0xf5);const _0x435f12=_0x2d4270['method']||_0x1b18df(0xd5),_0x49e80b=[_0x1b18df(0xd5),_0x1b18df(0xbd),_0x1b18df(0xbc),_0x1b18df(0xe6),_0x1b18df(0xf9)];if(!_0x49e80b['includes'](_0x435f12[_0x1b18df(0xec)]()))return'Invalid\x20HTTP\x20method:\x20'+_0x435f12+_0x1b18df(0xd0)+_0x49e80b['join'](',\x20');const _0x486d4f=_0x2d4270['type']||'td',_0x2aa53c=['td',_0x1b18df(0xd7),_0x1b18df(0xe0),_0x1b18df(0xcf),_0x1b18df(0xe9),_0x1b18df(0xba)];if(!_0x2aa53c[_0x1b18df(0xda)](_0x486d4f))return'Invalid\x20API\x20type:\x20'+_0x486d4f+'.\x20Valid\x20types:\x20'+_0x2aa53c[_0x1b18df(0xe5)](',\x20');return undefined;}async[a6_0x2ab87f(0xc5)](_0xa759a2){const _0x4aa6be=a6_0x2ab87f,{options:_0x405e53,args:_0x2ff2f5,tdx:_0x574d8d}=_0xa759a2,_0x5b38a6=_0x405e53,_0x1fafe3=_0x2ff2f5[0x0],_0x46d72e=(_0x5b38a6[_0x4aa6be(0xc8)]||_0x4aa6be(0xd5))[_0x4aa6be(0xec)](),_0x3062dd=_0x5b38a6[_0x4aa6be(0xed)],_0x2ca618=_0x5b38a6['file'],_0x33f34f=_0x5b38a6[_0x4aa6be(0xdc)],_0x123afc=_0x5b38a6[_0x4aa6be(0xf4)]||'td';try{const _0xb1afb2={};if(_0x33f34f){const _0x4cb9e8=Array['isArray'](_0x33f34f)?_0x33f34f:[_0x33f34f];for(const _0x367711 of _0x4cb9e8){const [_0x576755,_0x37a60b]=parseHeader(_0x367711);_0xb1afb2[_0x576755]=_0x37a60b;}}let _0x238519;if(_0x3062dd)_0x238519=_0x3062dd;else{if(_0x2ca618)try{_0x238519=RawAPI['readBodyFromFile'](_0x2ca618);}catch(_0x5335a7){return console[_0x4aa6be(0xdd)](_0x4aa6be(0xf0)+(_0x5335a7 instanceof Error?_0x5335a7[_0x4aa6be(0xcd)]:String(_0x5335a7))),0x1;}}const _0x25cd55={'method':_0x46d72e,'apiType':_0x123afc,'includeHeaders':_0x405e53[_0x4aa6be(0xbf)]};_0x238519&&(_0x25cd55[_0x4aa6be(0xee)]=_0x238519);Object['keys'](_0xb1afb2)[_0x4aa6be(0xbe)]>0x0&&(_0x25cd55[_0x4aa6be(0xc4)]=_0xb1afb2);if(_0x405e53[_0x4aa6be(0xbf)]){const _0x2aa0fa=resolveSite(_0x405e53['site']),_0x2cb18f=getEndpoint(_0x2aa0fa,_0x123afc),_0x1c9016=''+_0x2cb18f+_0x1fafe3;console[_0x4aa6be(0xdd)]('>\x20'+_0x46d72e+'\x20'+_0x1c9016);const _0x2e1e9c=getAuthHeaders(_0x2aa0fa),_0x3e93f9={..._0x2e1e9c,..._0xb1afb2};for(const [_0x69a38c,_0x26903a]of Object[_0x4aa6be(0xd4)](_0x3e93f9)){!isSensitiveHeader(_0x69a38c)&&console['error']('>\x20'+_0x69a38c+':\x20'+_0x26903a);}_0x238519&&console[_0x4aa6be(0xdd)]('>'),console[_0x4aa6be(0xdd)]('');}const _0x3acd5d=await _0x574d8d[_0x4aa6be(0xcc)]['request'](_0x1fafe3,_0x25cd55);if(_0x405e53['verbose']&&_0x3acd5d[_0x4aa6be(0xc4)]){console[_0x4aa6be(0xdd)](_0x4aa6be(0xc0)+_0x3acd5d['status']);for(const [_0x34d4ab,_0x469a68]of Object['entries'](_0x3acd5d[_0x4aa6be(0xc4)])){!isSensitiveHeader(_0x34d4ab)&&console[_0x4aa6be(0xdd)]('<\x20'+_0x34d4ab+':\x20'+_0x469a68);}console['error']('');}const _0x58e424=Boolean(_0x405e53[_0x4aa6be(0xd1)]),_0x42b24c={'color':_0x405e53[_0x4aa6be(0xce)],'noColor':_0x405e53[_0x4aa6be(0xf2)]||_0x58e424&&!_0x405e53[_0x4aa6be(0xce)]},_0x57c394=colorizeJSON(_0x3acd5d[_0x4aa6be(0xed)],_0x42b24c);return _0x405e53[_0x4aa6be(0xd1)]?(writeFileSync(_0x405e53['output'],_0x57c394),console['error'](_0x4aa6be(0xcb)+_0x405e53['output'])):console[_0x4aa6be(0xd8)](_0x57c394),0x0;}catch(_0x42686a){return _0x42686a instanceof Error?(console[_0x4aa6be(0xdd)](_0x4aa6be(0xf0)+_0x42686a[_0x4aa6be(0xcd)]),_0x405e53[_0x4aa6be(0xbf)]&&_0x42686a[_0x4aa6be(0xea)]&&console['error']('\x0aStack\x20trace:\x0a'+_0x42686a[_0x4aa6be(0xea)])):console[_0x4aa6be(0xdd)]('Error:\x20'+String(_0x42686a)),0x1;}}}
1
+ const a6_0x5984b7=a6_0x4161;function a6_0x4161(_0x591c3f,_0x21d3db){_0x591c3f=_0x591c3f-0x134;const _0x50f3cd=a6_0x50f3();let _0x416140=_0x50f3cd[_0x591c3f];return _0x416140;}(function(_0x2ddb17,_0x3f8c2b){const _0x2da2fc=a6_0x4161,_0x1a401d=_0x2ddb17();while(!![]){try{const _0x280a04=parseInt(_0x2da2fc(0x13e))/0x1+-parseInt(_0x2da2fc(0x13c))/0x2+parseInt(_0x2da2fc(0x14e))/0x3+-parseInt(_0x2da2fc(0x14b))/0x4*(parseInt(_0x2da2fc(0x16c))/0x5)+-parseInt(_0x2da2fc(0x138))/0x6+parseInt(_0x2da2fc(0x173))/0x7*(-parseInt(_0x2da2fc(0x155))/0x8)+-parseInt(_0x2da2fc(0x14c))/0x9*(-parseInt(_0x2da2fc(0x171))/0xa);if(_0x280a04===_0x3f8c2b)break;else _0x1a401d['push'](_0x1a401d['shift']());}catch(_0x361773){_0x1a401d['push'](_0x1a401d['shift']());}}}(a6_0x50f3,0x54bb1));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';function a6_0x50f3(){const _0x2018a5=['set-cookie2','Invalid\x20API\x20type:\x20','<\x20HTTP/1.1\x20','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','716RTvSqE','1629cvjVYf','PATCH','1921635KrqRZd','DELETE','toLowerCase','toUpperCase','method','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','Results\x20saved\x20to\x20','200EHmoIP','headers','trim','\x0aStack\x20trace:\x0a','proxy-authorization','trino','\x22.\x20','substring','cookie','workflow','length','stack','Endpoint\x20must\x20start\x20with\x20/:\x20','header','execute','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','PUT','verbose','GET','cdp','set-cookie','llm','x-auth-token','785HocomR','name','validate','file','description','26990iQlJLS','Error:\x20','110278hCUAyJ','error','x-xsrf-token','join','data','output','entries','includes','site','2701044xsElLH','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','POST','api','560242lPtPCV','indexOf','370241VEhaOj','.\x20Valid\x20types:\x20','noColor','body','llm-proxy','log','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','keys','message'];a6_0x50f3=function(){return _0x2018a5;};return a6_0x50f3();}const SENSITIVE_HEADERS=new Set(['authorization',a6_0x5984b7(0x159),a6_0x5984b7(0x15d),a6_0x5984b7(0x169),a6_0x5984b7(0x147),a6_0x5984b7(0x175),a6_0x5984b7(0x16b),'x-trino-user']);function isSensitiveHeader(_0x30d937){const _0x119790=a6_0x5984b7;return SENSITIVE_HEADERS['has'](_0x30d937[_0x119790(0x150)]());}function parseHeader(_0x327e12){const _0x3d173d=a6_0x5984b7,_0x370cd4=_0x327e12[_0x3d173d(0x13d)](':');if(_0x370cd4===-0x1)throw new Error('Invalid\x20header\x20format:\x20\x22'+_0x327e12+_0x3d173d(0x15b)+_0x3d173d(0x139));const _0x533f92=_0x327e12['substring'](0x0,_0x370cd4)[_0x3d173d(0x157)](),_0x5c0367=_0x327e12[_0x3d173d(0x15c)](_0x370cd4+0x1)['trim']();if(!_0x533f92)throw new Error(_0x3d173d(0x144)+_0x327e12+'\x22');return[_0x533f92,_0x5c0367];}export class ApiCommand extends BaseCommand{[a6_0x5984b7(0x16d)]='api';[a6_0x5984b7(0x170)]=a6_0x5984b7(0x14a);[a6_0x5984b7(0x16e)](_0x11b72e){const _0xd36289=a6_0x5984b7,{args:_0x165773,options:_0x20ad1e}=_0x11b72e,_0xb73817=_0x20ad1e;if(_0x165773[_0xd36289(0x15f)]===0x0)return _0xd36289(0x153);const _0xfcf4e5=_0x165773[0x0];if(!_0xfcf4e5['startsWith']('/'))return _0xd36289(0x161)+_0xfcf4e5;const _0x31efcf=_0xb73817[_0xd36289(0x177)],_0x1a6e9f=_0xb73817['file'];if(_0x31efcf&&_0x1a6e9f)return _0xd36289(0x164);const _0xa7a4af=_0xb73817[_0xd36289(0x152)]||_0xd36289(0x167),_0x416d99=[_0xd36289(0x167),_0xd36289(0x13a),_0xd36289(0x165),_0xd36289(0x14f),_0xd36289(0x14d)];if(!_0x416d99[_0xd36289(0x136)](_0xa7a4af[_0xd36289(0x151)]()))return'Invalid\x20HTTP\x20method:\x20'+_0xa7a4af+'.\x20Valid\x20methods:\x20'+_0x416d99[_0xd36289(0x176)](',\x20');const _0x137c2e=_0xb73817['type']||'td',_0x205328=['td',_0xd36289(0x168),_0xd36289(0x15e),_0xd36289(0x15a),_0xd36289(0x16a),_0xd36289(0x142)];if(!_0x205328[_0xd36289(0x136)](_0x137c2e))return _0xd36289(0x148)+_0x137c2e+_0xd36289(0x13f)+_0x205328['join'](',\x20');return undefined;}async[a6_0x5984b7(0x163)](_0x1c31e1){const _0x5c352a=a6_0x5984b7,{options:_0x25c1f9,args:_0x5b7507,tdx:_0x671f5d}=_0x1c31e1,_0x326dd3=_0x25c1f9,_0x270268=_0x5b7507[0x0],_0x4933e1=(_0x326dd3[_0x5c352a(0x152)]||_0x5c352a(0x167))[_0x5c352a(0x151)](),_0x229fc7=_0x326dd3[_0x5c352a(0x177)],_0x3ab65d=_0x326dd3[_0x5c352a(0x16f)],_0x377082=_0x326dd3[_0x5c352a(0x162)],_0x1b61ee=_0x326dd3['type']||'td';try{const _0x1e706e={};if(_0x377082){const _0xc7e02f=Array['isArray'](_0x377082)?_0x377082:[_0x377082];for(const _0x507169 of _0xc7e02f){const [_0x37bd3d,_0xc64d62]=parseHeader(_0x507169);_0x1e706e[_0x37bd3d]=_0xc64d62;}}let _0x192a9f;if(_0x229fc7)_0x192a9f=_0x229fc7;else{if(_0x3ab65d)try{_0x192a9f=RawAPI['readBodyFromFile'](_0x3ab65d);}catch(_0x134ce8){return console[_0x5c352a(0x174)](_0x5c352a(0x172)+(_0x134ce8 instanceof Error?_0x134ce8[_0x5c352a(0x146)]:String(_0x134ce8))),0x1;}}const _0x10c9b5={'method':_0x4933e1,'apiType':_0x1b61ee,'includeHeaders':_0x25c1f9[_0x5c352a(0x166)]};_0x192a9f&&(_0x10c9b5[_0x5c352a(0x141)]=_0x192a9f);Object[_0x5c352a(0x145)](_0x1e706e)[_0x5c352a(0x15f)]>0x0&&(_0x10c9b5[_0x5c352a(0x156)]=_0x1e706e);if(_0x25c1f9[_0x5c352a(0x166)]){const _0x1c0606=resolveSite(_0x25c1f9[_0x5c352a(0x137)]),_0x5f0b5d=getEndpoint(_0x1c0606,_0x1b61ee),_0x21cb37=''+_0x5f0b5d+_0x270268;console[_0x5c352a(0x174)]('>\x20'+_0x4933e1+'\x20'+_0x21cb37);const _0x1906de=getAuthHeaders(_0x1c0606),_0x549493={..._0x1906de,..._0x1e706e};for(const [_0x2d1f38,_0x56b3b6]of Object[_0x5c352a(0x135)](_0x549493)){!isSensitiveHeader(_0x2d1f38)&&console[_0x5c352a(0x174)]('>\x20'+_0x2d1f38+':\x20'+_0x56b3b6);}_0x192a9f&&console['error']('>'),console[_0x5c352a(0x174)]('');}const _0x279703=await _0x671f5d[_0x5c352a(0x13b)]['request'](_0x270268,_0x10c9b5);if(_0x25c1f9[_0x5c352a(0x166)]&&_0x279703['headers']){console[_0x5c352a(0x174)](_0x5c352a(0x149)+_0x279703['status']);for(const [_0x2c1021,_0x1d6d89]of Object[_0x5c352a(0x135)](_0x279703[_0x5c352a(0x156)])){!isSensitiveHeader(_0x2c1021)&&console[_0x5c352a(0x174)]('<\x20'+_0x2c1021+':\x20'+_0x1d6d89);}console[_0x5c352a(0x174)]('');}const _0xd5b24=Boolean(_0x25c1f9['output']),_0x4e1b79={'color':_0x25c1f9['color'],'noColor':_0x25c1f9[_0x5c352a(0x140)]||_0xd5b24&&!_0x25c1f9['color']},_0x3bbaba=colorizeJSON(_0x279703['data'],_0x4e1b79);return _0x25c1f9[_0x5c352a(0x134)]?(writeFileSync(_0x25c1f9[_0x5c352a(0x134)],_0x3bbaba),console['error'](_0x5c352a(0x154)+_0x25c1f9['output'])):console[_0x5c352a(0x143)](_0x3bbaba),0x0;}catch(_0x145dc2){return _0x145dc2 instanceof Error?(console[_0x5c352a(0x174)](_0x5c352a(0x172)+_0x145dc2[_0x5c352a(0x146)]),_0x25c1f9['verbose']&&_0x145dc2[_0x5c352a(0x160)]&&console[_0x5c352a(0x174)](_0x5c352a(0x158)+_0x145dc2[_0x5c352a(0x160)])):console[_0x5c352a(0x174)]('Error:\x20'+String(_0x145dc2)),0x1;}}}
@@ -1 +1 @@
1
- const a7_0x2cd8da=a7_0x47ee;(function(_0x8511a9,_0x2f4725){const _0x19041d=a7_0x47ee,_0x22585f=_0x8511a9();while(!![]){try{const _0x4b9a50=parseInt(_0x19041d(0xc5))/0x1*(-parseInt(_0x19041d(0xba))/0x2)+-parseInt(_0x19041d(0xd0))/0x3*(-parseInt(_0x19041d(0xd7))/0x4)+-parseInt(_0x19041d(0xe4))/0x5+-parseInt(_0x19041d(0xbb))/0x6+-parseInt(_0x19041d(0xf1))/0x7*(parseInt(_0x19041d(0xe3))/0x8)+parseInt(_0x19041d(0xd6))/0x9*(parseInt(_0x19041d(0xce))/0xa)+parseInt(_0x19041d(0xe9))/0xb;if(_0x4b9a50===_0x2f4725)break;else _0x22585f['push'](_0x22585f['shift']());}catch(_0x558718){_0x22585f['push'](_0x22585f['shift']());}}}(a7_0xb7a3,0xd3630));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';function a7_0xb7a3(){const _0x1006fe=['message','688760mTfYkm','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','342DHoxPs','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','apiKey','yellow','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','test','45lROJVC','47140jFtipZ','other','\x20for\x20profile:\x20','\x20--profile\x20','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','auth:setup','N/A','status','name','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','create','auth','40ScZcrR','6303500AeaFed','Select\x20your\x20Treasure\x20Data\x20site:','us01','\x0aSetup\x20cancelled','email','23609344kdRDLl','tdx:\x20auth\x20setup','tdx:\x20auth\x20clear','auth:clear','text','profile','Read\x20credential\x20from\x20','red','75215SFoPUB','Site\x20name\x20cannot\x20be\x20empty','bold','Remove\x20API\x20key\x20from\x20system\x20keychain','\x27\x20registered','User:\x20','customSite','Validating\x20API\x20key...','Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20','join','select','✗\x20Validation\x20failed:\x20','\x20\x20tdx','No\x20credential\x20found','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','last_name','You\x20can\x20find\x20your\x20API\x20key\x20at:','getUserInfo','warn','execute','trim','46032PAOkOe','4399614qetZUl','description','Setup\x20API\x20key\x20authentication\x20interactively','logLevel','Name:\x20','first_name','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','Enter\x20your\x20TD\x20API\x20key:','\x20(profile:\x20','site','40cEhtml','log','filter','green','jobs','error','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','Enter\x20site\x20name:'];a7_0xb7a3=function(){return _0x1006fe;};return a7_0xb7a3();}import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';import{buildSiteChoices}from'../core/constants.js';function a7_0x47ee(_0x14ed06,_0x57a030){_0x14ed06=_0x14ed06-0xa6;const _0xb7a39b=a7_0xb7a3();let _0x47ee5d=_0xb7a39b[_0x14ed06];return _0x47ee5d;}import a7_0x60ae14 from'prompts';import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a7_0x26c7c3 from'chalk';export class AuthSetupCommand extends BaseCommand{[a7_0x2cd8da(0xdf)]=a7_0x2cd8da(0xdc);['description']=a7_0x2cd8da(0xbd);async[a7_0x2cd8da(0xb8)](_0x3a5fb9){const _0x1953ca=a7_0x2cd8da,{options:_0x34e0e9}=_0x3a5fb9,_0x296473=_0x34e0e9[_0x1953ca(0xee)];console[_0x1953ca(0xc6)](a7_0x26c7c3[_0x1953ca(0xa6)](_0x1953ca(0xea)));const _0x319906=_0x34e0e9[_0x1953ca(0xc4)]||_0x1953ca(0xe6),{choices:_0x495bb3,initialIndex:_0x3519a6}=buildSiteChoices(_0x319906),_0x40ad6a=_0x296473?_0x1953ca(0xac)+_0x296473+'):':_0x1953ca(0xe5),_0x29c7c4=await a7_0x60ae14({'type':_0x1953ca(0xae),'name':_0x1953ca(0xc4),'message':_0x40ad6a,'choices':_0x495bb3,'initial':_0x3519a6});if(!_0x29c7c4[_0x1953ca(0xc4)])return console[_0x1953ca(0xc6)]('\x0aSetup\x20cancelled'),0x1;let _0x353e05;if(_0x29c7c4[_0x1953ca(0xc4)]===_0x1953ca(0xd8)){const _0x2503c4=await a7_0x60ae14({'type':_0x1953ca(0xed),'name':_0x1953ca(0xaa),'message':_0x1953ca(0xcc),'initial':_0x1953ca(0xe6),'validate':_0x3e76b3=>{const _0x3cc6ee=_0x1953ca;if(!_0x3e76b3||!_0x3e76b3[_0x3cc6ee(0xb9)]())return _0x3cc6ee(0xf2);if(!/^[a-z0-9-]+$/[_0x3cc6ee(0xd5)](_0x3e76b3[_0x3cc6ee(0xb9)]()))return _0x3cc6ee(0xc1);return!![];}});if(!_0x2503c4[_0x1953ca(0xaa)])return console['log'](_0x1953ca(0xe7)),0x1;_0x353e05=_0x2503c4['customSite'];}else _0x353e05=_0x29c7c4[_0x1953ca(0xc4)];const _0x13549c=resolveSite(_0x353e05);console[_0x1953ca(0xc6)]('Setting\x20up\x20authentication\x20for\x20site:\x20'+_0x13549c),console[_0x1953ca(0xc6)](_0x1953ca(0xb5)),console[_0x1953ca(0xc6)]('\x20\x20'+getConsoleUrl(_0x13549c,'/app/mp/ak'));const _0x43fad2=await a7_0x60ae14({'type':'password','name':_0x1953ca(0xd2),'message':_0x1953ca(0xc2),'validate':_0x26746a=>{const _0xddb884=_0x1953ca;if(!_0x26746a||!_0x26746a[_0xddb884(0xb9)]())return'API\x20key\x20cannot\x20be\x20empty';return!![];}});if(!_0x43fad2[_0x1953ca(0xd2)])return console[_0x1953ca(0xc6)](_0x1953ca(0xe7)),0x1;const _0x2106ac=_0x43fad2[_0x1953ca(0xd2)];console['log'](_0x1953ca(0xab));try{const _0x3f2477=TDX[_0x1953ca(0xe1)]({'site':_0x13549c,'apiKey':_0x2106ac[_0x1953ca(0xb9)](),'logLevel':_0x34e0e9[_0x1953ca(0xbe)]??LogLevel['ERROR']}),_0x45a734=await _0x3f2477[_0x1953ca(0xc9)][_0x1953ca(0xb6)]();console[_0x1953ca(0xc6)](_0x1953ca(0xd4)+_0x45a734['email']+')');const _0x44448c=await isKeychainAvailable();_0x44448c?(await saveAPIKeyAsync(_0x2106ac['trim'](),_0x13549c,_0x296473),console['log'](_0x1953ca(0xcb)+(_0x296473?'\x20(profile:\x20'+_0x296473+')':''))):(console[_0x1953ca(0xb7)](a7_0x26c7c3[_0x1953ca(0xd3)](_0x1953ca(0xb2))),console[_0x1953ca(0xb7)](a7_0x26c7c3[_0x1953ca(0xd3)]('\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.')));if(_0x296473){const _0x37a2ad={'site':_0x13549c};saveProfileToUserConfig(_0x296473,_0x37a2ad),console['log']('✓\x20Profile\x20\x27'+_0x296473+_0x1953ca(0xa8));}else saveDefaultSiteToUserConfig(_0x13549c),console[_0x1953ca(0xc6)]('✓\x20Default\x20site\x20set\x20to\x20'+_0x13549c);const _0x4ccfc7=_0x296473?_0x1953ca(0xda)+_0x296473:'';return console[_0x1953ca(0xc6)](),console['log'](_0x1953ca(0xe0)),console[_0x1953ca(0xc6)](_0x1953ca(0xb0)+_0x4ccfc7+_0x1953ca(0xdb)),console[_0x1953ca(0xc6)](_0x1953ca(0xb0)+_0x4ccfc7+_0x1953ca(0xd1)),0x0;}catch(_0xf17f04){if(_0xf17f04 instanceof HTTPClientError&&_0xf17f04[_0x1953ca(0xde)]===0x191)return printAuthError(_0xf17f04),0x1;return console[_0x1953ca(0xca)](a7_0x26c7c3[_0x1953ca(0xf0)](_0x1953ca(0xaf)+(_0xf17f04 instanceof Error?_0xf17f04[_0x1953ca(0xcd)]:String(_0xf17f04)))),console[_0x1953ca(0xca)](_0x1953ca(0xcf)),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x2cd8da(0xdf)]=a7_0x2cd8da(0xe2);['description']=a7_0x2cd8da(0xb3);async[a7_0x2cd8da(0xb8)](_0x205ae0){const _0x51137b=a7_0x2cd8da,{options:_0x83da89,tdx:_0x18eff7}=_0x205ae0,_0x4c3744=_0x83da89['site'],_0x4b56b7=_0x83da89[_0x51137b(0xee)],_0x42deeb=_0x4b56b7?_0x4b56b7:_0x51137b(0xdd);console[_0x51137b(0xc6)]('tdx\x20profile:\x20'+_0x42deeb+'\x20(site:\x20'+_0x4c3744+')');const _0x2fc0e2=await resolveAPIKeyAsync(_0x4c3744,_0x4b56b7);if(_0x2fc0e2){const {source:_0xba5eb,isDeprecated:_0x434eaf}=_0x2fc0e2,_0x26f02d=_0x51137b(0xef)+_0xba5eb;console[_0x51137b(0xc6)](_0x434eaf?a7_0x26c7c3[_0x51137b(0xd3)](_0x26f02d):_0x26f02d);}else console['log'](a7_0x26c7c3[_0x51137b(0xd3)](_0x51137b(0xb1)));try{const _0x40fbbf=await _0x18eff7[_0x51137b(0xc9)][_0x51137b(0xb6)]();return console[_0x51137b(0xc6)](a7_0x26c7c3[_0x51137b(0xc8)]('✓\x20Authentication\x20successful\x0a')),console[_0x51137b(0xc6)](_0x51137b(0xa9)+_0x40fbbf[_0x51137b(0xe8)]),(_0x40fbbf[_0x51137b(0xc0)]||_0x40fbbf[_0x51137b(0xb4)])&&console[_0x51137b(0xc6)](_0x51137b(0xbf)+[_0x40fbbf[_0x51137b(0xc0)],_0x40fbbf[_0x51137b(0xb4)]][_0x51137b(0xc7)](Boolean)[_0x51137b(0xad)]('\x20')),0x0;}catch(_0x420fe5){return _0x420fe5 instanceof HTTPClientError&&_0x420fe5[_0x51137b(0xde)]===0x191?printAuthError(_0x420fe5,!![],_0x4b56b7):console['error'](a7_0x26c7c3[_0x51137b(0xf0)](_0x51137b(0xaf)+(_0x420fe5 instanceof Error?_0x420fe5[_0x51137b(0xcd)]:String(_0x420fe5)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x2cd8da(0xdf)]=a7_0x2cd8da(0xec);[a7_0x2cd8da(0xbc)]=a7_0x2cd8da(0xa7);async['execute'](_0x188c0b){const _0x464d19=a7_0x2cd8da,{options:_0x5b1b54}=_0x188c0b,_0x392380=_0x5b1b54[_0x464d19(0xee)];console[_0x464d19(0xc6)](a7_0x26c7c3[_0x464d19(0xa6)](_0x464d19(0xeb)));const _0x4b443e=await isKeychainAvailable();if(!_0x4b443e)return console[_0x464d19(0xca)](a7_0x26c7c3[_0x464d19(0xf0)]('System\x20keychain\x20is\x20not\x20available')),0x1;const _0x4874ae=await deleteKeychainAPIKey(_0x392380);return _0x4874ae?(clearCredentialCache(),console[_0x464d19(0xc6)]('✓\x20API\x20key\x20removed\x20from\x20keychain'+(_0x392380?_0x464d19(0xc3)+_0x392380+')':'')),0x0):(console['log']('No\x20API\x20key\x20found\x20in\x20keychain'+(_0x392380?_0x464d19(0xd9)+_0x392380:'')),0x1);}}
1
+ const a7_0x44750e=a7_0xbbf0;(function(_0x167123,_0x2e6ada){const _0x475142=a7_0xbbf0,_0x4e2949=_0x167123();while(!![]){try{const _0x1ace47=-parseInt(_0x475142(0x1cb))/0x1+parseInt(_0x475142(0x1a6))/0x2+-parseInt(_0x475142(0x1a9))/0x3+-parseInt(_0x475142(0x1c3))/0x4+parseInt(_0x475142(0x1df))/0x5*(parseInt(_0x475142(0x1b0))/0x6)+-parseInt(_0x475142(0x1d9))/0x7*(parseInt(_0x475142(0x1cf))/0x8)+parseInt(_0x475142(0x1dc))/0x9;if(_0x1ace47===_0x2e6ada)break;else _0x4e2949['push'](_0x4e2949['shift']());}catch(_0x4593a3){_0x4e2949['push'](_0x4e2949['shift']());}}}(a7_0xf7ec,0xe6ead));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';function a7_0xf7ec(){const _0x5d53f2=['✗\x20Validation\x20failed:\x20','error','create','auth:setup','name','apiKey','Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20','56aVuSde','No\x20API\x20key\x20found\x20in\x20keychain','\x20(profile:\x20','30387699ztdXjh','ERROR','getUserInfo','8888575qXUxXR','site','us01','auth:clear','\x20\x20tdx','log','red','System\x20keychain\x20is\x20not\x20available','yellow','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','auth','description','✓\x20API\x20key\x20removed\x20from\x20keychain','Enter\x20site\x20name:','execute','profile','Setup\x20API\x20key\x20authentication\x20interactively','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','511574LqpHzs','jobs','filter','3588477QHOmQH','✓\x20Profile\x20\x27','email','\x0aSetup\x20cancelled','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','first_name','bold','6qgOVHr','No\x20credential\x20found','\x27\x20registered','join','text','status','\x20(site:\x20','warn','last_name','select','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','password','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','✓\x20Default\x20site\x20set\x20to\x20','Setting\x20up\x20authentication\x20for\x20site:\x20','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','message','other','tdx:\x20auth\x20clear','6548308DEnJHn','Validating\x20API\x20key...','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','test','Remove\x20API\x20key\x20from\x20system\x20keychain','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','Enter\x20your\x20TD\x20API\x20key:','tdx\x20profile:\x20','14216xIvwQb','✓\x20Authentication\x20successful\x0a','Read\x20credential\x20from\x20','trim','1616624XBkKXw','customSite','Select\x20your\x20Treasure\x20Data\x20site:'];a7_0xf7ec=function(){return _0x5d53f2;};return a7_0xf7ec();}import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';import{buildSiteChoices}from'../core/constants.js';import a7_0x409e8a from'prompts';import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';function a7_0xbbf0(_0x193548,_0x15018f){_0x193548=_0x193548-0x195;const _0xf7ecb3=a7_0xf7ec();let _0xbbf03d=_0xf7ecb3[_0x193548];return _0xbbf03d;}import{LogLevel}from'../utils/tdx-logger.js';import a7_0x22198d from'chalk';export class AuthSetupCommand extends BaseCommand{[a7_0x44750e(0x1d6)]=a7_0x44750e(0x1d5);[a7_0x44750e(0x19f)]=a7_0x44750e(0x1a4);async[a7_0x44750e(0x1a2)](_0x35c12b){const _0x50d9a8=a7_0x44750e,{options:_0x57c7b1}=_0x35c12b,_0x2b50d5=_0x57c7b1[_0x50d9a8(0x1a3)];console[_0x50d9a8(0x199)](a7_0x22198d[_0x50d9a8(0x1af)]('tdx:\x20auth\x20setup'));const _0x41bf40=_0x57c7b1[_0x50d9a8(0x195)]||'us01',{choices:_0x2122fc,initialIndex:_0x3311cd}=buildSiteChoices(_0x41bf40),_0x4e030c=_0x2b50d5?_0x50d9a8(0x1d8)+_0x2b50d5+'):':_0x50d9a8(0x1d1),_0x4074e6=await a7_0x409e8a({'type':_0x50d9a8(0x1b9),'name':_0x50d9a8(0x195),'message':_0x4e030c,'choices':_0x2122fc,'initial':_0x3311cd});if(!_0x4074e6[_0x50d9a8(0x195)])return console['log'](_0x50d9a8(0x1ac)),0x1;let _0x47bf98;if(_0x4074e6['site']===_0x50d9a8(0x1c1)){const _0x203875=await a7_0x409e8a({'type':_0x50d9a8(0x1b4),'name':'customSite','message':_0x50d9a8(0x1a1),'initial':_0x50d9a8(0x196),'validate':_0x15fc2a=>{const _0x50cfc8=_0x50d9a8;if(!_0x15fc2a||!_0x15fc2a[_0x50cfc8(0x1ce)]())return'Site\x20name\x20cannot\x20be\x20empty';if(!/^[a-z0-9-]+$/[_0x50cfc8(0x1c6)](_0x15fc2a[_0x50cfc8(0x1ce)]()))return _0x50cfc8(0x1c8);return!![];}});if(!_0x203875[_0x50d9a8(0x1d0)])return console['log'](_0x50d9a8(0x1ac)),0x1;_0x47bf98=_0x203875[_0x50d9a8(0x1d0)];}else _0x47bf98=_0x4074e6['site'];const _0x4667b6=resolveSite(_0x47bf98);console[_0x50d9a8(0x199)](_0x50d9a8(0x1be)+_0x4667b6),console['log']('You\x20can\x20find\x20your\x20API\x20key\x20at:'),console[_0x50d9a8(0x199)]('\x20\x20'+getConsoleUrl(_0x4667b6,'/app/mp/ak'));const _0x3b361b=await a7_0x409e8a({'type':_0x50d9a8(0x1bb),'name':_0x50d9a8(0x1d7),'message':_0x50d9a8(0x1c9),'validate':_0x3d1de4=>{const _0x5a6a59=_0x50d9a8;if(!_0x3d1de4||!_0x3d1de4[_0x5a6a59(0x1ce)]())return'API\x20key\x20cannot\x20be\x20empty';return!![];}});if(!_0x3b361b[_0x50d9a8(0x1d7)])return console[_0x50d9a8(0x199)](_0x50d9a8(0x1ac)),0x1;const _0x4c4282=_0x3b361b[_0x50d9a8(0x1d7)];console['log'](_0x50d9a8(0x1c4));try{const _0x4f9570=TDX[_0x50d9a8(0x1d4)]({'site':_0x4667b6,'apiKey':_0x4c4282['trim'](),'logLevel':_0x57c7b1['logLevel']??LogLevel[_0x50d9a8(0x1dd)]}),_0x58b0c5=await _0x4f9570[_0x50d9a8(0x1a7)][_0x50d9a8(0x1de)]();console[_0x50d9a8(0x199)](_0x50d9a8(0x1c5)+_0x58b0c5[_0x50d9a8(0x1ab)]+')');const _0x31166d=await isKeychainAvailable();_0x31166d?(await saveAPIKeyAsync(_0x4c4282['trim'](),_0x4667b6,_0x2b50d5),console['log'](_0x50d9a8(0x1a5)+(_0x2b50d5?_0x50d9a8(0x1db)+_0x2b50d5+')':''))):(console[_0x50d9a8(0x1b7)](a7_0x22198d[_0x50d9a8(0x19c)](_0x50d9a8(0x1bf))),console['warn'](a7_0x22198d[_0x50d9a8(0x19c)]('\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.')));if(_0x2b50d5){const _0x285d01={'site':_0x4667b6};saveProfileToUserConfig(_0x2b50d5,_0x285d01),console[_0x50d9a8(0x199)](_0x50d9a8(0x1aa)+_0x2b50d5+_0x50d9a8(0x1b2));}else saveDefaultSiteToUserConfig(_0x4667b6),console[_0x50d9a8(0x199)](_0x50d9a8(0x1bd)+_0x4667b6);const _0x80d830=_0x2b50d5?'\x20--profile\x20'+_0x2b50d5:'';return console[_0x50d9a8(0x199)](),console[_0x50d9a8(0x199)](_0x50d9a8(0x1bc)),console[_0x50d9a8(0x199)](_0x50d9a8(0x198)+_0x80d830+_0x50d9a8(0x1ba)),console[_0x50d9a8(0x199)](_0x50d9a8(0x198)+_0x80d830+_0x50d9a8(0x19d)),0x0;}catch(_0x36970a){if(_0x36970a instanceof HTTPClientError&&_0x36970a[_0x50d9a8(0x1b5)]===0x191)return printAuthError(_0x36970a),0x1;return console[_0x50d9a8(0x1d3)](a7_0x22198d['red'](_0x50d9a8(0x1d2)+(_0x36970a instanceof Error?_0x36970a[_0x50d9a8(0x1c0)]:String(_0x36970a)))),console[_0x50d9a8(0x1d3)](_0x50d9a8(0x1ad)),0x1;}}}export class AuthStatusCommand extends BaseCommand{['name']=a7_0x44750e(0x19e);[a7_0x44750e(0x19f)]='Show\x20authentication\x20status\x20and\x20validate\x20API\x20key';async[a7_0x44750e(0x1a2)](_0x2e6ede){const _0x46546d=a7_0x44750e,{options:_0x3ba3b6,tdx:_0x2a6049}=_0x2e6ede,_0x55fb92=_0x3ba3b6[_0x46546d(0x195)],_0x32aeae=_0x3ba3b6['profile'],_0x365ba7=_0x32aeae?_0x32aeae:'N/A';console[_0x46546d(0x199)](_0x46546d(0x1ca)+_0x365ba7+_0x46546d(0x1b6)+_0x55fb92+')');const _0x4592cf=await resolveAPIKeyAsync(_0x55fb92,_0x32aeae);if(_0x4592cf){const {source:_0x5a8b82,isDeprecated:_0x1d7b24}=_0x4592cf,_0x54e136=_0x46546d(0x1cd)+_0x5a8b82;console[_0x46546d(0x199)](_0x1d7b24?a7_0x22198d['yellow'](_0x54e136):_0x54e136);}else console[_0x46546d(0x199)](a7_0x22198d['yellow'](_0x46546d(0x1b1)));try{const _0x3bf6a9=await _0x2a6049[_0x46546d(0x1a7)][_0x46546d(0x1de)]();return console[_0x46546d(0x199)](a7_0x22198d['green'](_0x46546d(0x1cc))),console[_0x46546d(0x199)]('User:\x20'+_0x3bf6a9[_0x46546d(0x1ab)]),(_0x3bf6a9[_0x46546d(0x1ae)]||_0x3bf6a9[_0x46546d(0x1b8)])&&console['log']('Name:\x20'+[_0x3bf6a9['first_name'],_0x3bf6a9[_0x46546d(0x1b8)]][_0x46546d(0x1a8)](Boolean)[_0x46546d(0x1b3)]('\x20')),0x0;}catch(_0x3d6a2e){return _0x3d6a2e instanceof HTTPClientError&&_0x3d6a2e[_0x46546d(0x1b5)]===0x191?printAuthError(_0x3d6a2e,!![],_0x32aeae):console[_0x46546d(0x1d3)](a7_0x22198d[_0x46546d(0x19a)]('✗\x20Validation\x20failed:\x20'+(_0x3d6a2e instanceof Error?_0x3d6a2e[_0x46546d(0x1c0)]:String(_0x3d6a2e)))),0x1;}}}export class AuthClearCommand extends BaseCommand{['name']=a7_0x44750e(0x197);[a7_0x44750e(0x19f)]=a7_0x44750e(0x1c7);async[a7_0x44750e(0x1a2)](_0x3c12bf){const _0x2afa4b=a7_0x44750e,{options:_0x256167}=_0x3c12bf,_0x4c0d59=_0x256167['profile'];console[_0x2afa4b(0x199)](a7_0x22198d[_0x2afa4b(0x1af)](_0x2afa4b(0x1c2)));const _0x2a459a=await isKeychainAvailable();if(!_0x2a459a)return console[_0x2afa4b(0x1d3)](a7_0x22198d[_0x2afa4b(0x19a)](_0x2afa4b(0x19b))),0x1;const _0x22a81a=await deleteKeychainAPIKey(_0x4c0d59);return _0x22a81a?(clearCredentialCache(),console['log'](_0x2afa4b(0x1a0)+(_0x4c0d59?'\x20(profile:\x20'+_0x4c0d59+')':'')),0x0):(console['log'](_0x2afa4b(0x1da)+(_0x4c0d59?'\x20for\x20profile:\x20'+_0x4c0d59:'')),0x1);}}
@@ -1 +1 @@
1
- const a8_0x1a7de7=a8_0x1c31;(function(_0x46a342,_0x386679){const _0x6a58e=a8_0x1c31,_0x2d8190=_0x46a342();while(!![]){try{const _0x170940=parseInt(_0x6a58e(0x151))/0x1+parseInt(_0x6a58e(0x148))/0x2+parseInt(_0x6a58e(0x149))/0x3*(parseInt(_0x6a58e(0x142))/0x4)+parseInt(_0x6a58e(0x15d))/0x5+-parseInt(_0x6a58e(0x168))/0x6+parseInt(_0x6a58e(0x157))/0x7*(parseInt(_0x6a58e(0x15f))/0x8)+-parseInt(_0x6a58e(0x158))/0x9*(parseInt(_0x6a58e(0x14b))/0xa);if(_0x170940===_0x386679)break;else _0x2d8190['push'](_0x2d8190['shift']());}catch(_0xaa21f2){_0x2d8190['push'](_0x2d8190['shift']());}}}(a8_0x459d,0x26483));function a8_0x1c31(_0x268cf2,_0x1fa77a){_0x268cf2=_0x268cf2-0x140;const _0x459d01=a8_0x459d();let _0x1c310e=_0x459d01[_0x268cf2];return _0x1c310e;}import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{withSpinner}from'../utils/spinner.js';import{parseAgentRef}from'../sdk/agent/agent-ref-parser.js';import{saveLastChatId,loadLastChatId}from'../sdk/llm/chat-cache.js';function handleSDKError(_0x3cbe71,_0x5b2e83){const _0x88b6b6=a8_0x1c31;if(_0x3cbe71 instanceof SDKError)console[_0x88b6b6(0x143)](_0x88b6b6(0x173)+_0x3cbe71[_0x88b6b6(0x179)]),_0x5b2e83[_0x88b6b6(0x156)]&&(_0x3cbe71[_0x88b6b6(0x14e)]&&console[_0x88b6b6(0x143)](_0x88b6b6(0x172)+_0x3cbe71[_0x88b6b6(0x14e)]),_0x3cbe71[_0x88b6b6(0x153)]&&(console['error']('\x0aStack\x20trace:'),console[_0x88b6b6(0x143)](_0x3cbe71[_0x88b6b6(0x153)])));else throw _0x3cbe71;}export class ChatCommand extends BaseCommand{[a8_0x1a7de7(0x176)]=a8_0x1a7de7(0x167);[a8_0x1a7de7(0x15c)]=a8_0x1a7de7(0x160);['validate'](_0xdec90){const _0x3e8add=a8_0x1a7de7,_0x306da1=_0xdec90[_0x3e8add(0x14a)][_0x3e8add(0x159)]('\x20');if(!_0x306da1)return'Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options';return undefined;}async[a8_0x1a7de7(0x16b)](_0x2e9e04,_0x25a15e,_0x332843,_0xc18e9,_0x29b7ec){const _0x5ea9eb=a8_0x1a7de7;for await(const _0x1db9a7 of _0x2e9e04[_0x5ea9eb(0x14f)][_0x5ea9eb(0x167)](_0x25a15e,{'agentId':_0x332843,'chatId':_0xc18e9})){if(_0x1db9a7['type']===_0x5ea9eb(0x16d)){const _0x218b57=_0x1db9a7[_0x5ea9eb(0x14c)][_0x5ea9eb(0x141)];saveLastChatId(_0x218b57),_0x29b7ec&&console[_0x5ea9eb(0x143)]('Chat\x20session:\x20'+_0x218b57);}else _0x1db9a7[_0x5ea9eb(0x14d)]===_0x5ea9eb(0x15a)&&this[_0x5ea9eb(0x152)](_0x1db9a7[_0x5ea9eb(0x14c)]);}}async['getAgentId'](_0x3ae205,_0xb5aa1c,_0x1bc098,_0x1a5de2,_0x3f296b){const _0x72f651=a8_0x1a7de7,_0x44c755=_0xb5aa1c||_0x1bc098;if(_0x44c755){const {projectName:_0x453ae3,agentName:_0x225424}=parseAgentRef(_0x44c755),_0x579610=_0x225424||_0x44c755,_0x50df79=_0x225424?_0x453ae3:_0x1a5de2;if(!_0x50df79)throw new Error(_0x72f651(0x16c));if(_0x3f296b){const _0x58d9d2=_0xb5aa1c?_0x72f651(0x16e):_0x72f651(0x175);console[_0x72f651(0x143)](_0x72f651(0x147)+_0x58d9d2+':\x20'+_0x50df79+'/'+_0x579610);}const _0x34e426=await withSpinner(_0x72f651(0x165)+_0x50df79+_0x72f651(0x164),()=>_0x3ae205['llm']['resolveProjectId'](_0x50df79),{'verbose':_0x3f296b}),_0x4c228b=await withSpinner(_0x72f651(0x171)+_0x579610+'\x27...',()=>_0x3ae205[_0x72f651(0x14f)][_0x72f651(0x162)](_0x579610,_0x34e426[_0x72f651(0x14c)]),{'verbose':_0x3f296b});return _0x4c228b[_0x72f651(0x14c)];}else{const _0x46577c=_0x3ae205[_0x72f651(0x14f)][_0x72f651(0x16f)]();if(_0x46577c)return _0x3f296b&&console[_0x72f651(0x143)](_0x72f651(0x15b)+_0x46577c[_0x72f651(0x176)]),_0x46577c['id'];const _0x4e346a=await withSpinner('Getting\x20default\x20agent...',()=>_0x3ae205[_0x72f651(0x14f)]['getOrCreateDefaultAgent'](_0x72f651(0x177),0x0),{'verbose':_0x3f296b});return _0x4e346a['data']['id'];}}async[a8_0x1a7de7(0x174)](_0x9ed5ca){const _0x3f67f7=a8_0x1a7de7,{options:_0x77e216,args:_0x5d19da,tdx:_0x159cf9}=_0x9ed5ca,_0x56483c=_0x5d19da[_0x3f67f7(0x159)]('\x20'),_0x5e239a=_0x77e216,_0x4fabf8=_0x5e239a[_0x3f67f7(0x163)],_0x3b1861=_0x5e239a[_0x3f67f7(0x169)],_0x362d78=_0x5e239a[_0x3f67f7(0x150)],_0x2934a2=_0x5e239a[_0x3f67f7(0x170)];try{let _0x214fe9,_0x5dd2dc;!_0x2934a2&&(_0x5dd2dc=loadLastChatId(),_0x5dd2dc&&_0x77e216[_0x3f67f7(0x156)]&&console[_0x3f67f7(0x143)](_0x3f67f7(0x144)+_0x5dd2dc));(_0x2934a2||!_0x5dd2dc)&&(_0x214fe9=await this[_0x3f67f7(0x140)](_0x159cf9,_0x4fabf8,_0x3b1861,_0x362d78,_0x77e216['verbose']));try{await this[_0x3f67f7(0x16b)](_0x159cf9,_0x56483c,_0x214fe9,_0x5dd2dc,_0x77e216[_0x3f67f7(0x156)]);}catch(_0x3a0337){const _0x3c7f6d=_0x3a0337 instanceof SDKError&&_0x3a0337[_0x3f67f7(0x146)]===ErrorCode[_0x3f67f7(0x166)]||_0x3a0337 instanceof Error&&_0x3a0337['message'][_0x3f67f7(0x15e)](_0x3f67f7(0x154));if(_0x3c7f6d)_0x77e216['verbose']&&console[_0x3f67f7(0x143)](_0x3f67f7(0x155)),!_0x214fe9&&(_0x214fe9=await this['getAgentId'](_0x159cf9,_0x4fabf8,_0x3b1861,_0x362d78,_0x77e216[_0x3f67f7(0x156)])),await this[_0x3f67f7(0x16b)](_0x159cf9,_0x56483c,_0x214fe9,undefined,_0x77e216[_0x3f67f7(0x156)]);else throw _0x3a0337;}return console[_0x3f67f7(0x178)](),0x0;}catch(_0x52d95f){return console['error'](),handleSDKError(_0x52d95f,_0x77e216),0x1;}}[a8_0x1a7de7(0x152)](_0x443ec2){const _0xbe2440=a8_0x1a7de7;if(_0xbe2440(0x161)in _0x443ec2)process[_0xbe2440(0x16a)]['write'](_0x443ec2[_0xbe2440(0x161)]);else _0xbe2440(0x143)in _0x443ec2&&console[_0xbe2440(0x143)](_0xbe2440(0x145)+_0x443ec2[_0xbe2440(0x143)]);}}function a8_0x459d(){const _0x246c53=['469553uKqcTA','5680683RfEIds','join','event','Using\x20cached\x20default\x20agent:\x20','description','407715gGtXHV','includes','16DXZPXB','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','content','resolveAgentId','agent','\x27...','Resolving\x20project\x20\x27','CHAT_NOT_FOUND','chat','649962ZTpqCa','llmAgent','stdout','streamChat','No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22','metadata','--agent\x20flag','getDefaultAgent','new','Resolving\x20agent\x20\x27','\x20\x20Cause:\x20','Error:\x20','execute','session\x20context','name','claude-4.5-haiku','log','message','getAgentId','chatId','132NcDMsD','error','Continuing\x20chat:\x20','\x0aError:\x20','code','Using\x20agent\x20from\x20','591750nifHXb','15201KHIPJX','args','10rkmeCX','data','type','cause','llm','llmProject','217530UZqaUb','handleChatEvent','stack','404','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','verbose'];a8_0x459d=function(){return _0x246c53;};return a8_0x459d();}
1
+ const a8_0x2f8e4e=a8_0x5edc;(function(_0xf108c4,_0x5a7706){const _0x3cb81c=a8_0x5edc,_0x2b4343=_0xf108c4();while(!![]){try{const _0x27f7b1=-parseInt(_0x3cb81c(0x8b))/0x1*(parseInt(_0x3cb81c(0x8c))/0x2)+parseInt(_0x3cb81c(0x90))/0x3+-parseInt(_0x3cb81c(0x9b))/0x4+-parseInt(_0x3cb81c(0xa3))/0x5+-parseInt(_0x3cb81c(0xa8))/0x6+parseInt(_0x3cb81c(0x93))/0x7*(-parseInt(_0x3cb81c(0x84))/0x8)+-parseInt(_0x3cb81c(0x87))/0x9*(-parseInt(_0x3cb81c(0xbd))/0xa);if(_0x27f7b1===_0x5a7706)break;else _0x2b4343['push'](_0x2b4343['shift']());}catch(_0x30dec2){_0x2b4343['push'](_0x2b4343['shift']());}}}(a8_0x3e2d,0x52ec2));import{BaseCommand}from'./command.js';function a8_0x3e2d(){const _0x2dcc66=['16328AZXmwk','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','Chat\x20session:\x20','205587XEkcQD','Using\x20cached\x20default\x20agent:\x20','log','streamChat','29tabGbj','43486lPcXYs','description','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','new','1963050DORIzx','Using\x20agent\x20from\x20','Resolving\x20agent\x20\x27','56khYvje','getOrCreateDefaultAgent','Getting\x20default\x20agent...','content','message','stack','verbose','CHAT_NOT_FOUND','263424ywIBtq','metadata','name','data','stdout','Error:\x20','getAgentId','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','1865655SSJZBP','404','--agent\x20flag','chatId','join','2911218MqHGmH','cause','Continuing\x20chat:\x20','error','claude-4.5-haiku','handleChatEvent','resolveAgentId','\x20\x20Cause:\x20','llmAgent','event','code','type','write','agent','resolveProjectId','llm','\x27...','\x0aStack\x20trace:','\x0aError:\x20','validate','getDefaultAgent','550gZQQiF','execute','No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22'];a8_0x3e2d=function(){return _0x2dcc66;};return a8_0x3e2d();}import{SDKError,ErrorCode}from'../sdk/errors.js';import{withSpinner}from'../utils/spinner.js';import{parseAgentRef}from'../sdk/agent/agent-ref-parser.js';import{saveLastChatId,loadLastChatId}from'../sdk/llm/chat-cache.js';function handleSDKError(_0x3a6980,_0x14397f){const _0x2c32cd=a8_0x5edc;if(_0x3a6980 instanceof SDKError)console[_0x2c32cd(0xab)](_0x2c32cd(0xa0)+_0x3a6980['message']),_0x14397f[_0x2c32cd(0x99)]&&(_0x3a6980[_0x2c32cd(0xa9)]&&console[_0x2c32cd(0xab)](_0x2c32cd(0xaf)+_0x3a6980['cause']),_0x3a6980[_0x2c32cd(0x98)]&&(console[_0x2c32cd(0xab)](_0x2c32cd(0xb9)),console[_0x2c32cd(0xab)](_0x3a6980[_0x2c32cd(0x98)])));else throw _0x3a6980;}function a8_0x5edc(_0x46ff32,_0x55023b){_0x46ff32=_0x46ff32-0x83;const _0x3e2d28=a8_0x3e2d();let _0x5edcf9=_0x3e2d28[_0x46ff32];return _0x5edcf9;}export class ChatCommand extends BaseCommand{[a8_0x2f8e4e(0x9d)]='chat';[a8_0x2f8e4e(0x8d)]=a8_0x2f8e4e(0x85);[a8_0x2f8e4e(0xbb)](_0x3e8557){const _0x17a70e=a8_0x2f8e4e,_0x350e41=_0x3e8557['args'][_0x17a70e(0xa7)]('\x20');if(!_0x350e41)return _0x17a70e(0xa2);return undefined;}async[a8_0x2f8e4e(0x8a)](_0x52a5ac,_0x39a5da,_0x2c7607,_0xfa7ed8,_0x5c9d8d){const _0x4680eb=a8_0x2f8e4e;for await(const _0x4a0a11 of _0x52a5ac[_0x4680eb(0xb7)]['chat'](_0x39a5da,{'agentId':_0x2c7607,'chatId':_0xfa7ed8})){if(_0x4a0a11[_0x4680eb(0xb3)]===_0x4680eb(0x9c)){const _0x587e05=_0x4a0a11[_0x4680eb(0x9e)][_0x4680eb(0xa6)];saveLastChatId(_0x587e05),_0x5c9d8d&&console[_0x4680eb(0xab)](_0x4680eb(0x86)+_0x587e05);}else _0x4a0a11[_0x4680eb(0xb3)]===_0x4680eb(0xb1)&&this[_0x4680eb(0xad)](_0x4a0a11[_0x4680eb(0x9e)]);}}async[a8_0x2f8e4e(0xa1)](_0x151d55,_0x3978f8,_0x3195e6,_0x302753,_0x274d95){const _0x52445e=a8_0x2f8e4e,_0x204b5c=_0x3978f8||_0x3195e6;if(_0x204b5c){const {projectName:_0x5597ec,agentName:_0x274114}=parseAgentRef(_0x204b5c),_0x326109=_0x274114||_0x204b5c,_0x4ac1f4=_0x274114?_0x5597ec:_0x302753;if(!_0x4ac1f4)throw new Error(_0x52445e(0x83));if(_0x274d95){const _0x5ca191=_0x3978f8?_0x52445e(0xa5):'session\x20context';console[_0x52445e(0xab)](_0x52445e(0x91)+_0x5ca191+':\x20'+_0x4ac1f4+'/'+_0x326109);}const _0xc23c52=await withSpinner('Resolving\x20project\x20\x27'+_0x4ac1f4+'\x27...',()=>_0x151d55['llm'][_0x52445e(0xb6)](_0x4ac1f4),{'verbose':_0x274d95}),_0x3bf013=await withSpinner(_0x52445e(0x92)+_0x326109+_0x52445e(0xb8),()=>_0x151d55['llm'][_0x52445e(0xae)](_0x326109,_0xc23c52['data']),{'verbose':_0x274d95});return _0x3bf013[_0x52445e(0x9e)];}else{const _0x8ec951=_0x151d55[_0x52445e(0xb7)][_0x52445e(0xbc)]();if(_0x8ec951)return _0x274d95&&console[_0x52445e(0xab)](_0x52445e(0x88)+_0x8ec951[_0x52445e(0x9d)]),_0x8ec951['id'];const _0x3365c9=await withSpinner(_0x52445e(0x95),()=>_0x151d55[_0x52445e(0xb7)][_0x52445e(0x94)](_0x52445e(0xac),0x0),{'verbose':_0x274d95});return _0x3365c9[_0x52445e(0x9e)]['id'];}}async[a8_0x2f8e4e(0xbe)](_0x315e66){const _0x44c46e=a8_0x2f8e4e,{options:_0x423ce1,args:_0x35abea,tdx:_0x1a1183}=_0x315e66,_0x27e4bd=_0x35abea[_0x44c46e(0xa7)]('\x20'),_0x142ba7=_0x423ce1,_0x5071f3=_0x142ba7[_0x44c46e(0xb5)],_0x38470f=_0x142ba7[_0x44c46e(0xb0)],_0x4e442d=_0x142ba7['llmProject'],_0x5e728a=_0x142ba7[_0x44c46e(0x8f)];try{let _0x4c74a4,_0x53c665;!_0x5e728a&&(_0x53c665=loadLastChatId(),_0x53c665&&_0x423ce1[_0x44c46e(0x99)]&&console[_0x44c46e(0xab)](_0x44c46e(0xaa)+_0x53c665));(_0x5e728a||!_0x53c665)&&(_0x4c74a4=await this['getAgentId'](_0x1a1183,_0x5071f3,_0x38470f,_0x4e442d,_0x423ce1[_0x44c46e(0x99)]));try{await this['streamChat'](_0x1a1183,_0x27e4bd,_0x4c74a4,_0x53c665,_0x423ce1['verbose']);}catch(_0x3ac1f7){const _0x282446=_0x3ac1f7 instanceof SDKError&&_0x3ac1f7[_0x44c46e(0xb2)]===ErrorCode[_0x44c46e(0x9a)]||_0x3ac1f7 instanceof Error&&_0x3ac1f7[_0x44c46e(0x97)]['includes'](_0x44c46e(0xa4));if(_0x282446)_0x423ce1[_0x44c46e(0x99)]&&console['error'](_0x44c46e(0x8e)),!_0x4c74a4&&(_0x4c74a4=await this[_0x44c46e(0xa1)](_0x1a1183,_0x5071f3,_0x38470f,_0x4e442d,_0x423ce1[_0x44c46e(0x99)])),await this['streamChat'](_0x1a1183,_0x27e4bd,_0x4c74a4,undefined,_0x423ce1['verbose']);else throw _0x3ac1f7;}return console[_0x44c46e(0x89)](),0x0;}catch(_0x2714a2){return console[_0x44c46e(0xab)](),handleSDKError(_0x2714a2,_0x423ce1),0x1;}}[a8_0x2f8e4e(0xad)](_0x1cda52){const _0x533bc3=a8_0x2f8e4e;if('content'in _0x1cda52)process[_0x533bc3(0x9f)][_0x533bc3(0xb4)](_0x1cda52[_0x533bc3(0x96)]);else _0x533bc3(0xab)in _0x1cda52&&console['error'](_0x533bc3(0xba)+_0x1cda52['error']);}}