@treasuredata/tdx 0.25.6 → 0.25.7

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 (165) 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-yaml.js +1 -1
  108. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  109. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  110. package/dist/sdk/segment/pull-workflow.js +1 -1
  111. package/dist/sdk/segment/push-workflow.js +1 -1
  112. package/dist/sdk/segment/resolution-context.js +1 -1
  113. package/dist/sdk/segment/segment-path-parser.js +1 -1
  114. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  115. package/dist/sdk/segment/target-resolution.js +1 -1
  116. package/dist/sdk/segment/tdx-config.js +1 -1
  117. package/dist/sdk/segment/validate-files.js +1 -1
  118. package/dist/sdk/segment/yaml-validator.js +1 -1
  119. package/dist/sdk/segment.js +1 -1
  120. package/dist/sdk/types/index.js +1 -1
  121. package/dist/sdk/types/progress.js +1 -1
  122. package/dist/sdk/user.js +1 -1
  123. package/dist/sdk/util/format-detector.js +1 -1
  124. package/dist/sdk/util/formatters.js +1 -1
  125. package/dist/sdk/util/index.js +1 -1
  126. package/dist/sdk/util/tree-formatter.js +1 -1
  127. package/dist/sdk/workflow/archive-validation.js +1 -1
  128. package/dist/sdk/workflow/clone-workflow.js +1 -1
  129. package/dist/sdk/workflow/index.js +1 -1
  130. package/dist/sdk/workflow/pull-workflow.js +1 -1
  131. package/dist/sdk/workflow/push-workflow.js +1 -1
  132. package/dist/sdk/workflow/tdx-config.js +1 -1
  133. package/dist/sdk/workflow/workflow-utils.js +1 -1
  134. package/dist/test-utils/command-runner.js +1 -1
  135. package/dist/test-utils/factories.js +1 -1
  136. package/dist/test-utils/fixtures.js +1 -1
  137. package/dist/test-utils/http-mock.js +1 -1
  138. package/dist/test-utils/index.js +1 -1
  139. package/dist/utils/async.js +1 -1
  140. package/dist/utils/colors.js +1 -1
  141. package/dist/utils/diff.js +1 -1
  142. package/dist/utils/file-permissions.js +1 -1
  143. package/dist/utils/global-cache.js +1 -1
  144. package/dist/utils/json-loader.js +1 -1
  145. package/dist/utils/local-cache.js +1 -1
  146. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  147. package/dist/utils/logger/formatters/index.js +1 -1
  148. package/dist/utils/logger/handlers/console-handler.js +1 -1
  149. package/dist/utils/logger/handlers/file-handler.js +1 -1
  150. package/dist/utils/logger/handlers/index.js +1 -1
  151. package/dist/utils/logger/handlers/null-handler.js +1 -1
  152. package/dist/utils/logger/index.js +1 -1
  153. package/dist/utils/logger/logger.js +1 -1
  154. package/dist/utils/logger/types.js +1 -1
  155. package/dist/utils/option-validation.js +1 -1
  156. package/dist/utils/port.js +1 -1
  157. package/dist/utils/process.js +1 -1
  158. package/dist/utils/prompt.js +1 -1
  159. package/dist/utils/spinner.js +1 -1
  160. package/dist/utils/sse-parser.js +1 -1
  161. package/dist/utils/string-utils.js +1 -1
  162. package/dist/utils/table-ref-parser.js +1 -1
  163. package/dist/utils/tdx-logger.js +1 -1
  164. package/dist/utils/version-check.js +1 -1
  165. package/package.json +1 -1
@@ -1 +1 @@
1
- const a3_0x308fe8=a3_0x38c5;function a3_0x38c5(_0x5dc710,_0x2ae0c1){_0x5dc710=_0x5dc710-0x176;const _0x1c9674=a3_0x1c96();let _0x38c586=_0x1c9674[_0x5dc710];return _0x38c586;}(function(_0x296297,_0x312dc1){const _0x3fa87d=a3_0x38c5,_0x4b4ec8=_0x296297();while(!![]){try{const _0x3ec4c8=-parseInt(_0x3fa87d(0x18c))/0x1*(-parseInt(_0x3fa87d(0x184))/0x2)+-parseInt(_0x3fa87d(0x17a))/0x3*(parseInt(_0x3fa87d(0x177))/0x4)+parseInt(_0x3fa87d(0x181))/0x5*(-parseInt(_0x3fa87d(0x18e))/0x6)+parseInt(_0x3fa87d(0x197))/0x7*(-parseInt(_0x3fa87d(0x18b))/0x8)+parseInt(_0x3fa87d(0x189))/0x9+parseInt(_0x3fa87d(0x17d))/0xa*(parseInt(_0x3fa87d(0x182))/0xb)+parseInt(_0x3fa87d(0x180))/0xc;if(_0x3ec4c8===_0x312dc1)break;else _0x4b4ec8['push'](_0x4b4ec8['shift']());}catch(_0x446971){_0x4b4ec8['push'](_0x4b4ec8['shift']());}}}(a3_0x1c96,0x3d16c));import{BaseCommand}from'./command.js';function a3_0x1c96(){const _0x5e844a=['length','Resolved\x20child\x20ID:\x20','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','7VrxrmK','listActivations','✔\x20Found\x20','\x20activation','Error:\x20','List\x20activations\x20for\x20a\x20segment','data','302156dIsqXl','Resolving\x20child\x20segment\x20\x27','Child\x20name:\x20','6AREhpc','Resolving\x20parent\x20segment\x20\x27','Site:\x20','4490rxhQrz','\x27...','Listing\x20activations\x20for\x20segment\x20\x27','5165604UomAKu','3140qIPlwz','55kAQXAi','activations','1178HOYjgP','name','cause','site','Resolved\x20parent\x20ID:\x20','607374DitSsF','Parent\x20name:\x20','1244312OmfDYQ','319FoUtZA','Error:\x20Segment\x20name\x20is\x20required','1254fzFXie','resolveSegmentId','verbose','segment','error','description'];a3_0x1c96=function(){return _0x5e844a;};return a3_0x1c96();}import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';export class ActivationsCommand extends BaseCommand{[a3_0x308fe8(0x185)]=a3_0x308fe8(0x183);[a3_0x308fe8(0x193)]=a3_0x308fe8(0x19c);async['execute'](_0x3ca8f7){const _0x3e6014=a3_0x308fe8,{options:_0x449e12,args:_0x589458,tdx:_0x1c32e5}=_0x3ca8f7;if(_0x589458[_0x3e6014(0x194)]===0x0)return console[_0x3e6014(0x192)](_0x3e6014(0x18d)),console['error'](_0x3e6014(0x196)),0x1;try{const {parentId:_0x1baada,childId:_0xf7ea7b}=parseSegmentRef(_0x589458[0x0]);if(!_0xf7ea7b)return console[_0x3e6014(0x192)]('Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations'),console[_0x3e6014(0x192)](_0x3e6014(0x196)),0x1;_0x449e12['verbose']&&(console[_0x3e6014(0x192)](_0x3e6014(0x17c)+_0x449e12[_0x3e6014(0x187)]),console['error'](_0x3e6014(0x18a)+_0x1baada),console[_0x3e6014(0x192)](_0x3e6014(0x179)+_0xf7ea7b));const _0x324a9d=await withSpinner(_0x3e6014(0x17b)+_0x1baada+_0x3e6014(0x17e),()=>_0x1c32e5[_0x3e6014(0x191)]['resolveParentId'](_0x1baada),{'verbose':_0x449e12[_0x3e6014(0x190)]}),_0x16bec8=_0x324a9d[_0x3e6014(0x176)];_0x449e12[_0x3e6014(0x190)]&&console[_0x3e6014(0x192)](_0x3e6014(0x188)+_0x16bec8);const _0x11a2dc=await withSpinner(_0x3e6014(0x178)+_0xf7ea7b+_0x3e6014(0x17e),()=>_0x1c32e5[_0x3e6014(0x191)][_0x3e6014(0x18f)](_0x16bec8,_0xf7ea7b),{'verbose':_0x449e12[_0x3e6014(0x190)]}),_0x2f48dd=_0x11a2dc[_0x3e6014(0x176)];_0x449e12[_0x3e6014(0x190)]&&console[_0x3e6014(0x192)](_0x3e6014(0x195)+_0x2f48dd);const _0x4e1af7=await withSpinner(_0x3e6014(0x17f)+_0xf7ea7b+_0x3e6014(0x17e),()=>_0x1c32e5[_0x3e6014(0x191)][_0x3e6014(0x198)](_0x16bec8,_0x2f48dd),{'verbose':_0x449e12[_0x3e6014(0x190)]}),_0x3e0db6=_0x4e1af7[_0x3e6014(0x176)];return console[_0x3e6014(0x192)](_0x3e6014(0x199)+_0x3e0db6['length']+_0x3e6014(0x19a)+(_0x3e0db6[_0x3e6014(0x194)]!==0x1?'s':'')),await handleSDKOutput(_0x3e0db6,_0x449e12),0x0;}catch(_0x4690c6){if(_0x4690c6 instanceof SDKError)return console['error'](_0x3e6014(0x19b)+_0x4690c6['message']),_0x4690c6[_0x3e6014(0x186)]&&console[_0x3e6014(0x192)]('\x20\x20Cause:\x20'+_0x4690c6[_0x3e6014(0x186)]),0x1;throw _0x4690c6;}}}
1
+ const a3_0x5792bd=a3_0x5dbc;function a3_0x5dbc(_0x31da45,_0x2205a5){_0x31da45=_0x31da45-0xd7;const _0x237c24=a3_0x237c();let _0x5dbce7=_0x237c24[_0x31da45];return _0x5dbce7;}(function(_0x22d127,_0x9cd9a4){const _0xc2a89c=a3_0x5dbc,_0x3bbdee=_0x22d127();while(!![]){try{const _0x2ab209=-parseInt(_0xc2a89c(0xf0))/0x1*(-parseInt(_0xc2a89c(0xd7))/0x2)+parseInt(_0xc2a89c(0xdf))/0x3+parseInt(_0xc2a89c(0xe8))/0x4+parseInt(_0xc2a89c(0xf3))/0x5*(-parseInt(_0xc2a89c(0xe0))/0x6)+parseInt(_0xc2a89c(0xf5))/0x7+-parseInt(_0xc2a89c(0xf2))/0x8+parseInt(_0xc2a89c(0xf6))/0x9;if(_0x2ab209===_0x9cd9a4)break;else _0x3bbdee['push'](_0x3bbdee['shift']());}catch(_0x1b03e7){_0x3bbdee['push'](_0x3bbdee['shift']());}}}(a3_0x237c,0x78cb3));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';export class ActivationsCommand extends BaseCommand{[a3_0x5792bd(0xde)]=a3_0x5792bd(0xe2);[a3_0x5792bd(0xf1)]=a3_0x5792bd(0xf7);async[a3_0x5792bd(0xdd)](_0x253346){const _0x55ab62=a3_0x5792bd,{options:_0x3c2d73,args:_0x2a0c02,tdx:_0x1f7554}=_0x253346;if(_0x2a0c02[_0x55ab62(0xea)]===0x0)return console[_0x55ab62(0xee)](_0x55ab62(0xd8)),console[_0x55ab62(0xee)](_0x55ab62(0xe6)),0x1;try{const {parentId:_0x9841ea,childId:_0x5be761}=parseSegmentRef(_0x2a0c02[0x0]);if(!_0x5be761)return console[_0x55ab62(0xee)](_0x55ab62(0xe7)),console[_0x55ab62(0xee)](_0x55ab62(0xe6)),0x1;_0x3c2d73[_0x55ab62(0xe3)]&&(console[_0x55ab62(0xee)]('Site:\x20'+_0x3c2d73['site']),console['error'](_0x55ab62(0xec)+_0x9841ea),console['error']('Child\x20name:\x20'+_0x5be761));const _0x30201d=await withSpinner(_0x55ab62(0xf9)+_0x9841ea+_0x55ab62(0xe5),()=>_0x1f7554[_0x55ab62(0xef)][_0x55ab62(0xe1)](_0x9841ea),{'verbose':_0x3c2d73[_0x55ab62(0xe3)]}),_0x222473=_0x30201d[_0x55ab62(0xeb)];_0x3c2d73[_0x55ab62(0xe3)]&&console[_0x55ab62(0xee)](_0x55ab62(0xf4)+_0x222473);const _0x510032=await withSpinner(_0x55ab62(0xd9)+_0x5be761+'\x27...',()=>_0x1f7554[_0x55ab62(0xef)][_0x55ab62(0xe4)](_0x222473,_0x5be761),{'verbose':_0x3c2d73[_0x55ab62(0xe3)]}),_0x316e4=_0x510032[_0x55ab62(0xeb)];_0x3c2d73[_0x55ab62(0xe3)]&&console[_0x55ab62(0xee)]('Resolved\x20child\x20ID:\x20'+_0x316e4);const _0x329f47=await withSpinner(_0x55ab62(0xf8)+_0x5be761+_0x55ab62(0xe5),()=>_0x1f7554[_0x55ab62(0xef)][_0x55ab62(0xda)](_0x222473,_0x316e4),{'verbose':_0x3c2d73[_0x55ab62(0xe3)]}),_0x16b1ec=_0x329f47[_0x55ab62(0xeb)];return console[_0x55ab62(0xee)]('✔\x20Found\x20'+_0x16b1ec['length']+_0x55ab62(0xdb)+(_0x16b1ec[_0x55ab62(0xea)]!==0x1?'s':'')),await handleSDKOutput(_0x16b1ec,_0x3c2d73),0x0;}catch(_0x47d775){if(_0x47d775 instanceof SDKError)return console['error']('Error:\x20'+_0x47d775[_0x55ab62(0xdc)]),_0x47d775[_0x55ab62(0xe9)]&&console[_0x55ab62(0xee)](_0x55ab62(0xed)+_0x47d775[_0x55ab62(0xe9)]),0x1;throw _0x47d775;}}}function a3_0x237c(){const _0x274688=['cause','length','data','Parent\x20name:\x20','\x20\x20Cause:\x20','error','segment','1dKAHkI','description','7519312tVWjiy','393730jwuQFo','Resolved\x20parent\x20ID:\x20','2062837tETYXK','1220472ALhuqC','List\x20activations\x20for\x20a\x20segment','Listing\x20activations\x20for\x20segment\x20\x27','Resolving\x20parent\x20segment\x20\x27','723222FjhYXg','Error:\x20Segment\x20name\x20is\x20required','Resolving\x20child\x20segment\x20\x27','listActivations','\x20activation','message','execute','name','2100819hEUhiB','48RvrKVP','resolveParentId','activations','verbose','resolveSegmentId','\x27...','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','2289880xfXSmE'];a3_0x237c=function(){return _0x274688;};return a3_0x237c();}
@@ -1 +1 @@
1
- const a4_0x3da32f=a4_0x4a38;(function(_0x877152,_0x51b68a){const _0x49b7d7=a4_0x4a38,_0x380fdb=_0x877152();while(!![]){try{const _0x5ace29=-parseInt(_0x49b7d7(0x1a4))/0x1+parseInt(_0x49b7d7(0x114))/0x2+-parseInt(_0x49b7d7(0x169))/0x3*(parseInt(_0x49b7d7(0x104))/0x4)+parseInt(_0x49b7d7(0x18e))/0x5*(-parseInt(_0x49b7d7(0x188))/0x6)+parseInt(_0x49b7d7(0x112))/0x7+parseInt(_0x49b7d7(0x133))/0x8+parseInt(_0x49b7d7(0x195))/0x9;if(_0x5ace29===_0x51b68a)break;else _0x380fdb['push'](_0x380fdb['shift']());}catch(_0x43df33){_0x380fdb['push'](_0x380fdb['shift']());}}}(a4_0x88f7,0x5ac4a));import a4_0x727e9d from'chalk';import a4_0xba3762 from'path';import{existsSync,readFileSync}from'fs';function a4_0x88f7(){const _0x449760=['\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','hasChanges','\x20\x20Experimental\x20Artifact\x20\x22','\x0aChanges\x20to\x20prompt\x20\x27','\x0aPush\x20summary\x20for\x20\x27','\x20successfully','New\x20project:\x20','\x20\x20Integration\x20\x22','\x0aChanges\x20to\x20agent\x20\x27','projectName','Analyzing\x20project\x20\x22','red','projectId','cyan','\x0aError:','llm_project','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Would\x20push\x20agent:\x20','\x20files\x20to\x20','\x22\x20to\x20a\x20different\x20profile','push','Dry\x20run\x20-\x20no\x20changes\x20made','\x20resources?','\x0aChanges:','New\x20project\x20name\x20is\x20required','\x0aPull\x20summary\x20for\x20\x27','new','Project\x20cloned\x20with\x20errors','\x22:\x20','\x0a✔\x20Pushed\x20','parse','\x20unchanged','textKnowledgeBases','210999BqDbUg','Project:\x20','session','gray','diff','Writing\x20files...','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','\x20\x20Target:\x20','\x20\x20Prompt\x20\x22','\x20\x20Prompts:\x20','counts','newProjectId','Pushing\x20agent\x20from\x20\x22','dim','✔\x20Context\x20set:\x20','repeat','outputDir','<new-name>','Output\x20path:\x20','\x20=\x20','\x0aWrite\x20','\x20\x20Integrations:\x20','Dry\x20run\x20-\x20no\x20files\x20written','\x20\x20Agents:\x20','pushProject','Pushing\x20to\x20project...','\x20\x20tdx\x20agent\x20clone\x20agents/','Pulling\x20agent\x20\x22','\x22\x20from\x20project\x20\x22','\x0aPush\x20','log','3593706CrDxMX','Using\x20local\x20project:\x20','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','experimentalKnowledgeBases','prompts','\x20\x20Knowledge\x20Base\x20\x22','5mffcLJ','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','Agent:\x20','\x20files?','-\x20no\x20files\x20written','created','reason','13253229uXHaAf','yellow','Analyzing\x20changes\x20to\x20push...','agentName','\x20errors','errors','agentId','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','cloneProject','pushAgent','Errors:','newProjectName','\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','\x22\x20to\x20new\x20project\x20\x22','\x22\x20to\x20\x22','661982Hvegsi','\x20\x20Experimental\x20Artifacts:\x20','action','Clone\x20\x22','tdx.json','force','\x20changed','\x20total','error','name','knowledgeBases','\x20\x20Agent\x20\x22','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','Failed\x20to\x20push\x20agent:\x20','28ABBDuh','updated','isNew','site','\x20--profile\x20','context','sourceProjectName','Summary:','\x20|\x20','outputPath','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20#\x20Pull\x20specific\x20agent','join','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','unchanged','3287102HthAvQ','source','288806lUneWS','\x20\x20Source:\x20','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','integrations','\x27\x20to\x20create\x20the\x20folder\x20structure.','dryRun','experimentalArtifacts','pullProject','New\x20project\x20ID:\x20','Cancelled','Cloning\x20\x22','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','\x20created','\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','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','cwd','green','\x20\x20Knowledge\x20Bases:\x20','\x0a✔\x20Pulled\x20','\x22...','\x20new','Source:\x20','pullAgent','Using\x20current\x20project:\x20','-\x20nothing\x20pushed','agent:clone','message','llm','total','description','307840wwEhJr','llmProject','dirname','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','profile','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)','agents','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','yes','\x20--name\x20','INVALID_ARGUMENT','agent:pull','\x20\x20Text\x20Knowledge\x20Bases:\x20','Agent\x20pulled\x20successfully','execute','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','Project\x20cloned\x20successfully','\x20\x20tdx\x20agent\x20clone\x20--name\x20<new-name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clone\x20from\x20context\x20(llm_project)','output','Status:\x20','utf-8'];a4_0x88f7=function(){return _0x449760;};return a4_0x88f7();}import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function a4_0x4a38(_0x44cc60,_0x115228){_0x44cc60=_0x44cc60-0x100;const _0x88f7f8=a4_0x88f7();let _0x4a3800=_0x88f7f8[_0x44cc60];return _0x4a3800;}function formatCountSummary(_0x310792){const _0x5e5875=a4_0x4a38,_0xa9a4c9=[];if(_0x310792[_0x5e5875(0x131)]!==undefined)_0xa9a4c9[_0x5e5875(0x15c)](_0x310792[_0x5e5875(0x131)]+_0x5e5875(0x1ab));if(_0x310792[_0x5e5875(0x162)]!==undefined&&_0x310792[_0x5e5875(0x162)]>0x0)_0xa9a4c9['push'](a4_0x727e9d[_0x5e5875(0x125)](_0x310792['new']+'\x20new'));if(_0x310792[_0x5e5875(0x193)]!==undefined&&_0x310792[_0x5e5875(0x193)]>0x0)_0xa9a4c9[_0x5e5875(0x15c)](a4_0x727e9d[_0x5e5875(0x125)](_0x310792[_0x5e5875(0x193)]+_0x5e5875(0x121)));if(_0x310792[_0x5e5875(0x105)]!==undefined&&_0x310792['updated']>0x0)_0xa9a4c9['push'](a4_0x727e9d[_0x5e5875(0x196)](_0x310792['updated']+'\x20updated'));if(_0x310792[_0x5e5875(0x111)]!==undefined&&_0x310792[_0x5e5875(0x111)]>0x0)_0xa9a4c9['push'](a4_0x727e9d[_0x5e5875(0x16c)](_0x310792['unchanged']+'\x20unchanged'));if(_0x310792[_0x5e5875(0x19a)]!==undefined&&_0x310792[_0x5e5875(0x19a)]>0x0)_0xa9a4c9['push'](a4_0x727e9d[_0x5e5875(0x153)](_0x310792[_0x5e5875(0x19a)]+_0x5e5875(0x199)));return _0xa9a4c9[_0x5e5875(0x10f)](',\x20');}function displayDiffs(_0x3e5ae2,_0x180110,_0x229e0f,_0x525cf9,_0x390d31,_0x108845,_0x31ed17){const _0x370023=a4_0x4a38;for(const _0xfd5a0c of _0x3e5ae2){if(_0xfd5a0c[_0x370023(0x16d)]){const _0x5f4b65=_0xfd5a0c[_0x370023(0x198)]||_0xfd5a0c[_0x370023(0x1ad)];console[_0x370023(0x187)](_0x370023(0x150)+_0x5f4b65+'\x27:'),console['log']('─'[_0x370023(0x178)](0x3c)),console[_0x370023(0x187)](_0xfd5a0c['diff']),console[_0x370023(0x187)]('─'[_0x370023(0x178)](0x3c));}}for(const _0x253a24 of _0x180110){_0x253a24['diff']&&(console[_0x370023(0x187)]('\x0aChanges\x20to\x20knowledge\x20base\x20\x27'+_0x253a24[_0x370023(0x1ad)]+'\x27:'),console[_0x370023(0x187)]('─'[_0x370023(0x178)](0x3c)),console['log'](_0x253a24[_0x370023(0x16d)]),console[_0x370023(0x187)]('─'[_0x370023(0x178)](0x3c)));}for(const _0x4f3311 of _0x229e0f){_0x4f3311[_0x370023(0x16d)]&&(console[_0x370023(0x187)]('\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27'+_0x4f3311['name']+'\x27:'),console[_0x370023(0x187)]('─'[_0x370023(0x178)](0x3c)),console[_0x370023(0x187)](_0x4f3311[_0x370023(0x16d)]),console[_0x370023(0x187)]('─'[_0x370023(0x178)](0x3c)));}for(const _0x24eb1f of _0x525cf9){_0x24eb1f[_0x370023(0x16d)]&&(console[_0x370023(0x187)](_0x370023(0x14b)+_0x24eb1f[_0x370023(0x1ad)]+'\x27:'),console['log']('─'[_0x370023(0x178)](0x3c)),console[_0x370023(0x187)](_0x24eb1f['diff']),console['log']('─'[_0x370023(0x178)](0x3c)));}for(const _0x3e6010 of _0x390d31){_0x3e6010[_0x370023(0x16d)]&&(console['log']('\x0aChanges\x20to\x20integration\x20\x27'+_0x3e6010[_0x370023(0x1ad)]+'\x27:'),console[_0x370023(0x187)]('─'['repeat'](0x3c)),console[_0x370023(0x187)](_0x3e6010[_0x370023(0x16d)]),console['log']('─'[_0x370023(0x178)](0x3c)));}for(const _0x4935e3 of _0x108845){_0x4935e3[_0x370023(0x16d)]&&(console[_0x370023(0x187)](_0x370023(0x110)+_0x4935e3[_0x370023(0x1ad)]+'\x27:'),console['log']('─'[_0x370023(0x178)](0x3c)),console['log'](_0x4935e3[_0x370023(0x16d)]),console['log']('─'[_0x370023(0x178)](0x3c)));}for(const _0x2b04e8 of _0x31ed17){_0x2b04e8['diff']&&(console[_0x370023(0x187)]('\x0aChanges\x20to\x20experimental\x20artifact\x20\x27'+_0x2b04e8['name']+'\x27:'),console['log']('─'['repeat'](0x3c)),console[_0x370023(0x187)](_0x2b04e8[_0x370023(0x16d)]),console['log']('─'[_0x370023(0x178)](0x3c)));}}export class AgentPullCommand extends BaseCommand{['name']=a4_0x3da32f(0x13e);['description']='Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files';async[a4_0x3da32f(0x141)](_0x4f7eab){const _0x206e00=a4_0x3da32f,{options:_0x3d40d1,args:_0x179483,tdx:_0x98b858}=_0x4f7eab,_0x3dd66d=_0x179483[0x0],_0x473c80=_0x179483[0x1],_0x35a6fe=_0x3d40d1[_0x206e00(0x145)],_0x3bb39d=_0x3d40d1['dryRun'],_0x6bf6db=_0x3d40d1[_0x206e00(0x1a9)],_0x40dc4d=_0x3d40d1[_0x206e00(0x13b)],_0xb245c=_0x3d40d1[_0x206e00(0x134)];let _0x4f9647,_0x3a2d3d;const _0x331c89=findAgentConfigPath(process[_0x206e00(0x124)]());if(_0x3dd66d){const _0xa6f427=a4_0xba3762['join'](_0x3dd66d,'tdx.json');if(existsSync(_0xa6f427))try{const _0x333bce=JSON['parse'](readFileSync(_0xa6f427,_0x206e00(0x147)));_0x4f9647=_0x333bce['llm_project'],_0x3a2d3d=_0x3dd66d,console[_0x206e00(0x187)](a4_0x727e9d[_0x206e00(0x176)]('Using\x20project\x20from\x20'+_0xa6f427+':\x20'+_0x4f9647));}catch{_0x4f9647=_0x3dd66d;}else _0x4f9647=_0x3dd66d;}else{if(_0x331c89)try{const _0x33aa72=JSON[_0x206e00(0x166)](readFileSync(_0x331c89,_0x206e00(0x147)));_0x4f9647=_0x33aa72[_0x206e00(0x157)],_0x3a2d3d=a4_0xba3762['dirname'](_0x331c89),console[_0x206e00(0x187)](a4_0x727e9d[_0x206e00(0x176)]('Using\x20project:\x20'+_0x4f9647));}catch{_0x4f9647=_0xb245c;}else _0x4f9647=_0xb245c;}if(!_0x4f9647)return console[_0x206e00(0x187)](a4_0x727e9d[_0x206e00(0x196)](_0x206e00(0x13a))),console[_0x206e00(0x187)](_0x206e00(0x138)),console[_0x206e00(0x187)](_0x206e00(0x122)),console[_0x206e00(0x187)](_0x206e00(0x1a1)),console[_0x206e00(0x187)](_0x206e00(0x10e)),0x1;if(_0x473c80){const {data:_0x309577}=await withSpinner(_0x206e00(0x184)+_0x473c80+_0x206e00(0x185)+_0x4f9647+'\x22...',()=>_0x98b858[_0x206e00(0x130)][_0x206e00(0x12b)](_0x4f9647,_0x473c80,_0x35a6fe,{'dryRun':_0x3bb39d,'force':_0x6bf6db}));if(_0x3bb39d)return console[_0x206e00(0x187)](a4_0x727e9d['yellow'](_0x206e00(0x17f))),console[_0x206e00(0x187)]('Would\x20pull\x20agent:\x20'+_0x309577[_0x206e00(0x198)]),console[_0x206e00(0x187)](_0x206e00(0x17b)+_0x309577[_0x206e00(0x10d)]),_0x309577[_0x206e00(0x16d)]&&(console[_0x206e00(0x187)](_0x206e00(0x15f)),console['log']('─'[_0x206e00(0x178)](0x3c)),console[_0x206e00(0x187)](_0x309577[_0x206e00(0x16d)]),console[_0x206e00(0x187)]('─'[_0x206e00(0x178)](0x3c))),0x0;return console[_0x206e00(0x187)](a4_0x727e9d[_0x206e00(0x125)](_0x206e00(0x140))),console['log'](_0x206e00(0x190)+_0x309577[_0x206e00(0x198)]),console[_0x206e00(0x187)]('Output:\x20'+_0x309577['outputPath']),console[_0x206e00(0x187)](_0x206e00(0x146)+(_0x309577[_0x206e00(0x106)]?a4_0x727e9d[_0x206e00(0x125)]('new'):_0x309577[_0x206e00(0x149)]?a4_0x727e9d['yellow'](_0x206e00(0x105)):a4_0x727e9d[_0x206e00(0x16c)]('unchanged'))),0x0;}const _0x962380=_0x3a2d3d||_0x35a6fe,{data:_0x316fa8}=await withSpinner(_0x206e00(0x152)+_0x4f9647+'\x22...',()=>_0x98b858[_0x206e00(0x130)][_0x206e00(0x11b)](_0x4f9647,_0x962380,{'dryRun':!![]})),_0x23df77=_0x316fa8[_0x206e00(0x173)][_0x206e00(0x139)][_0x206e00(0x162)]+_0x316fa8[_0x206e00(0x173)][_0x206e00(0x100)][_0x206e00(0x162)]+_0x316fa8[_0x206e00(0x173)][_0x206e00(0x168)][_0x206e00(0x162)]+_0x316fa8[_0x206e00(0x173)][_0x206e00(0x18c)][_0x206e00(0x162)]+_0x316fa8[_0x206e00(0x173)][_0x206e00(0x117)][_0x206e00(0x162)]+_0x316fa8[_0x206e00(0x173)][_0x206e00(0x18b)][_0x206e00(0x162)]+_0x316fa8[_0x206e00(0x173)][_0x206e00(0x11a)][_0x206e00(0x162)],_0x22a235=_0x316fa8[_0x206e00(0x173)][_0x206e00(0x139)][_0x206e00(0x105)]+_0x316fa8[_0x206e00(0x173)][_0x206e00(0x100)][_0x206e00(0x105)]+_0x316fa8[_0x206e00(0x173)][_0x206e00(0x168)][_0x206e00(0x105)]+_0x316fa8[_0x206e00(0x173)]['prompts']['updated']+_0x316fa8[_0x206e00(0x173)][_0x206e00(0x117)]['updated']+_0x316fa8[_0x206e00(0x173)][_0x206e00(0x18b)][_0x206e00(0x105)]+_0x316fa8['counts'][_0x206e00(0x11a)]['updated'],_0x5d580e=_0x316fa8[_0x206e00(0x173)]['agents'][_0x206e00(0x111)]+_0x316fa8[_0x206e00(0x173)]['knowledgeBases'][_0x206e00(0x111)]+_0x316fa8[_0x206e00(0x173)][_0x206e00(0x168)][_0x206e00(0x111)]+_0x316fa8['counts']['prompts'][_0x206e00(0x111)]+_0x316fa8[_0x206e00(0x173)]['integrations']['unchanged']+_0x316fa8[_0x206e00(0x173)][_0x206e00(0x18b)][_0x206e00(0x111)]+_0x316fa8[_0x206e00(0x173)][_0x206e00(0x11a)][_0x206e00(0x111)];console[_0x206e00(0x187)](_0x206e00(0x161)+_0x316fa8[_0x206e00(0x151)]+'\x27:'),console[_0x206e00(0x187)]('\x20\x20'+a4_0x727e9d[_0x206e00(0x125)]('+\x20'+_0x23df77+'\x20new')+_0x206e00(0x10c)+a4_0x727e9d[_0x206e00(0x196)]('~\x20'+_0x22a235+'\x20changed')+'\x20|\x20'+a4_0x727e9d[_0x206e00(0x176)]('=\x20'+_0x5d580e+'\x20unchanged')),console[_0x206e00(0x187)](_0x206e00(0x180)+formatCountSummary(_0x316fa8[_0x206e00(0x173)]['agents'])),console[_0x206e00(0x187)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x316fa8['counts']['knowledgeBases'])),console[_0x206e00(0x187)](_0x206e00(0x13f)+formatCountSummary(_0x316fa8[_0x206e00(0x173)][_0x206e00(0x168)])),console['log'](_0x206e00(0x172)+formatCountSummary(_0x316fa8[_0x206e00(0x173)][_0x206e00(0x18c)])),console[_0x206e00(0x187)](_0x206e00(0x17e)+formatCountSummary(_0x316fa8[_0x206e00(0x173)][_0x206e00(0x117)]));const _0x33e404=_0x316fa8[_0x206e00(0x173)][_0x206e00(0x18b)][_0x206e00(0x131)]>0x0||_0x316fa8[_0x206e00(0x173)]['experimentalArtifacts'][_0x206e00(0x131)]>0x0;_0x33e404&&(console[_0x206e00(0x187)](_0x206e00(0x16f)+formatCountSummary(_0x316fa8[_0x206e00(0x173)][_0x206e00(0x18b)])),console['log'](_0x206e00(0x1a5)+formatCountSummary(_0x316fa8['counts'][_0x206e00(0x11a)])));console[_0x206e00(0x187)](_0x206e00(0x170)+a4_0x727e9d[_0x206e00(0x155)](_0x316fa8[_0x206e00(0x179)])),displayDiffs(_0x316fa8['agents'],_0x316fa8[_0x206e00(0x100)],_0x316fa8[_0x206e00(0x168)],_0x316fa8['prompts'],_0x316fa8['integrations'],_0x316fa8[_0x206e00(0x18b)],_0x316fa8[_0x206e00(0x11a)]);if(_0x3bb39d)return console[_0x206e00(0x187)](a4_0x727e9d[_0x206e00(0x196)](_0x206e00(0x120))),0x0;if(_0x23df77===0x0&&_0x22a235===0x0)return console['log'](a4_0x727e9d[_0x206e00(0x125)]('\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'llm_project':_0x316fa8[_0x206e00(0x151)]},_0x3d40d1[_0x206e00(0x16b)]),console['log'](a4_0x727e9d[_0x206e00(0x125)](_0x206e00(0x177)+a4_0x727e9d['dim'](_0x206e00(0x157))+_0x206e00(0x17c)+a4_0x727e9d[_0x206e00(0x155)](_0x316fa8[_0x206e00(0x151)]))),0x0;if(!_0x40dc4d&&!_0x6bf6db){if(!isInteractive())return console['error'](a4_0x727e9d[_0x206e00(0x153)](_0x206e00(0x156)),_0x206e00(0x158)),console['error'](a4_0x727e9d[_0x206e00(0x176)](_0x206e00(0x123))),0x1;const _0x7b41c1=await confirmKey(_0x206e00(0x17d)+(_0x23df77+_0x22a235)+_0x206e00(0x191));if(!_0x7b41c1)return console['log'](a4_0x727e9d[_0x206e00(0x196)]('Cancelled'),_0x206e00(0x192)),0x1;}const {data:_0x4f355d}=await withSpinner(_0x206e00(0x16e),()=>_0x98b858[_0x206e00(0x130)][_0x206e00(0x11b)](_0x4f9647,_0x962380,{'force':_0x6bf6db}));return console['log'](a4_0x727e9d[_0x206e00(0x125)](_0x206e00(0x127)+(_0x23df77+_0x22a235)+_0x206e00(0x15a)+_0x4f355d[_0x206e00(0x179)])),saveSessionContext({'llm_project':_0x4f355d['projectName']},_0x3d40d1[_0x206e00(0x16b)]),console['log'](a4_0x727e9d[_0x206e00(0x125)](_0x206e00(0x177)+a4_0x727e9d[_0x206e00(0x176)](_0x206e00(0x157))+'\x20=\x20'+a4_0x727e9d[_0x206e00(0x155)](_0x4f355d['projectName']))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x3da32f(0x1ad)]=a4_0x3da32f(0x12e);[a4_0x3da32f(0x132)]=a4_0x3da32f(0x11f);async[a4_0x3da32f(0x141)](_0x2e0e3b){const _0x330eb4=a4_0x3da32f,{options:_0x2aad27,args:_0x42ef76,tdx:_0x2e910b}=_0x2e0e3b,_0x248622=_0x42ef76[0x0],_0x505193=_0x2aad27[_0x330eb4(0x1ad)],_0xc65445=_0x2aad27['dryRun'],_0x292e1c=_0x2aad27['yes'],_0x378478=_0x2aad27[_0x330eb4(0x107)],_0x6d652=_0x2aad27['llmProject'];let _0x1b6900;const _0x268ea2=findAgentConfigPath(process['cwd']());if(_0x248622){const _0x43d384=a4_0xba3762[_0x330eb4(0x10f)](_0x248622,_0x330eb4(0x1a8));existsSync(_0x43d384)?(_0x1b6900=_0x248622,console['log'](a4_0x727e9d[_0x330eb4(0x176)]('Using\x20local\x20project:\x20'+_0x248622))):_0x1b6900=_0x248622;}else{if(_0x268ea2)_0x1b6900=a4_0xba3762[_0x330eb4(0x135)](_0x268ea2),console['log'](a4_0x727e9d[_0x330eb4(0x176)](_0x330eb4(0x12c)+_0x1b6900));else{if(_0x6d652){const _0x2a4b55=sanitizeForFilesystem(_0x6d652);let _0x88f35e=_0x2a4b55,_0x16a267=a4_0xba3762[_0x330eb4(0x10f)](process['cwd'](),_0x330eb4(0x139),_0x2a4b55,_0x330eb4(0x1a8));if(!existsSync(_0x16a267)){const _0x52e4f7=normalizeName(_0x6d652),_0x495355=a4_0xba3762['join'](process[_0x330eb4(0x124)](),'agents',_0x52e4f7,_0x330eb4(0x1a8));existsSync(_0x495355)&&(_0x88f35e=_0x52e4f7,_0x16a267=_0x495355);}if(existsSync(_0x16a267))_0x1b6900=a4_0xba3762['dirname'](_0x16a267),console[_0x330eb4(0x187)](a4_0x727e9d[_0x330eb4(0x176)](_0x330eb4(0x189)+_0x1b6900));else{const _0x132fe7=_0x2aad27[_0x330eb4(0x137)];if(_0x132fe7)throw new SDKError(ErrorCode[_0x330eb4(0x13d)],'Cannot\x20clone\x20from\x20context\x20project\x20\x22'+_0x6d652+_0x330eb4(0x15b),undefined,{'helpText':_0x330eb4(0x116)+_0x330eb4(0x142)+('\x20\x20tdx\x20agent\x20pull\x20'+_0x6d652+'\x0a')+(_0x330eb4(0x183)+_0x88f35e+_0x330eb4(0x13c)+(_0x505193||_0x330eb4(0x17a))+_0x330eb4(0x108)+_0x132fe7)});_0x1b6900=_0x6d652,console['log'](a4_0x727e9d['dim']('Using\x20context\x20project:\x20'+_0x6d652));}}}}if(!_0x1b6900)return console['log'](a4_0x727e9d['yellow'](_0x330eb4(0x19c))),console[_0x330eb4(0x187)]('\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project'),console['log']('\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory'),console[_0x330eb4(0x187)](_0x330eb4(0x144)),console[_0x330eb4(0x187)]('\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>'),0x1;if(!_0x505193)throw new SDKError(ErrorCode['MISSING_ARGUMENT'],_0x330eb4(0x160),undefined,{'helpText':_0x330eb4(0x18f)});if(!_0x292e1c&&!_0xc65445){if(!isInteractive())return console[_0x330eb4(0x1ac)](a4_0x727e9d[_0x330eb4(0x153)]('\x0aError:'),_0x330eb4(0x158)),console[_0x330eb4(0x1ac)](a4_0x727e9d[_0x330eb4(0x176)](_0x330eb4(0x123))),0x1;const _0x532efb=await confirmKey(_0x330eb4(0x1a7)+_0x1b6900+_0x330eb4(0x1a2)+_0x505193+'\x22?');if(!_0x532efb)return console[_0x330eb4(0x187)](a4_0x727e9d[_0x330eb4(0x196)](_0x330eb4(0x11d))),0x1;}const {data:_0x4f5c34}=await withSpinner(_0x330eb4(0x11e)+_0x1b6900+_0x330eb4(0x1a3)+_0x505193+_0x330eb4(0x128),()=>_0x2e910b[_0x330eb4(0x130)][_0x330eb4(0x19d)](_0x1b6900,_0x505193,{'dryRun':_0xc65445}));if(_0xc65445){console['log'](a4_0x727e9d['yellow'](_0x330eb4(0x15d))),console[_0x330eb4(0x187)]('Source:\x20'+_0x4f5c34[_0x330eb4(0x10a)]),console[_0x330eb4(0x187)]('New\x20project:\x20'+_0x505193),console[_0x330eb4(0x187)]('Would\x20clone:'),console[_0x330eb4(0x187)](_0x330eb4(0x180)+_0x4f5c34[_0x330eb4(0x173)]['agents']['created']),console[_0x330eb4(0x187)](_0x330eb4(0x126)+_0x4f5c34[_0x330eb4(0x173)][_0x330eb4(0x100)][_0x330eb4(0x193)]),console[_0x330eb4(0x187)]('\x20\x20Prompts:\x20'+_0x4f5c34[_0x330eb4(0x173)][_0x330eb4(0x18c)]['created']);const _0x2145fe=_0x4f5c34['counts'][_0x330eb4(0x18b)]['created']>0x0||_0x4f5c34['counts'][_0x330eb4(0x11a)]['created']>0x0;return _0x2145fe&&(console[_0x330eb4(0x187)](_0x330eb4(0x16f)+_0x4f5c34[_0x330eb4(0x173)][_0x330eb4(0x18b)][_0x330eb4(0x193)]),console[_0x330eb4(0x187)](_0x330eb4(0x1a5)+_0x4f5c34[_0x330eb4(0x173)][_0x330eb4(0x11a)][_0x330eb4(0x193)])),0x0;}const _0xfe3979=_0x4f5c34[_0x330eb4(0x173)][_0x330eb4(0x139)][_0x330eb4(0x19a)]>0x0||_0x4f5c34['counts'][_0x330eb4(0x100)][_0x330eb4(0x19a)]>0x0||_0x4f5c34['counts'][_0x330eb4(0x18c)][_0x330eb4(0x19a)]>0x0||_0x4f5c34[_0x330eb4(0x173)][_0x330eb4(0x18b)][_0x330eb4(0x19a)]>0x0||_0x4f5c34[_0x330eb4(0x173)][_0x330eb4(0x11a)][_0x330eb4(0x19a)]>0x0;_0xfe3979?console['log'](a4_0x727e9d[_0x330eb4(0x196)](_0x330eb4(0x163))):console[_0x330eb4(0x187)](a4_0x727e9d['green'](_0x330eb4(0x143)));console[_0x330eb4(0x187)](_0x330eb4(0x12a)+_0x4f5c34['sourceProjectName']),console['log'](_0x330eb4(0x14e)+_0x4f5c34[_0x330eb4(0x1a0)]),console[_0x330eb4(0x187)](_0x330eb4(0x11c)+_0x4f5c34['newProjectId']),console[_0x330eb4(0x187)](),console['log'](_0x330eb4(0x10b)),console['log'](_0x330eb4(0x180)+formatCountSummary(_0x4f5c34[_0x330eb4(0x173)][_0x330eb4(0x139)])),console['log'](_0x330eb4(0x126)+formatCountSummary(_0x4f5c34['counts'][_0x330eb4(0x100)])),console[_0x330eb4(0x187)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x4f5c34['counts']['prompts'])),console[_0x330eb4(0x187)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x4f5c34[_0x330eb4(0x173)][_0x330eb4(0x117)]));const _0x29a229=_0x4f5c34[_0x330eb4(0x173)]['experimentalKnowledgeBases'][_0x330eb4(0x193)]>0x0||_0x4f5c34[_0x330eb4(0x173)][_0x330eb4(0x18b)][_0x330eb4(0x105)]>0x0||_0x4f5c34['counts'][_0x330eb4(0x18b)]['unchanged']>0x0||_0x4f5c34[_0x330eb4(0x173)][_0x330eb4(0x11a)][_0x330eb4(0x193)]>0x0||_0x4f5c34[_0x330eb4(0x173)]['experimentalArtifacts'][_0x330eb4(0x105)]>0x0||_0x4f5c34['counts'][_0x330eb4(0x11a)][_0x330eb4(0x111)]>0x0;_0x29a229&&(console[_0x330eb4(0x187)](_0x330eb4(0x16f)+formatCountSummary(_0x4f5c34[_0x330eb4(0x173)][_0x330eb4(0x18b)])),console[_0x330eb4(0x187)](_0x330eb4(0x1a5)+formatCountSummary(_0x4f5c34[_0x330eb4(0x173)]['experimentalArtifacts'])));if(_0xfe3979){console[_0x330eb4(0x187)](),console['log'](a4_0x727e9d[_0x330eb4(0x153)](_0x330eb4(0x19f)));for(const _0x11e1ff of _0x4f5c34['agents']){_0x11e1ff[_0x330eb4(0x1a6)]===_0x330eb4(0x1ac)&&console[_0x330eb4(0x187)](a4_0x727e9d[_0x330eb4(0x153)](_0x330eb4(0x101)+_0x11e1ff[_0x330eb4(0x198)]+'\x22:\x20'+_0x11e1ff['error']));}for(const _0xf9f4e4 of _0x4f5c34[_0x330eb4(0x100)]){_0xf9f4e4[_0x330eb4(0x1a6)]===_0x330eb4(0x1ac)&&console[_0x330eb4(0x187)](a4_0x727e9d['red'](_0x330eb4(0x18d)+_0xf9f4e4[_0x330eb4(0x1ad)]+_0x330eb4(0x164)+_0xf9f4e4['error']));}for(const _0x32412c of _0x4f5c34['prompts']){_0x32412c['action']===_0x330eb4(0x1ac)&&console[_0x330eb4(0x187)](a4_0x727e9d['red'](_0x330eb4(0x171)+_0x32412c[_0x330eb4(0x1ad)]+_0x330eb4(0x164)+_0x32412c[_0x330eb4(0x1ac)]));}for(const _0x5a6813 of _0x4f5c34[_0x330eb4(0x117)]){_0x5a6813['action']===_0x330eb4(0x1ac)&&console['log'](a4_0x727e9d[_0x330eb4(0x153)](_0x330eb4(0x14f)+_0x5a6813[_0x330eb4(0x1ad)]+_0x330eb4(0x164)+_0x5a6813[_0x330eb4(0x1ac)]));}for(const _0x36fd18 of _0x4f5c34['experimentalKnowledgeBases']){_0x36fd18[_0x330eb4(0x1a6)]===_0x330eb4(0x1ac)&&console[_0x330eb4(0x187)](a4_0x727e9d[_0x330eb4(0x153)](_0x330eb4(0x148)+_0x36fd18[_0x330eb4(0x1ad)]+_0x330eb4(0x164)+_0x36fd18[_0x330eb4(0x1ac)]));}for(const _0x14caa1 of _0x4f5c34[_0x330eb4(0x11a)]){_0x14caa1['action']===_0x330eb4(0x1ac)&&console[_0x330eb4(0x187)](a4_0x727e9d[_0x330eb4(0x153)](_0x330eb4(0x14a)+_0x14caa1['name']+_0x330eb4(0x164)+_0x14caa1[_0x330eb4(0x1ac)]));}return 0x1;}console[_0x330eb4(0x187)]();const _0x52db03=getLLMProjectUrl(_0x378478,_0x4f5c34[_0x330eb4(0x174)]);return console[_0x330eb4(0x187)](_0x330eb4(0x16a)+a4_0x727e9d[_0x330eb4(0x155)](_0x52db03)),0x0;}}export class AgentPushCommand extends BaseCommand{['name']='agent:push';['description']=a4_0x3da32f(0x102);async['execute'](_0x24e65c){const _0x595653=a4_0x3da32f,{options:_0x15e013,args:_0x32ad88,tdx:_0x3f9c1d}=_0x24e65c;let _0x406453=_0x32ad88[0x0]||process[_0x595653(0x124)]();const _0x43da02=_0x15e013[_0x595653(0x119)],_0x3ae03d=_0x15e013[_0x595653(0x1a9)],_0x599cee=_0x15e013[_0x595653(0x13b)],_0x4b0475=_0x15e013[_0x595653(0x107)],_0x31db2f=a4_0xba3762[_0x595653(0x10f)](_0x406453,'agent.yml'),_0x33897a=existsSync(_0x31db2f);if(_0x33897a){const {data:_0x112be9}=await withSpinner(_0x595653(0x175)+_0x406453+_0x595653(0x128),()=>_0x3f9c1d[_0x595653(0x130)][_0x595653(0x19e)](_0x406453,{'dryRun':_0x43da02,'force':_0x3ae03d}));if(_0x43da02)return console[_0x595653(0x187)](a4_0x727e9d[_0x595653(0x196)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console['log'](_0x595653(0x159)+_0x112be9['agentName']),0x0;if(_0x112be9['action']===_0x595653(0x1ac))return console[_0x595653(0x187)](a4_0x727e9d[_0x595653(0x153)](_0x595653(0x103)+_0x112be9[_0x595653(0x1ac)])),0x1;console[_0x595653(0x187)](a4_0x727e9d['green']('Agent\x20'+_0x112be9[_0x595653(0x1a6)]+_0x595653(0x14d))),console[_0x595653(0x187)](_0x595653(0x190)+_0x112be9[_0x595653(0x198)]);if(_0x112be9[_0x595653(0x19b)]&&_0x112be9[_0x595653(0x154)]){const _0x333142=getLLMAgentChatUrl(_0x4b0475,_0x112be9['projectId'],_0x112be9[_0x595653(0x19b)]);console[_0x595653(0x187)]('Chat:\x20'+a4_0x727e9d['cyan'](_0x333142));}return 0x0;}const _0x6d35d3=_0x15e013[_0x595653(0x134)],_0x1b11dd=resolveProjectFromContext(_0x406453,_0x6d35d3);if(_0x1b11dd['found'])_0x406453=_0x1b11dd['projectDir'],_0x1b11dd[_0x595653(0x113)]===_0x595653(0x109)&&console[_0x595653(0x187)](a4_0x727e9d[_0x595653(0x176)]('Using\x20project:\x20'+_0x406453));else{let _0x44e284='Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.';_0x1b11dd[_0x595653(0x194)]==='no_local_folder'&&(_0x44e284=_0x1b11dd[_0x595653(0x12f)]+'\x0aRun\x20\x27tdx\x20agent\x20pull\x20'+_0x1b11dd[_0x595653(0x134)]+_0x595653(0x118));throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x1b11dd[_0x595653(0x194)]==='no_context'?_0x1b11dd[_0x595653(0x12f)]:'No\x20tdx.json\x20found\x20in\x20'+_0x406453,undefined,{'helpText':_0x44e284});}const {data:_0x5d1035}=await withSpinner(_0x595653(0x197),()=>_0x3f9c1d[_0x595653(0x130)][_0x595653(0x181)](_0x406453,{'dryRun':!![]})),_0xee0e36=_0x5d1035[_0x595653(0x173)]['agents']['errors']>0x0;if(_0xee0e36){console[_0x595653(0x187)](a4_0x727e9d[_0x595653(0x153)]('\x0aErrors\x20found:'));for(const _0x35d913 of _0x5d1035[_0x595653(0x139)]){_0x35d913[_0x595653(0x1a6)]===_0x595653(0x1ac)&&console['log'](a4_0x727e9d[_0x595653(0x153)]('\x20\x20Agent\x20\x22'+_0x35d913[_0x595653(0x198)]+_0x595653(0x164)+_0x35d913[_0x595653(0x1ac)]));}return 0x1;}const _0xcdf521=_0x5d1035['counts'][_0x595653(0x139)][_0x595653(0x193)]+_0x5d1035[_0x595653(0x173)][_0x595653(0x100)][_0x595653(0x193)]+_0x5d1035[_0x595653(0x173)][_0x595653(0x168)]['created']+_0x5d1035['counts'][_0x595653(0x18c)]['created']+_0x5d1035[_0x595653(0x173)][_0x595653(0x117)]['created']+_0x5d1035[_0x595653(0x173)][_0x595653(0x18b)][_0x595653(0x193)]+_0x5d1035[_0x595653(0x173)]['experimentalArtifacts'][_0x595653(0x193)],_0x3367ef=_0x5d1035[_0x595653(0x173)][_0x595653(0x139)][_0x595653(0x105)]+_0x5d1035[_0x595653(0x173)][_0x595653(0x100)][_0x595653(0x105)]+_0x5d1035[_0x595653(0x173)][_0x595653(0x168)][_0x595653(0x105)]+_0x5d1035[_0x595653(0x173)][_0x595653(0x18c)]['updated']+_0x5d1035['counts']['integrations'][_0x595653(0x105)]+_0x5d1035[_0x595653(0x173)][_0x595653(0x18b)][_0x595653(0x105)]+_0x5d1035[_0x595653(0x173)]['experimentalArtifacts'][_0x595653(0x105)],_0x18b962=_0x5d1035['counts']['agents']['unchanged']+_0x5d1035['counts']['knowledgeBases'][_0x595653(0x111)]+_0x5d1035[_0x595653(0x173)][_0x595653(0x168)][_0x595653(0x111)]+_0x5d1035[_0x595653(0x173)]['prompts'][_0x595653(0x111)]+_0x5d1035[_0x595653(0x173)][_0x595653(0x117)][_0x595653(0x111)]+_0x5d1035['counts'][_0x595653(0x18b)][_0x595653(0x111)]+_0x5d1035[_0x595653(0x173)][_0x595653(0x11a)][_0x595653(0x111)];console[_0x595653(0x187)](_0x595653(0x14c)+_0x5d1035[_0x595653(0x151)]+'\x27:'),console[_0x595653(0x187)]('\x20\x20'+a4_0x727e9d[_0x595653(0x125)]('+\x20'+_0xcdf521+_0x595653(0x129))+_0x595653(0x10c)+a4_0x727e9d[_0x595653(0x196)]('~\x20'+_0x3367ef+_0x595653(0x1aa))+'\x20|\x20'+a4_0x727e9d[_0x595653(0x176)]('=\x20'+_0x18b962+_0x595653(0x167))),console[_0x595653(0x187)](_0x595653(0x180)+formatCountSummary(_0x5d1035[_0x595653(0x173)][_0x595653(0x139)])),console[_0x595653(0x187)](_0x595653(0x126)+formatCountSummary(_0x5d1035[_0x595653(0x173)]['knowledgeBases'])),console[_0x595653(0x187)](_0x595653(0x13f)+formatCountSummary(_0x5d1035['counts'][_0x595653(0x168)])),console['log']('\x20\x20Prompts:\x20'+formatCountSummary(_0x5d1035[_0x595653(0x173)][_0x595653(0x18c)])),console[_0x595653(0x187)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x5d1035[_0x595653(0x173)]['integrations']));const _0x96f2a9=_0x5d1035[_0x595653(0x173)][_0x595653(0x18b)]['created']>0x0||_0x5d1035['counts'][_0x595653(0x18b)][_0x595653(0x105)]>0x0||_0x5d1035[_0x595653(0x173)][_0x595653(0x18b)]['unchanged']>0x0||_0x5d1035['counts'][_0x595653(0x11a)][_0x595653(0x193)]>0x0||_0x5d1035['counts'][_0x595653(0x11a)][_0x595653(0x105)]>0x0||_0x5d1035[_0x595653(0x173)][_0x595653(0x11a)][_0x595653(0x111)]>0x0;_0x96f2a9&&(console['log'](_0x595653(0x16f)+formatCountSummary(_0x5d1035[_0x595653(0x173)][_0x595653(0x18b)])),console[_0x595653(0x187)](_0x595653(0x1a5)+formatCountSummary(_0x5d1035['counts'][_0x595653(0x11a)])));console[_0x595653(0x187)](_0x595653(0x115)+a4_0x727e9d[_0x595653(0x155)](_0x406453)),displayDiffs(_0x5d1035['agents'],_0x5d1035[_0x595653(0x100)],_0x5d1035['textKnowledgeBases'],_0x5d1035[_0x595653(0x18c)],_0x5d1035[_0x595653(0x117)],_0x5d1035[_0x595653(0x18b)],_0x5d1035[_0x595653(0x11a)]);if(_0x43da02)return console[_0x595653(0x187)](a4_0x727e9d[_0x595653(0x196)](_0x595653(0x18a))),0x0;if(_0xcdf521===0x0&&_0x3367ef===0x0){console[_0x595653(0x187)](a4_0x727e9d[_0x595653(0x125)](_0x595653(0x136)));const _0x32324d=getLLMProjectUrl(_0x4b0475,_0x5d1035['projectId']);return console['log'](_0x595653(0x16a)+a4_0x727e9d[_0x595653(0x155)](_0x32324d)),0x0;}if(!_0x599cee&&!_0x3ae03d){if(!isInteractive())return console[_0x595653(0x1ac)](a4_0x727e9d[_0x595653(0x153)]('\x0aError:'),_0x595653(0x158)),console[_0x595653(0x1ac)](a4_0x727e9d[_0x595653(0x176)](_0x595653(0x123))),0x1;const _0x5eb33a=await confirmKey(_0x595653(0x186)+(_0xcdf521+_0x3367ef)+_0x595653(0x15e));if(!_0x5eb33a)return console[_0x595653(0x187)](a4_0x727e9d[_0x595653(0x196)](_0x595653(0x11d)),_0x595653(0x12d)),0x1;}const {data:_0x379286}=await withSpinner(_0x595653(0x182),()=>_0x3f9c1d[_0x595653(0x130)][_0x595653(0x181)](_0x406453,{'force':_0x3ae03d})),_0x4ae5af=_0x379286[_0x595653(0x173)][_0x595653(0x139)][_0x595653(0x19a)]>0x0||_0x379286['counts'][_0x595653(0x100)]['errors']>0x0||_0x379286['counts'][_0x595653(0x168)][_0x595653(0x19a)]>0x0||_0x379286[_0x595653(0x173)][_0x595653(0x18c)]['errors']>0x0;if(_0x4ae5af){console[_0x595653(0x187)](a4_0x727e9d[_0x595653(0x196)]('\x0aProject\x20pushed\x20with\x20errors')),console[_0x595653(0x187)](),console[_0x595653(0x187)](a4_0x727e9d[_0x595653(0x153)](_0x595653(0x19f)));for(const _0x49628b of _0x379286[_0x595653(0x139)]){_0x49628b[_0x595653(0x1a6)]===_0x595653(0x1ac)&&console[_0x595653(0x187)](a4_0x727e9d['red'](_0x595653(0x101)+_0x49628b[_0x595653(0x198)]+'\x22:\x20'+_0x49628b['error']));}for(const _0x1f7219 of _0x379286['knowledgeBases']){_0x1f7219[_0x595653(0x1a6)]===_0x595653(0x1ac)&&console['log'](a4_0x727e9d['red'](_0x595653(0x18d)+_0x1f7219[_0x595653(0x1ad)]+_0x595653(0x164)+_0x1f7219['error']));}for(const _0x2f417b of _0x379286['textKnowledgeBases']){_0x2f417b[_0x595653(0x1a6)]==='error'&&console[_0x595653(0x187)](a4_0x727e9d[_0x595653(0x153)]('\x20\x20Text\x20Knowledge\x20Base\x20\x22'+_0x2f417b[_0x595653(0x1ad)]+_0x595653(0x164)+_0x2f417b[_0x595653(0x1ac)]));}for(const _0x953e90 of _0x379286[_0x595653(0x18c)]){_0x953e90['action']===_0x595653(0x1ac)&&console[_0x595653(0x187)](a4_0x727e9d[_0x595653(0x153)]('\x20\x20Prompt\x20\x22'+_0x953e90[_0x595653(0x1ad)]+_0x595653(0x164)+_0x953e90['error']));}for(const _0x1308ec of _0x379286[_0x595653(0x117)]){_0x1308ec[_0x595653(0x1a6)]==='error'&&console[_0x595653(0x187)](a4_0x727e9d[_0x595653(0x153)]('\x20\x20Integration\x20\x22'+_0x1308ec[_0x595653(0x1ad)]+'\x22:\x20'+_0x1308ec[_0x595653(0x1ac)]));}return 0x1;}console[_0x595653(0x187)](a4_0x727e9d['green'](_0x595653(0x165)+(_0xcdf521+_0x3367ef)+'\x20resources\x20to\x20\x27'+_0x379286['projectName']+'\x27'));const _0x198725=getLLMProjectUrl(_0x4b0475,_0x379286['projectId']);return console['log'](_0x595653(0x16a)+a4_0x727e9d['cyan'](_0x198725)),0x0;}}
1
+ const a4_0x28bf07=a4_0x1616;(function(_0x43c8e9,_0x37552b){const _0xc13ba6=a4_0x1616,_0x244c23=_0x43c8e9();while(!![]){try{const _0x98bb23=parseInt(_0xc13ba6(0x1e8))/0x1*(parseInt(_0xc13ba6(0x1ae))/0x2)+parseInt(_0xc13ba6(0x1de))/0x3+-parseInt(_0xc13ba6(0x19f))/0x4+-parseInt(_0xc13ba6(0x1df))/0x5+-parseInt(_0xc13ba6(0x1eb))/0x6*(parseInt(_0xc13ba6(0x1c1))/0x7)+parseInt(_0xc13ba6(0x149))/0x8+parseInt(_0xc13ba6(0x185))/0x9;if(_0x98bb23===_0x37552b)break;else _0x244c23['push'](_0x244c23['shift']());}catch(_0x555f66){_0x244c23['push'](_0x244c23['shift']());}}}(a4_0xef5f,0x84d81));import a4_0x2f8a42 from'chalk';import a4_0x2b6457 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_0x1616(_0x9e9a1d,_0xa3639e){_0x9e9a1d=_0x9e9a1d-0x147;const _0xef5f6e=a4_0xef5f();let _0x161698=_0xef5f6e[_0x9e9a1d];return _0x161698;}import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x7a14ed){const _0x27d2a1=a4_0x1616,_0x4c8b8b=[];if(_0x7a14ed[_0x27d2a1(0x1ee)]!==undefined)_0x4c8b8b[_0x27d2a1(0x18d)](_0x7a14ed[_0x27d2a1(0x1ee)]+'\x20total');if(_0x7a14ed[_0x27d2a1(0x1c0)]!==undefined&&_0x7a14ed[_0x27d2a1(0x1c0)]>0x0)_0x4c8b8b[_0x27d2a1(0x18d)](a4_0x2f8a42[_0x27d2a1(0x14d)](_0x7a14ed[_0x27d2a1(0x1c0)]+_0x27d2a1(0x1f5)));if(_0x7a14ed['created']!==undefined&&_0x7a14ed[_0x27d2a1(0x198)]>0x0)_0x4c8b8b[_0x27d2a1(0x18d)](a4_0x2f8a42[_0x27d2a1(0x14d)](_0x7a14ed['created']+_0x27d2a1(0x15a)));if(_0x7a14ed[_0x27d2a1(0x1a4)]!==undefined&&_0x7a14ed['updated']>0x0)_0x4c8b8b[_0x27d2a1(0x18d)](a4_0x2f8a42[_0x27d2a1(0x1da)](_0x7a14ed[_0x27d2a1(0x1a4)]+'\x20updated'));if(_0x7a14ed[_0x27d2a1(0x172)]!==undefined&&_0x7a14ed[_0x27d2a1(0x172)]>0x0)_0x4c8b8b[_0x27d2a1(0x18d)](a4_0x2f8a42['gray'](_0x7a14ed['unchanged']+_0x27d2a1(0x19b)));if(_0x7a14ed[_0x27d2a1(0x182)]!==undefined&&_0x7a14ed['errors']>0x0)_0x4c8b8b['push'](a4_0x2f8a42[_0x27d2a1(0x150)](_0x7a14ed[_0x27d2a1(0x182)]+_0x27d2a1(0x176)));return _0x4c8b8b['join'](',\x20');}function displayDiffs(_0x1399c3,_0x24d676,_0x2a3e3b,_0x261b32,_0x488bb6,_0x50b2bf,_0x51c4a0){const _0x45ec2a=a4_0x1616;for(const _0x2666a0 of _0x1399c3){if(_0x2666a0[_0x45ec2a(0x1b8)]){const _0x534b0f=_0x2666a0[_0x45ec2a(0x1a8)]||_0x2666a0['name'];console[_0x45ec2a(0x1e4)](_0x45ec2a(0x164)+_0x534b0f+'\x27:'),console[_0x45ec2a(0x1e4)]('─'[_0x45ec2a(0x1bc)](0x3c)),console[_0x45ec2a(0x1e4)](_0x2666a0[_0x45ec2a(0x1b8)]),console[_0x45ec2a(0x1e4)]('─'[_0x45ec2a(0x1bc)](0x3c));}}for(const _0x3de1de of _0x24d676){_0x3de1de['diff']&&(console[_0x45ec2a(0x1e4)](_0x45ec2a(0x1fc)+_0x3de1de[_0x45ec2a(0x163)]+'\x27:'),console[_0x45ec2a(0x1e4)]('─'[_0x45ec2a(0x1bc)](0x3c)),console['log'](_0x3de1de[_0x45ec2a(0x1b8)]),console[_0x45ec2a(0x1e4)]('─'[_0x45ec2a(0x1bc)](0x3c)));}for(const _0x27114f of _0x2a3e3b){_0x27114f[_0x45ec2a(0x1b8)]&&(console[_0x45ec2a(0x1e4)](_0x45ec2a(0x14c)+_0x27114f[_0x45ec2a(0x163)]+'\x27:'),console[_0x45ec2a(0x1e4)]('─'[_0x45ec2a(0x1bc)](0x3c)),console['log'](_0x27114f[_0x45ec2a(0x1b8)]),console['log']('─'[_0x45ec2a(0x1bc)](0x3c)));}for(const _0x3eb588 of _0x261b32){_0x3eb588[_0x45ec2a(0x1b8)]&&(console[_0x45ec2a(0x1e4)](_0x45ec2a(0x187)+_0x3eb588[_0x45ec2a(0x163)]+'\x27:'),console[_0x45ec2a(0x1e4)]('─'[_0x45ec2a(0x1bc)](0x3c)),console[_0x45ec2a(0x1e4)](_0x3eb588[_0x45ec2a(0x1b8)]),console[_0x45ec2a(0x1e4)]('─'[_0x45ec2a(0x1bc)](0x3c)));}for(const _0x5ddbae of _0x488bb6){_0x5ddbae[_0x45ec2a(0x1b8)]&&(console[_0x45ec2a(0x1e4)](_0x45ec2a(0x1fb)+_0x5ddbae[_0x45ec2a(0x163)]+'\x27:'),console[_0x45ec2a(0x1e4)]('─'[_0x45ec2a(0x1bc)](0x3c)),console[_0x45ec2a(0x1e4)](_0x5ddbae[_0x45ec2a(0x1b8)]),console[_0x45ec2a(0x1e4)]('─'[_0x45ec2a(0x1bc)](0x3c)));}for(const _0x10e510 of _0x50b2bf){_0x10e510[_0x45ec2a(0x1b8)]&&(console[_0x45ec2a(0x1e4)](_0x45ec2a(0x1c2)+_0x10e510['name']+'\x27:'),console[_0x45ec2a(0x1e4)]('─'[_0x45ec2a(0x1bc)](0x3c)),console[_0x45ec2a(0x1e4)](_0x10e510[_0x45ec2a(0x1b8)]),console[_0x45ec2a(0x1e4)]('─'[_0x45ec2a(0x1bc)](0x3c)));}for(const _0x32a450 of _0x51c4a0){_0x32a450[_0x45ec2a(0x1b8)]&&(console[_0x45ec2a(0x1e4)](_0x45ec2a(0x1cb)+_0x32a450[_0x45ec2a(0x163)]+'\x27:'),console['log']('─'[_0x45ec2a(0x1bc)](0x3c)),console['log'](_0x32a450[_0x45ec2a(0x1b8)]),console['log']('─'['repeat'](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x28bf07(0x163)]=a4_0x28bf07(0x151);[a4_0x28bf07(0x192)]=a4_0x28bf07(0x1fa);async[a4_0x28bf07(0x169)](_0x324f16){const _0x1086ac=a4_0x28bf07,{options:_0x470143,args:_0x5dae56,tdx:_0x15c7af}=_0x324f16,_0x4dd339=_0x5dae56[0x0],_0x343216=_0x5dae56[0x1],_0x59c28d=_0x470143[_0x1086ac(0x197)],_0x427dc7=_0x470143[_0x1086ac(0x1a2)],_0x3a4fbd=_0x470143['force'],_0xc4cba2=_0x470143[_0x1086ac(0x1d6)],_0x4088b4=_0x470143[_0x1086ac(0x156)];let _0xa755fe,_0x32070d;const _0x476835=findAgentConfigPath(process[_0x1086ac(0x1b2)]());if(_0x4dd339){const _0x140435=a4_0x2b6457[_0x1086ac(0x1f9)](_0x4dd339,_0x1086ac(0x1b7));if(existsSync(_0x140435))try{const _0x591408=JSON[_0x1086ac(0x19a)](readFileSync(_0x140435,'utf-8'));_0xa755fe=_0x591408['llm_project'],_0x32070d=_0x4dd339,console[_0x1086ac(0x1e4)](a4_0x2f8a42[_0x1086ac(0x1aa)]('Using\x20project\x20from\x20'+_0x140435+':\x20'+_0xa755fe));}catch{_0xa755fe=_0x4dd339;}else _0xa755fe=_0x4dd339;}else{if(_0x476835)try{const _0x33fed7=JSON[_0x1086ac(0x19a)](readFileSync(_0x476835,'utf-8'));_0xa755fe=_0x33fed7[_0x1086ac(0x16f)],_0x32070d=a4_0x2b6457[_0x1086ac(0x19e)](_0x476835),console['log'](a4_0x2f8a42[_0x1086ac(0x1aa)]('Using\x20project:\x20'+_0xa755fe));}catch{_0xa755fe=_0x4088b4;}else _0xa755fe=_0x4088b4;}if(!_0xa755fe)return console[_0x1086ac(0x1e4)](a4_0x2f8a42[_0x1086ac(0x1da)]('llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a')),console[_0x1086ac(0x1e4)](_0x1086ac(0x15d)),console[_0x1086ac(0x1e4)](_0x1086ac(0x162)),console['log'](_0x1086ac(0x1af)),console[_0x1086ac(0x1e4)](_0x1086ac(0x18a)),0x1;if(_0x343216){const {data:_0x4c919d}=await withSpinner(_0x1086ac(0x1b5)+_0x343216+_0x1086ac(0x175)+_0xa755fe+'\x22...',()=>_0x15c7af['llm'][_0x1086ac(0x190)](_0xa755fe,_0x343216,_0x59c28d,{'dryRun':_0x427dc7,'force':_0x3a4fbd}));if(_0x427dc7)return console[_0x1086ac(0x1e4)](a4_0x2f8a42['yellow'](_0x1086ac(0x15f))),console['log'](_0x1086ac(0x1d2)+_0x4c919d[_0x1086ac(0x1a8)]),console[_0x1086ac(0x1e4)](_0x1086ac(0x171)+_0x4c919d[_0x1086ac(0x1ac)]),_0x4c919d[_0x1086ac(0x1b8)]&&(console['log'](_0x1086ac(0x1f2)),console[_0x1086ac(0x1e4)]('─'[_0x1086ac(0x1bc)](0x3c)),console['log'](_0x4c919d[_0x1086ac(0x1b8)]),console['log']('─'[_0x1086ac(0x1bc)](0x3c))),0x0;return console[_0x1086ac(0x1e4)](a4_0x2f8a42[_0x1086ac(0x14d)](_0x1086ac(0x1a9))),console['log'](_0x1086ac(0x15e)+_0x4c919d['agentName']),console[_0x1086ac(0x1e4)](_0x1086ac(0x1d9)+_0x4c919d['outputPath']),console[_0x1086ac(0x1e4)](_0x1086ac(0x16c)+(_0x4c919d['isNew']?a4_0x2f8a42[_0x1086ac(0x14d)](_0x1086ac(0x1c0)):_0x4c919d[_0x1086ac(0x1c3)]?a4_0x2f8a42[_0x1086ac(0x1da)](_0x1086ac(0x1a4)):a4_0x2f8a42[_0x1086ac(0x1ca)](_0x1086ac(0x172)))),0x0;}const _0x4e1c53=_0x32070d||_0x59c28d,{data:_0x14b014}=await withSpinner('Analyzing\x20project\x20\x22'+_0xa755fe+_0x1086ac(0x1b0),()=>_0x15c7af[_0x1086ac(0x15b)][_0x1086ac(0x1b4)](_0xa755fe,_0x4e1c53,{'dryRun':!![]})),_0x1d4bcc=_0x14b014[_0x1086ac(0x1c4)][_0x1086ac(0x1b6)][_0x1086ac(0x1c0)]+_0x14b014[_0x1086ac(0x1c4)][_0x1086ac(0x1d0)]['new']+_0x14b014[_0x1086ac(0x1c4)][_0x1086ac(0x1e6)][_0x1086ac(0x1c0)]+_0x14b014[_0x1086ac(0x1c4)][_0x1086ac(0x1a0)][_0x1086ac(0x1c0)]+_0x14b014['counts']['integrations'][_0x1086ac(0x1c0)]+_0x14b014[_0x1086ac(0x1c4)][_0x1086ac(0x1f7)][_0x1086ac(0x1c0)]+_0x14b014['counts'][_0x1086ac(0x17f)][_0x1086ac(0x1c0)],_0x12fb68=_0x14b014[_0x1086ac(0x1c4)][_0x1086ac(0x1b6)][_0x1086ac(0x1a4)]+_0x14b014[_0x1086ac(0x1c4)][_0x1086ac(0x1d0)][_0x1086ac(0x1a4)]+_0x14b014[_0x1086ac(0x1c4)][_0x1086ac(0x1e6)][_0x1086ac(0x1a4)]+_0x14b014[_0x1086ac(0x1c4)][_0x1086ac(0x1a0)][_0x1086ac(0x1a4)]+_0x14b014['counts'][_0x1086ac(0x194)]['updated']+_0x14b014[_0x1086ac(0x1c4)][_0x1086ac(0x1f7)][_0x1086ac(0x1a4)]+_0x14b014[_0x1086ac(0x1c4)][_0x1086ac(0x17f)][_0x1086ac(0x1a4)],_0x2f9489=_0x14b014[_0x1086ac(0x1c4)][_0x1086ac(0x1b6)]['unchanged']+_0x14b014[_0x1086ac(0x1c4)][_0x1086ac(0x1d0)][_0x1086ac(0x172)]+_0x14b014['counts'][_0x1086ac(0x1e6)][_0x1086ac(0x172)]+_0x14b014[_0x1086ac(0x1c4)][_0x1086ac(0x1a0)][_0x1086ac(0x172)]+_0x14b014['counts'][_0x1086ac(0x194)]['unchanged']+_0x14b014['counts'][_0x1086ac(0x1f7)][_0x1086ac(0x172)]+_0x14b014[_0x1086ac(0x1c4)][_0x1086ac(0x17f)][_0x1086ac(0x172)];console[_0x1086ac(0x1e4)]('\x0aPull\x20summary\x20for\x20\x27'+_0x14b014['projectName']+'\x27:'),console['log']('\x20\x20'+a4_0x2f8a42['green']('+\x20'+_0x1d4bcc+_0x1086ac(0x1f5))+_0x1086ac(0x179)+a4_0x2f8a42[_0x1086ac(0x1da)]('~\x20'+_0x12fb68+'\x20changed')+_0x1086ac(0x179)+a4_0x2f8a42[_0x1086ac(0x1aa)]('=\x20'+_0x2f9489+'\x20unchanged')),console['log'](_0x1086ac(0x165)+formatCountSummary(_0x14b014[_0x1086ac(0x1c4)][_0x1086ac(0x1b6)])),console[_0x1086ac(0x1e4)](_0x1086ac(0x18f)+formatCountSummary(_0x14b014[_0x1086ac(0x1c4)][_0x1086ac(0x1d0)])),console[_0x1086ac(0x1e4)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x14b014[_0x1086ac(0x1c4)][_0x1086ac(0x1e6)])),console[_0x1086ac(0x1e4)](_0x1086ac(0x1e9)+formatCountSummary(_0x14b014['counts'][_0x1086ac(0x1a0)])),console[_0x1086ac(0x1e4)](_0x1086ac(0x188)+formatCountSummary(_0x14b014[_0x1086ac(0x1c4)][_0x1086ac(0x194)]));const _0x4bb973=_0x14b014['counts'][_0x1086ac(0x1f7)][_0x1086ac(0x1ee)]>0x0||_0x14b014[_0x1086ac(0x1c4)][_0x1086ac(0x17f)][_0x1086ac(0x1ee)]>0x0;_0x4bb973&&(console[_0x1086ac(0x1e4)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x14b014[_0x1086ac(0x1c4)][_0x1086ac(0x1f7)])),console[_0x1086ac(0x1e4)](_0x1086ac(0x16a)+formatCountSummary(_0x14b014[_0x1086ac(0x1c4)][_0x1086ac(0x17f)])));console[_0x1086ac(0x1e4)](_0x1086ac(0x1c7)+a4_0x2f8a42[_0x1086ac(0x17a)](_0x14b014[_0x1086ac(0x1cd)])),displayDiffs(_0x14b014['agents'],_0x14b014['knowledgeBases'],_0x14b014['textKnowledgeBases'],_0x14b014[_0x1086ac(0x1a0)],_0x14b014['integrations'],_0x14b014[_0x1086ac(0x1f7)],_0x14b014[_0x1086ac(0x17f)]);if(_0x427dc7)return console[_0x1086ac(0x1e4)](a4_0x2f8a42['yellow'](_0x1086ac(0x1bb))),0x0;if(_0x1d4bcc===0x0&&_0x12fb68===0x0)return console[_0x1086ac(0x1e4)](a4_0x2f8a42['green']('\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'llm_project':_0x14b014[_0x1086ac(0x181)]},_0x470143['session']),console['log'](a4_0x2f8a42[_0x1086ac(0x14d)](_0x1086ac(0x196)+a4_0x2f8a42[_0x1086ac(0x1aa)](_0x1086ac(0x16f))+_0x1086ac(0x1a1)+a4_0x2f8a42[_0x1086ac(0x17a)](_0x14b014['projectName']))),0x0;if(!_0xc4cba2&&!_0x3a4fbd){if(!isInteractive())return console['error'](a4_0x2f8a42[_0x1086ac(0x150)](_0x1086ac(0x1e3)),_0x1086ac(0x1f6)),console[_0x1086ac(0x15c)](a4_0x2f8a42['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x56de64=await confirmKey(_0x1086ac(0x186)+(_0x1d4bcc+_0x12fb68)+_0x1086ac(0x1ba));if(!_0x56de64)return console[_0x1086ac(0x1e4)](a4_0x2f8a42[_0x1086ac(0x1da)](_0x1086ac(0x159)),_0x1086ac(0x1e7)),0x1;}const {data:_0x2333ff}=await withSpinner(_0x1086ac(0x174),()=>_0x15c7af[_0x1086ac(0x15b)]['pullProject'](_0xa755fe,_0x4e1c53,{'force':_0x3a4fbd}));return console[_0x1086ac(0x1e4)](a4_0x2f8a42[_0x1086ac(0x14d)](_0x1086ac(0x189)+(_0x1d4bcc+_0x12fb68)+'\x20files\x20to\x20'+_0x2333ff['outputDir'])),saveSessionContext({'llm_project':_0x2333ff[_0x1086ac(0x181)]},_0x470143[_0x1086ac(0x16d)]),console[_0x1086ac(0x1e4)](a4_0x2f8a42['green'](_0x1086ac(0x196)+a4_0x2f8a42[_0x1086ac(0x1aa)]('llm_project')+_0x1086ac(0x1a1)+a4_0x2f8a42[_0x1086ac(0x17a)](_0x2333ff[_0x1086ac(0x181)]))),0x0;}}function a4_0xef5f(){const _0x4cd7d6=['Pushing\x20agent\x20from\x20\x22','Using\x20project:\x20','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','execute','\x20\x20Experimental\x20Artifacts:\x20','Dry\x20run\x20-\x20no\x20changes\x20made','Status:\x20','session','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','llm_project','no_context','Output\x20path:\x20','unchanged','no_local_folder','Writing\x20files...','\x22\x20from\x20project\x20\x22','\x20errors','\x22\x20to\x20new\x20project\x20\x22','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','\x20|\x20','cyan','agent:push','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','Errors:','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','experimentalArtifacts','found','projectName','errors','Using\x20context\x20project:\x20','Project:\x20','10280826tuuRvX','\x0aWrite\x20','\x0aChanges\x20to\x20prompt\x20\x27','\x20\x20Integrations:\x20','\x0a✔\x20Pulled\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20#\x20Pull\x20specific\x20agent','\x20\x20Text\x20Knowledge\x20Base\x20\x22','\x20changed','push','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','\x20\x20Knowledge\x20Bases:\x20','pullAgent','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','description','\x0a✔\x20Pushed\x20','integrations','\x20\x20Experimental\x20Artifact\x20\x22','✔\x20Context\x20set:\x20','output','created','sourceProjectName','parse','\x20unchanged','\x20\x20Knowledge\x20Base\x20\x22','Would\x20push\x20agent:\x20','dirname','3578268MDzkdS','prompts','\x20=\x20','dryRun','newProjectId','updated','\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)','Analyzing\x20changes\x20to\x20push...','source','agentName','Agent\x20pulled\x20successfully','dim','Clone\x20\x22','outputPath','\x22:\x20','12674RGhFki','\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','\x22...','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','cwd','agent:clone','pullProject','Pulling\x20agent\x20\x22','agents','tdx.json','diff','\x20--profile\x20','\x20files?','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','repeat','Chat:\x20','force','\x27\x20to\x20create\x20the\x20folder\x20structure.','new','21GRMdvm','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','hasChanges','counts','\x20\x20tdx\x20agent\x20pull\x20','\x20\x20Text\x20Knowledge\x20Bases:\x20','\x20\x20Target:\x20','Failed\x20to\x20push\x20agent:\x20','pushAgent','gray','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','No\x20tdx.json\x20found\x20in\x20','outputDir','\x0aPush\x20','action','knowledgeBases','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','Would\x20pull\x20agent:\x20','site','Using\x20local\x20project:\x20','Would\x20clone:','yes','MISSING_ARGUMENT','\x20\x20Prompt\x20\x22','Output:\x20','yellow','\x22\x20to\x20a\x20different\x20profile','\x20\x20Source:\x20','\x0aPush\x20summary\x20for\x20\x27','2532381iDQIYc','5058500UXkErS','agentId','New\x20project\x20name\x20is\x20required','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','\x0aError:','log','Pushing\x20to\x20project...','textKnowledgeBases','-\x20no\x20files\x20written','65qwVbzl','\x20\x20Prompts:\x20','-\x20nothing\x20pushed','730662HnyOmS','projectId','Project\x20cloned\x20successfully','total','New\x20project:\x20','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','Summary:','\x0aChanges:','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','Cannot\x20clone\x20from\x20context\x20project\x20\x22','\x20new','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','experimentalKnowledgeBases','Project\x20cloned\x20with\x20errors','join','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','\x0aChanges\x20to\x20integration\x20\x27','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','\x20\x20Integration\x20\x22','Cloning\x20\x22','\x20resources\x20to\x20\x27','INVALID_ARGUMENT','3339048ZOoLJk','projectDir','\x20\x20Agent\x20\x22','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','green','\x0aErrors\x20found:','\x22\x20to\x20\x22','red','agent:pull','pushProject','reason','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','New\x20project\x20ID:\x20','llmProject','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20successfully','Cancelled','\x20created','llm','error','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)','Agent:\x20','Dry\x20run\x20-\x20no\x20files\x20written','message','\x20\x20tdx\x20agent\x20clone\x20agents/','\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','name','\x0aChanges\x20to\x20agent\x20\x27','\x20\x20Agents:\x20'];a4_0xef5f=function(){return _0x4cd7d6;};return a4_0xef5f();}export class AgentCloneCommand extends BaseCommand{['name']=a4_0x28bf07(0x1b3);[a4_0x28bf07(0x192)]=a4_0x28bf07(0x17e);async['execute'](_0x1349d6){const _0x3f0473=a4_0x28bf07,{options:_0x567596,args:_0x1a8132,tdx:_0x384c1e}=_0x1349d6,_0x4278fd=_0x1a8132[0x0],_0x4a4493=_0x567596[_0x3f0473(0x163)],_0x40f931=_0x567596[_0x3f0473(0x1a2)],_0x5b2db4=_0x567596[_0x3f0473(0x1d6)],_0x440d93=_0x567596['site'],_0x18e12b=_0x567596[_0x3f0473(0x156)];let _0x59f08e;const _0x39295c=findAgentConfigPath(process[_0x3f0473(0x1b2)]());if(_0x4278fd){const _0x2bb70f=a4_0x2b6457['join'](_0x4278fd,_0x3f0473(0x1b7));existsSync(_0x2bb70f)?(_0x59f08e=_0x4278fd,console[_0x3f0473(0x1e4)](a4_0x2f8a42['dim'](_0x3f0473(0x1d4)+_0x4278fd))):_0x59f08e=_0x4278fd;}else{if(_0x39295c)_0x59f08e=a4_0x2b6457['dirname'](_0x39295c),console[_0x3f0473(0x1e4)](a4_0x2f8a42[_0x3f0473(0x1aa)]('Using\x20current\x20project:\x20'+_0x59f08e));else{if(_0x18e12b){const _0x266c77=sanitizeForFilesystem(_0x18e12b);let _0x160c61=_0x266c77,_0x59374b=a4_0x2b6457['join'](process['cwd'](),_0x3f0473(0x1b6),_0x266c77,_0x3f0473(0x1b7));if(!existsSync(_0x59374b)){const _0x5bb9db=normalizeName(_0x18e12b),_0x4c4b6c=a4_0x2b6457[_0x3f0473(0x1f9)](process['cwd'](),_0x3f0473(0x1b6),_0x5bb9db,_0x3f0473(0x1b7));existsSync(_0x4c4b6c)&&(_0x160c61=_0x5bb9db,_0x59374b=_0x4c4b6c);}if(existsSync(_0x59374b))_0x59f08e=a4_0x2b6457['dirname'](_0x59374b),console[_0x3f0473(0x1e4)](a4_0x2f8a42[_0x3f0473(0x1aa)](_0x3f0473(0x1d4)+_0x59f08e));else{const _0x11148e=_0x567596['profile'];if(_0x11148e)throw new SDKError(ErrorCode[_0x3f0473(0x148)],_0x3f0473(0x1f4)+_0x18e12b+_0x3f0473(0x1db),undefined,{'helpText':_0x3f0473(0x17c)+_0x3f0473(0x1f3)+(_0x3f0473(0x1c5)+_0x18e12b+'\x0a')+(_0x3f0473(0x161)+_0x160c61+'\x20--name\x20'+(_0x4a4493||'<new-name>')+_0x3f0473(0x1b9)+_0x11148e)});_0x59f08e=_0x18e12b,console[_0x3f0473(0x1e4)](a4_0x2f8a42[_0x3f0473(0x1aa)](_0x3f0473(0x183)+_0x18e12b));}}}}if(!_0x59f08e)return console[_0x3f0473(0x1e4)](a4_0x2f8a42[_0x3f0473(0x1da)](_0x3f0473(0x1d1))),console['log'](_0x3f0473(0x18e)),console[_0x3f0473(0x1e4)]('\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory'),console[_0x3f0473(0x1e4)](_0x3f0473(0x1a5)),console[_0x3f0473(0x1e4)](_0x3f0473(0x191)),0x1;if(!_0x4a4493)throw new SDKError(ErrorCode[_0x3f0473(0x1d7)],_0x3f0473(0x1e1),undefined,{'helpText':_0x3f0473(0x16e)});if(!_0x5b2db4&&!_0x40f931){if(!isInteractive())return console['error'](a4_0x2f8a42[_0x3f0473(0x150)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x3f0473(0x15c)](a4_0x2f8a42[_0x3f0473(0x1aa)](_0x3f0473(0x157))),0x1;const _0x451a92=await confirmKey(_0x3f0473(0x1ab)+_0x59f08e+_0x3f0473(0x177)+_0x4a4493+'\x22?');if(!_0x451a92)return console['log'](a4_0x2f8a42['yellow'](_0x3f0473(0x159))),0x1;}const {data:_0xc111e3}=await withSpinner(_0x3f0473(0x1fe)+_0x59f08e+_0x3f0473(0x14f)+_0x4a4493+_0x3f0473(0x1b0),()=>_0x384c1e[_0x3f0473(0x15b)]['cloneProject'](_0x59f08e,_0x4a4493,{'dryRun':_0x40f931}));if(_0x40f931){console[_0x3f0473(0x1e4)](a4_0x2f8a42[_0x3f0473(0x1da)](_0x3f0473(0x16b))),console[_0x3f0473(0x1e4)]('Source:\x20'+_0xc111e3[_0x3f0473(0x199)]),console[_0x3f0473(0x1e4)](_0x3f0473(0x1ef)+_0x4a4493),console[_0x3f0473(0x1e4)](_0x3f0473(0x1d5)),console[_0x3f0473(0x1e4)](_0x3f0473(0x165)+_0xc111e3[_0x3f0473(0x1c4)][_0x3f0473(0x1b6)][_0x3f0473(0x198)]),console[_0x3f0473(0x1e4)](_0x3f0473(0x18f)+_0xc111e3['counts']['knowledgeBases'][_0x3f0473(0x198)]),console['log'](_0x3f0473(0x1e9)+_0xc111e3[_0x3f0473(0x1c4)][_0x3f0473(0x1a0)][_0x3f0473(0x198)]);const _0x582b6e=_0xc111e3[_0x3f0473(0x1c4)][_0x3f0473(0x1f7)]['created']>0x0||_0xc111e3[_0x3f0473(0x1c4)][_0x3f0473(0x17f)]['created']>0x0;return _0x582b6e&&(console[_0x3f0473(0x1e4)](_0x3f0473(0x178)+_0xc111e3[_0x3f0473(0x1c4)]['experimentalKnowledgeBases'][_0x3f0473(0x198)]),console[_0x3f0473(0x1e4)](_0x3f0473(0x16a)+_0xc111e3[_0x3f0473(0x1c4)][_0x3f0473(0x17f)][_0x3f0473(0x198)])),0x0;}const _0x552dfb=_0xc111e3[_0x3f0473(0x1c4)]['agents']['errors']>0x0||_0xc111e3[_0x3f0473(0x1c4)]['knowledgeBases']['errors']>0x0||_0xc111e3[_0x3f0473(0x1c4)][_0x3f0473(0x1a0)][_0x3f0473(0x182)]>0x0||_0xc111e3['counts'][_0x3f0473(0x1f7)][_0x3f0473(0x182)]>0x0||_0xc111e3[_0x3f0473(0x1c4)]['experimentalArtifacts']['errors']>0x0;_0x552dfb?console[_0x3f0473(0x1e4)](a4_0x2f8a42[_0x3f0473(0x1da)](_0x3f0473(0x1f8))):console[_0x3f0473(0x1e4)](a4_0x2f8a42[_0x3f0473(0x14d)](_0x3f0473(0x1ed)));console[_0x3f0473(0x1e4)]('Source:\x20'+_0xc111e3[_0x3f0473(0x199)]),console[_0x3f0473(0x1e4)]('New\x20project:\x20'+_0xc111e3['newProjectName']),console[_0x3f0473(0x1e4)](_0x3f0473(0x155)+_0xc111e3[_0x3f0473(0x1a3)]),console[_0x3f0473(0x1e4)](),console[_0x3f0473(0x1e4)](_0x3f0473(0x1f1)),console['log'](_0x3f0473(0x165)+formatCountSummary(_0xc111e3[_0x3f0473(0x1c4)][_0x3f0473(0x1b6)])),console[_0x3f0473(0x1e4)](_0x3f0473(0x18f)+formatCountSummary(_0xc111e3[_0x3f0473(0x1c4)]['knowledgeBases'])),console[_0x3f0473(0x1e4)](_0x3f0473(0x1e9)+formatCountSummary(_0xc111e3[_0x3f0473(0x1c4)][_0x3f0473(0x1a0)])),console[_0x3f0473(0x1e4)](_0x3f0473(0x188)+formatCountSummary(_0xc111e3[_0x3f0473(0x1c4)]['integrations']));const _0x338ccb=_0xc111e3[_0x3f0473(0x1c4)][_0x3f0473(0x1f7)][_0x3f0473(0x198)]>0x0||_0xc111e3[_0x3f0473(0x1c4)]['experimentalKnowledgeBases'][_0x3f0473(0x1a4)]>0x0||_0xc111e3[_0x3f0473(0x1c4)][_0x3f0473(0x1f7)][_0x3f0473(0x172)]>0x0||_0xc111e3['counts']['experimentalArtifacts'][_0x3f0473(0x198)]>0x0||_0xc111e3['counts'][_0x3f0473(0x17f)][_0x3f0473(0x1a4)]>0x0||_0xc111e3[_0x3f0473(0x1c4)][_0x3f0473(0x17f)][_0x3f0473(0x172)]>0x0;_0x338ccb&&(console[_0x3f0473(0x1e4)](_0x3f0473(0x178)+formatCountSummary(_0xc111e3[_0x3f0473(0x1c4)]['experimentalKnowledgeBases'])),console['log']('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0xc111e3[_0x3f0473(0x1c4)][_0x3f0473(0x17f)])));if(_0x552dfb){console[_0x3f0473(0x1e4)](),console[_0x3f0473(0x1e4)](a4_0x2f8a42['red'](_0x3f0473(0x17d)));for(const _0x4f62e0 of _0xc111e3['agents']){_0x4f62e0['action']===_0x3f0473(0x15c)&&console[_0x3f0473(0x1e4)](a4_0x2f8a42[_0x3f0473(0x150)](_0x3f0473(0x14b)+_0x4f62e0[_0x3f0473(0x1a8)]+_0x3f0473(0x1ad)+_0x4f62e0[_0x3f0473(0x15c)]));}for(const _0x264a2b of _0xc111e3[_0x3f0473(0x1d0)]){_0x264a2b[_0x3f0473(0x1cf)]===_0x3f0473(0x15c)&&console[_0x3f0473(0x1e4)](a4_0x2f8a42[_0x3f0473(0x150)](_0x3f0473(0x19c)+_0x264a2b['name']+_0x3f0473(0x1ad)+_0x264a2b['error']));}for(const _0xd2999c of _0xc111e3[_0x3f0473(0x1a0)]){_0xd2999c[_0x3f0473(0x1cf)]==='error'&&console['log'](a4_0x2f8a42[_0x3f0473(0x150)](_0x3f0473(0x1d8)+_0xd2999c['name']+_0x3f0473(0x1ad)+_0xd2999c[_0x3f0473(0x15c)]));}for(const _0x1560a3 of _0xc111e3[_0x3f0473(0x194)]){_0x1560a3[_0x3f0473(0x1cf)]===_0x3f0473(0x15c)&&console['log'](a4_0x2f8a42[_0x3f0473(0x150)](_0x3f0473(0x1fd)+_0x1560a3[_0x3f0473(0x163)]+_0x3f0473(0x1ad)+_0x1560a3['error']));}for(const _0x1f0a8a of _0xc111e3[_0x3f0473(0x1f7)]){_0x1f0a8a['action']===_0x3f0473(0x15c)&&console[_0x3f0473(0x1e4)](a4_0x2f8a42[_0x3f0473(0x150)]('\x20\x20Experimental\x20Knowledge\x20Base\x20\x22'+_0x1f0a8a['name']+_0x3f0473(0x1ad)+_0x1f0a8a[_0x3f0473(0x15c)]));}for(const _0x187075 of _0xc111e3['experimentalArtifacts']){_0x187075[_0x3f0473(0x1cf)]===_0x3f0473(0x15c)&&console[_0x3f0473(0x1e4)](a4_0x2f8a42[_0x3f0473(0x150)](_0x3f0473(0x195)+_0x187075['name']+_0x3f0473(0x1ad)+_0x187075[_0x3f0473(0x15c)]));}return 0x1;}console[_0x3f0473(0x1e4)]();const _0x50831b=getLLMProjectUrl(_0x440d93,_0xc111e3[_0x3f0473(0x1a3)]);return console[_0x3f0473(0x1e4)](_0x3f0473(0x184)+a4_0x2f8a42[_0x3f0473(0x17a)](_0x50831b)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x28bf07(0x163)]=a4_0x28bf07(0x17b);[a4_0x28bf07(0x192)]=a4_0x28bf07(0x1b1);async[a4_0x28bf07(0x169)](_0x1c7469){const _0x4eff9a=a4_0x28bf07,{options:_0x33b969,args:_0xce3aea,tdx:_0x10643c}=_0x1c7469;let _0x157870=_0xce3aea[0x0]||process[_0x4eff9a(0x1b2)]();const _0x10af1b=_0x33b969['dryRun'],_0x5d8ef6=_0x33b969[_0x4eff9a(0x1be)],_0x528f47=_0x33b969[_0x4eff9a(0x1d6)],_0x367990=_0x33b969[_0x4eff9a(0x1d3)],_0x4895f8=a4_0x2b6457['join'](_0x157870,'agent.yml'),_0x2b58e6=existsSync(_0x4895f8);if(_0x2b58e6){const {data:_0x4e838b}=await withSpinner(_0x4eff9a(0x166)+_0x157870+_0x4eff9a(0x1b0),()=>_0x10643c[_0x4eff9a(0x15b)][_0x4eff9a(0x1c9)](_0x157870,{'dryRun':_0x10af1b,'force':_0x5d8ef6}));if(_0x10af1b)return console[_0x4eff9a(0x1e4)](a4_0x2f8a42[_0x4eff9a(0x1da)](_0x4eff9a(0x16b))),console[_0x4eff9a(0x1e4)](_0x4eff9a(0x19d)+_0x4e838b[_0x4eff9a(0x1a8)]),0x0;if(_0x4e838b[_0x4eff9a(0x1cf)]===_0x4eff9a(0x15c))return console[_0x4eff9a(0x1e4)](a4_0x2f8a42[_0x4eff9a(0x150)](_0x4eff9a(0x1c8)+_0x4e838b['error'])),0x1;console[_0x4eff9a(0x1e4)](a4_0x2f8a42[_0x4eff9a(0x14d)]('Agent\x20'+_0x4e838b['action']+_0x4eff9a(0x158))),console[_0x4eff9a(0x1e4)](_0x4eff9a(0x15e)+_0x4e838b[_0x4eff9a(0x1a8)]);if(_0x4e838b[_0x4eff9a(0x1e0)]&&_0x4e838b[_0x4eff9a(0x1ec)]){const _0x58b394=getLLMAgentChatUrl(_0x367990,_0x4e838b[_0x4eff9a(0x1ec)],_0x4e838b[_0x4eff9a(0x1e0)]);console[_0x4eff9a(0x1e4)](_0x4eff9a(0x1bd)+a4_0x2f8a42[_0x4eff9a(0x17a)](_0x58b394));}return 0x0;}const _0x5dfb3b=_0x33b969[_0x4eff9a(0x156)],_0x434db3=resolveProjectFromContext(_0x157870,_0x5dfb3b);if(_0x434db3[_0x4eff9a(0x180)])_0x157870=_0x434db3[_0x4eff9a(0x14a)],_0x434db3[_0x4eff9a(0x1a7)]==='context'&&console[_0x4eff9a(0x1e4)](a4_0x2f8a42[_0x4eff9a(0x1aa)](_0x4eff9a(0x167)+_0x157870));else{let _0x50883c=_0x4eff9a(0x168);_0x434db3[_0x4eff9a(0x153)]===_0x4eff9a(0x173)&&(_0x50883c=_0x434db3['message']+_0x4eff9a(0x1e2)+_0x434db3['llmProject']+_0x4eff9a(0x1bf));throw new SDKError(ErrorCode[_0x4eff9a(0x148)],_0x434db3['reason']===_0x4eff9a(0x170)?_0x434db3[_0x4eff9a(0x160)]:_0x4eff9a(0x1cc)+_0x157870,undefined,{'helpText':_0x50883c});}const {data:_0x59595a}=await withSpinner(_0x4eff9a(0x1a6),()=>_0x10643c[_0x4eff9a(0x15b)]['pushProject'](_0x157870,{'dryRun':!![]})),_0x354e38=_0x59595a[_0x4eff9a(0x1c4)][_0x4eff9a(0x1b6)]['errors']>0x0;if(_0x354e38){console[_0x4eff9a(0x1e4)](a4_0x2f8a42[_0x4eff9a(0x150)](_0x4eff9a(0x14e)));for(const _0x141ed4 of _0x59595a[_0x4eff9a(0x1b6)]){_0x141ed4['action']===_0x4eff9a(0x15c)&&console[_0x4eff9a(0x1e4)](a4_0x2f8a42['red']('\x20\x20Agent\x20\x22'+_0x141ed4[_0x4eff9a(0x1a8)]+_0x4eff9a(0x1ad)+_0x141ed4[_0x4eff9a(0x15c)]));}return 0x1;}const _0x51975c=_0x59595a[_0x4eff9a(0x1c4)][_0x4eff9a(0x1b6)][_0x4eff9a(0x198)]+_0x59595a[_0x4eff9a(0x1c4)][_0x4eff9a(0x1d0)][_0x4eff9a(0x198)]+_0x59595a['counts'][_0x4eff9a(0x1e6)][_0x4eff9a(0x198)]+_0x59595a[_0x4eff9a(0x1c4)][_0x4eff9a(0x1a0)][_0x4eff9a(0x198)]+_0x59595a[_0x4eff9a(0x1c4)]['integrations'][_0x4eff9a(0x198)]+_0x59595a[_0x4eff9a(0x1c4)]['experimentalKnowledgeBases'][_0x4eff9a(0x198)]+_0x59595a[_0x4eff9a(0x1c4)]['experimentalArtifacts'][_0x4eff9a(0x198)],_0x14c151=_0x59595a[_0x4eff9a(0x1c4)][_0x4eff9a(0x1b6)][_0x4eff9a(0x1a4)]+_0x59595a[_0x4eff9a(0x1c4)][_0x4eff9a(0x1d0)]['updated']+_0x59595a['counts'][_0x4eff9a(0x1e6)][_0x4eff9a(0x1a4)]+_0x59595a[_0x4eff9a(0x1c4)][_0x4eff9a(0x1a0)]['updated']+_0x59595a['counts'][_0x4eff9a(0x194)][_0x4eff9a(0x1a4)]+_0x59595a['counts']['experimentalKnowledgeBases'][_0x4eff9a(0x1a4)]+_0x59595a[_0x4eff9a(0x1c4)][_0x4eff9a(0x17f)]['updated'],_0x4d269f=_0x59595a[_0x4eff9a(0x1c4)][_0x4eff9a(0x1b6)][_0x4eff9a(0x172)]+_0x59595a[_0x4eff9a(0x1c4)][_0x4eff9a(0x1d0)][_0x4eff9a(0x172)]+_0x59595a[_0x4eff9a(0x1c4)]['textKnowledgeBases'][_0x4eff9a(0x172)]+_0x59595a[_0x4eff9a(0x1c4)][_0x4eff9a(0x1a0)][_0x4eff9a(0x172)]+_0x59595a[_0x4eff9a(0x1c4)]['integrations'][_0x4eff9a(0x172)]+_0x59595a[_0x4eff9a(0x1c4)][_0x4eff9a(0x1f7)]['unchanged']+_0x59595a['counts'][_0x4eff9a(0x17f)][_0x4eff9a(0x172)];console[_0x4eff9a(0x1e4)](_0x4eff9a(0x1dd)+_0x59595a[_0x4eff9a(0x181)]+'\x27:'),console[_0x4eff9a(0x1e4)]('\x20\x20'+a4_0x2f8a42[_0x4eff9a(0x14d)]('+\x20'+_0x51975c+_0x4eff9a(0x1f5))+_0x4eff9a(0x179)+a4_0x2f8a42[_0x4eff9a(0x1da)]('~\x20'+_0x14c151+_0x4eff9a(0x18c))+'\x20|\x20'+a4_0x2f8a42[_0x4eff9a(0x1aa)]('=\x20'+_0x4d269f+_0x4eff9a(0x19b))),console[_0x4eff9a(0x1e4)](_0x4eff9a(0x165)+formatCountSummary(_0x59595a['counts']['agents'])),console['log'](_0x4eff9a(0x18f)+formatCountSummary(_0x59595a[_0x4eff9a(0x1c4)][_0x4eff9a(0x1d0)])),console[_0x4eff9a(0x1e4)](_0x4eff9a(0x1c6)+formatCountSummary(_0x59595a[_0x4eff9a(0x1c4)][_0x4eff9a(0x1e6)])),console[_0x4eff9a(0x1e4)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x59595a[_0x4eff9a(0x1c4)][_0x4eff9a(0x1a0)])),console[_0x4eff9a(0x1e4)](_0x4eff9a(0x188)+formatCountSummary(_0x59595a['counts'][_0x4eff9a(0x194)]));const _0x13f3a7=_0x59595a['counts'][_0x4eff9a(0x1f7)][_0x4eff9a(0x198)]>0x0||_0x59595a['counts']['experimentalKnowledgeBases'][_0x4eff9a(0x1a4)]>0x0||_0x59595a[_0x4eff9a(0x1c4)]['experimentalKnowledgeBases'][_0x4eff9a(0x172)]>0x0||_0x59595a['counts'][_0x4eff9a(0x17f)][_0x4eff9a(0x198)]>0x0||_0x59595a[_0x4eff9a(0x1c4)][_0x4eff9a(0x17f)]['updated']>0x0||_0x59595a[_0x4eff9a(0x1c4)][_0x4eff9a(0x17f)][_0x4eff9a(0x172)]>0x0;_0x13f3a7&&(console[_0x4eff9a(0x1e4)](_0x4eff9a(0x178)+formatCountSummary(_0x59595a[_0x4eff9a(0x1c4)][_0x4eff9a(0x1f7)])),console[_0x4eff9a(0x1e4)](_0x4eff9a(0x16a)+formatCountSummary(_0x59595a[_0x4eff9a(0x1c4)][_0x4eff9a(0x17f)])));console[_0x4eff9a(0x1e4)](_0x4eff9a(0x1dc)+a4_0x2f8a42[_0x4eff9a(0x17a)](_0x157870)),displayDiffs(_0x59595a['agents'],_0x59595a[_0x4eff9a(0x1d0)],_0x59595a[_0x4eff9a(0x1e6)],_0x59595a['prompts'],_0x59595a[_0x4eff9a(0x194)],_0x59595a[_0x4eff9a(0x1f7)],_0x59595a[_0x4eff9a(0x17f)]);if(_0x10af1b)return console[_0x4eff9a(0x1e4)](a4_0x2f8a42[_0x4eff9a(0x1da)](_0x4eff9a(0x1f0))),0x0;if(_0x51975c===0x0&&_0x14c151===0x0){console[_0x4eff9a(0x1e4)](a4_0x2f8a42[_0x4eff9a(0x14d)](_0x4eff9a(0x154)));const _0x39e5c9=getLLMProjectUrl(_0x367990,_0x59595a[_0x4eff9a(0x1ec)]);return console[_0x4eff9a(0x1e4)](_0x4eff9a(0x184)+a4_0x2f8a42['cyan'](_0x39e5c9)),0x0;}if(!_0x528f47&&!_0x5d8ef6){if(!isInteractive())return console[_0x4eff9a(0x15c)](a4_0x2f8a42[_0x4eff9a(0x150)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a4_0x2f8a42[_0x4eff9a(0x1aa)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x174799=await confirmKey(_0x4eff9a(0x1ce)+(_0x51975c+_0x14c151)+'\x20resources?');if(!_0x174799)return console['log'](a4_0x2f8a42['yellow'](_0x4eff9a(0x159)),_0x4eff9a(0x1ea)),0x1;}const {data:_0x3b1877}=await withSpinner(_0x4eff9a(0x1e5),()=>_0x10643c[_0x4eff9a(0x15b)][_0x4eff9a(0x152)](_0x157870,{'force':_0x5d8ef6})),_0x55e672=_0x3b1877[_0x4eff9a(0x1c4)][_0x4eff9a(0x1b6)][_0x4eff9a(0x182)]>0x0||_0x3b1877[_0x4eff9a(0x1c4)][_0x4eff9a(0x1d0)][_0x4eff9a(0x182)]>0x0||_0x3b1877[_0x4eff9a(0x1c4)][_0x4eff9a(0x1e6)][_0x4eff9a(0x182)]>0x0||_0x3b1877['counts'][_0x4eff9a(0x1a0)]['errors']>0x0;if(_0x55e672){console[_0x4eff9a(0x1e4)](a4_0x2f8a42[_0x4eff9a(0x1da)]('\x0aProject\x20pushed\x20with\x20errors')),console[_0x4eff9a(0x1e4)](),console['log'](a4_0x2f8a42[_0x4eff9a(0x150)](_0x4eff9a(0x17d)));for(const _0x2a4da5 of _0x3b1877[_0x4eff9a(0x1b6)]){_0x2a4da5[_0x4eff9a(0x1cf)]===_0x4eff9a(0x15c)&&console['log'](a4_0x2f8a42[_0x4eff9a(0x150)](_0x4eff9a(0x14b)+_0x2a4da5[_0x4eff9a(0x1a8)]+_0x4eff9a(0x1ad)+_0x2a4da5[_0x4eff9a(0x15c)]));}for(const _0x2e3038 of _0x3b1877['knowledgeBases']){_0x2e3038[_0x4eff9a(0x1cf)]===_0x4eff9a(0x15c)&&console[_0x4eff9a(0x1e4)](a4_0x2f8a42[_0x4eff9a(0x150)]('\x20\x20Knowledge\x20Base\x20\x22'+_0x2e3038[_0x4eff9a(0x163)]+_0x4eff9a(0x1ad)+_0x2e3038['error']));}for(const _0x4ca1f6 of _0x3b1877[_0x4eff9a(0x1e6)]){_0x4ca1f6[_0x4eff9a(0x1cf)]==='error'&&console[_0x4eff9a(0x1e4)](a4_0x2f8a42['red'](_0x4eff9a(0x18b)+_0x4ca1f6[_0x4eff9a(0x163)]+_0x4eff9a(0x1ad)+_0x4ca1f6[_0x4eff9a(0x15c)]));}for(const _0x22d585 of _0x3b1877[_0x4eff9a(0x1a0)]){_0x22d585[_0x4eff9a(0x1cf)]===_0x4eff9a(0x15c)&&console[_0x4eff9a(0x1e4)](a4_0x2f8a42[_0x4eff9a(0x150)](_0x4eff9a(0x1d8)+_0x22d585['name']+_0x4eff9a(0x1ad)+_0x22d585[_0x4eff9a(0x15c)]));}for(const _0x5bbf95 of _0x3b1877[_0x4eff9a(0x194)]){_0x5bbf95[_0x4eff9a(0x1cf)]===_0x4eff9a(0x15c)&&console[_0x4eff9a(0x1e4)](a4_0x2f8a42['red'](_0x4eff9a(0x1fd)+_0x5bbf95[_0x4eff9a(0x163)]+_0x4eff9a(0x1ad)+_0x5bbf95[_0x4eff9a(0x15c)]));}return 0x1;}console[_0x4eff9a(0x1e4)](a4_0x2f8a42[_0x4eff9a(0x14d)](_0x4eff9a(0x193)+(_0x51975c+_0x14c151)+_0x4eff9a(0x147)+_0x3b1877['projectName']+'\x27'));const _0x36204b=getLLMProjectUrl(_0x367990,_0x3b1877['projectId']);return console[_0x4eff9a(0x1e4)](_0x4eff9a(0x184)+a4_0x2f8a42[_0x4eff9a(0x17a)](_0x36204b)),0x0;}}
@@ -1 +1 @@
1
- const a5_0x4ea2b1=a5_0x38ec;(function(_0x2fc0cf,_0x3ca1aa){const _0x3bc4ff=a5_0x38ec,_0xc77c15=_0x2fc0cf();while(!![]){try{const _0x2d81fa=parseInt(_0x3bc4ff(0x179))/0x1+-parseInt(_0x3bc4ff(0x15d))/0x2+-parseInt(_0x3bc4ff(0x188))/0x3*(parseInt(_0x3bc4ff(0x1b5))/0x4)+parseInt(_0x3bc4ff(0x1bd))/0x5*(-parseInt(_0x3bc4ff(0x187))/0x6)+parseInt(_0x3bc4ff(0x158))/0x7*(parseInt(_0x3bc4ff(0x185))/0x8)+-parseInt(_0x3bc4ff(0x181))/0x9+parseInt(_0x3bc4ff(0x1a4))/0xa;if(_0x2d81fa===_0x3ca1aa)break;else _0xc77c15['push'](_0xc77c15['shift']());}catch(_0x49897d){_0xc77c15['push'](_0xc77c15['shift']());}}}(a5_0x3de4,0x913a1));import*as a5_0x49b85d from'node:fs';function a5_0x38ec(_0x1db75d,_0x2e0cff){_0x1db75d=_0x1db75d-0x13e;const _0x3de4ef=a5_0x3de4();let _0x38ecec=_0x3de4ef[_0x1db75d];return _0x38ecec;}import*as a5_0x48c92c from'node:path';import a5_0x1b661a from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';function a5_0x3de4(){const _0x521617=['FAIL','2246624wfAcMR','some','site','includes','text','projectName','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','agent:test','testName','has','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','/<agent-name>','agentName','Cached\x20run\x20is\x20from\x20site\x20\x22','join','ERROR','dryRun','Total:\x20\x20\x20\x20','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','no_context','stop','test.yml','resolve','⚠\x20SKIPPED:\x20','\x22,\x20but\x20current\x20site\x20is\x20\x22','llm','Usage:','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','186322dbVlaG','eval','push','add','...','name','find','resolveAgentId','8324199dQmjaj','toISOString','Running\x20agent\x20tests...','...\x20','3801088dFQuRl','\x20\x20Conversation:\x20','78750xqVfDC','5493ljAqsJ','✓\x20PASS:\x20','✗\x20ERROR:\x20Project\x20not\x20found:\x20','start','length','\x20\x20Round\x20','output','substring','toLowerCase','Duration:\x20','conversations','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','table','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','tsv','found','projectDir','\x20\x20Project:\x20','Output\x20written\x20to:\x20','\x27\x20to\x20create\x20the\x20folder\x20structure.','verbose','\x20\x20Site:\x20','message','dim','Re-evaluating...','tests','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','reason','31988340AGXnlL','404','\x20\x20-\x20','execute','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','description','Evaluating\x20response...','Cached\x20run\x20from:\x20','no_local_folder','PASS','map','Failed:\x20\x20\x20','red','timestamp','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','round','1604GseVUA','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','forEach','\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','Site:\x20','llmProject','agent',':\x20Sending\x20user\x20input...','365cwRsAD','Available\x20tests:\x20','now','white','testYmlPath','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','No\x20tests\x20have\x20tags\x20defined.','Error\x20writing\x20output\x20file:\x20','✗\x20FAIL:\x20','resolveProjectId','cyan','Error:\x20No\x20previous\x20test\x20run\x20found.','executeReeval','No\x20tests\x20found\x20with\x20tags:\x20','Agent:\x20','✗\x20ERROR:\x20','status','multiple_agents','\x20-\x20','not\x20found','split','Running\x20test:\x20','tags','Using\x20agent:\x20','reeval','writeFileSync','\x20(cached)','Available\x20tags:\x20','\x22:\x20','repeat','log','yellow','Failed\x20Tests:','conversation_url','utf-8','Errors:\x20\x20\x20','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','rounds','green','Run\x20\x27tdx\x20agent\x20pull\x20','\x20(new)','Round\x20','filter','\x20\x20Evaluating...\x20','Test\x20Configuration:','no_tests','Round\x201/','trim','No\x20tests\x20found\x20matching:\x20','Executing\x20new\x20tests...','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','Running:\x20','json','\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)','context','jsonl','14tPBykK','Tests\x20found:\x20','\x20\x20Agent:\x20','agentDirs'];a5_0x3de4=function(){return _0x521617;};return a5_0x3de4();}import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x4ea2b1(0x17e)]=a5_0x4ea2b1(0x164);[a5_0x4ea2b1(0x1a9)]='Run\x20tests\x20for\x20an\x20LLM\x20agent';async[a5_0x4ea2b1(0x1a7)](_0x5e36f5){const _0x50f8a3=a5_0x4ea2b1,{options:_0x4e0425,args:_0x1cdbb1,tdx:_0x5964c4}=_0x5e36f5,_0x139ddb=_0x1cdbb1[0x0]||'.',_0x545af9=_0x4e0425[_0x50f8a3(0x16d)],_0x5ab1eb=_0x4e0425,_0x6bbc95=_0x5ab1eb[_0x50f8a3(0x17a)]===![],_0x22d90c=_0x5ab1eb[_0x50f8a3(0x1d5)],_0x2cd547=_0x5ab1eb['name'],_0x22b109=_0x5ab1eb[_0x50f8a3(0x1d3)],_0x991f50=_0x4e0425[_0x50f8a3(0x15f)],_0xb4409f=_0x5ab1eb[_0x50f8a3(0x18e)];if(_0x22d90c&&_0x6bbc95)return console[_0x50f8a3(0x13e)](a5_0x1b661a[_0x50f8a3(0x1b0)](_0x50f8a3(0x163))),0x1;let _0x260640='table';if(_0x5ab1eb[_0x50f8a3(0x154)])_0x260640=_0x50f8a3(0x154);else{if(_0x5ab1eb['jsonl'])_0x260640=_0x50f8a3(0x157);else{if(_0x5ab1eb[_0x50f8a3(0x196)])_0x260640=_0x50f8a3(0x196);else{if(_0x5ab1eb[_0x50f8a3(0x194)])_0x260640=_0x50f8a3(0x194);}}}const _0x140977=_0x5ab1eb[_0x50f8a3(0x1ba)];let _0x65ec2=_0x139ddb;const _0x35f458=a5_0x49b85d['existsSync'](_0x139ddb),_0x4aa3ef=_0x139ddb==='.';if(!_0x35f458||_0x4aa3ef){const _0x468a0e=resolveProjectFromContext(_0x139ddb,_0x140977,{'requireFile':_0x50f8a3(0x172)});if(_0x468a0e[_0x50f8a3(0x197)])_0x65ec2=_0x468a0e[_0x50f8a3(0x198)],_0x468a0e['source']===_0x50f8a3(0x156)&&console[_0x50f8a3(0x13e)](a5_0x1b661a['dim'](_0x50f8a3(0x1d4)+_0x65ec2));else switch(_0x468a0e[_0x50f8a3(0x1a3)]){case _0x50f8a3(0x170):console['log'](a5_0x1b661a['yellow'](_0x468a0e['message'])),console[_0x50f8a3(0x13e)](),console['log'](_0x50f8a3(0x177)),console['log'](_0x50f8a3(0x1b8)),console[_0x50f8a3(0x13e)](_0x50f8a3(0x155)),console[_0x50f8a3(0x13e)](),console['log'](_0x50f8a3(0x144));return 0x1;case _0x50f8a3(0x1ac):console[_0x50f8a3(0x13e)](a5_0x1b661a['yellow'](_0x468a0e[_0x50f8a3(0x19e)])),console[_0x50f8a3(0x13e)](),console[_0x50f8a3(0x13e)](_0x50f8a3(0x147)+_0x468a0e[_0x50f8a3(0x1ba)]+_0x50f8a3(0x19b));return 0x1;case _0x50f8a3(0x1ce):{const _0x40fbab=a5_0x48c92c['basename'](_0x468a0e[_0x50f8a3(0x198)]);console[_0x50f8a3(0x13e)](a5_0x1b661a[_0x50f8a3(0x13f)](_0x50f8a3(0x1b2)+_0x468a0e[_0x50f8a3(0x1ba)]+'\x22:'));for(const _0x151005 of _0x468a0e[_0x50f8a3(0x15b)]){console['log'](_0x50f8a3(0x1a6)+_0x151005);}return console[_0x50f8a3(0x13e)](),console[_0x50f8a3(0x13e)](_0x50f8a3(0x152)+_0x40fbab+_0x50f8a3(0x168)),0x1;}case _0x50f8a3(0x14d):console['log'](a5_0x1b661a[_0x50f8a3(0x13f)]('No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22'+_0x468a0e[_0x50f8a3(0x1ba)]+'\x22.')),console[_0x50f8a3(0x13e)](a5_0x1b661a[_0x50f8a3(0x19f)]('Project\x20path:\x20'+_0x468a0e['projectDir'])),console[_0x50f8a3(0x13e)](),console[_0x50f8a3(0x13e)](_0x50f8a3(0x16f));return 0x1;}}const {definition:_0xe188be,agentInfo:_0x13fc27}=parseTestFile(_0x65ec2);let _0x272e32=_0xe188be[_0x50f8a3(0x1a1)];if(_0x2cd547){const _0x2f053d=_0x2cd547[_0x50f8a3(0x1d1)](',')[_0x50f8a3(0x1ae)](_0x212ae8=>_0x212ae8[_0x50f8a3(0x14f)]());_0x272e32=_0xe188be[_0x50f8a3(0x1a1)]['filter'](_0x1bc00b=>_0x2f053d[_0x50f8a3(0x160)](_0x1bc00b[_0x50f8a3(0x17e)]));if(_0x272e32['length']===0x0)return console[_0x50f8a3(0x13e)](a5_0x1b661a[_0x50f8a3(0x13f)](_0x50f8a3(0x150)+_0x2cd547)),console[_0x50f8a3(0x13e)](a5_0x1b661a[_0x50f8a3(0x19f)](_0x50f8a3(0x1be)+_0xe188be[_0x50f8a3(0x1a1)][_0x50f8a3(0x1ae)](_0x1e9440=>_0x1e9440[_0x50f8a3(0x17e)])[_0x50f8a3(0x16b)](',\x20'))),0x1;}if(_0x22b109){const _0x60e36=_0x22b109[_0x50f8a3(0x1d1)](',')[_0x50f8a3(0x1ae)](_0x8cfb3d=>_0x8cfb3d[_0x50f8a3(0x14f)]()[_0x50f8a3(0x190)]());_0x272e32=_0x272e32[_0x50f8a3(0x14a)](_0x438aff=>_0x438aff[_0x50f8a3(0x1d3)]?.[_0x50f8a3(0x15e)](_0x44db55=>_0x60e36[_0x50f8a3(0x160)](_0x44db55[_0x50f8a3(0x190)]())));if(_0x272e32[_0x50f8a3(0x18c)]===0x0){console[_0x50f8a3(0x13e)](a5_0x1b661a[_0x50f8a3(0x13f)](_0x50f8a3(0x1ca)+_0x22b109));const _0x2353fc=new Set();return _0xe188be[_0x50f8a3(0x1a1)][_0x50f8a3(0x1b7)](_0x9f6b54=>_0x9f6b54['tags']?.[_0x50f8a3(0x1b7)](_0xa21211=>_0x2353fc[_0x50f8a3(0x17c)](_0xa21211))),_0x2353fc['size']>0x0?console[_0x50f8a3(0x13e)](a5_0x1b661a[_0x50f8a3(0x19f)](_0x50f8a3(0x1d8)+[..._0x2353fc]['join'](',\x20'))):console[_0x50f8a3(0x13e)](a5_0x1b661a[_0x50f8a3(0x19f)](_0x50f8a3(0x1c3))),0x1;}}if(_0x22d90c)return this['executeReeval'](_0x5e36f5,{'definition':{'tests':_0x272e32},'agentInfo':_0x13fc27,'outputFormat':_0x260640,'outputFile':_0xb4409f,'testNames':_0x2cd547});if(_0x545af9){console['log'](a5_0x1b661a[_0x50f8a3(0x1c7)](_0x50f8a3(0x14c))),console[_0x50f8a3(0x13e)](_0x50f8a3(0x19d)+a5_0x1b661a[_0x50f8a3(0x1c0)](_0x991f50)),console[_0x50f8a3(0x13e)](_0x50f8a3(0x199)+a5_0x1b661a[_0x50f8a3(0x1c0)](_0x13fc27[_0x50f8a3(0x162)])),console[_0x50f8a3(0x13e)](_0x50f8a3(0x15a)+a5_0x1b661a[_0x50f8a3(0x1c0)](_0x13fc27[_0x50f8a3(0x169)])),console[_0x50f8a3(0x13e)](),console['log'](_0x50f8a3(0x159)+a5_0x1b661a[_0x50f8a3(0x1c0)](_0x272e32[_0x50f8a3(0x18c)]));for(let _0x1aa6f0=0x0;_0x1aa6f0<_0x272e32[_0x50f8a3(0x18c)];_0x1aa6f0++){const _0xe9e649=_0x272e32[_0x1aa6f0],_0x5d431e=_0xe9e649[_0x50f8a3(0x145)][_0x50f8a3(0x18c)]===0x1?_0x50f8a3(0x1b4):_0x50f8a3(0x145),_0x3c710d=_0xe9e649[_0x50f8a3(0x1d3)]?.[_0x50f8a3(0x18c)]?'\x20['+_0xe9e649['tags'][_0x50f8a3(0x16b)](',\x20')+']':'';console[_0x50f8a3(0x13e)]('\x20\x20'+(_0x1aa6f0+0x1)+'.\x20'+a5_0x1b661a[_0x50f8a3(0x1c0)](_0xe9e649[_0x50f8a3(0x17e)])+'\x20('+_0xe9e649['rounds'][_0x50f8a3(0x18c)]+'\x20'+_0x5d431e+')'+a5_0x1b661a['dim'](_0x3c710d));}return 0x0;}let _0x24d9fa,_0x4f1e20;try{_0x24d9fa=await _0x5964c4[_0x50f8a3(0x176)][_0x50f8a3(0x1c6)](_0x13fc27[_0x50f8a3(0x162)]);}catch(_0x5f2b01){const _0xc01c74=_0x5f2b01 instanceof Error?_0x5f2b01[_0x50f8a3(0x19e)]:String(_0x5f2b01);return _0xc01c74[_0x50f8a3(0x160)](_0x50f8a3(0x1a5))||_0xc01c74[_0x50f8a3(0x190)]()[_0x50f8a3(0x160)](_0x50f8a3(0x1d0))?console['log'](a5_0x1b661a['red'](_0x50f8a3(0x18a)+_0x13fc27[_0x50f8a3(0x162)])):console[_0x50f8a3(0x13e)](a5_0x1b661a[_0x50f8a3(0x1b0)](_0x50f8a3(0x195)+_0x13fc27[_0x50f8a3(0x162)]+_0x50f8a3(0x1d9)+_0xc01c74)),0x1;}try{_0x4f1e20=await _0x5964c4[_0x50f8a3(0x176)][_0x50f8a3(0x180)](_0x13fc27[_0x50f8a3(0x169)],_0x24d9fa);}catch(_0x290ef2){const _0xfd21d8=_0x290ef2 instanceof Error?_0x290ef2['message']:String(_0x290ef2);return _0xfd21d8[_0x50f8a3(0x160)]('404')||_0xfd21d8[_0x50f8a3(0x190)]()['includes']('not\x20found')?console[_0x50f8a3(0x13e)](a5_0x1b661a[_0x50f8a3(0x1b0)](_0x50f8a3(0x1a8)+_0x13fc27[_0x50f8a3(0x169)])):console[_0x50f8a3(0x13e)](a5_0x1b661a[_0x50f8a3(0x1b0)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22'+_0x13fc27['agentName']+_0x50f8a3(0x1d9)+_0xfd21d8)),0x1;}let _0x4f2545;if(!_0x6bbc95)try{_0x4f2545=await setupEvaluatorAgent(_0x5964c4[_0x50f8a3(0x176)],_0x4e0425['verbose']);}catch(_0x32a744){const _0x382760=_0x32a744 instanceof Error?_0x32a744['message']:String(_0x32a744);return console['log'](a5_0x1b661a[_0x50f8a3(0x1b0)]('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x382760)),0x1;}console[_0x50f8a3(0x13e)](a5_0x1b661a[_0x50f8a3(0x1c7)](_0x50f8a3(0x183))),console[_0x50f8a3(0x13e)](_0x50f8a3(0x1b9)+a5_0x1b661a[_0x50f8a3(0x1c0)](_0x991f50)),console[_0x50f8a3(0x13e)](_0x50f8a3(0x1cb)+a5_0x1b661a[_0x50f8a3(0x1c0)](_0x13fc27[_0x50f8a3(0x162)]+'/'+_0x13fc27[_0x50f8a3(0x169)])),console[_0x50f8a3(0x13e)]();const _0x3311c9=[],_0x2ab363=[],_0xe54691=Date[_0x50f8a3(0x1bf)]();for(let _0x2430ef=0x0;_0x2430ef<_0x272e32[_0x50f8a3(0x18c)];_0x2430ef++){const _0x3751a4=_0x272e32[_0x2430ef];_0x272e32['length']>0x1?console[_0x50f8a3(0x13e)]('Test\x20'+(_0x2430ef+0x1)+'/'+_0x272e32[_0x50f8a3(0x18c)]+':\x20'+a5_0x1b661a[_0x50f8a3(0x1c0)](_0x3751a4[_0x50f8a3(0x17e)])):console[_0x50f8a3(0x13e)](_0x50f8a3(0x1d2)+a5_0x1b661a[_0x50f8a3(0x1c0)](_0x3751a4[_0x50f8a3(0x17e)]));const _0x384bfa=createCommandSpinner('Round\x201/'+_0x3751a4[_0x50f8a3(0x145)][_0x50f8a3(0x18c)]+_0x50f8a3(0x1bc));_0x384bfa[_0x50f8a3(0x18b)]();try{const {result:_0x2b3785,conversation:_0x40eb73}=await runTest(_0x5964c4[_0x50f8a3(0x176)],_0x3751a4,{'agentId':_0x4f1e20,'projectId':_0x24d9fa,'site':_0x991f50,'noEval':_0x6bbc95,'evaluatorId':_0x4f2545,'onRoundStart':(_0x570a63,_0x557ed4)=>{const _0x10e19a=_0x50f8a3;_0x384bfa[_0x10e19a(0x161)]='Round\x20'+(_0x570a63+0x1)+'/'+_0x557ed4+_0x10e19a(0x1bc);},'onRoundComplete':(_0x2491a3,_0x384cef,_0x529d15)=>{const _0x4c959c=_0x50f8a3,_0x4a5bd3=formatElapsed(_0x384cef);_0x529d15?console[_0x4c959c(0x13e)](_0x4c959c(0x18d)+(_0x2491a3+0x1)+'/'+_0x3751a4[_0x4c959c(0x145)][_0x4c959c(0x18c)]+_0x4c959c(0x184)+a5_0x1b661a[_0x4c959c(0x146)]('✓')+'\x20('+_0x4a5bd3+')'):console[_0x4c959c(0x13e)](_0x4c959c(0x18d)+(_0x2491a3+0x1)+'/'+_0x3751a4[_0x4c959c(0x145)][_0x4c959c(0x18c)]+_0x4c959c(0x184)+a5_0x1b661a['red']('✗'));},'onEvaluationStart':()=>{const _0x238609=_0x50f8a3;_0x384bfa['text']=_0x238609(0x1aa);},'onEvaluationComplete':_0x2a77e5=>{const _0x1ed7a6=_0x50f8a3,_0x443a07=formatElapsed(_0x2a77e5);console[_0x1ed7a6(0x13e)](_0x1ed7a6(0x14b)+a5_0x1b661a[_0x1ed7a6(0x146)]('✓')+'\x20('+_0x443a07+')');}});_0x384bfa['stop'](),_0x3311c9[_0x50f8a3(0x17b)](_0x2b3785),_0x2ab363['push'](_0x40eb73);if(_0x2b3785[_0x50f8a3(0x1cd)]===_0x50f8a3(0x1ad))console['log'](a5_0x1b661a[_0x50f8a3(0x146)](_0x50f8a3(0x189)+_0x2b3785[_0x50f8a3(0x1a3)]));else _0x2b3785[_0x50f8a3(0x1cd)]===_0x50f8a3(0x15c)?console['log'](a5_0x1b661a[_0x50f8a3(0x1b0)](_0x50f8a3(0x1c5)+_0x2b3785[_0x50f8a3(0x1a3)])):console['log'](a5_0x1b661a[_0x50f8a3(0x1b0)](_0x50f8a3(0x1cc)+_0x2b3785[_0x50f8a3(0x1a3)]));_0x2b3785[_0x50f8a3(0x141)]&&console[_0x50f8a3(0x13e)](a5_0x1b661a[_0x50f8a3(0x19f)]('Conversation\x20URL:\x20'+_0x2b3785[_0x50f8a3(0x141)])),console['log']();}catch(_0x21ef2c){_0x384bfa[_0x50f8a3(0x171)]();const _0x58f255=_0x21ef2c instanceof Error?_0x21ef2c['message']:String(_0x21ef2c);console[_0x50f8a3(0x13e)](a5_0x1b661a[_0x50f8a3(0x1b0)](_0x50f8a3(0x1cc)+_0x58f255)),console[_0x50f8a3(0x13e)](),_0x3311c9['push']({'name':_0x3751a4[_0x50f8a3(0x17e)],'status':_0x50f8a3(0x16c),'reason':_0x58f255,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}const _0x1749ae=Date[_0x50f8a3(0x1bf)]()-_0xe54691,_0x17e138=_0x3311c9[_0x50f8a3(0x14a)](_0x2ce7c5=>_0x2ce7c5[_0x50f8a3(0x1cd)]==='PASS')['length'],_0x5b0861=_0x3311c9['filter'](_0x7b8655=>_0x7b8655[_0x50f8a3(0x1cd)]===_0x50f8a3(0x15c))[_0x50f8a3(0x18c)],_0xe6e22d=_0x3311c9[_0x50f8a3(0x14a)](_0x3d6775=>_0x3d6775[_0x50f8a3(0x1cd)]===_0x50f8a3(0x16c))[_0x50f8a3(0x18c)];console[_0x50f8a3(0x13e)]('━'[_0x50f8a3(0x1da)](0x3c)),console[_0x50f8a3(0x13e)]('Test\x20Summary'),console['log']('━'['repeat'](0x3c)),console['log'](_0x50f8a3(0x16e)+_0x3311c9[_0x50f8a3(0x18c)]),console[_0x50f8a3(0x13e)]('Passed:\x20\x20\x20'+a5_0x1b661a[_0x50f8a3(0x146)](_0x17e138)),console['log'](_0x50f8a3(0x1af)+a5_0x1b661a[_0x50f8a3(0x1b0)](_0x5b0861));_0xe6e22d>0x0&&console['log']('Errors:\x20\x20\x20'+a5_0x1b661a[_0x50f8a3(0x1b0)](_0xe6e22d));console['log'](_0x50f8a3(0x191)+formatElapsed(_0x1749ae)),console[_0x50f8a3(0x13e)]('━'[_0x50f8a3(0x1da)](0x3c));const _0x40dc14=_0x3311c9[_0x50f8a3(0x14a)](_0x483007=>_0x483007[_0x50f8a3(0x1cd)]!==_0x50f8a3(0x1ad));if(_0x40dc14[_0x50f8a3(0x18c)]>0x0){console[_0x50f8a3(0x13e)](),console[_0x50f8a3(0x13e)](_0x50f8a3(0x140));for(const _0x4abea8 of _0x40dc14){const _0x5dff61=a5_0x1b661a[_0x50f8a3(0x1b0)]('✗'),_0x4f2d86=_0x4abea8[_0x50f8a3(0x1a3)][_0x50f8a3(0x18c)]>0x32?_0x4abea8[_0x50f8a3(0x1a3)][_0x50f8a3(0x18f)](0x0,0x32)+_0x50f8a3(0x17d):_0x4abea8[_0x50f8a3(0x1a3)];console[_0x50f8a3(0x13e)]('\x20\x20'+_0x5dff61+'\x20'+_0x4abea8[_0x50f8a3(0x17e)]+':\x20'+_0x4f2d86);}}const _0x1f29b0={'summary':{'total':_0x3311c9[_0x50f8a3(0x18c)],'passed':_0x17e138,'failed':_0x5b0861,'errors':_0xe6e22d>0x0?_0xe6e22d:undefined,'duration_ms':_0x1749ae},'tests':_0x3311c9,'agent':{'project':_0x13fc27[_0x50f8a3(0x162)],'name':_0x13fc27[_0x50f8a3(0x169)],'site':_0x991f50},'timestamp':new Date(_0xe54691)['toISOString']()};try{const _0xb0277a=buildCachedTestRun(_0x2ab363,{'site':_0x991f50,'projectId':_0x24d9fa,'projectName':_0x13fc27[_0x50f8a3(0x162)],'agentId':_0x4f1e20,'agentName':_0x13fc27[_0x50f8a3(0x169)],'testYmlPath':a5_0x48c92c[_0x50f8a3(0x173)](_0x13fc27[_0x50f8a3(0x1c1)])});saveLastTestRun(_0xb0277a);}catch{}if(_0x260640!==_0x50f8a3(0x194)||_0xb4409f){const _0x6a5b0c=formatResults(_0x1f29b0,_0x260640);if(_0xb4409f)try{a5_0x49b85d[_0x50f8a3(0x1d6)](_0xb4409f,_0x6a5b0c,_0x50f8a3(0x142)),console[_0x50f8a3(0x13e)](),console[_0x50f8a3(0x13e)](a5_0x1b661a[_0x50f8a3(0x19f)](_0x50f8a3(0x19a)+_0xb4409f));}catch(_0x553bd8){return console[_0x50f8a3(0x13e)](),console[_0x50f8a3(0x13e)](a5_0x1b661a['red'](_0x50f8a3(0x1c4)+_0x553bd8)),0x1;}else console[_0x50f8a3(0x13e)](),console[_0x50f8a3(0x13e)](_0x6a5b0c);}return _0x40dc14[_0x50f8a3(0x18c)]>0x0?0x1:0x0;}async[a5_0x4ea2b1(0x1c9)](_0xe95b5d,_0x54e166){const _0x205047=a5_0x4ea2b1,{options:_0x5c7f91,tdx:_0x18642b}=_0xe95b5d,{definition:_0x1f9795,agentInfo:_0x2b4c5b,outputFormat:_0x2ee88e,outputFile:_0x1d9ab8}=_0x54e166,_0x55f8b0=_0x5c7f91[_0x205047(0x15f)],_0x4ab74c=loadLastTestRun();if(!_0x4ab74c)return console[_0x205047(0x13e)](a5_0x1b661a['red'](_0x205047(0x1c8))),console[_0x205047(0x13e)](a5_0x1b661a[_0x205047(0x19f)](_0x205047(0x1b6))),0x1;if(_0x4ab74c[_0x205047(0x1bb)]['agentName']!==_0x2b4c5b[_0x205047(0x169)])return console[_0x205047(0x13e)](a5_0x1b661a[_0x205047(0x1b0)](_0x205047(0x178)+_0x4ab74c[_0x205047(0x1bb)][_0x205047(0x169)]+_0x205047(0x1a2)+_0x2b4c5b['agentName']+'\x22.')),console['log'](a5_0x1b661a['dim'](_0x205047(0x193))),0x1;const _0xc9387d=new Set(_0x4ab74c[_0x205047(0x192)][_0x205047(0x1ae)](_0x350a4f=>_0x350a4f[_0x205047(0x165)])),_0x2e88cd=_0x1f9795[_0x205047(0x1a1)]['filter'](_0x16b51f=>!_0xc9387d[_0x205047(0x166)](_0x16b51f[_0x205047(0x17e)]));if(_0x2e88cd[_0x205047(0x18c)]>0x0&&_0x4ab74c[_0x205047(0x15f)]!==_0x55f8b0)return console['log'](a5_0x1b661a['red']('Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.')),console[_0x205047(0x13e)](a5_0x1b661a[_0x205047(0x19f)](_0x205047(0x16a)+_0x4ab74c[_0x205047(0x15f)]+_0x205047(0x175)+_0x55f8b0+'\x22.')),console['log'](a5_0x1b661a[_0x205047(0x19f)]('Either\x20switch\x20to\x20the\x20\x22'+_0x4ab74c[_0x205047(0x15f)]+_0x205047(0x1c2))),0x1;const _0x102c20=_0x1f9795[_0x205047(0x1a1)][_0x205047(0x14a)](_0x192c97=>_0xc9387d[_0x205047(0x166)](_0x192c97[_0x205047(0x17e)])),_0x53cb32=_0x2e88cd;let _0x149c41;try{_0x149c41=await setupEvaluatorAgent(_0x18642b['llm'],_0x5c7f91[_0x205047(0x19c)]);}catch(_0x27b975){const _0x228537=_0x27b975 instanceof Error?_0x27b975[_0x205047(0x19e)]:String(_0x27b975);return console[_0x205047(0x13e)](a5_0x1b661a[_0x205047(0x1b0)](_0x205047(0x1b3)+_0x228537)),0x1;}console[_0x205047(0x13e)](a5_0x1b661a[_0x205047(0x1c7)]('Re-evaluating\x20cached\x20test\x20run...')),console['log'](_0x205047(0x1ab)+a5_0x1b661a['white'](_0x4ab74c[_0x205047(0x1b1)])),console[_0x205047(0x13e)](_0x205047(0x1cb)+a5_0x1b661a[_0x205047(0x1c0)](_0x4ab74c['agent']['projectName']+'/'+_0x4ab74c[_0x205047(0x1bb)][_0x205047(0x169)]));_0x53cb32[_0x205047(0x18c)]>0x0&&console[_0x205047(0x13e)]('New\x20tests\x20to\x20execute:\x20'+a5_0x1b661a[_0x205047(0x13f)](_0x53cb32[_0x205047(0x18c)]));console[_0x205047(0x13e)]();const _0x5d00b5=[],_0xd9af33=Date['now'](),_0x14da02=createCommandSpinner(_0x205047(0x1a0));if(_0x102c20[_0x205047(0x18c)]>0x0)try{const _0xe56823=await reevaluateFromCache(_0x18642b[_0x205047(0x176)],_0x4ab74c,{'tests':_0x102c20},{'evaluatorId':_0x149c41,'onTestStart':(_0x523a45,_0x3511e3,_0x52a74d)=>{const _0xc91cbf=_0x205047;_0x14da02[_0xc91cbf(0x161)]='Re-evaluating\x20'+(_0x3511e3+0x1)+'/'+_0x52a74d+':\x20'+_0x523a45+'...';if(!_0x14da02['isSpinning'])_0x14da02[_0xc91cbf(0x18b)]();},'onTestComplete':(_0x3273bd,_0x3238ef)=>{const _0x4fa594=_0x205047;_0x14da02[_0x4fa594(0x171)]();if(_0x3238ef[_0x4fa594(0x1cd)]===_0x4fa594(0x1ad))console[_0x4fa594(0x13e)](a5_0x1b661a['green'](_0x4fa594(0x189)+_0x3273bd)+a5_0x1b661a['dim']('\x20(cached)'));else _0x3238ef[_0x4fa594(0x1cd)]===_0x4fa594(0x15c)?console[_0x4fa594(0x13e)](a5_0x1b661a['red'](_0x4fa594(0x1c5)+_0x3273bd+_0x4fa594(0x1cf)+_0x3238ef[_0x4fa594(0x1a3)])+a5_0x1b661a['dim'](_0x4fa594(0x1d7))):console[_0x4fa594(0x13e)](a5_0x1b661a[_0x4fa594(0x1b0)]('✗\x20ERROR:\x20'+_0x3273bd+_0x4fa594(0x1cf)+_0x3238ef[_0x4fa594(0x1a3)]));_0x3238ef['conversation_url']&&console[_0x4fa594(0x13e)](a5_0x1b661a['dim']('\x20\x20Conversation:\x20'+_0x3238ef[_0x4fa594(0x141)])),_0x5d00b5['push'](_0x3238ef);},'onTestSkipped':(_0x1f87e2,_0x1ddbe4)=>{const _0x4bbff5=_0x205047;_0x14da02['stop'](),console[_0x4bbff5(0x13e)](a5_0x1b661a[_0x4bbff5(0x13f)](_0x4bbff5(0x174)+_0x1f87e2+_0x4bbff5(0x1cf)+_0x1ddbe4));}});for(const _0x1e85e0 of _0xe56823){!_0x5d00b5[_0x205047(0x17f)](_0x22063e=>_0x22063e['name']===_0x1e85e0[_0x205047(0x17e)])&&_0x5d00b5[_0x205047(0x17b)](_0x1e85e0);}}catch(_0x906008){_0x14da02[_0x205047(0x171)]();const _0xdeb136=_0x906008 instanceof Error?_0x906008[_0x205047(0x19e)]:String(_0x906008);return console['log'](a5_0x1b661a[_0x205047(0x1b0)](_0x205047(0x167)+_0xdeb136)),0x1;}_0x14da02[_0x205047(0x171)]();if(_0x53cb32[_0x205047(0x18c)]>0x0){console['log'](),console[_0x205047(0x13e)](a5_0x1b661a[_0x205047(0x1c7)](_0x205047(0x151)));const {projectId:_0x39421f,agentId:_0x3497db}=_0x4ab74c['agent'];for(const _0x28ca07 of _0x53cb32){console[_0x205047(0x13e)](_0x205047(0x153)+a5_0x1b661a[_0x205047(0x1c0)](_0x28ca07[_0x205047(0x17e)]));const _0x198ceb=createCommandSpinner(_0x205047(0x14e)+_0x28ca07[_0x205047(0x145)]['length']+_0x205047(0x1bc));_0x198ceb[_0x205047(0x18b)]();try{const {result:_0x1b77dd}=await runTest(_0x18642b[_0x205047(0x176)],_0x28ca07,{'agentId':_0x3497db,'projectId':_0x39421f,'site':_0x4ab74c['site'],'noEval':![],'evaluatorId':_0x149c41,'onRoundStart':(_0x516920,_0x48d275)=>{const _0x3c84bf=_0x205047;_0x198ceb[_0x3c84bf(0x161)]=_0x3c84bf(0x149)+(_0x516920+0x1)+'/'+_0x48d275+_0x3c84bf(0x1bc);},'onRoundComplete':(_0x51371a,_0x257b9c,_0x244813)=>{const _0x30865b=_0x205047,_0x1e466b=formatElapsed(_0x257b9c);_0x244813?console[_0x30865b(0x13e)](_0x30865b(0x18d)+(_0x51371a+0x1)+'/'+_0x28ca07[_0x30865b(0x145)][_0x30865b(0x18c)]+_0x30865b(0x184)+a5_0x1b661a['green']('✓')+'\x20('+_0x1e466b+')'):console[_0x30865b(0x13e)](_0x30865b(0x18d)+(_0x51371a+0x1)+'/'+_0x28ca07[_0x30865b(0x145)]['length']+'...\x20'+a5_0x1b661a[_0x30865b(0x1b0)]('✗'));},'onEvaluationStart':()=>{const _0x13d2ef=_0x205047;_0x198ceb[_0x13d2ef(0x161)]='Evaluating\x20response...';},'onEvaluationComplete':_0x41cdb7=>{const _0x311370=_0x205047,_0x3364ef=formatElapsed(_0x41cdb7);console[_0x311370(0x13e)]('\x20\x20Evaluating...\x20'+a5_0x1b661a['green']('✓')+'\x20('+_0x3364ef+')');}});_0x198ceb['stop'](),_0x5d00b5[_0x205047(0x17b)](_0x1b77dd);if(_0x1b77dd[_0x205047(0x1cd)]===_0x205047(0x1ad))console[_0x205047(0x13e)](a5_0x1b661a[_0x205047(0x146)](_0x205047(0x189)+_0x1b77dd[_0x205047(0x1a3)])+a5_0x1b661a['dim'](_0x205047(0x148)));else _0x1b77dd[_0x205047(0x1cd)]==='FAIL'?console[_0x205047(0x13e)](a5_0x1b661a[_0x205047(0x1b0)](_0x205047(0x1c5)+_0x1b77dd['reason'])+a5_0x1b661a[_0x205047(0x19f)](_0x205047(0x148))):console[_0x205047(0x13e)](a5_0x1b661a[_0x205047(0x1b0)]('✗\x20ERROR:\x20'+_0x1b77dd['reason']));_0x1b77dd[_0x205047(0x141)]&&console['log'](a5_0x1b661a[_0x205047(0x19f)](_0x205047(0x186)+_0x1b77dd['conversation_url']));}catch(_0xe29ffc){_0x198ceb[_0x205047(0x171)]();const _0x1a40c4=_0xe29ffc instanceof Error?_0xe29ffc[_0x205047(0x19e)]:String(_0xe29ffc);console[_0x205047(0x13e)](a5_0x1b661a['red']('✗\x20ERROR:\x20'+_0x1a40c4)),_0x5d00b5[_0x205047(0x17b)]({'name':_0x28ca07[_0x205047(0x17e)],'status':_0x205047(0x16c),'reason':_0x1a40c4,'timestamp':new Date()[_0x205047(0x182)](),'duration_ms':0x0});}}}console[_0x205047(0x13e)]();const _0x3734a9=Date[_0x205047(0x1bf)]()-_0xd9af33,_0x2dce47=_0x5d00b5[_0x205047(0x14a)](_0x43a63b=>_0x43a63b[_0x205047(0x1cd)]===_0x205047(0x1ad))[_0x205047(0x18c)],_0x4ef17d=_0x5d00b5['filter'](_0xa601c4=>_0xa601c4[_0x205047(0x1cd)]===_0x205047(0x15c))['length'],_0x3e3dbd=_0x5d00b5[_0x205047(0x14a)](_0x36008a=>_0x36008a['status']===_0x205047(0x16c))['length'];console[_0x205047(0x13e)]('━'[_0x205047(0x1da)](0x3c)),console['log']('Re-evaluation\x20Summary'),console['log']('━'[_0x205047(0x1da)](0x3c)),console[_0x205047(0x13e)](_0x205047(0x16e)+_0x5d00b5['length']),console['log']('Passed:\x20\x20\x20'+a5_0x1b661a[_0x205047(0x146)](_0x2dce47)),console['log']('Failed:\x20\x20\x20'+a5_0x1b661a[_0x205047(0x1b0)](_0x4ef17d));_0x3e3dbd>0x0&&console[_0x205047(0x13e)](_0x205047(0x143)+a5_0x1b661a[_0x205047(0x1b0)](_0x3e3dbd));console[_0x205047(0x13e)](_0x205047(0x191)+formatElapsed(_0x3734a9)),console[_0x205047(0x13e)]('━'[_0x205047(0x1da)](0x3c));const _0x1b62f3={'summary':{'total':_0x5d00b5[_0x205047(0x18c)],'passed':_0x2dce47,'failed':_0x4ef17d,'errors':_0x3e3dbd>0x0?_0x3e3dbd:undefined,'duration_ms':_0x3734a9},'tests':_0x5d00b5,'agent':{'project':_0x2b4c5b[_0x205047(0x162)],'name':_0x2b4c5b['agentName'],'site':_0x55f8b0},'timestamp':new Date(_0xd9af33)[_0x205047(0x182)]()};if(_0x2ee88e!==_0x205047(0x194)||_0x1d9ab8){const _0x51c08b=formatResults(_0x1b62f3,_0x2ee88e);if(_0x1d9ab8)try{a5_0x49b85d[_0x205047(0x1d6)](_0x1d9ab8,_0x51c08b,'utf-8'),console[_0x205047(0x13e)](),console[_0x205047(0x13e)](a5_0x1b661a[_0x205047(0x19f)](_0x205047(0x19a)+_0x1d9ab8));}catch(_0x4b8fa8){return console[_0x205047(0x13e)](),console[_0x205047(0x13e)](a5_0x1b661a[_0x205047(0x1b0)](_0x205047(0x1c4)+_0x4b8fa8)),0x1;}else console[_0x205047(0x13e)](),console[_0x205047(0x13e)](_0x51c08b);}const _0x3e2b30=_0x5d00b5[_0x205047(0x14a)](_0x5dcbca=>_0x5dcbca[_0x205047(0x1cd)]!==_0x205047(0x1ad));return _0x3e2b30['length']>0x0?0x1:0x0;}}
1
+ const a5_0x3bd5f5=a5_0x27fd;function a5_0x54b5(){const _0x27f9ff=['\x20\x20Evaluating...\x20','dim','stop','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','\x22,\x20but\x20current\x20site\x20is\x20\x22','substring','conversation_url','Executing\x20new\x20tests...','red','toLowerCase','Run\x20tests\x20for\x20an\x20LLM\x20agent','\x20-\x20','eval','\x20\x20-\x20','filter','source','Error\x20writing\x20output\x20file:\x20','tags','\x20(new)','site','✗\x20ERROR:\x20Project\x20not\x20found:\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','timestamp','\x20\x20Agent:\x20','Evaluating\x20response...','\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)','tests','tsv','\x20\x20Site:\x20','resolve','⚠\x20SKIPPED:\x20','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','push','729154KxNqto','start','7474167wtVACw','jsonl','Re-evaluating\x20cached\x20test\x20run...','utf-8','Re-evaluating\x20','forEach','reason','multiple_agents','✓\x20PASS:\x20','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','4674109WgGlpF','projectName','Duration:\x20','Project\x20path:\x20','execute','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','name','find','verbose','basename','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','join','Round\x20','ERROR','Re-evaluation\x20Summary','8SaNCWb','length','\x20\x20Round\x20','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','No\x20tests\x20found\x20with\x20tags:\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>','description','json','Usage:','Running\x20agent\x20tests...','agentName','Run\x20\x27tdx\x20agent\x20pull\x20','includes','projectDir','status','llmProject','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','test.yml','\x20\x20Project:\x20','output','Total:\x20\x20\x20\x20','Failed:\x20\x20\x20','size','Cached\x20run\x20from:\x20','yellow','Test\x20Summary','49788cpFkHW','40LFJxdG','no_context','250224UTvPDN','table','PASS','Available\x20tags:\x20','Output\x20written\x20to:\x20','427908ROqKst','Passed:\x20\x20\x20','Cached\x20run\x20is\x20from\x20site\x20\x22','New\x20tests\x20to\x20execute:\x20','Round\x201/','no_tests','testName','agent','split','\x27\x20to\x20create\x20the\x20folder\x20structure.','Conversation\x20URL:\x20','cyan','has','add','some','repeat','7190239gkIFuL','resolveAgentId','dryRun','rounds','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','isSpinning','Either\x20switch\x20to\x20the\x20\x22','...\x20','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','message','map','\x22:\x20','found','agent:test','404','text','✗\x20ERROR:\x20','now','\x20(cached)','toISOString','testYmlPath','10KjROIn','FAIL','log','white','trim','writeFileSync','agentDirs',':\x20Sending\x20user\x20input...','\x20\x20Conversation:\x20','Site:\x20','No\x20tests\x20have\x20tags\x20defined.','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','green','llm','✗\x20FAIL:\x20','28ANQmdq','executeReeval','...','Test\x20','not\x20found'];a5_0x54b5=function(){return _0x27f9ff;};return a5_0x54b5();}(function(_0x11ac80,_0x3c957b){const _0x519d3a=a5_0x27fd,_0x5e699b=_0x11ac80();while(!![]){try{const _0x3a912f=-parseInt(_0x519d3a(0x102))/0x1+parseInt(_0x519d3a(0x175))/0x2*(-parseInt(_0x519d3a(0x139))/0x3)+parseInt(_0x519d3a(0x141))/0x4+-parseInt(_0x519d3a(0x166))/0x5*(parseInt(_0x519d3a(0x13c))/0x6)+-parseInt(_0x519d3a(0x151))/0x7+parseInt(_0x519d3a(0x11e))/0x8*(parseInt(_0x519d3a(0x104))/0x9)+parseInt(_0x519d3a(0x13a))/0xa*(parseInt(_0x519d3a(0x10e))/0xb);if(_0x3a912f===_0x3c957b)break;else _0x5e699b['push'](_0x5e699b['shift']());}catch(_0x247083){_0x5e699b['push'](_0x5e699b['shift']());}}}(a5_0x54b5,0x89f29));import*as a5_0x4032fe from'node:fs';import*as a5_0x3b1a0e from'node:path';function a5_0x27fd(_0x4bf428,_0x15cdbc){_0x4bf428=_0x4bf428-0xee;const _0x54b5ba=a5_0x54b5();let _0x27fdd6=_0x54b5ba[_0x4bf428];return _0x27fdd6;}import a5_0x1a0b33 from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x3bd5f5(0x114)]=a5_0x3bd5f5(0x15e);[a5_0x3bd5f5(0x125)]=a5_0x3bd5f5(0x184);async[a5_0x3bd5f5(0x112)](_0x4b8ce3){const _0x262e87=a5_0x3bd5f5,{options:_0x44790b,args:_0x4e1fad,tdx:_0x4c564d}=_0x4b8ce3,_0x53e8bd=_0x4e1fad[0x0]||'.',_0x4caed5=_0x44790b[_0x262e87(0x153)],_0x372cef=_0x44790b,_0x494f45=_0x372cef[_0x262e87(0x186)]===![],_0x572a28=_0x372cef['reeval'],_0x461d9d=_0x372cef[_0x262e87(0x114)],_0x2df9e9=_0x372cef['tags'],_0xc184d3=_0x44790b['site'],_0x4332b3=_0x372cef[_0x262e87(0x132)];if(_0x572a28&&_0x494f45)return console[_0x262e87(0x168)](a5_0x1a0b33[_0x262e87(0x182)](_0x262e87(0x113))),0x1;let _0x2e262d=_0x262e87(0x13d);if(_0x372cef['json'])_0x2e262d=_0x262e87(0x126);else{if(_0x372cef[_0x262e87(0x105)])_0x2e262d=_0x262e87(0x105);else{if(_0x372cef[_0x262e87(0xfc)])_0x2e262d=_0x262e87(0xfc);else{if(_0x372cef['table'])_0x2e262d='table';}}}const _0x13ff91=_0x372cef[_0x262e87(0x12e)];let _0x52227e=_0x53e8bd;const _0x39331d=a5_0x4032fe['existsSync'](_0x53e8bd),_0x6b68b7=_0x53e8bd==='.';if(!_0x39331d||_0x6b68b7){const _0x7db2f8=resolveProjectFromContext(_0x53e8bd,_0x13ff91,{'requireFile':_0x262e87(0x130)});if(_0x7db2f8[_0x262e87(0x15d)])_0x52227e=_0x7db2f8[_0x262e87(0x12c)],_0x7db2f8[_0x262e87(0xf0)]==='context'&&console['log'](a5_0x1a0b33['dim']('Using\x20agent:\x20'+_0x52227e));else switch(_0x7db2f8[_0x262e87(0x10a)]){case _0x262e87(0x13b):console[_0x262e87(0x168)](a5_0x1a0b33['yellow'](_0x7db2f8[_0x262e87(0x15a)])),console[_0x262e87(0x168)](),console[_0x262e87(0x168)](_0x262e87(0x127)),console['log'](_0x262e87(0x123)),console[_0x262e87(0x168)](_0x262e87(0xfa)),console[_0x262e87(0x168)](),console[_0x262e87(0x168)](_0x262e87(0x171));return 0x1;case'no_local_folder':console[_0x262e87(0x168)](a5_0x1a0b33['yellow'](_0x7db2f8[_0x262e87(0x15a)])),console['log'](),console['log'](_0x262e87(0x12a)+_0x7db2f8['llmProject']+_0x262e87(0x14a));return 0x1;case _0x262e87(0x10b):{const _0x9c67ab=a5_0x3b1a0e[_0x262e87(0x117)](_0x7db2f8[_0x262e87(0x12c)]);console[_0x262e87(0x168)](a5_0x1a0b33[_0x262e87(0x137)]('Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22'+_0x7db2f8[_0x262e87(0x12e)]+'\x22:'));for(const _0x49e399 of _0x7db2f8[_0x262e87(0x16c)]){console[_0x262e87(0x168)](_0x262e87(0xee)+_0x49e399);}return console[_0x262e87(0x168)](),console[_0x262e87(0x168)](_0x262e87(0x10d)+_0x9c67ab+_0x262e87(0x124)),0x1;}case _0x262e87(0x146):console[_0x262e87(0x168)](a5_0x1a0b33['yellow'](_0x262e87(0x155)+_0x7db2f8[_0x262e87(0x12e)]+'\x22.')),console[_0x262e87(0x168)](a5_0x1a0b33[_0x262e87(0x17b)](_0x262e87(0x111)+_0x7db2f8[_0x262e87(0x12c)])),console[_0x262e87(0x168)](),console['log']('Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.');return 0x1;}}const {definition:_0xc63106,agentInfo:_0x522622}=parseTestFile(_0x52227e);let _0x47a65c=_0xc63106[_0x262e87(0xfb)];if(_0x461d9d){const _0x8cb8d3=_0x461d9d[_0x262e87(0x149)](',')[_0x262e87(0x15b)](_0x553037=>_0x553037['trim']());_0x47a65c=_0xc63106[_0x262e87(0xfb)][_0x262e87(0xef)](_0x4ce44f=>_0x8cb8d3[_0x262e87(0x12b)](_0x4ce44f['name']));if(_0x47a65c['length']===0x0)return console[_0x262e87(0x168)](a5_0x1a0b33[_0x262e87(0x137)]('No\x20tests\x20found\x20matching:\x20'+_0x461d9d)),console['log'](a5_0x1a0b33[_0x262e87(0x17b)]('Available\x20tests:\x20'+_0xc63106[_0x262e87(0xfb)][_0x262e87(0x15b)](_0x507d44=>_0x507d44['name'])[_0x262e87(0x11a)](',\x20'))),0x1;}if(_0x2df9e9){const _0xef9078=_0x2df9e9[_0x262e87(0x149)](',')[_0x262e87(0x15b)](_0x44dba3=>_0x44dba3[_0x262e87(0x16a)]()['toLowerCase']());_0x47a65c=_0x47a65c[_0x262e87(0xef)](_0x5d53fd=>_0x5d53fd[_0x262e87(0xf2)]?.[_0x262e87(0x14f)](_0x1a713f=>_0xef9078[_0x262e87(0x12b)](_0x1a713f[_0x262e87(0x183)]())));if(_0x47a65c[_0x262e87(0x11f)]===0x0){console[_0x262e87(0x168)](a5_0x1a0b33[_0x262e87(0x137)](_0x262e87(0x122)+_0x2df9e9));const _0xb5aae4=new Set();return _0xc63106[_0x262e87(0xfb)][_0x262e87(0x109)](_0x18e384=>_0x18e384[_0x262e87(0xf2)]?.[_0x262e87(0x109)](_0x4667cc=>_0xb5aae4[_0x262e87(0x14e)](_0x4667cc))),_0xb5aae4[_0x262e87(0x135)]>0x0?console[_0x262e87(0x168)](a5_0x1a0b33['dim'](_0x262e87(0x13f)+[..._0xb5aae4][_0x262e87(0x11a)](',\x20'))):console['log'](a5_0x1a0b33['dim'](_0x262e87(0x170))),0x1;}}if(_0x572a28)return this[_0x262e87(0x176)](_0x4b8ce3,{'definition':{'tests':_0x47a65c},'agentInfo':_0x522622,'outputFormat':_0x2e262d,'outputFile':_0x4332b3,'testNames':_0x461d9d});if(_0x4caed5){console[_0x262e87(0x168)](a5_0x1a0b33[_0x262e87(0x14c)]('Test\x20Configuration:')),console['log'](_0x262e87(0xfd)+a5_0x1a0b33[_0x262e87(0x169)](_0xc184d3)),console[_0x262e87(0x168)](_0x262e87(0x131)+a5_0x1a0b33[_0x262e87(0x169)](_0x522622[_0x262e87(0x10f)])),console[_0x262e87(0x168)](_0x262e87(0xf8)+a5_0x1a0b33['white'](_0x522622['agentName'])),console[_0x262e87(0x168)](),console[_0x262e87(0x168)]('Tests\x20found:\x20'+a5_0x1a0b33['white'](_0x47a65c[_0x262e87(0x11f)]));for(let _0xdf9ca4=0x0;_0xdf9ca4<_0x47a65c[_0x262e87(0x11f)];_0xdf9ca4++){const _0x291120=_0x47a65c[_0xdf9ca4],_0x5f3315=_0x291120[_0x262e87(0x154)][_0x262e87(0x11f)]===0x1?'round':_0x262e87(0x154),_0x2a0c07=_0x291120['tags']?.['length']?'\x20['+_0x291120[_0x262e87(0xf2)][_0x262e87(0x11a)](',\x20')+']':'';console[_0x262e87(0x168)]('\x20\x20'+(_0xdf9ca4+0x1)+'.\x20'+a5_0x1a0b33[_0x262e87(0x169)](_0x291120[_0x262e87(0x114)])+'\x20('+_0x291120['rounds'][_0x262e87(0x11f)]+'\x20'+_0x5f3315+')'+a5_0x1a0b33[_0x262e87(0x17b)](_0x2a0c07));}return 0x0;}let _0x419fee,_0x1f36ba;try{_0x419fee=await _0x4c564d['llm']['resolveProjectId'](_0x522622[_0x262e87(0x10f)]);}catch(_0x344357){const _0x48943a=_0x344357 instanceof Error?_0x344357[_0x262e87(0x15a)]:String(_0x344357);return _0x48943a['includes']('404')||_0x48943a[_0x262e87(0x183)]()[_0x262e87(0x12b)](_0x262e87(0x179))?console[_0x262e87(0x168)](a5_0x1a0b33[_0x262e87(0x182)](_0x262e87(0xf5)+_0x522622[_0x262e87(0x10f)])):console[_0x262e87(0x168)](a5_0x1a0b33[_0x262e87(0x182)](_0x262e87(0xf6)+_0x522622[_0x262e87(0x10f)]+_0x262e87(0x15c)+_0x48943a)),0x1;}try{_0x1f36ba=await _0x4c564d[_0x262e87(0x173)][_0x262e87(0x152)](_0x522622[_0x262e87(0x129)],_0x419fee);}catch(_0x5ad285){const _0x33081e=_0x5ad285 instanceof Error?_0x5ad285['message']:String(_0x5ad285);return _0x33081e[_0x262e87(0x12b)](_0x262e87(0x15f))||_0x33081e[_0x262e87(0x183)]()[_0x262e87(0x12b)](_0x262e87(0x179))?console[_0x262e87(0x168)](a5_0x1a0b33['red'](_0x262e87(0x100)+_0x522622[_0x262e87(0x129)])):console['log'](a5_0x1a0b33['red']('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22'+_0x522622['agentName']+_0x262e87(0x15c)+_0x33081e)),0x1;}let _0x232783;if(!_0x494f45)try{_0x232783=await setupEvaluatorAgent(_0x4c564d[_0x262e87(0x173)],_0x44790b['verbose']);}catch(_0x57b300){const _0x420d3c=_0x57b300 instanceof Error?_0x57b300[_0x262e87(0x15a)]:String(_0x57b300);return console[_0x262e87(0x168)](a5_0x1a0b33[_0x262e87(0x182)](_0x262e87(0x17d)+_0x420d3c)),0x1;}console[_0x262e87(0x168)](a5_0x1a0b33[_0x262e87(0x14c)](_0x262e87(0x128))),console[_0x262e87(0x168)](_0x262e87(0x16f)+a5_0x1a0b33[_0x262e87(0x169)](_0xc184d3)),console[_0x262e87(0x168)]('Agent:\x20'+a5_0x1a0b33['white'](_0x522622[_0x262e87(0x10f)]+'/'+_0x522622['agentName'])),console['log']();const _0x14eab1=[],_0xdf1497=[],_0x460b2a=Date[_0x262e87(0x162)]();for(let _0x406b21=0x0;_0x406b21<_0x47a65c['length'];_0x406b21++){const _0x1526a3=_0x47a65c[_0x406b21];_0x47a65c[_0x262e87(0x11f)]>0x1?console[_0x262e87(0x168)](_0x262e87(0x178)+(_0x406b21+0x1)+'/'+_0x47a65c['length']+':\x20'+a5_0x1a0b33['white'](_0x1526a3[_0x262e87(0x114)])):console[_0x262e87(0x168)]('Running\x20test:\x20'+a5_0x1a0b33['white'](_0x1526a3[_0x262e87(0x114)]));const _0x5354d9=createCommandSpinner(_0x262e87(0x145)+_0x1526a3['rounds'][_0x262e87(0x11f)]+':\x20Sending\x20user\x20input...');_0x5354d9[_0x262e87(0x103)]();try{const {result:_0xefd02b,conversation:_0x13c055}=await runTest(_0x4c564d[_0x262e87(0x173)],_0x1526a3,{'agentId':_0x1f36ba,'projectId':_0x419fee,'site':_0xc184d3,'noEval':_0x494f45,'evaluatorId':_0x232783,'onRoundStart':(_0x54f629,_0x4441a7)=>{const _0x5d7147=_0x262e87;_0x5354d9[_0x5d7147(0x160)]=_0x5d7147(0x11b)+(_0x54f629+0x1)+'/'+_0x4441a7+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x50a9e1,_0x1f959f,_0x47e8cf)=>{const _0x184179=_0x262e87,_0x12954c=formatElapsed(_0x1f959f);_0x47e8cf?console[_0x184179(0x168)](_0x184179(0x120)+(_0x50a9e1+0x1)+'/'+_0x1526a3[_0x184179(0x154)][_0x184179(0x11f)]+_0x184179(0x158)+a5_0x1a0b33[_0x184179(0x172)]('✓')+'\x20('+_0x12954c+')'):console[_0x184179(0x168)]('\x20\x20Round\x20'+(_0x50a9e1+0x1)+'/'+_0x1526a3[_0x184179(0x154)][_0x184179(0x11f)]+'...\x20'+a5_0x1a0b33[_0x184179(0x182)]('✗'));},'onEvaluationStart':()=>{const _0x14d1da=_0x262e87;_0x5354d9[_0x14d1da(0x160)]=_0x14d1da(0xf9);},'onEvaluationComplete':_0x4224d8=>{const _0x13a2e4=_0x262e87,_0xd0c9ad=formatElapsed(_0x4224d8);console[_0x13a2e4(0x168)](_0x13a2e4(0x17a)+a5_0x1a0b33[_0x13a2e4(0x172)]('✓')+'\x20('+_0xd0c9ad+')');}});_0x5354d9[_0x262e87(0x17c)](),_0x14eab1['push'](_0xefd02b),_0xdf1497['push'](_0x13c055);if(_0xefd02b['status']===_0x262e87(0x13e))console[_0x262e87(0x168)](a5_0x1a0b33['green'](_0x262e87(0x10c)+_0xefd02b[_0x262e87(0x10a)]));else _0xefd02b[_0x262e87(0x12d)]===_0x262e87(0x167)?console['log'](a5_0x1a0b33[_0x262e87(0x182)]('✗\x20FAIL:\x20'+_0xefd02b['reason'])):console[_0x262e87(0x168)](a5_0x1a0b33['red']('✗\x20ERROR:\x20'+_0xefd02b[_0x262e87(0x10a)]));_0xefd02b['conversation_url']&&console['log'](a5_0x1a0b33['dim'](_0x262e87(0x14b)+_0xefd02b['conversation_url'])),console[_0x262e87(0x168)]();}catch(_0x6ff214){_0x5354d9['stop']();const _0x353320=_0x6ff214 instanceof Error?_0x6ff214[_0x262e87(0x15a)]:String(_0x6ff214);console[_0x262e87(0x168)](a5_0x1a0b33['red']('✗\x20ERROR:\x20'+_0x353320)),console['log'](),_0x14eab1['push']({'name':_0x1526a3[_0x262e87(0x114)],'status':_0x262e87(0x11c),'reason':_0x353320,'timestamp':new Date()[_0x262e87(0x164)](),'duration_ms':0x0});}}const _0x3ac299=Date[_0x262e87(0x162)]()-_0x460b2a,_0x5712ba=_0x14eab1[_0x262e87(0xef)](_0x1ea06c=>_0x1ea06c[_0x262e87(0x12d)]===_0x262e87(0x13e))[_0x262e87(0x11f)],_0x1391e0=_0x14eab1[_0x262e87(0xef)](_0x17a8b8=>_0x17a8b8[_0x262e87(0x12d)]===_0x262e87(0x167))[_0x262e87(0x11f)],_0x5ecc98=_0x14eab1[_0x262e87(0xef)](_0x44c7de=>_0x44c7de[_0x262e87(0x12d)]==='ERROR')[_0x262e87(0x11f)];console[_0x262e87(0x168)]('━'[_0x262e87(0x150)](0x3c)),console[_0x262e87(0x168)](_0x262e87(0x138)),console[_0x262e87(0x168)]('━'[_0x262e87(0x150)](0x3c)),console[_0x262e87(0x168)](_0x262e87(0x133)+_0x14eab1['length']),console['log']('Passed:\x20\x20\x20'+a5_0x1a0b33[_0x262e87(0x172)](_0x5712ba)),console[_0x262e87(0x168)](_0x262e87(0x134)+a5_0x1a0b33[_0x262e87(0x182)](_0x1391e0));_0x5ecc98>0x0&&console[_0x262e87(0x168)]('Errors:\x20\x20\x20'+a5_0x1a0b33[_0x262e87(0x182)](_0x5ecc98));console[_0x262e87(0x168)]('Duration:\x20'+formatElapsed(_0x3ac299)),console['log']('━'['repeat'](0x3c));const _0x525e7e=_0x14eab1[_0x262e87(0xef)](_0x10a22f=>_0x10a22f['status']!==_0x262e87(0x13e));if(_0x525e7e[_0x262e87(0x11f)]>0x0){console['log'](),console[_0x262e87(0x168)]('Failed\x20Tests:');for(const _0x439482 of _0x525e7e){const _0x21f708=a5_0x1a0b33[_0x262e87(0x182)]('✗'),_0x52ad01=_0x439482[_0x262e87(0x10a)]['length']>0x32?_0x439482[_0x262e87(0x10a)][_0x262e87(0x17f)](0x0,0x32)+_0x262e87(0x177):_0x439482[_0x262e87(0x10a)];console['log']('\x20\x20'+_0x21f708+'\x20'+_0x439482[_0x262e87(0x114)]+':\x20'+_0x52ad01);}}const _0x301aba={'summary':{'total':_0x14eab1['length'],'passed':_0x5712ba,'failed':_0x1391e0,'errors':_0x5ecc98>0x0?_0x5ecc98:undefined,'duration_ms':_0x3ac299},'tests':_0x14eab1,'agent':{'project':_0x522622[_0x262e87(0x10f)],'name':_0x522622[_0x262e87(0x129)],'site':_0xc184d3},'timestamp':new Date(_0x460b2a)[_0x262e87(0x164)]()};try{const _0x51cc9f=buildCachedTestRun(_0xdf1497,{'site':_0xc184d3,'projectId':_0x419fee,'projectName':_0x522622[_0x262e87(0x10f)],'agentId':_0x1f36ba,'agentName':_0x522622['agentName'],'testYmlPath':a5_0x3b1a0e[_0x262e87(0xfe)](_0x522622[_0x262e87(0x165)])});saveLastTestRun(_0x51cc9f);}catch{}if(_0x2e262d!==_0x262e87(0x13d)||_0x4332b3){const _0x5e8543=formatResults(_0x301aba,_0x2e262d);if(_0x4332b3)try{a5_0x4032fe[_0x262e87(0x16b)](_0x4332b3,_0x5e8543,_0x262e87(0x107)),console[_0x262e87(0x168)](),console[_0x262e87(0x168)](a5_0x1a0b33[_0x262e87(0x17b)](_0x262e87(0x140)+_0x4332b3));}catch(_0x190bc2){return console['log'](),console['log'](a5_0x1a0b33[_0x262e87(0x182)](_0x262e87(0xf1)+_0x190bc2)),0x1;}else console[_0x262e87(0x168)](),console[_0x262e87(0x168)](_0x5e8543);}return _0x525e7e[_0x262e87(0x11f)]>0x0?0x1:0x0;}async['executeReeval'](_0xf18d10,_0xe1d344){const _0x4b4888=a5_0x3bd5f5,{options:_0x315d6c,tdx:_0x45673f}=_0xf18d10,{definition:_0x2807be,agentInfo:_0x35864c,outputFormat:_0x3e03cd,outputFile:_0x248375}=_0xe1d344,_0x523bd9=_0x315d6c[_0x4b4888(0xf4)],_0x25f637=loadLastTestRun();if(!_0x25f637)return console['log'](a5_0x1a0b33[_0x4b4888(0x182)]('Error:\x20No\x20previous\x20test\x20run\x20found.')),console[_0x4b4888(0x168)](a5_0x1a0b33[_0x4b4888(0x17b)](_0x4b4888(0x118))),0x1;if(_0x25f637[_0x4b4888(0x148)]['agentName']!==_0x35864c[_0x4b4888(0x129)])return console['log'](a5_0x1a0b33[_0x4b4888(0x182)]('Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22'+_0x25f637[_0x4b4888(0x148)][_0x4b4888(0x129)]+'\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22'+_0x35864c['agentName']+'\x22.')),console[_0x4b4888(0x168)](a5_0x1a0b33['dim'](_0x4b4888(0x12f))),0x1;const _0x4adb54=new Set(_0x25f637['conversations'][_0x4b4888(0x15b)](_0x56d853=>_0x56d853[_0x4b4888(0x147)])),_0x727e8d=_0x2807be[_0x4b4888(0xfb)]['filter'](_0x495981=>!_0x4adb54[_0x4b4888(0x14d)](_0x495981[_0x4b4888(0x114)]));if(_0x727e8d[_0x4b4888(0x11f)]>0x0&&_0x25f637['site']!==_0x523bd9)return console[_0x4b4888(0x168)](a5_0x1a0b33['red'](_0x4b4888(0x159))),console['log'](a5_0x1a0b33[_0x4b4888(0x17b)](_0x4b4888(0x143)+_0x25f637[_0x4b4888(0xf4)]+_0x4b4888(0x17e)+_0x523bd9+'\x22.')),console[_0x4b4888(0x168)](a5_0x1a0b33[_0x4b4888(0x17b)](_0x4b4888(0x157)+_0x25f637[_0x4b4888(0xf4)]+_0x4b4888(0x121))),0x1;const _0x7eb82b=_0x2807be[_0x4b4888(0xfb)]['filter'](_0x336280=>_0x4adb54['has'](_0x336280['name'])),_0x30b92f=_0x727e8d;let _0xdcd3a8;try{_0xdcd3a8=await setupEvaluatorAgent(_0x45673f[_0x4b4888(0x173)],_0x315d6c[_0x4b4888(0x116)]);}catch(_0x17bd79){const _0x147ff9=_0x17bd79 instanceof Error?_0x17bd79[_0x4b4888(0x15a)]:String(_0x17bd79);return console['log'](a5_0x1a0b33['red']('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x147ff9)),0x1;}console['log'](a5_0x1a0b33[_0x4b4888(0x14c)](_0x4b4888(0x106))),console[_0x4b4888(0x168)](_0x4b4888(0x136)+a5_0x1a0b33[_0x4b4888(0x169)](_0x25f637[_0x4b4888(0xf7)])),console[_0x4b4888(0x168)]('Agent:\x20'+a5_0x1a0b33[_0x4b4888(0x169)](_0x25f637[_0x4b4888(0x148)][_0x4b4888(0x10f)]+'/'+_0x25f637[_0x4b4888(0x148)]['agentName']));_0x30b92f[_0x4b4888(0x11f)]>0x0&&console[_0x4b4888(0x168)](_0x4b4888(0x144)+a5_0x1a0b33['yellow'](_0x30b92f['length']));console[_0x4b4888(0x168)]();const _0x314a54=[],_0xa789bc=Date[_0x4b4888(0x162)](),_0x5c22bc=createCommandSpinner('Re-evaluating...');if(_0x7eb82b[_0x4b4888(0x11f)]>0x0)try{const _0xc29f9c=await reevaluateFromCache(_0x45673f[_0x4b4888(0x173)],_0x25f637,{'tests':_0x7eb82b},{'evaluatorId':_0xdcd3a8,'onTestStart':(_0x5a42b2,_0x4ab3d8,_0x23b095)=>{const _0x4bb6ad=_0x4b4888;_0x5c22bc[_0x4bb6ad(0x160)]=_0x4bb6ad(0x108)+(_0x4ab3d8+0x1)+'/'+_0x23b095+':\x20'+_0x5a42b2+'...';if(!_0x5c22bc[_0x4bb6ad(0x156)])_0x5c22bc[_0x4bb6ad(0x103)]();},'onTestComplete':(_0x2a8a9e,_0x9ccd0f)=>{const _0x11e7af=_0x4b4888;_0x5c22bc[_0x11e7af(0x17c)]();if(_0x9ccd0f['status']===_0x11e7af(0x13e))console['log'](a5_0x1a0b33['green'](_0x11e7af(0x10c)+_0x2a8a9e)+a5_0x1a0b33[_0x11e7af(0x17b)]('\x20(cached)'));else _0x9ccd0f[_0x11e7af(0x12d)]===_0x11e7af(0x167)?console[_0x11e7af(0x168)](a5_0x1a0b33[_0x11e7af(0x182)](_0x11e7af(0x174)+_0x2a8a9e+_0x11e7af(0x185)+_0x9ccd0f[_0x11e7af(0x10a)])+a5_0x1a0b33[_0x11e7af(0x17b)](_0x11e7af(0x163))):console['log'](a5_0x1a0b33[_0x11e7af(0x182)](_0x11e7af(0x161)+_0x2a8a9e+_0x11e7af(0x185)+_0x9ccd0f[_0x11e7af(0x10a)]));_0x9ccd0f[_0x11e7af(0x180)]&&console[_0x11e7af(0x168)](a5_0x1a0b33[_0x11e7af(0x17b)](_0x11e7af(0x16e)+_0x9ccd0f[_0x11e7af(0x180)])),_0x314a54[_0x11e7af(0x101)](_0x9ccd0f);},'onTestSkipped':(_0x3fe5f6,_0x5e621d)=>{const _0x4e6f4d=_0x4b4888;_0x5c22bc[_0x4e6f4d(0x17c)](),console[_0x4e6f4d(0x168)](a5_0x1a0b33[_0x4e6f4d(0x137)](_0x4e6f4d(0xff)+_0x3fe5f6+_0x4e6f4d(0x185)+_0x5e621d));}});for(const _0x1b2f77 of _0xc29f9c){!_0x314a54[_0x4b4888(0x115)](_0x330aed=>_0x330aed[_0x4b4888(0x114)]===_0x1b2f77[_0x4b4888(0x114)])&&_0x314a54[_0x4b4888(0x101)](_0x1b2f77);}}catch(_0x497024){_0x5c22bc[_0x4b4888(0x17c)]();const _0x94ea9b=_0x497024 instanceof Error?_0x497024[_0x4b4888(0x15a)]:String(_0x497024);return console[_0x4b4888(0x168)](a5_0x1a0b33[_0x4b4888(0x182)](_0x4b4888(0x119)+_0x94ea9b)),0x1;}_0x5c22bc[_0x4b4888(0x17c)]();if(_0x30b92f[_0x4b4888(0x11f)]>0x0){console[_0x4b4888(0x168)](),console[_0x4b4888(0x168)](a5_0x1a0b33[_0x4b4888(0x14c)](_0x4b4888(0x181)));const {projectId:_0x17fc08,agentId:_0x22f3ef}=_0x25f637['agent'];for(const _0x40d61c of _0x30b92f){console[_0x4b4888(0x168)]('Running:\x20'+a5_0x1a0b33['white'](_0x40d61c['name']));const _0x1db253=createCommandSpinner(_0x4b4888(0x145)+_0x40d61c[_0x4b4888(0x154)][_0x4b4888(0x11f)]+_0x4b4888(0x16d));_0x1db253[_0x4b4888(0x103)]();try{const {result:_0x4cc56e}=await runTest(_0x45673f[_0x4b4888(0x173)],_0x40d61c,{'agentId':_0x22f3ef,'projectId':_0x17fc08,'site':_0x25f637[_0x4b4888(0xf4)],'noEval':![],'evaluatorId':_0xdcd3a8,'onRoundStart':(_0x1c9b1c,_0x1ef88b)=>{const _0x441967=_0x4b4888;_0x1db253[_0x441967(0x160)]=_0x441967(0x11b)+(_0x1c9b1c+0x1)+'/'+_0x1ef88b+_0x441967(0x16d);},'onRoundComplete':(_0xa75433,_0xa5e03a,_0xbe5dac)=>{const _0xbf1f7d=_0x4b4888,_0x5d5d41=formatElapsed(_0xa5e03a);_0xbe5dac?console[_0xbf1f7d(0x168)](_0xbf1f7d(0x120)+(_0xa75433+0x1)+'/'+_0x40d61c[_0xbf1f7d(0x154)][_0xbf1f7d(0x11f)]+_0xbf1f7d(0x158)+a5_0x1a0b33[_0xbf1f7d(0x172)]('✓')+'\x20('+_0x5d5d41+')'):console[_0xbf1f7d(0x168)](_0xbf1f7d(0x120)+(_0xa75433+0x1)+'/'+_0x40d61c[_0xbf1f7d(0x154)]['length']+_0xbf1f7d(0x158)+a5_0x1a0b33[_0xbf1f7d(0x182)]('✗'));},'onEvaluationStart':()=>{const _0x2a48af=_0x4b4888;_0x1db253[_0x2a48af(0x160)]=_0x2a48af(0xf9);},'onEvaluationComplete':_0x6c9260=>{const _0xf213d7=_0x4b4888,_0x1bc8b7=formatElapsed(_0x6c9260);console[_0xf213d7(0x168)](_0xf213d7(0x17a)+a5_0x1a0b33[_0xf213d7(0x172)]('✓')+'\x20('+_0x1bc8b7+')');}});_0x1db253[_0x4b4888(0x17c)](),_0x314a54[_0x4b4888(0x101)](_0x4cc56e);if(_0x4cc56e[_0x4b4888(0x12d)]===_0x4b4888(0x13e))console[_0x4b4888(0x168)](a5_0x1a0b33['green'](_0x4b4888(0x10c)+_0x4cc56e[_0x4b4888(0x10a)])+a5_0x1a0b33[_0x4b4888(0x17b)](_0x4b4888(0xf3)));else _0x4cc56e['status']==='FAIL'?console[_0x4b4888(0x168)](a5_0x1a0b33['red']('✗\x20FAIL:\x20'+_0x4cc56e[_0x4b4888(0x10a)])+a5_0x1a0b33[_0x4b4888(0x17b)]('\x20(new)')):console['log'](a5_0x1a0b33[_0x4b4888(0x182)](_0x4b4888(0x161)+_0x4cc56e[_0x4b4888(0x10a)]));_0x4cc56e[_0x4b4888(0x180)]&&console[_0x4b4888(0x168)](a5_0x1a0b33['dim'](_0x4b4888(0x16e)+_0x4cc56e[_0x4b4888(0x180)]));}catch(_0x43c76e){_0x1db253[_0x4b4888(0x17c)]();const _0x4b9a17=_0x43c76e instanceof Error?_0x43c76e['message']:String(_0x43c76e);console[_0x4b4888(0x168)](a5_0x1a0b33[_0x4b4888(0x182)](_0x4b4888(0x161)+_0x4b9a17)),_0x314a54[_0x4b4888(0x101)]({'name':_0x40d61c[_0x4b4888(0x114)],'status':'ERROR','reason':_0x4b9a17,'timestamp':new Date()[_0x4b4888(0x164)](),'duration_ms':0x0});}}}console[_0x4b4888(0x168)]();const _0x576f41=Date[_0x4b4888(0x162)]()-_0xa789bc,_0x4298bb=_0x314a54['filter'](_0x19880d=>_0x19880d[_0x4b4888(0x12d)]===_0x4b4888(0x13e))[_0x4b4888(0x11f)],_0x32e07f=_0x314a54[_0x4b4888(0xef)](_0x392be4=>_0x392be4[_0x4b4888(0x12d)]===_0x4b4888(0x167))[_0x4b4888(0x11f)],_0x3f5b19=_0x314a54[_0x4b4888(0xef)](_0x417d39=>_0x417d39['status']==='ERROR')['length'];console[_0x4b4888(0x168)]('━'[_0x4b4888(0x150)](0x3c)),console[_0x4b4888(0x168)](_0x4b4888(0x11d)),console[_0x4b4888(0x168)]('━'[_0x4b4888(0x150)](0x3c)),console['log']('Total:\x20\x20\x20\x20'+_0x314a54[_0x4b4888(0x11f)]),console['log'](_0x4b4888(0x142)+a5_0x1a0b33[_0x4b4888(0x172)](_0x4298bb)),console[_0x4b4888(0x168)]('Failed:\x20\x20\x20'+a5_0x1a0b33[_0x4b4888(0x182)](_0x32e07f));_0x3f5b19>0x0&&console['log']('Errors:\x20\x20\x20'+a5_0x1a0b33[_0x4b4888(0x182)](_0x3f5b19));console[_0x4b4888(0x168)](_0x4b4888(0x110)+formatElapsed(_0x576f41)),console[_0x4b4888(0x168)]('━'[_0x4b4888(0x150)](0x3c));const _0x4a8ad7={'summary':{'total':_0x314a54['length'],'passed':_0x4298bb,'failed':_0x32e07f,'errors':_0x3f5b19>0x0?_0x3f5b19:undefined,'duration_ms':_0x576f41},'tests':_0x314a54,'agent':{'project':_0x35864c[_0x4b4888(0x10f)],'name':_0x35864c[_0x4b4888(0x129)],'site':_0x523bd9},'timestamp':new Date(_0xa789bc)[_0x4b4888(0x164)]()};if(_0x3e03cd!==_0x4b4888(0x13d)||_0x248375){const _0x43e7c5=formatResults(_0x4a8ad7,_0x3e03cd);if(_0x248375)try{a5_0x4032fe[_0x4b4888(0x16b)](_0x248375,_0x43e7c5,_0x4b4888(0x107)),console['log'](),console[_0x4b4888(0x168)](a5_0x1a0b33[_0x4b4888(0x17b)](_0x4b4888(0x140)+_0x248375));}catch(_0x5c04f0){return console['log'](),console[_0x4b4888(0x168)](a5_0x1a0b33['red'](_0x4b4888(0xf1)+_0x5c04f0)),0x1;}else console[_0x4b4888(0x168)](),console[_0x4b4888(0x168)](_0x43e7c5);}const _0x459be3=_0x314a54['filter'](_0x462be7=>_0x462be7['status']!==_0x4b4888(0x13e));return _0x459be3[_0x4b4888(0x11f)]>0x0?0x1:0x0;}}
@@ -1 +1 @@
1
- const a6_0x4a8e96=a6_0x1907;(function(_0x2d56e3,_0x3a6f45){const _0x102e35=a6_0x1907,_0x10ed1e=_0x2d56e3();while(!![]){try{const _0x19605b=parseInt(_0x102e35(0x1d1))/0x1+-parseInt(_0x102e35(0x1db))/0x2*(-parseInt(_0x102e35(0x1ec))/0x3)+parseInt(_0x102e35(0x1c4))/0x4+-parseInt(_0x102e35(0x200))/0x5+parseInt(_0x102e35(0x1ea))/0x6+-parseInt(_0x102e35(0x203))/0x7+parseInt(_0x102e35(0x1de))/0x8*(parseInt(_0x102e35(0x1f3))/0x9);if(_0x19605b===_0x3a6f45)break;else _0x10ed1e['push'](_0x10ed1e['shift']());}catch(_0x22758d){_0x10ed1e['push'](_0x10ed1e['shift']());}}}(a6_0x3958,0x513ac));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';function a6_0x1907(_0x3e9173,_0x20e053){_0x3e9173=_0x3e9173-0x1c3;const _0x3958c5=a6_0x3958();let _0x19076e=_0x3958c5[_0x3e9173];return _0x19076e;}import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';function a6_0x3958(){const _0x5c4d8d=['set-cookie','2475158VTwGeF','verbose','cdp','execute','llm','llm-proxy','199956fPxoEQ','entries','x-trino-user','color','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','data','type','has','api','description','header','\x0aStack\x20trace:\x0a','length','386042aTOKmu','indexOf','readBodyFromFile','toLowerCase','trino','name','includes','stack','set-cookie2','\x22.\x20','1712whAWBu','output','join','321848lhchij','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','site','Error:\x20','request','cookie','PUT','GET','proxy-authorization','authorization','substring','message','1565172efDOVT','Results\x20saved\x20to\x20','1383dXTdim','Invalid\x20HTTP\x20method:\x20','POST','headers','Endpoint\x20must\x20start\x20with\x20/:\x20','startsWith','.\x20Valid\x20types:\x20','9SOMuqy','toUpperCase','.\x20Valid\x20methods:\x20','Invalid\x20header\x20format:\x20\x22','file','keys','validate','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','<\x20HTTP/1.1\x20','error','PATCH','x-auth-token','method','2227150rcJXvS','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.'];a6_0x3958=function(){return _0x5c4d8d;};return a6_0x3958();}import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a6_0x4a8e96(0x1e7),a6_0x4a8e96(0x1e6),a6_0x4a8e96(0x1e3),a6_0x4a8e96(0x202),a6_0x4a8e96(0x1d9),'x-xsrf-token',a6_0x4a8e96(0x1fe),a6_0x4a8e96(0x1c6)]);function isSensitiveHeader(_0x5048c8){const _0x10e564=a6_0x4a8e96;return SENSITIVE_HEADERS[_0x10e564(0x1cb)](_0x5048c8[_0x10e564(0x1d4)]());}function parseHeader(_0x30853c){const _0x4534ce=a6_0x4a8e96,_0x296aa1=_0x30853c[_0x4534ce(0x1d2)](':');if(_0x296aa1===-0x1)throw new Error(_0x4534ce(0x1f6)+_0x30853c+_0x4534ce(0x1da)+_0x4534ce(0x1df));const _0x27367d=_0x30853c[_0x4534ce(0x1e8)](0x0,_0x296aa1)['trim'](),_0x52cd7b=_0x30853c[_0x4534ce(0x1e8)](_0x296aa1+0x1)['trim']();if(!_0x27367d)throw new Error(_0x4534ce(0x1fa)+_0x30853c+'\x22');return[_0x27367d,_0x52cd7b];}export class ApiCommand extends BaseCommand{[a6_0x4a8e96(0x1d6)]=a6_0x4a8e96(0x1cc);[a6_0x4a8e96(0x1cd)]='Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs';[a6_0x4a8e96(0x1f9)](_0x1c1963){const _0xabd8d9=a6_0x4a8e96,{args:_0x121122,options:_0x194569}=_0x1c1963,_0x493a03=_0x194569;if(_0x121122['length']===0x0)return _0xabd8d9(0x1c8);const _0x2593bf=_0x121122[0x0];if(!_0x2593bf[_0xabd8d9(0x1f1)]('/'))return _0xabd8d9(0x1f0)+_0x2593bf;const _0x35aedf=_0x493a03[_0xabd8d9(0x1c9)],_0x2198b6=_0x493a03[_0xabd8d9(0x1f7)];if(_0x35aedf&&_0x2198b6)return _0xabd8d9(0x201);const _0x4157cd=_0x493a03[_0xabd8d9(0x1ff)]||_0xabd8d9(0x1e5),_0x1669fb=[_0xabd8d9(0x1e5),_0xabd8d9(0x1ee),_0xabd8d9(0x1e4),'DELETE',_0xabd8d9(0x1fd)];if(!_0x1669fb[_0xabd8d9(0x1d7)](_0x4157cd['toUpperCase']()))return _0xabd8d9(0x1ed)+_0x4157cd+_0xabd8d9(0x1f5)+_0x1669fb[_0xabd8d9(0x1dd)](',\x20');const _0x279300=_0x493a03[_0xabd8d9(0x1ca)]||'td',_0x4836f1=['td',_0xabd8d9(0x205),'workflow',_0xabd8d9(0x1d5),_0xabd8d9(0x207),_0xabd8d9(0x1c3)];if(!_0x4836f1['includes'](_0x279300))return'Invalid\x20API\x20type:\x20'+_0x279300+_0xabd8d9(0x1f2)+_0x4836f1[_0xabd8d9(0x1dd)](',\x20');return undefined;}async[a6_0x4a8e96(0x206)](_0x4ad058){const _0x148752=a6_0x4a8e96,{options:_0x27c33d,args:_0x1e0b6b,tdx:_0x28ca4f}=_0x4ad058,_0xe7cf2c=_0x27c33d,_0x292685=_0x1e0b6b[0x0],_0x787503=(_0xe7cf2c['method']||_0x148752(0x1e5))[_0x148752(0x1f4)](),_0x468cd8=_0xe7cf2c[_0x148752(0x1c9)],_0x1eee9f=_0xe7cf2c[_0x148752(0x1f7)],_0x814816=_0xe7cf2c[_0x148752(0x1ce)],_0x312c62=_0xe7cf2c[_0x148752(0x1ca)]||'td';try{const _0x852ff0={};if(_0x814816){const _0x4c3fbf=Array['isArray'](_0x814816)?_0x814816:[_0x814816];for(const _0x1e4882 of _0x4c3fbf){const [_0x1d2bab,_0x50ffec]=parseHeader(_0x1e4882);_0x852ff0[_0x1d2bab]=_0x50ffec;}}let _0x36abb8;if(_0x468cd8)_0x36abb8=_0x468cd8;else{if(_0x1eee9f)try{_0x36abb8=RawAPI[_0x148752(0x1d3)](_0x1eee9f);}catch(_0x1f102d){return console['error']('Error:\x20'+(_0x1f102d instanceof Error?_0x1f102d['message']:String(_0x1f102d))),0x1;}}const _0x32671f={'method':_0x787503,'apiType':_0x312c62,'includeHeaders':_0x27c33d[_0x148752(0x204)]};_0x36abb8&&(_0x32671f['body']=_0x36abb8);Object[_0x148752(0x1f8)](_0x852ff0)[_0x148752(0x1d0)]>0x0&&(_0x32671f[_0x148752(0x1ef)]=_0x852ff0);if(_0x27c33d[_0x148752(0x204)]){const _0x89dd0b=resolveSite(_0x27c33d[_0x148752(0x1e0)]),_0x256e3f=getEndpoint(_0x89dd0b,_0x312c62),_0x2ce416=''+_0x256e3f+_0x292685;console[_0x148752(0x1fc)]('>\x20'+_0x787503+'\x20'+_0x2ce416);const _0x3ebb60=getAuthHeaders(_0x89dd0b),_0x341846={..._0x3ebb60,..._0x852ff0};for(const [_0x5aa104,_0x43a06c]of Object['entries'](_0x341846)){!isSensitiveHeader(_0x5aa104)&&console[_0x148752(0x1fc)]('>\x20'+_0x5aa104+':\x20'+_0x43a06c);}_0x36abb8&&console[_0x148752(0x1fc)]('>'),console[_0x148752(0x1fc)]('');}const _0xf917c5=await _0x28ca4f[_0x148752(0x1cc)][_0x148752(0x1e2)](_0x292685,_0x32671f);if(_0x27c33d['verbose']&&_0xf917c5[_0x148752(0x1ef)]){console[_0x148752(0x1fc)](_0x148752(0x1fb)+_0xf917c5['status']);for(const [_0x4d9dda,_0x24d318]of Object[_0x148752(0x1c5)](_0xf917c5[_0x148752(0x1ef)])){!isSensitiveHeader(_0x4d9dda)&&console['error']('<\x20'+_0x4d9dda+':\x20'+_0x24d318);}console[_0x148752(0x1fc)]('');}const _0x53b1ad=Boolean(_0x27c33d[_0x148752(0x1dc)]),_0x4f92a4={'color':_0x27c33d[_0x148752(0x1c7)],'noColor':_0x27c33d['noColor']||_0x53b1ad&&!_0x27c33d[_0x148752(0x1c7)]},_0x29f148=colorizeJSON(_0xf917c5[_0x148752(0x1c9)],_0x4f92a4);return _0x27c33d[_0x148752(0x1dc)]?(writeFileSync(_0x27c33d['output'],_0x29f148),console['error'](_0x148752(0x1eb)+_0x27c33d['output'])):console['log'](_0x29f148),0x0;}catch(_0x2af081){return _0x2af081 instanceof Error?(console[_0x148752(0x1fc)](_0x148752(0x1e1)+_0x2af081[_0x148752(0x1e9)]),_0x27c33d[_0x148752(0x204)]&&_0x2af081[_0x148752(0x1d8)]&&console[_0x148752(0x1fc)](_0x148752(0x1cf)+_0x2af081[_0x148752(0x1d8)])):console[_0x148752(0x1fc)]('Error:\x20'+String(_0x2af081)),0x1;}}}
1
+ const a6_0x2e5367=a6_0x5522;(function(_0x7b8e88,_0xb50035){const _0xef638c=a6_0x5522,_0xa074de=_0x7b8e88();while(!![]){try{const _0x1c4f37=parseInt(_0xef638c(0xf0))/0x1*(parseInt(_0xef638c(0xdd))/0x2)+-parseInt(_0xef638c(0xba))/0x3+-parseInt(_0xef638c(0xee))/0x4+parseInt(_0xef638c(0xd7))/0x5+parseInt(_0xef638c(0xb6))/0x6*(-parseInt(_0xef638c(0xc9))/0x7)+parseInt(_0xef638c(0xc4))/0x8+parseInt(_0xef638c(0xb8))/0x9*(parseInt(_0xef638c(0xbc))/0xa);if(_0x1c4f37===_0xb50035)break;else _0xa074de['push'](_0xa074de['shift']());}catch(_0x1d3e73){_0xa074de['push'](_0xa074de['shift']());}}}(a6_0x2216,0x9ecb5));function a6_0x2216(){const _0x4a9094=['validate','818308yTgLsi','indexOf','670069kQCWbx','PUT','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','PATCH','Invalid\x20HTTP\x20method:\x20','14718edRdZa','POST','81mYVBwY','noColor','2851170RyUxRE','isArray','1075080SDLpaw','.\x20Valid\x20methods:\x20','trino','startsWith','error','api','file','includes','5580480PsMWop','DELETE','output','data','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','2261Czicmp','message','join','verbose','description','site','Endpoint\x20must\x20start\x20with\x20/:\x20','length','proxy-authorization','method','llm-proxy','headers','Error:\x20','keys','1312530KkYfEZ','cookie','toUpperCase','stack','set-cookie','x-auth-token','2SWWiQL','workflow','substring','GET','color','readBodyFromFile','\x0aStack\x20trace:\x0a','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','Invalid\x20header\x20format:\x20\x22','trim','x-xsrf-token','.\x20Valid\x20types:\x20','name','set-cookie2','entries','body'];a6_0x2216=function(){return _0x4a9094;};return a6_0x2216();}import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set(['authorization',a6_0x2e5367(0xd1),a6_0x2e5367(0xd8),a6_0x2e5367(0xdb),a6_0x2e5367(0xea),a6_0x2e5367(0xe7),a6_0x2e5367(0xdc),'x-trino-user']);function a6_0x5522(_0x50a598,_0x5aa4ad){_0x50a598=_0x50a598-0xb6;const _0x221662=a6_0x2216();let _0x552266=_0x221662[_0x50a598];return _0x552266;}function isSensitiveHeader(_0x201a6c){return SENSITIVE_HEADERS['has'](_0x201a6c['toLowerCase']());}function parseHeader(_0x442ae0){const _0x16473a=a6_0x2e5367,_0x58b1df=_0x442ae0[_0x16473a(0xef)](':');if(_0x58b1df===-0x1)throw new Error(_0x16473a(0xe5)+_0x442ae0+'\x22.\x20'+'Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22');const _0x1e73f2=_0x442ae0[_0x16473a(0xdf)](0x0,_0x58b1df)[_0x16473a(0xe6)](),_0x1f55a1=_0x442ae0['substring'](_0x58b1df+0x1)[_0x16473a(0xe6)]();if(!_0x1e73f2)throw new Error(_0x16473a(0xf2)+_0x442ae0+'\x22');return[_0x1e73f2,_0x1f55a1];}export class ApiCommand extends BaseCommand{[a6_0x2e5367(0xe9)]=a6_0x2e5367(0xc1);[a6_0x2e5367(0xcd)]=a6_0x2e5367(0xc8);[a6_0x2e5367(0xed)](_0x3b4526){const _0x407a21=a6_0x2e5367,{args:_0x1beb99,options:_0x3b27ce}=_0x3b4526,_0x5c115f=_0x3b27ce;if(_0x1beb99[_0x407a21(0xd0)]===0x0)return'Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list';const _0xe87d6e=_0x1beb99[0x0];if(!_0xe87d6e[_0x407a21(0xbf)]('/'))return _0x407a21(0xcf)+_0xe87d6e;const _0x29a51f=_0x5c115f['data'],_0x4626d2=_0x5c115f['file'];if(_0x29a51f&&_0x4626d2)return _0x407a21(0xe4);const _0x3c416c=_0x5c115f['method']||_0x407a21(0xe0),_0x59069f=[_0x407a21(0xe0),_0x407a21(0xb7),_0x407a21(0xf1),_0x407a21(0xc5),_0x407a21(0xf3)];if(!_0x59069f[_0x407a21(0xc3)](_0x3c416c[_0x407a21(0xd9)]()))return _0x407a21(0xf4)+_0x3c416c+_0x407a21(0xbd)+_0x59069f['join'](',\x20');const _0x3da52d=_0x5c115f['type']||'td',_0x14142c=['td','cdp',_0x407a21(0xde),_0x407a21(0xbe),'llm',_0x407a21(0xd3)];if(!_0x14142c[_0x407a21(0xc3)](_0x3da52d))return'Invalid\x20API\x20type:\x20'+_0x3da52d+_0x407a21(0xe8)+_0x14142c[_0x407a21(0xcb)](',\x20');return undefined;}async['execute'](_0x96e12d){const _0x3a16f4=a6_0x2e5367,{options:_0x139e9f,args:_0x2b2d71,tdx:_0x1357f3}=_0x96e12d,_0x18e864=_0x139e9f,_0x26cb41=_0x2b2d71[0x0],_0x376a45=(_0x18e864[_0x3a16f4(0xd2)]||_0x3a16f4(0xe0))[_0x3a16f4(0xd9)](),_0x2d0eb2=_0x18e864[_0x3a16f4(0xc7)],_0x5a3e91=_0x18e864[_0x3a16f4(0xc2)],_0x53728a=_0x18e864['header'],_0x3928e4=_0x18e864['type']||'td';try{const _0x8bbb8a={};if(_0x53728a){const _0x5bb1ee=Array[_0x3a16f4(0xbb)](_0x53728a)?_0x53728a:[_0x53728a];for(const _0x164788 of _0x5bb1ee){const [_0x104c97,_0xa4d468]=parseHeader(_0x164788);_0x8bbb8a[_0x104c97]=_0xa4d468;}}let _0xedabf8;if(_0x2d0eb2)_0xedabf8=_0x2d0eb2;else{if(_0x5a3e91)try{_0xedabf8=RawAPI[_0x3a16f4(0xe2)](_0x5a3e91);}catch(_0x4bd39c){return console[_0x3a16f4(0xc0)](_0x3a16f4(0xd5)+(_0x4bd39c instanceof Error?_0x4bd39c[_0x3a16f4(0xca)]:String(_0x4bd39c))),0x1;}}const _0x24de93={'method':_0x376a45,'apiType':_0x3928e4,'includeHeaders':_0x139e9f['verbose']};_0xedabf8&&(_0x24de93[_0x3a16f4(0xec)]=_0xedabf8);Object[_0x3a16f4(0xd6)](_0x8bbb8a)[_0x3a16f4(0xd0)]>0x0&&(_0x24de93[_0x3a16f4(0xd4)]=_0x8bbb8a);if(_0x139e9f[_0x3a16f4(0xcc)]){const _0x394462=resolveSite(_0x139e9f[_0x3a16f4(0xce)]),_0xa7f032=getEndpoint(_0x394462,_0x3928e4),_0x45b304=''+_0xa7f032+_0x26cb41;console[_0x3a16f4(0xc0)]('>\x20'+_0x376a45+'\x20'+_0x45b304);const _0x5ddb04=getAuthHeaders(_0x394462),_0x53dd06={..._0x5ddb04,..._0x8bbb8a};for(const [_0x224bbc,_0x1879b1]of Object[_0x3a16f4(0xeb)](_0x53dd06)){!isSensitiveHeader(_0x224bbc)&&console[_0x3a16f4(0xc0)]('>\x20'+_0x224bbc+':\x20'+_0x1879b1);}_0xedabf8&&console[_0x3a16f4(0xc0)]('>'),console['error']('');}const _0x5ab2a3=await _0x1357f3[_0x3a16f4(0xc1)]['request'](_0x26cb41,_0x24de93);if(_0x139e9f[_0x3a16f4(0xcc)]&&_0x5ab2a3['headers']){console[_0x3a16f4(0xc0)]('<\x20HTTP/1.1\x20'+_0x5ab2a3['status']);for(const [_0x5c0069,_0x1c22e2]of Object[_0x3a16f4(0xeb)](_0x5ab2a3[_0x3a16f4(0xd4)])){!isSensitiveHeader(_0x5c0069)&&console[_0x3a16f4(0xc0)]('<\x20'+_0x5c0069+':\x20'+_0x1c22e2);}console[_0x3a16f4(0xc0)]('');}const _0x466823=Boolean(_0x139e9f[_0x3a16f4(0xc6)]),_0x5ad4f5={'color':_0x139e9f[_0x3a16f4(0xe1)],'noColor':_0x139e9f[_0x3a16f4(0xb9)]||_0x466823&&!_0x139e9f[_0x3a16f4(0xe1)]},_0xd6e7ec=colorizeJSON(_0x5ab2a3[_0x3a16f4(0xc7)],_0x5ad4f5);return _0x139e9f[_0x3a16f4(0xc6)]?(writeFileSync(_0x139e9f[_0x3a16f4(0xc6)],_0xd6e7ec),console['error']('Results\x20saved\x20to\x20'+_0x139e9f['output'])):console['log'](_0xd6e7ec),0x0;}catch(_0x2f56a0){return _0x2f56a0 instanceof Error?(console[_0x3a16f4(0xc0)](_0x3a16f4(0xd5)+_0x2f56a0[_0x3a16f4(0xca)]),_0x139e9f[_0x3a16f4(0xcc)]&&_0x2f56a0[_0x3a16f4(0xda)]&&console[_0x3a16f4(0xc0)](_0x3a16f4(0xe3)+_0x2f56a0[_0x3a16f4(0xda)])):console[_0x3a16f4(0xc0)](_0x3a16f4(0xd5)+String(_0x2f56a0)),0x1;}}}
@@ -1 +1 @@
1
- const a7_0x40b929=a7_0x3d17;(function(_0x221d4e,_0x2eb1a0){const _0x1e2748=a7_0x3d17,_0x10b307=_0x221d4e();while(!![]){try{const _0x25d8f0=-parseInt(_0x1e2748(0x119))/0x1*(-parseInt(_0x1e2748(0xf9))/0x2)+-parseInt(_0x1e2748(0x117))/0x3*(parseInt(_0x1e2748(0x131))/0x4)+parseInt(_0x1e2748(0x115))/0x5+parseInt(_0x1e2748(0xf3))/0x6+-parseInt(_0x1e2748(0x123))/0x7*(parseInt(_0x1e2748(0x128))/0x8)+-parseInt(_0x1e2748(0x124))/0x9*(parseInt(_0x1e2748(0xf4))/0xa)+-parseInt(_0x1e2748(0x101))/0xb;if(_0x25d8f0===_0x2eb1a0)break;else _0x10b307['push'](_0x10b307['shift']());}catch(_0x277227){_0x10b307['push'](_0x10b307['shift']());}}}(a7_0x167e,0xa55d3));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';function a7_0x167e(){const _0x22dc30=['Setup\x20API\x20key\x20authentication\x20interactively','apiKey','You\x20can\x20find\x20your\x20API\x20key\x20at:','warn','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','Name:\x20','5576064euHmmH','6572360wvVtaF','other','tdx:\x20auth\x20clear','profile','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','20gnAYXN','execute','error','ERROR','site','filter','System\x20keychain\x20is\x20not\x20available','\x20(profile:\x20','11004598KuWhoE','last_name','Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20','bold','create','Validating\x20API\x20key...','us01','/app/mp/ak','auth:setup','getUserInfo','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','\x20\x20tdx','✓\x20API\x20key\x20removed\x20from\x20keychain','\x0aSetup\x20cancelled','name','message','select','User:\x20','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','trim','6772445xDNzTF','No\x20API\x20key\x20found\x20in\x20keychain','17769MmqEDW','text','96829PAPcTC','first_name','API\x20key\x20cannot\x20be\x20empty','✗\x20Validation\x20failed:\x20','\x20for\x20profile:\x20','Enter\x20site\x20name:','customSite','\x20--profile\x20','Enter\x20your\x20TD\x20API\x20key:','test','210WqbtUX','9lLwoQy','status','Site\x20name\x20cannot\x20be\x20empty','✓\x20Authentication\x20successful\x0a','13968fyDAHO','red','Setting\x20up\x20authentication\x20for\x20site:\x20','jobs','description','password','auth','log','yellow','584vSkujJ'];a7_0x167e=function(){return _0x22dc30;};return a7_0x167e();}import{clearCredentialCache}from'../core/credential-cache.js';import{buildSiteChoices}from'../core/constants.js';import a7_0xd50773 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_0x52bc3b from'chalk';export class AuthSetupCommand extends BaseCommand{[a7_0x40b929(0x10f)]=a7_0x40b929(0x109);[a7_0x40b929(0x12c)]=a7_0x40b929(0x132);async[a7_0x40b929(0xfa)](_0x39654d){const _0x996977=a7_0x40b929,{options:_0x12c4a3}=_0x39654d,_0x1bceb6=_0x12c4a3[_0x996977(0xf7)];console[_0x996977(0x12f)](a7_0x52bc3b[_0x996977(0x104)]('tdx:\x20auth\x20setup'));const _0x5323ba=_0x12c4a3[_0x996977(0xfd)]||_0x996977(0x107),{choices:_0x43908f,initialIndex:_0x38e1d4}=buildSiteChoices(_0x5323ba),_0x3d0ed=_0x1bceb6?_0x996977(0x103)+_0x1bceb6+'):':'Select\x20your\x20Treasure\x20Data\x20site:',_0x45987c=await a7_0xd50773({'type':_0x996977(0x111),'name':_0x996977(0xfd),'message':_0x3d0ed,'choices':_0x43908f,'initial':_0x38e1d4});if(!_0x45987c[_0x996977(0xfd)])return console[_0x996977(0x12f)](_0x996977(0x10e)),0x1;let _0x3e863c;if(_0x45987c[_0x996977(0xfd)]===_0x996977(0xf5)){const _0x3cfcb8=await a7_0xd50773({'type':_0x996977(0x118),'name':_0x996977(0x11f),'message':_0x996977(0x11e),'initial':_0x996977(0x107),'validate':_0xce1b2d=>{const _0x166aaa=_0x996977;if(!_0xce1b2d||!_0xce1b2d[_0x166aaa(0x114)]())return _0x166aaa(0x126);if(!/^[a-z0-9-]+$/[_0x166aaa(0x122)](_0xce1b2d[_0x166aaa(0x114)]()))return'Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens';return!![];}});if(!_0x3cfcb8[_0x996977(0x11f)])return console['log'](_0x996977(0x10e)),0x1;_0x3e863c=_0x3cfcb8[_0x996977(0x11f)];}else _0x3e863c=_0x45987c[_0x996977(0xfd)];const _0x4fd928=resolveSite(_0x3e863c);console['log'](_0x996977(0x12a)+_0x4fd928),console[_0x996977(0x12f)](_0x996977(0xef)),console[_0x996977(0x12f)]('\x20\x20'+getConsoleUrl(_0x4fd928,_0x996977(0x108)));const _0x4b4a44=await a7_0xd50773({'type':_0x996977(0x12d),'name':_0x996977(0x133),'message':_0x996977(0x121),'validate':_0x59f83d=>{const _0x2a5341=_0x996977;if(!_0x59f83d||!_0x59f83d[_0x2a5341(0x114)]())return _0x2a5341(0x11b);return!![];}});if(!_0x4b4a44[_0x996977(0x133)])return console[_0x996977(0x12f)]('\x0aSetup\x20cancelled'),0x1;const _0x3d3dd1=_0x4b4a44[_0x996977(0x133)];console['log'](_0x996977(0x106));try{const _0x16a901=TDX[_0x996977(0x105)]({'site':_0x4fd928,'apiKey':_0x3d3dd1['trim'](),'logLevel':_0x12c4a3['logLevel']??LogLevel[_0x996977(0xfc)]}),_0x5eb3d5=await _0x16a901[_0x996977(0x12b)][_0x996977(0x10a)]();console[_0x996977(0x12f)]('✓\x20API\x20key\x20is\x20valid\x20(User:\x20'+_0x5eb3d5['email']+')');const _0x291b81=await isKeychainAvailable();_0x291b81?(await saveAPIKeyAsync(_0x3d3dd1[_0x996977(0x114)](),_0x4fd928,_0x1bceb6),console[_0x996977(0x12f)]('✓\x20API\x20key\x20saved\x20to\x20system\x20keychain'+(_0x1bceb6?_0x996977(0x100)+_0x1bceb6+')':''))):(console[_0x996977(0xf0)](a7_0x52bc3b[_0x996977(0x130)](_0x996977(0x113))),console['warn'](a7_0x52bc3b[_0x996977(0x130)](_0x996977(0xf1))));if(_0x1bceb6){const _0x482b09={'site':_0x4fd928};saveProfileToUserConfig(_0x1bceb6,_0x482b09),console['log']('✓\x20Profile\x20\x27'+_0x1bceb6+'\x27\x20registered');}else saveDefaultSiteToUserConfig(_0x4fd928),console[_0x996977(0x12f)]('✓\x20Default\x20site\x20set\x20to\x20'+_0x4fd928);const _0x44fdcd=_0x1bceb6?_0x996977(0x120)+_0x1bceb6:'';return console['log'](),console[_0x996977(0x12f)](_0x996977(0xf8)),console[_0x996977(0x12f)]('\x20\x20tdx'+_0x44fdcd+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console[_0x996977(0x12f)](_0x996977(0x10c)+_0x44fdcd+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases'),0x0;}catch(_0xca072e){if(_0xca072e instanceof HTTPClientError&&_0xca072e[_0x996977(0x125)]===0x191)return printAuthError(_0xca072e),0x1;return console[_0x996977(0xfb)](a7_0x52bc3b[_0x996977(0x129)](_0x996977(0x11c)+(_0xca072e instanceof Error?_0xca072e[_0x996977(0x110)]:String(_0xca072e)))),console[_0x996977(0xfb)]('API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.'),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x40b929(0x10f)]=a7_0x40b929(0x12e);[a7_0x40b929(0x12c)]=a7_0x40b929(0x10b);async[a7_0x40b929(0xfa)](_0x547e2c){const _0x24cdfc=a7_0x40b929,{options:_0x2b3eed,tdx:_0x2295cf}=_0x547e2c,_0x5e235f=_0x2b3eed['site'],_0x1e69f1=_0x2b3eed[_0x24cdfc(0xf7)],_0x4d94e0=_0x1e69f1?_0x1e69f1:'N/A';console['log']('tdx\x20profile:\x20'+_0x4d94e0+'\x20(site:\x20'+_0x5e235f+')');const _0x226180=await resolveAPIKeyAsync(_0x5e235f,_0x1e69f1);if(_0x226180){const {source:_0x5c29eb,isDeprecated:_0x3a3c54}=_0x226180,_0x46917f='Read\x20credential\x20from\x20'+_0x5c29eb;console['log'](_0x3a3c54?a7_0x52bc3b[_0x24cdfc(0x130)](_0x46917f):_0x46917f);}else console[_0x24cdfc(0x12f)](a7_0x52bc3b[_0x24cdfc(0x130)]('No\x20credential\x20found'));try{const _0x39deb4=await _0x2295cf['jobs'][_0x24cdfc(0x10a)]();return console[_0x24cdfc(0x12f)](a7_0x52bc3b['green'](_0x24cdfc(0x127))),console[_0x24cdfc(0x12f)](_0x24cdfc(0x112)+_0x39deb4['email']),(_0x39deb4[_0x24cdfc(0x11a)]||_0x39deb4[_0x24cdfc(0x102)])&&console[_0x24cdfc(0x12f)](_0x24cdfc(0xf2)+[_0x39deb4[_0x24cdfc(0x11a)],_0x39deb4[_0x24cdfc(0x102)]][_0x24cdfc(0xfe)](Boolean)['join']('\x20')),0x0;}catch(_0x3d2712){return _0x3d2712 instanceof HTTPClientError&&_0x3d2712[_0x24cdfc(0x125)]===0x191?printAuthError(_0x3d2712,!![],_0x1e69f1):console['error'](a7_0x52bc3b[_0x24cdfc(0x129)](_0x24cdfc(0x11c)+(_0x3d2712 instanceof Error?_0x3d2712[_0x24cdfc(0x110)]:String(_0x3d2712)))),0x1;}}}function a7_0x3d17(_0xe12c86,_0x491bbc){_0xe12c86=_0xe12c86-0xef;const _0x167ed0=a7_0x167e();let _0x3d17d9=_0x167ed0[_0xe12c86];return _0x3d17d9;}export class AuthClearCommand extends BaseCommand{[a7_0x40b929(0x10f)]='auth:clear';['description']='Remove\x20API\x20key\x20from\x20system\x20keychain';async[a7_0x40b929(0xfa)](_0x536466){const _0x227c31=a7_0x40b929,{options:_0x3a4fec}=_0x536466,_0x325867=_0x3a4fec[_0x227c31(0xf7)];console[_0x227c31(0x12f)](a7_0x52bc3b['bold'](_0x227c31(0xf6)));const _0x1c515f=await isKeychainAvailable();if(!_0x1c515f)return console[_0x227c31(0xfb)](a7_0x52bc3b[_0x227c31(0x129)](_0x227c31(0xff))),0x1;const _0x25aa52=await deleteKeychainAPIKey(_0x325867);return _0x25aa52?(clearCredentialCache(),console[_0x227c31(0x12f)](_0x227c31(0x10d)+(_0x325867?_0x227c31(0x100)+_0x325867+')':'')),0x0):(console[_0x227c31(0x12f)](_0x227c31(0x116)+(_0x325867?_0x227c31(0x11d)+_0x325867:'')),0x1);}}
1
+ const a7_0x1e8578=a7_0x184c;(function(_0x4a529a,_0x5868ce){const _0x2062fa=a7_0x184c,_0x5bb0cf=_0x4a529a();while(!![]){try{const _0x47f62d=parseInt(_0x2062fa(0x1c1))/0x1+-parseInt(_0x2062fa(0x1c3))/0x2+-parseInt(_0x2062fa(0x1f4))/0x3*(-parseInt(_0x2062fa(0x1b1))/0x4)+parseInt(_0x2062fa(0x1f1))/0x5+parseInt(_0x2062fa(0x1dc))/0x6+parseInt(_0x2062fa(0x1e0))/0x7+-parseInt(_0x2062fa(0x1ec))/0x8*(parseInt(_0x2062fa(0x1bb))/0x9);if(_0x47f62d===_0x5868ce)break;else _0x5bb0cf['push'](_0x5bb0cf['shift']());}catch(_0x5e8c0b){_0x5bb0cf['push'](_0x5bb0cf['shift']());}}}(a7_0x4c78,0xc8c4e));function a7_0x184c(_0x35af09,_0x282390){_0x35af09=_0x35af09-0x1b0;const _0x4c78cb=a7_0x4c78();let _0x184ce8=_0x4c78cb[_0x35af09];return _0x184ce8;}import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';function a7_0x4c78(){const _0x5d9274=['Select\x20your\x20Treasure\x20Data\x20site:','No\x20credential\x20found','/app/mp/ak','Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20','last_name','execute','description','site','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','name','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','11193704mtDiFI','message','red','auth:setup','No\x20API\x20key\x20found\x20in\x20keychain','5057210gxzzUB','warn','first_name','159hggeAT','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','yellow','69948ArFwVD','apiKey','customSite','User:\x20','\x20for\x20profile:\x20','Remove\x20API\x20key\x20from\x20system\x20keychain','error','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','✓\x20Profile\x20\x27','System\x20keychain\x20is\x20not\x20available','9OdoNhm','Name:\x20','✓\x20Authentication\x20successful\x0a','Setting\x20up\x20authentication\x20for\x20site:\x20','Site\x20name\x20cannot\x20be\x20empty','\x27\x20registered','89153zUxQRa','bold','1192262nnvXum','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','email','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','getUserInfo','auth','N/A','\x20--profile\x20','auth:clear','Validating\x20API\x20key...','Setup\x20API\x20key\x20authentication\x20interactively','\x20\x20tdx','Read\x20credential\x20from\x20','create','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','status','profile','tdx\x20profile:\x20','green','You\x20can\x20find\x20your\x20API\x20key\x20at:','✓\x20API\x20key\x20removed\x20from\x20keychain','text','log','trim','us01','4323570IarkgF','password','\x0aSetup\x20cancelled','jobs','487851RjidkK'];a7_0x4c78=function(){return _0x5d9274;};return a7_0x4c78();}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_0x57a49d 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_0x4189a4 from'chalk';export class AuthSetupCommand extends BaseCommand{[a7_0x1e8578(0x1ea)]=a7_0x1e8578(0x1ef);[a7_0x1e8578(0x1e7)]=a7_0x1e8578(0x1cd);async[a7_0x1e8578(0x1e6)](_0x20aa97){const _0x2d0649=a7_0x1e8578,{options:_0x21e8ae}=_0x20aa97,_0x252d2e=_0x21e8ae['profile'];console['log'](a7_0x4189a4[_0x2d0649(0x1c2)]('tdx:\x20auth\x20setup'));const _0x158b18=_0x21e8ae['site']||_0x2d0649(0x1db),{choices:_0x5d2d0e,initialIndex:_0x2d548a}=buildSiteChoices(_0x158b18),_0x4c1571=_0x252d2e?_0x2d0649(0x1e4)+_0x252d2e+'):':_0x2d0649(0x1e1),_0x24886e=await a7_0x57a49d({'type':'select','name':_0x2d0649(0x1e8),'message':_0x4c1571,'choices':_0x5d2d0e,'initial':_0x2d548a});if(!_0x24886e[_0x2d0649(0x1e8)])return console[_0x2d0649(0x1d9)](_0x2d0649(0x1de)),0x1;let _0xb06f52;if(_0x24886e[_0x2d0649(0x1e8)]==='other'){const _0x50cf0e=await a7_0x57a49d({'type':_0x2d0649(0x1d8),'name':_0x2d0649(0x1b3),'message':'Enter\x20site\x20name:','initial':_0x2d0649(0x1db),'validate':_0xb35e12=>{const _0x270788=_0x2d0649;if(!_0xb35e12||!_0xb35e12[_0x270788(0x1da)]())return _0x270788(0x1bf);if(!/^[a-z0-9-]+$/['test'](_0xb35e12[_0x270788(0x1da)]()))return _0x270788(0x1c4);return!![];}});if(!_0x50cf0e[_0x2d0649(0x1b3)])return console[_0x2d0649(0x1d9)](_0x2d0649(0x1de)),0x1;_0xb06f52=_0x50cf0e[_0x2d0649(0x1b3)];}else _0xb06f52=_0x24886e['site'];const _0x4fee5a=resolveSite(_0xb06f52);console[_0x2d0649(0x1d9)](_0x2d0649(0x1be)+_0x4fee5a),console[_0x2d0649(0x1d9)](_0x2d0649(0x1d6)),console['log']('\x20\x20'+getConsoleUrl(_0x4fee5a,_0x2d0649(0x1e3)));const _0xdabd46=await a7_0x57a49d({'type':_0x2d0649(0x1dd),'name':_0x2d0649(0x1b2),'message':'Enter\x20your\x20TD\x20API\x20key:','validate':_0x308d3c=>{if(!_0x308d3c||!_0x308d3c['trim']())return'API\x20key\x20cannot\x20be\x20empty';return!![];}});if(!_0xdabd46[_0x2d0649(0x1b2)])return console[_0x2d0649(0x1d9)](_0x2d0649(0x1de)),0x1;const _0xe9094e=_0xdabd46[_0x2d0649(0x1b2)];console[_0x2d0649(0x1d9)](_0x2d0649(0x1cc));try{const _0x20dda7=TDX[_0x2d0649(0x1d0)]({'site':_0x4fee5a,'apiKey':_0xe9094e[_0x2d0649(0x1da)](),'logLevel':_0x21e8ae['logLevel']??LogLevel['ERROR']}),_0x19580c=await _0x20dda7[_0x2d0649(0x1df)][_0x2d0649(0x1c7)]();console[_0x2d0649(0x1d9)]('✓\x20API\x20key\x20is\x20valid\x20(User:\x20'+_0x19580c[_0x2d0649(0x1c5)]+')');const _0x3fb8f2=await isKeychainAvailable();_0x3fb8f2?(await saveAPIKeyAsync(_0xe9094e[_0x2d0649(0x1da)](),_0x4fee5a,_0x252d2e),console['log'](_0x2d0649(0x1e9)+(_0x252d2e?'\x20(profile:\x20'+_0x252d2e+')':''))):(console[_0x2d0649(0x1f2)](a7_0x4189a4[_0x2d0649(0x1b0)](_0x2d0649(0x1c6))),console[_0x2d0649(0x1f2)](a7_0x4189a4[_0x2d0649(0x1b0)](_0x2d0649(0x1d1))));if(_0x252d2e){const _0x56d56c={'site':_0x4fee5a};saveProfileToUserConfig(_0x252d2e,_0x56d56c),console['log'](_0x2d0649(0x1b9)+_0x252d2e+_0x2d0649(0x1c0));}else saveDefaultSiteToUserConfig(_0x4fee5a),console[_0x2d0649(0x1d9)]('✓\x20Default\x20site\x20set\x20to\x20'+_0x4fee5a);const _0x5b98c8=_0x252d2e?_0x2d0649(0x1ca)+_0x252d2e:'';return console[_0x2d0649(0x1d9)](),console[_0x2d0649(0x1d9)](_0x2d0649(0x1eb)),console[_0x2d0649(0x1d9)]('\x20\x20tdx'+_0x5b98c8+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console['log'](_0x2d0649(0x1ce)+_0x5b98c8+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases'),0x0;}catch(_0x486855){if(_0x486855 instanceof HTTPClientError&&_0x486855[_0x2d0649(0x1d2)]===0x191)return printAuthError(_0x486855),0x1;return console[_0x2d0649(0x1b7)](a7_0x4189a4[_0x2d0649(0x1ee)]('✗\x20Validation\x20failed:\x20'+(_0x486855 instanceof Error?_0x486855[_0x2d0649(0x1ed)]:String(_0x486855)))),console[_0x2d0649(0x1b7)](_0x2d0649(0x1b8)),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x1e8578(0x1ea)]=a7_0x1e8578(0x1c8);[a7_0x1e8578(0x1e7)]=a7_0x1e8578(0x1f5);async[a7_0x1e8578(0x1e6)](_0x2cd9f7){const _0x35aae3=a7_0x1e8578,{options:_0x5e5149,tdx:_0x21a515}=_0x2cd9f7,_0x451fbe=_0x5e5149[_0x35aae3(0x1e8)],_0x52e3a0=_0x5e5149[_0x35aae3(0x1d3)],_0x176bd3=_0x52e3a0?_0x52e3a0:_0x35aae3(0x1c9);console['log'](_0x35aae3(0x1d4)+_0x176bd3+'\x20(site:\x20'+_0x451fbe+')');const _0x398799=await resolveAPIKeyAsync(_0x451fbe,_0x52e3a0);if(_0x398799){const {source:_0x555b64,isDeprecated:_0x1817ea}=_0x398799,_0x26d4c9=_0x35aae3(0x1cf)+_0x555b64;console[_0x35aae3(0x1d9)](_0x1817ea?a7_0x4189a4['yellow'](_0x26d4c9):_0x26d4c9);}else console[_0x35aae3(0x1d9)](a7_0x4189a4[_0x35aae3(0x1b0)](_0x35aae3(0x1e2)));try{const _0x1b3325=await _0x21a515[_0x35aae3(0x1df)][_0x35aae3(0x1c7)]();return console[_0x35aae3(0x1d9)](a7_0x4189a4[_0x35aae3(0x1d5)](_0x35aae3(0x1bd))),console[_0x35aae3(0x1d9)](_0x35aae3(0x1b4)+_0x1b3325['email']),(_0x1b3325['first_name']||_0x1b3325[_0x35aae3(0x1e5)])&&console['log'](_0x35aae3(0x1bc)+[_0x1b3325[_0x35aae3(0x1f3)],_0x1b3325[_0x35aae3(0x1e5)]]['filter'](Boolean)['join']('\x20')),0x0;}catch(_0x3fc809){return _0x3fc809 instanceof HTTPClientError&&_0x3fc809[_0x35aae3(0x1d2)]===0x191?printAuthError(_0x3fc809,!![],_0x52e3a0):console[_0x35aae3(0x1b7)](a7_0x4189a4[_0x35aae3(0x1ee)]('✗\x20Validation\x20failed:\x20'+(_0x3fc809 instanceof Error?_0x3fc809[_0x35aae3(0x1ed)]:String(_0x3fc809)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x1e8578(0x1ea)]=a7_0x1e8578(0x1cb);[a7_0x1e8578(0x1e7)]=a7_0x1e8578(0x1b6);async['execute'](_0x1abd00){const _0x38f21d=a7_0x1e8578,{options:_0x3e47f9}=_0x1abd00,_0x2e66c5=_0x3e47f9['profile'];console[_0x38f21d(0x1d9)](a7_0x4189a4[_0x38f21d(0x1c2)]('tdx:\x20auth\x20clear'));const _0x2e6441=await isKeychainAvailable();if(!_0x2e6441)return console[_0x38f21d(0x1b7)](a7_0x4189a4[_0x38f21d(0x1ee)](_0x38f21d(0x1ba))),0x1;const _0xc39625=await deleteKeychainAPIKey(_0x2e66c5);return _0xc39625?(clearCredentialCache(),console[_0x38f21d(0x1d9)](_0x38f21d(0x1d7)+(_0x2e66c5?'\x20(profile:\x20'+_0x2e66c5+')':'')),0x0):(console[_0x38f21d(0x1d9)](_0x38f21d(0x1f0)+(_0x2e66c5?_0x38f21d(0x1b5)+_0x2e66c5:'')),0x1);}}
@@ -1 +1 @@
1
- const a8_0x3dc73a=a8_0x2714;function a8_0x53db(){const _0x129413=['48028816YGEKfU','Resolving\x20project\x20\x27','projectId','type','new','includes','29330XBybGp','tool','validate','stack','Error:\x20','name','chat','functionName','10sFSvZd','verbose','291833OUicMi','Create\x20a\x20new\x20chat\x20session','chatId','Continuing\x20chat:\x20','resolveProjectId','event','streamChat','execute','session\x20context','tool_result','join','slice','message','23388rdfUNr','1902XRoyOJ','streamChatJsonl','content','Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22','write','Resolving\x20agent\x20\x27','data','767427heESLI','metadata','handleChatEvent','startChat','claude-4.5-haiku','getDefaultAgent','stringify','stdout','description','targetFunction','tool_call','2649104CEHiYS','13583637MmAgNb','No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22','\x0aError:\x20','targetWebSearchTool','site','615nhgtLE','targetKnowledgeBase','string','Using\x20agent\x20from\x20','4PDXOBM','Getting\x20default\x20agent...','llmAgent','Error:\x20Chat\x20session\x20\x27','agent','chat-create','agentId','Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together','log','error','llm','Using\x20cached\x20default\x20agent:\x20','context','options','\x27\x20not\x20found','cause','resolveAgentId','\x27...'];a8_0x53db=function(){return _0x129413;};return a8_0x53db();}function a8_0x2714(_0x546774,_0x12d3d5){_0x546774=_0x546774-0x6e;const _0x53db10=a8_0x53db();let _0x2714c7=_0x53db10[_0x546774];return _0x2714c7;}(function(_0x872644,_0x5f11e4){const _0x3325da=a8_0x2714,_0x50bb21=_0x872644();while(!![]){try{const _0x4c495b=parseInt(_0x3325da(0xb9))/0x1*(-parseInt(_0x3325da(0x97))/0x2)+parseInt(_0x3325da(0x82))/0x3+-parseInt(_0x3325da(0x7a))/0x4*(parseInt(_0x3325da(0x93))/0x5)+parseInt(_0x3325da(0x7b))/0x6*(-parseInt(_0x3325da(0xaf))/0x7)+parseInt(_0x3325da(0x8d))/0x8+parseInt(_0x3325da(0x8e))/0x9*(-parseInt(_0x3325da(0xb7))/0xa)+parseInt(_0x3325da(0xa9))/0xb;if(_0x4c495b===_0x5f11e4)break;else _0x50bb21['push'](_0x50bb21['shift']());}catch(_0x57df06){_0x50bb21['push'](_0x50bb21['shift']());}}}(a8_0x53db,0xc6721));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(_0x34fefe,_0x52928d){const _0x17d9e9=a8_0x2714;if(_0x34fefe instanceof SDKError)console[_0x17d9e9(0xa0)](_0x17d9e9(0xb3)+_0x34fefe[_0x17d9e9(0x79)]),_0x52928d[_0x17d9e9(0xb8)]&&(_0x34fefe[_0x17d9e9(0xa6)]&&console[_0x17d9e9(0xa0)]('\x20\x20Cause:\x20'+_0x34fefe[_0x17d9e9(0xa6)]),_0x34fefe['stack']&&(console[_0x17d9e9(0xa0)]('\x0aStack\x20trace:'),console[_0x17d9e9(0xa0)](_0x34fefe[_0x17d9e9(0xb2)])));else throw _0x34fefe;}async function resolveAgentId(_0x1dfdae,_0x27e06e,_0x4d018d,_0x4981bd,_0x5de9ce){const _0x314c6e=a8_0x2714,_0x43c585=_0x27e06e||_0x4d018d;if(_0x43c585){const {projectName:_0x43df4e,agentName:_0x5e310d}=parseAgentRef(_0x43c585),_0x2fb007=_0x5e310d||_0x43c585,_0x2915db=_0x5e310d?_0x43df4e:_0x4981bd;if(!_0x2915db)throw new Error(_0x314c6e(0x8f));if(_0x5de9ce){const _0x3b7b1d=_0x27e06e?'--agent\x20flag':_0x314c6e(0x75);console[_0x314c6e(0xa0)](_0x314c6e(0x96)+_0x3b7b1d+':\x20'+_0x2915db+'/'+_0x2fb007);}const _0x26423e=await withSpinner(_0x314c6e(0xaa)+_0x2915db+_0x314c6e(0xa8),()=>_0x1dfdae[_0x314c6e(0xa1)][_0x314c6e(0x71)](_0x2915db),{'verbose':_0x5de9ce}),_0x65c51=await withSpinner(_0x314c6e(0x80)+_0x2fb007+_0x314c6e(0xa8),()=>_0x1dfdae[_0x314c6e(0xa1)][_0x314c6e(0xa7)](_0x2fb007,_0x26423e['data']),{'verbose':_0x5de9ce});return _0x65c51[_0x314c6e(0x81)];}else{const _0x566fd0=_0x1dfdae[_0x314c6e(0xa1)][_0x314c6e(0x87)]();if(_0x566fd0)return _0x5de9ce&&console[_0x314c6e(0xa0)](_0x314c6e(0xa2)+_0x566fd0['name']),_0x566fd0['id'];const _0x5f4197=await withSpinner(_0x314c6e(0x98),()=>_0x1dfdae[_0x314c6e(0xa1)]['getOrCreateDefaultAgent'](_0x314c6e(0x86),0x0),{'verbose':_0x5de9ce});return _0x5f4197[_0x314c6e(0x81)]['id'];}}export class ChatCommand extends BaseCommand{[a8_0x3dc73a(0xb4)]=a8_0x3dc73a(0xb5);[a8_0x3dc73a(0x8a)]='Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)';[a8_0x3dc73a(0xb1)](_0x6f57a9){const _0xa417b2=a8_0x3dc73a,_0x4b2868=_0x6f57a9['args'][_0xa417b2(0x77)]('\x20');if(!_0x4b2868)return'Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options';return undefined;}async[a8_0x3dc73a(0x73)](_0x55db7a,_0x254483,_0x17e5ca,_0x40aae8,_0x55d20c){const _0x737ef4=a8_0x3dc73a;for await(const _0x2c7584 of _0x55db7a[_0x737ef4(0xa1)][_0x737ef4(0xb5)](_0x254483,{'agentId':_0x17e5ca,'chatId':_0x40aae8})){if(_0x2c7584['type']===_0x737ef4(0x83)){const _0x5b7b5d=_0x2c7584[_0x737ef4(0x81)]['chatId'];saveLastChatId(_0x5b7b5d),_0x55d20c&&console[_0x737ef4(0xa0)]('Chat\x20session:\x20'+_0x5b7b5d);}else _0x2c7584[_0x737ef4(0xac)]===_0x737ef4(0x72)&&this[_0x737ef4(0x84)](_0x2c7584['data']);}}async[a8_0x3dc73a(0x7c)](_0x4b0f03,_0x48398c,_0x2a2d01,_0xb83836){const _0xf82a15=a8_0x3dc73a,_0x26115c=_0x4b0f03[_0xf82a15(0xa3)][_0xf82a15(0x92)];let _0x3ca5e6=![];for await(const _0x47e1ff of _0x4b0f03[_0xf82a15(0xa1)][_0xf82a15(0xb5)](_0x48398c,{'agentId':_0x2a2d01,'chatId':_0xb83836})){if(_0x47e1ff[_0xf82a15(0xac)]===_0xf82a15(0x83)){const _0xf081f5=_0x47e1ff['data'];saveLastChatId(_0xf081f5[_0xf82a15(0x6f)]);const _0x4e83e8=_0xf081f5[_0xf82a15(0xab)]&&_0xf081f5['agentId']?getLLMConversationUrl(_0x26115c,_0xf081f5[_0xf82a15(0xab)],_0xf081f5[_0xf82a15(0x9d)],_0xf081f5[_0xf82a15(0x6f)]):undefined;console['log'](JSON[_0xf82a15(0x88)]({'type':_0xf82a15(0x83),'data':{'chatId':_0xf081f5[_0xf82a15(0x6f)],'agentId':_0xf081f5['agentId'],'consoleUrl':_0x4e83e8}})),_0x3ca5e6=!![];}else{if(_0x47e1ff[_0xf82a15(0xac)]===_0xf82a15(0x72)){!_0x3ca5e6&&_0xb83836&&(console[_0xf82a15(0x9f)](JSON['stringify']({'type':_0xf82a15(0x83),'data':{'chatId':_0xb83836}})),_0x3ca5e6=!![]);const _0x5f07c7=_0x47e1ff[_0xf82a15(0x81)];if(_0xf82a15(0x7d)in _0x5f07c7)console[_0xf82a15(0x9f)](JSON[_0xf82a15(0x88)]({'type':_0xf82a15(0x7d),'data':{'content':_0x5f07c7[_0xf82a15(0x7d)]}}));else{if(_0xf82a15(0x8c)in _0x5f07c7){const _0x402c78=_0x5f07c7['tool_call'];console[_0xf82a15(0x9f)](JSON['stringify']({'type':_0xf82a15(0x8c),'data':{'id':_0x402c78['id'],'name':_0x402c78[_0xf82a15(0xb6)],'target':_0x402c78[_0xf82a15(0x94)]?.['name']||_0x402c78['targetAgent']?.[_0xf82a15(0xb4)]||_0x402c78[_0xf82a15(0x91)]?.[_0xf82a15(0xb4)]||_0x402c78[_0xf82a15(0x8b)]}}));}else{if(_0xf82a15(0xb0)in _0x5f07c7)console[_0xf82a15(0x9f)](JSON['stringify']({'type':_0xf82a15(0x76),'data':{'id':_0x5f07c7['tool']['id'],'name':_0x5f07c7[_0xf82a15(0xb0)][_0xf82a15(0xb6)],'result':typeof _0x5f07c7['tool'][_0xf82a15(0x7d)]===_0xf82a15(0x95)?_0x5f07c7[_0xf82a15(0xb0)][_0xf82a15(0x7d)][_0xf82a15(0x78)](0x0,0x1f4):''}}));else _0xf82a15(0xa0)in _0x5f07c7&&console[_0xf82a15(0x9f)](JSON[_0xf82a15(0x88)]({'type':_0xf82a15(0xa0),'data':{'error':_0x5f07c7[_0xf82a15(0xa0)]}}));}}}}}console['log'](JSON[_0xf82a15(0x88)]({'type':'done'}));}async[a8_0x3dc73a(0x74)](_0xbd2503){const _0x268b05=a8_0x3dc73a,{options:_0x58fa72,args:_0x4a6ec3,tdx:_0x56f2bc}=_0xbd2503,_0x567be6=_0x4a6ec3[_0x268b05(0x77)]('\x20'),_0x261604=_0x58fa72,_0x32efc4=_0x261604[_0x268b05(0x9b)],_0x5796b2=_0x261604[_0x268b05(0x99)],_0x5cd534=_0x261604['llmProject'],_0x3a4b5e=_0x261604[_0x268b05(0xad)],_0xf60267=_0x261604['chatId'],_0x1e5d11=_0x261604['stream'];if(_0x3a4b5e&&_0xf60267)return console['error'](_0x268b05(0x9e)),0x1;try{let _0x9b435,_0x2b21be;if(_0xf60267)_0x2b21be=_0xf60267;else!_0x3a4b5e&&(_0x2b21be=loadLastChatId(),_0x2b21be&&_0x58fa72[_0x268b05(0xb8)]&&console[_0x268b05(0xa0)](_0x268b05(0x70)+_0x2b21be));!_0xf60267&&(_0x3a4b5e||!_0x2b21be)&&(_0x9b435=await resolveAgentId(_0x56f2bc,_0x32efc4,_0x5796b2,_0x5cd534,_0x58fa72[_0x268b05(0xb8)]));const _0x1443a8=_0x1e5d11?(_0x1de824,_0x1981fd,_0x1d9efa)=>this[_0x268b05(0x7c)](_0x56f2bc,_0x1de824,_0x1981fd,_0x1d9efa):(_0x3defca,_0x1be75c,_0x1eac9c)=>this[_0x268b05(0x73)](_0x56f2bc,_0x3defca,_0x1be75c,_0x1eac9c,_0x58fa72[_0x268b05(0xb8)]);try{await _0x1443a8(_0x567be6,_0x9b435,_0x2b21be);}catch(_0x29c036){const _0x4bc7e8=_0x29c036 instanceof SDKError&&_0x29c036['code']===ErrorCode['CHAT_NOT_FOUND']||_0x29c036 instanceof Error&&_0x29c036[_0x268b05(0x79)][_0x268b05(0xae)]('404');if(_0x4bc7e8&&_0xf60267)return console[_0x268b05(0xa0)](_0x268b05(0x9a)+_0xf60267+_0x268b05(0xa5)),0x1;if(_0x4bc7e8)_0x58fa72[_0x268b05(0xb8)]&&console[_0x268b05(0xa0)]('Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...'),!_0x9b435&&(_0x9b435=await resolveAgentId(_0x56f2bc,_0x32efc4,_0x5796b2,_0x5cd534,_0x58fa72['verbose'])),await _0x1443a8(_0x567be6,_0x9b435,undefined);else throw _0x29c036;}return!_0x1e5d11&&console[_0x268b05(0x9f)](),0x0;}catch(_0x427b77){return console[_0x268b05(0xa0)](),handleSDKError(_0x427b77,_0x58fa72),0x1;}}[a8_0x3dc73a(0x84)](_0x182d07){const _0x56af63=a8_0x3dc73a;if(_0x56af63(0x7d)in _0x182d07)process[_0x56af63(0x89)][_0x56af63(0x7f)](_0x182d07[_0x56af63(0x7d)]);else'error'in _0x182d07&&console['error'](_0x56af63(0x90)+_0x182d07[_0x56af63(0xa0)]);}}export class ChatCreateCommand extends BaseCommand{['name']=a8_0x3dc73a(0x9c);[a8_0x3dc73a(0x8a)]=a8_0x3dc73a(0x6e);[a8_0x3dc73a(0xb1)](_0x502be5){const _0x4024f4=a8_0x3dc73a,_0x230760=_0x502be5[_0x4024f4(0xa4)],_0x22e46b=_0x230760[_0x4024f4(0x9b)],_0x7a7aa3=_0x230760['llmAgent'];if(!_0x22e46b&&!_0x7a7aa3)return _0x4024f4(0x7e);return undefined;}async[a8_0x3dc73a(0x74)](_0x34970a){const _0x90a698=a8_0x3dc73a,{options:_0x26b25c,tdx:_0xd51064}=_0x34970a,_0xfd7018=_0x26b25c,_0x5ccde6=_0xfd7018['agent'],_0x34ea40=_0xfd7018[_0x90a698(0x99)],_0x38dabd=_0xfd7018['llmProject'];try{const _0x490aac=await resolveAgentId(_0xd51064,_0x5ccde6,_0x34ea40,_0x38dabd,_0x26b25c[_0x90a698(0xb8)]),_0x2cdee8=await _0xd51064[_0x90a698(0xa1)][_0x90a698(0x85)](_0x490aac);return saveLastChatId(_0x2cdee8['id']),console['log'](JSON[_0x90a698(0x88)]({'chatId':_0x2cdee8['id'],'agentId':_0x490aac})),0x0;}catch(_0x3e358e){return handleSDKError(_0x3e358e,_0x26b25c),0x1;}}}
1
+ const a8_0x24fde1=a8_0xa019;(function(_0x342b50,_0x1ff49a){const _0x54f6e3=a8_0xa019,_0x55c630=_0x342b50();while(!![]){try{const _0x4638c6=-parseInt(_0x54f6e3(0x147))/0x1+parseInt(_0x54f6e3(0x14b))/0x2*(-parseInt(_0x54f6e3(0x12b))/0x3)+-parseInt(_0x54f6e3(0x128))/0x4+parseInt(_0x54f6e3(0x16b))/0x5*(parseInt(_0x54f6e3(0x142))/0x6)+parseInt(_0x54f6e3(0x146))/0x7*(-parseInt(_0x54f6e3(0x138))/0x8)+-parseInt(_0x54f6e3(0x148))/0x9+parseInt(_0x54f6e3(0x13f))/0xa*(parseInt(_0x54f6e3(0x129))/0xb);if(_0x4638c6===_0x1ff49a)break;else _0x55c630['push'](_0x55c630['shift']());}catch(_0x2711fa){_0x55c630['push'](_0x55c630['shift']());}}}(a8_0x39b6,0x4542b));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/errors.js';function a8_0x39b6(){const _0x496316=['name','event','stack','Error:\x20Chat\x20session\x20\x27','9964650kmKUqm','log','description','6qWmATP','type','execute','content','7iwZABG','53327GagKOF','4783437XfCaES','streamChat','chatId','136ovpCsg','\x27\x20not\x20found','getOrCreateDefaultAgent','code','Create\x20a\x20new\x20chat\x20session','stringify','data','metadata','Getting\x20default\x20agent...','Using\x20agent\x20from\x20','\x27...','llmProject','getDefaultAgent','cause','Error:\x20','args','--agent\x20flag','chat','agent','Continuing\x20chat:\x20','projectId','error','site','agentId','verbose','slice','targetAgent','Resolving\x20agent\x20\x27','\x20\x20Cause:\x20','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','session\x20context','handleChatEvent','1143940asFqLD','No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22','claude-4.5-haiku','stream','CHAT_NOT_FOUND','write','tool_call','\x0aError:\x20','stdout','targetFunction','startChat','llmAgent','375136DAoEIh','11rJplFi','streamChatJsonl','3570rNNMty','\x0aStack\x20trace:','tool_result','tool','llm','chat-create','includes','Chat\x20session:\x20','options','join','resolveAgentId','targetWebSearchTool','functionName','1456304YvzOwV','string','message'];a8_0x39b6=function(){return _0x496316;};return a8_0x39b6();}import{withSpinner}from'../utils/spinner.js';import{parseAgentRef}from'../sdk/agent/agent-ref-parser.js';function a8_0xa019(_0x18c1ba,_0x4e9608){_0x18c1ba=_0x18c1ba-0x122;const _0x39b65a=a8_0x39b6();let _0xa019a=_0x39b65a[_0x18c1ba];return _0xa019a;}import{saveLastChatId,loadLastChatId}from'../sdk/llm/chat-cache.js';import{getLLMConversationUrl}from'../sdk/client/endpoints.js';function handleSDKError(_0x4bf9f8,_0x308c09){const _0x1e6626=a8_0xa019;if(_0x4bf9f8 instanceof SDKError)console[_0x1e6626(0x160)](_0x1e6626(0x159)+_0x4bf9f8['message']),_0x308c09['verbose']&&(_0x4bf9f8[_0x1e6626(0x158)]&&console['error'](_0x1e6626(0x167)+_0x4bf9f8[_0x1e6626(0x158)]),_0x4bf9f8[_0x1e6626(0x13d)]&&(console[_0x1e6626(0x160)](_0x1e6626(0x12c)),console[_0x1e6626(0x160)](_0x4bf9f8['stack'])));else throw _0x4bf9f8;}async function resolveAgentId(_0x1a4eda,_0x21c053,_0x2eb525,_0x3e23fe,_0x4be07a){const _0x1765c9=a8_0xa019,_0x2c132a=_0x21c053||_0x2eb525;if(_0x2c132a){const {projectName:_0x2d75b5,agentName:_0xccff2f}=parseAgentRef(_0x2c132a),_0x382212=_0xccff2f||_0x2c132a,_0x1f1c04=_0xccff2f?_0x2d75b5:_0x3e23fe;if(!_0x1f1c04)throw new Error(_0x1765c9(0x16c));if(_0x4be07a){const _0x21e0df=_0x21c053?_0x1765c9(0x15b):_0x1765c9(0x169);console[_0x1765c9(0x160)](_0x1765c9(0x154)+_0x21e0df+':\x20'+_0x1f1c04+'/'+_0x382212);}const _0x47eef9=await withSpinner('Resolving\x20project\x20\x27'+_0x1f1c04+'\x27...',()=>_0x1a4eda[_0x1765c9(0x12f)]['resolveProjectId'](_0x1f1c04),{'verbose':_0x4be07a}),_0x446c09=await withSpinner(_0x1765c9(0x166)+_0x382212+_0x1765c9(0x155),()=>_0x1a4eda[_0x1765c9(0x12f)][_0x1765c9(0x135)](_0x382212,_0x47eef9[_0x1765c9(0x151)]),{'verbose':_0x4be07a});return _0x446c09['data'];}else{const _0x8552ee=_0x1a4eda[_0x1765c9(0x12f)][_0x1765c9(0x157)]();if(_0x8552ee)return _0x4be07a&&console[_0x1765c9(0x160)]('Using\x20cached\x20default\x20agent:\x20'+_0x8552ee[_0x1765c9(0x13b)]),_0x8552ee['id'];const _0x1fc2da=await withSpinner(_0x1765c9(0x153),()=>_0x1a4eda[_0x1765c9(0x12f)][_0x1765c9(0x14d)](_0x1765c9(0x16d),0x0),{'verbose':_0x4be07a});return _0x1fc2da['data']['id'];}}export class ChatCommand extends BaseCommand{[a8_0x24fde1(0x13b)]=a8_0x24fde1(0x15c);[a8_0x24fde1(0x141)]='Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)';['validate'](_0x2be797){const _0x47de74=a8_0x24fde1,_0x369cd4=_0x2be797[_0x47de74(0x15a)][_0x47de74(0x134)]('\x20');if(!_0x369cd4)return _0x47de74(0x168);return undefined;}async[a8_0x24fde1(0x149)](_0xee0771,_0x419e5a,_0x3bbb13,_0x3f5e45,_0xd24ad1){const _0x44243f=a8_0x24fde1;for await(const _0x4e3d62 of _0xee0771[_0x44243f(0x12f)][_0x44243f(0x15c)](_0x419e5a,{'agentId':_0x3bbb13,'chatId':_0x3f5e45})){if(_0x4e3d62['type']===_0x44243f(0x152)){const _0x425838=_0x4e3d62['data'][_0x44243f(0x14a)];saveLastChatId(_0x425838),_0xd24ad1&&console[_0x44243f(0x160)](_0x44243f(0x132)+_0x425838);}else _0x4e3d62[_0x44243f(0x143)]===_0x44243f(0x13c)&&this[_0x44243f(0x16a)](_0x4e3d62['data']);}}async[a8_0x24fde1(0x12a)](_0x5aceb5,_0x29c60e,_0x47aeb3,_0x5627ef){const _0x223893=a8_0x24fde1,_0x8d9b84=_0x5aceb5['context'][_0x223893(0x161)];let _0x525e23=![];for await(const _0x3516c8 of _0x5aceb5[_0x223893(0x12f)][_0x223893(0x15c)](_0x29c60e,{'agentId':_0x47aeb3,'chatId':_0x5627ef})){if(_0x3516c8[_0x223893(0x143)]===_0x223893(0x152)){const _0xbfb117=_0x3516c8[_0x223893(0x151)];saveLastChatId(_0xbfb117[_0x223893(0x14a)]);const _0x550e17=_0xbfb117[_0x223893(0x15f)]&&_0xbfb117[_0x223893(0x162)]?getLLMConversationUrl(_0x8d9b84,_0xbfb117[_0x223893(0x15f)],_0xbfb117['agentId'],_0xbfb117[_0x223893(0x14a)]):undefined;console[_0x223893(0x140)](JSON[_0x223893(0x150)]({'type':'metadata','data':{'chatId':_0xbfb117[_0x223893(0x14a)],'agentId':_0xbfb117[_0x223893(0x162)],'consoleUrl':_0x550e17}})),_0x525e23=!![];}else{if(_0x3516c8[_0x223893(0x143)]==='event'){!_0x525e23&&_0x5627ef&&(console[_0x223893(0x140)](JSON['stringify']({'type':_0x223893(0x152),'data':{'chatId':_0x5627ef}})),_0x525e23=!![]);const _0x1609ac=_0x3516c8[_0x223893(0x151)];if(_0x223893(0x145)in _0x1609ac)console[_0x223893(0x140)](JSON[_0x223893(0x150)]({'type':_0x223893(0x145),'data':{'content':_0x1609ac['content']}}));else{if(_0x223893(0x122)in _0x1609ac){const _0x3c77d2=_0x1609ac[_0x223893(0x122)];console[_0x223893(0x140)](JSON[_0x223893(0x150)]({'type':_0x223893(0x122),'data':{'id':_0x3c77d2['id'],'name':_0x3c77d2[_0x223893(0x137)],'target':_0x3c77d2['targetKnowledgeBase']?.[_0x223893(0x13b)]||_0x3c77d2[_0x223893(0x165)]?.[_0x223893(0x13b)]||_0x3c77d2[_0x223893(0x136)]?.['name']||_0x3c77d2[_0x223893(0x125)]}}));}else{if(_0x223893(0x12e)in _0x1609ac)console[_0x223893(0x140)](JSON[_0x223893(0x150)]({'type':_0x223893(0x12d),'data':{'id':_0x1609ac[_0x223893(0x12e)]['id'],'name':_0x1609ac[_0x223893(0x12e)][_0x223893(0x137)],'result':typeof _0x1609ac['tool'][_0x223893(0x145)]===_0x223893(0x139)?_0x1609ac[_0x223893(0x12e)][_0x223893(0x145)][_0x223893(0x164)](0x0,0x1f4):''}}));else _0x223893(0x160)in _0x1609ac&&console[_0x223893(0x140)](JSON['stringify']({'type':_0x223893(0x160),'data':{'error':_0x1609ac[_0x223893(0x160)]}}));}}}}}console[_0x223893(0x140)](JSON[_0x223893(0x150)]({'type':'done'}));}async[a8_0x24fde1(0x144)](_0x45538f){const _0x48ad39=a8_0x24fde1,{options:_0x1a0804,args:_0x1aba6e,tdx:_0x427d78}=_0x45538f,_0xfb2f25=_0x1aba6e[_0x48ad39(0x134)]('\x20'),_0x33e3ac=_0x1a0804,_0x27fbbb=_0x33e3ac['agent'],_0x134773=_0x33e3ac[_0x48ad39(0x127)],_0x110592=_0x33e3ac[_0x48ad39(0x156)],_0x561f96=_0x33e3ac['new'],_0x5a9d3c=_0x33e3ac[_0x48ad39(0x14a)],_0x11de13=_0x33e3ac[_0x48ad39(0x16e)];if(_0x561f96&&_0x5a9d3c)return console[_0x48ad39(0x160)]('Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together'),0x1;try{let _0x4b736c,_0x14ddfe;if(_0x5a9d3c)_0x14ddfe=_0x5a9d3c;else!_0x561f96&&(_0x14ddfe=loadLastChatId(),_0x14ddfe&&_0x1a0804[_0x48ad39(0x163)]&&console[_0x48ad39(0x160)](_0x48ad39(0x15e)+_0x14ddfe));!_0x5a9d3c&&(_0x561f96||!_0x14ddfe)&&(_0x4b736c=await resolveAgentId(_0x427d78,_0x27fbbb,_0x134773,_0x110592,_0x1a0804[_0x48ad39(0x163)]));const _0x240034=_0x11de13?(_0x24c102,_0x32bea2,_0x35325a)=>this[_0x48ad39(0x12a)](_0x427d78,_0x24c102,_0x32bea2,_0x35325a):(_0x291f11,_0xa6319,_0x28dd2f)=>this[_0x48ad39(0x149)](_0x427d78,_0x291f11,_0xa6319,_0x28dd2f,_0x1a0804[_0x48ad39(0x163)]);try{await _0x240034(_0xfb2f25,_0x4b736c,_0x14ddfe);}catch(_0x286902){const _0xf144e=_0x286902 instanceof SDKError&&_0x286902[_0x48ad39(0x14e)]===ErrorCode[_0x48ad39(0x16f)]||_0x286902 instanceof Error&&_0x286902[_0x48ad39(0x13a)][_0x48ad39(0x131)]('404');if(_0xf144e&&_0x5a9d3c)return console['error'](_0x48ad39(0x13e)+_0x5a9d3c+_0x48ad39(0x14c)),0x1;if(_0xf144e)_0x1a0804['verbose']&&console['error']('Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...'),!_0x4b736c&&(_0x4b736c=await resolveAgentId(_0x427d78,_0x27fbbb,_0x134773,_0x110592,_0x1a0804[_0x48ad39(0x163)])),await _0x240034(_0xfb2f25,_0x4b736c,undefined);else throw _0x286902;}return!_0x11de13&&console[_0x48ad39(0x140)](),0x0;}catch(_0x13cbfe){return console[_0x48ad39(0x160)](),handleSDKError(_0x13cbfe,_0x1a0804),0x1;}}['handleChatEvent'](_0xf24f2f){const _0x53795c=a8_0x24fde1;if(_0x53795c(0x145)in _0xf24f2f)process[_0x53795c(0x124)][_0x53795c(0x170)](_0xf24f2f[_0x53795c(0x145)]);else _0x53795c(0x160)in _0xf24f2f&&console[_0x53795c(0x160)](_0x53795c(0x123)+_0xf24f2f[_0x53795c(0x160)]);}}export class ChatCreateCommand extends BaseCommand{[a8_0x24fde1(0x13b)]=a8_0x24fde1(0x130);[a8_0x24fde1(0x141)]=a8_0x24fde1(0x14f);['validate'](_0x4df171){const _0x2cc2ca=a8_0x24fde1,_0x369a6a=_0x4df171[_0x2cc2ca(0x133)],_0x455f5e=_0x369a6a[_0x2cc2ca(0x15d)],_0x64000e=_0x369a6a[_0x2cc2ca(0x127)];if(!_0x455f5e&&!_0x64000e)return'Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22';return undefined;}async[a8_0x24fde1(0x144)](_0x7502ef){const _0x50b4b4=a8_0x24fde1,{options:_0x17bd02,tdx:_0x4b21bb}=_0x7502ef,_0x45a858=_0x17bd02,_0x15bb31=_0x45a858['agent'],_0x12f7f5=_0x45a858[_0x50b4b4(0x127)],_0x29f45d=_0x45a858[_0x50b4b4(0x156)];try{const _0x52a0ae=await resolveAgentId(_0x4b21bb,_0x15bb31,_0x12f7f5,_0x29f45d,_0x17bd02[_0x50b4b4(0x163)]),_0x323731=await _0x4b21bb[_0x50b4b4(0x12f)][_0x50b4b4(0x126)](_0x52a0ae);return saveLastChatId(_0x323731['id']),console[_0x50b4b4(0x140)](JSON[_0x50b4b4(0x150)]({'chatId':_0x323731['id'],'agentId':_0x52a0ae})),0x0;}catch(_0x570352){return handleSDKError(_0x570352,_0x17bd02),0x1;}}}