@treasuredata/tdx 0.26.2 → 0.26.4

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 (169) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/chat-command.js +1 -1
  11. package/dist/commands/claude-command.js +1 -1
  12. package/dist/commands/claude-statusline-command.js +1 -1
  13. package/dist/commands/claude-usage-command.js +1 -1
  14. package/dist/commands/command.js +1 -1
  15. package/dist/commands/connection-command.js +1 -1
  16. package/dist/commands/databases.js +1 -1
  17. package/dist/commands/describe.js +1 -1
  18. package/dist/commands/engage-command.js +1 -1
  19. package/dist/commands/job-command.js +1 -1
  20. package/dist/commands/journey-command.js +1 -1
  21. package/dist/commands/journey-validate-command.js +1 -1
  22. package/dist/commands/llm-command.js +1 -1
  23. package/dist/commands/mcp-command.js +1 -1
  24. package/dist/commands/parent-segment-command.js +1 -1
  25. package/dist/commands/profile-command.js +1 -1
  26. package/dist/commands/profiles-command.js +1 -1
  27. package/dist/commands/query-command.js +1 -1
  28. package/dist/commands/schedule-command.js +1 -1
  29. package/dist/commands/segment-command.js +1 -1
  30. package/dist/commands/segment-create-command.js +1 -1
  31. package/dist/commands/segment-fields-command.js +1 -1
  32. package/dist/commands/segment-pull-command.js +1 -1
  33. package/dist/commands/segment-push-command.js +1 -1
  34. package/dist/commands/segment-update-command.js +1 -1
  35. package/dist/commands/segment-use-command.js +1 -1
  36. package/dist/commands/segment-validate-command.js +1 -1
  37. package/dist/commands/segments.js +1 -1
  38. package/dist/commands/show.js +1 -1
  39. package/dist/commands/status-command.js +1 -1
  40. package/dist/commands/tables.js +1 -1
  41. package/dist/commands/unset-command.js +1 -1
  42. package/dist/commands/use-command.js +1 -1
  43. package/dist/commands/user-command.js +1 -1
  44. package/dist/commands/workflow-command.js +1 -1
  45. package/dist/core/auth.js +1 -1
  46. package/dist/core/command-output.js +1 -1
  47. package/dist/core/config.js +1 -1
  48. package/dist/core/connection-cache.js +1 -1
  49. package/dist/core/constants.js +1 -1
  50. package/dist/core/credential-cache.js +1 -1
  51. package/dist/core/global-context.js +1 -1
  52. package/dist/core/keychain.js +1 -1
  53. package/dist/core/profile.js +1 -1
  54. package/dist/core/project-config.js +1 -1
  55. package/dist/core/session.js +1 -1
  56. package/dist/core/user-cache.js +1 -1
  57. package/dist/core/version.js +1 -1
  58. package/dist/index.js +1 -1
  59. package/dist/mcp/server.js +1 -1
  60. package/dist/mcp/tools/index.js +1 -1
  61. package/dist/mcp/tools/tdx-run.js +1 -1
  62. package/dist/mcp/tools/tdx-search.js +1 -1
  63. package/dist/mcp/utils.js +1 -1
  64. package/dist/proxy/claude-usage-tracker.js +1 -1
  65. package/dist/proxy/passthrough-server.js +1 -1
  66. package/dist/proxy/sse-usage-parser.js +1 -1
  67. package/dist/sdk/agent/agent-config.js +1 -1
  68. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  69. package/dist/sdk/agent/agent-yaml.js +1 -1
  70. package/dist/sdk/agent/test/evaluator.js +1 -1
  71. package/dist/sdk/agent/test/executor.js +1 -1
  72. package/dist/sdk/agent/test/index.js +1 -1
  73. package/dist/sdk/agent/test/output.js +1 -1
  74. package/dist/sdk/agent/test/parser.js +1 -1
  75. package/dist/sdk/api.js +1 -1
  76. package/dist/sdk/client/cdp-api-client.js +1 -1
  77. package/dist/sdk/client/endpoints.js +1 -1
  78. package/dist/sdk/client/engage-api-client.js +1 -1
  79. package/dist/sdk/client/http-client.js +1 -1
  80. package/dist/sdk/client/llm-api-client.js +1 -1
  81. package/dist/sdk/client/rate-limiter.js +1 -1
  82. package/dist/sdk/client/td-api-client.js +1 -1
  83. package/dist/sdk/client/trino-api-client.js +1 -1
  84. package/dist/sdk/client/workflow-client.js +1 -1
  85. package/dist/sdk/connection-validator.js +1 -1
  86. package/dist/sdk/connection.js +1 -1
  87. package/dist/sdk/engage.js +1 -1
  88. package/dist/sdk/errors.js +1 -1
  89. package/dist/sdk/index.js +1 -1
  90. package/dist/sdk/io/index.js +1 -1
  91. package/dist/sdk/io/node-filesystem.js +1 -1
  92. package/dist/sdk/job.js +1 -1
  93. package/dist/sdk/journey.js +1 -1
  94. package/dist/sdk/llm/chat-cache.js +1 -1
  95. package/dist/sdk/llm/index.js +1 -1
  96. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  97. package/dist/sdk/llm/model-factors.js +1 -1
  98. package/dist/sdk/personalization.js +1 -1
  99. package/dist/sdk/query/index.js +1 -1
  100. package/dist/sdk/query/sql-parser.js +1 -1
  101. package/dist/sdk/realtime.js +1 -1
  102. package/dist/sdk/schedule.js +1 -1
  103. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  104. package/dist/sdk/segment/fields-display.js +1 -1
  105. package/dist/sdk/segment/file-discovery.js +1 -1
  106. package/dist/sdk/segment/journey-utils.js +1 -1
  107. package/dist/sdk/segment/journey-validator.js +1 -1
  108. package/dist/sdk/segment/journey-yaml.js +1 -1
  109. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  110. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  111. package/dist/sdk/segment/pull-workflow.js +1 -1
  112. package/dist/sdk/segment/push-recovery.js +1 -1
  113. package/dist/sdk/segment/push-workflow.js +1 -1
  114. package/dist/sdk/segment/resolution-context.js +1 -1
  115. package/dist/sdk/segment/segment-path-parser.js +1 -1
  116. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  117. package/dist/sdk/segment/target-resolution.js +1 -1
  118. package/dist/sdk/segment/tdx-config.js +1 -1
  119. package/dist/sdk/segment/validate-files.js +1 -1
  120. package/dist/sdk/segment/yaml-validator.d.ts.map +1 -1
  121. package/dist/sdk/segment/yaml-validator.js +1 -1
  122. package/dist/sdk/segment/yaml-validator.js.map +1 -1
  123. package/dist/sdk/segment.js +1 -1
  124. package/dist/sdk/types/index.js +1 -1
  125. package/dist/sdk/types/progress.js +1 -1
  126. package/dist/sdk/user.js +1 -1
  127. package/dist/sdk/util/format-detector.js +1 -1
  128. package/dist/sdk/util/formatters.js +1 -1
  129. package/dist/sdk/util/index.js +1 -1
  130. package/dist/sdk/util/tree-formatter.js +1 -1
  131. package/dist/sdk/workflow/archive-validation.js +1 -1
  132. package/dist/sdk/workflow/clone-workflow.js +1 -1
  133. package/dist/sdk/workflow/index.js +1 -1
  134. package/dist/sdk/workflow/pull-workflow.js +1 -1
  135. package/dist/sdk/workflow/push-workflow.js +1 -1
  136. package/dist/sdk/workflow/tdx-config.js +1 -1
  137. package/dist/sdk/workflow/workflow-utils.js +1 -1
  138. package/dist/test-utils/command-runner.js +1 -1
  139. package/dist/test-utils/factories.js +1 -1
  140. package/dist/test-utils/fixtures.js +1 -1
  141. package/dist/test-utils/http-mock.js +1 -1
  142. package/dist/test-utils/index.js +1 -1
  143. package/dist/utils/async.js +1 -1
  144. package/dist/utils/colors.js +1 -1
  145. package/dist/utils/diff.js +1 -1
  146. package/dist/utils/file-permissions.js +1 -1
  147. package/dist/utils/global-cache.js +1 -1
  148. package/dist/utils/json-loader.js +1 -1
  149. package/dist/utils/local-cache.js +1 -1
  150. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  151. package/dist/utils/logger/formatters/index.js +1 -1
  152. package/dist/utils/logger/handlers/console-handler.js +1 -1
  153. package/dist/utils/logger/handlers/file-handler.js +1 -1
  154. package/dist/utils/logger/handlers/index.js +1 -1
  155. package/dist/utils/logger/handlers/null-handler.js +1 -1
  156. package/dist/utils/logger/index.js +1 -1
  157. package/dist/utils/logger/logger.js +1 -1
  158. package/dist/utils/logger/types.js +1 -1
  159. package/dist/utils/option-validation.js +1 -1
  160. package/dist/utils/port.js +1 -1
  161. package/dist/utils/process.js +1 -1
  162. package/dist/utils/prompt.js +1 -1
  163. package/dist/utils/spinner.js +1 -1
  164. package/dist/utils/sse-parser.js +1 -1
  165. package/dist/utils/string-utils.js +1 -1
  166. package/dist/utils/table-ref-parser.js +1 -1
  167. package/dist/utils/tdx-logger.js +1 -1
  168. package/dist/utils/version-check.js +1 -1
  169. package/package.json +1 -1
@@ -1 +1 @@
1
- const a3_0x298da5=a3_0x57c9;(function(_0xfcbcd2,_0x219dec){const _0x5cb858=a3_0x57c9,_0x57d99a=_0xfcbcd2();while(!![]){try{const _0x567163=-parseInt(_0x5cb858(0x162))/0x1+-parseInt(_0x5cb858(0x164))/0x2+parseInt(_0x5cb858(0x14d))/0x3+parseInt(_0x5cb858(0x151))/0x4+parseInt(_0x5cb858(0x152))/0x5*(parseInt(_0x5cb858(0x155))/0x6)+parseInt(_0x5cb858(0x146))/0x7+parseInt(_0x5cb858(0x160))/0x8;if(_0x567163===_0x219dec)break;else _0x57d99a['push'](_0x57d99a['shift']());}catch(_0x158820){_0x57d99a['push'](_0x57d99a['shift']());}}}(a3_0x2d10,0xe0f62));function a3_0x57c9(_0x4623a1,_0x5d3374){_0x4623a1=_0x4623a1-0x146;const _0x2d1031=a3_0x2d10();let _0x57c99f=_0x2d1031[_0x4623a1];return _0x57c99f;}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a3_0x2d10(){const _0xfe9d2d=['error','Resolved\x20parent\x20ID:\x20','resolveSegmentId','data','message','name','Site:\x20','verbose','2367224wminRS','execute','1109761hZWOzq','Child\x20name:\x20','502130QsNEGj','description','listActivations','Error:\x20','\x20\x20Cause:\x20','6811182ZROuuO','site','Error:\x20Segment\x20name\x20is\x20required','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','resolveParentId','cause','Resolved\x20child\x20ID:\x20','759354XmMBYW','segment','length','\x27...','1832664KVKRGA','975EUCtCs','activations','Parent\x20name:\x20','9294HONzsD','✔\x20Found\x20','\x20activation'];a3_0x2d10=function(){return _0xfe9d2d;};return a3_0x2d10();}import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';export class ActivationsCommand extends BaseCommand{[a3_0x298da5(0x15d)]=a3_0x298da5(0x153);[a3_0x298da5(0x165)]='List\x20activations\x20for\x20a\x20segment';async[a3_0x298da5(0x161)](_0x146bf8){const _0x71a47f=a3_0x298da5,{options:_0x1f30c4,args:_0x6c17a8,tdx:_0x1d767f}=_0x146bf8;if(_0x6c17a8[_0x71a47f(0x14f)]===0x0)return console[_0x71a47f(0x158)](_0x71a47f(0x148)),console[_0x71a47f(0x158)]('Usage:\x20tdx\x20activations\x20<parent_name/child_name>'),0x1;try{const {parentId:_0x572925,childId:_0x1e2508}=parseSegmentRef(_0x6c17a8[0x0]);if(!_0x1e2508)return console['error']('Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations'),console[_0x71a47f(0x158)](_0x71a47f(0x149)),0x1;_0x1f30c4[_0x71a47f(0x15f)]&&(console[_0x71a47f(0x158)](_0x71a47f(0x15e)+_0x1f30c4[_0x71a47f(0x147)]),console['error'](_0x71a47f(0x154)+_0x572925),console[_0x71a47f(0x158)](_0x71a47f(0x163)+_0x1e2508));const _0x7191c=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x572925+'\x27...',()=>_0x1d767f[_0x71a47f(0x14e)][_0x71a47f(0x14a)](_0x572925),{'verbose':_0x1f30c4['verbose']}),_0x23bead=_0x7191c[_0x71a47f(0x15b)];_0x1f30c4[_0x71a47f(0x15f)]&&console[_0x71a47f(0x158)](_0x71a47f(0x159)+_0x23bead);const _0x3562d1=await withSpinner('Resolving\x20child\x20segment\x20\x27'+_0x1e2508+'\x27...',()=>_0x1d767f['segment'][_0x71a47f(0x15a)](_0x23bead,_0x1e2508),{'verbose':_0x1f30c4['verbose']}),_0x3dc078=_0x3562d1[_0x71a47f(0x15b)];_0x1f30c4[_0x71a47f(0x15f)]&&console[_0x71a47f(0x158)](_0x71a47f(0x14c)+_0x3dc078);const _0x2e1899=await withSpinner('Listing\x20activations\x20for\x20segment\x20\x27'+_0x1e2508+_0x71a47f(0x150),()=>_0x1d767f[_0x71a47f(0x14e)][_0x71a47f(0x166)](_0x23bead,_0x3dc078),{'verbose':_0x1f30c4['verbose']}),_0x41cb6e=_0x2e1899['data'];return console[_0x71a47f(0x158)](_0x71a47f(0x156)+_0x41cb6e[_0x71a47f(0x14f)]+_0x71a47f(0x157)+(_0x41cb6e[_0x71a47f(0x14f)]!==0x1?'s':'')),await handleSDKOutput(_0x41cb6e,_0x1f30c4),0x0;}catch(_0x47f38f){if(_0x47f38f instanceof SDKError)return console['error'](_0x71a47f(0x167)+_0x47f38f[_0x71a47f(0x15c)]),_0x47f38f[_0x71a47f(0x14b)]&&console[_0x71a47f(0x158)](_0x71a47f(0x168)+_0x47f38f['cause']),0x1;throw _0x47f38f;}}}
1
+ const a3_0x3d355f=a3_0x2187;function a3_0x2187(_0x24726f,_0x4f3643){_0x24726f=_0x24726f-0x6d;const _0xa181ee=a3_0xa181();let _0x218742=_0xa181ee[_0x24726f];return _0x218742;}function a3_0xa181(){const _0x598e48=['\x20\x20Cause:\x20','6325795TkxfOv','List\x20activations\x20for\x20a\x20segment','5003168APOykF','6654ebilCP','\x27...','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','66340mNxUoB','activations','Parent\x20name:\x20','\x20activation','Child\x20name:\x20','9gYsPmh','556bPEXWK','error','Resolved\x20child\x20ID:\x20','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','verbose','✔\x20Found\x20','resolveSegmentId','2894229xbrAGv','6GTAfkp','site','segment','Resolved\x20parent\x20ID:\x20','Site:\x20','length','cause','Listing\x20activations\x20for\x20segment\x20\x27','Error:\x20','Resolving\x20parent\x20segment\x20\x27','listActivations','896598qhvcca','6845TTixmu','message','data','execute','3047HqgKYr'];a3_0xa181=function(){return _0x598e48;};return a3_0xa181();}(function(_0x4ed663,_0x4e7fb3){const _0x277cbf=a3_0x2187,_0x32a7c1=_0x4ed663();while(!![]){try{const _0x18c9f1=-parseInt(_0x277cbf(0x76))/0x1*(parseInt(_0x277cbf(0x6e))/0x2)+-parseInt(_0x277cbf(0x7e))/0x3+parseInt(_0x277cbf(0x77))/0x4*(parseInt(_0x277cbf(0x8b))/0x5)+-parseInt(_0x277cbf(0x7f))/0x6*(parseInt(_0x277cbf(0x91))/0x7)+parseInt(_0x277cbf(0x6d))/0x8+parseInt(_0x277cbf(0x8a))/0x9+parseInt(_0x277cbf(0x71))/0xa*(parseInt(_0x277cbf(0x8f))/0xb);if(_0x18c9f1===_0x4e7fb3)break;else _0x32a7c1['push'](_0x32a7c1['shift']());}catch(_0x2b0be8){_0x32a7c1['push'](_0x32a7c1['shift']());}}}(a3_0xa181,0xd0a1c));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_0x3d355f(0x72);['description']=a3_0x3d355f(0x92);async[a3_0x3d355f(0x8e)](_0x436f0f){const _0x28a8a9=a3_0x3d355f,{options:_0x1f71b4,args:_0x19c6cf,tdx:_0x3ff969}=_0x436f0f;if(_0x19c6cf[_0x28a8a9(0x84)]===0x0)return console[_0x28a8a9(0x78)]('Error:\x20Segment\x20name\x20is\x20required'),console[_0x28a8a9(0x78)](_0x28a8a9(0x70)),0x1;try{const {parentId:_0x25aead,childId:_0x37b636}=parseSegmentRef(_0x19c6cf[0x0]);if(!_0x37b636)return console[_0x28a8a9(0x78)](_0x28a8a9(0x7a)),console['error'](_0x28a8a9(0x70)),0x1;_0x1f71b4[_0x28a8a9(0x7b)]&&(console['error'](_0x28a8a9(0x83)+_0x1f71b4[_0x28a8a9(0x80)]),console[_0x28a8a9(0x78)](_0x28a8a9(0x73)+_0x25aead),console[_0x28a8a9(0x78)](_0x28a8a9(0x75)+_0x37b636));const _0x1ea313=await withSpinner(_0x28a8a9(0x88)+_0x25aead+_0x28a8a9(0x6f),()=>_0x3ff969['segment']['resolveParentId'](_0x25aead),{'verbose':_0x1f71b4[_0x28a8a9(0x7b)]}),_0x521098=_0x1ea313[_0x28a8a9(0x8d)];_0x1f71b4[_0x28a8a9(0x7b)]&&console[_0x28a8a9(0x78)](_0x28a8a9(0x82)+_0x521098);const _0x4823dc=await withSpinner('Resolving\x20child\x20segment\x20\x27'+_0x37b636+_0x28a8a9(0x6f),()=>_0x3ff969[_0x28a8a9(0x81)][_0x28a8a9(0x7d)](_0x521098,_0x37b636),{'verbose':_0x1f71b4[_0x28a8a9(0x7b)]}),_0xac4fda=_0x4823dc[_0x28a8a9(0x8d)];_0x1f71b4[_0x28a8a9(0x7b)]&&console['error'](_0x28a8a9(0x79)+_0xac4fda);const _0x50bd9b=await withSpinner(_0x28a8a9(0x86)+_0x37b636+_0x28a8a9(0x6f),()=>_0x3ff969[_0x28a8a9(0x81)][_0x28a8a9(0x89)](_0x521098,_0xac4fda),{'verbose':_0x1f71b4['verbose']}),_0x361762=_0x50bd9b['data'];return console[_0x28a8a9(0x78)](_0x28a8a9(0x7c)+_0x361762['length']+_0x28a8a9(0x74)+(_0x361762[_0x28a8a9(0x84)]!==0x1?'s':'')),await handleSDKOutput(_0x361762,_0x1f71b4),0x0;}catch(_0x2a2894){if(_0x2a2894 instanceof SDKError)return console[_0x28a8a9(0x78)](_0x28a8a9(0x87)+_0x2a2894[_0x28a8a9(0x8c)]),_0x2a2894['cause']&&console[_0x28a8a9(0x78)](_0x28a8a9(0x90)+_0x2a2894[_0x28a8a9(0x85)]),0x1;throw _0x2a2894;}}}
@@ -1 +1 @@
1
- const a4_0x266ed6=a4_0x173b;(function(_0x4cb0ca,_0x47065d){const _0x180463=a4_0x173b,_0x1a49e9=_0x4cb0ca();while(!![]){try{const _0x26be3c=-parseInt(_0x180463(0xbb))/0x1*(-parseInt(_0x180463(0xd5))/0x2)+-parseInt(_0x180463(0x103))/0x3+-parseInt(_0x180463(0xdf))/0x4+-parseInt(_0x180463(0xed))/0x5*(parseInt(_0x180463(0x10b))/0x6)+-parseInt(_0x180463(0xc4))/0x7*(parseInt(_0x180463(0xe0))/0x8)+-parseInt(_0x180463(0xaf))/0x9*(-parseInt(_0x180463(0xe7))/0xa)+parseInt(_0x180463(0xdb))/0xb;if(_0x26be3c===_0x47065d)break;else _0x1a49e9['push'](_0x1a49e9['shift']());}catch(_0x163ed8){_0x1a49e9['push'](_0x1a49e9['shift']());}}}(a4_0xb399,0xf381c));import a4_0x51ad2e from'chalk';import a4_0x53d24e from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';function a4_0xb399(){const _0x1b033d=['Status:\x20','Cloning\x20\x22','experimentalArtifacts','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','agent:push','join','execute','\x20\x20Agent\x20\x22','\x20\x20tdx\x20agent\x20pull\x20','parse','\x20files?','\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)','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','Failed\x20to\x20push\x20agent:\x20','projectName','agent:pull','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','\x0aError:','pushProject','23058rjtdbj','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','push','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','outputPath','Would\x20push\x20agent:\x20','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','llm','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','Dry\x20run\x20-\x20no\x20files\x20written','Agent\x20pulled\x20successfully','Project\x20cloned\x20successfully','241027REQhaY','Cancelled','\x0a✔\x20Pulled\x20','knowledgeBases','yes','Using\x20context\x20project:\x20','\x20unchanged','\x20\x20Target:\x20','new','124145ovUqUc','\x20updated','site','cloneProject','\x20\x20Integration\x20\x22','prompts','yellow','\x20new','\x20successfully','dim','dryRun','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','total','found','\x20errors','diff','description','16JijLPi','agent.yml','agentName','\x20\x20Text\x20Knowledge\x20Bases:\x20','\x20\x20Agents:\x20','MISSING_ARGUMENT','23485286ZTiFTo','Analyzing\x20changes\x20to\x20push...','Analyzing\x20project\x20\x22','Pushing\x20to\x20project...','927384nNtcGQ','272xiDgtZ','✔\x20Context\x20set:\x20','pullAgent','Pushing\x20agent\x20from\x20\x22','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','Errors:','\x0aErrors\x20found:','170yNgEdk','Source:\x20','hasChanges','Output\x20path:\x20','\x20\x20Experimental\x20Artifacts:\x20','tdx.json','46245qNONPR','\x22\x20to\x20\x22','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','Writing\x20files...','Chat:\x20','no_local_folder','cwd','Would\x20clone:','Would\x20pull\x20agent:\x20','\x0aProject\x20pushed\x20with\x20errors','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','-\x20no\x20files\x20written','\x20--name\x20','agentId','sourceProjectName','Project:\x20','force','unchanged','no_context','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','textKnowledgeBases','\x20\x20tdx\x20agent\x20clone\x20agents/','4132209hufUPb','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','\x0aChanges\x20to\x20integration\x20\x27','newProjectName','\x20|\x20','Using\x20local\x20project:\x20','action','\x0a✔\x20Pushed\x20','582bVYVSE','New\x20project\x20ID:\x20','\x20created','llmProject','Summary:','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','log','reason','projectId','cyan','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','updated','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','\x20\x20Knowledge\x20Base\x20\x22','outputDir','pullProject','green','integrations','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','\x20changed','error','\x20--profile\x20','\x20=\x20','Project\x20cloned\x20with\x20errors','\x0aChanges\x20to\x20agent\x20\x27','\x22...','\x20\x20Source:\x20','\x20\x20Knowledge\x20Bases:\x20','newProjectId','Agent\x20','message','Pulling\x20agent\x20\x22','agents','gray','errors','source','Cannot\x20clone\x20from\x20context\x20project\x20\x22','\x20\x20Prompts:\x20','\x0aPush\x20','session','repeat','red','New\x20project:\x20','No\x20tdx.json\x20found\x20in\x20','counts','New\x20project\x20name\x20is\x20required','\x0aPush\x20summary\x20for\x20\x27','experimentalKnowledgeBases','name','\x20\x20Integrations:\x20','\x22\x20to\x20a\x20different\x20profile','\x20\x20Experimental\x20Artifact\x20\x22','llm_project','\x22\x20to\x20new\x20project\x20\x22','created','\x0aPull\x20summary\x20for\x20\x27','\x22:\x20','dirname','utf-8','Using\x20current\x20project:\x20','Using\x20project\x20from\x20','context','Using\x20project:\x20','pushAgent','\x0aChanges\x20to\x20prompt\x20\x27','\x20\x20Prompt\x20\x22','\x0aWrite\x20','\x20\x20Experimental\x20Knowledge\x20Bases:\x20'];a4_0xb399=function(){return _0x1b033d;};return a4_0xb399();}function a4_0x173b(_0x5ecf81,_0x2c8e95){_0x5ecf81=_0x5ecf81-0x8c;const _0xb399d0=a4_0xb399();let _0x173ba1=_0xb399d0[_0x5ecf81];return _0x173ba1;}import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x4f536b){const _0xc3672e=a4_0x173b,_0x4abf57=[];if(_0x4f536b[_0xc3672e(0xd0)]!==undefined)_0x4abf57['push'](_0x4f536b[_0xc3672e(0xd0)]+'\x20total');if(_0x4f536b[_0xc3672e(0xc3)]!==undefined&&_0x4f536b['new']>0x0)_0x4abf57[_0xc3672e(0xb1)](a4_0x51ad2e[_0xc3672e(0x11b)](_0x4f536b[_0xc3672e(0xc3)]+'\x20new'));if(_0x4f536b[_0xc3672e(0x8d)]!==undefined&&_0x4f536b[_0xc3672e(0x8d)]>0x0)_0x4abf57[_0xc3672e(0xb1)](a4_0x51ad2e[_0xc3672e(0x11b)](_0x4f536b['created']+_0xc3672e(0x10d)));if(_0x4f536b['updated']!==undefined&&_0x4f536b[_0xc3672e(0x116)]>0x0)_0x4abf57[_0xc3672e(0xb1)](a4_0x51ad2e[_0xc3672e(0xca)](_0x4f536b[_0xc3672e(0x116)]+_0xc3672e(0xc5)));if(_0x4f536b['unchanged']!==undefined&&_0x4f536b[_0xc3672e(0xfe)]>0x0)_0x4abf57[_0xc3672e(0xb1)](a4_0x51ad2e['gray'](_0x4f536b[_0xc3672e(0xfe)]+_0xc3672e(0xc1)));if(_0x4f536b[_0xc3672e(0x12d)]!==undefined&&_0x4f536b[_0xc3672e(0x12d)]>0x0)_0x4abf57[_0xc3672e(0xb1)](a4_0x51ad2e[_0xc3672e(0x134)](_0x4f536b[_0xc3672e(0x12d)]+_0xc3672e(0xd2)));return _0x4abf57[_0xc3672e(0xa0)](',\x20');}function displayDiffs(_0x1ded88,_0x3bab3a,_0x2be646,_0x141ee1,_0xa2fcf9,_0x2356c6,_0xbe6080){const _0x25121f=a4_0x173b;for(const _0x2ae0cb of _0x1ded88){if(_0x2ae0cb[_0x25121f(0xd3)]){const _0x4d1048=_0x2ae0cb[_0x25121f(0xd7)]||_0x2ae0cb[_0x25121f(0x13b)];console[_0x25121f(0x111)](_0x25121f(0x123)+_0x4d1048+'\x27:'),console[_0x25121f(0x111)]('─'[_0x25121f(0x133)](0x3c)),console['log'](_0x2ae0cb[_0x25121f(0xd3)]),console[_0x25121f(0x111)]('─'['repeat'](0x3c));}}for(const _0x27702c of _0x3bab3a){_0x27702c[_0x25121f(0xd3)]&&(console[_0x25121f(0x111)](_0x25121f(0x104)+_0x27702c[_0x25121f(0x13b)]+'\x27:'),console[_0x25121f(0x111)]('─'[_0x25121f(0x133)](0x3c)),console[_0x25121f(0x111)](_0x27702c[_0x25121f(0xd3)]),console[_0x25121f(0x111)]('─'[_0x25121f(0x133)](0x3c)));}for(const _0xf8abd of _0x2be646){_0xf8abd[_0x25121f(0xd3)]&&(console['log'](_0x25121f(0xb0)+_0xf8abd['name']+'\x27:'),console['log']('─'['repeat'](0x3c)),console[_0x25121f(0x111)](_0xf8abd['diff']),console[_0x25121f(0x111)]('─'[_0x25121f(0x133)](0x3c)));}for(const _0x5222a0 of _0x141ee1){_0x5222a0[_0x25121f(0xd3)]&&(console['log'](_0x25121f(0x97)+_0x5222a0[_0x25121f(0x13b)]+'\x27:'),console[_0x25121f(0x111)]('─'[_0x25121f(0x133)](0x3c)),console[_0x25121f(0x111)](_0x5222a0['diff']),console[_0x25121f(0x111)]('─'[_0x25121f(0x133)](0x3c)));}for(const _0xbf7362 of _0xa2fcf9){_0xbf7362[_0x25121f(0xd3)]&&(console[_0x25121f(0x111)](_0x25121f(0x105)+_0xbf7362[_0x25121f(0x13b)]+'\x27:'),console[_0x25121f(0x111)]('─'[_0x25121f(0x133)](0x3c)),console['log'](_0xbf7362[_0x25121f(0xd3)]),console[_0x25121f(0x111)]('─'[_0x25121f(0x133)](0x3c)));}for(const _0x5a553e of _0x2356c6){_0x5a553e[_0x25121f(0xd3)]&&(console['log'](_0x25121f(0xef)+_0x5a553e[_0x25121f(0x13b)]+'\x27:'),console['log']('─'[_0x25121f(0x133)](0x3c)),console[_0x25121f(0x111)](_0x5a553e[_0x25121f(0xd3)]),console['log']('─'[_0x25121f(0x133)](0x3c)));}for(const _0xbd6801 of _0xbe6080){_0xbd6801[_0x25121f(0xd3)]&&(console['log'](_0x25121f(0x11d)+_0xbd6801['name']+'\x27:'),console['log']('─'[_0x25121f(0x133)](0x3c)),console['log'](_0xbd6801['diff']),console[_0x25121f(0x111)]('─'['repeat'](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x266ed6(0x13b)]=a4_0x266ed6(0xab);[a4_0x266ed6(0xd4)]=a4_0x266ed6(0xb5);async[a4_0x266ed6(0xa1)](_0x3e17c9){const _0x3320d7=a4_0x266ed6,{options:_0x567d27,args:_0x5eefe6,tdx:_0x1a0f2d}=_0x3e17c9,_0x160ea1=_0x5eefe6[0x0],_0x1bcf69=_0x5eefe6[0x1],_0xfc93ce=_0x567d27['output'],_0x22688b=_0x567d27[_0x3320d7(0xce)],_0x4506b4=_0x567d27[_0x3320d7(0xfd)],_0x2c8d14=_0x567d27['yes'],_0x2a8633=_0x567d27[_0x3320d7(0x10e)];let _0x1012e2,_0x22696e;const _0x373cbc=findAgentConfigPath(process[_0x3320d7(0xf3)]());if(_0x160ea1){const _0x533c69=a4_0x53d24e[_0x3320d7(0xa0)](_0x160ea1,'tdx.json');if(existsSync(_0x533c69))try{const _0x20bc70=JSON['parse'](readFileSync(_0x533c69,'utf-8'));_0x1012e2=_0x20bc70[_0x3320d7(0x13f)],_0x22696e=_0x160ea1,console['log'](a4_0x51ad2e['dim'](_0x3320d7(0x93)+_0x533c69+':\x20'+_0x1012e2));}catch{_0x1012e2=_0x160ea1;}else _0x1012e2=_0x160ea1;}else{if(_0x373cbc)try{const _0x26209b=JSON[_0x3320d7(0xa4)](readFileSync(_0x373cbc,_0x3320d7(0x91)));_0x1012e2=_0x26209b['llm_project'],_0x22696e=a4_0x53d24e[_0x3320d7(0x90)](_0x373cbc),console[_0x3320d7(0x111)](a4_0x51ad2e[_0x3320d7(0xcd)](_0x3320d7(0x95)+_0x1012e2));}catch{_0x1012e2=_0x2a8633;}else _0x1012e2=_0x2a8633;}if(!_0x1012e2)return console['log'](a4_0x51ad2e[_0x3320d7(0xca)]('llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a')),console[_0x3320d7(0x111)]('Usage:\x20tdx\x20agent\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20project\x20(requires\x20context\x20or\x20tdx.json)'),console[_0x3320d7(0x111)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project'),console[_0x3320d7(0x111)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory'),console[_0x3320d7(0x111)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20#\x20Pull\x20specific\x20agent'),0x1;if(_0x1bcf69){const {data:_0x163548}=await withSpinner(_0x3320d7(0x12a)+_0x1bcf69+'\x22\x20from\x20project\x20\x22'+_0x1012e2+_0x3320d7(0x124),()=>_0x1a0f2d[_0x3320d7(0xb6)][_0x3320d7(0xe2)](_0x1012e2,_0x1bcf69,_0xfc93ce,{'dryRun':_0x22688b,'force':_0x4506b4}));if(_0x22688b)return console[_0x3320d7(0x111)](a4_0x51ad2e[_0x3320d7(0xca)](_0x3320d7(0xb8))),console[_0x3320d7(0x111)](_0x3320d7(0xf5)+_0x163548[_0x3320d7(0xd7)]),console[_0x3320d7(0x111)](_0x3320d7(0xea)+_0x163548[_0x3320d7(0xb3)]),_0x163548['diff']&&(console[_0x3320d7(0x111)]('\x0aChanges:'),console[_0x3320d7(0x111)]('─'[_0x3320d7(0x133)](0x3c)),console[_0x3320d7(0x111)](_0x163548[_0x3320d7(0xd3)]),console['log']('─'[_0x3320d7(0x133)](0x3c))),0x0;return console[_0x3320d7(0x111)](a4_0x51ad2e['green'](_0x3320d7(0xb9))),console['log']('Agent:\x20'+_0x163548[_0x3320d7(0xd7)]),console[_0x3320d7(0x111)]('Output:\x20'+_0x163548[_0x3320d7(0xb3)]),console[_0x3320d7(0x111)](_0x3320d7(0x9b)+(_0x163548['isNew']?a4_0x51ad2e[_0x3320d7(0x11b)]('new'):_0x163548[_0x3320d7(0xe9)]?a4_0x51ad2e[_0x3320d7(0xca)]('updated'):a4_0x51ad2e[_0x3320d7(0x12c)](_0x3320d7(0xfe)))),0x0;}const _0x1102d2=_0x22696e||_0xfc93ce,{data:_0x2d9792}=await withSpinner(_0x3320d7(0xdd)+_0x1012e2+_0x3320d7(0x124),()=>_0x1a0f2d[_0x3320d7(0xb6)][_0x3320d7(0x11a)](_0x1012e2,_0x1102d2,{'dryRun':!![]})),_0x500f85=_0x2d9792[_0x3320d7(0x137)][_0x3320d7(0x12b)][_0x3320d7(0xc3)]+_0x2d9792[_0x3320d7(0x137)]['knowledgeBases'][_0x3320d7(0xc3)]+_0x2d9792[_0x3320d7(0x137)][_0x3320d7(0x101)][_0x3320d7(0xc3)]+_0x2d9792[_0x3320d7(0x137)][_0x3320d7(0xc9)][_0x3320d7(0xc3)]+_0x2d9792[_0x3320d7(0x137)][_0x3320d7(0x11c)]['new']+_0x2d9792[_0x3320d7(0x137)][_0x3320d7(0x13a)][_0x3320d7(0xc3)]+_0x2d9792[_0x3320d7(0x137)][_0x3320d7(0x9d)][_0x3320d7(0xc3)],_0x37e9ff=_0x2d9792['counts'][_0x3320d7(0x12b)][_0x3320d7(0x116)]+_0x2d9792[_0x3320d7(0x137)][_0x3320d7(0xbe)][_0x3320d7(0x116)]+_0x2d9792['counts'][_0x3320d7(0x101)][_0x3320d7(0x116)]+_0x2d9792[_0x3320d7(0x137)][_0x3320d7(0xc9)][_0x3320d7(0x116)]+_0x2d9792[_0x3320d7(0x137)][_0x3320d7(0x11c)][_0x3320d7(0x116)]+_0x2d9792[_0x3320d7(0x137)][_0x3320d7(0x13a)][_0x3320d7(0x116)]+_0x2d9792[_0x3320d7(0x137)][_0x3320d7(0x9d)]['updated'],_0x420409=_0x2d9792[_0x3320d7(0x137)][_0x3320d7(0x12b)]['unchanged']+_0x2d9792[_0x3320d7(0x137)][_0x3320d7(0xbe)]['unchanged']+_0x2d9792[_0x3320d7(0x137)]['textKnowledgeBases'][_0x3320d7(0xfe)]+_0x2d9792[_0x3320d7(0x137)][_0x3320d7(0xc9)][_0x3320d7(0xfe)]+_0x2d9792[_0x3320d7(0x137)][_0x3320d7(0x11c)][_0x3320d7(0xfe)]+_0x2d9792['counts']['experimentalKnowledgeBases']['unchanged']+_0x2d9792[_0x3320d7(0x137)][_0x3320d7(0x9d)][_0x3320d7(0xfe)];console[_0x3320d7(0x111)](_0x3320d7(0x8e)+_0x2d9792[_0x3320d7(0xaa)]+'\x27:'),console[_0x3320d7(0x111)]('\x20\x20'+a4_0x51ad2e[_0x3320d7(0x11b)]('+\x20'+_0x500f85+_0x3320d7(0xcb))+_0x3320d7(0x107)+a4_0x51ad2e[_0x3320d7(0xca)]('~\x20'+_0x37e9ff+_0x3320d7(0x11e))+_0x3320d7(0x107)+a4_0x51ad2e['dim']('=\x20'+_0x420409+'\x20unchanged')),console['log'](_0x3320d7(0xd9)+formatCountSummary(_0x2d9792[_0x3320d7(0x137)][_0x3320d7(0x12b)])),console[_0x3320d7(0x111)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x2d9792[_0x3320d7(0x137)]['knowledgeBases'])),console[_0x3320d7(0x111)](_0x3320d7(0xd8)+formatCountSummary(_0x2d9792[_0x3320d7(0x137)][_0x3320d7(0x101)])),console[_0x3320d7(0x111)](_0x3320d7(0x130)+formatCountSummary(_0x2d9792[_0x3320d7(0x137)][_0x3320d7(0xc9)])),console[_0x3320d7(0x111)](_0x3320d7(0x13c)+formatCountSummary(_0x2d9792[_0x3320d7(0x137)][_0x3320d7(0x11c)]));const _0x5e260a=_0x2d9792[_0x3320d7(0x137)]['experimentalKnowledgeBases'][_0x3320d7(0xd0)]>0x0||_0x2d9792['counts'][_0x3320d7(0x9d)][_0x3320d7(0xd0)]>0x0;_0x5e260a&&(console[_0x3320d7(0x111)](_0x3320d7(0x9a)+formatCountSummary(_0x2d9792[_0x3320d7(0x137)][_0x3320d7(0x13a)])),console['log'](_0x3320d7(0xeb)+formatCountSummary(_0x2d9792[_0x3320d7(0x137)][_0x3320d7(0x9d)])));console['log'](_0x3320d7(0xc2)+a4_0x51ad2e[_0x3320d7(0x114)](_0x2d9792['outputDir'])),displayDiffs(_0x2d9792[_0x3320d7(0x12b)],_0x2d9792[_0x3320d7(0xbe)],_0x2d9792['textKnowledgeBases'],_0x2d9792[_0x3320d7(0xc9)],_0x2d9792['integrations'],_0x2d9792['experimentalKnowledgeBases'],_0x2d9792['experimentalArtifacts']);if(_0x22688b)return console[_0x3320d7(0x111)](a4_0x51ad2e[_0x3320d7(0xca)](_0x3320d7(0xa7))),0x0;if(_0x500f85===0x0&&_0x37e9ff===0x0)return console[_0x3320d7(0x111)](a4_0x51ad2e[_0x3320d7(0x11b)]('\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'llm_project':_0x2d9792[_0x3320d7(0xaa)]},_0x567d27[_0x3320d7(0x132)]),console['log'](a4_0x51ad2e[_0x3320d7(0x11b)](_0x3320d7(0xe1)+a4_0x51ad2e[_0x3320d7(0xcd)](_0x3320d7(0x13f))+_0x3320d7(0x121)+a4_0x51ad2e[_0x3320d7(0x114)](_0x2d9792[_0x3320d7(0xaa)]))),0x0;if(!_0x2c8d14&&!_0x4506b4){if(!isInteractive())return console[_0x3320d7(0x11f)](a4_0x51ad2e[_0x3320d7(0x134)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x3320d7(0x11f)](a4_0x51ad2e[_0x3320d7(0xcd)](_0x3320d7(0x115))),0x1;const _0x574d92=await confirmKey(_0x3320d7(0x99)+(_0x500f85+_0x37e9ff)+_0x3320d7(0xa5));if(!_0x574d92)return console[_0x3320d7(0x111)](a4_0x51ad2e[_0x3320d7(0xca)](_0x3320d7(0xbc)),_0x3320d7(0xf8)),0x1;}const {data:_0x28f4f5}=await withSpinner(_0x3320d7(0xf0),()=>_0x1a0f2d[_0x3320d7(0xb6)]['pullProject'](_0x1012e2,_0x1102d2,{'force':_0x4506b4}));return console['log'](a4_0x51ad2e[_0x3320d7(0x11b)](_0x3320d7(0xbd)+(_0x500f85+_0x37e9ff)+'\x20files\x20to\x20'+_0x28f4f5[_0x3320d7(0x119)])),saveSessionContext({'llm_project':_0x28f4f5[_0x3320d7(0xaa)]},_0x567d27['session']),console[_0x3320d7(0x111)](a4_0x51ad2e['green'](_0x3320d7(0xe1)+a4_0x51ad2e[_0x3320d7(0xcd)](_0x3320d7(0x13f))+_0x3320d7(0x121)+a4_0x51ad2e[_0x3320d7(0x114)](_0x28f4f5[_0x3320d7(0xaa)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x266ed6(0x13b)]='agent:clone';['description']=a4_0x266ed6(0xcf);async[a4_0x266ed6(0xa1)](_0x32325e){const _0x167934=a4_0x266ed6,{options:_0xab88fb,args:_0x1405a6,tdx:_0x49bc1b}=_0x32325e,_0x15fadb=_0x1405a6[0x0],_0x43317f=_0xab88fb['name'],_0x106324=_0xab88fb[_0x167934(0xce)],_0x2fd414=_0xab88fb[_0x167934(0xbf)],_0x52d5fc=_0xab88fb[_0x167934(0xc6)],_0x47aa0b=_0xab88fb[_0x167934(0x10e)];let _0x99ff21;const _0x432863=findAgentConfigPath(process[_0x167934(0xf3)]());if(_0x15fadb){const _0x2be10d=a4_0x53d24e[_0x167934(0xa0)](_0x15fadb,_0x167934(0xec));existsSync(_0x2be10d)?(_0x99ff21=_0x15fadb,console[_0x167934(0x111)](a4_0x51ad2e[_0x167934(0xcd)](_0x167934(0x108)+_0x15fadb))):_0x99ff21=_0x15fadb;}else{if(_0x432863)_0x99ff21=a4_0x53d24e[_0x167934(0x90)](_0x432863),console[_0x167934(0x111)](a4_0x51ad2e['dim'](_0x167934(0x92)+_0x99ff21));else{if(_0x47aa0b){const _0x56a3db=sanitizeForFilesystem(_0x47aa0b);let _0x22021a=_0x56a3db,_0x13e4e8=a4_0x53d24e[_0x167934(0xa0)](process['cwd'](),_0x167934(0x12b),_0x56a3db,'tdx.json');if(!existsSync(_0x13e4e8)){const _0x148aa6=normalizeName(_0x47aa0b),_0x26a5b9=a4_0x53d24e[_0x167934(0xa0)](process[_0x167934(0xf3)](),_0x167934(0x12b),_0x148aa6,_0x167934(0xec));existsSync(_0x26a5b9)&&(_0x22021a=_0x148aa6,_0x13e4e8=_0x26a5b9);}if(existsSync(_0x13e4e8))_0x99ff21=a4_0x53d24e['dirname'](_0x13e4e8),console[_0x167934(0x111)](a4_0x51ad2e[_0x167934(0xcd)]('Using\x20local\x20project:\x20'+_0x99ff21));else{const _0x45a7a7=_0xab88fb['profile'];if(_0x45a7a7)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x167934(0x12f)+_0x47aa0b+_0x167934(0x13d),undefined,{'helpText':_0x167934(0x117)+'First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a'+(_0x167934(0xa3)+_0x47aa0b+'\x0a')+(_0x167934(0x102)+_0x22021a+_0x167934(0xf9)+(_0x43317f||'<new-name>')+_0x167934(0x120)+_0x45a7a7)});_0x99ff21=_0x47aa0b,console[_0x167934(0x111)](a4_0x51ad2e['dim'](_0x167934(0xc0)+_0x47aa0b));}}}}if(!_0x99ff21)return console['log'](a4_0x51ad2e[_0x167934(0xca)](_0x167934(0xb2))),console[_0x167934(0x111)]('\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project'),console[_0x167934(0x111)](_0x167934(0xe4)),console['log'](_0x167934(0xa6)),console['log']('\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>'),0x1;if(!_0x43317f)throw new SDKError(ErrorCode[_0x167934(0xda)],_0x167934(0x138),undefined,{'helpText':_0x167934(0xa8)});if(!_0x2fd414&&!_0x106324){if(!isInteractive())return console[_0x167934(0x11f)](a4_0x51ad2e[_0x167934(0x134)]('\x0aError:'),_0x167934(0x9e)),console[_0x167934(0x11f)](a4_0x51ad2e['dim'](_0x167934(0x115))),0x1;const _0x38144e=await confirmKey('Clone\x20\x22'+_0x99ff21+_0x167934(0x8c)+_0x43317f+'\x22?');if(!_0x38144e)return console[_0x167934(0x111)](a4_0x51ad2e[_0x167934(0xca)](_0x167934(0xbc))),0x1;}const {data:_0x2c3d17}=await withSpinner(_0x167934(0x9c)+_0x99ff21+_0x167934(0xee)+_0x43317f+_0x167934(0x124),()=>_0x49bc1b[_0x167934(0xb6)][_0x167934(0xc7)](_0x99ff21,_0x43317f,{'dryRun':_0x106324}));if(_0x106324){console[_0x167934(0x111)](a4_0x51ad2e['yellow']('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x167934(0x111)](_0x167934(0xe8)+_0x2c3d17[_0x167934(0xfb)]),console[_0x167934(0x111)](_0x167934(0x135)+_0x43317f),console['log'](_0x167934(0xf4)),console['log'](_0x167934(0xd9)+_0x2c3d17[_0x167934(0x137)][_0x167934(0x12b)][_0x167934(0x8d)]),console[_0x167934(0x111)]('\x20\x20Knowledge\x20Bases:\x20'+_0x2c3d17[_0x167934(0x137)][_0x167934(0xbe)]['created']),console[_0x167934(0x111)](_0x167934(0x130)+_0x2c3d17[_0x167934(0x137)][_0x167934(0xc9)]['created']);const _0x42376b=_0x2c3d17[_0x167934(0x137)]['experimentalKnowledgeBases'][_0x167934(0x8d)]>0x0||_0x2c3d17[_0x167934(0x137)][_0x167934(0x9d)][_0x167934(0x8d)]>0x0;return _0x42376b&&(console['log']('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+_0x2c3d17[_0x167934(0x137)][_0x167934(0x13a)]['created']),console['log'](_0x167934(0xeb)+_0x2c3d17[_0x167934(0x137)]['experimentalArtifacts']['created'])),0x0;}const _0x58aff6=_0x2c3d17[_0x167934(0x137)]['agents'][_0x167934(0x12d)]>0x0||_0x2c3d17[_0x167934(0x137)][_0x167934(0xbe)][_0x167934(0x12d)]>0x0||_0x2c3d17['counts']['prompts'][_0x167934(0x12d)]>0x0||_0x2c3d17[_0x167934(0x137)][_0x167934(0x13a)][_0x167934(0x12d)]>0x0||_0x2c3d17['counts'][_0x167934(0x9d)][_0x167934(0x12d)]>0x0;_0x58aff6?console[_0x167934(0x111)](a4_0x51ad2e[_0x167934(0xca)](_0x167934(0x122))):console['log'](a4_0x51ad2e[_0x167934(0x11b)](_0x167934(0xba)));console[_0x167934(0x111)](_0x167934(0xe8)+_0x2c3d17[_0x167934(0xfb)]),console[_0x167934(0x111)]('New\x20project:\x20'+_0x2c3d17[_0x167934(0x106)]),console['log'](_0x167934(0x10c)+_0x2c3d17[_0x167934(0x127)]),console[_0x167934(0x111)](),console[_0x167934(0x111)](_0x167934(0x10f)),console[_0x167934(0x111)](_0x167934(0xd9)+formatCountSummary(_0x2c3d17[_0x167934(0x137)][_0x167934(0x12b)])),console[_0x167934(0x111)](_0x167934(0x126)+formatCountSummary(_0x2c3d17[_0x167934(0x137)][_0x167934(0xbe)])),console['log']('\x20\x20Prompts:\x20'+formatCountSummary(_0x2c3d17[_0x167934(0x137)][_0x167934(0xc9)])),console[_0x167934(0x111)](_0x167934(0x13c)+formatCountSummary(_0x2c3d17['counts'][_0x167934(0x11c)]));const _0x35b633=_0x2c3d17['counts'][_0x167934(0x13a)]['created']>0x0||_0x2c3d17[_0x167934(0x137)]['experimentalKnowledgeBases'][_0x167934(0x116)]>0x0||_0x2c3d17['counts']['experimentalKnowledgeBases'][_0x167934(0xfe)]>0x0||_0x2c3d17[_0x167934(0x137)][_0x167934(0x9d)][_0x167934(0x8d)]>0x0||_0x2c3d17[_0x167934(0x137)]['experimentalArtifacts'][_0x167934(0x116)]>0x0||_0x2c3d17[_0x167934(0x137)]['experimentalArtifacts'][_0x167934(0xfe)]>0x0;_0x35b633&&(console[_0x167934(0x111)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x2c3d17[_0x167934(0x137)][_0x167934(0x13a)])),console['log'](_0x167934(0xeb)+formatCountSummary(_0x2c3d17['counts']['experimentalArtifacts'])));if(_0x58aff6){console[_0x167934(0x111)](),console[_0x167934(0x111)](a4_0x51ad2e['red'](_0x167934(0xe5)));for(const _0x51a3f6 of _0x2c3d17['agents']){_0x51a3f6[_0x167934(0x109)]===_0x167934(0x11f)&&console['log'](a4_0x51ad2e[_0x167934(0x134)](_0x167934(0xa2)+_0x51a3f6[_0x167934(0xd7)]+_0x167934(0x8f)+_0x51a3f6[_0x167934(0x11f)]));}for(const _0x150cd5 of _0x2c3d17[_0x167934(0xbe)]){_0x150cd5['action']==='error'&&console[_0x167934(0x111)](a4_0x51ad2e['red']('\x20\x20Knowledge\x20Base\x20\x22'+_0x150cd5['name']+_0x167934(0x8f)+_0x150cd5['error']));}for(const _0x54bc6f of _0x2c3d17[_0x167934(0xc9)]){_0x54bc6f['action']===_0x167934(0x11f)&&console[_0x167934(0x111)](a4_0x51ad2e[_0x167934(0x134)](_0x167934(0x98)+_0x54bc6f[_0x167934(0x13b)]+_0x167934(0x8f)+_0x54bc6f[_0x167934(0x11f)]));}for(const _0x422f62 of _0x2c3d17[_0x167934(0x11c)]){_0x422f62['action']===_0x167934(0x11f)&&console[_0x167934(0x111)](a4_0x51ad2e['red'](_0x167934(0xc8)+_0x422f62[_0x167934(0x13b)]+'\x22:\x20'+_0x422f62[_0x167934(0x11f)]));}for(const _0xf35ff4 of _0x2c3d17[_0x167934(0x13a)]){_0xf35ff4[_0x167934(0x109)]===_0x167934(0x11f)&&console['log'](a4_0x51ad2e['red'](_0x167934(0xb7)+_0xf35ff4['name']+_0x167934(0x8f)+_0xf35ff4['error']));}for(const _0x2ebca6 of _0x2c3d17[_0x167934(0x9d)]){_0x2ebca6[_0x167934(0x109)]===_0x167934(0x11f)&&console[_0x167934(0x111)](a4_0x51ad2e[_0x167934(0x134)](_0x167934(0x13e)+_0x2ebca6[_0x167934(0x13b)]+_0x167934(0x8f)+_0x2ebca6[_0x167934(0x11f)]));}return 0x1;}console[_0x167934(0x111)]();const _0x264671=getLLMProjectUrl(_0x52d5fc,_0x2c3d17['newProjectId']);return console[_0x167934(0x111)](_0x167934(0xfc)+a4_0x51ad2e[_0x167934(0x114)](_0x264671)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x266ed6(0x13b)]=a4_0x266ed6(0x9f);[a4_0x266ed6(0xd4)]='Push\x20local\x20agent\x20files\x20to\x20LLM\x20project';async[a4_0x266ed6(0xa1)](_0x21ee5b){const _0x45d6f6=a4_0x266ed6,{options:_0x374b5a,args:_0x113ebc,tdx:_0x330062}=_0x21ee5b;let _0x47a256=_0x113ebc[0x0]||process['cwd']();const _0x5e24e0=_0x374b5a['dryRun'],_0x6c3886=_0x374b5a[_0x45d6f6(0xfd)],_0x569e1f=_0x374b5a[_0x45d6f6(0xbf)],_0x11815a=_0x374b5a[_0x45d6f6(0xc6)],_0x52db83=a4_0x53d24e[_0x45d6f6(0xa0)](_0x47a256,_0x45d6f6(0xd6)),_0x209cd4=existsSync(_0x52db83);if(_0x209cd4){const {data:_0x3a6bcc}=await withSpinner(_0x45d6f6(0xe3)+_0x47a256+_0x45d6f6(0x124),()=>_0x330062[_0x45d6f6(0xb6)][_0x45d6f6(0x96)](_0x47a256,{'dryRun':_0x5e24e0,'force':_0x6c3886}));if(_0x5e24e0)return console[_0x45d6f6(0x111)](a4_0x51ad2e[_0x45d6f6(0xca)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x45d6f6(0x111)](_0x45d6f6(0xb4)+_0x3a6bcc[_0x45d6f6(0xd7)]),0x0;if(_0x3a6bcc[_0x45d6f6(0x109)]==='error')return console[_0x45d6f6(0x111)](a4_0x51ad2e[_0x45d6f6(0x134)](_0x45d6f6(0xa9)+_0x3a6bcc[_0x45d6f6(0x11f)])),0x1;console['log'](a4_0x51ad2e[_0x45d6f6(0x11b)](_0x45d6f6(0x128)+_0x3a6bcc[_0x45d6f6(0x109)]+_0x45d6f6(0xcc))),console['log']('Agent:\x20'+_0x3a6bcc[_0x45d6f6(0xd7)]);if(_0x3a6bcc[_0x45d6f6(0xfa)]&&_0x3a6bcc[_0x45d6f6(0x113)]){const _0x487a78=getLLMAgentChatUrl(_0x11815a,_0x3a6bcc['projectId'],_0x3a6bcc['agentId']);console[_0x45d6f6(0x111)](_0x45d6f6(0xf1)+a4_0x51ad2e[_0x45d6f6(0x114)](_0x487a78));}return 0x0;}const _0x515694=_0x374b5a[_0x45d6f6(0x10e)],_0x569f43=resolveProjectFromContext(_0x47a256,_0x515694);if(_0x569f43[_0x45d6f6(0xd1)])_0x47a256=_0x569f43['projectDir'],_0x569f43[_0x45d6f6(0x12e)]===_0x45d6f6(0x94)&&console['log'](a4_0x51ad2e[_0x45d6f6(0xcd)](_0x45d6f6(0x95)+_0x47a256));else{let _0x269832=_0x45d6f6(0x110);_0x569f43[_0x45d6f6(0x112)]===_0x45d6f6(0xf2)&&(_0x269832=_0x569f43[_0x45d6f6(0x129)]+_0x45d6f6(0x100)+_0x569f43[_0x45d6f6(0x10e)]+'\x27\x20to\x20create\x20the\x20folder\x20structure.');throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x569f43[_0x45d6f6(0x112)]===_0x45d6f6(0xff)?_0x569f43[_0x45d6f6(0x129)]:_0x45d6f6(0x136)+_0x47a256,undefined,{'helpText':_0x269832});}const {data:_0x4f9496}=await withSpinner(_0x45d6f6(0xdc),()=>_0x330062[_0x45d6f6(0xb6)][_0x45d6f6(0xae)](_0x47a256,{'dryRun':!![]})),_0x1a9645=_0x4f9496[_0x45d6f6(0x137)][_0x45d6f6(0x12b)][_0x45d6f6(0x12d)]>0x0;if(_0x1a9645){console[_0x45d6f6(0x111)](a4_0x51ad2e[_0x45d6f6(0x134)](_0x45d6f6(0xe6)));for(const _0x327125 of _0x4f9496[_0x45d6f6(0x12b)]){_0x327125[_0x45d6f6(0x109)]==='error'&&console['log'](a4_0x51ad2e['red']('\x20\x20Agent\x20\x22'+_0x327125[_0x45d6f6(0xd7)]+_0x45d6f6(0x8f)+_0x327125[_0x45d6f6(0x11f)]));}return 0x1;}const _0x540b2c=_0x4f9496['counts'][_0x45d6f6(0x12b)][_0x45d6f6(0x8d)]+_0x4f9496[_0x45d6f6(0x137)][_0x45d6f6(0xbe)]['created']+_0x4f9496['counts']['textKnowledgeBases'][_0x45d6f6(0x8d)]+_0x4f9496['counts'][_0x45d6f6(0xc9)]['created']+_0x4f9496[_0x45d6f6(0x137)][_0x45d6f6(0x11c)][_0x45d6f6(0x8d)]+_0x4f9496[_0x45d6f6(0x137)]['experimentalKnowledgeBases']['created']+_0x4f9496[_0x45d6f6(0x137)][_0x45d6f6(0x9d)]['created'],_0x376418=_0x4f9496[_0x45d6f6(0x137)][_0x45d6f6(0x12b)][_0x45d6f6(0x116)]+_0x4f9496['counts'][_0x45d6f6(0xbe)][_0x45d6f6(0x116)]+_0x4f9496[_0x45d6f6(0x137)]['textKnowledgeBases'][_0x45d6f6(0x116)]+_0x4f9496[_0x45d6f6(0x137)][_0x45d6f6(0xc9)]['updated']+_0x4f9496[_0x45d6f6(0x137)]['integrations']['updated']+_0x4f9496['counts'][_0x45d6f6(0x13a)][_0x45d6f6(0x116)]+_0x4f9496[_0x45d6f6(0x137)][_0x45d6f6(0x9d)][_0x45d6f6(0x116)],_0x4dc5cb=_0x4f9496[_0x45d6f6(0x137)][_0x45d6f6(0x12b)][_0x45d6f6(0xfe)]+_0x4f9496[_0x45d6f6(0x137)]['knowledgeBases'][_0x45d6f6(0xfe)]+_0x4f9496[_0x45d6f6(0x137)][_0x45d6f6(0x101)][_0x45d6f6(0xfe)]+_0x4f9496['counts'][_0x45d6f6(0xc9)]['unchanged']+_0x4f9496['counts'][_0x45d6f6(0x11c)][_0x45d6f6(0xfe)]+_0x4f9496[_0x45d6f6(0x137)][_0x45d6f6(0x13a)][_0x45d6f6(0xfe)]+_0x4f9496[_0x45d6f6(0x137)][_0x45d6f6(0x9d)][_0x45d6f6(0xfe)];console[_0x45d6f6(0x111)](_0x45d6f6(0x139)+_0x4f9496[_0x45d6f6(0xaa)]+'\x27:'),console[_0x45d6f6(0x111)]('\x20\x20'+a4_0x51ad2e[_0x45d6f6(0x11b)]('+\x20'+_0x540b2c+_0x45d6f6(0xcb))+'\x20|\x20'+a4_0x51ad2e[_0x45d6f6(0xca)]('~\x20'+_0x376418+_0x45d6f6(0x11e))+'\x20|\x20'+a4_0x51ad2e[_0x45d6f6(0xcd)]('=\x20'+_0x4dc5cb+_0x45d6f6(0xc1))),console['log']('\x20\x20Agents:\x20'+formatCountSummary(_0x4f9496['counts'][_0x45d6f6(0x12b)])),console[_0x45d6f6(0x111)](_0x45d6f6(0x126)+formatCountSummary(_0x4f9496['counts'][_0x45d6f6(0xbe)])),console[_0x45d6f6(0x111)](_0x45d6f6(0xd8)+formatCountSummary(_0x4f9496[_0x45d6f6(0x137)]['textKnowledgeBases'])),console['log'](_0x45d6f6(0x130)+formatCountSummary(_0x4f9496[_0x45d6f6(0x137)][_0x45d6f6(0xc9)])),console['log'](_0x45d6f6(0x13c)+formatCountSummary(_0x4f9496[_0x45d6f6(0x137)][_0x45d6f6(0x11c)]));const _0x5bbd62=_0x4f9496[_0x45d6f6(0x137)]['experimentalKnowledgeBases'][_0x45d6f6(0x8d)]>0x0||_0x4f9496[_0x45d6f6(0x137)][_0x45d6f6(0x13a)]['updated']>0x0||_0x4f9496['counts'][_0x45d6f6(0x13a)][_0x45d6f6(0xfe)]>0x0||_0x4f9496[_0x45d6f6(0x137)][_0x45d6f6(0x9d)][_0x45d6f6(0x8d)]>0x0||_0x4f9496[_0x45d6f6(0x137)][_0x45d6f6(0x9d)]['updated']>0x0||_0x4f9496['counts'][_0x45d6f6(0x9d)][_0x45d6f6(0xfe)]>0x0;_0x5bbd62&&(console[_0x45d6f6(0x111)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x4f9496[_0x45d6f6(0x137)]['experimentalKnowledgeBases'])),console['log'](_0x45d6f6(0xeb)+formatCountSummary(_0x4f9496['counts'][_0x45d6f6(0x9d)])));console[_0x45d6f6(0x111)](_0x45d6f6(0x125)+a4_0x51ad2e[_0x45d6f6(0x114)](_0x47a256)),displayDiffs(_0x4f9496[_0x45d6f6(0x12b)],_0x4f9496[_0x45d6f6(0xbe)],_0x4f9496['textKnowledgeBases'],_0x4f9496[_0x45d6f6(0xc9)],_0x4f9496[_0x45d6f6(0x11c)],_0x4f9496[_0x45d6f6(0x13a)],_0x4f9496[_0x45d6f6(0x9d)]);if(_0x5e24e0)return console[_0x45d6f6(0x111)](a4_0x51ad2e[_0x45d6f6(0xca)](_0x45d6f6(0xac))),0x0;if(_0x540b2c===0x0&&_0x376418===0x0){console[_0x45d6f6(0x111)](a4_0x51ad2e[_0x45d6f6(0x11b)](_0x45d6f6(0xf7)));const _0x1117d1=getLLMProjectUrl(_0x11815a,_0x4f9496[_0x45d6f6(0x113)]);return console[_0x45d6f6(0x111)](_0x45d6f6(0xfc)+a4_0x51ad2e['cyan'](_0x1117d1)),0x0;}if(!_0x569e1f&&!_0x6c3886){if(!isInteractive())return console[_0x45d6f6(0x11f)](a4_0x51ad2e['red'](_0x45d6f6(0xad)),_0x45d6f6(0x9e)),console[_0x45d6f6(0x11f)](a4_0x51ad2e[_0x45d6f6(0xcd)](_0x45d6f6(0x115))),0x1;const _0x5e9055=await confirmKey(_0x45d6f6(0x131)+(_0x540b2c+_0x376418)+'\x20resources?');if(!_0x5e9055)return console[_0x45d6f6(0x111)](a4_0x51ad2e[_0x45d6f6(0xca)](_0x45d6f6(0xbc)),'-\x20nothing\x20pushed'),0x1;}const {data:_0x19768e}=await withSpinner(_0x45d6f6(0xde),()=>_0x330062[_0x45d6f6(0xb6)][_0x45d6f6(0xae)](_0x47a256,{'force':_0x6c3886})),_0x2dd39c=_0x19768e[_0x45d6f6(0x137)][_0x45d6f6(0x12b)][_0x45d6f6(0x12d)]>0x0||_0x19768e['counts'][_0x45d6f6(0xbe)][_0x45d6f6(0x12d)]>0x0||_0x19768e['counts'][_0x45d6f6(0x101)][_0x45d6f6(0x12d)]>0x0||_0x19768e['counts'][_0x45d6f6(0xc9)][_0x45d6f6(0x12d)]>0x0;if(_0x2dd39c){console['log'](a4_0x51ad2e['yellow'](_0x45d6f6(0xf6))),console[_0x45d6f6(0x111)](),console[_0x45d6f6(0x111)](a4_0x51ad2e['red'](_0x45d6f6(0xe5)));for(const _0x42423e of _0x19768e[_0x45d6f6(0x12b)]){_0x42423e[_0x45d6f6(0x109)]==='error'&&console['log'](a4_0x51ad2e[_0x45d6f6(0x134)]('\x20\x20Agent\x20\x22'+_0x42423e[_0x45d6f6(0xd7)]+_0x45d6f6(0x8f)+_0x42423e[_0x45d6f6(0x11f)]));}for(const _0x23f493 of _0x19768e[_0x45d6f6(0xbe)]){_0x23f493[_0x45d6f6(0x109)]===_0x45d6f6(0x11f)&&console[_0x45d6f6(0x111)](a4_0x51ad2e[_0x45d6f6(0x134)](_0x45d6f6(0x118)+_0x23f493['name']+_0x45d6f6(0x8f)+_0x23f493[_0x45d6f6(0x11f)]));}for(const _0x1feb4d of _0x19768e[_0x45d6f6(0x101)]){_0x1feb4d['action']===_0x45d6f6(0x11f)&&console[_0x45d6f6(0x111)](a4_0x51ad2e[_0x45d6f6(0x134)]('\x20\x20Text\x20Knowledge\x20Base\x20\x22'+_0x1feb4d[_0x45d6f6(0x13b)]+_0x45d6f6(0x8f)+_0x1feb4d[_0x45d6f6(0x11f)]));}for(const _0x533e1a of _0x19768e['prompts']){_0x533e1a[_0x45d6f6(0x109)]===_0x45d6f6(0x11f)&&console[_0x45d6f6(0x111)](a4_0x51ad2e[_0x45d6f6(0x134)](_0x45d6f6(0x98)+_0x533e1a[_0x45d6f6(0x13b)]+_0x45d6f6(0x8f)+_0x533e1a[_0x45d6f6(0x11f)]));}for(const _0x38f7cc of _0x19768e[_0x45d6f6(0x11c)]){_0x38f7cc[_0x45d6f6(0x109)]==='error'&&console['log'](a4_0x51ad2e[_0x45d6f6(0x134)]('\x20\x20Integration\x20\x22'+_0x38f7cc['name']+_0x45d6f6(0x8f)+_0x38f7cc['error']));}return 0x1;}console['log'](a4_0x51ad2e['green'](_0x45d6f6(0x10a)+(_0x540b2c+_0x376418)+'\x20resources\x20to\x20\x27'+_0x19768e['projectName']+'\x27'));const _0x29e9e0=getLLMProjectUrl(_0x11815a,_0x19768e[_0x45d6f6(0x113)]);return console[_0x45d6f6(0x111)](_0x45d6f6(0xfc)+a4_0x51ad2e[_0x45d6f6(0x114)](_0x29e9e0)),0x0;}}
1
+ const a4_0x262473=a4_0x374f;(function(_0x558472,_0x3fc800){const _0x147034=a4_0x374f,_0x2cccf6=_0x558472();while(!![]){try{const _0x5f562a=parseInt(_0x147034(0x178))/0x1+-parseInt(_0x147034(0x175))/0x2+parseInt(_0x147034(0x136))/0x3+-parseInt(_0x147034(0x130))/0x4+parseInt(_0x147034(0x195))/0x5*(-parseInt(_0x147034(0x1c5))/0x6)+-parseInt(_0x147034(0x15f))/0x7+parseInt(_0x147034(0x1b5))/0x8;if(_0x5f562a===_0x3fc800)break;else _0x2cccf6['push'](_0x2cccf6['shift']());}catch(_0x2b8cb4){_0x2cccf6['push'](_0x2cccf6['shift']());}}}(a4_0x16b8,0x30b2a));function a4_0x16b8(){const _0x57d5ef=['\x20\x20tdx\x20agent\x20clone\x20agents/','Dry\x20run\x20-\x20no\x20changes\x20made','\x22\x20to\x20new\x20project\x20\x22','no_context','New\x20project:\x20','8100152zrxqTa','New\x20project\x20name\x20is\x20required','-\x20nothing\x20pushed','outputPath','Pushing\x20to\x20project...','Usage:\x20tdx\x20agent\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20project\x20(requires\x20context\x20or\x20tdx.json)','dim','\x22...','tdx.json','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','\x20--profile\x20','red','Using\x20local\x20project:\x20','\x20\x20Agent\x20\x22','pushProject','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20#\x20Pull\x20specific\x20agent','98994hMnAMd','\x0aPush\x20','pushAgent','\x0aError:','\x20total','\x20unchanged','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','agents','projectName','errors','cyan','Source:\x20','yellow','\x20--name\x20','push','Output:\x20','diff','source','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory','Cancelled','Agent\x20pulled\x20successfully','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','\x22\x20to\x20\x22','Project\x20cloned\x20successfully','Failed\x20to\x20push\x20agent:\x20','\x20\x20Text\x20Knowledge\x20Bases:\x20','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','\x20\x20Source:\x20','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','MISSING_ARGUMENT','Using\x20current\x20project:\x20','Summary:','agentName','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','newProjectId','883772fplugT','Analyzing\x20changes\x20to\x20push...','name','dirname','description','\x22\x20to\x20a\x20different\x20profile','155955YcQEut','\x20resources\x20to\x20\x27','experimentalKnowledgeBases','error','context','Status:\x20','\x0a✔\x20Pushed\x20','\x20\x20Knowledge\x20Bases:\x20','\x20\x20Prompts:\x20','Clone\x20\x22','site','agent:clone','Using\x20context\x20project:\x20','\x0aChanges:','experimentalArtifacts','Using\x20project:\x20','\x20|\x20','Using\x20project\x20from\x20','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','unchanged','<new-name>','projectId','\x20\x20Knowledge\x20Base\x20\x22','\x0aChanges\x20to\x20agent\x20\x27','agentId','\x0aChanges\x20to\x20prompt\x20\x27','utf-8','Pulling\x20agent\x20\x22','-\x20no\x20files\x20written','\x20\x20Integrations:\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Errors:','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','output','cwd','force','message','Agent\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x0aPull\x20summary\x20for\x20\x27','log','1162546jmzNLA','prompts','Would\x20pull\x20agent:\x20','✔\x20Context\x20set:\x20','agent:push','\x0aProject\x20pushed\x20with\x20errors','counts','new','created','\x22:\x20','outputDir','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','\x20resources?','repeat','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','\x22\x20from\x20project\x20\x22','llmProject','Project:\x20','\x20\x20Agents:\x20','total','reason','no_local_folder','522742gLIROH','join','INVALID_ARGUMENT','129833UkAAZM','Output\x20path:\x20','sourceProjectName','knowledgeBases','updated','\x0a✔\x20Pulled\x20','\x27\x20to\x20create\x20the\x20folder\x20structure.','\x0aWrite\x20','dryRun','\x20created','Agent:\x20','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','Pushing\x20agent\x20from\x20\x22','action','Dry\x20run\x20-\x20no\x20files\x20written','hasChanges','found','\x20\x20Experimental\x20Artifact\x20\x22','llm','cloneProject','isNew','Would\x20clone:','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','green','yes','\x20errors','Cannot\x20clone\x20from\x20context\x20project\x20\x22','\x20=\x20','llm_project','105LhONCe','Would\x20push\x20agent:\x20','\x20\x20Integration\x20\x22','session','\x20new','Analyzing\x20project\x20\x22','\x20\x20Target:\x20','integrations','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','pullAgent','profile','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','pullProject','\x20\x20Experimental\x20Artifacts:\x20','\x20\x20tdx\x20agent\x20pull\x20','\x0aChanges\x20to\x20integration\x20\x27','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','gray','Cloning\x20\x22','No\x20tdx.json\x20found\x20in\x20','\x20changed','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project','agent:pull','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','agent.yml','textKnowledgeBases','execute'];a4_0x16b8=function(){return _0x57d5ef;};return a4_0x16b8();}import a4_0x55e839 from'chalk';import a4_0xe650e4 from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext}from'../sdk/agent/agent-config.js';function a4_0x374f(_0x38729b,_0x379e3d){_0x38729b=_0x38729b-0x126;const _0x16b892=a4_0x16b8();let _0x374f12=_0x16b892[_0x38729b];return _0x374f12;}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(_0x1f2b05){const _0xe8c13d=a4_0x374f,_0x367976=[];if(_0x1f2b05[_0xe8c13d(0x172)]!==undefined)_0x367976[_0xe8c13d(0x1d3)](_0x1f2b05[_0xe8c13d(0x172)]+_0xe8c13d(0x1c9));if(_0x1f2b05[_0xe8c13d(0x166)]!==undefined&&_0x1f2b05[_0xe8c13d(0x166)]>0x0)_0x367976[_0xe8c13d(0x1d3)](a4_0x55e839[_0xe8c13d(0x18f)](_0x1f2b05[_0xe8c13d(0x166)]+_0xe8c13d(0x199)));if(_0x1f2b05['created']!==undefined&&_0x1f2b05['created']>0x0)_0x367976[_0xe8c13d(0x1d3)](a4_0x55e839['green'](_0x1f2b05[_0xe8c13d(0x167)]+_0xe8c13d(0x181)));if(_0x1f2b05[_0xe8c13d(0x17c)]!==undefined&&_0x1f2b05['updated']>0x0)_0x367976['push'](a4_0x55e839[_0xe8c13d(0x1d1)](_0x1f2b05[_0xe8c13d(0x17c)]+'\x20updated'));if(_0x1f2b05['unchanged']!==undefined&&_0x1f2b05[_0xe8c13d(0x149)]>0x0)_0x367976[_0xe8c13d(0x1d3)](a4_0x55e839['gray'](_0x1f2b05['unchanged']+_0xe8c13d(0x1ca)));if(_0x1f2b05[_0xe8c13d(0x1ce)]!==undefined&&_0x1f2b05['errors']>0x0)_0x367976[_0xe8c13d(0x1d3)](a4_0x55e839[_0xe8c13d(0x1c0)](_0x1f2b05[_0xe8c13d(0x1ce)]+_0xe8c13d(0x191)));return _0x367976['join'](',\x20');}function displayDiffs(_0x462eac,_0x564e47,_0x586e91,_0x2f9d3e,_0x327eaa,_0x316117,_0x52fe3f){const _0x273276=a4_0x374f;for(const _0x20e76a of _0x462eac){if(_0x20e76a[_0x273276(0x1d5)]){const _0x438323=_0x20e76a[_0x273276(0x12d)]||_0x20e76a[_0x273276(0x132)];console[_0x273276(0x15e)](_0x273276(0x14d)+_0x438323+'\x27:'),console[_0x273276(0x15e)]('─'['repeat'](0x3c)),console[_0x273276(0x15e)](_0x20e76a[_0x273276(0x1d5)]),console[_0x273276(0x15e)]('─'[_0x273276(0x16c)](0x3c));}}for(const _0xc5a682 of _0x564e47){_0xc5a682[_0x273276(0x1d5)]&&(console[_0x273276(0x15e)](_0x273276(0x156)+_0xc5a682[_0x273276(0x132)]+'\x27:'),console['log']('─'[_0x273276(0x16c)](0x3c)),console[_0x273276(0x15e)](_0xc5a682['diff']),console[_0x273276(0x15e)]('─'[_0x273276(0x16c)](0x3c)));}for(const _0x334ba7 of _0x586e91){_0x334ba7['diff']&&(console[_0x273276(0x15e)](_0x273276(0x18e)+_0x334ba7['name']+'\x27:'),console[_0x273276(0x15e)]('─'['repeat'](0x3c)),console[_0x273276(0x15e)](_0x334ba7[_0x273276(0x1d5)]),console[_0x273276(0x15e)]('─'['repeat'](0x3c)));}for(const _0x1abd3d of _0x2f9d3e){_0x1abd3d['diff']&&(console[_0x273276(0x15e)](_0x273276(0x14f)+_0x1abd3d[_0x273276(0x132)]+'\x27:'),console['log']('─'[_0x273276(0x16c)](0x3c)),console[_0x273276(0x15e)](_0x1abd3d[_0x273276(0x1d5)]),console[_0x273276(0x15e)]('─'['repeat'](0x3c)));}for(const _0x4c7a4b of _0x327eaa){_0x4c7a4b[_0x273276(0x1d5)]&&(console['log'](_0x273276(0x1a4)+_0x4c7a4b[_0x273276(0x132)]+'\x27:'),console['log']('─'['repeat'](0x3c)),console[_0x273276(0x15e)](_0x4c7a4b[_0x273276(0x1d5)]),console[_0x273276(0x15e)]('─'[_0x273276(0x16c)](0x3c)));}for(const _0x253004 of _0x316117){_0x253004['diff']&&(console['log'](_0x273276(0x1a5)+_0x253004[_0x273276(0x132)]+'\x27:'),console[_0x273276(0x15e)]('─'[_0x273276(0x16c)](0x3c)),console['log'](_0x253004[_0x273276(0x1d5)]),console[_0x273276(0x15e)]('─'[_0x273276(0x16c)](0x3c)));}for(const _0x15b045 of _0x52fe3f){_0x15b045[_0x273276(0x1d5)]&&(console[_0x273276(0x15e)](_0x273276(0x16d)+_0x15b045['name']+'\x27:'),console['log']('─'[_0x273276(0x16c)](0x3c)),console[_0x273276(0x15e)](_0x15b045[_0x273276(0x1d5)]),console[_0x273276(0x15e)]('─'[_0x273276(0x16c)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x262473(0x132)]=a4_0x262473(0x1ab);['description']=a4_0x262473(0x1a0);async[a4_0x262473(0x1af)](_0x2cd7ac){const _0x504d2e=a4_0x262473,{options:_0x51b42a,args:_0x486915,tdx:_0x47ba8f}=_0x2cd7ac,_0x40ec76=_0x486915[0x0],_0x105abb=_0x486915[0x1],_0x36238b=_0x51b42a[_0x504d2e(0x157)],_0x2e0596=_0x51b42a[_0x504d2e(0x180)],_0x2889c2=_0x51b42a['force'],_0x2d77e0=_0x51b42a[_0x504d2e(0x190)],_0x3560c3=_0x51b42a[_0x504d2e(0x16f)];let _0x47757a,_0x79995f;const _0xbd4a7e=findAgentConfigPath(process[_0x504d2e(0x158)]());if(_0x40ec76){const _0x3ec4d7=a4_0xe650e4[_0x504d2e(0x176)](_0x40ec76,_0x504d2e(0x1bd));if(existsSync(_0x3ec4d7))try{const _0x29bd60=JSON['parse'](readFileSync(_0x3ec4d7,_0x504d2e(0x150)));_0x47757a=_0x29bd60[_0x504d2e(0x194)],_0x79995f=_0x40ec76,console[_0x504d2e(0x15e)](a4_0x55e839[_0x504d2e(0x1bb)](_0x504d2e(0x147)+_0x3ec4d7+':\x20'+_0x47757a));}catch{_0x47757a=_0x40ec76;}else _0x47757a=_0x40ec76;}else{if(_0xbd4a7e)try{const _0x225d0b=JSON['parse'](readFileSync(_0xbd4a7e,_0x504d2e(0x150)));_0x47757a=_0x225d0b[_0x504d2e(0x194)],_0x79995f=a4_0xe650e4[_0x504d2e(0x133)](_0xbd4a7e),console[_0x504d2e(0x15e)](a4_0x55e839[_0x504d2e(0x1bb)]('Using\x20project:\x20'+_0x47757a));}catch{_0x47757a=_0x3560c3;}else _0x47757a=_0x3560c3;}if(!_0x47757a)return console['log'](a4_0x55e839[_0x504d2e(0x1d1)](_0x504d2e(0x1cb))),console[_0x504d2e(0x15e)](_0x504d2e(0x1ba)),console[_0x504d2e(0x15e)](_0x504d2e(0x1aa)),console[_0x504d2e(0x15e)](_0x504d2e(0x1d7)),console[_0x504d2e(0x15e)](_0x504d2e(0x1c4)),0x1;if(_0x105abb){const {data:_0xa2d21f}=await withSpinner(_0x504d2e(0x151)+_0x105abb+_0x504d2e(0x16e)+_0x47757a+'\x22...',()=>_0x47ba8f[_0x504d2e(0x18a)][_0x504d2e(0x19e)](_0x47757a,_0x105abb,_0x36238b,{'dryRun':_0x2e0596,'force':_0x2889c2}));if(_0x2e0596)return console[_0x504d2e(0x15e)](a4_0x55e839['yellow'](_0x504d2e(0x186))),console[_0x504d2e(0x15e)](_0x504d2e(0x161)+_0xa2d21f[_0x504d2e(0x12d)]),console[_0x504d2e(0x15e)](_0x504d2e(0x179)+_0xa2d21f[_0x504d2e(0x1b8)]),_0xa2d21f['diff']&&(console[_0x504d2e(0x15e)](_0x504d2e(0x143)),console['log']('─'[_0x504d2e(0x16c)](0x3c)),console['log'](_0xa2d21f[_0x504d2e(0x1d5)]),console['log']('─'[_0x504d2e(0x16c)](0x3c))),0x0;return console[_0x504d2e(0x15e)](a4_0x55e839[_0x504d2e(0x18f)](_0x504d2e(0x1d9))),console['log']('Agent:\x20'+_0xa2d21f['agentName']),console['log'](_0x504d2e(0x1d4)+_0xa2d21f[_0x504d2e(0x1b8)]),console[_0x504d2e(0x15e)](_0x504d2e(0x13b)+(_0xa2d21f[_0x504d2e(0x18c)]?a4_0x55e839[_0x504d2e(0x18f)]('new'):_0xa2d21f[_0x504d2e(0x187)]?a4_0x55e839[_0x504d2e(0x1d1)](_0x504d2e(0x17c)):a4_0x55e839[_0x504d2e(0x1a6)](_0x504d2e(0x149)))),0x0;}const _0x57b76e=_0x79995f||_0x36238b,{data:_0x4edef2}=await withSpinner(_0x504d2e(0x19a)+_0x47757a+_0x504d2e(0x1bc),()=>_0x47ba8f[_0x504d2e(0x18a)][_0x504d2e(0x1a1)](_0x47757a,_0x57b76e,{'dryRun':!![]})),_0x4554cd=_0x4edef2['counts'][_0x504d2e(0x1cc)]['new']+_0x4edef2[_0x504d2e(0x165)][_0x504d2e(0x17b)][_0x504d2e(0x166)]+_0x4edef2['counts'][_0x504d2e(0x1ae)][_0x504d2e(0x166)]+_0x4edef2[_0x504d2e(0x165)][_0x504d2e(0x160)]['new']+_0x4edef2[_0x504d2e(0x165)]['integrations'][_0x504d2e(0x166)]+_0x4edef2[_0x504d2e(0x165)]['experimentalKnowledgeBases']['new']+_0x4edef2['counts'][_0x504d2e(0x144)][_0x504d2e(0x166)],_0x32e91c=_0x4edef2[_0x504d2e(0x165)][_0x504d2e(0x1cc)][_0x504d2e(0x17c)]+_0x4edef2[_0x504d2e(0x165)][_0x504d2e(0x17b)]['updated']+_0x4edef2[_0x504d2e(0x165)][_0x504d2e(0x1ae)][_0x504d2e(0x17c)]+_0x4edef2[_0x504d2e(0x165)]['prompts'][_0x504d2e(0x17c)]+_0x4edef2[_0x504d2e(0x165)]['integrations'][_0x504d2e(0x17c)]+_0x4edef2[_0x504d2e(0x165)][_0x504d2e(0x138)]['updated']+_0x4edef2[_0x504d2e(0x165)][_0x504d2e(0x144)][_0x504d2e(0x17c)],_0x8d8746=_0x4edef2[_0x504d2e(0x165)]['agents'][_0x504d2e(0x149)]+_0x4edef2[_0x504d2e(0x165)][_0x504d2e(0x17b)][_0x504d2e(0x149)]+_0x4edef2[_0x504d2e(0x165)][_0x504d2e(0x1ae)][_0x504d2e(0x149)]+_0x4edef2[_0x504d2e(0x165)][_0x504d2e(0x160)][_0x504d2e(0x149)]+_0x4edef2[_0x504d2e(0x165)][_0x504d2e(0x19c)][_0x504d2e(0x149)]+_0x4edef2[_0x504d2e(0x165)][_0x504d2e(0x138)]['unchanged']+_0x4edef2[_0x504d2e(0x165)][_0x504d2e(0x144)][_0x504d2e(0x149)];console['log'](_0x504d2e(0x15d)+_0x4edef2[_0x504d2e(0x1cd)]+'\x27:'),console[_0x504d2e(0x15e)]('\x20\x20'+a4_0x55e839[_0x504d2e(0x18f)]('+\x20'+_0x4554cd+_0x504d2e(0x199))+_0x504d2e(0x146)+a4_0x55e839[_0x504d2e(0x1d1)]('~\x20'+_0x32e91c+_0x504d2e(0x1a9))+_0x504d2e(0x146)+a4_0x55e839[_0x504d2e(0x1bb)]('=\x20'+_0x8d8746+_0x504d2e(0x1ca))),console[_0x504d2e(0x15e)]('\x20\x20Agents:\x20'+formatCountSummary(_0x4edef2['counts'][_0x504d2e(0x1cc)])),console[_0x504d2e(0x15e)](_0x504d2e(0x13d)+formatCountSummary(_0x4edef2[_0x504d2e(0x165)][_0x504d2e(0x17b)])),console[_0x504d2e(0x15e)](_0x504d2e(0x126)+formatCountSummary(_0x4edef2[_0x504d2e(0x165)][_0x504d2e(0x1ae)])),console[_0x504d2e(0x15e)](_0x504d2e(0x13e)+formatCountSummary(_0x4edef2[_0x504d2e(0x165)][_0x504d2e(0x160)])),console[_0x504d2e(0x15e)](_0x504d2e(0x153)+formatCountSummary(_0x4edef2[_0x504d2e(0x165)][_0x504d2e(0x19c)]));const _0x1b5ead=_0x4edef2[_0x504d2e(0x165)][_0x504d2e(0x138)][_0x504d2e(0x172)]>0x0||_0x4edef2[_0x504d2e(0x165)][_0x504d2e(0x144)][_0x504d2e(0x172)]>0x0;_0x1b5ead&&(console[_0x504d2e(0x15e)](_0x504d2e(0x1be)+formatCountSummary(_0x4edef2[_0x504d2e(0x165)]['experimentalKnowledgeBases'])),console[_0x504d2e(0x15e)](_0x504d2e(0x1a2)+formatCountSummary(_0x4edef2['counts']['experimentalArtifacts'])));console[_0x504d2e(0x15e)](_0x504d2e(0x19b)+a4_0x55e839[_0x504d2e(0x1cf)](_0x4edef2[_0x504d2e(0x169)])),displayDiffs(_0x4edef2[_0x504d2e(0x1cc)],_0x4edef2[_0x504d2e(0x17b)],_0x4edef2['textKnowledgeBases'],_0x4edef2['prompts'],_0x4edef2[_0x504d2e(0x19c)],_0x4edef2[_0x504d2e(0x138)],_0x4edef2[_0x504d2e(0x144)]);if(_0x2e0596)return console[_0x504d2e(0x15e)](a4_0x55e839['yellow'](_0x504d2e(0x148))),0x0;if(_0x4554cd===0x0&&_0x32e91c===0x0)return console['log'](a4_0x55e839['green']('\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'llm_project':_0x4edef2[_0x504d2e(0x1cd)]},_0x51b42a[_0x504d2e(0x198)]),console['log'](a4_0x55e839['green'](_0x504d2e(0x162)+a4_0x55e839[_0x504d2e(0x1bb)](_0x504d2e(0x194))+_0x504d2e(0x193)+a4_0x55e839[_0x504d2e(0x1cf)](_0x4edef2['projectName']))),0x0;if(!_0x2d77e0&&!_0x2889c2){if(!isInteractive())return console[_0x504d2e(0x139)](a4_0x55e839[_0x504d2e(0x1c0)](_0x504d2e(0x1c8)),_0x504d2e(0x154)),console[_0x504d2e(0x139)](a4_0x55e839[_0x504d2e(0x1bb)](_0x504d2e(0x15c))),0x1;const _0x4acc8e=await confirmKey(_0x504d2e(0x17f)+(_0x4554cd+_0x32e91c)+'\x20files?');if(!_0x4acc8e)return console[_0x504d2e(0x15e)](a4_0x55e839[_0x504d2e(0x1d1)](_0x504d2e(0x1d8)),_0x504d2e(0x152)),0x1;}const {data:_0x3a9787}=await withSpinner('Writing\x20files...',()=>_0x47ba8f[_0x504d2e(0x18a)][_0x504d2e(0x1a1)](_0x47757a,_0x57b76e,{'force':_0x2889c2}));return console[_0x504d2e(0x15e)](a4_0x55e839[_0x504d2e(0x18f)](_0x504d2e(0x17d)+(_0x4554cd+_0x32e91c)+'\x20files\x20to\x20'+_0x3a9787[_0x504d2e(0x169)])),saveSessionContext({'llm_project':_0x3a9787[_0x504d2e(0x1cd)]},_0x51b42a[_0x504d2e(0x198)]),console[_0x504d2e(0x15e)](a4_0x55e839[_0x504d2e(0x18f)](_0x504d2e(0x162)+a4_0x55e839[_0x504d2e(0x1bb)]('llm_project')+_0x504d2e(0x193)+a4_0x55e839[_0x504d2e(0x1cf)](_0x3a9787[_0x504d2e(0x1cd)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x262473(0x132)]=a4_0x262473(0x141);[a4_0x262473(0x134)]=a4_0x262473(0x183);async[a4_0x262473(0x1af)](_0x37ddf8){const _0x107653=a4_0x262473,{options:_0x5e3925,args:_0x2be81d,tdx:_0x1badfa}=_0x37ddf8,_0x4b0b91=_0x2be81d[0x0],_0x299ae8=_0x5e3925[_0x107653(0x132)],_0x5a3733=_0x5e3925['dryRun'],_0x5ae925=_0x5e3925['yes'],_0x23c65c=_0x5e3925[_0x107653(0x140)],_0x2b7fd3=_0x5e3925[_0x107653(0x16f)];let _0x2bc4aa;const _0x2e4eb8=findAgentConfigPath(process[_0x107653(0x158)]());if(_0x4b0b91){const _0x1cfba7=a4_0xe650e4[_0x107653(0x176)](_0x4b0b91,_0x107653(0x1bd));existsSync(_0x1cfba7)?(_0x2bc4aa=_0x4b0b91,console[_0x107653(0x15e)](a4_0x55e839[_0x107653(0x1bb)](_0x107653(0x1c1)+_0x4b0b91))):_0x2bc4aa=_0x4b0b91;}else{if(_0x2e4eb8)_0x2bc4aa=a4_0xe650e4[_0x107653(0x133)](_0x2e4eb8),console[_0x107653(0x15e)](a4_0x55e839[_0x107653(0x1bb)](_0x107653(0x12b)+_0x2bc4aa));else{if(_0x2b7fd3){const _0x4bca79=sanitizeForFilesystem(_0x2b7fd3);let _0x392f9f=_0x4bca79,_0x7e0a17=a4_0xe650e4[_0x107653(0x176)](process[_0x107653(0x158)](),_0x107653(0x1cc),_0x4bca79,_0x107653(0x1bd));if(!existsSync(_0x7e0a17)){const _0x494921=normalizeName(_0x2b7fd3),_0x127a0d=a4_0xe650e4[_0x107653(0x176)](process[_0x107653(0x158)](),_0x107653(0x1cc),_0x494921,_0x107653(0x1bd));existsSync(_0x127a0d)&&(_0x392f9f=_0x494921,_0x7e0a17=_0x127a0d);}if(existsSync(_0x7e0a17))_0x2bc4aa=a4_0xe650e4[_0x107653(0x133)](_0x7e0a17),console[_0x107653(0x15e)](a4_0x55e839['dim'](_0x107653(0x1c1)+_0x2bc4aa));else{const _0x1c62f6=_0x5e3925[_0x107653(0x19f)];if(_0x1c62f6)throw new SDKError(ErrorCode[_0x107653(0x177)],_0x107653(0x192)+_0x2b7fd3+_0x107653(0x135),undefined,{'helpText':_0x107653(0x16a)+'First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a'+(_0x107653(0x1a3)+_0x2b7fd3+'\x0a')+(_0x107653(0x1b0)+_0x392f9f+_0x107653(0x1d2)+(_0x299ae8||_0x107653(0x14a))+_0x107653(0x1bf)+_0x1c62f6)});_0x2bc4aa=_0x2b7fd3,console['log'](a4_0x55e839[_0x107653(0x1bb)](_0x107653(0x142)+_0x2b7fd3));}}}}if(!_0x2bc4aa)return console[_0x107653(0x15e)](a4_0x55e839['yellow'](_0x107653(0x127))),console['log']('\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project'),console[_0x107653(0x15e)](_0x107653(0x19d)),console[_0x107653(0x15e)]('\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[_0x107653(0x15e)](_0x107653(0x129)),0x1;if(!_0x299ae8)throw new SDKError(ErrorCode[_0x107653(0x12a)],_0x107653(0x1b6),undefined,{'helpText':'Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>'});if(!_0x5ae925&&!_0x5a3733){if(!isInteractive())return console[_0x107653(0x139)](a4_0x55e839[_0x107653(0x1c0)](_0x107653(0x1c8)),_0x107653(0x154)),console['error'](a4_0x55e839[_0x107653(0x1bb)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x20f9d0=await confirmKey(_0x107653(0x13f)+_0x2bc4aa+_0x107653(0x1b2)+_0x299ae8+'\x22?');if(!_0x20f9d0)return console[_0x107653(0x15e)](a4_0x55e839[_0x107653(0x1d1)]('Cancelled')),0x1;}const {data:_0x4bb757}=await withSpinner(_0x107653(0x1a7)+_0x2bc4aa+_0x107653(0x1db)+_0x299ae8+_0x107653(0x1bc),()=>_0x1badfa[_0x107653(0x18a)][_0x107653(0x18b)](_0x2bc4aa,_0x299ae8,{'dryRun':_0x5a3733}));if(_0x5a3733){console[_0x107653(0x15e)](a4_0x55e839[_0x107653(0x1d1)](_0x107653(0x1b1))),console['log'](_0x107653(0x1d0)+_0x4bb757[_0x107653(0x17a)]),console['log'](_0x107653(0x1b4)+_0x299ae8),console[_0x107653(0x15e)](_0x107653(0x18d)),console[_0x107653(0x15e)](_0x107653(0x171)+_0x4bb757[_0x107653(0x165)][_0x107653(0x1cc)]['created']),console['log'](_0x107653(0x13d)+_0x4bb757['counts']['knowledgeBases'][_0x107653(0x167)]),console[_0x107653(0x15e)](_0x107653(0x13e)+_0x4bb757[_0x107653(0x165)][_0x107653(0x160)][_0x107653(0x167)]);const _0x21994e=_0x4bb757[_0x107653(0x165)][_0x107653(0x138)][_0x107653(0x167)]>0x0||_0x4bb757['counts'][_0x107653(0x144)][_0x107653(0x167)]>0x0;return _0x21994e&&(console[_0x107653(0x15e)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+_0x4bb757[_0x107653(0x165)][_0x107653(0x138)][_0x107653(0x167)]),console[_0x107653(0x15e)]('\x20\x20Experimental\x20Artifacts:\x20'+_0x4bb757[_0x107653(0x165)][_0x107653(0x144)][_0x107653(0x167)])),0x0;}const _0x535ae8=_0x4bb757[_0x107653(0x165)]['agents']['errors']>0x0||_0x4bb757[_0x107653(0x165)][_0x107653(0x17b)][_0x107653(0x1ce)]>0x0||_0x4bb757['counts'][_0x107653(0x160)][_0x107653(0x1ce)]>0x0||_0x4bb757[_0x107653(0x165)][_0x107653(0x138)][_0x107653(0x1ce)]>0x0||_0x4bb757[_0x107653(0x165)]['experimentalArtifacts'][_0x107653(0x1ce)]>0x0;_0x535ae8?console[_0x107653(0x15e)](a4_0x55e839[_0x107653(0x1d1)]('Project\x20cloned\x20with\x20errors')):console[_0x107653(0x15e)](a4_0x55e839[_0x107653(0x18f)](_0x107653(0x1dc)));console['log'](_0x107653(0x1d0)+_0x4bb757[_0x107653(0x17a)]),console[_0x107653(0x15e)](_0x107653(0x1b4)+_0x4bb757['newProjectName']),console[_0x107653(0x15e)]('New\x20project\x20ID:\x20'+_0x4bb757[_0x107653(0x12f)]),console[_0x107653(0x15e)](),console[_0x107653(0x15e)](_0x107653(0x12c)),console['log']('\x20\x20Agents:\x20'+formatCountSummary(_0x4bb757[_0x107653(0x165)][_0x107653(0x1cc)])),console['log'](_0x107653(0x13d)+formatCountSummary(_0x4bb757[_0x107653(0x165)][_0x107653(0x17b)])),console[_0x107653(0x15e)](_0x107653(0x13e)+formatCountSummary(_0x4bb757[_0x107653(0x165)]['prompts'])),console[_0x107653(0x15e)](_0x107653(0x153)+formatCountSummary(_0x4bb757[_0x107653(0x165)][_0x107653(0x19c)]));const _0x274ba6=_0x4bb757[_0x107653(0x165)]['experimentalKnowledgeBases'][_0x107653(0x167)]>0x0||_0x4bb757[_0x107653(0x165)]['experimentalKnowledgeBases']['updated']>0x0||_0x4bb757['counts'][_0x107653(0x138)][_0x107653(0x149)]>0x0||_0x4bb757['counts'][_0x107653(0x144)][_0x107653(0x167)]>0x0||_0x4bb757[_0x107653(0x165)][_0x107653(0x144)][_0x107653(0x17c)]>0x0||_0x4bb757['counts'][_0x107653(0x144)][_0x107653(0x149)]>0x0;_0x274ba6&&(console[_0x107653(0x15e)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x4bb757[_0x107653(0x165)][_0x107653(0x138)])),console[_0x107653(0x15e)](_0x107653(0x1a2)+formatCountSummary(_0x4bb757[_0x107653(0x165)]['experimentalArtifacts'])));if(_0x535ae8){console[_0x107653(0x15e)](),console[_0x107653(0x15e)](a4_0x55e839[_0x107653(0x1c0)](_0x107653(0x155)));for(const _0x16448b of _0x4bb757['agents']){_0x16448b[_0x107653(0x185)]===_0x107653(0x139)&&console[_0x107653(0x15e)](a4_0x55e839['red'](_0x107653(0x1c2)+_0x16448b[_0x107653(0x12d)]+'\x22:\x20'+_0x16448b[_0x107653(0x139)]));}for(const _0x33dc7e of _0x4bb757[_0x107653(0x17b)]){_0x33dc7e[_0x107653(0x185)]===_0x107653(0x139)&&console[_0x107653(0x15e)](a4_0x55e839[_0x107653(0x1c0)](_0x107653(0x14c)+_0x33dc7e[_0x107653(0x132)]+_0x107653(0x168)+_0x33dc7e[_0x107653(0x139)]));}for(const _0x46ca4c of _0x4bb757[_0x107653(0x160)]){_0x46ca4c[_0x107653(0x185)]==='error'&&console[_0x107653(0x15e)](a4_0x55e839[_0x107653(0x1c0)]('\x20\x20Prompt\x20\x22'+_0x46ca4c[_0x107653(0x132)]+_0x107653(0x168)+_0x46ca4c['error']));}for(const _0x21c7b5 of _0x4bb757['integrations']){_0x21c7b5['action']===_0x107653(0x139)&&console[_0x107653(0x15e)](a4_0x55e839[_0x107653(0x1c0)](_0x107653(0x197)+_0x21c7b5['name']+_0x107653(0x168)+_0x21c7b5['error']));}for(const _0x2d594a of _0x4bb757[_0x107653(0x138)]){_0x2d594a[_0x107653(0x185)]===_0x107653(0x139)&&console['log'](a4_0x55e839[_0x107653(0x1c0)]('\x20\x20Experimental\x20Knowledge\x20Base\x20\x22'+_0x2d594a[_0x107653(0x132)]+'\x22:\x20'+_0x2d594a['error']));}for(const _0x289b42 of _0x4bb757[_0x107653(0x144)]){_0x289b42[_0x107653(0x185)]===_0x107653(0x139)&&console[_0x107653(0x15e)](a4_0x55e839[_0x107653(0x1c0)](_0x107653(0x189)+_0x289b42['name']+_0x107653(0x168)+_0x289b42['error']));}return 0x1;}console[_0x107653(0x15e)]();const _0x16ab0b=getLLMProjectUrl(_0x23c65c,_0x4bb757[_0x107653(0x12f)]);return console[_0x107653(0x15e)](_0x107653(0x170)+a4_0x55e839[_0x107653(0x1cf)](_0x16ab0b)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x262473(0x132)]=a4_0x262473(0x163);[a4_0x262473(0x134)]=a4_0x262473(0x12e);async['execute'](_0x37e047){const _0x16b5d4=a4_0x262473,{options:_0x3309f8,args:_0x17140f,tdx:_0x4aaa38}=_0x37e047;let _0x17849f=_0x17140f[0x0]||process[_0x16b5d4(0x158)]();const _0x13b997=_0x3309f8['dryRun'],_0x403ae0=_0x3309f8[_0x16b5d4(0x159)],_0x322128=_0x3309f8[_0x16b5d4(0x190)],_0x2f1105=_0x3309f8[_0x16b5d4(0x140)],_0x329859=a4_0xe650e4['join'](_0x17849f,_0x16b5d4(0x1ad)),_0x2061ef=existsSync(_0x329859);if(_0x2061ef){const {data:_0xc815ee}=await withSpinner(_0x16b5d4(0x184)+_0x17849f+_0x16b5d4(0x1bc),()=>_0x4aaa38[_0x16b5d4(0x18a)][_0x16b5d4(0x1c7)](_0x17849f,{'dryRun':_0x13b997,'force':_0x403ae0}));if(_0x13b997)return console[_0x16b5d4(0x15e)](a4_0x55e839[_0x16b5d4(0x1d1)](_0x16b5d4(0x1b1))),console[_0x16b5d4(0x15e)](_0x16b5d4(0x196)+_0xc815ee[_0x16b5d4(0x12d)]),0x0;if(_0xc815ee[_0x16b5d4(0x185)]==='error')return console[_0x16b5d4(0x15e)](a4_0x55e839['red'](_0x16b5d4(0x1dd)+_0xc815ee[_0x16b5d4(0x139)])),0x1;console['log'](a4_0x55e839[_0x16b5d4(0x18f)](_0x16b5d4(0x15b)+_0xc815ee['action']+'\x20successfully')),console[_0x16b5d4(0x15e)](_0x16b5d4(0x182)+_0xc815ee['agentName']);if(_0xc815ee[_0x16b5d4(0x14e)]&&_0xc815ee[_0x16b5d4(0x14b)]){const _0x3ef38c=getLLMAgentChatUrl(_0x2f1105,_0xc815ee[_0x16b5d4(0x14b)],_0xc815ee[_0x16b5d4(0x14e)]);console[_0x16b5d4(0x15e)]('Chat:\x20'+a4_0x55e839['cyan'](_0x3ef38c));}return 0x0;}const _0xf47cc6=_0x3309f8[_0x16b5d4(0x16f)],_0x2af5a0=resolveProjectFromContext(_0x17849f,_0xf47cc6);if(_0x2af5a0[_0x16b5d4(0x188)])_0x17849f=_0x2af5a0['projectDir'],_0x2af5a0[_0x16b5d4(0x1d6)]===_0x16b5d4(0x13a)&&console[_0x16b5d4(0x15e)](a4_0x55e839[_0x16b5d4(0x1bb)](_0x16b5d4(0x145)+_0x17849f));else{let _0xb31296=_0x16b5d4(0x1ac);_0x2af5a0['reason']===_0x16b5d4(0x174)&&(_0xb31296=_0x2af5a0[_0x16b5d4(0x15a)]+'\x0aRun\x20\x27tdx\x20agent\x20pull\x20'+_0x2af5a0[_0x16b5d4(0x16f)]+_0x16b5d4(0x17e));throw new SDKError(ErrorCode[_0x16b5d4(0x177)],_0x2af5a0[_0x16b5d4(0x173)]===_0x16b5d4(0x1b3)?_0x2af5a0[_0x16b5d4(0x15a)]:_0x16b5d4(0x1a8)+_0x17849f,undefined,{'helpText':_0xb31296});}const {data:_0xddd9}=await withSpinner(_0x16b5d4(0x131),()=>_0x4aaa38['llm'][_0x16b5d4(0x1c3)](_0x17849f,{'dryRun':!![]})),_0x2e0074=_0xddd9[_0x16b5d4(0x165)][_0x16b5d4(0x1cc)][_0x16b5d4(0x1ce)]>0x0;if(_0x2e0074){console['log'](a4_0x55e839[_0x16b5d4(0x1c0)]('\x0aErrors\x20found:'));for(const _0xea26a6 of _0xddd9[_0x16b5d4(0x1cc)]){_0xea26a6['action']===_0x16b5d4(0x139)&&console['log'](a4_0x55e839[_0x16b5d4(0x1c0)](_0x16b5d4(0x1c2)+_0xea26a6[_0x16b5d4(0x12d)]+'\x22:\x20'+_0xea26a6['error']));}return 0x1;}const _0x35b98a=_0xddd9[_0x16b5d4(0x165)][_0x16b5d4(0x1cc)][_0x16b5d4(0x167)]+_0xddd9[_0x16b5d4(0x165)][_0x16b5d4(0x17b)]['created']+_0xddd9[_0x16b5d4(0x165)]['textKnowledgeBases'][_0x16b5d4(0x167)]+_0xddd9['counts'][_0x16b5d4(0x160)][_0x16b5d4(0x167)]+_0xddd9[_0x16b5d4(0x165)][_0x16b5d4(0x19c)][_0x16b5d4(0x167)]+_0xddd9['counts'][_0x16b5d4(0x138)][_0x16b5d4(0x167)]+_0xddd9[_0x16b5d4(0x165)][_0x16b5d4(0x144)][_0x16b5d4(0x167)],_0x490b7c=_0xddd9[_0x16b5d4(0x165)][_0x16b5d4(0x1cc)][_0x16b5d4(0x17c)]+_0xddd9[_0x16b5d4(0x165)][_0x16b5d4(0x17b)][_0x16b5d4(0x17c)]+_0xddd9['counts']['textKnowledgeBases']['updated']+_0xddd9['counts']['prompts']['updated']+_0xddd9['counts'][_0x16b5d4(0x19c)][_0x16b5d4(0x17c)]+_0xddd9[_0x16b5d4(0x165)][_0x16b5d4(0x138)][_0x16b5d4(0x17c)]+_0xddd9[_0x16b5d4(0x165)][_0x16b5d4(0x144)]['updated'],_0x2ff4ca=_0xddd9[_0x16b5d4(0x165)][_0x16b5d4(0x1cc)]['unchanged']+_0xddd9[_0x16b5d4(0x165)][_0x16b5d4(0x17b)][_0x16b5d4(0x149)]+_0xddd9['counts'][_0x16b5d4(0x1ae)]['unchanged']+_0xddd9[_0x16b5d4(0x165)][_0x16b5d4(0x160)][_0x16b5d4(0x149)]+_0xddd9[_0x16b5d4(0x165)][_0x16b5d4(0x19c)]['unchanged']+_0xddd9[_0x16b5d4(0x165)][_0x16b5d4(0x138)][_0x16b5d4(0x149)]+_0xddd9['counts'][_0x16b5d4(0x144)][_0x16b5d4(0x149)];console['log']('\x0aPush\x20summary\x20for\x20\x27'+_0xddd9[_0x16b5d4(0x1cd)]+'\x27:'),console['log']('\x20\x20'+a4_0x55e839[_0x16b5d4(0x18f)]('+\x20'+_0x35b98a+_0x16b5d4(0x199))+'\x20|\x20'+a4_0x55e839[_0x16b5d4(0x1d1)]('~\x20'+_0x490b7c+_0x16b5d4(0x1a9))+_0x16b5d4(0x146)+a4_0x55e839['dim']('=\x20'+_0x2ff4ca+'\x20unchanged')),console[_0x16b5d4(0x15e)](_0x16b5d4(0x171)+formatCountSummary(_0xddd9[_0x16b5d4(0x165)][_0x16b5d4(0x1cc)])),console[_0x16b5d4(0x15e)](_0x16b5d4(0x13d)+formatCountSummary(_0xddd9[_0x16b5d4(0x165)][_0x16b5d4(0x17b)])),console[_0x16b5d4(0x15e)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0xddd9[_0x16b5d4(0x165)][_0x16b5d4(0x1ae)])),console['log'](_0x16b5d4(0x13e)+formatCountSummary(_0xddd9['counts'][_0x16b5d4(0x160)])),console[_0x16b5d4(0x15e)](_0x16b5d4(0x153)+formatCountSummary(_0xddd9[_0x16b5d4(0x165)][_0x16b5d4(0x19c)]));const _0x1f0719=_0xddd9['counts'][_0x16b5d4(0x138)][_0x16b5d4(0x167)]>0x0||_0xddd9[_0x16b5d4(0x165)][_0x16b5d4(0x138)][_0x16b5d4(0x17c)]>0x0||_0xddd9[_0x16b5d4(0x165)][_0x16b5d4(0x138)]['unchanged']>0x0||_0xddd9[_0x16b5d4(0x165)][_0x16b5d4(0x144)]['created']>0x0||_0xddd9[_0x16b5d4(0x165)][_0x16b5d4(0x144)]['updated']>0x0||_0xddd9['counts'][_0x16b5d4(0x144)]['unchanged']>0x0;_0x1f0719&&(console[_0x16b5d4(0x15e)](_0x16b5d4(0x1be)+formatCountSummary(_0xddd9['counts'][_0x16b5d4(0x138)])),console[_0x16b5d4(0x15e)](_0x16b5d4(0x1a2)+formatCountSummary(_0xddd9['counts'][_0x16b5d4(0x144)])));console['log'](_0x16b5d4(0x128)+a4_0x55e839[_0x16b5d4(0x1cf)](_0x17849f)),displayDiffs(_0xddd9[_0x16b5d4(0x1cc)],_0xddd9[_0x16b5d4(0x17b)],_0xddd9['textKnowledgeBases'],_0xddd9['prompts'],_0xddd9[_0x16b5d4(0x19c)],_0xddd9['experimentalKnowledgeBases'],_0xddd9[_0x16b5d4(0x144)]);if(_0x13b997)return console['log'](a4_0x55e839[_0x16b5d4(0x1d1)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed')),0x0;if(_0x35b98a===0x0&&_0x490b7c===0x0){console[_0x16b5d4(0x15e)](a4_0x55e839[_0x16b5d4(0x18f)](_0x16b5d4(0x1da)));const _0x2eff5c=getLLMProjectUrl(_0x2f1105,_0xddd9[_0x16b5d4(0x14b)]);return console[_0x16b5d4(0x15e)](_0x16b5d4(0x170)+a4_0x55e839[_0x16b5d4(0x1cf)](_0x2eff5c)),0x0;}if(!_0x322128&&!_0x403ae0){if(!isInteractive())return console['error'](a4_0x55e839[_0x16b5d4(0x1c0)]('\x0aError:'),_0x16b5d4(0x154)),console['error'](a4_0x55e839['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x3853ed=await confirmKey(_0x16b5d4(0x1c6)+(_0x35b98a+_0x490b7c)+_0x16b5d4(0x16b));if(!_0x3853ed)return console['log'](a4_0x55e839[_0x16b5d4(0x1d1)](_0x16b5d4(0x1d8)),_0x16b5d4(0x1b7)),0x1;}const {data:_0x4eed5d}=await withSpinner(_0x16b5d4(0x1b9),()=>_0x4aaa38[_0x16b5d4(0x18a)]['pushProject'](_0x17849f,{'force':_0x403ae0})),_0x5b5453=_0x4eed5d['counts']['agents']['errors']>0x0||_0x4eed5d['counts']['knowledgeBases'][_0x16b5d4(0x1ce)]>0x0||_0x4eed5d[_0x16b5d4(0x165)][_0x16b5d4(0x1ae)][_0x16b5d4(0x1ce)]>0x0||_0x4eed5d[_0x16b5d4(0x165)]['prompts'][_0x16b5d4(0x1ce)]>0x0;if(_0x5b5453){console[_0x16b5d4(0x15e)](a4_0x55e839[_0x16b5d4(0x1d1)](_0x16b5d4(0x164))),console[_0x16b5d4(0x15e)](),console['log'](a4_0x55e839[_0x16b5d4(0x1c0)](_0x16b5d4(0x155)));for(const _0x440f3e of _0x4eed5d[_0x16b5d4(0x1cc)]){_0x440f3e[_0x16b5d4(0x185)]===_0x16b5d4(0x139)&&console[_0x16b5d4(0x15e)](a4_0x55e839[_0x16b5d4(0x1c0)]('\x20\x20Agent\x20\x22'+_0x440f3e[_0x16b5d4(0x12d)]+_0x16b5d4(0x168)+_0x440f3e['error']));}for(const _0x54ab8e of _0x4eed5d[_0x16b5d4(0x17b)]){_0x54ab8e[_0x16b5d4(0x185)]===_0x16b5d4(0x139)&&console[_0x16b5d4(0x15e)](a4_0x55e839['red'](_0x16b5d4(0x14c)+_0x54ab8e['name']+_0x16b5d4(0x168)+_0x54ab8e[_0x16b5d4(0x139)]));}for(const _0xd953d5 of _0x4eed5d[_0x16b5d4(0x1ae)]){_0xd953d5[_0x16b5d4(0x185)]===_0x16b5d4(0x139)&&console[_0x16b5d4(0x15e)](a4_0x55e839[_0x16b5d4(0x1c0)]('\x20\x20Text\x20Knowledge\x20Base\x20\x22'+_0xd953d5[_0x16b5d4(0x132)]+_0x16b5d4(0x168)+_0xd953d5[_0x16b5d4(0x139)]));}for(const _0x8f0c14 of _0x4eed5d['prompts']){_0x8f0c14[_0x16b5d4(0x185)]===_0x16b5d4(0x139)&&console['log'](a4_0x55e839[_0x16b5d4(0x1c0)]('\x20\x20Prompt\x20\x22'+_0x8f0c14[_0x16b5d4(0x132)]+_0x16b5d4(0x168)+_0x8f0c14[_0x16b5d4(0x139)]));}for(const _0x1d8ae7 of _0x4eed5d[_0x16b5d4(0x19c)]){_0x1d8ae7[_0x16b5d4(0x185)]===_0x16b5d4(0x139)&&console[_0x16b5d4(0x15e)](a4_0x55e839[_0x16b5d4(0x1c0)](_0x16b5d4(0x197)+_0x1d8ae7[_0x16b5d4(0x132)]+_0x16b5d4(0x168)+_0x1d8ae7[_0x16b5d4(0x139)]));}return 0x1;}console['log'](a4_0x55e839[_0x16b5d4(0x18f)](_0x16b5d4(0x13c)+(_0x35b98a+_0x490b7c)+_0x16b5d4(0x137)+_0x4eed5d[_0x16b5d4(0x1cd)]+'\x27'));const _0xbc5f70=getLLMProjectUrl(_0x2f1105,_0x4eed5d['projectId']);return console[_0x16b5d4(0x15e)](_0x16b5d4(0x170)+a4_0x55e839['cyan'](_0xbc5f70)),0x0;}}
@@ -1 +1 @@
1
- const a5_0x47d17d=a5_0x30ad;(function(_0x4e6c8a,_0x2c2aed){const _0x23c632=a5_0x30ad,_0x28d395=_0x4e6c8a();while(!![]){try{const _0x3f86df=-parseInt(_0x23c632(0x230))/0x1*(-parseInt(_0x23c632(0x222))/0x2)+parseInt(_0x23c632(0x1ef))/0x3+parseInt(_0x23c632(0x257))/0x4*(parseInt(_0x23c632(0x23a))/0x5)+-parseInt(_0x23c632(0x1d7))/0x6+-parseInt(_0x23c632(0x207))/0x7+-parseInt(_0x23c632(0x1dd))/0x8+parseInt(_0x23c632(0x266))/0x9;if(_0x3f86df===_0x2c2aed)break;else _0x28d395['push'](_0x28d395['shift']());}catch(_0x1d7544){_0x28d395['push'](_0x28d395['shift']());}}}(a5_0xfe96,0xb0b9c));import*as a5_0x3baeb1 from'node:fs';import*as a5_0x39557c from'node:path';import a5_0x32ce2e from'chalk';import{BaseCommand}from'./command.js';function a5_0xfe96(){const _0x4754df=['No\x20tests\x20have\x20tags\x20defined.','Evaluating\x20response...','404','multiple_agents','llmProject','Duration:\x20','6FCuVDo','projectDir','testName','has','name','tests','Available\x20tests:\x20','\x20\x20Round\x20','writeFileSync','Site:\x20','map','✓\x20PASS:\x20','repeat','testYmlPath','60077mGRYpP','llm','eval','resolveProjectId','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','Tests\x20found:\x20','log','reeval','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','Running:\x20','5691815avUkPq','execute','\x20(cached)','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','Failed:\x20\x20\x20','forEach','status','dryRun','\x20\x20Project:\x20','\x20\x20-\x20','includes','test.yml','Re-evaluating...','✗\x20ERROR:\x20','executeReeval','push','\x22:\x20','green','\x20\x20Agent:\x20',':\x20Sending\x20user\x20input...','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','projectName','output','start','\x20-\x20','now','rounds','Error\x20writing\x20output\x20file:\x20','jsonl','4uSNJGd','white','/<agent-name>','agentDirs','agent','FAIL','Round\x20','Project\x20path:\x20','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','agentName','Run\x20\x27tdx\x20agent\x20pull\x20','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','context','ERROR','17099865cowFkb','Passed:\x20\x20\x20','reason','Either\x20switch\x20to\x20the\x20\x22','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','No\x20tests\x20found\x20with\x20tags:\x20','Conversation\x20URL:\x20','\x20(new)','message','Re-evaluating\x20','find','join','dim','5060706QpczmK','Available\x20tags:\x20','red','Output\x20written\x20to:\x20','\x20\x20Evaluating...\x20','✗\x20ERROR:\x20Project\x20not\x20found:\x20','9824312VOduJt','Re-evaluation\x20Summary','\x20\x20Site:\x20','Agent:\x20','text','Errors:\x20\x20\x20','✗\x20FAIL:\x20','Running\x20test:\x20','\x20\x20tdx\x20agent\x20test\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20(requires\x20context\x20or\x20tdx.json)','resolve','...','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','split','verbose','Test\x20Summary','Round\x201/','site','737400Ocfmyp','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','not\x20found','yellow','Running\x20agent\x20tests...','some','\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','conversation_url','found','json','toISOString','New\x20tests\x20to\x20execute:\x20','length','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','...\x20','no_context','cyan','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','size','stop','Failed\x20Tests:','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','no_local_folder','toLowerCase','4683147gqrfNj','\x20\x20Conversation:\x20','substring','tags','Error:\x20No\x20previous\x20test\x20run\x20found.','add','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','PASS','round','Cached\x20run\x20is\x20from\x20site\x20\x22','agent:test','filter','trim','resolveAgentId','description','Executing\x20new\x20tests...','tsv','Total:\x20\x20\x20\x20','table','source','Using\x20agent:\x20'];a5_0xfe96=function(){return _0x4754df;};return a5_0xfe96();}import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';function a5_0x30ad(_0x226f4e,_0x10b3e1){_0x226f4e=_0x226f4e-0x1d1;const _0xfe96d1=a5_0xfe96();let _0x30ad2e=_0xfe96d1[_0x226f4e];return _0x30ad2e;}import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{['name']=a5_0x47d17d(0x211);[a5_0x47d17d(0x215)]='Run\x20tests\x20for\x20an\x20LLM\x20agent';async[a5_0x47d17d(0x23b)](_0x1e3d50){const _0x498abf=a5_0x47d17d,{options:_0x93395b,args:_0x3e7ad5,tdx:_0x507d21}=_0x1e3d50,_0x36676c=_0x3e7ad5[0x0]||'.',_0x275aa7=_0x93395b[_0x498abf(0x241)],_0x50ff84=_0x93395b,_0x3371ae=_0x50ff84[_0x498abf(0x232)]===![],_0x2bd6ba=_0x50ff84[_0x498abf(0x237)],_0x4375d3=_0x50ff84[_0x498abf(0x226)],_0x55b139=_0x50ff84['tags'],_0xb25139=_0x93395b['site'],_0x2d91bb=_0x50ff84[_0x498abf(0x250)];if(_0x2bd6ba&&_0x3371ae)return console[_0x498abf(0x236)](a5_0x32ce2e[_0x498abf(0x1d9)]('Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval')),0x1;let _0x3dfcc9=_0x498abf(0x219);if(_0x50ff84['json'])_0x3dfcc9=_0x498abf(0x1f8);else{if(_0x50ff84[_0x498abf(0x256)])_0x3dfcc9=_0x498abf(0x256);else{if(_0x50ff84[_0x498abf(0x217)])_0x3dfcc9=_0x498abf(0x217);else{if(_0x50ff84[_0x498abf(0x219)])_0x3dfcc9=_0x498abf(0x219);}}}const _0x5ed81d=_0x50ff84[_0x498abf(0x220)];let _0x40e361=_0x36676c;const _0x223745=a5_0x3baeb1['existsSync'](_0x36676c),_0x5e582=_0x36676c==='.';if(!_0x223745||_0x5e582){const _0x143d35=resolveProjectFromContext(_0x36676c,_0x5ed81d,{'requireFile':_0x498abf(0x245)});if(_0x143d35[_0x498abf(0x1f7)])_0x40e361=_0x143d35[_0x498abf(0x223)],_0x143d35[_0x498abf(0x21a)]===_0x498abf(0x264)&&console[_0x498abf(0x236)](a5_0x32ce2e[_0x498abf(0x1d6)](_0x498abf(0x21b)+_0x40e361));else switch(_0x143d35[_0x498abf(0x268)]){case _0x498abf(0x1fe):console['log'](a5_0x32ce2e[_0x498abf(0x1f2)](_0x143d35['message'])),console[_0x498abf(0x236)](),console[_0x498abf(0x236)]('Usage:'),console['log'](_0x498abf(0x1f5)),console[_0x498abf(0x236)](_0x498abf(0x1e5)),console[_0x498abf(0x236)](),console[_0x498abf(0x236)](_0x498abf(0x23d));return 0x1;case _0x498abf(0x205):console[_0x498abf(0x236)](a5_0x32ce2e['yellow'](_0x143d35[_0x498abf(0x1d2)])),console[_0x498abf(0x236)](),console[_0x498abf(0x236)](_0x498abf(0x261)+_0x143d35[_0x498abf(0x220)]+'\x27\x20to\x20create\x20the\x20folder\x20structure.');return 0x1;case _0x498abf(0x21f):{const _0x4a5e1f=a5_0x39557c['basename'](_0x143d35[_0x498abf(0x223)]);console['log'](a5_0x32ce2e[_0x498abf(0x1f2)](_0x498abf(0x1e8)+_0x143d35[_0x498abf(0x220)]+'\x22:'));for(const _0x35ef62 of _0x143d35[_0x498abf(0x25a)]){console[_0x498abf(0x236)](_0x498abf(0x243)+_0x35ef62);}return console[_0x498abf(0x236)](),console[_0x498abf(0x236)](_0x498abf(0x20d)+_0x4a5e1f+_0x498abf(0x259)),0x1;}case'no_tests':console[_0x498abf(0x236)](a5_0x32ce2e[_0x498abf(0x1f2)](_0x498abf(0x24e)+_0x143d35['llmProject']+'\x22.')),console['log'](a5_0x32ce2e[_0x498abf(0x1d6)](_0x498abf(0x25e)+_0x143d35['projectDir'])),console[_0x498abf(0x236)](),console[_0x498abf(0x236)](_0x498abf(0x238));return 0x1;}}const {definition:_0x1960a7,agentInfo:_0x4d19e2}=parseTestFile(_0x40e361);let _0x53837e=_0x1960a7[_0x498abf(0x227)];if(_0x4375d3){const _0x32ae1e=_0x4375d3[_0x498abf(0x1ea)](',')[_0x498abf(0x22c)](_0x4e050a=>_0x4e050a[_0x498abf(0x213)]());_0x53837e=_0x1960a7[_0x498abf(0x227)][_0x498abf(0x212)](_0x163ddd=>_0x32ae1e[_0x498abf(0x244)](_0x163ddd['name']));if(_0x53837e['length']===0x0)return console[_0x498abf(0x236)](a5_0x32ce2e['yellow']('No\x20tests\x20found\x20matching:\x20'+_0x4375d3)),console['log'](a5_0x32ce2e[_0x498abf(0x1d6)](_0x498abf(0x228)+_0x1960a7[_0x498abf(0x227)][_0x498abf(0x22c)](_0x4b0199=>_0x4b0199['name'])['join'](',\x20'))),0x1;}if(_0x55b139){const _0x574622=_0x55b139['split'](',')[_0x498abf(0x22c)](_0x207fb9=>_0x207fb9[_0x498abf(0x213)]()[_0x498abf(0x206)]());_0x53837e=_0x53837e[_0x498abf(0x212)](_0x16a9de=>_0x16a9de[_0x498abf(0x20a)]?.[_0x498abf(0x1f4)](_0x5ea4c8=>_0x574622[_0x498abf(0x244)](_0x5ea4c8['toLowerCase']())));if(_0x53837e[_0x498abf(0x1fb)]===0x0){console[_0x498abf(0x236)](a5_0x32ce2e['yellow'](_0x498abf(0x26b)+_0x55b139));const _0x1e520c=new Set();return _0x1960a7['tests']['forEach'](_0x3ff392=>_0x3ff392[_0x498abf(0x20a)]?.[_0x498abf(0x23f)](_0x5165c7=>_0x1e520c[_0x498abf(0x20c)](_0x5165c7))),_0x1e520c[_0x498abf(0x201)]>0x0?console[_0x498abf(0x236)](a5_0x32ce2e[_0x498abf(0x1d6)](_0x498abf(0x1d8)+[..._0x1e520c][_0x498abf(0x1d5)](',\x20'))):console[_0x498abf(0x236)](a5_0x32ce2e[_0x498abf(0x1d6)](_0x498abf(0x21c))),0x1;}}if(_0x2bd6ba)return this[_0x498abf(0x248)](_0x1e3d50,{'definition':{'tests':_0x53837e},'agentInfo':_0x4d19e2,'outputFormat':_0x3dfcc9,'outputFile':_0x2d91bb,'testNames':_0x4375d3});if(_0x275aa7){console[_0x498abf(0x236)](a5_0x32ce2e[_0x498abf(0x1ff)]('Test\x20Configuration:')),console[_0x498abf(0x236)](_0x498abf(0x1df)+a5_0x32ce2e[_0x498abf(0x258)](_0xb25139)),console[_0x498abf(0x236)](_0x498abf(0x242)+a5_0x32ce2e[_0x498abf(0x258)](_0x4d19e2[_0x498abf(0x24f)])),console[_0x498abf(0x236)](_0x498abf(0x24c)+a5_0x32ce2e['white'](_0x4d19e2[_0x498abf(0x260)])),console[_0x498abf(0x236)](),console[_0x498abf(0x236)](_0x498abf(0x235)+a5_0x32ce2e[_0x498abf(0x258)](_0x53837e['length']));for(let _0x222d54=0x0;_0x222d54<_0x53837e[_0x498abf(0x1fb)];_0x222d54++){const _0x72d836=_0x53837e[_0x222d54],_0x4fa7f1=_0x72d836[_0x498abf(0x254)][_0x498abf(0x1fb)]===0x1?_0x498abf(0x20f):_0x498abf(0x254),_0x2763fa=_0x72d836[_0x498abf(0x20a)]?.[_0x498abf(0x1fb)]?'\x20['+_0x72d836['tags']['join'](',\x20')+']':'';console[_0x498abf(0x236)]('\x20\x20'+(_0x222d54+0x1)+'.\x20'+a5_0x32ce2e['white'](_0x72d836[_0x498abf(0x226)])+'\x20('+_0x72d836[_0x498abf(0x254)][_0x498abf(0x1fb)]+'\x20'+_0x4fa7f1+')'+a5_0x32ce2e['dim'](_0x2763fa));}return 0x0;}let _0x491b8d,_0xe9ce0a;try{_0x491b8d=await _0x507d21[_0x498abf(0x231)][_0x498abf(0x233)](_0x4d19e2[_0x498abf(0x24f)]);}catch(_0x439583){const _0x3bb6a5=_0x439583 instanceof Error?_0x439583[_0x498abf(0x1d2)]:String(_0x439583);return _0x3bb6a5[_0x498abf(0x244)](_0x498abf(0x21e))||_0x3bb6a5[_0x498abf(0x206)]()[_0x498abf(0x244)](_0x498abf(0x1f1))?console['log'](a5_0x32ce2e[_0x498abf(0x1d9)](_0x498abf(0x1dc)+_0x4d19e2[_0x498abf(0x24f)])):console['log'](a5_0x32ce2e['red'](_0x498abf(0x263)+_0x4d19e2[_0x498abf(0x24f)]+_0x498abf(0x24a)+_0x3bb6a5)),0x1;}try{_0xe9ce0a=await _0x507d21[_0x498abf(0x231)][_0x498abf(0x214)](_0x4d19e2[_0x498abf(0x260)],_0x491b8d);}catch(_0x2fb472){const _0x52a618=_0x2fb472 instanceof Error?_0x2fb472[_0x498abf(0x1d2)]:String(_0x2fb472);return _0x52a618[_0x498abf(0x244)](_0x498abf(0x21e))||_0x52a618['toLowerCase']()['includes'](_0x498abf(0x1f1))?console[_0x498abf(0x236)](a5_0x32ce2e[_0x498abf(0x1d9)](_0x498abf(0x1fc)+_0x4d19e2[_0x498abf(0x260)])):console['log'](a5_0x32ce2e[_0x498abf(0x1d9)](_0x498abf(0x26a)+_0x4d19e2[_0x498abf(0x260)]+_0x498abf(0x24a)+_0x52a618)),0x1;}let _0x27cac9;if(!_0x3371ae)try{_0x27cac9=await setupEvaluatorAgent(_0x507d21[_0x498abf(0x231)],_0x93395b[_0x498abf(0x1eb)]);}catch(_0xf47f80){const _0x5adfc2=_0xf47f80 instanceof Error?_0xf47f80[_0x498abf(0x1d2)]:String(_0xf47f80);return console[_0x498abf(0x236)](a5_0x32ce2e['red'](_0x498abf(0x1f0)+_0x5adfc2)),0x1;}console[_0x498abf(0x236)](a5_0x32ce2e['cyan'](_0x498abf(0x1f3))),console[_0x498abf(0x236)](_0x498abf(0x22b)+a5_0x32ce2e[_0x498abf(0x258)](_0xb25139)),console['log'](_0x498abf(0x1e0)+a5_0x32ce2e[_0x498abf(0x258)](_0x4d19e2[_0x498abf(0x24f)]+'/'+_0x4d19e2[_0x498abf(0x260)])),console[_0x498abf(0x236)]();const _0x3a2f1f=[],_0x1c3974=[],_0x865854=Date[_0x498abf(0x253)]();for(let _0x46e4ad=0x0;_0x46e4ad<_0x53837e[_0x498abf(0x1fb)];_0x46e4ad++){const _0x2369a0=_0x53837e[_0x46e4ad];_0x53837e[_0x498abf(0x1fb)]>0x1?console[_0x498abf(0x236)]('Test\x20'+(_0x46e4ad+0x1)+'/'+_0x53837e[_0x498abf(0x1fb)]+':\x20'+a5_0x32ce2e['white'](_0x2369a0[_0x498abf(0x226)])):console[_0x498abf(0x236)](_0x498abf(0x1e4)+a5_0x32ce2e[_0x498abf(0x258)](_0x2369a0[_0x498abf(0x226)]));const _0x8a5a44=createCommandSpinner(_0x498abf(0x1ed)+_0x2369a0[_0x498abf(0x254)][_0x498abf(0x1fb)]+_0x498abf(0x24d));_0x8a5a44[_0x498abf(0x251)]();try{const {result:_0x2977dd,conversation:_0x199a9e}=await runTest(_0x507d21[_0x498abf(0x231)],_0x2369a0,{'agentId':_0xe9ce0a,'projectId':_0x491b8d,'site':_0xb25139,'noEval':_0x3371ae,'evaluatorId':_0x27cac9,'onRoundStart':(_0x14b73e,_0x2563c4)=>{const _0x4a72d7=_0x498abf;_0x8a5a44[_0x4a72d7(0x1e1)]=_0x4a72d7(0x25d)+(_0x14b73e+0x1)+'/'+_0x2563c4+_0x4a72d7(0x24d);},'onRoundComplete':(_0x29f382,_0x4cd42e,_0x5ceb0f)=>{const _0x23813f=_0x498abf,_0x49507b=formatElapsed(_0x4cd42e);_0x5ceb0f?console[_0x23813f(0x236)](_0x23813f(0x229)+(_0x29f382+0x1)+'/'+_0x2369a0[_0x23813f(0x254)][_0x23813f(0x1fb)]+'...\x20'+a5_0x32ce2e['green']('✓')+'\x20('+_0x49507b+')'):console[_0x23813f(0x236)](_0x23813f(0x229)+(_0x29f382+0x1)+'/'+_0x2369a0[_0x23813f(0x254)]['length']+'...\x20'+a5_0x32ce2e[_0x23813f(0x1d9)]('✗'));},'onEvaluationStart':()=>{const _0x2f9351=_0x498abf;_0x8a5a44['text']=_0x2f9351(0x21d);},'onEvaluationComplete':_0x19adc4=>{const _0x347221=_0x498abf,_0x261e04=formatElapsed(_0x19adc4);console[_0x347221(0x236)](_0x347221(0x1db)+a5_0x32ce2e[_0x347221(0x24b)]('✓')+'\x20('+_0x261e04+')');}});_0x8a5a44[_0x498abf(0x202)](),_0x3a2f1f[_0x498abf(0x249)](_0x2977dd),_0x1c3974[_0x498abf(0x249)](_0x199a9e);if(_0x2977dd[_0x498abf(0x240)]===_0x498abf(0x20e))console[_0x498abf(0x236)](a5_0x32ce2e['green']('✓\x20PASS:\x20'+_0x2977dd[_0x498abf(0x268)]));else _0x2977dd[_0x498abf(0x240)]===_0x498abf(0x25c)?console[_0x498abf(0x236)](a5_0x32ce2e[_0x498abf(0x1d9)](_0x498abf(0x1e3)+_0x2977dd[_0x498abf(0x268)])):console[_0x498abf(0x236)](a5_0x32ce2e[_0x498abf(0x1d9)](_0x498abf(0x247)+_0x2977dd['reason']));_0x2977dd[_0x498abf(0x1f6)]&&console[_0x498abf(0x236)](a5_0x32ce2e['dim'](_0x498abf(0x26c)+_0x2977dd[_0x498abf(0x1f6)])),console['log']();}catch(_0x19e6eb){_0x8a5a44[_0x498abf(0x202)]();const _0x958c74=_0x19e6eb instanceof Error?_0x19e6eb[_0x498abf(0x1d2)]:String(_0x19e6eb);console[_0x498abf(0x236)](a5_0x32ce2e[_0x498abf(0x1d9)](_0x498abf(0x247)+_0x958c74)),console[_0x498abf(0x236)](),_0x3a2f1f['push']({'name':_0x2369a0['name'],'status':'ERROR','reason':_0x958c74,'timestamp':new Date()[_0x498abf(0x1f9)](),'duration_ms':0x0});}}const _0xcd3c7f=Date[_0x498abf(0x253)]()-_0x865854,_0x58a2c6=_0x3a2f1f['filter'](_0x119535=>_0x119535['status']==='PASS')[_0x498abf(0x1fb)],_0x45197a=_0x3a2f1f[_0x498abf(0x212)](_0x4d954d=>_0x4d954d[_0x498abf(0x240)]===_0x498abf(0x25c))['length'],_0x210d47=_0x3a2f1f[_0x498abf(0x212)](_0x51d9b6=>_0x51d9b6[_0x498abf(0x240)]===_0x498abf(0x265))['length'];console[_0x498abf(0x236)]('━'[_0x498abf(0x22e)](0x3c)),console[_0x498abf(0x236)](_0x498abf(0x1ec)),console['log']('━'['repeat'](0x3c)),console[_0x498abf(0x236)](_0x498abf(0x218)+_0x3a2f1f[_0x498abf(0x1fb)]),console['log'](_0x498abf(0x267)+a5_0x32ce2e[_0x498abf(0x24b)](_0x58a2c6)),console[_0x498abf(0x236)](_0x498abf(0x23e)+a5_0x32ce2e[_0x498abf(0x1d9)](_0x45197a));_0x210d47>0x0&&console[_0x498abf(0x236)](_0x498abf(0x1e2)+a5_0x32ce2e['red'](_0x210d47));console[_0x498abf(0x236)](_0x498abf(0x221)+formatElapsed(_0xcd3c7f)),console[_0x498abf(0x236)]('━'['repeat'](0x3c));const _0x404eff=_0x3a2f1f[_0x498abf(0x212)](_0x5965ed=>_0x5965ed[_0x498abf(0x240)]!==_0x498abf(0x20e));if(_0x404eff[_0x498abf(0x1fb)]>0x0){console[_0x498abf(0x236)](),console[_0x498abf(0x236)](_0x498abf(0x203));for(const _0x2738fa of _0x404eff){const _0x479659=a5_0x32ce2e[_0x498abf(0x1d9)]('✗'),_0x4456a7=_0x2738fa[_0x498abf(0x268)][_0x498abf(0x1fb)]>0x32?_0x2738fa[_0x498abf(0x268)][_0x498abf(0x209)](0x0,0x32)+_0x498abf(0x1e7):_0x2738fa[_0x498abf(0x268)];console['log']('\x20\x20'+_0x479659+'\x20'+_0x2738fa[_0x498abf(0x226)]+':\x20'+_0x4456a7);}}const _0xc6822b={'summary':{'total':_0x3a2f1f[_0x498abf(0x1fb)],'passed':_0x58a2c6,'failed':_0x45197a,'errors':_0x210d47>0x0?_0x210d47:undefined,'duration_ms':_0xcd3c7f},'tests':_0x3a2f1f,'agent':{'project':_0x4d19e2['projectName'],'name':_0x4d19e2[_0x498abf(0x260)],'site':_0xb25139},'timestamp':new Date(_0x865854)[_0x498abf(0x1f9)]()};try{const _0x2d0fe3=buildCachedTestRun(_0x1c3974,{'site':_0xb25139,'projectId':_0x491b8d,'projectName':_0x4d19e2[_0x498abf(0x24f)],'agentId':_0xe9ce0a,'agentName':_0x4d19e2['agentName'],'testYmlPath':a5_0x39557c[_0x498abf(0x1e6)](_0x4d19e2[_0x498abf(0x22f)])});saveLastTestRun(_0x2d0fe3);}catch{}if(_0x3dfcc9!==_0x498abf(0x219)||_0x2d91bb){const _0x48bdeb=formatResults(_0xc6822b,_0x3dfcc9);if(_0x2d91bb)try{a5_0x3baeb1['writeFileSync'](_0x2d91bb,_0x48bdeb,'utf-8'),console['log'](),console['log'](a5_0x32ce2e[_0x498abf(0x1d6)](_0x498abf(0x1da)+_0x2d91bb));}catch(_0x3bb1bc){return console[_0x498abf(0x236)](),console[_0x498abf(0x236)](a5_0x32ce2e[_0x498abf(0x1d9)](_0x498abf(0x255)+_0x3bb1bc)),0x1;}else console['log'](),console['log'](_0x48bdeb);}return _0x404eff[_0x498abf(0x1fb)]>0x0?0x1:0x0;}async[a5_0x47d17d(0x248)](_0x47e6df,_0x36b4ed){const _0x445cb6=a5_0x47d17d,{options:_0x5a2c2c,tdx:_0x3b71a0}=_0x47e6df,{definition:_0x1457fc,agentInfo:_0x2ed787,outputFormat:_0x1b34b4,outputFile:_0x48249d}=_0x36b4ed,_0x1594f4=_0x5a2c2c[_0x445cb6(0x1ee)],_0x14354f=loadLastTestRun();if(!_0x14354f)return console[_0x445cb6(0x236)](a5_0x32ce2e[_0x445cb6(0x1d9)](_0x445cb6(0x20b))),console[_0x445cb6(0x236)](a5_0x32ce2e[_0x445cb6(0x1d6)]('Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.')),0x1;if(_0x14354f[_0x445cb6(0x25b)][_0x445cb6(0x260)]!==_0x2ed787[_0x445cb6(0x260)])return console[_0x445cb6(0x236)](a5_0x32ce2e[_0x445cb6(0x1d9)](_0x445cb6(0x262)+_0x14354f[_0x445cb6(0x25b)][_0x445cb6(0x260)]+_0x445cb6(0x234)+_0x2ed787['agentName']+'\x22.')),console[_0x445cb6(0x236)](a5_0x32ce2e[_0x445cb6(0x1d6)](_0x445cb6(0x200))),0x1;const _0x1def45=new Set(_0x14354f['conversations']['map'](_0x3eb91e=>_0x3eb91e[_0x445cb6(0x224)])),_0x404116=_0x1457fc[_0x445cb6(0x227)][_0x445cb6(0x212)](_0x18e6c8=>!_0x1def45['has'](_0x18e6c8[_0x445cb6(0x226)]));if(_0x404116[_0x445cb6(0x1fb)]>0x0&&_0x14354f[_0x445cb6(0x1ee)]!==_0x1594f4)return console['log'](a5_0x32ce2e[_0x445cb6(0x1d9)](_0x445cb6(0x204))),console[_0x445cb6(0x236)](a5_0x32ce2e[_0x445cb6(0x1d6)](_0x445cb6(0x210)+_0x14354f[_0x445cb6(0x1ee)]+'\x22,\x20but\x20current\x20site\x20is\x20\x22'+_0x1594f4+'\x22.')),console[_0x445cb6(0x236)](a5_0x32ce2e['dim'](_0x445cb6(0x269)+_0x14354f[_0x445cb6(0x1ee)]+_0x445cb6(0x1e9))),0x1;const _0x32b86e=_0x1457fc[_0x445cb6(0x227)]['filter'](_0x538fad=>_0x1def45[_0x445cb6(0x225)](_0x538fad[_0x445cb6(0x226)])),_0x309d3e=_0x404116;let _0x498dbb;try{_0x498dbb=await setupEvaluatorAgent(_0x3b71a0['llm'],_0x5a2c2c['verbose']);}catch(_0x23e879){const _0x53f45c=_0x23e879 instanceof Error?_0x23e879['message']:String(_0x23e879);return console[_0x445cb6(0x236)](a5_0x32ce2e['red'](_0x445cb6(0x1f0)+_0x53f45c)),0x1;}console['log'](a5_0x32ce2e[_0x445cb6(0x1ff)]('Re-evaluating\x20cached\x20test\x20run...')),console['log']('Cached\x20run\x20from:\x20'+a5_0x32ce2e[_0x445cb6(0x258)](_0x14354f['timestamp'])),console[_0x445cb6(0x236)](_0x445cb6(0x1e0)+a5_0x32ce2e[_0x445cb6(0x258)](_0x14354f['agent'][_0x445cb6(0x24f)]+'/'+_0x14354f['agent'][_0x445cb6(0x260)]));_0x309d3e['length']>0x0&&console['log'](_0x445cb6(0x1fa)+a5_0x32ce2e['yellow'](_0x309d3e[_0x445cb6(0x1fb)]));console[_0x445cb6(0x236)]();const _0x58e204=[],_0xd717d5=Date['now'](),_0x1822c1=createCommandSpinner(_0x445cb6(0x246));if(_0x32b86e[_0x445cb6(0x1fb)]>0x0)try{const _0x8e6c1a=await reevaluateFromCache(_0x3b71a0[_0x445cb6(0x231)],_0x14354f,{'tests':_0x32b86e},{'evaluatorId':_0x498dbb,'onTestStart':(_0x87a367,_0x2b0db6,_0x3b72ba)=>{const _0x4064cb=_0x445cb6;_0x1822c1['text']=_0x4064cb(0x1d3)+(_0x2b0db6+0x1)+'/'+_0x3b72ba+':\x20'+_0x87a367+'...';if(!_0x1822c1['isSpinning'])_0x1822c1[_0x4064cb(0x251)]();},'onTestComplete':(_0x2af094,_0x460253)=>{const _0x3093ee=_0x445cb6;_0x1822c1[_0x3093ee(0x202)]();if(_0x460253['status']===_0x3093ee(0x20e))console[_0x3093ee(0x236)](a5_0x32ce2e[_0x3093ee(0x24b)](_0x3093ee(0x22d)+_0x2af094)+a5_0x32ce2e[_0x3093ee(0x1d6)](_0x3093ee(0x23c)));else _0x460253['status']===_0x3093ee(0x25c)?console[_0x3093ee(0x236)](a5_0x32ce2e['red'](_0x3093ee(0x1e3)+_0x2af094+_0x3093ee(0x252)+_0x460253[_0x3093ee(0x268)])+a5_0x32ce2e['dim'](_0x3093ee(0x23c))):console['log'](a5_0x32ce2e[_0x3093ee(0x1d9)]('✗\x20ERROR:\x20'+_0x2af094+'\x20-\x20'+_0x460253[_0x3093ee(0x268)]));_0x460253[_0x3093ee(0x1f6)]&&console[_0x3093ee(0x236)](a5_0x32ce2e['dim'](_0x3093ee(0x208)+_0x460253[_0x3093ee(0x1f6)])),_0x58e204['push'](_0x460253);},'onTestSkipped':(_0x1be6fe,_0x17e5ea)=>{const _0xbb5252=_0x445cb6;_0x1822c1[_0xbb5252(0x202)](),console[_0xbb5252(0x236)](a5_0x32ce2e['yellow']('⚠\x20SKIPPED:\x20'+_0x1be6fe+'\x20-\x20'+_0x17e5ea));}});for(const _0x32ba2d of _0x8e6c1a){!_0x58e204[_0x445cb6(0x1d4)](_0x3bf75f=>_0x3bf75f[_0x445cb6(0x226)]===_0x32ba2d[_0x445cb6(0x226)])&&_0x58e204['push'](_0x32ba2d);}}catch(_0x268fc3){_0x1822c1[_0x445cb6(0x202)]();const _0xb6e2da=_0x268fc3 instanceof Error?_0x268fc3['message']:String(_0x268fc3);return console[_0x445cb6(0x236)](a5_0x32ce2e[_0x445cb6(0x1d9)](_0x445cb6(0x25f)+_0xb6e2da)),0x1;}_0x1822c1[_0x445cb6(0x202)]();if(_0x309d3e['length']>0x0){console[_0x445cb6(0x236)](),console[_0x445cb6(0x236)](a5_0x32ce2e[_0x445cb6(0x1ff)](_0x445cb6(0x216)));const {projectId:_0x555f4f,agentId:_0x440240}=_0x14354f[_0x445cb6(0x25b)];for(const _0x2f96b3 of _0x309d3e){console[_0x445cb6(0x236)](_0x445cb6(0x239)+a5_0x32ce2e['white'](_0x2f96b3[_0x445cb6(0x226)]));const _0x37649e=createCommandSpinner(_0x445cb6(0x1ed)+_0x2f96b3[_0x445cb6(0x254)][_0x445cb6(0x1fb)]+_0x445cb6(0x24d));_0x37649e[_0x445cb6(0x251)]();try{const {result:_0xfa277d}=await runTest(_0x3b71a0[_0x445cb6(0x231)],_0x2f96b3,{'agentId':_0x440240,'projectId':_0x555f4f,'site':_0x14354f[_0x445cb6(0x1ee)],'noEval':![],'evaluatorId':_0x498dbb,'onRoundStart':(_0x232b42,_0x50b8a8)=>{const _0x3ab2e1=_0x445cb6;_0x37649e[_0x3ab2e1(0x1e1)]='Round\x20'+(_0x232b42+0x1)+'/'+_0x50b8a8+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x10707b,_0x105dc5,_0x2b27fa)=>{const _0x3dbefe=_0x445cb6,_0x303e93=formatElapsed(_0x105dc5);_0x2b27fa?console[_0x3dbefe(0x236)](_0x3dbefe(0x229)+(_0x10707b+0x1)+'/'+_0x2f96b3[_0x3dbefe(0x254)][_0x3dbefe(0x1fb)]+_0x3dbefe(0x1fd)+a5_0x32ce2e['green']('✓')+'\x20('+_0x303e93+')'):console[_0x3dbefe(0x236)](_0x3dbefe(0x229)+(_0x10707b+0x1)+'/'+_0x2f96b3[_0x3dbefe(0x254)]['length']+'...\x20'+a5_0x32ce2e[_0x3dbefe(0x1d9)]('✗'));},'onEvaluationStart':()=>{const _0x391e01=_0x445cb6;_0x37649e[_0x391e01(0x1e1)]='Evaluating\x20response...';},'onEvaluationComplete':_0x313feb=>{const _0x37b388=_0x445cb6,_0x5512fa=formatElapsed(_0x313feb);console['log'](_0x37b388(0x1db)+a5_0x32ce2e[_0x37b388(0x24b)]('✓')+'\x20('+_0x5512fa+')');}});_0x37649e['stop'](),_0x58e204[_0x445cb6(0x249)](_0xfa277d);if(_0xfa277d[_0x445cb6(0x240)]==='PASS')console['log'](a5_0x32ce2e[_0x445cb6(0x24b)](_0x445cb6(0x22d)+_0xfa277d[_0x445cb6(0x268)])+a5_0x32ce2e['dim'](_0x445cb6(0x1d1)));else _0xfa277d['status']===_0x445cb6(0x25c)?console['log'](a5_0x32ce2e[_0x445cb6(0x1d9)](_0x445cb6(0x1e3)+_0xfa277d[_0x445cb6(0x268)])+a5_0x32ce2e[_0x445cb6(0x1d6)](_0x445cb6(0x1d1))):console['log'](a5_0x32ce2e['red']('✗\x20ERROR:\x20'+_0xfa277d[_0x445cb6(0x268)]));_0xfa277d['conversation_url']&&console['log'](a5_0x32ce2e[_0x445cb6(0x1d6)](_0x445cb6(0x208)+_0xfa277d[_0x445cb6(0x1f6)]));}catch(_0x22dd76){_0x37649e['stop']();const _0x1262fd=_0x22dd76 instanceof Error?_0x22dd76[_0x445cb6(0x1d2)]:String(_0x22dd76);console['log'](a5_0x32ce2e['red'](_0x445cb6(0x247)+_0x1262fd)),_0x58e204[_0x445cb6(0x249)]({'name':_0x2f96b3['name'],'status':'ERROR','reason':_0x1262fd,'timestamp':new Date()[_0x445cb6(0x1f9)](),'duration_ms':0x0});}}}console[_0x445cb6(0x236)]();const _0x228ef8=Date[_0x445cb6(0x253)]()-_0xd717d5,_0xefb3fb=_0x58e204['filter'](_0x10ec5b=>_0x10ec5b['status']===_0x445cb6(0x20e))['length'],_0x540994=_0x58e204[_0x445cb6(0x212)](_0x232a62=>_0x232a62[_0x445cb6(0x240)]===_0x445cb6(0x25c))[_0x445cb6(0x1fb)],_0x2f01d0=_0x58e204['filter'](_0x226354=>_0x226354['status']===_0x445cb6(0x265))[_0x445cb6(0x1fb)];console['log']('━'[_0x445cb6(0x22e)](0x3c)),console[_0x445cb6(0x236)](_0x445cb6(0x1de)),console[_0x445cb6(0x236)]('━'['repeat'](0x3c)),console[_0x445cb6(0x236)](_0x445cb6(0x218)+_0x58e204[_0x445cb6(0x1fb)]),console[_0x445cb6(0x236)](_0x445cb6(0x267)+a5_0x32ce2e[_0x445cb6(0x24b)](_0xefb3fb)),console[_0x445cb6(0x236)](_0x445cb6(0x23e)+a5_0x32ce2e[_0x445cb6(0x1d9)](_0x540994));_0x2f01d0>0x0&&console[_0x445cb6(0x236)](_0x445cb6(0x1e2)+a5_0x32ce2e[_0x445cb6(0x1d9)](_0x2f01d0));console[_0x445cb6(0x236)](_0x445cb6(0x221)+formatElapsed(_0x228ef8)),console[_0x445cb6(0x236)]('━'[_0x445cb6(0x22e)](0x3c));const _0x4e1d0c={'summary':{'total':_0x58e204[_0x445cb6(0x1fb)],'passed':_0xefb3fb,'failed':_0x540994,'errors':_0x2f01d0>0x0?_0x2f01d0:undefined,'duration_ms':_0x228ef8},'tests':_0x58e204,'agent':{'project':_0x2ed787[_0x445cb6(0x24f)],'name':_0x2ed787[_0x445cb6(0x260)],'site':_0x1594f4},'timestamp':new Date(_0xd717d5)[_0x445cb6(0x1f9)]()};if(_0x1b34b4!==_0x445cb6(0x219)||_0x48249d){const _0x5c1855=formatResults(_0x4e1d0c,_0x1b34b4);if(_0x48249d)try{a5_0x3baeb1[_0x445cb6(0x22a)](_0x48249d,_0x5c1855,'utf-8'),console[_0x445cb6(0x236)](),console[_0x445cb6(0x236)](a5_0x32ce2e['dim'](_0x445cb6(0x1da)+_0x48249d));}catch(_0x4f87b6){return console[_0x445cb6(0x236)](),console[_0x445cb6(0x236)](a5_0x32ce2e[_0x445cb6(0x1d9)](_0x445cb6(0x255)+_0x4f87b6)),0x1;}else console[_0x445cb6(0x236)](),console[_0x445cb6(0x236)](_0x5c1855);}const _0x536dcb=_0x58e204[_0x445cb6(0x212)](_0x1a86d0=>_0x1a86d0[_0x445cb6(0x240)]!=='PASS');return _0x536dcb[_0x445cb6(0x1fb)]>0x0?0x1:0x0;}}
1
+ const a5_0xab8cff=a5_0x1f06;(function(_0x5a59f7,_0x41c44b){const _0x2a1909=a5_0x1f06,_0x1c1e3e=_0x5a59f7();while(!![]){try{const _0x2e5a0b=parseInt(_0x2a1909(0x188))/0x1*(-parseInt(_0x2a1909(0x196))/0x2)+parseInt(_0x2a1909(0x1c5))/0x3*(parseInt(_0x2a1909(0x1b6))/0x4)+-parseInt(_0x2a1909(0x197))/0x5+parseInt(_0x2a1909(0x18a))/0x6*(-parseInt(_0x2a1909(0x16f))/0x7)+parseInt(_0x2a1909(0x199))/0x8+parseInt(_0x2a1909(0x179))/0x9+-parseInt(_0x2a1909(0x1d4))/0xa*(-parseInt(_0x2a1909(0x1d9))/0xb);if(_0x2e5a0b===_0x41c44b)break;else _0x1c1e3e['push'](_0x1c1e3e['shift']());}catch(_0x429ca7){_0x1c1e3e['push'](_0x1c1e3e['shift']());}}}(a5_0x5db9,0x6f786));import*as a5_0x183389 from'node:fs';import*as a5_0x1cee67 from'node:path';import a5_0x307e0f 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';function a5_0x5db9(){const _0x4b011b=[':\x20Sending\x20user\x20input...','Error:\x20No\x20previous\x20test\x20run\x20found.','\x20(new)','llmProject','eval','Available\x20tests:\x20','toISOString','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','agentDirs','Available\x20tags:\x20','52147JlHHhM','\x20\x20Conversation:\x20','1235946SjJGXO','no_local_folder','site','add','json','✓\x20PASS:\x20','Project\x20path:\x20','\x20(cached)','PASS','Duration:\x20','has','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','8mJHljr','3663555yTJsvd','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','483912necekN','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','substring','Run\x20\x27tdx\x20agent\x20pull\x20','reason','Output\x20written\x20to:\x20','Evaluating\x20response...','Site:\x20','New\x20tests\x20to\x20execute:\x20','source','now','reeval','stop','agent','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','Running\x20agent\x20tests...','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','testYmlPath','\x20\x20Site:\x20','multiple_agents','llm','Total:\x20\x20\x20\x20','FAIL','No\x20tests\x20have\x20tags\x20defined.','join','Agent:\x20','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','Error\x20writing\x20output\x20file:\x20','green','3404rBdIRE','conversation_url','Re-evaluating...','dim','Re-evaluating\x20','...\x20','resolve','ERROR','name','Round\x201/','\x20\x20Project:\x20','no_tests','table','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','Round\x20','1146pAUSRW','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','includes','projectDir','tsv','push','Run\x20tests\x20for\x20an\x20LLM\x20agent','\x20\x20Agent:\x20','Test\x20Configuration:','yellow','repeat','Tests\x20found:\x20','\x20\x20tdx\x20agent\x20test\x20<path>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20from\x20path','/<agent-name>','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','70djfOzu','Conversation\x20URL:\x20','filter','Re-evaluation\x20Summary','map','887557lQnNQD','agentName','writeFileSync','no_context','projectName','✗\x20ERROR:\x20','cyan','verbose','not\x20found','\x20-\x20','Cached\x20run\x20from:\x20','status','404','...','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','dryRun','message','output','jsonl','\x27\x20to\x20create\x20the\x20folder\x20structure.','tags','description','white','size','No\x20tests\x20found\x20matching:\x20','✗\x20ERROR:\x20Project\x20not\x20found:\x20','basename','red','tests','testName','log','agent:test','Running\x20test:\x20','\x20\x20Evaluating...\x20','forEach','executeReeval','✗\x20FAIL:\x20','\x22,\x20but\x20current\x20site\x20is\x20\x22','\x20\x20Round\x20','execute','timestamp','rounds','Failed:\x20\x20\x20','length','start','test.yml','14CnJPOk','toLowerCase','\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)','utf-8','resolveProjectId','split','Executing\x20new\x20tests...','text','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','Cached\x20run\x20is\x20from\x20site\x20\x22','7735347dKzTOR','Errors:\x20\x20\x20','\x22:\x20'];a5_0x5db9=function(){return _0x4b011b;};return a5_0x5db9();}function a5_0x1f06(_0x14fc2e,_0x1e7bf5){_0x14fc2e=_0x14fc2e-0x167;const _0x5db9b7=a5_0x5db9();let _0x1f069f=_0x5db9b7[_0x14fc2e];return _0x1f069f;}import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0xab8cff(0x1be)]=a5_0xab8cff(0x1f8);[a5_0xab8cff(0x1ee)]=a5_0xab8cff(0x1cb);async[a5_0xab8cff(0x168)](_0x5c23f1){const _0x39dbfc=a5_0xab8cff,{options:_0x57a5df,args:_0x24d092,tdx:_0x5c688b}=_0x5c23f1,_0x2025e2=_0x24d092[0x0]||'.',_0x450680=_0x57a5df[_0x39dbfc(0x1e8)],_0x149d97=_0x57a5df,_0x12c8d8=_0x149d97[_0x39dbfc(0x180)]===![],_0x33deca=_0x149d97[_0x39dbfc(0x1a4)],_0x56977f=_0x149d97[_0x39dbfc(0x1be)],_0x1f837f=_0x149d97[_0x39dbfc(0x1ed)],_0x5c462f=_0x57a5df[_0x39dbfc(0x18c)],_0x14d238=_0x149d97[_0x39dbfc(0x1ea)];if(_0x33deca&&_0x12c8d8)return console[_0x39dbfc(0x1f7)](a5_0x307e0f['red']('Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval')),0x1;let _0x2affe7='table';if(_0x149d97[_0x39dbfc(0x18e)])_0x2affe7=_0x39dbfc(0x18e);else{if(_0x149d97[_0x39dbfc(0x1eb)])_0x2affe7='jsonl';else{if(_0x149d97[_0x39dbfc(0x1c9)])_0x2affe7='tsv';else{if(_0x149d97[_0x39dbfc(0x1c2)])_0x2affe7='table';}}}const _0x3d9c28=_0x149d97['llmProject'];let _0x281d18=_0x2025e2;const _0x370cfb=a5_0x183389['existsSync'](_0x2025e2),_0x1889c5=_0x2025e2==='.';if(!_0x370cfb||_0x1889c5){const _0x2230ef=resolveProjectFromContext(_0x2025e2,_0x3d9c28,{'requireFile':_0x39dbfc(0x16e)});if(_0x2230ef['found'])_0x281d18=_0x2230ef['projectDir'],_0x2230ef[_0x39dbfc(0x1a2)]==='context'&&console['log'](a5_0x307e0f['dim']('Using\x20agent:\x20'+_0x281d18));else switch(_0x2230ef[_0x39dbfc(0x19d)]){case _0x39dbfc(0x1dc):console[_0x39dbfc(0x1f7)](a5_0x307e0f[_0x39dbfc(0x1ce)](_0x2230ef[_0x39dbfc(0x1e9)])),console[_0x39dbfc(0x1f7)](),console[_0x39dbfc(0x1f7)]('Usage:'),console[_0x39dbfc(0x1f7)](_0x39dbfc(0x1d1)),console['log'](_0x39dbfc(0x171)),console[_0x39dbfc(0x1f7)](),console['log'](_0x39dbfc(0x1a7));return 0x1;case _0x39dbfc(0x18b):console[_0x39dbfc(0x1f7)](a5_0x307e0f['yellow'](_0x2230ef[_0x39dbfc(0x1e9)])),console[_0x39dbfc(0x1f7)](),console[_0x39dbfc(0x1f7)](_0x39dbfc(0x19c)+_0x2230ef[_0x39dbfc(0x17f)]+_0x39dbfc(0x1ec));return 0x1;case _0x39dbfc(0x1ac):{const _0x215be6=a5_0x1cee67[_0x39dbfc(0x1f3)](_0x2230ef[_0x39dbfc(0x1c8)]);console['log'](a5_0x307e0f['yellow']('Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22'+_0x2230ef[_0x39dbfc(0x17f)]+'\x22:'));for(const _0x12e982 of _0x2230ef[_0x39dbfc(0x186)]){console[_0x39dbfc(0x1f7)]('\x20\x20-\x20'+_0x12e982);}return console['log'](),console[_0x39dbfc(0x1f7)](_0x39dbfc(0x1a9)+_0x215be6+_0x39dbfc(0x1d2)),0x1;}case _0x39dbfc(0x1c1):console[_0x39dbfc(0x1f7)](a5_0x307e0f[_0x39dbfc(0x1ce)](_0x39dbfc(0x1c3)+_0x2230ef['llmProject']+'\x22.')),console[_0x39dbfc(0x1f7)](a5_0x307e0f[_0x39dbfc(0x1b9)](_0x39dbfc(0x190)+_0x2230ef[_0x39dbfc(0x1c8)])),console['log'](),console['log'](_0x39dbfc(0x185));return 0x1;}}const {definition:_0x2c0168,agentInfo:_0x58cf18}=parseTestFile(_0x281d18);let _0x4b3f2d=_0x2c0168['tests'];if(_0x56977f){const _0x26881b=_0x56977f[_0x39dbfc(0x174)](',')[_0x39dbfc(0x1d8)](_0x147b8b=>_0x147b8b['trim']());_0x4b3f2d=_0x2c0168[_0x39dbfc(0x1f5)][_0x39dbfc(0x1d6)](_0x681de0=>_0x26881b[_0x39dbfc(0x1c7)](_0x681de0[_0x39dbfc(0x1be)]));if(_0x4b3f2d[_0x39dbfc(0x16c)]===0x0)return console[_0x39dbfc(0x1f7)](a5_0x307e0f[_0x39dbfc(0x1ce)](_0x39dbfc(0x1f1)+_0x56977f)),console[_0x39dbfc(0x1f7)](a5_0x307e0f['dim'](_0x39dbfc(0x181)+_0x2c0168[_0x39dbfc(0x1f5)][_0x39dbfc(0x1d8)](_0x3f529a=>_0x3f529a[_0x39dbfc(0x1be)])[_0x39dbfc(0x1b1)](',\x20'))),0x1;}if(_0x1f837f){const _0x5e9c36=_0x1f837f['split'](',')[_0x39dbfc(0x1d8)](_0x109796=>_0x109796['trim']()[_0x39dbfc(0x170)]());_0x4b3f2d=_0x4b3f2d[_0x39dbfc(0x1d6)](_0x204c9b=>_0x204c9b[_0x39dbfc(0x1ed)]?.['some'](_0x158fe6=>_0x5e9c36[_0x39dbfc(0x1c7)](_0x158fe6[_0x39dbfc(0x170)]())));if(_0x4b3f2d[_0x39dbfc(0x16c)]===0x0){console[_0x39dbfc(0x1f7)](a5_0x307e0f['yellow']('No\x20tests\x20found\x20with\x20tags:\x20'+_0x1f837f));const _0x5d97f3=new Set();return _0x2c0168[_0x39dbfc(0x1f5)]['forEach'](_0x1cf97b=>_0x1cf97b[_0x39dbfc(0x1ed)]?.[_0x39dbfc(0x1fb)](_0x63cb11=>_0x5d97f3[_0x39dbfc(0x18d)](_0x63cb11))),_0x5d97f3[_0x39dbfc(0x1f0)]>0x0?console[_0x39dbfc(0x1f7)](a5_0x307e0f[_0x39dbfc(0x1b9)](_0x39dbfc(0x187)+[..._0x5d97f3][_0x39dbfc(0x1b1)](',\x20'))):console[_0x39dbfc(0x1f7)](a5_0x307e0f[_0x39dbfc(0x1b9)](_0x39dbfc(0x1b0))),0x1;}}if(_0x33deca)return this[_0x39dbfc(0x1fc)](_0x5c23f1,{'definition':{'tests':_0x4b3f2d},'agentInfo':_0x58cf18,'outputFormat':_0x2affe7,'outputFile':_0x14d238,'testNames':_0x56977f});if(_0x450680){console[_0x39dbfc(0x1f7)](a5_0x307e0f['cyan'](_0x39dbfc(0x1cd))),console['log'](_0x39dbfc(0x1ab)+a5_0x307e0f[_0x39dbfc(0x1ef)](_0x5c462f)),console[_0x39dbfc(0x1f7)](_0x39dbfc(0x1c0)+a5_0x307e0f[_0x39dbfc(0x1ef)](_0x58cf18[_0x39dbfc(0x1dd)])),console[_0x39dbfc(0x1f7)](_0x39dbfc(0x1cc)+a5_0x307e0f[_0x39dbfc(0x1ef)](_0x58cf18[_0x39dbfc(0x1da)])),console[_0x39dbfc(0x1f7)](),console[_0x39dbfc(0x1f7)](_0x39dbfc(0x1d0)+a5_0x307e0f[_0x39dbfc(0x1ef)](_0x4b3f2d[_0x39dbfc(0x16c)]));for(let _0xa8c2df=0x0;_0xa8c2df<_0x4b3f2d[_0x39dbfc(0x16c)];_0xa8c2df++){const _0x1de5f3=_0x4b3f2d[_0xa8c2df],_0x18c772=_0x1de5f3[_0x39dbfc(0x16a)]['length']===0x1?'round':_0x39dbfc(0x16a),_0x28a7f9=_0x1de5f3[_0x39dbfc(0x1ed)]?.[_0x39dbfc(0x16c)]?'\x20['+_0x1de5f3[_0x39dbfc(0x1ed)]['join'](',\x20')+']':'';console[_0x39dbfc(0x1f7)]('\x20\x20'+(_0xa8c2df+0x1)+'.\x20'+a5_0x307e0f[_0x39dbfc(0x1ef)](_0x1de5f3[_0x39dbfc(0x1be)])+'\x20('+_0x1de5f3[_0x39dbfc(0x16a)][_0x39dbfc(0x16c)]+'\x20'+_0x18c772+')'+a5_0x307e0f[_0x39dbfc(0x1b9)](_0x28a7f9));}return 0x0;}let _0xfc9a05,_0x15ab1b;try{_0xfc9a05=await _0x5c688b['llm'][_0x39dbfc(0x173)](_0x58cf18[_0x39dbfc(0x1dd)]);}catch(_0x28e626){const _0xb922c4=_0x28e626 instanceof Error?_0x28e626[_0x39dbfc(0x1e9)]:String(_0x28e626);return _0xb922c4[_0x39dbfc(0x1c7)](_0x39dbfc(0x1e5))||_0xb922c4['toLowerCase']()[_0x39dbfc(0x1c7)](_0x39dbfc(0x1e1))?console['log'](a5_0x307e0f[_0x39dbfc(0x1f4)](_0x39dbfc(0x1f2)+_0x58cf18['projectName'])):console[_0x39dbfc(0x1f7)](a5_0x307e0f['red'](_0x39dbfc(0x1c6)+_0x58cf18[_0x39dbfc(0x1dd)]+'\x22:\x20'+_0xb922c4)),0x1;}try{_0x15ab1b=await _0x5c688b['llm']['resolveAgentId'](_0x58cf18['agentName'],_0xfc9a05);}catch(_0x464002){const _0x3fb175=_0x464002 instanceof Error?_0x464002[_0x39dbfc(0x1e9)]:String(_0x464002);return _0x3fb175[_0x39dbfc(0x1c7)](_0x39dbfc(0x1e5))||_0x3fb175[_0x39dbfc(0x170)]()[_0x39dbfc(0x1c7)](_0x39dbfc(0x1e1))?console[_0x39dbfc(0x1f7)](a5_0x307e0f[_0x39dbfc(0x1f4)](_0x39dbfc(0x1e7)+_0x58cf18[_0x39dbfc(0x1da)])):console['log'](a5_0x307e0f['red'](_0x39dbfc(0x184)+_0x58cf18['agentName']+_0x39dbfc(0x17b)+_0x3fb175)),0x1;}let _0x4808e3;if(!_0x12c8d8)try{_0x4808e3=await setupEvaluatorAgent(_0x5c688b[_0x39dbfc(0x1ad)],_0x57a5df[_0x39dbfc(0x1e0)]);}catch(_0x1777ad){const _0x4c547f=_0x1777ad instanceof Error?_0x1777ad[_0x39dbfc(0x1e9)]:String(_0x1777ad);return console[_0x39dbfc(0x1f7)](a5_0x307e0f[_0x39dbfc(0x1f4)](_0x39dbfc(0x177)+_0x4c547f)),0x1;}console['log'](a5_0x307e0f[_0x39dbfc(0x1df)](_0x39dbfc(0x1a8))),console[_0x39dbfc(0x1f7)](_0x39dbfc(0x1a0)+a5_0x307e0f[_0x39dbfc(0x1ef)](_0x5c462f)),console[_0x39dbfc(0x1f7)](_0x39dbfc(0x1b2)+a5_0x307e0f['white'](_0x58cf18[_0x39dbfc(0x1dd)]+'/'+_0x58cf18[_0x39dbfc(0x1da)])),console['log']();const _0x571ad1=[],_0x19de2c=[],_0xc85a94=Date[_0x39dbfc(0x1a3)]();for(let _0x1c4446=0x0;_0x1c4446<_0x4b3f2d['length'];_0x1c4446++){const _0x272daf=_0x4b3f2d[_0x1c4446];_0x4b3f2d[_0x39dbfc(0x16c)]>0x1?console[_0x39dbfc(0x1f7)]('Test\x20'+(_0x1c4446+0x1)+'/'+_0x4b3f2d[_0x39dbfc(0x16c)]+':\x20'+a5_0x307e0f[_0x39dbfc(0x1ef)](_0x272daf[_0x39dbfc(0x1be)])):console[_0x39dbfc(0x1f7)](_0x39dbfc(0x1f9)+a5_0x307e0f[_0x39dbfc(0x1ef)](_0x272daf[_0x39dbfc(0x1be)]));const _0x59fd9f=createCommandSpinner('Round\x201/'+_0x272daf['rounds'][_0x39dbfc(0x16c)]+_0x39dbfc(0x17c));_0x59fd9f[_0x39dbfc(0x16d)]();try{const {result:_0x7902f8,conversation:_0x1570dc}=await runTest(_0x5c688b[_0x39dbfc(0x1ad)],_0x272daf,{'agentId':_0x15ab1b,'projectId':_0xfc9a05,'site':_0x5c462f,'noEval':_0x12c8d8,'evaluatorId':_0x4808e3,'onRoundStart':(_0x258b86,_0x298a04)=>{const _0xf00421=_0x39dbfc;_0x59fd9f[_0xf00421(0x176)]=_0xf00421(0x1c4)+(_0x258b86+0x1)+'/'+_0x298a04+_0xf00421(0x17c);},'onRoundComplete':(_0x1ebf70,_0x5c1048,_0x6ef84c)=>{const _0x6488e9=_0x39dbfc,_0x3cca2a=formatElapsed(_0x5c1048);_0x6ef84c?console['log'](_0x6488e9(0x167)+(_0x1ebf70+0x1)+'/'+_0x272daf[_0x6488e9(0x16a)][_0x6488e9(0x16c)]+_0x6488e9(0x1bb)+a5_0x307e0f[_0x6488e9(0x1b5)]('✓')+'\x20('+_0x3cca2a+')'):console[_0x6488e9(0x1f7)](_0x6488e9(0x167)+(_0x1ebf70+0x1)+'/'+_0x272daf['rounds']['length']+_0x6488e9(0x1bb)+a5_0x307e0f[_0x6488e9(0x1f4)]('✗'));},'onEvaluationStart':()=>{const _0x15a9ce=_0x39dbfc;_0x59fd9f[_0x15a9ce(0x176)]='Evaluating\x20response...';},'onEvaluationComplete':_0x232319=>{const _0x483258=_0x39dbfc,_0x338eef=formatElapsed(_0x232319);console[_0x483258(0x1f7)]('\x20\x20Evaluating...\x20'+a5_0x307e0f[_0x483258(0x1b5)]('✓')+'\x20('+_0x338eef+')');}});_0x59fd9f[_0x39dbfc(0x1a5)](),_0x571ad1[_0x39dbfc(0x1ca)](_0x7902f8),_0x19de2c[_0x39dbfc(0x1ca)](_0x1570dc);if(_0x7902f8['status']===_0x39dbfc(0x192))console[_0x39dbfc(0x1f7)](a5_0x307e0f[_0x39dbfc(0x1b5)]('✓\x20PASS:\x20'+_0x7902f8[_0x39dbfc(0x19d)]));else _0x7902f8[_0x39dbfc(0x1e4)]==='FAIL'?console[_0x39dbfc(0x1f7)](a5_0x307e0f[_0x39dbfc(0x1f4)](_0x39dbfc(0x1fd)+_0x7902f8['reason'])):console[_0x39dbfc(0x1f7)](a5_0x307e0f[_0x39dbfc(0x1f4)](_0x39dbfc(0x1de)+_0x7902f8[_0x39dbfc(0x19d)]));_0x7902f8[_0x39dbfc(0x1b7)]&&console['log'](a5_0x307e0f[_0x39dbfc(0x1b9)](_0x39dbfc(0x1d5)+_0x7902f8[_0x39dbfc(0x1b7)])),console[_0x39dbfc(0x1f7)]();}catch(_0x12c43a){_0x59fd9f[_0x39dbfc(0x1a5)]();const _0x3ee29e=_0x12c43a instanceof Error?_0x12c43a[_0x39dbfc(0x1e9)]:String(_0x12c43a);console[_0x39dbfc(0x1f7)](a5_0x307e0f[_0x39dbfc(0x1f4)]('✗\x20ERROR:\x20'+_0x3ee29e)),console[_0x39dbfc(0x1f7)](),_0x571ad1[_0x39dbfc(0x1ca)]({'name':_0x272daf[_0x39dbfc(0x1be)],'status':'ERROR','reason':_0x3ee29e,'timestamp':new Date()[_0x39dbfc(0x182)](),'duration_ms':0x0});}}const _0xff4c47=Date[_0x39dbfc(0x1a3)]()-_0xc85a94,_0x42fcd5=_0x571ad1[_0x39dbfc(0x1d6)](_0x178499=>_0x178499['status']===_0x39dbfc(0x192))[_0x39dbfc(0x16c)],_0x371331=_0x571ad1['filter'](_0x58c63a=>_0x58c63a['status']==='FAIL')['length'],_0x2ccc7c=_0x571ad1[_0x39dbfc(0x1d6)](_0x24d5e3=>_0x24d5e3['status']===_0x39dbfc(0x1bd))[_0x39dbfc(0x16c)];console[_0x39dbfc(0x1f7)]('━'[_0x39dbfc(0x1cf)](0x3c)),console[_0x39dbfc(0x1f7)]('Test\x20Summary'),console[_0x39dbfc(0x1f7)]('━'['repeat'](0x3c)),console[_0x39dbfc(0x1f7)](_0x39dbfc(0x1ae)+_0x571ad1[_0x39dbfc(0x16c)]),console['log']('Passed:\x20\x20\x20'+a5_0x307e0f['green'](_0x42fcd5)),console[_0x39dbfc(0x1f7)](_0x39dbfc(0x16b)+a5_0x307e0f[_0x39dbfc(0x1f4)](_0x371331));_0x2ccc7c>0x0&&console['log'](_0x39dbfc(0x17a)+a5_0x307e0f['red'](_0x2ccc7c));console[_0x39dbfc(0x1f7)](_0x39dbfc(0x193)+formatElapsed(_0xff4c47)),console[_0x39dbfc(0x1f7)]('━'[_0x39dbfc(0x1cf)](0x3c));const _0x31d650=_0x571ad1[_0x39dbfc(0x1d6)](_0x18623d=>_0x18623d[_0x39dbfc(0x1e4)]!=='PASS');if(_0x31d650[_0x39dbfc(0x16c)]>0x0){console[_0x39dbfc(0x1f7)](),console[_0x39dbfc(0x1f7)]('Failed\x20Tests:');for(const _0x208a6e of _0x31d650){const _0x4b105a=a5_0x307e0f['red']('✗'),_0x47a0aa=_0x208a6e['reason'][_0x39dbfc(0x16c)]>0x32?_0x208a6e['reason'][_0x39dbfc(0x19b)](0x0,0x32)+_0x39dbfc(0x1e6):_0x208a6e[_0x39dbfc(0x19d)];console[_0x39dbfc(0x1f7)]('\x20\x20'+_0x4b105a+'\x20'+_0x208a6e[_0x39dbfc(0x1be)]+':\x20'+_0x47a0aa);}}const _0x4a0a7d={'summary':{'total':_0x571ad1[_0x39dbfc(0x16c)],'passed':_0x42fcd5,'failed':_0x371331,'errors':_0x2ccc7c>0x0?_0x2ccc7c:undefined,'duration_ms':_0xff4c47},'tests':_0x571ad1,'agent':{'project':_0x58cf18[_0x39dbfc(0x1dd)],'name':_0x58cf18[_0x39dbfc(0x1da)],'site':_0x5c462f},'timestamp':new Date(_0xc85a94)['toISOString']()};try{const _0x82ff89=buildCachedTestRun(_0x19de2c,{'site':_0x5c462f,'projectId':_0xfc9a05,'projectName':_0x58cf18[_0x39dbfc(0x1dd)],'agentId':_0x15ab1b,'agentName':_0x58cf18[_0x39dbfc(0x1da)],'testYmlPath':a5_0x1cee67[_0x39dbfc(0x1bc)](_0x58cf18[_0x39dbfc(0x1aa)])});saveLastTestRun(_0x82ff89);}catch{}if(_0x2affe7!==_0x39dbfc(0x1c2)||_0x14d238){const _0x9efd2b=formatResults(_0x4a0a7d,_0x2affe7);if(_0x14d238)try{a5_0x183389[_0x39dbfc(0x1db)](_0x14d238,_0x9efd2b,'utf-8'),console['log'](),console['log'](a5_0x307e0f[_0x39dbfc(0x1b9)](_0x39dbfc(0x19e)+_0x14d238));}catch(_0x28f443){return console[_0x39dbfc(0x1f7)](),console[_0x39dbfc(0x1f7)](a5_0x307e0f[_0x39dbfc(0x1f4)](_0x39dbfc(0x1b4)+_0x28f443)),0x1;}else console[_0x39dbfc(0x1f7)](),console[_0x39dbfc(0x1f7)](_0x9efd2b);}return _0x31d650[_0x39dbfc(0x16c)]>0x0?0x1:0x0;}async['executeReeval'](_0x14b87c,_0x4edcb1){const _0x7489db=a5_0xab8cff,{options:_0x1824e5,tdx:_0x72714d}=_0x14b87c,{definition:_0x27e79e,agentInfo:_0x2c6249,outputFormat:_0x51b49c,outputFile:_0x517e4e}=_0x4edcb1,_0x186736=_0x1824e5[_0x7489db(0x18c)],_0x3155c7=loadLastTestRun();if(!_0x3155c7)return console[_0x7489db(0x1f7)](a5_0x307e0f['red'](_0x7489db(0x17d))),console[_0x7489db(0x1f7)](a5_0x307e0f['dim']('Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.')),0x1;if(_0x3155c7['agent'][_0x7489db(0x1da)]!==_0x2c6249[_0x7489db(0x1da)])return console[_0x7489db(0x1f7)](a5_0x307e0f[_0x7489db(0x1f4)](_0x7489db(0x1b3)+_0x3155c7[_0x7489db(0x1a6)][_0x7489db(0x1da)]+_0x7489db(0x19a)+_0x2c6249[_0x7489db(0x1da)]+'\x22.')),console[_0x7489db(0x1f7)](a5_0x307e0f[_0x7489db(0x1b9)](_0x7489db(0x183))),0x1;const _0x1b4b46=new Set(_0x3155c7['conversations'][_0x7489db(0x1d8)](_0x48ce93=>_0x48ce93[_0x7489db(0x1f6)])),_0x178e35=_0x27e79e[_0x7489db(0x1f5)]['filter'](_0x4e5717=>!_0x1b4b46[_0x7489db(0x194)](_0x4e5717[_0x7489db(0x1be)]));if(_0x178e35[_0x7489db(0x16c)]>0x0&&_0x3155c7[_0x7489db(0x18c)]!==_0x186736)return console[_0x7489db(0x1f7)](a5_0x307e0f[_0x7489db(0x1f4)](_0x7489db(0x195))),console[_0x7489db(0x1f7)](a5_0x307e0f[_0x7489db(0x1b9)](_0x7489db(0x178)+_0x3155c7[_0x7489db(0x18c)]+_0x7489db(0x1fe)+_0x186736+'\x22.')),console[_0x7489db(0x1f7)](a5_0x307e0f[_0x7489db(0x1b9)]('Either\x20switch\x20to\x20the\x20\x22'+_0x3155c7[_0x7489db(0x18c)]+_0x7489db(0x198))),0x1;const _0x121ff4=_0x27e79e[_0x7489db(0x1f5)][_0x7489db(0x1d6)](_0x45193e=>_0x1b4b46[_0x7489db(0x194)](_0x45193e['name'])),_0x241271=_0x178e35;let _0x4b702a;try{_0x4b702a=await setupEvaluatorAgent(_0x72714d[_0x7489db(0x1ad)],_0x1824e5[_0x7489db(0x1e0)]);}catch(_0x5f5238){const _0xca2053=_0x5f5238 instanceof Error?_0x5f5238['message']:String(_0x5f5238);return console[_0x7489db(0x1f7)](a5_0x307e0f[_0x7489db(0x1f4)]('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0xca2053)),0x1;}console[_0x7489db(0x1f7)](a5_0x307e0f[_0x7489db(0x1df)]('Re-evaluating\x20cached\x20test\x20run...')),console[_0x7489db(0x1f7)](_0x7489db(0x1e3)+a5_0x307e0f['white'](_0x3155c7[_0x7489db(0x169)])),console[_0x7489db(0x1f7)](_0x7489db(0x1b2)+a5_0x307e0f[_0x7489db(0x1ef)](_0x3155c7[_0x7489db(0x1a6)][_0x7489db(0x1dd)]+'/'+_0x3155c7[_0x7489db(0x1a6)][_0x7489db(0x1da)]));_0x241271[_0x7489db(0x16c)]>0x0&&console[_0x7489db(0x1f7)](_0x7489db(0x1a1)+a5_0x307e0f[_0x7489db(0x1ce)](_0x241271[_0x7489db(0x16c)]));console[_0x7489db(0x1f7)]();const _0x621268=[],_0x236a7c=Date[_0x7489db(0x1a3)](),_0x275242=createCommandSpinner(_0x7489db(0x1b8));if(_0x121ff4[_0x7489db(0x16c)]>0x0)try{const _0x36a2ac=await reevaluateFromCache(_0x72714d[_0x7489db(0x1ad)],_0x3155c7,{'tests':_0x121ff4},{'evaluatorId':_0x4b702a,'onTestStart':(_0x15a640,_0x5ac21f,_0x38e4a4)=>{const _0xfa8382=_0x7489db;_0x275242[_0xfa8382(0x176)]=_0xfa8382(0x1ba)+(_0x5ac21f+0x1)+'/'+_0x38e4a4+':\x20'+_0x15a640+_0xfa8382(0x1e6);if(!_0x275242['isSpinning'])_0x275242[_0xfa8382(0x16d)]();},'onTestComplete':(_0x472517,_0x5e50fd)=>{const _0x4326a3=_0x7489db;_0x275242['stop']();if(_0x5e50fd['status']==='PASS')console[_0x4326a3(0x1f7)](a5_0x307e0f[_0x4326a3(0x1b5)](_0x4326a3(0x18f)+_0x472517)+a5_0x307e0f['dim'](_0x4326a3(0x191)));else _0x5e50fd[_0x4326a3(0x1e4)]===_0x4326a3(0x1af)?console[_0x4326a3(0x1f7)](a5_0x307e0f['red'](_0x4326a3(0x1fd)+_0x472517+'\x20-\x20'+_0x5e50fd[_0x4326a3(0x19d)])+a5_0x307e0f[_0x4326a3(0x1b9)](_0x4326a3(0x191))):console['log'](a5_0x307e0f[_0x4326a3(0x1f4)](_0x4326a3(0x1de)+_0x472517+'\x20-\x20'+_0x5e50fd[_0x4326a3(0x19d)]));_0x5e50fd[_0x4326a3(0x1b7)]&&console[_0x4326a3(0x1f7)](a5_0x307e0f['dim']('\x20\x20Conversation:\x20'+_0x5e50fd['conversation_url'])),_0x621268[_0x4326a3(0x1ca)](_0x5e50fd);},'onTestSkipped':(_0x1d940d,_0x16dcb7)=>{const _0x54a417=_0x7489db;_0x275242[_0x54a417(0x1a5)](),console['log'](a5_0x307e0f['yellow']('⚠\x20SKIPPED:\x20'+_0x1d940d+_0x54a417(0x1e2)+_0x16dcb7));}});for(const _0x3575f1 of _0x36a2ac){!_0x621268['find'](_0x3667a2=>_0x3667a2[_0x7489db(0x1be)]===_0x3575f1[_0x7489db(0x1be)])&&_0x621268[_0x7489db(0x1ca)](_0x3575f1);}}catch(_0x48d287){_0x275242['stop']();const _0x23d090=_0x48d287 instanceof Error?_0x48d287[_0x7489db(0x1e9)]:String(_0x48d287);return console[_0x7489db(0x1f7)](a5_0x307e0f[_0x7489db(0x1f4)](_0x7489db(0x1d3)+_0x23d090)),0x1;}_0x275242['stop']();if(_0x241271[_0x7489db(0x16c)]>0x0){console[_0x7489db(0x1f7)](),console[_0x7489db(0x1f7)](a5_0x307e0f[_0x7489db(0x1df)](_0x7489db(0x175)));const {projectId:_0x2ee731,agentId:_0x53ec20}=_0x3155c7[_0x7489db(0x1a6)];for(const _0x48fc47 of _0x241271){console[_0x7489db(0x1f7)]('Running:\x20'+a5_0x307e0f[_0x7489db(0x1ef)](_0x48fc47['name']));const _0x5d6318=createCommandSpinner(_0x7489db(0x1bf)+_0x48fc47[_0x7489db(0x16a)][_0x7489db(0x16c)]+_0x7489db(0x17c));_0x5d6318[_0x7489db(0x16d)]();try{const {result:_0x3097f7}=await runTest(_0x72714d['llm'],_0x48fc47,{'agentId':_0x53ec20,'projectId':_0x2ee731,'site':_0x3155c7['site'],'noEval':![],'evaluatorId':_0x4b702a,'onRoundStart':(_0x54c492,_0x3e98af)=>{const _0x58c781=_0x7489db;_0x5d6318[_0x58c781(0x176)]=_0x58c781(0x1c4)+(_0x54c492+0x1)+'/'+_0x3e98af+_0x58c781(0x17c);},'onRoundComplete':(_0x46c946,_0xd4c90d,_0x25f953)=>{const _0x3231f2=_0x7489db,_0x2d6171=formatElapsed(_0xd4c90d);_0x25f953?console['log'](_0x3231f2(0x167)+(_0x46c946+0x1)+'/'+_0x48fc47[_0x3231f2(0x16a)][_0x3231f2(0x16c)]+_0x3231f2(0x1bb)+a5_0x307e0f['green']('✓')+'\x20('+_0x2d6171+')'):console[_0x3231f2(0x1f7)](_0x3231f2(0x167)+(_0x46c946+0x1)+'/'+_0x48fc47[_0x3231f2(0x16a)]['length']+'...\x20'+a5_0x307e0f[_0x3231f2(0x1f4)]('✗'));},'onEvaluationStart':()=>{const _0x48c016=_0x7489db;_0x5d6318[_0x48c016(0x176)]=_0x48c016(0x19f);},'onEvaluationComplete':_0x231f7b=>{const _0x4a1459=_0x7489db,_0x3901e5=formatElapsed(_0x231f7b);console[_0x4a1459(0x1f7)](_0x4a1459(0x1fa)+a5_0x307e0f[_0x4a1459(0x1b5)]('✓')+'\x20('+_0x3901e5+')');}});_0x5d6318['stop'](),_0x621268[_0x7489db(0x1ca)](_0x3097f7);if(_0x3097f7[_0x7489db(0x1e4)]===_0x7489db(0x192))console[_0x7489db(0x1f7)](a5_0x307e0f[_0x7489db(0x1b5)](_0x7489db(0x18f)+_0x3097f7[_0x7489db(0x19d)])+a5_0x307e0f[_0x7489db(0x1b9)](_0x7489db(0x17e)));else _0x3097f7[_0x7489db(0x1e4)]===_0x7489db(0x1af)?console[_0x7489db(0x1f7)](a5_0x307e0f[_0x7489db(0x1f4)](_0x7489db(0x1fd)+_0x3097f7[_0x7489db(0x19d)])+a5_0x307e0f[_0x7489db(0x1b9)]('\x20(new)')):console[_0x7489db(0x1f7)](a5_0x307e0f['red'](_0x7489db(0x1de)+_0x3097f7[_0x7489db(0x19d)]));_0x3097f7[_0x7489db(0x1b7)]&&console[_0x7489db(0x1f7)](a5_0x307e0f[_0x7489db(0x1b9)](_0x7489db(0x189)+_0x3097f7['conversation_url']));}catch(_0x686df7){_0x5d6318[_0x7489db(0x1a5)]();const _0x43a409=_0x686df7 instanceof Error?_0x686df7[_0x7489db(0x1e9)]:String(_0x686df7);console[_0x7489db(0x1f7)](a5_0x307e0f[_0x7489db(0x1f4)](_0x7489db(0x1de)+_0x43a409)),_0x621268[_0x7489db(0x1ca)]({'name':_0x48fc47[_0x7489db(0x1be)],'status':'ERROR','reason':_0x43a409,'timestamp':new Date()[_0x7489db(0x182)](),'duration_ms':0x0});}}}console['log']();const _0x22833b=Date[_0x7489db(0x1a3)]()-_0x236a7c,_0x5be4db=_0x621268[_0x7489db(0x1d6)](_0x5c1f68=>_0x5c1f68['status']===_0x7489db(0x192))[_0x7489db(0x16c)],_0x31e06e=_0x621268[_0x7489db(0x1d6)](_0xafb274=>_0xafb274[_0x7489db(0x1e4)]===_0x7489db(0x1af))[_0x7489db(0x16c)],_0x5ba6f3=_0x621268[_0x7489db(0x1d6)](_0x3994ce=>_0x3994ce[_0x7489db(0x1e4)]==='ERROR')[_0x7489db(0x16c)];console['log']('━'[_0x7489db(0x1cf)](0x3c)),console[_0x7489db(0x1f7)](_0x7489db(0x1d7)),console[_0x7489db(0x1f7)]('━'[_0x7489db(0x1cf)](0x3c)),console[_0x7489db(0x1f7)](_0x7489db(0x1ae)+_0x621268[_0x7489db(0x16c)]),console[_0x7489db(0x1f7)]('Passed:\x20\x20\x20'+a5_0x307e0f[_0x7489db(0x1b5)](_0x5be4db)),console[_0x7489db(0x1f7)](_0x7489db(0x16b)+a5_0x307e0f['red'](_0x31e06e));_0x5ba6f3>0x0&&console['log'](_0x7489db(0x17a)+a5_0x307e0f[_0x7489db(0x1f4)](_0x5ba6f3));console[_0x7489db(0x1f7)](_0x7489db(0x193)+formatElapsed(_0x22833b)),console[_0x7489db(0x1f7)]('━'[_0x7489db(0x1cf)](0x3c));const _0x538c98={'summary':{'total':_0x621268[_0x7489db(0x16c)],'passed':_0x5be4db,'failed':_0x31e06e,'errors':_0x5ba6f3>0x0?_0x5ba6f3:undefined,'duration_ms':_0x22833b},'tests':_0x621268,'agent':{'project':_0x2c6249[_0x7489db(0x1dd)],'name':_0x2c6249[_0x7489db(0x1da)],'site':_0x186736},'timestamp':new Date(_0x236a7c)[_0x7489db(0x182)]()};if(_0x51b49c!==_0x7489db(0x1c2)||_0x517e4e){const _0x5c464d=formatResults(_0x538c98,_0x51b49c);if(_0x517e4e)try{a5_0x183389[_0x7489db(0x1db)](_0x517e4e,_0x5c464d,_0x7489db(0x172)),console[_0x7489db(0x1f7)](),console[_0x7489db(0x1f7)](a5_0x307e0f[_0x7489db(0x1b9)]('Output\x20written\x20to:\x20'+_0x517e4e));}catch(_0x512718){return console['log'](),console[_0x7489db(0x1f7)](a5_0x307e0f[_0x7489db(0x1f4)]('Error\x20writing\x20output\x20file:\x20'+_0x512718)),0x1;}else console[_0x7489db(0x1f7)](),console[_0x7489db(0x1f7)](_0x5c464d);}const _0x3677ff=_0x621268[_0x7489db(0x1d6)](_0x4420dc=>_0x4420dc[_0x7489db(0x1e4)]!==_0x7489db(0x192));return _0x3677ff[_0x7489db(0x16c)]>0x0?0x1:0x0;}}
@@ -1 +1 @@
1
- const a6_0x401f4a=a6_0x41e1;(function(_0x5bb0dc,_0x32de5c){const _0x7069c7=a6_0x41e1,_0x5aec1c=_0x5bb0dc();while(!![]){try{const _0x387c2e=-parseInt(_0x7069c7(0xaa))/0x1*(-parseInt(_0x7069c7(0xe4))/0x2)+parseInt(_0x7069c7(0xc0))/0x3+parseInt(_0x7069c7(0xda))/0x4*(parseInt(_0x7069c7(0xb2))/0x5)+-parseInt(_0x7069c7(0xba))/0x6*(-parseInt(_0x7069c7(0xe3))/0x7)+-parseInt(_0x7069c7(0xa9))/0x8+parseInt(_0x7069c7(0xd5))/0x9+parseInt(_0x7069c7(0xdc))/0xa*(-parseInt(_0x7069c7(0xa8))/0xb);if(_0x387c2e===_0x32de5c)break;else _0x5aec1c['push'](_0x5aec1c['shift']());}catch(_0x337bde){_0x5aec1c['push'](_0x5aec1c['shift']());}}}(a6_0x4fe6,0xb3b65));import{BaseCommand}from'./command.js';function a6_0x41e1(_0x1e74d2,_0x3f2ccc){_0x1e74d2=_0x1e74d2-0xa1;const _0x4fe67f=a6_0x4fe6();let _0x41e104=_0x4fe67f[_0x1e74d2];return _0x41e104;}import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a6_0x401f4a(0xa7),a6_0x401f4a(0xcc),'cookie',a6_0x401f4a(0xe8),'set-cookie2','x-xsrf-token',a6_0x401f4a(0xb3),a6_0x401f4a(0xa1)]);function isSensitiveHeader(_0x2cbd66){const _0x1f14ce=a6_0x401f4a;return SENSITIVE_HEADERS[_0x1f14ce(0xd0)](_0x2cbd66[_0x1f14ce(0xcf)]());}function a6_0x4fe6(){const _0x389a16=['type','4884633zOJdOA','status','headers','body','Endpoint\x20must\x20start\x20with\x20/:\x20','18740CSyrYn','join','12065870DhjpTZ','api','.\x20Valid\x20types:\x20','length','site','workflow','file','1357412XvGVmD','44WhwzRx','POST','startsWith','cdp','set-cookie','noColor','x-trino-user','PUT','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','trino','data','color','authorization','11HktARU','10311736RqDqca','10787YZupsq','<\x20HTTP/1.1\x20','request','llm','GET','validate','isArray','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','180iqIxhD','x-auth-token','Invalid\x20HTTP\x20method:\x20','name','trim','\x0aStack\x20trace:\x0a','keys','includes','42EFqKDu','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','stack','header','.\x20Valid\x20methods:\x20','execute','2776596tBiaKc','log','output','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','readBodyFromFile','method','Error:\x20','error','substring','llm-proxy','indexOf','verbose','proxy-authorization','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','PATCH','toLowerCase','has','toUpperCase','entries','Results\x20saved\x20to\x20'];a6_0x4fe6=function(){return _0x389a16;};return a6_0x4fe6();}function parseHeader(_0x5481c0){const _0x26f114=a6_0x401f4a,_0x43b762=_0x5481c0[_0x26f114(0xca)](':');if(_0x43b762===-0x1)throw new Error('Invalid\x20header\x20format:\x20\x22'+_0x5481c0+'\x22.\x20'+_0x26f114(0xbb));const _0x1f95ff=_0x5481c0[_0x26f114(0xc8)](0x0,_0x43b762)[_0x26f114(0xb6)](),_0x287bf1=_0x5481c0[_0x26f114(0xc8)](_0x43b762+0x1)['trim']();if(!_0x1f95ff)throw new Error(_0x26f114(0xc3)+_0x5481c0+'\x22');return[_0x1f95ff,_0x287bf1];}export class ApiCommand extends BaseCommand{[a6_0x401f4a(0xb5)]=a6_0x401f4a(0xdd);['description']=a6_0x401f4a(0xb1);[a6_0x401f4a(0xaf)](_0x25335d){const _0x111320=a6_0x401f4a,{args:_0x5919df,options:_0x135ba4}=_0x25335d,_0x4c1649=_0x135ba4;if(_0x5919df[_0x111320(0xdf)]===0x0)return _0x111320(0xcd);const _0x395323=_0x5919df[0x0];if(!_0x395323[_0x111320(0xe6)]('/'))return _0x111320(0xd9)+_0x395323;const _0xc7fb48=_0x4c1649[_0x111320(0xa5)],_0x4ae5e9=_0x4c1649[_0x111320(0xe2)];if(_0xc7fb48&&_0x4ae5e9)return _0x111320(0xa3);const _0x25a6ac=_0x4c1649[_0x111320(0xc5)]||_0x111320(0xae),_0x211322=[_0x111320(0xae),_0x111320(0xe5),_0x111320(0xa2),'DELETE',_0x111320(0xce)];if(!_0x211322[_0x111320(0xb9)](_0x25a6ac[_0x111320(0xd1)]()))return _0x111320(0xb4)+_0x25a6ac+_0x111320(0xbe)+_0x211322[_0x111320(0xdb)](',\x20');const _0x4b4394=_0x4c1649[_0x111320(0xd4)]||'td',_0x1c5edf=['td',_0x111320(0xe7),_0x111320(0xe1),_0x111320(0xa4),_0x111320(0xad),_0x111320(0xc9)];if(!_0x1c5edf['includes'](_0x4b4394))return'Invalid\x20API\x20type:\x20'+_0x4b4394+_0x111320(0xde)+_0x1c5edf[_0x111320(0xdb)](',\x20');return undefined;}async[a6_0x401f4a(0xbf)](_0x41ad13){const _0x28212a=a6_0x401f4a,{options:_0x559bb9,args:_0x10bbc4,tdx:_0x2274fc}=_0x41ad13,_0x10ced4=_0x559bb9,_0x2d9360=_0x10bbc4[0x0],_0x2ddb02=(_0x10ced4['method']||_0x28212a(0xae))[_0x28212a(0xd1)](),_0x277a23=_0x10ced4['data'],_0x5b9a6d=_0x10ced4[_0x28212a(0xe2)],_0x314734=_0x10ced4[_0x28212a(0xbd)],_0x2a11b2=_0x10ced4[_0x28212a(0xd4)]||'td';try{const _0x5650a1={};if(_0x314734){const _0x501c3a=Array[_0x28212a(0xb0)](_0x314734)?_0x314734:[_0x314734];for(const _0x105e8a of _0x501c3a){const [_0x5d5dd2,_0x4213a8]=parseHeader(_0x105e8a);_0x5650a1[_0x5d5dd2]=_0x4213a8;}}let _0x1ffb4d;if(_0x277a23)_0x1ffb4d=_0x277a23;else{if(_0x5b9a6d)try{_0x1ffb4d=RawAPI[_0x28212a(0xc4)](_0x5b9a6d);}catch(_0x246b49){return console[_0x28212a(0xc7)](_0x28212a(0xc6)+(_0x246b49 instanceof Error?_0x246b49['message']:String(_0x246b49))),0x1;}}const _0x542b1c={'method':_0x2ddb02,'apiType':_0x2a11b2,'includeHeaders':_0x559bb9[_0x28212a(0xcb)]};_0x1ffb4d&&(_0x542b1c[_0x28212a(0xd8)]=_0x1ffb4d);Object[_0x28212a(0xb8)](_0x5650a1)['length']>0x0&&(_0x542b1c[_0x28212a(0xd7)]=_0x5650a1);if(_0x559bb9[_0x28212a(0xcb)]){const _0x5b839d=resolveSite(_0x559bb9[_0x28212a(0xe0)]),_0x13cc99=getEndpoint(_0x5b839d,_0x2a11b2),_0x473be2=''+_0x13cc99+_0x2d9360;console[_0x28212a(0xc7)]('>\x20'+_0x2ddb02+'\x20'+_0x473be2);const _0x5bcdb8=getAuthHeaders(_0x5b839d),_0x3d750c={..._0x5bcdb8,..._0x5650a1};for(const [_0x48f0e0,_0x1cbba6]of Object[_0x28212a(0xd2)](_0x3d750c)){!isSensitiveHeader(_0x48f0e0)&&console[_0x28212a(0xc7)]('>\x20'+_0x48f0e0+':\x20'+_0x1cbba6);}_0x1ffb4d&&console[_0x28212a(0xc7)]('>'),console[_0x28212a(0xc7)]('');}const _0x58aced=await _0x2274fc['api'][_0x28212a(0xac)](_0x2d9360,_0x542b1c);if(_0x559bb9['verbose']&&_0x58aced['headers']){console[_0x28212a(0xc7)](_0x28212a(0xab)+_0x58aced[_0x28212a(0xd6)]);for(const [_0x2ea67d,_0x3a9df7]of Object['entries'](_0x58aced[_0x28212a(0xd7)])){!isSensitiveHeader(_0x2ea67d)&&console[_0x28212a(0xc7)]('<\x20'+_0x2ea67d+':\x20'+_0x3a9df7);}console[_0x28212a(0xc7)]('');}const _0x4b4870=Boolean(_0x559bb9[_0x28212a(0xc2)]),_0x50c1f9={'color':_0x559bb9[_0x28212a(0xa6)],'noColor':_0x559bb9[_0x28212a(0xe9)]||_0x4b4870&&!_0x559bb9[_0x28212a(0xa6)]},_0x4a08ac=colorizeJSON(_0x58aced[_0x28212a(0xa5)],_0x50c1f9);return _0x559bb9[_0x28212a(0xc2)]?(writeFileSync(_0x559bb9[_0x28212a(0xc2)],_0x4a08ac),console['error'](_0x28212a(0xd3)+_0x559bb9[_0x28212a(0xc2)])):console[_0x28212a(0xc1)](_0x4a08ac),0x0;}catch(_0x34ecd6){return _0x34ecd6 instanceof Error?(console[_0x28212a(0xc7)](_0x28212a(0xc6)+_0x34ecd6['message']),_0x559bb9[_0x28212a(0xcb)]&&_0x34ecd6[_0x28212a(0xbc)]&&console[_0x28212a(0xc7)](_0x28212a(0xb7)+_0x34ecd6[_0x28212a(0xbc)])):console['error'](_0x28212a(0xc6)+String(_0x34ecd6)),0x1;}}}
1
+ const a6_0x36d382=a6_0x146a;(function(_0x50e032,_0x3c0841){const _0x1c26ea=a6_0x146a,_0x3be946=_0x50e032();while(!![]){try{const _0x6220a1=-parseInt(_0x1c26ea(0xc7))/0x1*(-parseInt(_0x1c26ea(0xbe))/0x2)+-parseInt(_0x1c26ea(0xb4))/0x3*(parseInt(_0x1c26ea(0xb0))/0x4)+-parseInt(_0x1c26ea(0xe5))/0x5+parseInt(_0x1c26ea(0xe3))/0x6*(-parseInt(_0x1c26ea(0xc8))/0x7)+-parseInt(_0x1c26ea(0xd4))/0x8*(-parseInt(_0x1c26ea(0xc0))/0x9)+-parseInt(_0x1c26ea(0xe6))/0xa*(-parseInt(_0x1c26ea(0xd3))/0xb)+parseInt(_0x1c26ea(0xd2))/0xc*(parseInt(_0x1c26ea(0xf3))/0xd);if(_0x6220a1===_0x3c0841)break;else _0x3be946['push'](_0x3be946['shift']());}catch(_0xc202ad){_0x3be946['push'](_0x3be946['shift']());}}}(a6_0x346c,0x6a1c0));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';function a6_0x346c(){const _0x3f5589=['method','api','6474GotAMn','PUT','header','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','Invalid\x20HTTP\x20method:\x20','5396GtmVHX','keys','trino','Invalid\x20API\x20type:\x20','1065UWwDmw','llm','llm-proxy','description','workflow','toLowerCase','.\x20Valid\x20methods:\x20','verbose','stack','GET','2OwSkuE','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','2364381DZltbO','Error:\x20','.\x20Valid\x20types:\x20','data','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','join','cdp','100251piRBLX','4514727RvAoGY','noColor','type','length','message','color','includes','Endpoint\x20must\x20start\x20with\x20/:\x20','\x0aStack\x20trace:\x0a','headers','17916Pnzrwt','3896618relTXL','24PxoWrZ','set-cookie2','PATCH','validate','substring','body','has','trim','request','readBodyFromFile','startsWith','error','<\x20HTTP/1.1\x20','authorization','status','6CVfPSQ','Invalid\x20header\x20format:\x20\x22','3909440ZfKcby','20jEbcNA','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','output','file','indexOf','x-auth-token','execute','set-cookie','toUpperCase','DELETE','x-xsrf-token'];a6_0x346c=function(){return _0x3f5589;};return a6_0x346c();}import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a6_0x36d382(0xe1),'proxy-authorization','cookie',a6_0x36d382(0xed),a6_0x36d382(0xd5),a6_0x36d382(0xf0),a6_0x36d382(0xeb),'x-trino-user']);function isSensitiveHeader(_0x3f58fb){const _0x37639a=a6_0x36d382;return SENSITIVE_HEADERS[_0x37639a(0xda)](_0x3f58fb[_0x37639a(0xb9)]());}function a6_0x146a(_0x2b3ac1,_0x5b5b5f){_0x2b3ac1=_0x2b3ac1-0xb0;const _0x346c81=a6_0x346c();let _0x146aba=_0x346c81[_0x2b3ac1];return _0x146aba;}function parseHeader(_0x22b644){const _0xd5f9bd=a6_0x36d382,_0x1e8776=_0x22b644[_0xd5f9bd(0xea)](':');if(_0x1e8776===-0x1)throw new Error(_0xd5f9bd(0xe4)+_0x22b644+'\x22.\x20'+_0xd5f9bd(0xbf));const _0x298f43=_0x22b644[_0xd5f9bd(0xd8)](0x0,_0x1e8776)[_0xd5f9bd(0xdb)](),_0x46e174=_0x22b644[_0xd5f9bd(0xd8)](_0x1e8776+0x1)['trim']();if(!_0x298f43)throw new Error('Header\x20key\x20cannot\x20be\x20empty:\x20\x22'+_0x22b644+'\x22');return[_0x298f43,_0x46e174];}export class ApiCommand extends BaseCommand{['name']='api';[a6_0x36d382(0xb7)]=a6_0x36d382(0xe7);[a6_0x36d382(0xd7)](_0x2c554f){const _0x27e6f0=a6_0x36d382,{args:_0xd2b56d,options:_0x36f056}=_0x2c554f,_0x582803=_0x36f056;if(_0xd2b56d[_0x27e6f0(0xcb)]===0x0)return _0x27e6f0(0xc4);const _0x118015=_0xd2b56d[0x0];if(!_0x118015[_0x27e6f0(0xde)]('/'))return _0x27e6f0(0xcf)+_0x118015;const _0x4871ba=_0x582803['data'],_0x732f5c=_0x582803[_0x27e6f0(0xe9)];if(_0x4871ba&&_0x732f5c)return _0x27e6f0(0xf6);const _0x54ab4b=_0x582803[_0x27e6f0(0xf1)]||_0x27e6f0(0xbd),_0x4705ef=[_0x27e6f0(0xbd),'POST',_0x27e6f0(0xf4),_0x27e6f0(0xef),_0x27e6f0(0xd6)];if(!_0x4705ef[_0x27e6f0(0xce)](_0x54ab4b[_0x27e6f0(0xee)]()))return _0x27e6f0(0xf7)+_0x54ab4b+_0x27e6f0(0xba)+_0x4705ef[_0x27e6f0(0xc5)](',\x20');const _0xf44544=_0x582803[_0x27e6f0(0xca)]||'td',_0x1002d6=['td',_0x27e6f0(0xc6),_0x27e6f0(0xb8),_0x27e6f0(0xb2),_0x27e6f0(0xb5),_0x27e6f0(0xb6)];if(!_0x1002d6['includes'](_0xf44544))return _0x27e6f0(0xb3)+_0xf44544+_0x27e6f0(0xc2)+_0x1002d6[_0x27e6f0(0xc5)](',\x20');return undefined;}async[a6_0x36d382(0xec)](_0x5c5f56){const _0x517b7d=a6_0x36d382,{options:_0x449273,args:_0x7f00e2,tdx:_0x3dca9f}=_0x5c5f56,_0x5b9ec1=_0x449273,_0x4c7cb2=_0x7f00e2[0x0],_0x4b55d0=(_0x5b9ec1[_0x517b7d(0xf1)]||_0x517b7d(0xbd))[_0x517b7d(0xee)](),_0x3dc2df=_0x5b9ec1[_0x517b7d(0xc3)],_0x2492a5=_0x5b9ec1['file'],_0x514670=_0x5b9ec1[_0x517b7d(0xf5)],_0x39ad25=_0x5b9ec1[_0x517b7d(0xca)]||'td';try{const _0x305f68={};if(_0x514670){const _0x317233=Array['isArray'](_0x514670)?_0x514670:[_0x514670];for(const _0x44e343 of _0x317233){const [_0x2dc673,_0x178616]=parseHeader(_0x44e343);_0x305f68[_0x2dc673]=_0x178616;}}let _0x543df6;if(_0x3dc2df)_0x543df6=_0x3dc2df;else{if(_0x2492a5)try{_0x543df6=RawAPI[_0x517b7d(0xdd)](_0x2492a5);}catch(_0x579b85){return console[_0x517b7d(0xdf)](_0x517b7d(0xc1)+(_0x579b85 instanceof Error?_0x579b85[_0x517b7d(0xcc)]:String(_0x579b85))),0x1;}}const _0x30356b={'method':_0x4b55d0,'apiType':_0x39ad25,'includeHeaders':_0x449273[_0x517b7d(0xbb)]};_0x543df6&&(_0x30356b[_0x517b7d(0xd9)]=_0x543df6);Object[_0x517b7d(0xb1)](_0x305f68)['length']>0x0&&(_0x30356b[_0x517b7d(0xd1)]=_0x305f68);if(_0x449273[_0x517b7d(0xbb)]){const _0x444bbc=resolveSite(_0x449273['site']),_0x4fe58e=getEndpoint(_0x444bbc,_0x39ad25),_0x103d32=''+_0x4fe58e+_0x4c7cb2;console['error']('>\x20'+_0x4b55d0+'\x20'+_0x103d32);const _0x400cbe=getAuthHeaders(_0x444bbc),_0x194275={..._0x400cbe,..._0x305f68};for(const [_0x502240,_0x1e55a2]of Object['entries'](_0x194275)){!isSensitiveHeader(_0x502240)&&console[_0x517b7d(0xdf)]('>\x20'+_0x502240+':\x20'+_0x1e55a2);}_0x543df6&&console['error']('>'),console[_0x517b7d(0xdf)]('');}const _0x39914c=await _0x3dca9f[_0x517b7d(0xf2)][_0x517b7d(0xdc)](_0x4c7cb2,_0x30356b);if(_0x449273[_0x517b7d(0xbb)]&&_0x39914c['headers']){console['error'](_0x517b7d(0xe0)+_0x39914c[_0x517b7d(0xe2)]);for(const [_0x3ca629,_0x59cc64]of Object['entries'](_0x39914c['headers'])){!isSensitiveHeader(_0x3ca629)&&console[_0x517b7d(0xdf)]('<\x20'+_0x3ca629+':\x20'+_0x59cc64);}console['error']('');}const _0x4eb575=Boolean(_0x449273['output']),_0xee42a3={'color':_0x449273[_0x517b7d(0xcd)],'noColor':_0x449273[_0x517b7d(0xc9)]||_0x4eb575&&!_0x449273['color']},_0x4eff30=colorizeJSON(_0x39914c[_0x517b7d(0xc3)],_0xee42a3);return _0x449273[_0x517b7d(0xe8)]?(writeFileSync(_0x449273[_0x517b7d(0xe8)],_0x4eff30),console['error']('Results\x20saved\x20to\x20'+_0x449273[_0x517b7d(0xe8)])):console['log'](_0x4eff30),0x0;}catch(_0x7a7a2c){return _0x7a7a2c instanceof Error?(console[_0x517b7d(0xdf)](_0x517b7d(0xc1)+_0x7a7a2c['message']),_0x449273[_0x517b7d(0xbb)]&&_0x7a7a2c[_0x517b7d(0xbc)]&&console[_0x517b7d(0xdf)](_0x517b7d(0xd0)+_0x7a7a2c[_0x517b7d(0xbc)])):console[_0x517b7d(0xdf)](_0x517b7d(0xc1)+String(_0x7a7a2c)),0x1;}}}
@@ -1 +1 @@
1
- function a7_0x1bdc(){const _0x158cda=['\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','No\x20credential\x20found','error','Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20','Remove\x20API\x20key\x20from\x20system\x20keychain','✓\x20Authentication\x20successful\x0a','4605237uXDXtg','red','apiKey','auth:clear','join','Site\x20name\x20cannot\x20be\x20empty','9740isOEWV','Setting\x20up\x20authentication\x20for\x20site:\x20','N/A','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','✓\x20Default\x20site\x20set\x20to\x20','other','API\x20key\x20cannot\x20be\x20empty','✗\x20Validation\x20failed:\x20','name','text','\x20\x20tdx','yellow','✓\x20API\x20key\x20removed\x20from\x20keychain','Enter\x20site\x20name:','filter','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','✓\x20Profile\x20\x27','warn','161ZONDir','2tApzVL','first_name','auth:setup','1503mTbhup','\x0aSetup\x20cancelled','password','\x20for\x20profile:\x20','trim','3585KnYLKN','1565118kpjdOC','log','message','bold','Setup\x20API\x20key\x20authentication\x20interactively','execute','User:\x20','customSite','last_name','10090omYtwF','\x20(profile:\x20','437624axZPVh','profile','jobs','description','select','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','ERROR','site','getUserInfo','status','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','us01','green','68385834ZgMnKJ','\x20(site:\x20','279447ujhfPX','\x20--profile\x20','Enter\x20your\x20TD\x20API\x20key:','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','tdx:\x20auth\x20setup','email','tdx:\x20auth\x20clear','Read\x20credential\x20from\x20','/app/mp/ak','You\x20can\x20find\x20your\x20API\x20key\x20at:'];a7_0x1bdc=function(){return _0x158cda;};return a7_0x1bdc();}const a7_0xeee2e2=a7_0x52ff;(function(_0x5624d2,_0x4fe843){const _0xc456ac=a7_0x52ff,_0x23c210=_0x5624d2();while(!![]){try{const _0x49eac3=-parseInt(_0xc456ac(0xf6))/0x1+-parseInt(_0xc456ac(0xd3))/0x2*(parseInt(_0xc456ac(0x106))/0x3)+parseInt(_0xc456ac(0x10c))/0x4*(-parseInt(_0xc456ac(0xdb))/0x5)+-parseInt(_0xc456ac(0xdc))/0x6+-parseInt(_0xc456ac(0xd2))/0x7*(parseInt(_0xc456ac(0xe7))/0x8)+parseInt(_0xc456ac(0xd6))/0x9*(-parseInt(_0xc456ac(0xe5))/0xa)+parseInt(_0xc456ac(0xf4))/0xb;if(_0x49eac3===_0x4fe843)break;else _0x23c210['push'](_0x23c210['shift']());}catch(_0x3d3d89){_0x23c210['push'](_0x23c210['shift']());}}}(a7_0x1bdc,0xec8f4));function a7_0x52ff(_0x3ead46,_0x244485){_0x3ead46=_0x3ead46-0xcb;const _0x1bdc69=a7_0x1bdc();let _0x52ff30=_0x1bdc69[_0x3ead46];return _0x52ff30;}import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';import{buildSiteChoices}from'../core/constants.js';import a7_0x3602fb 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_0x5585e8 from'chalk';export class AuthSetupCommand extends BaseCommand{[a7_0xeee2e2(0x114)]=a7_0xeee2e2(0xd5);[a7_0xeee2e2(0xea)]=a7_0xeee2e2(0xe0);async[a7_0xeee2e2(0xe1)](_0x527124){const _0x192010=a7_0xeee2e2,{options:_0xe2536c}=_0x527124,_0x1fa9a=_0xe2536c['profile'];console[_0x192010(0xdd)](a7_0x5585e8[_0x192010(0xdf)](_0x192010(0xfa)));const _0x56883c=_0xe2536c[_0x192010(0xee)]||_0x192010(0xf2),{choices:_0x3d11e5,initialIndex:_0x439cae}=buildSiteChoices(_0x56883c),_0x455aad=_0x1fa9a?_0x192010(0x103)+_0x1fa9a+'):':'Select\x20your\x20Treasure\x20Data\x20site:',_0x52c5db=await a7_0x3602fb({'type':_0x192010(0xeb),'name':_0x192010(0xee),'message':_0x455aad,'choices':_0x3d11e5,'initial':_0x439cae});if(!_0x52c5db[_0x192010(0xee)])return console['log'](_0x192010(0xd7)),0x1;let _0x45c1a6;if(_0x52c5db[_0x192010(0xee)]===_0x192010(0x111)){const _0x59d5bc=await a7_0x3602fb({'type':_0x192010(0x115),'name':_0x192010(0xe3),'message':_0x192010(0xcd),'initial':_0x192010(0xf2),'validate':_0x43b9ee=>{const _0x38d99d=_0x192010;if(!_0x43b9ee||!_0x43b9ee[_0x38d99d(0xda)]())return _0x38d99d(0x10b);if(!/^[a-z0-9-]+$/['test'](_0x43b9ee[_0x38d99d(0xda)]()))return'Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens';return!![];}});if(!_0x59d5bc[_0x192010(0xe3)])return console[_0x192010(0xdd)](_0x192010(0xd7)),0x1;_0x45c1a6=_0x59d5bc[_0x192010(0xe3)];}else _0x45c1a6=_0x52c5db[_0x192010(0xee)];const _0x3af228=resolveSite(_0x45c1a6);console['log'](_0x192010(0x10d)+_0x3af228),console['log'](_0x192010(0xff)),console[_0x192010(0xdd)]('\x20\x20'+getConsoleUrl(_0x3af228,_0x192010(0xfe)));const _0x56de81=await a7_0x3602fb({'type':_0x192010(0xd8),'name':'apiKey','message':_0x192010(0xf8),'validate':_0x2af638=>{const _0x44a974=_0x192010;if(!_0x2af638||!_0x2af638[_0x44a974(0xda)]())return _0x44a974(0x112);return!![];}});if(!_0x56de81[_0x192010(0x108)])return console[_0x192010(0xdd)](_0x192010(0xd7)),0x1;const _0x1d76bb=_0x56de81['apiKey'];console[_0x192010(0xdd)]('Validating\x20API\x20key...');try{const _0x3779e2=TDX['create']({'site':_0x3af228,'apiKey':_0x1d76bb[_0x192010(0xda)](),'logLevel':_0xe2536c['logLevel']??LogLevel[_0x192010(0xed)]}),_0xe41608=await _0x3779e2[_0x192010(0xe9)][_0x192010(0xef)]();console['log'](_0x192010(0xec)+_0xe41608[_0x192010(0xfb)]+')');const _0x75216b=await isKeychainAvailable();_0x75216b?(await saveAPIKeyAsync(_0x1d76bb[_0x192010(0xda)](),_0x3af228,_0x1fa9a),console[_0x192010(0xdd)]('✓\x20API\x20key\x20saved\x20to\x20system\x20keychain'+(_0x1fa9a?_0x192010(0xe6)+_0x1fa9a+')':''))):(console[_0x192010(0xd1)](a7_0x5585e8['yellow'](_0x192010(0xf9))),console[_0x192010(0xd1)](a7_0x5585e8[_0x192010(0xcb)]('\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.')));if(_0x1fa9a){const _0xbd29be={'site':_0x3af228};saveProfileToUserConfig(_0x1fa9a,_0xbd29be),console['log'](_0x192010(0xd0)+_0x1fa9a+'\x27\x20registered');}else saveDefaultSiteToUserConfig(_0x3af228),console[_0x192010(0xdd)](_0x192010(0x110)+_0x3af228);const _0x5af00d=_0x1fa9a?_0x192010(0xf7)+_0x1fa9a:'';return console[_0x192010(0xdd)](),console[_0x192010(0xdd)](_0x192010(0xf1)),console['log']('\x20\x20tdx'+_0x5af00d+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console[_0x192010(0xdd)](_0x192010(0x116)+_0x5af00d+_0x192010(0x100)),0x0;}catch(_0x13d53d){if(_0x13d53d instanceof HTTPClientError&&_0x13d53d[_0x192010(0xf0)]===0x191)return printAuthError(_0x13d53d),0x1;return console[_0x192010(0x102)](a7_0x5585e8[_0x192010(0x107)](_0x192010(0x113)+(_0x13d53d instanceof Error?_0x13d53d[_0x192010(0xde)]:String(_0x13d53d)))),console[_0x192010(0x102)](_0x192010(0x10f)),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0xeee2e2(0x114)]='auth';['description']=a7_0xeee2e2(0xcf);async[a7_0xeee2e2(0xe1)](_0xe9c8db){const _0x1f614c=a7_0xeee2e2,{options:_0x116cc1,tdx:_0x51f148}=_0xe9c8db,_0x213f7d=_0x116cc1[_0x1f614c(0xee)],_0x31f85e=_0x116cc1[_0x1f614c(0xe8)],_0x33bb56=_0x31f85e?_0x31f85e:_0x1f614c(0x10e);console['log']('tdx\x20profile:\x20'+_0x33bb56+_0x1f614c(0xf5)+_0x213f7d+')');const _0x1fc3e7=await resolveAPIKeyAsync(_0x213f7d,_0x31f85e);if(_0x1fc3e7){const {source:_0x4bbea4,isDeprecated:_0x9843e2}=_0x1fc3e7,_0x12e544=_0x1f614c(0xfd)+_0x4bbea4;console['log'](_0x9843e2?a7_0x5585e8[_0x1f614c(0xcb)](_0x12e544):_0x12e544);}else console[_0x1f614c(0xdd)](a7_0x5585e8['yellow'](_0x1f614c(0x101)));try{const _0x159bf8=await _0x51f148['jobs'][_0x1f614c(0xef)]();return console[_0x1f614c(0xdd)](a7_0x5585e8[_0x1f614c(0xf3)](_0x1f614c(0x105))),console[_0x1f614c(0xdd)](_0x1f614c(0xe2)+_0x159bf8[_0x1f614c(0xfb)]),(_0x159bf8['first_name']||_0x159bf8['last_name'])&&console[_0x1f614c(0xdd)]('Name:\x20'+[_0x159bf8[_0x1f614c(0xd4)],_0x159bf8[_0x1f614c(0xe4)]][_0x1f614c(0xce)](Boolean)[_0x1f614c(0x10a)]('\x20')),0x0;}catch(_0x1391ec){return _0x1391ec instanceof HTTPClientError&&_0x1391ec[_0x1f614c(0xf0)]===0x191?printAuthError(_0x1391ec,!![],_0x31f85e):console[_0x1f614c(0x102)](a7_0x5585e8['red'](_0x1f614c(0x113)+(_0x1391ec instanceof Error?_0x1391ec[_0x1f614c(0xde)]:String(_0x1391ec)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0xeee2e2(0x114)]=a7_0xeee2e2(0x109);['description']=a7_0xeee2e2(0x104);async['execute'](_0x4311c6){const _0x116a9a=a7_0xeee2e2,{options:_0x5cec5d}=_0x4311c6,_0x3997e8=_0x5cec5d[_0x116a9a(0xe8)];console[_0x116a9a(0xdd)](a7_0x5585e8[_0x116a9a(0xdf)](_0x116a9a(0xfc)));const _0x2dba7d=await isKeychainAvailable();if(!_0x2dba7d)return console[_0x116a9a(0x102)](a7_0x5585e8[_0x116a9a(0x107)]('System\x20keychain\x20is\x20not\x20available')),0x1;const _0x18b781=await deleteKeychainAPIKey(_0x3997e8);return _0x18b781?(clearCredentialCache(),console[_0x116a9a(0xdd)](_0x116a9a(0xcc)+(_0x3997e8?_0x116a9a(0xe6)+_0x3997e8+')':'')),0x0):(console['log']('No\x20API\x20key\x20found\x20in\x20keychain'+(_0x3997e8?_0x116a9a(0xd9)+_0x3997e8:'')),0x1);}}
1
+ const a7_0x4aac1a=a7_0x545b;(function(_0x10aa39,_0x1df6e5){const _0x4dd3d9=a7_0x545b,_0x2a8d96=_0x10aa39();while(!![]){try{const _0x4ae658=-parseInt(_0x4dd3d9(0x1ae))/0x1+parseInt(_0x4dd3d9(0x17f))/0x2+-parseInt(_0x4dd3d9(0x188))/0x3+parseInt(_0x4dd3d9(0x19d))/0x4*(-parseInt(_0x4dd3d9(0x1be))/0x5)+parseInt(_0x4dd3d9(0x183))/0x6+parseInt(_0x4dd3d9(0x1b5))/0x7*(-parseInt(_0x4dd3d9(0x1ba))/0x8)+parseInt(_0x4dd3d9(0x1c3))/0x9;if(_0x4ae658===_0x1df6e5)break;else _0x2a8d96['push'](_0x2a8d96['shift']());}catch(_0x145fea){_0x2a8d96['push'](_0x2a8d96['shift']());}}}(a7_0x2a07,0x6981e));function a7_0x2a07(){const _0x3a1ff5=['us01','9196974AWCzqq','\x20(profile:\x20','Enter\x20site\x20name:','bold','email','name','474316mrXloe','No\x20API\x20key\x20found\x20in\x20keychain','green','red','5073474UIwNoL','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','test','profile','✗\x20Validation\x20failed:\x20','1565295SpqPKP','\x0aSetup\x20cancelled','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','description','Name:\x20','site','other','jobs','select','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','✓\x20Authentication\x20successful\x0a','tdx:\x20auth\x20setup','\x20for\x20profile:\x20','yellow','Remove\x20API\x20key\x20from\x20system\x20keychain','execute','\x20--profile\x20','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','Setup\x20API\x20key\x20authentication\x20interactively','text','No\x20credential\x20found','376elIXqj','status','Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20','Read\x20credential\x20from\x20','ERROR','create','log','warn','message','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','filter','User:\x20','\x27\x20registered','/app/mp/ak','tdx:\x20auth\x20clear','System\x20keychain\x20is\x20not\x20available','514825zzRqzX','\x20\x20tdx','Setting\x20up\x20authentication\x20for\x20site:\x20','Site\x20name\x20cannot\x20be\x20empty','first_name','trim','logLevel','7imlBfd','last_name','error','customSite','apiKey','3266408tjJbZq','getUserInfo','tdx\x20profile:\x20','You\x20can\x20find\x20your\x20API\x20key\x20at:','12105yugIGP','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','join','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'];a7_0x2a07=function(){return _0x3a1ff5;};return a7_0x2a07();}function a7_0x545b(_0x378c6a,_0x251d30){_0x378c6a=_0x378c6a-0x17f;const _0x2a07ed=a7_0x2a07();let _0x545bc3=_0x2a07ed[_0x378c6a];return _0x545bc3;}import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';import{buildSiteChoices}from'../core/constants.js';import a7_0x4a90d5 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_0x17dc69 from'chalk';export class AuthSetupCommand extends BaseCommand{[a7_0x4aac1a(0x1c8)]='auth:setup';[a7_0x4aac1a(0x18b)]=a7_0x4aac1a(0x19a);async[a7_0x4aac1a(0x197)](_0xde9c8a){const _0x361ba6=a7_0x4aac1a,{options:_0x55d721}=_0xde9c8a,_0x32b962=_0x55d721[_0x361ba6(0x186)];console[_0x361ba6(0x1a3)](a7_0x17dc69[_0x361ba6(0x1c6)](_0x361ba6(0x193)));const _0x5326a4=_0x55d721[_0x361ba6(0x18d)]||_0x361ba6(0x1c2),{choices:_0x1b32f3,initialIndex:_0x215408}=buildSiteChoices(_0x5326a4),_0x3668df=_0x32b962?_0x361ba6(0x19f)+_0x32b962+'):':'Select\x20your\x20Treasure\x20Data\x20site:',_0x461e2c=await a7_0x4a90d5({'type':_0x361ba6(0x190),'name':_0x361ba6(0x18d),'message':_0x3668df,'choices':_0x1b32f3,'initial':_0x215408});if(!_0x461e2c[_0x361ba6(0x18d)])return console[_0x361ba6(0x1a3)](_0x361ba6(0x189)),0x1;let _0x366839;if(_0x461e2c['site']===_0x361ba6(0x18e)){const _0x2c50f0=await a7_0x4a90d5({'type':_0x361ba6(0x19b),'name':_0x361ba6(0x1b8),'message':_0x361ba6(0x1c5),'initial':_0x361ba6(0x1c2),'validate':_0x3970b2=>{const _0x56afee=_0x361ba6;if(!_0x3970b2||!_0x3970b2['trim']())return _0x56afee(0x1b1);if(!/^[a-z0-9-]+$/[_0x56afee(0x185)](_0x3970b2[_0x56afee(0x1b3)]()))return'Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens';return!![];}});if(!_0x2c50f0[_0x361ba6(0x1b8)])return console['log'](_0x361ba6(0x189)),0x1;_0x366839=_0x2c50f0[_0x361ba6(0x1b8)];}else _0x366839=_0x461e2c[_0x361ba6(0x18d)];const _0x5d3ac8=resolveSite(_0x366839);console[_0x361ba6(0x1a3)](_0x361ba6(0x1b0)+_0x5d3ac8),console[_0x361ba6(0x1a3)](_0x361ba6(0x1bd)),console['log']('\x20\x20'+getConsoleUrl(_0x5d3ac8,_0x361ba6(0x1ab)));const _0x2aaeaa=await a7_0x4a90d5({'type':'password','name':_0x361ba6(0x1b9),'message':'Enter\x20your\x20TD\x20API\x20key:','validate':_0xc128b6=>{if(!_0xc128b6||!_0xc128b6['trim']())return'API\x20key\x20cannot\x20be\x20empty';return!![];}});if(!_0x2aaeaa['apiKey'])return console[_0x361ba6(0x1a3)](_0x361ba6(0x189)),0x1;const _0x5263bf=_0x2aaeaa[_0x361ba6(0x1b9)];console[_0x361ba6(0x1a3)]('Validating\x20API\x20key...');try{const _0x14ac8a=TDX[_0x361ba6(0x1a2)]({'site':_0x5d3ac8,'apiKey':_0x5263bf[_0x361ba6(0x1b3)](),'logLevel':_0x55d721[_0x361ba6(0x1b4)]??LogLevel[_0x361ba6(0x1a1)]}),_0x71ebe2=await _0x14ac8a['jobs'][_0x361ba6(0x1bb)]();console['log'](_0x361ba6(0x199)+_0x71ebe2[_0x361ba6(0x1c7)]+')');const _0x80c63c=await isKeychainAvailable();_0x80c63c?(await saveAPIKeyAsync(_0x5263bf[_0x361ba6(0x1b3)](),_0x5d3ac8,_0x32b962),console[_0x361ba6(0x1a3)](_0x361ba6(0x1a6)+(_0x32b962?_0x361ba6(0x1c4)+_0x32b962+')':''))):(console[_0x361ba6(0x1a4)](a7_0x17dc69[_0x361ba6(0x195)](_0x361ba6(0x1bf))),console['warn'](a7_0x17dc69[_0x361ba6(0x195)](_0x361ba6(0x184))));if(_0x32b962){const _0x228608={'site':_0x5d3ac8};saveProfileToUserConfig(_0x32b962,_0x228608),console[_0x361ba6(0x1a3)]('✓\x20Profile\x20\x27'+_0x32b962+_0x361ba6(0x1aa));}else saveDefaultSiteToUserConfig(_0x5d3ac8),console[_0x361ba6(0x1a3)]('✓\x20Default\x20site\x20set\x20to\x20'+_0x5d3ac8);const _0x1b7edf=_0x32b962?_0x361ba6(0x198)+_0x32b962:'';return console[_0x361ba6(0x1a3)](),console[_0x361ba6(0x1a3)](_0x361ba6(0x1a7)),console[_0x361ba6(0x1a3)]('\x20\x20tdx'+_0x1b7edf+_0x361ba6(0x1c1)),console['log'](_0x361ba6(0x1af)+_0x1b7edf+_0x361ba6(0x191)),0x0;}catch(_0x4ce3c7){if(_0x4ce3c7 instanceof HTTPClientError&&_0x4ce3c7[_0x361ba6(0x19e)]===0x191)return printAuthError(_0x4ce3c7),0x1;return console['error'](a7_0x17dc69[_0x361ba6(0x182)](_0x361ba6(0x187)+(_0x4ce3c7 instanceof Error?_0x4ce3c7[_0x361ba6(0x1a5)]:String(_0x4ce3c7)))),console[_0x361ba6(0x1b7)]('API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.'),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x4aac1a(0x1c8)]='auth';[a7_0x4aac1a(0x18b)]=a7_0x4aac1a(0x18a);async['execute'](_0x5b6c7a){const _0x440b4c=a7_0x4aac1a,{options:_0x2768a6,tdx:_0x2d4ebb}=_0x5b6c7a,_0x333f10=_0x2768a6[_0x440b4c(0x18d)],_0x94cd28=_0x2768a6[_0x440b4c(0x186)],_0x6778bb=_0x94cd28?_0x94cd28:'N/A';console[_0x440b4c(0x1a3)](_0x440b4c(0x1bc)+_0x6778bb+'\x20(site:\x20'+_0x333f10+')');const _0x3a55e8=await resolveAPIKeyAsync(_0x333f10,_0x94cd28);if(_0x3a55e8){const {source:_0x12b3d6,isDeprecated:_0x156385}=_0x3a55e8,_0x25dc5f=_0x440b4c(0x1a0)+_0x12b3d6;console['log'](_0x156385?a7_0x17dc69[_0x440b4c(0x195)](_0x25dc5f):_0x25dc5f);}else console['log'](a7_0x17dc69['yellow'](_0x440b4c(0x19c)));try{const _0x34b680=await _0x2d4ebb[_0x440b4c(0x18f)][_0x440b4c(0x1bb)]();return console['log'](a7_0x17dc69[_0x440b4c(0x181)](_0x440b4c(0x192))),console[_0x440b4c(0x1a3)](_0x440b4c(0x1a9)+_0x34b680[_0x440b4c(0x1c7)]),(_0x34b680[_0x440b4c(0x1b2)]||_0x34b680[_0x440b4c(0x1b6)])&&console[_0x440b4c(0x1a3)](_0x440b4c(0x18c)+[_0x34b680[_0x440b4c(0x1b2)],_0x34b680[_0x440b4c(0x1b6)]][_0x440b4c(0x1a8)](Boolean)[_0x440b4c(0x1c0)]('\x20')),0x0;}catch(_0x1a998d){return _0x1a998d instanceof HTTPClientError&&_0x1a998d[_0x440b4c(0x19e)]===0x191?printAuthError(_0x1a998d,!![],_0x94cd28):console[_0x440b4c(0x1b7)](a7_0x17dc69[_0x440b4c(0x182)](_0x440b4c(0x187)+(_0x1a998d instanceof Error?_0x1a998d[_0x440b4c(0x1a5)]:String(_0x1a998d)))),0x1;}}}export class AuthClearCommand extends BaseCommand{['name']='auth:clear';[a7_0x4aac1a(0x18b)]=a7_0x4aac1a(0x196);async[a7_0x4aac1a(0x197)](_0x3108ac){const _0x535df8=a7_0x4aac1a,{options:_0x8292ae}=_0x3108ac,_0x2ef716=_0x8292ae[_0x535df8(0x186)];console[_0x535df8(0x1a3)](a7_0x17dc69['bold'](_0x535df8(0x1ac)));const _0x2c72e1=await isKeychainAvailable();if(!_0x2c72e1)return console[_0x535df8(0x1b7)](a7_0x17dc69[_0x535df8(0x182)](_0x535df8(0x1ad))),0x1;const _0x31215d=await deleteKeychainAPIKey(_0x2ef716);return _0x31215d?(clearCredentialCache(),console['log']('✓\x20API\x20key\x20removed\x20from\x20keychain'+(_0x2ef716?_0x535df8(0x1c4)+_0x2ef716+')':'')),0x0):(console['log'](_0x535df8(0x180)+(_0x2ef716?_0x535df8(0x194)+_0x2ef716:'')),0x1);}}
@@ -1 +1 @@
1
- const a8_0x2ba85d=a8_0x4f25;(function(_0x47e55a,_0x2a3f1c){const _0x4e06a8=a8_0x4f25,_0x5f4961=_0x47e55a();while(!![]){try{const _0x245ca0=-parseInt(_0x4e06a8(0x1bb))/0x1+-parseInt(_0x4e06a8(0x1c3))/0x2*(parseInt(_0x4e06a8(0x180))/0x3)+-parseInt(_0x4e06a8(0x191))/0x4*(-parseInt(_0x4e06a8(0x1bd))/0x5)+parseInt(_0x4e06a8(0x17b))/0x6*(-parseInt(_0x4e06a8(0x195))/0x7)+-parseInt(_0x4e06a8(0x1a2))/0x8*(parseInt(_0x4e06a8(0x17f))/0x9)+-parseInt(_0x4e06a8(0x1b7))/0xa*(parseInt(_0x4e06a8(0x181))/0xb)+parseInt(_0x4e06a8(0x1a8))/0xc;if(_0x245ca0===_0x2a3f1c)break;else _0x5f4961['push'](_0x5f4961['shift']());}catch(_0x40bb0b){_0x5f4961['push'](_0x5f4961['shift']());}}}(a8_0x3fa2,0xdafa1));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{withSpinner}from'../utils/spinner.js';function a8_0x3fa2(){const _0x4c702d=['Error:\x20Chat\x20session\x20\x27','targetWebSearchTool','Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together','type','name','Continuing\x20chat:\x20','4417750kKSkCk','metadata','404','streamChatJsonl','837418XtJatl','No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22','305815OVtOhf','options','\x0aStack\x20trace:','claude-4.5-haiku','getDefaultAgent','session\x20context','688570jJSOQg','Resolving\x20agent\x20\x27','tool','content','\x27...','verbose','llmAgent','handleChatEvent','774yosTJA','context','string','error','4179096zNIHgU','3KxrxaL','22XmdSzW','projectId','agent','chatId','stream','llmProject','Resolving\x20project\x20\x27','Using\x20agent\x20from\x20','new','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','description','targetFunction','targetAgent','startChat','code','stdout','32tWGqHH','Create\x20a\x20new\x20chat\x20session','data','execute','55888PHEeMw','cause','streamChat','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','Chat\x20session:\x20','--agent\x20flag','tool_call','Getting\x20default\x20agent...','\x20\x20Cause:\x20','Using\x20cached\x20default\x20agent:\x20','functionName','stringify','\x27\x20not\x20found','8MAJgWW','args','message','llm','log','site','47605896ddKZhW','getOrCreateDefaultAgent','chat','stack','join','\x0aError:\x20','resolveProjectId','event','agentId'];a8_0x3fa2=function(){return _0x4c702d;};return a8_0x3fa2();}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(_0x10797e,_0x498d8c){const _0x574289=a8_0x4f25;if(_0x10797e instanceof SDKError)console['error']('Error:\x20'+_0x10797e[_0x574289(0x1a4)]),_0x498d8c[_0x574289(0x178)]&&(_0x10797e[_0x574289(0x196)]&&console['error'](_0x574289(0x19d)+_0x10797e['cause']),_0x10797e['stack']&&(console[_0x574289(0x17e)](_0x574289(0x1bf)),console['error'](_0x10797e[_0x574289(0x1ab)])));else throw _0x10797e;}function a8_0x4f25(_0x4ddb1c,_0x52d011){_0x4ddb1c=_0x4ddb1c-0x174;const _0x3fa248=a8_0x3fa2();let _0x4f25da=_0x3fa248[_0x4ddb1c];return _0x4f25da;}async function resolveAgentId(_0x57c604,_0x31c2c4,_0x551268,_0x43808e,_0x4960ff){const _0x542205=a8_0x4f25,_0x1704ae=_0x31c2c4||_0x551268;if(_0x1704ae){const {projectName:_0x4b9874,agentName:_0x242ac6}=parseAgentRef(_0x1704ae),_0x19b26d=_0x242ac6||_0x1704ae,_0x3d5988=_0x242ac6?_0x4b9874:_0x43808e;if(!_0x3d5988)throw new Error(_0x542205(0x1bc));if(_0x4960ff){const _0x43adee=_0x31c2c4?_0x542205(0x19a):_0x542205(0x1c2);console[_0x542205(0x17e)](_0x542205(0x188)+_0x43adee+':\x20'+_0x3d5988+'/'+_0x19b26d);}const _0x2d3463=await withSpinner(_0x542205(0x187)+_0x3d5988+'\x27...',()=>_0x57c604[_0x542205(0x1a5)][_0x542205(0x1ae)](_0x3d5988),{'verbose':_0x4960ff}),_0x498649=await withSpinner(_0x542205(0x174)+_0x19b26d+_0x542205(0x177),()=>_0x57c604[_0x542205(0x1a5)]['resolveAgentId'](_0x19b26d,_0x2d3463['data']),{'verbose':_0x4960ff});return _0x498649['data'];}else{const _0x41a818=_0x57c604[_0x542205(0x1a5)][_0x542205(0x1c1)]();if(_0x41a818)return _0x4960ff&&console['error'](_0x542205(0x19e)+_0x41a818[_0x542205(0x1b5)]),_0x41a818['id'];const _0x268285=await withSpinner(_0x542205(0x19c),()=>_0x57c604[_0x542205(0x1a5)][_0x542205(0x1a9)](_0x542205(0x1c0),0x0),{'verbose':_0x4960ff});return _0x268285[_0x542205(0x193)]['id'];}}export class ChatCommand extends BaseCommand{[a8_0x2ba85d(0x1b5)]='chat';['description']=a8_0x2ba85d(0x198);['validate'](_0x52066f){const _0x2a9ef4=a8_0x2ba85d,_0x575b41=_0x52066f[_0x2a9ef4(0x1a3)]['join']('\x20');if(!_0x575b41)return _0x2a9ef4(0x18a);return undefined;}async[a8_0x2ba85d(0x197)](_0x2c09bb,_0x392f33,_0x1ced2b,_0xb7237f,_0x4b2140){const _0x231ac7=a8_0x2ba85d;for await(const _0x399597 of _0x2c09bb[_0x231ac7(0x1a5)][_0x231ac7(0x1aa)](_0x392f33,{'agentId':_0x1ced2b,'chatId':_0xb7237f})){if(_0x399597['type']===_0x231ac7(0x1b8)){const _0x3b5f1d=_0x399597[_0x231ac7(0x193)][_0x231ac7(0x184)];saveLastChatId(_0x3b5f1d),_0x4b2140&&console[_0x231ac7(0x17e)](_0x231ac7(0x199)+_0x3b5f1d);}else _0x399597[_0x231ac7(0x1b4)]===_0x231ac7(0x1af)&&this[_0x231ac7(0x17a)](_0x399597[_0x231ac7(0x193)]);}}async['streamChatJsonl'](_0x55ca1d,_0x4e5cf7,_0xadd353,_0x1c80cd){const _0x1ec9f1=a8_0x2ba85d,_0xa94581=_0x55ca1d[_0x1ec9f1(0x17c)][_0x1ec9f1(0x1a7)];let _0x90a980=![];for await(const _0x3836fe of _0x55ca1d[_0x1ec9f1(0x1a5)][_0x1ec9f1(0x1aa)](_0x4e5cf7,{'agentId':_0xadd353,'chatId':_0x1c80cd})){if(_0x3836fe[_0x1ec9f1(0x1b4)]==='metadata'){const _0x1f685d=_0x3836fe[_0x1ec9f1(0x193)];saveLastChatId(_0x1f685d[_0x1ec9f1(0x184)]);const _0x54dda7=_0x1f685d['projectId']&&_0x1f685d[_0x1ec9f1(0x1b0)]?getLLMConversationUrl(_0xa94581,_0x1f685d[_0x1ec9f1(0x182)],_0x1f685d[_0x1ec9f1(0x1b0)],_0x1f685d[_0x1ec9f1(0x184)]):undefined;console['log'](JSON[_0x1ec9f1(0x1a0)]({'type':_0x1ec9f1(0x1b8),'data':{'chatId':_0x1f685d[_0x1ec9f1(0x184)],'agentId':_0x1f685d[_0x1ec9f1(0x1b0)],'consoleUrl':_0x54dda7}})),_0x90a980=!![];}else{if(_0x3836fe[_0x1ec9f1(0x1b4)]==='event'){!_0x90a980&&_0x1c80cd&&(console['log'](JSON[_0x1ec9f1(0x1a0)]({'type':_0x1ec9f1(0x1b8),'data':{'chatId':_0x1c80cd}})),_0x90a980=!![]);const _0x3ad241=_0x3836fe[_0x1ec9f1(0x193)];if(_0x1ec9f1(0x176)in _0x3ad241)console[_0x1ec9f1(0x1a6)](JSON[_0x1ec9f1(0x1a0)]({'type':'content','data':{'content':_0x3ad241[_0x1ec9f1(0x176)]}}));else{if(_0x1ec9f1(0x19b)in _0x3ad241){const _0x5b1aa5=_0x3ad241[_0x1ec9f1(0x19b)];console[_0x1ec9f1(0x1a6)](JSON['stringify']({'type':_0x1ec9f1(0x19b),'data':{'id':_0x5b1aa5['id'],'name':_0x5b1aa5[_0x1ec9f1(0x19f)],'target':_0x5b1aa5['targetKnowledgeBase']?.[_0x1ec9f1(0x1b5)]||_0x5b1aa5[_0x1ec9f1(0x18d)]?.['name']||_0x5b1aa5[_0x1ec9f1(0x1b2)]?.[_0x1ec9f1(0x1b5)]||_0x5b1aa5[_0x1ec9f1(0x18c)]}}));}else{if(_0x1ec9f1(0x175)in _0x3ad241)console[_0x1ec9f1(0x1a6)](JSON[_0x1ec9f1(0x1a0)]({'type':'tool_result','data':{'id':_0x3ad241[_0x1ec9f1(0x175)]['id'],'name':_0x3ad241['tool'][_0x1ec9f1(0x19f)],'result':typeof _0x3ad241[_0x1ec9f1(0x175)][_0x1ec9f1(0x176)]===_0x1ec9f1(0x17d)?_0x3ad241[_0x1ec9f1(0x175)][_0x1ec9f1(0x176)]['slice'](0x0,0x1f4):''}}));else _0x1ec9f1(0x17e)in _0x3ad241&&console[_0x1ec9f1(0x1a6)](JSON[_0x1ec9f1(0x1a0)]({'type':'error','data':{'error':_0x3ad241[_0x1ec9f1(0x17e)]}}));}}}}}console[_0x1ec9f1(0x1a6)](JSON[_0x1ec9f1(0x1a0)]({'type':'done'}));}async[a8_0x2ba85d(0x194)](_0x5021cb){const _0xbcd81=a8_0x2ba85d,{options:_0x339e0e,args:_0x41e09b,tdx:_0x4d53c6}=_0x5021cb,_0x24125d=_0x41e09b[_0xbcd81(0x1ac)]('\x20'),_0x40dc14=_0x339e0e,_0x53a447=_0x40dc14['agent'],_0x314ef8=_0x40dc14[_0xbcd81(0x179)],_0x397b5a=_0x40dc14[_0xbcd81(0x186)],_0x772747=_0x40dc14[_0xbcd81(0x189)],_0x2a7367=_0x40dc14['chatId'],_0xf2c724=_0x40dc14[_0xbcd81(0x185)];if(_0x772747&&_0x2a7367)return console[_0xbcd81(0x17e)](_0xbcd81(0x1b3)),0x1;try{let _0x515978,_0x543d71;if(_0x2a7367)_0x543d71=_0x2a7367;else!_0x772747&&(_0x543d71=loadLastChatId(),_0x543d71&&_0x339e0e[_0xbcd81(0x178)]&&console[_0xbcd81(0x17e)](_0xbcd81(0x1b6)+_0x543d71));!_0x2a7367&&(_0x772747||!_0x543d71)&&(_0x515978=await resolveAgentId(_0x4d53c6,_0x53a447,_0x314ef8,_0x397b5a,_0x339e0e[_0xbcd81(0x178)]));const _0x42a330=_0xf2c724?(_0x30c1a5,_0x57002f,_0x41e1a5)=>this[_0xbcd81(0x1ba)](_0x4d53c6,_0x30c1a5,_0x57002f,_0x41e1a5):(_0x88be6,_0x3d0f30,_0x272f00)=>this[_0xbcd81(0x197)](_0x4d53c6,_0x88be6,_0x3d0f30,_0x272f00,_0x339e0e[_0xbcd81(0x178)]);try{await _0x42a330(_0x24125d,_0x515978,_0x543d71);}catch(_0x21259b){const _0x3e633b=_0x21259b instanceof SDKError&&_0x21259b[_0xbcd81(0x18f)]===ErrorCode['CHAT_NOT_FOUND']||_0x21259b instanceof Error&&_0x21259b[_0xbcd81(0x1a4)]['includes'](_0xbcd81(0x1b9));if(_0x3e633b&&_0x2a7367)return console['error'](_0xbcd81(0x1b1)+_0x2a7367+_0xbcd81(0x1a1)),0x1;if(_0x3e633b)_0x339e0e[_0xbcd81(0x178)]&&console['error']('Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...'),!_0x515978&&(_0x515978=await resolveAgentId(_0x4d53c6,_0x53a447,_0x314ef8,_0x397b5a,_0x339e0e[_0xbcd81(0x178)])),await _0x42a330(_0x24125d,_0x515978,undefined);else throw _0x21259b;}return!_0xf2c724&&console[_0xbcd81(0x1a6)](),0x0;}catch(_0xa19879){return console['error'](),handleSDKError(_0xa19879,_0x339e0e),0x1;}}['handleChatEvent'](_0x13c7ce){const _0x5e2ab4=a8_0x2ba85d;if(_0x5e2ab4(0x176)in _0x13c7ce)process[_0x5e2ab4(0x190)]['write'](_0x13c7ce[_0x5e2ab4(0x176)]);else _0x5e2ab4(0x17e)in _0x13c7ce&&console['error'](_0x5e2ab4(0x1ad)+_0x13c7ce[_0x5e2ab4(0x17e)]);}}export class ChatCreateCommand extends BaseCommand{[a8_0x2ba85d(0x1b5)]='chat-create';[a8_0x2ba85d(0x18b)]=a8_0x2ba85d(0x192);['validate'](_0x515bf2){const _0x585b40=a8_0x2ba85d,_0x24cd2e=_0x515bf2[_0x585b40(0x1be)],_0x32828e=_0x24cd2e[_0x585b40(0x183)],_0x308f79=_0x24cd2e[_0x585b40(0x179)];if(!_0x32828e&&!_0x308f79)return'Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22';return undefined;}async['execute'](_0x1cbfb8){const _0x558a6f=a8_0x2ba85d,{options:_0x7198bb,tdx:_0x2a5a0e}=_0x1cbfb8,_0x8d9fb6=_0x7198bb,_0x6b0a11=_0x8d9fb6[_0x558a6f(0x183)],_0x26a96a=_0x8d9fb6['llmAgent'],_0x3e4c03=_0x8d9fb6['llmProject'];try{const _0x2352ed=await resolveAgentId(_0x2a5a0e,_0x6b0a11,_0x26a96a,_0x3e4c03,_0x7198bb[_0x558a6f(0x178)]),_0x6dab1f=await _0x2a5a0e['llm'][_0x558a6f(0x18e)](_0x2352ed);return saveLastChatId(_0x6dab1f['id']),console[_0x558a6f(0x1a6)](JSON[_0x558a6f(0x1a0)]({'chatId':_0x6dab1f['id'],'agentId':_0x2352ed})),0x0;}catch(_0x4d20de){return handleSDKError(_0x4d20de,_0x7198bb),0x1;}}}
1
+ const a8_0x4ade6b=a8_0x3037;(function(_0x1c0a0a,_0x53522f){const _0x2840ff=a8_0x3037,_0x17c772=_0x1c0a0a();while(!![]){try{const _0x1ad28c=parseInt(_0x2840ff(0xbd))/0x1+parseInt(_0x2840ff(0xca))/0x2+parseInt(_0x2840ff(0x97))/0x3*(-parseInt(_0x2840ff(0xb0))/0x4)+-parseInt(_0x2840ff(0xce))/0x5+-parseInt(_0x2840ff(0xdc))/0x6+-parseInt(_0x2840ff(0xc1))/0x7*(-parseInt(_0x2840ff(0xda))/0x8)+parseInt(_0x2840ff(0xa7))/0x9*(-parseInt(_0x2840ff(0xcd))/0xa);if(_0x1ad28c===_0x53522f)break;else _0x17c772['push'](_0x17c772['shift']());}catch(_0x545102){_0x17c772['push'](_0x17c772['shift']());}}}(a8_0x3162,0xd4ed1));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(_0x174986,_0x3d5a35){const _0x4e14b9=a8_0x3037;if(_0x174986 instanceof SDKError)console['error'](_0x4e14b9(0xde)+_0x174986[_0x4e14b9(0xcb)]),_0x3d5a35[_0x4e14b9(0xa9)]&&(_0x174986['cause']&&console[_0x4e14b9(0xb1)](_0x4e14b9(0xd1)+_0x174986[_0x4e14b9(0xc4)]),_0x174986[_0x4e14b9(0xd4)]&&(console[_0x4e14b9(0xb1)](_0x4e14b9(0x9f)),console[_0x4e14b9(0xb1)](_0x174986[_0x4e14b9(0xd4)])));else throw _0x174986;}function a8_0x3037(_0x49c6ae,_0x317bc3){_0x49c6ae=_0x49c6ae-0x93;const _0x316223=a8_0x3162();let _0x30374e=_0x316223[_0x49c6ae];return _0x30374e;}async function resolveAgentId(_0x46051b,_0x2d80bb,_0x3cb9ff,_0x4aeaae,_0x3fcbd7){const _0x3c64cd=a8_0x3037,_0x73b157=_0x2d80bb||_0x3cb9ff;if(_0x73b157){const {projectName:_0x1c69c0,agentName:_0x5ee340}=parseAgentRef(_0x73b157),_0x455eb0=_0x5ee340||_0x73b157,_0x33d07a=_0x5ee340?_0x1c69c0:_0x4aeaae;if(!_0x33d07a)throw new Error('No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22');if(_0x3fcbd7){const _0x1ac5f9=_0x2d80bb?_0x3c64cd(0xa3):'session\x20context';console[_0x3c64cd(0xb1)]('Using\x20agent\x20from\x20'+_0x1ac5f9+':\x20'+_0x33d07a+'/'+_0x455eb0);}const _0x383c89=await withSpinner('Resolving\x20project\x20\x27'+_0x33d07a+'\x27...',()=>_0x46051b[_0x3c64cd(0xae)][_0x3c64cd(0xaa)](_0x33d07a),{'verbose':_0x3fcbd7}),_0x163c84=await withSpinner('Resolving\x20agent\x20\x27'+_0x455eb0+_0x3c64cd(0xac),()=>_0x46051b[_0x3c64cd(0xae)]['resolveAgentId'](_0x455eb0,_0x383c89[_0x3c64cd(0xa8)]),{'verbose':_0x3fcbd7});return _0x163c84[_0x3c64cd(0xa8)];}else{const _0x55ba63=_0x46051b['llm'][_0x3c64cd(0xc2)]();if(_0x55ba63)return _0x3fcbd7&&console[_0x3c64cd(0xb1)](_0x3c64cd(0xe0)+_0x55ba63[_0x3c64cd(0xb8)]),_0x55ba63['id'];const _0x187d84=await withSpinner(_0x3c64cd(0xdb),()=>_0x46051b[_0x3c64cd(0xae)][_0x3c64cd(0xd6)](_0x3c64cd(0xb7),0x0),{'verbose':_0x3fcbd7});return _0x187d84[_0x3c64cd(0xa8)]['id'];}}function a8_0x3162(){const _0x187b6c=['llmProject','projectId','chat','14zQxGWR','getDefaultAgent','streamChat','cause','join','stringify','Error:\x20Chat\x20session\x20\x27','tool','stdout','2041042kXNcXs','message','llmAgent','24370MVbOcw','2942965gdIcgE','Create\x20a\x20new\x20chat\x20session','startChat','\x20\x20Cause:\x20','description','args','stack','chat-create','getOrCreateDefaultAgent','chatId','Chat\x20session:\x20','handleChatEvent','5896760mUBBJg','Getting\x20default\x20agent...','3965292sLzzqw','options','Error:\x20','targetAgent','Using\x20cached\x20default\x20agent:\x20','log','content','validate','functionName','41343PdiUYB','targetWebSearchTool','includes','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','agent','stream','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','metadata','\x0aStack\x20trace:','event','streamChatJsonl','context','--agent\x20flag','CHAT_NOT_FOUND','type','slice','153SWjGju','data','verbose','resolveProjectId','execute','\x27...','tool_call','llm','targetKnowledgeBase','468cGiQMe','error','Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together','write','\x0aError:\x20','targetFunction','Continuing\x20chat:\x20','claude-4.5-haiku','name','string','agentId','done','new','1280715NxUzlm'];a8_0x3162=function(){return _0x187b6c;};return a8_0x3162();}export class ChatCommand extends BaseCommand{['name']=a8_0x4ade6b(0xc0);['description']='Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)';[a8_0x4ade6b(0x95)](_0xa207f1){const _0x5ccb5f=a8_0x4ade6b,_0x4df3cb=_0xa207f1[_0x5ccb5f(0xd3)][_0x5ccb5f(0xc5)]('\x20');if(!_0x4df3cb)return _0x5ccb5f(0x9a);return undefined;}async['streamChat'](_0x345d5b,_0x192d1e,_0x24bc3a,_0x230ad3,_0x37b89e){const _0x35441f=a8_0x4ade6b;for await(const _0x42411c of _0x345d5b[_0x35441f(0xae)][_0x35441f(0xc0)](_0x192d1e,{'agentId':_0x24bc3a,'chatId':_0x230ad3})){if(_0x42411c['type']===_0x35441f(0x9e)){const _0x162a5b=_0x42411c[_0x35441f(0xa8)][_0x35441f(0xd7)];saveLastChatId(_0x162a5b),_0x37b89e&&console[_0x35441f(0xb1)](_0x35441f(0xd8)+_0x162a5b);}else _0x42411c[_0x35441f(0xa5)]==='event'&&this[_0x35441f(0xd9)](_0x42411c[_0x35441f(0xa8)]);}}async['streamChatJsonl'](_0x54edf2,_0x1e5902,_0x21e41d,_0x3bd637){const _0xf3795a=a8_0x4ade6b,_0x430e04=_0x54edf2[_0xf3795a(0xa2)]['site'];let _0x8fc930=![];for await(const _0x5c23ff of _0x54edf2[_0xf3795a(0xae)]['chat'](_0x1e5902,{'agentId':_0x21e41d,'chatId':_0x3bd637})){if(_0x5c23ff[_0xf3795a(0xa5)]===_0xf3795a(0x9e)){const _0x5ce3b4=_0x5c23ff[_0xf3795a(0xa8)];saveLastChatId(_0x5ce3b4[_0xf3795a(0xd7)]);const _0xe222a8=_0x5ce3b4[_0xf3795a(0xbf)]&&_0x5ce3b4[_0xf3795a(0xba)]?getLLMConversationUrl(_0x430e04,_0x5ce3b4[_0xf3795a(0xbf)],_0x5ce3b4[_0xf3795a(0xba)],_0x5ce3b4[_0xf3795a(0xd7)]):undefined;console[_0xf3795a(0x93)](JSON[_0xf3795a(0xc6)]({'type':_0xf3795a(0x9e),'data':{'chatId':_0x5ce3b4[_0xf3795a(0xd7)],'agentId':_0x5ce3b4[_0xf3795a(0xba)],'consoleUrl':_0xe222a8}})),_0x8fc930=!![];}else{if(_0x5c23ff['type']===_0xf3795a(0xa0)){!_0x8fc930&&_0x3bd637&&(console[_0xf3795a(0x93)](JSON['stringify']({'type':'metadata','data':{'chatId':_0x3bd637}})),_0x8fc930=!![]);const _0x6fdd37=_0x5c23ff[_0xf3795a(0xa8)];if('content'in _0x6fdd37)console[_0xf3795a(0x93)](JSON[_0xf3795a(0xc6)]({'type':_0xf3795a(0x94),'data':{'content':_0x6fdd37[_0xf3795a(0x94)]}}));else{if('tool_call'in _0x6fdd37){const _0x4a4a19=_0x6fdd37[_0xf3795a(0xad)];console[_0xf3795a(0x93)](JSON['stringify']({'type':_0xf3795a(0xad),'data':{'id':_0x4a4a19['id'],'name':_0x4a4a19['functionName'],'target':_0x4a4a19[_0xf3795a(0xaf)]?.[_0xf3795a(0xb8)]||_0x4a4a19[_0xf3795a(0xdf)]?.[_0xf3795a(0xb8)]||_0x4a4a19[_0xf3795a(0x98)]?.[_0xf3795a(0xb8)]||_0x4a4a19[_0xf3795a(0xb5)]}}));}else{if('tool'in _0x6fdd37)console[_0xf3795a(0x93)](JSON[_0xf3795a(0xc6)]({'type':'tool_result','data':{'id':_0x6fdd37['tool']['id'],'name':_0x6fdd37['tool'][_0xf3795a(0x96)],'result':typeof _0x6fdd37[_0xf3795a(0xc8)]['content']===_0xf3795a(0xb9)?_0x6fdd37[_0xf3795a(0xc8)]['content'][_0xf3795a(0xa6)](0x0,0x1f4):''}}));else _0xf3795a(0xb1)in _0x6fdd37&&console[_0xf3795a(0x93)](JSON[_0xf3795a(0xc6)]({'type':_0xf3795a(0xb1),'data':{'error':_0x6fdd37['error']}}));}}}}}console[_0xf3795a(0x93)](JSON[_0xf3795a(0xc6)]({'type':_0xf3795a(0xbb)}));}async[a8_0x4ade6b(0xab)](_0x2832b3){const _0x13bcbf=a8_0x4ade6b,{options:_0x56414a,args:_0x3065bf,tdx:_0x82fb4d}=_0x2832b3,_0x582007=_0x3065bf['join']('\x20'),_0x1f954e=_0x56414a,_0x11334d=_0x1f954e['agent'],_0x39848c=_0x1f954e['llmAgent'],_0xf5b20b=_0x1f954e[_0x13bcbf(0xbe)],_0x568fc5=_0x1f954e[_0x13bcbf(0xbc)],_0x29cad6=_0x1f954e[_0x13bcbf(0xd7)],_0x5f3e12=_0x1f954e[_0x13bcbf(0x9c)];if(_0x568fc5&&_0x29cad6)return console['error'](_0x13bcbf(0xb2)),0x1;try{let _0x5c1611,_0x303bec;if(_0x29cad6)_0x303bec=_0x29cad6;else!_0x568fc5&&(_0x303bec=loadLastChatId(),_0x303bec&&_0x56414a[_0x13bcbf(0xa9)]&&console[_0x13bcbf(0xb1)](_0x13bcbf(0xb6)+_0x303bec));!_0x29cad6&&(_0x568fc5||!_0x303bec)&&(_0x5c1611=await resolveAgentId(_0x82fb4d,_0x11334d,_0x39848c,_0xf5b20b,_0x56414a[_0x13bcbf(0xa9)]));const _0x16528d=_0x5f3e12?(_0x380773,_0x48a250,_0x5a856f)=>this[_0x13bcbf(0xa1)](_0x82fb4d,_0x380773,_0x48a250,_0x5a856f):(_0x3ba552,_0x111120,_0x2fb0b2)=>this[_0x13bcbf(0xc3)](_0x82fb4d,_0x3ba552,_0x111120,_0x2fb0b2,_0x56414a[_0x13bcbf(0xa9)]);try{await _0x16528d(_0x582007,_0x5c1611,_0x303bec);}catch(_0x178dcb){const _0x2c6192=_0x178dcb instanceof SDKError&&_0x178dcb['code']===ErrorCode[_0x13bcbf(0xa4)]||_0x178dcb instanceof Error&&_0x178dcb['message'][_0x13bcbf(0x99)]('404');if(_0x2c6192&&_0x29cad6)return console[_0x13bcbf(0xb1)](_0x13bcbf(0xc7)+_0x29cad6+'\x27\x20not\x20found'),0x1;if(_0x2c6192)_0x56414a[_0x13bcbf(0xa9)]&&console['error'](_0x13bcbf(0x9d)),!_0x5c1611&&(_0x5c1611=await resolveAgentId(_0x82fb4d,_0x11334d,_0x39848c,_0xf5b20b,_0x56414a[_0x13bcbf(0xa9)])),await _0x16528d(_0x582007,_0x5c1611,undefined);else throw _0x178dcb;}return!_0x5f3e12&&console[_0x13bcbf(0x93)](),0x0;}catch(_0x1299bd){return console[_0x13bcbf(0xb1)](),handleSDKError(_0x1299bd,_0x56414a),0x1;}}[a8_0x4ade6b(0xd9)](_0x2b7158){const _0xbf67a3=a8_0x4ade6b;if(_0xbf67a3(0x94)in _0x2b7158)process[_0xbf67a3(0xc9)][_0xbf67a3(0xb3)](_0x2b7158['content']);else _0xbf67a3(0xb1)in _0x2b7158&&console[_0xbf67a3(0xb1)](_0xbf67a3(0xb4)+_0x2b7158[_0xbf67a3(0xb1)]);}}export class ChatCreateCommand extends BaseCommand{[a8_0x4ade6b(0xb8)]=a8_0x4ade6b(0xd5);[a8_0x4ade6b(0xd2)]=a8_0x4ade6b(0xcf);[a8_0x4ade6b(0x95)](_0x15402e){const _0x27ba57=a8_0x4ade6b,_0xffb6a9=_0x15402e[_0x27ba57(0xdd)],_0x575573=_0xffb6a9[_0x27ba57(0x9b)],_0x3aae53=_0xffb6a9['llmAgent'];if(!_0x575573&&!_0x3aae53)return'Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22';return undefined;}async[a8_0x4ade6b(0xab)](_0x5c7b64){const _0x30d287=a8_0x4ade6b,{options:_0x43d588,tdx:_0xecaf5d}=_0x5c7b64,_0x1d0bd4=_0x43d588,_0x20d478=_0x1d0bd4[_0x30d287(0x9b)],_0x4d8de6=_0x1d0bd4[_0x30d287(0xcc)],_0x3d22f0=_0x1d0bd4[_0x30d287(0xbe)];try{const _0x4def89=await resolveAgentId(_0xecaf5d,_0x20d478,_0x4d8de6,_0x3d22f0,_0x43d588[_0x30d287(0xa9)]),_0x36eb4c=await _0xecaf5d['llm'][_0x30d287(0xd0)](_0x4def89);return saveLastChatId(_0x36eb4c['id']),console[_0x30d287(0x93)](JSON[_0x30d287(0xc6)]({'chatId':_0x36eb4c['id'],'agentId':_0x4def89})),0x0;}catch(_0x4fd975){return handleSDKError(_0x4fd975,_0x43d588),0x1;}}}