@treasuredata/tdx 0.25.0 → 0.25.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (163) 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/mcp-command.js +1 -1
  24. package/dist/commands/parent-segment-command.js +1 -1
  25. package/dist/commands/profile-command.js +1 -1
  26. package/dist/commands/profiles-command.js +1 -1
  27. package/dist/commands/query-command.js +1 -1
  28. package/dist/commands/schedule-command.js +1 -1
  29. package/dist/commands/segment-command.js +1 -1
  30. package/dist/commands/segment-create-command.js +1 -1
  31. package/dist/commands/segment-fields-command.js +1 -1
  32. package/dist/commands/segment-pull-command.js +1 -1
  33. package/dist/commands/segment-push-command.js +1 -1
  34. package/dist/commands/segment-update-command.js +1 -1
  35. package/dist/commands/segment-use-command.js +1 -1
  36. package/dist/commands/segment-validate-command.js +1 -1
  37. package/dist/commands/segments.js +1 -1
  38. package/dist/commands/show.js +1 -1
  39. package/dist/commands/status-command.js +1 -1
  40. package/dist/commands/tables.js +1 -1
  41. package/dist/commands/unset-command.js +1 -1
  42. package/dist/commands/use-command.js +1 -1
  43. package/dist/commands/user-command.js +1 -1
  44. package/dist/commands/workflow-command.js +1 -1
  45. package/dist/core/auth.js +1 -1
  46. package/dist/core/command-output.js +1 -1
  47. package/dist/core/config.js +1 -1
  48. package/dist/core/connection-cache.js +1 -1
  49. package/dist/core/constants.js +1 -1
  50. package/dist/core/credential-cache.js +1 -1
  51. package/dist/core/global-context.js +1 -1
  52. package/dist/core/keychain.js +1 -1
  53. package/dist/core/profile.js +1 -1
  54. package/dist/core/project-config.js +1 -1
  55. package/dist/core/session.js +1 -1
  56. package/dist/core/user-cache.js +1 -1
  57. package/dist/core/version.js +1 -1
  58. package/dist/index.js +1 -1
  59. package/dist/mcp/server.js +1 -1
  60. package/dist/mcp/tools/index.js +1 -1
  61. package/dist/mcp/tools/tdx-run.js +1 -1
  62. package/dist/mcp/tools/tdx-search.js +1 -1
  63. package/dist/mcp/utils.js +1 -1
  64. package/dist/proxy/claude-usage-tracker.js +1 -1
  65. package/dist/proxy/passthrough-server.js +1 -1
  66. package/dist/proxy/sse-usage-parser.js +1 -1
  67. package/dist/sdk/agent/agent-config.js +1 -1
  68. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  69. package/dist/sdk/agent/agent-yaml.js +1 -1
  70. package/dist/sdk/agent/test/evaluator.js +1 -1
  71. package/dist/sdk/agent/test/executor.js +1 -1
  72. package/dist/sdk/agent/test/index.js +1 -1
  73. package/dist/sdk/agent/test/output.js +1 -1
  74. package/dist/sdk/agent/test/parser.js +1 -1
  75. package/dist/sdk/api.js +1 -1
  76. package/dist/sdk/client/cdp-api-client.js +1 -1
  77. package/dist/sdk/client/endpoints.js +1 -1
  78. package/dist/sdk/client/engage-api-client.js +1 -1
  79. package/dist/sdk/client/http-client.js +1 -1
  80. package/dist/sdk/client/llm-api-client.js +1 -1
  81. package/dist/sdk/client/rate-limiter.js +1 -1
  82. package/dist/sdk/client/td-api-client.js +1 -1
  83. package/dist/sdk/client/trino-api-client.js +1 -1
  84. package/dist/sdk/client/workflow-client.js +1 -1
  85. package/dist/sdk/connection-validator.js +1 -1
  86. package/dist/sdk/connection.js +1 -1
  87. package/dist/sdk/engage.js +1 -1
  88. package/dist/sdk/errors.js +1 -1
  89. package/dist/sdk/index.js +1 -1
  90. package/dist/sdk/io/index.js +1 -1
  91. package/dist/sdk/io/node-filesystem.js +1 -1
  92. package/dist/sdk/job.js +1 -1
  93. package/dist/sdk/journey.js +1 -1
  94. package/dist/sdk/llm/chat-cache.js +1 -1
  95. package/dist/sdk/llm/index.js +1 -1
  96. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  97. package/dist/sdk/llm/model-factors.js +1 -1
  98. package/dist/sdk/query/index.js +1 -1
  99. package/dist/sdk/query/sql-parser.js +1 -1
  100. package/dist/sdk/schedule.js +1 -1
  101. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  102. package/dist/sdk/segment/fields-display.js +1 -1
  103. package/dist/sdk/segment/file-discovery.js +1 -1
  104. package/dist/sdk/segment/journey-utils.js +1 -1
  105. package/dist/sdk/segment/journey-yaml.js +1 -1
  106. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  107. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  108. package/dist/sdk/segment/pull-workflow.js +1 -1
  109. package/dist/sdk/segment/push-workflow.js +1 -1
  110. package/dist/sdk/segment/resolution-context.js +1 -1
  111. package/dist/sdk/segment/segment-path-parser.js +1 -1
  112. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  113. package/dist/sdk/segment/target-resolution.js +1 -1
  114. package/dist/sdk/segment/tdx-config.js +1 -1
  115. package/dist/sdk/segment/validate-files.js +1 -1
  116. package/dist/sdk/segment/yaml-validator.js +1 -1
  117. package/dist/sdk/segment.js +1 -1
  118. package/dist/sdk/types/index.js +1 -1
  119. package/dist/sdk/types/progress.js +1 -1
  120. package/dist/sdk/user.js +1 -1
  121. package/dist/sdk/util/format-detector.js +1 -1
  122. package/dist/sdk/util/formatters.js +1 -1
  123. package/dist/sdk/util/index.js +1 -1
  124. package/dist/sdk/util/tree-formatter.js +1 -1
  125. package/dist/sdk/workflow/archive-validation.js +1 -1
  126. package/dist/sdk/workflow/clone-workflow.js +1 -1
  127. package/dist/sdk/workflow/index.js +1 -1
  128. package/dist/sdk/workflow/pull-workflow.js +1 -1
  129. package/dist/sdk/workflow/push-workflow.js +1 -1
  130. package/dist/sdk/workflow/tdx-config.js +1 -1
  131. package/dist/sdk/workflow/workflow-utils.js +1 -1
  132. package/dist/test-utils/command-runner.js +1 -1
  133. package/dist/test-utils/factories.js +1 -1
  134. package/dist/test-utils/fixtures.js +1 -1
  135. package/dist/test-utils/http-mock.js +1 -1
  136. package/dist/test-utils/index.js +1 -1
  137. package/dist/utils/async.js +1 -1
  138. package/dist/utils/colors.js +1 -1
  139. package/dist/utils/diff.js +1 -1
  140. package/dist/utils/file-permissions.js +1 -1
  141. package/dist/utils/global-cache.js +1 -1
  142. package/dist/utils/json-loader.js +1 -1
  143. package/dist/utils/local-cache.js +1 -1
  144. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  145. package/dist/utils/logger/formatters/index.js +1 -1
  146. package/dist/utils/logger/handlers/console-handler.js +1 -1
  147. package/dist/utils/logger/handlers/file-handler.js +1 -1
  148. package/dist/utils/logger/handlers/index.js +1 -1
  149. package/dist/utils/logger/handlers/null-handler.js +1 -1
  150. package/dist/utils/logger/index.js +1 -1
  151. package/dist/utils/logger/logger.js +1 -1
  152. package/dist/utils/logger/types.js +1 -1
  153. package/dist/utils/option-validation.js +1 -1
  154. package/dist/utils/port.js +1 -1
  155. package/dist/utils/process.js +1 -1
  156. package/dist/utils/prompt.js +1 -1
  157. package/dist/utils/spinner.js +1 -1
  158. package/dist/utils/sse-parser.js +1 -1
  159. package/dist/utils/string-utils.js +1 -1
  160. package/dist/utils/table-ref-parser.js +1 -1
  161. package/dist/utils/tdx-logger.js +1 -1
  162. package/dist/utils/version-check.js +1 -1
  163. package/package.json +1 -1
@@ -1 +1 @@
1
- function a3_0x5370(_0x4db5ff,_0x561c6a){_0x4db5ff=_0x4db5ff-0xf1;const _0xf0b5e7=a3_0xf0b5();let _0x5370c8=_0xf0b5e7[_0x4db5ff];return _0x5370c8;}const a3_0x2be09d=a3_0x5370;(function(_0x3e099b,_0x28f1b9){const _0x3eecfd=a3_0x5370,_0x503ee7=_0x3e099b();while(!![]){try{const _0x1c9f04=parseInt(_0x3eecfd(0xf2))/0x1*(parseInt(_0x3eecfd(0xf6))/0x2)+parseInt(_0x3eecfd(0x10d))/0x3+parseInt(_0x3eecfd(0x10f))/0x4+-parseInt(_0x3eecfd(0x111))/0x5+parseInt(_0x3eecfd(0x106))/0x6+parseInt(_0x3eecfd(0xf7))/0x7*(parseInt(_0x3eecfd(0x10e))/0x8)+-parseInt(_0x3eecfd(0xf5))/0x9;if(_0x1c9f04===_0x28f1b9)break;else _0x503ee7['push'](_0x503ee7['shift']());}catch(_0x2ba02f){_0x503ee7['push'](_0x503ee7['shift']());}}}(a3_0xf0b5,0x20928));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';export class ActivationsCommand extends BaseCommand{[a3_0x2be09d(0xf4)]=a3_0x2be09d(0x102);['description']=a3_0x2be09d(0x101);async[a3_0x2be09d(0xfa)](_0x926939){const _0x27a157=a3_0x2be09d,{options:_0x1871c4,args:_0xfd32b3,tdx:_0x691293}=_0x926939;if(_0xfd32b3[_0x27a157(0x103)]===0x0)return console[_0x27a157(0xf1)](_0x27a157(0x112)),console['error'](_0x27a157(0xf8)),0x1;try{const {parentId:_0x1f4b8f,childId:_0x5a3dd4}=parseSegmentRef(_0xfd32b3[0x0]);if(!_0x5a3dd4)return console[_0x27a157(0xf1)]('Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations'),console[_0x27a157(0xf1)](_0x27a157(0xf8)),0x1;_0x1871c4[_0x27a157(0x107)]&&(console[_0x27a157(0xf1)](_0x27a157(0x108)+_0x1871c4[_0x27a157(0x109)]),console[_0x27a157(0xf1)](_0x27a157(0xfb)+_0x1f4b8f),console[_0x27a157(0xf1)]('Child\x20name:\x20'+_0x5a3dd4));const _0x395188=await withSpinner(_0x27a157(0xfd)+_0x1f4b8f+_0x27a157(0x105),()=>_0x691293[_0x27a157(0x10b)][_0x27a157(0x10c)](_0x1f4b8f),{'verbose':_0x1871c4['verbose']}),_0x4f8692=_0x395188[_0x27a157(0x10a)];_0x1871c4[_0x27a157(0x107)]&&console[_0x27a157(0xf1)](_0x27a157(0x104)+_0x4f8692);const _0x42bdc8=await withSpinner(_0x27a157(0xff)+_0x5a3dd4+'\x27...',()=>_0x691293[_0x27a157(0x10b)]['resolveSegmentId'](_0x4f8692,_0x5a3dd4),{'verbose':_0x1871c4[_0x27a157(0x107)]}),_0xe5292f=_0x42bdc8[_0x27a157(0x10a)];_0x1871c4[_0x27a157(0x107)]&&console['error'](_0x27a157(0xf3)+_0xe5292f);const _0x18e63a=await withSpinner(_0x27a157(0xfe)+_0x5a3dd4+_0x27a157(0x105),()=>_0x691293[_0x27a157(0x10b)][_0x27a157(0x100)](_0x4f8692,_0xe5292f),{'verbose':_0x1871c4[_0x27a157(0x107)]}),_0x289a76=_0x18e63a[_0x27a157(0x10a)];return console[_0x27a157(0xf1)]('✔\x20Found\x20'+_0x289a76[_0x27a157(0x103)]+_0x27a157(0xfc)+(_0x289a76['length']!==0x1?'s':'')),await handleSDKOutput(_0x289a76,_0x1871c4),0x0;}catch(_0x29b0a7){if(_0x29b0a7 instanceof SDKError)return console[_0x27a157(0xf1)]('Error:\x20'+_0x29b0a7[_0x27a157(0x110)]),_0x29b0a7[_0x27a157(0xf9)]&&console[_0x27a157(0xf1)]('\x20\x20Cause:\x20'+_0x29b0a7[_0x27a157(0xf9)]),0x1;throw _0x29b0a7;}}}function a3_0xf0b5(){const _0x5295bd=['name','5968467zBgPGl','178ojUibw','33530ftAyUD','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','cause','execute','Parent\x20name:\x20','\x20activation','Resolving\x20parent\x20segment\x20\x27','Listing\x20activations\x20for\x20segment\x20\x27','Resolving\x20child\x20segment\x20\x27','listActivations','List\x20activations\x20for\x20a\x20segment','activations','length','Resolved\x20parent\x20ID:\x20','\x27...','666390yWINAT','verbose','Site:\x20','site','data','segment','resolveParentId','675162MSRCWK','424gDfkmm','980984NCZSHK','message','1180735kkWNzq','Error:\x20Segment\x20name\x20is\x20required','error','2219tAGIfb','Resolved\x20child\x20ID:\x20'];a3_0xf0b5=function(){return _0x5295bd;};return a3_0xf0b5();}
1
+ const a3_0x308326=a3_0x5e11;(function(_0x4a35c0,_0x2269f6){const _0x426f88=a3_0x5e11,_0x84ff7b=_0x4a35c0();while(!![]){try{const _0xa98a58=parseInt(_0x426f88(0x171))/0x1+-parseInt(_0x426f88(0x174))/0x2*(parseInt(_0x426f88(0x177))/0x3)+parseInt(_0x426f88(0x17a))/0x4+parseInt(_0x426f88(0x183))/0x5*(parseInt(_0x426f88(0x185))/0x6)+parseInt(_0x426f88(0x170))/0x7+parseInt(_0x426f88(0x17b))/0x8+-parseInt(_0x426f88(0x17f))/0x9;if(_0xa98a58===_0x2269f6)break;else _0x84ff7b['push'](_0x84ff7b['shift']());}catch(_0x3324ed){_0x84ff7b['push'](_0x84ff7b['shift']());}}}(a3_0x9e54,0x6e4dd));import{BaseCommand}from'./command.js';function a3_0x5e11(_0x17e4e0,_0x78f345){_0x17e4e0=_0x17e4e0-0x169;const _0x9e54a9=a3_0x9e54();let _0x5e1163=_0x9e54a9[_0x17e4e0];return _0x5e1163;}import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';function a3_0x9e54(){const _0x164c76=['error','data','410Kdpdbu','Resolving\x20child\x20segment\x20\x27','site','6639BvoRsa','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','Error:\x20','2644932AKfxCx','4998984iKGKTA','length','\x20activation','Error:\x20Segment\x20name\x20is\x20required','18098478zuGgoy','cause','Resolved\x20child\x20ID:\x20','\x27...','3572335tBUkGV','listActivations','6BXgZZv','segment','Parent\x20name:\x20','activations','Listing\x20activations\x20for\x20segment\x20\x27','verbose','resolveParentId','resolveSegmentId','Resolving\x20parent\x20segment\x20\x27','Resolved\x20parent\x20ID:\x20','List\x20activations\x20for\x20a\x20segment','✔\x20Found\x20','3703469hRogPc','386772sUDqWb'];a3_0x9e54=function(){return _0x164c76;};return a3_0x9e54();}import{withSpinner}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';export class ActivationsCommand extends BaseCommand{['name']=a3_0x308326(0x188);['description']=a3_0x308326(0x16e);async['execute'](_0x563c8f){const _0x490cb3=a3_0x308326,{options:_0xf338f7,args:_0x276369,tdx:_0x3c4ad3}=_0x563c8f;if(_0x276369[_0x490cb3(0x17c)]===0x0)return console['error'](_0x490cb3(0x17e)),console[_0x490cb3(0x172)]('Usage:\x20tdx\x20activations\x20<parent_name/child_name>'),0x1;try{const {parentId:_0x37f699,childId:_0x287efc}=parseSegmentRef(_0x276369[0x0]);if(!_0x287efc)return console[_0x490cb3(0x172)]('Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations'),console['error'](_0x490cb3(0x178)),0x1;_0xf338f7['verbose']&&(console['error']('Site:\x20'+_0xf338f7[_0x490cb3(0x176)]),console[_0x490cb3(0x172)](_0x490cb3(0x187)+_0x37f699),console[_0x490cb3(0x172)]('Child\x20name:\x20'+_0x287efc));const _0x546aab=await withSpinner(_0x490cb3(0x16c)+_0x37f699+'\x27...',()=>_0x3c4ad3['segment'][_0x490cb3(0x16a)](_0x37f699),{'verbose':_0xf338f7['verbose']}),_0x26acc3=_0x546aab[_0x490cb3(0x173)];_0xf338f7[_0x490cb3(0x169)]&&console[_0x490cb3(0x172)](_0x490cb3(0x16d)+_0x26acc3);const _0x2eb398=await withSpinner(_0x490cb3(0x175)+_0x287efc+_0x490cb3(0x182),()=>_0x3c4ad3[_0x490cb3(0x186)][_0x490cb3(0x16b)](_0x26acc3,_0x287efc),{'verbose':_0xf338f7[_0x490cb3(0x169)]}),_0x2cfffa=_0x2eb398[_0x490cb3(0x173)];_0xf338f7[_0x490cb3(0x169)]&&console[_0x490cb3(0x172)](_0x490cb3(0x181)+_0x2cfffa);const _0x397e52=await withSpinner(_0x490cb3(0x189)+_0x287efc+'\x27...',()=>_0x3c4ad3[_0x490cb3(0x186)][_0x490cb3(0x184)](_0x26acc3,_0x2cfffa),{'verbose':_0xf338f7[_0x490cb3(0x169)]}),_0x16d732=_0x397e52['data'];return console[_0x490cb3(0x172)](_0x490cb3(0x16f)+_0x16d732[_0x490cb3(0x17c)]+_0x490cb3(0x17d)+(_0x16d732[_0x490cb3(0x17c)]!==0x1?'s':'')),await handleSDKOutput(_0x16d732,_0xf338f7),0x0;}catch(_0x5a8830){if(_0x5a8830 instanceof SDKError)return console[_0x490cb3(0x172)](_0x490cb3(0x179)+_0x5a8830['message']),_0x5a8830[_0x490cb3(0x180)]&&console['error']('\x20\x20Cause:\x20'+_0x5a8830['cause']),0x1;throw _0x5a8830;}}}
@@ -1 +1 @@
1
- const a4_0x5d84ce=a4_0x524b;function a4_0x57e1(){const _0xde1231=['\x20unchanged','pullAgent','Would\x20clone:','session','repeat','sourceProjectName','-\x20nothing\x20pushed','no_context','Dry\x20run\x20-\x20no\x20changes\x20made','yes','textKnowledgeBases','llm_project','✔\x20Context\x20set:\x20','Clone\x20\x22','\x20\x20Knowledge\x20Bases:\x20','Using\x20project\x20from\x20','agentName','\x20\x20Integrations:\x20','\x0a✔\x20Pulled\x20','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','newProjectId','352752JMciDW','Would\x20pull\x20agent:\x20','\x22...','Agent\x20pulled\x20successfully','Agent:\x20','total','MISSING_ARGUMENT','\x20\x20Text\x20Knowledge\x20Bases:\x20','INVALID_ARGUMENT','48351braLsg','join','Project\x20cloned\x20with\x20errors','\x27\x20to\x20create\x20the\x20folder\x20structure.','cyan','\x0aPush\x20','\x20\x20tdx\x20agent\x20pull\x20','\x20new','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','\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','\x20total','tdx.json','site','Output\x20path:\x20','Output:\x20','\x20\x20Agents:\x20','<new-name>','\x0aChanges\x20to\x20text\x20knowledge\x20base\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','\x20created','New\x20project:\x20','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Summary:','108CvOUWm','2NkBBnr','error','hasChanges','agentId','dim','\x20\x20Prompt\x20\x22','projectName','yellow','new','Using\x20local\x20project:\x20','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','\x0aWrite\x20','context','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','\x20\x20Agent\x20\x22','updated','agents','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','output','Status:\x20','Cancelled','projectId','agent:clone','-\x20no\x20files\x20written','\x0aChanges\x20to\x20prompt\x20\x27','\x20|\x20','llmProject','\x0aProject\x20pushed\x20with\x20errors','log','\x0aError:','Writing\x20files...','No\x20tdx.json\x20found\x20in\x20','Using\x20current\x20project:\x20','message','Pulling\x20agent\x20\x22','5cebPlj','Agent\x20','\x20changed','projectDir','Using\x20context\x20project:\x20','\x20--name\x20','description','\x20\x20Target:\x20','\x0aChanges:','\x20--profile\x20','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','prompts','profile','push','agent:pull','New\x20project\x20ID:\x20','cloneProject','green','Failed\x20to\x20push\x20agent:\x20','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','10502210RdpyMo','\x22:\x20','\x0aPull\x20summary\x20for\x20\x27','230251uYQlQs','force','Analyzing\x20changes\x20to\x20push...','agent.yml','Errors:','\x20\x20Text\x20Knowledge\x20Base\x20\x22','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','\x0a✔\x20Pushed\x20','\x0aPush\x20summary\x20for\x20\x27','counts','errors','name','2889972PYZMLc','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','Would\x20push\x20agent:\x20','Source:\x20','gray','no_local_folder','\x20\x20Integration\x20\x22','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20successfully','\x20\x20Prompts:\x20','dryRun','Pushing\x20agent\x20from\x20\x22','cwd','\x20errors','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)','outputDir','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20#\x20Pull\x20specific\x20agent','red','utf-8','Chat:\x20','pullProject','\x20\x20Knowledge\x20Base\x20\x22','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','llm','421628gshsWa','Cannot\x20clone\x20from\x20context\x20project\x20\x22','execute','480215uqUDxD','Using\x20project:\x20','agent:push','Pushing\x20to\x20project...','reason','parse','integrations','pushAgent','created','newProjectName','found','\x20=\x20','diff','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','dirname','action','Project:\x20','unchanged','knowledgeBases'];a4_0x57e1=function(){return _0xde1231;};return a4_0x57e1();}(function(_0xa391a6,_0x29ee7e){const _0x1202f7=a4_0x524b,_0x1aa780=_0xa391a6();while(!![]){try{const _0x3a5067=parseInt(_0x1202f7(0x13d))/0x1*(parseInt(_0x1202f7(0x187))/0x2)+-parseInt(_0x1202f7(0x16e))/0x3+-parseInt(_0x1202f7(0x13a))/0x4*(parseInt(_0x1202f7(0x1aa))/0x5)+parseInt(_0x1202f7(0x122))/0x6+-parseInt(_0x1202f7(0x1c1))/0x7+parseInt(_0x1202f7(0x165))/0x8*(parseInt(_0x1202f7(0x186))/0x9)+-parseInt(_0x1202f7(0x1be))/0xa;if(_0x3a5067===_0x29ee7e)break;else _0x1aa780['push'](_0x1aa780['shift']());}catch(_0x3a3cd4){_0x1aa780['push'](_0x1aa780['shift']());}}}(a4_0x57e1,0x45e9f));import a4_0x7da01a from'chalk';function a4_0x524b(_0x31d5b9,_0x5ebc57){_0x31d5b9=_0x31d5b9-0x118;const _0x57e1a6=a4_0x57e1();let _0x524bae=_0x57e1a6[_0x31d5b9];return _0x524bae;}import a4_0x246e7b 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(_0x553e72){const _0x353108=a4_0x524b,_0x50ed6d=[];if(_0x553e72['total']!==undefined)_0x50ed6d[_0x353108(0x1b7)](_0x553e72[_0x353108(0x16a)]+_0x353108(0x178));if(_0x553e72[_0x353108(0x18f)]!==undefined&&_0x553e72[_0x353108(0x18f)]>0x0)_0x50ed6d[_0x353108(0x1b7)](a4_0x7da01a[_0x353108(0x1bb)](_0x553e72[_0x353108(0x18f)]+_0x353108(0x175)));if(_0x553e72[_0x353108(0x145)]!==undefined&&_0x553e72[_0x353108(0x145)]>0x0)_0x50ed6d['push'](a4_0x7da01a[_0x353108(0x1bb)](_0x553e72[_0x353108(0x145)]+_0x353108(0x181)));if(_0x553e72['updated']!==undefined&&_0x553e72['updated']>0x0)_0x50ed6d[_0x353108(0x1b7)](a4_0x7da01a[_0x353108(0x18e)](_0x553e72['updated']+'\x20updated'));if(_0x553e72[_0x353108(0x14e)]!==undefined&&_0x553e72[_0x353108(0x14e)]>0x0)_0x50ed6d[_0x353108(0x1b7)](a4_0x7da01a[_0x353108(0x126)](_0x553e72['unchanged']+_0x353108(0x150)));if(_0x553e72[_0x353108(0x120)]!==undefined&&_0x553e72['errors']>0x0)_0x50ed6d[_0x353108(0x1b7)](a4_0x7da01a[_0x353108(0x133)](_0x553e72[_0x353108(0x120)]+_0x353108(0x12f)));return _0x50ed6d[_0x353108(0x16f)](',\x20');}function displayDiffs(_0x53a4a1,_0x360d5d,_0x26799a,_0x413a0f,_0x1d9eff=[]){const _0x4ce0a0=a4_0x524b;for(const _0xef72b4 of _0x53a4a1){if(_0xef72b4[_0x4ce0a0(0x149)]){const _0x4ad048=_0xef72b4[_0x4ce0a0(0x160)]||_0xef72b4[_0x4ce0a0(0x121)];console[_0x4ce0a0(0x1a3)]('\x0aChanges\x20to\x20agent\x20\x27'+_0x4ad048+'\x27:'),console['log']('─'[_0x4ce0a0(0x154)](0x3c)),console[_0x4ce0a0(0x1a3)](_0xef72b4['diff']),console[_0x4ce0a0(0x1a3)]('─'[_0x4ce0a0(0x154)](0x3c));}}for(const _0x271e9f of _0x360d5d){_0x271e9f['diff']&&(console[_0x4ce0a0(0x1a3)](_0x4ce0a0(0x176)+_0x271e9f[_0x4ce0a0(0x121)]+'\x27:'),console[_0x4ce0a0(0x1a3)]('─'['repeat'](0x3c)),console[_0x4ce0a0(0x1a3)](_0x271e9f[_0x4ce0a0(0x149)]),console[_0x4ce0a0(0x1a3)]('─'['repeat'](0x3c)));}for(const _0xd51b38 of _0x26799a){_0xd51b38[_0x4ce0a0(0x149)]&&(console[_0x4ce0a0(0x1a3)](_0x4ce0a0(0x17f)+_0xd51b38[_0x4ce0a0(0x121)]+'\x27:'),console[_0x4ce0a0(0x1a3)]('─'[_0x4ce0a0(0x154)](0x3c)),console[_0x4ce0a0(0x1a3)](_0xd51b38[_0x4ce0a0(0x149)]),console[_0x4ce0a0(0x1a3)]('─'[_0x4ce0a0(0x154)](0x3c)));}for(const _0x1b876c of _0x413a0f){_0x1b876c[_0x4ce0a0(0x149)]&&(console[_0x4ce0a0(0x1a3)](_0x4ce0a0(0x19f)+_0x1b876c[_0x4ce0a0(0x121)]+'\x27:'),console[_0x4ce0a0(0x1a3)]('─'[_0x4ce0a0(0x154)](0x3c)),console[_0x4ce0a0(0x1a3)](_0x1b876c['diff']),console[_0x4ce0a0(0x1a3)]('─'['repeat'](0x3c)));}for(const _0x1b49ea of _0x1d9eff){_0x1b49ea[_0x4ce0a0(0x149)]&&(console[_0x4ce0a0(0x1a3)]('\x0aChanges\x20to\x20integration\x20\x27'+_0x1b49ea[_0x4ce0a0(0x121)]+'\x27:'),console[_0x4ce0a0(0x1a3)]('─'[_0x4ce0a0(0x154)](0x3c)),console[_0x4ce0a0(0x1a3)](_0x1b49ea[_0x4ce0a0(0x149)]),console[_0x4ce0a0(0x1a3)]('─'[_0x4ce0a0(0x154)](0x3c)));}}export class AgentPullCommand extends BaseCommand{['name']=a4_0x5d84ce(0x1b8);['description']=a4_0x5d84ce(0x138);async[a4_0x5d84ce(0x13c)](_0xd9a46a){const _0x20c8c0=a4_0x5d84ce,{options:_0x10f0ce,args:_0x3aa877,tdx:_0x50d656}=_0xd9a46a,_0x28de78=_0x3aa877[0x0],_0x266286=_0x3aa877[0x1],_0x522079=_0x10f0ce[_0x20c8c0(0x199)],_0x12b46f=_0x10f0ce['dryRun'],_0x175fef=_0x10f0ce[_0x20c8c0(0x1c2)],_0x403541=_0x10f0ce[_0x20c8c0(0x159)],_0x3d2063=_0x10f0ce[_0x20c8c0(0x1a1)];let _0x39ed7f,_0xf9a1b1;const _0x3f9181=findAgentConfigPath(process['cwd']());if(_0x28de78){const _0x33b2cc=a4_0x246e7b[_0x20c8c0(0x16f)](_0x28de78,_0x20c8c0(0x179));if(existsSync(_0x33b2cc))try{const _0x33b0b3=JSON[_0x20c8c0(0x142)](readFileSync(_0x33b2cc,_0x20c8c0(0x134)));_0x39ed7f=_0x33b0b3[_0x20c8c0(0x15b)],_0xf9a1b1=_0x28de78,console['log'](a4_0x7da01a[_0x20c8c0(0x18b)](_0x20c8c0(0x15f)+_0x33b2cc+':\x20'+_0x39ed7f));}catch{_0x39ed7f=_0x28de78;}else _0x39ed7f=_0x28de78;}else{if(_0x3f9181)try{const _0x3fef1f=JSON[_0x20c8c0(0x142)](readFileSync(_0x3f9181,_0x20c8c0(0x134)));_0x39ed7f=_0x3fef1f[_0x20c8c0(0x15b)],_0xf9a1b1=a4_0x246e7b[_0x20c8c0(0x14b)](_0x3f9181),console[_0x20c8c0(0x1a3)](a4_0x7da01a[_0x20c8c0(0x18b)](_0x20c8c0(0x13e)+_0x39ed7f));}catch{_0x39ed7f=_0x3d2063;}else _0x39ed7f=_0x3d2063;}if(!_0x39ed7f)return console[_0x20c8c0(0x1a3)](a4_0x7da01a[_0x20c8c0(0x18e)](_0x20c8c0(0x1b4))),console[_0x20c8c0(0x1a3)](_0x20c8c0(0x130)),console[_0x20c8c0(0x1a3)](_0x20c8c0(0x180)),console[_0x20c8c0(0x1a3)](_0x20c8c0(0x177)),console[_0x20c8c0(0x1a3)](_0x20c8c0(0x132)),0x1;if(_0x266286){const {data:_0x362509}=await withSpinner(_0x20c8c0(0x1a9)+_0x266286+'\x22\x20from\x20project\x20\x22'+_0x39ed7f+'\x22...',()=>_0x50d656[_0x20c8c0(0x139)][_0x20c8c0(0x151)](_0x39ed7f,_0x266286,_0x522079,{'dryRun':_0x12b46f,'force':_0x175fef}));if(_0x12b46f)return console['log'](a4_0x7da01a[_0x20c8c0(0x18e)]('Dry\x20run\x20-\x20no\x20files\x20written')),console[_0x20c8c0(0x1a3)](_0x20c8c0(0x166)+_0x362509['agentName']),console[_0x20c8c0(0x1a3)](_0x20c8c0(0x17b)+_0x362509['outputPath']),_0x362509[_0x20c8c0(0x149)]&&(console[_0x20c8c0(0x1a3)](_0x20c8c0(0x1b2)),console[_0x20c8c0(0x1a3)]('─'[_0x20c8c0(0x154)](0x3c)),console[_0x20c8c0(0x1a3)](_0x362509[_0x20c8c0(0x149)]),console[_0x20c8c0(0x1a3)]('─'['repeat'](0x3c))),0x0;return console[_0x20c8c0(0x1a3)](a4_0x7da01a[_0x20c8c0(0x1bb)](_0x20c8c0(0x168))),console[_0x20c8c0(0x1a3)](_0x20c8c0(0x169)+_0x362509[_0x20c8c0(0x160)]),console[_0x20c8c0(0x1a3)](_0x20c8c0(0x17c)+_0x362509['outputPath']),console[_0x20c8c0(0x1a3)](_0x20c8c0(0x19a)+(_0x362509['isNew']?a4_0x7da01a[_0x20c8c0(0x1bb)](_0x20c8c0(0x18f)):_0x362509[_0x20c8c0(0x189)]?a4_0x7da01a[_0x20c8c0(0x18e)]('updated'):a4_0x7da01a['gray'](_0x20c8c0(0x14e)))),0x0;}const _0x570091=_0xf9a1b1||_0x522079,{data:_0x1b768f}=await withSpinner('Analyzing\x20project\x20\x22'+_0x39ed7f+_0x20c8c0(0x167),()=>_0x50d656[_0x20c8c0(0x139)][_0x20c8c0(0x136)](_0x39ed7f,_0x570091,{'dryRun':!![]})),_0x49ac95=_0x1b768f[_0x20c8c0(0x11f)][_0x20c8c0(0x197)]['new']+_0x1b768f[_0x20c8c0(0x11f)][_0x20c8c0(0x14f)][_0x20c8c0(0x18f)]+_0x1b768f[_0x20c8c0(0x11f)][_0x20c8c0(0x15a)][_0x20c8c0(0x18f)]+_0x1b768f[_0x20c8c0(0x11f)][_0x20c8c0(0x1b5)]['new']+_0x1b768f[_0x20c8c0(0x11f)][_0x20c8c0(0x143)]['new'],_0x7cb790=_0x1b768f['counts'][_0x20c8c0(0x197)][_0x20c8c0(0x196)]+_0x1b768f['counts'][_0x20c8c0(0x14f)]['updated']+_0x1b768f[_0x20c8c0(0x11f)][_0x20c8c0(0x15a)][_0x20c8c0(0x196)]+_0x1b768f[_0x20c8c0(0x11f)][_0x20c8c0(0x1b5)][_0x20c8c0(0x196)]+_0x1b768f['counts'][_0x20c8c0(0x143)][_0x20c8c0(0x196)],_0x598b2e=_0x1b768f['counts'][_0x20c8c0(0x197)][_0x20c8c0(0x14e)]+_0x1b768f['counts']['knowledgeBases']['unchanged']+_0x1b768f[_0x20c8c0(0x11f)][_0x20c8c0(0x15a)][_0x20c8c0(0x14e)]+_0x1b768f[_0x20c8c0(0x11f)]['prompts'][_0x20c8c0(0x14e)]+_0x1b768f['counts']['integrations'][_0x20c8c0(0x14e)];console[_0x20c8c0(0x1a3)](_0x20c8c0(0x1c0)+_0x1b768f['projectName']+'\x27:'),console[_0x20c8c0(0x1a3)]('\x20\x20'+a4_0x7da01a['green']('+\x20'+_0x49ac95+_0x20c8c0(0x175))+_0x20c8c0(0x1a0)+a4_0x7da01a['yellow']('~\x20'+_0x7cb790+_0x20c8c0(0x1ac))+_0x20c8c0(0x1a0)+a4_0x7da01a['dim']('=\x20'+_0x598b2e+'\x20unchanged')),console[_0x20c8c0(0x1a3)](_0x20c8c0(0x17d)+formatCountSummary(_0x1b768f[_0x20c8c0(0x11f)][_0x20c8c0(0x197)])),console[_0x20c8c0(0x1a3)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x1b768f['counts'][_0x20c8c0(0x14f)])),console[_0x20c8c0(0x1a3)](_0x20c8c0(0x16c)+formatCountSummary(_0x1b768f[_0x20c8c0(0x11f)][_0x20c8c0(0x15a)])),console[_0x20c8c0(0x1a3)](_0x20c8c0(0x12b)+formatCountSummary(_0x1b768f['counts'][_0x20c8c0(0x1b5)])),console['log'](_0x20c8c0(0x161)+formatCountSummary(_0x1b768f[_0x20c8c0(0x11f)][_0x20c8c0(0x143)])),console[_0x20c8c0(0x1a3)](_0x20c8c0(0x1b1)+a4_0x7da01a[_0x20c8c0(0x172)](_0x1b768f['outputDir'])),displayDiffs(_0x1b768f['agents'],_0x1b768f[_0x20c8c0(0x14f)],_0x1b768f[_0x20c8c0(0x15a)],_0x1b768f['prompts'],_0x1b768f[_0x20c8c0(0x143)]);if(_0x12b46f)return console[_0x20c8c0(0x1a3)](a4_0x7da01a[_0x20c8c0(0x18e)](_0x20c8c0(0x123))),0x0;if(_0x49ac95===0x0&&_0x7cb790===0x0)return console[_0x20c8c0(0x1a3)](a4_0x7da01a['green'](_0x20c8c0(0x191))),saveSessionContext({'llm_project':_0x1b768f[_0x20c8c0(0x18d)]},_0x10f0ce[_0x20c8c0(0x153)]),console['log'](a4_0x7da01a['green'](_0x20c8c0(0x15c)+a4_0x7da01a['dim'](_0x20c8c0(0x15b))+_0x20c8c0(0x148)+a4_0x7da01a[_0x20c8c0(0x172)](_0x1b768f[_0x20c8c0(0x18d)]))),0x0;if(!_0x403541&&!_0x175fef){if(!isInteractive())return console[_0x20c8c0(0x188)](a4_0x7da01a[_0x20c8c0(0x133)](_0x20c8c0(0x1a4)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x20c8c0(0x188)](a4_0x7da01a['dim'](_0x20c8c0(0x129))),0x1;const _0x4c7cd9=await confirmKey(_0x20c8c0(0x192)+(_0x49ac95+_0x7cb790)+'\x20files?');if(!_0x4c7cd9)return console[_0x20c8c0(0x1a3)](a4_0x7da01a[_0x20c8c0(0x18e)](_0x20c8c0(0x19b)),_0x20c8c0(0x19e)),0x1;}const {data:_0x44df3c}=await withSpinner(_0x20c8c0(0x1a5),()=>_0x50d656['llm'][_0x20c8c0(0x136)](_0x39ed7f,_0x570091,{'force':_0x175fef}));return console[_0x20c8c0(0x1a3)](a4_0x7da01a['green'](_0x20c8c0(0x162)+(_0x49ac95+_0x7cb790)+'\x20files\x20to\x20'+_0x44df3c[_0x20c8c0(0x131)])),saveSessionContext({'llm_project':_0x44df3c[_0x20c8c0(0x18d)]},_0x10f0ce['session']),console['log'](a4_0x7da01a['green']('✔\x20Context\x20set:\x20'+a4_0x7da01a['dim'](_0x20c8c0(0x15b))+'\x20=\x20'+a4_0x7da01a['cyan'](_0x44df3c[_0x20c8c0(0x18d)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x5d84ce(0x121)]=a4_0x5d84ce(0x19d);[a4_0x5d84ce(0x1b0)]=a4_0x5d84ce(0x198);async['execute'](_0x7c7f6){const _0x58cb67=a4_0x5d84ce,{options:_0x18bbf5,args:_0x379895,tdx:_0x57ae8b}=_0x7c7f6,_0x263af2=_0x379895[0x0],_0x17c990=_0x18bbf5['name'],_0x50e87d=_0x18bbf5[_0x58cb67(0x12c)],_0x1d19a6=_0x18bbf5[_0x58cb67(0x159)],_0x47ef1d=_0x18bbf5[_0x58cb67(0x17a)],_0x1f9970=_0x18bbf5[_0x58cb67(0x1a1)];let _0x4324c1;const _0x538227=findAgentConfigPath(process['cwd']());if(_0x263af2){const _0x2744c2=a4_0x246e7b['join'](_0x263af2,_0x58cb67(0x179));existsSync(_0x2744c2)?(_0x4324c1=_0x263af2,console[_0x58cb67(0x1a3)](a4_0x7da01a['dim'](_0x58cb67(0x190)+_0x263af2))):_0x4324c1=_0x263af2;}else{if(_0x538227)_0x4324c1=a4_0x246e7b[_0x58cb67(0x14b)](_0x538227),console[_0x58cb67(0x1a3)](a4_0x7da01a[_0x58cb67(0x18b)](_0x58cb67(0x1a7)+_0x4324c1));else{if(_0x1f9970){const _0x541021=sanitizeForFilesystem(_0x1f9970);let _0x24a054=_0x541021,_0x26dbb1=a4_0x246e7b['join'](process['cwd'](),_0x58cb67(0x197),_0x541021,_0x58cb67(0x179));if(!existsSync(_0x26dbb1)){const _0x4073e6=normalizeName(_0x1f9970),_0x5c7c4a=a4_0x246e7b[_0x58cb67(0x16f)](process[_0x58cb67(0x12e)](),'agents',_0x4073e6,_0x58cb67(0x179));existsSync(_0x5c7c4a)&&(_0x24a054=_0x4073e6,_0x26dbb1=_0x5c7c4a);}if(existsSync(_0x26dbb1))_0x4324c1=a4_0x246e7b[_0x58cb67(0x14b)](_0x26dbb1),console[_0x58cb67(0x1a3)](a4_0x7da01a['dim'](_0x58cb67(0x190)+_0x4324c1));else{const _0x4162d8=_0x18bbf5[_0x58cb67(0x1b6)];if(_0x4162d8)throw new SDKError(ErrorCode[_0x58cb67(0x16d)],_0x58cb67(0x13b)+_0x1f9970+'\x22\x20to\x20a\x20different\x20profile',undefined,{'helpText':_0x58cb67(0x194)+'First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a'+(_0x58cb67(0x174)+_0x1f9970+'\x0a')+('\x20\x20tdx\x20agent\x20clone\x20agents/'+_0x24a054+_0x58cb67(0x1af)+(_0x17c990||_0x58cb67(0x17e))+_0x58cb67(0x1b3)+_0x4162d8)});_0x4324c1=_0x1f9970,console['log'](a4_0x7da01a[_0x58cb67(0x18b)](_0x58cb67(0x1ae)+_0x1f9970));}}}}if(!_0x4324c1)return console[_0x58cb67(0x1a3)](a4_0x7da01a[_0x58cb67(0x18e)]('No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a')),console[_0x58cb67(0x1a3)]('\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project'),console[_0x58cb67(0x1a3)]('\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory'),console[_0x58cb67(0x1a3)]('\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'](_0x58cb67(0x11c)),0x1;if(!_0x17c990)throw new SDKError(ErrorCode[_0x58cb67(0x16b)],'New\x20project\x20name\x20is\x20required',undefined,{'helpText':_0x58cb67(0x163)});if(!_0x1d19a6&&!_0x50e87d){if(!isInteractive())return console[_0x58cb67(0x188)](a4_0x7da01a[_0x58cb67(0x133)](_0x58cb67(0x1a4)),_0x58cb67(0x184)),console[_0x58cb67(0x188)](a4_0x7da01a['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x58b6eb=await confirmKey(_0x58cb67(0x15d)+_0x4324c1+'\x22\x20to\x20new\x20project\x20\x22'+_0x17c990+'\x22?');if(!_0x58b6eb)return console[_0x58cb67(0x1a3)](a4_0x7da01a['yellow'](_0x58cb67(0x19b))),0x1;}const {data:_0x41aa44}=await withSpinner('Cloning\x20\x22'+_0x4324c1+'\x22\x20to\x20\x22'+_0x17c990+_0x58cb67(0x167),()=>_0x57ae8b[_0x58cb67(0x139)][_0x58cb67(0x1ba)](_0x4324c1,_0x17c990,{'dryRun':_0x50e87d}));if(_0x50e87d)return console[_0x58cb67(0x1a3)](a4_0x7da01a[_0x58cb67(0x18e)](_0x58cb67(0x158))),console['log'](_0x58cb67(0x125)+_0x41aa44[_0x58cb67(0x155)]),console['log'](_0x58cb67(0x182)+_0x17c990),console['log'](_0x58cb67(0x152)),console[_0x58cb67(0x1a3)](_0x58cb67(0x17d)+_0x41aa44[_0x58cb67(0x11f)][_0x58cb67(0x197)][_0x58cb67(0x145)]),console[_0x58cb67(0x1a3)](_0x58cb67(0x15e)+_0x41aa44[_0x58cb67(0x11f)][_0x58cb67(0x14f)][_0x58cb67(0x145)]),console[_0x58cb67(0x1a3)]('\x20\x20Prompts:\x20'+_0x41aa44['counts'][_0x58cb67(0x1b5)]['created']),0x0;const _0x32d637=_0x41aa44[_0x58cb67(0x11f)]['agents'][_0x58cb67(0x120)]>0x0||_0x41aa44[_0x58cb67(0x11f)]['knowledgeBases'][_0x58cb67(0x120)]>0x0||_0x41aa44[_0x58cb67(0x11f)][_0x58cb67(0x1b5)][_0x58cb67(0x120)]>0x0;_0x32d637?console['log'](a4_0x7da01a[_0x58cb67(0x18e)](_0x58cb67(0x170))):console['log'](a4_0x7da01a['green']('Project\x20cloned\x20successfully'));console[_0x58cb67(0x1a3)]('Source:\x20'+_0x41aa44[_0x58cb67(0x155)]),console[_0x58cb67(0x1a3)](_0x58cb67(0x182)+_0x41aa44[_0x58cb67(0x146)]),console[_0x58cb67(0x1a3)](_0x58cb67(0x1b9)+_0x41aa44[_0x58cb67(0x164)]),console[_0x58cb67(0x1a3)](),console['log'](_0x58cb67(0x185)),console[_0x58cb67(0x1a3)](_0x58cb67(0x17d)+formatCountSummary(_0x41aa44['counts']['agents'])),console[_0x58cb67(0x1a3)](_0x58cb67(0x15e)+formatCountSummary(_0x41aa44[_0x58cb67(0x11f)][_0x58cb67(0x14f)])),console[_0x58cb67(0x1a3)](_0x58cb67(0x12b)+formatCountSummary(_0x41aa44['counts']['prompts'])),console['log'](_0x58cb67(0x161)+formatCountSummary(_0x41aa44[_0x58cb67(0x11f)][_0x58cb67(0x143)]));if(_0x32d637){console[_0x58cb67(0x1a3)](),console['log'](a4_0x7da01a[_0x58cb67(0x133)](_0x58cb67(0x11a)));for(const _0x4b100a of _0x41aa44[_0x58cb67(0x197)]){_0x4b100a['action']===_0x58cb67(0x188)&&console[_0x58cb67(0x1a3)](a4_0x7da01a[_0x58cb67(0x133)](_0x58cb67(0x195)+_0x4b100a['agentName']+_0x58cb67(0x1bf)+_0x4b100a[_0x58cb67(0x188)]));}for(const _0x51e4f8 of _0x41aa44[_0x58cb67(0x14f)]){_0x51e4f8['action']==='error'&&console['log'](a4_0x7da01a['red'](_0x58cb67(0x137)+_0x51e4f8[_0x58cb67(0x121)]+_0x58cb67(0x1bf)+_0x51e4f8['error']));}for(const _0x5d962d of _0x41aa44[_0x58cb67(0x1b5)]){_0x5d962d[_0x58cb67(0x14c)]===_0x58cb67(0x188)&&console[_0x58cb67(0x1a3)](a4_0x7da01a[_0x58cb67(0x133)]('\x20\x20Prompt\x20\x22'+_0x5d962d[_0x58cb67(0x121)]+_0x58cb67(0x1bf)+_0x5d962d['error']));}for(const _0x1b8cf7 of _0x41aa44['integrations']){_0x1b8cf7['action']===_0x58cb67(0x188)&&console[_0x58cb67(0x1a3)](a4_0x7da01a[_0x58cb67(0x133)]('\x20\x20Integration\x20\x22'+_0x1b8cf7[_0x58cb67(0x121)]+_0x58cb67(0x1bf)+_0x1b8cf7['error']));}return 0x1;}console['log']();const _0x1d78ee=getLLMProjectUrl(_0x47ef1d,_0x41aa44[_0x58cb67(0x164)]);return console[_0x58cb67(0x1a3)](_0x58cb67(0x14d)+a4_0x7da01a[_0x58cb67(0x172)](_0x1d78ee)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x5d84ce(0x121)]=a4_0x5d84ce(0x13f);[a4_0x5d84ce(0x1b0)]='Push\x20local\x20agent\x20files\x20to\x20LLM\x20project';async['execute'](_0x4bd06b){const _0x3a0615=a4_0x5d84ce,{options:_0xb648,args:_0xa00e0f,tdx:_0x43885d}=_0x4bd06b;let _0x1e7d3b=_0xa00e0f[0x0]||process['cwd']();const _0x56362f=_0xb648[_0x3a0615(0x12c)],_0x415fae=_0xb648[_0x3a0615(0x1c2)],_0x397802=_0xb648[_0x3a0615(0x159)],_0x5ec88e=_0xb648[_0x3a0615(0x17a)],_0x496d94=a4_0x246e7b['join'](_0x1e7d3b,_0x3a0615(0x119)),_0xe42347=existsSync(_0x496d94);if(_0xe42347){const {data:_0x22d07c}=await withSpinner(_0x3a0615(0x12d)+_0x1e7d3b+_0x3a0615(0x167),()=>_0x43885d[_0x3a0615(0x139)][_0x3a0615(0x144)](_0x1e7d3b,{'dryRun':_0x56362f,'force':_0x415fae}));if(_0x56362f)return console[_0x3a0615(0x1a3)](a4_0x7da01a['yellow'](_0x3a0615(0x158))),console[_0x3a0615(0x1a3)](_0x3a0615(0x124)+_0x22d07c[_0x3a0615(0x160)]),0x0;if(_0x22d07c[_0x3a0615(0x14c)]===_0x3a0615(0x188))return console['log'](a4_0x7da01a[_0x3a0615(0x133)](_0x3a0615(0x1bc)+_0x22d07c[_0x3a0615(0x188)])),0x1;console[_0x3a0615(0x1a3)](a4_0x7da01a[_0x3a0615(0x1bb)](_0x3a0615(0x1ab)+_0x22d07c['action']+_0x3a0615(0x12a))),console[_0x3a0615(0x1a3)](_0x3a0615(0x169)+_0x22d07c[_0x3a0615(0x160)]);if(_0x22d07c[_0x3a0615(0x18a)]&&_0x22d07c[_0x3a0615(0x19c)]){const _0x2b87ba=getLLMAgentChatUrl(_0x5ec88e,_0x22d07c[_0x3a0615(0x19c)],_0x22d07c[_0x3a0615(0x18a)]);console[_0x3a0615(0x1a3)](_0x3a0615(0x135)+a4_0x7da01a[_0x3a0615(0x172)](_0x2b87ba));}return 0x0;}const _0x1e281e=_0xb648[_0x3a0615(0x1a1)],_0x469b63=resolveProjectFromContext(_0x1e7d3b,_0x1e281e);if(_0x469b63[_0x3a0615(0x147)])_0x1e7d3b=_0x469b63[_0x3a0615(0x1ad)],_0x469b63['source']===_0x3a0615(0x193)&&console['log'](a4_0x7da01a[_0x3a0615(0x18b)](_0x3a0615(0x13e)+_0x1e7d3b));else{let _0xfdbe6a='Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.';_0x469b63[_0x3a0615(0x141)]===_0x3a0615(0x127)&&(_0xfdbe6a=_0x469b63['message']+_0x3a0615(0x14a)+_0x469b63[_0x3a0615(0x1a1)]+_0x3a0615(0x171));throw new SDKError(ErrorCode[_0x3a0615(0x16d)],_0x469b63[_0x3a0615(0x141)]===_0x3a0615(0x157)?_0x469b63[_0x3a0615(0x1a8)]:_0x3a0615(0x1a6)+_0x1e7d3b,undefined,{'helpText':_0xfdbe6a});}const {data:_0x5a561d}=await withSpinner(_0x3a0615(0x118),()=>_0x43885d[_0x3a0615(0x139)]['pushProject'](_0x1e7d3b,{'dryRun':!![]})),_0x32d5fd=_0x5a561d[_0x3a0615(0x11f)][_0x3a0615(0x197)][_0x3a0615(0x120)]>0x0;if(_0x32d5fd){console[_0x3a0615(0x1a3)](a4_0x7da01a[_0x3a0615(0x133)]('\x0aErrors\x20found:'));for(const _0x62a20b of _0x5a561d['agents']){_0x62a20b['action']==='error'&&console['log'](a4_0x7da01a[_0x3a0615(0x133)](_0x3a0615(0x195)+_0x62a20b[_0x3a0615(0x160)]+'\x22:\x20'+_0x62a20b[_0x3a0615(0x188)]));}return 0x1;}const _0x87bc2=_0x5a561d[_0x3a0615(0x11f)][_0x3a0615(0x197)][_0x3a0615(0x145)]+_0x5a561d[_0x3a0615(0x11f)][_0x3a0615(0x14f)][_0x3a0615(0x145)]+_0x5a561d[_0x3a0615(0x11f)]['textKnowledgeBases']['created']+_0x5a561d[_0x3a0615(0x11f)]['prompts']['created']+_0x5a561d[_0x3a0615(0x11f)][_0x3a0615(0x143)][_0x3a0615(0x145)],_0x1a6eb3=_0x5a561d[_0x3a0615(0x11f)][_0x3a0615(0x197)]['updated']+_0x5a561d['counts'][_0x3a0615(0x14f)][_0x3a0615(0x196)]+_0x5a561d[_0x3a0615(0x11f)][_0x3a0615(0x15a)][_0x3a0615(0x196)]+_0x5a561d[_0x3a0615(0x11f)][_0x3a0615(0x1b5)][_0x3a0615(0x196)]+_0x5a561d[_0x3a0615(0x11f)][_0x3a0615(0x143)][_0x3a0615(0x196)],_0x1c87bf=_0x5a561d[_0x3a0615(0x11f)][_0x3a0615(0x197)][_0x3a0615(0x14e)]+_0x5a561d[_0x3a0615(0x11f)][_0x3a0615(0x14f)][_0x3a0615(0x14e)]+_0x5a561d['counts'][_0x3a0615(0x15a)][_0x3a0615(0x14e)]+_0x5a561d[_0x3a0615(0x11f)][_0x3a0615(0x1b5)]['unchanged']+_0x5a561d['counts'][_0x3a0615(0x143)]['unchanged'];console[_0x3a0615(0x1a3)](_0x3a0615(0x11e)+_0x5a561d[_0x3a0615(0x18d)]+'\x27:'),console[_0x3a0615(0x1a3)]('\x20\x20'+a4_0x7da01a[_0x3a0615(0x1bb)]('+\x20'+_0x87bc2+_0x3a0615(0x175))+_0x3a0615(0x1a0)+a4_0x7da01a[_0x3a0615(0x18e)]('~\x20'+_0x1a6eb3+_0x3a0615(0x1ac))+'\x20|\x20'+a4_0x7da01a[_0x3a0615(0x18b)]('=\x20'+_0x1c87bf+_0x3a0615(0x150))),console['log'](_0x3a0615(0x17d)+formatCountSummary(_0x5a561d[_0x3a0615(0x11f)][_0x3a0615(0x197)])),console[_0x3a0615(0x1a3)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x5a561d[_0x3a0615(0x11f)][_0x3a0615(0x14f)])),console[_0x3a0615(0x1a3)](_0x3a0615(0x16c)+formatCountSummary(_0x5a561d[_0x3a0615(0x11f)][_0x3a0615(0x15a)])),console[_0x3a0615(0x1a3)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x5a561d[_0x3a0615(0x11f)][_0x3a0615(0x1b5)])),console[_0x3a0615(0x1a3)](_0x3a0615(0x161)+formatCountSummary(_0x5a561d[_0x3a0615(0x11f)][_0x3a0615(0x143)])),console[_0x3a0615(0x1a3)]('\x20\x20Source:\x20'+a4_0x7da01a[_0x3a0615(0x172)](_0x1e7d3b)),displayDiffs(_0x5a561d['agents'],_0x5a561d['knowledgeBases'],_0x5a561d[_0x3a0615(0x15a)],_0x5a561d[_0x3a0615(0x1b5)],_0x5a561d[_0x3a0615(0x143)]);if(_0x56362f)return console[_0x3a0615(0x1a3)](a4_0x7da01a[_0x3a0615(0x18e)](_0x3a0615(0x1bd))),0x0;if(_0x87bc2===0x0&&_0x1a6eb3===0x0){console[_0x3a0615(0x1a3)](a4_0x7da01a[_0x3a0615(0x1bb)](_0x3a0615(0x183)));const _0x5ba224=getLLMProjectUrl(_0x5ec88e,_0x5a561d['projectId']);return console['log'](_0x3a0615(0x14d)+a4_0x7da01a['cyan'](_0x5ba224)),0x0;}if(!_0x397802&&!_0x415fae){if(!isInteractive())return console['error'](a4_0x7da01a[_0x3a0615(0x133)](_0x3a0615(0x1a4)),_0x3a0615(0x184)),console[_0x3a0615(0x188)](a4_0x7da01a[_0x3a0615(0x18b)](_0x3a0615(0x129))),0x1;const _0x10971e=await confirmKey(_0x3a0615(0x173)+(_0x87bc2+_0x1a6eb3)+'\x20resources?');if(!_0x10971e)return console['log'](a4_0x7da01a['yellow'](_0x3a0615(0x19b)),_0x3a0615(0x156)),0x1;}const {data:_0x34d0c9}=await withSpinner(_0x3a0615(0x140),()=>_0x43885d['llm']['pushProject'](_0x1e7d3b,{'force':_0x415fae})),_0x4fed59=_0x34d0c9[_0x3a0615(0x11f)]['agents'][_0x3a0615(0x120)]>0x0||_0x34d0c9[_0x3a0615(0x11f)][_0x3a0615(0x14f)][_0x3a0615(0x120)]>0x0||_0x34d0c9['counts'][_0x3a0615(0x15a)]['errors']>0x0||_0x34d0c9[_0x3a0615(0x11f)][_0x3a0615(0x1b5)][_0x3a0615(0x120)]>0x0;if(_0x4fed59){console[_0x3a0615(0x1a3)](a4_0x7da01a[_0x3a0615(0x18e)](_0x3a0615(0x1a2))),console[_0x3a0615(0x1a3)](),console[_0x3a0615(0x1a3)](a4_0x7da01a[_0x3a0615(0x133)](_0x3a0615(0x11a)));for(const _0x4af046 of _0x34d0c9[_0x3a0615(0x197)]){_0x4af046[_0x3a0615(0x14c)]===_0x3a0615(0x188)&&console[_0x3a0615(0x1a3)](a4_0x7da01a['red'](_0x3a0615(0x195)+_0x4af046[_0x3a0615(0x160)]+'\x22:\x20'+_0x4af046['error']));}for(const _0x87b25e of _0x34d0c9[_0x3a0615(0x14f)]){_0x87b25e[_0x3a0615(0x14c)]==='error'&&console[_0x3a0615(0x1a3)](a4_0x7da01a[_0x3a0615(0x133)](_0x3a0615(0x137)+_0x87b25e[_0x3a0615(0x121)]+_0x3a0615(0x1bf)+_0x87b25e['error']));}for(const _0x365b86 of _0x34d0c9[_0x3a0615(0x15a)]){_0x365b86['action']===_0x3a0615(0x188)&&console[_0x3a0615(0x1a3)](a4_0x7da01a[_0x3a0615(0x133)](_0x3a0615(0x11b)+_0x365b86['name']+_0x3a0615(0x1bf)+_0x365b86[_0x3a0615(0x188)]));}for(const _0x566dc8 of _0x34d0c9[_0x3a0615(0x1b5)]){_0x566dc8[_0x3a0615(0x14c)]===_0x3a0615(0x188)&&console[_0x3a0615(0x1a3)](a4_0x7da01a[_0x3a0615(0x133)](_0x3a0615(0x18c)+_0x566dc8[_0x3a0615(0x121)]+_0x3a0615(0x1bf)+_0x566dc8['error']));}for(const _0x5648ea of _0x34d0c9[_0x3a0615(0x143)]){_0x5648ea[_0x3a0615(0x14c)]===_0x3a0615(0x188)&&console[_0x3a0615(0x1a3)](a4_0x7da01a[_0x3a0615(0x133)](_0x3a0615(0x128)+_0x5648ea['name']+_0x3a0615(0x1bf)+_0x5648ea[_0x3a0615(0x188)]));}return 0x1;}console[_0x3a0615(0x1a3)](a4_0x7da01a[_0x3a0615(0x1bb)](_0x3a0615(0x11d)+(_0x87bc2+_0x1a6eb3)+'\x20resources\x20to\x20\x27'+_0x34d0c9[_0x3a0615(0x18d)]+'\x27'));const _0x3250d9=getLLMProjectUrl(_0x5ec88e,_0x34d0c9[_0x3a0615(0x19c)]);return console[_0x3a0615(0x1a3)](_0x3a0615(0x14d)+a4_0x7da01a[_0x3a0615(0x172)](_0x3250d9)),0x0;}}
1
+ const a4_0x24ee34=a4_0x2bdb;(function(_0x85b999,_0x413424){const _0x4bb0d0=a4_0x2bdb,_0x9ed7dd=_0x85b999();while(!![]){try{const _0x41cb10=-parseInt(_0x4bb0d0(0x66))/0x1*(-parseInt(_0x4bb0d0(0x6a))/0x2)+parseInt(_0x4bb0d0(0x6c))/0x3+parseInt(_0x4bb0d0(0xb1))/0x4*(parseInt(_0x4bb0d0(0xfb))/0x5)+parseInt(_0x4bb0d0(0x74))/0x6+-parseInt(_0x4bb0d0(0xb3))/0x7+parseInt(_0x4bb0d0(0x9b))/0x8+-parseInt(_0x4bb0d0(0x73))/0x9*(parseInt(_0x4bb0d0(0x9d))/0xa);if(_0x41cb10===_0x413424)break;else _0x9ed7dd['push'](_0x9ed7dd['shift']());}catch(_0x2601b2){_0x9ed7dd['push'](_0x9ed7dd['shift']());}}}(a4_0x346b,0x5872c));import a4_0x362182 from'chalk';function a4_0x346b(){const _0x310b1f=['\x22\x20to\x20a\x20different\x20profile','\x20\x20Prompts:\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','new','found','agent:push','\x22...','green','Pushing\x20agent\x20from\x20\x22','\x20total','hasChanges','created','Failed\x20to\x20push\x20agent:\x20','parse','Analyzing\x20changes\x20to\x20push...','\x20\x20Knowledge\x20Bases:\x20','\x20\x20tdx\x20agent\x20pull\x20','Using\x20local\x20project:\x20','no_context','counts','unchanged','\x20=\x20','\x20\x20Agents:\x20','agent:clone','diff','\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)','Output\x20path:\x20','session','agentId','\x22:\x20','prompts','\x20changed','Analyzing\x20project\x20\x22','Agent\x20pulled\x20successfully','Would\x20pull\x20agent:\x20','\x20new','dirname','\x0aProject\x20pushed\x20with\x20errors','pushProject','outputDir','no_local_folder','output','updated','Using\x20context\x20project:\x20','\x0aError:','\x27\x20to\x20create\x20the\x20folder\x20structure.','action','outputPath','pullProject','Writing\x20files...','\x20\x20Prompt\x20\x22','220Mwfesj','\x20updated','agentName','\x20\x20Integrations:\x20','Project\x20cloned\x20successfully','INVALID_ARGUMENT','projectName','Would\x20clone:','execute','\x0aErrors\x20found:','\x0a✔\x20Pulled\x20','\x20resources?','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','\x20created','llm','2RdtmWL','Output:\x20','Errors:','\x22\x20to\x20new\x20project\x20\x22','109394cPGXfs','textKnowledgeBases','1156794doMzOW','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)','No\x20tdx.json\x20found\x20in\x20','\x0aPush\x20summary\x20for\x20\x27','Using\x20project\x20from\x20','red','\x20unchanged','954VpUNgf','3189774LxkFVE','gray','cyan','\x0aPull\x20summary\x20for\x20\x27','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','Cancelled','utf-8','pullAgent','Cannot\x20clone\x20from\x20context\x20project\x20\x22','dim','\x20\x20Agent\x20\x22','integrations','yellow','cloneProject','Pulling\x20agent\x20\x22','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','Using\x20current\x20project:\x20','\x20|\x20','Cloning\x20\x22','\x0aWrite\x20','total','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','reason','✔\x20Context\x20set:\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','source','knowledgeBases','-\x20nothing\x20pushed','Pushing\x20to\x20project...','\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','\x20\x20Knowledge\x20Base\x20\x22','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','\x0aChanges\x20to\x20prompt\x20\x27','errors','Clone\x20\x22','join','\x20\x20Text\x20Knowledge\x20Bases:\x20','error','4209008mmWXGK','dryRun','131860IqacUY','Agent:\x20','Dry\x20run\x20-\x20no\x20changes\x20made','repeat','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','Chat:\x20','newProjectId','\x20\x20Target:\x20','Dry\x20run\x20-\x20no\x20files\x20written','New\x20project\x20ID:\x20','pushAgent','push','<new-name>','agents','description','name','llmProject','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','message','llm_project','61604OIxqCi','projectDir','3292737xEcVlg','Summary:','\x20\x20Integration\x20\x22','cwd','force','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','\x0aPush\x20','log','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','New\x20project:\x20','\x20files?','sourceProjectName','tdx.json','\x20files\x20to\x20','projectId','\x22\x20to\x20\x22','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','Source:\x20','\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','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','Project:\x20'];a4_0x346b=function(){return _0x310b1f;};return a4_0x346b();}import a4_0x41f431 from'path';import{existsSync,readFileSync}from'fs';function a4_0x2bdb(_0x95d662,_0x524e32){_0x95d662=_0x95d662-0x65;const _0x346b11=a4_0x346b();let _0x2bdb8f=_0x346b11[_0x95d662];return _0x2bdb8f;}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(_0x557a8f){const _0x4136c0=a4_0x2bdb,_0x3db7da=[];if(_0x557a8f[_0x4136c0(0x88)]!==undefined)_0x3db7da['push'](_0x557a8f[_0x4136c0(0x88)]+_0x4136c0(0xd1));if(_0x557a8f[_0x4136c0(0xcb)]!==undefined&&_0x557a8f[_0x4136c0(0xcb)]>0x0)_0x3db7da[_0x4136c0(0xa8)](a4_0x362182['green'](_0x557a8f[_0x4136c0(0xcb)]+_0x4136c0(0xeb)));if(_0x557a8f[_0x4136c0(0xd3)]!==undefined&&_0x557a8f['created']>0x0)_0x3db7da[_0x4136c0(0xa8)](a4_0x362182[_0x4136c0(0xcf)](_0x557a8f[_0x4136c0(0xd3)]+_0x4136c0(0x108)));if(_0x557a8f[_0x4136c0(0xf2)]!==undefined&&_0x557a8f['updated']>0x0)_0x3db7da[_0x4136c0(0xa8)](a4_0x362182[_0x4136c0(0x80)](_0x557a8f['updated']+_0x4136c0(0xfc)));if(_0x557a8f[_0x4136c0(0xdc)]!==undefined&&_0x557a8f[_0x4136c0(0xdc)]>0x0)_0x3db7da['push'](a4_0x362182[_0x4136c0(0x75)](_0x557a8f[_0x4136c0(0xdc)]+_0x4136c0(0x72)));if(_0x557a8f[_0x4136c0(0x96)]!==undefined&&_0x557a8f['errors']>0x0)_0x3db7da[_0x4136c0(0xa8)](a4_0x362182[_0x4136c0(0x71)](_0x557a8f[_0x4136c0(0x96)]+'\x20errors'));return _0x3db7da[_0x4136c0(0x98)](',\x20');}function displayDiffs(_0x5b16d7,_0x1822a3,_0x131300,_0x3a6b2b,_0x27a25e=[]){const _0x48c47f=a4_0x2bdb;for(const _0x2fdcc4 of _0x5b16d7){if(_0x2fdcc4[_0x48c47f(0xe0)]){const _0x106e5a=_0x2fdcc4[_0x48c47f(0xfd)]||_0x2fdcc4[_0x48c47f(0xac)];console[_0x48c47f(0xba)]('\x0aChanges\x20to\x20agent\x20\x27'+_0x106e5a+'\x27:'),console[_0x48c47f(0xba)]('─'[_0x48c47f(0xa0)](0x3c)),console[_0x48c47f(0xba)](_0x2fdcc4[_0x48c47f(0xe0)]),console[_0x48c47f(0xba)]('─'[_0x48c47f(0xa0)](0x3c));}}for(const _0x55d2df of _0x1822a3){_0x55d2df['diff']&&(console[_0x48c47f(0xba)]('\x0aChanges\x20to\x20knowledge\x20base\x20\x27'+_0x55d2df[_0x48c47f(0xac)]+'\x27:'),console[_0x48c47f(0xba)]('─'['repeat'](0x3c)),console[_0x48c47f(0xba)](_0x55d2df[_0x48c47f(0xe0)]),console[_0x48c47f(0xba)]('─'[_0x48c47f(0xa0)](0x3c)));}for(const _0x4b07bf of _0x131300){_0x4b07bf['diff']&&(console[_0x48c47f(0xba)](_0x48c47f(0xae)+_0x4b07bf[_0x48c47f(0xac)]+'\x27:'),console['log']('─'[_0x48c47f(0xa0)](0x3c)),console[_0x48c47f(0xba)](_0x4b07bf[_0x48c47f(0xe0)]),console[_0x48c47f(0xba)]('─'[_0x48c47f(0xa0)](0x3c)));}for(const _0x5d92f0 of _0x3a6b2b){_0x5d92f0[_0x48c47f(0xe0)]&&(console[_0x48c47f(0xba)](_0x48c47f(0x95)+_0x5d92f0[_0x48c47f(0xac)]+'\x27:'),console[_0x48c47f(0xba)]('─'[_0x48c47f(0xa0)](0x3c)),console[_0x48c47f(0xba)](_0x5d92f0['diff']),console[_0x48c47f(0xba)]('─'[_0x48c47f(0xa0)](0x3c)));}for(const _0x24c482 of _0x27a25e){_0x24c482[_0x48c47f(0xe0)]&&(console[_0x48c47f(0xba)]('\x0aChanges\x20to\x20integration\x20\x27'+_0x24c482[_0x48c47f(0xac)]+'\x27:'),console[_0x48c47f(0xba)]('─'[_0x48c47f(0xa0)](0x3c)),console[_0x48c47f(0xba)](_0x24c482[_0x48c47f(0xe0)]),console[_0x48c47f(0xba)]('─'[_0x48c47f(0xa0)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x24ee34(0xac)]='agent:pull';[a4_0x24ee34(0xab)]=a4_0x24ee34(0xc3);async[a4_0x24ee34(0x103)](_0x3e58dd){const _0x202bd8=a4_0x24ee34,{options:_0x22f005,args:_0x529ca3,tdx:_0x26a8ba}=_0x3e58dd,_0x6d409e=_0x529ca3[0x0],_0x5c1520=_0x529ca3[0x1],_0x20dabd=_0x22f005[_0x202bd8(0xf1)],_0x43a38c=_0x22f005[_0x202bd8(0x9c)],_0xc00d91=_0x22f005[_0x202bd8(0xb7)],_0x3e9543=_0x22f005['yes'],_0x4cb8da=_0x22f005[_0x202bd8(0xad)];let _0x6e8001,_0xf40408;const _0x514258=findAgentConfigPath(process['cwd']());if(_0x6d409e){const _0x20b5fc=a4_0x41f431[_0x202bd8(0x98)](_0x6d409e,'tdx.json');if(existsSync(_0x20b5fc))try{const _0x410193=JSON['parse'](readFileSync(_0x20b5fc,_0x202bd8(0x7a)));_0x6e8001=_0x410193[_0x202bd8(0xb0)],_0xf40408=_0x6d409e,console[_0x202bd8(0xba)](a4_0x362182['dim'](_0x202bd8(0x70)+_0x20b5fc+':\x20'+_0x6e8001));}catch{_0x6e8001=_0x6d409e;}else _0x6e8001=_0x6d409e;}else{if(_0x514258)try{const _0x34d993=JSON[_0x202bd8(0xd5)](readFileSync(_0x514258,_0x202bd8(0x7a)));_0x6e8001=_0x34d993[_0x202bd8(0xb0)],_0xf40408=a4_0x41f431[_0x202bd8(0xec)](_0x514258),console[_0x202bd8(0xba)](a4_0x362182[_0x202bd8(0x7d)]('Using\x20project:\x20'+_0x6e8001));}catch{_0x6e8001=_0x4cb8da;}else _0x6e8001=_0x4cb8da;}if(!_0x6e8001)return console['log'](a4_0x362182['yellow'](_0x202bd8(0x83))),console[_0x202bd8(0xba)](_0x202bd8(0x6d)),console['log'](_0x202bd8(0x92)),console[_0x202bd8(0xba)](_0x202bd8(0xc5)),console[_0x202bd8(0xba)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20#\x20Pull\x20specific\x20agent'),0x1;if(_0x5c1520){const {data:_0xde0ed3}=await withSpinner(_0x202bd8(0x82)+_0x5c1520+'\x22\x20from\x20project\x20\x22'+_0x6e8001+_0x202bd8(0xce),()=>_0x26a8ba['llm'][_0x202bd8(0x7b)](_0x6e8001,_0x5c1520,_0x20dabd,{'dryRun':_0x43a38c,'force':_0xc00d91}));if(_0x43a38c)return console[_0x202bd8(0xba)](a4_0x362182[_0x202bd8(0x80)](_0x202bd8(0xa5))),console[_0x202bd8(0xba)](_0x202bd8(0xea)+_0xde0ed3['agentName']),console[_0x202bd8(0xba)](_0x202bd8(0xe2)+_0xde0ed3[_0x202bd8(0xf7)]),_0xde0ed3[_0x202bd8(0xe0)]&&(console['log']('\x0aChanges:'),console[_0x202bd8(0xba)]('─'[_0x202bd8(0xa0)](0x3c)),console[_0x202bd8(0xba)](_0xde0ed3[_0x202bd8(0xe0)]),console[_0x202bd8(0xba)]('─'[_0x202bd8(0xa0)](0x3c))),0x0;return console['log'](a4_0x362182[_0x202bd8(0xcf)](_0x202bd8(0xe9))),console['log'](_0x202bd8(0x9e)+_0xde0ed3['agentName']),console['log'](_0x202bd8(0x67)+_0xde0ed3['outputPath']),console[_0x202bd8(0xba)]('Status:\x20'+(_0xde0ed3['isNew']?a4_0x362182['green'](_0x202bd8(0xcb)):_0xde0ed3[_0x202bd8(0xd2)]?a4_0x362182[_0x202bd8(0x80)](_0x202bd8(0xf2)):a4_0x362182['gray'](_0x202bd8(0xdc)))),0x0;}const _0x40c2be=_0xf40408||_0x20dabd,{data:_0x277d83}=await withSpinner(_0x202bd8(0xe8)+_0x6e8001+_0x202bd8(0xce),()=>_0x26a8ba[_0x202bd8(0x65)]['pullProject'](_0x6e8001,_0x40c2be,{'dryRun':!![]})),_0x1a1036=_0x277d83['counts'][_0x202bd8(0xaa)][_0x202bd8(0xcb)]+_0x277d83[_0x202bd8(0xdb)][_0x202bd8(0x8f)]['new']+_0x277d83[_0x202bd8(0xdb)]['textKnowledgeBases']['new']+_0x277d83[_0x202bd8(0xdb)]['prompts']['new']+_0x277d83[_0x202bd8(0xdb)][_0x202bd8(0x7f)]['new'],_0x1dfd75=_0x277d83[_0x202bd8(0xdb)][_0x202bd8(0xaa)][_0x202bd8(0xf2)]+_0x277d83['counts'][_0x202bd8(0x8f)][_0x202bd8(0xf2)]+_0x277d83[_0x202bd8(0xdb)]['textKnowledgeBases']['updated']+_0x277d83[_0x202bd8(0xdb)]['prompts'][_0x202bd8(0xf2)]+_0x277d83['counts'][_0x202bd8(0x7f)]['updated'],_0x404831=_0x277d83[_0x202bd8(0xdb)][_0x202bd8(0xaa)][_0x202bd8(0xdc)]+_0x277d83[_0x202bd8(0xdb)]['knowledgeBases'][_0x202bd8(0xdc)]+_0x277d83[_0x202bd8(0xdb)]['textKnowledgeBases'][_0x202bd8(0xdc)]+_0x277d83[_0x202bd8(0xdb)][_0x202bd8(0xe6)][_0x202bd8(0xdc)]+_0x277d83[_0x202bd8(0xdb)][_0x202bd8(0x7f)]['unchanged'];console[_0x202bd8(0xba)](_0x202bd8(0x77)+_0x277d83['projectName']+'\x27:'),console['log']('\x20\x20'+a4_0x362182['green']('+\x20'+_0x1a1036+_0x202bd8(0xeb))+'\x20|\x20'+a4_0x362182[_0x202bd8(0x80)]('~\x20'+_0x1dfd75+'\x20changed')+_0x202bd8(0x85)+a4_0x362182[_0x202bd8(0x7d)]('=\x20'+_0x404831+_0x202bd8(0x72))),console[_0x202bd8(0xba)]('\x20\x20Agents:\x20'+formatCountSummary(_0x277d83[_0x202bd8(0xdb)][_0x202bd8(0xaa)])),console[_0x202bd8(0xba)](_0x202bd8(0xd7)+formatCountSummary(_0x277d83[_0x202bd8(0xdb)][_0x202bd8(0x8f)])),console[_0x202bd8(0xba)](_0x202bd8(0x99)+formatCountSummary(_0x277d83['counts'][_0x202bd8(0x6b)])),console[_0x202bd8(0xba)](_0x202bd8(0xc9)+formatCountSummary(_0x277d83[_0x202bd8(0xdb)]['prompts'])),console[_0x202bd8(0xba)](_0x202bd8(0xfe)+formatCountSummary(_0x277d83[_0x202bd8(0xdb)][_0x202bd8(0x7f)])),console[_0x202bd8(0xba)](_0x202bd8(0xa4)+a4_0x362182[_0x202bd8(0x76)](_0x277d83[_0x202bd8(0xef)])),displayDiffs(_0x277d83[_0x202bd8(0xaa)],_0x277d83[_0x202bd8(0x8f)],_0x277d83[_0x202bd8(0x6b)],_0x277d83['prompts'],_0x277d83[_0x202bd8(0x7f)]);if(_0x43a38c)return console[_0x202bd8(0xba)](a4_0x362182['yellow']('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x1a1036===0x0&&_0x1dfd75===0x0)return console[_0x202bd8(0xba)](a4_0x362182[_0x202bd8(0xcf)](_0x202bd8(0x94))),saveSessionContext({'llm_project':_0x277d83[_0x202bd8(0x101)]},_0x22f005[_0x202bd8(0xe3)]),console[_0x202bd8(0xba)](a4_0x362182[_0x202bd8(0xcf)](_0x202bd8(0x8c)+a4_0x362182[_0x202bd8(0x7d)](_0x202bd8(0xb0))+'\x20=\x20'+a4_0x362182[_0x202bd8(0x76)](_0x277d83['projectName']))),0x0;if(!_0x3e9543&&!_0xc00d91){if(!isInteractive())return console['error'](a4_0x362182['red'](_0x202bd8(0xf4)),_0x202bd8(0xca)),console[_0x202bd8(0x9a)](a4_0x362182[_0x202bd8(0x7d)](_0x202bd8(0x8d))),0x1;const _0x3dff80=await confirmKey(_0x202bd8(0x87)+(_0x1a1036+_0x1dfd75)+_0x202bd8(0xbd));if(!_0x3dff80)return console['log'](a4_0x362182[_0x202bd8(0x80)](_0x202bd8(0x79)),'-\x20no\x20files\x20written'),0x1;}const {data:_0x58bbc4}=await withSpinner(_0x202bd8(0xf9),()=>_0x26a8ba[_0x202bd8(0x65)][_0x202bd8(0xf8)](_0x6e8001,_0x40c2be,{'force':_0xc00d91}));return console['log'](a4_0x362182['green'](_0x202bd8(0x105)+(_0x1a1036+_0x1dfd75)+_0x202bd8(0xc0)+_0x58bbc4[_0x202bd8(0xef)])),saveSessionContext({'llm_project':_0x58bbc4[_0x202bd8(0x101)]},_0x22f005['session']),console[_0x202bd8(0xba)](a4_0x362182[_0x202bd8(0xcf)](_0x202bd8(0x8c)+a4_0x362182['dim'](_0x202bd8(0xb0))+_0x202bd8(0xdd)+a4_0x362182['cyan'](_0x58bbc4[_0x202bd8(0x101)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{['name']=a4_0x24ee34(0xdf);['description']='Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project';async['execute'](_0x15014a){const _0x3dfa20=a4_0x24ee34,{options:_0x1c0ad5,args:_0x314beb,tdx:_0x2d49cc}=_0x15014a,_0x2a3f4b=_0x314beb[0x0],_0x53da33=_0x1c0ad5[_0x3dfa20(0xac)],_0x41e315=_0x1c0ad5[_0x3dfa20(0x9c)],_0x1f4216=_0x1c0ad5['yes'],_0x4657a7=_0x1c0ad5['site'],_0x21166c=_0x1c0ad5[_0x3dfa20(0xad)];let _0x581b9e;const _0x186c64=findAgentConfigPath(process[_0x3dfa20(0xb6)]());if(_0x2a3f4b){const _0x45782c=a4_0x41f431[_0x3dfa20(0x98)](_0x2a3f4b,_0x3dfa20(0xbf));existsSync(_0x45782c)?(_0x581b9e=_0x2a3f4b,console[_0x3dfa20(0xba)](a4_0x362182['dim'](_0x3dfa20(0xd9)+_0x2a3f4b))):_0x581b9e=_0x2a3f4b;}else{if(_0x186c64)_0x581b9e=a4_0x41f431[_0x3dfa20(0xec)](_0x186c64),console[_0x3dfa20(0xba)](a4_0x362182[_0x3dfa20(0x7d)](_0x3dfa20(0x84)+_0x581b9e));else{if(_0x21166c){const _0xfe75ce=sanitizeForFilesystem(_0x21166c);let _0x29cddb=_0xfe75ce,_0xf5d37b=a4_0x41f431['join'](process[_0x3dfa20(0xb6)](),_0x3dfa20(0xaa),_0xfe75ce,_0x3dfa20(0xbf));if(!existsSync(_0xf5d37b)){const _0x486081=normalizeName(_0x21166c),_0x4a72b8=a4_0x41f431[_0x3dfa20(0x98)](process[_0x3dfa20(0xb6)](),'agents',_0x486081,_0x3dfa20(0xbf));existsSync(_0x4a72b8)&&(_0x29cddb=_0x486081,_0xf5d37b=_0x4a72b8);}if(existsSync(_0xf5d37b))_0x581b9e=a4_0x41f431['dirname'](_0xf5d37b),console['log'](a4_0x362182[_0x3dfa20(0x7d)](_0x3dfa20(0xd9)+_0x581b9e));else{const _0x28cdcd=_0x1c0ad5['profile'];if(_0x28cdcd)throw new SDKError(ErrorCode[_0x3dfa20(0x100)],_0x3dfa20(0x7c)+_0x21166c+_0x3dfa20(0xc8),undefined,{'helpText':_0x3dfa20(0xbb)+_0x3dfa20(0xb8)+(_0x3dfa20(0xd8)+_0x21166c+'\x0a')+('\x20\x20tdx\x20agent\x20clone\x20agents/'+_0x29cddb+'\x20--name\x20'+(_0x53da33||_0x3dfa20(0xa9))+'\x20--profile\x20'+_0x28cdcd)});_0x581b9e=_0x21166c,console[_0x3dfa20(0xba)](a4_0x362182[_0x3dfa20(0x7d)](_0x3dfa20(0xf3)+_0x21166c));}}}}if(!_0x581b9e)return console[_0x3dfa20(0xba)](a4_0x362182[_0x3dfa20(0x80)](_0x3dfa20(0x89))),console[_0x3dfa20(0xba)]('\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project'),console['log'](_0x3dfa20(0xa1)),console[_0x3dfa20(0xba)](_0x3dfa20(0xe1)),console[_0x3dfa20(0xba)]('\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>'),0x1;if(!_0x53da33)throw new SDKError(ErrorCode['MISSING_ARGUMENT'],'New\x20project\x20name\x20is\x20required',undefined,{'helpText':_0x3dfa20(0x107)});if(!_0x1f4216&&!_0x41e315){if(!isInteractive())return console[_0x3dfa20(0x9a)](a4_0x362182['red'](_0x3dfa20(0xf4)),_0x3dfa20(0xca)),console[_0x3dfa20(0x9a)](a4_0x362182[_0x3dfa20(0x7d)](_0x3dfa20(0x8d))),0x1;const _0x141e91=await confirmKey(_0x3dfa20(0x97)+_0x581b9e+_0x3dfa20(0x69)+_0x53da33+'\x22?');if(!_0x141e91)return console[_0x3dfa20(0xba)](a4_0x362182[_0x3dfa20(0x80)](_0x3dfa20(0x79))),0x1;}const {data:_0x2e1869}=await withSpinner(_0x3dfa20(0x86)+_0x581b9e+_0x3dfa20(0xc2)+_0x53da33+'\x22...',()=>_0x2d49cc[_0x3dfa20(0x65)][_0x3dfa20(0x81)](_0x581b9e,_0x53da33,{'dryRun':_0x41e315}));if(_0x41e315)return console[_0x3dfa20(0xba)](a4_0x362182[_0x3dfa20(0x80)](_0x3dfa20(0x9f))),console[_0x3dfa20(0xba)](_0x3dfa20(0xc4)+_0x2e1869[_0x3dfa20(0xbe)]),console['log'](_0x3dfa20(0xbc)+_0x53da33),console[_0x3dfa20(0xba)](_0x3dfa20(0x102)),console[_0x3dfa20(0xba)]('\x20\x20Agents:\x20'+_0x2e1869[_0x3dfa20(0xdb)][_0x3dfa20(0xaa)][_0x3dfa20(0xd3)]),console[_0x3dfa20(0xba)]('\x20\x20Knowledge\x20Bases:\x20'+_0x2e1869[_0x3dfa20(0xdb)][_0x3dfa20(0x8f)][_0x3dfa20(0xd3)]),console[_0x3dfa20(0xba)](_0x3dfa20(0xc9)+_0x2e1869[_0x3dfa20(0xdb)][_0x3dfa20(0xe6)]['created']),0x0;const _0x10ed23=_0x2e1869[_0x3dfa20(0xdb)]['agents'][_0x3dfa20(0x96)]>0x0||_0x2e1869[_0x3dfa20(0xdb)][_0x3dfa20(0x8f)]['errors']>0x0||_0x2e1869[_0x3dfa20(0xdb)]['prompts'][_0x3dfa20(0x96)]>0x0;_0x10ed23?console[_0x3dfa20(0xba)](a4_0x362182['yellow']('Project\x20cloned\x20with\x20errors')):console[_0x3dfa20(0xba)](a4_0x362182['green'](_0x3dfa20(0xff)));console['log'](_0x3dfa20(0xc4)+_0x2e1869['sourceProjectName']),console[_0x3dfa20(0xba)](_0x3dfa20(0xbc)+_0x2e1869['newProjectName']),console[_0x3dfa20(0xba)](_0x3dfa20(0xa6)+_0x2e1869[_0x3dfa20(0xa3)]),console[_0x3dfa20(0xba)](),console[_0x3dfa20(0xba)](_0x3dfa20(0xb4)),console['log'](_0x3dfa20(0xde)+formatCountSummary(_0x2e1869[_0x3dfa20(0xdb)][_0x3dfa20(0xaa)])),console[_0x3dfa20(0xba)](_0x3dfa20(0xd7)+formatCountSummary(_0x2e1869[_0x3dfa20(0xdb)][_0x3dfa20(0x8f)])),console[_0x3dfa20(0xba)](_0x3dfa20(0xc9)+formatCountSummary(_0x2e1869[_0x3dfa20(0xdb)][_0x3dfa20(0xe6)])),console[_0x3dfa20(0xba)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x2e1869[_0x3dfa20(0xdb)][_0x3dfa20(0x7f)]));if(_0x10ed23){console['log'](),console[_0x3dfa20(0xba)](a4_0x362182['red']('Errors:'));for(const _0x2bae75 of _0x2e1869[_0x3dfa20(0xaa)]){_0x2bae75[_0x3dfa20(0xf6)]==='error'&&console[_0x3dfa20(0xba)](a4_0x362182[_0x3dfa20(0x71)]('\x20\x20Agent\x20\x22'+_0x2bae75[_0x3dfa20(0xfd)]+_0x3dfa20(0xe5)+_0x2bae75[_0x3dfa20(0x9a)]));}for(const _0x4a8f7a of _0x2e1869[_0x3dfa20(0x8f)]){_0x4a8f7a[_0x3dfa20(0xf6)]===_0x3dfa20(0x9a)&&console[_0x3dfa20(0xba)](a4_0x362182[_0x3dfa20(0x71)](_0x3dfa20(0x93)+_0x4a8f7a[_0x3dfa20(0xac)]+_0x3dfa20(0xe5)+_0x4a8f7a[_0x3dfa20(0x9a)]));}for(const _0x551ee4 of _0x2e1869[_0x3dfa20(0xe6)]){_0x551ee4['action']===_0x3dfa20(0x9a)&&console['log'](a4_0x362182[_0x3dfa20(0x71)](_0x3dfa20(0xfa)+_0x551ee4[_0x3dfa20(0xac)]+'\x22:\x20'+_0x551ee4[_0x3dfa20(0x9a)]));}for(const _0x50e305 of _0x2e1869[_0x3dfa20(0x7f)]){_0x50e305['action']===_0x3dfa20(0x9a)&&console[_0x3dfa20(0xba)](a4_0x362182[_0x3dfa20(0x71)](_0x3dfa20(0xb5)+_0x50e305[_0x3dfa20(0xac)]+_0x3dfa20(0xe5)+_0x50e305['error']));}return 0x1;}console[_0x3dfa20(0xba)]();const _0x14511a=getLLMProjectUrl(_0x4657a7,_0x2e1869['newProjectId']);return console[_0x3dfa20(0xba)](_0x3dfa20(0xc7)+a4_0x362182[_0x3dfa20(0x76)](_0x14511a)),0x0;}}export class AgentPushCommand extends BaseCommand{['name']=a4_0x24ee34(0xcd);['description']=a4_0x24ee34(0x78);async[a4_0x24ee34(0x103)](_0xfbc7e4){const _0x50f6b8=a4_0x24ee34,{options:_0x50b31f,args:_0x4e4cbe,tdx:_0x11799f}=_0xfbc7e4;let _0x419a9c=_0x4e4cbe[0x0]||process[_0x50f6b8(0xb6)]();const _0x252262=_0x50b31f[_0x50f6b8(0x9c)],_0x40fe6c=_0x50b31f[_0x50f6b8(0xb7)],_0x1d4b80=_0x50b31f['yes'],_0x283bda=_0x50b31f['site'],_0x49d9aa=a4_0x41f431['join'](_0x419a9c,'agent.yml'),_0x5d9e2a=existsSync(_0x49d9aa);if(_0x5d9e2a){const {data:_0x2408d3}=await withSpinner(_0x50f6b8(0xd0)+_0x419a9c+_0x50f6b8(0xce),()=>_0x11799f[_0x50f6b8(0x65)][_0x50f6b8(0xa7)](_0x419a9c,{'dryRun':_0x252262,'force':_0x40fe6c}));if(_0x252262)return console[_0x50f6b8(0xba)](a4_0x362182[_0x50f6b8(0x80)](_0x50f6b8(0x9f))),console[_0x50f6b8(0xba)]('Would\x20push\x20agent:\x20'+_0x2408d3[_0x50f6b8(0xfd)]),0x0;if(_0x2408d3[_0x50f6b8(0xf6)]===_0x50f6b8(0x9a))return console[_0x50f6b8(0xba)](a4_0x362182[_0x50f6b8(0x71)](_0x50f6b8(0xd4)+_0x2408d3[_0x50f6b8(0x9a)])),0x1;console[_0x50f6b8(0xba)](a4_0x362182[_0x50f6b8(0xcf)]('Agent\x20'+_0x2408d3[_0x50f6b8(0xf6)]+'\x20successfully')),console[_0x50f6b8(0xba)](_0x50f6b8(0x9e)+_0x2408d3[_0x50f6b8(0xfd)]);if(_0x2408d3[_0x50f6b8(0xe4)]&&_0x2408d3[_0x50f6b8(0xc1)]){const _0x5d41fe=getLLMAgentChatUrl(_0x283bda,_0x2408d3[_0x50f6b8(0xc1)],_0x2408d3[_0x50f6b8(0xe4)]);console[_0x50f6b8(0xba)](_0x50f6b8(0xa2)+a4_0x362182[_0x50f6b8(0x76)](_0x5d41fe));}return 0x0;}const _0x9686ce=_0x50b31f[_0x50f6b8(0xad)],_0x5f32b7=resolveProjectFromContext(_0x419a9c,_0x9686ce);if(_0x5f32b7[_0x50f6b8(0xcc)])_0x419a9c=_0x5f32b7[_0x50f6b8(0xb2)],_0x5f32b7[_0x50f6b8(0x8e)]==='context'&&console[_0x50f6b8(0xba)](a4_0x362182['dim']('Using\x20project:\x20'+_0x419a9c));else{let _0x3e8dea=_0x50f6b8(0xc6);_0x5f32b7[_0x50f6b8(0x8b)]===_0x50f6b8(0xf0)&&(_0x3e8dea=_0x5f32b7['message']+_0x50f6b8(0x8a)+_0x5f32b7[_0x50f6b8(0xad)]+_0x50f6b8(0xf5));throw new SDKError(ErrorCode[_0x50f6b8(0x100)],_0x5f32b7[_0x50f6b8(0x8b)]===_0x50f6b8(0xda)?_0x5f32b7[_0x50f6b8(0xaf)]:_0x50f6b8(0x6e)+_0x419a9c,undefined,{'helpText':_0x3e8dea});}const {data:_0x4ced9e}=await withSpinner(_0x50f6b8(0xd6),()=>_0x11799f['llm']['pushProject'](_0x419a9c,{'dryRun':!![]})),_0x4445e6=_0x4ced9e[_0x50f6b8(0xdb)][_0x50f6b8(0xaa)][_0x50f6b8(0x96)]>0x0;if(_0x4445e6){console['log'](a4_0x362182[_0x50f6b8(0x71)](_0x50f6b8(0x104)));for(const _0x312217 of _0x4ced9e[_0x50f6b8(0xaa)]){_0x312217[_0x50f6b8(0xf6)]===_0x50f6b8(0x9a)&&console[_0x50f6b8(0xba)](a4_0x362182['red'](_0x50f6b8(0x7e)+_0x312217[_0x50f6b8(0xfd)]+'\x22:\x20'+_0x312217[_0x50f6b8(0x9a)]));}return 0x1;}const _0x1b7aed=_0x4ced9e[_0x50f6b8(0xdb)]['agents'][_0x50f6b8(0xd3)]+_0x4ced9e[_0x50f6b8(0xdb)][_0x50f6b8(0x8f)][_0x50f6b8(0xd3)]+_0x4ced9e[_0x50f6b8(0xdb)][_0x50f6b8(0x6b)][_0x50f6b8(0xd3)]+_0x4ced9e[_0x50f6b8(0xdb)]['prompts'][_0x50f6b8(0xd3)]+_0x4ced9e[_0x50f6b8(0xdb)][_0x50f6b8(0x7f)][_0x50f6b8(0xd3)],_0x307e66=_0x4ced9e['counts']['agents'][_0x50f6b8(0xf2)]+_0x4ced9e[_0x50f6b8(0xdb)]['knowledgeBases'][_0x50f6b8(0xf2)]+_0x4ced9e['counts'][_0x50f6b8(0x6b)]['updated']+_0x4ced9e[_0x50f6b8(0xdb)]['prompts']['updated']+_0x4ced9e['counts']['integrations']['updated'],_0x173cc2=_0x4ced9e[_0x50f6b8(0xdb)]['agents']['unchanged']+_0x4ced9e[_0x50f6b8(0xdb)]['knowledgeBases']['unchanged']+_0x4ced9e[_0x50f6b8(0xdb)][_0x50f6b8(0x6b)]['unchanged']+_0x4ced9e['counts'][_0x50f6b8(0xe6)][_0x50f6b8(0xdc)]+_0x4ced9e[_0x50f6b8(0xdb)][_0x50f6b8(0x7f)][_0x50f6b8(0xdc)];console[_0x50f6b8(0xba)](_0x50f6b8(0x6f)+_0x4ced9e[_0x50f6b8(0x101)]+'\x27:'),console[_0x50f6b8(0xba)]('\x20\x20'+a4_0x362182[_0x50f6b8(0xcf)]('+\x20'+_0x1b7aed+_0x50f6b8(0xeb))+_0x50f6b8(0x85)+a4_0x362182[_0x50f6b8(0x80)]('~\x20'+_0x307e66+_0x50f6b8(0xe7))+_0x50f6b8(0x85)+a4_0x362182[_0x50f6b8(0x7d)]('=\x20'+_0x173cc2+_0x50f6b8(0x72))),console[_0x50f6b8(0xba)]('\x20\x20Agents:\x20'+formatCountSummary(_0x4ced9e[_0x50f6b8(0xdb)][_0x50f6b8(0xaa)])),console[_0x50f6b8(0xba)](_0x50f6b8(0xd7)+formatCountSummary(_0x4ced9e['counts'][_0x50f6b8(0x8f)])),console[_0x50f6b8(0xba)](_0x50f6b8(0x99)+formatCountSummary(_0x4ced9e[_0x50f6b8(0xdb)][_0x50f6b8(0x6b)])),console[_0x50f6b8(0xba)](_0x50f6b8(0xc9)+formatCountSummary(_0x4ced9e[_0x50f6b8(0xdb)][_0x50f6b8(0xe6)])),console[_0x50f6b8(0xba)](_0x50f6b8(0xfe)+formatCountSummary(_0x4ced9e[_0x50f6b8(0xdb)][_0x50f6b8(0x7f)])),console[_0x50f6b8(0xba)]('\x20\x20Source:\x20'+a4_0x362182[_0x50f6b8(0x76)](_0x419a9c)),displayDiffs(_0x4ced9e['agents'],_0x4ced9e[_0x50f6b8(0x8f)],_0x4ced9e[_0x50f6b8(0x6b)],_0x4ced9e[_0x50f6b8(0xe6)],_0x4ced9e['integrations']);if(_0x252262)return console[_0x50f6b8(0xba)](a4_0x362182['yellow']('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed')),0x0;if(_0x1b7aed===0x0&&_0x307e66===0x0){console['log'](a4_0x362182[_0x50f6b8(0xcf)]('\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date'));const _0x811b7=getLLMProjectUrl(_0x283bda,_0x4ced9e['projectId']);return console['log'](_0x50f6b8(0xc7)+a4_0x362182['cyan'](_0x811b7)),0x0;}if(!_0x1d4b80&&!_0x40fe6c){if(!isInteractive())return console[_0x50f6b8(0x9a)](a4_0x362182['red'](_0x50f6b8(0xf4)),_0x50f6b8(0xca)),console[_0x50f6b8(0x9a)](a4_0x362182['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x4d13d5=await confirmKey(_0x50f6b8(0xb9)+(_0x1b7aed+_0x307e66)+_0x50f6b8(0x106));if(!_0x4d13d5)return console['log'](a4_0x362182[_0x50f6b8(0x80)](_0x50f6b8(0x79)),_0x50f6b8(0x90)),0x1;}const {data:_0x2467b7}=await withSpinner(_0x50f6b8(0x91),()=>_0x11799f[_0x50f6b8(0x65)][_0x50f6b8(0xee)](_0x419a9c,{'force':_0x40fe6c})),_0x517f65=_0x2467b7[_0x50f6b8(0xdb)][_0x50f6b8(0xaa)][_0x50f6b8(0x96)]>0x0||_0x2467b7['counts'][_0x50f6b8(0x8f)][_0x50f6b8(0x96)]>0x0||_0x2467b7['counts'][_0x50f6b8(0x6b)][_0x50f6b8(0x96)]>0x0||_0x2467b7[_0x50f6b8(0xdb)]['prompts']['errors']>0x0;if(_0x517f65){console[_0x50f6b8(0xba)](a4_0x362182[_0x50f6b8(0x80)](_0x50f6b8(0xed))),console[_0x50f6b8(0xba)](),console['log'](a4_0x362182['red'](_0x50f6b8(0x68)));for(const _0xc93781 of _0x2467b7['agents']){_0xc93781[_0x50f6b8(0xf6)]===_0x50f6b8(0x9a)&&console[_0x50f6b8(0xba)](a4_0x362182[_0x50f6b8(0x71)](_0x50f6b8(0x7e)+_0xc93781[_0x50f6b8(0xfd)]+'\x22:\x20'+_0xc93781[_0x50f6b8(0x9a)]));}for(const _0x26604c of _0x2467b7[_0x50f6b8(0x8f)]){_0x26604c[_0x50f6b8(0xf6)]===_0x50f6b8(0x9a)&&console[_0x50f6b8(0xba)](a4_0x362182[_0x50f6b8(0x71)](_0x50f6b8(0x93)+_0x26604c[_0x50f6b8(0xac)]+'\x22:\x20'+_0x26604c[_0x50f6b8(0x9a)]));}for(const _0x18149a of _0x2467b7[_0x50f6b8(0x6b)]){_0x18149a['action']===_0x50f6b8(0x9a)&&console[_0x50f6b8(0xba)](a4_0x362182[_0x50f6b8(0x71)]('\x20\x20Text\x20Knowledge\x20Base\x20\x22'+_0x18149a['name']+_0x50f6b8(0xe5)+_0x18149a[_0x50f6b8(0x9a)]));}for(const _0x183251 of _0x2467b7[_0x50f6b8(0xe6)]){_0x183251[_0x50f6b8(0xf6)]===_0x50f6b8(0x9a)&&console[_0x50f6b8(0xba)](a4_0x362182[_0x50f6b8(0x71)]('\x20\x20Prompt\x20\x22'+_0x183251[_0x50f6b8(0xac)]+_0x50f6b8(0xe5)+_0x183251[_0x50f6b8(0x9a)]));}for(const _0x261c3d of _0x2467b7[_0x50f6b8(0x7f)]){_0x261c3d[_0x50f6b8(0xf6)]===_0x50f6b8(0x9a)&&console[_0x50f6b8(0xba)](a4_0x362182[_0x50f6b8(0x71)](_0x50f6b8(0xb5)+_0x261c3d[_0x50f6b8(0xac)]+_0x50f6b8(0xe5)+_0x261c3d[_0x50f6b8(0x9a)]));}return 0x1;}console[_0x50f6b8(0xba)](a4_0x362182[_0x50f6b8(0xcf)]('\x0a✔\x20Pushed\x20'+(_0x1b7aed+_0x307e66)+'\x20resources\x20to\x20\x27'+_0x2467b7[_0x50f6b8(0x101)]+'\x27'));const _0x14370b=getLLMProjectUrl(_0x283bda,_0x2467b7['projectId']);return console[_0x50f6b8(0xba)](_0x50f6b8(0xc7)+a4_0x362182[_0x50f6b8(0x76)](_0x14370b)),0x0;}}
@@ -1 +1 @@
1
- const a5_0x2a298d=a5_0x5cdc;function a5_0x5cdc(_0x9efe37,_0x4f4318){_0x9efe37=_0x9efe37-0x17c;const _0x3324db=a5_0x3324();let _0x5cdc4f=_0x3324db[_0x9efe37];return _0x5cdc4f;}function a5_0x3324(){const _0x417451=['yellow','executeReeval','Either\x20switch\x20to\x20the\x20\x22','reeval','Test\x20','some','71044EiUHeF','9pjjraH','207473EHzoTI','start','table','3tiKwrR','\x20\x20Agent:\x20','⚠\x20SKIPPED:\x20','171832yrxgAT','projectName','rounds','utf-8','✗\x20FAIL:\x20','Project\x20path:\x20','split','404','found','resolve','length','Cached\x20run\x20is\x20from\x20site\x20\x22','execute','verbose','cyan','json','Test\x20Configuration:','conversation_url','No\x20tests\x20found\x20with\x20tags:\x20','PASS','Executing\x20new\x20tests...','✗\x20ERROR:\x20Project\x20not\x20found:\x20','1500145wuEnwa','map','no_tests','Available\x20tests:\x20','Error:\x20No\x20previous\x20test\x20run\x20found.','has','Evaluating\x20response...','trim','repeat','✗\x20ERROR:\x20','llm','Round\x20','\x20\x20Round\x20','tests','...','substring','\x20\x20Project:\x20','testYmlPath','Site:\x20','Error\x20writing\x20output\x20file:\x20','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','output','toLowerCase','find','Total:\x20\x20\x20\x20','status','tsv','tags','FAIL','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','agent','2709XVHlfl','\x20-\x20','site','\x27\x20to\x20create\x20the\x20folder\x20structure.','testName','add','agent:test','ERROR','stop','562168YWPhPK','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','reason','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','Run\x20\x27tdx\x20agent\x20pull\x20','projectDir','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','text','✓\x20PASS:\x20','\x20(new)','jsonl','now','Running\x20test:\x20',':\x20Sending\x20user\x20input...','\x20(cached)','Agent:\x20','filter','/<agent-name>','...\x20','dim','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','name','no_context','10DxzJrT','Output\x20written\x20to:\x20','Tests\x20found:\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','Duration:\x20','Errors:\x20\x20\x20','log','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','round','not\x20found','\x22:\x20','includes','context','\x20\x20Conversation:\x20','\x20\x20Site:\x20','agentDirs','Test\x20Summary','multiple_agents','push','resolveAgentId','\x22,\x20but\x20current\x20site\x20is\x20\x22','\x20\x20-\x20','agentName','7194UQlZUJ','toISOString','Round\x201/','Using\x20agent:\x20','llmProject','white','\x20\x20Evaluating...\x20','source','Cached\x20run\x20from:\x20','message','red','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','green','test.yml','no_local_folder','join','7791487NjyvlV','existsSync','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','writeFileSync','Conversation\x20URL:\x20','resolveProjectId','isSpinning','Failed:\x20\x20\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22'];a5_0x3324=function(){return _0x417451;};return a5_0x3324();}(function(_0x29b359,_0x44ce9d){const _0x184c9d=a5_0x5cdc,_0x1057aa=_0x29b359();while(!![]){try{const _0x5a732f=-parseInt(_0x184c9d(0x209))/0x1+parseInt(_0x184c9d(0x207))/0x2+parseInt(_0x184c9d(0x20c))/0x3*(-parseInt(_0x184c9d(0x20f))/0x4)+parseInt(_0x184c9d(0x191))/0x5+parseInt(_0x184c9d(0x1e8))/0x6*(-parseInt(_0x184c9d(0x1b1))/0x7)+-parseInt(_0x184c9d(0x1ba))/0x8*(parseInt(_0x184c9d(0x208))/0x9)+-parseInt(_0x184c9d(0x1d1))/0xa*(-parseInt(_0x184c9d(0x1f8))/0xb);if(_0x5a732f===_0x44ce9d)break;else _0x1057aa['push'](_0x1057aa['shift']());}catch(_0x2a90ad){_0x1057aa['push'](_0x1057aa['shift']());}}}(a5_0x3324,0x3f451));import*as a5_0x254c45 from'node:fs';import*as a5_0x4e7ede from'node:path';import a5_0xe176b from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x2a298d(0x1cf)]=a5_0x2a298d(0x1b7);['description']='Run\x20tests\x20for\x20an\x20LLM\x20agent';async[a5_0x2a298d(0x187)](_0x4f9771){const _0x176cd8=a5_0x2a298d,{options:_0x1c0545,args:_0x184f2a,tdx:_0x24029d}=_0x4f9771,_0x2ea2e3=_0x184f2a[0x0]||'.',_0x45bfef=_0x1c0545['dryRun'],_0x30e851=_0x1c0545,_0x3eb44d=_0x30e851['eval']===![],_0x6fc78a=_0x30e851[_0x176cd8(0x204)],_0x3af441=_0x30e851['name'],_0x5d7990=_0x30e851['tags'],_0x96c282=_0x1c0545[_0x176cd8(0x1b3)],_0x1c103b=_0x30e851[_0x176cd8(0x1a7)];if(_0x6fc78a&&_0x3eb44d)return console[_0x176cd8(0x1d7)](a5_0xe176b[_0x176cd8(0x1f2)](_0x176cd8(0x1c0))),0x1;let _0x4b9d6a=_0x176cd8(0x20b);if(_0x30e851['json'])_0x4b9d6a=_0x176cd8(0x18a);else{if(_0x30e851['jsonl'])_0x4b9d6a=_0x176cd8(0x1c4);else{if(_0x30e851['tsv'])_0x4b9d6a=_0x176cd8(0x1ac);else{if(_0x30e851[_0x176cd8(0x20b)])_0x4b9d6a='table';}}}const _0x1cf9e0=_0x30e851['llmProject'];let _0x5eebbe=_0x2ea2e3;const _0x597be6=a5_0x254c45[_0x176cd8(0x1f9)](_0x2ea2e3),_0x5564d7=_0x2ea2e3==='.';if(!_0x597be6||_0x5564d7){const _0x32c9ff=resolveProjectFromContext(_0x2ea2e3,_0x1cf9e0,{'requireFile':_0x176cd8(0x1f5)});if(_0x32c9ff[_0x176cd8(0x183)])_0x5eebbe=_0x32c9ff[_0x176cd8(0x1bf)],_0x32c9ff[_0x176cd8(0x1ef)]===_0x176cd8(0x1dd)&&console['log'](a5_0xe176b[_0x176cd8(0x1cd)](_0x176cd8(0x1eb)+_0x5eebbe));else switch(_0x32c9ff[_0x176cd8(0x1bc)]){case _0x176cd8(0x1d0):console[_0x176cd8(0x1d7)](a5_0xe176b['yellow'](_0x32c9ff[_0x176cd8(0x1f1)])),console[_0x176cd8(0x1d7)](),console[_0x176cd8(0x1d7)]('Usage:'),console['log']('\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[_0x176cd8(0x1d7)]('\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[_0x176cd8(0x1d7)](),console[_0x176cd8(0x1d7)](_0x176cd8(0x1fa));return 0x1;case _0x176cd8(0x1f6):console['log'](a5_0xe176b[_0x176cd8(0x201)](_0x32c9ff[_0x176cd8(0x1f1)])),console[_0x176cd8(0x1d7)](),console[_0x176cd8(0x1d7)](_0x176cd8(0x1be)+_0x32c9ff[_0x176cd8(0x1ec)]+_0x176cd8(0x1b4));return 0x1;case _0x176cd8(0x1e2):{const _0x2f65f9=a5_0x4e7ede['basename'](_0x32c9ff['projectDir']);console[_0x176cd8(0x1d7)](a5_0xe176b[_0x176cd8(0x201)]('Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22'+_0x32c9ff[_0x176cd8(0x1ec)]+'\x22:'));for(const _0x50fb1d of _0x32c9ff[_0x176cd8(0x1e0)]){console[_0x176cd8(0x1d7)](_0x176cd8(0x1e6)+_0x50fb1d);}return console['log'](),console[_0x176cd8(0x1d7)](_0x176cd8(0x1f3)+_0x2f65f9+_0x176cd8(0x1cb)),0x1;}case _0x176cd8(0x193):console[_0x176cd8(0x1d7)](a5_0xe176b['yellow'](_0x176cd8(0x1a5)+_0x32c9ff[_0x176cd8(0x1ec)]+'\x22.')),console[_0x176cd8(0x1d7)](a5_0xe176b[_0x176cd8(0x1cd)](_0x176cd8(0x180)+_0x32c9ff['projectDir'])),console['log'](),console[_0x176cd8(0x1d7)]('Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.');return 0x1;}}const {definition:_0x332691,agentInfo:_0x75c9b8}=parseTestFile(_0x5eebbe);let _0x503f8e=_0x332691['tests'];if(_0x3af441){const _0x481f68=_0x3af441['split'](',')['map'](_0x582f0d=>_0x582f0d['trim']());_0x503f8e=_0x332691[_0x176cd8(0x19e)][_0x176cd8(0x1ca)](_0x5d7a14=>_0x481f68[_0x176cd8(0x1dc)](_0x5d7a14[_0x176cd8(0x1cf)]));if(_0x503f8e['length']===0x0)return console['log'](a5_0xe176b['yellow']('No\x20tests\x20found\x20matching:\x20'+_0x3af441)),console[_0x176cd8(0x1d7)](a5_0xe176b['dim'](_0x176cd8(0x194)+_0x332691[_0x176cd8(0x19e)][_0x176cd8(0x192)](_0x36a691=>_0x36a691[_0x176cd8(0x1cf)])[_0x176cd8(0x1f7)](',\x20'))),0x1;}if(_0x5d7990){const _0x47d0c8=_0x5d7990[_0x176cd8(0x181)](',')['map'](_0x4477b7=>_0x4477b7[_0x176cd8(0x198)]()[_0x176cd8(0x1a8)]());_0x503f8e=_0x503f8e[_0x176cd8(0x1ca)](_0x1fb807=>_0x1fb807[_0x176cd8(0x1ad)]?.[_0x176cd8(0x206)](_0x184a24=>_0x47d0c8[_0x176cd8(0x1dc)](_0x184a24[_0x176cd8(0x1a8)]())));if(_0x503f8e[_0x176cd8(0x185)]===0x0){console['log'](a5_0xe176b['yellow'](_0x176cd8(0x18d)+_0x5d7990));const _0x474d39=new Set();return _0x332691[_0x176cd8(0x19e)]['forEach'](_0xa4f8d3=>_0xa4f8d3['tags']?.['forEach'](_0x3f5406=>_0x474d39[_0x176cd8(0x1b6)](_0x3f5406))),_0x474d39['size']>0x0?console[_0x176cd8(0x1d7)](a5_0xe176b['dim']('Available\x20tags:\x20'+[..._0x474d39][_0x176cd8(0x1f7)](',\x20'))):console[_0x176cd8(0x1d7)](a5_0xe176b[_0x176cd8(0x1cd)]('No\x20tests\x20have\x20tags\x20defined.')),0x1;}}if(_0x6fc78a)return this[_0x176cd8(0x202)](_0x4f9771,{'definition':{'tests':_0x503f8e},'agentInfo':_0x75c9b8,'outputFormat':_0x4b9d6a,'outputFile':_0x1c103b,'testNames':_0x3af441});if(_0x45bfef){console[_0x176cd8(0x1d7)](a5_0xe176b[_0x176cd8(0x189)](_0x176cd8(0x18b))),console['log'](_0x176cd8(0x1df)+a5_0xe176b['white'](_0x96c282)),console[_0x176cd8(0x1d7)](_0x176cd8(0x1a1)+a5_0xe176b[_0x176cd8(0x1ed)](_0x75c9b8[_0x176cd8(0x17c)])),console[_0x176cd8(0x1d7)](_0x176cd8(0x20d)+a5_0xe176b[_0x176cd8(0x1ed)](_0x75c9b8[_0x176cd8(0x1e7)])),console[_0x176cd8(0x1d7)](),console[_0x176cd8(0x1d7)](_0x176cd8(0x1d3)+a5_0xe176b['white'](_0x503f8e['length']));for(let _0x17efed=0x0;_0x17efed<_0x503f8e[_0x176cd8(0x185)];_0x17efed++){const _0x5933dc=_0x503f8e[_0x17efed],_0x2228bb=_0x5933dc[_0x176cd8(0x17d)][_0x176cd8(0x185)]===0x1?_0x176cd8(0x1d9):'rounds',_0x1e565f=_0x5933dc['tags']?.['length']?'\x20['+_0x5933dc[_0x176cd8(0x1ad)][_0x176cd8(0x1f7)](',\x20')+']':'';console[_0x176cd8(0x1d7)]('\x20\x20'+(_0x17efed+0x1)+'.\x20'+a5_0xe176b['white'](_0x5933dc[_0x176cd8(0x1cf)])+'\x20('+_0x5933dc[_0x176cd8(0x17d)][_0x176cd8(0x185)]+'\x20'+_0x2228bb+')'+a5_0xe176b[_0x176cd8(0x1cd)](_0x1e565f));}return 0x0;}let _0x2aabba,_0x1b7bbd;try{_0x2aabba=await _0x24029d[_0x176cd8(0x19b)][_0x176cd8(0x1fd)](_0x75c9b8[_0x176cd8(0x17c)]);}catch(_0x33536b){const _0x324761=_0x33536b instanceof Error?_0x33536b['message']:String(_0x33536b);return _0x324761[_0x176cd8(0x1dc)](_0x176cd8(0x182))||_0x324761['toLowerCase']()[_0x176cd8(0x1dc)](_0x176cd8(0x1da))?console[_0x176cd8(0x1d7)](a5_0xe176b[_0x176cd8(0x1f2)](_0x176cd8(0x190)+_0x75c9b8[_0x176cd8(0x17c)])):console['log'](a5_0xe176b[_0x176cd8(0x1f2)](_0x176cd8(0x200)+_0x75c9b8[_0x176cd8(0x17c)]+_0x176cd8(0x1db)+_0x324761)),0x1;}try{_0x1b7bbd=await _0x24029d[_0x176cd8(0x19b)][_0x176cd8(0x1e4)](_0x75c9b8[_0x176cd8(0x1e7)],_0x2aabba);}catch(_0x46ffb3){const _0x3b8bcd=_0x46ffb3 instanceof Error?_0x46ffb3[_0x176cd8(0x1f1)]:String(_0x46ffb3);return _0x3b8bcd['includes'](_0x176cd8(0x182))||_0x3b8bcd['toLowerCase']()[_0x176cd8(0x1dc)]('not\x20found')?console[_0x176cd8(0x1d7)](a5_0xe176b[_0x176cd8(0x1f2)]('✗\x20ERROR:\x20Agent\x20not\x20found:\x20'+_0x75c9b8[_0x176cd8(0x1e7)])):console['log'](a5_0xe176b[_0x176cd8(0x1f2)](_0x176cd8(0x1d4)+_0x75c9b8[_0x176cd8(0x1e7)]+'\x22:\x20'+_0x3b8bcd)),0x1;}let _0x278da9;if(!_0x3eb44d)try{_0x278da9=await setupEvaluatorAgent(_0x24029d[_0x176cd8(0x19b)],_0x1c0545[_0x176cd8(0x188)]);}catch(_0x259a03){const _0x1fb1fb=_0x259a03 instanceof Error?_0x259a03[_0x176cd8(0x1f1)]:String(_0x259a03);return console[_0x176cd8(0x1d7)](a5_0xe176b['red'](_0x176cd8(0x1af)+_0x1fb1fb)),0x1;}console[_0x176cd8(0x1d7)](a5_0xe176b['cyan']('Running\x20agent\x20tests...')),console[_0x176cd8(0x1d7)](_0x176cd8(0x1a3)+a5_0xe176b[_0x176cd8(0x1ed)](_0x96c282)),console[_0x176cd8(0x1d7)]('Agent:\x20'+a5_0xe176b[_0x176cd8(0x1ed)](_0x75c9b8['projectName']+'/'+_0x75c9b8[_0x176cd8(0x1e7)])),console[_0x176cd8(0x1d7)]();const _0x204375=[],_0x4b5333=[],_0x1b7002=Date[_0x176cd8(0x1c5)]();for(let _0x4e891a=0x0;_0x4e891a<_0x503f8e[_0x176cd8(0x185)];_0x4e891a++){const _0x4c39e3=_0x503f8e[_0x4e891a];_0x503f8e[_0x176cd8(0x185)]>0x1?console[_0x176cd8(0x1d7)](_0x176cd8(0x205)+(_0x4e891a+0x1)+'/'+_0x503f8e[_0x176cd8(0x185)]+':\x20'+a5_0xe176b[_0x176cd8(0x1ed)](_0x4c39e3[_0x176cd8(0x1cf)])):console[_0x176cd8(0x1d7)](_0x176cd8(0x1c6)+a5_0xe176b[_0x176cd8(0x1ed)](_0x4c39e3['name']));const _0xd0904d=createCommandSpinner(_0x176cd8(0x1ea)+_0x4c39e3[_0x176cd8(0x17d)][_0x176cd8(0x185)]+_0x176cd8(0x1c7));_0xd0904d[_0x176cd8(0x20a)]();try{const {result:_0x44a8d4,conversation:_0x1c65f5}=await runTest(_0x24029d[_0x176cd8(0x19b)],_0x4c39e3,{'agentId':_0x1b7bbd,'projectId':_0x2aabba,'site':_0x96c282,'noEval':_0x3eb44d,'evaluatorId':_0x278da9,'onRoundStart':(_0xdb1fef,_0xd40d59)=>{const _0x253526=_0x176cd8;_0xd0904d['text']=_0x253526(0x19c)+(_0xdb1fef+0x1)+'/'+_0xd40d59+_0x253526(0x1c7);},'onRoundComplete':(_0x4db844,_0x146ae0,_0x59afba)=>{const _0x379579=_0x176cd8,_0x12754d=formatElapsed(_0x146ae0);_0x59afba?console[_0x379579(0x1d7)](_0x379579(0x19d)+(_0x4db844+0x1)+'/'+_0x4c39e3['rounds'][_0x379579(0x185)]+_0x379579(0x1cc)+a5_0xe176b[_0x379579(0x1f4)]('✓')+'\x20('+_0x12754d+')'):console[_0x379579(0x1d7)](_0x379579(0x19d)+(_0x4db844+0x1)+'/'+_0x4c39e3[_0x379579(0x17d)][_0x379579(0x185)]+'...\x20'+a5_0xe176b[_0x379579(0x1f2)]('✗'));},'onEvaluationStart':()=>{const _0x1c140c=_0x176cd8;_0xd0904d['text']=_0x1c140c(0x197);},'onEvaluationComplete':_0x585c33=>{const _0xba1aba=_0x176cd8,_0x2f05b5=formatElapsed(_0x585c33);console[_0xba1aba(0x1d7)](_0xba1aba(0x1ee)+a5_0xe176b[_0xba1aba(0x1f4)]('✓')+'\x20('+_0x2f05b5+')');}});_0xd0904d[_0x176cd8(0x1b9)](),_0x204375['push'](_0x44a8d4),_0x4b5333[_0x176cd8(0x1e3)](_0x1c65f5);if(_0x44a8d4[_0x176cd8(0x1ab)]===_0x176cd8(0x18e))console[_0x176cd8(0x1d7)](a5_0xe176b[_0x176cd8(0x1f4)](_0x176cd8(0x1c2)+_0x44a8d4['reason']));else _0x44a8d4[_0x176cd8(0x1ab)]===_0x176cd8(0x1ae)?console['log'](a5_0xe176b[_0x176cd8(0x1f2)](_0x176cd8(0x17f)+_0x44a8d4[_0x176cd8(0x1bc)])):console[_0x176cd8(0x1d7)](a5_0xe176b[_0x176cd8(0x1f2)](_0x176cd8(0x19a)+_0x44a8d4[_0x176cd8(0x1bc)]));_0x44a8d4[_0x176cd8(0x18c)]&&console[_0x176cd8(0x1d7)](a5_0xe176b[_0x176cd8(0x1cd)](_0x176cd8(0x1fc)+_0x44a8d4[_0x176cd8(0x18c)])),console[_0x176cd8(0x1d7)]();}catch(_0x27e11f){_0xd0904d[_0x176cd8(0x1b9)]();const _0x26ee50=_0x27e11f instanceof Error?_0x27e11f[_0x176cd8(0x1f1)]:String(_0x27e11f);console['log'](a5_0xe176b[_0x176cd8(0x1f2)](_0x176cd8(0x19a)+_0x26ee50)),console[_0x176cd8(0x1d7)](),_0x204375[_0x176cd8(0x1e3)]({'name':_0x4c39e3['name'],'status':'ERROR','reason':_0x26ee50,'timestamp':new Date()[_0x176cd8(0x1e9)](),'duration_ms':0x0});}}const _0x37f180=Date[_0x176cd8(0x1c5)]()-_0x1b7002,_0xa2c08d=_0x204375['filter'](_0x4de6da=>_0x4de6da[_0x176cd8(0x1ab)]===_0x176cd8(0x18e))[_0x176cd8(0x185)],_0x259345=_0x204375[_0x176cd8(0x1ca)](_0x319745=>_0x319745[_0x176cd8(0x1ab)]===_0x176cd8(0x1ae))[_0x176cd8(0x185)],_0x135acb=_0x204375[_0x176cd8(0x1ca)](_0x503319=>_0x503319['status']===_0x176cd8(0x1b8))['length'];console['log']('━'[_0x176cd8(0x199)](0x3c)),console[_0x176cd8(0x1d7)](_0x176cd8(0x1e1)),console[_0x176cd8(0x1d7)]('━'['repeat'](0x3c)),console['log'](_0x176cd8(0x1aa)+_0x204375[_0x176cd8(0x185)]),console[_0x176cd8(0x1d7)]('Passed:\x20\x20\x20'+a5_0xe176b[_0x176cd8(0x1f4)](_0xa2c08d)),console[_0x176cd8(0x1d7)](_0x176cd8(0x1ff)+a5_0xe176b[_0x176cd8(0x1f2)](_0x259345));_0x135acb>0x0&&console[_0x176cd8(0x1d7)](_0x176cd8(0x1d6)+a5_0xe176b[_0x176cd8(0x1f2)](_0x135acb));console[_0x176cd8(0x1d7)](_0x176cd8(0x1d5)+formatElapsed(_0x37f180)),console[_0x176cd8(0x1d7)]('━'[_0x176cd8(0x199)](0x3c));const _0x484f2a=_0x204375[_0x176cd8(0x1ca)](_0x519cb7=>_0x519cb7['status']!=='PASS');if(_0x484f2a[_0x176cd8(0x185)]>0x0){console[_0x176cd8(0x1d7)](),console[_0x176cd8(0x1d7)]('Failed\x20Tests:');for(const _0x441693 of _0x484f2a){const _0x4ddd5a=a5_0xe176b['red']('✗'),_0x5950a9=_0x441693['reason']['length']>0x32?_0x441693[_0x176cd8(0x1bc)][_0x176cd8(0x1a0)](0x0,0x32)+'...':_0x441693[_0x176cd8(0x1bc)];console[_0x176cd8(0x1d7)]('\x20\x20'+_0x4ddd5a+'\x20'+_0x441693[_0x176cd8(0x1cf)]+':\x20'+_0x5950a9);}}const _0x5bae79={'summary':{'total':_0x204375[_0x176cd8(0x185)],'passed':_0xa2c08d,'failed':_0x259345,'errors':_0x135acb>0x0?_0x135acb:undefined,'duration_ms':_0x37f180},'tests':_0x204375,'agent':{'project':_0x75c9b8[_0x176cd8(0x17c)],'name':_0x75c9b8['agentName'],'site':_0x96c282},'timestamp':new Date(_0x1b7002)[_0x176cd8(0x1e9)]()};try{const _0x2ff113=buildCachedTestRun(_0x4b5333,{'site':_0x96c282,'projectId':_0x2aabba,'projectName':_0x75c9b8['projectName'],'agentId':_0x1b7bbd,'agentName':_0x75c9b8['agentName'],'testYmlPath':a5_0x4e7ede[_0x176cd8(0x184)](_0x75c9b8[_0x176cd8(0x1a2)])});saveLastTestRun(_0x2ff113);}catch{}if(_0x4b9d6a!==_0x176cd8(0x20b)||_0x1c103b){const _0x32d921=formatResults(_0x5bae79,_0x4b9d6a);if(_0x1c103b)try{a5_0x254c45[_0x176cd8(0x1fb)](_0x1c103b,_0x32d921,_0x176cd8(0x17e)),console[_0x176cd8(0x1d7)](),console[_0x176cd8(0x1d7)](a5_0xe176b[_0x176cd8(0x1cd)](_0x176cd8(0x1d2)+_0x1c103b));}catch(_0x5a87a9){return console[_0x176cd8(0x1d7)](),console[_0x176cd8(0x1d7)](a5_0xe176b[_0x176cd8(0x1f2)](_0x176cd8(0x1a4)+_0x5a87a9)),0x1;}else console['log'](),console[_0x176cd8(0x1d7)](_0x32d921);}return _0x484f2a[_0x176cd8(0x185)]>0x0?0x1:0x0;}async[a5_0x2a298d(0x202)](_0x1be7f6,_0x521677){const _0x53a15e=a5_0x2a298d,{options:_0x3caec3,tdx:_0x54d64c}=_0x1be7f6,{definition:_0x4f5d36,agentInfo:_0x7749a0,outputFormat:_0x5ccd42,outputFile:_0x576953}=_0x521677,_0x35cc1f=_0x3caec3['site'],_0x1db105=loadLastTestRun();if(!_0x1db105)return console['log'](a5_0xe176b[_0x53a15e(0x1f2)](_0x53a15e(0x195))),console[_0x53a15e(0x1d7)](a5_0xe176b[_0x53a15e(0x1cd)](_0x53a15e(0x1d8))),0x1;if(_0x1db105[_0x53a15e(0x1b0)][_0x53a15e(0x1e7)]!==_0x7749a0[_0x53a15e(0x1e7)])return console[_0x53a15e(0x1d7)](a5_0xe176b[_0x53a15e(0x1f2)](_0x53a15e(0x1bd)+_0x1db105[_0x53a15e(0x1b0)][_0x53a15e(0x1e7)]+_0x53a15e(0x1bb)+_0x7749a0[_0x53a15e(0x1e7)]+'\x22.')),console['log'](a5_0xe176b['dim'](_0x53a15e(0x1a6))),0x1;const _0x1b6fd3=new Set(_0x1db105['conversations'][_0x53a15e(0x192)](_0xda8a07=>_0xda8a07[_0x53a15e(0x1b5)])),_0x41341c=_0x4f5d36['tests'][_0x53a15e(0x1ca)](_0x2bc2e4=>!_0x1b6fd3[_0x53a15e(0x196)](_0x2bc2e4[_0x53a15e(0x1cf)]));if(_0x41341c[_0x53a15e(0x185)]>0x0&&_0x1db105[_0x53a15e(0x1b3)]!==_0x35cc1f)return console[_0x53a15e(0x1d7)](a5_0xe176b[_0x53a15e(0x1f2)](_0x53a15e(0x1ce))),console['log'](a5_0xe176b[_0x53a15e(0x1cd)](_0x53a15e(0x186)+_0x1db105[_0x53a15e(0x1b3)]+_0x53a15e(0x1e5)+_0x35cc1f+'\x22.')),console[_0x53a15e(0x1d7)](a5_0xe176b[_0x53a15e(0x1cd)](_0x53a15e(0x203)+_0x1db105['site']+'\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.')),0x1;const _0x2cdb3f=_0x4f5d36[_0x53a15e(0x19e)][_0x53a15e(0x1ca)](_0x253b30=>_0x1b6fd3[_0x53a15e(0x196)](_0x253b30[_0x53a15e(0x1cf)])),_0x57219a=_0x41341c;let _0x5d96bb;try{_0x5d96bb=await setupEvaluatorAgent(_0x54d64c[_0x53a15e(0x19b)],_0x3caec3[_0x53a15e(0x188)]);}catch(_0x5335da){const _0x58235e=_0x5335da instanceof Error?_0x5335da[_0x53a15e(0x1f1)]:String(_0x5335da);return console[_0x53a15e(0x1d7)](a5_0xe176b[_0x53a15e(0x1f2)]('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x58235e)),0x1;}console[_0x53a15e(0x1d7)](a5_0xe176b[_0x53a15e(0x189)]('Re-evaluating\x20cached\x20test\x20run...')),console['log'](_0x53a15e(0x1f0)+a5_0xe176b[_0x53a15e(0x1ed)](_0x1db105['timestamp'])),console['log'](_0x53a15e(0x1c9)+a5_0xe176b['white'](_0x1db105['agent'][_0x53a15e(0x17c)]+'/'+_0x1db105[_0x53a15e(0x1b0)][_0x53a15e(0x1e7)]));_0x57219a[_0x53a15e(0x185)]>0x0&&console[_0x53a15e(0x1d7)]('New\x20tests\x20to\x20execute:\x20'+a5_0xe176b[_0x53a15e(0x201)](_0x57219a[_0x53a15e(0x185)]));console[_0x53a15e(0x1d7)]();const _0x18ddae=[],_0x4f2e1d=Date[_0x53a15e(0x1c5)](),_0x44905c=createCommandSpinner('Re-evaluating...');if(_0x2cdb3f['length']>0x0)try{const _0x1bf3a1=await reevaluateFromCache(_0x54d64c['llm'],_0x1db105,{'tests':_0x2cdb3f},{'evaluatorId':_0x5d96bb,'onTestStart':(_0x2c33a5,_0xc910b2,_0x53875e)=>{const _0x1e6804=_0x53a15e;_0x44905c[_0x1e6804(0x1c1)]='Re-evaluating\x20'+(_0xc910b2+0x1)+'/'+_0x53875e+':\x20'+_0x2c33a5+_0x1e6804(0x19f);if(!_0x44905c[_0x1e6804(0x1fe)])_0x44905c[_0x1e6804(0x20a)]();},'onTestComplete':(_0x5d0eb7,_0x34c957)=>{const _0x8a856d=_0x53a15e;_0x44905c[_0x8a856d(0x1b9)]();if(_0x34c957['status']===_0x8a856d(0x18e))console['log'](a5_0xe176b[_0x8a856d(0x1f4)](_0x8a856d(0x1c2)+_0x5d0eb7)+a5_0xe176b['dim']('\x20(cached)'));else _0x34c957[_0x8a856d(0x1ab)]===_0x8a856d(0x1ae)?console[_0x8a856d(0x1d7)](a5_0xe176b['red']('✗\x20FAIL:\x20'+_0x5d0eb7+'\x20-\x20'+_0x34c957[_0x8a856d(0x1bc)])+a5_0xe176b[_0x8a856d(0x1cd)](_0x8a856d(0x1c8))):console[_0x8a856d(0x1d7)](a5_0xe176b[_0x8a856d(0x1f2)](_0x8a856d(0x19a)+_0x5d0eb7+'\x20-\x20'+_0x34c957[_0x8a856d(0x1bc)]));_0x34c957[_0x8a856d(0x18c)]&&console[_0x8a856d(0x1d7)](a5_0xe176b[_0x8a856d(0x1cd)](_0x8a856d(0x1de)+_0x34c957[_0x8a856d(0x18c)])),_0x18ddae[_0x8a856d(0x1e3)](_0x34c957);},'onTestSkipped':(_0x3c4486,_0x72b27f)=>{const _0x143e4a=_0x53a15e;_0x44905c[_0x143e4a(0x1b9)](),console[_0x143e4a(0x1d7)](a5_0xe176b[_0x143e4a(0x201)](_0x143e4a(0x20e)+_0x3c4486+_0x143e4a(0x1b2)+_0x72b27f));}});for(const _0x4132f6 of _0x1bf3a1){!_0x18ddae[_0x53a15e(0x1a9)](_0x3b8c9a=>_0x3b8c9a[_0x53a15e(0x1cf)]===_0x4132f6['name'])&&_0x18ddae['push'](_0x4132f6);}}catch(_0x1b9075){_0x44905c['stop']();const _0xa28f0=_0x1b9075 instanceof Error?_0x1b9075[_0x53a15e(0x1f1)]:String(_0x1b9075);return console[_0x53a15e(0x1d7)](a5_0xe176b[_0x53a15e(0x1f2)]('✗\x20ERROR:\x20Re-evaluation\x20failed:\x20'+_0xa28f0)),0x1;}_0x44905c[_0x53a15e(0x1b9)]();if(_0x57219a[_0x53a15e(0x185)]>0x0){console[_0x53a15e(0x1d7)](),console['log'](a5_0xe176b[_0x53a15e(0x189)](_0x53a15e(0x18f)));const {projectId:_0x22e046,agentId:_0x13f2d1}=_0x1db105[_0x53a15e(0x1b0)];for(const _0x53fc1a of _0x57219a){console['log']('Running:\x20'+a5_0xe176b[_0x53a15e(0x1ed)](_0x53fc1a['name']));const _0x1778e7=createCommandSpinner(_0x53a15e(0x1ea)+_0x53fc1a[_0x53a15e(0x17d)][_0x53a15e(0x185)]+_0x53a15e(0x1c7));_0x1778e7['start']();try{const {result:_0x32beb2}=await runTest(_0x54d64c[_0x53a15e(0x19b)],_0x53fc1a,{'agentId':_0x13f2d1,'projectId':_0x22e046,'site':_0x1db105[_0x53a15e(0x1b3)],'noEval':![],'evaluatorId':_0x5d96bb,'onRoundStart':(_0x2a9d8a,_0x564698)=>{_0x1778e7['text']='Round\x20'+(_0x2a9d8a+0x1)+'/'+_0x564698+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x34b8c7,_0x377079,_0x56525c)=>{const _0x216263=_0x53a15e,_0x47cc68=formatElapsed(_0x377079);_0x56525c?console[_0x216263(0x1d7)]('\x20\x20Round\x20'+(_0x34b8c7+0x1)+'/'+_0x53fc1a[_0x216263(0x17d)][_0x216263(0x185)]+_0x216263(0x1cc)+a5_0xe176b[_0x216263(0x1f4)]('✓')+'\x20('+_0x47cc68+')'):console[_0x216263(0x1d7)](_0x216263(0x19d)+(_0x34b8c7+0x1)+'/'+_0x53fc1a[_0x216263(0x17d)][_0x216263(0x185)]+_0x216263(0x1cc)+a5_0xe176b[_0x216263(0x1f2)]('✗'));},'onEvaluationStart':()=>{const _0x428a4a=_0x53a15e;_0x1778e7[_0x428a4a(0x1c1)]=_0x428a4a(0x197);},'onEvaluationComplete':_0x48a74b=>{const _0x17b08b=_0x53a15e,_0x1190df=formatElapsed(_0x48a74b);console[_0x17b08b(0x1d7)](_0x17b08b(0x1ee)+a5_0xe176b[_0x17b08b(0x1f4)]('✓')+'\x20('+_0x1190df+')');}});_0x1778e7[_0x53a15e(0x1b9)](),_0x18ddae[_0x53a15e(0x1e3)](_0x32beb2);if(_0x32beb2['status']===_0x53a15e(0x18e))console[_0x53a15e(0x1d7)](a5_0xe176b[_0x53a15e(0x1f4)](_0x53a15e(0x1c2)+_0x32beb2[_0x53a15e(0x1bc)])+a5_0xe176b['dim'](_0x53a15e(0x1c3)));else _0x32beb2[_0x53a15e(0x1ab)]===_0x53a15e(0x1ae)?console[_0x53a15e(0x1d7)](a5_0xe176b[_0x53a15e(0x1f2)](_0x53a15e(0x17f)+_0x32beb2[_0x53a15e(0x1bc)])+a5_0xe176b[_0x53a15e(0x1cd)](_0x53a15e(0x1c3))):console[_0x53a15e(0x1d7)](a5_0xe176b[_0x53a15e(0x1f2)](_0x53a15e(0x19a)+_0x32beb2['reason']));_0x32beb2[_0x53a15e(0x18c)]&&console[_0x53a15e(0x1d7)](a5_0xe176b[_0x53a15e(0x1cd)](_0x53a15e(0x1de)+_0x32beb2[_0x53a15e(0x18c)]));}catch(_0x184bc4){_0x1778e7['stop']();const _0x18e9d6=_0x184bc4 instanceof Error?_0x184bc4['message']:String(_0x184bc4);console[_0x53a15e(0x1d7)](a5_0xe176b[_0x53a15e(0x1f2)](_0x53a15e(0x19a)+_0x18e9d6)),_0x18ddae[_0x53a15e(0x1e3)]({'name':_0x53fc1a['name'],'status':_0x53a15e(0x1b8),'reason':_0x18e9d6,'timestamp':new Date()[_0x53a15e(0x1e9)](),'duration_ms':0x0});}}}console[_0x53a15e(0x1d7)]();const _0x5ff11d=Date[_0x53a15e(0x1c5)]()-_0x4f2e1d,_0x57d7ec=_0x18ddae['filter'](_0x1c5ab4=>_0x1c5ab4['status']===_0x53a15e(0x18e))[_0x53a15e(0x185)],_0x3ab713=_0x18ddae['filter'](_0x598b34=>_0x598b34[_0x53a15e(0x1ab)]===_0x53a15e(0x1ae))[_0x53a15e(0x185)],_0x2d4d53=_0x18ddae[_0x53a15e(0x1ca)](_0x2b7ffe=>_0x2b7ffe[_0x53a15e(0x1ab)]===_0x53a15e(0x1b8))['length'];console[_0x53a15e(0x1d7)]('━'[_0x53a15e(0x199)](0x3c)),console[_0x53a15e(0x1d7)]('Re-evaluation\x20Summary'),console[_0x53a15e(0x1d7)]('━'[_0x53a15e(0x199)](0x3c)),console[_0x53a15e(0x1d7)]('Total:\x20\x20\x20\x20'+_0x18ddae['length']),console[_0x53a15e(0x1d7)]('Passed:\x20\x20\x20'+a5_0xe176b['green'](_0x57d7ec)),console[_0x53a15e(0x1d7)](_0x53a15e(0x1ff)+a5_0xe176b[_0x53a15e(0x1f2)](_0x3ab713));_0x2d4d53>0x0&&console[_0x53a15e(0x1d7)]('Errors:\x20\x20\x20'+a5_0xe176b[_0x53a15e(0x1f2)](_0x2d4d53));console[_0x53a15e(0x1d7)](_0x53a15e(0x1d5)+formatElapsed(_0x5ff11d)),console[_0x53a15e(0x1d7)]('━'[_0x53a15e(0x199)](0x3c));const _0xedfe2e={'summary':{'total':_0x18ddae[_0x53a15e(0x185)],'passed':_0x57d7ec,'failed':_0x3ab713,'errors':_0x2d4d53>0x0?_0x2d4d53:undefined,'duration_ms':_0x5ff11d},'tests':_0x18ddae,'agent':{'project':_0x7749a0[_0x53a15e(0x17c)],'name':_0x7749a0[_0x53a15e(0x1e7)],'site':_0x35cc1f},'timestamp':new Date(_0x4f2e1d)[_0x53a15e(0x1e9)]()};if(_0x5ccd42!==_0x53a15e(0x20b)||_0x576953){const _0x52dfbe=formatResults(_0xedfe2e,_0x5ccd42);if(_0x576953)try{a5_0x254c45[_0x53a15e(0x1fb)](_0x576953,_0x52dfbe,'utf-8'),console['log'](),console[_0x53a15e(0x1d7)](a5_0xe176b[_0x53a15e(0x1cd)]('Output\x20written\x20to:\x20'+_0x576953));}catch(_0x49f8d5){return console[_0x53a15e(0x1d7)](),console[_0x53a15e(0x1d7)](a5_0xe176b[_0x53a15e(0x1f2)](_0x53a15e(0x1a4)+_0x49f8d5)),0x1;}else console[_0x53a15e(0x1d7)](),console['log'](_0x52dfbe);}const _0x285686=_0x18ddae['filter'](_0x8e8d3a=>_0x8e8d3a[_0x53a15e(0x1ab)]!==_0x53a15e(0x18e));return _0x285686[_0x53a15e(0x185)]>0x0?0x1:0x0;}}
1
+ const a5_0x29ec61=a5_0x5e65;(function(_0x142fde,_0x4979c4){const _0x349691=a5_0x5e65,_0x2f6ed3=_0x142fde();while(!![]){try{const _0x59b5fa=-parseInt(_0x349691(0x218))/0x1+parseInt(_0x349691(0x214))/0x2+-parseInt(_0x349691(0x1e3))/0x3*(parseInt(_0x349691(0x21d))/0x4)+-parseInt(_0x349691(0x1cb))/0x5+parseInt(_0x349691(0x22d))/0x6*(-parseInt(_0x349691(0x19d))/0x7)+parseInt(_0x349691(0x202))/0x8+-parseInt(_0x349691(0x1af))/0x9*(-parseInt(_0x349691(0x1e2))/0xa);if(_0x59b5fa===_0x4979c4)break;else _0x2f6ed3['push'](_0x2f6ed3['shift']());}catch(_0x450271){_0x2f6ed3['push'](_0x2f6ed3['shift']());}}}(a5_0x389d,0x8ae54));function a5_0x389d(){const _0x535a80=['1130316VyKqWu','join','text','Re-evaluating...','828457kcgkTz','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','Evaluating\x20response...','site','⚠\x20SKIPPED:\x20','1219316ozjVnw','Either\x20switch\x20to\x20the\x20\x22','yellow','description','map','testName','Usage:','Executing\x20new\x20tests...','green','stop','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','Running:\x20','resolve','testYmlPath','Using\x20agent:\x20','Test\x20Summary','6KtnPXZ','Project\x20path:\x20','red','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','writeFileSync','found','dryRun','add','No\x20tests\x20found\x20matching:\x20','7730590cldmdH','\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','Re-evaluating\x20cached\x20test\x20run...','Available\x20tags:\x20','ERROR','Running\x20agent\x20tests...','/<agent-name>','\x20\x20Round\x20','jsonl','No\x20tests\x20have\x20tags\x20defined.','\x20(new)','llm','timestamp','New\x20tests\x20to\x20execute:\x20','no_local_folder','basename','existsSync','tags','17496KsrdIp','\x27\x20to\x20create\x20the\x20folder\x20structure.','Agent:\x20','Duration:\x20','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','...\x20','Running\x20test:\x20','No\x20tests\x20found\x20with\x20tags:\x20','toLowerCase','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','agent','llmProject','tests','verbose','toISOString','Conversation\x20URL:\x20','status','...','size','find','context','agentName','execute',':\x20Sending\x20user\x20input...','\x20\x20-\x20','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','Passed:\x20\x20\x20','PASS','382870uPdfCj','Re-evaluating\x20','\x20\x20Conversation:\x20','\x20-\x20','Test\x20','name','\x20\x20Evaluating...\x20','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','Failed:\x20\x20\x20','Output\x20written\x20to:\x20','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','Errors:\x20\x20\x20','message','no_tests','Tests\x20found:\x20','resolveAgentId','\x20(cached)','cyan','some','Re-evaluation\x20Summary','start','projectName','projectDir','6610MrQZWI','3nZyzNh','dim','Error:\x20No\x20previous\x20test\x20run\x20found.','Total:\x20\x20\x20\x20','json','Run\x20tests\x20for\x20an\x20LLM\x20agent','output','agentDirs','✗\x20ERROR:\x20','now','reason','agent:test','\x22:\x20','executeReeval','Round\x201/','includes','Round\x20','split','white','utf-8','✗\x20FAIL:\x20','conversation_url','Site:\x20','404','log','no_context','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','resolveProjectId','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','rounds','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','8264032obBgkt','length','Failed\x20Tests:','has','forEach','not\x20found','filter','trim','repeat','✓\x20PASS:\x20','✗\x20ERROR:\x20Project\x20not\x20found:\x20','tsv','Error\x20writing\x20output\x20file:\x20','table','reeval','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','FAIL','push'];a5_0x389d=function(){return _0x535a80;};return a5_0x389d();}import*as a5_0x512f45 from'node:fs';function a5_0x5e65(_0x1dd110,_0x2dce9a){_0x1dd110=_0x1dd110-0x19a;const _0x389dc5=a5_0x389d();let _0x5e6550=_0x389dc5[_0x1dd110];return _0x5e6550;}import*as a5_0x59fe4e from'node:path';import a5_0x156d4c from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x29ec61(0x1d0)]=a5_0x29ec61(0x1ee);[a5_0x29ec61(0x220)]=a5_0x29ec61(0x1e8);async[a5_0x29ec61(0x1c5)](_0x5615b4){const _0x5643b3=a5_0x29ec61,{options:_0x23caa6,args:_0x32526b,tdx:_0xf1f8e7}=_0x5615b4,_0x4bc8ad=_0x32526b[0x0]||'.',_0x17f9b7=_0x23caa6[_0x5643b3(0x19a)],_0x498167=_0x23caa6,_0x628b93=_0x498167['eval']===![],_0x151dc9=_0x498167[_0x5643b3(0x210)],_0x8ed697=_0x498167['name'],_0x58e9f6=_0x498167[_0x5643b3(0x1ae)],_0xe47f7a=_0x23caa6['site'],_0x5aa41d=_0x498167[_0x5643b3(0x1e9)];if(_0x151dc9&&_0x628b93)return console[_0x5643b3(0x1fb)](a5_0x156d4c['red'](_0x5643b3(0x1d2))),0x1;let _0x3edbb6='table';if(_0x498167['json'])_0x3edbb6=_0x5643b3(0x1e7);else{if(_0x498167[_0x5643b3(0x1a5)])_0x3edbb6='jsonl';else{if(_0x498167[_0x5643b3(0x20d)])_0x3edbb6=_0x5643b3(0x20d);else{if(_0x498167['table'])_0x3edbb6='table';}}}const _0x251149=_0x498167[_0x5643b3(0x1ba)];let _0x3a10f2=_0x4bc8ad;const _0x3f9a3a=a5_0x512f45[_0x5643b3(0x1ad)](_0x4bc8ad),_0x4746ec=_0x4bc8ad==='.';if(!_0x3f9a3a||_0x4746ec){const _0x3c2b0a=resolveProjectFromContext(_0x4bc8ad,_0x251149,{'requireFile':'test.yml'});if(_0x3c2b0a[_0x5643b3(0x232)])_0x3a10f2=_0x3c2b0a['projectDir'],_0x3c2b0a['source']===_0x5643b3(0x1c3)&&console[_0x5643b3(0x1fb)](a5_0x156d4c['dim'](_0x5643b3(0x22b)+_0x3a10f2));else switch(_0x3c2b0a[_0x5643b3(0x1ed)]){case _0x5643b3(0x1fc):console[_0x5643b3(0x1fb)](a5_0x156d4c['yellow'](_0x3c2b0a[_0x5643b3(0x1d7)])),console[_0x5643b3(0x1fb)](),console['log'](_0x5643b3(0x223)),console['log'](_0x5643b3(0x19e)),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[_0x5643b3(0x1fb)](),console[_0x5643b3(0x1fb)](_0x5643b3(0x1ff));return 0x1;case _0x5643b3(0x1ab):console[_0x5643b3(0x1fb)](a5_0x156d4c[_0x5643b3(0x21f)](_0x3c2b0a[_0x5643b3(0x1d7)])),console[_0x5643b3(0x1fb)](),console[_0x5643b3(0x1fb)]('Run\x20\x27tdx\x20agent\x20pull\x20'+_0x3c2b0a[_0x5643b3(0x1ba)]+_0x5643b3(0x1b0));return 0x1;case'multiple_agents':{const _0x2b0343=a5_0x59fe4e[_0x5643b3(0x1ac)](_0x3c2b0a[_0x5643b3(0x1e1)]);console['log'](a5_0x156d4c[_0x5643b3(0x21f)](_0x5643b3(0x227)+_0x3c2b0a[_0x5643b3(0x1ba)]+'\x22:'));for(const _0x5d8deb of _0x3c2b0a[_0x5643b3(0x1ea)]){console[_0x5643b3(0x1fb)](_0x5643b3(0x1c7)+_0x5d8deb);}return console[_0x5643b3(0x1fb)](),console[_0x5643b3(0x1fb)](_0x5643b3(0x230)+_0x2b0343+_0x5643b3(0x1a3)),0x1;}case _0x5643b3(0x1d8):console[_0x5643b3(0x1fb)](a5_0x156d4c[_0x5643b3(0x21f)]('No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22'+_0x3c2b0a[_0x5643b3(0x1ba)]+'\x22.')),console[_0x5643b3(0x1fb)](a5_0x156d4c[_0x5643b3(0x1e4)](_0x5643b3(0x22e)+_0x3c2b0a[_0x5643b3(0x1e1)])),console['log'](),console['log']('Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.');return 0x1;}}const {definition:_0x3b3777,agentInfo:_0x1a665e}=parseTestFile(_0x3a10f2);let _0x160f77=_0x3b3777[_0x5643b3(0x1bb)];if(_0x8ed697){const _0x430087=_0x8ed697[_0x5643b3(0x1f4)](',')[_0x5643b3(0x221)](_0x315a00=>_0x315a00['trim']());_0x160f77=_0x3b3777[_0x5643b3(0x1bb)][_0x5643b3(0x208)](_0x4c2977=>_0x430087[_0x5643b3(0x1f2)](_0x4c2977[_0x5643b3(0x1d0)]));if(_0x160f77[_0x5643b3(0x203)]===0x0)return console[_0x5643b3(0x1fb)](a5_0x156d4c[_0x5643b3(0x21f)](_0x5643b3(0x19c)+_0x8ed697)),console[_0x5643b3(0x1fb)](a5_0x156d4c[_0x5643b3(0x1e4)]('Available\x20tests:\x20'+_0x3b3777[_0x5643b3(0x1bb)][_0x5643b3(0x221)](_0x18673d=>_0x18673d[_0x5643b3(0x1d0)])[_0x5643b3(0x215)](',\x20'))),0x1;}if(_0x58e9f6){const _0x5d63d6=_0x58e9f6[_0x5643b3(0x1f4)](',')['map'](_0x2d7b2e=>_0x2d7b2e[_0x5643b3(0x209)]()[_0x5643b3(0x1b7)]());_0x160f77=_0x160f77[_0x5643b3(0x208)](_0x151289=>_0x151289[_0x5643b3(0x1ae)]?.[_0x5643b3(0x1dd)](_0x101add=>_0x5d63d6[_0x5643b3(0x1f2)](_0x101add[_0x5643b3(0x1b7)]())));if(_0x160f77[_0x5643b3(0x203)]===0x0){console[_0x5643b3(0x1fb)](a5_0x156d4c[_0x5643b3(0x21f)](_0x5643b3(0x1b6)+_0x58e9f6));const _0x378c30=new Set();return _0x3b3777['tests']['forEach'](_0x5c363e=>_0x5c363e[_0x5643b3(0x1ae)]?.[_0x5643b3(0x206)](_0xd8b4df=>_0x378c30[_0x5643b3(0x19b)](_0xd8b4df))),_0x378c30[_0x5643b3(0x1c1)]>0x0?console['log'](a5_0x156d4c[_0x5643b3(0x1e4)](_0x5643b3(0x1a0)+[..._0x378c30][_0x5643b3(0x215)](',\x20'))):console[_0x5643b3(0x1fb)](a5_0x156d4c[_0x5643b3(0x1e4)](_0x5643b3(0x1a6))),0x1;}}if(_0x151dc9)return this[_0x5643b3(0x1f0)](_0x5615b4,{'definition':{'tests':_0x160f77},'agentInfo':_0x1a665e,'outputFormat':_0x3edbb6,'outputFile':_0x5aa41d,'testNames':_0x8ed697});if(_0x17f9b7){console[_0x5643b3(0x1fb)](a5_0x156d4c[_0x5643b3(0x1dc)]('Test\x20Configuration:')),console[_0x5643b3(0x1fb)]('\x20\x20Site:\x20'+a5_0x156d4c['white'](_0xe47f7a)),console[_0x5643b3(0x1fb)]('\x20\x20Project:\x20'+a5_0x156d4c['white'](_0x1a665e['projectName'])),console['log']('\x20\x20Agent:\x20'+a5_0x156d4c[_0x5643b3(0x1f5)](_0x1a665e['agentName'])),console[_0x5643b3(0x1fb)](),console[_0x5643b3(0x1fb)](_0x5643b3(0x1d9)+a5_0x156d4c[_0x5643b3(0x1f5)](_0x160f77['length']));for(let _0x3b623c=0x0;_0x3b623c<_0x160f77['length'];_0x3b623c++){const _0x3355b1=_0x160f77[_0x3b623c],_0x71c7ad=_0x3355b1['rounds'][_0x5643b3(0x203)]===0x1?'round':_0x5643b3(0x200),_0x23ea92=_0x3355b1['tags']?.[_0x5643b3(0x203)]?'\x20['+_0x3355b1['tags'][_0x5643b3(0x215)](',\x20')+']':'';console[_0x5643b3(0x1fb)]('\x20\x20'+(_0x3b623c+0x1)+'.\x20'+a5_0x156d4c[_0x5643b3(0x1f5)](_0x3355b1[_0x5643b3(0x1d0)])+'\x20('+_0x3355b1[_0x5643b3(0x200)][_0x5643b3(0x203)]+'\x20'+_0x71c7ad+')'+a5_0x156d4c[_0x5643b3(0x1e4)](_0x23ea92));}return 0x0;}let _0x5e1f83,_0x2a3168;try{_0x5e1f83=await _0xf1f8e7[_0x5643b3(0x1a8)][_0x5643b3(0x1fe)](_0x1a665e['projectName']);}catch(_0xc7355a){const _0x34755f=_0xc7355a instanceof Error?_0xc7355a[_0x5643b3(0x1d7)]:String(_0xc7355a);return _0x34755f[_0x5643b3(0x1f2)](_0x5643b3(0x1fa))||_0x34755f[_0x5643b3(0x1b7)]()[_0x5643b3(0x1f2)](_0x5643b3(0x207))?console[_0x5643b3(0x1fb)](a5_0x156d4c['red'](_0x5643b3(0x20c)+_0x1a665e['projectName'])):console['log'](a5_0x156d4c[_0x5643b3(0x22f)](_0x5643b3(0x1b8)+_0x1a665e[_0x5643b3(0x1e0)]+_0x5643b3(0x1ef)+_0x34755f)),0x1;}try{_0x2a3168=await _0xf1f8e7['llm'][_0x5643b3(0x1da)](_0x1a665e['agentName'],_0x5e1f83);}catch(_0x645a88){const _0x2ea1c7=_0x645a88 instanceof Error?_0x645a88[_0x5643b3(0x1d7)]:String(_0x645a88);return _0x2ea1c7['includes'](_0x5643b3(0x1fa))||_0x2ea1c7[_0x5643b3(0x1b7)]()[_0x5643b3(0x1f2)](_0x5643b3(0x207))?console[_0x5643b3(0x1fb)](a5_0x156d4c[_0x5643b3(0x22f)](_0x5643b3(0x219)+_0x1a665e[_0x5643b3(0x1c4)])):console['log'](a5_0x156d4c[_0x5643b3(0x22f)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22'+_0x1a665e[_0x5643b3(0x1c4)]+_0x5643b3(0x1ef)+_0x2ea1c7)),0x1;}let _0x1e1793;if(!_0x628b93)try{_0x1e1793=await setupEvaluatorAgent(_0xf1f8e7['llm'],_0x23caa6[_0x5643b3(0x1bc)]);}catch(_0x504264){const _0x1c7ab3=_0x504264 instanceof Error?_0x504264[_0x5643b3(0x1d7)]:String(_0x504264);return console[_0x5643b3(0x1fb)](a5_0x156d4c['red'](_0x5643b3(0x1d5)+_0x1c7ab3)),0x1;}console[_0x5643b3(0x1fb)](a5_0x156d4c[_0x5643b3(0x1dc)](_0x5643b3(0x1a2))),console['log'](_0x5643b3(0x1f9)+a5_0x156d4c[_0x5643b3(0x1f5)](_0xe47f7a)),console[_0x5643b3(0x1fb)](_0x5643b3(0x1b1)+a5_0x156d4c[_0x5643b3(0x1f5)](_0x1a665e[_0x5643b3(0x1e0)]+'/'+_0x1a665e[_0x5643b3(0x1c4)])),console['log']();const _0x185784=[],_0x33a30c=[],_0xdb00c7=Date[_0x5643b3(0x1ec)]();for(let _0xf40f9c=0x0;_0xf40f9c<_0x160f77[_0x5643b3(0x203)];_0xf40f9c++){const _0x4bdacd=_0x160f77[_0xf40f9c];_0x160f77[_0x5643b3(0x203)]>0x1?console[_0x5643b3(0x1fb)](_0x5643b3(0x1cf)+(_0xf40f9c+0x1)+'/'+_0x160f77['length']+':\x20'+a5_0x156d4c['white'](_0x4bdacd['name'])):console['log'](_0x5643b3(0x1b5)+a5_0x156d4c[_0x5643b3(0x1f5)](_0x4bdacd[_0x5643b3(0x1d0)]));const _0x48be0c=createCommandSpinner('Round\x201/'+_0x4bdacd['rounds'][_0x5643b3(0x203)]+':\x20Sending\x20user\x20input...');_0x48be0c['start']();try{const {result:_0x2f2f91,conversation:_0x31d24a}=await runTest(_0xf1f8e7[_0x5643b3(0x1a8)],_0x4bdacd,{'agentId':_0x2a3168,'projectId':_0x5e1f83,'site':_0xe47f7a,'noEval':_0x628b93,'evaluatorId':_0x1e1793,'onRoundStart':(_0x484796,_0x28dc31)=>{const _0x5ef606=_0x5643b3;_0x48be0c[_0x5ef606(0x216)]='Round\x20'+(_0x484796+0x1)+'/'+_0x28dc31+_0x5ef606(0x1c6);},'onRoundComplete':(_0x274f4e,_0x25b4e9,_0x31ec6f)=>{const _0x5594c0=_0x5643b3,_0x1d501c=formatElapsed(_0x25b4e9);_0x31ec6f?console[_0x5594c0(0x1fb)]('\x20\x20Round\x20'+(_0x274f4e+0x1)+'/'+_0x4bdacd[_0x5594c0(0x200)]['length']+_0x5594c0(0x1b4)+a5_0x156d4c[_0x5594c0(0x225)]('✓')+'\x20('+_0x1d501c+')'):console[_0x5594c0(0x1fb)](_0x5594c0(0x1a4)+(_0x274f4e+0x1)+'/'+_0x4bdacd[_0x5594c0(0x200)]['length']+_0x5594c0(0x1b4)+a5_0x156d4c[_0x5594c0(0x22f)]('✗'));},'onEvaluationStart':()=>{const _0x53c952=_0x5643b3;_0x48be0c[_0x53c952(0x216)]='Evaluating\x20response...';},'onEvaluationComplete':_0x2aa1f6=>{const _0x332377=_0x5643b3,_0x497ee8=formatElapsed(_0x2aa1f6);console[_0x332377(0x1fb)](_0x332377(0x1d1)+a5_0x156d4c[_0x332377(0x225)]('✓')+'\x20('+_0x497ee8+')');}});_0x48be0c[_0x5643b3(0x226)](),_0x185784[_0x5643b3(0x213)](_0x2f2f91),_0x33a30c[_0x5643b3(0x213)](_0x31d24a);if(_0x2f2f91[_0x5643b3(0x1bf)]==='PASS')console['log'](a5_0x156d4c['green'](_0x5643b3(0x20b)+_0x2f2f91['reason']));else _0x2f2f91[_0x5643b3(0x1bf)]==='FAIL'?console[_0x5643b3(0x1fb)](a5_0x156d4c[_0x5643b3(0x22f)]('✗\x20FAIL:\x20'+_0x2f2f91[_0x5643b3(0x1ed)])):console[_0x5643b3(0x1fb)](a5_0x156d4c[_0x5643b3(0x22f)](_0x5643b3(0x1eb)+_0x2f2f91['reason']));_0x2f2f91[_0x5643b3(0x1f8)]&&console[_0x5643b3(0x1fb)](a5_0x156d4c[_0x5643b3(0x1e4)](_0x5643b3(0x1be)+_0x2f2f91[_0x5643b3(0x1f8)])),console[_0x5643b3(0x1fb)]();}catch(_0x4a0c60){_0x48be0c[_0x5643b3(0x226)]();const _0x587aa9=_0x4a0c60 instanceof Error?_0x4a0c60[_0x5643b3(0x1d7)]:String(_0x4a0c60);console[_0x5643b3(0x1fb)](a5_0x156d4c[_0x5643b3(0x22f)]('✗\x20ERROR:\x20'+_0x587aa9)),console['log'](),_0x185784[_0x5643b3(0x213)]({'name':_0x4bdacd[_0x5643b3(0x1d0)],'status':_0x5643b3(0x1a1),'reason':_0x587aa9,'timestamp':new Date()[_0x5643b3(0x1bd)](),'duration_ms':0x0});}}const _0x11c26c=Date[_0x5643b3(0x1ec)]()-_0xdb00c7,_0x4b7afe=_0x185784[_0x5643b3(0x208)](_0x203395=>_0x203395[_0x5643b3(0x1bf)]===_0x5643b3(0x1ca))[_0x5643b3(0x203)],_0x43d4c4=_0x185784[_0x5643b3(0x208)](_0x5d5aed=>_0x5d5aed[_0x5643b3(0x1bf)]==='FAIL')[_0x5643b3(0x203)],_0x5d33db=_0x185784[_0x5643b3(0x208)](_0x14fbe7=>_0x14fbe7[_0x5643b3(0x1bf)]===_0x5643b3(0x1a1))[_0x5643b3(0x203)];console[_0x5643b3(0x1fb)]('━'[_0x5643b3(0x20a)](0x3c)),console[_0x5643b3(0x1fb)](_0x5643b3(0x22c)),console[_0x5643b3(0x1fb)]('━'[_0x5643b3(0x20a)](0x3c)),console[_0x5643b3(0x1fb)](_0x5643b3(0x1e6)+_0x185784[_0x5643b3(0x203)]),console[_0x5643b3(0x1fb)](_0x5643b3(0x1c9)+a5_0x156d4c[_0x5643b3(0x225)](_0x4b7afe)),console[_0x5643b3(0x1fb)](_0x5643b3(0x1d3)+a5_0x156d4c[_0x5643b3(0x22f)](_0x43d4c4));_0x5d33db>0x0&&console[_0x5643b3(0x1fb)]('Errors:\x20\x20\x20'+a5_0x156d4c[_0x5643b3(0x22f)](_0x5d33db));console[_0x5643b3(0x1fb)](_0x5643b3(0x1b2)+formatElapsed(_0x11c26c)),console[_0x5643b3(0x1fb)]('━'['repeat'](0x3c));const _0x12a8b0=_0x185784[_0x5643b3(0x208)](_0x5cd14c=>_0x5cd14c[_0x5643b3(0x1bf)]!==_0x5643b3(0x1ca));if(_0x12a8b0[_0x5643b3(0x203)]>0x0){console[_0x5643b3(0x1fb)](),console[_0x5643b3(0x1fb)](_0x5643b3(0x204));for(const _0x7049fd of _0x12a8b0){const _0x4dcdfb=a5_0x156d4c[_0x5643b3(0x22f)]('✗'),_0x5eeee5=_0x7049fd[_0x5643b3(0x1ed)][_0x5643b3(0x203)]>0x32?_0x7049fd[_0x5643b3(0x1ed)]['substring'](0x0,0x32)+_0x5643b3(0x1c0):_0x7049fd['reason'];console[_0x5643b3(0x1fb)]('\x20\x20'+_0x4dcdfb+'\x20'+_0x7049fd['name']+':\x20'+_0x5eeee5);}}const _0x53d0d7={'summary':{'total':_0x185784[_0x5643b3(0x203)],'passed':_0x4b7afe,'failed':_0x43d4c4,'errors':_0x5d33db>0x0?_0x5d33db:undefined,'duration_ms':_0x11c26c},'tests':_0x185784,'agent':{'project':_0x1a665e[_0x5643b3(0x1e0)],'name':_0x1a665e[_0x5643b3(0x1c4)],'site':_0xe47f7a},'timestamp':new Date(_0xdb00c7)['toISOString']()};try{const _0x578d57=buildCachedTestRun(_0x33a30c,{'site':_0xe47f7a,'projectId':_0x5e1f83,'projectName':_0x1a665e['projectName'],'agentId':_0x2a3168,'agentName':_0x1a665e[_0x5643b3(0x1c4)],'testYmlPath':a5_0x59fe4e[_0x5643b3(0x229)](_0x1a665e[_0x5643b3(0x22a)])});saveLastTestRun(_0x578d57);}catch{}if(_0x3edbb6!==_0x5643b3(0x20f)||_0x5aa41d){const _0x1f5969=formatResults(_0x53d0d7,_0x3edbb6);if(_0x5aa41d)try{a5_0x512f45[_0x5643b3(0x231)](_0x5aa41d,_0x1f5969,_0x5643b3(0x1f6)),console['log'](),console[_0x5643b3(0x1fb)](a5_0x156d4c[_0x5643b3(0x1e4)]('Output\x20written\x20to:\x20'+_0x5aa41d));}catch(_0x41a3f9){return console[_0x5643b3(0x1fb)](),console[_0x5643b3(0x1fb)](a5_0x156d4c[_0x5643b3(0x22f)]('Error\x20writing\x20output\x20file:\x20'+_0x41a3f9)),0x1;}else console['log'](),console[_0x5643b3(0x1fb)](_0x1f5969);}return _0x12a8b0[_0x5643b3(0x203)]>0x0?0x1:0x0;}async[a5_0x29ec61(0x1f0)](_0x2be0f6,_0x5b6593){const _0x86bbf7=a5_0x29ec61,{options:_0x585540,tdx:_0x287334}=_0x2be0f6,{definition:_0x3bcad4,agentInfo:_0x25bc48,outputFormat:_0x52e6f5,outputFile:_0x2f9bc4}=_0x5b6593,_0x5cc9f4=_0x585540[_0x86bbf7(0x21b)],_0xfee129=loadLastTestRun();if(!_0xfee129)return console['log'](a5_0x156d4c[_0x86bbf7(0x22f)](_0x86bbf7(0x1e5))),console[_0x86bbf7(0x1fb)](a5_0x156d4c[_0x86bbf7(0x1e4)](_0x86bbf7(0x1fd))),0x1;if(_0xfee129[_0x86bbf7(0x1b9)][_0x86bbf7(0x1c4)]!==_0x25bc48[_0x86bbf7(0x1c4)])return console[_0x86bbf7(0x1fb)](a5_0x156d4c[_0x86bbf7(0x22f)](_0x86bbf7(0x1c8)+_0xfee129[_0x86bbf7(0x1b9)][_0x86bbf7(0x1c4)]+'\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22'+_0x25bc48['agentName']+'\x22.')),console[_0x86bbf7(0x1fb)](a5_0x156d4c[_0x86bbf7(0x1e4)](_0x86bbf7(0x1b3))),0x1;const _0x7d4e79=new Set(_0xfee129['conversations']['map'](_0x1b5e7d=>_0x1b5e7d[_0x86bbf7(0x222)])),_0x5ed22a=_0x3bcad4['tests'][_0x86bbf7(0x208)](_0x30117d=>!_0x7d4e79[_0x86bbf7(0x205)](_0x30117d[_0x86bbf7(0x1d0)]));if(_0x5ed22a[_0x86bbf7(0x203)]>0x0&&_0xfee129[_0x86bbf7(0x21b)]!==_0x5cc9f4)return console[_0x86bbf7(0x1fb)](a5_0x156d4c[_0x86bbf7(0x22f)](_0x86bbf7(0x211))),console[_0x86bbf7(0x1fb)](a5_0x156d4c[_0x86bbf7(0x1e4)]('Cached\x20run\x20is\x20from\x20site\x20\x22'+_0xfee129['site']+'\x22,\x20but\x20current\x20site\x20is\x20\x22'+_0x5cc9f4+'\x22.')),console[_0x86bbf7(0x1fb)](a5_0x156d4c['dim'](_0x86bbf7(0x21e)+_0xfee129[_0x86bbf7(0x21b)]+'\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.')),0x1;const _0xe8af8b=_0x3bcad4['tests'][_0x86bbf7(0x208)](_0x54d482=>_0x7d4e79[_0x86bbf7(0x205)](_0x54d482['name'])),_0x24ac2a=_0x5ed22a;let _0x380c97;try{_0x380c97=await setupEvaluatorAgent(_0x287334[_0x86bbf7(0x1a8)],_0x585540[_0x86bbf7(0x1bc)]);}catch(_0x540ee0){const _0xc29e01=_0x540ee0 instanceof Error?_0x540ee0[_0x86bbf7(0x1d7)]:String(_0x540ee0);return console['log'](a5_0x156d4c[_0x86bbf7(0x22f)]('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0xc29e01)),0x1;}console[_0x86bbf7(0x1fb)](a5_0x156d4c['cyan'](_0x86bbf7(0x19f))),console[_0x86bbf7(0x1fb)]('Cached\x20run\x20from:\x20'+a5_0x156d4c['white'](_0xfee129[_0x86bbf7(0x1a9)])),console[_0x86bbf7(0x1fb)](_0x86bbf7(0x1b1)+a5_0x156d4c[_0x86bbf7(0x1f5)](_0xfee129[_0x86bbf7(0x1b9)][_0x86bbf7(0x1e0)]+'/'+_0xfee129[_0x86bbf7(0x1b9)][_0x86bbf7(0x1c4)]));_0x24ac2a[_0x86bbf7(0x203)]>0x0&&console['log'](_0x86bbf7(0x1aa)+a5_0x156d4c[_0x86bbf7(0x21f)](_0x24ac2a[_0x86bbf7(0x203)]));console[_0x86bbf7(0x1fb)]();const _0x56426=[],_0x2fd197=Date[_0x86bbf7(0x1ec)](),_0x2d0608=createCommandSpinner(_0x86bbf7(0x217));if(_0xe8af8b['length']>0x0)try{const _0x508b50=await reevaluateFromCache(_0x287334[_0x86bbf7(0x1a8)],_0xfee129,{'tests':_0xe8af8b},{'evaluatorId':_0x380c97,'onTestStart':(_0x3fef0e,_0x45861e,_0xced3a1)=>{const _0x34ea79=_0x86bbf7;_0x2d0608['text']=_0x34ea79(0x1cc)+(_0x45861e+0x1)+'/'+_0xced3a1+':\x20'+_0x3fef0e+_0x34ea79(0x1c0);if(!_0x2d0608['isSpinning'])_0x2d0608['start']();},'onTestComplete':(_0x81916d,_0x6728a6)=>{const _0x5ce67b=_0x86bbf7;_0x2d0608[_0x5ce67b(0x226)]();if(_0x6728a6['status']==='PASS')console[_0x5ce67b(0x1fb)](a5_0x156d4c[_0x5ce67b(0x225)](_0x5ce67b(0x20b)+_0x81916d)+a5_0x156d4c[_0x5ce67b(0x1e4)](_0x5ce67b(0x1db)));else _0x6728a6['status']===_0x5ce67b(0x212)?console[_0x5ce67b(0x1fb)](a5_0x156d4c[_0x5ce67b(0x22f)](_0x5ce67b(0x1f7)+_0x81916d+_0x5ce67b(0x1ce)+_0x6728a6['reason'])+a5_0x156d4c[_0x5ce67b(0x1e4)](_0x5ce67b(0x1db))):console['log'](a5_0x156d4c[_0x5ce67b(0x22f)](_0x5ce67b(0x1eb)+_0x81916d+_0x5ce67b(0x1ce)+_0x6728a6[_0x5ce67b(0x1ed)]));_0x6728a6[_0x5ce67b(0x1f8)]&&console[_0x5ce67b(0x1fb)](a5_0x156d4c['dim'](_0x5ce67b(0x1cd)+_0x6728a6[_0x5ce67b(0x1f8)])),_0x56426['push'](_0x6728a6);},'onTestSkipped':(_0x13388f,_0x1aa11f)=>{const _0x4fc105=_0x86bbf7;_0x2d0608[_0x4fc105(0x226)](),console[_0x4fc105(0x1fb)](a5_0x156d4c[_0x4fc105(0x21f)](_0x4fc105(0x21c)+_0x13388f+_0x4fc105(0x1ce)+_0x1aa11f));}});for(const _0x2c1d1e of _0x508b50){!_0x56426[_0x86bbf7(0x1c2)](_0x4e2a01=>_0x4e2a01[_0x86bbf7(0x1d0)]===_0x2c1d1e[_0x86bbf7(0x1d0)])&&_0x56426['push'](_0x2c1d1e);}}catch(_0x1a695e){_0x2d0608[_0x86bbf7(0x226)]();const _0x331182=_0x1a695e instanceof Error?_0x1a695e[_0x86bbf7(0x1d7)]:String(_0x1a695e);return console[_0x86bbf7(0x1fb)](a5_0x156d4c[_0x86bbf7(0x22f)](_0x86bbf7(0x201)+_0x331182)),0x1;}_0x2d0608['stop']();if(_0x24ac2a['length']>0x0){console[_0x86bbf7(0x1fb)](),console[_0x86bbf7(0x1fb)](a5_0x156d4c[_0x86bbf7(0x1dc)](_0x86bbf7(0x224)));const {projectId:_0x1b119f,agentId:_0x18c969}=_0xfee129[_0x86bbf7(0x1b9)];for(const _0x44ca28 of _0x24ac2a){console[_0x86bbf7(0x1fb)](_0x86bbf7(0x228)+a5_0x156d4c[_0x86bbf7(0x1f5)](_0x44ca28[_0x86bbf7(0x1d0)]));const _0x1bf37e=createCommandSpinner(_0x86bbf7(0x1f1)+_0x44ca28[_0x86bbf7(0x200)][_0x86bbf7(0x203)]+_0x86bbf7(0x1c6));_0x1bf37e[_0x86bbf7(0x1df)]();try{const {result:_0x45baa9}=await runTest(_0x287334[_0x86bbf7(0x1a8)],_0x44ca28,{'agentId':_0x18c969,'projectId':_0x1b119f,'site':_0xfee129[_0x86bbf7(0x21b)],'noEval':![],'evaluatorId':_0x380c97,'onRoundStart':(_0x1d620b,_0x4c9a0b)=>{const _0x4816bf=_0x86bbf7;_0x1bf37e[_0x4816bf(0x216)]=_0x4816bf(0x1f3)+(_0x1d620b+0x1)+'/'+_0x4c9a0b+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x4c17f6,_0x1f48c3,_0x141eb2)=>{const _0x5c6d86=_0x86bbf7,_0x58768b=formatElapsed(_0x1f48c3);_0x141eb2?console[_0x5c6d86(0x1fb)](_0x5c6d86(0x1a4)+(_0x4c17f6+0x1)+'/'+_0x44ca28[_0x5c6d86(0x200)][_0x5c6d86(0x203)]+_0x5c6d86(0x1b4)+a5_0x156d4c['green']('✓')+'\x20('+_0x58768b+')'):console[_0x5c6d86(0x1fb)](_0x5c6d86(0x1a4)+(_0x4c17f6+0x1)+'/'+_0x44ca28['rounds']['length']+'...\x20'+a5_0x156d4c[_0x5c6d86(0x22f)]('✗'));},'onEvaluationStart':()=>{const _0x3f07b6=_0x86bbf7;_0x1bf37e['text']=_0x3f07b6(0x21a);},'onEvaluationComplete':_0x5479f3=>{const _0x43c197=_0x86bbf7,_0x20ca89=formatElapsed(_0x5479f3);console['log'](_0x43c197(0x1d1)+a5_0x156d4c['green']('✓')+'\x20('+_0x20ca89+')');}});_0x1bf37e[_0x86bbf7(0x226)](),_0x56426[_0x86bbf7(0x213)](_0x45baa9);if(_0x45baa9[_0x86bbf7(0x1bf)]===_0x86bbf7(0x1ca))console[_0x86bbf7(0x1fb)](a5_0x156d4c[_0x86bbf7(0x225)](_0x86bbf7(0x20b)+_0x45baa9[_0x86bbf7(0x1ed)])+a5_0x156d4c['dim'](_0x86bbf7(0x1a7)));else _0x45baa9[_0x86bbf7(0x1bf)]==='FAIL'?console['log'](a5_0x156d4c[_0x86bbf7(0x22f)](_0x86bbf7(0x1f7)+_0x45baa9[_0x86bbf7(0x1ed)])+a5_0x156d4c[_0x86bbf7(0x1e4)]('\x20(new)')):console[_0x86bbf7(0x1fb)](a5_0x156d4c[_0x86bbf7(0x22f)](_0x86bbf7(0x1eb)+_0x45baa9[_0x86bbf7(0x1ed)]));_0x45baa9[_0x86bbf7(0x1f8)]&&console[_0x86bbf7(0x1fb)](a5_0x156d4c['dim'](_0x86bbf7(0x1cd)+_0x45baa9[_0x86bbf7(0x1f8)]));}catch(_0x1826b2){_0x1bf37e[_0x86bbf7(0x226)]();const _0x2893e4=_0x1826b2 instanceof Error?_0x1826b2[_0x86bbf7(0x1d7)]:String(_0x1826b2);console[_0x86bbf7(0x1fb)](a5_0x156d4c[_0x86bbf7(0x22f)](_0x86bbf7(0x1eb)+_0x2893e4)),_0x56426[_0x86bbf7(0x213)]({'name':_0x44ca28['name'],'status':_0x86bbf7(0x1a1),'reason':_0x2893e4,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}}console[_0x86bbf7(0x1fb)]();const _0x614a4=Date[_0x86bbf7(0x1ec)]()-_0x2fd197,_0x5a2394=_0x56426[_0x86bbf7(0x208)](_0x11ce26=>_0x11ce26[_0x86bbf7(0x1bf)]===_0x86bbf7(0x1ca))[_0x86bbf7(0x203)],_0x4ab1a0=_0x56426[_0x86bbf7(0x208)](_0x3f54b4=>_0x3f54b4[_0x86bbf7(0x1bf)]===_0x86bbf7(0x212))[_0x86bbf7(0x203)],_0x49c49b=_0x56426[_0x86bbf7(0x208)](_0x5afb5e=>_0x5afb5e['status']===_0x86bbf7(0x1a1))[_0x86bbf7(0x203)];console[_0x86bbf7(0x1fb)]('━'[_0x86bbf7(0x20a)](0x3c)),console[_0x86bbf7(0x1fb)](_0x86bbf7(0x1de)),console['log']('━'['repeat'](0x3c)),console[_0x86bbf7(0x1fb)]('Total:\x20\x20\x20\x20'+_0x56426[_0x86bbf7(0x203)]),console['log'](_0x86bbf7(0x1c9)+a5_0x156d4c[_0x86bbf7(0x225)](_0x5a2394)),console['log'](_0x86bbf7(0x1d3)+a5_0x156d4c[_0x86bbf7(0x22f)](_0x4ab1a0));_0x49c49b>0x0&&console[_0x86bbf7(0x1fb)](_0x86bbf7(0x1d6)+a5_0x156d4c[_0x86bbf7(0x22f)](_0x49c49b));console['log']('Duration:\x20'+formatElapsed(_0x614a4)),console['log']('━'[_0x86bbf7(0x20a)](0x3c));const _0x261d49={'summary':{'total':_0x56426[_0x86bbf7(0x203)],'passed':_0x5a2394,'failed':_0x4ab1a0,'errors':_0x49c49b>0x0?_0x49c49b:undefined,'duration_ms':_0x614a4},'tests':_0x56426,'agent':{'project':_0x25bc48['projectName'],'name':_0x25bc48[_0x86bbf7(0x1c4)],'site':_0x5cc9f4},'timestamp':new Date(_0x2fd197)[_0x86bbf7(0x1bd)]()};if(_0x52e6f5!==_0x86bbf7(0x20f)||_0x2f9bc4){const _0x2655f1=formatResults(_0x261d49,_0x52e6f5);if(_0x2f9bc4)try{a5_0x512f45['writeFileSync'](_0x2f9bc4,_0x2655f1,_0x86bbf7(0x1f6)),console[_0x86bbf7(0x1fb)](),console[_0x86bbf7(0x1fb)](a5_0x156d4c[_0x86bbf7(0x1e4)](_0x86bbf7(0x1d4)+_0x2f9bc4));}catch(_0x3d25e1){return console[_0x86bbf7(0x1fb)](),console[_0x86bbf7(0x1fb)](a5_0x156d4c[_0x86bbf7(0x22f)](_0x86bbf7(0x20e)+_0x3d25e1)),0x1;}else console[_0x86bbf7(0x1fb)](),console[_0x86bbf7(0x1fb)](_0x2655f1);}const _0x4ae001=_0x56426['filter'](_0x5bba2c=>_0x5bba2c['status']!==_0x86bbf7(0x1ca));return _0x4ae001[_0x86bbf7(0x203)]>0x0?0x1:0x0;}}
@@ -1 +1 @@
1
- const a6_0x5a5ca0=a6_0x5c90;(function(_0x3fb1e5,_0x3f4ab1){const _0x19e71a=a6_0x5c90,_0x25b673=_0x3fb1e5();while(!![]){try{const _0x2ce831=parseInt(_0x19e71a(0x157))/0x1*(-parseInt(_0x19e71a(0x150))/0x2)+-parseInt(_0x19e71a(0x18e))/0x3*(parseInt(_0x19e71a(0x183))/0x4)+parseInt(_0x19e71a(0x186))/0x5*(parseInt(_0x19e71a(0x17b))/0x6)+parseInt(_0x19e71a(0x177))/0x7*(parseInt(_0x19e71a(0x18d))/0x8)+parseInt(_0x19e71a(0x18c))/0x9*(-parseInt(_0x19e71a(0x171))/0xa)+-parseInt(_0x19e71a(0x161))/0xb*(parseInt(_0x19e71a(0x179))/0xc)+parseInt(_0x19e71a(0x190))/0xd*(parseInt(_0x19e71a(0x164))/0xe);if(_0x2ce831===_0x3f4ab1)break;else _0x25b673['push'](_0x25b673['shift']());}catch(_0x1aa4ea){_0x25b673['push'](_0x25b673['shift']());}}}(a6_0x55f9,0x6e941));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_0x55f9(){const _0x455c2c=['14slnebT','includes','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','file','llm-proxy','isArray','Endpoint\x20must\x20start\x20with\x20/:\x20','128491LywXzb','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','PATCH','description','request','status','<\x20HTTP/1.1\x20','readBodyFromFile','toUpperCase','POST','33dAJjYj','color','proxy-authorization','15946BOvGWL','startsWith','x-trino-user','toLowerCase','headers','x-auth-token','method','Invalid\x20header\x20format:\x20\x22','PUT','.\x20Valid\x20types:\x20','Invalid\x20HTTP\x20method:\x20','set-cookie','set-cookie2','812990ttICSb','message','trino','workflow','\x0aStack\x20trace:\x0a','header','1392097MGLcqq','body','2971080AVsYmr','GET','1401594ZWUrog','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','error','verbose','data','validate','.\x20Valid\x20methods:\x20','trim','652rbdrfB','length','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','15brfnRc','execute','noColor','substring','stack','api','9fXqAny','8gVbSnN','10797hKIAYf','output','21268iqPghC','Error:\x20','Invalid\x20API\x20type:\x20','x-xsrf-token','entries'];a6_0x55f9=function(){return _0x455c2c;};return a6_0x55f9();}import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set(['authorization',a6_0x5a5ca0(0x163),'cookie',a6_0x5a5ca0(0x16f),a6_0x5a5ca0(0x170),a6_0x5a5ca0(0x14e),a6_0x5a5ca0(0x169),a6_0x5a5ca0(0x166)]);function a6_0x5c90(_0x53e937,_0x112497){_0x53e937=_0x53e937-0x14d;const _0x55f98b=a6_0x55f9();let _0x5c90eb=_0x55f98b[_0x53e937];return _0x5c90eb;}function isSensitiveHeader(_0x124572){const _0x120e9e=a6_0x5a5ca0;return SENSITIVE_HEADERS['has'](_0x124572[_0x120e9e(0x167)]());}function parseHeader(_0x17d617){const _0x5747e9=a6_0x5a5ca0,_0x7cbcaa=_0x17d617['indexOf'](':');if(_0x7cbcaa===-0x1)throw new Error(_0x5747e9(0x16b)+_0x17d617+'\x22.\x20'+_0x5747e9(0x158));const _0x549981=_0x17d617[_0x5747e9(0x189)](0x0,_0x7cbcaa)[_0x5747e9(0x182)](),_0x41dd02=_0x17d617[_0x5747e9(0x189)](_0x7cbcaa+0x1)[_0x5747e9(0x182)]();if(!_0x549981)throw new Error(_0x5747e9(0x152)+_0x17d617+'\x22');return[_0x549981,_0x41dd02];}export class ApiCommand extends BaseCommand{['name']=a6_0x5a5ca0(0x18b);[a6_0x5a5ca0(0x15a)]='Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs';[a6_0x5a5ca0(0x180)](_0x589a07){const _0x5a4872=a6_0x5a5ca0,{args:_0x5892cb,options:_0x3ad18f}=_0x589a07,_0x437cca=_0x3ad18f;if(_0x5892cb[_0x5a4872(0x184)]===0x0)return _0x5a4872(0x17c);const _0x292f79=_0x5892cb[0x0];if(!_0x292f79[_0x5a4872(0x165)]('/'))return _0x5a4872(0x156)+_0x292f79;const _0x3d73e8=_0x437cca[_0x5a4872(0x17f)],_0x3a9d4c=_0x437cca[_0x5a4872(0x153)];if(_0x3d73e8&&_0x3a9d4c)return _0x5a4872(0x185);const _0x1bcd83=_0x437cca['method']||'GET',_0x3e9c14=['GET',_0x5a4872(0x160),_0x5a4872(0x16c),'DELETE',_0x5a4872(0x159)];if(!_0x3e9c14['includes'](_0x1bcd83['toUpperCase']()))return _0x5a4872(0x16e)+_0x1bcd83+_0x5a4872(0x181)+_0x3e9c14['join'](',\x20');const _0x1fd4e4=_0x437cca['type']||'td',_0x38cb08=['td','cdp',_0x5a4872(0x174),_0x5a4872(0x173),'llm',_0x5a4872(0x154)];if(!_0x38cb08[_0x5a4872(0x151)](_0x1fd4e4))return _0x5a4872(0x14d)+_0x1fd4e4+_0x5a4872(0x16d)+_0x38cb08['join'](',\x20');return undefined;}async[a6_0x5a5ca0(0x187)](_0x18cb83){const _0x2b1263=a6_0x5a5ca0,{options:_0x23821c,args:_0x36f1c5,tdx:_0x28dd62}=_0x18cb83,_0x45a79b=_0x23821c,_0x257aca=_0x36f1c5[0x0],_0x133e84=(_0x45a79b[_0x2b1263(0x16a)]||_0x2b1263(0x17a))[_0x2b1263(0x15f)](),_0x347a74=_0x45a79b[_0x2b1263(0x17f)],_0x3678a2=_0x45a79b[_0x2b1263(0x153)],_0x4bf8dc=_0x45a79b[_0x2b1263(0x176)],_0x559c04=_0x45a79b['type']||'td';try{const _0x39190a={};if(_0x4bf8dc){const _0x4f4cbf=Array[_0x2b1263(0x155)](_0x4bf8dc)?_0x4bf8dc:[_0x4bf8dc];for(const _0x3d5255 of _0x4f4cbf){const [_0x4ba88f,_0x48aaf0]=parseHeader(_0x3d5255);_0x39190a[_0x4ba88f]=_0x48aaf0;}}let _0x2ff094;if(_0x347a74)_0x2ff094=_0x347a74;else{if(_0x3678a2)try{_0x2ff094=RawAPI[_0x2b1263(0x15e)](_0x3678a2);}catch(_0x10c8f9){return console[_0x2b1263(0x17d)](_0x2b1263(0x191)+(_0x10c8f9 instanceof Error?_0x10c8f9[_0x2b1263(0x172)]:String(_0x10c8f9))),0x1;}}const _0x29b8cd={'method':_0x133e84,'apiType':_0x559c04,'includeHeaders':_0x23821c[_0x2b1263(0x17e)]};_0x2ff094&&(_0x29b8cd[_0x2b1263(0x178)]=_0x2ff094);Object['keys'](_0x39190a)[_0x2b1263(0x184)]>0x0&&(_0x29b8cd[_0x2b1263(0x168)]=_0x39190a);if(_0x23821c[_0x2b1263(0x17e)]){const _0x4c9c14=resolveSite(_0x23821c['site']),_0x403aae=getEndpoint(_0x4c9c14,_0x559c04),_0x21d179=''+_0x403aae+_0x257aca;console[_0x2b1263(0x17d)]('>\x20'+_0x133e84+'\x20'+_0x21d179);const _0x34acc4=getAuthHeaders(_0x4c9c14),_0x39be26={..._0x34acc4,..._0x39190a};for(const [_0x56f5f9,_0x3dffb6]of Object[_0x2b1263(0x14f)](_0x39be26)){!isSensitiveHeader(_0x56f5f9)&&console['error']('>\x20'+_0x56f5f9+':\x20'+_0x3dffb6);}_0x2ff094&&console[_0x2b1263(0x17d)]('>'),console[_0x2b1263(0x17d)]('');}const _0x13d7b9=await _0x28dd62[_0x2b1263(0x18b)][_0x2b1263(0x15b)](_0x257aca,_0x29b8cd);if(_0x23821c[_0x2b1263(0x17e)]&&_0x13d7b9[_0x2b1263(0x168)]){console[_0x2b1263(0x17d)](_0x2b1263(0x15d)+_0x13d7b9[_0x2b1263(0x15c)]);for(const [_0x13486e,_0x248387]of Object[_0x2b1263(0x14f)](_0x13d7b9[_0x2b1263(0x168)])){!isSensitiveHeader(_0x13486e)&&console[_0x2b1263(0x17d)]('<\x20'+_0x13486e+':\x20'+_0x248387);}console[_0x2b1263(0x17d)]('');}const _0x235bee=Boolean(_0x23821c[_0x2b1263(0x18f)]),_0x1beef4={'color':_0x23821c[_0x2b1263(0x162)],'noColor':_0x23821c[_0x2b1263(0x188)]||_0x235bee&&!_0x23821c[_0x2b1263(0x162)]},_0x570b2b=colorizeJSON(_0x13d7b9['data'],_0x1beef4);return _0x23821c[_0x2b1263(0x18f)]?(writeFileSync(_0x23821c[_0x2b1263(0x18f)],_0x570b2b),console[_0x2b1263(0x17d)]('Results\x20saved\x20to\x20'+_0x23821c[_0x2b1263(0x18f)])):console['log'](_0x570b2b),0x0;}catch(_0x25ac13){return _0x25ac13 instanceof Error?(console[_0x2b1263(0x17d)](_0x2b1263(0x191)+_0x25ac13[_0x2b1263(0x172)]),_0x23821c[_0x2b1263(0x17e)]&&_0x25ac13[_0x2b1263(0x18a)]&&console['error'](_0x2b1263(0x175)+_0x25ac13[_0x2b1263(0x18a)])):console[_0x2b1263(0x17d)](_0x2b1263(0x191)+String(_0x25ac13)),0x1;}}}
1
+ const a6_0x21e77f=a6_0x16a2;(function(_0x1bd1d9,_0x4eebd8){const _0xcb23ae=a6_0x16a2,_0x27a821=_0x1bd1d9();while(!![]){try{const _0x7442c1=parseInt(_0xcb23ae(0x11f))/0x1*(-parseInt(_0xcb23ae(0x11a))/0x2)+-parseInt(_0xcb23ae(0x13b))/0x3*(-parseInt(_0xcb23ae(0x11d))/0x4)+-parseInt(_0xcb23ae(0x125))/0x5+-parseInt(_0xcb23ae(0x12a))/0x6+parseInt(_0xcb23ae(0x13d))/0x7+parseInt(_0xcb23ae(0x10c))/0x8*(-parseInt(_0xcb23ae(0x120))/0x9)+-parseInt(_0xcb23ae(0x136))/0xa*(-parseInt(_0xcb23ae(0x129))/0xb);if(_0x7442c1===_0x4eebd8)break;else _0x27a821['push'](_0x27a821['shift']());}catch(_0x4ee631){_0x27a821['push'](_0x27a821['shift']());}}}(a6_0x5804,0xa0dfe));import{BaseCommand}from'./command.js';function a6_0x16a2(_0x281cc0,_0x1f9c32){_0x281cc0=_0x281cc0-0x106;const _0x580439=a6_0x5804();let _0x16a2b6=_0x580439[_0x281cc0];return _0x16a2b6;}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_0x5804(){const _0x338968=['type','indexOf','stack','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','data','llm','request','298GzDhJk','<\x20HTTP/1.1\x20','name','2350028vCnzGs','trim','1303ncOIdy','9usRLny','POST','workflow','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','validate','6481450fMuBfE','cookie','method','description','28863901bDHixG','1396608hliXDX','\x0aStack\x20trace:\x0a','includes','noColor','DELETE','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','has','message','Endpoint\x20must\x20start\x20with\x20/:\x20','status','headers','Invalid\x20header\x20format:\x20\x22','10npqjvn','toUpperCase','join','Invalid\x20HTTP\x20method:\x20','verbose','3dnRgVn','x-auth-token','401016aNqSgF','toLowerCase','substring','file','color','\x22.\x20','Invalid\x20API\x20type:\x20','isArray','error','PUT','api','GET','Error:\x20','.\x20Valid\x20methods:\x20','entries','body','trino','x-xsrf-token','length','7093112sLpvjc','.\x20Valid\x20types:\x20','site','keys','output','x-trino-user','readBodyFromFile'];a6_0x5804=function(){return _0x338968;};return a6_0x5804();}import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set(['authorization','proxy-authorization',a6_0x21e77f(0x126),'set-cookie','set-cookie2',a6_0x21e77f(0x10a),a6_0x21e77f(0x13c),a6_0x21e77f(0x111)]);function isSensitiveHeader(_0x29c1a2){const _0x5ebeac=a6_0x21e77f;return SENSITIVE_HEADERS[_0x5ebeac(0x130)](_0x29c1a2[_0x5ebeac(0x13e)]());}function parseHeader(_0x1458ff){const _0x526c38=a6_0x21e77f,_0x42e912=_0x1458ff[_0x526c38(0x114)](':');if(_0x42e912===-0x1)throw new Error(_0x526c38(0x135)+_0x1458ff+_0x526c38(0x142)+_0x526c38(0x116));const _0x1629fc=_0x1458ff['substring'](0x0,_0x42e912)[_0x526c38(0x11e)](),_0x53ef53=_0x1458ff[_0x526c38(0x13f)](_0x42e912+0x1)['trim']();if(!_0x1629fc)throw new Error(_0x526c38(0x123)+_0x1458ff+'\x22');return[_0x1629fc,_0x53ef53];}export class ApiCommand extends BaseCommand{[a6_0x21e77f(0x11c)]='api';[a6_0x21e77f(0x128)]='Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs';[a6_0x21e77f(0x124)](_0x344763){const _0x1ede5e=a6_0x21e77f,{args:_0x3b0107,options:_0x536eab}=_0x344763,_0x1016e5=_0x536eab;if(_0x3b0107[_0x1ede5e(0x10b)]===0x0)return _0x1ede5e(0x12f);const _0x42a7da=_0x3b0107[0x0];if(!_0x42a7da['startsWith']('/'))return _0x1ede5e(0x132)+_0x42a7da;const _0x493771=_0x1016e5[_0x1ede5e(0x117)],_0x7db652=_0x1016e5['file'];if(_0x493771&&_0x7db652)return'Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.';const _0x1a0bf8=_0x1016e5[_0x1ede5e(0x127)]||_0x1ede5e(0x148),_0x6b87fc=[_0x1ede5e(0x148),_0x1ede5e(0x121),_0x1ede5e(0x146),_0x1ede5e(0x12e),'PATCH'];if(!_0x6b87fc[_0x1ede5e(0x12c)](_0x1a0bf8['toUpperCase']()))return _0x1ede5e(0x139)+_0x1a0bf8+_0x1ede5e(0x106)+_0x6b87fc['join'](',\x20');const _0x39758c=_0x1016e5['type']||'td',_0x404e11=['td','cdp',_0x1ede5e(0x122),_0x1ede5e(0x109),_0x1ede5e(0x118),'llm-proxy'];if(!_0x404e11[_0x1ede5e(0x12c)](_0x39758c))return _0x1ede5e(0x143)+_0x39758c+_0x1ede5e(0x10d)+_0x404e11[_0x1ede5e(0x138)](',\x20');return undefined;}async['execute'](_0x48e720){const _0x47b5fb=a6_0x21e77f,{options:_0xb53cd2,args:_0x3b3209,tdx:_0x7a3757}=_0x48e720,_0xc212ab=_0xb53cd2,_0x4e1485=_0x3b3209[0x0],_0x521f6c=(_0xc212ab['method']||'GET')[_0x47b5fb(0x137)](),_0x387bb4=_0xc212ab[_0x47b5fb(0x117)],_0x26ae01=_0xc212ab[_0x47b5fb(0x140)],_0x24ae87=_0xc212ab['header'],_0x3c4e6b=_0xc212ab[_0x47b5fb(0x113)]||'td';try{const _0x2a1cdc={};if(_0x24ae87){const _0x4896f0=Array[_0x47b5fb(0x144)](_0x24ae87)?_0x24ae87:[_0x24ae87];for(const _0x482803 of _0x4896f0){const [_0x185367,_0x42c023]=parseHeader(_0x482803);_0x2a1cdc[_0x185367]=_0x42c023;}}let _0x32fad0;if(_0x387bb4)_0x32fad0=_0x387bb4;else{if(_0x26ae01)try{_0x32fad0=RawAPI[_0x47b5fb(0x112)](_0x26ae01);}catch(_0x2fe6bb){return console['error'](_0x47b5fb(0x149)+(_0x2fe6bb instanceof Error?_0x2fe6bb['message']:String(_0x2fe6bb))),0x1;}}const _0x1ab7d7={'method':_0x521f6c,'apiType':_0x3c4e6b,'includeHeaders':_0xb53cd2[_0x47b5fb(0x13a)]};_0x32fad0&&(_0x1ab7d7[_0x47b5fb(0x108)]=_0x32fad0);Object[_0x47b5fb(0x10f)](_0x2a1cdc)[_0x47b5fb(0x10b)]>0x0&&(_0x1ab7d7[_0x47b5fb(0x134)]=_0x2a1cdc);if(_0xb53cd2[_0x47b5fb(0x13a)]){const _0x23236d=resolveSite(_0xb53cd2[_0x47b5fb(0x10e)]),_0x26c765=getEndpoint(_0x23236d,_0x3c4e6b),_0x91bc13=''+_0x26c765+_0x4e1485;console['error']('>\x20'+_0x521f6c+'\x20'+_0x91bc13);const _0x5956c3=getAuthHeaders(_0x23236d),_0x488ed2={..._0x5956c3,..._0x2a1cdc};for(const [_0x185e3c,_0x48ebb0]of Object[_0x47b5fb(0x107)](_0x488ed2)){!isSensitiveHeader(_0x185e3c)&&console[_0x47b5fb(0x145)]('>\x20'+_0x185e3c+':\x20'+_0x48ebb0);}_0x32fad0&&console[_0x47b5fb(0x145)]('>'),console[_0x47b5fb(0x145)]('');}const _0x3082e6=await _0x7a3757[_0x47b5fb(0x147)][_0x47b5fb(0x119)](_0x4e1485,_0x1ab7d7);if(_0xb53cd2['verbose']&&_0x3082e6['headers']){console[_0x47b5fb(0x145)](_0x47b5fb(0x11b)+_0x3082e6[_0x47b5fb(0x133)]);for(const [_0x560d0c,_0x47b315]of Object[_0x47b5fb(0x107)](_0x3082e6[_0x47b5fb(0x134)])){!isSensitiveHeader(_0x560d0c)&&console['error']('<\x20'+_0x560d0c+':\x20'+_0x47b315);}console[_0x47b5fb(0x145)]('');}const _0x1b20ae=Boolean(_0xb53cd2[_0x47b5fb(0x110)]),_0x1d0c99={'color':_0xb53cd2[_0x47b5fb(0x141)],'noColor':_0xb53cd2[_0x47b5fb(0x12d)]||_0x1b20ae&&!_0xb53cd2[_0x47b5fb(0x141)]},_0x2a32a2=colorizeJSON(_0x3082e6[_0x47b5fb(0x117)],_0x1d0c99);return _0xb53cd2[_0x47b5fb(0x110)]?(writeFileSync(_0xb53cd2[_0x47b5fb(0x110)],_0x2a32a2),console[_0x47b5fb(0x145)]('Results\x20saved\x20to\x20'+_0xb53cd2[_0x47b5fb(0x110)])):console['log'](_0x2a32a2),0x0;}catch(_0x315c75){return _0x315c75 instanceof Error?(console['error'](_0x47b5fb(0x149)+_0x315c75[_0x47b5fb(0x131)]),_0xb53cd2[_0x47b5fb(0x13a)]&&_0x315c75[_0x47b5fb(0x115)]&&console[_0x47b5fb(0x145)](_0x47b5fb(0x12b)+_0x315c75['stack'])):console['error'](_0x47b5fb(0x149)+String(_0x315c75)),0x1;}}}
@@ -1 +1 @@
1
- const a7_0x174119=a7_0x1fca;(function(_0x1a34b5,_0x3fa903){const _0x46f9be=a7_0x1fca,_0x1e2908=_0x1a34b5();while(!![]){try{const _0x5d37b5=-parseInt(_0x46f9be(0x171))/0x1*(parseInt(_0x46f9be(0x18c))/0x2)+-parseInt(_0x46f9be(0x164))/0x3+parseInt(_0x46f9be(0x17d))/0x4*(-parseInt(_0x46f9be(0x177))/0x5)+parseInt(_0x46f9be(0x18e))/0x6*(-parseInt(_0x46f9be(0x1a4))/0x7)+-parseInt(_0x46f9be(0x168))/0x8*(parseInt(_0x46f9be(0x19f))/0x9)+-parseInt(_0x46f9be(0x1a7))/0xa+-parseInt(_0x46f9be(0x17f))/0xb*(-parseInt(_0x46f9be(0x185))/0xc);if(_0x5d37b5===_0x3fa903)break;else _0x1e2908['push'](_0x1e2908['shift']());}catch(_0x127156){_0x1e2908['push'](_0x1e2908['shift']());}}}(a7_0x3ee6,0xb5f23));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';function a7_0x3ee6(){const _0x567717=['✓\x20Authentication\x20successful\x0a','Remove\x20API\x20key\x20from\x20system\x20keychain','2223ZNxnVK','execute','ERROR','first_name','\x20for\x20profile:\x20','text','41185nQGAWi','\x20(profile:\x20','\x20--profile\x20','/app/mp/ak','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','388STgTKb','N/A','2783WKhNbN','✓\x20Profile\x20\x27','✓\x20Default\x20site\x20set\x20to\x20','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','site','last_name','238044rFizAC','description','\x20\x20tdx','No\x20credential\x20found','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','jobs','select','1006CkLJOK','error','6ZpKuei','Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20','tdx\x20profile:\x20','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','Name:\x20','join','profile','green','bold','yellow','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','apiKey','✓\x20API\x20key\x20removed\x20from\x20keychain','warn','Validating\x20API\x20key...','log','User:\x20','5412249wSGxHL','name','other','email','Enter\x20your\x20TD\x20API\x20key:','681023sFqhEJ','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','getUserInfo','9769870HQYXFN','System\x20keychain\x20is\x20not\x20available','tdx:\x20auth\x20setup','us01','auth:setup','API\x20key\x20cannot\x20be\x20empty','red','238062WwGrDS','✗\x20Validation\x20failed:\x20','create','trim','16QLqkNT','No\x20API\x20key\x20found\x20in\x20keychain','auth:clear','Setup\x20API\x20key\x20authentication\x20interactively','customSite','message','filter'];a7_0x3ee6=function(){return _0x567717;};return a7_0x3ee6();}import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';function a7_0x1fca(_0x1746f7,_0x47ea9d){_0x1746f7=_0x1746f7-0x160;const _0x3ee68=a7_0x3ee6();let _0x1fcaf9=_0x3ee68[_0x1746f7];return _0x1fcaf9;}import{buildSiteChoices}from'../core/constants.js';import a7_0x4aaabe 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_0x514684 from'chalk';export class AuthSetupCommand extends BaseCommand{['name']=a7_0x174119(0x161);[a7_0x174119(0x186)]=a7_0x174119(0x16b);async[a7_0x174119(0x172)](_0x2d03ea){const _0x222241=a7_0x174119,{options:_0x11c19a}=_0x2d03ea,_0x33e796=_0x11c19a[_0x222241(0x194)];console['log'](a7_0x514684[_0x222241(0x196)](_0x222241(0x1a9)));const _0x2f86c2=_0x11c19a[_0x222241(0x183)]||_0x222241(0x160),{choices:_0x4e6dfd,initialIndex:_0x2b662f}=buildSiteChoices(_0x2f86c2),_0x4ba56b=_0x33e796?_0x222241(0x18f)+_0x33e796+'):':'Select\x20your\x20Treasure\x20Data\x20site:',_0x1ddaf8=await a7_0x4aaabe({'type':_0x222241(0x18b),'name':'site','message':_0x4ba56b,'choices':_0x4e6dfd,'initial':_0x2b662f});if(!_0x1ddaf8[_0x222241(0x183)])return console[_0x222241(0x19d)]('\x0aSetup\x20cancelled'),0x1;let _0x439fb5;if(_0x1ddaf8[_0x222241(0x183)]===_0x222241(0x1a1)){const _0x5d1742=await a7_0x4aaabe({'type':_0x222241(0x176),'name':_0x222241(0x16c),'message':'Enter\x20site\x20name:','initial':'us01','validate':_0xdae1eb=>{const _0x21ff9e=_0x222241;if(!_0xdae1eb||!_0xdae1eb[_0x21ff9e(0x167)]())return'Site\x20name\x20cannot\x20be\x20empty';if(!/^[a-z0-9-]+$/['test'](_0xdae1eb['trim']()))return _0x21ff9e(0x17b);return!![];}});if(!_0x5d1742[_0x222241(0x16c)])return console[_0x222241(0x19d)]('\x0aSetup\x20cancelled'),0x1;_0x439fb5=_0x5d1742['customSite'];}else _0x439fb5=_0x1ddaf8[_0x222241(0x183)];const _0x26401f=resolveSite(_0x439fb5);console['log']('Setting\x20up\x20authentication\x20for\x20site:\x20'+_0x26401f),console['log']('You\x20can\x20find\x20your\x20API\x20key\x20at:'),console[_0x222241(0x19d)]('\x20\x20'+getConsoleUrl(_0x26401f,_0x222241(0x17a)));const _0x12012e=await a7_0x4aaabe({'type':'password','name':_0x222241(0x199),'message':_0x222241(0x1a3),'validate':_0x479f79=>{const _0xa670d5=_0x222241;if(!_0x479f79||!_0x479f79['trim']())return _0xa670d5(0x162);return!![];}});if(!_0x12012e[_0x222241(0x199)])return console['log']('\x0aSetup\x20cancelled'),0x1;const _0x3f3615=_0x12012e['apiKey'];console['log'](_0x222241(0x19c));try{const _0x22806a=TDX[_0x222241(0x166)]({'site':_0x26401f,'apiKey':_0x3f3615[_0x222241(0x167)](),'logLevel':_0x11c19a['logLevel']??LogLevel[_0x222241(0x173)]}),_0x5c03b9=await _0x22806a[_0x222241(0x18a)][_0x222241(0x1a6)]();console[_0x222241(0x19d)](_0x222241(0x1a5)+_0x5c03b9[_0x222241(0x1a2)]+')');const _0x40955d=await isKeychainAvailable();_0x40955d?(await saveAPIKeyAsync(_0x3f3615['trim'](),_0x26401f,_0x33e796),console[_0x222241(0x19d)]('✓\x20API\x20key\x20saved\x20to\x20system\x20keychain'+(_0x33e796?_0x222241(0x178)+_0x33e796+')':''))):(console[_0x222241(0x19b)](a7_0x514684[_0x222241(0x197)]('⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.')),console[_0x222241(0x19b)](a7_0x514684[_0x222241(0x197)](_0x222241(0x191))));if(_0x33e796){const _0x558257={'site':_0x26401f};saveProfileToUserConfig(_0x33e796,_0x558257),console[_0x222241(0x19d)](_0x222241(0x180)+_0x33e796+'\x27\x20registered');}else saveDefaultSiteToUserConfig(_0x26401f),console['log'](_0x222241(0x181)+_0x26401f);const _0x331040=_0x33e796?_0x222241(0x179)+_0x33e796:'';return console[_0x222241(0x19d)](),console[_0x222241(0x19d)](_0x222241(0x17c)),console['log']('\x20\x20tdx'+_0x331040+_0x222241(0x182)),console['log'](_0x222241(0x187)+_0x331040+_0x222241(0x198)),0x0;}catch(_0x4bba74){if(_0x4bba74 instanceof HTTPClientError&&_0x4bba74['status']===0x191)return printAuthError(_0x4bba74),0x1;return console[_0x222241(0x18d)](a7_0x514684[_0x222241(0x163)](_0x222241(0x165)+(_0x4bba74 instanceof Error?_0x4bba74[_0x222241(0x16d)]:String(_0x4bba74)))),console[_0x222241(0x18d)](_0x222241(0x189)),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x174119(0x1a0)]='auth';[a7_0x174119(0x186)]='Show\x20authentication\x20status\x20and\x20validate\x20API\x20key';async[a7_0x174119(0x172)](_0x40f822){const _0x545131=a7_0x174119,{options:_0x5e1893,tdx:_0x306a3e}=_0x40f822,_0x1ba84f=_0x5e1893['site'],_0x9d7076=_0x5e1893[_0x545131(0x194)],_0x439e94=_0x9d7076?_0x9d7076:_0x545131(0x17e);console['log'](_0x545131(0x190)+_0x439e94+'\x20(site:\x20'+_0x1ba84f+')');const _0x1c7666=await resolveAPIKeyAsync(_0x1ba84f,_0x9d7076);if(_0x1c7666){const {source:_0x283923,isDeprecated:_0x4e0942}=_0x1c7666,_0xdfd7ec='Read\x20credential\x20from\x20'+_0x283923;console[_0x545131(0x19d)](_0x4e0942?a7_0x514684['yellow'](_0xdfd7ec):_0xdfd7ec);}else console[_0x545131(0x19d)](a7_0x514684[_0x545131(0x197)](_0x545131(0x188)));try{const _0x23671d=await _0x306a3e['jobs'][_0x545131(0x1a6)]();return console[_0x545131(0x19d)](a7_0x514684[_0x545131(0x195)](_0x545131(0x16f))),console[_0x545131(0x19d)](_0x545131(0x19e)+_0x23671d[_0x545131(0x1a2)]),(_0x23671d[_0x545131(0x174)]||_0x23671d[_0x545131(0x184)])&&console['log'](_0x545131(0x192)+[_0x23671d[_0x545131(0x174)],_0x23671d['last_name']][_0x545131(0x16e)](Boolean)[_0x545131(0x193)]('\x20')),0x0;}catch(_0x14cc26){return _0x14cc26 instanceof HTTPClientError&&_0x14cc26['status']===0x191?printAuthError(_0x14cc26,!![],_0x9d7076):console['error'](a7_0x514684[_0x545131(0x163)](_0x545131(0x165)+(_0x14cc26 instanceof Error?_0x14cc26[_0x545131(0x16d)]:String(_0x14cc26)))),0x1;}}}export class AuthClearCommand extends BaseCommand{['name']=a7_0x174119(0x16a);['description']=a7_0x174119(0x170);async[a7_0x174119(0x172)](_0x1a0440){const _0x25e7a6=a7_0x174119,{options:_0x317da6}=_0x1a0440,_0x17a66c=_0x317da6[_0x25e7a6(0x194)];console[_0x25e7a6(0x19d)](a7_0x514684[_0x25e7a6(0x196)]('tdx:\x20auth\x20clear'));const _0x3ac8d8=await isKeychainAvailable();if(!_0x3ac8d8)return console[_0x25e7a6(0x18d)](a7_0x514684[_0x25e7a6(0x163)](_0x25e7a6(0x1a8))),0x1;const _0x341978=await deleteKeychainAPIKey(_0x17a66c);return _0x341978?(clearCredentialCache(),console[_0x25e7a6(0x19d)](_0x25e7a6(0x19a)+(_0x17a66c?_0x25e7a6(0x178)+_0x17a66c+')':'')),0x0):(console[_0x25e7a6(0x19d)](_0x25e7a6(0x169)+(_0x17a66c?_0x25e7a6(0x175)+_0x17a66c:'')),0x1);}}
1
+ function a7_0x26bd(){const _0x3e4784=['other','filter','\x0aSetup\x20cancelled','jobs','site','red','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','tdx\x20profile:\x20','apiKey','918EfTFCi','✗\x20Validation\x20failed:\x20','yellow','customSite','26907azVKvr','trim','auth:setup','718248qVoEbY','19658yWySWR','712BbYCHA','API\x20key\x20cannot\x20be\x20empty','20gdGaUF','auth','bold','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','log','execute','description','No\x20API\x20key\x20found\x20in\x20keychain','9jxtUyj','\x20(profile:\x20','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','Enter\x20your\x20TD\x20API\x20key:','User:\x20','last_name','40445HdcDrk','5572369drNamT','profile','password','error','tdx:\x20auth\x20clear','green','Name:\x20','System\x20keychain\x20is\x20not\x20available','✓\x20Default\x20site\x20set\x20to\x20','\x20\x20tdx','warn','\x27\x20registered','Enter\x20site\x20name:','N/A','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','You\x20can\x20find\x20your\x20API\x20key\x20at:','message','select','11251226UYbeAm','us01','test','/app/mp/ak','Select\x20your\x20Treasure\x20Data\x20site:','getUserInfo','status','join','4902904kZiwtm','\x20for\x20profile:\x20','auth:clear','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','Validating\x20API\x20key...','Read\x20credential\x20from\x20','✓\x20Authentication\x20successful\x0a','\x20(site:\x20','21CXhQlj','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','481qSAJPa','name','first_name','email','text','Remove\x20API\x20key\x20from\x20system\x20keychain'];a7_0x26bd=function(){return _0x3e4784;};return a7_0x26bd();}const a7_0x4774dc=a7_0x3600;(function(_0xc18f3c,_0x332369){const _0x93fc48=a7_0x3600,_0x336fc1=_0xc18f3c();while(!![]){try{const _0x2bf51e=parseInt(_0x93fc48(0x147))/0x1*(parseInt(_0x93fc48(0x112))/0x2)+-parseInt(_0x93fc48(0x10e))/0x3*(-parseInt(_0x93fc48(0x113))/0x4)+parseInt(_0x93fc48(0x124))/0x5*(parseInt(_0x93fc48(0x10a))/0x6)+-parseInt(_0x93fc48(0x137))/0x7+parseInt(_0x93fc48(0x13f))/0x8*(parseInt(_0x93fc48(0x11e))/0x9)+-parseInt(_0x93fc48(0x115))/0xa*(-parseInt(_0x93fc48(0x125))/0xb)+parseInt(_0x93fc48(0x111))/0xc*(-parseInt(_0x93fc48(0x149))/0xd);if(_0x2bf51e===_0x332369)break;else _0x336fc1['push'](_0x336fc1['shift']());}catch(_0x567aa5){_0x336fc1['push'](_0x336fc1['shift']());}}}(a7_0x26bd,0xce345));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';import{buildSiteChoices}from'../core/constants.js';import a7_0x413372 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_0x142def from'chalk';export class AuthSetupCommand extends BaseCommand{[a7_0x4774dc(0x14a)]=a7_0x4774dc(0x110);['description']='Setup\x20API\x20key\x20authentication\x20interactively';async[a7_0x4774dc(0x11b)](_0x561585){const _0x14f2d5=a7_0x4774dc,{options:_0x4626a6}=_0x561585,_0x13123b=_0x4626a6[_0x14f2d5(0x126)];console[_0x14f2d5(0x11a)](a7_0x142def[_0x14f2d5(0x117)]('tdx:\x20auth\x20setup'));const _0x147651=_0x4626a6['site']||_0x14f2d5(0x138),{choices:_0xca0f51,initialIndex:_0x1b7288}=buildSiteChoices(_0x147651),_0x236b66=_0x13123b?'Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20'+_0x13123b+'):':_0x14f2d5(0x13b),_0x4cbec8=await a7_0x413372({'type':_0x14f2d5(0x136),'name':_0x14f2d5(0x105),'message':_0x236b66,'choices':_0xca0f51,'initial':_0x1b7288});if(!_0x4cbec8[_0x14f2d5(0x105)])return console[_0x14f2d5(0x11a)](_0x14f2d5(0x103)),0x1;let _0x7ad265;if(_0x4cbec8[_0x14f2d5(0x105)]===_0x14f2d5(0x14f)){const _0x324a5c=await a7_0x413372({'type':_0x14f2d5(0x14d),'name':_0x14f2d5(0x10d),'message':_0x14f2d5(0x131),'initial':_0x14f2d5(0x138),'validate':_0x9fd6c=>{const _0x4df2e1=_0x14f2d5;if(!_0x9fd6c||!_0x9fd6c['trim']())return'Site\x20name\x20cannot\x20be\x20empty';if(!/^[a-z0-9-]+$/[_0x4df2e1(0x139)](_0x9fd6c['trim']()))return _0x4df2e1(0x107);return!![];}});if(!_0x324a5c[_0x14f2d5(0x10d)])return console[_0x14f2d5(0x11a)](_0x14f2d5(0x103)),0x1;_0x7ad265=_0x324a5c[_0x14f2d5(0x10d)];}else _0x7ad265=_0x4cbec8['site'];const _0x3c3d8a=resolveSite(_0x7ad265);console[_0x14f2d5(0x11a)]('Setting\x20up\x20authentication\x20for\x20site:\x20'+_0x3c3d8a),console[_0x14f2d5(0x11a)](_0x14f2d5(0x134)),console['log']('\x20\x20'+getConsoleUrl(_0x3c3d8a,_0x14f2d5(0x13a)));const _0x297262=await a7_0x413372({'type':_0x14f2d5(0x127),'name':_0x14f2d5(0x109),'message':_0x14f2d5(0x121),'validate':_0x5ac0b7=>{const _0x2e8548=_0x14f2d5;if(!_0x5ac0b7||!_0x5ac0b7['trim']())return _0x2e8548(0x114);return!![];}});if(!_0x297262[_0x14f2d5(0x109)])return console[_0x14f2d5(0x11a)](_0x14f2d5(0x103)),0x1;const _0x54ce0e=_0x297262[_0x14f2d5(0x109)];console[_0x14f2d5(0x11a)](_0x14f2d5(0x143));try{const _0x4b7990=TDX['create']({'site':_0x3c3d8a,'apiKey':_0x54ce0e['trim'](),'logLevel':_0x4626a6['logLevel']??LogLevel['ERROR']}),_0x14fcab=await _0x4b7990[_0x14f2d5(0x104)][_0x14f2d5(0x13c)]();console[_0x14f2d5(0x11a)](_0x14f2d5(0x120)+_0x14fcab[_0x14f2d5(0x14c)]+')');const _0x3a7988=await isKeychainAvailable();_0x3a7988?(await saveAPIKeyAsync(_0x54ce0e[_0x14f2d5(0x10f)](),_0x3c3d8a,_0x13123b),console['log']('✓\x20API\x20key\x20saved\x20to\x20system\x20keychain'+(_0x13123b?_0x14f2d5(0x11f)+_0x13123b+')':''))):(console[_0x14f2d5(0x12f)](a7_0x142def[_0x14f2d5(0x10c)](_0x14f2d5(0x118))),console[_0x14f2d5(0x12f)](a7_0x142def[_0x14f2d5(0x10c)](_0x14f2d5(0x148))));if(_0x13123b){const _0x2214c2={'site':_0x3c3d8a};saveProfileToUserConfig(_0x13123b,_0x2214c2),console[_0x14f2d5(0x11a)]('✓\x20Profile\x20\x27'+_0x13123b+_0x14f2d5(0x130));}else saveDefaultSiteToUserConfig(_0x3c3d8a),console['log'](_0x14f2d5(0x12d)+_0x3c3d8a);const _0x5156aa=_0x13123b?'\x20--profile\x20'+_0x13123b:'';return console['log'](),console['log'](_0x14f2d5(0x119)),console[_0x14f2d5(0x11a)](_0x14f2d5(0x12e)+_0x5156aa+_0x14f2d5(0x133)),console['log'](_0x14f2d5(0x12e)+_0x5156aa+_0x14f2d5(0x142)),0x0;}catch(_0x21a867){if(_0x21a867 instanceof HTTPClientError&&_0x21a867[_0x14f2d5(0x13d)]===0x191)return printAuthError(_0x21a867),0x1;return console[_0x14f2d5(0x128)](a7_0x142def[_0x14f2d5(0x106)](_0x14f2d5(0x10b)+(_0x21a867 instanceof Error?_0x21a867['message']:String(_0x21a867)))),console['error']('API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.'),0x1;}}}function a7_0x3600(_0x495925,_0x594b7f){_0x495925=_0x495925-0x103;const _0x26bd08=a7_0x26bd();let _0x3600bc=_0x26bd08[_0x495925];return _0x3600bc;}export class AuthStatusCommand extends BaseCommand{[a7_0x4774dc(0x14a)]=a7_0x4774dc(0x116);[a7_0x4774dc(0x11c)]='Show\x20authentication\x20status\x20and\x20validate\x20API\x20key';async[a7_0x4774dc(0x11b)](_0x254534){const _0x34bc4b=a7_0x4774dc,{options:_0x82e6b9,tdx:_0x813dd4}=_0x254534,_0x3d6231=_0x82e6b9[_0x34bc4b(0x105)],_0x2b9208=_0x82e6b9[_0x34bc4b(0x126)],_0x35307d=_0x2b9208?_0x2b9208:_0x34bc4b(0x132);console['log'](_0x34bc4b(0x108)+_0x35307d+_0x34bc4b(0x146)+_0x3d6231+')');const _0x23b696=await resolveAPIKeyAsync(_0x3d6231,_0x2b9208);if(_0x23b696){const {source:_0x32ac21,isDeprecated:_0xa01044}=_0x23b696,_0xbd1779=_0x34bc4b(0x144)+_0x32ac21;console[_0x34bc4b(0x11a)](_0xa01044?a7_0x142def[_0x34bc4b(0x10c)](_0xbd1779):_0xbd1779);}else console[_0x34bc4b(0x11a)](a7_0x142def[_0x34bc4b(0x10c)]('No\x20credential\x20found'));try{const _0x22aa77=await _0x813dd4[_0x34bc4b(0x104)]['getUserInfo']();return console[_0x34bc4b(0x11a)](a7_0x142def[_0x34bc4b(0x12a)](_0x34bc4b(0x145))),console[_0x34bc4b(0x11a)](_0x34bc4b(0x122)+_0x22aa77[_0x34bc4b(0x14c)]),(_0x22aa77[_0x34bc4b(0x14b)]||_0x22aa77[_0x34bc4b(0x123)])&&console[_0x34bc4b(0x11a)](_0x34bc4b(0x12b)+[_0x22aa77[_0x34bc4b(0x14b)],_0x22aa77[_0x34bc4b(0x123)]][_0x34bc4b(0x150)](Boolean)[_0x34bc4b(0x13e)]('\x20')),0x0;}catch(_0x29edb9){return _0x29edb9 instanceof HTTPClientError&&_0x29edb9[_0x34bc4b(0x13d)]===0x191?printAuthError(_0x29edb9,!![],_0x2b9208):console[_0x34bc4b(0x128)](a7_0x142def[_0x34bc4b(0x106)](_0x34bc4b(0x10b)+(_0x29edb9 instanceof Error?_0x29edb9[_0x34bc4b(0x135)]:String(_0x29edb9)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x4774dc(0x14a)]=a7_0x4774dc(0x141);[a7_0x4774dc(0x11c)]=a7_0x4774dc(0x14e);async['execute'](_0xe31262){const _0x3bf156=a7_0x4774dc,{options:_0x1afd48}=_0xe31262,_0x3495ac=_0x1afd48[_0x3bf156(0x126)];console['log'](a7_0x142def[_0x3bf156(0x117)](_0x3bf156(0x129)));const _0x116717=await isKeychainAvailable();if(!_0x116717)return console[_0x3bf156(0x128)](a7_0x142def[_0x3bf156(0x106)](_0x3bf156(0x12c))),0x1;const _0xa0866f=await deleteKeychainAPIKey(_0x3495ac);return _0xa0866f?(clearCredentialCache(),console[_0x3bf156(0x11a)]('✓\x20API\x20key\x20removed\x20from\x20keychain'+(_0x3495ac?_0x3bf156(0x11f)+_0x3495ac+')':'')),0x0):(console[_0x3bf156(0x11a)](_0x3bf156(0x11d)+(_0x3495ac?_0x3bf156(0x140)+_0x3495ac:'')),0x1);}}
@@ -1 +1 @@
1
- const a8_0x54ca86=a8_0x4a0d;function a8_0x4a0d(_0x8bd2a8,_0x31a8f2){_0x8bd2a8=_0x8bd2a8-0x1b3;const _0x275bda=a8_0x275b();let _0x4a0d2a=_0x275bda[_0x8bd2a8];return _0x4a0d2a;}(function(_0x1c812e,_0x4cb4fc){const _0x22953e=a8_0x4a0d,_0x10610f=_0x1c812e();while(!![]){try{const _0x32cae7=-parseInt(_0x22953e(0x1f3))/0x1+parseInt(_0x22953e(0x1b9))/0x2*(parseInt(_0x22953e(0x1c2))/0x3)+parseInt(_0x22953e(0x1d3))/0x4*(parseInt(_0x22953e(0x1f9))/0x5)+-parseInt(_0x22953e(0x1ce))/0x6+-parseInt(_0x22953e(0x1f0))/0x7+-parseInt(_0x22953e(0x1d2))/0x8+parseInt(_0x22953e(0x1e7))/0x9;if(_0x32cae7===_0x4cb4fc)break;else _0x10610f['push'](_0x10610f['shift']());}catch(_0x4a8ae0){_0x10610f['push'](_0x10610f['shift']());}}}(a8_0x275b,0xe2155));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';import{getLLMConversationUrl}from'../sdk/client/endpoints.js';function handleSDKError(_0x5f2ab7,_0x54e053){const _0x19662e=a8_0x4a0d;if(_0x5f2ab7 instanceof SDKError)console[_0x19662e(0x1b6)](_0x19662e(0x1ee)+_0x5f2ab7[_0x19662e(0x1cd)]),_0x54e053[_0x19662e(0x1b5)]&&(_0x5f2ab7[_0x19662e(0x1f4)]&&console['error']('\x20\x20Cause:\x20'+_0x5f2ab7['cause']),_0x5f2ab7['stack']&&(console[_0x19662e(0x1b6)](_0x19662e(0x1dd)),console['error'](_0x5f2ab7[_0x19662e(0x1e9)])));else throw _0x5f2ab7;}function a8_0x275b(){const _0x2e197b=['chat','new','llmProject','startChat','slice','validate','tool','22975425deABmf','context','stack','targetAgent','chatId','stdout','agentId','Error:\x20','includes','8345029IUXHno','CHAT_NOT_FOUND','execute','1138157QqUnvr','cause','functionName','resolveProjectId','type','Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together','92060IZbrAK','404','resolveAgentId','tool_result','args','chat-create','agent','verbose','error','description','targetFunction','2NSCWFM','Error:\x20Chat\x20session\x20\x27','tool_call','\x27\x20not\x20found','Getting\x20default\x20agent...','string','projectId','name','Chat\x20session:\x20','2036523qVesDz','streamChatJsonl','getOrCreateDefaultAgent','\x27...','stringify','content','Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22','Using\x20agent\x20from\x20','Create\x20a\x20new\x20chat\x20session','targetKnowledgeBase','--agent\x20flag','message','3352518sOZkFq','metadata','session\x20context','Continuing\x20chat:\x20','8883808kLYoIm','368ZmSnPW','join','event','site','write','llmAgent','log','llm','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','data','\x0aStack\x20trace:','handleChatEvent','done'];a8_0x275b=function(){return _0x2e197b;};return a8_0x275b();}async function resolveAgentId(_0x3da453,_0x53c524,_0x401e1c,_0x48919c,_0x368e9e){const _0xf67c58=a8_0x4a0d,_0x17f816=_0x53c524||_0x401e1c;if(_0x17f816){const {projectName:_0x53a5ea,agentName:_0x5437e4}=parseAgentRef(_0x17f816),_0x2df1ce=_0x5437e4||_0x17f816,_0x365321=_0x5437e4?_0x53a5ea:_0x48919c;if(!_0x365321)throw new Error('No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22');if(_0x368e9e){const _0x5897f9=_0x53c524?_0xf67c58(0x1cc):_0xf67c58(0x1d0);console[_0xf67c58(0x1b6)](_0xf67c58(0x1c9)+_0x5897f9+':\x20'+_0x365321+'/'+_0x2df1ce);}const _0x17fdbd=await withSpinner('Resolving\x20project\x20\x27'+_0x365321+_0xf67c58(0x1c5),()=>_0x3da453[_0xf67c58(0x1da)][_0xf67c58(0x1f6)](_0x365321),{'verbose':_0x368e9e}),_0x21d201=await withSpinner('Resolving\x20agent\x20\x27'+_0x2df1ce+_0xf67c58(0x1c5),()=>_0x3da453[_0xf67c58(0x1da)][_0xf67c58(0x1fb)](_0x2df1ce,_0x17fdbd['data']),{'verbose':_0x368e9e});return _0x21d201['data'];}else{const _0x2a424f=_0x3da453['llm']['getDefaultAgent']();if(_0x2a424f)return _0x368e9e&&console[_0xf67c58(0x1b6)]('Using\x20cached\x20default\x20agent:\x20'+_0x2a424f[_0xf67c58(0x1c0)]),_0x2a424f['id'];const _0x4b903f=await withSpinner(_0xf67c58(0x1bd),()=>_0x3da453[_0xf67c58(0x1da)][_0xf67c58(0x1c4)]('claude-4.5-haiku',0x0),{'verbose':_0x368e9e});return _0x4b903f[_0xf67c58(0x1dc)]['id'];}}export class ChatCommand extends BaseCommand{[a8_0x54ca86(0x1c0)]=a8_0x54ca86(0x1e0);['description']='Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)';[a8_0x54ca86(0x1e5)](_0x5281f7){const _0xa710b1=a8_0x54ca86,_0x3bc4ac=_0x5281f7[_0xa710b1(0x1fd)][_0xa710b1(0x1d4)]('\x20');if(!_0x3bc4ac)return _0xa710b1(0x1db);return undefined;}async['streamChat'](_0x4a9b85,_0x40ca81,_0x4fe15e,_0x33ceed,_0x593ad8){const _0x129f58=a8_0x54ca86;for await(const _0x424b1f of _0x4a9b85[_0x129f58(0x1da)][_0x129f58(0x1e0)](_0x40ca81,{'agentId':_0x4fe15e,'chatId':_0x33ceed})){if(_0x424b1f[_0x129f58(0x1f7)]==='metadata'){const _0x225c58=_0x424b1f['data']['chatId'];saveLastChatId(_0x225c58),_0x593ad8&&console[_0x129f58(0x1b6)](_0x129f58(0x1c1)+_0x225c58);}else _0x424b1f['type']==='event'&&this['handleChatEvent'](_0x424b1f[_0x129f58(0x1dc)]);}}async[a8_0x54ca86(0x1c3)](_0x49d50f,_0x27f672,_0x22f677,_0x3fd7f4){const _0x445df0=a8_0x54ca86,_0x457b11=_0x49d50f[_0x445df0(0x1e8)][_0x445df0(0x1d6)];let _0x54efc6=![];for await(const _0x42a6f1 of _0x49d50f[_0x445df0(0x1da)]['chat'](_0x27f672,{'agentId':_0x22f677,'chatId':_0x3fd7f4})){if(_0x42a6f1[_0x445df0(0x1f7)]===_0x445df0(0x1cf)){const _0x22355b=_0x42a6f1[_0x445df0(0x1dc)];saveLastChatId(_0x22355b[_0x445df0(0x1eb)]);const _0x37bd4d=_0x22355b[_0x445df0(0x1bf)]&&_0x22355b[_0x445df0(0x1ed)]?getLLMConversationUrl(_0x457b11,_0x22355b[_0x445df0(0x1bf)],_0x22355b[_0x445df0(0x1ed)],_0x22355b[_0x445df0(0x1eb)]):undefined;console[_0x445df0(0x1d9)](JSON[_0x445df0(0x1c6)]({'type':_0x445df0(0x1cf),'data':{'chatId':_0x22355b[_0x445df0(0x1eb)],'agentId':_0x22355b[_0x445df0(0x1ed)],'consoleUrl':_0x37bd4d}})),_0x54efc6=!![];}else{if(_0x42a6f1[_0x445df0(0x1f7)]===_0x445df0(0x1d5)){!_0x54efc6&&_0x3fd7f4&&(console[_0x445df0(0x1d9)](JSON[_0x445df0(0x1c6)]({'type':_0x445df0(0x1cf),'data':{'chatId':_0x3fd7f4}})),_0x54efc6=!![]);const _0x468619=_0x42a6f1[_0x445df0(0x1dc)];if(_0x445df0(0x1c7)in _0x468619)console[_0x445df0(0x1d9)](JSON[_0x445df0(0x1c6)]({'type':_0x445df0(0x1c7),'data':{'content':_0x468619['content']}}));else{if(_0x445df0(0x1bb)in _0x468619){const _0x2bdbeb=_0x468619[_0x445df0(0x1bb)];console[_0x445df0(0x1d9)](JSON[_0x445df0(0x1c6)]({'type':'tool_call','data':{'id':_0x2bdbeb['id'],'name':_0x2bdbeb['functionName'],'target':_0x2bdbeb[_0x445df0(0x1cb)]?.[_0x445df0(0x1c0)]||_0x2bdbeb[_0x445df0(0x1ea)]?.[_0x445df0(0x1c0)]||_0x2bdbeb['targetWebSearchTool']?.['name']||_0x2bdbeb[_0x445df0(0x1b8)]}}));}else{if(_0x445df0(0x1e6)in _0x468619)console[_0x445df0(0x1d9)](JSON[_0x445df0(0x1c6)]({'type':_0x445df0(0x1fc),'data':{'id':_0x468619[_0x445df0(0x1e6)]['id'],'name':_0x468619[_0x445df0(0x1e6)][_0x445df0(0x1f5)],'result':typeof _0x468619['tool'][_0x445df0(0x1c7)]===_0x445df0(0x1be)?_0x468619[_0x445df0(0x1e6)][_0x445df0(0x1c7)][_0x445df0(0x1e4)](0x0,0x1f4):''}}));else _0x445df0(0x1b6)in _0x468619&&console[_0x445df0(0x1d9)](JSON[_0x445df0(0x1c6)]({'type':_0x445df0(0x1b6),'data':{'error':_0x468619['error']}}));}}}}}console[_0x445df0(0x1d9)](JSON[_0x445df0(0x1c6)]({'type':_0x445df0(0x1df)}));}async[a8_0x54ca86(0x1f2)](_0x10b8b9){const _0x18fc80=a8_0x54ca86,{options:_0x2751bf,args:_0x4242dd,tdx:_0x68d200}=_0x10b8b9,_0x59dab2=_0x4242dd['join']('\x20'),_0x4e26cf=_0x2751bf,_0x4177c=_0x4e26cf[_0x18fc80(0x1b4)],_0x18575c=_0x4e26cf[_0x18fc80(0x1d8)],_0x1501ce=_0x4e26cf[_0x18fc80(0x1e2)],_0x2a0fd3=_0x4e26cf[_0x18fc80(0x1e1)],_0x15d32b=_0x4e26cf[_0x18fc80(0x1eb)],_0x308a52=_0x4e26cf['stream'];if(_0x2a0fd3&&_0x15d32b)return console['error'](_0x18fc80(0x1f8)),0x1;try{let _0x1ed005,_0x153e9a;if(_0x15d32b)_0x153e9a=_0x15d32b;else!_0x2a0fd3&&(_0x153e9a=loadLastChatId(),_0x153e9a&&_0x2751bf[_0x18fc80(0x1b5)]&&console[_0x18fc80(0x1b6)](_0x18fc80(0x1d1)+_0x153e9a));!_0x15d32b&&(_0x2a0fd3||!_0x153e9a)&&(_0x1ed005=await resolveAgentId(_0x68d200,_0x4177c,_0x18575c,_0x1501ce,_0x2751bf[_0x18fc80(0x1b5)]));const _0x584c99=_0x308a52?(_0x53b6b6,_0xdcb0fa,_0x3064b6)=>this[_0x18fc80(0x1c3)](_0x68d200,_0x53b6b6,_0xdcb0fa,_0x3064b6):(_0x8bbf15,_0x23d80e,_0x23c215)=>this['streamChat'](_0x68d200,_0x8bbf15,_0x23d80e,_0x23c215,_0x2751bf['verbose']);try{await _0x584c99(_0x59dab2,_0x1ed005,_0x153e9a);}catch(_0x5f288d){const _0x2531e8=_0x5f288d instanceof SDKError&&_0x5f288d['code']===ErrorCode[_0x18fc80(0x1f1)]||_0x5f288d instanceof Error&&_0x5f288d['message'][_0x18fc80(0x1ef)](_0x18fc80(0x1fa));if(_0x2531e8&&_0x15d32b)return console[_0x18fc80(0x1b6)](_0x18fc80(0x1ba)+_0x15d32b+_0x18fc80(0x1bc)),0x1;if(_0x2531e8)_0x2751bf[_0x18fc80(0x1b5)]&&console['error']('Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...'),!_0x1ed005&&(_0x1ed005=await resolveAgentId(_0x68d200,_0x4177c,_0x18575c,_0x1501ce,_0x2751bf[_0x18fc80(0x1b5)])),await _0x584c99(_0x59dab2,_0x1ed005,undefined);else throw _0x5f288d;}return!_0x308a52&&console[_0x18fc80(0x1d9)](),0x0;}catch(_0x175a1f){return console['error'](),handleSDKError(_0x175a1f,_0x2751bf),0x1;}}[a8_0x54ca86(0x1de)](_0x15c24a){const _0x39ea1c=a8_0x54ca86;if('content'in _0x15c24a)process[_0x39ea1c(0x1ec)][_0x39ea1c(0x1d7)](_0x15c24a['content']);else _0x39ea1c(0x1b6)in _0x15c24a&&console[_0x39ea1c(0x1b6)]('\x0aError:\x20'+_0x15c24a['error']);}}export class ChatCreateCommand extends BaseCommand{[a8_0x54ca86(0x1c0)]=a8_0x54ca86(0x1b3);[a8_0x54ca86(0x1b7)]=a8_0x54ca86(0x1ca);[a8_0x54ca86(0x1e5)](_0x10f5b5){const _0x5849ee=a8_0x54ca86,_0x47ebd1=_0x10f5b5['options'],_0x17f807=_0x47ebd1[_0x5849ee(0x1b4)],_0x117bf6=_0x47ebd1['llmAgent'];if(!_0x17f807&&!_0x117bf6)return _0x5849ee(0x1c8);return undefined;}async[a8_0x54ca86(0x1f2)](_0x19cdcd){const _0x41757f=a8_0x54ca86,{options:_0x1bd76b,tdx:_0x1f4a43}=_0x19cdcd,_0x2740e2=_0x1bd76b,_0x427cb0=_0x2740e2['agent'],_0x1e27d3=_0x2740e2[_0x41757f(0x1d8)],_0x15fb08=_0x2740e2[_0x41757f(0x1e2)];try{const _0x38c206=await resolveAgentId(_0x1f4a43,_0x427cb0,_0x1e27d3,_0x15fb08,_0x1bd76b[_0x41757f(0x1b5)]),_0x1bcb07=await _0x1f4a43[_0x41757f(0x1da)][_0x41757f(0x1e3)](_0x38c206);return saveLastChatId(_0x1bcb07['id']),console[_0x41757f(0x1d9)](JSON[_0x41757f(0x1c6)]({'chatId':_0x1bcb07['id'],'agentId':_0x38c206})),0x0;}catch(_0x23bfe2){return handleSDKError(_0x23bfe2,_0x1bd76b),0x1;}}}
1
+ const a8_0x2480b6=a8_0x28d1;(function(_0x5b3179,_0x1faedb){const _0x474997=a8_0x28d1,_0x36ed19=_0x5b3179();while(!![]){try{const _0x269768=parseInt(_0x474997(0x8e))/0x1*(-parseInt(_0x474997(0x89))/0x2)+-parseInt(_0x474997(0xd2))/0x3*(-parseInt(_0x474997(0xbd))/0x4)+parseInt(_0x474997(0xac))/0x5*(-parseInt(_0x474997(0xc9))/0x6)+-parseInt(_0x474997(0xb9))/0x7*(-parseInt(_0x474997(0x8d))/0x8)+parseInt(_0x474997(0x9e))/0x9*(-parseInt(_0x474997(0xcc))/0xa)+-parseInt(_0x474997(0x97))/0xb+parseInt(_0x474997(0xc7))/0xc*(parseInt(_0x474997(0x8b))/0xd);if(_0x269768===_0x1faedb)break;else _0x36ed19['push'](_0x36ed19['shift']());}catch(_0x75429c){_0x36ed19['push'](_0x36ed19['shift']());}}}(a8_0x39ac,0xaa6e2));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{withSpinner}from'../utils/spinner.js';import{parseAgentRef}from'../sdk/agent/agent-ref-parser.js';import{saveLastChatId,loadLastChatId}from'../sdk/llm/chat-cache.js';function a8_0x28d1(_0x19a3fb,_0x52d414){_0x19a3fb=_0x19a3fb-0x88;const _0x39ac57=a8_0x39ac();let _0x28d19c=_0x39ac57[_0x19a3fb];return _0x28d19c;}function a8_0x39ac(){const _0x43f585=['Getting\x20default\x20agent...','stdout','args','6952778fLcCbs','CHAT_NOT_FOUND','session\x20context','streamChat','1787060zljbkj','tool_call','new','Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together','claude-4.5-haiku','getDefaultAgent','tool','verbose','metadata','error','12qLBIOi','stream','10074uOjYcu','\x27...','llmProject','1060tPXBgF','message','Chat\x20session:\x20','llm','streamChatJsonl','resolveProjectId','9vhFoMe','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','chat-create','targetKnowledgeBase','chatId','\x20\x20Cause:\x20','type','Error:\x20','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','10838iGDiNx','code','3603041CifyIA','done','8KuOwpM','14vGvqSD','agentId','join','stringify','log','agent','projectId','Using\x20agent\x20from\x20','string','2243417BRGUjS','\x0aStack\x20trace:','write','slice','Continuing\x20chat:\x20','Create\x20a\x20new\x20chat\x20session','context','77193ArzTHN','handleChatEvent','name','chat','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','cause','--agent\x20flag','stack','\x27\x20not\x20found','functionName','validate','options','llmAgent','Resolving\x20agent\x20\x27','2155ybMwQb','event','No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22','site','description','targetWebSearchTool','execute','data','Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22','content'];a8_0x39ac=function(){return _0x43f585;};return a8_0x39ac();}import{getLLMConversationUrl}from'../sdk/client/endpoints.js';function handleSDKError(_0x54a71f,_0x243ac8){const _0x265837=a8_0x28d1;if(_0x54a71f instanceof SDKError)console[_0x265837(0xc6)](_0x265837(0xd9)+_0x54a71f[_0x265837(0xcd)]),_0x243ac8['verbose']&&(_0x54a71f[_0x265837(0xa3)]&&console[_0x265837(0xc6)](_0x265837(0xd7)+_0x54a71f['cause']),_0x54a71f['stack']&&(console[_0x265837(0xc6)](_0x265837(0x98)),console[_0x265837(0xc6)](_0x54a71f[_0x265837(0xa5)])));else throw _0x54a71f;}async function resolveAgentId(_0x3e76d3,_0x19ba9a,_0x2286af,_0xcfd159,_0xbcb74f){const _0x3f7c2f=a8_0x28d1,_0x2d857c=_0x19ba9a||_0x2286af;if(_0x2d857c){const {projectName:_0x1617ce,agentName:_0xf88aa8}=parseAgentRef(_0x2d857c),_0x207c06=_0xf88aa8||_0x2d857c,_0x5778ce=_0xf88aa8?_0x1617ce:_0xcfd159;if(!_0x5778ce)throw new Error(_0x3f7c2f(0xae));if(_0xbcb74f){const _0x383179=_0x19ba9a?_0x3f7c2f(0xa4):_0x3f7c2f(0xbb);console[_0x3f7c2f(0xc6)](_0x3f7c2f(0x95)+_0x383179+':\x20'+_0x5778ce+'/'+_0x207c06);}const _0x1c885d=await withSpinner('Resolving\x20project\x20\x27'+_0x5778ce+_0x3f7c2f(0xca),()=>_0x3e76d3[_0x3f7c2f(0xcf)][_0x3f7c2f(0xd1)](_0x5778ce),{'verbose':_0xbcb74f}),_0x555c6b=await withSpinner(_0x3f7c2f(0xab)+_0x207c06+_0x3f7c2f(0xca),()=>_0x3e76d3[_0x3f7c2f(0xcf)]['resolveAgentId'](_0x207c06,_0x1c885d[_0x3f7c2f(0xb3)]),{'verbose':_0xbcb74f});return _0x555c6b['data'];}else{const _0xfcc097=_0x3e76d3[_0x3f7c2f(0xcf)][_0x3f7c2f(0xc2)]();if(_0xfcc097)return _0xbcb74f&&console[_0x3f7c2f(0xc6)]('Using\x20cached\x20default\x20agent:\x20'+_0xfcc097[_0x3f7c2f(0xa0)]),_0xfcc097['id'];const _0x17ede1=await withSpinner(_0x3f7c2f(0xb6),()=>_0x3e76d3['llm']['getOrCreateDefaultAgent'](_0x3f7c2f(0xc1),0x0),{'verbose':_0xbcb74f});return _0x17ede1[_0x3f7c2f(0xb3)]['id'];}}export class ChatCommand extends BaseCommand{['name']=a8_0x2480b6(0xa1);['description']=a8_0x2480b6(0xa2);[a8_0x2480b6(0xa8)](_0x55ced8){const _0x52d8a9=a8_0x2480b6,_0x4cb96a=_0x55ced8[_0x52d8a9(0xb8)][_0x52d8a9(0x90)]('\x20');if(!_0x4cb96a)return _0x52d8a9(0x88);return undefined;}async[a8_0x2480b6(0xbc)](_0x73851f,_0x51135f,_0xc79d56,_0x545a28,_0x4302b7){const _0x2c3f7c=a8_0x2480b6;for await(const _0x30794c of _0x73851f['llm'][_0x2c3f7c(0xa1)](_0x51135f,{'agentId':_0xc79d56,'chatId':_0x545a28})){if(_0x30794c[_0x2c3f7c(0xd8)]===_0x2c3f7c(0xc5)){const _0x274dc4=_0x30794c['data'][_0x2c3f7c(0xd6)];saveLastChatId(_0x274dc4),_0x4302b7&&console[_0x2c3f7c(0xc6)](_0x2c3f7c(0xce)+_0x274dc4);}else _0x30794c['type']===_0x2c3f7c(0xad)&&this[_0x2c3f7c(0x9f)](_0x30794c[_0x2c3f7c(0xb3)]);}}async[a8_0x2480b6(0xd0)](_0x3cbf03,_0x5e7228,_0x501abb,_0x59ee42){const _0x19da73=a8_0x2480b6,_0xdb6ae5=_0x3cbf03[_0x19da73(0x9d)][_0x19da73(0xaf)];let _0x34899f=![];for await(const _0x3fb4d4 of _0x3cbf03['llm'][_0x19da73(0xa1)](_0x5e7228,{'agentId':_0x501abb,'chatId':_0x59ee42})){if(_0x3fb4d4[_0x19da73(0xd8)]===_0x19da73(0xc5)){const _0x1ee61b=_0x3fb4d4[_0x19da73(0xb3)];saveLastChatId(_0x1ee61b[_0x19da73(0xd6)]);const _0x579889=_0x1ee61b[_0x19da73(0x94)]&&_0x1ee61b[_0x19da73(0x8f)]?getLLMConversationUrl(_0xdb6ae5,_0x1ee61b[_0x19da73(0x94)],_0x1ee61b[_0x19da73(0x8f)],_0x1ee61b[_0x19da73(0xd6)]):undefined;console[_0x19da73(0x92)](JSON[_0x19da73(0x91)]({'type':'metadata','data':{'chatId':_0x1ee61b[_0x19da73(0xd6)],'agentId':_0x1ee61b[_0x19da73(0x8f)],'consoleUrl':_0x579889}})),_0x34899f=!![];}else{if(_0x3fb4d4[_0x19da73(0xd8)]===_0x19da73(0xad)){!_0x34899f&&_0x59ee42&&(console[_0x19da73(0x92)](JSON[_0x19da73(0x91)]({'type':_0x19da73(0xc5),'data':{'chatId':_0x59ee42}})),_0x34899f=!![]);const _0x44647c=_0x3fb4d4['data'];if(_0x19da73(0xb5)in _0x44647c)console[_0x19da73(0x92)](JSON[_0x19da73(0x91)]({'type':_0x19da73(0xb5),'data':{'content':_0x44647c[_0x19da73(0xb5)]}}));else{if(_0x19da73(0xbe)in _0x44647c){const _0x39d875=_0x44647c['tool_call'];console[_0x19da73(0x92)](JSON[_0x19da73(0x91)]({'type':_0x19da73(0xbe),'data':{'id':_0x39d875['id'],'name':_0x39d875[_0x19da73(0xa7)],'target':_0x39d875[_0x19da73(0xd5)]?.[_0x19da73(0xa0)]||_0x39d875['targetAgent']?.['name']||_0x39d875[_0x19da73(0xb1)]?.[_0x19da73(0xa0)]||_0x39d875['targetFunction']}}));}else{if('tool'in _0x44647c)console[_0x19da73(0x92)](JSON[_0x19da73(0x91)]({'type':'tool_result','data':{'id':_0x44647c['tool']['id'],'name':_0x44647c[_0x19da73(0xc3)]['functionName'],'result':typeof _0x44647c[_0x19da73(0xc3)][_0x19da73(0xb5)]===_0x19da73(0x96)?_0x44647c[_0x19da73(0xc3)][_0x19da73(0xb5)][_0x19da73(0x9a)](0x0,0x1f4):''}}));else _0x19da73(0xc6)in _0x44647c&&console[_0x19da73(0x92)](JSON[_0x19da73(0x91)]({'type':'error','data':{'error':_0x44647c[_0x19da73(0xc6)]}}));}}}}}console[_0x19da73(0x92)](JSON[_0x19da73(0x91)]({'type':_0x19da73(0x8c)}));}async[a8_0x2480b6(0xb2)](_0x15c459){const _0x3c78c0=a8_0x2480b6,{options:_0x40c35d,args:_0xdcc066,tdx:_0x16062a}=_0x15c459,_0x194398=_0xdcc066[_0x3c78c0(0x90)]('\x20'),_0x46537f=_0x40c35d,_0xe76245=_0x46537f[_0x3c78c0(0x93)],_0x4dfa4e=_0x46537f[_0x3c78c0(0xaa)],_0x335783=_0x46537f[_0x3c78c0(0xcb)],_0x533606=_0x46537f[_0x3c78c0(0xbf)],_0x281c9d=_0x46537f[_0x3c78c0(0xd6)],_0x5a7c50=_0x46537f[_0x3c78c0(0xc8)];if(_0x533606&&_0x281c9d)return console[_0x3c78c0(0xc6)](_0x3c78c0(0xc0)),0x1;try{let _0xc6079a,_0x3db940;if(_0x281c9d)_0x3db940=_0x281c9d;else!_0x533606&&(_0x3db940=loadLastChatId(),_0x3db940&&_0x40c35d[_0x3c78c0(0xc4)]&&console['error'](_0x3c78c0(0x9b)+_0x3db940));!_0x281c9d&&(_0x533606||!_0x3db940)&&(_0xc6079a=await resolveAgentId(_0x16062a,_0xe76245,_0x4dfa4e,_0x335783,_0x40c35d[_0x3c78c0(0xc4)]));const _0xb1312f=_0x5a7c50?(_0x574419,_0x4d9cb1,_0x3506ac)=>this[_0x3c78c0(0xd0)](_0x16062a,_0x574419,_0x4d9cb1,_0x3506ac):(_0x181a8a,_0x530be1,_0x5c4833)=>this[_0x3c78c0(0xbc)](_0x16062a,_0x181a8a,_0x530be1,_0x5c4833,_0x40c35d[_0x3c78c0(0xc4)]);try{await _0xb1312f(_0x194398,_0xc6079a,_0x3db940);}catch(_0x3e3836){const _0x2174d6=_0x3e3836 instanceof SDKError&&_0x3e3836[_0x3c78c0(0x8a)]===ErrorCode[_0x3c78c0(0xba)]||_0x3e3836 instanceof Error&&_0x3e3836['message']['includes']('404');if(_0x2174d6&&_0x281c9d)return console[_0x3c78c0(0xc6)]('Error:\x20Chat\x20session\x20\x27'+_0x281c9d+_0x3c78c0(0xa6)),0x1;if(_0x2174d6)_0x40c35d[_0x3c78c0(0xc4)]&&console[_0x3c78c0(0xc6)](_0x3c78c0(0xd3)),!_0xc6079a&&(_0xc6079a=await resolveAgentId(_0x16062a,_0xe76245,_0x4dfa4e,_0x335783,_0x40c35d[_0x3c78c0(0xc4)])),await _0xb1312f(_0x194398,_0xc6079a,undefined);else throw _0x3e3836;}return!_0x5a7c50&&console['log'](),0x0;}catch(_0x5f37f4){return console['error'](),handleSDKError(_0x5f37f4,_0x40c35d),0x1;}}[a8_0x2480b6(0x9f)](_0x1b4bfd){const _0x38ddc7=a8_0x2480b6;if(_0x38ddc7(0xb5)in _0x1b4bfd)process[_0x38ddc7(0xb7)][_0x38ddc7(0x99)](_0x1b4bfd[_0x38ddc7(0xb5)]);else _0x38ddc7(0xc6)in _0x1b4bfd&&console[_0x38ddc7(0xc6)]('\x0aError:\x20'+_0x1b4bfd['error']);}}export class ChatCreateCommand extends BaseCommand{['name']=a8_0x2480b6(0xd4);[a8_0x2480b6(0xb0)]=a8_0x2480b6(0x9c);['validate'](_0x569d22){const _0x4dc48e=a8_0x2480b6,_0x178a04=_0x569d22[_0x4dc48e(0xa9)],_0x5a5c57=_0x178a04['agent'],_0x2437a4=_0x178a04[_0x4dc48e(0xaa)];if(!_0x5a5c57&&!_0x2437a4)return _0x4dc48e(0xb4);return undefined;}async['execute'](_0x43f989){const _0x5e0582=a8_0x2480b6,{options:_0x223dc9,tdx:_0x163259}=_0x43f989,_0x1acc94=_0x223dc9,_0x421c35=_0x1acc94['agent'],_0x5211d6=_0x1acc94[_0x5e0582(0xaa)],_0x9b4893=_0x1acc94[_0x5e0582(0xcb)];try{const _0x2f909e=await resolveAgentId(_0x163259,_0x421c35,_0x5211d6,_0x9b4893,_0x223dc9[_0x5e0582(0xc4)]),_0x2871d5=await _0x163259[_0x5e0582(0xcf)]['startChat'](_0x2f909e);return saveLastChatId(_0x2871d5['id']),console['log'](JSON['stringify']({'chatId':_0x2871d5['id'],'agentId':_0x2f909e})),0x0;}catch(_0x28141a){return handleSDKError(_0x28141a,_0x223dc9),0x1;}}}