@treasuredata/tdx 0.18.0 → 0.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (172) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/chat-command.js +1 -1
  11. package/dist/commands/claude-command.js +1 -1
  12. package/dist/commands/claude-statusline-command.js +1 -1
  13. package/dist/commands/claude-usage-command.js +1 -1
  14. package/dist/commands/command.js +1 -1
  15. package/dist/commands/connection-command.js +1 -1
  16. package/dist/commands/databases.js +1 -1
  17. package/dist/commands/describe.js +1 -1
  18. package/dist/commands/engage-command.js +1 -1
  19. package/dist/commands/job-command.js +1 -1
  20. package/dist/commands/journey-command.js +1 -1
  21. package/dist/commands/journey-validate-command.js +1 -1
  22. package/dist/commands/llm-command.js +1 -1
  23. package/dist/commands/llm-proxy.js +1 -1
  24. package/dist/commands/mcp-command.js +1 -1
  25. package/dist/commands/parent-segment-command.js +1 -1
  26. package/dist/commands/profile-command.js +1 -1
  27. package/dist/commands/profiles-command.js +1 -1
  28. package/dist/commands/query-command.js +1 -1
  29. package/dist/commands/schedule-command.js +1 -1
  30. package/dist/commands/segment-command.js +1 -1
  31. package/dist/commands/segment-create-command.js +1 -1
  32. package/dist/commands/segment-fields-command.js +1 -1
  33. package/dist/commands/segment-pull-command.js +1 -1
  34. package/dist/commands/segment-push-command.js +1 -1
  35. package/dist/commands/segment-update-command.js +1 -1
  36. package/dist/commands/segment-use-command.js +1 -1
  37. package/dist/commands/segment-validate-command.js +1 -1
  38. package/dist/commands/segments.js +1 -1
  39. package/dist/commands/show.js +1 -1
  40. package/dist/commands/status-command.js +1 -1
  41. package/dist/commands/tables.js +1 -1
  42. package/dist/commands/unset-command.js +1 -1
  43. package/dist/commands/use-command.js +1 -1
  44. package/dist/commands/user-command.js +1 -1
  45. package/dist/commands/workflow-command.js +1 -1
  46. package/dist/core/auth.js +1 -1
  47. package/dist/core/command-output.js +1 -1
  48. package/dist/core/config.js +1 -1
  49. package/dist/core/connection-cache.js +1 -1
  50. package/dist/core/constants.js +1 -1
  51. package/dist/core/credential-cache.js +1 -1
  52. package/dist/core/global-context.js +1 -1
  53. package/dist/core/keychain.js +1 -1
  54. package/dist/core/profile.js +1 -1
  55. package/dist/core/project-config.js +1 -1
  56. package/dist/core/session.js +1 -1
  57. package/dist/core/user-cache.js +1 -1
  58. package/dist/core/version.js +1 -1
  59. package/dist/index.js +1 -1
  60. package/dist/mcp/server.js +1 -1
  61. package/dist/mcp/tools/index.js +1 -1
  62. package/dist/mcp/tools/tdx-run.js +1 -1
  63. package/dist/mcp/tools/tdx-search.js +1 -1
  64. package/dist/mcp/utils.js +1 -1
  65. package/dist/proxy/anthropic-adapter.js +1 -1
  66. package/dist/proxy/claude-usage-tracker.d.ts.map +1 -1
  67. package/dist/proxy/claude-usage-tracker.js +1 -1
  68. package/dist/proxy/claude-usage-tracker.js.map +1 -1
  69. package/dist/proxy/context-signature.js +1 -1
  70. package/dist/proxy/conversation-utils.js +1 -1
  71. package/dist/proxy/passthrough-server.js +1 -1
  72. package/dist/proxy/server.js +1 -1
  73. package/dist/proxy/session-cache.js +1 -1
  74. package/dist/proxy/sse-usage-parser.js +1 -1
  75. package/dist/sdk/agent/agent-config.js +1 -1
  76. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  77. package/dist/sdk/agent/agent-yaml.js +1 -1
  78. package/dist/sdk/agent/test/evaluator.js +1 -1
  79. package/dist/sdk/agent/test/executor.js +1 -1
  80. package/dist/sdk/agent/test/index.js +1 -1
  81. package/dist/sdk/agent/test/output.js +1 -1
  82. package/dist/sdk/agent/test/parser.js +1 -1
  83. package/dist/sdk/api.js +1 -1
  84. package/dist/sdk/client/cdp-api-client.js +1 -1
  85. package/dist/sdk/client/endpoints.js +1 -1
  86. package/dist/sdk/client/engage-api-client.js +1 -1
  87. package/dist/sdk/client/http-client.js +1 -1
  88. package/dist/sdk/client/llm-api-client.js +1 -1
  89. package/dist/sdk/client/rate-limiter.js +1 -1
  90. package/dist/sdk/client/td-api-client.js +1 -1
  91. package/dist/sdk/client/trino-api-client.js +1 -1
  92. package/dist/sdk/client/workflow-client.js +1 -1
  93. package/dist/sdk/connection-validator.js +1 -1
  94. package/dist/sdk/connection.js +1 -1
  95. package/dist/sdk/engage.js +1 -1
  96. package/dist/sdk/errors.js +1 -1
  97. package/dist/sdk/index.js +1 -1
  98. package/dist/sdk/io/index.js +1 -1
  99. package/dist/sdk/io/node-filesystem.js +1 -1
  100. package/dist/sdk/job.js +1 -1
  101. package/dist/sdk/journey.js +1 -1
  102. package/dist/sdk/llm/chat-cache.js +1 -1
  103. package/dist/sdk/llm/index.js +1 -1
  104. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  105. package/dist/sdk/llm/model-aliases.js +1 -1
  106. package/dist/sdk/llm/model-factors.js +1 -1
  107. package/dist/sdk/query/index.js +1 -1
  108. package/dist/sdk/query/sql-parser.js +1 -1
  109. package/dist/sdk/schedule.js +1 -1
  110. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  111. package/dist/sdk/segment/fields-display.js +1 -1
  112. package/dist/sdk/segment/file-discovery.js +1 -1
  113. package/dist/sdk/segment/journey-utils.js +1 -1
  114. package/dist/sdk/segment/journey-yaml.js +1 -1
  115. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  116. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  117. package/dist/sdk/segment/pull-workflow.js +1 -1
  118. package/dist/sdk/segment/push-workflow.js +1 -1
  119. package/dist/sdk/segment/resolution-context.js +1 -1
  120. package/dist/sdk/segment/segment-path-parser.js +1 -1
  121. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  122. package/dist/sdk/segment/target-resolution.js +1 -1
  123. package/dist/sdk/segment/tdx-config.js +1 -1
  124. package/dist/sdk/segment/validate-files.js +1 -1
  125. package/dist/sdk/segment/yaml-validator.js +1 -1
  126. package/dist/sdk/segment.js +1 -1
  127. package/dist/sdk/types/index.js +1 -1
  128. package/dist/sdk/types/progress.js +1 -1
  129. package/dist/sdk/user.js +1 -1
  130. package/dist/sdk/util/format-detector.js +1 -1
  131. package/dist/sdk/util/formatters.js +1 -1
  132. package/dist/sdk/util/index.js +1 -1
  133. package/dist/sdk/util/tree-formatter.js +1 -1
  134. package/dist/sdk/workflow/archive-validation.js +1 -1
  135. package/dist/sdk/workflow/clone-workflow.js +1 -1
  136. package/dist/sdk/workflow/index.js +1 -1
  137. package/dist/sdk/workflow/pull-workflow.js +1 -1
  138. package/dist/sdk/workflow/push-workflow.js +1 -1
  139. package/dist/sdk/workflow/tdx-config.js +1 -1
  140. package/dist/sdk/workflow/workflow-utils.js +1 -1
  141. package/dist/test-utils/command-runner.js +1 -1
  142. package/dist/test-utils/factories.js +1 -1
  143. package/dist/test-utils/fixtures.js +1 -1
  144. package/dist/test-utils/http-mock.js +1 -1
  145. package/dist/test-utils/index.js +1 -1
  146. package/dist/utils/async.js +1 -1
  147. package/dist/utils/colors.js +1 -1
  148. package/dist/utils/diff.js +1 -1
  149. package/dist/utils/file-permissions.js +1 -1
  150. package/dist/utils/global-cache.js +1 -1
  151. package/dist/utils/json-loader.js +1 -1
  152. package/dist/utils/local-cache.js +1 -1
  153. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  154. package/dist/utils/logger/formatters/index.js +1 -1
  155. package/dist/utils/logger/handlers/console-handler.js +1 -1
  156. package/dist/utils/logger/handlers/file-handler.js +1 -1
  157. package/dist/utils/logger/handlers/index.js +1 -1
  158. package/dist/utils/logger/handlers/null-handler.js +1 -1
  159. package/dist/utils/logger/index.js +1 -1
  160. package/dist/utils/logger/logger.js +1 -1
  161. package/dist/utils/logger/types.js +1 -1
  162. package/dist/utils/option-validation.js +1 -1
  163. package/dist/utils/port.js +1 -1
  164. package/dist/utils/process.js +1 -1
  165. package/dist/utils/prompt.js +1 -1
  166. package/dist/utils/spinner.js +1 -1
  167. package/dist/utils/sse-parser.js +1 -1
  168. package/dist/utils/string-utils.js +1 -1
  169. package/dist/utils/table-ref-parser.js +1 -1
  170. package/dist/utils/tdx-logger.js +1 -1
  171. package/dist/utils/version-check.js +1 -1
  172. package/package.json +1 -1
@@ -1 +1 @@
1
- const a3_0x154f11=a3_0x445c;function a3_0x2e15(){const _0x456c88=['segment','Resolving\x20parent\x20segment\x20\x27','1744771RjJGnu','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','189qMJFFv','Parent\x20name:\x20','Error:\x20','6UECSzP','message','Error:\x20Segment\x20name\x20is\x20required','Resolving\x20child\x20segment\x20\x27','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','33682VYpuyJ','Resolved\x20parent\x20ID:\x20','Resolved\x20child\x20ID:\x20','6071VaiUjd','execute','resolveSegmentId','cause','8TmaKlZ','Listing\x20activations\x20for\x20segment\x20\x27','2080HyNnFq','resolveParentId','12300WBIQyd','\x20\x20Cause:\x20','856BgkQPF','✔\x20Found\x20','4465EZJqmi','listActivations','1759122DGuKVR','description','verbose','Child\x20name:\x20','633445grFwVB','7692xdmTnH','name','\x27...','error','site','data','length'];a3_0x2e15=function(){return _0x456c88;};return a3_0x2e15();}(function(_0x23fcb4,_0x325f6a){const _0x171a2c=a3_0x445c,_0x37e473=_0x23fcb4();while(!![]){try{const _0xd40d9c=-parseInt(_0x171a2c(0x1a7))/0x1+-parseInt(_0x171a2c(0x19d))/0x2*(-parseInt(_0x171a2c(0x1b3))/0x3)+parseInt(_0x171a2c(0x19f))/0x4*(parseInt(_0x171a2c(0x1a1))/0x5)+-parseInt(_0x171a2c(0x18d))/0x6*(-parseInt(_0x171a2c(0x1b1))/0x7)+-parseInt(_0x171a2c(0x199))/0x8*(parseInt(_0x171a2c(0x1a3))/0x9)+-parseInt(_0x171a2c(0x19b))/0xa*(-parseInt(_0x171a2c(0x192))/0xb)+-parseInt(_0x171a2c(0x1a8))/0xc*(parseInt(_0x171a2c(0x195))/0xd);if(_0xd40d9c===_0x325f6a)break;else _0x37e473['push'](_0x37e473['shift']());}catch(_0x4a3e15){_0x37e473['push'](_0x37e473['shift']());}}}(a3_0x2e15,0x52243));import{BaseCommand}from'./command.js';function a3_0x445c(_0x2f9120,_0x33cf2c){_0x2f9120=_0x2f9120-0x18d;const _0x2e15e2=a3_0x2e15();let _0x445c80=_0x2e15e2[_0x2f9120];return _0x445c80;}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_0x154f11(0x1a9)]='activations';[a3_0x154f11(0x1a4)]='List\x20activations\x20for\x20a\x20segment';async[a3_0x154f11(0x196)](_0x4f525a){const _0x45e868=a3_0x154f11,{options:_0x20b0ba,args:_0x335de5,tdx:_0x386194}=_0x4f525a;if(_0x335de5[_0x45e868(0x1ae)]===0x0)return console[_0x45e868(0x1ab)](_0x45e868(0x18f)),console['error'](_0x45e868(0x1b2)),0x1;try{const {parentId:_0x9c787a,childId:_0x1d11de}=parseSegmentRef(_0x335de5[0x0]);if(!_0x1d11de)return console['error'](_0x45e868(0x191)),console[_0x45e868(0x1ab)](_0x45e868(0x1b2)),0x1;_0x20b0ba['verbose']&&(console[_0x45e868(0x1ab)]('Site:\x20'+_0x20b0ba[_0x45e868(0x1ac)]),console[_0x45e868(0x1ab)](_0x45e868(0x1b4)+_0x9c787a),console[_0x45e868(0x1ab)](_0x45e868(0x1a6)+_0x1d11de));const _0x2d923a=await withSpinner(_0x45e868(0x1b0)+_0x9c787a+_0x45e868(0x1aa),()=>_0x386194[_0x45e868(0x1af)][_0x45e868(0x19c)](_0x9c787a),{'verbose':_0x20b0ba['verbose']}),_0x893428=_0x2d923a['data'];_0x20b0ba[_0x45e868(0x1a5)]&&console[_0x45e868(0x1ab)](_0x45e868(0x193)+_0x893428);const _0x2ee196=await withSpinner(_0x45e868(0x190)+_0x1d11de+_0x45e868(0x1aa),()=>_0x386194['segment'][_0x45e868(0x197)](_0x893428,_0x1d11de),{'verbose':_0x20b0ba['verbose']}),_0x39e9fc=_0x2ee196[_0x45e868(0x1ad)];_0x20b0ba[_0x45e868(0x1a5)]&&console['error'](_0x45e868(0x194)+_0x39e9fc);const _0x48f14d=await withSpinner(_0x45e868(0x19a)+_0x1d11de+_0x45e868(0x1aa),()=>_0x386194['segment'][_0x45e868(0x1a2)](_0x893428,_0x39e9fc),{'verbose':_0x20b0ba[_0x45e868(0x1a5)]}),_0x44a199=_0x48f14d['data'];return console[_0x45e868(0x1ab)](_0x45e868(0x1a0)+_0x44a199['length']+'\x20activation'+(_0x44a199[_0x45e868(0x1ae)]!==0x1?'s':'')),await handleSDKOutput(_0x44a199,_0x20b0ba),0x0;}catch(_0x5016ac){if(_0x5016ac instanceof SDKError)return console[_0x45e868(0x1ab)](_0x45e868(0x1b5)+_0x5016ac[_0x45e868(0x18e)]),_0x5016ac[_0x45e868(0x198)]&&console[_0x45e868(0x1ab)](_0x45e868(0x19e)+_0x5016ac['cause']),0x1;throw _0x5016ac;}}}
1
+ const a3_0x2b14cf=a3_0x255d;(function(_0x5aa43f,_0x2aa3c6){const _0x39216b=a3_0x255d,_0x2109fd=_0x5aa43f();while(!![]){try{const _0x529091=parseInt(_0x39216b(0x1a4))/0x1*(-parseInt(_0x39216b(0x1b8))/0x2)+parseInt(_0x39216b(0x1b0))/0x3*(parseInt(_0x39216b(0x1bf))/0x4)+-parseInt(_0x39216b(0x1a0))/0x5*(-parseInt(_0x39216b(0x1be))/0x6)+parseInt(_0x39216b(0x19f))/0x7+-parseInt(_0x39216b(0x1bd))/0x8*(parseInt(_0x39216b(0x1b6))/0x9)+-parseInt(_0x39216b(0x1ae))/0xa*(parseInt(_0x39216b(0x1ba))/0xb)+-parseInt(_0x39216b(0x1af))/0xc*(-parseInt(_0x39216b(0x1bc))/0xd);if(_0x529091===_0x2aa3c6)break;else _0x2109fd['push'](_0x2109fd['shift']());}catch(_0x20e51e){_0x2109fd['push'](_0x2109fd['shift']());}}}(a3_0xbc99,0x62c03));function a3_0x255d(_0x4fc1fa,_0x8cea7){_0x4fc1fa=_0x4fc1fa-0x19c;const _0xbc9986=a3_0xbc99();let _0x255d51=_0xbc9986[_0x4fc1fa];return _0x255d51;}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_0x2b14cf(0x1a5)]=a3_0x2b14cf(0x1a8);[a3_0x2b14cf(0x1b2)]='List\x20activations\x20for\x20a\x20segment';async[a3_0x2b14cf(0x1a2)](_0x1fe272){const _0x39fd75=a3_0x2b14cf,{options:_0xe1c870,args:_0x4a390c,tdx:_0x40d0c0}=_0x1fe272;if(_0x4a390c['length']===0x0)return console[_0x39fd75(0x1a9)](_0x39fd75(0x19c)),console[_0x39fd75(0x1a9)](_0x39fd75(0x1b5)),0x1;try{const {parentId:_0x2e7f23,childId:_0x4b87cd}=parseSegmentRef(_0x4a390c[0x0]);if(!_0x4b87cd)return console[_0x39fd75(0x1a9)]('Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations'),console['error'](_0x39fd75(0x1b5)),0x1;_0xe1c870['verbose']&&(console[_0x39fd75(0x1a9)]('Site:\x20'+_0xe1c870['site']),console['error'](_0x39fd75(0x1a1)+_0x2e7f23),console[_0x39fd75(0x1a9)](_0x39fd75(0x1a7)+_0x4b87cd));const _0xf8f60d=await withSpinner(_0x39fd75(0x19e)+_0x2e7f23+_0x39fd75(0x1a6),()=>_0x40d0c0['segment'][_0x39fd75(0x1b4)](_0x2e7f23),{'verbose':_0xe1c870[_0x39fd75(0x19d)]}),_0x42177c=_0xf8f60d['data'];_0xe1c870[_0x39fd75(0x19d)]&&console[_0x39fd75(0x1a9)]('Resolved\x20parent\x20ID:\x20'+_0x42177c);const _0x38af91=await withSpinner(_0x39fd75(0x1c0)+_0x4b87cd+_0x39fd75(0x1a6),()=>_0x40d0c0[_0x39fd75(0x1bb)][_0x39fd75(0x1ac)](_0x42177c,_0x4b87cd),{'verbose':_0xe1c870['verbose']}),_0xe350cf=_0x38af91['data'];_0xe1c870['verbose']&&console[_0x39fd75(0x1a9)](_0x39fd75(0x1a3)+_0xe350cf);const _0x1e3b90=await withSpinner(_0x39fd75(0x1b1)+_0x4b87cd+'\x27...',()=>_0x40d0c0[_0x39fd75(0x1bb)]['listActivations'](_0x42177c,_0xe350cf),{'verbose':_0xe1c870[_0x39fd75(0x19d)]}),_0x1dad91=_0x1e3b90[_0x39fd75(0x1ad)];return console[_0x39fd75(0x1a9)](_0x39fd75(0x1ab)+_0x1dad91['length']+_0x39fd75(0x1b9)+(_0x1dad91['length']!==0x1?'s':'')),await handleSDKOutput(_0x1dad91,_0xe1c870),0x0;}catch(_0x1f0a00){if(_0x1f0a00 instanceof SDKError)return console[_0x39fd75(0x1a9)](_0x39fd75(0x1b3)+_0x1f0a00['message']),_0x1f0a00['cause']&&console[_0x39fd75(0x1a9)](_0x39fd75(0x1b7)+_0x1f0a00[_0x39fd75(0x1aa)]),0x1;throw _0x1f0a00;}}}function a3_0xbc99(){const _0x3decec=['20hlSaaw','Parent\x20name:\x20','execute','Resolved\x20child\x20ID:\x20','2XoCkOa','name','\x27...','Child\x20name:\x20','activations','error','cause','✔\x20Found\x20','resolveSegmentId','data','3981510IpqhbC','12xTJFjT','3BzZRMa','Listing\x20activations\x20for\x20segment\x20\x27','description','Error:\x20','resolveParentId','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','27OrLAKN','\x20\x20Cause:\x20','351018VTbPTR','\x20activation','22RcMmEP','segment','8804718cJHJHt','1333112QzVgxT','1202982OXQSvi','2092028wslZsd','Resolving\x20child\x20segment\x20\x27','Error:\x20Segment\x20name\x20is\x20required','verbose','Resolving\x20parent\x20segment\x20\x27','346073ueZEuE'];a3_0xbc99=function(){return _0x3decec;};return a3_0xbc99();}
@@ -1 +1 @@
1
- const a4_0x23ab02=a4_0x3745;(function(_0x2b648a,_0x1636cf){const _0x2045b3=a4_0x3745,_0x54a60f=_0x2b648a();while(!![]){try{const _0x367fa7=parseInt(_0x2045b3(0x9d))/0x1+parseInt(_0x2045b3(0xa0))/0x2+-parseInt(_0x2045b3(0xcf))/0x3*(-parseInt(_0x2045b3(0x9c))/0x4)+parseInt(_0x2045b3(0x11f))/0x5*(-parseInt(_0x2045b3(0xde))/0x6)+-parseInt(_0x2045b3(0x133))/0x7+-parseInt(_0x2045b3(0x117))/0x8+parseInt(_0x2045b3(0xb3))/0x9;if(_0x367fa7===_0x1636cf)break;else _0x54a60f['push'](_0x54a60f['shift']());}catch(_0x1adce2){_0x54a60f['push'](_0x54a60f['shift']());}}}(a4_0x7c47,0x92daf));function a4_0x3745(_0x3c2475,_0x34424c){_0x3c2475=_0x3c2475-0x9b;const _0x7c4779=a4_0x7c47();let _0x374591=_0x7c4779[_0x3c2475];return _0x374591;}import a4_0x7cfd41 from'chalk';import a4_0x3bf6a9 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(_0x11c5f6){const _0x168a8a=a4_0x3745,_0x310131=[];if(_0x11c5f6[_0x168a8a(0x112)]!==undefined)_0x310131[_0x168a8a(0xa1)](_0x11c5f6[_0x168a8a(0x112)]+'\x20total');if(_0x11c5f6['new']!==undefined&&_0x11c5f6[_0x168a8a(0x10f)]>0x0)_0x310131['push'](a4_0x7cfd41[_0x168a8a(0xbd)](_0x11c5f6[_0x168a8a(0x10f)]+'\x20new'));if(_0x11c5f6[_0x168a8a(0x10c)]!==undefined&&_0x11c5f6[_0x168a8a(0x10c)]>0x0)_0x310131['push'](a4_0x7cfd41[_0x168a8a(0xbd)](_0x11c5f6[_0x168a8a(0x10c)]+_0x168a8a(0xf7)));if(_0x11c5f6[_0x168a8a(0xe6)]!==undefined&&_0x11c5f6[_0x168a8a(0xe6)]>0x0)_0x310131[_0x168a8a(0xa1)](a4_0x7cfd41['yellow'](_0x11c5f6[_0x168a8a(0xe6)]+_0x168a8a(0xfc)));if(_0x11c5f6['unchanged']!==undefined&&_0x11c5f6[_0x168a8a(0xff)]>0x0)_0x310131[_0x168a8a(0xa1)](a4_0x7cfd41[_0x168a8a(0xb7)](_0x11c5f6[_0x168a8a(0xff)]+_0x168a8a(0x116)));if(_0x11c5f6['errors']!==undefined&&_0x11c5f6['errors']>0x0)_0x310131['push'](a4_0x7cfd41[_0x168a8a(0x107)](_0x11c5f6['errors']+_0x168a8a(0xc4)));return _0x310131[_0x168a8a(0xb1)](',\x20');}function a4_0x7c47(){const _0x270f94=['560268wonrGL','\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)','pushProject','856744XcKKOH','push','reason','<new-name>','Output:\x20','force','\x22\x20to\x20\x22','\x20\x20Integrations:\x20','description','source','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','outputPath','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','\x20\x20Text\x20Knowledge\x20Bases:\x20','Usage:\x20tdx\x20agent\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20project\x20(requires\x20context\x20or\x20tdx.json)','\x0aError:','New\x20project\x20name\x20is\x20required','join','dryRun','9025659JQwXcq','Cancelled','Summary:','Project\x20cloned\x20with\x20errors','gray','Analyzing\x20changes\x20to\x20push...','\x20\x20Knowledge\x20Base\x20\x22','agent:pull','projectName','agent:push','green','Errors:','Using\x20project:\x20','name','parse','\x20resources\x20to\x20\x27','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','\x20errors','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','Pulling\x20agent\x20\x22','newProjectName','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','dirname','New\x20project:\x20','prompts','counts','agentName','243qwmicr','\x0aChanges\x20to\x20agent\x20\x27','yes','integrations','New\x20project\x20ID:\x20','log','llm','Would\x20push\x20agent:\x20','Project\x20cloned\x20successfully','\x20|\x20','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','repeat','\x20resources?','-\x20nothing\x20pushed','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','1716bhIuuV','Would\x20clone:','cwd','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','session','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','context','agent.yml','updated','tdx.json','llm_project','Would\x20pull\x20agent:\x20','execute','Agent:\x20','projectDir','isNew','✔\x20Context\x20set:\x20','Using\x20local\x20project:\x20','message','\x20changed','\x0aChanges:','outputDir','\x22\x20to\x20a\x20different\x20profile','Source:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20#\x20Pull\x20specific\x20agent','\x20created','Failed\x20to\x20push\x20agent:\x20','Using\x20current\x20project:\x20','agents','sourceProjectName','\x20updated','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','error','unchanged','yellow','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','textKnowledgeBases','action','hasChanges','projectId','output','red','diff','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','Project:\x20','dim','created','knowledgeBases','\x20\x20Source:\x20','new','MISSING_ARGUMENT','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','total','Dry\x20run\x20-\x20no\x20changes\x20made','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','\x20\x20Target:\x20','\x20unchanged','3211808kRhmUw','cyan','pushAgent','errors','Dry\x20run\x20-\x20no\x20files\x20written','utf-8','\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','profile','15550xeVQZq','no_local_folder','Agent\x20','pullProject','\x20new','\x20files?','\x0aChanges\x20to\x20prompt\x20\x27','\x20\x20Integration\x20\x22','\x0aPush\x20summary\x20for\x20\x27','llmProject','\x0aProject\x20pushed\x20with\x20errors','no_context','Pushing\x20agent\x20from\x20\x22','newProjectId','\x22:\x20','\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','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','\x0aWrite\x20','\x20\x20Knowledge\x20Bases:\x20','7359471foQVgx','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','Writing\x20files...','\x22\x20to\x20new\x20project\x20\x22','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','\x20\x20Prompt\x20\x22','\x22...','\x20\x20Agents:\x20','\x20\x20Prompts:\x20','Using\x20project\x20from\x20','\x20\x20Agent\x20\x22','found','\x20--profile\x20','-\x20no\x20files\x20written','Pushing\x20to\x20project...','site','INVALID_ARGUMENT','47028LTUJzY'];a4_0x7c47=function(){return _0x270f94;};return a4_0x7c47();}function displayDiffs(_0x53d9a1,_0xef8eff,_0x1bdd97,_0x986871,_0x37ff78=[]){const _0x2d3312=a4_0x3745;for(const _0x1d4f83 of _0x53d9a1){if(_0x1d4f83[_0x2d3312(0x108)]){const _0x680d58=_0x1d4f83['agentName']||_0x1d4f83[_0x2d3312(0xc0)];console[_0x2d3312(0xd4)](_0x2d3312(0xd0)+_0x680d58+'\x27:'),console[_0x2d3312(0xd4)]('─'[_0x2d3312(0xda)](0x3c)),console['log'](_0x1d4f83[_0x2d3312(0x108)]),console[_0x2d3312(0xd4)]('─'[_0x2d3312(0xda)](0x3c));}}for(const _0x5238b0 of _0xef8eff){_0x5238b0[_0x2d3312(0x108)]&&(console['log'](_0x2d3312(0x109)+_0x5238b0[_0x2d3312(0xc0)]+'\x27:'),console[_0x2d3312(0xd4)]('─'[_0x2d3312(0xda)](0x3c)),console[_0x2d3312(0xd4)](_0x5238b0[_0x2d3312(0x108)]),console['log']('─'['repeat'](0x3c)));}for(const _0x2aa460 of _0x1bdd97){_0x2aa460[_0x2d3312(0x108)]&&(console['log'](_0x2d3312(0x111)+_0x2aa460[_0x2d3312(0xc0)]+'\x27:'),console[_0x2d3312(0xd4)]('─'[_0x2d3312(0xda)](0x3c)),console[_0x2d3312(0xd4)](_0x2aa460[_0x2d3312(0x108)]),console[_0x2d3312(0xd4)]('─'[_0x2d3312(0xda)](0x3c)));}for(const _0x55976a of _0x986871){_0x55976a[_0x2d3312(0x108)]&&(console['log'](_0x2d3312(0x125)+_0x55976a[_0x2d3312(0xc0)]+'\x27:'),console[_0x2d3312(0xd4)]('─'[_0x2d3312(0xda)](0x3c)),console[_0x2d3312(0xd4)](_0x55976a[_0x2d3312(0x108)]),console[_0x2d3312(0xd4)]('─'[_0x2d3312(0xda)](0x3c)));}for(const _0x268660 of _0x37ff78){_0x268660[_0x2d3312(0x108)]&&(console['log']('\x0aChanges\x20to\x20integration\x20\x27'+_0x268660[_0x2d3312(0xc0)]+'\x27:'),console[_0x2d3312(0xd4)]('─'[_0x2d3312(0xda)](0x3c)),console[_0x2d3312(0xd4)](_0x268660[_0x2d3312(0x108)]),console['log']('─'[_0x2d3312(0xda)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x23ab02(0xc0)]=a4_0x23ab02(0xba);[a4_0x23ab02(0xa8)]=a4_0x23ab02(0xc3);async[a4_0x23ab02(0xea)](_0x2899ad){const _0x1cc1d5=a4_0x23ab02,{options:_0x4c420a,args:_0x1ed485,tdx:_0x870e6}=_0x2899ad,_0x27b7a6=_0x1ed485[0x0],_0x162c6a=_0x1ed485[0x1],_0x37db15=_0x4c420a[_0x1cc1d5(0x106)],_0x554af1=_0x4c420a[_0x1cc1d5(0xb2)],_0x399e88=_0x4c420a[_0x1cc1d5(0xa5)],_0x41b4ae=_0x4c420a[_0x1cc1d5(0xd1)],_0x5b93=_0x4c420a[_0x1cc1d5(0x128)];let _0x4212d4,_0xae98a8;const _0x1ca5bb=findAgentConfigPath(process[_0x1cc1d5(0xe0)]());if(_0x27b7a6){const _0x26b90c=a4_0x3bf6a9[_0x1cc1d5(0xb1)](_0x27b7a6,_0x1cc1d5(0xe7));if(existsSync(_0x26b90c))try{const _0x3e8652=JSON[_0x1cc1d5(0xc1)](readFileSync(_0x26b90c,'utf-8'));_0x4212d4=_0x3e8652[_0x1cc1d5(0xe8)],_0xae98a8=_0x27b7a6,console[_0x1cc1d5(0xd4)](a4_0x7cfd41[_0x1cc1d5(0x10b)](_0x1cc1d5(0x13c)+_0x26b90c+':\x20'+_0x4212d4));}catch{_0x4212d4=_0x27b7a6;}else _0x4212d4=_0x27b7a6;}else{if(_0x1ca5bb)try{const _0x35faf7=JSON[_0x1cc1d5(0xc1)](readFileSync(_0x1ca5bb,_0x1cc1d5(0x11c)));_0x4212d4=_0x35faf7[_0x1cc1d5(0xe8)],_0xae98a8=a4_0x3bf6a9[_0x1cc1d5(0xca)](_0x1ca5bb),console['log'](a4_0x7cfd41[_0x1cc1d5(0x10b)](_0x1cc1d5(0xbf)+_0x4212d4));}catch{_0x4212d4=_0x5b93;}else _0x4212d4=_0x5b93;}if(!_0x4212d4)return console[_0x1cc1d5(0xd4)](a4_0x7cfd41[_0x1cc1d5(0x100)](_0x1cc1d5(0xd9))),console[_0x1cc1d5(0xd4)](_0x1cc1d5(0xae)),console[_0x1cc1d5(0xd4)](_0x1cc1d5(0x12e)),console[_0x1cc1d5(0xd4)](_0x1cc1d5(0x11d)),console[_0x1cc1d5(0xd4)](_0x1cc1d5(0xf6)),0x1;if(_0x162c6a){const {data:_0x4c0777}=await withSpinner(_0x1cc1d5(0xc6)+_0x162c6a+'\x22\x20from\x20project\x20\x22'+_0x4212d4+_0x1cc1d5(0x139),()=>_0x870e6[_0x1cc1d5(0xd5)]['pullAgent'](_0x4212d4,_0x162c6a,_0x37db15,{'dryRun':_0x554af1,'force':_0x399e88}));if(_0x554af1)return console[_0x1cc1d5(0xd4)](a4_0x7cfd41[_0x1cc1d5(0x100)](_0x1cc1d5(0x11b))),console[_0x1cc1d5(0xd4)](_0x1cc1d5(0xe9)+_0x4c0777[_0x1cc1d5(0xce)]),console[_0x1cc1d5(0xd4)]('Output\x20path:\x20'+_0x4c0777[_0x1cc1d5(0xab)]),_0x4c0777[_0x1cc1d5(0x108)]&&(console[_0x1cc1d5(0xd4)](_0x1cc1d5(0xf2)),console[_0x1cc1d5(0xd4)]('─'[_0x1cc1d5(0xda)](0x3c)),console['log'](_0x4c0777[_0x1cc1d5(0x108)]),console[_0x1cc1d5(0xd4)]('─'[_0x1cc1d5(0xda)](0x3c))),0x0;return console[_0x1cc1d5(0xd4)](a4_0x7cfd41[_0x1cc1d5(0xbd)]('Agent\x20pulled\x20successfully')),console[_0x1cc1d5(0xd4)]('Agent:\x20'+_0x4c0777['agentName']),console[_0x1cc1d5(0xd4)](_0x1cc1d5(0xa4)+_0x4c0777[_0x1cc1d5(0xab)]),console[_0x1cc1d5(0xd4)]('Status:\x20'+(_0x4c0777[_0x1cc1d5(0xed)]?a4_0x7cfd41[_0x1cc1d5(0xbd)]('new'):_0x4c0777[_0x1cc1d5(0x104)]?a4_0x7cfd41[_0x1cc1d5(0x100)](_0x1cc1d5(0xe6)):a4_0x7cfd41['gray'](_0x1cc1d5(0xff)))),0x0;}const _0x5b4304=_0xae98a8||_0x37db15,{data:_0x2830da}=await withSpinner('Analyzing\x20project\x20\x22'+_0x4212d4+_0x1cc1d5(0x139),()=>_0x870e6[_0x1cc1d5(0xd5)][_0x1cc1d5(0x122)](_0x4212d4,_0x5b4304,{'dryRun':!![]})),_0x3ea5a6=_0x2830da['counts'][_0x1cc1d5(0xfa)]['new']+_0x2830da[_0x1cc1d5(0xcd)][_0x1cc1d5(0x10d)][_0x1cc1d5(0x10f)]+_0x2830da[_0x1cc1d5(0xcd)][_0x1cc1d5(0x102)][_0x1cc1d5(0x10f)]+_0x2830da[_0x1cc1d5(0xcd)][_0x1cc1d5(0xcc)][_0x1cc1d5(0x10f)]+_0x2830da[_0x1cc1d5(0xcd)][_0x1cc1d5(0xd2)][_0x1cc1d5(0x10f)],_0x560482=_0x2830da['counts']['agents'][_0x1cc1d5(0xe6)]+_0x2830da[_0x1cc1d5(0xcd)][_0x1cc1d5(0x10d)][_0x1cc1d5(0xe6)]+_0x2830da['counts'][_0x1cc1d5(0x102)][_0x1cc1d5(0xe6)]+_0x2830da['counts']['prompts'][_0x1cc1d5(0xe6)]+_0x2830da['counts'][_0x1cc1d5(0xd2)]['updated'],_0x599a06=_0x2830da[_0x1cc1d5(0xcd)][_0x1cc1d5(0xfa)]['unchanged']+_0x2830da[_0x1cc1d5(0xcd)]['knowledgeBases'][_0x1cc1d5(0xff)]+_0x2830da[_0x1cc1d5(0xcd)][_0x1cc1d5(0x102)]['unchanged']+_0x2830da['counts'][_0x1cc1d5(0xcc)][_0x1cc1d5(0xff)]+_0x2830da[_0x1cc1d5(0xcd)][_0x1cc1d5(0xd2)]['unchanged'];console[_0x1cc1d5(0xd4)]('\x0aPull\x20summary\x20for\x20\x27'+_0x2830da[_0x1cc1d5(0xbb)]+'\x27:'),console[_0x1cc1d5(0xd4)]('\x20\x20'+a4_0x7cfd41[_0x1cc1d5(0xbd)]('+\x20'+_0x3ea5a6+_0x1cc1d5(0x123))+_0x1cc1d5(0xd8)+a4_0x7cfd41['yellow']('~\x20'+_0x560482+_0x1cc1d5(0xf1))+_0x1cc1d5(0xd8)+a4_0x7cfd41['dim']('=\x20'+_0x599a06+'\x20unchanged')),console[_0x1cc1d5(0xd4)](_0x1cc1d5(0x13a)+formatCountSummary(_0x2830da[_0x1cc1d5(0xcd)]['agents'])),console[_0x1cc1d5(0xd4)](_0x1cc1d5(0x132)+formatCountSummary(_0x2830da[_0x1cc1d5(0xcd)][_0x1cc1d5(0x10d)])),console[_0x1cc1d5(0xd4)](_0x1cc1d5(0xad)+formatCountSummary(_0x2830da[_0x1cc1d5(0xcd)][_0x1cc1d5(0x102)])),console['log']('\x20\x20Prompts:\x20'+formatCountSummary(_0x2830da[_0x1cc1d5(0xcd)][_0x1cc1d5(0xcc)])),console['log']('\x20\x20Integrations:\x20'+formatCountSummary(_0x2830da[_0x1cc1d5(0xcd)][_0x1cc1d5(0xd2)])),console[_0x1cc1d5(0xd4)](_0x1cc1d5(0x115)+a4_0x7cfd41['cyan'](_0x2830da[_0x1cc1d5(0xf3)])),displayDiffs(_0x2830da[_0x1cc1d5(0xfa)],_0x2830da[_0x1cc1d5(0x10d)],_0x2830da[_0x1cc1d5(0x102)],_0x2830da[_0x1cc1d5(0xcc)],_0x2830da[_0x1cc1d5(0xd2)]);if(_0x554af1)return console[_0x1cc1d5(0xd4)](a4_0x7cfd41[_0x1cc1d5(0x100)](_0x1cc1d5(0x137))),0x0;if(_0x3ea5a6===0x0&&_0x560482===0x0)return console['log'](a4_0x7cfd41['green'](_0x1cc1d5(0x130))),saveSessionContext({'llm_project':_0x2830da[_0x1cc1d5(0xbb)]},_0x4c420a[_0x1cc1d5(0xe2)]),console[_0x1cc1d5(0xd4)](a4_0x7cfd41[_0x1cc1d5(0xbd)](_0x1cc1d5(0xee)+a4_0x7cfd41[_0x1cc1d5(0x10b)](_0x1cc1d5(0xe8))+'\x20=\x20'+a4_0x7cfd41[_0x1cc1d5(0x118)](_0x2830da[_0x1cc1d5(0xbb)]))),0x0;if(!_0x41b4ae&&!_0x399e88){if(!isInteractive())return console[_0x1cc1d5(0xfe)](a4_0x7cfd41[_0x1cc1d5(0x107)](_0x1cc1d5(0xaf)),_0x1cc1d5(0xaa)),console[_0x1cc1d5(0xfe)](a4_0x7cfd41[_0x1cc1d5(0x10b)](_0x1cc1d5(0xe1))),0x1;const _0x186364=await confirmKey(_0x1cc1d5(0x131)+(_0x3ea5a6+_0x560482)+_0x1cc1d5(0x124));if(!_0x186364)return console[_0x1cc1d5(0xd4)](a4_0x7cfd41[_0x1cc1d5(0x100)]('Cancelled'),_0x1cc1d5(0x140)),0x1;}const {data:_0x21a1d2}=await withSpinner(_0x1cc1d5(0x135),()=>_0x870e6[_0x1cc1d5(0xd5)]['pullProject'](_0x4212d4,_0x5b4304,{'force':_0x399e88}));return console[_0x1cc1d5(0xd4)](a4_0x7cfd41[_0x1cc1d5(0xbd)]('\x0a✔\x20Pulled\x20'+(_0x3ea5a6+_0x560482)+'\x20files\x20to\x20'+_0x21a1d2[_0x1cc1d5(0xf3)])),saveSessionContext({'llm_project':_0x21a1d2['projectName']},_0x4c420a[_0x1cc1d5(0xe2)]),console[_0x1cc1d5(0xd4)](a4_0x7cfd41['green'](_0x1cc1d5(0xee)+a4_0x7cfd41['dim'](_0x1cc1d5(0xe8))+'\x20=\x20'+a4_0x7cfd41['cyan'](_0x21a1d2[_0x1cc1d5(0xbb)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x23ab02(0xc0)]='agent:clone';[a4_0x23ab02(0xa8)]=a4_0x23ab02(0xfd);async[a4_0x23ab02(0xea)](_0x1d98f2){const _0x453d97=a4_0x23ab02,{options:_0x2c80f4,args:_0x23d77c,tdx:_0x1f6607}=_0x1d98f2,_0x4667ae=_0x23d77c[0x0],_0xb0d34b=_0x2c80f4[_0x453d97(0xc0)],_0x318010=_0x2c80f4[_0x453d97(0xb2)],_0x5e7766=_0x2c80f4['yes'],_0x3a74a4=_0x2c80f4[_0x453d97(0x142)],_0x4b4a86=_0x2c80f4[_0x453d97(0x128)];let _0x2d339c;const _0x570bbe=findAgentConfigPath(process['cwd']());if(_0x4667ae){const _0x27cfb9=a4_0x3bf6a9[_0x453d97(0xb1)](_0x4667ae,_0x453d97(0xe7));existsSync(_0x27cfb9)?(_0x2d339c=_0x4667ae,console[_0x453d97(0xd4)](a4_0x7cfd41[_0x453d97(0x10b)](_0x453d97(0xef)+_0x4667ae))):_0x2d339c=_0x4667ae;}else{if(_0x570bbe)_0x2d339c=a4_0x3bf6a9[_0x453d97(0xca)](_0x570bbe),console[_0x453d97(0xd4)](a4_0x7cfd41[_0x453d97(0x10b)](_0x453d97(0xf9)+_0x2d339c));else{if(_0x4b4a86){const _0x455c03=sanitizeForFilesystem(_0x4b4a86);let _0x582480=_0x455c03,_0x4eb389=a4_0x3bf6a9['join'](process[_0x453d97(0xe0)](),_0x453d97(0xfa),_0x455c03,_0x453d97(0xe7));if(!existsSync(_0x4eb389)){const _0x2cee8b=normalizeName(_0x4b4a86),_0x1a7de2=a4_0x3bf6a9[_0x453d97(0xb1)](process[_0x453d97(0xe0)](),'agents',_0x2cee8b,_0x453d97(0xe7));existsSync(_0x1a7de2)&&(_0x582480=_0x2cee8b,_0x4eb389=_0x1a7de2);}if(existsSync(_0x4eb389))_0x2d339c=a4_0x3bf6a9[_0x453d97(0xca)](_0x4eb389),console[_0x453d97(0xd4)](a4_0x7cfd41[_0x453d97(0x10b)](_0x453d97(0xef)+_0x2d339c));else{const _0x9464dd=_0x2c80f4[_0x453d97(0x11e)];if(_0x9464dd)throw new SDKError(ErrorCode[_0x453d97(0x9b)],'Cannot\x20clone\x20from\x20context\x20project\x20\x22'+_0x4b4a86+_0x453d97(0xf4),undefined,{'helpText':_0x453d97(0xc5)+_0x453d97(0x12f)+('\x20\x20tdx\x20agent\x20pull\x20'+_0x4b4a86+'\x0a')+('\x20\x20tdx\x20agent\x20clone\x20agents/'+_0x582480+'\x20--name\x20'+(_0xb0d34b||_0x453d97(0xa3))+_0x453d97(0x13f)+_0x9464dd)});_0x2d339c=_0x4b4a86,console[_0x453d97(0xd4)](a4_0x7cfd41[_0x453d97(0x10b)]('Using\x20context\x20project:\x20'+_0x4b4a86));}}}}if(!_0x2d339c)return console[_0x453d97(0xd4)](a4_0x7cfd41['yellow'](_0x453d97(0x134))),console['log']('\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project'),console[_0x453d97(0xd4)](_0x453d97(0x114)),console[_0x453d97(0xd4)](_0x453d97(0x9e)),console[_0x453d97(0xd4)](_0x453d97(0x101)),0x1;if(!_0xb0d34b)throw new SDKError(ErrorCode[_0x453d97(0x110)],_0x453d97(0xb0),undefined,{'helpText':_0x453d97(0xc8)});if(!_0x5e7766&&!_0x318010){if(!isInteractive())return console[_0x453d97(0xfe)](a4_0x7cfd41[_0x453d97(0x107)](_0x453d97(0xaf)),_0x453d97(0xaa)),console['error'](a4_0x7cfd41[_0x453d97(0x10b)](_0x453d97(0xe1))),0x1;const _0x35ad7d=await confirmKey('Clone\x20\x22'+_0x2d339c+_0x453d97(0x136)+_0xb0d34b+'\x22?');if(!_0x35ad7d)return console[_0x453d97(0xd4)](a4_0x7cfd41[_0x453d97(0x100)](_0x453d97(0xb4))),0x1;}const {data:_0x7af9fa}=await withSpinner('Cloning\x20\x22'+_0x2d339c+_0x453d97(0xa6)+_0xb0d34b+_0x453d97(0x139),()=>_0x1f6607['llm']['cloneProject'](_0x2d339c,_0xb0d34b,{'dryRun':_0x318010}));if(_0x318010)return console[_0x453d97(0xd4)](a4_0x7cfd41[_0x453d97(0x100)](_0x453d97(0x113))),console[_0x453d97(0xd4)](_0x453d97(0xf5)+_0x7af9fa[_0x453d97(0xfb)]),console[_0x453d97(0xd4)](_0x453d97(0xcb)+_0xb0d34b),console[_0x453d97(0xd4)](_0x453d97(0xdf)),console[_0x453d97(0xd4)](_0x453d97(0x13a)+_0x7af9fa[_0x453d97(0xcd)]['agents'][_0x453d97(0x10c)]),console[_0x453d97(0xd4)]('\x20\x20Knowledge\x20Bases:\x20'+_0x7af9fa[_0x453d97(0xcd)]['knowledgeBases'][_0x453d97(0x10c)]),console['log'](_0x453d97(0x13b)+_0x7af9fa['counts'][_0x453d97(0xcc)][_0x453d97(0x10c)]),0x0;const _0x2fe96a=_0x7af9fa['counts'][_0x453d97(0xfa)][_0x453d97(0x11a)]>0x0||_0x7af9fa[_0x453d97(0xcd)][_0x453d97(0x10d)]['errors']>0x0||_0x7af9fa['counts'][_0x453d97(0xcc)]['errors']>0x0;_0x2fe96a?console[_0x453d97(0xd4)](a4_0x7cfd41[_0x453d97(0x100)](_0x453d97(0xb6))):console[_0x453d97(0xd4)](a4_0x7cfd41['green'](_0x453d97(0xd7)));console['log'](_0x453d97(0xf5)+_0x7af9fa[_0x453d97(0xfb)]),console[_0x453d97(0xd4)](_0x453d97(0xcb)+_0x7af9fa[_0x453d97(0xc7)]),console[_0x453d97(0xd4)](_0x453d97(0xd3)+_0x7af9fa[_0x453d97(0x12c)]),console[_0x453d97(0xd4)](),console[_0x453d97(0xd4)](_0x453d97(0xb5)),console['log'](_0x453d97(0x13a)+formatCountSummary(_0x7af9fa[_0x453d97(0xcd)][_0x453d97(0xfa)])),console[_0x453d97(0xd4)](_0x453d97(0x132)+formatCountSummary(_0x7af9fa[_0x453d97(0xcd)]['knowledgeBases'])),console[_0x453d97(0xd4)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x7af9fa[_0x453d97(0xcd)][_0x453d97(0xcc)])),console[_0x453d97(0xd4)](_0x453d97(0xa7)+formatCountSummary(_0x7af9fa['counts'][_0x453d97(0xd2)]));if(_0x2fe96a){console[_0x453d97(0xd4)](),console[_0x453d97(0xd4)](a4_0x7cfd41['red']('Errors:'));for(const _0x42e072 of _0x7af9fa[_0x453d97(0xfa)]){_0x42e072['action']===_0x453d97(0xfe)&&console[_0x453d97(0xd4)](a4_0x7cfd41[_0x453d97(0x107)]('\x20\x20Agent\x20\x22'+_0x42e072[_0x453d97(0xce)]+_0x453d97(0x12d)+_0x42e072[_0x453d97(0xfe)]));}for(const _0x44dc71 of _0x7af9fa[_0x453d97(0x10d)]){_0x44dc71['action']==='error'&&console[_0x453d97(0xd4)](a4_0x7cfd41['red'](_0x453d97(0xb9)+_0x44dc71[_0x453d97(0xc0)]+_0x453d97(0x12d)+_0x44dc71[_0x453d97(0xfe)]));}for(const _0x30a5b2 of _0x7af9fa[_0x453d97(0xcc)]){_0x30a5b2[_0x453d97(0x103)]===_0x453d97(0xfe)&&console[_0x453d97(0xd4)](a4_0x7cfd41[_0x453d97(0x107)](_0x453d97(0x138)+_0x30a5b2['name']+_0x453d97(0x12d)+_0x30a5b2[_0x453d97(0xfe)]));}for(const _0x528ff1 of _0x7af9fa[_0x453d97(0xd2)]){_0x528ff1[_0x453d97(0x103)]==='error'&&console[_0x453d97(0xd4)](a4_0x7cfd41['red'](_0x453d97(0x126)+_0x528ff1[_0x453d97(0xc0)]+_0x453d97(0x12d)+_0x528ff1[_0x453d97(0xfe)]));}return 0x1;}console[_0x453d97(0xd4)]();const _0x167d88=getLLMProjectUrl(_0x3a74a4,_0x7af9fa[_0x453d97(0x12c)]);return console[_0x453d97(0xd4)](_0x453d97(0x10a)+a4_0x7cfd41['cyan'](_0x167d88)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x23ab02(0xc0)]=a4_0x23ab02(0xbc);['description']='Push\x20local\x20agent\x20files\x20to\x20LLM\x20project';async[a4_0x23ab02(0xea)](_0x2681bd){const _0x4e3042=a4_0x23ab02,{options:_0x4acc01,args:_0x44f819,tdx:_0x37f830}=_0x2681bd;let _0x474175=_0x44f819[0x0]||process[_0x4e3042(0xe0)]();const _0x965960=_0x4acc01[_0x4e3042(0xb2)],_0x1a3e53=_0x4acc01[_0x4e3042(0xa5)],_0x2a2556=_0x4acc01[_0x4e3042(0xd1)],_0x1d675a=_0x4acc01['site'],_0x30ea43=a4_0x3bf6a9[_0x4e3042(0xb1)](_0x474175,_0x4e3042(0xe5)),_0x4e4a92=existsSync(_0x30ea43);if(_0x4e4a92){const {data:_0x3b4676}=await withSpinner(_0x4e3042(0x12b)+_0x474175+_0x4e3042(0x139),()=>_0x37f830[_0x4e3042(0xd5)][_0x4e3042(0x119)](_0x474175,{'dryRun':_0x965960,'force':_0x1a3e53}));if(_0x965960)return console[_0x4e3042(0xd4)](a4_0x7cfd41[_0x4e3042(0x100)](_0x4e3042(0x113))),console[_0x4e3042(0xd4)](_0x4e3042(0xd6)+_0x3b4676[_0x4e3042(0xce)]),0x0;if(_0x3b4676[_0x4e3042(0x103)]===_0x4e3042(0xfe))return console['log'](a4_0x7cfd41[_0x4e3042(0x107)](_0x4e3042(0xf8)+_0x3b4676[_0x4e3042(0xfe)])),0x1;console['log'](a4_0x7cfd41['green'](_0x4e3042(0x121)+_0x3b4676['action']+'\x20successfully')),console['log'](_0x4e3042(0xeb)+_0x3b4676['agentName']);if(_0x3b4676['agentId']&&_0x3b4676[_0x4e3042(0x105)]){const _0xc781c2=getLLMAgentChatUrl(_0x1d675a,_0x3b4676[_0x4e3042(0x105)],_0x3b4676['agentId']);console[_0x4e3042(0xd4)]('Chat:\x20'+a4_0x7cfd41['cyan'](_0xc781c2));}return 0x0;}const _0x1bc340=_0x4acc01[_0x4e3042(0x128)],_0x1ec6cb=resolveProjectFromContext(_0x474175,_0x1bc340);if(_0x1ec6cb[_0x4e3042(0x13e)])_0x474175=_0x1ec6cb[_0x4e3042(0xec)],_0x1ec6cb[_0x4e3042(0xa9)]===_0x4e3042(0xe4)&&console[_0x4e3042(0xd4)](a4_0x7cfd41[_0x4e3042(0x10b)](_0x4e3042(0xbf)+_0x474175));else{let _0x319d17=_0x4e3042(0xc9);_0x1ec6cb['reason']===_0x4e3042(0x120)&&(_0x319d17=_0x1ec6cb[_0x4e3042(0xf0)]+_0x4e3042(0xdd)+_0x1ec6cb[_0x4e3042(0x128)]+'\x27\x20to\x20create\x20the\x20folder\x20structure.');throw new SDKError(ErrorCode[_0x4e3042(0x9b)],_0x1ec6cb[_0x4e3042(0xa2)]===_0x4e3042(0x12a)?_0x1ec6cb[_0x4e3042(0xf0)]:'No\x20tdx.json\x20found\x20in\x20'+_0x474175,undefined,{'helpText':_0x319d17});}const {data:_0x3a469e}=await withSpinner(_0x4e3042(0xb8),()=>_0x37f830[_0x4e3042(0xd5)][_0x4e3042(0x9f)](_0x474175,{'dryRun':!![]})),_0x177e2e=_0x3a469e[_0x4e3042(0xcd)][_0x4e3042(0xfa)]['errors']>0x0;if(_0x177e2e){console['log'](a4_0x7cfd41[_0x4e3042(0x107)]('\x0aErrors\x20found:'));for(const _0x49643e of _0x3a469e[_0x4e3042(0xfa)]){_0x49643e[_0x4e3042(0x103)]===_0x4e3042(0xfe)&&console[_0x4e3042(0xd4)](a4_0x7cfd41[_0x4e3042(0x107)](_0x4e3042(0x13d)+_0x49643e[_0x4e3042(0xce)]+_0x4e3042(0x12d)+_0x49643e[_0x4e3042(0xfe)]));}return 0x1;}const _0x4aefc5=_0x3a469e['counts'][_0x4e3042(0xfa)][_0x4e3042(0x10c)]+_0x3a469e['counts'][_0x4e3042(0x10d)]['created']+_0x3a469e['counts'][_0x4e3042(0x102)][_0x4e3042(0x10c)]+_0x3a469e[_0x4e3042(0xcd)]['prompts']['created']+_0x3a469e[_0x4e3042(0xcd)][_0x4e3042(0xd2)][_0x4e3042(0x10c)],_0x424eb3=_0x3a469e['counts']['agents'][_0x4e3042(0xe6)]+_0x3a469e['counts'][_0x4e3042(0x10d)][_0x4e3042(0xe6)]+_0x3a469e[_0x4e3042(0xcd)][_0x4e3042(0x102)][_0x4e3042(0xe6)]+_0x3a469e[_0x4e3042(0xcd)]['prompts']['updated']+_0x3a469e[_0x4e3042(0xcd)]['integrations'][_0x4e3042(0xe6)],_0x52b56b=_0x3a469e[_0x4e3042(0xcd)][_0x4e3042(0xfa)][_0x4e3042(0xff)]+_0x3a469e[_0x4e3042(0xcd)][_0x4e3042(0x10d)][_0x4e3042(0xff)]+_0x3a469e[_0x4e3042(0xcd)]['textKnowledgeBases'][_0x4e3042(0xff)]+_0x3a469e['counts'][_0x4e3042(0xcc)][_0x4e3042(0xff)]+_0x3a469e['counts'][_0x4e3042(0xd2)]['unchanged'];console['log'](_0x4e3042(0x127)+_0x3a469e[_0x4e3042(0xbb)]+'\x27:'),console[_0x4e3042(0xd4)]('\x20\x20'+a4_0x7cfd41['green']('+\x20'+_0x4aefc5+_0x4e3042(0x123))+'\x20|\x20'+a4_0x7cfd41[_0x4e3042(0x100)]('~\x20'+_0x424eb3+'\x20changed')+'\x20|\x20'+a4_0x7cfd41[_0x4e3042(0x10b)]('=\x20'+_0x52b56b+_0x4e3042(0x116))),console[_0x4e3042(0xd4)](_0x4e3042(0x13a)+formatCountSummary(_0x3a469e[_0x4e3042(0xcd)][_0x4e3042(0xfa)])),console[_0x4e3042(0xd4)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x3a469e['counts'][_0x4e3042(0x10d)])),console[_0x4e3042(0xd4)](_0x4e3042(0xad)+formatCountSummary(_0x3a469e[_0x4e3042(0xcd)][_0x4e3042(0x102)])),console[_0x4e3042(0xd4)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x3a469e['counts'][_0x4e3042(0xcc)])),console[_0x4e3042(0xd4)](_0x4e3042(0xa7)+formatCountSummary(_0x3a469e['counts'][_0x4e3042(0xd2)])),console['log'](_0x4e3042(0x10e)+a4_0x7cfd41[_0x4e3042(0x118)](_0x474175)),displayDiffs(_0x3a469e[_0x4e3042(0xfa)],_0x3a469e[_0x4e3042(0x10d)],_0x3a469e[_0x4e3042(0x102)],_0x3a469e[_0x4e3042(0xcc)],_0x3a469e[_0x4e3042(0xd2)]);if(_0x965960)return console[_0x4e3042(0xd4)](a4_0x7cfd41[_0x4e3042(0x100)](_0x4e3042(0xe3))),0x0;if(_0x4aefc5===0x0&&_0x424eb3===0x0){console[_0x4e3042(0xd4)](a4_0x7cfd41['green'](_0x4e3042(0xac)));const _0x42bb9a=getLLMProjectUrl(_0x1d675a,_0x3a469e[_0x4e3042(0x105)]);return console[_0x4e3042(0xd4)](_0x4e3042(0x10a)+a4_0x7cfd41[_0x4e3042(0x118)](_0x42bb9a)),0x0;}if(!_0x2a2556&&!_0x1a3e53){if(!isInteractive())return console[_0x4e3042(0xfe)](a4_0x7cfd41[_0x4e3042(0x107)](_0x4e3042(0xaf)),_0x4e3042(0xaa)),console[_0x4e3042(0xfe)](a4_0x7cfd41['dim'](_0x4e3042(0xe1))),0x1;const _0xc7fb1a=await confirmKey('\x0aPush\x20'+(_0x4aefc5+_0x424eb3)+_0x4e3042(0xdb));if(!_0xc7fb1a)return console[_0x4e3042(0xd4)](a4_0x7cfd41[_0x4e3042(0x100)](_0x4e3042(0xb4)),_0x4e3042(0xdc)),0x1;}const {data:_0x422ba8}=await withSpinner(_0x4e3042(0x141),()=>_0x37f830[_0x4e3042(0xd5)][_0x4e3042(0x9f)](_0x474175,{'force':_0x1a3e53})),_0x8e5cef=_0x422ba8[_0x4e3042(0xcd)]['agents'][_0x4e3042(0x11a)]>0x0||_0x422ba8['counts'][_0x4e3042(0x10d)][_0x4e3042(0x11a)]>0x0||_0x422ba8['counts'][_0x4e3042(0x102)][_0x4e3042(0x11a)]>0x0||_0x422ba8[_0x4e3042(0xcd)]['prompts'][_0x4e3042(0x11a)]>0x0;if(_0x8e5cef){console[_0x4e3042(0xd4)](a4_0x7cfd41[_0x4e3042(0x100)](_0x4e3042(0x129))),console[_0x4e3042(0xd4)](),console[_0x4e3042(0xd4)](a4_0x7cfd41[_0x4e3042(0x107)](_0x4e3042(0xbe)));for(const _0x21b698 of _0x422ba8[_0x4e3042(0xfa)]){_0x21b698[_0x4e3042(0x103)]===_0x4e3042(0xfe)&&console[_0x4e3042(0xd4)](a4_0x7cfd41[_0x4e3042(0x107)](_0x4e3042(0x13d)+_0x21b698[_0x4e3042(0xce)]+_0x4e3042(0x12d)+_0x21b698[_0x4e3042(0xfe)]));}for(const _0x3fa591 of _0x422ba8[_0x4e3042(0x10d)]){_0x3fa591[_0x4e3042(0x103)]===_0x4e3042(0xfe)&&console[_0x4e3042(0xd4)](a4_0x7cfd41[_0x4e3042(0x107)](_0x4e3042(0xb9)+_0x3fa591[_0x4e3042(0xc0)]+'\x22:\x20'+_0x3fa591['error']));}for(const _0x3f4af9 of _0x422ba8[_0x4e3042(0x102)]){_0x3f4af9[_0x4e3042(0x103)]==='error'&&console[_0x4e3042(0xd4)](a4_0x7cfd41['red']('\x20\x20Text\x20Knowledge\x20Base\x20\x22'+_0x3f4af9[_0x4e3042(0xc0)]+'\x22:\x20'+_0x3f4af9[_0x4e3042(0xfe)]));}for(const _0x3e3587 of _0x422ba8[_0x4e3042(0xcc)]){_0x3e3587[_0x4e3042(0x103)]===_0x4e3042(0xfe)&&console[_0x4e3042(0xd4)](a4_0x7cfd41['red'](_0x4e3042(0x138)+_0x3e3587[_0x4e3042(0xc0)]+_0x4e3042(0x12d)+_0x3e3587[_0x4e3042(0xfe)]));}for(const _0x238140 of _0x422ba8[_0x4e3042(0xd2)]){_0x238140['action']===_0x4e3042(0xfe)&&console[_0x4e3042(0xd4)](a4_0x7cfd41[_0x4e3042(0x107)](_0x4e3042(0x126)+_0x238140[_0x4e3042(0xc0)]+_0x4e3042(0x12d)+_0x238140['error']));}return 0x1;}console[_0x4e3042(0xd4)](a4_0x7cfd41[_0x4e3042(0xbd)]('\x0a✔\x20Pushed\x20'+(_0x4aefc5+_0x424eb3)+_0x4e3042(0xc2)+_0x422ba8[_0x4e3042(0xbb)]+'\x27'));const _0x4a549a=getLLMProjectUrl(_0x1d675a,_0x422ba8[_0x4e3042(0x105)]);return console['log'](_0x4e3042(0x10a)+a4_0x7cfd41[_0x4e3042(0x118)](_0x4a549a)),0x0;}}
1
+ const a4_0x5ec1e0=a4_0x525d;function a4_0x525d(_0x236987,_0x38e050){_0x236987=_0x236987-0x12f;const _0x2e345c=a4_0x2e34();let _0x525d23=_0x2e345c[_0x236987];return _0x525d23;}(function(_0x4fe510,_0x35134a){const _0x5560ba=a4_0x525d,_0x2acf41=_0x4fe510();while(!![]){try{const _0x558d89=-parseInt(_0x5560ba(0x150))/0x1*(parseInt(_0x5560ba(0x1c9))/0x2)+parseInt(_0x5560ba(0x1d2))/0x3+-parseInt(_0x5560ba(0x17d))/0x4*(parseInt(_0x5560ba(0x159))/0x5)+-parseInt(_0x5560ba(0x1a7))/0x6+-parseInt(_0x5560ba(0x144))/0x7*(parseInt(_0x5560ba(0x1a3))/0x8)+parseInt(_0x5560ba(0x173))/0x9+-parseInt(_0x5560ba(0x156))/0xa*(-parseInt(_0x5560ba(0x16a))/0xb);if(_0x558d89===_0x35134a)break;else _0x2acf41['push'](_0x2acf41['shift']());}catch(_0x4a903e){_0x2acf41['push'](_0x2acf41['shift']());}}}(a4_0x2e34,0x8b8b4));import a4_0x58da74 from'chalk';function a4_0x2e34(){const _0x3794fe=['6760KxfQdc','\x20\x20Source:\x20','diff','117895PoFZBZ','context','llm_project','log','\x20successfully','\x20=\x20','errors','Clone\x20\x22','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','unchanged','\x20--name\x20','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','green','textKnowledgeBases','outputDir','agent.yml','Using\x20current\x20project:\x20','13860XSMCYA','utf-8','\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','\x0aPull\x20summary\x20for\x20\x27','\x20\x20Integrations:\x20','Analyzing\x20changes\x20to\x20push...','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','Source:\x20','\x20\x20Prompts:\x20','4432527gSklvL','Would\x20clone:','Project\x20cloned\x20successfully','message','<new-name>','join','push','\x22\x20to\x20\x22','\x20errors','reason','40moqrod','projectName','dim','Output\x20path:\x20','created','\x20|\x20','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','found','action','\x0aProject\x20pushed\x20with\x20errors','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','Failed\x20to\x20push\x20agent:\x20','prompts','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','cyan','\x0a✔\x20Pulled\x20','projectId','Chat:\x20','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','agentId','New\x20project\x20ID:\x20','\x20--profile\x20','Would\x20push\x20agent:\x20','Using\x20context\x20project:\x20','new','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','Dry\x20run\x20-\x20no\x20changes\x20made','agent:pull','site','force','cloneProject','\x22\x20to\x20new\x20project\x20\x22','execute','newProjectId','description','Project\x20cloned\x20with\x20errors','New\x20project:\x20','593504YOgLUP','\x20\x20Prompt\x20\x22','output','Pushing\x20agent\x20from\x20\x22','3277464hHPrbv','gray','agent:push','Output:\x20','tdx.json','\x20\x20Text\x20Knowledge\x20Bases:\x20','\x20\x20Agents:\x20','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','Project:\x20','\x22...','llmProject','\x20\x20Integration\x20\x22','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','\x20\x20Knowledge\x20Bases:\x20','\x22\x20to\x20a\x20different\x20profile','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','✔\x20Context\x20set:\x20','\x20new','\x20\x20Target:\x20','\x20updated','\x20\x20Agent\x20\x22','sourceProjectName','Summary:','profile','session','Analyzing\x20project\x20\x22','\x20\x20tdx\x20agent\x20clone\x20agents/','Agent:\x20','\x20\x20tdx\x20agent\x20clone\x20--name\x20<new-name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clone\x20from\x20context\x20(llm_project)','counts','-\x20nothing\x20pushed','Cannot\x20clone\x20from\x20context\x20project\x20\x22','Using\x20local\x20project:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20#\x20Pull\x20specific\x20agent','522134FSexTk','pullProject','Using\x20project:\x20','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','\x20\x20Knowledge\x20Base\x20\x22','\x0aChanges\x20to\x20integration\x20\x27','yes','name','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','1256358vrevHw','outputPath','\x20\x20Text\x20Knowledge\x20Base\x20\x22','\x20\x20tdx\x20agent\x20pull\x20','INVALID_ARGUMENT','hasChanges','Cancelled','yellow','\x0aError:','\x0a✔\x20Pushed\x20','Dry\x20run\x20-\x20no\x20files\x20written','red','Cloning\x20\x22','knowledgeBases','source','parse','llm','dirname','pullAgent','dryRun','\x20unchanged','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','no_context','cwd','pushProject','Agent\x20pulled\x20successfully','repeat','\x0aWrite\x20','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','\x0aChanges\x20to\x20agent\x20\x27','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Pulling\x20agent\x20\x22','error','\x20resources\x20to\x20\x27','14AAvISP','newProjectName','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)','updated','\x22:\x20','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','integrations','\x0aChanges\x20to\x20prompt\x20\x27','\x20total','total','Errors:','agents','1MnJZCb','agentName','\x20changed','Agent\x20','\x0aErrors\x20found:','\x0aChanges\x20to\x20knowledge\x20base\x20\x27'];a4_0x2e34=function(){return _0x3794fe;};return a4_0x2e34();}import a4_0x168d65 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(_0x1a6f4f){const _0xb018d8=a4_0x525d,_0x55cb7f=[];if(_0x1a6f4f['total']!==undefined)_0x55cb7f[_0xb018d8(0x179)](_0x1a6f4f[_0xb018d8(0x14d)]+_0xb018d8(0x14c));if(_0x1a6f4f[_0xb018d8(0x196)]!==undefined&&_0x1a6f4f[_0xb018d8(0x196)]>0x0)_0x55cb7f['push'](a4_0x58da74[_0xb018d8(0x165)](_0x1a6f4f[_0xb018d8(0x196)]+_0xb018d8(0x1b8)));if(_0x1a6f4f['created']!==undefined&&_0x1a6f4f[_0xb018d8(0x181)]>0x0)_0x55cb7f[_0xb018d8(0x179)](a4_0x58da74['green'](_0x1a6f4f[_0xb018d8(0x181)]+'\x20created'));if(_0x1a6f4f[_0xb018d8(0x147)]!==undefined&&_0x1a6f4f['updated']>0x0)_0x55cb7f[_0xb018d8(0x179)](a4_0x58da74[_0xb018d8(0x1d9)](_0x1a6f4f[_0xb018d8(0x147)]+_0xb018d8(0x1ba)));if(_0x1a6f4f['unchanged']!==undefined&&_0x1a6f4f[_0xb018d8(0x162)]>0x0)_0x55cb7f[_0xb018d8(0x179)](a4_0x58da74[_0xb018d8(0x1a8)](_0x1a6f4f[_0xb018d8(0x162)]+_0xb018d8(0x136)));if(_0x1a6f4f['errors']!==undefined&&_0x1a6f4f[_0xb018d8(0x15f)]>0x0)_0x55cb7f[_0xb018d8(0x179)](a4_0x58da74[_0xb018d8(0x1dd)](_0x1a6f4f[_0xb018d8(0x15f)]+_0xb018d8(0x17b)));return _0x55cb7f[_0xb018d8(0x178)](',\x20');}function displayDiffs(_0x3ba3c3,_0x4af13c,_0x2f8b95,_0x5a8b8b,_0x45452a=[]){const _0x68180d=a4_0x525d;for(const _0x28bd83 of _0x3ba3c3){if(_0x28bd83['diff']){const _0x332e6b=_0x28bd83[_0x68180d(0x151)]||_0x28bd83['name'];console[_0x68180d(0x15c)](_0x68180d(0x13f)+_0x332e6b+'\x27:'),console[_0x68180d(0x15c)]('─'[_0x68180d(0x13c)](0x3c)),console['log'](_0x28bd83[_0x68180d(0x158)]),console[_0x68180d(0x15c)]('─'[_0x68180d(0x13c)](0x3c));}}for(const _0x3e6707 of _0x4af13c){_0x3e6707[_0x68180d(0x158)]&&(console[_0x68180d(0x15c)](_0x68180d(0x155)+_0x3e6707[_0x68180d(0x1d0)]+'\x27:'),console[_0x68180d(0x15c)]('─'[_0x68180d(0x13c)](0x3c)),console[_0x68180d(0x15c)](_0x3e6707[_0x68180d(0x158)]),console[_0x68180d(0x15c)]('─'[_0x68180d(0x13c)](0x3c)));}for(const _0x377aea of _0x2f8b95){_0x377aea[_0x68180d(0x158)]&&(console['log'](_0x68180d(0x190)+_0x377aea['name']+'\x27:'),console['log']('─'[_0x68180d(0x13c)](0x3c)),console['log'](_0x377aea[_0x68180d(0x158)]),console[_0x68180d(0x15c)]('─'[_0x68180d(0x13c)](0x3c)));}for(const _0x59ebf7 of _0x5a8b8b){_0x59ebf7[_0x68180d(0x158)]&&(console[_0x68180d(0x15c)](_0x68180d(0x14b)+_0x59ebf7[_0x68180d(0x1d0)]+'\x27:'),console[_0x68180d(0x15c)]('─'[_0x68180d(0x13c)](0x3c)),console['log'](_0x59ebf7[_0x68180d(0x158)]),console[_0x68180d(0x15c)]('─'[_0x68180d(0x13c)](0x3c)));}for(const _0x191edb of _0x45452a){_0x191edb[_0x68180d(0x158)]&&(console[_0x68180d(0x15c)](_0x68180d(0x1ce)+_0x191edb[_0x68180d(0x1d0)]+'\x27:'),console['log']('─'['repeat'](0x3c)),console[_0x68180d(0x15c)](_0x191edb[_0x68180d(0x158)]),console[_0x68180d(0x15c)]('─'[_0x68180d(0x13c)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x5ec1e0(0x1d0)]=a4_0x5ec1e0(0x199);['description']='Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files';async[a4_0x5ec1e0(0x19e)](_0x5d7d48){const _0x5a728c=a4_0x5ec1e0,{options:_0x3838c3,args:_0x29a9f3,tdx:_0x37a1e0}=_0x5d7d48,_0x4e2f43=_0x29a9f3[0x0],_0x348f7e=_0x29a9f3[0x1],_0x53928d=_0x3838c3[_0x5a728c(0x1a5)],_0x119b9b=_0x3838c3[_0x5a728c(0x135)],_0x11bfa5=_0x3838c3[_0x5a728c(0x19b)],_0x902a38=_0x3838c3[_0x5a728c(0x1cf)],_0x22ee18=_0x3838c3[_0x5a728c(0x1b1)];let _0x202e40,_0x1dbe96;const _0x54b9f9=findAgentConfigPath(process[_0x5a728c(0x139)]());if(_0x4e2f43){const _0x448d32=a4_0x168d65[_0x5a728c(0x178)](_0x4e2f43,_0x5a728c(0x1ab));if(existsSync(_0x448d32))try{const _0x2a8033=JSON[_0x5a728c(0x131)](readFileSync(_0x448d32,_0x5a728c(0x16b)));_0x202e40=_0x2a8033[_0x5a728c(0x15b)],_0x1dbe96=_0x4e2f43,console[_0x5a728c(0x15c)](a4_0x58da74[_0x5a728c(0x17f)]('Using\x20project\x20from\x20'+_0x448d32+':\x20'+_0x202e40));}catch{_0x202e40=_0x4e2f43;}else _0x202e40=_0x4e2f43;}else{if(_0x54b9f9)try{const _0x1d25b6=JSON['parse'](readFileSync(_0x54b9f9,_0x5a728c(0x16b)));_0x202e40=_0x1d25b6[_0x5a728c(0x15b)],_0x1dbe96=a4_0x168d65[_0x5a728c(0x133)](_0x54b9f9),console['log'](a4_0x58da74['dim'](_0x5a728c(0x1cb)+_0x202e40));}catch{_0x202e40=_0x22ee18;}else _0x202e40=_0x22ee18;}if(!_0x202e40)return console[_0x5a728c(0x15c)](a4_0x58da74[_0x5a728c(0x1d9)]('llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a')),console['log'](_0x5a728c(0x146)),console['log']('\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'),console[_0x5a728c(0x15c)](_0x5a728c(0x16c)),console[_0x5a728c(0x15c)](_0x5a728c(0x1c8)),0x1;if(_0x348f7e){const {data:_0x53cc9d}=await withSpinner(_0x5a728c(0x141)+_0x348f7e+'\x22\x20from\x20project\x20\x22'+_0x202e40+'\x22...',()=>_0x37a1e0['llm'][_0x5a728c(0x134)](_0x202e40,_0x348f7e,_0x53928d,{'dryRun':_0x119b9b,'force':_0x11bfa5}));if(_0x119b9b)return console['log'](a4_0x58da74[_0x5a728c(0x1d9)](_0x5a728c(0x1dc))),console[_0x5a728c(0x15c)]('Would\x20pull\x20agent:\x20'+_0x53cc9d[_0x5a728c(0x151)]),console['log'](_0x5a728c(0x180)+_0x53cc9d[_0x5a728c(0x1d3)]),_0x53cc9d[_0x5a728c(0x158)]&&(console['log']('\x0aChanges:'),console[_0x5a728c(0x15c)]('─'[_0x5a728c(0x13c)](0x3c)),console[_0x5a728c(0x15c)](_0x53cc9d[_0x5a728c(0x158)]),console[_0x5a728c(0x15c)]('─'[_0x5a728c(0x13c)](0x3c))),0x0;return console[_0x5a728c(0x15c)](a4_0x58da74[_0x5a728c(0x165)](_0x5a728c(0x13b))),console[_0x5a728c(0x15c)](_0x5a728c(0x1c2)+_0x53cc9d['agentName']),console[_0x5a728c(0x15c)](_0x5a728c(0x1aa)+_0x53cc9d['outputPath']),console['log']('Status:\x20'+(_0x53cc9d['isNew']?a4_0x58da74['green']('new'):_0x53cc9d[_0x5a728c(0x1d7)]?a4_0x58da74['yellow'](_0x5a728c(0x147)):a4_0x58da74[_0x5a728c(0x1a8)](_0x5a728c(0x162)))),0x0;}const _0xe0233f=_0x1dbe96||_0x53928d,{data:_0x496dbe}=await withSpinner(_0x5a728c(0x1c0)+_0x202e40+_0x5a728c(0x1b0),()=>_0x37a1e0[_0x5a728c(0x132)][_0x5a728c(0x1ca)](_0x202e40,_0xe0233f,{'dryRun':!![]})),_0x57d136=_0x496dbe[_0x5a728c(0x1c4)]['agents'][_0x5a728c(0x196)]+_0x496dbe[_0x5a728c(0x1c4)][_0x5a728c(0x12f)][_0x5a728c(0x196)]+_0x496dbe[_0x5a728c(0x1c4)][_0x5a728c(0x166)]['new']+_0x496dbe['counts'][_0x5a728c(0x189)]['new']+_0x496dbe[_0x5a728c(0x1c4)][_0x5a728c(0x14a)][_0x5a728c(0x196)],_0x8907b9=_0x496dbe[_0x5a728c(0x1c4)][_0x5a728c(0x14f)]['updated']+_0x496dbe['counts'][_0x5a728c(0x12f)]['updated']+_0x496dbe[_0x5a728c(0x1c4)][_0x5a728c(0x166)][_0x5a728c(0x147)]+_0x496dbe[_0x5a728c(0x1c4)]['prompts'][_0x5a728c(0x147)]+_0x496dbe[_0x5a728c(0x1c4)][_0x5a728c(0x14a)][_0x5a728c(0x147)],_0x56827f=_0x496dbe[_0x5a728c(0x1c4)][_0x5a728c(0x14f)]['unchanged']+_0x496dbe['counts'][_0x5a728c(0x12f)][_0x5a728c(0x162)]+_0x496dbe['counts'][_0x5a728c(0x166)][_0x5a728c(0x162)]+_0x496dbe[_0x5a728c(0x1c4)][_0x5a728c(0x189)][_0x5a728c(0x162)]+_0x496dbe['counts'][_0x5a728c(0x14a)][_0x5a728c(0x162)];console[_0x5a728c(0x15c)](_0x5a728c(0x16d)+_0x496dbe[_0x5a728c(0x17e)]+'\x27:'),console[_0x5a728c(0x15c)]('\x20\x20'+a4_0x58da74[_0x5a728c(0x165)]('+\x20'+_0x57d136+_0x5a728c(0x1b8))+'\x20|\x20'+a4_0x58da74['yellow']('~\x20'+_0x8907b9+_0x5a728c(0x152))+_0x5a728c(0x182)+a4_0x58da74[_0x5a728c(0x17f)]('=\x20'+_0x56827f+_0x5a728c(0x136))),console[_0x5a728c(0x15c)](_0x5a728c(0x1ad)+formatCountSummary(_0x496dbe[_0x5a728c(0x1c4)][_0x5a728c(0x14f)])),console[_0x5a728c(0x15c)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x496dbe[_0x5a728c(0x1c4)][_0x5a728c(0x12f)])),console[_0x5a728c(0x15c)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x496dbe[_0x5a728c(0x1c4)]['textKnowledgeBases'])),console[_0x5a728c(0x15c)](_0x5a728c(0x172)+formatCountSummary(_0x496dbe[_0x5a728c(0x1c4)][_0x5a728c(0x189)])),console['log']('\x20\x20Integrations:\x20'+formatCountSummary(_0x496dbe[_0x5a728c(0x1c4)][_0x5a728c(0x14a)])),console[_0x5a728c(0x15c)](_0x5a728c(0x1b9)+a4_0x58da74[_0x5a728c(0x18c)](_0x496dbe[_0x5a728c(0x167)])),displayDiffs(_0x496dbe[_0x5a728c(0x14f)],_0x496dbe[_0x5a728c(0x12f)],_0x496dbe['textKnowledgeBases'],_0x496dbe[_0x5a728c(0x189)],_0x496dbe[_0x5a728c(0x14a)]);if(_0x119b9b)return console[_0x5a728c(0x15c)](a4_0x58da74[_0x5a728c(0x1d9)](_0x5a728c(0x197))),0x0;if(_0x57d136===0x0&&_0x8907b9===0x0)return console[_0x5a728c(0x15c)](a4_0x58da74[_0x5a728c(0x165)](_0x5a728c(0x137))),saveSessionContext({'llm_project':_0x496dbe[_0x5a728c(0x17e)]},_0x3838c3[_0x5a728c(0x1bf)]),console[_0x5a728c(0x15c)](a4_0x58da74[_0x5a728c(0x165)](_0x5a728c(0x1b7)+a4_0x58da74[_0x5a728c(0x17f)](_0x5a728c(0x15b))+_0x5a728c(0x15e)+a4_0x58da74[_0x5a728c(0x18c)](_0x496dbe[_0x5a728c(0x17e)]))),0x0;if(!_0x902a38&&!_0x11bfa5){if(!isInteractive())return console[_0x5a728c(0x142)](a4_0x58da74[_0x5a728c(0x1dd)](_0x5a728c(0x1da)),_0x5a728c(0x161)),console[_0x5a728c(0x142)](a4_0x58da74[_0x5a728c(0x17f)](_0x5a728c(0x140))),0x1;const _0x5c9952=await confirmKey(_0x5a728c(0x13d)+(_0x57d136+_0x8907b9)+'\x20files?');if(!_0x5c9952)return console[_0x5a728c(0x15c)](a4_0x58da74[_0x5a728c(0x1d9)](_0x5a728c(0x1d8)),'-\x20no\x20files\x20written'),0x1;}const {data:_0x2a35f3}=await withSpinner('Writing\x20files...',()=>_0x37a1e0['llm'][_0x5a728c(0x1ca)](_0x202e40,_0xe0233f,{'force':_0x11bfa5}));return console[_0x5a728c(0x15c)](a4_0x58da74[_0x5a728c(0x165)](_0x5a728c(0x18d)+(_0x57d136+_0x8907b9)+'\x20files\x20to\x20'+_0x2a35f3[_0x5a728c(0x167)])),saveSessionContext({'llm_project':_0x2a35f3[_0x5a728c(0x17e)]},_0x3838c3[_0x5a728c(0x1bf)]),console['log'](a4_0x58da74[_0x5a728c(0x165)](_0x5a728c(0x1b7)+a4_0x58da74['dim'](_0x5a728c(0x15b))+_0x5a728c(0x15e)+a4_0x58da74[_0x5a728c(0x18c)](_0x2a35f3[_0x5a728c(0x17e)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{['name']='agent:clone';[a4_0x5ec1e0(0x1a0)]=a4_0x5ec1e0(0x187);async[a4_0x5ec1e0(0x19e)](_0x3d3186){const _0x2ae458=a4_0x5ec1e0,{options:_0x32e5c8,args:_0x566ed5,tdx:_0x4aee2e}=_0x3d3186,_0x378167=_0x566ed5[0x0],_0x2ea609=_0x32e5c8[_0x2ae458(0x1d0)],_0x149f35=_0x32e5c8['dryRun'],_0x32662e=_0x32e5c8[_0x2ae458(0x1cf)],_0x32442a=_0x32e5c8[_0x2ae458(0x19a)],_0x271635=_0x32e5c8['llmProject'];let _0x55b995;const _0x3eb008=findAgentConfigPath(process[_0x2ae458(0x139)]());if(_0x378167){const _0x47e25e=a4_0x168d65[_0x2ae458(0x178)](_0x378167,_0x2ae458(0x1ab));existsSync(_0x47e25e)?(_0x55b995=_0x378167,console[_0x2ae458(0x15c)](a4_0x58da74[_0x2ae458(0x17f)](_0x2ae458(0x1c7)+_0x378167))):_0x55b995=_0x378167;}else{if(_0x3eb008)_0x55b995=a4_0x168d65[_0x2ae458(0x133)](_0x3eb008),console['log'](a4_0x58da74[_0x2ae458(0x17f)](_0x2ae458(0x169)+_0x55b995));else{if(_0x271635){const _0x4c5713=sanitizeForFilesystem(_0x271635);let _0x43cb6a=_0x4c5713,_0x542344=a4_0x168d65[_0x2ae458(0x178)](process[_0x2ae458(0x139)](),_0x2ae458(0x14f),_0x4c5713,_0x2ae458(0x1ab));if(!existsSync(_0x542344)){const _0x1e6b34=normalizeName(_0x271635),_0x2561d4=a4_0x168d65[_0x2ae458(0x178)](process[_0x2ae458(0x139)](),_0x2ae458(0x14f),_0x1e6b34,'tdx.json');existsSync(_0x2561d4)&&(_0x43cb6a=_0x1e6b34,_0x542344=_0x2561d4);}if(existsSync(_0x542344))_0x55b995=a4_0x168d65[_0x2ae458(0x133)](_0x542344),console[_0x2ae458(0x15c)](a4_0x58da74[_0x2ae458(0x17f)](_0x2ae458(0x1c7)+_0x55b995));else{const _0x29109c=_0x32e5c8[_0x2ae458(0x1be)];if(_0x29109c)throw new SDKError(ErrorCode[_0x2ae458(0x1d6)],_0x2ae458(0x1c6)+_0x271635+_0x2ae458(0x1b5),undefined,{'helpText':_0x2ae458(0x18a)+_0x2ae458(0x18b)+(_0x2ae458(0x1d5)+_0x271635+'\x0a')+(_0x2ae458(0x1c1)+_0x43cb6a+_0x2ae458(0x163)+(_0x2ea609||_0x2ae458(0x177))+_0x2ae458(0x193)+_0x29109c)});_0x55b995=_0x271635,console[_0x2ae458(0x15c)](a4_0x58da74[_0x2ae458(0x17f)](_0x2ae458(0x195)+_0x271635));}}}}if(!_0x55b995)return console[_0x2ae458(0x15c)](a4_0x58da74[_0x2ae458(0x1d9)](_0x2ae458(0x1d1))),console[_0x2ae458(0x15c)](_0x2ae458(0x1ae)),console[_0x2ae458(0x15c)](_0x2ae458(0x1b3)),console[_0x2ae458(0x15c)](_0x2ae458(0x1c3)),console['log'](_0x2ae458(0x1b6)),0x1;if(!_0x2ea609)throw new SDKError(ErrorCode['MISSING_ARGUMENT'],'New\x20project\x20name\x20is\x20required',undefined,{'helpText':_0x2ae458(0x170)});if(!_0x32662e&&!_0x149f35){if(!isInteractive())return console['error'](a4_0x58da74[_0x2ae458(0x1dd)](_0x2ae458(0x1da)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x2ae458(0x142)](a4_0x58da74[_0x2ae458(0x17f)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x59add5=await confirmKey(_0x2ae458(0x160)+_0x55b995+_0x2ae458(0x19d)+_0x2ea609+'\x22?');if(!_0x59add5)return console[_0x2ae458(0x15c)](a4_0x58da74[_0x2ae458(0x1d9)](_0x2ae458(0x1d8))),0x1;}const {data:_0x1aa9ef}=await withSpinner(_0x2ae458(0x1de)+_0x55b995+_0x2ae458(0x17a)+_0x2ea609+_0x2ae458(0x1b0),()=>_0x4aee2e[_0x2ae458(0x132)][_0x2ae458(0x19c)](_0x55b995,_0x2ea609,{'dryRun':_0x149f35}));if(_0x149f35)return console[_0x2ae458(0x15c)](a4_0x58da74[_0x2ae458(0x1d9)](_0x2ae458(0x198))),console[_0x2ae458(0x15c)](_0x2ae458(0x171)+_0x1aa9ef[_0x2ae458(0x1bc)]),console[_0x2ae458(0x15c)](_0x2ae458(0x1a2)+_0x2ea609),console[_0x2ae458(0x15c)](_0x2ae458(0x174)),console[_0x2ae458(0x15c)](_0x2ae458(0x1ad)+_0x1aa9ef[_0x2ae458(0x1c4)][_0x2ae458(0x14f)][_0x2ae458(0x181)]),console[_0x2ae458(0x15c)](_0x2ae458(0x1b4)+_0x1aa9ef[_0x2ae458(0x1c4)]['knowledgeBases'][_0x2ae458(0x181)]),console[_0x2ae458(0x15c)]('\x20\x20Prompts:\x20'+_0x1aa9ef['counts'][_0x2ae458(0x189)][_0x2ae458(0x181)]),0x0;const _0x1396b6=_0x1aa9ef[_0x2ae458(0x1c4)][_0x2ae458(0x14f)]['errors']>0x0||_0x1aa9ef[_0x2ae458(0x1c4)][_0x2ae458(0x12f)][_0x2ae458(0x15f)]>0x0||_0x1aa9ef[_0x2ae458(0x1c4)]['prompts'][_0x2ae458(0x15f)]>0x0;_0x1396b6?console['log'](a4_0x58da74[_0x2ae458(0x1d9)](_0x2ae458(0x1a1))):console[_0x2ae458(0x15c)](a4_0x58da74[_0x2ae458(0x165)](_0x2ae458(0x175)));console[_0x2ae458(0x15c)](_0x2ae458(0x171)+_0x1aa9ef[_0x2ae458(0x1bc)]),console[_0x2ae458(0x15c)]('New\x20project:\x20'+_0x1aa9ef[_0x2ae458(0x145)]),console['log'](_0x2ae458(0x192)+_0x1aa9ef[_0x2ae458(0x19f)]),console[_0x2ae458(0x15c)](),console['log'](_0x2ae458(0x1bd)),console[_0x2ae458(0x15c)]('\x20\x20Agents:\x20'+formatCountSummary(_0x1aa9ef[_0x2ae458(0x1c4)][_0x2ae458(0x14f)])),console[_0x2ae458(0x15c)](_0x2ae458(0x1b4)+formatCountSummary(_0x1aa9ef[_0x2ae458(0x1c4)][_0x2ae458(0x12f)])),console[_0x2ae458(0x15c)](_0x2ae458(0x172)+formatCountSummary(_0x1aa9ef[_0x2ae458(0x1c4)]['prompts'])),console[_0x2ae458(0x15c)](_0x2ae458(0x16e)+formatCountSummary(_0x1aa9ef[_0x2ae458(0x1c4)][_0x2ae458(0x14a)]));if(_0x1396b6){console[_0x2ae458(0x15c)](),console[_0x2ae458(0x15c)](a4_0x58da74[_0x2ae458(0x1dd)](_0x2ae458(0x14e)));for(const _0x4b288a of _0x1aa9ef['agents']){_0x4b288a['action']===_0x2ae458(0x142)&&console['log'](a4_0x58da74[_0x2ae458(0x1dd)]('\x20\x20Agent\x20\x22'+_0x4b288a[_0x2ae458(0x151)]+_0x2ae458(0x148)+_0x4b288a['error']));}for(const _0x59c1fe of _0x1aa9ef['knowledgeBases']){_0x59c1fe[_0x2ae458(0x185)]===_0x2ae458(0x142)&&console[_0x2ae458(0x15c)](a4_0x58da74[_0x2ae458(0x1dd)]('\x20\x20Knowledge\x20Base\x20\x22'+_0x59c1fe['name']+_0x2ae458(0x148)+_0x59c1fe[_0x2ae458(0x142)]));}for(const _0x2f1099 of _0x1aa9ef[_0x2ae458(0x189)]){_0x2f1099[_0x2ae458(0x185)]==='error'&&console[_0x2ae458(0x15c)](a4_0x58da74['red'](_0x2ae458(0x1a4)+_0x2f1099[_0x2ae458(0x1d0)]+_0x2ae458(0x148)+_0x2f1099[_0x2ae458(0x142)]));}for(const _0x594481 of _0x1aa9ef['integrations']){_0x594481[_0x2ae458(0x185)]===_0x2ae458(0x142)&&console[_0x2ae458(0x15c)](a4_0x58da74['red'](_0x2ae458(0x1b2)+_0x594481['name']+_0x2ae458(0x148)+_0x594481[_0x2ae458(0x142)]));}return 0x1;}console['log']();const _0x5213a8=getLLMProjectUrl(_0x32442a,_0x1aa9ef[_0x2ae458(0x19f)]);return console[_0x2ae458(0x15c)]('Project:\x20'+a4_0x58da74['cyan'](_0x5213a8)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x5ec1e0(0x1d0)]=a4_0x5ec1e0(0x1a9);[a4_0x5ec1e0(0x1a0)]=a4_0x5ec1e0(0x149);async[a4_0x5ec1e0(0x19e)](_0x2a5944){const _0x4b28ff=a4_0x5ec1e0,{options:_0x6cd81,args:_0xcc4683,tdx:_0x514b5e}=_0x2a5944;let _0x4d4ce6=_0xcc4683[0x0]||process['cwd']();const _0x5c9cc6=_0x6cd81[_0x4b28ff(0x135)],_0x559814=_0x6cd81['force'],_0x3c7d72=_0x6cd81['yes'],_0x261dd3=_0x6cd81[_0x4b28ff(0x19a)],_0x5571d0=a4_0x168d65['join'](_0x4d4ce6,_0x4b28ff(0x168)),_0x5bbec5=existsSync(_0x5571d0);if(_0x5bbec5){const {data:_0x4e1bd2}=await withSpinner(_0x4b28ff(0x1a6)+_0x4d4ce6+_0x4b28ff(0x1b0),()=>_0x514b5e[_0x4b28ff(0x132)]['pushAgent'](_0x4d4ce6,{'dryRun':_0x5c9cc6,'force':_0x559814}));if(_0x5c9cc6)return console[_0x4b28ff(0x15c)](a4_0x58da74[_0x4b28ff(0x1d9)](_0x4b28ff(0x198))),console[_0x4b28ff(0x15c)](_0x4b28ff(0x194)+_0x4e1bd2[_0x4b28ff(0x151)]),0x0;if(_0x4e1bd2[_0x4b28ff(0x185)]==='error')return console[_0x4b28ff(0x15c)](a4_0x58da74['red'](_0x4b28ff(0x188)+_0x4e1bd2[_0x4b28ff(0x142)])),0x1;console[_0x4b28ff(0x15c)](a4_0x58da74[_0x4b28ff(0x165)](_0x4b28ff(0x153)+_0x4e1bd2['action']+_0x4b28ff(0x15d))),console[_0x4b28ff(0x15c)]('Agent:\x20'+_0x4e1bd2[_0x4b28ff(0x151)]);if(_0x4e1bd2[_0x4b28ff(0x191)]&&_0x4e1bd2['projectId']){const _0x58120c=getLLMAgentChatUrl(_0x261dd3,_0x4e1bd2[_0x4b28ff(0x18e)],_0x4e1bd2[_0x4b28ff(0x191)]);console[_0x4b28ff(0x15c)](_0x4b28ff(0x18f)+a4_0x58da74[_0x4b28ff(0x18c)](_0x58120c));}return 0x0;}const _0x256c2e=_0x6cd81['llmProject'],_0x3d6e50=resolveProjectFromContext(_0x4d4ce6,_0x256c2e);if(_0x3d6e50[_0x4b28ff(0x184)])_0x4d4ce6=_0x3d6e50['projectDir'],_0x3d6e50[_0x4b28ff(0x130)]===_0x4b28ff(0x15a)&&console[_0x4b28ff(0x15c)](a4_0x58da74['dim'](_0x4b28ff(0x1cb)+_0x4d4ce6));else{let _0x59be13=_0x4b28ff(0x183);_0x3d6e50[_0x4b28ff(0x17c)]==='no_local_folder'&&(_0x59be13=_0x3d6e50[_0x4b28ff(0x176)]+_0x4b28ff(0x1cc)+_0x3d6e50[_0x4b28ff(0x1b1)]+'\x27\x20to\x20create\x20the\x20folder\x20structure.');throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x3d6e50['reason']===_0x4b28ff(0x138)?_0x3d6e50[_0x4b28ff(0x176)]:'No\x20tdx.json\x20found\x20in\x20'+_0x4d4ce6,undefined,{'helpText':_0x59be13});}const {data:_0x564ab7}=await withSpinner(_0x4b28ff(0x16f),()=>_0x514b5e['llm'][_0x4b28ff(0x13a)](_0x4d4ce6,{'dryRun':!![]})),_0x5e91aa=_0x564ab7[_0x4b28ff(0x1c4)][_0x4b28ff(0x14f)][_0x4b28ff(0x15f)]>0x0;if(_0x5e91aa){console[_0x4b28ff(0x15c)](a4_0x58da74[_0x4b28ff(0x1dd)](_0x4b28ff(0x154)));for(const _0xaadde4 of _0x564ab7['agents']){_0xaadde4[_0x4b28ff(0x185)]==='error'&&console[_0x4b28ff(0x15c)](a4_0x58da74['red'](_0x4b28ff(0x1bb)+_0xaadde4[_0x4b28ff(0x151)]+_0x4b28ff(0x148)+_0xaadde4[_0x4b28ff(0x142)]));}return 0x1;}const _0x3a23b3=_0x564ab7[_0x4b28ff(0x1c4)][_0x4b28ff(0x14f)][_0x4b28ff(0x181)]+_0x564ab7[_0x4b28ff(0x1c4)][_0x4b28ff(0x12f)][_0x4b28ff(0x181)]+_0x564ab7[_0x4b28ff(0x1c4)][_0x4b28ff(0x166)][_0x4b28ff(0x181)]+_0x564ab7[_0x4b28ff(0x1c4)][_0x4b28ff(0x189)][_0x4b28ff(0x181)]+_0x564ab7[_0x4b28ff(0x1c4)][_0x4b28ff(0x14a)][_0x4b28ff(0x181)],_0x3de129=_0x564ab7[_0x4b28ff(0x1c4)][_0x4b28ff(0x14f)][_0x4b28ff(0x147)]+_0x564ab7[_0x4b28ff(0x1c4)]['knowledgeBases'][_0x4b28ff(0x147)]+_0x564ab7[_0x4b28ff(0x1c4)][_0x4b28ff(0x166)][_0x4b28ff(0x147)]+_0x564ab7[_0x4b28ff(0x1c4)][_0x4b28ff(0x189)]['updated']+_0x564ab7['counts'][_0x4b28ff(0x14a)][_0x4b28ff(0x147)],_0x58616b=_0x564ab7[_0x4b28ff(0x1c4)]['agents'][_0x4b28ff(0x162)]+_0x564ab7[_0x4b28ff(0x1c4)][_0x4b28ff(0x12f)][_0x4b28ff(0x162)]+_0x564ab7['counts']['textKnowledgeBases']['unchanged']+_0x564ab7[_0x4b28ff(0x1c4)][_0x4b28ff(0x189)][_0x4b28ff(0x162)]+_0x564ab7[_0x4b28ff(0x1c4)][_0x4b28ff(0x14a)][_0x4b28ff(0x162)];console[_0x4b28ff(0x15c)]('\x0aPush\x20summary\x20for\x20\x27'+_0x564ab7[_0x4b28ff(0x17e)]+'\x27:'),console[_0x4b28ff(0x15c)]('\x20\x20'+a4_0x58da74[_0x4b28ff(0x165)]('+\x20'+_0x3a23b3+_0x4b28ff(0x1b8))+_0x4b28ff(0x182)+a4_0x58da74[_0x4b28ff(0x1d9)]('~\x20'+_0x3de129+_0x4b28ff(0x152))+_0x4b28ff(0x182)+a4_0x58da74[_0x4b28ff(0x17f)]('=\x20'+_0x58616b+_0x4b28ff(0x136))),console['log'](_0x4b28ff(0x1ad)+formatCountSummary(_0x564ab7['counts'][_0x4b28ff(0x14f)])),console[_0x4b28ff(0x15c)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x564ab7[_0x4b28ff(0x1c4)]['knowledgeBases'])),console['log'](_0x4b28ff(0x1ac)+formatCountSummary(_0x564ab7[_0x4b28ff(0x1c4)][_0x4b28ff(0x166)])),console[_0x4b28ff(0x15c)](_0x4b28ff(0x172)+formatCountSummary(_0x564ab7[_0x4b28ff(0x1c4)]['prompts'])),console[_0x4b28ff(0x15c)](_0x4b28ff(0x16e)+formatCountSummary(_0x564ab7[_0x4b28ff(0x1c4)][_0x4b28ff(0x14a)])),console['log'](_0x4b28ff(0x157)+a4_0x58da74[_0x4b28ff(0x18c)](_0x4d4ce6)),displayDiffs(_0x564ab7[_0x4b28ff(0x14f)],_0x564ab7['knowledgeBases'],_0x564ab7[_0x4b28ff(0x166)],_0x564ab7[_0x4b28ff(0x189)],_0x564ab7['integrations']);if(_0x5c9cc6)return console[_0x4b28ff(0x15c)](a4_0x58da74['yellow'](_0x4b28ff(0x164))),0x0;if(_0x3a23b3===0x0&&_0x3de129===0x0){console['log'](a4_0x58da74['green'](_0x4b28ff(0x13e)));const _0x58baee=getLLMProjectUrl(_0x261dd3,_0x564ab7[_0x4b28ff(0x18e)]);return console[_0x4b28ff(0x15c)](_0x4b28ff(0x1af)+a4_0x58da74[_0x4b28ff(0x18c)](_0x58baee)),0x0;}if(!_0x3c7d72&&!_0x559814){if(!isInteractive())return console['error'](a4_0x58da74['red'](_0x4b28ff(0x1da)),_0x4b28ff(0x161)),console['error'](a4_0x58da74['dim'](_0x4b28ff(0x140))),0x1;const _0x1b4d4f=await confirmKey('\x0aPush\x20'+(_0x3a23b3+_0x3de129)+'\x20resources?');if(!_0x1b4d4f)return console[_0x4b28ff(0x15c)](a4_0x58da74[_0x4b28ff(0x1d9)](_0x4b28ff(0x1d8)),_0x4b28ff(0x1c5)),0x1;}const {data:_0x143d54}=await withSpinner('Pushing\x20to\x20project...',()=>_0x514b5e['llm']['pushProject'](_0x4d4ce6,{'force':_0x559814})),_0x13228f=_0x143d54[_0x4b28ff(0x1c4)][_0x4b28ff(0x14f)][_0x4b28ff(0x15f)]>0x0||_0x143d54[_0x4b28ff(0x1c4)]['knowledgeBases'][_0x4b28ff(0x15f)]>0x0||_0x143d54[_0x4b28ff(0x1c4)]['textKnowledgeBases'][_0x4b28ff(0x15f)]>0x0||_0x143d54[_0x4b28ff(0x1c4)][_0x4b28ff(0x189)][_0x4b28ff(0x15f)]>0x0;if(_0x13228f){console[_0x4b28ff(0x15c)](a4_0x58da74[_0x4b28ff(0x1d9)](_0x4b28ff(0x186))),console[_0x4b28ff(0x15c)](),console[_0x4b28ff(0x15c)](a4_0x58da74['red'](_0x4b28ff(0x14e)));for(const _0x3fe045 of _0x143d54['agents']){_0x3fe045[_0x4b28ff(0x185)]===_0x4b28ff(0x142)&&console[_0x4b28ff(0x15c)](a4_0x58da74[_0x4b28ff(0x1dd)]('\x20\x20Agent\x20\x22'+_0x3fe045[_0x4b28ff(0x151)]+_0x4b28ff(0x148)+_0x3fe045[_0x4b28ff(0x142)]));}for(const _0xf7f144 of _0x143d54[_0x4b28ff(0x12f)]){_0xf7f144[_0x4b28ff(0x185)]===_0x4b28ff(0x142)&&console[_0x4b28ff(0x15c)](a4_0x58da74[_0x4b28ff(0x1dd)](_0x4b28ff(0x1cd)+_0xf7f144[_0x4b28ff(0x1d0)]+_0x4b28ff(0x148)+_0xf7f144['error']));}for(const _0x246194 of _0x143d54['textKnowledgeBases']){_0x246194[_0x4b28ff(0x185)]==='error'&&console[_0x4b28ff(0x15c)](a4_0x58da74['red'](_0x4b28ff(0x1d4)+_0x246194['name']+_0x4b28ff(0x148)+_0x246194['error']));}for(const _0x51223e of _0x143d54[_0x4b28ff(0x189)]){_0x51223e[_0x4b28ff(0x185)]===_0x4b28ff(0x142)&&console[_0x4b28ff(0x15c)](a4_0x58da74[_0x4b28ff(0x1dd)]('\x20\x20Prompt\x20\x22'+_0x51223e[_0x4b28ff(0x1d0)]+'\x22:\x20'+_0x51223e[_0x4b28ff(0x142)]));}for(const _0x3da699 of _0x143d54[_0x4b28ff(0x14a)]){_0x3da699[_0x4b28ff(0x185)]===_0x4b28ff(0x142)&&console[_0x4b28ff(0x15c)](a4_0x58da74[_0x4b28ff(0x1dd)](_0x4b28ff(0x1b2)+_0x3da699[_0x4b28ff(0x1d0)]+_0x4b28ff(0x148)+_0x3da699[_0x4b28ff(0x142)]));}return 0x1;}console[_0x4b28ff(0x15c)](a4_0x58da74[_0x4b28ff(0x165)](_0x4b28ff(0x1db)+(_0x3a23b3+_0x3de129)+_0x4b28ff(0x143)+_0x143d54[_0x4b28ff(0x17e)]+'\x27'));const _0x361662=getLLMProjectUrl(_0x261dd3,_0x143d54['projectId']);return console[_0x4b28ff(0x15c)](_0x4b28ff(0x1af)+a4_0x58da74['cyan'](_0x361662)),0x0;}}
@@ -1 +1 @@
1
- function a5_0x1dc3(_0x3e3492,_0x5bf1b9){_0x3e3492=_0x3e3492-0x106;const _0x6779c=a5_0x6779();let _0x1dc33c=_0x6779c[_0x3e3492];return _0x1dc33c;}const a5_0x42b6a6=a5_0x1dc3;(function(_0x1c4eae,_0xf34443){const _0x13b155=a5_0x1dc3,_0x3e5035=_0x1c4eae();while(!![]){try{const _0xc87fe2=-parseInt(_0x13b155(0x160))/0x1+-parseInt(_0x13b155(0x179))/0x2*(parseInt(_0x13b155(0x18b))/0x3)+-parseInt(_0x13b155(0x161))/0x4+parseInt(_0x13b155(0x158))/0x5*(-parseInt(_0x13b155(0x109))/0x6)+-parseInt(_0x13b155(0x142))/0x7*(parseInt(_0x13b155(0x19b))/0x8)+-parseInt(_0x13b155(0x119))/0x9+parseInt(_0x13b155(0x13a))/0xa;if(_0xc87fe2===_0xf34443)break;else _0x3e5035['push'](_0x3e5035['shift']());}catch(_0x2c6762){_0x3e5035['push'](_0x3e5035['shift']());}}}(a5_0x6779,0x2bc7b));import*as a5_0x3f2115 from'node:fs';import*as a5_0x3ee9e9 from'node:path';import a5_0x58b6d3 from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{['name']=a5_0x42b6a6(0x12b);[a5_0x42b6a6(0x180)]='Run\x20tests\x20for\x20an\x20LLM\x20agent';async[a5_0x42b6a6(0x133)](_0x32f76f){const _0x2689ec=a5_0x42b6a6,{options:_0x3afdc5,args:_0x2d7e51,tdx:_0x18aad8}=_0x32f76f,_0x195f7d=_0x2d7e51[0x0]||'.',_0x109d7c=_0x3afdc5[_0x2689ec(0x16e)],_0x607a4=_0x3afdc5,_0x493fba=_0x607a4[_0x2689ec(0x16a)]===![],_0x41b4d4=_0x607a4[_0x2689ec(0x13e)],_0x55273e=_0x607a4[_0x2689ec(0x107)],_0x4e1dca=_0x607a4[_0x2689ec(0x150)],_0x3aa335=_0x3afdc5[_0x2689ec(0x13b)],_0x25fe94=_0x607a4[_0x2689ec(0x186)];if(_0x41b4d4&&_0x493fba)return console[_0x2689ec(0x106)](a5_0x58b6d3[_0x2689ec(0x118)]('Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval')),0x1;let _0x1f565e=_0x2689ec(0x134);if(_0x607a4[_0x2689ec(0x113)])_0x1f565e=_0x2689ec(0x113);else{if(_0x607a4[_0x2689ec(0x137)])_0x1f565e=_0x2689ec(0x137);else{if(_0x607a4[_0x2689ec(0x163)])_0x1f565e=_0x2689ec(0x163);else{if(_0x607a4[_0x2689ec(0x134)])_0x1f565e=_0x2689ec(0x134);}}}const _0x3ab7e2=_0x607a4[_0x2689ec(0x12e)];let _0x1a1051=_0x195f7d;const _0xbbbc34=a5_0x3f2115[_0x2689ec(0x185)](_0x195f7d),_0xd472b=_0x195f7d==='.';if(!_0xbbbc34||_0xd472b){const _0x380f05=resolveProjectFromContext(_0x195f7d,_0x3ab7e2,{'requireFile':_0x2689ec(0x121)});if(_0x380f05[_0x2689ec(0x18a)])_0x1a1051=_0x380f05['projectDir'],_0x380f05['source']==='context'&&console[_0x2689ec(0x106)](a5_0x58b6d3['dim'](_0x2689ec(0x13c)+_0x1a1051));else switch(_0x380f05[_0x2689ec(0x146)]){case'no_context':console[_0x2689ec(0x106)](a5_0x58b6d3['yellow'](_0x380f05[_0x2689ec(0x17d)])),console[_0x2689ec(0x106)](),console['log'](_0x2689ec(0x19e)),console[_0x2689ec(0x106)]('\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[_0x2689ec(0x106)](_0x2689ec(0x178)),console[_0x2689ec(0x106)](),console[_0x2689ec(0x106)](_0x2689ec(0x12d));return 0x1;case _0x2689ec(0x15c):console[_0x2689ec(0x106)](a5_0x58b6d3['yellow'](_0x380f05[_0x2689ec(0x17d)])),console[_0x2689ec(0x106)](),console[_0x2689ec(0x106)]('Run\x20\x27tdx\x20agent\x20pull\x20'+_0x380f05[_0x2689ec(0x12e)]+_0x2689ec(0x12f));return 0x1;case _0x2689ec(0x148):{const _0x2203c7=a5_0x3ee9e9[_0x2689ec(0x128)](_0x380f05[_0x2689ec(0x14f)]);console[_0x2689ec(0x106)](a5_0x58b6d3[_0x2689ec(0x18c)](_0x2689ec(0x14b)+_0x380f05[_0x2689ec(0x12e)]+'\x22:'));for(const _0x5ebd3e of _0x380f05['agentDirs']){console[_0x2689ec(0x106)]('\x20\x20-\x20'+_0x5ebd3e);}return console[_0x2689ec(0x106)](),console[_0x2689ec(0x106)](_0x2689ec(0x114)+_0x2203c7+_0x2689ec(0x196)),0x1;}case _0x2689ec(0x13d):console['log'](a5_0x58b6d3['yellow'](_0x2689ec(0x14d)+_0x380f05[_0x2689ec(0x12e)]+'\x22.')),console[_0x2689ec(0x106)](a5_0x58b6d3[_0x2689ec(0x170)](_0x2689ec(0x15b)+_0x380f05[_0x2689ec(0x14f)])),console[_0x2689ec(0x106)](),console[_0x2689ec(0x106)]('Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.');return 0x1;}}const {definition:_0x1094ae,agentInfo:_0x8e8991}=parseTestFile(_0x1a1051);let _0x5aca99=_0x1094ae[_0x2689ec(0x16c)];if(_0x55273e){const _0x4003c0=_0x55273e[_0x2689ec(0x187)](',')['map'](_0x531ea5=>_0x531ea5[_0x2689ec(0x132)]());_0x5aca99=_0x1094ae['tests'][_0x2689ec(0x12a)](_0x1ba125=>_0x4003c0['includes'](_0x1ba125[_0x2689ec(0x107)]));if(_0x5aca99[_0x2689ec(0x17e)]===0x0)return console['log'](a5_0x58b6d3[_0x2689ec(0x18c)](_0x2689ec(0x10d)+_0x55273e)),console['log'](a5_0x58b6d3['dim'](_0x2689ec(0x19a)+_0x1094ae[_0x2689ec(0x16c)][_0x2689ec(0x175)](_0x5653f4=>_0x5653f4[_0x2689ec(0x107)])[_0x2689ec(0x111)](',\x20'))),0x1;}if(_0x4e1dca){const _0x266be3=_0x4e1dca[_0x2689ec(0x187)](',')[_0x2689ec(0x175)](_0x495028=>_0x495028[_0x2689ec(0x132)]()[_0x2689ec(0x189)]());_0x5aca99=_0x5aca99[_0x2689ec(0x12a)](_0x5abcb9=>_0x5abcb9[_0x2689ec(0x150)]?.[_0x2689ec(0x192)](_0x358cc3=>_0x266be3['includes'](_0x358cc3['toLowerCase']())));if(_0x5aca99[_0x2689ec(0x17e)]===0x0){console['log'](a5_0x58b6d3[_0x2689ec(0x18c)]('No\x20tests\x20found\x20with\x20tags:\x20'+_0x4e1dca));const _0x320076=new Set();return _0x1094ae['tests'][_0x2689ec(0x125)](_0x236399=>_0x236399[_0x2689ec(0x150)]?.[_0x2689ec(0x125)](_0x391623=>_0x320076['add'](_0x391623))),_0x320076[_0x2689ec(0x166)]>0x0?console[_0x2689ec(0x106)](a5_0x58b6d3[_0x2689ec(0x170)]('Available\x20tags:\x20'+[..._0x320076][_0x2689ec(0x111)](',\x20'))):console[_0x2689ec(0x106)](a5_0x58b6d3[_0x2689ec(0x170)](_0x2689ec(0x184))),0x1;}}if(_0x41b4d4)return this[_0x2689ec(0x127)](_0x32f76f,{'definition':{'tests':_0x5aca99},'agentInfo':_0x8e8991,'outputFormat':_0x1f565e,'outputFile':_0x25fe94,'testNames':_0x55273e});if(_0x109d7c){console[_0x2689ec(0x106)](a5_0x58b6d3[_0x2689ec(0x168)](_0x2689ec(0x153))),console['log'](_0x2689ec(0x164)+a5_0x58b6d3['white'](_0x3aa335)),console[_0x2689ec(0x106)]('\x20\x20Project:\x20'+a5_0x58b6d3[_0x2689ec(0x176)](_0x8e8991[_0x2689ec(0x11b)])),console[_0x2689ec(0x106)](_0x2689ec(0x110)+a5_0x58b6d3[_0x2689ec(0x176)](_0x8e8991[_0x2689ec(0x18e)])),console[_0x2689ec(0x106)](),console[_0x2689ec(0x106)]('Tests\x20found:\x20'+a5_0x58b6d3[_0x2689ec(0x176)](_0x5aca99[_0x2689ec(0x17e)]));for(let _0x1736ab=0x0;_0x1736ab<_0x5aca99[_0x2689ec(0x17e)];_0x1736ab++){const _0x420e1f=_0x5aca99[_0x1736ab],_0x25db4b=_0x420e1f[_0x2689ec(0x19d)][_0x2689ec(0x17e)]===0x1?_0x2689ec(0x10e):_0x2689ec(0x19d),_0x31e5e8=_0x420e1f[_0x2689ec(0x150)]?.['length']?'\x20['+_0x420e1f['tags']['join'](',\x20')+']':'';console[_0x2689ec(0x106)]('\x20\x20'+(_0x1736ab+0x1)+'.\x20'+a5_0x58b6d3[_0x2689ec(0x176)](_0x420e1f[_0x2689ec(0x107)])+'\x20('+_0x420e1f[_0x2689ec(0x19d)][_0x2689ec(0x17e)]+'\x20'+_0x25db4b+')'+a5_0x58b6d3[_0x2689ec(0x170)](_0x31e5e8));}return 0x0;}let _0x383fa7,_0x3f4c86;try{_0x383fa7=await _0x18aad8['llm']['resolveProjectId'](_0x8e8991[_0x2689ec(0x11b)]);}catch(_0x5b3de3){const _0x129825=_0x5b3de3 instanceof Error?_0x5b3de3[_0x2689ec(0x17d)]:String(_0x5b3de3);return _0x129825[_0x2689ec(0x157)](_0x2689ec(0x16b))||_0x129825[_0x2689ec(0x189)]()[_0x2689ec(0x157)](_0x2689ec(0x117))?console[_0x2689ec(0x106)](a5_0x58b6d3[_0x2689ec(0x118)](_0x2689ec(0x17c)+_0x8e8991[_0x2689ec(0x11b)])):console[_0x2689ec(0x106)](a5_0x58b6d3[_0x2689ec(0x118)](_0x2689ec(0x126)+_0x8e8991[_0x2689ec(0x11b)]+_0x2689ec(0x11e)+_0x129825)),0x1;}try{_0x3f4c86=await _0x18aad8['llm'][_0x2689ec(0x177)](_0x8e8991[_0x2689ec(0x18e)],_0x383fa7);}catch(_0x266e00){const _0x1ba93a=_0x266e00 instanceof Error?_0x266e00[_0x2689ec(0x17d)]:String(_0x266e00);return _0x1ba93a[_0x2689ec(0x157)](_0x2689ec(0x16b))||_0x1ba93a[_0x2689ec(0x189)]()[_0x2689ec(0x157)](_0x2689ec(0x117))?console[_0x2689ec(0x106)](a5_0x58b6d3['red'](_0x2689ec(0x18f)+_0x8e8991[_0x2689ec(0x18e)])):console[_0x2689ec(0x106)](a5_0x58b6d3['red'](_0x2689ec(0x181)+_0x8e8991['agentName']+_0x2689ec(0x11e)+_0x1ba93a)),0x1;}let _0x353124;if(!_0x493fba)try{_0x353124=await setupEvaluatorAgent(_0x18aad8[_0x2689ec(0x194)],_0x3afdc5[_0x2689ec(0x10c)]);}catch(_0x48cb30){const _0x31f46c=_0x48cb30 instanceof Error?_0x48cb30[_0x2689ec(0x17d)]:String(_0x48cb30);return console[_0x2689ec(0x106)](a5_0x58b6d3[_0x2689ec(0x118)]('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x31f46c)),0x1;}console[_0x2689ec(0x106)](a5_0x58b6d3['cyan'](_0x2689ec(0x130))),console[_0x2689ec(0x106)](_0x2689ec(0x15e)+a5_0x58b6d3[_0x2689ec(0x176)](_0x3aa335)),console[_0x2689ec(0x106)](_0x2689ec(0x16d)+a5_0x58b6d3['white'](_0x8e8991[_0x2689ec(0x11b)]+'/'+_0x8e8991[_0x2689ec(0x18e)])),console[_0x2689ec(0x106)]();const _0x580bf9=[],_0x97cd87=[],_0x35458d=Date[_0x2689ec(0x14a)]();for(let _0x1ad4f4=0x0;_0x1ad4f4<_0x5aca99[_0x2689ec(0x17e)];_0x1ad4f4++){const _0x26d6b9=_0x5aca99[_0x1ad4f4];_0x5aca99[_0x2689ec(0x17e)]>0x1?console['log'](_0x2689ec(0x10b)+(_0x1ad4f4+0x1)+'/'+_0x5aca99['length']+':\x20'+a5_0x58b6d3[_0x2689ec(0x176)](_0x26d6b9[_0x2689ec(0x107)])):console[_0x2689ec(0x106)](_0x2689ec(0x138)+a5_0x58b6d3['white'](_0x26d6b9['name']));const _0x45d406=createCommandSpinner(_0x2689ec(0x162)+_0x26d6b9[_0x2689ec(0x19d)][_0x2689ec(0x17e)]+':\x20Sending\x20user\x20input...');_0x45d406[_0x2689ec(0x169)]();try{const {result:_0x69a724,conversation:_0x56f81b}=await runTest(_0x18aad8['llm'],_0x26d6b9,{'agentId':_0x3f4c86,'projectId':_0x383fa7,'site':_0x3aa335,'noEval':_0x493fba,'evaluatorId':_0x353124,'onRoundStart':(_0x49efd6,_0x4e68e2)=>{const _0x1963ba=_0x2689ec;_0x45d406[_0x1963ba(0x123)]=_0x1963ba(0x188)+(_0x49efd6+0x1)+'/'+_0x4e68e2+_0x1963ba(0x182);},'onRoundComplete':(_0x59026a,_0x157901,_0x57ad00)=>{const _0x116f5b=_0x2689ec,_0x470f53=formatElapsed(_0x157901);_0x57ad00?console[_0x116f5b(0x106)](_0x116f5b(0x108)+(_0x59026a+0x1)+'/'+_0x26d6b9[_0x116f5b(0x19d)][_0x116f5b(0x17e)]+'...\x20'+a5_0x58b6d3[_0x116f5b(0x19c)]('✓')+'\x20('+_0x470f53+')'):console[_0x116f5b(0x106)]('\x20\x20Round\x20'+(_0x59026a+0x1)+'/'+_0x26d6b9[_0x116f5b(0x19d)][_0x116f5b(0x17e)]+_0x116f5b(0x140)+a5_0x58b6d3[_0x116f5b(0x118)]('✗'));},'onEvaluationStart':()=>{const _0x894164=_0x2689ec;_0x45d406[_0x894164(0x123)]='Evaluating\x20response...';},'onEvaluationComplete':_0x88e4fb=>{const _0x3d02bd=_0x2689ec,_0x4387ac=formatElapsed(_0x88e4fb);console['log'](_0x3d02bd(0x10f)+a5_0x58b6d3[_0x3d02bd(0x19c)]('✓')+'\x20('+_0x4387ac+')');}});_0x45d406[_0x2689ec(0x171)](),_0x580bf9[_0x2689ec(0x120)](_0x69a724),_0x97cd87[_0x2689ec(0x120)](_0x56f81b);if(_0x69a724[_0x2689ec(0x145)]===_0x2689ec(0x19f))console[_0x2689ec(0x106)](a5_0x58b6d3['green'](_0x2689ec(0x141)+_0x69a724[_0x2689ec(0x146)]));else _0x69a724[_0x2689ec(0x145)]==='FAIL'?console[_0x2689ec(0x106)](a5_0x58b6d3['red']('✗\x20FAIL:\x20'+_0x69a724[_0x2689ec(0x146)])):console[_0x2689ec(0x106)](a5_0x58b6d3['red'](_0x2689ec(0x135)+_0x69a724[_0x2689ec(0x146)]));_0x69a724[_0x2689ec(0x12c)]&&console[_0x2689ec(0x106)](a5_0x58b6d3['dim'](_0x2689ec(0x11d)+_0x69a724[_0x2689ec(0x12c)])),console[_0x2689ec(0x106)]();}catch(_0x3b0fa5){_0x45d406[_0x2689ec(0x171)]();const _0xe81d1=_0x3b0fa5 instanceof Error?_0x3b0fa5[_0x2689ec(0x17d)]:String(_0x3b0fa5);console[_0x2689ec(0x106)](a5_0x58b6d3[_0x2689ec(0x118)]('✗\x20ERROR:\x20'+_0xe81d1)),console[_0x2689ec(0x106)](),_0x580bf9[_0x2689ec(0x120)]({'name':_0x26d6b9[_0x2689ec(0x107)],'status':_0x2689ec(0x17f),'reason':_0xe81d1,'timestamp':new Date()[_0x2689ec(0x152)](),'duration_ms':0x0});}}const _0x35a566=Date[_0x2689ec(0x14a)]()-_0x35458d,_0x21334e=_0x580bf9['filter'](_0x330462=>_0x330462[_0x2689ec(0x145)]===_0x2689ec(0x19f))[_0x2689ec(0x17e)],_0x510f04=_0x580bf9[_0x2689ec(0x12a)](_0x15c208=>_0x15c208[_0x2689ec(0x145)]===_0x2689ec(0x131))[_0x2689ec(0x17e)],_0x376782=_0x580bf9[_0x2689ec(0x12a)](_0x39a315=>_0x39a315[_0x2689ec(0x145)]===_0x2689ec(0x17f))[_0x2689ec(0x17e)];console['log']('━'['repeat'](0x3c)),console[_0x2689ec(0x106)]('Test\x20Summary'),console[_0x2689ec(0x106)]('━'[_0x2689ec(0x18d)](0x3c)),console['log']('Total:\x20\x20\x20\x20'+_0x580bf9[_0x2689ec(0x17e)]),console[_0x2689ec(0x106)]('Passed:\x20\x20\x20'+a5_0x58b6d3[_0x2689ec(0x19c)](_0x21334e)),console[_0x2689ec(0x106)]('Failed:\x20\x20\x20'+a5_0x58b6d3[_0x2689ec(0x118)](_0x510f04));_0x376782>0x0&&console[_0x2689ec(0x106)](_0x2689ec(0x156)+a5_0x58b6d3[_0x2689ec(0x118)](_0x376782));console[_0x2689ec(0x106)](_0x2689ec(0x183)+formatElapsed(_0x35a566)),console[_0x2689ec(0x106)]('━'[_0x2689ec(0x18d)](0x3c));const _0x51db9f=_0x580bf9[_0x2689ec(0x12a)](_0x24d7e6=>_0x24d7e6['status']!==_0x2689ec(0x19f));if(_0x51db9f[_0x2689ec(0x17e)]>0x0){console[_0x2689ec(0x106)](),console['log'](_0x2689ec(0x147));for(const _0x3970f4 of _0x51db9f){const _0x1f6a33=a5_0x58b6d3[_0x2689ec(0x118)]('✗'),_0x29c02f=_0x3970f4['reason'][_0x2689ec(0x17e)]>0x32?_0x3970f4[_0x2689ec(0x146)]['substring'](0x0,0x32)+_0x2689ec(0x1a0):_0x3970f4[_0x2689ec(0x146)];console['log']('\x20\x20'+_0x1f6a33+'\x20'+_0x3970f4['name']+':\x20'+_0x29c02f);}}const _0x5d8327={'summary':{'total':_0x580bf9['length'],'passed':_0x21334e,'failed':_0x510f04,'errors':_0x376782>0x0?_0x376782:undefined,'duration_ms':_0x35a566},'tests':_0x580bf9,'agent':{'project':_0x8e8991[_0x2689ec(0x11b)],'name':_0x8e8991[_0x2689ec(0x18e)],'site':_0x3aa335},'timestamp':new Date(_0x35458d)[_0x2689ec(0x152)]()};try{const _0x3f539f=buildCachedTestRun(_0x97cd87,{'site':_0x3aa335,'projectId':_0x383fa7,'projectName':_0x8e8991[_0x2689ec(0x11b)],'agentId':_0x3f4c86,'agentName':_0x8e8991[_0x2689ec(0x18e)],'testYmlPath':a5_0x3ee9e9[_0x2689ec(0x116)](_0x8e8991[_0x2689ec(0x139)])});saveLastTestRun(_0x3f539f);}catch{}if(_0x1f565e!==_0x2689ec(0x134)||_0x25fe94){const _0x28b5c3=formatResults(_0x5d8327,_0x1f565e);if(_0x25fe94)try{a5_0x3f2115[_0x2689ec(0x154)](_0x25fe94,_0x28b5c3,_0x2689ec(0x14c)),console[_0x2689ec(0x106)](),console['log'](a5_0x58b6d3[_0x2689ec(0x170)](_0x2689ec(0x15a)+_0x25fe94));}catch(_0x386f46){return console['log'](),console['log'](a5_0x58b6d3[_0x2689ec(0x118)](_0x2689ec(0x17b)+_0x386f46)),0x1;}else console['log'](),console[_0x2689ec(0x106)](_0x28b5c3);}return _0x51db9f[_0x2689ec(0x17e)]>0x0?0x1:0x0;}async['executeReeval'](_0x4dc82d,_0x53b31b){const _0x3c78cd=a5_0x42b6a6,{options:_0x986c4d,tdx:_0x4d0570}=_0x4dc82d,{definition:_0x4e699b,agentInfo:_0x3e5b94,outputFormat:_0x2560f4,outputFile:_0x14aa7f}=_0x53b31b,_0x27aeb3=_0x986c4d[_0x3c78cd(0x13b)],_0x433a35=loadLastTestRun();if(!_0x433a35)return console[_0x3c78cd(0x106)](a5_0x58b6d3['red'](_0x3c78cd(0x11f))),console[_0x3c78cd(0x106)](a5_0x58b6d3['dim'](_0x3c78cd(0x15d))),0x1;if(_0x433a35['agent'][_0x3c78cd(0x18e)]!==_0x3e5b94[_0x3c78cd(0x18e)])return console['log'](a5_0x58b6d3[_0x3c78cd(0x118)](_0x3c78cd(0x172)+_0x433a35['agent']['agentName']+_0x3c78cd(0x198)+_0x3e5b94['agentName']+'\x22.')),console[_0x3c78cd(0x106)](a5_0x58b6d3[_0x3c78cd(0x170)](_0x3c78cd(0x167))),0x1;const _0x438c5c=new Set(_0x433a35[_0x3c78cd(0x149)]['map'](_0x3ba256=>_0x3ba256[_0x3c78cd(0x151)])),_0x78cb30=_0x4e699b['tests'][_0x3c78cd(0x12a)](_0x4432e9=>!_0x438c5c[_0x3c78cd(0x165)](_0x4432e9[_0x3c78cd(0x107)]));if(_0x78cb30[_0x3c78cd(0x17e)]>0x0&&_0x433a35[_0x3c78cd(0x13b)]!==_0x27aeb3)return console[_0x3c78cd(0x106)](a5_0x58b6d3[_0x3c78cd(0x118)](_0x3c78cd(0x197))),console[_0x3c78cd(0x106)](a5_0x58b6d3[_0x3c78cd(0x170)](_0x3c78cd(0x11c)+_0x433a35[_0x3c78cd(0x13b)]+_0x3c78cd(0x199)+_0x27aeb3+'\x22.')),console[_0x3c78cd(0x106)](a5_0x58b6d3['dim'](_0x3c78cd(0x173)+_0x433a35[_0x3c78cd(0x13b)]+_0x3c78cd(0x11a))),0x1;const _0x23dbfe=_0x4e699b[_0x3c78cd(0x16c)][_0x3c78cd(0x12a)](_0x31227a=>_0x438c5c[_0x3c78cd(0x165)](_0x31227a[_0x3c78cd(0x107)])),_0x12f376=_0x78cb30;let _0x11c43b;try{_0x11c43b=await setupEvaluatorAgent(_0x4d0570[_0x3c78cd(0x194)],_0x986c4d['verbose']);}catch(_0x3d5e22){const _0x1eac8b=_0x3d5e22 instanceof Error?_0x3d5e22[_0x3c78cd(0x17d)]:String(_0x3d5e22);return console[_0x3c78cd(0x106)](a5_0x58b6d3[_0x3c78cd(0x118)](_0x3c78cd(0x155)+_0x1eac8b)),0x1;}console[_0x3c78cd(0x106)](a5_0x58b6d3[_0x3c78cd(0x168)]('Re-evaluating\x20cached\x20test\x20run...')),console['log'](_0x3c78cd(0x129)+a5_0x58b6d3['white'](_0x433a35[_0x3c78cd(0x143)])),console[_0x3c78cd(0x106)]('Agent:\x20'+a5_0x58b6d3['white'](_0x433a35['agent']['projectName']+'/'+_0x433a35[_0x3c78cd(0x17a)]['agentName']));_0x12f376['length']>0x0&&console[_0x3c78cd(0x106)](_0x3c78cd(0x174)+a5_0x58b6d3[_0x3c78cd(0x18c)](_0x12f376[_0x3c78cd(0x17e)]));console[_0x3c78cd(0x106)]();const _0x56f65e=[],_0x3254f6=Date[_0x3c78cd(0x14a)](),_0x5d00ab=createCommandSpinner(_0x3c78cd(0x115));if(_0x23dbfe[_0x3c78cd(0x17e)]>0x0)try{const _0x453ba2=await reevaluateFromCache(_0x4d0570[_0x3c78cd(0x194)],_0x433a35,{'tests':_0x23dbfe},{'evaluatorId':_0x11c43b,'onTestStart':(_0x300098,_0x51777b,_0x363987)=>{const _0x22988b=_0x3c78cd;_0x5d00ab[_0x22988b(0x123)]=_0x22988b(0x112)+(_0x51777b+0x1)+'/'+_0x363987+':\x20'+_0x300098+_0x22988b(0x1a0);if(!_0x5d00ab['isSpinning'])_0x5d00ab[_0x22988b(0x169)]();},'onTestComplete':(_0x5eb666,_0x176af5)=>{const _0x2f2cd1=_0x3c78cd;_0x5d00ab[_0x2f2cd1(0x171)]();if(_0x176af5[_0x2f2cd1(0x145)]===_0x2f2cd1(0x19f))console[_0x2f2cd1(0x106)](a5_0x58b6d3['green'](_0x2f2cd1(0x141)+_0x5eb666)+a5_0x58b6d3[_0x2f2cd1(0x170)](_0x2f2cd1(0x136)));else _0x176af5[_0x2f2cd1(0x145)]==='FAIL'?console[_0x2f2cd1(0x106)](a5_0x58b6d3[_0x2f2cd1(0x118)]('✗\x20FAIL:\x20'+_0x5eb666+_0x2f2cd1(0x159)+_0x176af5['reason'])+a5_0x58b6d3[_0x2f2cd1(0x170)](_0x2f2cd1(0x136))):console[_0x2f2cd1(0x106)](a5_0x58b6d3[_0x2f2cd1(0x118)](_0x2f2cd1(0x135)+_0x5eb666+_0x2f2cd1(0x159)+_0x176af5['reason']));_0x176af5[_0x2f2cd1(0x12c)]&&console[_0x2f2cd1(0x106)](a5_0x58b6d3[_0x2f2cd1(0x170)]('\x20\x20Conversation:\x20'+_0x176af5[_0x2f2cd1(0x12c)])),_0x56f65e['push'](_0x176af5);},'onTestSkipped':(_0x1973a1,_0x49e2cf)=>{const _0x275b1c=_0x3c78cd;_0x5d00ab[_0x275b1c(0x171)](),console[_0x275b1c(0x106)](a5_0x58b6d3[_0x275b1c(0x18c)](_0x275b1c(0x10a)+_0x1973a1+'\x20-\x20'+_0x49e2cf));}});for(const _0x343fda of _0x453ba2){!_0x56f65e[_0x3c78cd(0x193)](_0x5802=>_0x5802[_0x3c78cd(0x107)]===_0x343fda['name'])&&_0x56f65e[_0x3c78cd(0x120)](_0x343fda);}}catch(_0x40b0a4){_0x5d00ab['stop']();const _0x2ab988=_0x40b0a4 instanceof Error?_0x40b0a4[_0x3c78cd(0x17d)]:String(_0x40b0a4);return console['log'](a5_0x58b6d3[_0x3c78cd(0x118)](_0x3c78cd(0x124)+_0x2ab988)),0x1;}_0x5d00ab[_0x3c78cd(0x171)]();if(_0x12f376[_0x3c78cd(0x17e)]>0x0){console['log'](),console['log'](a5_0x58b6d3[_0x3c78cd(0x168)](_0x3c78cd(0x15f)));const {projectId:_0x55eb29,agentId:_0xc0f54f}=_0x433a35[_0x3c78cd(0x17a)];for(const _0x2ee491 of _0x12f376){console[_0x3c78cd(0x106)](_0x3c78cd(0x14e)+a5_0x58b6d3[_0x3c78cd(0x176)](_0x2ee491[_0x3c78cd(0x107)]));const _0x3e54f2=createCommandSpinner('Round\x201/'+_0x2ee491[_0x3c78cd(0x19d)][_0x3c78cd(0x17e)]+_0x3c78cd(0x182));_0x3e54f2['start']();try{const {result:_0x33cc7e}=await runTest(_0x4d0570[_0x3c78cd(0x194)],_0x2ee491,{'agentId':_0xc0f54f,'projectId':_0x55eb29,'site':_0x433a35[_0x3c78cd(0x13b)],'noEval':![],'evaluatorId':_0x11c43b,'onRoundStart':(_0x4ddaf2,_0x20f295)=>{const _0x3b264c=_0x3c78cd;_0x3e54f2['text']='Round\x20'+(_0x4ddaf2+0x1)+'/'+_0x20f295+_0x3b264c(0x182);},'onRoundComplete':(_0x372b21,_0x434992,_0x4c1e7e)=>{const _0x205fd5=_0x3c78cd,_0x413f37=formatElapsed(_0x434992);_0x4c1e7e?console[_0x205fd5(0x106)](_0x205fd5(0x108)+(_0x372b21+0x1)+'/'+_0x2ee491[_0x205fd5(0x19d)][_0x205fd5(0x17e)]+_0x205fd5(0x140)+a5_0x58b6d3[_0x205fd5(0x19c)]('✓')+'\x20('+_0x413f37+')'):console[_0x205fd5(0x106)](_0x205fd5(0x108)+(_0x372b21+0x1)+'/'+_0x2ee491[_0x205fd5(0x19d)][_0x205fd5(0x17e)]+'...\x20'+a5_0x58b6d3[_0x205fd5(0x118)]('✗'));},'onEvaluationStart':()=>{const _0x1e5efd=_0x3c78cd;_0x3e54f2[_0x1e5efd(0x123)]='Evaluating\x20response...';},'onEvaluationComplete':_0x3452da=>{const _0x42f0d8=_0x3c78cd,_0x47828a=formatElapsed(_0x3452da);console[_0x42f0d8(0x106)](_0x42f0d8(0x10f)+a5_0x58b6d3['green']('✓')+'\x20('+_0x47828a+')');}});_0x3e54f2['stop'](),_0x56f65e[_0x3c78cd(0x120)](_0x33cc7e);if(_0x33cc7e[_0x3c78cd(0x145)]===_0x3c78cd(0x19f))console[_0x3c78cd(0x106)](a5_0x58b6d3['green'](_0x3c78cd(0x141)+_0x33cc7e[_0x3c78cd(0x146)])+a5_0x58b6d3[_0x3c78cd(0x170)](_0x3c78cd(0x144)));else _0x33cc7e[_0x3c78cd(0x145)]===_0x3c78cd(0x131)?console[_0x3c78cd(0x106)](a5_0x58b6d3[_0x3c78cd(0x118)](_0x3c78cd(0x195)+_0x33cc7e[_0x3c78cd(0x146)])+a5_0x58b6d3['dim']('\x20(new)')):console[_0x3c78cd(0x106)](a5_0x58b6d3[_0x3c78cd(0x118)](_0x3c78cd(0x135)+_0x33cc7e['reason']));_0x33cc7e['conversation_url']&&console[_0x3c78cd(0x106)](a5_0x58b6d3['dim'](_0x3c78cd(0x190)+_0x33cc7e[_0x3c78cd(0x12c)]));}catch(_0x268bbc){_0x3e54f2['stop']();const _0x575ddd=_0x268bbc instanceof Error?_0x268bbc[_0x3c78cd(0x17d)]:String(_0x268bbc);console[_0x3c78cd(0x106)](a5_0x58b6d3[_0x3c78cd(0x118)](_0x3c78cd(0x135)+_0x575ddd)),_0x56f65e[_0x3c78cd(0x120)]({'name':_0x2ee491[_0x3c78cd(0x107)],'status':'ERROR','reason':_0x575ddd,'timestamp':new Date()[_0x3c78cd(0x152)](),'duration_ms':0x0});}}}console['log']();const _0xe8c0e9=Date[_0x3c78cd(0x14a)]()-_0x3254f6,_0x37245f=_0x56f65e['filter'](_0x2f10fa=>_0x2f10fa[_0x3c78cd(0x145)]===_0x3c78cd(0x19f))[_0x3c78cd(0x17e)],_0x17d801=_0x56f65e['filter'](_0x448d4e=>_0x448d4e[_0x3c78cd(0x145)]===_0x3c78cd(0x131))[_0x3c78cd(0x17e)],_0x58fc47=_0x56f65e[_0x3c78cd(0x12a)](_0x2e1853=>_0x2e1853[_0x3c78cd(0x145)]===_0x3c78cd(0x17f))[_0x3c78cd(0x17e)];console[_0x3c78cd(0x106)]('━'[_0x3c78cd(0x18d)](0x3c)),console[_0x3c78cd(0x106)](_0x3c78cd(0x122)),console[_0x3c78cd(0x106)]('━'[_0x3c78cd(0x18d)](0x3c)),console[_0x3c78cd(0x106)](_0x3c78cd(0x191)+_0x56f65e[_0x3c78cd(0x17e)]),console[_0x3c78cd(0x106)](_0x3c78cd(0x16f)+a5_0x58b6d3[_0x3c78cd(0x19c)](_0x37245f)),console[_0x3c78cd(0x106)](_0x3c78cd(0x13f)+a5_0x58b6d3[_0x3c78cd(0x118)](_0x17d801));_0x58fc47>0x0&&console[_0x3c78cd(0x106)](_0x3c78cd(0x156)+a5_0x58b6d3[_0x3c78cd(0x118)](_0x58fc47));console[_0x3c78cd(0x106)](_0x3c78cd(0x183)+formatElapsed(_0xe8c0e9)),console[_0x3c78cd(0x106)]('━'[_0x3c78cd(0x18d)](0x3c));const _0x5e0b37={'summary':{'total':_0x56f65e[_0x3c78cd(0x17e)],'passed':_0x37245f,'failed':_0x17d801,'errors':_0x58fc47>0x0?_0x58fc47:undefined,'duration_ms':_0xe8c0e9},'tests':_0x56f65e,'agent':{'project':_0x3e5b94[_0x3c78cd(0x11b)],'name':_0x3e5b94['agentName'],'site':_0x27aeb3},'timestamp':new Date(_0x3254f6)[_0x3c78cd(0x152)]()};if(_0x2560f4!=='table'||_0x14aa7f){const _0x4a7e61=formatResults(_0x5e0b37,_0x2560f4);if(_0x14aa7f)try{a5_0x3f2115['writeFileSync'](_0x14aa7f,_0x4a7e61,_0x3c78cd(0x14c)),console[_0x3c78cd(0x106)](),console[_0x3c78cd(0x106)](a5_0x58b6d3[_0x3c78cd(0x170)](_0x3c78cd(0x15a)+_0x14aa7f));}catch(_0x3a7713){return console['log'](),console[_0x3c78cd(0x106)](a5_0x58b6d3[_0x3c78cd(0x118)]('Error\x20writing\x20output\x20file:\x20'+_0x3a7713)),0x1;}else console['log'](),console[_0x3c78cd(0x106)](_0x4a7e61);}const _0x50f017=_0x56f65e[_0x3c78cd(0x12a)](_0x4eb845=>_0x4eb845[_0x3c78cd(0x145)]!==_0x3c78cd(0x19f));return _0x50f017['length']>0x0?0x1:0x0;}}function a5_0x6779(){const _0x33ff2b=['start','eval','404','tests','Agent:\x20','dryRun','Passed:\x20\x20\x20','dim','stop','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','Either\x20switch\x20to\x20the\x20\x22','New\x20tests\x20to\x20execute:\x20','map','white','resolveAgentId','\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)','778IdPiSO','agent','Error\x20writing\x20output\x20file:\x20','✗\x20ERROR:\x20Project\x20not\x20found:\x20','message','length','ERROR','description','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22',':\x20Sending\x20user\x20input...','Duration:\x20','No\x20tests\x20have\x20tags\x20defined.','existsSync','output','split','Round\x20','toLowerCase','found','2139TSySbQ','yellow','repeat','agentName','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','\x20\x20Conversation:\x20','Total:\x20\x20\x20\x20','some','find','llm','✗\x20FAIL:\x20','/<agent-name>','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','\x22,\x20but\x20current\x20site\x20is\x20\x22','Available\x20tests:\x20','74560RIqqEF','green','rounds','Usage:','PASS','...','log','name','\x20\x20Round\x20','6VTELlM','⚠\x20SKIPPED:\x20','Test\x20','verbose','No\x20tests\x20found\x20matching:\x20','round','\x20\x20Evaluating...\x20','\x20\x20Agent:\x20','join','Re-evaluating\x20','json','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','Re-evaluating...','resolve','not\x20found','red','760311oUJPTZ','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','projectName','Cached\x20run\x20is\x20from\x20site\x20\x22','Conversation\x20URL:\x20','\x22:\x20','Error:\x20No\x20previous\x20test\x20run\x20found.','push','test.yml','Re-evaluation\x20Summary','text','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','forEach','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','executeReeval','basename','Cached\x20run\x20from:\x20','filter','agent:test','conversation_url','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','llmProject','\x27\x20to\x20create\x20the\x20folder\x20structure.','Running\x20agent\x20tests...','FAIL','trim','execute','table','✗\x20ERROR:\x20','\x20(cached)','jsonl','Running\x20test:\x20','testYmlPath','14895740BkZFJI','site','Using\x20agent:\x20','no_tests','reeval','Failed:\x20\x20\x20','...\x20','✓\x20PASS:\x20','84PFYBvk','timestamp','\x20(new)','status','reason','Failed\x20Tests:','multiple_agents','conversations','now','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','utf-8','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','Running:\x20','projectDir','tags','testName','toISOString','Test\x20Configuration:','writeFileSync','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','Errors:\x20\x20\x20','includes','1361665MriQOf','\x20-\x20','Output\x20written\x20to:\x20','Project\x20path:\x20','no_local_folder','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','Site:\x20','Executing\x20new\x20tests...','272833eSElgN','1165636YBumRl','Round\x201/','tsv','\x20\x20Site:\x20','has','size','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','cyan'];a5_0x6779=function(){return _0x33ff2b;};return a5_0x6779();}
1
+ function a5_0x4048(){const _0x170f4f=['split','Round\x20','utf-8','FAIL','log','/<agent-name>','Duration:\x20','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','Test\x20Configuration:','resolveAgentId','status','conversation_url','✗\x20FAIL:\x20','Total:\x20\x20\x20\x20','white','Re-evaluation\x20Summary','New\x20tests\x20to\x20execute:\x20','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','30361298hzthgl','trim','writeFileSync','Run\x20\x27tdx\x20agent\x20pull\x20','\x20\x20tdx\x20agent\x20test\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20(requires\x20context\x20or\x20tdx.json)','Evaluating\x20response...','has','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','527915SXwdmb','table','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','152544NcqZeK','ERROR','Tests\x20found:\x20','\x20(cached)','\x20\x20Conversation:\x20','json','conversations','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','Error\x20writing\x20output\x20file:\x20','2019812HxCxwv','resolveProjectId','Running\x20agent\x20tests...','toLowerCase','Using\x20agent:\x20','execute','Run\x20tests\x20for\x20an\x20LLM\x20agent','Available\x20tests:\x20','eval','green',':\x20Sending\x20user\x20input...','tags','timestamp','Cached\x20run\x20from:\x20','✓\x20PASS:\x20','\x20\x20Evaluating...\x20','stop','agentDirs','Failed\x20Tests:','agentName','Agent:\x20','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','message','source','cyan','73674XwZSGm','1790fYLnAs','substring','Cached\x20run\x20is\x20from\x20site\x20\x22','test.yml','reason','executeReeval','text','\x27\x20to\x20create\x20the\x20folder\x20structure.','map','size','multiple_agents','No\x20tests\x20found\x20with\x20tags:\x20','rounds','site','join','round','\x20\x20Round\x20','tests','21HaivEK','\x20\x20Agent:\x20','Round\x201/','no_local_folder','Site:\x20','\x20\x20Site:\x20','add','name','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','Running:\x20','projectDir','...\x20','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','Errors:\x20\x20\x20','✗\x20ERROR:\x20Project\x20not\x20found:\x20','context','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','PASS','some','\x20\x20-\x20','repeat','llm','jsonl','72XErJJk','agent:test','testYmlPath','projectName','Running\x20test:\x20','316504iSMagC','resolve','404','llmProject','⚠\x20SKIPPED:\x20','No\x20tests\x20have\x20tags\x20defined.','3bDfnjs','verbose','\x22,\x20but\x20current\x20site\x20is\x20\x22','reeval','testName','agent','includes','Executing\x20new\x20tests...','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','toISOString','output','Test\x20Summary','Conversation\x20URL:\x20','Output\x20written\x20to:\x20','✗\x20ERROR:\x20','basename','tsv','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','Passed:\x20\x20\x20','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','now','\x20-\x20','\x22:\x20','existsSync','push','red','length','start','Failed:\x20\x20\x20','5863732TZGdzI','Re-evaluating\x20','\x20\x20tdx\x20agent\x20test\x20<path>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20from\x20path','Either\x20switch\x20to\x20the\x20\x22','not\x20found','filter','...','dim','forEach','yellow','description','Usage:'];a5_0x4048=function(){return _0x170f4f;};return a5_0x4048();}const a5_0x1bc89f=a5_0x1068;(function(_0x222cf5,_0x54fa1d){const _0x1a9669=a5_0x1068,_0x3ca2e1=_0x222cf5();while(!![]){try{const _0x328d26=parseInt(_0x1a9669(0x136))/0x1+-parseInt(_0x1a9669(0x13f))/0x2+parseInt(_0x1a9669(0x18e))/0x3*(parseInt(_0x1a9669(0x10d))/0x4)+-parseInt(_0x1a9669(0x133))/0x5*(parseInt(_0x1a9669(0x183))/0x6)+parseInt(_0x1a9669(0x16b))/0x7*(parseInt(_0x1a9669(0x188))/0x8)+-parseInt(_0x1a9669(0x158))/0x9*(parseInt(_0x1a9669(0x159))/0xa)+parseInt(_0x1a9669(0x12b))/0xb;if(_0x328d26===_0x54fa1d)break;else _0x3ca2e1['push'](_0x3ca2e1['shift']());}catch(_0x988164){_0x3ca2e1['push'](_0x3ca2e1['shift']());}}}(a5_0x4048,0xb8590));import*as a5_0x2e4ecf from'node:fs';import*as a5_0x5d610e from'node:path';import a5_0x26445c from'chalk';function a5_0x1068(_0x3f978e,_0x2045e7){_0x3f978e=_0x3f978e-0xf1;const _0x40484b=a5_0x4048();let _0x106822=_0x40484b[_0x3f978e];return _0x106822;}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_0x1bc89f(0x172)]=a5_0x1bc89f(0x184);[a5_0x1bc89f(0x117)]=a5_0x1bc89f(0x145);async[a5_0x1bc89f(0x144)](_0x3d5daf){const _0x423a94=a5_0x1bc89f,{options:_0x20b6ce,args:_0x43f3a5,tdx:_0x304bde}=_0x3d5daf,_0x12ab89=_0x43f3a5[0x0]||'.',_0x89986c=_0x20b6ce['dryRun'],_0x28fe0d=_0x20b6ce,_0x35e3a2=_0x28fe0d[_0x423a94(0x147)]===![],_0x4d1eb6=_0x28fe0d[_0x423a94(0xf2)],_0x31c77d=_0x28fe0d['name'],_0x48f8ec=_0x28fe0d[_0x423a94(0x14a)],_0x19b232=_0x20b6ce[_0x423a94(0x166)],_0x581578=_0x28fe0d[_0x423a94(0xfa)];if(_0x4d1eb6&&_0x35e3a2)return console[_0x423a94(0x11d)](a5_0x26445c[_0x423a94(0x109)](_0x423a94(0x173))),0x1;let _0x2ca276=_0x423a94(0x134);if(_0x28fe0d['json'])_0x2ca276=_0x423a94(0x13b);else{if(_0x28fe0d[_0x423a94(0x182)])_0x2ca276=_0x423a94(0x182);else{if(_0x28fe0d[_0x423a94(0x100)])_0x2ca276=_0x423a94(0x100);else{if(_0x28fe0d['table'])_0x2ca276=_0x423a94(0x134);}}}const _0x5e22d7=_0x28fe0d['llmProject'];let _0x4f1be3=_0x12ab89;const _0x294373=a5_0x2e4ecf[_0x423a94(0x107)](_0x12ab89),_0x349aac=_0x12ab89==='.';if(!_0x294373||_0x349aac){const _0xd4b12b=resolveProjectFromContext(_0x12ab89,_0x5e22d7,{'requireFile':_0x423a94(0x15c)});if(_0xd4b12b['found'])_0x4f1be3=_0xd4b12b[_0x423a94(0x175)],_0xd4b12b[_0x423a94(0x156)]===_0x423a94(0x17b)&&console['log'](a5_0x26445c[_0x423a94(0x114)](_0x423a94(0x143)+_0x4f1be3));else switch(_0xd4b12b[_0x423a94(0x15d)]){case'no_context':console[_0x423a94(0x11d)](a5_0x26445c['yellow'](_0xd4b12b[_0x423a94(0x155)])),console['log'](),console[_0x423a94(0x11d)](_0x423a94(0x118)),console['log'](_0x423a94(0x10f)),console[_0x423a94(0x11d)](_0x423a94(0x12f)),console[_0x423a94(0x11d)](),console[_0x423a94(0x11d)]('Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>');return 0x1;case _0x423a94(0x16e):console[_0x423a94(0x11d)](a5_0x26445c[_0x423a94(0x116)](_0xd4b12b[_0x423a94(0x155)])),console[_0x423a94(0x11d)](),console[_0x423a94(0x11d)](_0x423a94(0x12e)+_0xd4b12b[_0x423a94(0x18b)]+_0x423a94(0x160));return 0x1;case _0x423a94(0x163):{const _0xbb6b33=a5_0x5d610e[_0x423a94(0xff)](_0xd4b12b['projectDir']);console[_0x423a94(0x11d)](a5_0x26445c['yellow'](_0x423a94(0x154)+_0xd4b12b[_0x423a94(0x18b)]+'\x22:'));for(const _0x24daf7 of _0xd4b12b[_0x423a94(0x150)]){console[_0x423a94(0x11d)](_0x423a94(0x17f)+_0x24daf7);}return console[_0x423a94(0x11d)](),console[_0x423a94(0x11d)](_0x423a94(0x135)+_0xbb6b33+_0x423a94(0x11e)),0x1;}case'no_tests':console[_0x423a94(0x11d)](a5_0x26445c[_0x423a94(0x116)](_0x423a94(0x13d)+_0xd4b12b[_0x423a94(0x18b)]+'\x22.')),console[_0x423a94(0x11d)](a5_0x26445c['dim']('Project\x20path:\x20'+_0xd4b12b[_0x423a94(0x175)])),console[_0x423a94(0x11d)](),console[_0x423a94(0x11d)](_0x423a94(0x132));return 0x1;}}const {definition:_0x22db04,agentInfo:_0x426e79}=parseTestFile(_0x4f1be3);let _0x462c69=_0x22db04[_0x423a94(0x16a)];if(_0x31c77d){const _0x197d90=_0x31c77d[_0x423a94(0x119)](',')[_0x423a94(0x161)](_0x4c5abb=>_0x4c5abb[_0x423a94(0x12c)]());_0x462c69=_0x22db04['tests'][_0x423a94(0x112)](_0xd7db35=>_0x197d90[_0x423a94(0xf5)](_0xd7db35[_0x423a94(0x172)]));if(_0x462c69['length']===0x0)return console['log'](a5_0x26445c[_0x423a94(0x116)]('No\x20tests\x20found\x20matching:\x20'+_0x31c77d)),console[_0x423a94(0x11d)](a5_0x26445c[_0x423a94(0x114)](_0x423a94(0x146)+_0x22db04[_0x423a94(0x16a)][_0x423a94(0x161)](_0x2c91b0=>_0x2c91b0[_0x423a94(0x172)])[_0x423a94(0x167)](',\x20'))),0x1;}if(_0x48f8ec){const _0x38cced=_0x48f8ec[_0x423a94(0x119)](',')[_0x423a94(0x161)](_0x49af74=>_0x49af74[_0x423a94(0x12c)]()[_0x423a94(0x142)]());_0x462c69=_0x462c69['filter'](_0x5be9f7=>_0x5be9f7[_0x423a94(0x14a)]?.[_0x423a94(0x17e)](_0x298dfd=>_0x38cced[_0x423a94(0xf5)](_0x298dfd[_0x423a94(0x142)]())));if(_0x462c69[_0x423a94(0x10a)]===0x0){console['log'](a5_0x26445c['yellow'](_0x423a94(0x164)+_0x48f8ec));const _0x18489d=new Set();return _0x22db04[_0x423a94(0x16a)][_0x423a94(0x115)](_0x398e46=>_0x398e46[_0x423a94(0x14a)]?.['forEach'](_0x3f23ec=>_0x18489d[_0x423a94(0x171)](_0x3f23ec))),_0x18489d[_0x423a94(0x162)]>0x0?console['log'](a5_0x26445c[_0x423a94(0x114)]('Available\x20tags:\x20'+[..._0x18489d]['join'](',\x20'))):console[_0x423a94(0x11d)](a5_0x26445c[_0x423a94(0x114)](_0x423a94(0x18d))),0x1;}}if(_0x4d1eb6)return this[_0x423a94(0x15e)](_0x3d5daf,{'definition':{'tests':_0x462c69},'agentInfo':_0x426e79,'outputFormat':_0x2ca276,'outputFile':_0x581578,'testNames':_0x31c77d});if(_0x89986c){console[_0x423a94(0x11d)](a5_0x26445c[_0x423a94(0x157)](_0x423a94(0x121))),console[_0x423a94(0x11d)](_0x423a94(0x170)+a5_0x26445c['white'](_0x19b232)),console['log']('\x20\x20Project:\x20'+a5_0x26445c[_0x423a94(0x127)](_0x426e79[_0x423a94(0x186)])),console[_0x423a94(0x11d)](_0x423a94(0x16c)+a5_0x26445c[_0x423a94(0x127)](_0x426e79['agentName'])),console['log'](),console[_0x423a94(0x11d)](_0x423a94(0x138)+a5_0x26445c['white'](_0x462c69[_0x423a94(0x10a)]));for(let _0x1103ea=0x0;_0x1103ea<_0x462c69['length'];_0x1103ea++){const _0x2c1f02=_0x462c69[_0x1103ea],_0x5c1d3f=_0x2c1f02[_0x423a94(0x165)][_0x423a94(0x10a)]===0x1?_0x423a94(0x168):_0x423a94(0x165),_0x14b56e=_0x2c1f02['tags']?.[_0x423a94(0x10a)]?'\x20['+_0x2c1f02[_0x423a94(0x14a)][_0x423a94(0x167)](',\x20')+']':'';console[_0x423a94(0x11d)]('\x20\x20'+(_0x1103ea+0x1)+'.\x20'+a5_0x26445c['white'](_0x2c1f02['name'])+'\x20('+_0x2c1f02[_0x423a94(0x165)][_0x423a94(0x10a)]+'\x20'+_0x5c1d3f+')'+a5_0x26445c[_0x423a94(0x114)](_0x14b56e));}return 0x0;}let _0x557f80,_0x6d03c5;try{_0x557f80=await _0x304bde[_0x423a94(0x181)][_0x423a94(0x140)](_0x426e79['projectName']);}catch(_0x241d7b){const _0x356c4f=_0x241d7b instanceof Error?_0x241d7b['message']:String(_0x241d7b);return _0x356c4f[_0x423a94(0xf5)](_0x423a94(0x18a))||_0x356c4f['toLowerCase']()[_0x423a94(0xf5)](_0x423a94(0x111))?console[_0x423a94(0x11d)](a5_0x26445c[_0x423a94(0x109)](_0x423a94(0x17a)+_0x426e79[_0x423a94(0x186)])):console[_0x423a94(0x11d)](a5_0x26445c[_0x423a94(0x109)](_0x423a94(0xf8)+_0x426e79[_0x423a94(0x186)]+_0x423a94(0x106)+_0x356c4f)),0x1;}try{_0x6d03c5=await _0x304bde[_0x423a94(0x181)][_0x423a94(0x122)](_0x426e79['agentName'],_0x557f80);}catch(_0x294fc0){const _0x3e64e1=_0x294fc0 instanceof Error?_0x294fc0[_0x423a94(0x155)]:String(_0x294fc0);return _0x3e64e1['includes'](_0x423a94(0x18a))||_0x3e64e1[_0x423a94(0x142)]()['includes'](_0x423a94(0x111))?console['log'](a5_0x26445c[_0x423a94(0x109)](_0x423a94(0x101)+_0x426e79['agentName'])):console[_0x423a94(0x11d)](a5_0x26445c[_0x423a94(0x109)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22'+_0x426e79[_0x423a94(0x152)]+_0x423a94(0x106)+_0x3e64e1)),0x1;}let _0x322cc7;if(!_0x35e3a2)try{_0x322cc7=await setupEvaluatorAgent(_0x304bde[_0x423a94(0x181)],_0x20b6ce['verbose']);}catch(_0x2aa2ad){const _0x4df7c5=_0x2aa2ad instanceof Error?_0x2aa2ad[_0x423a94(0x155)]:String(_0x2aa2ad);return console[_0x423a94(0x11d)](a5_0x26445c[_0x423a94(0x109)](_0x423a94(0x178)+_0x4df7c5)),0x1;}console[_0x423a94(0x11d)](a5_0x26445c[_0x423a94(0x157)](_0x423a94(0x141))),console['log'](_0x423a94(0x16f)+a5_0x26445c['white'](_0x19b232)),console[_0x423a94(0x11d)](_0x423a94(0x153)+a5_0x26445c[_0x423a94(0x127)](_0x426e79[_0x423a94(0x186)]+'/'+_0x426e79[_0x423a94(0x152)])),console[_0x423a94(0x11d)]();const _0x21b8e1=[],_0x15af2b=[],_0x3ca9f7=Date['now']();for(let _0x14b9b1=0x0;_0x14b9b1<_0x462c69[_0x423a94(0x10a)];_0x14b9b1++){const _0x121c3c=_0x462c69[_0x14b9b1];_0x462c69['length']>0x1?console[_0x423a94(0x11d)]('Test\x20'+(_0x14b9b1+0x1)+'/'+_0x462c69[_0x423a94(0x10a)]+':\x20'+a5_0x26445c[_0x423a94(0x127)](_0x121c3c[_0x423a94(0x172)])):console[_0x423a94(0x11d)](_0x423a94(0x187)+a5_0x26445c['white'](_0x121c3c[_0x423a94(0x172)]));const _0xaea953=createCommandSpinner('Round\x201/'+_0x121c3c['rounds']['length']+':\x20Sending\x20user\x20input...');_0xaea953[_0x423a94(0x10b)]();try{const {result:_0x7d99a9,conversation:_0x3352c7}=await runTest(_0x304bde[_0x423a94(0x181)],_0x121c3c,{'agentId':_0x6d03c5,'projectId':_0x557f80,'site':_0x19b232,'noEval':_0x35e3a2,'evaluatorId':_0x322cc7,'onRoundStart':(_0xa19a1,_0x176a2c)=>{const _0x2fac65=_0x423a94;_0xaea953['text']=_0x2fac65(0x11a)+(_0xa19a1+0x1)+'/'+_0x176a2c+_0x2fac65(0x149);},'onRoundComplete':(_0x1a4f55,_0x3c605b,_0x128390)=>{const _0x5f1c1f=_0x423a94,_0x5a2c59=formatElapsed(_0x3c605b);_0x128390?console['log'](_0x5f1c1f(0x169)+(_0x1a4f55+0x1)+'/'+_0x121c3c[_0x5f1c1f(0x165)][_0x5f1c1f(0x10a)]+_0x5f1c1f(0x176)+a5_0x26445c[_0x5f1c1f(0x148)]('✓')+'\x20('+_0x5a2c59+')'):console[_0x5f1c1f(0x11d)](_0x5f1c1f(0x169)+(_0x1a4f55+0x1)+'/'+_0x121c3c[_0x5f1c1f(0x165)]['length']+'...\x20'+a5_0x26445c[_0x5f1c1f(0x109)]('✗'));},'onEvaluationStart':()=>{const _0x339acf=_0x423a94;_0xaea953[_0x339acf(0x15f)]=_0x339acf(0x130);},'onEvaluationComplete':_0x3d7256=>{const _0xd5ed27=_0x423a94,_0x4b0f85=formatElapsed(_0x3d7256);console[_0xd5ed27(0x11d)](_0xd5ed27(0x14e)+a5_0x26445c[_0xd5ed27(0x148)]('✓')+'\x20('+_0x4b0f85+')');}});_0xaea953[_0x423a94(0x14f)](),_0x21b8e1['push'](_0x7d99a9),_0x15af2b[_0x423a94(0x108)](_0x3352c7);if(_0x7d99a9['status']==='PASS')console[_0x423a94(0x11d)](a5_0x26445c[_0x423a94(0x148)](_0x423a94(0x14d)+_0x7d99a9[_0x423a94(0x15d)]));else _0x7d99a9[_0x423a94(0x123)]===_0x423a94(0x11c)?console[_0x423a94(0x11d)](a5_0x26445c[_0x423a94(0x109)]('✗\x20FAIL:\x20'+_0x7d99a9[_0x423a94(0x15d)])):console[_0x423a94(0x11d)](a5_0x26445c[_0x423a94(0x109)](_0x423a94(0xfe)+_0x7d99a9[_0x423a94(0x15d)]));_0x7d99a9[_0x423a94(0x124)]&&console[_0x423a94(0x11d)](a5_0x26445c['dim'](_0x423a94(0xfc)+_0x7d99a9['conversation_url'])),console[_0x423a94(0x11d)]();}catch(_0x501a52){_0xaea953[_0x423a94(0x14f)]();const _0x2c43af=_0x501a52 instanceof Error?_0x501a52[_0x423a94(0x155)]:String(_0x501a52);console[_0x423a94(0x11d)](a5_0x26445c['red'](_0x423a94(0xfe)+_0x2c43af)),console[_0x423a94(0x11d)](),_0x21b8e1[_0x423a94(0x108)]({'name':_0x121c3c[_0x423a94(0x172)],'status':_0x423a94(0x137),'reason':_0x2c43af,'timestamp':new Date()[_0x423a94(0xf9)](),'duration_ms':0x0});}}const _0x56f47f=Date[_0x423a94(0x104)]()-_0x3ca9f7,_0x11fb26=_0x21b8e1[_0x423a94(0x112)](_0x529b12=>_0x529b12[_0x423a94(0x123)]==='PASS')['length'],_0x4435ba=_0x21b8e1[_0x423a94(0x112)](_0x3b6328=>_0x3b6328[_0x423a94(0x123)]===_0x423a94(0x11c))[_0x423a94(0x10a)],_0x2d3d5d=_0x21b8e1[_0x423a94(0x112)](_0x311eb=>_0x311eb[_0x423a94(0x123)]===_0x423a94(0x137))['length'];console[_0x423a94(0x11d)]('━'['repeat'](0x3c)),console['log'](_0x423a94(0xfb)),console[_0x423a94(0x11d)]('━'[_0x423a94(0x180)](0x3c)),console[_0x423a94(0x11d)](_0x423a94(0x126)+_0x21b8e1[_0x423a94(0x10a)]),console[_0x423a94(0x11d)](_0x423a94(0x102)+a5_0x26445c[_0x423a94(0x148)](_0x11fb26)),console[_0x423a94(0x11d)](_0x423a94(0x10c)+a5_0x26445c[_0x423a94(0x109)](_0x4435ba));_0x2d3d5d>0x0&&console[_0x423a94(0x11d)](_0x423a94(0x179)+a5_0x26445c['red'](_0x2d3d5d));console[_0x423a94(0x11d)](_0x423a94(0x11f)+formatElapsed(_0x56f47f)),console[_0x423a94(0x11d)]('━'[_0x423a94(0x180)](0x3c));const _0x5298ed=_0x21b8e1[_0x423a94(0x112)](_0x4a649a=>_0x4a649a[_0x423a94(0x123)]!==_0x423a94(0x17d));if(_0x5298ed[_0x423a94(0x10a)]>0x0){console[_0x423a94(0x11d)](),console['log'](_0x423a94(0x151));for(const _0x3e3a99 of _0x5298ed){const _0x3b21ad=a5_0x26445c[_0x423a94(0x109)]('✗'),_0x3f78d0=_0x3e3a99['reason'][_0x423a94(0x10a)]>0x32?_0x3e3a99['reason'][_0x423a94(0x15a)](0x0,0x32)+_0x423a94(0x113):_0x3e3a99[_0x423a94(0x15d)];console[_0x423a94(0x11d)]('\x20\x20'+_0x3b21ad+'\x20'+_0x3e3a99[_0x423a94(0x172)]+':\x20'+_0x3f78d0);}}const _0x12e6a1={'summary':{'total':_0x21b8e1[_0x423a94(0x10a)],'passed':_0x11fb26,'failed':_0x4435ba,'errors':_0x2d3d5d>0x0?_0x2d3d5d:undefined,'duration_ms':_0x56f47f},'tests':_0x21b8e1,'agent':{'project':_0x426e79['projectName'],'name':_0x426e79[_0x423a94(0x152)],'site':_0x19b232},'timestamp':new Date(_0x3ca9f7)[_0x423a94(0xf9)]()};try{const _0x5bd1d9=buildCachedTestRun(_0x15af2b,{'site':_0x19b232,'projectId':_0x557f80,'projectName':_0x426e79[_0x423a94(0x186)],'agentId':_0x6d03c5,'agentName':_0x426e79[_0x423a94(0x152)],'testYmlPath':a5_0x5d610e[_0x423a94(0x189)](_0x426e79[_0x423a94(0x185)])});saveLastTestRun(_0x5bd1d9);}catch{}if(_0x2ca276!==_0x423a94(0x134)||_0x581578){const _0x584d48=formatResults(_0x12e6a1,_0x2ca276);if(_0x581578)try{a5_0x2e4ecf['writeFileSync'](_0x581578,_0x584d48,'utf-8'),console['log'](),console[_0x423a94(0x11d)](a5_0x26445c[_0x423a94(0x114)]('Output\x20written\x20to:\x20'+_0x581578));}catch(_0x58323c){return console[_0x423a94(0x11d)](),console[_0x423a94(0x11d)](a5_0x26445c[_0x423a94(0x109)](_0x423a94(0x13e)+_0x58323c)),0x1;}else console['log'](),console['log'](_0x584d48);}return _0x5298ed['length']>0x0?0x1:0x0;}async[a5_0x1bc89f(0x15e)](_0x269f45,_0x91ba2e){const _0x50ca84=a5_0x1bc89f,{options:_0x3b3347,tdx:_0x36a579}=_0x269f45,{definition:_0x305386,agentInfo:_0x1d8d66,outputFormat:_0x311eb4,outputFile:_0x43ce38}=_0x91ba2e,_0x2bc5=_0x3b3347[_0x50ca84(0x166)],_0x1d6120=loadLastTestRun();if(!_0x1d6120)return console[_0x50ca84(0x11d)](a5_0x26445c[_0x50ca84(0x109)]('Error:\x20No\x20previous\x20test\x20run\x20found.')),console[_0x50ca84(0x11d)](a5_0x26445c[_0x50ca84(0x114)](_0x50ca84(0x12a))),0x1;if(_0x1d6120[_0x50ca84(0xf4)][_0x50ca84(0x152)]!==_0x1d8d66[_0x50ca84(0x152)])return console[_0x50ca84(0x11d)](a5_0x26445c[_0x50ca84(0x109)](_0x50ca84(0x17c)+_0x1d6120[_0x50ca84(0xf4)]['agentName']+_0x50ca84(0xf7)+_0x1d8d66[_0x50ca84(0x152)]+'\x22.')),console['log'](a5_0x26445c[_0x50ca84(0x114)](_0x50ca84(0x103))),0x1;const _0x1962f0=new Set(_0x1d6120[_0x50ca84(0x13c)]['map'](_0x3d505b=>_0x3d505b[_0x50ca84(0xf3)])),_0x292bb3=_0x305386[_0x50ca84(0x16a)][_0x50ca84(0x112)](_0xcb2f54=>!_0x1962f0[_0x50ca84(0x131)](_0xcb2f54[_0x50ca84(0x172)]));if(_0x292bb3[_0x50ca84(0x10a)]>0x0&&_0x1d6120[_0x50ca84(0x166)]!==_0x2bc5)return console['log'](a5_0x26445c[_0x50ca84(0x109)](_0x50ca84(0x120))),console[_0x50ca84(0x11d)](a5_0x26445c['dim'](_0x50ca84(0x15b)+_0x1d6120['site']+_0x50ca84(0xf1)+_0x2bc5+'\x22.')),console[_0x50ca84(0x11d)](a5_0x26445c[_0x50ca84(0x114)](_0x50ca84(0x110)+_0x1d6120[_0x50ca84(0x166)]+'\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.')),0x1;const _0x1b61d3=_0x305386[_0x50ca84(0x16a)][_0x50ca84(0x112)](_0x349f6b=>_0x1962f0[_0x50ca84(0x131)](_0x349f6b['name'])),_0x13a888=_0x292bb3;let _0x48a266;try{_0x48a266=await setupEvaluatorAgent(_0x36a579[_0x50ca84(0x181)],_0x3b3347[_0x50ca84(0x18f)]);}catch(_0x4db7e8){const _0x112c98=_0x4db7e8 instanceof Error?_0x4db7e8[_0x50ca84(0x155)]:String(_0x4db7e8);return console['log'](a5_0x26445c['red'](_0x50ca84(0x178)+_0x112c98)),0x1;}console[_0x50ca84(0x11d)](a5_0x26445c['cyan']('Re-evaluating\x20cached\x20test\x20run...')),console[_0x50ca84(0x11d)](_0x50ca84(0x14c)+a5_0x26445c['white'](_0x1d6120[_0x50ca84(0x14b)])),console[_0x50ca84(0x11d)](_0x50ca84(0x153)+a5_0x26445c[_0x50ca84(0x127)](_0x1d6120[_0x50ca84(0xf4)][_0x50ca84(0x186)]+'/'+_0x1d6120[_0x50ca84(0xf4)]['agentName']));_0x13a888[_0x50ca84(0x10a)]>0x0&&console[_0x50ca84(0x11d)](_0x50ca84(0x129)+a5_0x26445c[_0x50ca84(0x116)](_0x13a888['length']));console[_0x50ca84(0x11d)]();const _0x327361=[],_0x2da28b=Date[_0x50ca84(0x104)](),_0x2c099e=createCommandSpinner('Re-evaluating...');if(_0x1b61d3[_0x50ca84(0x10a)]>0x0)try{const _0x52791a=await reevaluateFromCache(_0x36a579['llm'],_0x1d6120,{'tests':_0x1b61d3},{'evaluatorId':_0x48a266,'onTestStart':(_0x4dec03,_0x460bf3,_0x4906fc)=>{const _0x37a00d=_0x50ca84;_0x2c099e['text']=_0x37a00d(0x10e)+(_0x460bf3+0x1)+'/'+_0x4906fc+':\x20'+_0x4dec03+_0x37a00d(0x113);if(!_0x2c099e['isSpinning'])_0x2c099e[_0x37a00d(0x10b)]();},'onTestComplete':(_0x8b243,_0x5dccd8)=>{const _0x378690=_0x50ca84;_0x2c099e[_0x378690(0x14f)]();if(_0x5dccd8[_0x378690(0x123)]==='PASS')console[_0x378690(0x11d)](a5_0x26445c[_0x378690(0x148)](_0x378690(0x14d)+_0x8b243)+a5_0x26445c[_0x378690(0x114)](_0x378690(0x139)));else _0x5dccd8[_0x378690(0x123)]===_0x378690(0x11c)?console[_0x378690(0x11d)](a5_0x26445c[_0x378690(0x109)](_0x378690(0x125)+_0x8b243+_0x378690(0x105)+_0x5dccd8[_0x378690(0x15d)])+a5_0x26445c[_0x378690(0x114)](_0x378690(0x139))):console[_0x378690(0x11d)](a5_0x26445c[_0x378690(0x109)](_0x378690(0xfe)+_0x8b243+_0x378690(0x105)+_0x5dccd8[_0x378690(0x15d)]));_0x5dccd8[_0x378690(0x124)]&&console[_0x378690(0x11d)](a5_0x26445c[_0x378690(0x114)](_0x378690(0x13a)+_0x5dccd8[_0x378690(0x124)])),_0x327361[_0x378690(0x108)](_0x5dccd8);},'onTestSkipped':(_0xa4cf95,_0xc4e334)=>{const _0x4c69e5=_0x50ca84;_0x2c099e['stop'](),console[_0x4c69e5(0x11d)](a5_0x26445c['yellow'](_0x4c69e5(0x18c)+_0xa4cf95+_0x4c69e5(0x105)+_0xc4e334));}});for(const _0x44dfd8 of _0x52791a){!_0x327361['find'](_0x20531a=>_0x20531a[_0x50ca84(0x172)]===_0x44dfd8[_0x50ca84(0x172)])&&_0x327361[_0x50ca84(0x108)](_0x44dfd8);}}catch(_0x47f723){_0x2c099e['stop']();const _0x10d6f6=_0x47f723 instanceof Error?_0x47f723[_0x50ca84(0x155)]:String(_0x47f723);return console[_0x50ca84(0x11d)](a5_0x26445c['red'](_0x50ca84(0x177)+_0x10d6f6)),0x1;}_0x2c099e['stop']();if(_0x13a888[_0x50ca84(0x10a)]>0x0){console[_0x50ca84(0x11d)](),console['log'](a5_0x26445c[_0x50ca84(0x157)](_0x50ca84(0xf6)));const {projectId:_0x5b2b1e,agentId:_0x1037cf}=_0x1d6120[_0x50ca84(0xf4)];for(const _0x527edc of _0x13a888){console['log'](_0x50ca84(0x174)+a5_0x26445c['white'](_0x527edc[_0x50ca84(0x172)]));const _0x5032ac=createCommandSpinner(_0x50ca84(0x16d)+_0x527edc[_0x50ca84(0x165)][_0x50ca84(0x10a)]+_0x50ca84(0x149));_0x5032ac[_0x50ca84(0x10b)]();try{const {result:_0x211344}=await runTest(_0x36a579['llm'],_0x527edc,{'agentId':_0x1037cf,'projectId':_0x5b2b1e,'site':_0x1d6120[_0x50ca84(0x166)],'noEval':![],'evaluatorId':_0x48a266,'onRoundStart':(_0x419bc8,_0x419186)=>{const _0x3808a3=_0x50ca84;_0x5032ac['text']='Round\x20'+(_0x419bc8+0x1)+'/'+_0x419186+_0x3808a3(0x149);},'onRoundComplete':(_0x544c49,_0x2dbda0,_0x44513b)=>{const _0x5ccb63=_0x50ca84,_0x152379=formatElapsed(_0x2dbda0);_0x44513b?console[_0x5ccb63(0x11d)](_0x5ccb63(0x169)+(_0x544c49+0x1)+'/'+_0x527edc[_0x5ccb63(0x165)][_0x5ccb63(0x10a)]+_0x5ccb63(0x176)+a5_0x26445c[_0x5ccb63(0x148)]('✓')+'\x20('+_0x152379+')'):console['log'](_0x5ccb63(0x169)+(_0x544c49+0x1)+'/'+_0x527edc[_0x5ccb63(0x165)][_0x5ccb63(0x10a)]+_0x5ccb63(0x176)+a5_0x26445c[_0x5ccb63(0x109)]('✗'));},'onEvaluationStart':()=>{const _0x3473e4=_0x50ca84;_0x5032ac[_0x3473e4(0x15f)]=_0x3473e4(0x130);},'onEvaluationComplete':_0x10f76e=>{const _0x1c3784=_0x50ca84,_0x4c9f65=formatElapsed(_0x10f76e);console[_0x1c3784(0x11d)]('\x20\x20Evaluating...\x20'+a5_0x26445c[_0x1c3784(0x148)]('✓')+'\x20('+_0x4c9f65+')');}});_0x5032ac[_0x50ca84(0x14f)](),_0x327361[_0x50ca84(0x108)](_0x211344);if(_0x211344[_0x50ca84(0x123)]===_0x50ca84(0x17d))console[_0x50ca84(0x11d)](a5_0x26445c['green'](_0x50ca84(0x14d)+_0x211344[_0x50ca84(0x15d)])+a5_0x26445c[_0x50ca84(0x114)]('\x20(new)'));else _0x211344[_0x50ca84(0x123)]===_0x50ca84(0x11c)?console['log'](a5_0x26445c[_0x50ca84(0x109)](_0x50ca84(0x125)+_0x211344[_0x50ca84(0x15d)])+a5_0x26445c[_0x50ca84(0x114)]('\x20(new)')):console[_0x50ca84(0x11d)](a5_0x26445c[_0x50ca84(0x109)](_0x50ca84(0xfe)+_0x211344[_0x50ca84(0x15d)]));_0x211344[_0x50ca84(0x124)]&&console[_0x50ca84(0x11d)](a5_0x26445c[_0x50ca84(0x114)](_0x50ca84(0x13a)+_0x211344[_0x50ca84(0x124)]));}catch(_0x569964){_0x5032ac[_0x50ca84(0x14f)]();const _0x15e3c7=_0x569964 instanceof Error?_0x569964[_0x50ca84(0x155)]:String(_0x569964);console[_0x50ca84(0x11d)](a5_0x26445c[_0x50ca84(0x109)](_0x50ca84(0xfe)+_0x15e3c7)),_0x327361[_0x50ca84(0x108)]({'name':_0x527edc['name'],'status':'ERROR','reason':_0x15e3c7,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}}console[_0x50ca84(0x11d)]();const _0x48bd7c=Date[_0x50ca84(0x104)]()-_0x2da28b,_0x286f53=_0x327361[_0x50ca84(0x112)](_0x6f0358=>_0x6f0358[_0x50ca84(0x123)]===_0x50ca84(0x17d))['length'],_0x226c12=_0x327361[_0x50ca84(0x112)](_0x2b20d0=>_0x2b20d0['status']===_0x50ca84(0x11c))[_0x50ca84(0x10a)],_0x31aa46=_0x327361[_0x50ca84(0x112)](_0x4ac68d=>_0x4ac68d['status']===_0x50ca84(0x137))[_0x50ca84(0x10a)];console[_0x50ca84(0x11d)]('━'[_0x50ca84(0x180)](0x3c)),console[_0x50ca84(0x11d)](_0x50ca84(0x128)),console[_0x50ca84(0x11d)]('━'[_0x50ca84(0x180)](0x3c)),console[_0x50ca84(0x11d)](_0x50ca84(0x126)+_0x327361[_0x50ca84(0x10a)]),console['log'](_0x50ca84(0x102)+a5_0x26445c[_0x50ca84(0x148)](_0x286f53)),console[_0x50ca84(0x11d)](_0x50ca84(0x10c)+a5_0x26445c[_0x50ca84(0x109)](_0x226c12));_0x31aa46>0x0&&console[_0x50ca84(0x11d)](_0x50ca84(0x179)+a5_0x26445c[_0x50ca84(0x109)](_0x31aa46));console[_0x50ca84(0x11d)]('Duration:\x20'+formatElapsed(_0x48bd7c)),console[_0x50ca84(0x11d)]('━'[_0x50ca84(0x180)](0x3c));const _0x19dd4e={'summary':{'total':_0x327361[_0x50ca84(0x10a)],'passed':_0x286f53,'failed':_0x226c12,'errors':_0x31aa46>0x0?_0x31aa46:undefined,'duration_ms':_0x48bd7c},'tests':_0x327361,'agent':{'project':_0x1d8d66[_0x50ca84(0x186)],'name':_0x1d8d66[_0x50ca84(0x152)],'site':_0x2bc5},'timestamp':new Date(_0x2da28b)[_0x50ca84(0xf9)]()};if(_0x311eb4!==_0x50ca84(0x134)||_0x43ce38){const _0x513a9a=formatResults(_0x19dd4e,_0x311eb4);if(_0x43ce38)try{a5_0x2e4ecf[_0x50ca84(0x12d)](_0x43ce38,_0x513a9a,_0x50ca84(0x11b)),console[_0x50ca84(0x11d)](),console[_0x50ca84(0x11d)](a5_0x26445c['dim'](_0x50ca84(0xfd)+_0x43ce38));}catch(_0x18fda4){return console[_0x50ca84(0x11d)](),console[_0x50ca84(0x11d)](a5_0x26445c[_0x50ca84(0x109)](_0x50ca84(0x13e)+_0x18fda4)),0x1;}else console[_0x50ca84(0x11d)](),console['log'](_0x513a9a);}const _0x215a47=_0x327361[_0x50ca84(0x112)](_0x4fce20=>_0x4fce20[_0x50ca84(0x123)]!==_0x50ca84(0x17d));return _0x215a47['length']>0x0?0x1:0x0;}}
@@ -1 +1 @@
1
- function a6_0x1cdf(){const _0x1d1bdb=['Endpoint\x20must\x20start\x20with\x20/:\x20','cookie','execute','Error:\x20','PUT','trino','description','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','Invalid\x20HTTP\x20method:\x20','indexOf','color','2506782lZLQUr','output','75778srOgZS','trim','.\x20Valid\x20methods:\x20','cdp','workflow','method','name','set-cookie','124ndoiKs','stack','includes','isArray','header','x-xsrf-token','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','\x22.\x20','38178NRzvjG','keys','GET','verbose','50ejxDjX','error','toLowerCase','file','x-auth-token','Invalid\x20API\x20type:\x20','7ZTcNgF','3025594nGKviO','has','entries','<\x20HTTP/1.1\x20','data','4803615MrcFSV','authorization','validate','\x0aStack\x20trace:\x0a','set-cookie2','message','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','substring','join','2818540HIrDse','log','body','8GVdAcR','request','2635962ogdsuc','api','POST','startsWith','headers','type','.\x20Valid\x20types:\x20','llm-proxy'];a6_0x1cdf=function(){return _0x1d1bdb;};return a6_0x1cdf();}const a6_0x41f045=a6_0x4843;(function(_0x361843,_0x19bae8){const _0x364c51=a6_0x4843,_0x4987d4=_0x361843();while(!![]){try{const _0xa0e25a=parseInt(_0x364c51(0x219))/0x1*(-parseInt(_0x364c51(0x1ff))/0x2)+parseInt(_0x364c51(0x20f))/0x3*(parseInt(_0x364c51(0x207))/0x4)+-parseInt(_0x364c51(0x1e4))/0x5+-parseInt(_0x364c51(0x1fd))/0x6+parseInt(_0x364c51(0x1e9))/0x7*(parseInt(_0x364c51(0x1e7))/0x8)+-parseInt(_0x364c51(0x1db))/0x9+parseInt(_0x364c51(0x213))/0xa*(parseInt(_0x364c51(0x21a))/0xb);if(_0xa0e25a===_0x19bae8)break;else _0x4987d4['push'](_0x4987d4['shift']());}catch(_0x11e096){_0x4987d4['push'](_0x4987d4['shift']());}}}(a6_0x1cdf,0x59537));function a6_0x4843(_0x4424ea,_0x5f9054){_0x4424ea=_0x4424ea-0x1d8;const _0x1cdf2b=a6_0x1cdf();let _0x484343=_0x1cdf2b[_0x4424ea];return _0x484343;}import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a6_0x41f045(0x1dc),'proxy-authorization',a6_0x41f045(0x1f2),a6_0x41f045(0x206),a6_0x41f045(0x1df),a6_0x41f045(0x20c),a6_0x41f045(0x217),'x-trino-user']);function isSensitiveHeader(_0x86854d){const _0x5e515b=a6_0x41f045;return SENSITIVE_HEADERS[_0x5e515b(0x21b)](_0x86854d[_0x5e515b(0x215)]());}function parseHeader(_0x3eae55){const _0x56fde7=a6_0x41f045,_0x5ce518=_0x3eae55[_0x56fde7(0x1fb)](':');if(_0x5ce518===-0x1)throw new Error('Invalid\x20header\x20format:\x20\x22'+_0x3eae55+_0x56fde7(0x20e)+_0x56fde7(0x1e1));const _0x4a4aa1=_0x3eae55[_0x56fde7(0x1e2)](0x0,_0x5ce518)['trim'](),_0x555754=_0x3eae55['substring'](_0x5ce518+0x1)[_0x56fde7(0x200)]();if(!_0x4a4aa1)throw new Error(_0x56fde7(0x1f8)+_0x3eae55+'\x22');return[_0x4a4aa1,_0x555754];}export class ApiCommand extends BaseCommand{[a6_0x41f045(0x205)]=a6_0x41f045(0x1ea);[a6_0x41f045(0x1f7)]='Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs';[a6_0x41f045(0x1dd)](_0x5f4ac2){const _0x9e110f=a6_0x41f045,{args:_0x27475c,options:_0x36be0a}=_0x5f4ac2,_0x395b99=_0x36be0a;if(_0x27475c['length']===0x0)return _0x9e110f(0x20d);const _0x1a49bf=_0x27475c[0x0];if(!_0x1a49bf[_0x9e110f(0x1ec)]('/'))return _0x9e110f(0x1f1)+_0x1a49bf;const _0x12e190=_0x395b99[_0x9e110f(0x1da)],_0x4b2c09=_0x395b99['file'];if(_0x12e190&&_0x4b2c09)return _0x9e110f(0x1f9);const _0x2487ce=_0x395b99['method']||'GET',_0x56cdf2=['GET',_0x9e110f(0x1eb),_0x9e110f(0x1f5),'DELETE','PATCH'];if(!_0x56cdf2[_0x9e110f(0x209)](_0x2487ce['toUpperCase']()))return _0x9e110f(0x1fa)+_0x2487ce+_0x9e110f(0x201)+_0x56cdf2['join'](',\x20');const _0x107914=_0x395b99[_0x9e110f(0x1ee)]||'td',_0x3a74d6=['td',_0x9e110f(0x202),_0x9e110f(0x203),_0x9e110f(0x1f6),'llm',_0x9e110f(0x1f0)];if(!_0x3a74d6[_0x9e110f(0x209)](_0x107914))return _0x9e110f(0x218)+_0x107914+_0x9e110f(0x1ef)+_0x3a74d6[_0x9e110f(0x1e3)](',\x20');return undefined;}async[a6_0x41f045(0x1f3)](_0x55d224){const _0x57c230=a6_0x41f045,{options:_0x12b760,args:_0x42a3e9,tdx:_0x5c6274}=_0x55d224,_0x48a278=_0x12b760,_0xb60a0c=_0x42a3e9[0x0],_0x21c5ba=(_0x48a278[_0x57c230(0x204)]||_0x57c230(0x211))['toUpperCase'](),_0x464326=_0x48a278[_0x57c230(0x1da)],_0x4ba2c0=_0x48a278[_0x57c230(0x216)],_0x398c14=_0x48a278[_0x57c230(0x20b)],_0x189dcc=_0x48a278[_0x57c230(0x1ee)]||'td';try{const _0x169afd={};if(_0x398c14){const _0x3c3876=Array[_0x57c230(0x20a)](_0x398c14)?_0x398c14:[_0x398c14];for(const _0x3cdc10 of _0x3c3876){const [_0x3fac3f,_0x284dd2]=parseHeader(_0x3cdc10);_0x169afd[_0x3fac3f]=_0x284dd2;}}let _0x31b577;if(_0x464326)_0x31b577=_0x464326;else{if(_0x4ba2c0)try{_0x31b577=RawAPI['readBodyFromFile'](_0x4ba2c0);}catch(_0xf13880){return console['error'](_0x57c230(0x1f4)+(_0xf13880 instanceof Error?_0xf13880[_0x57c230(0x1e0)]:String(_0xf13880))),0x1;}}const _0x2632c9={'method':_0x21c5ba,'apiType':_0x189dcc,'includeHeaders':_0x12b760[_0x57c230(0x212)]};_0x31b577&&(_0x2632c9[_0x57c230(0x1e6)]=_0x31b577);Object[_0x57c230(0x210)](_0x169afd)['length']>0x0&&(_0x2632c9[_0x57c230(0x1ed)]=_0x169afd);if(_0x12b760[_0x57c230(0x212)]){const _0x41036a=resolveSite(_0x12b760['site']),_0x2cf7a5=getEndpoint(_0x41036a,_0x189dcc),_0x479fd9=''+_0x2cf7a5+_0xb60a0c;console['error']('>\x20'+_0x21c5ba+'\x20'+_0x479fd9);const _0x39822f=getAuthHeaders(_0x41036a),_0xcd9a2a={..._0x39822f,..._0x169afd};for(const [_0x278c56,_0x3323ce]of Object[_0x57c230(0x1d8)](_0xcd9a2a)){!isSensitiveHeader(_0x278c56)&&console['error']('>\x20'+_0x278c56+':\x20'+_0x3323ce);}_0x31b577&&console[_0x57c230(0x214)]('>'),console[_0x57c230(0x214)]('');}const _0x18582b=await _0x5c6274[_0x57c230(0x1ea)][_0x57c230(0x1e8)](_0xb60a0c,_0x2632c9);if(_0x12b760[_0x57c230(0x212)]&&_0x18582b['headers']){console['error'](_0x57c230(0x1d9)+_0x18582b['status']);for(const [_0x3bd9e4,_0x1efdc4]of Object[_0x57c230(0x1d8)](_0x18582b[_0x57c230(0x1ed)])){!isSensitiveHeader(_0x3bd9e4)&&console[_0x57c230(0x214)]('<\x20'+_0x3bd9e4+':\x20'+_0x1efdc4);}console[_0x57c230(0x214)]('');}const _0x3ab07a=Boolean(_0x12b760[_0x57c230(0x1fe)]),_0x3cf20d={'color':_0x12b760[_0x57c230(0x1fc)],'noColor':_0x12b760['noColor']||_0x3ab07a&&!_0x12b760[_0x57c230(0x1fc)]},_0x366c55=colorizeJSON(_0x18582b[_0x57c230(0x1da)],_0x3cf20d);return _0x12b760[_0x57c230(0x1fe)]?(writeFileSync(_0x12b760[_0x57c230(0x1fe)],_0x366c55),console['error']('Results\x20saved\x20to\x20'+_0x12b760[_0x57c230(0x1fe)])):console[_0x57c230(0x1e5)](_0x366c55),0x0;}catch(_0x564ca2){return _0x564ca2 instanceof Error?(console[_0x57c230(0x214)](_0x57c230(0x1f4)+_0x564ca2[_0x57c230(0x1e0)]),_0x12b760[_0x57c230(0x212)]&&_0x564ca2[_0x57c230(0x208)]&&console[_0x57c230(0x214)](_0x57c230(0x1de)+_0x564ca2[_0x57c230(0x208)])):console['error'](_0x57c230(0x1f4)+String(_0x564ca2)),0x1;}}}
1
+ const a6_0x39dc0a=a6_0x19ec;(function(_0x8da0e4,_0x170b90){const _0x4140fd=a6_0x19ec,_0x444797=_0x8da0e4();while(!![]){try{const _0x3ff119=-parseInt(_0x4140fd(0xd7))/0x1*(parseInt(_0x4140fd(0xa9))/0x2)+-parseInt(_0x4140fd(0xc8))/0x3*(parseInt(_0x4140fd(0xd3))/0x4)+parseInt(_0x4140fd(0xac))/0x5*(-parseInt(_0x4140fd(0xba))/0x6)+-parseInt(_0x4140fd(0x97))/0x7*(parseInt(_0x4140fd(0xce))/0x8)+-parseInt(_0x4140fd(0xa2))/0x9+-parseInt(_0x4140fd(0xaf))/0xa*(parseInt(_0x4140fd(0xa4))/0xb)+parseInt(_0x4140fd(0xb0))/0xc*(parseInt(_0x4140fd(0xc3))/0xd);if(_0x3ff119===_0x170b90)break;else _0x444797['push'](_0x444797['shift']());}catch(_0x42466f){_0x444797['push'](_0x444797['shift']());}}}(a6_0x2b38,0xf105e));import{BaseCommand}from'./command.js';function a6_0x2b38(){const _0x132a9d=['type','GET','error','set-cookie2','4221GKkGhE','trim','name','verbose','<\x20HTTP/1.1\x20','indexOf','includes','api','substring','message','execute','2424834xicYSG','authorization','110heqIHU','length','x-trino-user','PATCH','PUT','756xpOSGa','readBodyFromFile','stack','5ldLnau','noColor','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','712700TUluLX','8628QIIade','Error:\x20','.\x20Valid\x20methods:\x20','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','toLowerCase','\x0aStack\x20trace:\x0a','headers','entries','join','x-auth-token','495570lLyqTy','Endpoint\x20must\x20start\x20with\x20/:\x20','toUpperCase','Invalid\x20HTTP\x20method:\x20','log','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','color','proxy-authorization','status','98813MUpaRR','set-cookie','isArray','cdp','data','681WQpIXU','Invalid\x20API\x20type:\x20','method','description','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','has','24184jQWQXe','Invalid\x20header\x20format:\x20\x22','request','cookie','file','19204IyMkYI','llm','output','Results\x20saved\x20to\x20','1324JDKmKC','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','startsWith'];a6_0x2b38=function(){return _0x132a9d;};return a6_0x2b38();}import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a6_0x39dc0a(0xa3),a6_0x39dc0a(0xc1),a6_0x39dc0a(0xd1),a6_0x39dc0a(0xc4),a6_0x39dc0a(0x96),'x-xsrf-token',a6_0x39dc0a(0xb9),a6_0x39dc0a(0xa6)]);function a6_0x19ec(_0x30ef87,_0x20af65){_0x30ef87=_0x30ef87-0x93;const _0x2b38d1=a6_0x2b38();let _0x19ec54=_0x2b38d1[_0x30ef87];return _0x19ec54;}function isSensitiveHeader(_0x45989c){const _0x3ac8f1=a6_0x39dc0a;return SENSITIVE_HEADERS[_0x3ac8f1(0xcd)](_0x45989c[_0x3ac8f1(0xb4)]());}function parseHeader(_0x3bdd71){const _0x19363d=a6_0x39dc0a,_0x57c93f=_0x3bdd71[_0x19363d(0x9c)](':');if(_0x57c93f===-0x1)throw new Error(_0x19363d(0xcf)+_0x3bdd71+'\x22.\x20'+_0x19363d(0xbf));const _0x4c0052=_0x3bdd71[_0x19363d(0x9f)](0x0,_0x57c93f)[_0x19363d(0x98)](),_0x3cf5af=_0x3bdd71[_0x19363d(0x9f)](_0x57c93f+0x1)[_0x19363d(0x98)]();if(!_0x4c0052)throw new Error(_0x19363d(0xcc)+_0x3bdd71+'\x22');return[_0x4c0052,_0x3cf5af];}export class ApiCommand extends BaseCommand{[a6_0x39dc0a(0x99)]='api';[a6_0x39dc0a(0xcb)]=a6_0x39dc0a(0xb3);['validate'](_0x57d087){const _0x46888c=a6_0x39dc0a,{args:_0x14668a,options:_0x410a9b}=_0x57d087,_0x53685e=_0x410a9b;if(_0x14668a[_0x46888c(0xa5)]===0x0)return _0x46888c(0xd8);const _0x1b072d=_0x14668a[0x0];if(!_0x1b072d[_0x46888c(0xd9)]('/'))return _0x46888c(0xbb)+_0x1b072d;const _0x3b5e53=_0x53685e[_0x46888c(0xc7)],_0x8f3896=_0x53685e['file'];if(_0x3b5e53&&_0x8f3896)return _0x46888c(0xae);const _0x54f26c=_0x53685e[_0x46888c(0xca)]||_0x46888c(0x94),_0x4b682c=[_0x46888c(0x94),'POST',_0x46888c(0xa8),'DELETE',_0x46888c(0xa7)];if(!_0x4b682c[_0x46888c(0x9d)](_0x54f26c['toUpperCase']()))return _0x46888c(0xbd)+_0x54f26c+_0x46888c(0xb2)+_0x4b682c[_0x46888c(0xb8)](',\x20');const _0x2bd8d9=_0x53685e['type']||'td',_0x2b025e=['td',_0x46888c(0xc6),'workflow','trino',_0x46888c(0xd4),'llm-proxy'];if(!_0x2b025e['includes'](_0x2bd8d9))return _0x46888c(0xc9)+_0x2bd8d9+'.\x20Valid\x20types:\x20'+_0x2b025e['join'](',\x20');return undefined;}async[a6_0x39dc0a(0xa1)](_0xbc2e23){const _0x1fb48e=a6_0x39dc0a,{options:_0x203924,args:_0x88b306,tdx:_0x569772}=_0xbc2e23,_0x2c6075=_0x203924,_0x3d3b11=_0x88b306[0x0],_0x2d5bf1=(_0x2c6075[_0x1fb48e(0xca)]||_0x1fb48e(0x94))[_0x1fb48e(0xbc)](),_0x1efb09=_0x2c6075[_0x1fb48e(0xc7)],_0x1e5edb=_0x2c6075[_0x1fb48e(0xd2)],_0x10b780=_0x2c6075['header'],_0x4868df=_0x2c6075[_0x1fb48e(0x93)]||'td';try{const _0x344799={};if(_0x10b780){const _0x1f7adb=Array[_0x1fb48e(0xc5)](_0x10b780)?_0x10b780:[_0x10b780];for(const _0x46a050 of _0x1f7adb){const [_0x45dde4,_0x682448]=parseHeader(_0x46a050);_0x344799[_0x45dde4]=_0x682448;}}let _0x4160d2;if(_0x1efb09)_0x4160d2=_0x1efb09;else{if(_0x1e5edb)try{_0x4160d2=RawAPI[_0x1fb48e(0xaa)](_0x1e5edb);}catch(_0x1272be){return console[_0x1fb48e(0x95)](_0x1fb48e(0xb1)+(_0x1272be instanceof Error?_0x1272be[_0x1fb48e(0xa0)]:String(_0x1272be))),0x1;}}const _0xac8886={'method':_0x2d5bf1,'apiType':_0x4868df,'includeHeaders':_0x203924['verbose']};_0x4160d2&&(_0xac8886['body']=_0x4160d2);Object['keys'](_0x344799)[_0x1fb48e(0xa5)]>0x0&&(_0xac8886['headers']=_0x344799);if(_0x203924[_0x1fb48e(0x9a)]){const _0x37f01e=resolveSite(_0x203924['site']),_0x5be1f6=getEndpoint(_0x37f01e,_0x4868df),_0x1bccba=''+_0x5be1f6+_0x3d3b11;console[_0x1fb48e(0x95)]('>\x20'+_0x2d5bf1+'\x20'+_0x1bccba);const _0x5d3711=getAuthHeaders(_0x37f01e),_0x1a8a4c={..._0x5d3711,..._0x344799};for(const [_0x11ebc0,_0x1bf0fb]of Object[_0x1fb48e(0xb7)](_0x1a8a4c)){!isSensitiveHeader(_0x11ebc0)&&console[_0x1fb48e(0x95)]('>\x20'+_0x11ebc0+':\x20'+_0x1bf0fb);}_0x4160d2&&console['error']('>'),console[_0x1fb48e(0x95)]('');}const _0x992314=await _0x569772[_0x1fb48e(0x9e)][_0x1fb48e(0xd0)](_0x3d3b11,_0xac8886);if(_0x203924[_0x1fb48e(0x9a)]&&_0x992314['headers']){console[_0x1fb48e(0x95)](_0x1fb48e(0x9b)+_0x992314[_0x1fb48e(0xc2)]);for(const [_0x2d241b,_0x5171b1]of Object[_0x1fb48e(0xb7)](_0x992314[_0x1fb48e(0xb6)])){!isSensitiveHeader(_0x2d241b)&&console['error']('<\x20'+_0x2d241b+':\x20'+_0x5171b1);}console[_0x1fb48e(0x95)]('');}const _0x1c5871=Boolean(_0x203924[_0x1fb48e(0xd5)]),_0x5ab356={'color':_0x203924[_0x1fb48e(0xc0)],'noColor':_0x203924[_0x1fb48e(0xad)]||_0x1c5871&&!_0x203924[_0x1fb48e(0xc0)]},_0x5db3ea=colorizeJSON(_0x992314[_0x1fb48e(0xc7)],_0x5ab356);return _0x203924[_0x1fb48e(0xd5)]?(writeFileSync(_0x203924[_0x1fb48e(0xd5)],_0x5db3ea),console['error'](_0x1fb48e(0xd6)+_0x203924[_0x1fb48e(0xd5)])):console[_0x1fb48e(0xbe)](_0x5db3ea),0x0;}catch(_0x26fa2a){return _0x26fa2a instanceof Error?(console[_0x1fb48e(0x95)]('Error:\x20'+_0x26fa2a[_0x1fb48e(0xa0)]),_0x203924['verbose']&&_0x26fa2a[_0x1fb48e(0xab)]&&console[_0x1fb48e(0x95)](_0x1fb48e(0xb5)+_0x26fa2a[_0x1fb48e(0xab)])):console['error'](_0x1fb48e(0xb1)+String(_0x26fa2a)),0x1;}}}
@@ -1 +1 @@
1
- const a7_0x142097=a7_0x56dd;(function(_0x45b82b,_0x83ec56){const _0x4b28d8=a7_0x56dd,_0x465ef1=_0x45b82b();while(!![]){try{const _0x50e1ad=-parseInt(_0x4b28d8(0x11d))/0x1+parseInt(_0x4b28d8(0x11f))/0x2+-parseInt(_0x4b28d8(0xef))/0x3+parseInt(_0x4b28d8(0x102))/0x4*(parseInt(_0x4b28d8(0x118))/0x5)+-parseInt(_0x4b28d8(0xf5))/0x6+parseInt(_0x4b28d8(0x120))/0x7+-parseInt(_0x4b28d8(0xf2))/0x8*(parseInt(_0x4b28d8(0xee))/0x9);if(_0x50e1ad===_0x83ec56)break;else _0x465ef1['push'](_0x465ef1['shift']());}catch(_0x501f67){_0x465ef1['push'](_0x465ef1['shift']());}}}(a7_0x51ba,0xc1ced));function a7_0x51ba(){const _0x49a1f2=['\x0aSetup\x20cancelled','name','1494905wPoanR','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','3122466sdpahs','9003743BBfSjn','apiKey','error','/app/mp/ak','execute','last_name','create','Setup\x20API\x20key\x20authentication\x20interactively','\x20--profile\x20','\x20(profile:\x20','logLevel','customSite','red','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','site','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','test','\x20\x20tdx','getUserInfo','Remove\x20API\x20key\x20from\x20system\x20keychain','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','1011006knNnrh','402357MXqcxE','Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20','✓\x20API\x20key\x20removed\x20from\x20keychain','56tXWPEk','Name:\x20','✓\x20Profile\x20\x27','5727834AhilGZ','email','description','tdx:\x20auth\x20clear','jobs','auth:setup','message','ERROR','API\x20key\x20cannot\x20be\x20empty','User:\x20','yellow','auth','✓\x20Authentication\x20successful\x0a','4jNXRpQ','warn','\x20for\x20profile:\x20','first_name','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','status','password','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','join','\x27\x20registered','bold','log','✓\x20Default\x20site\x20set\x20to\x20','trim','green','✗\x20Validation\x20failed:\x20','profile','Site\x20name\x20cannot\x20be\x20empty','us01','No\x20credential\x20found','auth:clear','text','6581780uRijkc','\x20(site:\x20','Validating\x20API\x20key...'];a7_0x51ba=function(){return _0x49a1f2;};return a7_0x51ba();}import{BaseCommand,printAuthError}from'./command.js';function a7_0x56dd(_0x40b2ae,_0x466a58){_0x40b2ae=_0x40b2ae-0xeb;const _0x51ba22=a7_0x51ba();let _0x56dd59=_0x51ba22[_0x40b2ae];return _0x56dd59;}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_0x53b68e 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_0xc152d8 from'chalk';export class AuthSetupCommand extends BaseCommand{[a7_0x142097(0x11c)]=a7_0x142097(0xfa);['description']=a7_0x142097(0x127);async['execute'](_0x32bb5f){const _0x1c2722=a7_0x142097,{options:_0x529d8a}=_0x32bb5f,_0x5a8add=_0x529d8a['profile'];console['log'](a7_0xc152d8['bold']('tdx:\x20auth\x20setup'));const _0x3aeb86=_0x529d8a[_0x1c2722(0x12f)]||'us01',{choices:_0x3176b3,initialIndex:_0x209c22}=buildSiteChoices(_0x3aeb86),_0x319bca=_0x5a8add?_0x1c2722(0xf0)+_0x5a8add+'):':'Select\x20your\x20Treasure\x20Data\x20site:',_0x1515dc=await a7_0x53b68e({'type':'select','name':_0x1c2722(0x12f),'message':_0x319bca,'choices':_0x3176b3,'initial':_0x209c22});if(!_0x1515dc[_0x1c2722(0x12f)])return console[_0x1c2722(0x10d)](_0x1c2722(0x11b)),0x1;let _0x5110f2;if(_0x1515dc[_0x1c2722(0x12f)]==='other'){const _0x2f050d=await a7_0x53b68e({'type':_0x1c2722(0x117),'name':_0x1c2722(0x12b),'message':'Enter\x20site\x20name:','initial':_0x1c2722(0x114),'validate':_0x3364bf=>{const _0x7bd95f=_0x1c2722;if(!_0x3364bf||!_0x3364bf[_0x7bd95f(0x10f)]())return _0x7bd95f(0x113);if(!/^[a-z0-9-]+$/[_0x7bd95f(0x131)](_0x3364bf[_0x7bd95f(0x10f)]()))return _0x7bd95f(0x11e);return!![];}});if(!_0x2f050d[_0x1c2722(0x12b)])return console[_0x1c2722(0x10d)](_0x1c2722(0x11b)),0x1;_0x5110f2=_0x2f050d[_0x1c2722(0x12b)];}else _0x5110f2=_0x1515dc[_0x1c2722(0x12f)];const _0x3559e0=resolveSite(_0x5110f2);console[_0x1c2722(0x10d)]('Setting\x20up\x20authentication\x20for\x20site:\x20'+_0x3559e0),console['log']('You\x20can\x20find\x20your\x20API\x20key\x20at:'),console[_0x1c2722(0x10d)]('\x20\x20'+getConsoleUrl(_0x3559e0,_0x1c2722(0x123)));const _0x4215f3=await a7_0x53b68e({'type':_0x1c2722(0x108),'name':_0x1c2722(0x121),'message':'Enter\x20your\x20TD\x20API\x20key:','validate':_0x6a0a53=>{const _0x38c9c1=_0x1c2722;if(!_0x6a0a53||!_0x6a0a53[_0x38c9c1(0x10f)]())return _0x38c9c1(0xfd);return!![];}});if(!_0x4215f3[_0x1c2722(0x121)])return console[_0x1c2722(0x10d)](_0x1c2722(0x11b)),0x1;const _0x7d2c0d=_0x4215f3['apiKey'];console[_0x1c2722(0x10d)](_0x1c2722(0x11a));try{const _0xef435c=TDX[_0x1c2722(0x126)]({'site':_0x3559e0,'apiKey':_0x7d2c0d[_0x1c2722(0x10f)](),'logLevel':_0x529d8a[_0x1c2722(0x12a)]??LogLevel[_0x1c2722(0xfc)]}),_0x47e1f1=await _0xef435c[_0x1c2722(0xf9)]['getUserInfo']();console[_0x1c2722(0x10d)]('✓\x20API\x20key\x20is\x20valid\x20(User:\x20'+_0x47e1f1[_0x1c2722(0xf6)]+')');const _0x357316=await isKeychainAvailable();_0x357316?(await saveAPIKeyAsync(_0x7d2c0d[_0x1c2722(0x10f)](),_0x3559e0,_0x5a8add),console['log'](_0x1c2722(0x12d)+(_0x5a8add?_0x1c2722(0x129)+_0x5a8add+')':''))):(console[_0x1c2722(0x103)](a7_0xc152d8[_0x1c2722(0xff)](_0x1c2722(0xed))),console['warn'](a7_0xc152d8[_0x1c2722(0xff)](_0x1c2722(0x109))));if(_0x5a8add){const _0x80da5b={'site':_0x3559e0};saveProfileToUserConfig(_0x5a8add,_0x80da5b),console[_0x1c2722(0x10d)](_0x1c2722(0xf4)+_0x5a8add+_0x1c2722(0x10b));}else saveDefaultSiteToUserConfig(_0x3559e0),console[_0x1c2722(0x10d)](_0x1c2722(0x10e)+_0x3559e0);const _0x476400=_0x5a8add?_0x1c2722(0x128)+_0x5a8add:'';return console[_0x1c2722(0x10d)](),console[_0x1c2722(0x10d)]('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console[_0x1c2722(0x10d)]('\x20\x20tdx'+_0x476400+_0x1c2722(0x130)),console['log'](_0x1c2722(0x132)+_0x476400+_0x1c2722(0x106)),0x0;}catch(_0x4bdf73){if(_0x4bdf73 instanceof HTTPClientError&&_0x4bdf73['status']===0x191)return printAuthError(_0x4bdf73),0x1;return console['error'](a7_0xc152d8[_0x1c2722(0x12c)](_0x1c2722(0x111)+(_0x4bdf73 instanceof Error?_0x4bdf73['message']:String(_0x4bdf73)))),console[_0x1c2722(0x122)]('API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.'),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x142097(0x11c)]=a7_0x142097(0x100);[a7_0x142097(0xf7)]=a7_0x142097(0x12e);async[a7_0x142097(0x124)](_0x104b2d){const _0x13c2e5=a7_0x142097,{options:_0x500be8,tdx:_0x59e78c}=_0x104b2d,_0x446288=_0x500be8[_0x13c2e5(0x12f)],_0x4c12fc=_0x500be8[_0x13c2e5(0x112)],_0x57f46b=_0x4c12fc?_0x4c12fc:'N/A';console['log']('tdx\x20profile:\x20'+_0x57f46b+_0x13c2e5(0x119)+_0x446288+')');const _0x297c06=await resolveAPIKeyAsync(_0x446288,_0x4c12fc);if(_0x297c06){const {source:_0x344593,isDeprecated:_0x3f8322}=_0x297c06,_0x39f8a8='Read\x20credential\x20from\x20'+_0x344593;console[_0x13c2e5(0x10d)](_0x3f8322?a7_0xc152d8[_0x13c2e5(0xff)](_0x39f8a8):_0x39f8a8);}else console[_0x13c2e5(0x10d)](a7_0xc152d8[_0x13c2e5(0xff)](_0x13c2e5(0x115)));try{const _0x513571=await _0x59e78c['jobs'][_0x13c2e5(0xeb)]();return console['log'](a7_0xc152d8[_0x13c2e5(0x110)](_0x13c2e5(0x101))),console[_0x13c2e5(0x10d)](_0x13c2e5(0xfe)+_0x513571['email']),(_0x513571[_0x13c2e5(0x105)]||_0x513571[_0x13c2e5(0x125)])&&console[_0x13c2e5(0x10d)](_0x13c2e5(0xf3)+[_0x513571[_0x13c2e5(0x105)],_0x513571[_0x13c2e5(0x125)]]['filter'](Boolean)[_0x13c2e5(0x10a)]('\x20')),0x0;}catch(_0x5b3a96){return _0x5b3a96 instanceof HTTPClientError&&_0x5b3a96[_0x13c2e5(0x107)]===0x191?printAuthError(_0x5b3a96,!![],_0x4c12fc):console['error'](a7_0xc152d8[_0x13c2e5(0x12c)](_0x13c2e5(0x111)+(_0x5b3a96 instanceof Error?_0x5b3a96[_0x13c2e5(0xfb)]:String(_0x5b3a96)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x142097(0x11c)]=a7_0x142097(0x116);[a7_0x142097(0xf7)]=a7_0x142097(0xec);async['execute'](_0x56413f){const _0x3518bb=a7_0x142097,{options:_0x1b4b64}=_0x56413f,_0x290a3a=_0x1b4b64[_0x3518bb(0x112)];console[_0x3518bb(0x10d)](a7_0xc152d8[_0x3518bb(0x10c)](_0x3518bb(0xf8)));const _0x22dd09=await isKeychainAvailable();if(!_0x22dd09)return console['error'](a7_0xc152d8[_0x3518bb(0x12c)]('System\x20keychain\x20is\x20not\x20available')),0x1;const _0x2ec7e6=await deleteKeychainAPIKey(_0x290a3a);return _0x2ec7e6?(clearCredentialCache(),console[_0x3518bb(0x10d)](_0x3518bb(0xf1)+(_0x290a3a?_0x3518bb(0x129)+_0x290a3a+')':'')),0x0):(console[_0x3518bb(0x10d)]('No\x20API\x20key\x20found\x20in\x20keychain'+(_0x290a3a?_0x3518bb(0x104)+_0x290a3a:'')),0x1);}}
1
+ const a7_0x4c407b=a7_0x34a2;(function(_0xe65489,_0x3f4ee2){const _0x314637=a7_0x34a2,_0x4fe080=_0xe65489();while(!![]){try{const _0x47910d=parseInt(_0x314637(0x11d))/0x1+parseInt(_0x314637(0x11a))/0x2+-parseInt(_0x314637(0x10d))/0x3*(-parseInt(_0x314637(0xfc))/0x4)+parseInt(_0x314637(0xf3))/0x5*(-parseInt(_0x314637(0x10f))/0x6)+-parseInt(_0x314637(0x112))/0x7*(parseInt(_0x314637(0x106))/0x8)+-parseInt(_0x314637(0xee))/0x9*(parseInt(_0x314637(0xff))/0xa)+-parseInt(_0x314637(0xf2))/0xb*(-parseInt(_0x314637(0xf0))/0xc);if(_0x47910d===_0x3f4ee2)break;else _0x4fe080['push'](_0x4fe080['shift']());}catch(_0x2b441e){_0x4fe080['push'](_0x4fe080['shift']());}}}(a7_0x519e,0x856e5));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_0x112ec8 from'prompts';import{HTTPClientError}from'../sdk/client/http-client.js';function a7_0x34a2(_0x48e3cc,_0x4f057b){_0x48e3cc=_0x48e3cc-0xdb;const _0x519e65=a7_0x519e();let _0x34a250=_0x519e65[_0x48e3cc];return _0x34a250;}import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a7_0xdae8d9 from'chalk';export class AuthSetupCommand extends BaseCommand{[a7_0x4c407b(0xe9)]=a7_0x4c407b(0xef);['description']=a7_0x4c407b(0x11c);async['execute'](_0x312cf3){const _0x1b14dc=a7_0x4c407b,{options:_0x1abd35}=_0x312cf3,_0x833504=_0x1abd35['profile'];console[_0x1b14dc(0x105)](a7_0xdae8d9[_0x1b14dc(0xe4)]('tdx:\x20auth\x20setup'));const _0x1dd3a0=_0x1abd35['site']||_0x1b14dc(0x11e),{choices:_0x5cf2d9,initialIndex:_0x4c4ec8}=buildSiteChoices(_0x1dd3a0),_0x4c09ec=_0x833504?'Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20'+_0x833504+'):':_0x1b14dc(0x120),_0x43dddf=await a7_0x112ec8({'type':_0x1b14dc(0xec),'name':_0x1b14dc(0x114),'message':_0x4c09ec,'choices':_0x5cf2d9,'initial':_0x4c4ec8});if(!_0x43dddf[_0x1b14dc(0x114)])return console[_0x1b14dc(0x105)](_0x1b14dc(0x128)),0x1;let _0x382308;if(_0x43dddf[_0x1b14dc(0x114)]===_0x1b14dc(0xdd)){const _0x4b5840=await a7_0x112ec8({'type':_0x1b14dc(0x109),'name':_0x1b14dc(0x125),'message':_0x1b14dc(0x102),'initial':'us01','validate':_0x2f98d1=>{const _0x5b626c=_0x1b14dc;if(!_0x2f98d1||!_0x2f98d1[_0x5b626c(0xe7)]())return'Site\x20name\x20cannot\x20be\x20empty';if(!/^[a-z0-9-]+$/[_0x5b626c(0x121)](_0x2f98d1[_0x5b626c(0xe7)]()))return _0x5b626c(0xfe);return!![];}});if(!_0x4b5840[_0x1b14dc(0x125)])return console['log'](_0x1b14dc(0x128)),0x1;_0x382308=_0x4b5840[_0x1b14dc(0x125)];}else _0x382308=_0x43dddf[_0x1b14dc(0x114)];const _0x79be68=resolveSite(_0x382308);console[_0x1b14dc(0x105)](_0x1b14dc(0xe5)+_0x79be68),console[_0x1b14dc(0x105)](_0x1b14dc(0x103)),console[_0x1b14dc(0x105)]('\x20\x20'+getConsoleUrl(_0x79be68,_0x1b14dc(0xe6)));const _0x3fa7c7=await a7_0x112ec8({'type':_0x1b14dc(0x101),'name':_0x1b14dc(0x110),'message':_0x1b14dc(0x10b),'validate':_0xaa73a2=>{const _0x283563=_0x1b14dc;if(!_0xaa73a2||!_0xaa73a2[_0x283563(0xe7)]())return _0x283563(0xfb);return!![];}});if(!_0x3fa7c7[_0x1b14dc(0x110)])return console[_0x1b14dc(0x105)](_0x1b14dc(0x128)),0x1;const _0x36e8e6=_0x3fa7c7[_0x1b14dc(0x110)];console[_0x1b14dc(0x105)](_0x1b14dc(0x117));try{const _0x4e3ac5=TDX[_0x1b14dc(0xfa)]({'site':_0x79be68,'apiKey':_0x36e8e6[_0x1b14dc(0xe7)](),'logLevel':_0x1abd35[_0x1b14dc(0xdf)]??LogLevel['ERROR']}),_0x4a1c85=await _0x4e3ac5['jobs']['getUserInfo']();console[_0x1b14dc(0x105)](_0x1b14dc(0x122)+_0x4a1c85[_0x1b14dc(0xf8)]+')');const _0xc8ba32=await isKeychainAvailable();_0xc8ba32?(await saveAPIKeyAsync(_0x36e8e6[_0x1b14dc(0xe7)](),_0x79be68,_0x833504),console['log'](_0x1b14dc(0x118)+(_0x833504?_0x1b14dc(0xfd)+_0x833504+')':''))):(console[_0x1b14dc(0x127)](a7_0xdae8d9[_0x1b14dc(0xe8)](_0x1b14dc(0xea))),console[_0x1b14dc(0x127)](a7_0xdae8d9[_0x1b14dc(0xe8)]('\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.')));if(_0x833504){const _0x55edc9={'site':_0x79be68};saveProfileToUserConfig(_0x833504,_0x55edc9),console[_0x1b14dc(0x105)](_0x1b14dc(0xf6)+_0x833504+_0x1b14dc(0x124));}else saveDefaultSiteToUserConfig(_0x79be68),console[_0x1b14dc(0x105)]('✓\x20Default\x20site\x20set\x20to\x20'+_0x79be68);const _0xd67be8=_0x833504?_0x1b14dc(0x100)+_0x833504:'';return console[_0x1b14dc(0x105)](),console[_0x1b14dc(0x105)]('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console[_0x1b14dc(0x105)]('\x20\x20tdx'+_0xd67be8+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console[_0x1b14dc(0x105)](_0x1b14dc(0xdb)+_0xd67be8+_0x1b14dc(0x115)),0x0;}catch(_0x562403){if(_0x562403 instanceof HTTPClientError&&_0x562403[_0x1b14dc(0xe0)]===0x191)return printAuthError(_0x562403),0x1;return console[_0x1b14dc(0xe1)](a7_0xdae8d9[_0x1b14dc(0x119)]('✗\x20Validation\x20failed:\x20'+(_0x562403 instanceof Error?_0x562403[_0x1b14dc(0xf5)]:String(_0x562403)))),console[_0x1b14dc(0xe1)]('API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.'),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x4c407b(0xe9)]='auth';['description']=a7_0x4c407b(0x116);async['execute'](_0x378548){const _0x3aebe6=a7_0x4c407b,{options:_0x5876b9,tdx:_0x52b921}=_0x378548,_0x6754b5=_0x5876b9[_0x3aebe6(0x114)],_0x38f674=_0x5876b9['profile'],_0x469526=_0x38f674?_0x38f674:_0x3aebe6(0xed);console[_0x3aebe6(0x105)](_0x3aebe6(0xf4)+_0x469526+_0x3aebe6(0x108)+_0x6754b5+')');const _0x228691=await resolveAPIKeyAsync(_0x6754b5,_0x38f674);if(_0x228691){const {source:_0x1588c6,isDeprecated:_0x3c4a9a}=_0x228691,_0x140e6e='Read\x20credential\x20from\x20'+_0x1588c6;console[_0x3aebe6(0x105)](_0x3c4a9a?a7_0xdae8d9[_0x3aebe6(0xe8)](_0x140e6e):_0x140e6e);}else console['log'](a7_0xdae8d9[_0x3aebe6(0xe8)](_0x3aebe6(0xde)));try{const _0x592559=await _0x52b921[_0x3aebe6(0xf7)][_0x3aebe6(0x126)]();return console[_0x3aebe6(0x105)](a7_0xdae8d9[_0x3aebe6(0x10a)](_0x3aebe6(0x111))),console[_0x3aebe6(0x105)](_0x3aebe6(0xf1)+_0x592559['email']),(_0x592559[_0x3aebe6(0x107)]||_0x592559[_0x3aebe6(0x11f)])&&console[_0x3aebe6(0x105)](_0x3aebe6(0xe3)+[_0x592559['first_name'],_0x592559['last_name']]['filter'](Boolean)[_0x3aebe6(0xe2)]('\x20')),0x0;}catch(_0x3b7e83){return _0x3b7e83 instanceof HTTPClientError&&_0x3b7e83['status']===0x191?printAuthError(_0x3b7e83,!![],_0x38f674):console[_0x3aebe6(0xe1)](a7_0xdae8d9['red'](_0x3aebe6(0x113)+(_0x3b7e83 instanceof Error?_0x3b7e83['message']:String(_0x3b7e83)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x4c407b(0xe9)]=a7_0x4c407b(0x10c);[a7_0x4c407b(0x10e)]=a7_0x4c407b(0xeb);async[a7_0x4c407b(0xf9)](_0x22ee51){const _0x1435c6=a7_0x4c407b,{options:_0x6b87da}=_0x22ee51,_0xe95e11=_0x6b87da[_0x1435c6(0x11b)];console[_0x1435c6(0x105)](a7_0xdae8d9[_0x1435c6(0xe4)]('tdx:\x20auth\x20clear'));const _0x146df2=await isKeychainAvailable();if(!_0x146df2)return console[_0x1435c6(0xe1)](a7_0xdae8d9[_0x1435c6(0x119)](_0x1435c6(0x123))),0x1;const _0x204c3b=await deleteKeychainAPIKey(_0xe95e11);return _0x204c3b?(clearCredentialCache(),console[_0x1435c6(0x105)]('✓\x20API\x20key\x20removed\x20from\x20keychain'+(_0xe95e11?_0x1435c6(0xfd)+_0xe95e11+')':'')),0x0):(console[_0x1435c6(0x105)](_0x1435c6(0xdc)+(_0xe95e11?_0x1435c6(0x104)+_0xe95e11:'')),0x1);}}function a7_0x519e(){const _0x53b310=['System\x20keychain\x20is\x20not\x20available','\x27\x20registered','customSite','getUserInfo','warn','\x0aSetup\x20cancelled','\x20\x20tdx','No\x20API\x20key\x20found\x20in\x20keychain','other','No\x20credential\x20found','logLevel','status','error','join','Name:\x20','bold','Setting\x20up\x20authentication\x20for\x20site:\x20','/app/mp/ak','trim','yellow','name','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','Remove\x20API\x20key\x20from\x20system\x20keychain','select','N/A','1026XRnacl','auth:setup','2292FKaXMF','User:\x20','74437qykURK','5oTpkPV','tdx\x20profile:\x20','message','✓\x20Profile\x20\x27','jobs','email','execute','create','API\x20key\x20cannot\x20be\x20empty','4inVtqq','\x20(profile:\x20','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','22630IINKdl','\x20--profile\x20','password','Enter\x20site\x20name:','You\x20can\x20find\x20your\x20API\x20key\x20at:','\x20for\x20profile:\x20','log','1376QafQTr','first_name','\x20(site:\x20','text','green','Enter\x20your\x20TD\x20API\x20key:','auth:clear','513699xFINXs','description','4413204jZrjVP','apiKey','✓\x20Authentication\x20successful\x0a','40558wHcSiv','✗\x20Validation\x20failed:\x20','site','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','Validating\x20API\x20key...','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','red','746598vIhwzf','profile','Setup\x20API\x20key\x20authentication\x20interactively','699588jFhuDm','us01','last_name','Select\x20your\x20Treasure\x20Data\x20site:','test','✓\x20API\x20key\x20is\x20valid\x20(User:\x20'];a7_0x519e=function(){return _0x53b310;};return a7_0x519e();}
@@ -1 +1 @@
1
- const a8_0x173098=a8_0x50cd;(function(_0x3f174c,_0x4f9f70){const _0x470b2c=a8_0x50cd,_0x27ba7c=_0x3f174c();while(!![]){try{const _0x57f112=parseInt(_0x470b2c(0x129))/0x1*(-parseInt(_0x470b2c(0x103))/0x2)+parseInt(_0x470b2c(0x12a))/0x3+-parseInt(_0x470b2c(0x113))/0x4*(parseInt(_0x470b2c(0x109))/0x5)+-parseInt(_0x470b2c(0x12b))/0x6*(parseInt(_0x470b2c(0x10f))/0x7)+-parseInt(_0x470b2c(0xfe))/0x8*(parseInt(_0x470b2c(0xfc))/0x9)+parseInt(_0x470b2c(0x112))/0xa+parseInt(_0x470b2c(0x104))/0xb;if(_0x57f112===_0x4f9f70)break;else _0x27ba7c['push'](_0x27ba7c['shift']());}catch(_0x27876a){_0x27ba7c['push'](_0x27ba7c['shift']());}}}(a8_0x3c45,0x6fb02));function a8_0x50cd(_0x22c7dc,_0x23063b){_0x22c7dc=_0x22c7dc-0xfb;const _0x3c45c4=a8_0x3c45();let _0x50cdaf=_0x3c45c4[_0x22c7dc];return _0x50cdaf;}import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{withSpinner}from'../utils/spinner.js';function a8_0x3c45(){const _0x497f89=['getAgentId','Getting\x20default\x20agent...','\x20\x20Cause:\x20','content','resolveProjectId','llmAgent','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','includes','error','chat','llmProject','28ltVOpf','2291115nbdKnD','2110428lFYJpO','chatId','claude-4.5-haiku','streamChat','getDefaultAgent','event','\x27...','\x0aError:\x20','19422WrPCeM','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','2512AljKPh','join','Using\x20cached\x20default\x20agent:\x20','CHAT_NOT_FOUND','No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22','47174mfYOKb','10677854jPRngz','execute','Continuing\x20chat:\x20','write','message','15185mwCUoz','stdout','new','cause','name','getOrCreateDefaultAgent','7taJGVK','llm','--agent\x20flag','4249890xjCWwk','16HelBWV','session\x20context','Chat\x20session:\x20','handleChatEvent','type','metadata','data','verbose','validate','Resolving\x20agent\x20\x27','code'];a8_0x3c45=function(){return _0x497f89;};return a8_0x3c45();}import{parseAgentRef}from'../sdk/agent/agent-ref-parser.js';import{saveLastChatId,loadLastChatId}from'../sdk/llm/chat-cache.js';function handleSDKError(_0xb44c2c,_0x40fe08){const _0x22b456=a8_0x50cd;if(_0xb44c2c instanceof SDKError)console[_0x22b456(0x126)]('Error:\x20'+_0xb44c2c[_0x22b456(0x108)]),_0x40fe08[_0x22b456(0x11a)]&&(_0xb44c2c[_0x22b456(0x10c)]&&console[_0x22b456(0x126)](_0x22b456(0x120)+_0xb44c2c[_0x22b456(0x10c)]),_0xb44c2c['stack']&&(console[_0x22b456(0x126)]('\x0aStack\x20trace:'),console[_0x22b456(0x126)](_0xb44c2c['stack'])));else throw _0xb44c2c;}export class ChatCommand extends BaseCommand{[a8_0x173098(0x10d)]=a8_0x173098(0x127);['description']='Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)';[a8_0x173098(0x11b)](_0x362d8c){const _0x222c02=a8_0x173098,_0x27af63=_0x362d8c['args'][_0x222c02(0xff)]('\x20');if(!_0x27af63)return _0x222c02(0xfd);return undefined;}async['streamChat'](_0x29c6ea,_0x35511a,_0x25936c,_0x4e53be,_0x326f8a){const _0x98ba85=a8_0x173098;for await(const _0x29abf2 of _0x29c6ea[_0x98ba85(0x110)][_0x98ba85(0x127)](_0x35511a,{'agentId':_0x25936c,'chatId':_0x4e53be})){if(_0x29abf2[_0x98ba85(0x117)]===_0x98ba85(0x118)){const _0x65a11e=_0x29abf2[_0x98ba85(0x119)][_0x98ba85(0x12c)];saveLastChatId(_0x65a11e),_0x326f8a&&console[_0x98ba85(0x126)](_0x98ba85(0x115)+_0x65a11e);}else _0x29abf2[_0x98ba85(0x117)]===_0x98ba85(0x130)&&this[_0x98ba85(0x116)](_0x29abf2[_0x98ba85(0x119)]);}}async[a8_0x173098(0x11e)](_0x3a5fae,_0x2475f6,_0x504820,_0x15925b,_0x3a9991){const _0x31d160=a8_0x173098,_0x3da98b=_0x2475f6||_0x504820;if(_0x3da98b){const {projectName:_0x226f05,agentName:_0x4196df}=parseAgentRef(_0x3da98b),_0x384408=_0x4196df||_0x3da98b,_0x4a53de=_0x4196df?_0x226f05:_0x15925b;if(!_0x4a53de)throw new Error(_0x31d160(0x102));if(_0x3a9991){const _0x2e9def=_0x2475f6?_0x31d160(0x111):_0x31d160(0x114);console['error']('Using\x20agent\x20from\x20'+_0x2e9def+':\x20'+_0x4a53de+'/'+_0x384408);}const _0x5153ac=await withSpinner('Resolving\x20project\x20\x27'+_0x4a53de+_0x31d160(0x131),()=>_0x3a5fae[_0x31d160(0x110)][_0x31d160(0x122)](_0x4a53de),{'verbose':_0x3a9991}),_0x3aee9c=await withSpinner(_0x31d160(0x11c)+_0x384408+'\x27...',()=>_0x3a5fae['llm']['resolveAgentId'](_0x384408,_0x5153ac[_0x31d160(0x119)]),{'verbose':_0x3a9991});return _0x3aee9c['data'];}else{const _0x538271=_0x3a5fae[_0x31d160(0x110)][_0x31d160(0x12f)]();if(_0x538271)return _0x3a9991&&console[_0x31d160(0x126)](_0x31d160(0x100)+_0x538271['name']),_0x538271['id'];const _0x319ff0=await withSpinner(_0x31d160(0x11f),()=>_0x3a5fae[_0x31d160(0x110)][_0x31d160(0x10e)](_0x31d160(0x12d),0x0),{'verbose':_0x3a9991});return _0x319ff0['data']['id'];}}async[a8_0x173098(0x105)](_0x24f46d){const _0x47033b=a8_0x173098,{options:_0x48f967,args:_0x4ddd92,tdx:_0x437127}=_0x24f46d,_0x15c9a7=_0x4ddd92[_0x47033b(0xff)]('\x20'),_0x74885e=_0x48f967,_0x1702a6=_0x74885e['agent'],_0x492324=_0x74885e[_0x47033b(0x123)],_0x820cf4=_0x74885e[_0x47033b(0x128)],_0x7497e0=_0x74885e[_0x47033b(0x10b)];try{let _0x1c0e77,_0x408025;!_0x7497e0&&(_0x408025=loadLastChatId(),_0x408025&&_0x48f967[_0x47033b(0x11a)]&&console[_0x47033b(0x126)](_0x47033b(0x106)+_0x408025));(_0x7497e0||!_0x408025)&&(_0x1c0e77=await this[_0x47033b(0x11e)](_0x437127,_0x1702a6,_0x492324,_0x820cf4,_0x48f967['verbose']));try{await this['streamChat'](_0x437127,_0x15c9a7,_0x1c0e77,_0x408025,_0x48f967['verbose']);}catch(_0x1fc43f){const _0x3fde4d=_0x1fc43f instanceof SDKError&&_0x1fc43f[_0x47033b(0x11d)]===ErrorCode[_0x47033b(0x101)]||_0x1fc43f instanceof Error&&_0x1fc43f['message'][_0x47033b(0x125)]('404');if(_0x3fde4d)_0x48f967[_0x47033b(0x11a)]&&console['error'](_0x47033b(0x124)),!_0x1c0e77&&(_0x1c0e77=await this[_0x47033b(0x11e)](_0x437127,_0x1702a6,_0x492324,_0x820cf4,_0x48f967[_0x47033b(0x11a)])),await this[_0x47033b(0x12e)](_0x437127,_0x15c9a7,_0x1c0e77,undefined,_0x48f967[_0x47033b(0x11a)]);else throw _0x1fc43f;}return console['log'](),0x0;}catch(_0x23db74){return console['error'](),handleSDKError(_0x23db74,_0x48f967),0x1;}}['handleChatEvent'](_0x45ed7b){const _0x673ab3=a8_0x173098;if(_0x673ab3(0x121)in _0x45ed7b)process[_0x673ab3(0x10a)][_0x673ab3(0x107)](_0x45ed7b[_0x673ab3(0x121)]);else _0x673ab3(0x126)in _0x45ed7b&&console['error'](_0x673ab3(0xfb)+_0x45ed7b['error']);}}
1
+ const a8_0x561f75=a8_0xbc0f;(function(_0x1f7d90,_0x4442e4){const _0x36a70f=a8_0xbc0f,_0x20e314=_0x1f7d90();while(!![]){try{const _0x528d22=-parseInt(_0x36a70f(0xf5))/0x1*(-parseInt(_0x36a70f(0xe9))/0x2)+-parseInt(_0x36a70f(0xd0))/0x3+-parseInt(_0x36a70f(0xeb))/0x4*(-parseInt(_0x36a70f(0xe5))/0x5)+parseInt(_0x36a70f(0xe4))/0x6+parseInt(_0x36a70f(0xe8))/0x7*(-parseInt(_0x36a70f(0xcb))/0x8)+parseInt(_0x36a70f(0xee))/0x9+-parseInt(_0x36a70f(0xfb))/0xa*(-parseInt(_0x36a70f(0xe7))/0xb);if(_0x528d22===_0x4442e4)break;else _0x20e314['push'](_0x20e314['shift']());}catch(_0x2a0c5e){_0x20e314['push'](_0x20e314['shift']());}}}(a8_0x544f,0x3b22b));import{BaseCommand}from'./command.js';function a8_0x544f(){const _0x5202ed=['validate','\x0aError:\x20','stack','llmProject','content','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','join','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','description','183128HyQuCc','message','includes','No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22','log','1389372VtHTtk','getAgentId','Using\x20agent\x20from\x20','write','streamChat','Using\x20cached\x20default\x20agent:\x20','data','code','type','Chat\x20session:\x20','cause','execute','verbose','new','chatId','handleChatEvent','llmAgent','404','chat','session\x20context','495102mVcfhU','7070CJmXye','getDefaultAgent','89056ZarjLi','119UEXXkw','119824pOiLdO','args','904jIYedB','resolveAgentId','error','1874313ViWRSO','--agent\x20flag','event','llm','agent','Error:\x20','claude-4.5-haiku','7lCavJJ','getOrCreateDefaultAgent','\x0aStack\x20trace:','Getting\x20default\x20agent...','\x27...','resolveProjectId','80AHFfpx'];a8_0x544f=function(){return _0x5202ed;};return a8_0x544f();}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_0xbc0f(_0x3e4b8a,_0x54e375){_0x3e4b8a=_0x3e4b8a-0xc4;const _0x544fe4=a8_0x544f();let _0xbc0fcc=_0x544fe4[_0x3e4b8a];return _0xbc0fcc;}function handleSDKError(_0x565dca,_0x15675e){const _0x2072b1=a8_0xbc0f;if(_0x565dca instanceof SDKError)console['error'](_0x2072b1(0xf3)+_0x565dca[_0x2072b1(0xcc)]),_0x15675e[_0x2072b1(0xdc)]&&(_0x565dca['cause']&&console[_0x2072b1(0xed)]('\x20\x20Cause:\x20'+_0x565dca[_0x2072b1(0xda)]),_0x565dca[_0x2072b1(0xc4)]&&(console[_0x2072b1(0xed)](_0x2072b1(0xf7)),console[_0x2072b1(0xed)](_0x565dca['stack'])));else throw _0x565dca;}export class ChatCommand extends BaseCommand{['name']=a8_0x561f75(0xe2);[a8_0x561f75(0xca)]=a8_0x561f75(0xc7);[a8_0x561f75(0xfc)](_0x164ad9){const _0x2d2b87=a8_0x561f75,_0x3ff343=_0x164ad9[_0x2d2b87(0xea)]['join']('\x20');if(!_0x3ff343)return'Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options';return undefined;}async[a8_0x561f75(0xd4)](_0x18cbef,_0x5b0a9f,_0x167d79,_0x1ded87,_0x18ddb5){const _0x473b38=a8_0x561f75;for await(const _0x5e4d57 of _0x18cbef[_0x473b38(0xf1)]['chat'](_0x5b0a9f,{'agentId':_0x167d79,'chatId':_0x1ded87})){if(_0x5e4d57[_0x473b38(0xd8)]==='metadata'){const _0x5a46b4=_0x5e4d57[_0x473b38(0xd6)][_0x473b38(0xde)];saveLastChatId(_0x5a46b4),_0x18ddb5&&console[_0x473b38(0xed)](_0x473b38(0xd9)+_0x5a46b4);}else _0x5e4d57[_0x473b38(0xd8)]===_0x473b38(0xf0)&&this[_0x473b38(0xdf)](_0x5e4d57[_0x473b38(0xd6)]);}}async[a8_0x561f75(0xd1)](_0x5368c8,_0x57997c,_0x3c2c13,_0x22f0a1,_0x1a28fb){const _0x350555=a8_0x561f75,_0x2b393f=_0x57997c||_0x3c2c13;if(_0x2b393f){const {projectName:_0x2374ee,agentName:_0x3fefcd}=parseAgentRef(_0x2b393f),_0x1f5cd4=_0x3fefcd||_0x2b393f,_0x588791=_0x3fefcd?_0x2374ee:_0x22f0a1;if(!_0x588791)throw new Error(_0x350555(0xce));if(_0x1a28fb){const _0x33fc13=_0x57997c?_0x350555(0xef):_0x350555(0xe3);console[_0x350555(0xed)](_0x350555(0xd2)+_0x33fc13+':\x20'+_0x588791+'/'+_0x1f5cd4);}const _0x70fbbb=await withSpinner('Resolving\x20project\x20\x27'+_0x588791+_0x350555(0xf9),()=>_0x5368c8[_0x350555(0xf1)][_0x350555(0xfa)](_0x588791),{'verbose':_0x1a28fb}),_0x5e82d9=await withSpinner('Resolving\x20agent\x20\x27'+_0x1f5cd4+_0x350555(0xf9),()=>_0x5368c8[_0x350555(0xf1)][_0x350555(0xec)](_0x1f5cd4,_0x70fbbb[_0x350555(0xd6)]),{'verbose':_0x1a28fb});return _0x5e82d9[_0x350555(0xd6)];}else{const _0x1451ae=_0x5368c8['llm'][_0x350555(0xe6)]();if(_0x1451ae)return _0x1a28fb&&console[_0x350555(0xed)](_0x350555(0xd5)+_0x1451ae['name']),_0x1451ae['id'];const _0x32b3f9=await withSpinner(_0x350555(0xf8),()=>_0x5368c8[_0x350555(0xf1)][_0x350555(0xf6)](_0x350555(0xf4),0x0),{'verbose':_0x1a28fb});return _0x32b3f9[_0x350555(0xd6)]['id'];}}async[a8_0x561f75(0xdb)](_0x143e44){const _0x20df23=a8_0x561f75,{options:_0x1fcf99,args:_0x1c8a2d,tdx:_0x3b1f96}=_0x143e44,_0x5b76da=_0x1c8a2d[_0x20df23(0xc8)]('\x20'),_0x226df2=_0x1fcf99,_0x3c3782=_0x226df2[_0x20df23(0xf2)],_0xc9985f=_0x226df2[_0x20df23(0xe0)],_0x1262d3=_0x226df2[_0x20df23(0xc5)],_0xd91727=_0x226df2[_0x20df23(0xdd)];try{let _0x1ac5d4,_0x43022e;!_0xd91727&&(_0x43022e=loadLastChatId(),_0x43022e&&_0x1fcf99[_0x20df23(0xdc)]&&console['error']('Continuing\x20chat:\x20'+_0x43022e));(_0xd91727||!_0x43022e)&&(_0x1ac5d4=await this[_0x20df23(0xd1)](_0x3b1f96,_0x3c3782,_0xc9985f,_0x1262d3,_0x1fcf99['verbose']));try{await this['streamChat'](_0x3b1f96,_0x5b76da,_0x1ac5d4,_0x43022e,_0x1fcf99[_0x20df23(0xdc)]);}catch(_0x14db5d){const _0x254c6a=_0x14db5d instanceof SDKError&&_0x14db5d[_0x20df23(0xd7)]===ErrorCode['CHAT_NOT_FOUND']||_0x14db5d instanceof Error&&_0x14db5d[_0x20df23(0xcc)][_0x20df23(0xcd)](_0x20df23(0xe1));if(_0x254c6a)_0x1fcf99[_0x20df23(0xdc)]&&console[_0x20df23(0xed)](_0x20df23(0xc9)),!_0x1ac5d4&&(_0x1ac5d4=await this['getAgentId'](_0x3b1f96,_0x3c3782,_0xc9985f,_0x1262d3,_0x1fcf99[_0x20df23(0xdc)])),await this[_0x20df23(0xd4)](_0x3b1f96,_0x5b76da,_0x1ac5d4,undefined,_0x1fcf99[_0x20df23(0xdc)]);else throw _0x14db5d;}return console[_0x20df23(0xcf)](),0x0;}catch(_0x141612){return console[_0x20df23(0xed)](),handleSDKError(_0x141612,_0x1fcf99),0x1;}}[a8_0x561f75(0xdf)](_0x734b5f){const _0x33a219=a8_0x561f75;if(_0x33a219(0xc6)in _0x734b5f)process['stdout'][_0x33a219(0xd3)](_0x734b5f[_0x33a219(0xc6)]);else _0x33a219(0xed)in _0x734b5f&&console[_0x33a219(0xed)](_0x33a219(0xfd)+_0x734b5f[_0x33a219(0xed)]);}}