@treasuredata/tdx 0.28.8 → 0.29.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 (211) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/chat-command.js +1 -1
  11. package/dist/commands/claude-command.js +1 -1
  12. package/dist/commands/claude-statusline-command.js +1 -1
  13. package/dist/commands/claude-usage-command.js +1 -1
  14. package/dist/commands/command.js +1 -1
  15. package/dist/commands/connection-command.js +1 -1
  16. package/dist/commands/databases.js +1 -1
  17. package/dist/commands/delivery-command.js +1 -1
  18. package/dist/commands/describe.js +1 -1
  19. package/dist/commands/engage-campaign-pull-command.js +1 -1
  20. package/dist/commands/engage-campaign-push-command.js +1 -1
  21. package/dist/commands/engage-campaign-validate-command.js +1 -1
  22. package/dist/commands/engage-command.js +1 -1
  23. package/dist/commands/job-command.js +1 -1
  24. package/dist/commands/journey-command.js +1 -1
  25. package/dist/commands/journey-validate-command.js +1 -1
  26. package/dist/commands/llm-command.js +1 -1
  27. package/dist/commands/mcp-command.js +1 -1
  28. package/dist/commands/parent-segment-command.js +1 -1
  29. package/dist/commands/profile-command.js +1 -1
  30. package/dist/commands/profiles-command.js +1 -1
  31. package/dist/commands/query-command.js +1 -1
  32. package/dist/commands/schedule-command.js +1 -1
  33. package/dist/commands/segment-command.js +1 -1
  34. package/dist/commands/segment-create-command.js +1 -1
  35. package/dist/commands/segment-fields-command.js +1 -1
  36. package/dist/commands/segment-pull-command.js +1 -1
  37. package/dist/commands/segment-push-command.d.ts.map +1 -1
  38. package/dist/commands/segment-push-command.js +1 -1
  39. package/dist/commands/segment-push-command.js.map +1 -1
  40. package/dist/commands/segment-update-command.js +1 -1
  41. package/dist/commands/segment-use-command.js +1 -1
  42. package/dist/commands/segment-validate-command.js +1 -1
  43. package/dist/commands/segments.js +1 -1
  44. package/dist/commands/show.js +1 -1
  45. package/dist/commands/status-command.js +1 -1
  46. package/dist/commands/tables.js +1 -1
  47. package/dist/commands/unset-command.js +1 -1
  48. package/dist/commands/upgrade-command.js +1 -1
  49. package/dist/commands/use-command.js +1 -1
  50. package/dist/commands/user-command.js +1 -1
  51. package/dist/commands/workflow-command.js +1 -1
  52. package/dist/core/auth.js +1 -1
  53. package/dist/core/command-output.js +1 -1
  54. package/dist/core/config.js +1 -1
  55. package/dist/core/connection-cache.js +1 -1
  56. package/dist/core/constants.js +1 -1
  57. package/dist/core/credential-cache.js +1 -1
  58. package/dist/core/global-context.js +1 -1
  59. package/dist/core/keychain.js +1 -1
  60. package/dist/core/profile.js +1 -1
  61. package/dist/core/project-config.js +1 -1
  62. package/dist/core/session.js +1 -1
  63. package/dist/core/user-cache.js +1 -1
  64. package/dist/core/version.js +1 -1
  65. package/dist/index.js +1 -1
  66. package/dist/mcp/server.js +1 -1
  67. package/dist/mcp/tools/index.js +1 -1
  68. package/dist/mcp/tools/tdx-run.js +1 -1
  69. package/dist/mcp/tools/tdx-search.js +1 -1
  70. package/dist/mcp/utils.js +1 -1
  71. package/dist/proxy/claude-usage-tracker.js +1 -1
  72. package/dist/proxy/passthrough-server.js +1 -1
  73. package/dist/proxy/sse-usage-parser.js +1 -1
  74. package/dist/sdk/agent/agent-config.js +1 -1
  75. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  76. package/dist/sdk/agent/agent-yaml.js +1 -1
  77. package/dist/sdk/agent/test/evaluator.js +1 -1
  78. package/dist/sdk/agent/test/executor.js +1 -1
  79. package/dist/sdk/agent/test/index.js +1 -1
  80. package/dist/sdk/agent/test/output.js +1 -1
  81. package/dist/sdk/agent/test/parser.js +1 -1
  82. package/dist/sdk/agent/tool-target-registry.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/delivery-api-client.js +1 -1
  86. package/dist/sdk/client/endpoints.js +1 -1
  87. package/dist/sdk/client/engage-api-client.js +1 -1
  88. package/dist/sdk/client/http-client.js +1 -1
  89. package/dist/sdk/client/llm-api-client.js +1 -1
  90. package/dist/sdk/client/rate-limiter.js +1 -1
  91. package/dist/sdk/client/td-api-client.js +1 -1
  92. package/dist/sdk/client/trino-api-client.js +1 -1
  93. package/dist/sdk/client/workflow-client.js +1 -1
  94. package/dist/sdk/connection-validator.js +1 -1
  95. package/dist/sdk/connection.js +1 -1
  96. package/dist/sdk/delivery.js +1 -1
  97. package/dist/sdk/engage/campaign-pull.js +1 -1
  98. package/dist/sdk/engage/campaign-push.js +1 -1
  99. package/dist/sdk/engage/campaign-validator.d.ts.map +1 -1
  100. package/dist/sdk/engage/campaign-validator.js +1 -1
  101. package/dist/sdk/engage/campaign-validator.js.map +1 -1
  102. package/dist/sdk/engage/campaign-yaml.d.ts.map +1 -1
  103. package/dist/sdk/engage/campaign-yaml.js +1 -1
  104. package/dist/sdk/engage/campaign-yaml.js.map +1 -1
  105. package/dist/sdk/engage/types/campaign-def.js +1 -1
  106. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  107. package/dist/sdk/engage.js +1 -1
  108. package/dist/sdk/errors.js +1 -1
  109. package/dist/sdk/index.js +1 -1
  110. package/dist/sdk/io/index.js +1 -1
  111. package/dist/sdk/io/node-filesystem.js +1 -1
  112. package/dist/sdk/job.js +1 -1
  113. package/dist/sdk/journey.js +1 -1
  114. package/dist/sdk/llm/chat-cache.js +1 -1
  115. package/dist/sdk/llm/index.js +1 -1
  116. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  117. package/dist/sdk/llm/model-factors.js +1 -1
  118. package/dist/sdk/personalization.js +1 -1
  119. package/dist/sdk/query/index.js +1 -1
  120. package/dist/sdk/query/sql-parser.js +1 -1
  121. package/dist/sdk/realtime.js +1 -1
  122. package/dist/sdk/schedule.js +1 -1
  123. package/dist/sdk/segment/child-segment-yaml.d.ts.map +1 -1
  124. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  125. package/dist/sdk/segment/child-segment-yaml.js.map +1 -1
  126. package/dist/sdk/segment/fields-display.js +1 -1
  127. package/dist/sdk/segment/file-discovery.js +1 -1
  128. package/dist/sdk/segment/journey-utils.js +1 -1
  129. package/dist/sdk/segment/journey-validator.js +1 -1
  130. package/dist/sdk/segment/journey-yaml.js +1 -1
  131. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  132. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  133. package/dist/sdk/segment/pull-workflow.js +1 -1
  134. package/dist/sdk/segment/push-recovery.js +1 -1
  135. package/dist/sdk/segment/push-workflow.d.ts +1 -1
  136. package/dist/sdk/segment/push-workflow.d.ts.map +1 -1
  137. package/dist/sdk/segment/push-workflow.js +1 -1
  138. package/dist/sdk/segment/push-workflow.js.map +1 -1
  139. package/dist/sdk/segment/resolution-context.js +1 -1
  140. package/dist/sdk/segment/segment-path-parser.js +1 -1
  141. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  142. package/dist/sdk/segment/segment-validator.d.ts +33 -0
  143. package/dist/sdk/segment/segment-validator.d.ts.map +1 -0
  144. package/dist/sdk/segment/segment-validator.js +1 -0
  145. package/dist/sdk/segment/segment-validator.js.map +1 -0
  146. package/dist/sdk/segment/target-resolution.js +1 -1
  147. package/dist/sdk/segment/tdx-config.js +1 -1
  148. package/dist/sdk/segment/types/segment-def.d.ts +5 -179
  149. package/dist/sdk/segment/types/segment-def.d.ts.map +1 -1
  150. package/dist/sdk/segment/types/segment-def.js +1 -1
  151. package/dist/sdk/segment/types/segment-def.js.map +1 -1
  152. package/dist/sdk/segment/types/segment-schema.d.ts +259 -0
  153. package/dist/sdk/segment/types/segment-schema.d.ts.map +1 -0
  154. package/dist/sdk/segment/types/segment-schema.js +1 -0
  155. package/dist/sdk/segment/types/segment-schema.js.map +1 -0
  156. package/dist/sdk/segment/validate-files.d.ts.map +1 -1
  157. package/dist/sdk/segment/validate-files.js +1 -1
  158. package/dist/sdk/segment/validate-files.js.map +1 -1
  159. package/dist/sdk/segment/yaml-validator.d.ts +27 -10
  160. package/dist/sdk/segment/yaml-validator.d.ts.map +1 -1
  161. package/dist/sdk/segment/yaml-validator.js +1 -1
  162. package/dist/sdk/segment/yaml-validator.js.map +1 -1
  163. package/dist/sdk/segment.js +1 -1
  164. package/dist/sdk/types/cdp.d.ts +11 -2
  165. package/dist/sdk/types/cdp.d.ts.map +1 -1
  166. package/dist/sdk/types/index.js +1 -1
  167. package/dist/sdk/types/progress.js +1 -1
  168. package/dist/sdk/user.js +1 -1
  169. package/dist/sdk/util/format-detector.js +1 -1
  170. package/dist/sdk/util/formatters.js +1 -1
  171. package/dist/sdk/util/index.js +1 -1
  172. package/dist/sdk/util/tree-formatter.js +1 -1
  173. package/dist/sdk/workflow/archive-validation.js +1 -1
  174. package/dist/sdk/workflow/clone-workflow.js +1 -1
  175. package/dist/sdk/workflow/index.js +1 -1
  176. package/dist/sdk/workflow/pull-workflow.js +1 -1
  177. package/dist/sdk/workflow/push-workflow.js +1 -1
  178. package/dist/sdk/workflow/tdx-config.js +1 -1
  179. package/dist/sdk/workflow/workflow-utils.js +1 -1
  180. package/dist/test-utils/command-runner.js +1 -1
  181. package/dist/test-utils/factories.js +1 -1
  182. package/dist/test-utils/fixtures.js +1 -1
  183. package/dist/test-utils/http-mock.js +1 -1
  184. package/dist/test-utils/index.js +1 -1
  185. package/dist/utils/async.js +1 -1
  186. package/dist/utils/colors.js +1 -1
  187. package/dist/utils/diff.js +1 -1
  188. package/dist/utils/file-permissions.js +1 -1
  189. package/dist/utils/file-reader.js +1 -1
  190. package/dist/utils/global-cache.js +1 -1
  191. package/dist/utils/json-loader.js +1 -1
  192. package/dist/utils/local-cache.js +1 -1
  193. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  194. package/dist/utils/logger/formatters/index.js +1 -1
  195. package/dist/utils/logger/handlers/console-handler.js +1 -1
  196. package/dist/utils/logger/handlers/file-handler.js +1 -1
  197. package/dist/utils/logger/handlers/index.js +1 -1
  198. package/dist/utils/logger/handlers/null-handler.js +1 -1
  199. package/dist/utils/logger/index.js +1 -1
  200. package/dist/utils/logger/logger.js +1 -1
  201. package/dist/utils/logger/types.js +1 -1
  202. package/dist/utils/option-validation.js +1 -1
  203. package/dist/utils/process.js +1 -1
  204. package/dist/utils/prompt.js +1 -1
  205. package/dist/utils/spinner.js +1 -1
  206. package/dist/utils/sse-parser.js +1 -1
  207. package/dist/utils/string-utils.js +1 -1
  208. package/dist/utils/table-ref-parser.js +1 -1
  209. package/dist/utils/tdx-logger.js +1 -1
  210. package/dist/utils/version-check.js +1 -1
  211. package/package.json +1 -1
@@ -1 +1 @@
1
- const a3_0x3e9411=a3_0x25b2;(function(_0x13f812,_0x3df6d2){const _0x2190b3=a3_0x25b2,_0x306333=_0x13f812();while(!![]){try{const _0x329217=parseInt(_0x2190b3(0x173))/0x1+parseInt(_0x2190b3(0x15e))/0x2+parseInt(_0x2190b3(0x15f))/0x3+parseInt(_0x2190b3(0x17c))/0x4*(-parseInt(_0x2190b3(0x15c))/0x5)+parseInt(_0x2190b3(0x174))/0x6*(parseInt(_0x2190b3(0x16f))/0x7)+-parseInt(_0x2190b3(0x163))/0x8*(-parseInt(_0x2190b3(0x170))/0x9)+-parseInt(_0x2190b3(0x169))/0xa*(parseInt(_0x2190b3(0x165))/0xb);if(_0x329217===_0x3df6d2)break;else _0x306333['push'](_0x306333['shift']());}catch(_0x5070dc){_0x306333['push'](_0x306333['shift']());}}}(a3_0xfd25,0x3535f));function a3_0x25b2(_0x1daae6,_0x40735c){_0x1daae6=_0x1daae6-0x15c;const _0xfd2591=a3_0xfd25();let _0x25b21e=_0xfd2591[_0x1daae6];return _0x25b21e;}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';function a3_0xfd25(){const _0x5916b3=['cause','8452CiXYEI','execute','error','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','activations','330YnvHqE','Listing\x20activations\x20for\x20segment\x20\x27','623992kIjiov','80898QnLAAI','resolveParentId','verbose','Child\x20name:\x20','342296LrjgOf','segment','33ktvoKz','name','\x20activation','Resolving\x20child\x20segment\x20\x27','709760dwjVsS','length','Resolved\x20child\x20ID:\x20','Resolved\x20parent\x20ID:\x20','List\x20activations\x20for\x20a\x20segment','Error:\x20Segment\x20name\x20is\x20required','66591EzdAdd','9KmhNWl','✔\x20Found\x20','\x20\x20Cause:\x20','26867qokUcd','102CAwRmZ','description','data','Parent\x20name:\x20','\x27...','Error:\x20','Resolving\x20parent\x20segment\x20\x27'];a3_0xfd25=function(){return _0x5916b3;};return a3_0xfd25();}export class ActivationsCommand extends BaseCommand{[a3_0x3e9411(0x166)]=a3_0x3e9411(0x180);[a3_0x3e9411(0x175)]=a3_0x3e9411(0x16d);async[a3_0x3e9411(0x17d)](_0xfb46d3){const _0x5906cf=a3_0x3e9411,{options:_0x155891,args:_0x89ecf4,tdx:_0x4c3c54}=_0xfb46d3;if(_0x89ecf4[_0x5906cf(0x16a)]===0x0)return console[_0x5906cf(0x17e)](_0x5906cf(0x16e)),console['error'](_0x5906cf(0x17f)),0x1;try{const {parentId:_0x568b75,childId:_0x1a09da}=parseSegmentRef(_0x89ecf4[0x0]);if(!_0x1a09da)return console['error']('Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations'),console[_0x5906cf(0x17e)](_0x5906cf(0x17f)),0x1;_0x155891[_0x5906cf(0x161)]&&(console['error']('Site:\x20'+_0x155891['site']),console[_0x5906cf(0x17e)](_0x5906cf(0x177)+_0x568b75),console[_0x5906cf(0x17e)](_0x5906cf(0x162)+_0x1a09da));const _0x31e765=await withSpinner(_0x5906cf(0x17a)+_0x568b75+_0x5906cf(0x178),()=>_0x4c3c54['segment'][_0x5906cf(0x160)](_0x568b75),{'verbose':_0x155891[_0x5906cf(0x161)]}),_0x3c86a4=_0x31e765[_0x5906cf(0x176)];_0x155891[_0x5906cf(0x161)]&&console[_0x5906cf(0x17e)](_0x5906cf(0x16c)+_0x3c86a4);const _0x114022=await withSpinner(_0x5906cf(0x168)+_0x1a09da+_0x5906cf(0x178),()=>_0x4c3c54[_0x5906cf(0x164)]['resolveSegmentId'](_0x3c86a4,_0x1a09da),{'verbose':_0x155891[_0x5906cf(0x161)]}),_0x4ec838=_0x114022['data'];_0x155891[_0x5906cf(0x161)]&&console[_0x5906cf(0x17e)](_0x5906cf(0x16b)+_0x4ec838);const _0x457c45=await withSpinner(_0x5906cf(0x15d)+_0x1a09da+'\x27...',()=>_0x4c3c54[_0x5906cf(0x164)]['listActivations'](_0x3c86a4,_0x4ec838),{'verbose':_0x155891[_0x5906cf(0x161)]}),_0x2eed1=_0x457c45['data'];return console['error'](_0x5906cf(0x171)+_0x2eed1['length']+_0x5906cf(0x167)+(_0x2eed1[_0x5906cf(0x16a)]!==0x1?'s':'')),await handleSDKOutput(_0x2eed1,_0x155891),0x0;}catch(_0x3b31a3){if(_0x3b31a3 instanceof SDKError)return console[_0x5906cf(0x17e)](_0x5906cf(0x179)+_0x3b31a3['message']),_0x3b31a3[_0x5906cf(0x17b)]&&console['error'](_0x5906cf(0x172)+_0x3b31a3['cause']),0x1;throw _0x3b31a3;}}}
1
+ const a3_0xf54aad=a3_0xe185;(function(_0x22cb96,_0x3f9b76){const _0x6cfa14=a3_0xe185,_0x56e5e4=_0x22cb96();while(!![]){try{const _0x52b130=-parseInt(_0x6cfa14(0x1ac))/0x1*(-parseInt(_0x6cfa14(0x199))/0x2)+parseInt(_0x6cfa14(0x1ba))/0x3*(-parseInt(_0x6cfa14(0x1aa))/0x4)+-parseInt(_0x6cfa14(0x1a1))/0x5+-parseInt(_0x6cfa14(0x1b7))/0x6+-parseInt(_0x6cfa14(0x1a6))/0x7*(parseInt(_0x6cfa14(0x195))/0x8)+-parseInt(_0x6cfa14(0x1ae))/0x9*(parseInt(_0x6cfa14(0x19e))/0xa)+parseInt(_0x6cfa14(0x1ad))/0xb;if(_0x52b130===_0x3f9b76)break;else _0x56e5e4['push'](_0x56e5e4['shift']());}catch(_0x736005){_0x56e5e4['push'](_0x56e5e4['shift']());}}}(a3_0x3251,0xd260d));function a3_0x3251(){const _0x2c83b6=['Resolved\x20parent\x20ID:\x20','21BumOIx','Resolving\x20child\x20segment\x20\x27','✔\x20Found\x20','verbose','1908qomcwF','Resolving\x20parent\x20segment\x20\x27','1079asOgln','68937880FseCUE','747gYZuMO','Parent\x20name:\x20','site','Site:\x20','Listing\x20activations\x20for\x20segment\x20\x27','description','length','Resolved\x20child\x20ID:\x20','\x20activation','8959428wtvtck','\x20\x20Cause:\x20','Child\x20name:\x20','8433YeMqfg','1707824NEvqCz','activations','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','\x27...','1624YvwRAU','segment','data','listActivations','resolveSegmentId','151270QUrvqV','Error:\x20Segment\x20name\x20is\x20required','error','7757295cjwGQb','cause','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','List\x20activations\x20for\x20a\x20segment'];a3_0x3251=function(){return _0x2c83b6;};return a3_0x3251();}function a3_0xe185(_0x408f32,_0x5e05bd){_0x408f32=_0x408f32-0x195;const _0x32517b=a3_0x3251();let _0xe185d9=_0x32517b[_0x408f32];return _0xe185d9;}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{['name']=a3_0xf54aad(0x196);[a3_0xf54aad(0x1b3)]=a3_0xf54aad(0x1a4);async['execute'](_0x2ff57c){const _0x26bb28=a3_0xf54aad,{options:_0x17c514,args:_0x5ad911,tdx:_0x2e051e}=_0x2ff57c;if(_0x5ad911[_0x26bb28(0x1b4)]===0x0)return console[_0x26bb28(0x1a0)](_0x26bb28(0x19f)),console[_0x26bb28(0x1a0)](_0x26bb28(0x197)),0x1;try{const {parentId:_0x9e9389,childId:_0x298178}=parseSegmentRef(_0x5ad911[0x0]);if(!_0x298178)return console['error'](_0x26bb28(0x1a3)),console[_0x26bb28(0x1a0)]('Usage:\x20tdx\x20activations\x20<parent_name/child_name>'),0x1;_0x17c514[_0x26bb28(0x1a9)]&&(console[_0x26bb28(0x1a0)](_0x26bb28(0x1b1)+_0x17c514[_0x26bb28(0x1b0)]),console[_0x26bb28(0x1a0)](_0x26bb28(0x1af)+_0x9e9389),console[_0x26bb28(0x1a0)](_0x26bb28(0x1b9)+_0x298178));const _0x456b15=await withSpinner(_0x26bb28(0x1ab)+_0x9e9389+_0x26bb28(0x198),()=>_0x2e051e[_0x26bb28(0x19a)]['resolveParentId'](_0x9e9389),{'verbose':_0x17c514[_0x26bb28(0x1a9)]}),_0x3ead07=_0x456b15[_0x26bb28(0x19b)];_0x17c514['verbose']&&console[_0x26bb28(0x1a0)](_0x26bb28(0x1a5)+_0x3ead07);const _0x4c33e6=await withSpinner(_0x26bb28(0x1a7)+_0x298178+'\x27...',()=>_0x2e051e[_0x26bb28(0x19a)][_0x26bb28(0x19d)](_0x3ead07,_0x298178),{'verbose':_0x17c514[_0x26bb28(0x1a9)]}),_0x29743e=_0x4c33e6['data'];_0x17c514['verbose']&&console[_0x26bb28(0x1a0)](_0x26bb28(0x1b5)+_0x29743e);const _0x1a40ca=await withSpinner(_0x26bb28(0x1b2)+_0x298178+_0x26bb28(0x198),()=>_0x2e051e['segment'][_0x26bb28(0x19c)](_0x3ead07,_0x29743e),{'verbose':_0x17c514[_0x26bb28(0x1a9)]}),_0x1110d0=_0x1a40ca[_0x26bb28(0x19b)];return console[_0x26bb28(0x1a0)](_0x26bb28(0x1a8)+_0x1110d0[_0x26bb28(0x1b4)]+_0x26bb28(0x1b6)+(_0x1110d0['length']!==0x1?'s':'')),await handleSDKOutput(_0x1110d0,_0x17c514),0x0;}catch(_0x2b0b08){if(_0x2b0b08 instanceof SDKError)return console[_0x26bb28(0x1a0)]('Error:\x20'+_0x2b0b08['message']),_0x2b0b08[_0x26bb28(0x1a2)]&&console['error'](_0x26bb28(0x1b8)+_0x2b0b08[_0x26bb28(0x1a2)]),0x1;throw _0x2b0b08;}}}
@@ -1 +1 @@
1
- const a4_0x3c89bd=a4_0xedae;function a4_0x209a(){const _0x52a439=['join','Using\x20current\x20project:\x20','dim','\x20\x20Agents:\x20','experimentalKnowledgeBases','\x20\x20Prompt\x20\x22','execute','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','gray','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','Writing\x20files...','error','\x0aProject\x20pushed\x20with\x20errors','red','context','\x20|\x20','\x20\x20tdx\x20agent\x20clone\x20agents/','Would\x20push\x20agent:\x20','\x0aChanges\x20to\x20agent\x20\x27','\x22:\x20','no_local_folder','Pushing\x20to\x20project...','message','session','prompts','\x20\x20Agent\x20\x22','\x20successfully','\x20--profile\x20','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','1055304cngdev','\x22\x20to\x20new\x20project\x20\x22','\x20\x20tdx\x20agent\x20pull\x20','Status:\x20','cloneProject','cyan','Chat:\x20','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','newProjectName','\x0aPull\x20summary\x20for\x20\x27','Project\x20cloned\x20with\x20errors','\x20errors','log','\x0aError:','agentName','arg-dir','pushProject','\x20\x20Text\x20Knowledge\x20Bases:\x20','50687qHZVoC','utf-8','Using\x20local\x20project:\x20','repeat','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','llm_project','88vAQMyK','new','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','42170iHmyTy','New\x20project\x20ID:\x20','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','\x22\x20to\x20a\x20different\x20profile','outputDir','force','sourceProjectName','Agent:\x20','Summary:','diff','\x20\x20Experimental\x20Artifacts:\x20','yes','\x20\x20Source:\x20','Errors:','profile','\x0aErrors\x20found:','\x20\x20Integration\x20\x22','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','created','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','Using\x20project:\x20','tdx.json','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','\x20\x20Prompts:\x20','dryRun','newProjectId','agent.yml','\x20\x20Knowledge\x20Bases:\x20','New\x20project:\x20','llmProject','Dry\x20run\x20-\x20no\x20files\x20written','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','cwd-config','Cancelled','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','\x20\x20Integrations:\x20','Project\x20cloned\x20successfully','found','push','total','cwd','\x20--name\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project','Clone\x20\x22','counts','\x27\x20to\x20create\x20the\x20folder\x20structure.','green','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Cloning\x20\x22','INVALID_ARGUMENT','\x20new','dirname','Analyzing\x20project\x20\x22','\x20\x20Text\x20Knowledge\x20Base\x20\x22','294sjAxyL','textKnowledgeBases','883470auTgYu','parse','Using\x20project\x20from\x20context:\x20','\x20\x20Knowledge\x20Base\x20\x22','Agent\x20','projectName','Source:\x20','\x20resources\x20to\x20\x27','name','\x20files\x20to\x20','\x0aPush\x20','action','projectId','yellow','\x0a✔\x20Pushed\x20','Dry\x20run\x20-\x20no\x20changes\x20made','\x20unchanged','99356AVdsLY','source','No\x20tdx.json\x20found\x20in\x20','experimentalArtifacts','outputPath','\x20resources?','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20project','integrations','updated','New\x20project\x20name\x20is\x20required','agent:push','knowledgeBases','agentId','llm','agents','\x0aPush\x20summary\x20for\x20\x27','agent:clone','Project:\x20','no_context','unchanged','Pushing\x20agent\x20from\x20\x22','Using\x20context\x20project:\x20','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','\x0aChanges:','\x0aChanges\x20to\x20prompt\x20\x27','\x22\x20to\x20\x22','5041540gzgCch','pullAgent','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','1785vYuQhq','hasChanges','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory','48ZGeBVX','\x20changed','Would\x20clone:','Failed\x20to\x20push\x20agent:\x20','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','errors','\x22...','\x20updated','pullProject','description','\x20=\x20','\x20total','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','Usage:\x20tdx\x20agent\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20project\x20(requires\x20context\x20or\x20tdx.json)','MISSING_ARGUMENT','✔\x20Context\x20set:\x20','reason','\x20\x20Experimental\x20Artifact\x20\x22'];a4_0x209a=function(){return _0x52a439;};return a4_0x209a();}(function(_0x131120,_0x550e26){const _0x511519=a4_0xedae,_0x164b86=_0x131120();while(!![]){try{const _0x4e3869=parseInt(_0x511519(0x21a))/0x1*(-parseInt(_0x511519(0x1ea))/0x2)+-parseInt(_0x511519(0x1ec))/0x3+parseInt(_0x511519(0x1fd))/0x4+-parseInt(_0x511519(0x26a))/0x5*(-parseInt(_0x511519(0x21e))/0x6)+-parseInt(_0x511519(0x261))/0x7*(-parseInt(_0x511519(0x267))/0x8)+parseInt(_0x511519(0x24f))/0x9+parseInt(_0x511519(0x217))/0xa;if(_0x4e3869===_0x550e26)break;else _0x164b86['push'](_0x164b86['shift']());}catch(_0x6d3247){_0x164b86['push'](_0x164b86['shift']());}}}(a4_0x209a,0x39bc7));import a4_0x282c7e from'chalk';import a4_0x24c893 from'path';function a4_0xedae(_0x2e79a2,_0x359332){_0x2e79a2=_0x2e79a2-0x1e6;const _0x209aae=a4_0x209a();let _0xedae48=_0x209aae[_0x2e79a2];return _0xedae48;}import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext,resolveAgentPullArgs}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x5336cd){const _0xd0c5c9=a4_0xedae,_0x35d977=[];if(_0x5336cd['total']!==undefined)_0x35d977['push'](_0x5336cd['total']+_0xd0c5c9(0x229));if(_0x5336cd[_0xd0c5c9(0x268)]!==undefined&&_0x5336cd['new']>0x0)_0x35d977[_0xd0c5c9(0x292)](a4_0x282c7e[_0xd0c5c9(0x29a)](_0x5336cd['new']+'\x20new'));if(_0x5336cd[_0xd0c5c9(0x27d)]!==undefined&&_0x5336cd[_0xd0c5c9(0x27d)]>0x0)_0x35d977['push'](a4_0x282c7e[_0xd0c5c9(0x29a)](_0x5336cd[_0xd0c5c9(0x27d)]+'\x20created'));if(_0x5336cd['updated']!==undefined&&_0x5336cd['updated']>0x0)_0x35d977['push'](a4_0x282c7e['yellow'](_0x5336cd['updated']+_0xd0c5c9(0x225)));if(_0x5336cd[_0xd0c5c9(0x210)]!==undefined&&_0x5336cd[_0xd0c5c9(0x210)]>0x0)_0x35d977[_0xd0c5c9(0x292)](a4_0x282c7e[_0xd0c5c9(0x239)](_0x5336cd['unchanged']+_0xd0c5c9(0x1fc)));if(_0x5336cd[_0xd0c5c9(0x223)]!==undefined&&_0x5336cd[_0xd0c5c9(0x223)]>0x0)_0x35d977['push'](a4_0x282c7e[_0xd0c5c9(0x23f)](_0x5336cd[_0xd0c5c9(0x223)]+_0xd0c5c9(0x25a)));return _0x35d977['join'](',\x20');}function displayDiffs(_0x1a39ae,_0x24169b,_0x2723b2,_0x4cf2b9,_0x4c6f36,_0x2749cd,_0x5942e0){const _0x3b8876=a4_0xedae;for(const _0xcb9655 of _0x1a39ae){if(_0xcb9655[_0x3b8876(0x274)]){const _0xe02c6b=_0xcb9655[_0x3b8876(0x25d)]||_0xcb9655['name'];console[_0x3b8876(0x25b)](_0x3b8876(0x244)+_0xe02c6b+'\x27:'),console[_0x3b8876(0x25b)]('─'[_0x3b8876(0x264)](0x3c)),console[_0x3b8876(0x25b)](_0xcb9655['diff']),console[_0x3b8876(0x25b)]('─'[_0x3b8876(0x264)](0x3c));}}for(const _0x2d742b of _0x24169b){_0x2d742b['diff']&&(console[_0x3b8876(0x25b)](_0x3b8876(0x256)+_0x2d742b[_0x3b8876(0x1f4)]+'\x27:'),console[_0x3b8876(0x25b)]('─'[_0x3b8876(0x264)](0x3c)),console[_0x3b8876(0x25b)](_0x2d742b['diff']),console[_0x3b8876(0x25b)]('─'[_0x3b8876(0x264)](0x3c)));}for(const _0x3d8f03 of _0x2723b2){_0x3d8f03[_0x3b8876(0x274)]&&(console['log'](_0x3b8876(0x281)+_0x3d8f03[_0x3b8876(0x1f4)]+'\x27:'),console[_0x3b8876(0x25b)]('─'[_0x3b8876(0x264)](0x3c)),console[_0x3b8876(0x25b)](_0x3d8f03[_0x3b8876(0x274)]),console['log']('─'[_0x3b8876(0x264)](0x3c)));}for(const _0x31332b of _0x4cf2b9){_0x31332b['diff']&&(console[_0x3b8876(0x25b)](_0x3b8876(0x215)+_0x31332b[_0x3b8876(0x1f4)]+'\x27:'),console[_0x3b8876(0x25b)]('─'['repeat'](0x3c)),console[_0x3b8876(0x25b)](_0x31332b[_0x3b8876(0x274)]),console['log']('─'[_0x3b8876(0x264)](0x3c)));}for(const _0x276eb2 of _0x4c6f36){_0x276eb2[_0x3b8876(0x274)]&&(console[_0x3b8876(0x25b)]('\x0aChanges\x20to\x20integration\x20\x27'+_0x276eb2['name']+'\x27:'),console['log']('─'[_0x3b8876(0x264)](0x3c)),console['log'](_0x276eb2[_0x3b8876(0x274)]),console[_0x3b8876(0x25b)]('─'[_0x3b8876(0x264)](0x3c)));}for(const _0x48a327 of _0x2749cd){_0x48a327[_0x3b8876(0x274)]&&(console[_0x3b8876(0x25b)]('\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27'+_0x48a327['name']+'\x27:'),console[_0x3b8876(0x25b)]('─'[_0x3b8876(0x264)](0x3c)),console[_0x3b8876(0x25b)](_0x48a327[_0x3b8876(0x274)]),console[_0x3b8876(0x25b)]('─'[_0x3b8876(0x264)](0x3c)));}for(const _0x5827a2 of _0x5942e0){_0x5827a2[_0x3b8876(0x274)]&&(console['log'](_0x3b8876(0x238)+_0x5827a2[_0x3b8876(0x1f4)]+'\x27:'),console[_0x3b8876(0x25b)]('─'['repeat'](0x3c)),console['log'](_0x5827a2['diff']),console['log']('─'[_0x3b8876(0x264)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x3c89bd(0x1f4)]='agent:pull';[a4_0x3c89bd(0x227)]=a4_0x3c89bd(0x269);async[a4_0x3c89bd(0x237)](_0x4b682c){const _0x4b631d=a4_0x3c89bd,{options:_0x470222,args:_0x5d370d,tdx:_0x3e47d7}=_0x4b682c,_0x1eea3a=_0x5d370d[0x0],_0x3bca87=_0x5d370d[0x1],_0x3c5c1e=_0x470222['output'],_0x4fea08=_0x470222[_0x4b631d(0x284)],_0x3e3c76=_0x470222['force'],_0x55301c=_0x470222[_0x4b631d(0x276)],_0x4de693=_0x470222[_0x4b631d(0x289)],_0x349cbc=_0x470222['agent'];let _0x251d6d;if(_0x1eea3a){const _0x4fb99a=a4_0x24c893[_0x4b631d(0x231)](_0x1eea3a,_0x4b631d(0x280));if(existsSync(_0x4fb99a))try{const _0x25af65=JSON[_0x4b631d(0x1ed)](readFileSync(_0x4fb99a,_0x4b631d(0x262)));_0x25af65[_0x4b631d(0x266)]&&(_0x251d6d={'llm_project':_0x25af65[_0x4b631d(0x266)]});}catch{}}const _0xbfe48=findAgentConfigPath(process['cwd']());let _0xbae5b8;if(_0xbfe48)try{const _0x4643db=JSON['parse'](readFileSync(_0xbfe48,_0x4b631d(0x262)));_0x4643db['llm_project']&&(_0xbae5b8={'llm_project':_0x4643db[_0x4b631d(0x266)]});}catch{}const _0x4db4e3=resolveAgentPullArgs({'arg':_0x1eea3a,'agentNameArg':_0x3bca87,'agentFlag':_0x349cbc,'contextProject':_0x4de693,'argDirConfig':_0x251d6d,'cwdConfigPath':_0xbfe48||undefined,'cwdConfig':_0xbae5b8}),{projectNameOrId:_0x1a1d88,targetAgentName:_0x4f5ba8,existingOutputDir:_0x5bbd00,source:_0x4afc7f}=_0x4db4e3;if(_0x4afc7f===_0x4b631d(0x25e))console['log'](a4_0x282c7e[_0x4b631d(0x233)]('Using\x20project\x20from\x20'+a4_0x24c893[_0x4b631d(0x231)](_0x1eea3a,_0x4b631d(0x280))+':\x20'+_0x1a1d88));else{if(_0x4afc7f===_0x4b631d(0x28c))console['log'](a4_0x282c7e[_0x4b631d(0x233)](_0x4b631d(0x27f)+_0x1a1d88));else _0x4afc7f==='context'&&console[_0x4b631d(0x25b)](a4_0x282c7e[_0x4b631d(0x233)](_0x4b631d(0x1ee)+_0x1a1d88));}if(!_0x1a1d88)return _0x349cbc?(console[_0x4b631d(0x25b)](a4_0x282c7e[_0x4b631d(0x1f9)]('The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a')),console[_0x4b631d(0x25b)](_0x4b631d(0x22b)),console[_0x4b631d(0x25b)](_0x4b631d(0x213))):(console[_0x4b631d(0x25b)](a4_0x282c7e[_0x4b631d(0x1f9)](_0x4b631d(0x265))),console[_0x4b631d(0x25b)](_0x4b631d(0x22c)),console['log'](_0x4b631d(0x296)),console[_0x4b631d(0x25b)](_0x4b631d(0x21d)),console['log']('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20--agent\x20<name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20context\x20project'),console['log'](_0x4b631d(0x203))),0x1;if(_0x4f5ba8){const {data:_0x3f815c}=await withSpinner('Pulling\x20agent\x20\x22'+_0x4f5ba8+'\x22\x20from\x20project\x20\x22'+_0x1a1d88+_0x4b631d(0x224),()=>_0x3e47d7[_0x4b631d(0x20a)][_0x4b631d(0x218)](_0x1a1d88,_0x4f5ba8,_0x3c5c1e,{'dryRun':_0x4fea08,'force':_0x3e3c76}));if(_0x4fea08)return console['log'](a4_0x282c7e[_0x4b631d(0x1f9)](_0x4b631d(0x28a))),console[_0x4b631d(0x25b)]('Would\x20pull\x20agent:\x20'+_0x3f815c[_0x4b631d(0x25d)]),console[_0x4b631d(0x25b)]('Output\x20path:\x20'+_0x3f815c[_0x4b631d(0x201)]),_0x3f815c[_0x4b631d(0x274)]&&(console[_0x4b631d(0x25b)](_0x4b631d(0x214)),console['log']('─'[_0x4b631d(0x264)](0x3c)),console[_0x4b631d(0x25b)](_0x3f815c[_0x4b631d(0x274)]),console[_0x4b631d(0x25b)]('─'['repeat'](0x3c))),0x0;return console['log'](a4_0x282c7e[_0x4b631d(0x29a)]('Agent\x20pulled\x20successfully')),console[_0x4b631d(0x25b)]('Agent:\x20'+_0x3f815c['agentName']),console[_0x4b631d(0x25b)]('Output:\x20'+_0x3f815c[_0x4b631d(0x201)]),console['log'](_0x4b631d(0x252)+(_0x3f815c['isNew']?a4_0x282c7e[_0x4b631d(0x29a)](_0x4b631d(0x268)):_0x3f815c[_0x4b631d(0x21b)]?a4_0x282c7e[_0x4b631d(0x1f9)]('updated'):a4_0x282c7e[_0x4b631d(0x239)](_0x4b631d(0x210)))),0x0;}const _0x574ed9=_0x5bbd00||_0x3c5c1e,{data:_0x120938}=await withSpinner(_0x4b631d(0x1e8)+_0x1a1d88+_0x4b631d(0x224),()=>_0x3e47d7[_0x4b631d(0x20a)]['pullProject'](_0x1a1d88,_0x574ed9,{'dryRun':!![]})),_0x266ea6=_0x120938['counts'][_0x4b631d(0x20b)][_0x4b631d(0x268)]+_0x120938[_0x4b631d(0x298)][_0x4b631d(0x208)]['new']+_0x120938[_0x4b631d(0x298)][_0x4b631d(0x1eb)][_0x4b631d(0x268)]+_0x120938['counts'][_0x4b631d(0x24a)][_0x4b631d(0x268)]+_0x120938['counts'][_0x4b631d(0x204)]['new']+_0x120938[_0x4b631d(0x298)]['experimentalKnowledgeBases'][_0x4b631d(0x268)]+_0x120938['counts'][_0x4b631d(0x200)][_0x4b631d(0x268)],_0xc31fdb=_0x120938[_0x4b631d(0x298)][_0x4b631d(0x20b)][_0x4b631d(0x205)]+_0x120938[_0x4b631d(0x298)][_0x4b631d(0x208)][_0x4b631d(0x205)]+_0x120938[_0x4b631d(0x298)][_0x4b631d(0x1eb)]['updated']+_0x120938[_0x4b631d(0x298)][_0x4b631d(0x24a)][_0x4b631d(0x205)]+_0x120938[_0x4b631d(0x298)][_0x4b631d(0x204)]['updated']+_0x120938[_0x4b631d(0x298)][_0x4b631d(0x235)][_0x4b631d(0x205)]+_0x120938[_0x4b631d(0x298)][_0x4b631d(0x200)][_0x4b631d(0x205)],_0x2ab2a7=_0x120938[_0x4b631d(0x298)]['agents'][_0x4b631d(0x210)]+_0x120938[_0x4b631d(0x298)][_0x4b631d(0x208)][_0x4b631d(0x210)]+_0x120938['counts']['textKnowledgeBases'][_0x4b631d(0x210)]+_0x120938[_0x4b631d(0x298)][_0x4b631d(0x24a)]['unchanged']+_0x120938[_0x4b631d(0x298)][_0x4b631d(0x204)][_0x4b631d(0x210)]+_0x120938['counts'][_0x4b631d(0x235)]['unchanged']+_0x120938[_0x4b631d(0x298)][_0x4b631d(0x200)][_0x4b631d(0x210)];console[_0x4b631d(0x25b)](_0x4b631d(0x258)+_0x120938[_0x4b631d(0x1f1)]+'\x27:'),console[_0x4b631d(0x25b)]('\x20\x20'+a4_0x282c7e[_0x4b631d(0x29a)]('+\x20'+_0x266ea6+'\x20new')+_0x4b631d(0x241)+a4_0x282c7e['yellow']('~\x20'+_0xc31fdb+_0x4b631d(0x21f))+_0x4b631d(0x241)+a4_0x282c7e[_0x4b631d(0x233)]('=\x20'+_0x2ab2a7+_0x4b631d(0x1fc))),console[_0x4b631d(0x25b)](_0x4b631d(0x234)+formatCountSummary(_0x120938[_0x4b631d(0x298)][_0x4b631d(0x20b)])),console[_0x4b631d(0x25b)](_0x4b631d(0x287)+formatCountSummary(_0x120938[_0x4b631d(0x298)][_0x4b631d(0x208)])),console[_0x4b631d(0x25b)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x120938[_0x4b631d(0x298)]['textKnowledgeBases'])),console[_0x4b631d(0x25b)](_0x4b631d(0x283)+formatCountSummary(_0x120938[_0x4b631d(0x298)][_0x4b631d(0x24a)])),console[_0x4b631d(0x25b)](_0x4b631d(0x28f)+formatCountSummary(_0x120938[_0x4b631d(0x298)][_0x4b631d(0x204)]));const _0x4d2228=_0x120938[_0x4b631d(0x298)][_0x4b631d(0x235)][_0x4b631d(0x293)]>0x0||_0x120938[_0x4b631d(0x298)][_0x4b631d(0x200)][_0x4b631d(0x293)]>0x0;_0x4d2228&&(console[_0x4b631d(0x25b)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x120938[_0x4b631d(0x298)]['experimentalKnowledgeBases'])),console['log'](_0x4b631d(0x275)+formatCountSummary(_0x120938[_0x4b631d(0x298)]['experimentalArtifacts'])));console[_0x4b631d(0x25b)]('\x20\x20Target:\x20'+a4_0x282c7e['cyan'](_0x120938[_0x4b631d(0x26f)])),displayDiffs(_0x120938[_0x4b631d(0x20b)],_0x120938['knowledgeBases'],_0x120938[_0x4b631d(0x1eb)],_0x120938[_0x4b631d(0x24a)],_0x120938['integrations'],_0x120938['experimentalKnowledgeBases'],_0x120938['experimentalArtifacts']);if(_0x4fea08)return console[_0x4b631d(0x25b)](a4_0x282c7e[_0x4b631d(0x1f9)](_0x4b631d(0x27e))),0x0;if(_0x266ea6===0x0&&_0xc31fdb===0x0)return console[_0x4b631d(0x25b)](a4_0x282c7e[_0x4b631d(0x29a)]('\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'llm_project':_0x120938[_0x4b631d(0x1f1)]},_0x470222['session']),console[_0x4b631d(0x25b)](a4_0x282c7e[_0x4b631d(0x29a)](_0x4b631d(0x22e)+a4_0x282c7e[_0x4b631d(0x233)](_0x4b631d(0x266))+_0x4b631d(0x228)+a4_0x282c7e['cyan'](_0x120938['projectName']))),0x0;if(!_0x55301c&&!_0x3e3c76){if(!isInteractive())return console['error'](a4_0x282c7e[_0x4b631d(0x23f)]('\x0aError:'),_0x4b631d(0x29b)),console['error'](a4_0x282c7e[_0x4b631d(0x233)](_0x4b631d(0x219))),0x1;const _0x38fab2=await confirmKey('\x0aWrite\x20'+(_0x266ea6+_0xc31fdb)+'\x20files?');if(!_0x38fab2)return console[_0x4b631d(0x25b)](a4_0x282c7e[_0x4b631d(0x1f9)](_0x4b631d(0x28d)),'-\x20no\x20files\x20written'),0x1;}const {data:_0x1d3fd0}=await withSpinner(_0x4b631d(0x23c),()=>_0x3e47d7[_0x4b631d(0x20a)][_0x4b631d(0x226)](_0x1a1d88,_0x574ed9,{'force':_0x3e3c76}));return console['log'](a4_0x282c7e[_0x4b631d(0x29a)]('\x0a✔\x20Pulled\x20'+(_0x266ea6+_0xc31fdb)+_0x4b631d(0x1f5)+_0x1d3fd0[_0x4b631d(0x26f)])),saveSessionContext({'llm_project':_0x1d3fd0[_0x4b631d(0x1f1)]},_0x470222[_0x4b631d(0x249)]),console[_0x4b631d(0x25b)](a4_0x282c7e[_0x4b631d(0x29a)](_0x4b631d(0x22e)+a4_0x282c7e[_0x4b631d(0x233)]('llm_project')+'\x20=\x20'+a4_0x282c7e[_0x4b631d(0x254)](_0x1d3fd0[_0x4b631d(0x1f1)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x3c89bd(0x1f4)]=a4_0x3c89bd(0x20d);[a4_0x3c89bd(0x227)]=a4_0x3c89bd(0x28e);async[a4_0x3c89bd(0x237)](_0xa26d4e){const _0x11cfe2=a4_0x3c89bd,{options:_0x50b595,args:_0x55c446,tdx:_0x193cf7}=_0xa26d4e,_0x59e4b6=_0x55c446[0x0],_0x3f7b80=_0x50b595[_0x11cfe2(0x1f4)],_0x3235bb=_0x50b595[_0x11cfe2(0x284)],_0x4764f7=_0x50b595[_0x11cfe2(0x276)],_0xb26468=_0x50b595['site'],_0x19905d=_0x50b595['llmProject'];let _0x36def7;const _0x18cce5=findAgentConfigPath(process[_0x11cfe2(0x294)]());if(_0x59e4b6){const _0x4f9423=a4_0x24c893['join'](_0x59e4b6,_0x11cfe2(0x280));existsSync(_0x4f9423)?(_0x36def7=_0x59e4b6,console[_0x11cfe2(0x25b)](a4_0x282c7e[_0x11cfe2(0x233)](_0x11cfe2(0x263)+_0x59e4b6))):_0x36def7=_0x59e4b6;}else{if(_0x18cce5)_0x36def7=a4_0x24c893['dirname'](_0x18cce5),console[_0x11cfe2(0x25b)](a4_0x282c7e[_0x11cfe2(0x233)](_0x11cfe2(0x232)+_0x36def7));else{if(_0x19905d){const _0x2f8172=sanitizeForFilesystem(_0x19905d);let _0x2d1a19=_0x2f8172,_0x4af032=a4_0x24c893[_0x11cfe2(0x231)](process[_0x11cfe2(0x294)](),_0x11cfe2(0x20b),_0x2f8172,_0x11cfe2(0x280));if(!existsSync(_0x4af032)){const _0x3dd32e=normalizeName(_0x19905d),_0x5cb0b5=a4_0x24c893[_0x11cfe2(0x231)](process['cwd'](),_0x11cfe2(0x20b),_0x3dd32e,_0x11cfe2(0x280));existsSync(_0x5cb0b5)&&(_0x2d1a19=_0x3dd32e,_0x4af032=_0x5cb0b5);}if(existsSync(_0x4af032))_0x36def7=a4_0x24c893[_0x11cfe2(0x1e7)](_0x4af032),console[_0x11cfe2(0x25b)](a4_0x282c7e[_0x11cfe2(0x233)]('Using\x20local\x20project:\x20'+_0x36def7));else{const _0x5ade47=_0x50b595[_0x11cfe2(0x279)];if(_0x5ade47)throw new SDKError(ErrorCode[_0x11cfe2(0x29d)],'Cannot\x20clone\x20from\x20context\x20project\x20\x22'+_0x19905d+_0x11cfe2(0x26e),undefined,{'helpText':_0x11cfe2(0x27c)+_0x11cfe2(0x23b)+(_0x11cfe2(0x251)+_0x19905d+'\x0a')+(_0x11cfe2(0x242)+_0x2d1a19+_0x11cfe2(0x295)+(_0x3f7b80||'<new-name>')+_0x11cfe2(0x24d)+_0x5ade47)});_0x36def7=_0x19905d,console['log'](a4_0x282c7e[_0x11cfe2(0x233)](_0x11cfe2(0x212)+_0x19905d));}}}}if(!_0x36def7)return console['log'](a4_0x282c7e[_0x11cfe2(0x1f9)](_0x11cfe2(0x22a))),console['log'](_0x11cfe2(0x282)),console[_0x11cfe2(0x25b)](_0x11cfe2(0x28b)),console[_0x11cfe2(0x25b)]('\x20\x20tdx\x20agent\x20clone\x20--name\x20<new-name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clone\x20from\x20context\x20(llm_project)'),console[_0x11cfe2(0x25b)]('\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>'),0x1;if(!_0x3f7b80)throw new SDKError(ErrorCode[_0x11cfe2(0x22d)],_0x11cfe2(0x206),undefined,{'helpText':_0x11cfe2(0x222)});if(!_0x4764f7&&!_0x3235bb){if(!isInteractive())return console[_0x11cfe2(0x23d)](a4_0x282c7e['red'](_0x11cfe2(0x25c)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a4_0x282c7e[_0x11cfe2(0x233)](_0x11cfe2(0x219))),0x1;const _0x536fb3=await confirmKey(_0x11cfe2(0x297)+_0x36def7+_0x11cfe2(0x250)+_0x3f7b80+'\x22?');if(!_0x536fb3)return console[_0x11cfe2(0x25b)](a4_0x282c7e[_0x11cfe2(0x1f9)](_0x11cfe2(0x28d))),0x1;}const {data:_0x2b7247}=await withSpinner(_0x11cfe2(0x29c)+_0x36def7+_0x11cfe2(0x216)+_0x3f7b80+_0x11cfe2(0x224),()=>_0x193cf7['llm'][_0x11cfe2(0x253)](_0x36def7,_0x3f7b80,{'dryRun':_0x3235bb}));if(_0x3235bb){console[_0x11cfe2(0x25b)](a4_0x282c7e['yellow'](_0x11cfe2(0x1fb))),console[_0x11cfe2(0x25b)](_0x11cfe2(0x1f2)+_0x2b7247[_0x11cfe2(0x271)]),console['log'](_0x11cfe2(0x288)+_0x3f7b80),console[_0x11cfe2(0x25b)](_0x11cfe2(0x220)),console[_0x11cfe2(0x25b)](_0x11cfe2(0x234)+_0x2b7247[_0x11cfe2(0x298)]['agents'][_0x11cfe2(0x27d)]),console[_0x11cfe2(0x25b)](_0x11cfe2(0x287)+_0x2b7247[_0x11cfe2(0x298)][_0x11cfe2(0x208)][_0x11cfe2(0x27d)]),console[_0x11cfe2(0x25b)](_0x11cfe2(0x283)+_0x2b7247[_0x11cfe2(0x298)][_0x11cfe2(0x24a)][_0x11cfe2(0x27d)]);const _0x4be03a=_0x2b7247[_0x11cfe2(0x298)][_0x11cfe2(0x235)][_0x11cfe2(0x27d)]>0x0||_0x2b7247[_0x11cfe2(0x298)]['experimentalArtifacts']['created']>0x0;return _0x4be03a&&(console[_0x11cfe2(0x25b)](_0x11cfe2(0x24e)+_0x2b7247[_0x11cfe2(0x298)][_0x11cfe2(0x235)][_0x11cfe2(0x27d)]),console['log'](_0x11cfe2(0x275)+_0x2b7247[_0x11cfe2(0x298)][_0x11cfe2(0x200)][_0x11cfe2(0x27d)])),0x0;}const _0x358328=_0x2b7247[_0x11cfe2(0x298)]['agents'][_0x11cfe2(0x223)]>0x0||_0x2b7247['counts']['knowledgeBases'][_0x11cfe2(0x223)]>0x0||_0x2b7247[_0x11cfe2(0x298)][_0x11cfe2(0x24a)]['errors']>0x0||_0x2b7247['counts'][_0x11cfe2(0x235)]['errors']>0x0||_0x2b7247[_0x11cfe2(0x298)][_0x11cfe2(0x200)][_0x11cfe2(0x223)]>0x0;_0x358328?console[_0x11cfe2(0x25b)](a4_0x282c7e[_0x11cfe2(0x1f9)](_0x11cfe2(0x259))):console[_0x11cfe2(0x25b)](a4_0x282c7e[_0x11cfe2(0x29a)](_0x11cfe2(0x290)));console[_0x11cfe2(0x25b)](_0x11cfe2(0x1f2)+_0x2b7247[_0x11cfe2(0x271)]),console[_0x11cfe2(0x25b)](_0x11cfe2(0x288)+_0x2b7247[_0x11cfe2(0x257)]),console[_0x11cfe2(0x25b)](_0x11cfe2(0x26b)+_0x2b7247[_0x11cfe2(0x285)]),console[_0x11cfe2(0x25b)](),console['log'](_0x11cfe2(0x273)),console[_0x11cfe2(0x25b)](_0x11cfe2(0x234)+formatCountSummary(_0x2b7247[_0x11cfe2(0x298)]['agents'])),console[_0x11cfe2(0x25b)](_0x11cfe2(0x287)+formatCountSummary(_0x2b7247[_0x11cfe2(0x298)][_0x11cfe2(0x208)])),console[_0x11cfe2(0x25b)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x2b7247[_0x11cfe2(0x298)][_0x11cfe2(0x24a)])),console[_0x11cfe2(0x25b)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x2b7247[_0x11cfe2(0x298)][_0x11cfe2(0x204)]));const _0x5a1037=_0x2b7247[_0x11cfe2(0x298)]['experimentalKnowledgeBases'][_0x11cfe2(0x27d)]>0x0||_0x2b7247[_0x11cfe2(0x298)][_0x11cfe2(0x235)]['updated']>0x0||_0x2b7247[_0x11cfe2(0x298)][_0x11cfe2(0x235)][_0x11cfe2(0x210)]>0x0||_0x2b7247[_0x11cfe2(0x298)]['experimentalArtifacts'][_0x11cfe2(0x27d)]>0x0||_0x2b7247[_0x11cfe2(0x298)]['experimentalArtifacts'][_0x11cfe2(0x205)]>0x0||_0x2b7247[_0x11cfe2(0x298)][_0x11cfe2(0x200)][_0x11cfe2(0x210)]>0x0;_0x5a1037&&(console['log']('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x2b7247[_0x11cfe2(0x298)][_0x11cfe2(0x235)])),console[_0x11cfe2(0x25b)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x2b7247[_0x11cfe2(0x298)]['experimentalArtifacts'])));if(_0x358328){console[_0x11cfe2(0x25b)](),console[_0x11cfe2(0x25b)](a4_0x282c7e[_0x11cfe2(0x23f)]('Errors:'));for(const _0x2a8714 of _0x2b7247[_0x11cfe2(0x20b)]){_0x2a8714[_0x11cfe2(0x1f7)]===_0x11cfe2(0x23d)&&console[_0x11cfe2(0x25b)](a4_0x282c7e['red'](_0x11cfe2(0x24b)+_0x2a8714[_0x11cfe2(0x25d)]+_0x11cfe2(0x245)+_0x2a8714['error']));}for(const _0x27f0ca of _0x2b7247[_0x11cfe2(0x208)]){_0x27f0ca[_0x11cfe2(0x1f7)]===_0x11cfe2(0x23d)&&console[_0x11cfe2(0x25b)](a4_0x282c7e[_0x11cfe2(0x23f)](_0x11cfe2(0x1ef)+_0x27f0ca[_0x11cfe2(0x1f4)]+_0x11cfe2(0x245)+_0x27f0ca['error']));}for(const _0x447b10 of _0x2b7247['prompts']){_0x447b10['action']===_0x11cfe2(0x23d)&&console['log'](a4_0x282c7e[_0x11cfe2(0x23f)](_0x11cfe2(0x236)+_0x447b10['name']+'\x22:\x20'+_0x447b10['error']));}for(const _0x227053 of _0x2b7247[_0x11cfe2(0x204)]){_0x227053['action']===_0x11cfe2(0x23d)&&console[_0x11cfe2(0x25b)](a4_0x282c7e[_0x11cfe2(0x23f)](_0x11cfe2(0x27b)+_0x227053[_0x11cfe2(0x1f4)]+_0x11cfe2(0x245)+_0x227053[_0x11cfe2(0x23d)]));}for(const _0x451034 of _0x2b7247[_0x11cfe2(0x235)]){_0x451034[_0x11cfe2(0x1f7)]===_0x11cfe2(0x23d)&&console[_0x11cfe2(0x25b)](a4_0x282c7e[_0x11cfe2(0x23f)](_0x11cfe2(0x26c)+_0x451034[_0x11cfe2(0x1f4)]+_0x11cfe2(0x245)+_0x451034[_0x11cfe2(0x23d)]));}for(const _0x465f08 of _0x2b7247[_0x11cfe2(0x200)]){_0x465f08[_0x11cfe2(0x1f7)]==='error'&&console[_0x11cfe2(0x25b)](a4_0x282c7e[_0x11cfe2(0x23f)](_0x11cfe2(0x230)+_0x465f08['name']+'\x22:\x20'+_0x465f08['error']));}return 0x1;}console['log']();const _0x299eb1=getLLMProjectUrl(_0xb26468,_0x2b7247[_0x11cfe2(0x285)]);return console[_0x11cfe2(0x25b)](_0x11cfe2(0x20e)+a4_0x282c7e[_0x11cfe2(0x254)](_0x299eb1)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x3c89bd(0x1f4)]=a4_0x3c89bd(0x207);['description']=a4_0x3c89bd(0x21c);async[a4_0x3c89bd(0x237)](_0x457879){const _0x4408d5=a4_0x3c89bd,{options:_0x389e77,args:_0x17f8ee,tdx:_0x13cab8}=_0x457879;let _0x568ba4=_0x17f8ee[0x0]||process[_0x4408d5(0x294)]();const _0x2c62a2=_0x389e77['dryRun'],_0x52c6f5=_0x389e77[_0x4408d5(0x270)],_0x58bb01=_0x389e77[_0x4408d5(0x276)],_0x3e1d0e=_0x389e77['site'],_0x490728=a4_0x24c893[_0x4408d5(0x231)](_0x568ba4,_0x4408d5(0x286)),_0x32d4d8=existsSync(_0x490728);if(_0x32d4d8){const {data:_0x154e65}=await withSpinner(_0x4408d5(0x211)+_0x568ba4+_0x4408d5(0x224),()=>_0x13cab8[_0x4408d5(0x20a)]['pushAgent'](_0x568ba4,{'dryRun':_0x2c62a2,'force':_0x52c6f5}));if(_0x2c62a2)return console[_0x4408d5(0x25b)](a4_0x282c7e[_0x4408d5(0x1f9)](_0x4408d5(0x1fb))),console[_0x4408d5(0x25b)](_0x4408d5(0x243)+_0x154e65[_0x4408d5(0x25d)]),0x0;if(_0x154e65['action']===_0x4408d5(0x23d))return console['log'](a4_0x282c7e['red'](_0x4408d5(0x221)+_0x154e65[_0x4408d5(0x23d)])),0x1;console[_0x4408d5(0x25b)](a4_0x282c7e[_0x4408d5(0x29a)](_0x4408d5(0x1f0)+_0x154e65['action']+_0x4408d5(0x24c))),console[_0x4408d5(0x25b)](_0x4408d5(0x272)+_0x154e65['agentName']);if(_0x154e65['agentId']&&_0x154e65['projectId']){const _0x5965c0=getLLMAgentChatUrl(_0x3e1d0e,_0x154e65[_0x4408d5(0x1f8)],_0x154e65[_0x4408d5(0x209)]);console[_0x4408d5(0x25b)](_0x4408d5(0x255)+a4_0x282c7e[_0x4408d5(0x254)](_0x5965c0));}return 0x0;}const _0x3f6b26=_0x389e77[_0x4408d5(0x289)],_0x2f65bb=resolveProjectFromContext(_0x568ba4,_0x3f6b26);if(_0x2f65bb[_0x4408d5(0x291)])_0x568ba4=_0x2f65bb['projectDir'],_0x2f65bb[_0x4408d5(0x1fe)]===_0x4408d5(0x240)&&console[_0x4408d5(0x25b)](a4_0x282c7e[_0x4408d5(0x233)]('Using\x20project:\x20'+_0x568ba4));else{let _0x55f16d='Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.';_0x2f65bb[_0x4408d5(0x22f)]===_0x4408d5(0x246)&&(_0x55f16d=_0x2f65bb[_0x4408d5(0x248)]+_0x4408d5(0x23a)+_0x2f65bb[_0x4408d5(0x289)]+_0x4408d5(0x299));throw new SDKError(ErrorCode[_0x4408d5(0x29d)],_0x2f65bb['reason']===_0x4408d5(0x20f)?_0x2f65bb['message']:_0x4408d5(0x1ff)+_0x568ba4,undefined,{'helpText':_0x55f16d});}const {data:_0x33f7ee}=await withSpinner('Analyzing\x20changes\x20to\x20push...',()=>_0x13cab8['llm']['pushProject'](_0x568ba4,{'dryRun':!![]})),_0x4b52de=_0x33f7ee[_0x4408d5(0x298)][_0x4408d5(0x20b)][_0x4408d5(0x223)]>0x0;if(_0x4b52de){console['log'](a4_0x282c7e['red'](_0x4408d5(0x27a)));for(const _0xaca2b7 of _0x33f7ee[_0x4408d5(0x20b)]){_0xaca2b7[_0x4408d5(0x1f7)]===_0x4408d5(0x23d)&&console[_0x4408d5(0x25b)](a4_0x282c7e['red'](_0x4408d5(0x24b)+_0xaca2b7[_0x4408d5(0x25d)]+'\x22:\x20'+_0xaca2b7[_0x4408d5(0x23d)]));}return 0x1;}const _0x49b8ba=_0x33f7ee[_0x4408d5(0x298)][_0x4408d5(0x20b)][_0x4408d5(0x27d)]+_0x33f7ee[_0x4408d5(0x298)][_0x4408d5(0x208)][_0x4408d5(0x27d)]+_0x33f7ee['counts']['textKnowledgeBases'][_0x4408d5(0x27d)]+_0x33f7ee['counts'][_0x4408d5(0x24a)][_0x4408d5(0x27d)]+_0x33f7ee[_0x4408d5(0x298)]['integrations'][_0x4408d5(0x27d)]+_0x33f7ee[_0x4408d5(0x298)][_0x4408d5(0x235)][_0x4408d5(0x27d)]+_0x33f7ee[_0x4408d5(0x298)]['experimentalArtifacts']['created'],_0x97d6af=_0x33f7ee[_0x4408d5(0x298)]['agents'][_0x4408d5(0x205)]+_0x33f7ee[_0x4408d5(0x298)][_0x4408d5(0x208)][_0x4408d5(0x205)]+_0x33f7ee['counts'][_0x4408d5(0x1eb)][_0x4408d5(0x205)]+_0x33f7ee['counts'][_0x4408d5(0x24a)][_0x4408d5(0x205)]+_0x33f7ee['counts'][_0x4408d5(0x204)]['updated']+_0x33f7ee[_0x4408d5(0x298)][_0x4408d5(0x235)][_0x4408d5(0x205)]+_0x33f7ee['counts']['experimentalArtifacts'][_0x4408d5(0x205)],_0x5973e3=_0x33f7ee[_0x4408d5(0x298)][_0x4408d5(0x20b)]['unchanged']+_0x33f7ee[_0x4408d5(0x298)]['knowledgeBases'][_0x4408d5(0x210)]+_0x33f7ee[_0x4408d5(0x298)]['textKnowledgeBases'][_0x4408d5(0x210)]+_0x33f7ee[_0x4408d5(0x298)]['prompts'][_0x4408d5(0x210)]+_0x33f7ee['counts']['integrations'][_0x4408d5(0x210)]+_0x33f7ee['counts'][_0x4408d5(0x235)]['unchanged']+_0x33f7ee[_0x4408d5(0x298)][_0x4408d5(0x200)][_0x4408d5(0x210)];console[_0x4408d5(0x25b)](_0x4408d5(0x20c)+_0x33f7ee[_0x4408d5(0x1f1)]+'\x27:'),console[_0x4408d5(0x25b)]('\x20\x20'+a4_0x282c7e[_0x4408d5(0x29a)]('+\x20'+_0x49b8ba+_0x4408d5(0x1e6))+_0x4408d5(0x241)+a4_0x282c7e['yellow']('~\x20'+_0x97d6af+_0x4408d5(0x21f))+_0x4408d5(0x241)+a4_0x282c7e[_0x4408d5(0x233)]('=\x20'+_0x5973e3+_0x4408d5(0x1fc))),console[_0x4408d5(0x25b)]('\x20\x20Agents:\x20'+formatCountSummary(_0x33f7ee[_0x4408d5(0x298)]['agents'])),console[_0x4408d5(0x25b)](_0x4408d5(0x287)+formatCountSummary(_0x33f7ee[_0x4408d5(0x298)]['knowledgeBases'])),console[_0x4408d5(0x25b)](_0x4408d5(0x260)+formatCountSummary(_0x33f7ee[_0x4408d5(0x298)][_0x4408d5(0x1eb)])),console[_0x4408d5(0x25b)](_0x4408d5(0x283)+formatCountSummary(_0x33f7ee[_0x4408d5(0x298)][_0x4408d5(0x24a)])),console[_0x4408d5(0x25b)](_0x4408d5(0x28f)+formatCountSummary(_0x33f7ee['counts']['integrations']));const _0xad94bd=_0x33f7ee[_0x4408d5(0x298)][_0x4408d5(0x235)][_0x4408d5(0x27d)]>0x0||_0x33f7ee[_0x4408d5(0x298)][_0x4408d5(0x235)][_0x4408d5(0x205)]>0x0||_0x33f7ee[_0x4408d5(0x298)][_0x4408d5(0x235)][_0x4408d5(0x210)]>0x0||_0x33f7ee[_0x4408d5(0x298)]['experimentalArtifacts'][_0x4408d5(0x27d)]>0x0||_0x33f7ee[_0x4408d5(0x298)]['experimentalArtifacts'][_0x4408d5(0x205)]>0x0||_0x33f7ee[_0x4408d5(0x298)]['experimentalArtifacts']['unchanged']>0x0;_0xad94bd&&(console['log'](_0x4408d5(0x24e)+formatCountSummary(_0x33f7ee[_0x4408d5(0x298)][_0x4408d5(0x235)])),console['log'](_0x4408d5(0x275)+formatCountSummary(_0x33f7ee[_0x4408d5(0x298)][_0x4408d5(0x200)])));console[_0x4408d5(0x25b)](_0x4408d5(0x277)+a4_0x282c7e[_0x4408d5(0x254)](_0x568ba4)),displayDiffs(_0x33f7ee[_0x4408d5(0x20b)],_0x33f7ee[_0x4408d5(0x208)],_0x33f7ee['textKnowledgeBases'],_0x33f7ee['prompts'],_0x33f7ee[_0x4408d5(0x204)],_0x33f7ee[_0x4408d5(0x235)],_0x33f7ee[_0x4408d5(0x200)]);if(_0x2c62a2)return console['log'](a4_0x282c7e[_0x4408d5(0x1f9)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed')),0x0;if(_0x49b8ba===0x0&&_0x97d6af===0x0){console[_0x4408d5(0x25b)](a4_0x282c7e[_0x4408d5(0x29a)](_0x4408d5(0x26d)));const _0xe9231b=getLLMProjectUrl(_0x3e1d0e,_0x33f7ee['projectId']);return console[_0x4408d5(0x25b)](_0x4408d5(0x20e)+a4_0x282c7e[_0x4408d5(0x254)](_0xe9231b)),0x0;}if(!_0x58bb01&&!_0x52c6f5){if(!isInteractive())return console['error'](a4_0x282c7e[_0x4408d5(0x23f)](_0x4408d5(0x25c)),_0x4408d5(0x29b)),console[_0x4408d5(0x23d)](a4_0x282c7e['dim'](_0x4408d5(0x219))),0x1;const _0x10d164=await confirmKey(_0x4408d5(0x1f6)+(_0x49b8ba+_0x97d6af)+_0x4408d5(0x202));if(!_0x10d164)return console[_0x4408d5(0x25b)](a4_0x282c7e[_0x4408d5(0x1f9)]('Cancelled'),'-\x20nothing\x20pushed'),0x1;}const {data:_0x2d6a24}=await withSpinner(_0x4408d5(0x247),()=>_0x13cab8[_0x4408d5(0x20a)][_0x4408d5(0x25f)](_0x568ba4,{'force':_0x52c6f5})),_0x36b344=_0x2d6a24['counts']['agents']['errors']>0x0||_0x2d6a24['counts'][_0x4408d5(0x208)]['errors']>0x0||_0x2d6a24[_0x4408d5(0x298)][_0x4408d5(0x1eb)][_0x4408d5(0x223)]>0x0||_0x2d6a24[_0x4408d5(0x298)][_0x4408d5(0x24a)][_0x4408d5(0x223)]>0x0;if(_0x36b344){console[_0x4408d5(0x25b)](a4_0x282c7e['yellow'](_0x4408d5(0x23e))),console['log'](),console['log'](a4_0x282c7e[_0x4408d5(0x23f)](_0x4408d5(0x278)));for(const _0x1c9e42 of _0x2d6a24[_0x4408d5(0x20b)]){_0x1c9e42[_0x4408d5(0x1f7)]===_0x4408d5(0x23d)&&console['log'](a4_0x282c7e[_0x4408d5(0x23f)](_0x4408d5(0x24b)+_0x1c9e42[_0x4408d5(0x25d)]+_0x4408d5(0x245)+_0x1c9e42[_0x4408d5(0x23d)]));}for(const _0x23e3cd of _0x2d6a24[_0x4408d5(0x208)]){_0x23e3cd[_0x4408d5(0x1f7)]===_0x4408d5(0x23d)&&console[_0x4408d5(0x25b)](a4_0x282c7e[_0x4408d5(0x23f)]('\x20\x20Knowledge\x20Base\x20\x22'+_0x23e3cd[_0x4408d5(0x1f4)]+_0x4408d5(0x245)+_0x23e3cd[_0x4408d5(0x23d)]));}for(const _0x3cac9f of _0x2d6a24[_0x4408d5(0x1eb)]){_0x3cac9f[_0x4408d5(0x1f7)]===_0x4408d5(0x23d)&&console[_0x4408d5(0x25b)](a4_0x282c7e[_0x4408d5(0x23f)](_0x4408d5(0x1e9)+_0x3cac9f[_0x4408d5(0x1f4)]+_0x4408d5(0x245)+_0x3cac9f[_0x4408d5(0x23d)]));}for(const _0x3c957b of _0x2d6a24[_0x4408d5(0x24a)]){_0x3c957b[_0x4408d5(0x1f7)]==='error'&&console['log'](a4_0x282c7e[_0x4408d5(0x23f)](_0x4408d5(0x236)+_0x3c957b[_0x4408d5(0x1f4)]+'\x22:\x20'+_0x3c957b[_0x4408d5(0x23d)]));}for(const _0x4e6c0a of _0x2d6a24['integrations']){_0x4e6c0a['action']===_0x4408d5(0x23d)&&console[_0x4408d5(0x25b)](a4_0x282c7e[_0x4408d5(0x23f)](_0x4408d5(0x27b)+_0x4e6c0a[_0x4408d5(0x1f4)]+_0x4408d5(0x245)+_0x4e6c0a['error']));}return 0x1;}console['log'](a4_0x282c7e[_0x4408d5(0x29a)](_0x4408d5(0x1fa)+(_0x49b8ba+_0x97d6af)+_0x4408d5(0x1f3)+_0x2d6a24[_0x4408d5(0x1f1)]+'\x27'));const _0x351dd8=getLLMProjectUrl(_0x3e1d0e,_0x2d6a24[_0x4408d5(0x1f8)]);return console[_0x4408d5(0x25b)](_0x4408d5(0x20e)+a4_0x282c7e['cyan'](_0x351dd8)),0x0;}}
1
+ const a4_0x80e2a5=a4_0x27f9;(function(_0x5992e3,_0x40fbce){const _0x584ae0=a4_0x27f9,_0x2006ef=_0x5992e3();while(!![]){try{const _0x4aa4ec=parseInt(_0x584ae0(0x9c))/0x1+-parseInt(_0x584ae0(0x98))/0x2+-parseInt(_0x584ae0(0xc0))/0x3+-parseInt(_0x584ae0(0x74))/0x4+-parseInt(_0x584ae0(0xda))/0x5+parseInt(_0x584ae0(0xcc))/0x6+parseInt(_0x584ae0(0xbe))/0x7;if(_0x4aa4ec===_0x40fbce)break;else _0x2006ef['push'](_0x2006ef['shift']());}catch(_0x29a9f5){_0x2006ef['push'](_0x2006ef['shift']());}}}(a4_0x50d2,0x83db1));import a4_0x2e9eea from'chalk';import a4_0x53f2df from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';function a4_0x27f9(_0x3468ed,_0x4b7a6d){_0x3468ed=_0x3468ed-0x72;const _0x50d2e7=a4_0x50d2();let _0x27f99d=_0x50d2e7[_0x3468ed];return _0x27f99d;}import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext,resolveAgentPullArgs}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x550d35){const _0x1a250e=a4_0x27f9,_0x1e915e=[];if(_0x550d35['total']!==undefined)_0x1e915e['push'](_0x550d35['total']+'\x20total');if(_0x550d35[_0x1a250e(0xf0)]!==undefined&&_0x550d35[_0x1a250e(0xf0)]>0x0)_0x1e915e[_0x1a250e(0x102)](a4_0x2e9eea[_0x1a250e(0x109)](_0x550d35[_0x1a250e(0xf0)]+_0x1a250e(0xe4)));if(_0x550d35[_0x1a250e(0xc9)]!==undefined&&_0x550d35['created']>0x0)_0x1e915e[_0x1a250e(0x102)](a4_0x2e9eea[_0x1a250e(0x109)](_0x550d35[_0x1a250e(0xc9)]+'\x20created'));if(_0x550d35[_0x1a250e(0x106)]!==undefined&&_0x550d35[_0x1a250e(0x106)]>0x0)_0x1e915e[_0x1a250e(0x102)](a4_0x2e9eea[_0x1a250e(0x9d)](_0x550d35[_0x1a250e(0x106)]+_0x1a250e(0x100)));if(_0x550d35[_0x1a250e(0x119)]!==undefined&&_0x550d35[_0x1a250e(0x119)]>0x0)_0x1e915e['push'](a4_0x2e9eea['gray'](_0x550d35[_0x1a250e(0x119)]+'\x20unchanged'));if(_0x550d35[_0x1a250e(0x108)]!==undefined&&_0x550d35[_0x1a250e(0x108)]>0x0)_0x1e915e[_0x1a250e(0x102)](a4_0x2e9eea[_0x1a250e(0x11d)](_0x550d35['errors']+_0x1a250e(0x80)));return _0x1e915e[_0x1a250e(0xc2)](',\x20');}function displayDiffs(_0x1e64a7,_0x4e8bb9,_0xe5318a,_0x1f7e4d,_0x51d6b5,_0x40448,_0x10d85b){const _0x380cbd=a4_0x27f9;for(const _0x19a1af of _0x1e64a7){if(_0x19a1af[_0x380cbd(0x123)]){const _0x2391bd=_0x19a1af[_0x380cbd(0xb3)]||_0x19a1af[_0x380cbd(0xba)];console['log']('\x0aChanges\x20to\x20agent\x20\x27'+_0x2391bd+'\x27:'),console[_0x380cbd(0x105)]('─'[_0x380cbd(0xe6)](0x3c)),console[_0x380cbd(0x105)](_0x19a1af['diff']),console[_0x380cbd(0x105)]('─'[_0x380cbd(0xe6)](0x3c));}}for(const _0x47cdbe of _0x4e8bb9){_0x47cdbe[_0x380cbd(0x123)]&&(console[_0x380cbd(0x105)](_0x380cbd(0x94)+_0x47cdbe[_0x380cbd(0xba)]+'\x27:'),console['log']('─'[_0x380cbd(0xe6)](0x3c)),console[_0x380cbd(0x105)](_0x47cdbe[_0x380cbd(0x123)]),console['log']('─'[_0x380cbd(0xe6)](0x3c)));}for(const _0x47af9b of _0xe5318a){_0x47af9b[_0x380cbd(0x123)]&&(console['log'](_0x380cbd(0x78)+_0x47af9b[_0x380cbd(0xba)]+'\x27:'),console[_0x380cbd(0x105)]('─'[_0x380cbd(0xe6)](0x3c)),console[_0x380cbd(0x105)](_0x47af9b[_0x380cbd(0x123)]),console['log']('─'['repeat'](0x3c)));}for(const _0xd673a8 of _0x1f7e4d){_0xd673a8['diff']&&(console[_0x380cbd(0x105)](_0x380cbd(0x8c)+_0xd673a8[_0x380cbd(0xba)]+'\x27:'),console[_0x380cbd(0x105)]('─'[_0x380cbd(0xe6)](0x3c)),console[_0x380cbd(0x105)](_0xd673a8[_0x380cbd(0x123)]),console[_0x380cbd(0x105)]('─'[_0x380cbd(0xe6)](0x3c)));}for(const _0x1681bb of _0x51d6b5){_0x1681bb[_0x380cbd(0x123)]&&(console[_0x380cbd(0x105)](_0x380cbd(0x72)+_0x1681bb[_0x380cbd(0xba)]+'\x27:'),console[_0x380cbd(0x105)]('─'[_0x380cbd(0xe6)](0x3c)),console[_0x380cbd(0x105)](_0x1681bb['diff']),console['log']('─'[_0x380cbd(0xe6)](0x3c)));}for(const _0x47d0c6 of _0x40448){_0x47d0c6[_0x380cbd(0x123)]&&(console[_0x380cbd(0x105)](_0x380cbd(0xfa)+_0x47d0c6[_0x380cbd(0xba)]+'\x27:'),console[_0x380cbd(0x105)]('─'['repeat'](0x3c)),console[_0x380cbd(0x105)](_0x47d0c6[_0x380cbd(0x123)]),console[_0x380cbd(0x105)]('─'[_0x380cbd(0xe6)](0x3c)));}for(const _0x15301c of _0x10d85b){_0x15301c[_0x380cbd(0x123)]&&(console[_0x380cbd(0x105)](_0x380cbd(0xf9)+_0x15301c[_0x380cbd(0xba)]+'\x27:'),console[_0x380cbd(0x105)]('─'['repeat'](0x3c)),console[_0x380cbd(0x105)](_0x15301c['diff']),console['log']('─'['repeat'](0x3c)));}}function a4_0x50d2(){const _0x3239d0=['found','dirname','reason','yes','\x20errors','newProjectId','llmProject','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','Agent:\x20','Using\x20project\x20from\x20context:\x20','sourceProjectName','outputDir','site','New\x20project\x20name\x20is\x20required','Using\x20local\x20project:\x20','\x20=\x20','\x0aChanges\x20to\x20prompt\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project','\x0aPush\x20summary\x20for\x20\x27','No\x20tdx.json\x20found\x20in\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory','pullAgent','\x20\x20Text\x20Knowledge\x20Bases:\x20','\x22...','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','cwd','Using\x20project:\x20','integrations','1959492ZNibhA','\x0a✔\x20Pushed\x20','agent:clone','\x20--profile\x20','778352nAqOXJ','yellow','prompts','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','experimentalKnowledgeBases','agents','\x20\x20Experimental\x20Artifacts:\x20','\x22\x20to\x20\x22','\x20\x20Knowledge\x20Base\x20\x22','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','projectDir','Errors:','-\x20nothing\x20pushed','no_local_folder','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','\x20|\x20','\x0aError:','cyan','\x20changed','Dry\x20run\x20-\x20no\x20changes\x20made','execute','llm_project','\x0aPush\x20','agentName','✔\x20Context\x20set:\x20','llm','pullProject','\x20\x20Agents:\x20','projectName','Project\x20cloned\x20successfully','name','dryRun','Clone\x20\x22','Project\x20cloned\x20with\x20errors','18471810kSXBEa','\x20\x20tdx\x20agent\x20pull\x20','2244024bYwgoS','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','join','newProjectName','description','\x0a✔\x20Pulled\x20','no_context','dim','Using\x20context\x20project:\x20','created','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','Pulling\x20agent\x20\x22','1371966ySAWTK','Cancelled','outputPath','New\x20project:\x20','\x20resources\x20to\x20\x27','output','\x20\x20Prompts:\x20','parse','cloneProject','Agent\x20pulled\x20successfully','knowledgeBases','Project:\x20','Would\x20clone:','error','2240135RTUiWm','total','isNew','agentId','Analyzing\x20project\x20\x22','\x0aWrite\x20','\x20successfully','tdx.json','textKnowledgeBases','agent:pull','\x20new','profile','repeat','Status:\x20','agent.yml','Chat:\x20','\x20files\x20to\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)','\x20\x20Integrations:\x20','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','INVALID_ARGUMENT','new','agent','\x20\x20Agent\x20\x22','\x20unchanged','arg-dir','counts','\x22\x20from\x20project\x20\x22','\x20\x20Knowledge\x20Bases:\x20','<new-name>','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','\x20\x20Integration\x20\x22','experimentalArtifacts','Output:\x20','Using\x20project\x20from\x20','Pushing\x20to\x20project...','\x20updated','\x20\x20Target:\x20','push','action','\x20\x20Prompt\x20\x22','log','updated','Usage:\x20tdx\x20agent\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20project\x20(requires\x20context\x20or\x20tdx.json)','errors','green','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','Would\x20pull\x20agent:\x20','Pushing\x20agent\x20from\x20\x22','pushProject','Summary:','pushAgent','session','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','Agent\x20','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','\x22\x20to\x20a\x20different\x20profile','Using\x20current\x20project:\x20','projectId','Would\x20push\x20agent:\x20','message','unchanged','\x20resources?','\x20\x20Text\x20Knowledge\x20Base\x20\x22','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','red','Cloning\x20\x22','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','\x20--name\x20','utf-8','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','diff','\x27\x20to\x20create\x20the\x20folder\x20structure.','\x0aChanges\x20to\x20integration\x20\x27','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','3719924GgaQjS','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20--agent\x20<name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20context\x20project','\x0aErrors\x20found:','\x22:\x20','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','hasChanges','Writing\x20files...','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20project'];a4_0x50d2=function(){return _0x3239d0;};return a4_0x50d2();}export class AgentPullCommand extends BaseCommand{[a4_0x80e2a5(0xba)]=a4_0x80e2a5(0xe3);[a4_0x80e2a5(0xc4)]='Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files';async[a4_0x80e2a5(0xb0)](_0x3b2e93){const _0xa33dcb=a4_0x80e2a5,{options:_0x39ee11,args:_0x9b17c,tdx:_0x3ed2c1}=_0x3b2e93,_0x158a63=_0x9b17c[0x0],_0x13e67f=_0x9b17c[0x1],_0xf9ab53=_0x39ee11[_0xa33dcb(0xd1)],_0x27a890=_0x39ee11[_0xa33dcb(0xbb)],_0x59a05c=_0x39ee11['force'],_0x247a14=_0x39ee11['yes'],_0x58f437=_0x39ee11[_0xa33dcb(0x82)],_0x1deea6=_0x39ee11[_0xa33dcb(0xf1)];let _0x4a6394;if(_0x158a63){const _0x1f0430=a4_0x53f2df[_0xa33dcb(0xc2)](_0x158a63,_0xa33dcb(0xe1));if(existsSync(_0x1f0430))try{const _0x467d39=JSON[_0xa33dcb(0xd3)](readFileSync(_0x1f0430,_0xa33dcb(0x121)));_0x467d39[_0xa33dcb(0xb1)]&&(_0x4a6394={'llm_project':_0x467d39[_0xa33dcb(0xb1)]});}catch{}}const _0x53e2c2=findAgentConfigPath(process['cwd']());let _0x5e293e;if(_0x53e2c2)try{const _0x4ef0e2=JSON['parse'](readFileSync(_0x53e2c2,_0xa33dcb(0x121)));_0x4ef0e2[_0xa33dcb(0xb1)]&&(_0x5e293e={'llm_project':_0x4ef0e2[_0xa33dcb(0xb1)]});}catch{}const _0x51c9bf=resolveAgentPullArgs({'arg':_0x158a63,'agentNameArg':_0x13e67f,'agentFlag':_0x1deea6,'contextProject':_0x58f437,'argDirConfig':_0x4a6394,'cwdConfigPath':_0x53e2c2||undefined,'cwdConfig':_0x5e293e}),{projectNameOrId:_0xaacbb8,targetAgentName:_0xed6402,existingOutputDir:_0x322795,source:_0x102c22}=_0x51c9bf;if(_0x102c22===_0xa33dcb(0xf4))console[_0xa33dcb(0x105)](a4_0x2e9eea[_0xa33dcb(0xc7)](_0xa33dcb(0xfe)+a4_0x53f2df['join'](_0x158a63,_0xa33dcb(0xe1))+':\x20'+_0xaacbb8));else{if(_0x102c22==='cwd-config')console[_0xa33dcb(0x105)](a4_0x2e9eea[_0xa33dcb(0xc7)](_0xa33dcb(0x96)+_0xaacbb8));else _0x102c22==='context'&&console[_0xa33dcb(0x105)](a4_0x2e9eea[_0xa33dcb(0xc7)](_0xa33dcb(0x85)+_0xaacbb8));}if(!_0xaacbb8)return _0x1deea6?(console[_0xa33dcb(0x105)](a4_0x2e9eea[_0xa33dcb(0x9d)](_0xa33dcb(0x111))),console[_0xa33dcb(0x105)](_0xa33dcb(0x10a)),console[_0xa33dcb(0x105)](_0xa33dcb(0x122))):(console['log'](a4_0x2e9eea['yellow'](_0xa33dcb(0xee))),console[_0xa33dcb(0x105)](_0xa33dcb(0x107)),console[_0xa33dcb(0x105)](_0xa33dcb(0x8d)),console[_0xa33dcb(0x105)](_0xa33dcb(0x90)),console[_0xa33dcb(0x105)](_0xa33dcb(0x75)),console[_0xa33dcb(0x105)](_0xa33dcb(0x7b))),0x1;if(_0xed6402){const {data:_0x531201}=await withSpinner(_0xa33dcb(0xcb)+_0xed6402+_0xa33dcb(0xf6)+_0xaacbb8+_0xa33dcb(0x93),()=>_0x3ed2c1['llm'][_0xa33dcb(0x91)](_0xaacbb8,_0xed6402,_0xf9ab53,{'dryRun':_0x27a890,'force':_0x59a05c}));if(_0x27a890)return console[_0xa33dcb(0x105)](a4_0x2e9eea['yellow']('Dry\x20run\x20-\x20no\x20files\x20written')),console['log'](_0xa33dcb(0x10b)+_0x531201[_0xa33dcb(0xb3)]),console[_0xa33dcb(0x105)]('Output\x20path:\x20'+_0x531201[_0xa33dcb(0xce)]),_0x531201[_0xa33dcb(0x123)]&&(console['log']('\x0aChanges:'),console[_0xa33dcb(0x105)]('─'[_0xa33dcb(0xe6)](0x3c)),console[_0xa33dcb(0x105)](_0x531201[_0xa33dcb(0x123)]),console[_0xa33dcb(0x105)]('─'[_0xa33dcb(0xe6)](0x3c))),0x0;return console[_0xa33dcb(0x105)](a4_0x2e9eea['green'](_0xa33dcb(0xd5))),console['log']('Agent:\x20'+_0x531201[_0xa33dcb(0xb3)]),console[_0xa33dcb(0x105)](_0xa33dcb(0xfd)+_0x531201[_0xa33dcb(0xce)]),console[_0xa33dcb(0x105)](_0xa33dcb(0xe7)+(_0x531201[_0xa33dcb(0xdc)]?a4_0x2e9eea[_0xa33dcb(0x109)]('new'):_0x531201[_0xa33dcb(0x79)]?a4_0x2e9eea[_0xa33dcb(0x9d)](_0xa33dcb(0x106)):a4_0x2e9eea['gray'](_0xa33dcb(0x119)))),0x0;}const _0x7df378=_0x322795||_0xf9ab53,{data:_0x1cd3d2}=await withSpinner(_0xa33dcb(0xde)+_0xaacbb8+_0xa33dcb(0x93),()=>_0x3ed2c1[_0xa33dcb(0xb5)]['pullProject'](_0xaacbb8,_0x7df378,{'dryRun':!![]})),_0x3889ec=_0x1cd3d2['counts'][_0xa33dcb(0xa1)]['new']+_0x1cd3d2[_0xa33dcb(0xf5)][_0xa33dcb(0xd6)]['new']+_0x1cd3d2[_0xa33dcb(0xf5)][_0xa33dcb(0xe2)]['new']+_0x1cd3d2[_0xa33dcb(0xf5)]['prompts'][_0xa33dcb(0xf0)]+_0x1cd3d2[_0xa33dcb(0xf5)]['integrations'][_0xa33dcb(0xf0)]+_0x1cd3d2[_0xa33dcb(0xf5)][_0xa33dcb(0xa0)][_0xa33dcb(0xf0)]+_0x1cd3d2['counts'][_0xa33dcb(0xfc)][_0xa33dcb(0xf0)],_0x32e9b0=_0x1cd3d2[_0xa33dcb(0xf5)][_0xa33dcb(0xa1)][_0xa33dcb(0x106)]+_0x1cd3d2['counts']['knowledgeBases']['updated']+_0x1cd3d2[_0xa33dcb(0xf5)][_0xa33dcb(0xe2)]['updated']+_0x1cd3d2[_0xa33dcb(0xf5)][_0xa33dcb(0x9e)][_0xa33dcb(0x106)]+_0x1cd3d2['counts']['integrations'][_0xa33dcb(0x106)]+_0x1cd3d2['counts'][_0xa33dcb(0xa0)][_0xa33dcb(0x106)]+_0x1cd3d2[_0xa33dcb(0xf5)][_0xa33dcb(0xfc)]['updated'],_0x59b51e=_0x1cd3d2[_0xa33dcb(0xf5)][_0xa33dcb(0xa1)][_0xa33dcb(0x119)]+_0x1cd3d2[_0xa33dcb(0xf5)][_0xa33dcb(0xd6)][_0xa33dcb(0x119)]+_0x1cd3d2[_0xa33dcb(0xf5)][_0xa33dcb(0xe2)]['unchanged']+_0x1cd3d2[_0xa33dcb(0xf5)]['prompts'][_0xa33dcb(0x119)]+_0x1cd3d2[_0xa33dcb(0xf5)][_0xa33dcb(0x97)][_0xa33dcb(0x119)]+_0x1cd3d2[_0xa33dcb(0xf5)]['experimentalKnowledgeBases']['unchanged']+_0x1cd3d2[_0xa33dcb(0xf5)]['experimentalArtifacts']['unchanged'];console[_0xa33dcb(0x105)]('\x0aPull\x20summary\x20for\x20\x27'+_0x1cd3d2['projectName']+'\x27:'),console['log']('\x20\x20'+a4_0x2e9eea[_0xa33dcb(0x109)]('+\x20'+_0x3889ec+_0xa33dcb(0xe4))+_0xa33dcb(0xab)+a4_0x2e9eea[_0xa33dcb(0x9d)]('~\x20'+_0x32e9b0+_0xa33dcb(0xae))+_0xa33dcb(0xab)+a4_0x2e9eea[_0xa33dcb(0xc7)]('=\x20'+_0x59b51e+_0xa33dcb(0xf3))),console[_0xa33dcb(0x105)](_0xa33dcb(0xb7)+formatCountSummary(_0x1cd3d2[_0xa33dcb(0xf5)][_0xa33dcb(0xa1)])),console['log'](_0xa33dcb(0xf7)+formatCountSummary(_0x1cd3d2[_0xa33dcb(0xf5)][_0xa33dcb(0xd6)])),console['log'](_0xa33dcb(0x92)+formatCountSummary(_0x1cd3d2['counts'][_0xa33dcb(0xe2)])),console[_0xa33dcb(0x105)](_0xa33dcb(0xd2)+formatCountSummary(_0x1cd3d2[_0xa33dcb(0xf5)]['prompts'])),console[_0xa33dcb(0x105)](_0xa33dcb(0xec)+formatCountSummary(_0x1cd3d2[_0xa33dcb(0xf5)][_0xa33dcb(0x97)]));const _0x4d16e9=_0x1cd3d2[_0xa33dcb(0xf5)][_0xa33dcb(0xa0)]['total']>0x0||_0x1cd3d2['counts'][_0xa33dcb(0xfc)][_0xa33dcb(0xdb)]>0x0;_0x4d16e9&&(console[_0xa33dcb(0x105)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x1cd3d2[_0xa33dcb(0xf5)]['experimentalKnowledgeBases'])),console[_0xa33dcb(0x105)](_0xa33dcb(0xa2)+formatCountSummary(_0x1cd3d2[_0xa33dcb(0xf5)][_0xa33dcb(0xfc)])));console[_0xa33dcb(0x105)](_0xa33dcb(0x101)+a4_0x2e9eea[_0xa33dcb(0xad)](_0x1cd3d2[_0xa33dcb(0x87)])),displayDiffs(_0x1cd3d2['agents'],_0x1cd3d2['knowledgeBases'],_0x1cd3d2['textKnowledgeBases'],_0x1cd3d2['prompts'],_0x1cd3d2[_0xa33dcb(0x97)],_0x1cd3d2[_0xa33dcb(0xa0)],_0x1cd3d2[_0xa33dcb(0xfc)]);if(_0x27a890)return console[_0xa33dcb(0x105)](a4_0x2e9eea[_0xa33dcb(0x9d)](_0xa33dcb(0xa5))),0x0;if(_0x3889ec===0x0&&_0x32e9b0===0x0)return console[_0xa33dcb(0x105)](a4_0x2e9eea[_0xa33dcb(0x109)]('\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'llm_project':_0x1cd3d2[_0xa33dcb(0xb8)]},_0x39ee11['session']),console['log'](a4_0x2e9eea[_0xa33dcb(0x109)](_0xa33dcb(0xb4)+a4_0x2e9eea[_0xa33dcb(0xc7)](_0xa33dcb(0xb1))+_0xa33dcb(0x8b)+a4_0x2e9eea[_0xa33dcb(0xad)](_0x1cd3d2[_0xa33dcb(0xb8)]))),0x0;if(!_0x247a14&&!_0x59a05c){if(!isInteractive())return console[_0xa33dcb(0xd9)](a4_0x2e9eea[_0xa33dcb(0x11d)](_0xa33dcb(0xac)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0xa33dcb(0xd9)](a4_0x2e9eea[_0xa33dcb(0xc7)](_0xa33dcb(0x73))),0x1;const _0x1b0860=await confirmKey(_0xa33dcb(0xdf)+(_0x3889ec+_0x32e9b0)+'\x20files?');if(!_0x1b0860)return console[_0xa33dcb(0x105)](a4_0x2e9eea[_0xa33dcb(0x9d)](_0xa33dcb(0xcd)),'-\x20no\x20files\x20written'),0x1;}const {data:_0x59982c}=await withSpinner(_0xa33dcb(0x7a),()=>_0x3ed2c1[_0xa33dcb(0xb5)][_0xa33dcb(0xb6)](_0xaacbb8,_0x7df378,{'force':_0x59a05c}));return console['log'](a4_0x2e9eea[_0xa33dcb(0x109)](_0xa33dcb(0xc5)+(_0x3889ec+_0x32e9b0)+_0xa33dcb(0xea)+_0x59982c[_0xa33dcb(0x87)])),saveSessionContext({'llm_project':_0x59982c[_0xa33dcb(0xb8)]},_0x39ee11[_0xa33dcb(0x110)]),console[_0xa33dcb(0x105)](a4_0x2e9eea[_0xa33dcb(0x109)](_0xa33dcb(0xb4)+a4_0x2e9eea['dim']('llm_project')+_0xa33dcb(0x8b)+a4_0x2e9eea[_0xa33dcb(0xad)](_0x59982c[_0xa33dcb(0xb8)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x80e2a5(0xba)]=a4_0x80e2a5(0x9a);[a4_0x80e2a5(0xc4)]='Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project';async[a4_0x80e2a5(0xb0)](_0x485edc){const _0x5e94cd=a4_0x80e2a5,{options:_0x645c49,args:_0x42e772,tdx:_0x568143}=_0x485edc,_0x247008=_0x42e772[0x0],_0x3d18a9=_0x645c49['name'],_0x13af08=_0x645c49['dryRun'],_0x23ab33=_0x645c49[_0x5e94cd(0x7f)],_0x4adbe1=_0x645c49[_0x5e94cd(0x88)],_0x15182e=_0x645c49[_0x5e94cd(0x82)];let _0xa122f3;const _0x228d42=findAgentConfigPath(process[_0x5e94cd(0x95)]());if(_0x247008){const _0x2f86cc=a4_0x53f2df[_0x5e94cd(0xc2)](_0x247008,'tdx.json');existsSync(_0x2f86cc)?(_0xa122f3=_0x247008,console[_0x5e94cd(0x105)](a4_0x2e9eea['dim'](_0x5e94cd(0x8a)+_0x247008))):_0xa122f3=_0x247008;}else{if(_0x228d42)_0xa122f3=a4_0x53f2df[_0x5e94cd(0x7d)](_0x228d42),console[_0x5e94cd(0x105)](a4_0x2e9eea['dim'](_0x5e94cd(0x115)+_0xa122f3));else{if(_0x15182e){const _0x1d279f=sanitizeForFilesystem(_0x15182e);let _0x3b6224=_0x1d279f,_0x38011a=a4_0x53f2df['join'](process['cwd'](),_0x5e94cd(0xa1),_0x1d279f,_0x5e94cd(0xe1));if(!existsSync(_0x38011a)){const _0x4e723c=normalizeName(_0x15182e),_0xdbdad4=a4_0x53f2df[_0x5e94cd(0xc2)](process[_0x5e94cd(0x95)](),_0x5e94cd(0xa1),_0x4e723c,_0x5e94cd(0xe1));existsSync(_0xdbdad4)&&(_0x3b6224=_0x4e723c,_0x38011a=_0xdbdad4);}if(existsSync(_0x38011a))_0xa122f3=a4_0x53f2df['dirname'](_0x38011a),console[_0x5e94cd(0x105)](a4_0x2e9eea[_0x5e94cd(0xc7)](_0x5e94cd(0x8a)+_0xa122f3));else{const _0x4b8d53=_0x645c49[_0x5e94cd(0xe5)];if(_0x4b8d53)throw new SDKError(ErrorCode[_0x5e94cd(0xef)],'Cannot\x20clone\x20from\x20context\x20project\x20\x22'+_0x15182e+_0x5e94cd(0x114),undefined,{'helpText':_0x5e94cd(0xca)+_0x5e94cd(0xc1)+(_0x5e94cd(0xbf)+_0x15182e+'\x0a')+('\x20\x20tdx\x20agent\x20clone\x20agents/'+_0x3b6224+_0x5e94cd(0x120)+(_0x3d18a9||_0x5e94cd(0xf8))+_0x5e94cd(0x9b)+_0x4b8d53)});_0xa122f3=_0x15182e,console['log'](a4_0x2e9eea[_0x5e94cd(0xc7)](_0x5e94cd(0xc8)+_0x15182e));}}}}if(!_0xa122f3)return console[_0x5e94cd(0x105)](a4_0x2e9eea['yellow'](_0x5e94cd(0x83))),console[_0x5e94cd(0x105)](_0x5e94cd(0x11c)),console['log']('\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory'),console[_0x5e94cd(0x105)](_0x5e94cd(0xeb)),console['log']('\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>'),0x1;if(!_0x3d18a9)throw new SDKError(ErrorCode['MISSING_ARGUMENT'],_0x5e94cd(0x89),undefined,{'helpText':_0x5e94cd(0x113)});if(!_0x23ab33&&!_0x13af08){if(!isInteractive())return console[_0x5e94cd(0xd9)](a4_0x2e9eea[_0x5e94cd(0x11d)](_0x5e94cd(0xac)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x5e94cd(0xd9)](a4_0x2e9eea[_0x5e94cd(0xc7)](_0x5e94cd(0x73))),0x1;const _0xc22e53=await confirmKey(_0x5e94cd(0xbc)+_0xa122f3+'\x22\x20to\x20new\x20project\x20\x22'+_0x3d18a9+'\x22?');if(!_0xc22e53)return console[_0x5e94cd(0x105)](a4_0x2e9eea[_0x5e94cd(0x9d)](_0x5e94cd(0xcd))),0x1;}const {data:_0xa16218}=await withSpinner(_0x5e94cd(0x11e)+_0xa122f3+_0x5e94cd(0xa3)+_0x3d18a9+'\x22...',()=>_0x568143[_0x5e94cd(0xb5)][_0x5e94cd(0xd4)](_0xa122f3,_0x3d18a9,{'dryRun':_0x13af08}));if(_0x13af08){console[_0x5e94cd(0x105)](a4_0x2e9eea['yellow'](_0x5e94cd(0xaf))),console[_0x5e94cd(0x105)]('Source:\x20'+_0xa16218[_0x5e94cd(0x86)]),console['log'](_0x5e94cd(0xcf)+_0x3d18a9),console[_0x5e94cd(0x105)](_0x5e94cd(0xd8)),console[_0x5e94cd(0x105)](_0x5e94cd(0xb7)+_0xa16218[_0x5e94cd(0xf5)][_0x5e94cd(0xa1)][_0x5e94cd(0xc9)]),console[_0x5e94cd(0x105)](_0x5e94cd(0xf7)+_0xa16218[_0x5e94cd(0xf5)][_0x5e94cd(0xd6)]['created']),console[_0x5e94cd(0x105)]('\x20\x20Prompts:\x20'+_0xa16218[_0x5e94cd(0xf5)]['prompts'][_0x5e94cd(0xc9)]);const _0x3bcde8=_0xa16218[_0x5e94cd(0xf5)][_0x5e94cd(0xa0)][_0x5e94cd(0xc9)]>0x0||_0xa16218['counts'][_0x5e94cd(0xfc)][_0x5e94cd(0xc9)]>0x0;return _0x3bcde8&&(console[_0x5e94cd(0x105)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+_0xa16218[_0x5e94cd(0xf5)]['experimentalKnowledgeBases'][_0x5e94cd(0xc9)]),console[_0x5e94cd(0x105)](_0x5e94cd(0xa2)+_0xa16218[_0x5e94cd(0xf5)][_0x5e94cd(0xfc)][_0x5e94cd(0xc9)])),0x0;}const _0x310929=_0xa16218[_0x5e94cd(0xf5)]['agents'][_0x5e94cd(0x108)]>0x0||_0xa16218['counts']['knowledgeBases'][_0x5e94cd(0x108)]>0x0||_0xa16218[_0x5e94cd(0xf5)]['prompts'][_0x5e94cd(0x108)]>0x0||_0xa16218[_0x5e94cd(0xf5)][_0x5e94cd(0xa0)][_0x5e94cd(0x108)]>0x0||_0xa16218['counts'][_0x5e94cd(0xfc)][_0x5e94cd(0x108)]>0x0;_0x310929?console[_0x5e94cd(0x105)](a4_0x2e9eea[_0x5e94cd(0x9d)](_0x5e94cd(0xbd))):console[_0x5e94cd(0x105)](a4_0x2e9eea[_0x5e94cd(0x109)](_0x5e94cd(0xb9)));console[_0x5e94cd(0x105)]('Source:\x20'+_0xa16218[_0x5e94cd(0x86)]),console[_0x5e94cd(0x105)](_0x5e94cd(0xcf)+_0xa16218[_0x5e94cd(0xc3)]),console['log']('New\x20project\x20ID:\x20'+_0xa16218[_0x5e94cd(0x81)]),console[_0x5e94cd(0x105)](),console[_0x5e94cd(0x105)](_0x5e94cd(0x10e)),console['log'](_0x5e94cd(0xb7)+formatCountSummary(_0xa16218['counts'][_0x5e94cd(0xa1)])),console[_0x5e94cd(0x105)](_0x5e94cd(0xf7)+formatCountSummary(_0xa16218['counts'][_0x5e94cd(0xd6)])),console['log'](_0x5e94cd(0xd2)+formatCountSummary(_0xa16218[_0x5e94cd(0xf5)][_0x5e94cd(0x9e)])),console[_0x5e94cd(0x105)](_0x5e94cd(0xec)+formatCountSummary(_0xa16218[_0x5e94cd(0xf5)][_0x5e94cd(0x97)]));const _0x5e13cc=_0xa16218[_0x5e94cd(0xf5)][_0x5e94cd(0xa0)]['created']>0x0||_0xa16218[_0x5e94cd(0xf5)][_0x5e94cd(0xa0)][_0x5e94cd(0x106)]>0x0||_0xa16218[_0x5e94cd(0xf5)][_0x5e94cd(0xa0)][_0x5e94cd(0x119)]>0x0||_0xa16218[_0x5e94cd(0xf5)]['experimentalArtifacts'][_0x5e94cd(0xc9)]>0x0||_0xa16218[_0x5e94cd(0xf5)][_0x5e94cd(0xfc)][_0x5e94cd(0x106)]>0x0||_0xa16218['counts'][_0x5e94cd(0xfc)][_0x5e94cd(0x119)]>0x0;_0x5e13cc&&(console['log'](_0x5e94cd(0xaa)+formatCountSummary(_0xa16218['counts'][_0x5e94cd(0xa0)])),console[_0x5e94cd(0x105)](_0x5e94cd(0xa2)+formatCountSummary(_0xa16218[_0x5e94cd(0xf5)]['experimentalArtifacts'])));if(_0x310929){console['log'](),console[_0x5e94cd(0x105)](a4_0x2e9eea[_0x5e94cd(0x11d)](_0x5e94cd(0xa7)));for(const _0x580d51 of _0xa16218[_0x5e94cd(0xa1)]){_0x580d51[_0x5e94cd(0x103)]==='error'&&console[_0x5e94cd(0x105)](a4_0x2e9eea['red'](_0x5e94cd(0xf2)+_0x580d51[_0x5e94cd(0xb3)]+_0x5e94cd(0x77)+_0x580d51[_0x5e94cd(0xd9)]));}for(const _0x495174 of _0xa16218[_0x5e94cd(0xd6)]){_0x495174['action']===_0x5e94cd(0xd9)&&console[_0x5e94cd(0x105)](a4_0x2e9eea[_0x5e94cd(0x11d)](_0x5e94cd(0xa4)+_0x495174[_0x5e94cd(0xba)]+_0x5e94cd(0x77)+_0x495174[_0x5e94cd(0xd9)]));}for(const _0x29ad12 of _0xa16218[_0x5e94cd(0x9e)]){_0x29ad12[_0x5e94cd(0x103)]===_0x5e94cd(0xd9)&&console[_0x5e94cd(0x105)](a4_0x2e9eea[_0x5e94cd(0x11d)](_0x5e94cd(0x104)+_0x29ad12[_0x5e94cd(0xba)]+_0x5e94cd(0x77)+_0x29ad12[_0x5e94cd(0xd9)]));}for(const _0x304dc1 of _0xa16218[_0x5e94cd(0x97)]){_0x304dc1[_0x5e94cd(0x103)]===_0x5e94cd(0xd9)&&console[_0x5e94cd(0x105)](a4_0x2e9eea[_0x5e94cd(0x11d)](_0x5e94cd(0xfb)+_0x304dc1[_0x5e94cd(0xba)]+_0x5e94cd(0x77)+_0x304dc1[_0x5e94cd(0xd9)]));}for(const _0x28fe5f of _0xa16218['experimentalKnowledgeBases']){_0x28fe5f[_0x5e94cd(0x103)]===_0x5e94cd(0xd9)&&console[_0x5e94cd(0x105)](a4_0x2e9eea[_0x5e94cd(0x11d)]('\x20\x20Experimental\x20Knowledge\x20Base\x20\x22'+_0x28fe5f[_0x5e94cd(0xba)]+_0x5e94cd(0x77)+_0x28fe5f['error']));}for(const _0x488e06 of _0xa16218[_0x5e94cd(0xfc)]){_0x488e06[_0x5e94cd(0x103)]===_0x5e94cd(0xd9)&&console[_0x5e94cd(0x105)](a4_0x2e9eea[_0x5e94cd(0x11d)]('\x20\x20Experimental\x20Artifact\x20\x22'+_0x488e06['name']+_0x5e94cd(0x77)+_0x488e06['error']));}return 0x1;}console['log']();const _0x5b27a2=getLLMProjectUrl(_0x4adbe1,_0xa16218[_0x5e94cd(0x81)]);return console[_0x5e94cd(0x105)](_0x5e94cd(0xd7)+a4_0x2e9eea[_0x5e94cd(0xad)](_0x5b27a2)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x80e2a5(0xba)]='agent:push';[a4_0x80e2a5(0xc4)]=a4_0x80e2a5(0x11f);async[a4_0x80e2a5(0xb0)](_0x3f0514){const _0xb8deb5=a4_0x80e2a5,{options:_0x408f8e,args:_0x2385e1,tdx:_0xcd068e}=_0x3f0514;let _0x41edcf=_0x2385e1[0x0]||process['cwd']();const _0x27d135=_0x408f8e['dryRun'],_0x392e50=_0x408f8e['force'],_0x45bc56=_0x408f8e[_0xb8deb5(0x7f)],_0x544fe4=_0x408f8e[_0xb8deb5(0x88)],_0x265259=a4_0x53f2df[_0xb8deb5(0xc2)](_0x41edcf,_0xb8deb5(0xe8)),_0x45bc13=existsSync(_0x265259);if(_0x45bc13){const {data:_0x3e03fb}=await withSpinner(_0xb8deb5(0x10c)+_0x41edcf+_0xb8deb5(0x93),()=>_0xcd068e['llm'][_0xb8deb5(0x10f)](_0x41edcf,{'dryRun':_0x27d135,'force':_0x392e50}));if(_0x27d135)return console[_0xb8deb5(0x105)](a4_0x2e9eea['yellow'](_0xb8deb5(0xaf))),console[_0xb8deb5(0x105)](_0xb8deb5(0x117)+_0x3e03fb['agentName']),0x0;if(_0x3e03fb[_0xb8deb5(0x103)]==='error')return console[_0xb8deb5(0x105)](a4_0x2e9eea[_0xb8deb5(0x11d)]('Failed\x20to\x20push\x20agent:\x20'+_0x3e03fb['error'])),0x1;console[_0xb8deb5(0x105)](a4_0x2e9eea[_0xb8deb5(0x109)](_0xb8deb5(0x112)+_0x3e03fb[_0xb8deb5(0x103)]+_0xb8deb5(0xe0))),console[_0xb8deb5(0x105)](_0xb8deb5(0x84)+_0x3e03fb[_0xb8deb5(0xb3)]);if(_0x3e03fb[_0xb8deb5(0xdd)]&&_0x3e03fb[_0xb8deb5(0x116)]){const _0x88c344=getLLMAgentChatUrl(_0x544fe4,_0x3e03fb[_0xb8deb5(0x116)],_0x3e03fb[_0xb8deb5(0xdd)]);console['log'](_0xb8deb5(0xe9)+a4_0x2e9eea[_0xb8deb5(0xad)](_0x88c344));}return 0x0;}const _0x22aadf=_0x408f8e['llmProject'],_0x2feb20=resolveProjectFromContext(_0x41edcf,_0x22aadf);if(_0x2feb20[_0xb8deb5(0x7c)])_0x41edcf=_0x2feb20[_0xb8deb5(0xa6)],_0x2feb20['source']==='context'&&console[_0xb8deb5(0x105)](a4_0x2e9eea[_0xb8deb5(0xc7)](_0xb8deb5(0x96)+_0x41edcf));else{let _0x3bbde3='Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.';_0x2feb20[_0xb8deb5(0x7e)]===_0xb8deb5(0xa9)&&(_0x3bbde3=_0x2feb20[_0xb8deb5(0x118)]+_0xb8deb5(0x9f)+_0x2feb20[_0xb8deb5(0x82)]+_0xb8deb5(0x124));throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x2feb20[_0xb8deb5(0x7e)]===_0xb8deb5(0xc6)?_0x2feb20['message']:_0xb8deb5(0x8f)+_0x41edcf,undefined,{'helpText':_0x3bbde3});}const {data:_0x169380}=await withSpinner('Analyzing\x20changes\x20to\x20push...',()=>_0xcd068e[_0xb8deb5(0xb5)][_0xb8deb5(0x10d)](_0x41edcf,{'dryRun':!![]})),_0x5a67ff=_0x169380[_0xb8deb5(0xf5)][_0xb8deb5(0xa1)]['errors']>0x0;if(_0x5a67ff){console[_0xb8deb5(0x105)](a4_0x2e9eea['red'](_0xb8deb5(0x76)));for(const _0x20a2d1 of _0x169380[_0xb8deb5(0xa1)]){_0x20a2d1[_0xb8deb5(0x103)]===_0xb8deb5(0xd9)&&console[_0xb8deb5(0x105)](a4_0x2e9eea[_0xb8deb5(0x11d)](_0xb8deb5(0xf2)+_0x20a2d1[_0xb8deb5(0xb3)]+_0xb8deb5(0x77)+_0x20a2d1[_0xb8deb5(0xd9)]));}return 0x1;}const _0x482646=_0x169380[_0xb8deb5(0xf5)][_0xb8deb5(0xa1)][_0xb8deb5(0xc9)]+_0x169380['counts'][_0xb8deb5(0xd6)][_0xb8deb5(0xc9)]+_0x169380[_0xb8deb5(0xf5)][_0xb8deb5(0xe2)][_0xb8deb5(0xc9)]+_0x169380[_0xb8deb5(0xf5)]['prompts'][_0xb8deb5(0xc9)]+_0x169380['counts'][_0xb8deb5(0x97)][_0xb8deb5(0xc9)]+_0x169380[_0xb8deb5(0xf5)][_0xb8deb5(0xa0)][_0xb8deb5(0xc9)]+_0x169380[_0xb8deb5(0xf5)][_0xb8deb5(0xfc)][_0xb8deb5(0xc9)],_0x4625d4=_0x169380[_0xb8deb5(0xf5)][_0xb8deb5(0xa1)][_0xb8deb5(0x106)]+_0x169380[_0xb8deb5(0xf5)][_0xb8deb5(0xd6)]['updated']+_0x169380[_0xb8deb5(0xf5)][_0xb8deb5(0xe2)]['updated']+_0x169380[_0xb8deb5(0xf5)]['prompts'][_0xb8deb5(0x106)]+_0x169380['counts']['integrations']['updated']+_0x169380['counts'][_0xb8deb5(0xa0)][_0xb8deb5(0x106)]+_0x169380[_0xb8deb5(0xf5)]['experimentalArtifacts'][_0xb8deb5(0x106)],_0x308cd4=_0x169380[_0xb8deb5(0xf5)]['agents']['unchanged']+_0x169380['counts'][_0xb8deb5(0xd6)][_0xb8deb5(0x119)]+_0x169380[_0xb8deb5(0xf5)][_0xb8deb5(0xe2)][_0xb8deb5(0x119)]+_0x169380[_0xb8deb5(0xf5)][_0xb8deb5(0x9e)][_0xb8deb5(0x119)]+_0x169380[_0xb8deb5(0xf5)][_0xb8deb5(0x97)]['unchanged']+_0x169380['counts'][_0xb8deb5(0xa0)][_0xb8deb5(0x119)]+_0x169380[_0xb8deb5(0xf5)][_0xb8deb5(0xfc)][_0xb8deb5(0x119)];console['log'](_0xb8deb5(0x8e)+_0x169380[_0xb8deb5(0xb8)]+'\x27:'),console[_0xb8deb5(0x105)]('\x20\x20'+a4_0x2e9eea[_0xb8deb5(0x109)]('+\x20'+_0x482646+'\x20new')+'\x20|\x20'+a4_0x2e9eea[_0xb8deb5(0x9d)]('~\x20'+_0x4625d4+_0xb8deb5(0xae))+_0xb8deb5(0xab)+a4_0x2e9eea[_0xb8deb5(0xc7)]('=\x20'+_0x308cd4+_0xb8deb5(0xf3))),console['log']('\x20\x20Agents:\x20'+formatCountSummary(_0x169380[_0xb8deb5(0xf5)][_0xb8deb5(0xa1)])),console['log'](_0xb8deb5(0xf7)+formatCountSummary(_0x169380[_0xb8deb5(0xf5)][_0xb8deb5(0xd6)])),console[_0xb8deb5(0x105)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x169380[_0xb8deb5(0xf5)][_0xb8deb5(0xe2)])),console[_0xb8deb5(0x105)](_0xb8deb5(0xd2)+formatCountSummary(_0x169380['counts'][_0xb8deb5(0x9e)])),console[_0xb8deb5(0x105)](_0xb8deb5(0xec)+formatCountSummary(_0x169380[_0xb8deb5(0xf5)]['integrations']));const _0x293d9c=_0x169380['counts'][_0xb8deb5(0xa0)][_0xb8deb5(0xc9)]>0x0||_0x169380[_0xb8deb5(0xf5)][_0xb8deb5(0xa0)][_0xb8deb5(0x106)]>0x0||_0x169380[_0xb8deb5(0xf5)]['experimentalKnowledgeBases'][_0xb8deb5(0x119)]>0x0||_0x169380['counts'][_0xb8deb5(0xfc)][_0xb8deb5(0xc9)]>0x0||_0x169380[_0xb8deb5(0xf5)][_0xb8deb5(0xfc)][_0xb8deb5(0x106)]>0x0||_0x169380[_0xb8deb5(0xf5)]['experimentalArtifacts'][_0xb8deb5(0x119)]>0x0;_0x293d9c&&(console[_0xb8deb5(0x105)](_0xb8deb5(0xaa)+formatCountSummary(_0x169380['counts'][_0xb8deb5(0xa0)])),console[_0xb8deb5(0x105)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x169380[_0xb8deb5(0xf5)][_0xb8deb5(0xfc)])));console[_0xb8deb5(0x105)]('\x20\x20Source:\x20'+a4_0x2e9eea['cyan'](_0x41edcf)),displayDiffs(_0x169380[_0xb8deb5(0xa1)],_0x169380['knowledgeBases'],_0x169380[_0xb8deb5(0xe2)],_0x169380[_0xb8deb5(0x9e)],_0x169380[_0xb8deb5(0x97)],_0x169380[_0xb8deb5(0xa0)],_0x169380[_0xb8deb5(0xfc)]);if(_0x27d135)return console[_0xb8deb5(0x105)](a4_0x2e9eea[_0xb8deb5(0x9d)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed')),0x0;if(_0x482646===0x0&&_0x4625d4===0x0){console['log'](a4_0x2e9eea[_0xb8deb5(0x109)](_0xb8deb5(0xed)));const _0x5dcebf=getLLMProjectUrl(_0x544fe4,_0x169380[_0xb8deb5(0x116)]);return console[_0xb8deb5(0x105)](_0xb8deb5(0xd7)+a4_0x2e9eea['cyan'](_0x5dcebf)),0x0;}if(!_0x45bc56&&!_0x392e50){if(!isInteractive())return console['error'](a4_0x2e9eea[_0xb8deb5(0x11d)](_0xb8deb5(0xac)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0xb8deb5(0xd9)](a4_0x2e9eea[_0xb8deb5(0xc7)](_0xb8deb5(0x73))),0x1;const _0x7cff3b=await confirmKey(_0xb8deb5(0xb2)+(_0x482646+_0x4625d4)+_0xb8deb5(0x11a));if(!_0x7cff3b)return console['log'](a4_0x2e9eea[_0xb8deb5(0x9d)]('Cancelled'),_0xb8deb5(0xa8)),0x1;}const {data:_0xbf55f9}=await withSpinner(_0xb8deb5(0xff),()=>_0xcd068e[_0xb8deb5(0xb5)][_0xb8deb5(0x10d)](_0x41edcf,{'force':_0x392e50})),_0x4a12e0=_0xbf55f9['counts'][_0xb8deb5(0xa1)][_0xb8deb5(0x108)]>0x0||_0xbf55f9[_0xb8deb5(0xf5)][_0xb8deb5(0xd6)][_0xb8deb5(0x108)]>0x0||_0xbf55f9[_0xb8deb5(0xf5)]['textKnowledgeBases']['errors']>0x0||_0xbf55f9[_0xb8deb5(0xf5)][_0xb8deb5(0x9e)][_0xb8deb5(0x108)]>0x0;if(_0x4a12e0){console[_0xb8deb5(0x105)](a4_0x2e9eea[_0xb8deb5(0x9d)]('\x0aProject\x20pushed\x20with\x20errors')),console['log'](),console[_0xb8deb5(0x105)](a4_0x2e9eea['red'](_0xb8deb5(0xa7)));for(const _0xf6411c of _0xbf55f9[_0xb8deb5(0xa1)]){_0xf6411c['action']==='error'&&console[_0xb8deb5(0x105)](a4_0x2e9eea[_0xb8deb5(0x11d)](_0xb8deb5(0xf2)+_0xf6411c[_0xb8deb5(0xb3)]+_0xb8deb5(0x77)+_0xf6411c[_0xb8deb5(0xd9)]));}for(const _0x18e12f of _0xbf55f9['knowledgeBases']){_0x18e12f['action']===_0xb8deb5(0xd9)&&console[_0xb8deb5(0x105)](a4_0x2e9eea['red']('\x20\x20Knowledge\x20Base\x20\x22'+_0x18e12f[_0xb8deb5(0xba)]+_0xb8deb5(0x77)+_0x18e12f[_0xb8deb5(0xd9)]));}for(const _0x5d481d of _0xbf55f9[_0xb8deb5(0xe2)]){_0x5d481d[_0xb8deb5(0x103)]==='error'&&console[_0xb8deb5(0x105)](a4_0x2e9eea['red'](_0xb8deb5(0x11b)+_0x5d481d[_0xb8deb5(0xba)]+_0xb8deb5(0x77)+_0x5d481d[_0xb8deb5(0xd9)]));}for(const _0x292f7b of _0xbf55f9['prompts']){_0x292f7b[_0xb8deb5(0x103)]===_0xb8deb5(0xd9)&&console[_0xb8deb5(0x105)](a4_0x2e9eea[_0xb8deb5(0x11d)]('\x20\x20Prompt\x20\x22'+_0x292f7b[_0xb8deb5(0xba)]+_0xb8deb5(0x77)+_0x292f7b[_0xb8deb5(0xd9)]));}for(const _0x41d621 of _0xbf55f9[_0xb8deb5(0x97)]){_0x41d621['action']===_0xb8deb5(0xd9)&&console[_0xb8deb5(0x105)](a4_0x2e9eea[_0xb8deb5(0x11d)](_0xb8deb5(0xfb)+_0x41d621['name']+_0xb8deb5(0x77)+_0x41d621[_0xb8deb5(0xd9)]));}return 0x1;}console[_0xb8deb5(0x105)](a4_0x2e9eea[_0xb8deb5(0x109)](_0xb8deb5(0x99)+(_0x482646+_0x4625d4)+_0xb8deb5(0xd0)+_0xbf55f9[_0xb8deb5(0xb8)]+'\x27'));const _0x384ab4=getLLMProjectUrl(_0x544fe4,_0xbf55f9['projectId']);return console[_0xb8deb5(0x105)](_0xb8deb5(0xd7)+a4_0x2e9eea[_0xb8deb5(0xad)](_0x384ab4)),0x0;}}
@@ -1 +1 @@
1
- const a5_0x348df7=a5_0x422d;(function(_0x23d3bd,_0x45bdf9){const _0xf6772a=a5_0x422d,_0x2f7d4a=_0x23d3bd();while(!![]){try{const _0x5cc2d3=parseInt(_0xf6772a(0x168))/0x1+-parseInt(_0xf6772a(0x117))/0x2*(-parseInt(_0xf6772a(0x106))/0x3)+parseInt(_0xf6772a(0x103))/0x4+parseInt(_0xf6772a(0x17b))/0x5*(parseInt(_0xf6772a(0x170))/0x6)+-parseInt(_0xf6772a(0x119))/0x7*(parseInt(_0xf6772a(0x133))/0x8)+-parseInt(_0xf6772a(0x167))/0x9*(parseInt(_0xf6772a(0x13e))/0xa)+-parseInt(_0xf6772a(0x146))/0xb*(parseInt(_0xf6772a(0x134))/0xc);if(_0x5cc2d3===_0x45bdf9)break;else _0x2f7d4a['push'](_0x2f7d4a['shift']());}catch(_0xf32e71){_0x2f7d4a['push'](_0x2f7d4a['shift']());}}}(a5_0x829b,0x68952));import*as a5_0x1fa2e3 from'node:fs';import*as a5_0x496d65 from'node:path';import a5_0x312754 from'chalk';import{BaseCommand}from'./command.js';function a5_0x422d(_0x16be6e,_0x2dc89f){_0x16be6e=_0x16be6e-0xea;const _0x829bb9=a5_0x829b();let _0x422d77=_0x829bb9[_0x16be6e];return _0x422d77;}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';function a5_0x829b(){const _0x4823b1=['agent','Re-evaluating\x20cached\x20test\x20run...','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','resolve','find','agentName','execute','stop','red','Executing\x20new\x20tests...','Round\x20','459212tRmhfN','conversation_url','Failed:\x20\x20\x20','16929bXjEMr','Error\x20writing\x20output\x20file:\x20','ERROR','\x20\x20Round\x20','json','Agent:\x20','Running\x20agent\x20tests...','tsv','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','Test\x20Configuration:','white','cyan','site','llm','PASS','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','Site:\x20','262Mtvkqt','no_context','14eJhTSd','\x20(cached)','now','executeReeval','resolveProjectId','length','Tests\x20found:\x20','green','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','FAIL','✗\x20ERROR:\x20','Total:\x20\x20\x20\x20','context','yellow','Evaluating\x20response...','Re-evaluation\x20Summary','no_local_folder','tags','Run\x20\x27tdx\x20agent\x20pull\x20','testYmlPath','\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','✓\x20PASS:\x20','toISOString','includes','/<agent-name>','reason','373064tQVqxs','12iYXKFP','resolveAgentId','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','source','projectDir','Conversation\x20URL:\x20','\x20\x20Project:\x20','message','Usage:','start','1430OiYFFy','\x20\x20Site:\x20','Re-evaluating\x20','Either\x20switch\x20to\x20the\x20\x22','tests','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','\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)','repeat','15985717TOlNuu','basename','Output\x20written\x20to:\x20','text','No\x20tests\x20have\x20tags\x20defined.','dim','filter','split','Using\x20agent:\x20','Running\x20test:\x20','has','Cached\x20run\x20is\x20from\x20site\x20\x22','join','Round\x201/','size','Passed:\x20\x20\x20','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','Errors:\x20\x20\x20','verbose','push','jsonl','Failed\x20Tests:','404','reeval','✗\x20ERROR:\x20Project\x20not\x20found:\x20','projectName','✗\x20FAIL:\x20','log','rounds','Available\x20tests:\x20','\x20-\x20','existsSync','New\x20tests\x20to\x20execute:\x20','6759nCUQlI','447110rfghdp','trim','utf-8','name','status','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','420GIcWmd','table','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','Error:\x20No\x20previous\x20test\x20run\x20found.','agentDirs','...\x20','multiple_agents','toLowerCase',':\x20Sending\x20user\x20input...','some','...','55795BuGWea','Test\x20','\x20(new)','\x27\x20to\x20create\x20the\x20folder\x20structure.','forEach','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','\x22:\x20','\x20\x20-\x20','\x20\x20Evaluating...\x20','llmProject','writeFileSync','Test\x20Summary','Cached\x20run\x20from:\x20','Running:\x20','\x20\x20Conversation:\x20','add','\x20\x20Agent:\x20'];a5_0x829b=function(){return _0x4823b1;};return a5_0x829b();}export class AgentTestCommand extends BaseCommand{[a5_0x348df7(0x16b)]='agent:test';['description']='Run\x20tests\x20for\x20an\x20LLM\x20agent';async[a5_0x348df7(0xfe)](_0x161c02){const _0x4cfe3f=a5_0x348df7,{options:_0x2c20fc,args:_0x227f93,tdx:_0x4f4ecb}=_0x161c02,_0x160634=_0x227f93[0x0]||'.',_0x48f8f4=_0x2c20fc['dryRun'],_0x27523d=_0x2c20fc,_0x3e0617=_0x27523d['eval']===![],_0x3f8618=_0x27523d[_0x4cfe3f(0x15d)],_0x4b0c48=_0x27523d[_0x4cfe3f(0x16b)],_0x5bd9c8=_0x27523d[_0x4cfe3f(0x12a)],_0x451c73=_0x2c20fc['site'],_0x4a8abf=_0x27523d['output'];if(_0x3f8618&&_0x3e0617)return console[_0x4cfe3f(0x161)](a5_0x312754[_0x4cfe3f(0x100)](_0x4cfe3f(0x156))),0x1;let _0x11b36b=_0x4cfe3f(0x171);if(_0x27523d[_0x4cfe3f(0x10a)])_0x11b36b='json';else{if(_0x27523d[_0x4cfe3f(0x15a)])_0x11b36b=_0x4cfe3f(0x15a);else{if(_0x27523d[_0x4cfe3f(0x10d)])_0x11b36b=_0x4cfe3f(0x10d);else{if(_0x27523d[_0x4cfe3f(0x171)])_0x11b36b='table';}}}const _0x34db8f=_0x27523d[_0x4cfe3f(0xf0)];let _0x4a301a=_0x160634;const _0x3a2a1e=a5_0x1fa2e3[_0x4cfe3f(0x165)](_0x160634),_0x5c01b9=_0x160634==='.';if(!_0x3a2a1e||_0x5c01b9){const _0xd004b0=resolveProjectFromContext(_0x160634,_0x34db8f,{'requireFile':'test.yml'});if(_0xd004b0['found'])_0x4a301a=_0xd004b0['projectDir'],_0xd004b0[_0x4cfe3f(0x137)]===_0x4cfe3f(0x125)&&console['log'](a5_0x312754[_0x4cfe3f(0x14b)](_0x4cfe3f(0x14e)+_0x4a301a));else switch(_0xd004b0['reason']){case _0x4cfe3f(0x118):console[_0x4cfe3f(0x161)](a5_0x312754[_0x4cfe3f(0x126)](_0xd004b0['message'])),console[_0x4cfe3f(0x161)](),console[_0x4cfe3f(0x161)](_0x4cfe3f(0x13c)),console[_0x4cfe3f(0x161)](_0x4cfe3f(0x12d)),console[_0x4cfe3f(0x161)](_0x4cfe3f(0x144)),console[_0x4cfe3f(0x161)](),console['log'](_0x4cfe3f(0xec));return 0x1;case _0x4cfe3f(0x129):console[_0x4cfe3f(0x161)](a5_0x312754[_0x4cfe3f(0x126)](_0xd004b0[_0x4cfe3f(0x13b)])),console['log'](),console[_0x4cfe3f(0x161)](_0x4cfe3f(0x12b)+_0xd004b0['llmProject']+_0x4cfe3f(0xea));return 0x1;case _0x4cfe3f(0x176):{const _0x213ef9=a5_0x496d65[_0x4cfe3f(0x147)](_0xd004b0[_0x4cfe3f(0x138)]);console[_0x4cfe3f(0x161)](a5_0x312754[_0x4cfe3f(0x126)](_0x4cfe3f(0x16d)+_0xd004b0['llmProject']+'\x22:'));for(const _0x1d43ff of _0xd004b0[_0x4cfe3f(0x174)]){console[_0x4cfe3f(0x161)](_0x4cfe3f(0xee)+_0x1d43ff);}return console['log'](),console[_0x4cfe3f(0x161)]('Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/'+_0x213ef9+_0x4cfe3f(0x131)),0x1;}case'no_tests':console[_0x4cfe3f(0x161)](a5_0x312754[_0x4cfe3f(0x126)](_0x4cfe3f(0x16e)+_0xd004b0[_0x4cfe3f(0xf0)]+'\x22.')),console[_0x4cfe3f(0x161)](a5_0x312754['dim']('Project\x20path:\x20'+_0xd004b0['projectDir'])),console[_0x4cfe3f(0x161)](),console[_0x4cfe3f(0x161)](_0x4cfe3f(0xfa));return 0x1;}}const {definition:_0xb5e38a,agentInfo:_0x18072c}=parseTestFile(_0x4a301a);let _0x363b6a=_0xb5e38a[_0x4cfe3f(0x142)];if(_0x4b0c48){const _0x5b9561=_0x4b0c48[_0x4cfe3f(0x14d)](',')['map'](_0x2db06b=>_0x2db06b[_0x4cfe3f(0x169)]());_0x363b6a=_0xb5e38a[_0x4cfe3f(0x142)]['filter'](_0x2ed19c=>_0x5b9561['includes'](_0x2ed19c['name']));if(_0x363b6a[_0x4cfe3f(0x11e)]===0x0)return console[_0x4cfe3f(0x161)](a5_0x312754[_0x4cfe3f(0x126)]('No\x20tests\x20found\x20matching:\x20'+_0x4b0c48)),console['log'](a5_0x312754[_0x4cfe3f(0x14b)](_0x4cfe3f(0x163)+_0xb5e38a[_0x4cfe3f(0x142)]['map'](_0x1b15bc=>_0x1b15bc[_0x4cfe3f(0x16b)])[_0x4cfe3f(0x152)](',\x20'))),0x1;}if(_0x5bd9c8){const _0x4af7e2=_0x5bd9c8[_0x4cfe3f(0x14d)](',')['map'](_0x5ce645=>_0x5ce645['trim']()[_0x4cfe3f(0x177)]());_0x363b6a=_0x363b6a[_0x4cfe3f(0x14c)](_0x1819d6=>_0x1819d6['tags']?.[_0x4cfe3f(0x179)](_0x25bede=>_0x4af7e2[_0x4cfe3f(0x130)](_0x25bede[_0x4cfe3f(0x177)]())));if(_0x363b6a[_0x4cfe3f(0x11e)]===0x0){console['log'](a5_0x312754[_0x4cfe3f(0x126)]('No\x20tests\x20found\x20with\x20tags:\x20'+_0x5bd9c8));const _0x1cef2a=new Set();return _0xb5e38a[_0x4cfe3f(0x142)]['forEach'](_0x20933c=>_0x20933c[_0x4cfe3f(0x12a)]?.[_0x4cfe3f(0xeb)](_0x706f04=>_0x1cef2a[_0x4cfe3f(0xf6)](_0x706f04))),_0x1cef2a[_0x4cfe3f(0x154)]>0x0?console['log'](a5_0x312754[_0x4cfe3f(0x14b)]('Available\x20tags:\x20'+[..._0x1cef2a][_0x4cfe3f(0x152)](',\x20'))):console[_0x4cfe3f(0x161)](a5_0x312754[_0x4cfe3f(0x14b)](_0x4cfe3f(0x14a))),0x1;}}if(_0x3f8618)return this[_0x4cfe3f(0x11c)](_0x161c02,{'definition':{'tests':_0x363b6a},'agentInfo':_0x18072c,'outputFormat':_0x11b36b,'outputFile':_0x4a8abf,'testNames':_0x4b0c48});if(_0x48f8f4){console[_0x4cfe3f(0x161)](a5_0x312754[_0x4cfe3f(0x111)](_0x4cfe3f(0x10f))),console[_0x4cfe3f(0x161)](_0x4cfe3f(0x13f)+a5_0x312754[_0x4cfe3f(0x110)](_0x451c73)),console[_0x4cfe3f(0x161)](_0x4cfe3f(0x13a)+a5_0x312754[_0x4cfe3f(0x110)](_0x18072c['projectName'])),console[_0x4cfe3f(0x161)](_0x4cfe3f(0xf7)+a5_0x312754[_0x4cfe3f(0x110)](_0x18072c[_0x4cfe3f(0xfd)])),console[_0x4cfe3f(0x161)](),console['log'](_0x4cfe3f(0x11f)+a5_0x312754['white'](_0x363b6a['length']));for(let _0x289caa=0x0;_0x289caa<_0x363b6a[_0x4cfe3f(0x11e)];_0x289caa++){const _0x53e376=_0x363b6a[_0x289caa],_0xfb927e=_0x53e376['rounds']['length']===0x1?'round':_0x4cfe3f(0x162),_0x239906=_0x53e376[_0x4cfe3f(0x12a)]?.[_0x4cfe3f(0x11e)]?'\x20['+_0x53e376[_0x4cfe3f(0x12a)][_0x4cfe3f(0x152)](',\x20')+']':'';console['log']('\x20\x20'+(_0x289caa+0x1)+'.\x20'+a5_0x312754[_0x4cfe3f(0x110)](_0x53e376['name'])+'\x20('+_0x53e376['rounds'][_0x4cfe3f(0x11e)]+'\x20'+_0xfb927e+')'+a5_0x312754['dim'](_0x239906));}return 0x0;}let _0x5c09ed,_0xeb5bf0;try{_0x5c09ed=await _0x4f4ecb[_0x4cfe3f(0x113)][_0x4cfe3f(0x11d)](_0x18072c['projectName']);}catch(_0x1cfcc4){const _0xb2dd55=_0x1cfcc4 instanceof Error?_0x1cfcc4[_0x4cfe3f(0x13b)]:String(_0x1cfcc4);return _0xb2dd55[_0x4cfe3f(0x130)]('404')||_0xb2dd55[_0x4cfe3f(0x177)]()[_0x4cfe3f(0x130)]('not\x20found')?console[_0x4cfe3f(0x161)](a5_0x312754[_0x4cfe3f(0x100)](_0x4cfe3f(0x15e)+_0x18072c[_0x4cfe3f(0x15f)])):console[_0x4cfe3f(0x161)](a5_0x312754[_0x4cfe3f(0x100)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22'+_0x18072c[_0x4cfe3f(0x15f)]+_0x4cfe3f(0xed)+_0xb2dd55)),0x1;}try{_0xeb5bf0=await _0x4f4ecb[_0x4cfe3f(0x113)][_0x4cfe3f(0x135)](_0x18072c[_0x4cfe3f(0xfd)],_0x5c09ed);}catch(_0x399a24){const _0xde00ff=_0x399a24 instanceof Error?_0x399a24[_0x4cfe3f(0x13b)]:String(_0x399a24);return _0xde00ff[_0x4cfe3f(0x130)](_0x4cfe3f(0x15c))||_0xde00ff[_0x4cfe3f(0x177)]()[_0x4cfe3f(0x130)]('not\x20found')?console['log'](a5_0x312754[_0x4cfe3f(0x100)](_0x4cfe3f(0x10e)+_0x18072c['agentName'])):console[_0x4cfe3f(0x161)](a5_0x312754[_0x4cfe3f(0x100)](_0x4cfe3f(0x16f)+_0x18072c[_0x4cfe3f(0xfd)]+'\x22:\x20'+_0xde00ff)),0x1;}let _0x25f3b2;if(!_0x3e0617)try{_0x25f3b2=await setupEvaluatorAgent(_0x4f4ecb['llm'],_0x2c20fc[_0x4cfe3f(0x158)]);}catch(_0x22efea){const _0x460bab=_0x22efea instanceof Error?_0x22efea['message']:String(_0x22efea);return console[_0x4cfe3f(0x161)](a5_0x312754[_0x4cfe3f(0x100)](_0x4cfe3f(0x115)+_0x460bab)),0x1;}console[_0x4cfe3f(0x161)](a5_0x312754[_0x4cfe3f(0x111)](_0x4cfe3f(0x10c))),console[_0x4cfe3f(0x161)](_0x4cfe3f(0x116)+a5_0x312754[_0x4cfe3f(0x110)](_0x451c73)),console[_0x4cfe3f(0x161)](_0x4cfe3f(0x10b)+a5_0x312754['white'](_0x18072c[_0x4cfe3f(0x15f)]+'/'+_0x18072c[_0x4cfe3f(0xfd)])),console[_0x4cfe3f(0x161)]();const _0x17c0a5=[],_0x2cd05d=[],_0xc6d242=Date[_0x4cfe3f(0x11b)]();for(let _0x317740=0x0;_0x317740<_0x363b6a['length'];_0x317740++){const _0x9c2e7c=_0x363b6a[_0x317740];_0x363b6a[_0x4cfe3f(0x11e)]>0x1?console['log'](_0x4cfe3f(0x17c)+(_0x317740+0x1)+'/'+_0x363b6a[_0x4cfe3f(0x11e)]+':\x20'+a5_0x312754[_0x4cfe3f(0x110)](_0x9c2e7c[_0x4cfe3f(0x16b)])):console[_0x4cfe3f(0x161)](_0x4cfe3f(0x14f)+a5_0x312754['white'](_0x9c2e7c[_0x4cfe3f(0x16b)]));const _0x4b8d3d=createCommandSpinner(_0x4cfe3f(0x153)+_0x9c2e7c[_0x4cfe3f(0x162)][_0x4cfe3f(0x11e)]+_0x4cfe3f(0x178));_0x4b8d3d['start']();try{const {result:_0x57a4f0,conversation:_0x156b7a}=await runTest(_0x4f4ecb['llm'],_0x9c2e7c,{'agentId':_0xeb5bf0,'projectId':_0x5c09ed,'site':_0x451c73,'noEval':_0x3e0617,'evaluatorId':_0x25f3b2,'onRoundStart':(_0x51c624,_0x42db25)=>{const _0x1ffc1a=_0x4cfe3f;_0x4b8d3d[_0x1ffc1a(0x149)]='Round\x20'+(_0x51c624+0x1)+'/'+_0x42db25+_0x1ffc1a(0x178);},'onRoundComplete':(_0x383afd,_0x560e1a,_0x1e52c3)=>{const _0x4908c2=_0x4cfe3f,_0x2f9226=formatElapsed(_0x560e1a);_0x1e52c3?console['log'](_0x4908c2(0x109)+(_0x383afd+0x1)+'/'+_0x9c2e7c[_0x4908c2(0x162)]['length']+'...\x20'+a5_0x312754[_0x4908c2(0x120)]('✓')+'\x20('+_0x2f9226+')'):console[_0x4908c2(0x161)](_0x4908c2(0x109)+(_0x383afd+0x1)+'/'+_0x9c2e7c[_0x4908c2(0x162)][_0x4908c2(0x11e)]+_0x4908c2(0x175)+a5_0x312754['red']('✗'));},'onEvaluationStart':()=>{const _0x4eee76=_0x4cfe3f;_0x4b8d3d[_0x4eee76(0x149)]=_0x4eee76(0x127);},'onEvaluationComplete':_0x5eeba4=>{const _0x40d7f8=_0x4cfe3f,_0xcfbf2=formatElapsed(_0x5eeba4);console[_0x40d7f8(0x161)]('\x20\x20Evaluating...\x20'+a5_0x312754[_0x40d7f8(0x120)]('✓')+'\x20('+_0xcfbf2+')');}});_0x4b8d3d[_0x4cfe3f(0xff)](),_0x17c0a5['push'](_0x57a4f0),_0x2cd05d[_0x4cfe3f(0x159)](_0x156b7a);if(_0x57a4f0[_0x4cfe3f(0x16c)]===_0x4cfe3f(0x114))console[_0x4cfe3f(0x161)](a5_0x312754['green'](_0x4cfe3f(0x12e)+_0x57a4f0[_0x4cfe3f(0x132)]));else _0x57a4f0[_0x4cfe3f(0x16c)]===_0x4cfe3f(0x122)?console[_0x4cfe3f(0x161)](a5_0x312754[_0x4cfe3f(0x100)](_0x4cfe3f(0x160)+_0x57a4f0[_0x4cfe3f(0x132)])):console[_0x4cfe3f(0x161)](a5_0x312754[_0x4cfe3f(0x100)]('✗\x20ERROR:\x20'+_0x57a4f0[_0x4cfe3f(0x132)]));_0x57a4f0[_0x4cfe3f(0x104)]&&console[_0x4cfe3f(0x161)](a5_0x312754[_0x4cfe3f(0x14b)](_0x4cfe3f(0x139)+_0x57a4f0[_0x4cfe3f(0x104)])),console[_0x4cfe3f(0x161)]();}catch(_0x26afc6){_0x4b8d3d[_0x4cfe3f(0xff)]();const _0x24a63f=_0x26afc6 instanceof Error?_0x26afc6[_0x4cfe3f(0x13b)]:String(_0x26afc6);console[_0x4cfe3f(0x161)](a5_0x312754[_0x4cfe3f(0x100)](_0x4cfe3f(0x123)+_0x24a63f)),console[_0x4cfe3f(0x161)](),_0x17c0a5[_0x4cfe3f(0x159)]({'name':_0x9c2e7c[_0x4cfe3f(0x16b)],'status':_0x4cfe3f(0x108),'reason':_0x24a63f,'timestamp':new Date()[_0x4cfe3f(0x12f)](),'duration_ms':0x0});}}const _0x4a000c=Date[_0x4cfe3f(0x11b)]()-_0xc6d242,_0x2245be=_0x17c0a5['filter'](_0x3dedd5=>_0x3dedd5[_0x4cfe3f(0x16c)]===_0x4cfe3f(0x114))[_0x4cfe3f(0x11e)],_0x3a827b=_0x17c0a5['filter'](_0x1ab91a=>_0x1ab91a[_0x4cfe3f(0x16c)]===_0x4cfe3f(0x122))[_0x4cfe3f(0x11e)],_0x5aa4a7=_0x17c0a5['filter'](_0x38f685=>_0x38f685['status']===_0x4cfe3f(0x108))[_0x4cfe3f(0x11e)];console['log']('━'['repeat'](0x3c)),console[_0x4cfe3f(0x161)](_0x4cfe3f(0xf2)),console[_0x4cfe3f(0x161)]('━'[_0x4cfe3f(0x145)](0x3c)),console[_0x4cfe3f(0x161)](_0x4cfe3f(0x124)+_0x17c0a5[_0x4cfe3f(0x11e)]),console['log'](_0x4cfe3f(0x155)+a5_0x312754[_0x4cfe3f(0x120)](_0x2245be)),console[_0x4cfe3f(0x161)](_0x4cfe3f(0x105)+a5_0x312754['red'](_0x3a827b));_0x5aa4a7>0x0&&console['log'](_0x4cfe3f(0x157)+a5_0x312754['red'](_0x5aa4a7));console[_0x4cfe3f(0x161)]('Duration:\x20'+formatElapsed(_0x4a000c)),console[_0x4cfe3f(0x161)]('━'[_0x4cfe3f(0x145)](0x3c));const _0x4f3ce8=_0x17c0a5['filter'](_0x481040=>_0x481040[_0x4cfe3f(0x16c)]!=='PASS');if(_0x4f3ce8[_0x4cfe3f(0x11e)]>0x0){console['log'](),console[_0x4cfe3f(0x161)](_0x4cfe3f(0x15b));for(const _0x118786 of _0x4f3ce8){const _0x2fa525=a5_0x312754['red']('✗'),_0x205567=_0x118786[_0x4cfe3f(0x132)][_0x4cfe3f(0x11e)]>0x32?_0x118786[_0x4cfe3f(0x132)]['substring'](0x0,0x32)+_0x4cfe3f(0x17a):_0x118786[_0x4cfe3f(0x132)];console[_0x4cfe3f(0x161)]('\x20\x20'+_0x2fa525+'\x20'+_0x118786[_0x4cfe3f(0x16b)]+':\x20'+_0x205567);}}const _0x36b878={'summary':{'total':_0x17c0a5['length'],'passed':_0x2245be,'failed':_0x3a827b,'errors':_0x5aa4a7>0x0?_0x5aa4a7:undefined,'duration_ms':_0x4a000c},'tests':_0x17c0a5,'agent':{'project':_0x18072c[_0x4cfe3f(0x15f)],'name':_0x18072c[_0x4cfe3f(0xfd)],'site':_0x451c73},'timestamp':new Date(_0xc6d242)[_0x4cfe3f(0x12f)]()};try{const _0x4105a2=buildCachedTestRun(_0x2cd05d,{'site':_0x451c73,'projectId':_0x5c09ed,'projectName':_0x18072c['projectName'],'agentId':_0xeb5bf0,'agentName':_0x18072c[_0x4cfe3f(0xfd)],'testYmlPath':a5_0x496d65[_0x4cfe3f(0xfb)](_0x18072c[_0x4cfe3f(0x12c)])});saveLastTestRun(_0x4105a2);}catch{}if(_0x11b36b!=='table'||_0x4a8abf){const _0x5a0c8d=formatResults(_0x36b878,_0x11b36b);if(_0x4a8abf)try{a5_0x1fa2e3[_0x4cfe3f(0xf1)](_0x4a8abf,_0x5a0c8d,_0x4cfe3f(0x16a)),console[_0x4cfe3f(0x161)](),console[_0x4cfe3f(0x161)](a5_0x312754[_0x4cfe3f(0x14b)](_0x4cfe3f(0x148)+_0x4a8abf));}catch(_0x215e1e){return console[_0x4cfe3f(0x161)](),console[_0x4cfe3f(0x161)](a5_0x312754['red'](_0x4cfe3f(0x107)+_0x215e1e)),0x1;}else console[_0x4cfe3f(0x161)](),console['log'](_0x5a0c8d);}return _0x4f3ce8['length']>0x0?0x1:0x0;}async['executeReeval'](_0x3c49a7,_0x3ab7f0){const _0x5023e6=a5_0x348df7,{options:_0x40fe57,tdx:_0x313e42}=_0x3c49a7,{definition:_0x40cdda,agentInfo:_0x2e9a88,outputFormat:_0x1c6bba,outputFile:_0x989c7a}=_0x3ab7f0,_0x41299c=_0x40fe57[_0x5023e6(0x112)],_0x509907=loadLastTestRun();if(!_0x509907)return console[_0x5023e6(0x161)](a5_0x312754[_0x5023e6(0x100)](_0x5023e6(0x173))),console[_0x5023e6(0x161)](a5_0x312754[_0x5023e6(0x14b)](_0x5023e6(0x121))),0x1;if(_0x509907[_0x5023e6(0xf8)][_0x5023e6(0xfd)]!==_0x2e9a88[_0x5023e6(0xfd)])return console['log'](a5_0x312754[_0x5023e6(0x100)](_0x5023e6(0x136)+_0x509907[_0x5023e6(0xf8)][_0x5023e6(0xfd)]+_0x5023e6(0x143)+_0x2e9a88['agentName']+'\x22.')),console[_0x5023e6(0x161)](a5_0x312754['dim']('Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.')),0x1;const _0x223523=new Set(_0x509907['conversations']['map'](_0x4c624c=>_0x4c624c['testName'])),_0x4b4da9=_0x40cdda['tests']['filter'](_0x3facc5=>!_0x223523[_0x5023e6(0x150)](_0x3facc5[_0x5023e6(0x16b)]));if(_0x4b4da9['length']>0x0&&_0x509907[_0x5023e6(0x112)]!==_0x41299c)return console[_0x5023e6(0x161)](a5_0x312754[_0x5023e6(0x100)](_0x5023e6(0x172))),console[_0x5023e6(0x161)](a5_0x312754[_0x5023e6(0x14b)](_0x5023e6(0x151)+_0x509907[_0x5023e6(0x112)]+'\x22,\x20but\x20current\x20site\x20is\x20\x22'+_0x41299c+'\x22.')),console[_0x5023e6(0x161)](a5_0x312754[_0x5023e6(0x14b)](_0x5023e6(0x141)+_0x509907[_0x5023e6(0x112)]+'\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.')),0x1;const _0x4c6e56=_0x40cdda[_0x5023e6(0x142)][_0x5023e6(0x14c)](_0x1e634d=>_0x223523[_0x5023e6(0x150)](_0x1e634d[_0x5023e6(0x16b)])),_0x4e9804=_0x4b4da9;let _0x196bd4;try{_0x196bd4=await setupEvaluatorAgent(_0x313e42[_0x5023e6(0x113)],_0x40fe57[_0x5023e6(0x158)]);}catch(_0xe228c3){const _0x2944ca=_0xe228c3 instanceof Error?_0xe228c3[_0x5023e6(0x13b)]:String(_0xe228c3);return console[_0x5023e6(0x161)](a5_0x312754[_0x5023e6(0x100)]('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x2944ca)),0x1;}console[_0x5023e6(0x161)](a5_0x312754['cyan'](_0x5023e6(0xf9))),console[_0x5023e6(0x161)](_0x5023e6(0xf3)+a5_0x312754[_0x5023e6(0x110)](_0x509907['timestamp'])),console['log'](_0x5023e6(0x10b)+a5_0x312754[_0x5023e6(0x110)](_0x509907['agent'][_0x5023e6(0x15f)]+'/'+_0x509907[_0x5023e6(0xf8)][_0x5023e6(0xfd)]));_0x4e9804[_0x5023e6(0x11e)]>0x0&&console[_0x5023e6(0x161)](_0x5023e6(0x166)+a5_0x312754['yellow'](_0x4e9804[_0x5023e6(0x11e)]));console[_0x5023e6(0x161)]();const _0x2a13c0=[],_0x51b17a=Date[_0x5023e6(0x11b)](),_0x1df9a4=createCommandSpinner('Re-evaluating...');if(_0x4c6e56[_0x5023e6(0x11e)]>0x0)try{const _0x52c754=await reevaluateFromCache(_0x313e42[_0x5023e6(0x113)],_0x509907,{'tests':_0x4c6e56},{'evaluatorId':_0x196bd4,'onTestStart':(_0x450e30,_0x4feb88,_0xef6ef2)=>{const _0x18c15c=_0x5023e6;_0x1df9a4[_0x18c15c(0x149)]=_0x18c15c(0x140)+(_0x4feb88+0x1)+'/'+_0xef6ef2+':\x20'+_0x450e30+_0x18c15c(0x17a);if(!_0x1df9a4['isSpinning'])_0x1df9a4[_0x18c15c(0x13d)]();},'onTestComplete':(_0x266293,_0x177f36)=>{const _0x53fedf=_0x5023e6;_0x1df9a4['stop']();if(_0x177f36[_0x53fedf(0x16c)]==='PASS')console[_0x53fedf(0x161)](a5_0x312754['green'](_0x53fedf(0x12e)+_0x266293)+a5_0x312754['dim'](_0x53fedf(0x11a)));else _0x177f36['status']===_0x53fedf(0x122)?console[_0x53fedf(0x161)](a5_0x312754[_0x53fedf(0x100)](_0x53fedf(0x160)+_0x266293+'\x20-\x20'+_0x177f36['reason'])+a5_0x312754[_0x53fedf(0x14b)]('\x20(cached)')):console['log'](a5_0x312754[_0x53fedf(0x100)](_0x53fedf(0x123)+_0x266293+_0x53fedf(0x164)+_0x177f36[_0x53fedf(0x132)]));_0x177f36[_0x53fedf(0x104)]&&console['log'](a5_0x312754[_0x53fedf(0x14b)]('\x20\x20Conversation:\x20'+_0x177f36[_0x53fedf(0x104)])),_0x2a13c0[_0x53fedf(0x159)](_0x177f36);},'onTestSkipped':(_0x14d5cd,_0x580f0d)=>{const _0x10c9c3=_0x5023e6;_0x1df9a4[_0x10c9c3(0xff)](),console[_0x10c9c3(0x161)](a5_0x312754['yellow']('⚠\x20SKIPPED:\x20'+_0x14d5cd+_0x10c9c3(0x164)+_0x580f0d));}});for(const _0x512605 of _0x52c754){!_0x2a13c0[_0x5023e6(0xfc)](_0x5b3fa2=>_0x5b3fa2['name']===_0x512605['name'])&&_0x2a13c0[_0x5023e6(0x159)](_0x512605);}}catch(_0x195137){_0x1df9a4[_0x5023e6(0xff)]();const _0x1ffc18=_0x195137 instanceof Error?_0x195137[_0x5023e6(0x13b)]:String(_0x195137);return console['log'](a5_0x312754['red']('✗\x20ERROR:\x20Re-evaluation\x20failed:\x20'+_0x1ffc18)),0x1;}_0x1df9a4[_0x5023e6(0xff)]();if(_0x4e9804[_0x5023e6(0x11e)]>0x0){console[_0x5023e6(0x161)](),console[_0x5023e6(0x161)](a5_0x312754['cyan'](_0x5023e6(0x101)));const {projectId:_0x260357,agentId:_0x1abb7b}=_0x509907['agent'];for(const _0x58cdec of _0x4e9804){console[_0x5023e6(0x161)](_0x5023e6(0xf4)+a5_0x312754['white'](_0x58cdec['name']));const _0x20cdef=createCommandSpinner(_0x5023e6(0x153)+_0x58cdec[_0x5023e6(0x162)][_0x5023e6(0x11e)]+_0x5023e6(0x178));_0x20cdef['start']();try{const {result:_0x922893}=await runTest(_0x313e42['llm'],_0x58cdec,{'agentId':_0x1abb7b,'projectId':_0x260357,'site':_0x509907[_0x5023e6(0x112)],'noEval':![],'evaluatorId':_0x196bd4,'onRoundStart':(_0x48a27c,_0x3b2840)=>{const _0x12abf6=_0x5023e6;_0x20cdef[_0x12abf6(0x149)]=_0x12abf6(0x102)+(_0x48a27c+0x1)+'/'+_0x3b2840+_0x12abf6(0x178);},'onRoundComplete':(_0xbe312e,_0x4fb5a2,_0x3e8979)=>{const _0x334580=_0x5023e6,_0x4d5982=formatElapsed(_0x4fb5a2);_0x3e8979?console[_0x334580(0x161)](_0x334580(0x109)+(_0xbe312e+0x1)+'/'+_0x58cdec['rounds']['length']+'...\x20'+a5_0x312754[_0x334580(0x120)]('✓')+'\x20('+_0x4d5982+')'):console[_0x334580(0x161)](_0x334580(0x109)+(_0xbe312e+0x1)+'/'+_0x58cdec[_0x334580(0x162)][_0x334580(0x11e)]+_0x334580(0x175)+a5_0x312754['red']('✗'));},'onEvaluationStart':()=>{const _0x2443c4=_0x5023e6;_0x20cdef[_0x2443c4(0x149)]='Evaluating\x20response...';},'onEvaluationComplete':_0x31d042=>{const _0x3cb182=_0x5023e6,_0x67605c=formatElapsed(_0x31d042);console[_0x3cb182(0x161)](_0x3cb182(0xef)+a5_0x312754[_0x3cb182(0x120)]('✓')+'\x20('+_0x67605c+')');}});_0x20cdef['stop'](),_0x2a13c0[_0x5023e6(0x159)](_0x922893);if(_0x922893[_0x5023e6(0x16c)]===_0x5023e6(0x114))console[_0x5023e6(0x161)](a5_0x312754['green']('✓\x20PASS:\x20'+_0x922893[_0x5023e6(0x132)])+a5_0x312754['dim'](_0x5023e6(0x17d)));else _0x922893[_0x5023e6(0x16c)]===_0x5023e6(0x122)?console[_0x5023e6(0x161)](a5_0x312754['red'](_0x5023e6(0x160)+_0x922893[_0x5023e6(0x132)])+a5_0x312754['dim'](_0x5023e6(0x17d))):console['log'](a5_0x312754[_0x5023e6(0x100)](_0x5023e6(0x123)+_0x922893[_0x5023e6(0x132)]));_0x922893[_0x5023e6(0x104)]&&console[_0x5023e6(0x161)](a5_0x312754[_0x5023e6(0x14b)](_0x5023e6(0xf5)+_0x922893[_0x5023e6(0x104)]));}catch(_0x3843e1){_0x20cdef[_0x5023e6(0xff)]();const _0x33cc33=_0x3843e1 instanceof Error?_0x3843e1[_0x5023e6(0x13b)]:String(_0x3843e1);console[_0x5023e6(0x161)](a5_0x312754['red'](_0x5023e6(0x123)+_0x33cc33)),_0x2a13c0[_0x5023e6(0x159)]({'name':_0x58cdec['name'],'status':_0x5023e6(0x108),'reason':_0x33cc33,'timestamp':new Date()[_0x5023e6(0x12f)](),'duration_ms':0x0});}}}console[_0x5023e6(0x161)]();const _0x2b61f5=Date[_0x5023e6(0x11b)]()-_0x51b17a,_0x1e4f02=_0x2a13c0[_0x5023e6(0x14c)](_0x5b1d81=>_0x5b1d81[_0x5023e6(0x16c)]===_0x5023e6(0x114))[_0x5023e6(0x11e)],_0x1f3c1e=_0x2a13c0[_0x5023e6(0x14c)](_0x3c1e6d=>_0x3c1e6d[_0x5023e6(0x16c)]===_0x5023e6(0x122))[_0x5023e6(0x11e)],_0x15650c=_0x2a13c0[_0x5023e6(0x14c)](_0x319faa=>_0x319faa[_0x5023e6(0x16c)]===_0x5023e6(0x108))['length'];console['log']('━'[_0x5023e6(0x145)](0x3c)),console[_0x5023e6(0x161)](_0x5023e6(0x128)),console['log']('━'[_0x5023e6(0x145)](0x3c)),console[_0x5023e6(0x161)](_0x5023e6(0x124)+_0x2a13c0['length']),console[_0x5023e6(0x161)](_0x5023e6(0x155)+a5_0x312754[_0x5023e6(0x120)](_0x1e4f02)),console['log'](_0x5023e6(0x105)+a5_0x312754['red'](_0x1f3c1e));_0x15650c>0x0&&console[_0x5023e6(0x161)](_0x5023e6(0x157)+a5_0x312754[_0x5023e6(0x100)](_0x15650c));console[_0x5023e6(0x161)]('Duration:\x20'+formatElapsed(_0x2b61f5)),console['log']('━'[_0x5023e6(0x145)](0x3c));const _0x4fef93={'summary':{'total':_0x2a13c0[_0x5023e6(0x11e)],'passed':_0x1e4f02,'failed':_0x1f3c1e,'errors':_0x15650c>0x0?_0x15650c:undefined,'duration_ms':_0x2b61f5},'tests':_0x2a13c0,'agent':{'project':_0x2e9a88['projectName'],'name':_0x2e9a88['agentName'],'site':_0x41299c},'timestamp':new Date(_0x51b17a)['toISOString']()};if(_0x1c6bba!==_0x5023e6(0x171)||_0x989c7a){const _0x55d43b=formatResults(_0x4fef93,_0x1c6bba);if(_0x989c7a)try{a5_0x1fa2e3[_0x5023e6(0xf1)](_0x989c7a,_0x55d43b,'utf-8'),console['log'](),console[_0x5023e6(0x161)](a5_0x312754[_0x5023e6(0x14b)](_0x5023e6(0x148)+_0x989c7a));}catch(_0x39c480){return console[_0x5023e6(0x161)](),console['log'](a5_0x312754['red'](_0x5023e6(0x107)+_0x39c480)),0x1;}else console['log'](),console[_0x5023e6(0x161)](_0x55d43b);}const _0x54d3fd=_0x2a13c0[_0x5023e6(0x14c)](_0x5c508f=>_0x5c508f['status']!==_0x5023e6(0x114));return _0x54d3fd['length']>0x0?0x1:0x0;}}
1
+ const a5_0x4514ba=a5_0x3409;(function(_0x167e7a,_0xf7756c){const _0xd824a0=a5_0x3409,_0x1ef276=_0x167e7a();while(!![]){try{const _0x434738=parseInt(_0xd824a0(0x141))/0x1*(-parseInt(_0xd824a0(0x1a2))/0x2)+parseInt(_0xd824a0(0x162))/0x3*(parseInt(_0xd824a0(0x14e))/0x4)+-parseInt(_0xd824a0(0x169))/0x5+-parseInt(_0xd824a0(0x19a))/0x6*(parseInt(_0xd824a0(0x1b7))/0x7)+-parseInt(_0xd824a0(0x1a0))/0x8+parseInt(_0xd824a0(0x1c8))/0x9+parseInt(_0xd824a0(0x190))/0xa*(parseInt(_0xd824a0(0x1c5))/0xb);if(_0x434738===_0xf7756c)break;else _0x1ef276['push'](_0x1ef276['shift']());}catch(_0x4e41d2){_0x1ef276['push'](_0x1ef276['shift']());}}}(a5_0xfcd3,0x62b34));function a5_0xfcd3(){const _0x1aecbf=['Run\x20tests\x20for\x20an\x20LLM\x20agent','white','\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)','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','\x20(cached)','jsonl','resolveProjectId','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','\x20\x20Evaluating...\x20','\x20\x20Agent:\x20','Test\x20Summary','has','resolveAgentId','16217377eFCIdf','log','some','2763729MJnNBb','repeat','Available\x20tests:\x20','test.yml','Running\x20agent\x20tests...','executeReeval','✓\x20PASS:\x20','Error\x20writing\x20output\x20file:\x20','Agent:\x20','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','utf-8','ERROR','round','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','llmProject','No\x20tests\x20have\x20tags\x20defined.','231XIzXUq','find','/<agent-name>','writeFileSync','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','trim','FAIL','Errors:\x20\x20\x20','Either\x20switch\x20to\x20the\x20\x22','tags','agentDirs','Failed\x20Tests:','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','76432pQOuGo','dim','name','stop','Test\x20','conversation_url','reason','Error:\x20No\x20previous\x20test\x20run\x20found.','now','agent:test','message','table','tsv','timestamp','✗\x20FAIL:\x20','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','\x20-\x20','\x22:\x20','tests','Output\x20written\x20to:\x20','111tRNcKs','found','includes','red','verbose','Round\x20','agentName','3961435BkmVLp','Site:\x20','text','push','Evaluating\x20response...','output','no_tests','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','llm','\x20\x20Project:\x20','New\x20tests\x20to\x20execute:\x20','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','start','Round\x201/','dryRun','execute','Total:\x20\x20\x20\x20','join','\x20\x20Site:\x20','toISOString','length','cyan',':\x20Sending\x20user\x20input...','description','Cached\x20run\x20is\x20from\x20site\x20\x22','agent','Duration:\x20','projectName','conversations','\x20\x20Round\x20','\x27\x20to\x20create\x20the\x20folder\x20structure.','testName','status','projectDir','add','resolve','Running\x20test:\x20','✗\x20ERROR:\x20Project\x20not\x20found:\x20','Failed:\x20\x20\x20','10jCUDVH','split','Re-evaluating\x20','Passed:\x20\x20\x20','✗\x20ERROR:\x20','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','not\x20found','map','Tests\x20found:\x20','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','1103634mrjBNq','green','\x20\x20Conversation:\x20','Running:\x20','PASS','context','1239552faUxKz','404','6658FzjgqC','filter','⚠\x20SKIPPED:\x20','yellow','toLowerCase','reeval','site','forEach','substring','rounds','Available\x20tags:\x20','Re-evaluating...','\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','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','Project\x20path:\x20','multiple_agents','Run\x20\x27tdx\x20agent\x20pull\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','basename','eval','...\x20','14rSlTVD'];a5_0xfcd3=function(){return _0x1aecbf;};return a5_0xfcd3();}import*as a5_0xa4fb5d from'node:fs';import*as a5_0x5dfda6 from'node:path';function a5_0x3409(_0x14ed45,_0x143523){_0x14ed45=_0x14ed45-0x137;const _0xfcd3d6=a5_0xfcd3();let _0x340926=_0xfcd3d6[_0x14ed45];return _0x340926;}import a5_0x1d553d from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x4514ba(0x150)]=a5_0x4514ba(0x157);[a5_0x4514ba(0x180)]=a5_0x4514ba(0x1b8);async[a5_0x4514ba(0x178)](_0x26d33d){const _0x417548=a5_0x4514ba,{options:_0x4387d6,args:_0x4e7e39,tdx:_0x43143c}=_0x26d33d,_0x45467d=_0x4e7e39[0x0]||'.',_0x543870=_0x4387d6[_0x417548(0x177)],_0x413956=_0x4387d6,_0x57f4ea=_0x413956[_0x417548(0x1b5)]===![],_0x5867bb=_0x413956[_0x417548(0x1a7)],_0x483fd0=_0x413956[_0x417548(0x150)],_0x4caab9=_0x413956[_0x417548(0x14a)],_0x56167a=_0x4387d6[_0x417548(0x1a8)],_0x5c25e4=_0x413956[_0x417548(0x16e)];if(_0x5867bb&&_0x57f4ea)return console[_0x417548(0x1c6)](a5_0x1d553d['red'](_0x417548(0x195))),0x1;let _0x18455a='table';if(_0x413956['json'])_0x18455a='json';else{if(_0x413956['jsonl'])_0x18455a=_0x417548(0x1bd);else{if(_0x413956[_0x417548(0x15a)])_0x18455a='tsv';else{if(_0x413956['table'])_0x18455a=_0x417548(0x159);}}}const _0x2c9f6b=_0x413956[_0x417548(0x13f)];let _0x3ccbcf=_0x45467d;const _0x3b4313=a5_0xa4fb5d['existsSync'](_0x45467d),_0x307ebe=_0x45467d==='.';if(!_0x3b4313||_0x307ebe){const _0x2f8349=resolveProjectFromContext(_0x45467d,_0x2c9f6b,{'requireFile':_0x417548(0x1cb)});if(_0x2f8349[_0x417548(0x163)])_0x3ccbcf=_0x2f8349[_0x417548(0x18a)],_0x2f8349['source']===_0x417548(0x19f)&&console[_0x417548(0x1c6)](a5_0x1d553d[_0x417548(0x14f)]('Using\x20agent:\x20'+_0x3ccbcf));else switch(_0x2f8349[_0x417548(0x154)]){case'no_context':console['log'](a5_0x1d553d[_0x417548(0x1a5)](_0x2f8349['message'])),console[_0x417548(0x1c6)](),console[_0x417548(0x1c6)]('Usage:'),console['log'](_0x417548(0x1ae)),console['log'](_0x417548(0x1ba)),console[_0x417548(0x1c6)](),console[_0x417548(0x1c6)](_0x417548(0x1bf));return 0x1;case'no_local_folder':console['log'](a5_0x1d553d[_0x417548(0x1a5)](_0x2f8349[_0x417548(0x158)])),console[_0x417548(0x1c6)](),console[_0x417548(0x1c6)](_0x417548(0x1b2)+_0x2f8349[_0x417548(0x13f)]+_0x417548(0x187));return 0x1;case _0x417548(0x1b1):{const _0x388c54=a5_0x5dfda6[_0x417548(0x1b4)](_0x2f8349[_0x417548(0x18a)]);console['log'](a5_0x1d553d['yellow'](_0x417548(0x13a)+_0x2f8349['llmProject']+'\x22:'));for(const _0xc202a7 of _0x2f8349[_0x417548(0x14b)]){console[_0x417548(0x1c6)]('\x20\x20-\x20'+_0xc202a7);}return console[_0x417548(0x1c6)](),console[_0x417548(0x1c6)](_0x417548(0x174)+_0x388c54+_0x417548(0x143)),0x1;}case _0x417548(0x16f):console[_0x417548(0x1c6)](a5_0x1d553d[_0x417548(0x1a5)](_0x417548(0x199)+_0x2f8349['llmProject']+'\x22.')),console[_0x417548(0x1c6)](a5_0x1d553d[_0x417548(0x14f)](_0x417548(0x1b0)+_0x2f8349[_0x417548(0x18a)])),console['log'](),console[_0x417548(0x1c6)](_0x417548(0x15d));return 0x1;}}const {definition:_0x3cbd8b,agentInfo:_0x3720c5}=parseTestFile(_0x3ccbcf);let _0x58bc38=_0x3cbd8b[_0x417548(0x160)];if(_0x483fd0){const _0x252ba4=_0x483fd0[_0x417548(0x191)](',')[_0x417548(0x197)](_0x3ee16c=>_0x3ee16c[_0x417548(0x146)]());_0x58bc38=_0x3cbd8b[_0x417548(0x160)][_0x417548(0x1a3)](_0x441e19=>_0x252ba4[_0x417548(0x164)](_0x441e19[_0x417548(0x150)]));if(_0x58bc38['length']===0x0)return console[_0x417548(0x1c6)](a5_0x1d553d['yellow']('No\x20tests\x20found\x20matching:\x20'+_0x483fd0)),console[_0x417548(0x1c6)](a5_0x1d553d[_0x417548(0x14f)](_0x417548(0x1ca)+_0x3cbd8b[_0x417548(0x160)][_0x417548(0x197)](_0x5e2daf=>_0x5e2daf[_0x417548(0x150)])[_0x417548(0x17a)](',\x20'))),0x1;}if(_0x4caab9){const _0x10b918=_0x4caab9[_0x417548(0x191)](',')['map'](_0x19fe7d=>_0x19fe7d[_0x417548(0x146)]()[_0x417548(0x1a6)]());_0x58bc38=_0x58bc38['filter'](_0x5b00bb=>_0x5b00bb[_0x417548(0x14a)]?.[_0x417548(0x1c7)](_0x5df7a1=>_0x10b918[_0x417548(0x164)](_0x5df7a1[_0x417548(0x1a6)]())));if(_0x58bc38[_0x417548(0x17d)]===0x0){console[_0x417548(0x1c6)](a5_0x1d553d['yellow']('No\x20tests\x20found\x20with\x20tags:\x20'+_0x4caab9));const _0x55197a=new Set();return _0x3cbd8b[_0x417548(0x160)][_0x417548(0x1a9)](_0x1cbd0e=>_0x1cbd0e[_0x417548(0x14a)]?.[_0x417548(0x1a9)](_0x10d695=>_0x55197a[_0x417548(0x18b)](_0x10d695))),_0x55197a['size']>0x0?console['log'](a5_0x1d553d[_0x417548(0x14f)](_0x417548(0x1ac)+[..._0x55197a][_0x417548(0x17a)](',\x20'))):console[_0x417548(0x1c6)](a5_0x1d553d[_0x417548(0x14f)](_0x417548(0x140))),0x1;}}if(_0x5867bb)return this['executeReeval'](_0x26d33d,{'definition':{'tests':_0x58bc38},'agentInfo':_0x3720c5,'outputFormat':_0x18455a,'outputFile':_0x5c25e4,'testNames':_0x483fd0});if(_0x543870){console['log'](a5_0x1d553d[_0x417548(0x17e)]('Test\x20Configuration:')),console[_0x417548(0x1c6)](_0x417548(0x17b)+a5_0x1d553d[_0x417548(0x1b9)](_0x56167a)),console['log'](_0x417548(0x172)+a5_0x1d553d[_0x417548(0x1b9)](_0x3720c5[_0x417548(0x184)])),console[_0x417548(0x1c6)](_0x417548(0x1c1)+a5_0x1d553d['white'](_0x3720c5[_0x417548(0x168)])),console['log'](),console['log'](_0x417548(0x198)+a5_0x1d553d[_0x417548(0x1b9)](_0x58bc38['length']));for(let _0x10a12e=0x0;_0x10a12e<_0x58bc38[_0x417548(0x17d)];_0x10a12e++){const _0x2b990d=_0x58bc38[_0x10a12e],_0x739ee4=_0x2b990d[_0x417548(0x1ab)][_0x417548(0x17d)]===0x1?_0x417548(0x13d):_0x417548(0x1ab),_0xa11a3c=_0x2b990d[_0x417548(0x14a)]?.[_0x417548(0x17d)]?'\x20['+_0x2b990d[_0x417548(0x14a)][_0x417548(0x17a)](',\x20')+']':'';console[_0x417548(0x1c6)]('\x20\x20'+(_0x10a12e+0x1)+'.\x20'+a5_0x1d553d['white'](_0x2b990d['name'])+'\x20('+_0x2b990d[_0x417548(0x1ab)][_0x417548(0x17d)]+'\x20'+_0x739ee4+')'+a5_0x1d553d[_0x417548(0x14f)](_0xa11a3c));}return 0x0;}let _0x5a48ab,_0x4fe523;try{_0x5a48ab=await _0x43143c[_0x417548(0x171)][_0x417548(0x1be)](_0x3720c5[_0x417548(0x184)]);}catch(_0x2811fc){const _0x5f5acf=_0x2811fc instanceof Error?_0x2811fc[_0x417548(0x158)]:String(_0x2811fc);return _0x5f5acf['includes'](_0x417548(0x1a1))||_0x5f5acf[_0x417548(0x1a6)]()['includes'](_0x417548(0x196))?console[_0x417548(0x1c6)](a5_0x1d553d[_0x417548(0x165)](_0x417548(0x18e)+_0x3720c5[_0x417548(0x184)])):console[_0x417548(0x1c6)](a5_0x1d553d[_0x417548(0x165)](_0x417548(0x1b3)+_0x3720c5['projectName']+_0x417548(0x15f)+_0x5f5acf)),0x1;}try{_0x4fe523=await _0x43143c[_0x417548(0x171)][_0x417548(0x1c4)](_0x3720c5[_0x417548(0x168)],_0x5a48ab);}catch(_0x37aee3){const _0x5954f6=_0x37aee3 instanceof Error?_0x37aee3[_0x417548(0x158)]:String(_0x37aee3);return _0x5954f6[_0x417548(0x164)](_0x417548(0x1a1))||_0x5954f6[_0x417548(0x1a6)]()[_0x417548(0x164)]('not\x20found')?console['log'](a5_0x1d553d[_0x417548(0x165)]('✗\x20ERROR:\x20Agent\x20not\x20found:\x20'+_0x3720c5['agentName'])):console[_0x417548(0x1c6)](a5_0x1d553d['red'](_0x417548(0x1bb)+_0x3720c5[_0x417548(0x168)]+'\x22:\x20'+_0x5954f6)),0x1;}let _0x57c19c;if(!_0x57f4ea)try{_0x57c19c=await setupEvaluatorAgent(_0x43143c[_0x417548(0x171)],_0x4387d6['verbose']);}catch(_0x45db3a){const _0x14208a=_0x45db3a instanceof Error?_0x45db3a[_0x417548(0x158)]:String(_0x45db3a);return console[_0x417548(0x1c6)](a5_0x1d553d['red'](_0x417548(0x14d)+_0x14208a)),0x1;}console[_0x417548(0x1c6)](a5_0x1d553d['cyan'](_0x417548(0x1cc))),console[_0x417548(0x1c6)](_0x417548(0x16a)+a5_0x1d553d[_0x417548(0x1b9)](_0x56167a)),console['log'](_0x417548(0x139)+a5_0x1d553d[_0x417548(0x1b9)](_0x3720c5['projectName']+'/'+_0x3720c5['agentName'])),console[_0x417548(0x1c6)]();const _0x3231c7=[],_0x46af1d=[],_0x3cadd4=Date['now']();for(let _0x2d69bd=0x0;_0x2d69bd<_0x58bc38[_0x417548(0x17d)];_0x2d69bd++){const _0x17548c=_0x58bc38[_0x2d69bd];_0x58bc38[_0x417548(0x17d)]>0x1?console['log'](_0x417548(0x152)+(_0x2d69bd+0x1)+'/'+_0x58bc38[_0x417548(0x17d)]+':\x20'+a5_0x1d553d[_0x417548(0x1b9)](_0x17548c['name'])):console['log'](_0x417548(0x18d)+a5_0x1d553d['white'](_0x17548c[_0x417548(0x150)]));const _0x24989b=createCommandSpinner(_0x417548(0x176)+_0x17548c['rounds'][_0x417548(0x17d)]+_0x417548(0x17f));_0x24989b[_0x417548(0x175)]();try{const {result:_0xd7cfc1,conversation:_0xe0c72f}=await runTest(_0x43143c[_0x417548(0x171)],_0x17548c,{'agentId':_0x4fe523,'projectId':_0x5a48ab,'site':_0x56167a,'noEval':_0x57f4ea,'evaluatorId':_0x57c19c,'onRoundStart':(_0x92d72c,_0x12a7db)=>{const _0x2fa90f=_0x417548;_0x24989b[_0x2fa90f(0x16b)]='Round\x20'+(_0x92d72c+0x1)+'/'+_0x12a7db+_0x2fa90f(0x17f);},'onRoundComplete':(_0x5e16f1,_0x14a562,_0x369a63)=>{const _0x1ba593=_0x417548,_0x56e97e=formatElapsed(_0x14a562);_0x369a63?console[_0x1ba593(0x1c6)]('\x20\x20Round\x20'+(_0x5e16f1+0x1)+'/'+_0x17548c[_0x1ba593(0x1ab)][_0x1ba593(0x17d)]+_0x1ba593(0x1b6)+a5_0x1d553d['green']('✓')+'\x20('+_0x56e97e+')'):console['log']('\x20\x20Round\x20'+(_0x5e16f1+0x1)+'/'+_0x17548c[_0x1ba593(0x1ab)][_0x1ba593(0x17d)]+_0x1ba593(0x1b6)+a5_0x1d553d[_0x1ba593(0x165)]('✗'));},'onEvaluationStart':()=>{const _0x35e515=_0x417548;_0x24989b[_0x35e515(0x16b)]=_0x35e515(0x16d);},'onEvaluationComplete':_0x28bcc5=>{const _0x277ea0=_0x417548,_0x2c6ada=formatElapsed(_0x28bcc5);console['log'](_0x277ea0(0x1c0)+a5_0x1d553d['green']('✓')+'\x20('+_0x2c6ada+')');}});_0x24989b[_0x417548(0x151)](),_0x3231c7[_0x417548(0x16c)](_0xd7cfc1),_0x46af1d['push'](_0xe0c72f);if(_0xd7cfc1['status']===_0x417548(0x19e))console['log'](a5_0x1d553d[_0x417548(0x19b)](_0x417548(0x137)+_0xd7cfc1[_0x417548(0x154)]));else _0xd7cfc1[_0x417548(0x189)]===_0x417548(0x147)?console['log'](a5_0x1d553d[_0x417548(0x165)]('✗\x20FAIL:\x20'+_0xd7cfc1['reason'])):console[_0x417548(0x1c6)](a5_0x1d553d[_0x417548(0x165)](_0x417548(0x194)+_0xd7cfc1[_0x417548(0x154)]));_0xd7cfc1['conversation_url']&&console[_0x417548(0x1c6)](a5_0x1d553d[_0x417548(0x14f)]('Conversation\x20URL:\x20'+_0xd7cfc1[_0x417548(0x153)])),console['log']();}catch(_0xfbf53c){_0x24989b['stop']();const _0x3e16d0=_0xfbf53c instanceof Error?_0xfbf53c['message']:String(_0xfbf53c);console['log'](a5_0x1d553d['red'](_0x417548(0x194)+_0x3e16d0)),console[_0x417548(0x1c6)](),_0x3231c7['push']({'name':_0x17548c['name'],'status':_0x417548(0x13c),'reason':_0x3e16d0,'timestamp':new Date()[_0x417548(0x17c)](),'duration_ms':0x0});}}const _0x3f71e7=Date[_0x417548(0x156)]()-_0x3cadd4,_0x3434d6=_0x3231c7[_0x417548(0x1a3)](_0x4b14e4=>_0x4b14e4[_0x417548(0x189)]===_0x417548(0x19e))[_0x417548(0x17d)],_0x125fe5=_0x3231c7['filter'](_0x142af7=>_0x142af7[_0x417548(0x189)]===_0x417548(0x147))[_0x417548(0x17d)],_0x562067=_0x3231c7[_0x417548(0x1a3)](_0x322c87=>_0x322c87[_0x417548(0x189)]===_0x417548(0x13c))[_0x417548(0x17d)];console[_0x417548(0x1c6)]('━'[_0x417548(0x1c9)](0x3c)),console[_0x417548(0x1c6)](_0x417548(0x1c2)),console[_0x417548(0x1c6)]('━'[_0x417548(0x1c9)](0x3c)),console['log']('Total:\x20\x20\x20\x20'+_0x3231c7['length']),console['log'](_0x417548(0x193)+a5_0x1d553d[_0x417548(0x19b)](_0x3434d6)),console['log'](_0x417548(0x18f)+a5_0x1d553d[_0x417548(0x165)](_0x125fe5));_0x562067>0x0&&console[_0x417548(0x1c6)](_0x417548(0x148)+a5_0x1d553d[_0x417548(0x165)](_0x562067));console['log'](_0x417548(0x183)+formatElapsed(_0x3f71e7)),console['log']('━'[_0x417548(0x1c9)](0x3c));const _0x403e26=_0x3231c7['filter'](_0x3f72cd=>_0x3f72cd['status']!==_0x417548(0x19e));if(_0x403e26[_0x417548(0x17d)]>0x0){console['log'](),console[_0x417548(0x1c6)](_0x417548(0x14c));for(const _0x8f6cb9 of _0x403e26){const _0x608665=a5_0x1d553d['red']('✗'),_0x134129=_0x8f6cb9[_0x417548(0x154)][_0x417548(0x17d)]>0x32?_0x8f6cb9[_0x417548(0x154)][_0x417548(0x1aa)](0x0,0x32)+'...':_0x8f6cb9['reason'];console[_0x417548(0x1c6)]('\x20\x20'+_0x608665+'\x20'+_0x8f6cb9[_0x417548(0x150)]+':\x20'+_0x134129);}}const _0x4b213c={'summary':{'total':_0x3231c7[_0x417548(0x17d)],'passed':_0x3434d6,'failed':_0x125fe5,'errors':_0x562067>0x0?_0x562067:undefined,'duration_ms':_0x3f71e7},'tests':_0x3231c7,'agent':{'project':_0x3720c5[_0x417548(0x184)],'name':_0x3720c5[_0x417548(0x168)],'site':_0x56167a},'timestamp':new Date(_0x3cadd4)['toISOString']()};try{const _0x1d1691=buildCachedTestRun(_0x46af1d,{'site':_0x56167a,'projectId':_0x5a48ab,'projectName':_0x3720c5['projectName'],'agentId':_0x4fe523,'agentName':_0x3720c5[_0x417548(0x168)],'testYmlPath':a5_0x5dfda6[_0x417548(0x18c)](_0x3720c5['testYmlPath'])});saveLastTestRun(_0x1d1691);}catch{}if(_0x18455a!==_0x417548(0x159)||_0x5c25e4){const _0x1baaf0=formatResults(_0x4b213c,_0x18455a);if(_0x5c25e4)try{a5_0xa4fb5d[_0x417548(0x144)](_0x5c25e4,_0x1baaf0,_0x417548(0x13b)),console['log'](),console[_0x417548(0x1c6)](a5_0x1d553d[_0x417548(0x14f)](_0x417548(0x161)+_0x5c25e4));}catch(_0x54191e){return console['log'](),console[_0x417548(0x1c6)](a5_0x1d553d[_0x417548(0x165)](_0x417548(0x138)+_0x54191e)),0x1;}else console['log'](),console[_0x417548(0x1c6)](_0x1baaf0);}return _0x403e26['length']>0x0?0x1:0x0;}async[a5_0x4514ba(0x1cd)](_0x57ede6,_0x168e54){const _0x40290a=a5_0x4514ba,{options:_0xf2d922,tdx:_0x7fdb1a}=_0x57ede6,{definition:_0x2b257d,agentInfo:_0x38ef12,outputFormat:_0x39a7a5,outputFile:_0x5135c8}=_0x168e54,_0x4da138=_0xf2d922[_0x40290a(0x1a8)],_0x157cbd=loadLastTestRun();if(!_0x157cbd)return console[_0x40290a(0x1c6)](a5_0x1d553d[_0x40290a(0x165)](_0x40290a(0x155))),console[_0x40290a(0x1c6)](a5_0x1d553d[_0x40290a(0x14f)](_0x40290a(0x13e))),0x1;if(_0x157cbd[_0x40290a(0x182)][_0x40290a(0x168)]!==_0x38ef12[_0x40290a(0x168)])return console[_0x40290a(0x1c6)](a5_0x1d553d[_0x40290a(0x165)]('Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22'+_0x157cbd[_0x40290a(0x182)]['agentName']+_0x40290a(0x170)+_0x38ef12['agentName']+'\x22.')),console[_0x40290a(0x1c6)](a5_0x1d553d['dim']('Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.')),0x1;const _0xa254ae=new Set(_0x157cbd[_0x40290a(0x185)][_0x40290a(0x197)](_0x4dbbeb=>_0x4dbbeb[_0x40290a(0x188)])),_0x55992f=_0x2b257d[_0x40290a(0x160)][_0x40290a(0x1a3)](_0x397b83=>!_0xa254ae[_0x40290a(0x1c3)](_0x397b83[_0x40290a(0x150)]));if(_0x55992f[_0x40290a(0x17d)]>0x0&&_0x157cbd[_0x40290a(0x1a8)]!==_0x4da138)return console[_0x40290a(0x1c6)](a5_0x1d553d[_0x40290a(0x165)](_0x40290a(0x145))),console[_0x40290a(0x1c6)](a5_0x1d553d[_0x40290a(0x14f)](_0x40290a(0x181)+_0x157cbd[_0x40290a(0x1a8)]+'\x22,\x20but\x20current\x20site\x20is\x20\x22'+_0x4da138+'\x22.')),console[_0x40290a(0x1c6)](a5_0x1d553d[_0x40290a(0x14f)](_0x40290a(0x149)+_0x157cbd['site']+'\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.')),0x1;const _0x224f14=_0x2b257d['tests'][_0x40290a(0x1a3)](_0x3d992b=>_0xa254ae['has'](_0x3d992b[_0x40290a(0x150)])),_0x36390b=_0x55992f;let _0x32a2c0;try{_0x32a2c0=await setupEvaluatorAgent(_0x7fdb1a[_0x40290a(0x171)],_0xf2d922[_0x40290a(0x166)]);}catch(_0x57e8fd){const _0xfe436f=_0x57e8fd instanceof Error?_0x57e8fd[_0x40290a(0x158)]:String(_0x57e8fd);return console['log'](a5_0x1d553d['red'](_0x40290a(0x14d)+_0xfe436f)),0x1;}console[_0x40290a(0x1c6)](a5_0x1d553d['cyan']('Re-evaluating\x20cached\x20test\x20run...')),console[_0x40290a(0x1c6)]('Cached\x20run\x20from:\x20'+a5_0x1d553d['white'](_0x157cbd[_0x40290a(0x15b)])),console[_0x40290a(0x1c6)](_0x40290a(0x139)+a5_0x1d553d[_0x40290a(0x1b9)](_0x157cbd[_0x40290a(0x182)][_0x40290a(0x184)]+'/'+_0x157cbd[_0x40290a(0x182)][_0x40290a(0x168)]));_0x36390b[_0x40290a(0x17d)]>0x0&&console[_0x40290a(0x1c6)](_0x40290a(0x173)+a5_0x1d553d[_0x40290a(0x1a5)](_0x36390b[_0x40290a(0x17d)]));console['log']();const _0x3ffa58=[],_0x1669a8=Date['now'](),_0xa1fee1=createCommandSpinner(_0x40290a(0x1ad));if(_0x224f14[_0x40290a(0x17d)]>0x0)try{const _0x2622b3=await reevaluateFromCache(_0x7fdb1a[_0x40290a(0x171)],_0x157cbd,{'tests':_0x224f14},{'evaluatorId':_0x32a2c0,'onTestStart':(_0x2fb45b,_0x502a3a,_0x2e5b99)=>{const _0xf142dc=_0x40290a;_0xa1fee1[_0xf142dc(0x16b)]=_0xf142dc(0x192)+(_0x502a3a+0x1)+'/'+_0x2e5b99+':\x20'+_0x2fb45b+'...';if(!_0xa1fee1['isSpinning'])_0xa1fee1[_0xf142dc(0x175)]();},'onTestComplete':(_0x4a5f56,_0x266f6d)=>{const _0x2c3477=_0x40290a;_0xa1fee1[_0x2c3477(0x151)]();if(_0x266f6d[_0x2c3477(0x189)]===_0x2c3477(0x19e))console[_0x2c3477(0x1c6)](a5_0x1d553d[_0x2c3477(0x19b)](_0x2c3477(0x137)+_0x4a5f56)+a5_0x1d553d[_0x2c3477(0x14f)](_0x2c3477(0x1bc)));else _0x266f6d[_0x2c3477(0x189)]===_0x2c3477(0x147)?console['log'](a5_0x1d553d[_0x2c3477(0x165)](_0x2c3477(0x15c)+_0x4a5f56+_0x2c3477(0x15e)+_0x266f6d[_0x2c3477(0x154)])+a5_0x1d553d[_0x2c3477(0x14f)](_0x2c3477(0x1bc))):console[_0x2c3477(0x1c6)](a5_0x1d553d[_0x2c3477(0x165)](_0x2c3477(0x194)+_0x4a5f56+_0x2c3477(0x15e)+_0x266f6d[_0x2c3477(0x154)]));_0x266f6d[_0x2c3477(0x153)]&&console[_0x2c3477(0x1c6)](a5_0x1d553d[_0x2c3477(0x14f)](_0x2c3477(0x19c)+_0x266f6d['conversation_url'])),_0x3ffa58['push'](_0x266f6d);},'onTestSkipped':(_0x3b62dc,_0x4f7b78)=>{const _0x338cf9=_0x40290a;_0xa1fee1['stop'](),console[_0x338cf9(0x1c6)](a5_0x1d553d[_0x338cf9(0x1a5)](_0x338cf9(0x1a4)+_0x3b62dc+_0x338cf9(0x15e)+_0x4f7b78));}});for(const _0x3f8b8f of _0x2622b3){!_0x3ffa58[_0x40290a(0x142)](_0x4b6ae5=>_0x4b6ae5[_0x40290a(0x150)]===_0x3f8b8f['name'])&&_0x3ffa58[_0x40290a(0x16c)](_0x3f8b8f);}}catch(_0x7032b){_0xa1fee1['stop']();const _0xc20c37=_0x7032b instanceof Error?_0x7032b[_0x40290a(0x158)]:String(_0x7032b);return console['log'](a5_0x1d553d[_0x40290a(0x165)](_0x40290a(0x1af)+_0xc20c37)),0x1;}_0xa1fee1[_0x40290a(0x151)]();if(_0x36390b[_0x40290a(0x17d)]>0x0){console[_0x40290a(0x1c6)](),console[_0x40290a(0x1c6)](a5_0x1d553d['cyan']('Executing\x20new\x20tests...'));const {projectId:_0x24a81b,agentId:_0x2f8c7a}=_0x157cbd[_0x40290a(0x182)];for(const _0x3812c2 of _0x36390b){console[_0x40290a(0x1c6)](_0x40290a(0x19d)+a5_0x1d553d[_0x40290a(0x1b9)](_0x3812c2[_0x40290a(0x150)]));const _0x4168ad=createCommandSpinner('Round\x201/'+_0x3812c2[_0x40290a(0x1ab)][_0x40290a(0x17d)]+':\x20Sending\x20user\x20input...');_0x4168ad[_0x40290a(0x175)]();try{const {result:_0x59506e}=await runTest(_0x7fdb1a[_0x40290a(0x171)],_0x3812c2,{'agentId':_0x2f8c7a,'projectId':_0x24a81b,'site':_0x157cbd[_0x40290a(0x1a8)],'noEval':![],'evaluatorId':_0x32a2c0,'onRoundStart':(_0x2dbfd6,_0x4538bb)=>{const _0x123d03=_0x40290a;_0x4168ad[_0x123d03(0x16b)]=_0x123d03(0x167)+(_0x2dbfd6+0x1)+'/'+_0x4538bb+_0x123d03(0x17f);},'onRoundComplete':(_0x10274a,_0x569dd9,_0x4f61c4)=>{const _0x4f1df8=_0x40290a,_0x598566=formatElapsed(_0x569dd9);_0x4f61c4?console[_0x4f1df8(0x1c6)]('\x20\x20Round\x20'+(_0x10274a+0x1)+'/'+_0x3812c2[_0x4f1df8(0x1ab)][_0x4f1df8(0x17d)]+'...\x20'+a5_0x1d553d[_0x4f1df8(0x19b)]('✓')+'\x20('+_0x598566+')'):console[_0x4f1df8(0x1c6)](_0x4f1df8(0x186)+(_0x10274a+0x1)+'/'+_0x3812c2[_0x4f1df8(0x1ab)][_0x4f1df8(0x17d)]+_0x4f1df8(0x1b6)+a5_0x1d553d[_0x4f1df8(0x165)]('✗'));},'onEvaluationStart':()=>{const _0x593ec8=_0x40290a;_0x4168ad[_0x593ec8(0x16b)]=_0x593ec8(0x16d);},'onEvaluationComplete':_0x3d4172=>{const _0x1b856a=_0x40290a,_0xbc6560=formatElapsed(_0x3d4172);console[_0x1b856a(0x1c6)](_0x1b856a(0x1c0)+a5_0x1d553d[_0x1b856a(0x19b)]('✓')+'\x20('+_0xbc6560+')');}});_0x4168ad['stop'](),_0x3ffa58[_0x40290a(0x16c)](_0x59506e);if(_0x59506e[_0x40290a(0x189)]===_0x40290a(0x19e))console[_0x40290a(0x1c6)](a5_0x1d553d[_0x40290a(0x19b)](_0x40290a(0x137)+_0x59506e['reason'])+a5_0x1d553d['dim']('\x20(new)'));else _0x59506e[_0x40290a(0x189)]===_0x40290a(0x147)?console[_0x40290a(0x1c6)](a5_0x1d553d[_0x40290a(0x165)]('✗\x20FAIL:\x20'+_0x59506e[_0x40290a(0x154)])+a5_0x1d553d[_0x40290a(0x14f)]('\x20(new)')):console[_0x40290a(0x1c6)](a5_0x1d553d[_0x40290a(0x165)](_0x40290a(0x194)+_0x59506e[_0x40290a(0x154)]));_0x59506e[_0x40290a(0x153)]&&console[_0x40290a(0x1c6)](a5_0x1d553d[_0x40290a(0x14f)](_0x40290a(0x19c)+_0x59506e[_0x40290a(0x153)]));}catch(_0x338d83){_0x4168ad[_0x40290a(0x151)]();const _0x40dc60=_0x338d83 instanceof Error?_0x338d83['message']:String(_0x338d83);console[_0x40290a(0x1c6)](a5_0x1d553d[_0x40290a(0x165)]('✗\x20ERROR:\x20'+_0x40dc60)),_0x3ffa58['push']({'name':_0x3812c2[_0x40290a(0x150)],'status':_0x40290a(0x13c),'reason':_0x40dc60,'timestamp':new Date()[_0x40290a(0x17c)](),'duration_ms':0x0});}}}console['log']();const _0x5cc7c0=Date[_0x40290a(0x156)]()-_0x1669a8,_0x17f2bc=_0x3ffa58[_0x40290a(0x1a3)](_0x2f8027=>_0x2f8027[_0x40290a(0x189)]===_0x40290a(0x19e))[_0x40290a(0x17d)],_0x23efb0=_0x3ffa58[_0x40290a(0x1a3)](_0x1375ae=>_0x1375ae[_0x40290a(0x189)]===_0x40290a(0x147))[_0x40290a(0x17d)],_0x219288=_0x3ffa58['filter'](_0x5791fc=>_0x5791fc['status']===_0x40290a(0x13c))[_0x40290a(0x17d)];console[_0x40290a(0x1c6)]('━'['repeat'](0x3c)),console[_0x40290a(0x1c6)]('Re-evaluation\x20Summary'),console[_0x40290a(0x1c6)]('━'[_0x40290a(0x1c9)](0x3c)),console[_0x40290a(0x1c6)](_0x40290a(0x179)+_0x3ffa58[_0x40290a(0x17d)]),console['log']('Passed:\x20\x20\x20'+a5_0x1d553d[_0x40290a(0x19b)](_0x17f2bc)),console[_0x40290a(0x1c6)]('Failed:\x20\x20\x20'+a5_0x1d553d[_0x40290a(0x165)](_0x23efb0));_0x219288>0x0&&console[_0x40290a(0x1c6)](_0x40290a(0x148)+a5_0x1d553d[_0x40290a(0x165)](_0x219288));console['log'](_0x40290a(0x183)+formatElapsed(_0x5cc7c0)),console[_0x40290a(0x1c6)]('━'[_0x40290a(0x1c9)](0x3c));const _0x3583a9={'summary':{'total':_0x3ffa58[_0x40290a(0x17d)],'passed':_0x17f2bc,'failed':_0x23efb0,'errors':_0x219288>0x0?_0x219288:undefined,'duration_ms':_0x5cc7c0},'tests':_0x3ffa58,'agent':{'project':_0x38ef12['projectName'],'name':_0x38ef12[_0x40290a(0x168)],'site':_0x4da138},'timestamp':new Date(_0x1669a8)[_0x40290a(0x17c)]()};if(_0x39a7a5!==_0x40290a(0x159)||_0x5135c8){const _0xabb19e=formatResults(_0x3583a9,_0x39a7a5);if(_0x5135c8)try{a5_0xa4fb5d[_0x40290a(0x144)](_0x5135c8,_0xabb19e,_0x40290a(0x13b)),console[_0x40290a(0x1c6)](),console[_0x40290a(0x1c6)](a5_0x1d553d[_0x40290a(0x14f)](_0x40290a(0x161)+_0x5135c8));}catch(_0x28d409){return console[_0x40290a(0x1c6)](),console[_0x40290a(0x1c6)](a5_0x1d553d[_0x40290a(0x165)](_0x40290a(0x138)+_0x28d409)),0x1;}else console[_0x40290a(0x1c6)](),console['log'](_0xabb19e);}const _0x57c762=_0x3ffa58[_0x40290a(0x1a3)](_0xe9327e=>_0xe9327e['status']!==_0x40290a(0x19e));return _0x57c762[_0x40290a(0x17d)]>0x0?0x1:0x0;}}
@@ -1 +1 @@
1
- const a6_0x59f68b=a6_0x1849;(function(_0x3a635d,_0x8d2347){const _0x828eb7=a6_0x1849,_0x27151b=_0x3a635d();while(!![]){try{const _0x586856=parseInt(_0x828eb7(0x158))/0x1*(-parseInt(_0x828eb7(0x167))/0x2)+parseInt(_0x828eb7(0x163))/0x3+parseInt(_0x828eb7(0x16f))/0x4*(parseInt(_0x828eb7(0x15a))/0x5)+-parseInt(_0x828eb7(0x153))/0x6+parseInt(_0x828eb7(0x178))/0x7*(-parseInt(_0x828eb7(0x149))/0x8)+parseInt(_0x828eb7(0x17c))/0x9*(-parseInt(_0x828eb7(0x139))/0xa)+parseInt(_0x828eb7(0x16a))/0xb;if(_0x586856===_0x8d2347)break;else _0x27151b['push'](_0x27151b['shift']());}catch(_0x479468){_0x27151b['push'](_0x27151b['shift']());}}}(a6_0x240d,0x579c1));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';function a6_0x1849(_0x13f782,_0xee0204){_0x13f782=_0x13f782-0x138;const _0x240d32=a6_0x240d();let _0x184938=_0x240d32[_0x13f782];return _0x184938;}import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a6_0x59f68b(0x159),a6_0x59f68b(0x152),'cookie',a6_0x59f68b(0x161),'set-cookie2','x-xsrf-token',a6_0x59f68b(0x13f),a6_0x59f68b(0x145)]);function isSensitiveHeader(_0xa3686b){const _0x56a2d2=a6_0x59f68b;return SENSITIVE_HEADERS[_0x56a2d2(0x172)](_0xa3686b[_0x56a2d2(0x160)]());}function parseHeader(_0x5b7fda){const _0x2333fb=a6_0x59f68b,_0x60013c=_0x5b7fda[_0x2333fb(0x174)](':');if(_0x60013c===-0x1)throw new Error(_0x2333fb(0x148)+_0x5b7fda+_0x2333fb(0x141)+_0x2333fb(0x14d));const _0x22c2ad=_0x5b7fda['substring'](0x0,_0x60013c)[_0x2333fb(0x165)](),_0x49dcc7=_0x5b7fda[_0x2333fb(0x164)](_0x60013c+0x1)['trim']();if(!_0x22c2ad)throw new Error('Header\x20key\x20cannot\x20be\x20empty:\x20\x22'+_0x5b7fda+'\x22');return[_0x22c2ad,_0x49dcc7];}export class ApiCommand extends BaseCommand{[a6_0x59f68b(0x16d)]=a6_0x59f68b(0x142);[a6_0x59f68b(0x13c)]=a6_0x59f68b(0x169);['validate'](_0x4c8853){const _0x58f5fc=a6_0x59f68b,{args:_0xff4814,options:_0x53a523}=_0x4c8853,_0xce1590=_0x53a523;if(_0xff4814[_0x58f5fc(0x173)]===0x0)return _0x58f5fc(0x14b);const _0x2bb83e=_0xff4814[0x0];if(!_0x2bb83e[_0x58f5fc(0x140)]('/'))return _0x58f5fc(0x13e)+_0x2bb83e;const _0x30e98f=_0xce1590[_0x58f5fc(0x13b)],_0x466261=_0xce1590['file'];if(_0x30e98f&&_0x466261)return _0x58f5fc(0x177);const _0x4d478c=_0xce1590[_0x58f5fc(0x13d)]||_0x58f5fc(0x15f),_0x3a1270=['GET',_0x58f5fc(0x171),_0x58f5fc(0x14e),'DELETE',_0x58f5fc(0x17a)];if(!_0x3a1270[_0x58f5fc(0x154)](_0x4d478c[_0x58f5fc(0x14a)]()))return _0x58f5fc(0x151)+_0x4d478c+'.\x20Valid\x20methods:\x20'+_0x3a1270[_0x58f5fc(0x156)](',\x20');const _0x4f5118=_0xce1590[_0x58f5fc(0x15e)]||'td',_0x202ce0=['td',_0x58f5fc(0x162),_0x58f5fc(0x17b),_0x58f5fc(0x14c),_0x58f5fc(0x155),'llm-proxy'];if(!_0x202ce0[_0x58f5fc(0x154)](_0x4f5118))return _0x58f5fc(0x157)+_0x4f5118+_0x58f5fc(0x179)+_0x202ce0['join'](',\x20');return undefined;}async[a6_0x59f68b(0x170)](_0x5db8eb){const _0x112cd5=a6_0x59f68b,{options:_0x222644,args:_0x22d7a5,tdx:_0x56a97b}=_0x5db8eb,_0x49c5cd=_0x222644,_0x588981=_0x22d7a5[0x0],_0x48f21a=(_0x49c5cd[_0x112cd5(0x13d)]||_0x112cd5(0x15f))[_0x112cd5(0x14a)](),_0x176e80=_0x49c5cd[_0x112cd5(0x13b)],_0x334103=_0x49c5cd[_0x112cd5(0x146)],_0x518204=_0x49c5cd[_0x112cd5(0x168)],_0xbcbfb4=_0x49c5cd['type']||'td';try{const _0x434694={};if(_0x518204){const _0x26c16b=Array[_0x112cd5(0x150)](_0x518204)?_0x518204:[_0x518204];for(const _0x3c4358 of _0x26c16b){const [_0x12d0e1,_0x369257]=parseHeader(_0x3c4358);_0x434694[_0x12d0e1]=_0x369257;}}let _0x379c7b;if(_0x176e80)_0x379c7b=_0x176e80;else{if(_0x334103)try{_0x379c7b=RawAPI[_0x112cd5(0x15c)](_0x334103);}catch(_0x439d5b){return console[_0x112cd5(0x138)](_0x112cd5(0x15d)+(_0x439d5b instanceof Error?_0x439d5b[_0x112cd5(0x176)]:String(_0x439d5b))),0x1;}}const _0x738fda={'method':_0x48f21a,'apiType':_0xbcbfb4,'includeHeaders':_0x222644[_0x112cd5(0x16c)]};_0x379c7b&&(_0x738fda['body']=_0x379c7b);Object[_0x112cd5(0x143)](_0x434694)[_0x112cd5(0x173)]>0x0&&(_0x738fda[_0x112cd5(0x16b)]=_0x434694);if(_0x222644[_0x112cd5(0x16c)]){const _0x2f2c2c=resolveSite(_0x222644['site']),_0x32ac13=getEndpoint(_0x2f2c2c,_0xbcbfb4),_0x2293db=''+_0x32ac13+_0x588981;console[_0x112cd5(0x138)]('>\x20'+_0x48f21a+'\x20'+_0x2293db);const _0x4aa2d6=getAuthHeaders(_0x2f2c2c),_0x4b0c46={..._0x4aa2d6,..._0x434694};for(const [_0x20ac8a,_0x3fc4af]of Object[_0x112cd5(0x15b)](_0x4b0c46)){!isSensitiveHeader(_0x20ac8a)&&console[_0x112cd5(0x138)]('>\x20'+_0x20ac8a+':\x20'+_0x3fc4af);}_0x379c7b&&console[_0x112cd5(0x138)]('>'),console[_0x112cd5(0x138)]('');}const _0x11ca54=await _0x56a97b[_0x112cd5(0x142)]['request'](_0x588981,_0x738fda);if(_0x222644[_0x112cd5(0x16c)]&&_0x11ca54[_0x112cd5(0x16b)]){console[_0x112cd5(0x138)](_0x112cd5(0x13a)+_0x11ca54[_0x112cd5(0x166)]);for(const [_0x39e105,_0x38be5f]of Object[_0x112cd5(0x15b)](_0x11ca54[_0x112cd5(0x16b)])){!isSensitiveHeader(_0x39e105)&&console[_0x112cd5(0x138)]('<\x20'+_0x39e105+':\x20'+_0x38be5f);}console[_0x112cd5(0x138)]('');}const _0x13f4f7=Boolean(_0x222644['output']),_0x4de27c={'color':_0x222644[_0x112cd5(0x14f)],'noColor':_0x222644['noColor']||_0x13f4f7&&!_0x222644[_0x112cd5(0x14f)]},_0x2417b7=colorizeJSON(_0x11ca54[_0x112cd5(0x13b)],_0x4de27c);return _0x222644[_0x112cd5(0x144)]?(writeFileSync(_0x222644[_0x112cd5(0x144)],_0x2417b7),console[_0x112cd5(0x138)](_0x112cd5(0x16e)+_0x222644[_0x112cd5(0x144)])):console['log'](_0x2417b7),0x0;}catch(_0x553138){return _0x553138 instanceof Error?(console[_0x112cd5(0x138)]('Error:\x20'+_0x553138['message']),_0x222644['verbose']&&_0x553138[_0x112cd5(0x147)]&&console[_0x112cd5(0x138)](_0x112cd5(0x175)+_0x553138[_0x112cd5(0x147)])):console[_0x112cd5(0x138)](_0x112cd5(0x15d)+String(_0x553138)),0x1;}}}function a6_0x240d(){const _0x122cbd=['stack','Invalid\x20header\x20format:\x20\x22','8eHgDMX','toUpperCase','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','trino','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','PUT','color','isArray','Invalid\x20HTTP\x20method:\x20','proxy-authorization','843774JvqgEY','includes','llm','join','Invalid\x20API\x20type:\x20','2Cglzvm','authorization','76465dQhcKa','entries','readBodyFromFile','Error:\x20','type','GET','toLowerCase','set-cookie','cdp','1224291tEwtar','substring','trim','status','109488mzDflN','header','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','10957936pMSoaP','headers','verbose','name','Results\x20saved\x20to\x20','4ObbRdi','execute','POST','has','length','indexOf','\x0aStack\x20trace:\x0a','message','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','3953999SDXvaZ','.\x20Valid\x20types:\x20','PATCH','workflow','9flasUj','error','2457430vQqFqD','<\x20HTTP/1.1\x20','data','description','method','Endpoint\x20must\x20start\x20with\x20/:\x20','x-auth-token','startsWith','\x22.\x20','api','keys','output','x-trino-user','file'];a6_0x240d=function(){return _0x122cbd;};return a6_0x240d();}
1
+ const a6_0x5b6fb0=a6_0x4f19;(function(_0x72c7bb,_0x3bb951){const _0x3a7b38=a6_0x4f19,_0x3abba7=_0x72c7bb();while(!![]){try{const _0x17c87c=-parseInt(_0x3a7b38(0x1bf))/0x1*(parseInt(_0x3a7b38(0x1ab))/0x2)+parseInt(_0x3a7b38(0x1bb))/0x3*(-parseInt(_0x3a7b38(0x1df))/0x4)+-parseInt(_0x3a7b38(0x1bc))/0x5+parseInt(_0x3a7b38(0x1af))/0x6*(-parseInt(_0x3a7b38(0x1bd))/0x7)+-parseInt(_0x3a7b38(0x1b8))/0x8*(-parseInt(_0x3a7b38(0x1a8))/0x9)+-parseInt(_0x3a7b38(0x1c3))/0xa+parseInt(_0x3a7b38(0x1cc))/0xb;if(_0x17c87c===_0x3bb951)break;else _0x3abba7['push'](_0x3abba7['shift']());}catch(_0x1c8c29){_0x3abba7['push'](_0x3abba7['shift']());}}}(a6_0x3adc,0x46875));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';function a6_0x4f19(_0x4da496,_0x531497){_0x4da496=_0x4da496-0x19e;const _0x3adc60=a6_0x3adc();let _0x4f19e2=_0x3adc60[_0x4da496];return _0x4f19e2;}import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';function a6_0x3adc(){const _0x495ba8=['PATCH','PUT','request','x-trino-user','color','message','10277410iCnBua','\x22.\x20','GET','length','headers','.\x20Valid\x20methods:\x20','validate','log','Invalid\x20API\x20type:\x20','api','method','isArray','join','name','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','substring','startsWith','workflow','file','1121156GGXIvf','description','x-xsrf-token','proxy-authorization','entries','type','toUpperCase','\x0aStack\x20trace:\x0a','site','keys','DELETE','cookie','1634445ctBsbP','execute','Error:\x20','17764qWvXaH','body','<\x20HTTP/1.1\x20','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','60zEycgw','verbose','trim','indexOf','x-auth-token','noColor','data','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','readBodyFromFile','24fiOFDd','.\x20Valid\x20types:\x20','Results\x20saved\x20to\x20','3mDUsyK','797825JpGRcw','14028myJwtH','includes','61hJJCLI','header','authorization','output','1885440lzkPUW','llm-proxy','error'];a6_0x3adc=function(){return _0x495ba8;};return a6_0x3adc();}import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a6_0x5b6fb0(0x1c1),a6_0x5b6fb0(0x19f),a6_0x5b6fb0(0x1a7),'set-cookie','set-cookie2',a6_0x5b6fb0(0x19e),a6_0x5b6fb0(0x1b3),a6_0x5b6fb0(0x1c9)]);function isSensitiveHeader(_0x4986be){return SENSITIVE_HEADERS['has'](_0x4986be['toLowerCase']());}function parseHeader(_0x58019c){const _0x18f8b1=a6_0x5b6fb0,_0x1ac3e8=_0x58019c[_0x18f8b1(0x1b2)](':');if(_0x1ac3e8===-0x1)throw new Error('Invalid\x20header\x20format:\x20\x22'+_0x58019c+_0x18f8b1(0x1cd)+'Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22');const _0xb60125=_0x58019c[_0x18f8b1(0x1db)](0x0,_0x1ac3e8)[_0x18f8b1(0x1b1)](),_0x510567=_0x58019c[_0x18f8b1(0x1db)](_0x1ac3e8+0x1)[_0x18f8b1(0x1b1)]();if(!_0xb60125)throw new Error(_0x18f8b1(0x1b6)+_0x58019c+'\x22');return[_0xb60125,_0x510567];}export class ApiCommand extends BaseCommand{[a6_0x5b6fb0(0x1d9)]=a6_0x5b6fb0(0x1d5);[a6_0x5b6fb0(0x1e0)]='Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs';[a6_0x5b6fb0(0x1d2)](_0x5e03ea){const _0xb7e878=a6_0x5b6fb0,{args:_0x3c4187,options:_0x1064a8}=_0x5e03ea,_0x5767da=_0x1064a8;if(_0x3c4187[_0xb7e878(0x1cf)]===0x0)return _0xb7e878(0x1da);const _0x49d7a0=_0x3c4187[0x0];if(!_0x49d7a0[_0xb7e878(0x1dc)]('/'))return'Endpoint\x20must\x20start\x20with\x20/:\x20'+_0x49d7a0;const _0xe11793=_0x5767da['data'],_0x30a7c3=_0x5767da[_0xb7e878(0x1de)];if(_0xe11793&&_0x30a7c3)return _0xb7e878(0x1ae);const _0x868d2e=_0x5767da['method']||_0xb7e878(0x1ce),_0x10afdc=[_0xb7e878(0x1ce),'POST',_0xb7e878(0x1c7),_0xb7e878(0x1a6),_0xb7e878(0x1c6)];if(!_0x10afdc[_0xb7e878(0x1be)](_0x868d2e['toUpperCase']()))return'Invalid\x20HTTP\x20method:\x20'+_0x868d2e+_0xb7e878(0x1d1)+_0x10afdc[_0xb7e878(0x1d8)](',\x20');const _0x48dd8c=_0x5767da['type']||'td',_0x2ebce0=['td','cdp',_0xb7e878(0x1dd),'trino','llm',_0xb7e878(0x1c4)];if(!_0x2ebce0[_0xb7e878(0x1be)](_0x48dd8c))return _0xb7e878(0x1d4)+_0x48dd8c+_0xb7e878(0x1b9)+_0x2ebce0[_0xb7e878(0x1d8)](',\x20');return undefined;}async[a6_0x5b6fb0(0x1a9)](_0x124374){const _0x3fd139=a6_0x5b6fb0,{options:_0x11dd9d,args:_0xe7d6d1,tdx:_0x58b81d}=_0x124374,_0x1fe891=_0x11dd9d,_0x3a2271=_0xe7d6d1[0x0],_0x159c9b=(_0x1fe891[_0x3fd139(0x1d6)]||'GET')[_0x3fd139(0x1a2)](),_0x5c0d69=_0x1fe891[_0x3fd139(0x1b5)],_0x428126=_0x1fe891[_0x3fd139(0x1de)],_0x2a3c7b=_0x1fe891[_0x3fd139(0x1c0)],_0x15cdb8=_0x1fe891[_0x3fd139(0x1a1)]||'td';try{const _0x3f52d5={};if(_0x2a3c7b){const _0x1d0591=Array[_0x3fd139(0x1d7)](_0x2a3c7b)?_0x2a3c7b:[_0x2a3c7b];for(const _0x36d87b of _0x1d0591){const [_0x198d40,_0x1d26d3]=parseHeader(_0x36d87b);_0x3f52d5[_0x198d40]=_0x1d26d3;}}let _0xd933cd;if(_0x5c0d69)_0xd933cd=_0x5c0d69;else{if(_0x428126)try{_0xd933cd=RawAPI[_0x3fd139(0x1b7)](_0x428126);}catch(_0x240793){return console[_0x3fd139(0x1c5)](_0x3fd139(0x1aa)+(_0x240793 instanceof Error?_0x240793[_0x3fd139(0x1cb)]:String(_0x240793))),0x1;}}const _0x576ef0={'method':_0x159c9b,'apiType':_0x15cdb8,'includeHeaders':_0x11dd9d[_0x3fd139(0x1b0)]};_0xd933cd&&(_0x576ef0[_0x3fd139(0x1ac)]=_0xd933cd);Object[_0x3fd139(0x1a5)](_0x3f52d5)['length']>0x0&&(_0x576ef0['headers']=_0x3f52d5);if(_0x11dd9d[_0x3fd139(0x1b0)]){const _0x376f23=resolveSite(_0x11dd9d[_0x3fd139(0x1a4)]),_0x250b91=getEndpoint(_0x376f23,_0x15cdb8),_0x1a6c42=''+_0x250b91+_0x3a2271;console[_0x3fd139(0x1c5)]('>\x20'+_0x159c9b+'\x20'+_0x1a6c42);const _0x11fcb8=getAuthHeaders(_0x376f23),_0x9ec28a={..._0x11fcb8,..._0x3f52d5};for(const [_0x335484,_0x2424e5]of Object[_0x3fd139(0x1a0)](_0x9ec28a)){!isSensitiveHeader(_0x335484)&&console[_0x3fd139(0x1c5)]('>\x20'+_0x335484+':\x20'+_0x2424e5);}_0xd933cd&&console[_0x3fd139(0x1c5)]('>'),console['error']('');}const _0x4e809a=await _0x58b81d[_0x3fd139(0x1d5)][_0x3fd139(0x1c8)](_0x3a2271,_0x576ef0);if(_0x11dd9d[_0x3fd139(0x1b0)]&&_0x4e809a[_0x3fd139(0x1d0)]){console[_0x3fd139(0x1c5)](_0x3fd139(0x1ad)+_0x4e809a['status']);for(const [_0x3c9c05,_0x5ed11e]of Object[_0x3fd139(0x1a0)](_0x4e809a[_0x3fd139(0x1d0)])){!isSensitiveHeader(_0x3c9c05)&&console[_0x3fd139(0x1c5)]('<\x20'+_0x3c9c05+':\x20'+_0x5ed11e);}console[_0x3fd139(0x1c5)]('');}const _0x3ab828=Boolean(_0x11dd9d[_0x3fd139(0x1c2)]),_0x3969c1={'color':_0x11dd9d['color'],'noColor':_0x11dd9d[_0x3fd139(0x1b4)]||_0x3ab828&&!_0x11dd9d[_0x3fd139(0x1ca)]},_0x5ac4ee=colorizeJSON(_0x4e809a['data'],_0x3969c1);return _0x11dd9d[_0x3fd139(0x1c2)]?(writeFileSync(_0x11dd9d['output'],_0x5ac4ee),console[_0x3fd139(0x1c5)](_0x3fd139(0x1ba)+_0x11dd9d[_0x3fd139(0x1c2)])):console[_0x3fd139(0x1d3)](_0x5ac4ee),0x0;}catch(_0x3b87de){return _0x3b87de instanceof Error?(console[_0x3fd139(0x1c5)](_0x3fd139(0x1aa)+_0x3b87de[_0x3fd139(0x1cb)]),_0x11dd9d[_0x3fd139(0x1b0)]&&_0x3b87de['stack']&&console['error'](_0x3fd139(0x1a3)+_0x3b87de['stack'])):console['error'](_0x3fd139(0x1aa)+String(_0x3b87de)),0x1;}}}
@@ -1 +1 @@
1
- const a7_0x6925ab=a7_0x489a;(function(_0xbd2cc6,_0x578046){const _0x26ed14=a7_0x489a,_0x2041ff=_0xbd2cc6();while(!![]){try{const _0x33a69b=-parseInt(_0x26ed14(0x183))/0x1*(parseInt(_0x26ed14(0x159))/0x2)+-parseInt(_0x26ed14(0x185))/0x3+parseInt(_0x26ed14(0x167))/0x4+parseInt(_0x26ed14(0x19b))/0x5+parseInt(_0x26ed14(0x15f))/0x6+parseInt(_0x26ed14(0x16d))/0x7*(parseInt(_0x26ed14(0x19c))/0x8)+parseInt(_0x26ed14(0x160))/0x9*(-parseInt(_0x26ed14(0x18b))/0xa);if(_0x33a69b===_0x578046)break;else _0x2041ff['push'](_0x2041ff['shift']());}catch(_0x3bec43){_0x2041ff['push'](_0x2041ff['shift']());}}}(a7_0x5664,0xd48fd));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';function a7_0x5664(){const _0x283acb=['email','description','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','\x0aSetup\x20cancelled','Setup\x20API\x20key\x20authentication\x20interactively','green','Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20','\x20(profile:\x20','1155460hKPTqy','1672ybSVld','Site\x20name\x20cannot\x20be\x20empty','auth:setup','other','auth:clear','message','N/A','logLevel','test','10ETxseJ','red','text','✓\x20Default\x20site\x20set\x20to\x20','✓\x20Profile\x20\x27','Enter\x20site\x20name:','4787934hrGWNS','291996qMUwXo','auth','Remove\x20API\x20key\x20from\x20system\x20keychain','/app/mp/ak','You\x20can\x20find\x20your\x20API\x20key\x20at:','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','yellow','6136900gAXsXe','warn','last_name','profile','No\x20API\x20key\x20found\x20in\x20keychain','status','28889ROlTFS','\x20\x20tdx','\x27\x20registered','trim','join','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','✓\x20Authentication\x20successful\x0a','Read\x20credential\x20from\x20','first_name','filter','User:\x20','log','\x20for\x20profile:\x20','getUserInfo','System\x20keychain\x20is\x20not\x20available','Select\x20your\x20Treasure\x20Data\x20site:','API\x20key\x20cannot\x20be\x20empty','Setting\x20up\x20authentication\x20for\x20site:\x20','Name:\x20','jobs','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','22001mxiZMd','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','5096937ePUNsz','✓\x20API\x20key\x20removed\x20from\x20keychain','create','name','Validating\x20API\x20key...','customSite','230CxxHDf','site','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','ERROR','✗\x20Validation\x20failed:\x20','tdx\x20profile:\x20','execute','error'];a7_0x5664=function(){return _0x283acb;};return a7_0x5664();}import{clearCredentialCache}from'../core/credential-cache.js';function a7_0x489a(_0x53fe6c,_0x382a9a){_0x53fe6c=_0x53fe6c-0x156;const _0x56645d=a7_0x5664();let _0x489a22=_0x56645d[_0x53fe6c];return _0x489a22;}import{buildSiteChoices}from'../core/constants.js';import a7_0x142149 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_0xcdccf4 from'chalk';export class AuthSetupCommand extends BaseCommand{[a7_0x6925ab(0x188)]=a7_0x6925ab(0x19e);[a7_0x6925ab(0x194)]=a7_0x6925ab(0x197);async[a7_0x6925ab(0x191)](_0x1e8311){const _0x4a16cb=a7_0x6925ab,{options:_0x139157}=_0x1e8311,_0x576f7=_0x139157['profile'];console[_0x4a16cb(0x178)](a7_0xcdccf4['bold']('tdx:\x20auth\x20setup'));const _0x26712c=_0x139157['site']||'us01',{choices:_0xe3a0b5,initialIndex:_0x3be95b}=buildSiteChoices(_0x26712c),_0x37e252=_0x576f7?_0x4a16cb(0x199)+_0x576f7+'):':_0x4a16cb(0x17c),_0xa27a46=await a7_0x142149({'type':'select','name':_0x4a16cb(0x18c),'message':_0x37e252,'choices':_0xe3a0b5,'initial':_0x3be95b});if(!_0xa27a46['site'])return console[_0x4a16cb(0x178)](_0x4a16cb(0x196)),0x1;let _0x3f5187;if(_0xa27a46[_0x4a16cb(0x18c)]===_0x4a16cb(0x19f)){const _0x44c054=await a7_0x142149({'type':_0x4a16cb(0x15b),'name':_0x4a16cb(0x18a),'message':_0x4a16cb(0x15e),'initial':'us01','validate':_0x26b6da=>{const _0x223f90=_0x4a16cb;if(!_0x26b6da||!_0x26b6da[_0x223f90(0x170)]())return _0x223f90(0x19d);if(!/^[a-z0-9-]+$/[_0x223f90(0x158)](_0x26b6da[_0x223f90(0x170)]()))return _0x223f90(0x181);return!![];}});if(!_0x44c054[_0x4a16cb(0x18a)])return console[_0x4a16cb(0x178)](_0x4a16cb(0x196)),0x1;_0x3f5187=_0x44c054[_0x4a16cb(0x18a)];}else _0x3f5187=_0xa27a46[_0x4a16cb(0x18c)];const _0x935060=resolveSite(_0x3f5187);console[_0x4a16cb(0x178)](_0x4a16cb(0x17e)+_0x935060),console['log'](_0x4a16cb(0x164)),console[_0x4a16cb(0x178)]('\x20\x20'+getConsoleUrl(_0x935060,_0x4a16cb(0x163)));const _0x9022b7=await a7_0x142149({'type':'password','name':'apiKey','message':'Enter\x20your\x20TD\x20API\x20key:','validate':_0x2ead2a=>{const _0x16a71f=_0x4a16cb;if(!_0x2ead2a||!_0x2ead2a[_0x16a71f(0x170)]())return _0x16a71f(0x17d);return!![];}});if(!_0x9022b7['apiKey'])return console[_0x4a16cb(0x178)]('\x0aSetup\x20cancelled'),0x1;const _0x3aac55=_0x9022b7['apiKey'];console[_0x4a16cb(0x178)](_0x4a16cb(0x189));try{const _0x115275=TDX[_0x4a16cb(0x187)]({'site':_0x935060,'apiKey':_0x3aac55[_0x4a16cb(0x170)](),'logLevel':_0x139157[_0x4a16cb(0x157)]??LogLevel[_0x4a16cb(0x18e)]}),_0x1c22d9=await _0x115275[_0x4a16cb(0x180)][_0x4a16cb(0x17a)]();console[_0x4a16cb(0x178)]('✓\x20API\x20key\x20is\x20valid\x20(User:\x20'+_0x1c22d9[_0x4a16cb(0x193)]+')');const _0x3b85ae=await isKeychainAvailable();_0x3b85ae?(await saveAPIKeyAsync(_0x3aac55[_0x4a16cb(0x170)](),_0x935060,_0x576f7),console[_0x4a16cb(0x178)](_0x4a16cb(0x182)+(_0x576f7?_0x4a16cb(0x19a)+_0x576f7+')':''))):(console[_0x4a16cb(0x168)](a7_0xcdccf4[_0x4a16cb(0x166)](_0x4a16cb(0x184))),console[_0x4a16cb(0x168)](a7_0xcdccf4[_0x4a16cb(0x166)](_0x4a16cb(0x172))));if(_0x576f7){const _0x5569b8={'site':_0x935060};saveProfileToUserConfig(_0x576f7,_0x5569b8),console[_0x4a16cb(0x178)](_0x4a16cb(0x15d)+_0x576f7+_0x4a16cb(0x16f));}else saveDefaultSiteToUserConfig(_0x935060),console['log'](_0x4a16cb(0x15c)+_0x935060);const _0x4c1a83=_0x576f7?'\x20--profile\x20'+_0x576f7:'';return console[_0x4a16cb(0x178)](),console[_0x4a16cb(0x178)](_0x4a16cb(0x18d)),console[_0x4a16cb(0x178)](_0x4a16cb(0x16e)+_0x4c1a83+_0x4a16cb(0x195)),console[_0x4a16cb(0x178)](_0x4a16cb(0x16e)+_0x4c1a83+_0x4a16cb(0x165)),0x0;}catch(_0x2da1ad){if(_0x2da1ad instanceof HTTPClientError&&_0x2da1ad['status']===0x191)return printAuthError(_0x2da1ad),0x1;return console[_0x4a16cb(0x192)](a7_0xcdccf4[_0x4a16cb(0x15a)](_0x4a16cb(0x18f)+(_0x2da1ad instanceof Error?_0x2da1ad[_0x4a16cb(0x1a1)]:String(_0x2da1ad)))),console['error']('API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.'),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x6925ab(0x188)]=a7_0x6925ab(0x161);[a7_0x6925ab(0x194)]='Show\x20authentication\x20status\x20and\x20validate\x20API\x20key';async['execute'](_0x2caa75){const _0x34e267=a7_0x6925ab,{options:_0x537aaa,tdx:_0x1991d6}=_0x2caa75,_0x48f9f7=_0x537aaa[_0x34e267(0x18c)],_0x4e05b7=_0x537aaa[_0x34e267(0x16a)],_0x3cc458=_0x4e05b7?_0x4e05b7:_0x34e267(0x156);console[_0x34e267(0x178)](_0x34e267(0x190)+_0x3cc458+'\x20(site:\x20'+_0x48f9f7+')');const _0x4992a6=await resolveAPIKeyAsync(_0x48f9f7,_0x4e05b7);if(_0x4992a6){const {source:_0x1ffafb,isDeprecated:_0x531511}=_0x4992a6,_0x6d4adf=_0x34e267(0x174)+_0x1ffafb;console[_0x34e267(0x178)](_0x531511?a7_0xcdccf4[_0x34e267(0x166)](_0x6d4adf):_0x6d4adf);}else console[_0x34e267(0x178)](a7_0xcdccf4['yellow']('No\x20credential\x20found'));try{const _0x49593d=await _0x1991d6[_0x34e267(0x180)][_0x34e267(0x17a)]();return console[_0x34e267(0x178)](a7_0xcdccf4[_0x34e267(0x198)](_0x34e267(0x173))),console[_0x34e267(0x178)](_0x34e267(0x177)+_0x49593d[_0x34e267(0x193)]),(_0x49593d[_0x34e267(0x175)]||_0x49593d[_0x34e267(0x169)])&&console[_0x34e267(0x178)](_0x34e267(0x17f)+[_0x49593d[_0x34e267(0x175)],_0x49593d[_0x34e267(0x169)]][_0x34e267(0x176)](Boolean)[_0x34e267(0x171)]('\x20')),0x0;}catch(_0x5d1d70){return _0x5d1d70 instanceof HTTPClientError&&_0x5d1d70[_0x34e267(0x16c)]===0x191?printAuthError(_0x5d1d70,!![],_0x4e05b7):console[_0x34e267(0x192)](a7_0xcdccf4[_0x34e267(0x15a)](_0x34e267(0x18f)+(_0x5d1d70 instanceof Error?_0x5d1d70[_0x34e267(0x1a1)]:String(_0x5d1d70)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x6925ab(0x188)]=a7_0x6925ab(0x1a0);[a7_0x6925ab(0x194)]=a7_0x6925ab(0x162);async[a7_0x6925ab(0x191)](_0x129360){const _0x541ffe=a7_0x6925ab,{options:_0x59f9bf}=_0x129360,_0x2aea80=_0x59f9bf['profile'];console[_0x541ffe(0x178)](a7_0xcdccf4['bold']('tdx:\x20auth\x20clear'));const _0x1c048b=await isKeychainAvailable();if(!_0x1c048b)return console[_0x541ffe(0x192)](a7_0xcdccf4[_0x541ffe(0x15a)](_0x541ffe(0x17b))),0x1;const _0x4187ec=await deleteKeychainAPIKey(_0x2aea80);return _0x4187ec?(clearCredentialCache(),console[_0x541ffe(0x178)](_0x541ffe(0x186)+(_0x2aea80?_0x541ffe(0x19a)+_0x2aea80+')':'')),0x0):(console['log'](_0x541ffe(0x16b)+(_0x2aea80?_0x541ffe(0x179)+_0x2aea80:'')),0x1);}}
1
+ const a7_0x5e6974=a7_0x6009;(function(_0x53535d,_0x4989e5){const _0x38ac7b=a7_0x6009,_0x57b328=_0x53535d();while(!![]){try{const _0x5bb190=parseInt(_0x38ac7b(0x134))/0x1*(parseInt(_0x38ac7b(0x155))/0x2)+-parseInt(_0x38ac7b(0x14d))/0x3+parseInt(_0x38ac7b(0x15f))/0x4*(parseInt(_0x38ac7b(0x140))/0x5)+parseInt(_0x38ac7b(0x172))/0x6+parseInt(_0x38ac7b(0x146))/0x7+-parseInt(_0x38ac7b(0x13f))/0x8*(parseInt(_0x38ac7b(0x165))/0x9)+-parseInt(_0x38ac7b(0x15b))/0xa*(parseInt(_0x38ac7b(0x16d))/0xb);if(_0x5bb190===_0x4989e5)break;else _0x57b328['push'](_0x57b328['shift']());}catch(_0x579e78){_0x57b328['push'](_0x57b328['shift']());}}}(a7_0x1d6f,0x60ac0));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';function a7_0x1d6f(){const _0x2200de=['\x20--profile\x20','password','198FlcmOh','Name:\x20','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','profile','Site\x20name\x20cannot\x20be\x20empty','701958ROintb','name','Read\x20credential\x20from\x20','warn','/app/mp/ak','error','message','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','\x20\x20tdx','customSite','description','Setup\x20API\x20key\x20authentication\x20interactively','email','\x20(profile:\x20','You\x20can\x20find\x20your\x20API\x20key\x20at:','tdx:\x20auth\x20setup','create','API\x20key\x20cannot\x20be\x20empty','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','site','277SrUnZc','\x20for\x20profile:\x20','\x0aSetup\x20cancelled','tdx\x20profile:\x20','green','No\x20credential\x20found','\x27\x20registered','N/A','apiKey','red','last_name','9592GHMOeh','30435RutktQ','other','Enter\x20your\x20TD\x20API\x20key:','trim','auth:clear','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','4145190xaacYc','status','Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20','log','User:\x20','✓\x20Default\x20site\x20set\x20to\x20','first_name','1487514PVgRNi','tdx:\x20auth\x20clear','bold','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','✗\x20Validation\x20failed:\x20','Select\x20your\x20Treasure\x20Data\x20site:','No\x20API\x20key\x20found\x20in\x20keychain','yellow','1832alFSph','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','getUserInfo','auth','✓\x20Authentication\x20successful\x0a','Enter\x20site\x20name:','198320YlKOls','test','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','492iPklSK','✓\x20Profile\x20\x27','Setting\x20up\x20authentication\x20for\x20site:\x20','join','execute','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','3474QXoYGU','text','logLevel','\x20(site:\x20','select','us01'];a7_0x1d6f=function(){return _0x2200de;};return a7_0x1d6f();}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_0x36091f 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_0xf81f00 from'chalk';function a7_0x6009(_0x4b8089,_0x15b02b){_0x4b8089=_0x4b8089-0x125;const _0x1d6f73=a7_0x1d6f();let _0x600986=_0x1d6f73[_0x4b8089];return _0x600986;}export class AuthSetupCommand extends BaseCommand{[a7_0x5e6974(0x173)]='auth:setup';[a7_0x5e6974(0x12a)]=a7_0x5e6974(0x12b);async[a7_0x5e6974(0x163)](_0xc89252){const _0x1dbd6f=a7_0x5e6974,{options:_0x303fbe}=_0xc89252,_0x5a5d37=_0x303fbe['profile'];console[_0x1dbd6f(0x149)](a7_0xf81f00[_0x1dbd6f(0x14f)](_0x1dbd6f(0x12f)));const _0x5a514a=_0x303fbe[_0x1dbd6f(0x133)]||_0x1dbd6f(0x16a),{choices:_0x370de7,initialIndex:_0x5af016}=buildSiteChoices(_0x5a514a),_0x1bcb99=_0x5a5d37?_0x1dbd6f(0x148)+_0x5a5d37+'):':_0x1dbd6f(0x152),_0xb559e6=await a7_0x36091f({'type':_0x1dbd6f(0x169),'name':_0x1dbd6f(0x133),'message':_0x1bcb99,'choices':_0x370de7,'initial':_0x5af016});if(!_0xb559e6[_0x1dbd6f(0x133)])return console[_0x1dbd6f(0x149)](_0x1dbd6f(0x136)),0x1;let _0x140006;if(_0xb559e6[_0x1dbd6f(0x133)]===_0x1dbd6f(0x141)){const _0x17c6c3=await a7_0x36091f({'type':_0x1dbd6f(0x166),'name':'customSite','message':_0x1dbd6f(0x15a),'initial':_0x1dbd6f(0x16a),'validate':_0x1d9fe2=>{const _0x444114=_0x1dbd6f;if(!_0x1d9fe2||!_0x1d9fe2[_0x444114(0x143)]())return _0x444114(0x171);if(!/^[a-z0-9-]+$/[_0x444114(0x15c)](_0x1d9fe2['trim']()))return'Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens';return!![];}});if(!_0x17c6c3[_0x1dbd6f(0x129)])return console['log']('\x0aSetup\x20cancelled'),0x1;_0x140006=_0x17c6c3[_0x1dbd6f(0x129)];}else _0x140006=_0xb559e6[_0x1dbd6f(0x133)];const _0x2153dd=resolveSite(_0x140006);console[_0x1dbd6f(0x149)](_0x1dbd6f(0x161)+_0x2153dd),console[_0x1dbd6f(0x149)](_0x1dbd6f(0x12e)),console[_0x1dbd6f(0x149)]('\x20\x20'+getConsoleUrl(_0x2153dd,_0x1dbd6f(0x176)));const _0x36953a=await a7_0x36091f({'type':_0x1dbd6f(0x16c),'name':'apiKey','message':_0x1dbd6f(0x142),'validate':_0x7e41e3=>{const _0x346d4c=_0x1dbd6f;if(!_0x7e41e3||!_0x7e41e3[_0x346d4c(0x143)]())return _0x346d4c(0x131);return!![];}});if(!_0x36953a[_0x1dbd6f(0x13c)])return console['log'](_0x1dbd6f(0x136)),0x1;const _0x255799=_0x36953a[_0x1dbd6f(0x13c)];console[_0x1dbd6f(0x149)]('Validating\x20API\x20key...');try{const _0x44235d=TDX[_0x1dbd6f(0x130)]({'site':_0x2153dd,'apiKey':_0x255799[_0x1dbd6f(0x143)](),'logLevel':_0x303fbe[_0x1dbd6f(0x167)]??LogLevel['ERROR']}),_0x5dba9a=await _0x44235d['jobs'][_0x1dbd6f(0x157)]();console[_0x1dbd6f(0x149)](_0x1dbd6f(0x15e)+_0x5dba9a[_0x1dbd6f(0x12c)]+')');const _0x252a7f=await isKeychainAvailable();_0x252a7f?(await saveAPIKeyAsync(_0x255799[_0x1dbd6f(0x143)](),_0x2153dd,_0x5a5d37),console[_0x1dbd6f(0x149)](_0x1dbd6f(0x164)+(_0x5a5d37?_0x1dbd6f(0x12d)+_0x5a5d37+')':''))):(console[_0x1dbd6f(0x175)](a7_0xf81f00[_0x1dbd6f(0x154)](_0x1dbd6f(0x15d))),console[_0x1dbd6f(0x175)](a7_0xf81f00['yellow'](_0x1dbd6f(0x156))));if(_0x5a5d37){const _0x4f7e6e={'site':_0x2153dd};saveProfileToUserConfig(_0x5a5d37,_0x4f7e6e),console['log'](_0x1dbd6f(0x160)+_0x5a5d37+_0x1dbd6f(0x13a));}else saveDefaultSiteToUserConfig(_0x2153dd),console[_0x1dbd6f(0x149)](_0x1dbd6f(0x14b)+_0x2153dd);const _0x371377=_0x5a5d37?_0x1dbd6f(0x16b)+_0x5a5d37:'';return console[_0x1dbd6f(0x149)](),console[_0x1dbd6f(0x149)](_0x1dbd6f(0x16f)),console[_0x1dbd6f(0x149)](_0x1dbd6f(0x128)+_0x371377+_0x1dbd6f(0x127)),console[_0x1dbd6f(0x149)]('\x20\x20tdx'+_0x371377+_0x1dbd6f(0x132)),0x0;}catch(_0x22ff21){if(_0x22ff21 instanceof HTTPClientError&&_0x22ff21[_0x1dbd6f(0x147)]===0x191)return printAuthError(_0x22ff21),0x1;return console[_0x1dbd6f(0x125)](a7_0xf81f00[_0x1dbd6f(0x13d)](_0x1dbd6f(0x151)+(_0x22ff21 instanceof Error?_0x22ff21[_0x1dbd6f(0x126)]:String(_0x22ff21)))),console[_0x1dbd6f(0x125)](_0x1dbd6f(0x150)),0x1;}}}export class AuthStatusCommand extends BaseCommand{['name']=a7_0x5e6974(0x158);[a7_0x5e6974(0x12a)]=a7_0x5e6974(0x145);async['execute'](_0x103f83){const _0x507da6=a7_0x5e6974,{options:_0x328593,tdx:_0x417718}=_0x103f83,_0x4d4af8=_0x328593[_0x507da6(0x133)],_0x46a537=_0x328593[_0x507da6(0x170)],_0x3d84d4=_0x46a537?_0x46a537:_0x507da6(0x13b);console['log'](_0x507da6(0x137)+_0x3d84d4+_0x507da6(0x168)+_0x4d4af8+')');const _0x38b0df=await resolveAPIKeyAsync(_0x4d4af8,_0x46a537);if(_0x38b0df){const {source:_0xbb8f45,isDeprecated:_0x1e589}=_0x38b0df,_0xe5e171=_0x507da6(0x174)+_0xbb8f45;console[_0x507da6(0x149)](_0x1e589?a7_0xf81f00[_0x507da6(0x154)](_0xe5e171):_0xe5e171);}else console[_0x507da6(0x149)](a7_0xf81f00[_0x507da6(0x154)](_0x507da6(0x139)));try{const _0xbf9d76=await _0x417718['jobs']['getUserInfo']();return console[_0x507da6(0x149)](a7_0xf81f00[_0x507da6(0x138)](_0x507da6(0x159))),console[_0x507da6(0x149)](_0x507da6(0x14a)+_0xbf9d76['email']),(_0xbf9d76[_0x507da6(0x14c)]||_0xbf9d76[_0x507da6(0x13e)])&&console['log'](_0x507da6(0x16e)+[_0xbf9d76[_0x507da6(0x14c)],_0xbf9d76['last_name']]['filter'](Boolean)[_0x507da6(0x162)]('\x20')),0x0;}catch(_0x5fca6e){return _0x5fca6e instanceof HTTPClientError&&_0x5fca6e[_0x507da6(0x147)]===0x191?printAuthError(_0x5fca6e,!![],_0x46a537):console[_0x507da6(0x125)](a7_0xf81f00['red'](_0x507da6(0x151)+(_0x5fca6e instanceof Error?_0x5fca6e[_0x507da6(0x126)]:String(_0x5fca6e)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x5e6974(0x173)]=a7_0x5e6974(0x144);['description']='Remove\x20API\x20key\x20from\x20system\x20keychain';async['execute'](_0x1213a4){const _0x39a932=a7_0x5e6974,{options:_0x14159b}=_0x1213a4,_0x4f8908=_0x14159b[_0x39a932(0x170)];console['log'](a7_0xf81f00[_0x39a932(0x14f)](_0x39a932(0x14e)));const _0x3ebfbe=await isKeychainAvailable();if(!_0x3ebfbe)return console[_0x39a932(0x125)](a7_0xf81f00[_0x39a932(0x13d)]('System\x20keychain\x20is\x20not\x20available')),0x1;const _0x5ebcc7=await deleteKeychainAPIKey(_0x4f8908);return _0x5ebcc7?(clearCredentialCache(),console[_0x39a932(0x149)]('✓\x20API\x20key\x20removed\x20from\x20keychain'+(_0x4f8908?_0x39a932(0x12d)+_0x4f8908+')':'')),0x0):(console['log'](_0x39a932(0x153)+(_0x4f8908?_0x39a932(0x135)+_0x4f8908:'')),0x1);}}
@@ -1 +1 @@
1
- const a8_0x5a85ea=a8_0x3abd;(function(_0x3872b5,_0x28d547){const _0x2c07ce=a8_0x3abd,_0x22e275=_0x3872b5();while(!![]){try{const _0x5bb4d9=parseInt(_0x2c07ce(0x1cb))/0x1*(-parseInt(_0x2c07ce(0x1bf))/0x2)+-parseInt(_0x2c07ce(0x1b1))/0x3+parseInt(_0x2c07ce(0x1ad))/0x4+parseInt(_0x2c07ce(0x1cf))/0x5*(-parseInt(_0x2c07ce(0x1c7))/0x6)+-parseInt(_0x2c07ce(0x1c9))/0x7*(parseInt(_0x2c07ce(0x1a3))/0x8)+-parseInt(_0x2c07ce(0x1b2))/0x9*(-parseInt(_0x2c07ce(0x1a2))/0xa)+-parseInt(_0x2c07ce(0x1d1))/0xb*(-parseInt(_0x2c07ce(0x1c3))/0xc);if(_0x5bb4d9===_0x28d547)break;else _0x22e275['push'](_0x22e275['shift']());}catch(_0x5ef677){_0x22e275['push'](_0x22e275['shift']());}}}(a8_0x27f8,0x86fb7));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{withSpinner}from'../utils/spinner.js';import{parseAgentRef}from'../sdk/agent/agent-ref-parser.js';import{saveLastChatId,loadLastChatId}from'../sdk/llm/chat-cache.js';import{getLLMConversationUrl}from'../sdk/client/endpoints.js';function a8_0x3abd(_0x55fc40,_0x587816){_0x55fc40=_0x55fc40-0x190;const _0x27f868=a8_0x27f8();let _0x3abd74=_0x27f868[_0x55fc40];return _0x3abd74;}function a8_0x27f8(){const _0x381d1b=['targetWebSearchTool','1108368MFwXrV','1071153wkJjFm','done','write','description','string','Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22','chat-create','code','options','Using\x20cached\x20default\x20agent:\x20','name','Resolving\x20project\x20\x27','cause','9314jeAwCU','stdout','chat','data','12VTQmPM','includes','join','verbose','486xXxSDq','--agent\x20flag','49FWFbEL','Error:\x20Chat\x20session\x20\x27','111MBVcJZ','event','startChat','Error:\x20','44095tTExeb','chatId','19162594kDMiJy','streamChat','targetFunction','validate','Create\x20a\x20new\x20chat\x20session','execute','Chat\x20session:\x20','\x0aStack\x20trace:','Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together','site','projectId','metadata','CHAT_NOT_FOUND','message','getOrCreateDefaultAgent','slice','\x27\x20not\x20found','log','agentId','llmProject','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','tool_result','llmAgent','\x0aError:\x20','agent','tool_call','Using\x20agent\x20from\x20','streamChatJsonl','handleChatEvent','error','type','20UUtlUs','501848yduLmI','content','claude-4.5-haiku','stack','stringify','Resolving\x20agent\x20\x27','\x27...','resolveProjectId','tool','targetKnowledgeBase','2450552DSgjjr','llm','functionName'];a8_0x27f8=function(){return _0x381d1b;};return a8_0x27f8();}function handleSDKError(_0x54f4c7,_0xbc6792){const _0x443755=a8_0x3abd;if(_0x54f4c7 instanceof SDKError)console[_0x443755(0x1a0)](_0x443755(0x1ce)+_0x54f4c7['message']),_0xbc6792[_0x443755(0x1c6)]&&(_0x54f4c7[_0x443755(0x1be)]&&console[_0x443755(0x1a0)]('\x20\x20Cause:\x20'+_0x54f4c7[_0x443755(0x1be)]),_0x54f4c7[_0x443755(0x1a6)]&&(console[_0x443755(0x1a0)](_0x443755(0x1d8)),console['error'](_0x54f4c7['stack'])));else throw _0x54f4c7;}async function resolveAgentId(_0x2ab248,_0xf64e0c,_0x14f6df,_0x4d2952,_0x5b54fd){const _0x50934a=a8_0x3abd,_0x4525d0=_0xf64e0c||_0x14f6df;if(_0x4525d0){const {projectName:_0x44766a,agentName:_0x2c0733}=parseAgentRef(_0x4525d0),_0x2b8daa=_0x2c0733||_0x4525d0,_0x41a2fa=_0x2c0733?_0x44766a:_0x4d2952;if(!_0x41a2fa)throw new Error('No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22');if(_0x5b54fd){const _0x24328f=_0xf64e0c?_0x50934a(0x1c8):'session\x20context';console['error'](_0x50934a(0x19d)+_0x24328f+':\x20'+_0x41a2fa+'/'+_0x2b8daa);}const _0x943462=await withSpinner(_0x50934a(0x1bd)+_0x41a2fa+_0x50934a(0x1a9),()=>_0x2ab248[_0x50934a(0x1ae)][_0x50934a(0x1aa)](_0x41a2fa),{'verbose':_0x5b54fd}),_0x434e87=await withSpinner(_0x50934a(0x1a8)+_0x2b8daa+_0x50934a(0x1a9),()=>_0x2ab248[_0x50934a(0x1ae)]['resolveAgentId'](_0x2b8daa,_0x943462['data']),{'verbose':_0x5b54fd});return _0x434e87[_0x50934a(0x1c2)];}else{const _0x350489=_0x2ab248['llm']['getDefaultAgent']();if(_0x350489)return _0x5b54fd&&console['error'](_0x50934a(0x1bb)+_0x350489[_0x50934a(0x1bc)]),_0x350489['id'];const _0x1dfc18=await withSpinner('Getting\x20default\x20agent...',()=>_0x2ab248[_0x50934a(0x1ae)][_0x50934a(0x191)](_0x50934a(0x1a5),0x0),{'verbose':_0x5b54fd});return _0x1dfc18['data']['id'];}}export class ChatCommand extends BaseCommand{['name']=a8_0x5a85ea(0x1c1);[a8_0x5a85ea(0x1b5)]='Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)';['validate'](_0x4f83b7){const _0x137eaa=a8_0x5a85ea,_0x37cf0a=_0x4f83b7['args'][_0x137eaa(0x1c5)]('\x20');if(!_0x37cf0a)return'Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options';return undefined;}async[a8_0x5a85ea(0x1d2)](_0x2e7edc,_0x2443a7,_0x53eca7,_0x58a158,_0x4dd312){const _0x3d35bc=a8_0x5a85ea;for await(const _0x5f03c of _0x2e7edc[_0x3d35bc(0x1ae)][_0x3d35bc(0x1c1)](_0x2443a7,{'agentId':_0x53eca7,'chatId':_0x58a158})){if(_0x5f03c[_0x3d35bc(0x1a1)]===_0x3d35bc(0x1dc)){const _0x3284a3=_0x5f03c[_0x3d35bc(0x1c2)][_0x3d35bc(0x1d0)];saveLastChatId(_0x3284a3),_0x4dd312&&console[_0x3d35bc(0x1a0)](_0x3d35bc(0x1d7)+_0x3284a3);}else _0x5f03c[_0x3d35bc(0x1a1)]===_0x3d35bc(0x1cc)&&this[_0x3d35bc(0x19f)](_0x5f03c['data']);}}async[a8_0x5a85ea(0x19e)](_0x5079f0,_0x24380e,_0x4d0abc,_0x11d1ac){const _0x29ff13=a8_0x5a85ea,_0x5005f7=_0x5079f0['context'][_0x29ff13(0x1da)];let _0x1183c6=![];for await(const _0x65897 of _0x5079f0['llm'][_0x29ff13(0x1c1)](_0x24380e,{'agentId':_0x4d0abc,'chatId':_0x11d1ac})){if(_0x65897['type']===_0x29ff13(0x1dc)){const _0x52b8ec=_0x65897[_0x29ff13(0x1c2)];saveLastChatId(_0x52b8ec[_0x29ff13(0x1d0)]);const _0x30f470=_0x52b8ec[_0x29ff13(0x1db)]&&_0x52b8ec[_0x29ff13(0x195)]?getLLMConversationUrl(_0x5005f7,_0x52b8ec[_0x29ff13(0x1db)],_0x52b8ec['agentId'],_0x52b8ec[_0x29ff13(0x1d0)]):undefined;console[_0x29ff13(0x194)](JSON['stringify']({'type':'metadata','data':{'chatId':_0x52b8ec['chatId'],'agentId':_0x52b8ec[_0x29ff13(0x195)],'consoleUrl':_0x30f470}})),_0x1183c6=!![];}else{if(_0x65897['type']===_0x29ff13(0x1cc)){!_0x1183c6&&_0x11d1ac&&(console[_0x29ff13(0x194)](JSON['stringify']({'type':'metadata','data':{'chatId':_0x11d1ac}})),_0x1183c6=!![]);const _0x31fa0f=_0x65897[_0x29ff13(0x1c2)];if(_0x29ff13(0x1a4)in _0x31fa0f)console['log'](JSON[_0x29ff13(0x1a7)]({'type':'content','data':{'content':_0x31fa0f['content']}}));else{if(_0x29ff13(0x19c)in _0x31fa0f){const _0x2ca549=_0x31fa0f[_0x29ff13(0x19c)];console[_0x29ff13(0x194)](JSON[_0x29ff13(0x1a7)]({'type':'tool_call','data':{'id':_0x2ca549['id'],'name':_0x2ca549[_0x29ff13(0x1af)],'target':_0x2ca549[_0x29ff13(0x1ac)]?.['name']||_0x2ca549['targetAgent']?.[_0x29ff13(0x1bc)]||_0x2ca549[_0x29ff13(0x1b0)]?.[_0x29ff13(0x1bc)]||_0x2ca549[_0x29ff13(0x1d3)]}}));}else{if(_0x29ff13(0x1ab)in _0x31fa0f)console[_0x29ff13(0x194)](JSON[_0x29ff13(0x1a7)]({'type':_0x29ff13(0x198),'data':{'id':_0x31fa0f[_0x29ff13(0x1ab)]['id'],'name':_0x31fa0f['tool']['functionName'],'result':typeof _0x31fa0f[_0x29ff13(0x1ab)][_0x29ff13(0x1a4)]===_0x29ff13(0x1b6)?_0x31fa0f['tool'][_0x29ff13(0x1a4)][_0x29ff13(0x192)](0x0,0x1f4):''}}));else'error'in _0x31fa0f&&console['log'](JSON[_0x29ff13(0x1a7)]({'type':_0x29ff13(0x1a0),'data':{'error':_0x31fa0f[_0x29ff13(0x1a0)]}}));}}}}}console[_0x29ff13(0x194)](JSON[_0x29ff13(0x1a7)]({'type':_0x29ff13(0x1b3)}));}async['execute'](_0x4884d5){const _0x397d42=a8_0x5a85ea,{options:_0x574155,args:_0x267264,tdx:_0x468368}=_0x4884d5,_0x467cf1=_0x267264['join']('\x20'),_0x51f6a7=_0x574155,_0x21c0e3=_0x51f6a7[_0x397d42(0x19b)],_0x1fc411=_0x51f6a7[_0x397d42(0x199)],_0x50217=_0x51f6a7[_0x397d42(0x196)],_0x4341b0=_0x51f6a7['new'],_0x805c7a=_0x51f6a7[_0x397d42(0x1d0)],_0x56a5c1=_0x51f6a7['stream'];if(_0x4341b0&&_0x805c7a)return console['error'](_0x397d42(0x1d9)),0x1;try{let _0x8c371,_0x2979c0;if(_0x805c7a)_0x2979c0=_0x805c7a;else!_0x4341b0&&(_0x2979c0=loadLastChatId(),_0x2979c0&&_0x574155[_0x397d42(0x1c6)]&&console['error']('Continuing\x20chat:\x20'+_0x2979c0));!_0x805c7a&&(_0x4341b0||!_0x2979c0)&&(_0x8c371=await resolveAgentId(_0x468368,_0x21c0e3,_0x1fc411,_0x50217,_0x574155['verbose']));const _0x1e1543=_0x56a5c1?(_0x228391,_0x276272,_0x1dae6c)=>this[_0x397d42(0x19e)](_0x468368,_0x228391,_0x276272,_0x1dae6c):(_0x13f02f,_0x11bdbc,_0x4a6864)=>this[_0x397d42(0x1d2)](_0x468368,_0x13f02f,_0x11bdbc,_0x4a6864,_0x574155[_0x397d42(0x1c6)]);try{await _0x1e1543(_0x467cf1,_0x8c371,_0x2979c0);}catch(_0x1ad55d){const _0x273a2a=_0x1ad55d instanceof SDKError&&_0x1ad55d[_0x397d42(0x1b9)]===ErrorCode[_0x397d42(0x1dd)]||_0x1ad55d instanceof Error&&_0x1ad55d[_0x397d42(0x190)][_0x397d42(0x1c4)]('404');if(_0x273a2a&&_0x805c7a)return console[_0x397d42(0x1a0)](_0x397d42(0x1ca)+_0x805c7a+_0x397d42(0x193)),0x1;if(_0x273a2a)_0x574155['verbose']&&console[_0x397d42(0x1a0)](_0x397d42(0x197)),!_0x8c371&&(_0x8c371=await resolveAgentId(_0x468368,_0x21c0e3,_0x1fc411,_0x50217,_0x574155['verbose'])),await _0x1e1543(_0x467cf1,_0x8c371,undefined);else throw _0x1ad55d;}return!_0x56a5c1&&console[_0x397d42(0x194)](),0x0;}catch(_0x55aa1f){return console[_0x397d42(0x1a0)](),handleSDKError(_0x55aa1f,_0x574155),0x1;}}[a8_0x5a85ea(0x19f)](_0x774db1){const _0x243e13=a8_0x5a85ea;if(_0x243e13(0x1a4)in _0x774db1)process[_0x243e13(0x1c0)][_0x243e13(0x1b4)](_0x774db1[_0x243e13(0x1a4)]);else _0x243e13(0x1a0)in _0x774db1&&console['error'](_0x243e13(0x19a)+_0x774db1[_0x243e13(0x1a0)]);}}export class ChatCreateCommand extends BaseCommand{[a8_0x5a85ea(0x1bc)]=a8_0x5a85ea(0x1b8);[a8_0x5a85ea(0x1b5)]=a8_0x5a85ea(0x1d5);[a8_0x5a85ea(0x1d4)](_0xf6bf34){const _0x43fb0d=a8_0x5a85ea,_0x1cbdcb=_0xf6bf34[_0x43fb0d(0x1ba)],_0x5ae3b3=_0x1cbdcb[_0x43fb0d(0x19b)],_0x5c8c23=_0x1cbdcb[_0x43fb0d(0x199)];if(!_0x5ae3b3&&!_0x5c8c23)return _0x43fb0d(0x1b7);return undefined;}async[a8_0x5a85ea(0x1d6)](_0x4b33a2){const _0xfe5b72=a8_0x5a85ea,{options:_0x13113b,tdx:_0x853f8c}=_0x4b33a2,_0x59cc04=_0x13113b,_0x4fc9d9=_0x59cc04['agent'],_0x5461dd=_0x59cc04['llmAgent'],_0x17697d=_0x59cc04[_0xfe5b72(0x196)];try{const _0x543d0e=await resolveAgentId(_0x853f8c,_0x4fc9d9,_0x5461dd,_0x17697d,_0x13113b[_0xfe5b72(0x1c6)]),_0x56d29a=await _0x853f8c['llm'][_0xfe5b72(0x1cd)](_0x543d0e);return saveLastChatId(_0x56d29a['id']),console[_0xfe5b72(0x194)](JSON[_0xfe5b72(0x1a7)]({'chatId':_0x56d29a['id'],'agentId':_0x543d0e})),0x0;}catch(_0xd5152e){return handleSDKError(_0xd5152e,_0x13113b),0x1;}}}
1
+ function a8_0x4d56(){const _0xd0c25b=['session\x20context','1796uUaPAH','args','metadata','916792UwLJCc','verbose','llm','projectId','\x20\x20Cause:\x20','targetAgent','Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22','Getting\x20default\x20agent...','cause','stringify','description','site','2787955rPuDog','error','handleChatEvent','tool_result','\x27\x20not\x20found','options','Resolving\x20project\x20\x27','404','tool_call','Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together','Error:\x20','Error:\x20Chat\x20session\x20\x27','chat','event','context','6096231abGulR','getOrCreateDefaultAgent','startChat','Continuing\x20chat:\x20','8522502uVZQeB','6236ZVgrAh','agent','targetKnowledgeBase','targetWebSearchTool','llmAgent','20rLsYks','stream','511TPDyoW','slice','join','Chat\x20session:\x20','stack','Resolving\x20agent\x20\x27','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','stdout','10618580PgzxVb','code','message','3336UtULGn','content','log','tool','name','chatId','llmProject','functionName','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','claude-4.5-haiku','string','type','resolveAgentId','\x0aError:\x20','getDefaultAgent','new','includes','chat-create','\x27...','agentId','CHAT_NOT_FOUND','streamChat','data','No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22','resolveProjectId','\x0aStack\x20trace:'];a8_0x4d56=function(){return _0xd0c25b;};return a8_0x4d56();}const a8_0x4d893e=a8_0x187f;(function(_0xb0261,_0xc5d543){const _0xe38adc=a8_0x187f,_0x519e72=_0xb0261();while(!![]){try{const _0x56233a=parseInt(_0xe38adc(0xd9))/0x1*(-parseInt(_0xe38adc(0xd2))/0x2)+-parseInt(_0xe38adc(0x94))/0x3*(-parseInt(_0xe38adc(0xaf))/0x4)+parseInt(_0xe38adc(0xbe))/0x5+-parseInt(_0xe38adc(0xd1))/0x6+parseInt(_0xe38adc(0x91))/0x7+-parseInt(_0xe38adc(0xb2))/0x8+-parseInt(_0xe38adc(0xcd))/0x9*(-parseInt(_0xe38adc(0xd7))/0xa);if(_0x56233a===_0xc5d543)break;else _0x519e72['push'](_0x519e72['shift']());}catch(_0x37e8c5){_0x519e72['push'](_0x519e72['shift']());}}}(a8_0x4d56,0xc35df));function a8_0x187f(_0x3863d0,_0x4bbd51){_0x3863d0=_0x3863d0-0x8c;const _0x4d5657=a8_0x4d56();let _0x187fe9=_0x4d5657[_0x3863d0];return _0x187fe9;}import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{withSpinner}from'../utils/spinner.js';import{parseAgentRef}from'../sdk/agent/agent-ref-parser.js';import{saveLastChatId,loadLastChatId}from'../sdk/llm/chat-cache.js';import{getLLMConversationUrl}from'../sdk/client/endpoints.js';function handleSDKError(_0x58e23e,_0x22d427){const _0x8fd1a1=a8_0x187f;if(_0x58e23e instanceof SDKError)console[_0x8fd1a1(0xbf)](_0x8fd1a1(0xc8)+_0x58e23e[_0x8fd1a1(0x93)]),_0x22d427[_0x8fd1a1(0xb3)]&&(_0x58e23e['cause']&&console[_0x8fd1a1(0xbf)](_0x8fd1a1(0xb6)+_0x58e23e[_0x8fd1a1(0xba)]),_0x58e23e[_0x8fd1a1(0x8d)]&&(console[_0x8fd1a1(0xbf)](_0x8fd1a1(0xad)),console[_0x8fd1a1(0xbf)](_0x58e23e[_0x8fd1a1(0x8d)])));else throw _0x58e23e;}async function resolveAgentId(_0x50a952,_0x43ffd2,_0x4cdaf7,_0x3977f4,_0x5bc794){const _0x5b2dcf=a8_0x187f,_0x49a881=_0x43ffd2||_0x4cdaf7;if(_0x49a881){const {projectName:_0x34855a,agentName:_0x98a7}=parseAgentRef(_0x49a881),_0x51bd9a=_0x98a7||_0x49a881,_0x280fc3=_0x98a7?_0x34855a:_0x3977f4;if(!_0x280fc3)throw new Error(_0x5b2dcf(0xab));if(_0x5bc794){const _0x2f6e1c=_0x43ffd2?'--agent\x20flag':_0x5b2dcf(0xae);console['error']('Using\x20agent\x20from\x20'+_0x2f6e1c+':\x20'+_0x280fc3+'/'+_0x51bd9a);}const _0x53090e=await withSpinner(_0x5b2dcf(0xc4)+_0x280fc3+_0x5b2dcf(0xa6),()=>_0x50a952[_0x5b2dcf(0xb4)][_0x5b2dcf(0xac)](_0x280fc3),{'verbose':_0x5bc794}),_0x1a2741=await withSpinner(_0x5b2dcf(0x8e)+_0x51bd9a+'\x27...',()=>_0x50a952[_0x5b2dcf(0xb4)][_0x5b2dcf(0xa0)](_0x51bd9a,_0x53090e['data']),{'verbose':_0x5bc794});return _0x1a2741[_0x5b2dcf(0xaa)];}else{const _0xb7e128=_0x50a952['llm'][_0x5b2dcf(0xa2)]();if(_0xb7e128)return _0x5bc794&&console['error']('Using\x20cached\x20default\x20agent:\x20'+_0xb7e128[_0x5b2dcf(0x98)]),_0xb7e128['id'];const _0xa292b1=await withSpinner(_0x5b2dcf(0xb9),()=>_0x50a952[_0x5b2dcf(0xb4)][_0x5b2dcf(0xce)](_0x5b2dcf(0x9d),0x0),{'verbose':_0x5bc794});return _0xa292b1[_0x5b2dcf(0xaa)]['id'];}}export class ChatCommand extends BaseCommand{[a8_0x4d893e(0x98)]=a8_0x4d893e(0xca);[a8_0x4d893e(0xbc)]=a8_0x4d893e(0x9c);['validate'](_0x2d0624){const _0x4d7a49=a8_0x4d893e,_0x18075a=_0x2d0624[_0x4d7a49(0xb0)][_0x4d7a49(0xdb)]('\x20');if(!_0x18075a)return'Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options';return undefined;}async['streamChat'](_0x4d55e3,_0x3bfd12,_0x43618b,_0x18d0d8,_0x1045a8){const _0x2f09f8=a8_0x4d893e;for await(const _0x1af17b of _0x4d55e3[_0x2f09f8(0xb4)]['chat'](_0x3bfd12,{'agentId':_0x43618b,'chatId':_0x18d0d8})){if(_0x1af17b[_0x2f09f8(0x9f)]===_0x2f09f8(0xb1)){const _0x2e0bdf=_0x1af17b[_0x2f09f8(0xaa)][_0x2f09f8(0x99)];saveLastChatId(_0x2e0bdf),_0x1045a8&&console[_0x2f09f8(0xbf)](_0x2f09f8(0x8c)+_0x2e0bdf);}else _0x1af17b[_0x2f09f8(0x9f)]===_0x2f09f8(0xcb)&&this['handleChatEvent'](_0x1af17b[_0x2f09f8(0xaa)]);}}async['streamChatJsonl'](_0x244ab2,_0x147baf,_0x14fc87,_0xf8a36d){const _0xb5b196=a8_0x4d893e,_0x1807a6=_0x244ab2[_0xb5b196(0xcc)][_0xb5b196(0xbd)];let _0x4d48a1=![];for await(const _0x4067d5 of _0x244ab2[_0xb5b196(0xb4)][_0xb5b196(0xca)](_0x147baf,{'agentId':_0x14fc87,'chatId':_0xf8a36d})){if(_0x4067d5[_0xb5b196(0x9f)]===_0xb5b196(0xb1)){const _0x29bec7=_0x4067d5[_0xb5b196(0xaa)];saveLastChatId(_0x29bec7[_0xb5b196(0x99)]);const _0x3f45b8=_0x29bec7[_0xb5b196(0xb5)]&&_0x29bec7[_0xb5b196(0xa7)]?getLLMConversationUrl(_0x1807a6,_0x29bec7['projectId'],_0x29bec7[_0xb5b196(0xa7)],_0x29bec7[_0xb5b196(0x99)]):undefined;console[_0xb5b196(0x96)](JSON[_0xb5b196(0xbb)]({'type':_0xb5b196(0xb1),'data':{'chatId':_0x29bec7['chatId'],'agentId':_0x29bec7[_0xb5b196(0xa7)],'consoleUrl':_0x3f45b8}})),_0x4d48a1=!![];}else{if(_0x4067d5['type']===_0xb5b196(0xcb)){!_0x4d48a1&&_0xf8a36d&&(console[_0xb5b196(0x96)](JSON['stringify']({'type':_0xb5b196(0xb1),'data':{'chatId':_0xf8a36d}})),_0x4d48a1=!![]);const _0xb35869=_0x4067d5['data'];if('content'in _0xb35869)console[_0xb5b196(0x96)](JSON[_0xb5b196(0xbb)]({'type':_0xb5b196(0x95),'data':{'content':_0xb35869[_0xb5b196(0x95)]}}));else{if(_0xb5b196(0xc6)in _0xb35869){const _0x5d878d=_0xb35869['tool_call'];console['log'](JSON[_0xb5b196(0xbb)]({'type':_0xb5b196(0xc6),'data':{'id':_0x5d878d['id'],'name':_0x5d878d[_0xb5b196(0x9b)],'target':_0x5d878d[_0xb5b196(0xd4)]?.['name']||_0x5d878d[_0xb5b196(0xb7)]?.[_0xb5b196(0x98)]||_0x5d878d[_0xb5b196(0xd5)]?.[_0xb5b196(0x98)]||_0x5d878d['targetFunction']}}));}else{if(_0xb5b196(0x97)in _0xb35869)console['log'](JSON[_0xb5b196(0xbb)]({'type':_0xb5b196(0xc1),'data':{'id':_0xb35869[_0xb5b196(0x97)]['id'],'name':_0xb35869[_0xb5b196(0x97)]['functionName'],'result':typeof _0xb35869[_0xb5b196(0x97)][_0xb5b196(0x95)]===_0xb5b196(0x9e)?_0xb35869[_0xb5b196(0x97)][_0xb5b196(0x95)][_0xb5b196(0xda)](0x0,0x1f4):''}}));else'error'in _0xb35869&&console[_0xb5b196(0x96)](JSON[_0xb5b196(0xbb)]({'type':_0xb5b196(0xbf),'data':{'error':_0xb35869[_0xb5b196(0xbf)]}}));}}}}}console[_0xb5b196(0x96)](JSON[_0xb5b196(0xbb)]({'type':'done'}));}async['execute'](_0x366d73){const _0x5552e7=a8_0x4d893e,{options:_0x2b7114,args:_0x1656f2,tdx:_0x5cd40f}=_0x366d73,_0x1f7a07=_0x1656f2[_0x5552e7(0xdb)]('\x20'),_0x5524f6=_0x2b7114,_0x2f21f1=_0x5524f6[_0x5552e7(0xd3)],_0x17088f=_0x5524f6[_0x5552e7(0xd6)],_0xc31988=_0x5524f6['llmProject'],_0x4cd2f7=_0x5524f6[_0x5552e7(0xa3)],_0xc64141=_0x5524f6[_0x5552e7(0x99)],_0x98f28e=_0x5524f6[_0x5552e7(0xd8)];if(_0x4cd2f7&&_0xc64141)return console['error'](_0x5552e7(0xc7)),0x1;try{let _0x4c8683,_0xf002e4;if(_0xc64141)_0xf002e4=_0xc64141;else!_0x4cd2f7&&(_0xf002e4=loadLastChatId(),_0xf002e4&&_0x2b7114[_0x5552e7(0xb3)]&&console[_0x5552e7(0xbf)](_0x5552e7(0xd0)+_0xf002e4));!_0xc64141&&(_0x4cd2f7||!_0xf002e4)&&(_0x4c8683=await resolveAgentId(_0x5cd40f,_0x2f21f1,_0x17088f,_0xc31988,_0x2b7114[_0x5552e7(0xb3)]));const _0x299c84=_0x98f28e?(_0x24e2a1,_0x191478,_0x2e2c84)=>this['streamChatJsonl'](_0x5cd40f,_0x24e2a1,_0x191478,_0x2e2c84):(_0x36c96a,_0x2c00e0,_0x2175fd)=>this[_0x5552e7(0xa9)](_0x5cd40f,_0x36c96a,_0x2c00e0,_0x2175fd,_0x2b7114[_0x5552e7(0xb3)]);try{await _0x299c84(_0x1f7a07,_0x4c8683,_0xf002e4);}catch(_0x19e993){const _0x3ffb75=_0x19e993 instanceof SDKError&&_0x19e993[_0x5552e7(0x92)]===ErrorCode[_0x5552e7(0xa8)]||_0x19e993 instanceof Error&&_0x19e993[_0x5552e7(0x93)][_0x5552e7(0xa4)](_0x5552e7(0xc5));if(_0x3ffb75&&_0xc64141)return console['error'](_0x5552e7(0xc9)+_0xc64141+_0x5552e7(0xc2)),0x1;if(_0x3ffb75)_0x2b7114[_0x5552e7(0xb3)]&&console[_0x5552e7(0xbf)](_0x5552e7(0x8f)),!_0x4c8683&&(_0x4c8683=await resolveAgentId(_0x5cd40f,_0x2f21f1,_0x17088f,_0xc31988,_0x2b7114[_0x5552e7(0xb3)])),await _0x299c84(_0x1f7a07,_0x4c8683,undefined);else throw _0x19e993;}return!_0x98f28e&&console[_0x5552e7(0x96)](),0x0;}catch(_0x211602){return console['error'](),handleSDKError(_0x211602,_0x2b7114),0x1;}}[a8_0x4d893e(0xc0)](_0x57104e){const _0x4a13b4=a8_0x4d893e;if(_0x4a13b4(0x95)in _0x57104e)process[_0x4a13b4(0x90)]['write'](_0x57104e[_0x4a13b4(0x95)]);else _0x4a13b4(0xbf)in _0x57104e&&console['error'](_0x4a13b4(0xa1)+_0x57104e[_0x4a13b4(0xbf)]);}}export class ChatCreateCommand extends BaseCommand{[a8_0x4d893e(0x98)]=a8_0x4d893e(0xa5);['description']='Create\x20a\x20new\x20chat\x20session';['validate'](_0x32f423){const _0x54f72e=a8_0x4d893e,_0x613107=_0x32f423[_0x54f72e(0xc3)],_0x1decd9=_0x613107[_0x54f72e(0xd3)],_0x2f0f45=_0x613107[_0x54f72e(0xd6)];if(!_0x1decd9&&!_0x2f0f45)return _0x54f72e(0xb8);return undefined;}async['execute'](_0x57ce8b){const _0xfd4869=a8_0x4d893e,{options:_0x342ceb,tdx:_0x16acf1}=_0x57ce8b,_0x1e60c4=_0x342ceb,_0x36a91c=_0x1e60c4[_0xfd4869(0xd3)],_0x569627=_0x1e60c4[_0xfd4869(0xd6)],_0x57c0f5=_0x1e60c4[_0xfd4869(0x9a)];try{const _0x305236=await resolveAgentId(_0x16acf1,_0x36a91c,_0x569627,_0x57c0f5,_0x342ceb[_0xfd4869(0xb3)]),_0x131064=await _0x16acf1[_0xfd4869(0xb4)][_0xfd4869(0xcf)](_0x305236);return saveLastChatId(_0x131064['id']),console[_0xfd4869(0x96)](JSON['stringify']({'chatId':_0x131064['id'],'agentId':_0x305236})),0x0;}catch(_0x4d1e24){return handleSDKError(_0x4d1e24,_0x342ceb),0x1;}}}