@treasuredata/tdx 0.16.9 → 0.16.11
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.
- package/README.md +3 -2
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.d.ts.map +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/claude-usage-command.js.map +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/llm-proxy.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/anthropic-adapter.js +1 -1
- package/dist/proxy/claude-usage-tracker.d.ts +31 -0
- package/dist/proxy/claude-usage-tracker.d.ts.map +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/claude-usage-tracker.js.map +1 -1
- package/dist/proxy/context-signature.js +1 -1
- package/dist/proxy/conversation-utils.js +1 -1
- package/dist/proxy/passthrough-server.d.ts.map +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/passthrough-server.js.map +1 -1
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/session-cache.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.d.ts +0 -1
- package/dist/sdk/index.d.ts.map +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-aliases.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/port.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
- package/dist/sdk/claude-agent/claude-agent-client.d.ts +0 -73
- package/dist/sdk/claude-agent/claude-agent-client.d.ts.map +0 -1
- package/dist/sdk/claude-agent/claude-agent-client.js +0 -1
- package/dist/sdk/claude-agent/claude-agent-client.js.map +0 -1
- package/dist/sdk/claude-agent/environment.d.ts +0 -59
- package/dist/sdk/claude-agent/environment.d.ts.map +0 -1
- package/dist/sdk/claude-agent/environment.js +0 -1
- package/dist/sdk/claude-agent/environment.js.map +0 -1
- package/dist/sdk/claude-agent/index.d.ts +0 -15
- package/dist/sdk/claude-agent/index.d.ts.map +0 -1
- package/dist/sdk/claude-agent/index.js +0 -1
- package/dist/sdk/claude-agent/index.js.map +0 -1
- package/dist/sdk/claude-agent/system-prompts.d.ts +0 -22
- package/dist/sdk/claude-agent/system-prompts.d.ts.map +0 -1
- package/dist/sdk/claude-agent/system-prompts.js +0 -1
- package/dist/sdk/claude-agent/system-prompts.js.map +0 -1
- package/dist/sdk/claude-agent/types.d.ts +0 -107
- package/dist/sdk/claude-agent/types.d.ts.map +0 -1
- package/dist/sdk/claude-agent/types.js +0 -1
- package/dist/sdk/claude-agent/types.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a3_0x2942b3=a3_0x54c2;(function(_0x31667b,_0x5e1bbc){const _0x54ffe9=a3_0x54c2,_0x3bea6d=_0x31667b();while(!![]){try{const _0x2e5413=-parseInt(_0x54ffe9(0x14e))/0x1+-parseInt(_0x54ffe9(0x142))/0x2+parseInt(_0x54ffe9(0x159))/0x3*(parseInt(_0x54ffe9(0x15d))/0x4)+-parseInt(_0x54ffe9(0x14c))/0x5*(-parseInt(_0x54ffe9(0x146))/0x6)+parseInt(_0x54ffe9(0x156))/0x7+-parseInt(_0x54ffe9(0x14d))/0x8*(-parseInt(_0x54ffe9(0x161))/0x9)+parseInt(_0x54ffe9(0x158))/0xa*(-parseInt(_0x54ffe9(0x149))/0xb);if(_0x2e5413===_0x5e1bbc)break;else _0x3bea6d['push'](_0x3bea6d['shift']());}catch(_0x5d8319){_0x3bea6d['push'](_0x3bea6d['shift']());}}}(a3_0x299e,0x9c6c4));import{BaseCommand}from'./command.js';function a3_0x299e(){const _0x1cf488=['2012EhJPYJ','Listing\x20activations\x20for\x20segment\x20\x27','\x27...','cause','18CnKtdP','execute','resolveSegmentId','\x20\x20Cause:\x20','Resolving\x20parent\x20segment\x20\x27','738702zcmTqJ','✔\x20Found\x20','Site:\x20','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','6984LCPVTo','message','Resolved\x20child\x20ID:\x20','671uCkkiQ','length','Resolved\x20parent\x20ID:\x20','2900URvLlP','266416RSzfeg','145895JUxgJg','activations','error','verbose','segment','data','site','\x20activation','5644366sgxrak','resolveParentId','99490MzTxbo','1281SDFLlA','List\x20activations\x20for\x20a\x20segment','Child\x20name:\x20','name'];a3_0x299e=function(){return _0x1cf488;};return a3_0x299e();}import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';function a3_0x54c2(_0x287002,_0x4f45c5){_0x287002=_0x287002-0x142;const _0x299e32=a3_0x299e();let _0x54c2c1=_0x299e32[_0x287002];return _0x54c2c1;}import{withSpinner}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';export class ActivationsCommand extends BaseCommand{[a3_0x2942b3(0x15c)]=a3_0x2942b3(0x14f);['description']=a3_0x2942b3(0x15a);async[a3_0x2942b3(0x162)](_0x58afd2){const _0x31772c=a3_0x2942b3,{options:_0x43ffc4,args:_0x5198eb,tdx:_0x493f19}=_0x58afd2;if(_0x5198eb['length']===0x0)return console[_0x31772c(0x150)]('Error:\x20Segment\x20name\x20is\x20required'),console['error'](_0x31772c(0x145)),0x1;try{const {parentId:_0x2343ae,childId:_0x16bde4}=parseSegmentRef(_0x5198eb[0x0]);if(!_0x16bde4)return console['error']('Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations'),console[_0x31772c(0x150)](_0x31772c(0x145)),0x1;_0x43ffc4[_0x31772c(0x151)]&&(console[_0x31772c(0x150)](_0x31772c(0x144)+_0x43ffc4[_0x31772c(0x154)]),console[_0x31772c(0x150)]('Parent\x20name:\x20'+_0x2343ae),console[_0x31772c(0x150)](_0x31772c(0x15b)+_0x16bde4));const _0x355a13=await withSpinner(_0x31772c(0x165)+_0x2343ae+_0x31772c(0x15f),()=>_0x493f19['segment'][_0x31772c(0x157)](_0x2343ae),{'verbose':_0x43ffc4[_0x31772c(0x151)]}),_0x595179=_0x355a13[_0x31772c(0x153)];_0x43ffc4['verbose']&&console[_0x31772c(0x150)](_0x31772c(0x14b)+_0x595179);const _0x96ad67=await withSpinner('Resolving\x20child\x20segment\x20\x27'+_0x16bde4+_0x31772c(0x15f),()=>_0x493f19['segment'][_0x31772c(0x163)](_0x595179,_0x16bde4),{'verbose':_0x43ffc4['verbose']}),_0x313dd2=_0x96ad67['data'];_0x43ffc4['verbose']&&console['error'](_0x31772c(0x148)+_0x313dd2);const _0x2e6d15=await withSpinner(_0x31772c(0x15e)+_0x16bde4+'\x27...',()=>_0x493f19[_0x31772c(0x152)]['listActivations'](_0x595179,_0x313dd2),{'verbose':_0x43ffc4['verbose']}),_0x468f7d=_0x2e6d15[_0x31772c(0x153)];return console[_0x31772c(0x150)](_0x31772c(0x143)+_0x468f7d[_0x31772c(0x14a)]+_0x31772c(0x155)+(_0x468f7d[_0x31772c(0x14a)]!==0x1?'s':'')),await handleSDKOutput(_0x468f7d,_0x43ffc4),0x0;}catch(_0x255831){if(_0x255831 instanceof SDKError)return console[_0x31772c(0x150)]('Error:\x20'+_0x255831[_0x31772c(0x147)]),_0x255831[_0x31772c(0x160)]&&console[_0x31772c(0x150)](_0x31772c(0x164)+_0x255831[_0x31772c(0x160)]),0x1;throw _0x255831;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a4_0x29ee8f=a4_0x1a68;(function(_0x5871b8,_0x294a09){const _0x5689c3=a4_0x1a68,_0x1ca796=_0x5871b8();while(!![]){try{const _0x3160df=-parseInt(_0x5689c3(0x226))/0x1*(parseInt(_0x5689c3(0x21a))/0x2)+parseInt(_0x5689c3(0x1f4))/0x3*(-parseInt(_0x5689c3(0x247))/0x4)+-parseInt(_0x5689c3(0x1bd))/0x5+-parseInt(_0x5689c3(0x213))/0x6*(-parseInt(_0x5689c3(0x1c8))/0x7)+parseInt(_0x5689c3(0x22d))/0x8*(-parseInt(_0x5689c3(0x252))/0x9)+-parseInt(_0x5689c3(0x1b6))/0xa*(-parseInt(_0x5689c3(0x219))/0xb)+parseInt(_0x5689c3(0x22a))/0xc*(parseInt(_0x5689c3(0x235))/0xd);if(_0x3160df===_0x294a09)break;else _0x1ca796['push'](_0x1ca796['shift']());}catch(_0x3dda64){_0x1ca796['push'](_0x1ca796['shift']());}}}(a4_0x54a3,0x58a23));import a4_0x4024b3 from'chalk';import a4_0x136472 from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a4_0x1a68(_0x3ba45b,_0x14e1e0){_0x3ba45b=_0x3ba45b-0x1ae;const _0x54a3a9=a4_0x54a3();let _0x1a6824=_0x54a3a9[_0x3ba45b];return _0x1a6824;}import{withSpinner}from'../utils/spinner.js';import{confirmKey}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x4dd26f){const _0x4bca66=a4_0x1a68,_0xe01403=[];if(_0x4dd26f[_0x4bca66(0x1f2)]!==undefined)_0xe01403[_0x4bca66(0x20b)](_0x4dd26f[_0x4bca66(0x1f2)]+_0x4bca66(0x1b0));if(_0x4dd26f[_0x4bca66(0x206)]!==undefined&&_0x4dd26f[_0x4bca66(0x206)]>0x0)_0xe01403[_0x4bca66(0x20b)](a4_0x4024b3['green'](_0x4dd26f['new']+_0x4bca66(0x1ed)));if(_0x4dd26f[_0x4bca66(0x1b4)]!==undefined&&_0x4dd26f[_0x4bca66(0x1b4)]>0x0)_0xe01403[_0x4bca66(0x20b)](a4_0x4024b3[_0x4bca66(0x222)](_0x4dd26f[_0x4bca66(0x1b4)]+_0x4bca66(0x1e9)));if(_0x4dd26f[_0x4bca66(0x249)]!==undefined&&_0x4dd26f[_0x4bca66(0x249)]>0x0)_0xe01403['push'](a4_0x4024b3[_0x4bca66(0x218)](_0x4dd26f['updated']+_0x4bca66(0x1ce)));if(_0x4dd26f[_0x4bca66(0x205)]!==undefined&&_0x4dd26f[_0x4bca66(0x205)]>0x0)_0xe01403[_0x4bca66(0x20b)](a4_0x4024b3['gray'](_0x4dd26f['unchanged']+_0x4bca66(0x246)));if(_0x4dd26f[_0x4bca66(0x1bc)]!==undefined&&_0x4dd26f[_0x4bca66(0x1bc)]>0x0)_0xe01403[_0x4bca66(0x20b)](a4_0x4024b3[_0x4bca66(0x1f9)](_0x4dd26f[_0x4bca66(0x1bc)]+_0x4bca66(0x1f5)));return _0xe01403[_0x4bca66(0x240)](',\x20');}function displayDiffs(_0x5dec1b,_0x4400a5,_0x13169d,_0x3d4cea,_0x51c9f1=[]){const _0x44bec0=a4_0x1a68;for(const _0x26e2c4 of _0x5dec1b){if(_0x26e2c4[_0x44bec0(0x245)]){const _0x4a1e9b=_0x26e2c4[_0x44bec0(0x225)]||_0x26e2c4[_0x44bec0(0x1f0)];console[_0x44bec0(0x1c1)]('\x0aChanges\x20to\x20agent\x20\x27'+_0x4a1e9b+'\x27:'),console[_0x44bec0(0x1c1)]('─'[_0x44bec0(0x1cd)](0x3c)),console['log'](_0x26e2c4['diff']),console['log']('─'[_0x44bec0(0x1cd)](0x3c));}}for(const _0x2c9b40 of _0x4400a5){_0x2c9b40[_0x44bec0(0x245)]&&(console[_0x44bec0(0x1c1)](_0x44bec0(0x1d5)+_0x2c9b40[_0x44bec0(0x1f0)]+'\x27:'),console[_0x44bec0(0x1c1)]('─'['repeat'](0x3c)),console[_0x44bec0(0x1c1)](_0x2c9b40[_0x44bec0(0x245)]),console[_0x44bec0(0x1c1)]('─'[_0x44bec0(0x1cd)](0x3c)));}for(const _0x3c0941 of _0x13169d){_0x3c0941[_0x44bec0(0x245)]&&(console['log']('\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27'+_0x3c0941[_0x44bec0(0x1f0)]+'\x27:'),console[_0x44bec0(0x1c1)]('─'[_0x44bec0(0x1cd)](0x3c)),console['log'](_0x3c0941[_0x44bec0(0x245)]),console['log']('─'[_0x44bec0(0x1cd)](0x3c)));}for(const _0x52fb1b of _0x3d4cea){_0x52fb1b['diff']&&(console[_0x44bec0(0x1c1)](_0x44bec0(0x1af)+_0x52fb1b[_0x44bec0(0x1f0)]+'\x27:'),console[_0x44bec0(0x1c1)]('─'[_0x44bec0(0x1cd)](0x3c)),console[_0x44bec0(0x1c1)](_0x52fb1b[_0x44bec0(0x245)]),console[_0x44bec0(0x1c1)]('─'[_0x44bec0(0x1cd)](0x3c)));}for(const _0x3e8d07 of _0x51c9f1){_0x3e8d07[_0x44bec0(0x245)]&&(console[_0x44bec0(0x1c1)]('\x0aChanges\x20to\x20integration\x20\x27'+_0x3e8d07[_0x44bec0(0x1f0)]+'\x27:'),console['log']('─'['repeat'](0x3c)),console[_0x44bec0(0x1c1)](_0x3e8d07['diff']),console[_0x44bec0(0x1c1)]('─'[_0x44bec0(0x1cd)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x29ee8f(0x1f0)]=a4_0x29ee8f(0x1e4);[a4_0x29ee8f(0x1c0)]=a4_0x29ee8f(0x1fe);async[a4_0x29ee8f(0x1f3)](_0x172b30){const _0x1ede79=a4_0x29ee8f,{options:_0x38d1da,args:_0x23a917,tdx:_0x51686c}=_0x172b30,_0x3854aa=_0x23a917[0x0],_0x7f3556=_0x23a917[0x1],_0x3d9182=_0x38d1da[_0x1ede79(0x1e5)],_0x68e919=_0x38d1da['dryRun'],_0x161fbf=_0x38d1da[_0x1ede79(0x23f)],_0x29d0d5=_0x38d1da['yes'],_0x5e9b59=_0x38d1da[_0x1ede79(0x1e2)];let _0x2e342d,_0x4ec271;const _0x2e2d45=findAgentConfigPath(process[_0x1ede79(0x250)]());if(_0x3854aa){const _0x1c5fc4=a4_0x136472[_0x1ede79(0x240)](_0x3854aa,_0x1ede79(0x1d3));if(existsSync(_0x1c5fc4))try{const _0x2a46f7=JSON['parse'](readFileSync(_0x1c5fc4,_0x1ede79(0x215)));_0x2e342d=_0x2a46f7[_0x1ede79(0x1be)],_0x4ec271=_0x3854aa,console[_0x1ede79(0x1c1)](a4_0x4024b3[_0x1ede79(0x1df)](_0x1ede79(0x1cc)+_0x1c5fc4+':\x20'+_0x2e342d));}catch{_0x2e342d=_0x3854aa;}else _0x2e342d=_0x3854aa;}else{if(_0x2e2d45)try{const _0x4c2f87=JSON[_0x1ede79(0x1c4)](readFileSync(_0x2e2d45,_0x1ede79(0x215)));_0x2e342d=_0x4c2f87[_0x1ede79(0x1be)],_0x4ec271=a4_0x136472[_0x1ede79(0x232)](_0x2e2d45),console[_0x1ede79(0x1c1)](a4_0x4024b3[_0x1ede79(0x1df)](_0x1ede79(0x1dc)+_0x2e342d));}catch{_0x2e342d=_0x5e9b59;}else _0x2e342d=_0x5e9b59;}if(!_0x2e342d)return console[_0x1ede79(0x1c1)](a4_0x4024b3[_0x1ede79(0x218)]('llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a')),console[_0x1ede79(0x1c1)]('Usage:\x20tdx\x20agent\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20project\x20(requires\x20context\x20or\x20tdx.json)'),console[_0x1ede79(0x1c1)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project'),console[_0x1ede79(0x1c1)](_0x1ede79(0x1de)),console[_0x1ede79(0x1c1)](_0x1ede79(0x22c)),0x1;if(_0x7f3556){const {data:_0x442b85}=await withSpinner(_0x1ede79(0x20d)+_0x7f3556+_0x1ede79(0x209)+_0x2e342d+_0x1ede79(0x23b),()=>_0x51686c[_0x1ede79(0x251)]['pullAgent'](_0x2e342d,_0x7f3556,_0x3d9182,{'dryRun':_0x68e919,'force':_0x161fbf}));if(_0x68e919)return console['log'](a4_0x4024b3[_0x1ede79(0x218)]('Dry\x20run\x20-\x20no\x20files\x20written')),console['log'](_0x1ede79(0x228)+_0x442b85['agentName']),console['log'](_0x1ede79(0x242)+_0x442b85[_0x1ede79(0x23c)]),_0x442b85['diff']&&(console['log'](_0x1ede79(0x237)),console['log']('─'[_0x1ede79(0x1cd)](0x3c)),console[_0x1ede79(0x1c1)](_0x442b85[_0x1ede79(0x245)]),console['log']('─'[_0x1ede79(0x1cd)](0x3c))),0x0;return console[_0x1ede79(0x1c1)](a4_0x4024b3[_0x1ede79(0x222)](_0x1ede79(0x22f))),console[_0x1ede79(0x1c1)](_0x1ede79(0x224)+_0x442b85[_0x1ede79(0x225)]),console[_0x1ede79(0x1c1)](_0x1ede79(0x1c9)+_0x442b85['outputPath']),console['log']('Status:\x20'+(_0x442b85[_0x1ede79(0x227)]?a4_0x4024b3[_0x1ede79(0x222)](_0x1ede79(0x206)):_0x442b85[_0x1ede79(0x22b)]?a4_0x4024b3[_0x1ede79(0x218)](_0x1ede79(0x249)):a4_0x4024b3[_0x1ede79(0x1b9)](_0x1ede79(0x205)))),0x0;}const _0x22ca32=_0x4ec271||_0x3d9182,{data:_0x478309}=await withSpinner(_0x1ede79(0x1b7)+_0x2e342d+_0x1ede79(0x23b),()=>_0x51686c[_0x1ede79(0x251)][_0x1ede79(0x1ff)](_0x2e342d,_0x22ca32,{'dryRun':!![]})),_0x24eb72=_0x478309['counts'][_0x1ede79(0x21b)]['new']+_0x478309[_0x1ede79(0x200)][_0x1ede79(0x1e6)]['new']+_0x478309[_0x1ede79(0x200)]['textKnowledgeBases'][_0x1ede79(0x206)]+_0x478309[_0x1ede79(0x200)]['prompts'][_0x1ede79(0x206)]+_0x478309[_0x1ede79(0x200)][_0x1ede79(0x1e8)][_0x1ede79(0x206)],_0x57534c=_0x478309[_0x1ede79(0x200)]['agents'][_0x1ede79(0x249)]+_0x478309['counts']['knowledgeBases'][_0x1ede79(0x249)]+_0x478309[_0x1ede79(0x200)][_0x1ede79(0x1ae)][_0x1ede79(0x249)]+_0x478309['counts']['prompts'][_0x1ede79(0x249)]+_0x478309['counts'][_0x1ede79(0x1e8)]['updated'],_0x13512a=_0x478309[_0x1ede79(0x200)][_0x1ede79(0x21b)][_0x1ede79(0x205)]+_0x478309['counts'][_0x1ede79(0x1e6)][_0x1ede79(0x205)]+_0x478309['counts'][_0x1ede79(0x1ae)][_0x1ede79(0x205)]+_0x478309[_0x1ede79(0x200)]['prompts']['unchanged']+_0x478309['counts']['integrations'][_0x1ede79(0x205)];console[_0x1ede79(0x1c1)](_0x1ede79(0x243)+_0x478309[_0x1ede79(0x236)]+'\x27:'),console[_0x1ede79(0x1c1)]('\x20\x20'+a4_0x4024b3[_0x1ede79(0x222)]('+\x20'+_0x24eb72+'\x20new')+_0x1ede79(0x1dd)+a4_0x4024b3[_0x1ede79(0x218)]('~\x20'+_0x57534c+'\x20changed')+'\x20|\x20'+a4_0x4024b3['dim']('=\x20'+_0x13512a+_0x1ede79(0x246))),console[_0x1ede79(0x1c1)](_0x1ede79(0x1fd)+formatCountSummary(_0x478309['counts'][_0x1ede79(0x21b)])),console[_0x1ede79(0x1c1)](_0x1ede79(0x21e)+formatCountSummary(_0x478309[_0x1ede79(0x200)][_0x1ede79(0x1e6)])),console[_0x1ede79(0x1c1)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x478309['counts']['textKnowledgeBases'])),console[_0x1ede79(0x1c1)](_0x1ede79(0x1ef)+formatCountSummary(_0x478309[_0x1ede79(0x200)][_0x1ede79(0x24c)])),console[_0x1ede79(0x1c1)](_0x1ede79(0x1ea)+formatCountSummary(_0x478309[_0x1ede79(0x200)][_0x1ede79(0x1e8)])),console[_0x1ede79(0x1c1)]('\x20\x20Target:\x20'+a4_0x4024b3['cyan'](_0x478309['outputDir'])),displayDiffs(_0x478309[_0x1ede79(0x21b)],_0x478309[_0x1ede79(0x1e6)],_0x478309['textKnowledgeBases'],_0x478309[_0x1ede79(0x24c)],_0x478309[_0x1ede79(0x1e8)]);if(_0x68e919)return console[_0x1ede79(0x1c1)](a4_0x4024b3['yellow']('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x24eb72===0x0&&_0x57534c===0x0)return console[_0x1ede79(0x1c1)](a4_0x4024b3['green'](_0x1ede79(0x231))),saveSessionContext({'llm_project':_0x478309[_0x1ede79(0x236)]},_0x38d1da[_0x1ede79(0x24e)]),console[_0x1ede79(0x1c1)](a4_0x4024b3['green'](_0x1ede79(0x1e7)+a4_0x4024b3[_0x1ede79(0x1df)](_0x1ede79(0x1be))+'\x20=\x20'+a4_0x4024b3[_0x1ede79(0x23d)](_0x478309[_0x1ede79(0x236)]))),0x0;if(!_0x29d0d5&&!_0x161fbf){const _0x29839a=await confirmKey(_0x1ede79(0x203)+(_0x24eb72+_0x57534c)+_0x1ede79(0x24a));if(!_0x29839a)return console[_0x1ede79(0x1c1)](_0x1ede79(0x21f)),0x0;}const {data:_0x480e38}=await withSpinner(_0x1ede79(0x1c3),()=>_0x51686c[_0x1ede79(0x251)][_0x1ede79(0x1ff)](_0x2e342d,_0x22ca32,{'force':_0x161fbf}));return console[_0x1ede79(0x1c1)](a4_0x4024b3[_0x1ede79(0x222)](_0x1ede79(0x212)+(_0x24eb72+_0x57534c)+_0x1ede79(0x1cb)+_0x480e38['outputDir'])),saveSessionContext({'llm_project':_0x480e38[_0x1ede79(0x236)]},_0x38d1da['session']),console[_0x1ede79(0x1c1)](a4_0x4024b3[_0x1ede79(0x222)](_0x1ede79(0x1e7)+a4_0x4024b3['dim'](_0x1ede79(0x1be))+_0x1ede79(0x207)+a4_0x4024b3[_0x1ede79(0x23d)](_0x480e38[_0x1ede79(0x236)]))),0x0;}}function a4_0x54a3(){const _0x55f584=['\x20--name\x20','Source:\x20','\x20new','projectDir','\x20\x20Prompts:\x20','name','source','total','execute','27hcXziC','\x20errors','Using\x20context\x20project:\x20','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','newProjectName','red','Using\x20current\x20project:\x20','Pushing\x20agent\x20from\x20\x22','\x20--profile\x20','\x20\x20Agents:\x20','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','pullProject','counts','\x20\x20Integration\x20\x22','agentId','\x0aWrite\x20','\x20\x20Knowledge\x20Base\x20\x22','unchanged','new','\x20=\x20','Would\x20clone:','\x22\x20from\x20project\x20\x22','Dry\x20run\x20-\x20no\x20changes\x20made','push','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','Pulling\x20agent\x20\x22','Pushing\x20to\x20project...','No\x20tdx.json\x20found\x20in\x20','\x22:\x20','Clone\x20cancelled','\x0a✔\x20Pulled\x20','601212JVZxLi','agent.yml','utf-8','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','Summary:','yellow','17413cznEgl','2OeEGxA','agents','Cannot\x20clone\x20from\x20context\x20project\x20\x22','found','\x20\x20Knowledge\x20Bases:\x20','Pull\x20cancelled','<new-name>','\x0aPush\x20summary\x20for\x20\x27','green','profile','Agent:\x20','agentName','172307pQitqs','isNew','Would\x20pull\x20agent:\x20','\x0aErrors\x20found:','24bFSQNF','hasChanges','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20#\x20Pull\x20specific\x20agent','580256UlvEye','\x20\x20tdx\x20agent\x20pull\x20','Agent\x20pulled\x20successfully','Project\x20cloned\x20with\x20errors','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','dirname','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','\x20\x20Text\x20Knowledge\x20Base\x20\x22','1096615CucVjC','projectName','\x0aChanges:','\x22\x20to\x20\x22','\x0aPush\x20','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','\x22...','outputPath','cyan','no_local_folder','force','join','New\x20project\x20ID:\x20','Output\x20path:\x20','\x0aPull\x20summary\x20for\x20\x27','Failed\x20to\x20push\x20agent:\x20','diff','\x20unchanged','114084YMGiYg','INVALID_ARGUMENT','updated','\x20files?','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','prompts','Chat:\x20','session','New\x20project:\x20','cwd','llm','9xCyPoY','textKnowledgeBases','\x0aChanges\x20to\x20prompt\x20\x27','\x20total','newProjectId','\x20resources\x20to\x20\x27','action','created','\x0aProject\x20pushed\x20with\x20errors','2510oyMvxY','Analyzing\x20project\x20\x22','\x20\x20Agent\x20\x22','gray','\x0a✔\x20Pushed\x20','error','errors','1012410WHvnpq','llm_project','dryRun','description','log','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','Writing\x20files...','parse','Cloning\x20\x22','\x20\x20Text\x20Knowledge\x20Bases:\x20','Agent\x20','35omxAfz','Output:\x20','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','\x20files\x20to\x20','Using\x20project\x20from\x20','repeat','\x20updated','Project:\x20','projectId','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','tdx.json','context','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','MISSING_ARGUMENT','message','site','Using\x20local\x20project:\x20','\x27\x20to\x20create\x20the\x20folder\x20structure.','Analyzing\x20changes\x20to\x20push...','Using\x20project:\x20','\x20|\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory','dim','sourceProjectName','Errors:','llmProject','Would\x20push\x20agent:\x20','agent:pull','output','knowledgeBases','✔\x20Context\x20set:\x20','integrations','\x20created','\x20\x20Integrations:\x20'];a4_0x54a3=function(){return _0x55f584;};return a4_0x54a3();}export class AgentCloneCommand extends BaseCommand{[a4_0x29ee8f(0x1f0)]='agent:clone';[a4_0x29ee8f(0x1c0)]=a4_0x29ee8f(0x233);async[a4_0x29ee8f(0x1f3)](_0x593327){const _0x33a40a=a4_0x29ee8f,{options:_0x3a66e3,args:_0x264050,tdx:_0x3fe438}=_0x593327,_0x4d3d95=_0x264050[0x0],_0x5f22b2=_0x3a66e3[_0x33a40a(0x1f0)],_0x366614=_0x3a66e3['dryRun'],_0x29e857=_0x3a66e3['yes'],_0x4462d4=_0x3a66e3[_0x33a40a(0x1d8)],_0x149b98=_0x3a66e3[_0x33a40a(0x1e2)];let _0x19adeb;const _0x573b44=findAgentConfigPath(process[_0x33a40a(0x250)]());if(_0x4d3d95){const _0x196bab=a4_0x136472['join'](_0x4d3d95,'tdx.json');existsSync(_0x196bab)?(_0x19adeb=_0x4d3d95,console[_0x33a40a(0x1c1)](a4_0x4024b3[_0x33a40a(0x1df)](_0x33a40a(0x1d9)+_0x4d3d95))):_0x19adeb=_0x4d3d95;}else{if(_0x573b44)_0x19adeb=a4_0x136472[_0x33a40a(0x232)](_0x573b44),console['log'](a4_0x4024b3[_0x33a40a(0x1df)](_0x33a40a(0x1fa)+_0x19adeb));else{if(_0x149b98){const _0x24a836=sanitizeForFilesystem(_0x149b98);let _0x148810=_0x24a836,_0x2fc229=a4_0x136472[_0x33a40a(0x240)](process[_0x33a40a(0x250)](),_0x33a40a(0x21b),_0x24a836,'tdx.json');if(!existsSync(_0x2fc229)){const _0x32eb56=normalizeName(_0x149b98),_0x8cbcbc=a4_0x136472[_0x33a40a(0x240)](process['cwd'](),_0x33a40a(0x21b),_0x32eb56,_0x33a40a(0x1d3));existsSync(_0x8cbcbc)&&(_0x148810=_0x32eb56,_0x2fc229=_0x8cbcbc);}if(existsSync(_0x2fc229))_0x19adeb=a4_0x136472[_0x33a40a(0x232)](_0x2fc229),console['log'](a4_0x4024b3[_0x33a40a(0x1df)](_0x33a40a(0x1d9)+_0x19adeb));else{const _0x4aa511=_0x3a66e3[_0x33a40a(0x223)];if(_0x4aa511)throw new SDKError(ErrorCode[_0x33a40a(0x248)],_0x33a40a(0x21c)+_0x149b98+'\x22\x20to\x20a\x20different\x20profile',undefined,{'helpText':_0x33a40a(0x1ca)+_0x33a40a(0x23a)+(_0x33a40a(0x22e)+_0x149b98+'\x0a')+('\x20\x20tdx\x20agent\x20clone\x20agents/'+_0x148810+_0x33a40a(0x1eb)+(_0x5f22b2||_0x33a40a(0x220))+_0x33a40a(0x1fc)+_0x4aa511)});_0x19adeb=_0x149b98,console[_0x33a40a(0x1c1)](a4_0x4024b3[_0x33a40a(0x1df)](_0x33a40a(0x1f6)+_0x149b98));}}}}if(!_0x19adeb)return console['log'](a4_0x4024b3[_0x33a40a(0x218)](_0x33a40a(0x216))),console[_0x33a40a(0x1c1)]('\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project'),console['log'](_0x33a40a(0x1d2)),console[_0x33a40a(0x1c1)]('\x20\x20tdx\x20agent\x20clone\x20--name\x20<new-name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clone\x20from\x20context\x20(llm_project)'),console['log'](_0x33a40a(0x1d1)),0x1;if(!_0x5f22b2)throw new SDKError(ErrorCode[_0x33a40a(0x1d6)],'New\x20project\x20name\x20is\x20required',undefined,{'helpText':_0x33a40a(0x1c2)});if(!_0x29e857&&!_0x366614){const _0x2904bc=await confirmKey('Clone\x20\x22'+_0x19adeb+'\x22\x20to\x20new\x20project\x20\x22'+_0x5f22b2+'\x22?');if(!_0x2904bc)return console['log'](_0x33a40a(0x211)),0x0;}const {data:_0x3f85b2}=await withSpinner(_0x33a40a(0x1c5)+_0x19adeb+_0x33a40a(0x238)+_0x5f22b2+_0x33a40a(0x23b),()=>_0x3fe438[_0x33a40a(0x251)]['cloneProject'](_0x19adeb,_0x5f22b2,{'dryRun':_0x366614}));if(_0x366614)return console[_0x33a40a(0x1c1)](a4_0x4024b3[_0x33a40a(0x218)](_0x33a40a(0x20a))),console[_0x33a40a(0x1c1)]('Source:\x20'+_0x3f85b2[_0x33a40a(0x1e0)]),console['log'](_0x33a40a(0x24f)+_0x5f22b2),console[_0x33a40a(0x1c1)](_0x33a40a(0x208)),console[_0x33a40a(0x1c1)](_0x33a40a(0x1fd)+_0x3f85b2[_0x33a40a(0x200)][_0x33a40a(0x21b)]['created']),console['log'](_0x33a40a(0x21e)+_0x3f85b2[_0x33a40a(0x200)][_0x33a40a(0x1e6)][_0x33a40a(0x1b4)]),console[_0x33a40a(0x1c1)]('\x20\x20Prompts:\x20'+_0x3f85b2[_0x33a40a(0x200)][_0x33a40a(0x24c)][_0x33a40a(0x1b4)]),0x0;const _0x44e621=_0x3f85b2[_0x33a40a(0x200)][_0x33a40a(0x21b)]['errors']>0x0||_0x3f85b2['counts'][_0x33a40a(0x1e6)][_0x33a40a(0x1bc)]>0x0||_0x3f85b2['counts'][_0x33a40a(0x24c)][_0x33a40a(0x1bc)]>0x0;_0x44e621?console[_0x33a40a(0x1c1)](a4_0x4024b3[_0x33a40a(0x218)](_0x33a40a(0x230))):console[_0x33a40a(0x1c1)](a4_0x4024b3[_0x33a40a(0x222)]('Project\x20cloned\x20successfully'));console['log'](_0x33a40a(0x1ec)+_0x3f85b2[_0x33a40a(0x1e0)]),console['log'](_0x33a40a(0x24f)+_0x3f85b2[_0x33a40a(0x1f8)]),console[_0x33a40a(0x1c1)](_0x33a40a(0x241)+_0x3f85b2[_0x33a40a(0x1b1)]),console['log'](),console[_0x33a40a(0x1c1)](_0x33a40a(0x217)),console[_0x33a40a(0x1c1)](_0x33a40a(0x1fd)+formatCountSummary(_0x3f85b2[_0x33a40a(0x200)][_0x33a40a(0x21b)])),console[_0x33a40a(0x1c1)](_0x33a40a(0x21e)+formatCountSummary(_0x3f85b2['counts']['knowledgeBases'])),console[_0x33a40a(0x1c1)](_0x33a40a(0x1ef)+formatCountSummary(_0x3f85b2['counts'][_0x33a40a(0x24c)])),console['log'](_0x33a40a(0x1ea)+formatCountSummary(_0x3f85b2[_0x33a40a(0x200)][_0x33a40a(0x1e8)]));if(_0x44e621){console[_0x33a40a(0x1c1)](),console[_0x33a40a(0x1c1)](a4_0x4024b3[_0x33a40a(0x1f9)]('Errors:'));for(const _0x465c61 of _0x3f85b2[_0x33a40a(0x21b)]){_0x465c61[_0x33a40a(0x1b3)]===_0x33a40a(0x1bb)&&console[_0x33a40a(0x1c1)](a4_0x4024b3[_0x33a40a(0x1f9)](_0x33a40a(0x1b8)+_0x465c61[_0x33a40a(0x225)]+'\x22:\x20'+_0x465c61[_0x33a40a(0x1bb)]));}for(const _0x25191e of _0x3f85b2[_0x33a40a(0x1e6)]){_0x25191e['action']===_0x33a40a(0x1bb)&&console['log'](a4_0x4024b3['red'](_0x33a40a(0x204)+_0x25191e[_0x33a40a(0x1f0)]+_0x33a40a(0x210)+_0x25191e[_0x33a40a(0x1bb)]));}for(const _0x521442 of _0x3f85b2[_0x33a40a(0x24c)]){_0x521442[_0x33a40a(0x1b3)]===_0x33a40a(0x1bb)&&console[_0x33a40a(0x1c1)](a4_0x4024b3['red']('\x20\x20Prompt\x20\x22'+_0x521442['name']+_0x33a40a(0x210)+_0x521442[_0x33a40a(0x1bb)]));}for(const _0xe6c08c of _0x3f85b2[_0x33a40a(0x1e8)]){_0xe6c08c['action']==='error'&&console[_0x33a40a(0x1c1)](a4_0x4024b3[_0x33a40a(0x1f9)]('\x20\x20Integration\x20\x22'+_0xe6c08c[_0x33a40a(0x1f0)]+_0x33a40a(0x210)+_0xe6c08c[_0x33a40a(0x1bb)]));}return 0x1;}console[_0x33a40a(0x1c1)]();const _0x142fa1=getLLMProjectUrl(_0x4462d4,_0x3f85b2['newProjectId']);return console[_0x33a40a(0x1c1)](_0x33a40a(0x1cf)+a4_0x4024b3[_0x33a40a(0x23d)](_0x142fa1)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x29ee8f(0x1f0)]='agent:push';[a4_0x29ee8f(0x1c0)]=a4_0x29ee8f(0x20c);async[a4_0x29ee8f(0x1f3)](_0x115793){const _0x1c6c75=a4_0x29ee8f,{options:_0x2117e6,args:_0x45f740,tdx:_0x287c40}=_0x115793;let _0x6a51c=_0x45f740[0x0]||process[_0x1c6c75(0x250)]();const _0x1e9154=_0x2117e6[_0x1c6c75(0x1bf)],_0x195715=_0x2117e6[_0x1c6c75(0x23f)],_0x2f7c73=_0x2117e6['yes'],_0x26f209=_0x2117e6[_0x1c6c75(0x1d8)],_0x1584d2=a4_0x136472[_0x1c6c75(0x240)](_0x6a51c,_0x1c6c75(0x214)),_0x57fc4c=existsSync(_0x1584d2);if(_0x57fc4c){const {data:_0x3d8d69}=await withSpinner(_0x1c6c75(0x1fb)+_0x6a51c+_0x1c6c75(0x23b),()=>_0x287c40[_0x1c6c75(0x251)]['pushAgent'](_0x6a51c,{'dryRun':_0x1e9154,'force':_0x195715}));if(_0x1e9154)return console[_0x1c6c75(0x1c1)](a4_0x4024b3[_0x1c6c75(0x218)](_0x1c6c75(0x20a))),console[_0x1c6c75(0x1c1)](_0x1c6c75(0x1e3)+_0x3d8d69[_0x1c6c75(0x225)]),0x0;if(_0x3d8d69[_0x1c6c75(0x1b3)]==='error')return console['log'](a4_0x4024b3[_0x1c6c75(0x1f9)](_0x1c6c75(0x244)+_0x3d8d69[_0x1c6c75(0x1bb)])),0x1;console['log'](a4_0x4024b3[_0x1c6c75(0x222)](_0x1c6c75(0x1c7)+_0x3d8d69[_0x1c6c75(0x1b3)]+'\x20successfully')),console[_0x1c6c75(0x1c1)]('Agent:\x20'+_0x3d8d69['agentName']);if(_0x3d8d69[_0x1c6c75(0x202)]&&_0x3d8d69[_0x1c6c75(0x1d0)]){const _0x4ce98b=getLLMAgentChatUrl(_0x26f209,_0x3d8d69[_0x1c6c75(0x1d0)],_0x3d8d69[_0x1c6c75(0x202)]);console[_0x1c6c75(0x1c1)](_0x1c6c75(0x24d)+a4_0x4024b3['cyan'](_0x4ce98b));}return 0x0;}const _0x459555=_0x2117e6[_0x1c6c75(0x1e2)],_0x25356d=resolveProjectFromContext(_0x6a51c,_0x459555);if(_0x25356d[_0x1c6c75(0x21d)])_0x6a51c=_0x25356d[_0x1c6c75(0x1ee)],_0x25356d[_0x1c6c75(0x1f1)]===_0x1c6c75(0x1d4)&&console[_0x1c6c75(0x1c1)](a4_0x4024b3[_0x1c6c75(0x1df)]('Using\x20project:\x20'+_0x6a51c));else{let _0x253be0='Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.';_0x25356d['reason']===_0x1c6c75(0x23e)&&(_0x253be0=_0x25356d[_0x1c6c75(0x1d7)]+_0x1c6c75(0x24b)+_0x25356d[_0x1c6c75(0x1e2)]+_0x1c6c75(0x1da));throw new SDKError(ErrorCode[_0x1c6c75(0x248)],_0x25356d['reason']==='no_context'?_0x25356d[_0x1c6c75(0x1d7)]:_0x1c6c75(0x20f)+_0x6a51c,undefined,{'helpText':_0x253be0});}const {data:_0x182c5a}=await withSpinner(_0x1c6c75(0x1db),()=>_0x287c40[_0x1c6c75(0x251)]['pushProject'](_0x6a51c,{'dryRun':!![]})),_0x37789d=_0x182c5a[_0x1c6c75(0x200)][_0x1c6c75(0x21b)][_0x1c6c75(0x1bc)]>0x0;if(_0x37789d){console[_0x1c6c75(0x1c1)](a4_0x4024b3['red'](_0x1c6c75(0x229)));for(const _0x2ac22f of _0x182c5a[_0x1c6c75(0x21b)]){_0x2ac22f[_0x1c6c75(0x1b3)]===_0x1c6c75(0x1bb)&&console['log'](a4_0x4024b3[_0x1c6c75(0x1f9)](_0x1c6c75(0x1b8)+_0x2ac22f[_0x1c6c75(0x225)]+'\x22:\x20'+_0x2ac22f[_0x1c6c75(0x1bb)]));}return 0x1;}const _0x58d4c8=_0x182c5a[_0x1c6c75(0x200)][_0x1c6c75(0x21b)][_0x1c6c75(0x1b4)]+_0x182c5a['counts'][_0x1c6c75(0x1e6)][_0x1c6c75(0x1b4)]+_0x182c5a[_0x1c6c75(0x200)]['textKnowledgeBases']['created']+_0x182c5a[_0x1c6c75(0x200)][_0x1c6c75(0x24c)][_0x1c6c75(0x1b4)]+_0x182c5a['counts'][_0x1c6c75(0x1e8)][_0x1c6c75(0x1b4)],_0x1551df=_0x182c5a[_0x1c6c75(0x200)][_0x1c6c75(0x21b)]['updated']+_0x182c5a['counts'][_0x1c6c75(0x1e6)][_0x1c6c75(0x249)]+_0x182c5a[_0x1c6c75(0x200)][_0x1c6c75(0x1ae)][_0x1c6c75(0x249)]+_0x182c5a['counts'][_0x1c6c75(0x24c)][_0x1c6c75(0x249)]+_0x182c5a[_0x1c6c75(0x200)][_0x1c6c75(0x1e8)][_0x1c6c75(0x249)],_0x3d3d16=_0x182c5a[_0x1c6c75(0x200)]['agents'][_0x1c6c75(0x205)]+_0x182c5a[_0x1c6c75(0x200)]['knowledgeBases'][_0x1c6c75(0x205)]+_0x182c5a['counts'][_0x1c6c75(0x1ae)][_0x1c6c75(0x205)]+_0x182c5a[_0x1c6c75(0x200)][_0x1c6c75(0x24c)]['unchanged']+_0x182c5a[_0x1c6c75(0x200)][_0x1c6c75(0x1e8)][_0x1c6c75(0x205)];console['log'](_0x1c6c75(0x221)+_0x182c5a['projectName']+'\x27:'),console['log']('\x20\x20'+a4_0x4024b3['green']('+\x20'+_0x58d4c8+'\x20new')+'\x20|\x20'+a4_0x4024b3[_0x1c6c75(0x218)]('~\x20'+_0x1551df+'\x20changed')+_0x1c6c75(0x1dd)+a4_0x4024b3[_0x1c6c75(0x1df)]('=\x20'+_0x3d3d16+_0x1c6c75(0x246))),console[_0x1c6c75(0x1c1)](_0x1c6c75(0x1fd)+formatCountSummary(_0x182c5a[_0x1c6c75(0x200)][_0x1c6c75(0x21b)])),console['log'](_0x1c6c75(0x21e)+formatCountSummary(_0x182c5a[_0x1c6c75(0x200)][_0x1c6c75(0x1e6)])),console[_0x1c6c75(0x1c1)](_0x1c6c75(0x1c6)+formatCountSummary(_0x182c5a[_0x1c6c75(0x200)][_0x1c6c75(0x1ae)])),console[_0x1c6c75(0x1c1)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x182c5a[_0x1c6c75(0x200)][_0x1c6c75(0x24c)])),console[_0x1c6c75(0x1c1)](_0x1c6c75(0x1ea)+formatCountSummary(_0x182c5a['counts'][_0x1c6c75(0x1e8)])),console[_0x1c6c75(0x1c1)]('\x20\x20Source:\x20'+a4_0x4024b3['cyan'](_0x6a51c)),displayDiffs(_0x182c5a['agents'],_0x182c5a[_0x1c6c75(0x1e6)],_0x182c5a['textKnowledgeBases'],_0x182c5a[_0x1c6c75(0x24c)],_0x182c5a[_0x1c6c75(0x1e8)]);if(_0x1e9154)return console[_0x1c6c75(0x1c1)](a4_0x4024b3[_0x1c6c75(0x218)](_0x1c6c75(0x1f7))),0x0;if(_0x58d4c8===0x0&&_0x1551df===0x0){console['log'](a4_0x4024b3[_0x1c6c75(0x222)]('\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date'));const _0x3d371f=getLLMProjectUrl(_0x26f209,_0x182c5a['projectId']);return console[_0x1c6c75(0x1c1)](_0x1c6c75(0x1cf)+a4_0x4024b3['cyan'](_0x3d371f)),0x0;}if(!_0x2f7c73&&!_0x195715){const _0x51af91=await confirmKey(_0x1c6c75(0x239)+(_0x58d4c8+_0x1551df)+'\x20resources?');if(!_0x51af91)return console[_0x1c6c75(0x1c1)]('Push\x20cancelled'),0x0;}const {data:_0x523448}=await withSpinner(_0x1c6c75(0x20e),()=>_0x287c40[_0x1c6c75(0x251)]['pushProject'](_0x6a51c,{'force':_0x195715})),_0x5dea50=_0x523448[_0x1c6c75(0x200)][_0x1c6c75(0x21b)][_0x1c6c75(0x1bc)]>0x0||_0x523448['counts']['knowledgeBases']['errors']>0x0||_0x523448[_0x1c6c75(0x200)][_0x1c6c75(0x1ae)][_0x1c6c75(0x1bc)]>0x0||_0x523448['counts'][_0x1c6c75(0x24c)]['errors']>0x0;if(_0x5dea50){console['log'](a4_0x4024b3['yellow'](_0x1c6c75(0x1b5))),console['log'](),console[_0x1c6c75(0x1c1)](a4_0x4024b3[_0x1c6c75(0x1f9)](_0x1c6c75(0x1e1)));for(const _0xed3497 of _0x523448[_0x1c6c75(0x21b)]){_0xed3497[_0x1c6c75(0x1b3)]===_0x1c6c75(0x1bb)&&console[_0x1c6c75(0x1c1)](a4_0x4024b3[_0x1c6c75(0x1f9)](_0x1c6c75(0x1b8)+_0xed3497[_0x1c6c75(0x225)]+_0x1c6c75(0x210)+_0xed3497[_0x1c6c75(0x1bb)]));}for(const _0x4390fd of _0x523448[_0x1c6c75(0x1e6)]){_0x4390fd[_0x1c6c75(0x1b3)]==='error'&&console[_0x1c6c75(0x1c1)](a4_0x4024b3['red'](_0x1c6c75(0x204)+_0x4390fd[_0x1c6c75(0x1f0)]+_0x1c6c75(0x210)+_0x4390fd[_0x1c6c75(0x1bb)]));}for(const _0x1c00d5 of _0x523448['textKnowledgeBases']){_0x1c00d5[_0x1c6c75(0x1b3)]===_0x1c6c75(0x1bb)&&console[_0x1c6c75(0x1c1)](a4_0x4024b3['red'](_0x1c6c75(0x234)+_0x1c00d5[_0x1c6c75(0x1f0)]+_0x1c6c75(0x210)+_0x1c00d5[_0x1c6c75(0x1bb)]));}for(const _0x58f6b4 of _0x523448[_0x1c6c75(0x24c)]){_0x58f6b4['action']===_0x1c6c75(0x1bb)&&console[_0x1c6c75(0x1c1)](a4_0x4024b3['red']('\x20\x20Prompt\x20\x22'+_0x58f6b4[_0x1c6c75(0x1f0)]+_0x1c6c75(0x210)+_0x58f6b4['error']));}for(const _0x574626 of _0x523448[_0x1c6c75(0x1e8)]){_0x574626[_0x1c6c75(0x1b3)]==='error'&&console['log'](a4_0x4024b3[_0x1c6c75(0x1f9)](_0x1c6c75(0x201)+_0x574626['name']+'\x22:\x20'+_0x574626[_0x1c6c75(0x1bb)]));}return 0x1;}console[_0x1c6c75(0x1c1)](a4_0x4024b3['green'](_0x1c6c75(0x1ba)+(_0x58d4c8+_0x1551df)+_0x1c6c75(0x1b2)+_0x523448[_0x1c6c75(0x236)]+'\x27'));const _0xc5d53a=getLLMProjectUrl(_0x26f209,_0x523448[_0x1c6c75(0x1d0)]);return console[_0x1c6c75(0x1c1)](_0x1c6c75(0x1cf)+a4_0x4024b3[_0x1c6c75(0x23d)](_0xc5d53a)),0x0;}}
|
|
1
|
+
const a4_0x237827=a4_0x256a;(function(_0x5b1852,_0x116730){const _0x5ca1b4=a4_0x256a,_0x4eaeeb=_0x5b1852();while(!![]){try{const _0x567e49=-parseInt(_0x5ca1b4(0x221))/0x1*(-parseInt(_0x5ca1b4(0x1cf))/0x2)+parseInt(_0x5ca1b4(0x1f5))/0x3*(-parseInt(_0x5ca1b4(0x1db))/0x4)+-parseInt(_0x5ca1b4(0x1c9))/0x5*(-parseInt(_0x5ca1b4(0x19a))/0x6)+parseInt(_0x5ca1b4(0x1c8))/0x7+-parseInt(_0x5ca1b4(0x19d))/0x8*(parseInt(_0x5ca1b4(0x22f))/0x9)+parseInt(_0x5ca1b4(0x199))/0xa+parseInt(_0x5ca1b4(0x1df))/0xb*(-parseInt(_0x5ca1b4(0x1c7))/0xc);if(_0x567e49===_0x116730)break;else _0x4eaeeb['push'](_0x4eaeeb['shift']());}catch(_0x22a05a){_0x4eaeeb['push'](_0x4eaeeb['shift']());}}}(a4_0x208e,0x904f1));import a4_0x2ab3ec from'chalk';import a4_0x18c834 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}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';function a4_0x256a(_0x409bfa,_0x3f4e92){_0x409bfa=_0x409bfa-0x184;const _0x208e4a=a4_0x208e();let _0x256ad1=_0x208e4a[_0x409bfa];return _0x256ad1;}import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x366b4b){const _0x40922a=a4_0x256a,_0x5abb12=[];if(_0x366b4b[_0x40922a(0x219)]!==undefined)_0x5abb12[_0x40922a(0x1b6)](_0x366b4b[_0x40922a(0x219)]+_0x40922a(0x1a5));if(_0x366b4b[_0x40922a(0x1ff)]!==undefined&&_0x366b4b[_0x40922a(0x1ff)]>0x0)_0x5abb12[_0x40922a(0x1b6)](a4_0x2ab3ec[_0x40922a(0x1ac)](_0x366b4b[_0x40922a(0x1ff)]+'\x20new'));if(_0x366b4b[_0x40922a(0x1ec)]!==undefined&&_0x366b4b[_0x40922a(0x1ec)]>0x0)_0x5abb12['push'](a4_0x2ab3ec[_0x40922a(0x1ac)](_0x366b4b['created']+_0x40922a(0x184)));if(_0x366b4b['updated']!==undefined&&_0x366b4b[_0x40922a(0x235)]>0x0)_0x5abb12[_0x40922a(0x1b6)](a4_0x2ab3ec[_0x40922a(0x211)](_0x366b4b[_0x40922a(0x235)]+'\x20updated'));if(_0x366b4b[_0x40922a(0x1ca)]!==undefined&&_0x366b4b[_0x40922a(0x1ca)]>0x0)_0x5abb12[_0x40922a(0x1b6)](a4_0x2ab3ec['gray'](_0x366b4b[_0x40922a(0x1ca)]+_0x40922a(0x1b3)));if(_0x366b4b[_0x40922a(0x1dc)]!==undefined&&_0x366b4b[_0x40922a(0x1dc)]>0x0)_0x5abb12[_0x40922a(0x1b6)](a4_0x2ab3ec['red'](_0x366b4b['errors']+_0x40922a(0x22b)));return _0x5abb12[_0x40922a(0x228)](',\x20');}function displayDiffs(_0x4b5a7c,_0x1fd163,_0x462be3,_0x2438c0,_0x4cd877=[]){const _0x5e7874=a4_0x256a;for(const _0x39217f of _0x4b5a7c){if(_0x39217f[_0x5e7874(0x20d)]){const _0x4d3dc=_0x39217f[_0x5e7874(0x1c6)]||_0x39217f[_0x5e7874(0x1bd)];console[_0x5e7874(0x1ab)](_0x5e7874(0x1c3)+_0x4d3dc+'\x27:'),console[_0x5e7874(0x1ab)]('─'['repeat'](0x3c)),console[_0x5e7874(0x1ab)](_0x39217f[_0x5e7874(0x20d)]),console['log']('─'[_0x5e7874(0x1b7)](0x3c));}}for(const _0x2e238d of _0x1fd163){_0x2e238d[_0x5e7874(0x20d)]&&(console[_0x5e7874(0x1ab)](_0x5e7874(0x216)+_0x2e238d['name']+'\x27:'),console['log']('─'['repeat'](0x3c)),console['log'](_0x2e238d[_0x5e7874(0x20d)]),console['log']('─'[_0x5e7874(0x1b7)](0x3c)));}for(const _0x2569cb of _0x462be3){_0x2569cb['diff']&&(console[_0x5e7874(0x1ab)](_0x5e7874(0x204)+_0x2569cb[_0x5e7874(0x1bd)]+'\x27:'),console['log']('─'[_0x5e7874(0x1b7)](0x3c)),console['log'](_0x2569cb['diff']),console[_0x5e7874(0x1ab)]('─'['repeat'](0x3c)));}for(const _0xd651a0 of _0x2438c0){_0xd651a0[_0x5e7874(0x20d)]&&(console[_0x5e7874(0x1ab)]('\x0aChanges\x20to\x20prompt\x20\x27'+_0xd651a0['name']+'\x27:'),console[_0x5e7874(0x1ab)]('─'[_0x5e7874(0x1b7)](0x3c)),console[_0x5e7874(0x1ab)](_0xd651a0['diff']),console[_0x5e7874(0x1ab)]('─'[_0x5e7874(0x1b7)](0x3c)));}for(const _0x2ba15f of _0x4cd877){_0x2ba15f[_0x5e7874(0x20d)]&&(console[_0x5e7874(0x1ab)]('\x0aChanges\x20to\x20integration\x20\x27'+_0x2ba15f[_0x5e7874(0x1bd)]+'\x27:'),console['log']('─'[_0x5e7874(0x1b7)](0x3c)),console[_0x5e7874(0x1ab)](_0x2ba15f[_0x5e7874(0x20d)]),console['log']('─'[_0x5e7874(0x1b7)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x237827(0x1bd)]='agent:pull';[a4_0x237827(0x1bf)]=a4_0x237827(0x1fe);async[a4_0x237827(0x210)](_0x4d9cd4){const _0x508b85=a4_0x237827,{options:_0x29fc11,args:_0x535b53,tdx:_0x10ccfb}=_0x4d9cd4,_0x5b894f=_0x535b53[0x0],_0x16a010=_0x535b53[0x1],_0x2060af=_0x29fc11[_0x508b85(0x19e)],_0x2ff17b=_0x29fc11[_0x508b85(0x1b8)],_0x465999=_0x29fc11[_0x508b85(0x223)],_0x2dd759=_0x29fc11[_0x508b85(0x1ed)],_0x32dbae=_0x29fc11['llmProject'];let _0x377aca,_0x49968b;const _0x307bec=findAgentConfigPath(process[_0x508b85(0x1b2)]());if(_0x5b894f){const _0x160a4b=a4_0x18c834['join'](_0x5b894f,_0x508b85(0x1f2));if(existsSync(_0x160a4b))try{const _0xc1287a=JSON[_0x508b85(0x205)](readFileSync(_0x160a4b,_0x508b85(0x1e2)));_0x377aca=_0xc1287a[_0x508b85(0x230)],_0x49968b=_0x5b894f,console[_0x508b85(0x1ab)](a4_0x2ab3ec[_0x508b85(0x1a6)](_0x508b85(0x1d8)+_0x160a4b+':\x20'+_0x377aca));}catch{_0x377aca=_0x5b894f;}else _0x377aca=_0x5b894f;}else{if(_0x307bec)try{const _0x133642=JSON['parse'](readFileSync(_0x307bec,_0x508b85(0x1e2)));_0x377aca=_0x133642['llm_project'],_0x49968b=a4_0x18c834[_0x508b85(0x1fc)](_0x307bec),console[_0x508b85(0x1ab)](a4_0x2ab3ec[_0x508b85(0x1a6)](_0x508b85(0x20f)+_0x377aca));}catch{_0x377aca=_0x32dbae;}else _0x377aca=_0x32dbae;}if(!_0x377aca)return console[_0x508b85(0x1ab)](a4_0x2ab3ec[_0x508b85(0x211)](_0x508b85(0x207))),console[_0x508b85(0x1ab)](_0x508b85(0x18d)),console[_0x508b85(0x1ab)](_0x508b85(0x196)),console[_0x508b85(0x1ab)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory'),console['log'](_0x508b85(0x1ce)),0x1;if(_0x16a010){const {data:_0x2b9d85}=await withSpinner(_0x508b85(0x1c2)+_0x16a010+_0x508b85(0x1d5)+_0x377aca+_0x508b85(0x192),()=>_0x10ccfb[_0x508b85(0x218)]['pullAgent'](_0x377aca,_0x16a010,_0x2060af,{'dryRun':_0x2ff17b,'force':_0x465999}));if(_0x2ff17b)return console[_0x508b85(0x1ab)](a4_0x2ab3ec[_0x508b85(0x211)](_0x508b85(0x18a))),console[_0x508b85(0x1ab)](_0x508b85(0x1e4)+_0x2b9d85[_0x508b85(0x1c6)]),console[_0x508b85(0x1ab)]('Output\x20path:\x20'+_0x2b9d85['outputPath']),_0x2b9d85[_0x508b85(0x20d)]&&(console[_0x508b85(0x1ab)](_0x508b85(0x1af)),console[_0x508b85(0x1ab)]('─'['repeat'](0x3c)),console[_0x508b85(0x1ab)](_0x2b9d85[_0x508b85(0x20d)]),console[_0x508b85(0x1ab)]('─'[_0x508b85(0x1b7)](0x3c))),0x0;return console[_0x508b85(0x1ab)](a4_0x2ab3ec[_0x508b85(0x1ac)](_0x508b85(0x1dd))),console['log'](_0x508b85(0x1a0)+_0x2b9d85[_0x508b85(0x1c6)]),console[_0x508b85(0x1ab)](_0x508b85(0x209)+_0x2b9d85[_0x508b85(0x1a8)]),console[_0x508b85(0x1ab)](_0x508b85(0x19b)+(_0x2b9d85[_0x508b85(0x1de)]?a4_0x2ab3ec[_0x508b85(0x1ac)](_0x508b85(0x1ff)):_0x2b9d85[_0x508b85(0x1da)]?a4_0x2ab3ec['yellow'](_0x508b85(0x235)):a4_0x2ab3ec[_0x508b85(0x215)](_0x508b85(0x1ca)))),0x0;}const _0xc769ef=_0x49968b||_0x2060af,{data:_0x26baf5}=await withSpinner(_0x508b85(0x225)+_0x377aca+'\x22...',()=>_0x10ccfb['llm']['pullProject'](_0x377aca,_0xc769ef,{'dryRun':!![]})),_0x55d0ef=_0x26baf5[_0x508b85(0x188)][_0x508b85(0x1fb)][_0x508b85(0x1ff)]+_0x26baf5[_0x508b85(0x188)][_0x508b85(0x21e)][_0x508b85(0x1ff)]+_0x26baf5[_0x508b85(0x188)][_0x508b85(0x22c)][_0x508b85(0x1ff)]+_0x26baf5['counts'][_0x508b85(0x1e5)][_0x508b85(0x1ff)]+_0x26baf5[_0x508b85(0x188)]['integrations'][_0x508b85(0x1ff)],_0x54d492=_0x26baf5[_0x508b85(0x188)][_0x508b85(0x1fb)][_0x508b85(0x235)]+_0x26baf5[_0x508b85(0x188)]['knowledgeBases']['updated']+_0x26baf5['counts'][_0x508b85(0x22c)][_0x508b85(0x235)]+_0x26baf5[_0x508b85(0x188)][_0x508b85(0x1e5)][_0x508b85(0x235)]+_0x26baf5['counts'][_0x508b85(0x1b1)][_0x508b85(0x235)],_0xfc1cce=_0x26baf5[_0x508b85(0x188)][_0x508b85(0x1fb)][_0x508b85(0x1ca)]+_0x26baf5[_0x508b85(0x188)][_0x508b85(0x21e)][_0x508b85(0x1ca)]+_0x26baf5['counts'][_0x508b85(0x22c)][_0x508b85(0x1ca)]+_0x26baf5[_0x508b85(0x188)][_0x508b85(0x1e5)][_0x508b85(0x1ca)]+_0x26baf5[_0x508b85(0x188)][_0x508b85(0x1b1)][_0x508b85(0x1ca)];console[_0x508b85(0x1ab)](_0x508b85(0x22d)+_0x26baf5[_0x508b85(0x21d)]+'\x27:'),console[_0x508b85(0x1ab)]('\x20\x20'+a4_0x2ab3ec['green']('+\x20'+_0x55d0ef+_0x508b85(0x1c4))+'\x20|\x20'+a4_0x2ab3ec[_0x508b85(0x211)]('~\x20'+_0x54d492+_0x508b85(0x1fd))+_0x508b85(0x18e)+a4_0x2ab3ec[_0x508b85(0x1a6)]('=\x20'+_0xfc1cce+_0x508b85(0x1b3))),console[_0x508b85(0x1ab)](_0x508b85(0x1e9)+formatCountSummary(_0x26baf5[_0x508b85(0x188)]['agents'])),console[_0x508b85(0x1ab)](_0x508b85(0x1f7)+formatCountSummary(_0x26baf5[_0x508b85(0x188)][_0x508b85(0x21e)])),console[_0x508b85(0x1ab)](_0x508b85(0x1ba)+formatCountSummary(_0x26baf5[_0x508b85(0x188)][_0x508b85(0x22c)])),console['log']('\x20\x20Prompts:\x20'+formatCountSummary(_0x26baf5[_0x508b85(0x188)][_0x508b85(0x1e5)])),console[_0x508b85(0x1ab)](_0x508b85(0x20a)+formatCountSummary(_0x26baf5['counts']['integrations'])),console[_0x508b85(0x1ab)](_0x508b85(0x201)+a4_0x2ab3ec['cyan'](_0x26baf5[_0x508b85(0x220)])),displayDiffs(_0x26baf5[_0x508b85(0x1fb)],_0x26baf5['knowledgeBases'],_0x26baf5[_0x508b85(0x22c)],_0x26baf5[_0x508b85(0x1e5)],_0x26baf5['integrations']);if(_0x2ff17b)return console[_0x508b85(0x1ab)](a4_0x2ab3ec[_0x508b85(0x211)](_0x508b85(0x1ae))),0x0;if(_0x55d0ef===0x0&&_0x54d492===0x0)return console[_0x508b85(0x1ab)](a4_0x2ab3ec[_0x508b85(0x1ac)](_0x508b85(0x1ef))),saveSessionContext({'llm_project':_0x26baf5[_0x508b85(0x21d)]},_0x29fc11[_0x508b85(0x1f4)]),console[_0x508b85(0x1ab)](a4_0x2ab3ec[_0x508b85(0x1ac)](_0x508b85(0x224)+a4_0x2ab3ec[_0x508b85(0x1a6)](_0x508b85(0x230))+_0x508b85(0x1b4)+a4_0x2ab3ec[_0x508b85(0x208)](_0x26baf5[_0x508b85(0x21d)]))),0x0;if(!_0x2dd759&&!_0x465999){const _0x4811a2=await confirmKey(_0x508b85(0x229)+(_0x55d0ef+_0x54d492)+'\x20files?');if(!_0x4811a2)return console[_0x508b85(0x1ab)]('Pull\x20cancelled'),0x0;}const {data:_0x191f93}=await withSpinner(_0x508b85(0x1e6),()=>_0x10ccfb[_0x508b85(0x218)][_0x508b85(0x1b9)](_0x377aca,_0xc769ef,{'force':_0x465999}));return console[_0x508b85(0x1ab)](a4_0x2ab3ec[_0x508b85(0x1ac)](_0x508b85(0x1d6)+(_0x55d0ef+_0x54d492)+_0x508b85(0x197)+_0x191f93[_0x508b85(0x220)])),saveSessionContext({'llm_project':_0x191f93[_0x508b85(0x21d)]},_0x29fc11[_0x508b85(0x1f4)]),console['log'](a4_0x2ab3ec[_0x508b85(0x1ac)](_0x508b85(0x224)+a4_0x2ab3ec[_0x508b85(0x1a6)](_0x508b85(0x230))+_0x508b85(0x1b4)+a4_0x2ab3ec['cyan'](_0x191f93[_0x508b85(0x21d)]))),0x0;}}function a4_0x208e(){const _0x1cec1e=['hasChanges','372EVNqTJ','errors','Agent\x20pulled\x20successfully','isNew','12608662zVUsZR','Project\x20cloned\x20successfully','Using\x20current\x20project:\x20','utf-8','\x20\x20Agent\x20\x22','Would\x20pull\x20agent:\x20','prompts','Writing\x20files...','Summary:','New\x20project:\x20','\x20\x20Agents:\x20','New\x20project\x20ID:\x20','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','created','yes','Analyzing\x20changes\x20to\x20push...','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','\x22\x20to\x20\x22','Using\x20local\x20project:\x20','tdx.json','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','session','16383qHpphy','Would\x20clone:','\x20\x20Knowledge\x20Bases:\x20','Failed\x20to\x20push\x20agent:\x20','No\x20tdx.json\x20found\x20in\x20','newProjectId','agents','dirname','\x20changed','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','new','\x0aPush\x20','\x20\x20Target:\x20','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','\x20\x20tdx\x20agent\x20pull\x20','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','parse','Chat:\x20','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','cyan','Output:\x20','\x20\x20Integrations:\x20','action','<new-name>','diff','Agent\x20','Using\x20project:\x20','execute','yellow','reason','\x20\x20Source:\x20','\x20\x20tdx\x20agent\x20clone\x20agents/','gray','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','Using\x20context\x20project:\x20','llm','total','llmProject','red','\x22\x20to\x20a\x20different\x20profile','projectName','knowledgeBases','projectDir','outputDir','596bBSTkF','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','force','✔\x20Context\x20set:\x20','Analyzing\x20project\x20\x22','Clone\x20\x22','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','join','\x0aWrite\x20','\x27\x20to\x20create\x20the\x20folder\x20structure.','\x20errors','textKnowledgeBases','\x0aPull\x20summary\x20for\x20\x27','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','405ZOCZlF','llm_project','no_local_folder','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','newProjectName','cloneProject','updated','\x20created','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','no_context','Dry\x20run\x20-\x20no\x20changes\x20made','counts','\x20\x20Knowledge\x20Base\x20\x22','Dry\x20run\x20-\x20no\x20files\x20written','\x20\x20Prompts:\x20','\x0a✔\x20Pushed\x20','Usage:\x20tdx\x20agent\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20project\x20(requires\x20context\x20or\x20tdx.json)','\x20|\x20','\x22:\x20','\x0aPush\x20summary\x20for\x20\x27','MISSING_ARGUMENT','\x22...','error','Project:\x20','Would\x20push\x20agent:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project','\x20files\x20to\x20','profile','3474920PFHgcR','3306510erAhUe','Status:\x20','\x20resources?','84920CSJbqW','output','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','Agent:\x20','Errors:','Cannot\x20clone\x20from\x20context\x20project\x20\x22','context','projectId','\x20total','dim','New\x20project\x20name\x20is\x20required','outputPath','\x20--name\x20','message','log','green','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','\x0aChanges:','Pushing\x20to\x20project...','integrations','cwd','\x20unchanged','\x20=\x20','INVALID_ARGUMENT','push','repeat','dryRun','pullProject','\x20\x20Text\x20Knowledge\x20Bases:\x20','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','found','name','\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)','description','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','Source:\x20','Pulling\x20agent\x20\x22','\x0aChanges\x20to\x20agent\x20\x27','\x20new','sourceProjectName','agentName','12FWJHNB','1077503pPSWDN','10orWnuz','unchanged','agent:push','\x22\x20to\x20new\x20project\x20\x22','\x20successfully','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20#\x20Pull\x20specific\x20agent','3756cRlDPd','\x20--profile\x20','\x20\x20Integration\x20\x22','pushProject','site','\x20\x20Prompt\x20\x22','\x22\x20from\x20project\x20\x22','\x0a✔\x20Pulled\x20','\x0aErrors\x20found:','Using\x20project\x20from\x20','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed'];a4_0x208e=function(){return _0x1cec1e;};return a4_0x208e();}export class AgentCloneCommand extends BaseCommand{['name']='agent:clone';[a4_0x237827(0x1bf)]=a4_0x237827(0x22e);async[a4_0x237827(0x210)](_0x5b8dd8){const _0x439ccc=a4_0x237827,{options:_0x72e3da,args:_0x12266d,tdx:_0x5db4bb}=_0x5b8dd8,_0x56ed5e=_0x12266d[0x0],_0x2145fd=_0x72e3da[_0x439ccc(0x1bd)],_0x5af6d4=_0x72e3da[_0x439ccc(0x1b8)],_0x440eeb=_0x72e3da[_0x439ccc(0x1ed)],_0x128598=_0x72e3da[_0x439ccc(0x1d3)],_0x3ed944=_0x72e3da[_0x439ccc(0x21a)];let _0xa48d08;const _0x150627=findAgentConfigPath(process[_0x439ccc(0x1b2)]());if(_0x56ed5e){const _0x3b7390=a4_0x18c834[_0x439ccc(0x228)](_0x56ed5e,_0x439ccc(0x1f2));existsSync(_0x3b7390)?(_0xa48d08=_0x56ed5e,console[_0x439ccc(0x1ab)](a4_0x2ab3ec['dim'](_0x439ccc(0x1f1)+_0x56ed5e))):_0xa48d08=_0x56ed5e;}else{if(_0x150627)_0xa48d08=a4_0x18c834['dirname'](_0x150627),console[_0x439ccc(0x1ab)](a4_0x2ab3ec[_0x439ccc(0x1a6)](_0x439ccc(0x1e1)+_0xa48d08));else{if(_0x3ed944){const _0x31cfcf=sanitizeForFilesystem(_0x3ed944);let _0x1fc6a0=_0x31cfcf,_0x570cab=a4_0x18c834['join'](process[_0x439ccc(0x1b2)](),_0x439ccc(0x1fb),_0x31cfcf,'tdx.json');if(!existsSync(_0x570cab)){const _0x3f384a=normalizeName(_0x3ed944),_0x55cfb5=a4_0x18c834['join'](process[_0x439ccc(0x1b2)](),'agents',_0x3f384a,_0x439ccc(0x1f2));existsSync(_0x55cfb5)&&(_0x1fc6a0=_0x3f384a,_0x570cab=_0x55cfb5);}if(existsSync(_0x570cab))_0xa48d08=a4_0x18c834[_0x439ccc(0x1fc)](_0x570cab),console['log'](a4_0x2ab3ec[_0x439ccc(0x1a6)]('Using\x20local\x20project:\x20'+_0xa48d08));else{const _0x1c0f74=_0x72e3da[_0x439ccc(0x198)];if(_0x1c0f74)throw new SDKError(ErrorCode[_0x439ccc(0x1b5)],_0x439ccc(0x1a2)+_0x3ed944+_0x439ccc(0x21c),undefined,{'helpText':_0x439ccc(0x222)+_0x439ccc(0x1bb)+(_0x439ccc(0x203)+_0x3ed944+'\x0a')+(_0x439ccc(0x214)+_0x1fc6a0+_0x439ccc(0x1a9)+(_0x2145fd||_0x439ccc(0x20c))+_0x439ccc(0x1d0)+_0x1c0f74)});_0xa48d08=_0x3ed944,console[_0x439ccc(0x1ab)](a4_0x2ab3ec['dim'](_0x439ccc(0x217)+_0x3ed944));}}}}if(!_0xa48d08)return console[_0x439ccc(0x1ab)](a4_0x2ab3ec['yellow'](_0x439ccc(0x1f3))),console[_0x439ccc(0x1ab)](_0x439ccc(0x19f)),console['log'](_0x439ccc(0x1c0)),console[_0x439ccc(0x1ab)](_0x439ccc(0x1be)),console['log'](_0x439ccc(0x1ad)),0x1;if(!_0x2145fd)throw new SDKError(ErrorCode[_0x439ccc(0x191)],_0x439ccc(0x1a7),undefined,{'helpText':_0x439ccc(0x185)});if(!_0x440eeb&&!_0x5af6d4){const _0x313686=await confirmKey(_0x439ccc(0x226)+_0xa48d08+_0x439ccc(0x1cc)+_0x2145fd+'\x22?');if(!_0x313686)return console[_0x439ccc(0x1ab)]('Clone\x20cancelled'),0x0;}const {data:_0x4d5cee}=await withSpinner('Cloning\x20\x22'+_0xa48d08+_0x439ccc(0x1f0)+_0x2145fd+_0x439ccc(0x192),()=>_0x5db4bb['llm'][_0x439ccc(0x234)](_0xa48d08,_0x2145fd,{'dryRun':_0x5af6d4}));if(_0x5af6d4)return console['log'](a4_0x2ab3ec['yellow'](_0x439ccc(0x187))),console[_0x439ccc(0x1ab)]('Source:\x20'+_0x4d5cee[_0x439ccc(0x1c5)]),console[_0x439ccc(0x1ab)](_0x439ccc(0x1e8)+_0x2145fd),console['log'](_0x439ccc(0x1f6)),console['log']('\x20\x20Agents:\x20'+_0x4d5cee['counts']['agents'][_0x439ccc(0x1ec)]),console[_0x439ccc(0x1ab)](_0x439ccc(0x1f7)+_0x4d5cee[_0x439ccc(0x188)][_0x439ccc(0x21e)][_0x439ccc(0x1ec)]),console[_0x439ccc(0x1ab)](_0x439ccc(0x18b)+_0x4d5cee[_0x439ccc(0x188)][_0x439ccc(0x1e5)]['created']),0x0;const _0x2f2031=_0x4d5cee[_0x439ccc(0x188)][_0x439ccc(0x1fb)]['errors']>0x0||_0x4d5cee['counts'][_0x439ccc(0x21e)]['errors']>0x0||_0x4d5cee[_0x439ccc(0x188)][_0x439ccc(0x1e5)]['errors']>0x0;_0x2f2031?console[_0x439ccc(0x1ab)](a4_0x2ab3ec[_0x439ccc(0x211)]('Project\x20cloned\x20with\x20errors')):console[_0x439ccc(0x1ab)](a4_0x2ab3ec[_0x439ccc(0x1ac)](_0x439ccc(0x1e0)));console['log'](_0x439ccc(0x1c1)+_0x4d5cee['sourceProjectName']),console[_0x439ccc(0x1ab)]('New\x20project:\x20'+_0x4d5cee[_0x439ccc(0x233)]),console[_0x439ccc(0x1ab)](_0x439ccc(0x1ea)+_0x4d5cee[_0x439ccc(0x1fa)]),console[_0x439ccc(0x1ab)](),console[_0x439ccc(0x1ab)](_0x439ccc(0x1e7)),console[_0x439ccc(0x1ab)](_0x439ccc(0x1e9)+formatCountSummary(_0x4d5cee[_0x439ccc(0x188)]['agents'])),console[_0x439ccc(0x1ab)](_0x439ccc(0x1f7)+formatCountSummary(_0x4d5cee['counts'][_0x439ccc(0x21e)])),console['log'](_0x439ccc(0x18b)+formatCountSummary(_0x4d5cee[_0x439ccc(0x188)][_0x439ccc(0x1e5)])),console[_0x439ccc(0x1ab)](_0x439ccc(0x20a)+formatCountSummary(_0x4d5cee[_0x439ccc(0x188)][_0x439ccc(0x1b1)]));if(_0x2f2031){console[_0x439ccc(0x1ab)](),console[_0x439ccc(0x1ab)](a4_0x2ab3ec[_0x439ccc(0x21b)](_0x439ccc(0x1a1)));for(const _0x361a08 of _0x4d5cee[_0x439ccc(0x1fb)]){_0x361a08[_0x439ccc(0x20b)]===_0x439ccc(0x193)&&console[_0x439ccc(0x1ab)](a4_0x2ab3ec[_0x439ccc(0x21b)](_0x439ccc(0x1e3)+_0x361a08[_0x439ccc(0x1c6)]+_0x439ccc(0x18f)+_0x361a08[_0x439ccc(0x193)]));}for(const _0x32d776 of _0x4d5cee['knowledgeBases']){_0x32d776[_0x439ccc(0x20b)]===_0x439ccc(0x193)&&console[_0x439ccc(0x1ab)](a4_0x2ab3ec['red']('\x20\x20Knowledge\x20Base\x20\x22'+_0x32d776[_0x439ccc(0x1bd)]+_0x439ccc(0x18f)+_0x32d776[_0x439ccc(0x193)]));}for(const _0x46b760 of _0x4d5cee['prompts']){_0x46b760[_0x439ccc(0x20b)]===_0x439ccc(0x193)&&console[_0x439ccc(0x1ab)](a4_0x2ab3ec[_0x439ccc(0x21b)](_0x439ccc(0x1d4)+_0x46b760[_0x439ccc(0x1bd)]+'\x22:\x20'+_0x46b760[_0x439ccc(0x193)]));}for(const _0x19c627 of _0x4d5cee[_0x439ccc(0x1b1)]){_0x19c627[_0x439ccc(0x20b)]===_0x439ccc(0x193)&&console[_0x439ccc(0x1ab)](a4_0x2ab3ec['red'](_0x439ccc(0x1d1)+_0x19c627[_0x439ccc(0x1bd)]+_0x439ccc(0x18f)+_0x19c627[_0x439ccc(0x193)]));}return 0x1;}console[_0x439ccc(0x1ab)]();const _0x11958e=getLLMProjectUrl(_0x128598,_0x4d5cee[_0x439ccc(0x1fa)]);return console['log'](_0x439ccc(0x194)+a4_0x2ab3ec[_0x439ccc(0x208)](_0x11958e)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x237827(0x1bd)]=a4_0x237827(0x1cb);[a4_0x237827(0x1bf)]=a4_0x237827(0x202);async['execute'](_0x25662a){const _0x441c91=a4_0x237827,{options:_0x3ddfd1,args:_0x1acc03,tdx:_0x142271}=_0x25662a;let _0x34bb32=_0x1acc03[0x0]||process[_0x441c91(0x1b2)]();const _0x52a5c4=_0x3ddfd1[_0x441c91(0x1b8)],_0x1446ab=_0x3ddfd1[_0x441c91(0x223)],_0x34d20f=_0x3ddfd1[_0x441c91(0x1ed)],_0x574865=_0x3ddfd1[_0x441c91(0x1d3)],_0x55e5c3=a4_0x18c834[_0x441c91(0x228)](_0x34bb32,'agent.yml'),_0x21f7ae=existsSync(_0x55e5c3);if(_0x21f7ae){const {data:_0x31b2e0}=await withSpinner('Pushing\x20agent\x20from\x20\x22'+_0x34bb32+'\x22...',()=>_0x142271[_0x441c91(0x218)]['pushAgent'](_0x34bb32,{'dryRun':_0x52a5c4,'force':_0x1446ab}));if(_0x52a5c4)return console['log'](a4_0x2ab3ec['yellow']('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x441c91(0x1ab)](_0x441c91(0x195)+_0x31b2e0[_0x441c91(0x1c6)]),0x0;if(_0x31b2e0[_0x441c91(0x20b)]===_0x441c91(0x193))return console['log'](a4_0x2ab3ec[_0x441c91(0x21b)](_0x441c91(0x1f8)+_0x31b2e0[_0x441c91(0x193)])),0x1;console[_0x441c91(0x1ab)](a4_0x2ab3ec[_0x441c91(0x1ac)](_0x441c91(0x20e)+_0x31b2e0[_0x441c91(0x20b)]+_0x441c91(0x1cd))),console[_0x441c91(0x1ab)]('Agent:\x20'+_0x31b2e0[_0x441c91(0x1c6)]);if(_0x31b2e0['agentId']&&_0x31b2e0[_0x441c91(0x1a4)]){const _0x3ff87c=getLLMAgentChatUrl(_0x574865,_0x31b2e0[_0x441c91(0x1a4)],_0x31b2e0['agentId']);console['log'](_0x441c91(0x206)+a4_0x2ab3ec['cyan'](_0x3ff87c));}return 0x0;}const _0x3b9d47=_0x3ddfd1['llmProject'],_0x363530=resolveProjectFromContext(_0x34bb32,_0x3b9d47);if(_0x363530[_0x441c91(0x1bc)])_0x34bb32=_0x363530[_0x441c91(0x21f)],_0x363530['source']===_0x441c91(0x1a3)&&console[_0x441c91(0x1ab)](a4_0x2ab3ec[_0x441c91(0x1a6)]('Using\x20project:\x20'+_0x34bb32));else{let _0x3c89f4=_0x441c91(0x227);_0x363530['reason']===_0x441c91(0x231)&&(_0x3c89f4=_0x363530[_0x441c91(0x1aa)]+_0x441c91(0x232)+_0x363530[_0x441c91(0x21a)]+_0x441c91(0x22a));throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x363530[_0x441c91(0x212)]===_0x441c91(0x186)?_0x363530[_0x441c91(0x1aa)]:_0x441c91(0x1f9)+_0x34bb32,undefined,{'helpText':_0x3c89f4});}const {data:_0x301d36}=await withSpinner(_0x441c91(0x1ee),()=>_0x142271[_0x441c91(0x218)][_0x441c91(0x1d2)](_0x34bb32,{'dryRun':!![]})),_0x4f1f2c=_0x301d36[_0x441c91(0x188)][_0x441c91(0x1fb)][_0x441c91(0x1dc)]>0x0;if(_0x4f1f2c){console[_0x441c91(0x1ab)](a4_0x2ab3ec[_0x441c91(0x21b)](_0x441c91(0x1d7)));for(const _0x2e4c38 of _0x301d36[_0x441c91(0x1fb)]){_0x2e4c38[_0x441c91(0x20b)]===_0x441c91(0x193)&&console[_0x441c91(0x1ab)](a4_0x2ab3ec['red'](_0x441c91(0x1e3)+_0x2e4c38[_0x441c91(0x1c6)]+_0x441c91(0x18f)+_0x2e4c38['error']));}return 0x1;}const _0x3fb2d1=_0x301d36[_0x441c91(0x188)][_0x441c91(0x1fb)][_0x441c91(0x1ec)]+_0x301d36[_0x441c91(0x188)][_0x441c91(0x21e)][_0x441c91(0x1ec)]+_0x301d36[_0x441c91(0x188)][_0x441c91(0x22c)]['created']+_0x301d36[_0x441c91(0x188)][_0x441c91(0x1e5)][_0x441c91(0x1ec)]+_0x301d36[_0x441c91(0x188)][_0x441c91(0x1b1)]['created'],_0x3bf673=_0x301d36[_0x441c91(0x188)][_0x441c91(0x1fb)][_0x441c91(0x235)]+_0x301d36['counts'][_0x441c91(0x21e)][_0x441c91(0x235)]+_0x301d36[_0x441c91(0x188)]['textKnowledgeBases'][_0x441c91(0x235)]+_0x301d36[_0x441c91(0x188)][_0x441c91(0x1e5)][_0x441c91(0x235)]+_0x301d36[_0x441c91(0x188)][_0x441c91(0x1b1)]['updated'],_0x467296=_0x301d36[_0x441c91(0x188)][_0x441c91(0x1fb)]['unchanged']+_0x301d36[_0x441c91(0x188)][_0x441c91(0x21e)][_0x441c91(0x1ca)]+_0x301d36[_0x441c91(0x188)][_0x441c91(0x22c)]['unchanged']+_0x301d36[_0x441c91(0x188)][_0x441c91(0x1e5)]['unchanged']+_0x301d36[_0x441c91(0x188)][_0x441c91(0x1b1)][_0x441c91(0x1ca)];console[_0x441c91(0x1ab)](_0x441c91(0x190)+_0x301d36[_0x441c91(0x21d)]+'\x27:'),console[_0x441c91(0x1ab)]('\x20\x20'+a4_0x2ab3ec[_0x441c91(0x1ac)]('+\x20'+_0x3fb2d1+_0x441c91(0x1c4))+'\x20|\x20'+a4_0x2ab3ec[_0x441c91(0x211)]('~\x20'+_0x3bf673+_0x441c91(0x1fd))+_0x441c91(0x18e)+a4_0x2ab3ec[_0x441c91(0x1a6)]('=\x20'+_0x467296+_0x441c91(0x1b3))),console[_0x441c91(0x1ab)](_0x441c91(0x1e9)+formatCountSummary(_0x301d36[_0x441c91(0x188)][_0x441c91(0x1fb)])),console[_0x441c91(0x1ab)](_0x441c91(0x1f7)+formatCountSummary(_0x301d36[_0x441c91(0x188)]['knowledgeBases'])),console[_0x441c91(0x1ab)](_0x441c91(0x1ba)+formatCountSummary(_0x301d36['counts']['textKnowledgeBases'])),console[_0x441c91(0x1ab)](_0x441c91(0x18b)+formatCountSummary(_0x301d36[_0x441c91(0x188)]['prompts'])),console[_0x441c91(0x1ab)](_0x441c91(0x20a)+formatCountSummary(_0x301d36[_0x441c91(0x188)]['integrations'])),console[_0x441c91(0x1ab)](_0x441c91(0x213)+a4_0x2ab3ec[_0x441c91(0x208)](_0x34bb32)),displayDiffs(_0x301d36[_0x441c91(0x1fb)],_0x301d36[_0x441c91(0x21e)],_0x301d36[_0x441c91(0x22c)],_0x301d36[_0x441c91(0x1e5)],_0x301d36[_0x441c91(0x1b1)]);if(_0x52a5c4)return console[_0x441c91(0x1ab)](a4_0x2ab3ec[_0x441c91(0x211)](_0x441c91(0x1d9))),0x0;if(_0x3fb2d1===0x0&&_0x3bf673===0x0){console['log'](a4_0x2ab3ec[_0x441c91(0x1ac)](_0x441c91(0x1eb)));const _0x36805d=getLLMProjectUrl(_0x574865,_0x301d36[_0x441c91(0x1a4)]);return console[_0x441c91(0x1ab)](_0x441c91(0x194)+a4_0x2ab3ec[_0x441c91(0x208)](_0x36805d)),0x0;}if(!_0x34d20f&&!_0x1446ab){const _0x58f31a=await confirmKey(_0x441c91(0x200)+(_0x3fb2d1+_0x3bf673)+_0x441c91(0x19c));if(!_0x58f31a)return console[_0x441c91(0x1ab)]('Push\x20cancelled'),0x0;}const {data:_0x27a01e}=await withSpinner(_0x441c91(0x1b0),()=>_0x142271['llm']['pushProject'](_0x34bb32,{'force':_0x1446ab})),_0x4340ad=_0x27a01e['counts']['agents'][_0x441c91(0x1dc)]>0x0||_0x27a01e[_0x441c91(0x188)][_0x441c91(0x21e)][_0x441c91(0x1dc)]>0x0||_0x27a01e[_0x441c91(0x188)][_0x441c91(0x22c)][_0x441c91(0x1dc)]>0x0||_0x27a01e[_0x441c91(0x188)][_0x441c91(0x1e5)][_0x441c91(0x1dc)]>0x0;if(_0x4340ad){console[_0x441c91(0x1ab)](a4_0x2ab3ec[_0x441c91(0x211)]('\x0aProject\x20pushed\x20with\x20errors')),console[_0x441c91(0x1ab)](),console[_0x441c91(0x1ab)](a4_0x2ab3ec[_0x441c91(0x21b)]('Errors:'));for(const _0x320dd5 of _0x27a01e[_0x441c91(0x1fb)]){_0x320dd5[_0x441c91(0x20b)]===_0x441c91(0x193)&&console[_0x441c91(0x1ab)](a4_0x2ab3ec[_0x441c91(0x21b)]('\x20\x20Agent\x20\x22'+_0x320dd5['agentName']+_0x441c91(0x18f)+_0x320dd5[_0x441c91(0x193)]));}for(const _0x5e77ec of _0x27a01e[_0x441c91(0x21e)]){_0x5e77ec['action']===_0x441c91(0x193)&&console[_0x441c91(0x1ab)](a4_0x2ab3ec[_0x441c91(0x21b)](_0x441c91(0x189)+_0x5e77ec[_0x441c91(0x1bd)]+_0x441c91(0x18f)+_0x5e77ec[_0x441c91(0x193)]));}for(const _0x897f14 of _0x27a01e[_0x441c91(0x22c)]){_0x897f14[_0x441c91(0x20b)]===_0x441c91(0x193)&&console['log'](a4_0x2ab3ec[_0x441c91(0x21b)]('\x20\x20Text\x20Knowledge\x20Base\x20\x22'+_0x897f14[_0x441c91(0x1bd)]+_0x441c91(0x18f)+_0x897f14[_0x441c91(0x193)]));}for(const _0x41d78b of _0x27a01e[_0x441c91(0x1e5)]){_0x41d78b[_0x441c91(0x20b)]===_0x441c91(0x193)&&console[_0x441c91(0x1ab)](a4_0x2ab3ec['red'](_0x441c91(0x1d4)+_0x41d78b[_0x441c91(0x1bd)]+_0x441c91(0x18f)+_0x41d78b[_0x441c91(0x193)]));}for(const _0xd1943e of _0x27a01e[_0x441c91(0x1b1)]){_0xd1943e[_0x441c91(0x20b)]==='error'&&console[_0x441c91(0x1ab)](a4_0x2ab3ec['red'](_0x441c91(0x1d1)+_0xd1943e[_0x441c91(0x1bd)]+_0x441c91(0x18f)+_0xd1943e[_0x441c91(0x193)]));}return 0x1;}console['log'](a4_0x2ab3ec[_0x441c91(0x1ac)](_0x441c91(0x18c)+(_0x3fb2d1+_0x3bf673)+'\x20resources\x20to\x20\x27'+_0x27a01e['projectName']+'\x27'));const _0x55e4ff=getLLMProjectUrl(_0x574865,_0x27a01e[_0x441c91(0x1a4)]);return console[_0x441c91(0x1ab)]('Project:\x20'+a4_0x2ab3ec[_0x441c91(0x208)](_0x55e4ff)),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a5_0x27db88=a5_0x3ed8;(function(_0x488d3a,_0x2852e6){const _0x44a3a4=a5_0x3ed8,_0x29dba7=_0x488d3a();while(!![]){try{const _0x3e00d9=-parseInt(_0x44a3a4(0x108))/0x1+parseInt(_0x44a3a4(0xfa))/0x2+-parseInt(_0x44a3a4(0xdd))/0x3+-parseInt(_0x44a3a4(0xd7))/0x4*(-parseInt(_0x44a3a4(0x7c))/0x5)+parseInt(_0x44a3a4(0x88))/0x6*(-parseInt(_0x44a3a4(0x8c))/0x7)+-parseInt(_0x44a3a4(0x75))/0x8+parseInt(_0x44a3a4(0xe4))/0x9;if(_0x3e00d9===_0x2852e6)break;else _0x29dba7['push'](_0x29dba7['shift']());}catch(_0x639572){_0x29dba7['push'](_0x29dba7['shift']());}}}(a5_0x5ae8,0x1b403));import*as a5_0x1e08d7 from'node:fs';import*as a5_0x564877 from'node:path';import a5_0x17bfe6 from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';function a5_0x5ae8(){const _0x372f43=['New\x20tests\x20to\x20execute:\x20','PASS','Round\x20','white','testYmlPath','\x20\x20Conversation:\x20','find','projectName','227644QbGfDj','llmProject','yellow','\x22,\x20but\x20current\x20site\x20is\x20\x22','Cached\x20run\x20is\x20from\x20site\x20\x22','/<agent-name>','561471MHyDoC','Errors:\x20\x20\x20','Re-evaluation\x20Summary','split','add','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','4870755vQojDZ','Site:\x20','jsonl','table','No\x20tests\x20have\x20tags\x20defined.','⚠\x20SKIPPED:\x20','Duration:\x20','reeval','✗\x20FAIL:\x20','round','eval','Test\x20Configuration:','tsv','Re-evaluating...','rounds','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','status','...\x20','No\x20tests\x20found\x20matching:\x20','some','Running\x20test:\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','286260dswCcb','reason','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','Failed\x20Tests:','\x20\x20Round\x20','message','Re-evaluating\x20cached\x20test\x20run...','cyan','resolveAgentId','\x22:\x20','log','execute','executeReeval','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','210798teFPcR','conversation_url','FAIL','Running:\x20','name','output','✗\x20ERROR:\x20','now','\x20(cached)','Conversation\x20URL:\x20','156424bgCUND','resolveProjectId','push','\x20\x20Evaluating...\x20','agent:test','forEach','tags','5tVLPjm','resolve','agentDirs','\x20\x20Agent:\x20','text','Executing\x20new\x20tests...','agent','site','\x20\x20Project:\x20','no_tests','llm','dim','74862WHCela','green','\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)','verbose','119wXeWxf','test.yml','no_local_folder','Run\x20tests\x20for\x20an\x20LLM\x20agent','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','tests','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','✓\x20PASS:\x20','found','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','trim','utf-8','\x20\x20Site:\x20','Error\x20writing\x20output\x20file:\x20','✗\x20ERROR:\x20Project\x20not\x20found:\x20','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','basename','Cached\x20run\x20from:\x20','Re-evaluating\x20',':\x20Sending\x20user\x20input...','Agent:\x20','join','json','No\x20tests\x20found\x20with\x20tags:\x20','context','Tests\x20found:\x20','length','Run\x20\x27tdx\x20agent\x20pull\x20','includes','isSpinning','...','404','\x27\x20to\x20create\x20the\x20folder\x20structure.','stop','ERROR','Test\x20','conversations','red','projectDir','\x20(new)','toLowerCase','Round\x201/','\x20\x20-\x20','repeat','agentName','Error:\x20No\x20previous\x20test\x20run\x20found.','size','has','Failed:\x20\x20\x20','Running\x20agent\x20tests...','start','Available\x20tags:\x20','\x20-\x20','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','Passed:\x20\x20\x20','map','timestamp','no_context','writeFileSync','dryRun','not\x20found','Available\x20tests:\x20','Total:\x20\x20\x20\x20','filter','Evaluating\x20response...','Project\x20path:\x20','toISOString'];a5_0x5ae8=function(){return _0x372f43;};return a5_0x5ae8();}function a5_0x3ed8(_0xbc9871,_0x2241cf){_0xbc9871=_0xbc9871-0x73;const _0x5ae8b=a5_0x5ae8();let _0x3ed8c3=_0x5ae8b[_0xbc9871];return _0x3ed8c3;}import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x27db88(0x10c)]=a5_0x27db88(0x79);['description']=a5_0x27db88(0x8f);async[a5_0x27db88(0x105)](_0x497862){const _0x2f74ab=a5_0x27db88,{options:_0x2e8ac8,args:_0x4d4bb5,tdx:_0x54821a}=_0x497862,_0x4d78aa=_0x4d4bb5[0x0]||'.',_0x22a850=_0x2e8ac8[_0x2f74ab(0xc7)],_0x4b7aaa=_0x2e8ac8,_0x4a1fca=_0x4b7aaa[_0x2f74ab(0xee)]===![],_0x2daa63=_0x4b7aaa[_0x2f74ab(0xeb)],_0x387677=_0x4b7aaa[_0x2f74ab(0x10c)],_0x39bbbe=_0x4b7aaa[_0x2f74ab(0x7b)],_0x5f314f=_0x2e8ac8[_0x2f74ab(0x83)],_0x1ec630=_0x4b7aaa[_0x2f74ab(0x10d)];if(_0x2daa63&&_0x4a1fca)return console[_0x2f74ab(0x104)](a5_0x17bfe6[_0x2f74ab(0xb1)](_0x2f74ab(0x95))),0x1;let _0x26fe31=_0x2f74ab(0xe7);if(_0x4b7aaa[_0x2f74ab(0xa2)])_0x26fe31=_0x2f74ab(0xa2);else{if(_0x4b7aaa[_0x2f74ab(0xe6)])_0x26fe31='jsonl';else{if(_0x4b7aaa[_0x2f74ab(0xf0)])_0x26fe31=_0x2f74ab(0xf0);else{if(_0x4b7aaa[_0x2f74ab(0xe7)])_0x26fe31=_0x2f74ab(0xe7);}}}const _0x13b106=_0x4b7aaa[_0x2f74ab(0xd8)];let _0xc2adee=_0x4d78aa;const _0x45249b=a5_0x1e08d7['existsSync'](_0x4d78aa),_0xa0727e=_0x4d78aa==='.';if(!_0x45249b||_0xa0727e){const _0x65031=resolveProjectFromContext(_0x4d78aa,_0x13b106,{'requireFile':_0x2f74ab(0x8d)});if(_0x65031[_0x2f74ab(0x94)])_0xc2adee=_0x65031[_0x2f74ab(0xb2)],_0x65031['source']===_0x2f74ab(0xa4)&&console[_0x2f74ab(0x104)](a5_0x17bfe6['dim']('Using\x20agent:\x20'+_0xc2adee));else switch(_0x65031[_0x2f74ab(0xfb)]){case _0x2f74ab(0xc5):console[_0x2f74ab(0x104)](a5_0x17bfe6[_0x2f74ab(0xd9)](_0x65031['message'])),console[_0x2f74ab(0x104)](),console[_0x2f74ab(0x104)]('Usage:'),console['log'](_0x2f74ab(0xf9)),console[_0x2f74ab(0x104)](_0x2f74ab(0x8a)),console[_0x2f74ab(0x104)](),console[_0x2f74ab(0x104)](_0x2f74ab(0xc1));return 0x1;case _0x2f74ab(0x8e):console['log'](a5_0x17bfe6['yellow'](_0x65031[_0x2f74ab(0xff)])),console[_0x2f74ab(0x104)](),console[_0x2f74ab(0x104)](_0x2f74ab(0xa7)+_0x65031[_0x2f74ab(0xd8)]+_0x2f74ab(0xac));return 0x1;case'multiple_agents':{const _0x1c3465=a5_0x564877[_0x2f74ab(0x9c)](_0x65031['projectDir']);console['log'](a5_0x17bfe6['yellow']('Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22'+_0x65031[_0x2f74ab(0xd8)]+'\x22:'));for(const _0x956e10 of _0x65031[_0x2f74ab(0x7e)]){console[_0x2f74ab(0x104)](_0x2f74ab(0xb6)+_0x956e10);}return console[_0x2f74ab(0x104)](),console[_0x2f74ab(0x104)](_0x2f74ab(0xe3)+_0x1c3465+_0x2f74ab(0xdc)),0x1;}case _0x2f74ab(0x85):console['log'](a5_0x17bfe6['yellow']('No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22'+_0x65031[_0x2f74ab(0xd8)]+'\x22.')),console[_0x2f74ab(0x104)](a5_0x17bfe6[_0x2f74ab(0x87)](_0x2f74ab(0xcd)+_0x65031['projectDir'])),console['log'](),console[_0x2f74ab(0x104)]('Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.');return 0x1;}}const {definition:_0x135bc4,agentInfo:_0x5ab469}=parseTestFile(_0xc2adee);let _0x426387=_0x135bc4['tests'];if(_0x387677){const _0x5f17f8=_0x387677[_0x2f74ab(0xe0)](',')[_0x2f74ab(0xc3)](_0x520176=>_0x520176[_0x2f74ab(0x96)]());_0x426387=_0x135bc4[_0x2f74ab(0x91)][_0x2f74ab(0xcb)](_0x1500a3=>_0x5f17f8['includes'](_0x1500a3['name']));if(_0x426387[_0x2f74ab(0xa6)]===0x0)return console[_0x2f74ab(0x104)](a5_0x17bfe6['yellow'](_0x2f74ab(0xf6)+_0x387677)),console[_0x2f74ab(0x104)](a5_0x17bfe6[_0x2f74ab(0x87)](_0x2f74ab(0xc9)+_0x135bc4[_0x2f74ab(0x91)][_0x2f74ab(0xc3)](_0x4bafa9=>_0x4bafa9['name'])[_0x2f74ab(0xa1)](',\x20'))),0x1;}if(_0x39bbbe){const _0xfff65a=_0x39bbbe[_0x2f74ab(0xe0)](',')[_0x2f74ab(0xc3)](_0x483508=>_0x483508[_0x2f74ab(0x96)]()[_0x2f74ab(0xb4)]());_0x426387=_0x426387[_0x2f74ab(0xcb)](_0x5552ed=>_0x5552ed[_0x2f74ab(0x7b)]?.[_0x2f74ab(0xf7)](_0x5de8a4=>_0xfff65a[_0x2f74ab(0xa8)](_0x5de8a4['toLowerCase']())));if(_0x426387[_0x2f74ab(0xa6)]===0x0){console[_0x2f74ab(0x104)](a5_0x17bfe6[_0x2f74ab(0xd9)](_0x2f74ab(0xa3)+_0x39bbbe));const _0x58e5bc=new Set();return _0x135bc4['tests'][_0x2f74ab(0x7a)](_0x474a5a=>_0x474a5a[_0x2f74ab(0x7b)]?.[_0x2f74ab(0x7a)](_0xcb3d15=>_0x58e5bc[_0x2f74ab(0xe1)](_0xcb3d15))),_0x58e5bc[_0x2f74ab(0xba)]>0x0?console['log'](a5_0x17bfe6[_0x2f74ab(0x87)](_0x2f74ab(0xbf)+[..._0x58e5bc]['join'](',\x20'))):console[_0x2f74ab(0x104)](a5_0x17bfe6[_0x2f74ab(0x87)](_0x2f74ab(0xe8))),0x1;}}if(_0x2daa63)return this['executeReeval'](_0x497862,{'definition':{'tests':_0x426387},'agentInfo':_0x5ab469,'outputFormat':_0x26fe31,'outputFile':_0x1ec630,'testNames':_0x387677});if(_0x22a850){console['log'](a5_0x17bfe6['cyan'](_0x2f74ab(0xef))),console[_0x2f74ab(0x104)](_0x2f74ab(0x98)+a5_0x17bfe6[_0x2f74ab(0xd2)](_0x5f314f)),console[_0x2f74ab(0x104)](_0x2f74ab(0x84)+a5_0x17bfe6[_0x2f74ab(0xd2)](_0x5ab469[_0x2f74ab(0xd6)])),console[_0x2f74ab(0x104)](_0x2f74ab(0x7f)+a5_0x17bfe6[_0x2f74ab(0xd2)](_0x5ab469[_0x2f74ab(0xb8)])),console['log'](),console['log'](_0x2f74ab(0xa5)+a5_0x17bfe6[_0x2f74ab(0xd2)](_0x426387[_0x2f74ab(0xa6)]));for(let _0x1ee3a4=0x0;_0x1ee3a4<_0x426387[_0x2f74ab(0xa6)];_0x1ee3a4++){const _0x477593=_0x426387[_0x1ee3a4],_0x2add77=_0x477593[_0x2f74ab(0xf2)]['length']===0x1?_0x2f74ab(0xed):_0x2f74ab(0xf2),_0x396fcc=_0x477593[_0x2f74ab(0x7b)]?.['length']?'\x20['+_0x477593[_0x2f74ab(0x7b)][_0x2f74ab(0xa1)](',\x20')+']':'';console['log']('\x20\x20'+(_0x1ee3a4+0x1)+'.\x20'+a5_0x17bfe6['white'](_0x477593['name'])+'\x20('+_0x477593['rounds'][_0x2f74ab(0xa6)]+'\x20'+_0x2add77+')'+a5_0x17bfe6[_0x2f74ab(0x87)](_0x396fcc));}return 0x0;}let _0x248269,_0x25821a;try{_0x248269=await _0x54821a[_0x2f74ab(0x86)][_0x2f74ab(0x76)](_0x5ab469[_0x2f74ab(0xd6)]);}catch(_0x49afd0){const _0x608d47=_0x49afd0 instanceof Error?_0x49afd0[_0x2f74ab(0xff)]:String(_0x49afd0);return _0x608d47[_0x2f74ab(0xa8)](_0x2f74ab(0xab))||_0x608d47[_0x2f74ab(0xb4)]()[_0x2f74ab(0xa8)](_0x2f74ab(0xc8))?console['log'](a5_0x17bfe6[_0x2f74ab(0xb1)](_0x2f74ab(0x9a)+_0x5ab469[_0x2f74ab(0xd6)])):console[_0x2f74ab(0x104)](a5_0x17bfe6[_0x2f74ab(0xb1)](_0x2f74ab(0x107)+_0x5ab469['projectName']+'\x22:\x20'+_0x608d47)),0x1;}try{_0x25821a=await _0x54821a['llm'][_0x2f74ab(0x102)](_0x5ab469[_0x2f74ab(0xb8)],_0x248269);}catch(_0x1bd9a4){const _0x453cc8=_0x1bd9a4 instanceof Error?_0x1bd9a4[_0x2f74ab(0xff)]:String(_0x1bd9a4);return _0x453cc8[_0x2f74ab(0xa8)](_0x2f74ab(0xab))||_0x453cc8[_0x2f74ab(0xb4)]()[_0x2f74ab(0xa8)](_0x2f74ab(0xc8))?console['log'](a5_0x17bfe6[_0x2f74ab(0xb1)](_0x2f74ab(0x9b)+_0x5ab469[_0x2f74ab(0xb8)])):console[_0x2f74ab(0x104)](a5_0x17bfe6[_0x2f74ab(0xb1)](_0x2f74ab(0xfc)+_0x5ab469[_0x2f74ab(0xb8)]+_0x2f74ab(0x103)+_0x453cc8)),0x1;}let _0x17d9fb;if(!_0x4a1fca)try{_0x17d9fb=await setupEvaluatorAgent(_0x54821a[_0x2f74ab(0x86)],_0x2e8ac8[_0x2f74ab(0x8b)]);}catch(_0x3b8248){const _0x6e7971=_0x3b8248 instanceof Error?_0x3b8248[_0x2f74ab(0xff)]:String(_0x3b8248);return console[_0x2f74ab(0x104)](a5_0x17bfe6[_0x2f74ab(0xb1)](_0x2f74ab(0x92)+_0x6e7971)),0x1;}console['log'](a5_0x17bfe6[_0x2f74ab(0x101)](_0x2f74ab(0xbd))),console[_0x2f74ab(0x104)](_0x2f74ab(0xe5)+a5_0x17bfe6[_0x2f74ab(0xd2)](_0x5f314f)),console['log'](_0x2f74ab(0xa0)+a5_0x17bfe6['white'](_0x5ab469['projectName']+'/'+_0x5ab469['agentName'])),console['log']();const _0x4e48d2=[],_0x5ae1fa=[],_0x3156e3=Date[_0x2f74ab(0x10f)]();for(let _0x3372b0=0x0;_0x3372b0<_0x426387['length'];_0x3372b0++){const _0x48db31=_0x426387[_0x3372b0];_0x426387[_0x2f74ab(0xa6)]>0x1?console[_0x2f74ab(0x104)](_0x2f74ab(0xaf)+(_0x3372b0+0x1)+'/'+_0x426387[_0x2f74ab(0xa6)]+':\x20'+a5_0x17bfe6['white'](_0x48db31[_0x2f74ab(0x10c)])):console[_0x2f74ab(0x104)](_0x2f74ab(0xf8)+a5_0x17bfe6[_0x2f74ab(0xd2)](_0x48db31[_0x2f74ab(0x10c)]));const _0x2967ff=createCommandSpinner(_0x2f74ab(0xb5)+_0x48db31[_0x2f74ab(0xf2)][_0x2f74ab(0xa6)]+_0x2f74ab(0x9f));_0x2967ff[_0x2f74ab(0xbe)]();try{const {result:_0x444cd2,conversation:_0x444478}=await runTest(_0x54821a[_0x2f74ab(0x86)],_0x48db31,{'agentId':_0x25821a,'projectId':_0x248269,'site':_0x5f314f,'noEval':_0x4a1fca,'evaluatorId':_0x17d9fb,'onRoundStart':(_0x2fbc8b,_0x3d806f)=>{const _0x5dfeb0=_0x2f74ab;_0x2967ff[_0x5dfeb0(0x80)]=_0x5dfeb0(0xd1)+(_0x2fbc8b+0x1)+'/'+_0x3d806f+_0x5dfeb0(0x9f);},'onRoundComplete':(_0x4a7cc9,_0x60756c,_0x4737be)=>{const _0x4ec03e=_0x2f74ab,_0x101c3f=formatElapsed(_0x60756c);_0x4737be?console[_0x4ec03e(0x104)](_0x4ec03e(0xfe)+(_0x4a7cc9+0x1)+'/'+_0x48db31['rounds'][_0x4ec03e(0xa6)]+_0x4ec03e(0xf5)+a5_0x17bfe6[_0x4ec03e(0x89)]('✓')+'\x20('+_0x101c3f+')'):console[_0x4ec03e(0x104)](_0x4ec03e(0xfe)+(_0x4a7cc9+0x1)+'/'+_0x48db31[_0x4ec03e(0xf2)][_0x4ec03e(0xa6)]+_0x4ec03e(0xf5)+a5_0x17bfe6[_0x4ec03e(0xb1)]('✗'));},'onEvaluationStart':()=>{const _0x41c5cd=_0x2f74ab;_0x2967ff[_0x41c5cd(0x80)]=_0x41c5cd(0xcc);},'onEvaluationComplete':_0x3bc96d=>{const _0x1cf5d7=_0x2f74ab,_0x213ae6=formatElapsed(_0x3bc96d);console[_0x1cf5d7(0x104)](_0x1cf5d7(0x78)+a5_0x17bfe6['green']('✓')+'\x20('+_0x213ae6+')');}});_0x2967ff[_0x2f74ab(0xad)](),_0x4e48d2[_0x2f74ab(0x77)](_0x444cd2),_0x5ae1fa[_0x2f74ab(0x77)](_0x444478);if(_0x444cd2[_0x2f74ab(0xf4)]===_0x2f74ab(0xd0))console[_0x2f74ab(0x104)](a5_0x17bfe6['green'](_0x2f74ab(0x93)+_0x444cd2[_0x2f74ab(0xfb)]));else _0x444cd2['status']===_0x2f74ab(0x10a)?console[_0x2f74ab(0x104)](a5_0x17bfe6['red']('✗\x20FAIL:\x20'+_0x444cd2[_0x2f74ab(0xfb)])):console[_0x2f74ab(0x104)](a5_0x17bfe6[_0x2f74ab(0xb1)]('✗\x20ERROR:\x20'+_0x444cd2[_0x2f74ab(0xfb)]));_0x444cd2[_0x2f74ab(0x109)]&&console[_0x2f74ab(0x104)](a5_0x17bfe6[_0x2f74ab(0x87)](_0x2f74ab(0x74)+_0x444cd2[_0x2f74ab(0x109)])),console[_0x2f74ab(0x104)]();}catch(_0xa9999a){_0x2967ff['stop']();const _0x2adc09=_0xa9999a instanceof Error?_0xa9999a[_0x2f74ab(0xff)]:String(_0xa9999a);console[_0x2f74ab(0x104)](a5_0x17bfe6[_0x2f74ab(0xb1)](_0x2f74ab(0x10e)+_0x2adc09)),console['log'](),_0x4e48d2[_0x2f74ab(0x77)]({'name':_0x48db31['name'],'status':'ERROR','reason':_0x2adc09,'timestamp':new Date()[_0x2f74ab(0xce)](),'duration_ms':0x0});}}const _0x4375bb=Date['now']()-_0x3156e3,_0x480106=_0x4e48d2['filter'](_0x2d9cb4=>_0x2d9cb4[_0x2f74ab(0xf4)]===_0x2f74ab(0xd0))['length'],_0x18e041=_0x4e48d2[_0x2f74ab(0xcb)](_0x154991=>_0x154991[_0x2f74ab(0xf4)]===_0x2f74ab(0x10a))[_0x2f74ab(0xa6)],_0x1f679a=_0x4e48d2[_0x2f74ab(0xcb)](_0x2c42b2=>_0x2c42b2[_0x2f74ab(0xf4)]===_0x2f74ab(0xae))[_0x2f74ab(0xa6)];console[_0x2f74ab(0x104)]('━'['repeat'](0x3c)),console[_0x2f74ab(0x104)]('Test\x20Summary'),console[_0x2f74ab(0x104)]('━'[_0x2f74ab(0xb7)](0x3c)),console[_0x2f74ab(0x104)](_0x2f74ab(0xca)+_0x4e48d2[_0x2f74ab(0xa6)]),console[_0x2f74ab(0x104)](_0x2f74ab(0xc2)+a5_0x17bfe6['green'](_0x480106)),console[_0x2f74ab(0x104)](_0x2f74ab(0xbc)+a5_0x17bfe6[_0x2f74ab(0xb1)](_0x18e041));_0x1f679a>0x0&&console[_0x2f74ab(0x104)]('Errors:\x20\x20\x20'+a5_0x17bfe6[_0x2f74ab(0xb1)](_0x1f679a));console[_0x2f74ab(0x104)](_0x2f74ab(0xea)+formatElapsed(_0x4375bb)),console[_0x2f74ab(0x104)]('━'[_0x2f74ab(0xb7)](0x3c));const _0x459100=_0x4e48d2[_0x2f74ab(0xcb)](_0x11d1b0=>_0x11d1b0[_0x2f74ab(0xf4)]!==_0x2f74ab(0xd0));if(_0x459100[_0x2f74ab(0xa6)]>0x0){console[_0x2f74ab(0x104)](),console[_0x2f74ab(0x104)](_0x2f74ab(0xfd));for(const _0x48cfb0 of _0x459100){const _0x19f818=a5_0x17bfe6[_0x2f74ab(0xb1)]('✗'),_0x4f8084=_0x48cfb0['reason'][_0x2f74ab(0xa6)]>0x32?_0x48cfb0['reason']['substring'](0x0,0x32)+_0x2f74ab(0xaa):_0x48cfb0[_0x2f74ab(0xfb)];console['log']('\x20\x20'+_0x19f818+'\x20'+_0x48cfb0['name']+':\x20'+_0x4f8084);}}const _0x221026={'summary':{'total':_0x4e48d2['length'],'passed':_0x480106,'failed':_0x18e041,'errors':_0x1f679a>0x0?_0x1f679a:undefined,'duration_ms':_0x4375bb},'tests':_0x4e48d2,'agent':{'project':_0x5ab469[_0x2f74ab(0xd6)],'name':_0x5ab469[_0x2f74ab(0xb8)],'site':_0x5f314f},'timestamp':new Date(_0x3156e3)[_0x2f74ab(0xce)]()};try{const _0x206927=buildCachedTestRun(_0x5ae1fa,{'site':_0x5f314f,'projectId':_0x248269,'projectName':_0x5ab469[_0x2f74ab(0xd6)],'agentId':_0x25821a,'agentName':_0x5ab469[_0x2f74ab(0xb8)],'testYmlPath':a5_0x564877[_0x2f74ab(0x7d)](_0x5ab469[_0x2f74ab(0xd3)])});saveLastTestRun(_0x206927);}catch{}if(_0x26fe31!==_0x2f74ab(0xe7)||_0x1ec630){const _0x377863=formatResults(_0x221026,_0x26fe31);if(_0x1ec630)try{a5_0x1e08d7[_0x2f74ab(0xc6)](_0x1ec630,_0x377863,_0x2f74ab(0x97)),console[_0x2f74ab(0x104)](),console['log'](a5_0x17bfe6[_0x2f74ab(0x87)]('Output\x20written\x20to:\x20'+_0x1ec630));}catch(_0xf8ee6d){return console['log'](),console[_0x2f74ab(0x104)](a5_0x17bfe6[_0x2f74ab(0xb1)](_0x2f74ab(0x99)+_0xf8ee6d)),0x1;}else console[_0x2f74ab(0x104)](),console['log'](_0x377863);}return _0x459100['length']>0x0?0x1:0x0;}async[a5_0x27db88(0x106)](_0x4ad881,_0x249042){const _0x1fbb70=a5_0x27db88,{options:_0x32f7c5,tdx:_0x3c4ed6}=_0x4ad881,{definition:_0x57f201,agentInfo:_0xa9cccd,outputFormat:_0x3709bf,outputFile:_0x45098a}=_0x249042,_0x2110d6=_0x32f7c5['site'],_0x42d27b=loadLastTestRun();if(!_0x42d27b)return console[_0x1fbb70(0x104)](a5_0x17bfe6['red'](_0x1fbb70(0xb9))),console[_0x1fbb70(0x104)](a5_0x17bfe6['dim'](_0x1fbb70(0xe2))),0x1;if(_0x42d27b[_0x1fbb70(0x82)][_0x1fbb70(0xb8)]!==_0xa9cccd[_0x1fbb70(0xb8)])return console['log'](a5_0x17bfe6[_0x1fbb70(0xb1)]('Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22'+_0x42d27b[_0x1fbb70(0x82)][_0x1fbb70(0xb8)]+'\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22'+_0xa9cccd[_0x1fbb70(0xb8)]+'\x22.')),console[_0x1fbb70(0x104)](a5_0x17bfe6[_0x1fbb70(0x87)]('Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.')),0x1;const _0x1e7bc2=new Set(_0x42d27b[_0x1fbb70(0xb0)]['map'](_0x590c7e=>_0x590c7e['testName'])),_0x1e1d59=_0x57f201['tests']['filter'](_0x352ada=>!_0x1e7bc2[_0x1fbb70(0xbb)](_0x352ada[_0x1fbb70(0x10c)]));if(_0x1e1d59['length']>0x0&&_0x42d27b[_0x1fbb70(0x83)]!==_0x2110d6)return console[_0x1fbb70(0x104)](a5_0x17bfe6[_0x1fbb70(0xb1)](_0x1fbb70(0xf3))),console[_0x1fbb70(0x104)](a5_0x17bfe6[_0x1fbb70(0x87)](_0x1fbb70(0xdb)+_0x42d27b[_0x1fbb70(0x83)]+_0x1fbb70(0xda)+_0x2110d6+'\x22.')),console['log'](a5_0x17bfe6[_0x1fbb70(0x87)]('Either\x20switch\x20to\x20the\x20\x22'+_0x42d27b['site']+_0x1fbb70(0x90))),0x1;const _0x165ec5=_0x57f201[_0x1fbb70(0x91)][_0x1fbb70(0xcb)](_0x71f9b5=>_0x1e7bc2[_0x1fbb70(0xbb)](_0x71f9b5[_0x1fbb70(0x10c)])),_0x1254a1=_0x1e1d59;let _0xa6163;try{_0xa6163=await setupEvaluatorAgent(_0x3c4ed6['llm'],_0x32f7c5[_0x1fbb70(0x8b)]);}catch(_0x4b7093){const _0x29a270=_0x4b7093 instanceof Error?_0x4b7093[_0x1fbb70(0xff)]:String(_0x4b7093);return console[_0x1fbb70(0x104)](a5_0x17bfe6[_0x1fbb70(0xb1)](_0x1fbb70(0x92)+_0x29a270)),0x1;}console['log'](a5_0x17bfe6[_0x1fbb70(0x101)](_0x1fbb70(0x100))),console[_0x1fbb70(0x104)](_0x1fbb70(0x9d)+a5_0x17bfe6[_0x1fbb70(0xd2)](_0x42d27b[_0x1fbb70(0xc4)])),console[_0x1fbb70(0x104)](_0x1fbb70(0xa0)+a5_0x17bfe6[_0x1fbb70(0xd2)](_0x42d27b[_0x1fbb70(0x82)]['projectName']+'/'+_0x42d27b[_0x1fbb70(0x82)]['agentName']));_0x1254a1[_0x1fbb70(0xa6)]>0x0&&console['log'](_0x1fbb70(0xcf)+a5_0x17bfe6[_0x1fbb70(0xd9)](_0x1254a1[_0x1fbb70(0xa6)]));console['log']();const _0x160f2b=[],_0x343ba3=Date[_0x1fbb70(0x10f)](),_0x2a8abf=createCommandSpinner(_0x1fbb70(0xf1));if(_0x165ec5[_0x1fbb70(0xa6)]>0x0)try{const _0x21ae3c=await reevaluateFromCache(_0x3c4ed6[_0x1fbb70(0x86)],_0x42d27b,{'tests':_0x165ec5},{'evaluatorId':_0xa6163,'onTestStart':(_0xdfc55f,_0x467b36,_0x2b470e)=>{const _0x14d275=_0x1fbb70;_0x2a8abf['text']=_0x14d275(0x9e)+(_0x467b36+0x1)+'/'+_0x2b470e+':\x20'+_0xdfc55f+_0x14d275(0xaa);if(!_0x2a8abf[_0x14d275(0xa9)])_0x2a8abf[_0x14d275(0xbe)]();},'onTestComplete':(_0x50dfcc,_0x52071e)=>{const _0x599a28=_0x1fbb70;_0x2a8abf['stop']();if(_0x52071e[_0x599a28(0xf4)]===_0x599a28(0xd0))console[_0x599a28(0x104)](a5_0x17bfe6[_0x599a28(0x89)](_0x599a28(0x93)+_0x50dfcc)+a5_0x17bfe6['dim'](_0x599a28(0x73)));else _0x52071e[_0x599a28(0xf4)]===_0x599a28(0x10a)?console[_0x599a28(0x104)](a5_0x17bfe6[_0x599a28(0xb1)]('✗\x20FAIL:\x20'+_0x50dfcc+'\x20-\x20'+_0x52071e[_0x599a28(0xfb)])+a5_0x17bfe6[_0x599a28(0x87)](_0x599a28(0x73))):console[_0x599a28(0x104)](a5_0x17bfe6['red'](_0x599a28(0x10e)+_0x50dfcc+_0x599a28(0xc0)+_0x52071e[_0x599a28(0xfb)]));_0x52071e[_0x599a28(0x109)]&&console[_0x599a28(0x104)](a5_0x17bfe6[_0x599a28(0x87)](_0x599a28(0xd4)+_0x52071e[_0x599a28(0x109)])),_0x160f2b[_0x599a28(0x77)](_0x52071e);},'onTestSkipped':(_0x130084,_0x349c04)=>{const _0x18f765=_0x1fbb70;_0x2a8abf[_0x18f765(0xad)](),console['log'](a5_0x17bfe6[_0x18f765(0xd9)](_0x18f765(0xe9)+_0x130084+_0x18f765(0xc0)+_0x349c04));}});for(const _0x235183 of _0x21ae3c){!_0x160f2b[_0x1fbb70(0xd5)](_0x5f1787=>_0x5f1787[_0x1fbb70(0x10c)]===_0x235183[_0x1fbb70(0x10c)])&&_0x160f2b[_0x1fbb70(0x77)](_0x235183);}}catch(_0x2c93a6){_0x2a8abf['stop']();const _0x243fc4=_0x2c93a6 instanceof Error?_0x2c93a6[_0x1fbb70(0xff)]:String(_0x2c93a6);return console[_0x1fbb70(0x104)](a5_0x17bfe6[_0x1fbb70(0xb1)]('✗\x20ERROR:\x20Re-evaluation\x20failed:\x20'+_0x243fc4)),0x1;}_0x2a8abf[_0x1fbb70(0xad)]();if(_0x1254a1[_0x1fbb70(0xa6)]>0x0){console[_0x1fbb70(0x104)](),console[_0x1fbb70(0x104)](a5_0x17bfe6['cyan'](_0x1fbb70(0x81)));const {projectId:_0x369bbc,agentId:_0x4629b6}=_0x42d27b[_0x1fbb70(0x82)];for(const _0x1ff0df of _0x1254a1){console['log'](_0x1fbb70(0x10b)+a5_0x17bfe6[_0x1fbb70(0xd2)](_0x1ff0df['name']));const _0x667140=createCommandSpinner(_0x1fbb70(0xb5)+_0x1ff0df['rounds'][_0x1fbb70(0xa6)]+':\x20Sending\x20user\x20input...');_0x667140['start']();try{const {result:_0x1daf9e}=await runTest(_0x3c4ed6[_0x1fbb70(0x86)],_0x1ff0df,{'agentId':_0x4629b6,'projectId':_0x369bbc,'site':_0x42d27b[_0x1fbb70(0x83)],'noEval':![],'evaluatorId':_0xa6163,'onRoundStart':(_0x6d70ba,_0x43cf5f)=>{const _0x20975d=_0x1fbb70;_0x667140[_0x20975d(0x80)]='Round\x20'+(_0x6d70ba+0x1)+'/'+_0x43cf5f+_0x20975d(0x9f);},'onRoundComplete':(_0x174d67,_0x3eedef,_0x53b542)=>{const _0x44944a=_0x1fbb70,_0x485eca=formatElapsed(_0x3eedef);_0x53b542?console[_0x44944a(0x104)](_0x44944a(0xfe)+(_0x174d67+0x1)+'/'+_0x1ff0df[_0x44944a(0xf2)][_0x44944a(0xa6)]+_0x44944a(0xf5)+a5_0x17bfe6[_0x44944a(0x89)]('✓')+'\x20('+_0x485eca+')'):console['log'](_0x44944a(0xfe)+(_0x174d67+0x1)+'/'+_0x1ff0df[_0x44944a(0xf2)]['length']+_0x44944a(0xf5)+a5_0x17bfe6[_0x44944a(0xb1)]('✗'));},'onEvaluationStart':()=>{_0x667140['text']='Evaluating\x20response...';},'onEvaluationComplete':_0xd609c3=>{const _0x504d15=_0x1fbb70,_0x1b7dbc=formatElapsed(_0xd609c3);console['log'](_0x504d15(0x78)+a5_0x17bfe6['green']('✓')+'\x20('+_0x1b7dbc+')');}});_0x667140['stop'](),_0x160f2b[_0x1fbb70(0x77)](_0x1daf9e);if(_0x1daf9e['status']===_0x1fbb70(0xd0))console[_0x1fbb70(0x104)](a5_0x17bfe6['green'](_0x1fbb70(0x93)+_0x1daf9e['reason'])+a5_0x17bfe6[_0x1fbb70(0x87)](_0x1fbb70(0xb3)));else _0x1daf9e[_0x1fbb70(0xf4)]===_0x1fbb70(0x10a)?console['log'](a5_0x17bfe6[_0x1fbb70(0xb1)](_0x1fbb70(0xec)+_0x1daf9e[_0x1fbb70(0xfb)])+a5_0x17bfe6[_0x1fbb70(0x87)](_0x1fbb70(0xb3))):console['log'](a5_0x17bfe6[_0x1fbb70(0xb1)](_0x1fbb70(0x10e)+_0x1daf9e[_0x1fbb70(0xfb)]));_0x1daf9e[_0x1fbb70(0x109)]&&console[_0x1fbb70(0x104)](a5_0x17bfe6[_0x1fbb70(0x87)](_0x1fbb70(0xd4)+_0x1daf9e[_0x1fbb70(0x109)]));}catch(_0x129da9){_0x667140[_0x1fbb70(0xad)]();const _0x56ccb0=_0x129da9 instanceof Error?_0x129da9[_0x1fbb70(0xff)]:String(_0x129da9);console[_0x1fbb70(0x104)](a5_0x17bfe6[_0x1fbb70(0xb1)]('✗\x20ERROR:\x20'+_0x56ccb0)),_0x160f2b['push']({'name':_0x1ff0df[_0x1fbb70(0x10c)],'status':_0x1fbb70(0xae),'reason':_0x56ccb0,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}}console[_0x1fbb70(0x104)]();const _0x24fd09=Date[_0x1fbb70(0x10f)]()-_0x343ba3,_0x4f6c7a=_0x160f2b[_0x1fbb70(0xcb)](_0x131cf9=>_0x131cf9[_0x1fbb70(0xf4)]===_0x1fbb70(0xd0))[_0x1fbb70(0xa6)],_0x11295a=_0x160f2b[_0x1fbb70(0xcb)](_0x196211=>_0x196211[_0x1fbb70(0xf4)]===_0x1fbb70(0x10a))[_0x1fbb70(0xa6)],_0x1d1257=_0x160f2b[_0x1fbb70(0xcb)](_0x28104b=>_0x28104b[_0x1fbb70(0xf4)]===_0x1fbb70(0xae))[_0x1fbb70(0xa6)];console[_0x1fbb70(0x104)]('━'['repeat'](0x3c)),console[_0x1fbb70(0x104)](_0x1fbb70(0xdf)),console[_0x1fbb70(0x104)]('━'[_0x1fbb70(0xb7)](0x3c)),console[_0x1fbb70(0x104)](_0x1fbb70(0xca)+_0x160f2b[_0x1fbb70(0xa6)]),console[_0x1fbb70(0x104)](_0x1fbb70(0xc2)+a5_0x17bfe6['green'](_0x4f6c7a)),console[_0x1fbb70(0x104)](_0x1fbb70(0xbc)+a5_0x17bfe6[_0x1fbb70(0xb1)](_0x11295a));_0x1d1257>0x0&&console[_0x1fbb70(0x104)](_0x1fbb70(0xde)+a5_0x17bfe6[_0x1fbb70(0xb1)](_0x1d1257));console['log'](_0x1fbb70(0xea)+formatElapsed(_0x24fd09)),console[_0x1fbb70(0x104)]('━'[_0x1fbb70(0xb7)](0x3c));const _0x189bac={'summary':{'total':_0x160f2b[_0x1fbb70(0xa6)],'passed':_0x4f6c7a,'failed':_0x11295a,'errors':_0x1d1257>0x0?_0x1d1257:undefined,'duration_ms':_0x24fd09},'tests':_0x160f2b,'agent':{'project':_0xa9cccd[_0x1fbb70(0xd6)],'name':_0xa9cccd['agentName'],'site':_0x2110d6},'timestamp':new Date(_0x343ba3)[_0x1fbb70(0xce)]()};if(_0x3709bf!==_0x1fbb70(0xe7)||_0x45098a){const _0x3b2585=formatResults(_0x189bac,_0x3709bf);if(_0x45098a)try{a5_0x1e08d7['writeFileSync'](_0x45098a,_0x3b2585,_0x1fbb70(0x97)),console[_0x1fbb70(0x104)](),console[_0x1fbb70(0x104)](a5_0x17bfe6[_0x1fbb70(0x87)]('Output\x20written\x20to:\x20'+_0x45098a));}catch(_0x4611eb){return console[_0x1fbb70(0x104)](),console[_0x1fbb70(0x104)](a5_0x17bfe6['red'](_0x1fbb70(0x99)+_0x4611eb)),0x1;}else console[_0x1fbb70(0x104)](),console[_0x1fbb70(0x104)](_0x3b2585);}const _0x43e887=_0x160f2b[_0x1fbb70(0xcb)](_0xdb71=>_0xdb71[_0x1fbb70(0xf4)]!==_0x1fbb70(0xd0));return _0x43e887[_0x1fbb70(0xa6)]>0x0?0x1:0x0;}}
|
|
1
|
+
const a5_0x526847=a5_0x5003;(function(_0x38d7ed,_0x3cdd22){const _0x2ff3c6=a5_0x5003,_0x3b9475=_0x38d7ed();while(!![]){try{const _0x2a3d33=parseInt(_0x2ff3c6(0x14d))/0x1*(parseInt(_0x2ff3c6(0x155))/0x2)+-parseInt(_0x2ff3c6(0x139))/0x3+-parseInt(_0x2ff3c6(0x181))/0x4*(-parseInt(_0x2ff3c6(0x18e))/0x5)+-parseInt(_0x2ff3c6(0x135))/0x6+parseInt(_0x2ff3c6(0x15d))/0x7*(parseInt(_0x2ff3c6(0x1b6))/0x8)+parseInt(_0x2ff3c6(0x19a))/0x9+-parseInt(_0x2ff3c6(0x151))/0xa*(parseInt(_0x2ff3c6(0x133))/0xb);if(_0x2a3d33===_0x3cdd22)break;else _0x3b9475['push'](_0x3b9475['shift']());}catch(_0x1f8025){_0x3b9475['push'](_0x3b9475['shift']());}}}(a5_0x27e5,0x8f79b));import*as a5_0x42074 from'node:fs';import*as a5_0x333a48 from'node:path';import a5_0x70429a from'chalk';import{BaseCommand}from'./command.js';function a5_0x27e5(){const _0x1b5295=['map','status','\x20\x20Project:\x20','json','multiple_agents','No\x20tests\x20have\x20tags\x20defined.','33wxNHQa','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','2744544VPnyEy','repeat','✗\x20ERROR:\x20Project\x20not\x20found:\x20','\x20\x20Round\x20','2394651ODOLGC','\x20-\x20','\x20\x20Evaluating...\x20','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','Usage:','add','utf-8','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','Errors:\x20\x20\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','reason','table','size','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','\x27\x20to\x20create\x20the\x20folder\x20structure.','Run\x20tests\x20for\x20an\x20LLM\x20agent','\x22:\x20','found','\x20\x20Site:\x20','1418PIMfrx','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','llm','yellow','3824620YjaCRH','\x20(new)','resolveProjectId','output','1214lDpsAL','round','Re-evaluating\x20cached\x20test\x20run...','toISOString','toLowerCase','tags','writeFileSync','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','7jVzuGY','isSpinning','Round\x20','execute','no_context','✗\x20ERROR:\x20','not\x20found','start','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','Site:\x20','ERROR','Total:\x20\x20\x20\x20','trim','message','Re-evaluating\x20',':\x20Sending\x20user\x20input...','llmProject','reeval','white','No\x20tests\x20found\x20matching:\x20','resolve','Output\x20written\x20to:\x20','Failed:\x20\x20\x20','green','tsv','projectDir','Cached\x20run\x20from:\x20','forEach','agent','Re-evaluating...','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','agentDirs','push','executeReeval','description','FAIL','64hPZMPq','split','Agent:\x20','has','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','no_tests','\x20\x20-\x20','verbose','conversations','cyan','Running:\x20','Running\x20agent\x20tests...','/<agent-name>','57005hMPEUt','name','Round\x201/','tests','Error:\x20No\x20previous\x20test\x20run\x20found.','dim','basename','...','Available\x20tests:\x20','\x20\x20Agent:\x20','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','agentName','9336789LRvYqN','✓\x20PASS:\x20','rounds','now','✗\x20FAIL:\x20','No\x20tests\x20found\x20with\x20tags:\x20','Failed\x20Tests:','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','Running\x20test:\x20','PASS','eval','includes','join','conversation_url','red','substring','text','existsSync','\x20(cached)','Project\x20path:\x20','no_local_folder','404','Cached\x20run\x20is\x20from\x20site\x20\x22','log','source','\x20\x20Conversation:\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','projectName','7281112hXybnZ','Test\x20Summary','site','stop','agent:test','Tests\x20found:\x20','context','\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)','filter','length','Error\x20writing\x20output\x20file:\x20','Passed:\x20\x20\x20','...\x20','testYmlPath'];a5_0x27e5=function(){return _0x1b5295;};return a5_0x27e5();}import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';function a5_0x5003(_0x4c2394,_0x48b1aa){_0x4c2394=_0x4c2394-0x12c;const _0x27e5ca=a5_0x27e5();let _0x50039b=_0x27e5ca[_0x4c2394];return _0x50039b;}export class AgentTestCommand extends BaseCommand{[a5_0x526847(0x18f)]=a5_0x526847(0x1ba);[a5_0x526847(0x17f)]=a5_0x526847(0x149);async[a5_0x526847(0x160)](_0x2d5cdd){const _0x1f71f1=a5_0x526847,{options:_0x45947c,args:_0x5c7418,tdx:_0xb05848}=_0x2d5cdd,_0x1b215b=_0x5c7418[0x0]||'.',_0x31bb68=_0x45947c['dryRun'],_0xebb68a=_0x45947c,_0x16eaf9=_0xebb68a[_0x1f71f1(0x1a4)]===![],_0x11ad6a=_0xebb68a[_0x1f71f1(0x16e)],_0x1d47e7=_0xebb68a['name'],_0x2750e3=_0xebb68a[_0x1f71f1(0x15a)],_0x48d2e1=_0x45947c[_0x1f71f1(0x1b8)],_0x3e0d72=_0xebb68a[_0x1f71f1(0x154)];if(_0x11ad6a&&_0x16eaf9)return console[_0x1f71f1(0x1b1)](a5_0x70429a[_0x1f71f1(0x1a8)](_0x1f71f1(0x13c))),0x1;let _0x3e21be=_0x1f71f1(0x144);if(_0xebb68a[_0x1f71f1(0x130)])_0x3e21be='json';else{if(_0xebb68a['jsonl'])_0x3e21be='jsonl';else{if(_0xebb68a[_0x1f71f1(0x175)])_0x3e21be=_0x1f71f1(0x175);else{if(_0xebb68a[_0x1f71f1(0x144)])_0x3e21be=_0x1f71f1(0x144);}}}const _0x2007ed=_0xebb68a[_0x1f71f1(0x16d)];let _0x506ef5=_0x1b215b;const _0x9aaa21=a5_0x42074[_0x1f71f1(0x1ab)](_0x1b215b),_0x49ae50=_0x1b215b==='.';if(!_0x9aaa21||_0x49ae50){const _0x451612=resolveProjectFromContext(_0x1b215b,_0x2007ed,{'requireFile':'test.yml'});if(_0x451612[_0x1f71f1(0x14b)])_0x506ef5=_0x451612[_0x1f71f1(0x176)],_0x451612[_0x1f71f1(0x1b2)]===_0x1f71f1(0x1bc)&&console['log'](a5_0x70429a[_0x1f71f1(0x193)]('Using\x20agent:\x20'+_0x506ef5));else switch(_0x451612[_0x1f71f1(0x143)]){case _0x1f71f1(0x161):console[_0x1f71f1(0x1b1)](a5_0x70429a[_0x1f71f1(0x150)](_0x451612[_0x1f71f1(0x16a)])),console[_0x1f71f1(0x1b1)](),console['log'](_0x1f71f1(0x13d)),console[_0x1f71f1(0x1b1)]('\x20\x20tdx\x20agent\x20test\x20<path>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20from\x20path'),console['log'](_0x1f71f1(0x1bd)),console[_0x1f71f1(0x1b1)](),console['log'](_0x1f71f1(0x165));return 0x1;case _0x1f71f1(0x1ae):console[_0x1f71f1(0x1b1)](a5_0x70429a[_0x1f71f1(0x150)](_0x451612[_0x1f71f1(0x16a)])),console[_0x1f71f1(0x1b1)](),console[_0x1f71f1(0x1b1)]('Run\x20\x27tdx\x20agent\x20pull\x20'+_0x451612[_0x1f71f1(0x16d)]+_0x1f71f1(0x148));return 0x1;case _0x1f71f1(0x131):{const _0x852644=a5_0x333a48[_0x1f71f1(0x194)](_0x451612['projectDir']);console[_0x1f71f1(0x1b1)](a5_0x70429a['yellow']('Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22'+_0x451612[_0x1f71f1(0x16d)]+'\x22:'));for(const _0x40417e of _0x451612[_0x1f71f1(0x17c)]){console[_0x1f71f1(0x1b1)](_0x1f71f1(0x187)+_0x40417e);}return console['log'](),console[_0x1f71f1(0x1b1)](_0x1f71f1(0x185)+_0x852644+_0x1f71f1(0x18d)),0x1;}case _0x1f71f1(0x186):console[_0x1f71f1(0x1b1)](a5_0x70429a['yellow']('No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22'+_0x451612['llmProject']+'\x22.')),console[_0x1f71f1(0x1b1)](a5_0x70429a['dim'](_0x1f71f1(0x1ad)+_0x451612['projectDir'])),console[_0x1f71f1(0x1b1)](),console[_0x1f71f1(0x1b1)](_0x1f71f1(0x15c));return 0x1;}}const {definition:_0xd80e2d,agentInfo:_0x48adf4}=parseTestFile(_0x506ef5);let _0x1cb47a=_0xd80e2d['tests'];if(_0x1d47e7){const _0x377edb=_0x1d47e7['split'](',')['map'](_0x8782fb=>_0x8782fb[_0x1f71f1(0x169)]());_0x1cb47a=_0xd80e2d[_0x1f71f1(0x191)][_0x1f71f1(0x1be)](_0x23c3c9=>_0x377edb[_0x1f71f1(0x1a5)](_0x23c3c9[_0x1f71f1(0x18f)]));if(_0x1cb47a[_0x1f71f1(0x1bf)]===0x0)return console[_0x1f71f1(0x1b1)](a5_0x70429a['yellow'](_0x1f71f1(0x170)+_0x1d47e7)),console[_0x1f71f1(0x1b1)](a5_0x70429a[_0x1f71f1(0x193)](_0x1f71f1(0x196)+_0xd80e2d[_0x1f71f1(0x191)][_0x1f71f1(0x12d)](_0x514249=>_0x514249['name'])[_0x1f71f1(0x1a6)](',\x20'))),0x1;}if(_0x2750e3){const _0xb668d7=_0x2750e3[_0x1f71f1(0x182)](',')[_0x1f71f1(0x12d)](_0x42fe54=>_0x42fe54['trim']()[_0x1f71f1(0x159)]());_0x1cb47a=_0x1cb47a[_0x1f71f1(0x1be)](_0x1197af=>_0x1197af[_0x1f71f1(0x15a)]?.['some'](_0x1ad775=>_0xb668d7['includes'](_0x1ad775['toLowerCase']())));if(_0x1cb47a[_0x1f71f1(0x1bf)]===0x0){console[_0x1f71f1(0x1b1)](a5_0x70429a['yellow'](_0x1f71f1(0x19f)+_0x2750e3));const _0x16c7e0=new Set();return _0xd80e2d['tests'][_0x1f71f1(0x178)](_0x48aa75=>_0x48aa75[_0x1f71f1(0x15a)]?.[_0x1f71f1(0x178)](_0x57ce2b=>_0x16c7e0[_0x1f71f1(0x13e)](_0x57ce2b))),_0x16c7e0[_0x1f71f1(0x145)]>0x0?console[_0x1f71f1(0x1b1)](a5_0x70429a['dim']('Available\x20tags:\x20'+[..._0x16c7e0][_0x1f71f1(0x1a6)](',\x20'))):console[_0x1f71f1(0x1b1)](a5_0x70429a['dim'](_0x1f71f1(0x132))),0x1;}}if(_0x11ad6a)return this[_0x1f71f1(0x17e)](_0x2d5cdd,{'definition':{'tests':_0x1cb47a},'agentInfo':_0x48adf4,'outputFormat':_0x3e21be,'outputFile':_0x3e0d72,'testNames':_0x1d47e7});if(_0x31bb68){console[_0x1f71f1(0x1b1)](a5_0x70429a[_0x1f71f1(0x18a)]('Test\x20Configuration:')),console[_0x1f71f1(0x1b1)](_0x1f71f1(0x14c)+a5_0x70429a[_0x1f71f1(0x16f)](_0x48d2e1)),console[_0x1f71f1(0x1b1)](_0x1f71f1(0x12f)+a5_0x70429a[_0x1f71f1(0x16f)](_0x48adf4['projectName'])),console[_0x1f71f1(0x1b1)](_0x1f71f1(0x197)+a5_0x70429a[_0x1f71f1(0x16f)](_0x48adf4[_0x1f71f1(0x199)])),console[_0x1f71f1(0x1b1)](),console[_0x1f71f1(0x1b1)](_0x1f71f1(0x1bb)+a5_0x70429a[_0x1f71f1(0x16f)](_0x1cb47a[_0x1f71f1(0x1bf)]));for(let _0x54fce4=0x0;_0x54fce4<_0x1cb47a['length'];_0x54fce4++){const _0x5ece10=_0x1cb47a[_0x54fce4],_0xb3b567=_0x5ece10['rounds'][_0x1f71f1(0x1bf)]===0x1?_0x1f71f1(0x156):'rounds',_0x350135=_0x5ece10[_0x1f71f1(0x15a)]?.[_0x1f71f1(0x1bf)]?'\x20['+_0x5ece10[_0x1f71f1(0x15a)][_0x1f71f1(0x1a6)](',\x20')+']':'';console['log']('\x20\x20'+(_0x54fce4+0x1)+'.\x20'+a5_0x70429a[_0x1f71f1(0x16f)](_0x5ece10[_0x1f71f1(0x18f)])+'\x20('+_0x5ece10['rounds']['length']+'\x20'+_0xb3b567+')'+a5_0x70429a[_0x1f71f1(0x193)](_0x350135));}return 0x0;}let _0x52dc04,_0x58561e;try{_0x52dc04=await _0xb05848[_0x1f71f1(0x14f)][_0x1f71f1(0x153)](_0x48adf4[_0x1f71f1(0x1b5)]);}catch(_0x42c119){const _0x5451c2=_0x42c119 instanceof Error?_0x42c119['message']:String(_0x42c119);return _0x5451c2[_0x1f71f1(0x1a5)](_0x1f71f1(0x1af))||_0x5451c2[_0x1f71f1(0x159)]()[_0x1f71f1(0x1a5)](_0x1f71f1(0x163))?console['log'](a5_0x70429a[_0x1f71f1(0x1a8)](_0x1f71f1(0x137)+_0x48adf4[_0x1f71f1(0x1b5)])):console[_0x1f71f1(0x1b1)](a5_0x70429a[_0x1f71f1(0x1a8)](_0x1f71f1(0x142)+_0x48adf4[_0x1f71f1(0x1b5)]+'\x22:\x20'+_0x5451c2)),0x1;}try{_0x58561e=await _0xb05848[_0x1f71f1(0x14f)]['resolveAgentId'](_0x48adf4[_0x1f71f1(0x199)],_0x52dc04);}catch(_0x36d2af){const _0x208df3=_0x36d2af instanceof Error?_0x36d2af['message']:String(_0x36d2af);return _0x208df3[_0x1f71f1(0x1a5)]('404')||_0x208df3[_0x1f71f1(0x159)]()[_0x1f71f1(0x1a5)](_0x1f71f1(0x163))?console[_0x1f71f1(0x1b1)](a5_0x70429a[_0x1f71f1(0x1a8)](_0x1f71f1(0x147)+_0x48adf4[_0x1f71f1(0x199)])):console[_0x1f71f1(0x1b1)](a5_0x70429a[_0x1f71f1(0x1a8)](_0x1f71f1(0x1b4)+_0x48adf4['agentName']+_0x1f71f1(0x14a)+_0x208df3)),0x1;}let _0x8b762d;if(!_0x16eaf9)try{_0x8b762d=await setupEvaluatorAgent(_0xb05848[_0x1f71f1(0x14f)],_0x45947c[_0x1f71f1(0x188)]);}catch(_0x1d3df2){const _0x5730b4=_0x1d3df2 instanceof Error?_0x1d3df2['message']:String(_0x1d3df2);return console[_0x1f71f1(0x1b1)](a5_0x70429a['red']('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x5730b4)),0x1;}console[_0x1f71f1(0x1b1)](a5_0x70429a[_0x1f71f1(0x18a)](_0x1f71f1(0x18c))),console[_0x1f71f1(0x1b1)](_0x1f71f1(0x166)+a5_0x70429a['white'](_0x48d2e1)),console['log'](_0x1f71f1(0x183)+a5_0x70429a[_0x1f71f1(0x16f)](_0x48adf4[_0x1f71f1(0x1b5)]+'/'+_0x48adf4[_0x1f71f1(0x199)])),console[_0x1f71f1(0x1b1)]();const _0x26ea91=[],_0x4b6c8b=[],_0x5b02bf=Date[_0x1f71f1(0x19d)]();for(let _0x164d1d=0x0;_0x164d1d<_0x1cb47a[_0x1f71f1(0x1bf)];_0x164d1d++){const _0x3b313d=_0x1cb47a[_0x164d1d];_0x1cb47a[_0x1f71f1(0x1bf)]>0x1?console['log']('Test\x20'+(_0x164d1d+0x1)+'/'+_0x1cb47a[_0x1f71f1(0x1bf)]+':\x20'+a5_0x70429a[_0x1f71f1(0x16f)](_0x3b313d[_0x1f71f1(0x18f)])):console[_0x1f71f1(0x1b1)](_0x1f71f1(0x1a2)+a5_0x70429a[_0x1f71f1(0x16f)](_0x3b313d[_0x1f71f1(0x18f)]));const _0xc433ad=createCommandSpinner(_0x1f71f1(0x190)+_0x3b313d[_0x1f71f1(0x19c)]['length']+_0x1f71f1(0x16c));_0xc433ad[_0x1f71f1(0x164)]();try{const {result:_0x13aaa7,conversation:_0x11229b}=await runTest(_0xb05848[_0x1f71f1(0x14f)],_0x3b313d,{'agentId':_0x58561e,'projectId':_0x52dc04,'site':_0x48d2e1,'noEval':_0x16eaf9,'evaluatorId':_0x8b762d,'onRoundStart':(_0x554535,_0x1367b1)=>{const _0x5ad16c=_0x1f71f1;_0xc433ad[_0x5ad16c(0x1aa)]=_0x5ad16c(0x15f)+(_0x554535+0x1)+'/'+_0x1367b1+_0x5ad16c(0x16c);},'onRoundComplete':(_0xa63045,_0x418153,_0x25179d)=>{const _0x3c3eb4=_0x1f71f1,_0x59d3b2=formatElapsed(_0x418153);_0x25179d?console[_0x3c3eb4(0x1b1)](_0x3c3eb4(0x138)+(_0xa63045+0x1)+'/'+_0x3b313d[_0x3c3eb4(0x19c)][_0x3c3eb4(0x1bf)]+'...\x20'+a5_0x70429a[_0x3c3eb4(0x174)]('✓')+'\x20('+_0x59d3b2+')'):console[_0x3c3eb4(0x1b1)](_0x3c3eb4(0x138)+(_0xa63045+0x1)+'/'+_0x3b313d[_0x3c3eb4(0x19c)]['length']+_0x3c3eb4(0x1c2)+a5_0x70429a['red']('✗'));},'onEvaluationStart':()=>{const _0x4c3b45=_0x1f71f1;_0xc433ad[_0x4c3b45(0x1aa)]='Evaluating\x20response...';},'onEvaluationComplete':_0x49947f=>{const _0x14a432=_0x1f71f1,_0x35a10e=formatElapsed(_0x49947f);console[_0x14a432(0x1b1)](_0x14a432(0x13b)+a5_0x70429a[_0x14a432(0x174)]('✓')+'\x20('+_0x35a10e+')');}});_0xc433ad[_0x1f71f1(0x1b9)](),_0x26ea91[_0x1f71f1(0x17d)](_0x13aaa7),_0x4b6c8b[_0x1f71f1(0x17d)](_0x11229b);if(_0x13aaa7[_0x1f71f1(0x12e)]===_0x1f71f1(0x1a3))console['log'](a5_0x70429a[_0x1f71f1(0x174)](_0x1f71f1(0x19b)+_0x13aaa7['reason']));else _0x13aaa7[_0x1f71f1(0x12e)]===_0x1f71f1(0x180)?console[_0x1f71f1(0x1b1)](a5_0x70429a[_0x1f71f1(0x1a8)](_0x1f71f1(0x19e)+_0x13aaa7[_0x1f71f1(0x143)])):console[_0x1f71f1(0x1b1)](a5_0x70429a[_0x1f71f1(0x1a8)]('✗\x20ERROR:\x20'+_0x13aaa7[_0x1f71f1(0x143)]));_0x13aaa7[_0x1f71f1(0x1a7)]&&console[_0x1f71f1(0x1b1)](a5_0x70429a[_0x1f71f1(0x193)]('Conversation\x20URL:\x20'+_0x13aaa7[_0x1f71f1(0x1a7)])),console[_0x1f71f1(0x1b1)]();}catch(_0x424b9e){_0xc433ad[_0x1f71f1(0x1b9)]();const _0x1020cd=_0x424b9e instanceof Error?_0x424b9e[_0x1f71f1(0x16a)]:String(_0x424b9e);console[_0x1f71f1(0x1b1)](a5_0x70429a['red'](_0x1f71f1(0x162)+_0x1020cd)),console[_0x1f71f1(0x1b1)](),_0x26ea91[_0x1f71f1(0x17d)]({'name':_0x3b313d['name'],'status':_0x1f71f1(0x167),'reason':_0x1020cd,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}const _0x407cfb=Date[_0x1f71f1(0x19d)]()-_0x5b02bf,_0x5d0c64=_0x26ea91[_0x1f71f1(0x1be)](_0x5e5d80=>_0x5e5d80['status']===_0x1f71f1(0x1a3))['length'],_0x174f8b=_0x26ea91['filter'](_0x2b25d4=>_0x2b25d4[_0x1f71f1(0x12e)]===_0x1f71f1(0x180))[_0x1f71f1(0x1bf)],_0x4ed2e2=_0x26ea91['filter'](_0x4297f1=>_0x4297f1[_0x1f71f1(0x12e)]===_0x1f71f1(0x167))[_0x1f71f1(0x1bf)];console[_0x1f71f1(0x1b1)]('━'[_0x1f71f1(0x136)](0x3c)),console[_0x1f71f1(0x1b1)](_0x1f71f1(0x1b7)),console[_0x1f71f1(0x1b1)]('━'['repeat'](0x3c)),console[_0x1f71f1(0x1b1)](_0x1f71f1(0x168)+_0x26ea91[_0x1f71f1(0x1bf)]),console[_0x1f71f1(0x1b1)](_0x1f71f1(0x1c1)+a5_0x70429a[_0x1f71f1(0x174)](_0x5d0c64)),console[_0x1f71f1(0x1b1)]('Failed:\x20\x20\x20'+a5_0x70429a[_0x1f71f1(0x1a8)](_0x174f8b));_0x4ed2e2>0x0&&console[_0x1f71f1(0x1b1)]('Errors:\x20\x20\x20'+a5_0x70429a[_0x1f71f1(0x1a8)](_0x4ed2e2));console[_0x1f71f1(0x1b1)]('Duration:\x20'+formatElapsed(_0x407cfb)),console[_0x1f71f1(0x1b1)]('━'['repeat'](0x3c));const _0x28c74b=_0x26ea91[_0x1f71f1(0x1be)](_0x385017=>_0x385017['status']!==_0x1f71f1(0x1a3));if(_0x28c74b[_0x1f71f1(0x1bf)]>0x0){console[_0x1f71f1(0x1b1)](),console[_0x1f71f1(0x1b1)](_0x1f71f1(0x1a0));for(const _0xd970a5 of _0x28c74b){const _0x4a4860=a5_0x70429a[_0x1f71f1(0x1a8)]('✗'),_0x2edf7c=_0xd970a5[_0x1f71f1(0x143)][_0x1f71f1(0x1bf)]>0x32?_0xd970a5[_0x1f71f1(0x143)][_0x1f71f1(0x1a9)](0x0,0x32)+_0x1f71f1(0x195):_0xd970a5[_0x1f71f1(0x143)];console['log']('\x20\x20'+_0x4a4860+'\x20'+_0xd970a5['name']+':\x20'+_0x2edf7c);}}const _0x5650fb={'summary':{'total':_0x26ea91[_0x1f71f1(0x1bf)],'passed':_0x5d0c64,'failed':_0x174f8b,'errors':_0x4ed2e2>0x0?_0x4ed2e2:undefined,'duration_ms':_0x407cfb},'tests':_0x26ea91,'agent':{'project':_0x48adf4['projectName'],'name':_0x48adf4[_0x1f71f1(0x199)],'site':_0x48d2e1},'timestamp':new Date(_0x5b02bf)['toISOString']()};try{const _0x85f394=buildCachedTestRun(_0x4b6c8b,{'site':_0x48d2e1,'projectId':_0x52dc04,'projectName':_0x48adf4['projectName'],'agentId':_0x58561e,'agentName':_0x48adf4[_0x1f71f1(0x199)],'testYmlPath':a5_0x333a48[_0x1f71f1(0x171)](_0x48adf4[_0x1f71f1(0x12c)])});saveLastTestRun(_0x85f394);}catch{}if(_0x3e21be!=='table'||_0x3e0d72){const _0x4fe117=formatResults(_0x5650fb,_0x3e21be);if(_0x3e0d72)try{a5_0x42074[_0x1f71f1(0x15b)](_0x3e0d72,_0x4fe117,_0x1f71f1(0x13f)),console[_0x1f71f1(0x1b1)](),console[_0x1f71f1(0x1b1)](a5_0x70429a[_0x1f71f1(0x193)](_0x1f71f1(0x172)+_0x3e0d72));}catch(_0xc76006){return console['log'](),console[_0x1f71f1(0x1b1)](a5_0x70429a[_0x1f71f1(0x1a8)](_0x1f71f1(0x1c0)+_0xc76006)),0x1;}else console[_0x1f71f1(0x1b1)](),console[_0x1f71f1(0x1b1)](_0x4fe117);}return _0x28c74b[_0x1f71f1(0x1bf)]>0x0?0x1:0x0;}async['executeReeval'](_0x210650,_0x28aef8){const _0x1d6d76=a5_0x526847,{options:_0x573187,tdx:_0x15a487}=_0x210650,{definition:_0x6fd0f9,agentInfo:_0x3ee91e,outputFormat:_0x59e2d1,outputFile:_0x2753a9}=_0x28aef8,_0x1c66c5=_0x573187[_0x1d6d76(0x1b8)],_0x4f8068=loadLastTestRun();if(!_0x4f8068)return console[_0x1d6d76(0x1b1)](a5_0x70429a[_0x1d6d76(0x1a8)](_0x1d6d76(0x192))),console[_0x1d6d76(0x1b1)](a5_0x70429a[_0x1d6d76(0x193)](_0x1d6d76(0x134))),0x1;if(_0x4f8068['agent'][_0x1d6d76(0x199)]!==_0x3ee91e['agentName'])return console[_0x1d6d76(0x1b1)](a5_0x70429a[_0x1d6d76(0x1a8)](_0x1d6d76(0x14e)+_0x4f8068['agent']['agentName']+_0x1d6d76(0x17b)+_0x3ee91e[_0x1d6d76(0x199)]+'\x22.')),console['log'](a5_0x70429a[_0x1d6d76(0x193)](_0x1d6d76(0x1a1))),0x1;const _0x57bb1c=new Set(_0x4f8068[_0x1d6d76(0x189)][_0x1d6d76(0x12d)](_0x3dba9d=>_0x3dba9d['testName'])),_0x4845df=_0x6fd0f9['tests'][_0x1d6d76(0x1be)](_0x4e82f7=>!_0x57bb1c[_0x1d6d76(0x184)](_0x4e82f7[_0x1d6d76(0x18f)]));if(_0x4845df[_0x1d6d76(0x1bf)]>0x0&&_0x4f8068['site']!==_0x1c66c5)return console['log'](a5_0x70429a['red'](_0x1d6d76(0x198))),console[_0x1d6d76(0x1b1)](a5_0x70429a['dim'](_0x1d6d76(0x1b0)+_0x4f8068[_0x1d6d76(0x1b8)]+'\x22,\x20but\x20current\x20site\x20is\x20\x22'+_0x1c66c5+'\x22.')),console['log'](a5_0x70429a[_0x1d6d76(0x193)]('Either\x20switch\x20to\x20the\x20\x22'+_0x4f8068[_0x1d6d76(0x1b8)]+'\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.')),0x1;const _0x3127d7=_0x6fd0f9[_0x1d6d76(0x191)][_0x1d6d76(0x1be)](_0x1e8569=>_0x57bb1c[_0x1d6d76(0x184)](_0x1e8569['name'])),_0x3c5b75=_0x4845df;let _0x4406cb;try{_0x4406cb=await setupEvaluatorAgent(_0x15a487[_0x1d6d76(0x14f)],_0x573187[_0x1d6d76(0x188)]);}catch(_0x4628b){const _0x4bb991=_0x4628b instanceof Error?_0x4628b['message']:String(_0x4628b);return console[_0x1d6d76(0x1b1)](a5_0x70429a[_0x1d6d76(0x1a8)](_0x1d6d76(0x140)+_0x4bb991)),0x1;}console[_0x1d6d76(0x1b1)](a5_0x70429a[_0x1d6d76(0x18a)](_0x1d6d76(0x157))),console[_0x1d6d76(0x1b1)](_0x1d6d76(0x177)+a5_0x70429a[_0x1d6d76(0x16f)](_0x4f8068['timestamp'])),console[_0x1d6d76(0x1b1)](_0x1d6d76(0x183)+a5_0x70429a[_0x1d6d76(0x16f)](_0x4f8068[_0x1d6d76(0x179)][_0x1d6d76(0x1b5)]+'/'+_0x4f8068[_0x1d6d76(0x179)][_0x1d6d76(0x199)]));_0x3c5b75[_0x1d6d76(0x1bf)]>0x0&&console['log']('New\x20tests\x20to\x20execute:\x20'+a5_0x70429a[_0x1d6d76(0x150)](_0x3c5b75[_0x1d6d76(0x1bf)]));console['log']();const _0x1ffa42=[],_0x2bb7a2=Date[_0x1d6d76(0x19d)](),_0x5f1838=createCommandSpinner(_0x1d6d76(0x17a));if(_0x3127d7[_0x1d6d76(0x1bf)]>0x0)try{const _0x349836=await reevaluateFromCache(_0x15a487[_0x1d6d76(0x14f)],_0x4f8068,{'tests':_0x3127d7},{'evaluatorId':_0x4406cb,'onTestStart':(_0x30ba07,_0x4eca3a,_0xe08842)=>{const _0x45b660=_0x1d6d76;_0x5f1838[_0x45b660(0x1aa)]=_0x45b660(0x16b)+(_0x4eca3a+0x1)+'/'+_0xe08842+':\x20'+_0x30ba07+'...';if(!_0x5f1838[_0x45b660(0x15e)])_0x5f1838[_0x45b660(0x164)]();},'onTestComplete':(_0x29cdd9,_0x16007b)=>{const _0x221cab=_0x1d6d76;_0x5f1838[_0x221cab(0x1b9)]();if(_0x16007b[_0x221cab(0x12e)]===_0x221cab(0x1a3))console[_0x221cab(0x1b1)](a5_0x70429a['green'](_0x221cab(0x19b)+_0x29cdd9)+a5_0x70429a[_0x221cab(0x193)]('\x20(cached)'));else _0x16007b[_0x221cab(0x12e)]===_0x221cab(0x180)?console[_0x221cab(0x1b1)](a5_0x70429a[_0x221cab(0x1a8)](_0x221cab(0x19e)+_0x29cdd9+'\x20-\x20'+_0x16007b[_0x221cab(0x143)])+a5_0x70429a[_0x221cab(0x193)](_0x221cab(0x1ac))):console[_0x221cab(0x1b1)](a5_0x70429a[_0x221cab(0x1a8)](_0x221cab(0x162)+_0x29cdd9+_0x221cab(0x13a)+_0x16007b['reason']));_0x16007b[_0x221cab(0x1a7)]&&console['log'](a5_0x70429a[_0x221cab(0x193)](_0x221cab(0x1b3)+_0x16007b[_0x221cab(0x1a7)])),_0x1ffa42[_0x221cab(0x17d)](_0x16007b);},'onTestSkipped':(_0x5dab8,_0x186ba5)=>{const _0x17b90d=_0x1d6d76;_0x5f1838[_0x17b90d(0x1b9)](),console[_0x17b90d(0x1b1)](a5_0x70429a[_0x17b90d(0x150)]('⚠\x20SKIPPED:\x20'+_0x5dab8+'\x20-\x20'+_0x186ba5));}});for(const _0x32fd3c of _0x349836){!_0x1ffa42['find'](_0x7b3eaa=>_0x7b3eaa[_0x1d6d76(0x18f)]===_0x32fd3c[_0x1d6d76(0x18f)])&&_0x1ffa42[_0x1d6d76(0x17d)](_0x32fd3c);}}catch(_0x1aae2b){_0x5f1838[_0x1d6d76(0x1b9)]();const _0x3d63af=_0x1aae2b instanceof Error?_0x1aae2b[_0x1d6d76(0x16a)]:String(_0x1aae2b);return console[_0x1d6d76(0x1b1)](a5_0x70429a[_0x1d6d76(0x1a8)](_0x1d6d76(0x146)+_0x3d63af)),0x1;}_0x5f1838[_0x1d6d76(0x1b9)]();if(_0x3c5b75[_0x1d6d76(0x1bf)]>0x0){console[_0x1d6d76(0x1b1)](),console[_0x1d6d76(0x1b1)](a5_0x70429a['cyan']('Executing\x20new\x20tests...'));const {projectId:_0x2142fb,agentId:_0x5a292b}=_0x4f8068[_0x1d6d76(0x179)];for(const _0x449778 of _0x3c5b75){console['log'](_0x1d6d76(0x18b)+a5_0x70429a[_0x1d6d76(0x16f)](_0x449778[_0x1d6d76(0x18f)]));const _0x2fffb3=createCommandSpinner(_0x1d6d76(0x190)+_0x449778['rounds'][_0x1d6d76(0x1bf)]+_0x1d6d76(0x16c));_0x2fffb3['start']();try{const {result:_0x5a890b}=await runTest(_0x15a487[_0x1d6d76(0x14f)],_0x449778,{'agentId':_0x5a292b,'projectId':_0x2142fb,'site':_0x4f8068[_0x1d6d76(0x1b8)],'noEval':![],'evaluatorId':_0x4406cb,'onRoundStart':(_0x471385,_0x4d41bd)=>{const _0x114e22=_0x1d6d76;_0x2fffb3[_0x114e22(0x1aa)]='Round\x20'+(_0x471385+0x1)+'/'+_0x4d41bd+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x505fa4,_0x237e97,_0x1240c7)=>{const _0x3a418b=_0x1d6d76,_0x4379bd=formatElapsed(_0x237e97);_0x1240c7?console[_0x3a418b(0x1b1)](_0x3a418b(0x138)+(_0x505fa4+0x1)+'/'+_0x449778[_0x3a418b(0x19c)][_0x3a418b(0x1bf)]+_0x3a418b(0x1c2)+a5_0x70429a[_0x3a418b(0x174)]('✓')+'\x20('+_0x4379bd+')'):console[_0x3a418b(0x1b1)](_0x3a418b(0x138)+(_0x505fa4+0x1)+'/'+_0x449778[_0x3a418b(0x19c)][_0x3a418b(0x1bf)]+_0x3a418b(0x1c2)+a5_0x70429a[_0x3a418b(0x1a8)]('✗'));},'onEvaluationStart':()=>{const _0x2bf17e=_0x1d6d76;_0x2fffb3[_0x2bf17e(0x1aa)]='Evaluating\x20response...';},'onEvaluationComplete':_0x856799=>{const _0x2135b3=_0x1d6d76,_0xf1e94a=formatElapsed(_0x856799);console[_0x2135b3(0x1b1)]('\x20\x20Evaluating...\x20'+a5_0x70429a['green']('✓')+'\x20('+_0xf1e94a+')');}});_0x2fffb3['stop'](),_0x1ffa42[_0x1d6d76(0x17d)](_0x5a890b);if(_0x5a890b['status']===_0x1d6d76(0x1a3))console[_0x1d6d76(0x1b1)](a5_0x70429a[_0x1d6d76(0x174)](_0x1d6d76(0x19b)+_0x5a890b[_0x1d6d76(0x143)])+a5_0x70429a[_0x1d6d76(0x193)](_0x1d6d76(0x152)));else _0x5a890b[_0x1d6d76(0x12e)]===_0x1d6d76(0x180)?console[_0x1d6d76(0x1b1)](a5_0x70429a[_0x1d6d76(0x1a8)](_0x1d6d76(0x19e)+_0x5a890b[_0x1d6d76(0x143)])+a5_0x70429a[_0x1d6d76(0x193)](_0x1d6d76(0x152))):console['log'](a5_0x70429a[_0x1d6d76(0x1a8)](_0x1d6d76(0x162)+_0x5a890b[_0x1d6d76(0x143)]));_0x5a890b['conversation_url']&&console[_0x1d6d76(0x1b1)](a5_0x70429a[_0x1d6d76(0x193)]('\x20\x20Conversation:\x20'+_0x5a890b[_0x1d6d76(0x1a7)]));}catch(_0x47f0d9){_0x2fffb3[_0x1d6d76(0x1b9)]();const _0x1a8cf7=_0x47f0d9 instanceof Error?_0x47f0d9[_0x1d6d76(0x16a)]:String(_0x47f0d9);console[_0x1d6d76(0x1b1)](a5_0x70429a[_0x1d6d76(0x1a8)](_0x1d6d76(0x162)+_0x1a8cf7)),_0x1ffa42[_0x1d6d76(0x17d)]({'name':_0x449778['name'],'status':_0x1d6d76(0x167),'reason':_0x1a8cf7,'timestamp':new Date()[_0x1d6d76(0x158)](),'duration_ms':0x0});}}}console[_0x1d6d76(0x1b1)]();const _0x54487b=Date[_0x1d6d76(0x19d)]()-_0x2bb7a2,_0x2cd668=_0x1ffa42[_0x1d6d76(0x1be)](_0x448d15=>_0x448d15[_0x1d6d76(0x12e)]==='PASS')[_0x1d6d76(0x1bf)],_0x42b544=_0x1ffa42[_0x1d6d76(0x1be)](_0x3517d0=>_0x3517d0['status']===_0x1d6d76(0x180))[_0x1d6d76(0x1bf)],_0x125e30=_0x1ffa42['filter'](_0x50599f=>_0x50599f[_0x1d6d76(0x12e)]==='ERROR')[_0x1d6d76(0x1bf)];console[_0x1d6d76(0x1b1)]('━'['repeat'](0x3c)),console[_0x1d6d76(0x1b1)]('Re-evaluation\x20Summary'),console[_0x1d6d76(0x1b1)]('━'[_0x1d6d76(0x136)](0x3c)),console[_0x1d6d76(0x1b1)]('Total:\x20\x20\x20\x20'+_0x1ffa42[_0x1d6d76(0x1bf)]),console[_0x1d6d76(0x1b1)]('Passed:\x20\x20\x20'+a5_0x70429a[_0x1d6d76(0x174)](_0x2cd668)),console[_0x1d6d76(0x1b1)](_0x1d6d76(0x173)+a5_0x70429a['red'](_0x42b544));_0x125e30>0x0&&console[_0x1d6d76(0x1b1)](_0x1d6d76(0x141)+a5_0x70429a[_0x1d6d76(0x1a8)](_0x125e30));console[_0x1d6d76(0x1b1)]('Duration:\x20'+formatElapsed(_0x54487b)),console[_0x1d6d76(0x1b1)]('━'[_0x1d6d76(0x136)](0x3c));const _0x7b3607={'summary':{'total':_0x1ffa42[_0x1d6d76(0x1bf)],'passed':_0x2cd668,'failed':_0x42b544,'errors':_0x125e30>0x0?_0x125e30:undefined,'duration_ms':_0x54487b},'tests':_0x1ffa42,'agent':{'project':_0x3ee91e[_0x1d6d76(0x1b5)],'name':_0x3ee91e['agentName'],'site':_0x1c66c5},'timestamp':new Date(_0x2bb7a2)[_0x1d6d76(0x158)]()};if(_0x59e2d1!==_0x1d6d76(0x144)||_0x2753a9){const _0x1b68e0=formatResults(_0x7b3607,_0x59e2d1);if(_0x2753a9)try{a5_0x42074['writeFileSync'](_0x2753a9,_0x1b68e0,_0x1d6d76(0x13f)),console[_0x1d6d76(0x1b1)](),console[_0x1d6d76(0x1b1)](a5_0x70429a[_0x1d6d76(0x193)](_0x1d6d76(0x172)+_0x2753a9));}catch(_0x405c49){return console[_0x1d6d76(0x1b1)](),console[_0x1d6d76(0x1b1)](a5_0x70429a[_0x1d6d76(0x1a8)](_0x1d6d76(0x1c0)+_0x405c49)),0x1;}else console[_0x1d6d76(0x1b1)](),console[_0x1d6d76(0x1b1)](_0x1b68e0);}const _0x30dcb2=_0x1ffa42[_0x1d6d76(0x1be)](_0x4b2933=>_0x4b2933[_0x1d6d76(0x12e)]!==_0x1d6d76(0x1a3));return _0x30dcb2['length']>0x0?0x1:0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a6_0x170e96=a6_0x4122;(function(_0x56a1a5,_0x5131d8){const _0x1eb070=a6_0x4122,_0x823f55=_0x56a1a5();while(!![]){try{const _0x4580a8=parseInt(_0x1eb070(0x8a))/0x1+-parseInt(_0x1eb070(0x94))/0x2*(-parseInt(_0x1eb070(0x71))/0x3)+-parseInt(_0x1eb070(0x6a))/0x4*(parseInt(_0x1eb070(0x81))/0x5)+parseInt(_0x1eb070(0x92))/0x6*(-parseInt(_0x1eb070(0x9c))/0x7)+parseInt(_0x1eb070(0x8c))/0x8*(parseInt(_0x1eb070(0x7b))/0x9)+parseInt(_0x1eb070(0x6c))/0xa*(parseInt(_0x1eb070(0x76))/0xb)+-parseInt(_0x1eb070(0x9a))/0xc*(-parseInt(_0x1eb070(0x95))/0xd);if(_0x4580a8===_0x5131d8)break;else _0x823f55['push'](_0x823f55['shift']());}catch(_0x276074){_0x823f55['push'](_0x823f55['shift']());}}}(a6_0x4dd3,0x3a4e9));import{BaseCommand}from'./command.js';function a6_0x4122(_0x4ceed4,_0x364452){_0x4ceed4=_0x4ceed4-0x68;const _0x4dd3f1=a6_0x4dd3();let _0x41227e=_0x4dd3f1[_0x4ceed4];return _0x41227e;}import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a6_0x170e96(0x9b),a6_0x170e96(0x75),a6_0x170e96(0x88),'set-cookie',a6_0x170e96(0x8e),a6_0x170e96(0x6f),a6_0x170e96(0x7d),a6_0x170e96(0x84)]);function a6_0x4dd3(){const _0x56d573=['Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','output','Invalid\x20HTTP\x20method:\x20','900LuslGc','GET','error','x-trino-user','stack','site','api','cookie','validate','6928QWUVga','toLowerCase','3213216dMwAjj','POST','set-cookie2','join','DELETE','.\x20Valid\x20types:\x20','78NGShOn','execute','834ouFnOA','26GjxGiF','noColor','Invalid\x20header\x20format:\x20\x22','Invalid\x20API\x20type:\x20','entries','16308gnxjbS','authorization','145572iqUTWV','file','data','\x0aStack\x20trace:\x0a','isArray','toUpperCase','indexOf','.\x20Valid\x20methods:\x20','PATCH','verbose','length','has','method','cdp','PUT','<\x20HTTP/1.1\x20','workflow','Error:\x20','type','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','10548lDHYXo','Endpoint\x20must\x20start\x20with\x20/:\x20','2490vvocty','headers','body','x-xsrf-token','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','1371akLoyJ','trim','message','color','proxy-authorization','16874myrkVj','keys','substring','trino','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','9aHuuVp','request','x-auth-token'];a6_0x4dd3=function(){return _0x56d573;};return a6_0x4dd3();}function isSensitiveHeader(_0x46fd68){const _0x4ee6d5=a6_0x170e96;return SENSITIVE_HEADERS[_0x4ee6d5(0xa7)](_0x46fd68[_0x4ee6d5(0x8b)]());}function parseHeader(_0x8afd2e){const _0x4a3a45=a6_0x170e96,_0x220676=_0x8afd2e[_0x4a3a45(0xa2)](':');if(_0x220676===-0x1)throw new Error(_0x4a3a45(0x97)+_0x8afd2e+'\x22.\x20'+_0x4a3a45(0x70));const _0x1f9998=_0x8afd2e[_0x4a3a45(0x78)](0x0,_0x220676)[_0x4a3a45(0x72)](),_0x4ee21c=_0x8afd2e[_0x4a3a45(0x78)](_0x220676+0x1)[_0x4a3a45(0x72)]();if(!_0x1f9998)throw new Error(_0x4a3a45(0x69)+_0x8afd2e+'\x22');return[_0x1f9998,_0x4ee21c];}export class ApiCommand extends BaseCommand{['name']=a6_0x170e96(0x87);['description']=a6_0x170e96(0x7e);[a6_0x170e96(0x89)](_0x1c707e){const _0xf1dd92=a6_0x170e96,{args:_0x3d11ff,options:_0x1562fe}=_0x1c707e,_0x101b6e=_0x1562fe;if(_0x3d11ff['length']===0x0)return'Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list';const _0xf6ca7a=_0x3d11ff[0x0];if(!_0xf6ca7a['startsWith']('/'))return _0xf1dd92(0x6b)+_0xf6ca7a;const _0x354a0c=_0x101b6e[_0xf1dd92(0x9e)],_0x1ab58c=_0x101b6e[_0xf1dd92(0x9d)];if(_0x354a0c&&_0x1ab58c)return _0xf1dd92(0x7a);const _0xa8fba3=_0x101b6e[_0xf1dd92(0xa8)]||_0xf1dd92(0x82),_0x1e097d=[_0xf1dd92(0x82),_0xf1dd92(0x8d),_0xf1dd92(0xaa),_0xf1dd92(0x90),_0xf1dd92(0xa4)];if(!_0x1e097d['includes'](_0xa8fba3['toUpperCase']()))return _0xf1dd92(0x80)+_0xa8fba3+_0xf1dd92(0xa3)+_0x1e097d[_0xf1dd92(0x8f)](',\x20');const _0x53338f=_0x101b6e[_0xf1dd92(0x68)]||'td',_0x1695f5=['td',_0xf1dd92(0xa9),_0xf1dd92(0xac),_0xf1dd92(0x79),'llm','llm-proxy'];if(!_0x1695f5['includes'](_0x53338f))return _0xf1dd92(0x98)+_0x53338f+_0xf1dd92(0x91)+_0x1695f5['join'](',\x20');return undefined;}async[a6_0x170e96(0x93)](_0x467253){const _0x16ed8f=a6_0x170e96,{options:_0x5c6e17,args:_0x4b6cfa,tdx:_0x5a1ea7}=_0x467253,_0x152a87=_0x5c6e17,_0x3b0a20=_0x4b6cfa[0x0],_0x2be0cb=(_0x152a87[_0x16ed8f(0xa8)]||_0x16ed8f(0x82))[_0x16ed8f(0xa1)](),_0x42541d=_0x152a87[_0x16ed8f(0x9e)],_0x11a640=_0x152a87[_0x16ed8f(0x9d)],_0x3ca260=_0x152a87['header'],_0x58550e=_0x152a87[_0x16ed8f(0x68)]||'td';try{const _0x2854bc={};if(_0x3ca260){const _0xb3fe05=Array[_0x16ed8f(0xa0)](_0x3ca260)?_0x3ca260:[_0x3ca260];for(const _0x1ab664 of _0xb3fe05){const [_0x3b3445,_0x1bcd3f]=parseHeader(_0x1ab664);_0x2854bc[_0x3b3445]=_0x1bcd3f;}}let _0x37be88;if(_0x42541d)_0x37be88=_0x42541d;else{if(_0x11a640)try{_0x37be88=RawAPI['readBodyFromFile'](_0x11a640);}catch(_0x2fd14a){return console['error'](_0x16ed8f(0xad)+(_0x2fd14a instanceof Error?_0x2fd14a[_0x16ed8f(0x73)]:String(_0x2fd14a))),0x1;}}const _0x4390e1={'method':_0x2be0cb,'apiType':_0x58550e,'includeHeaders':_0x5c6e17[_0x16ed8f(0xa5)]};_0x37be88&&(_0x4390e1[_0x16ed8f(0x6e)]=_0x37be88);Object[_0x16ed8f(0x77)](_0x2854bc)[_0x16ed8f(0xa6)]>0x0&&(_0x4390e1[_0x16ed8f(0x6d)]=_0x2854bc);if(_0x5c6e17[_0x16ed8f(0xa5)]){const _0x9b941=resolveSite(_0x5c6e17[_0x16ed8f(0x86)]),_0x582eca=getEndpoint(_0x9b941,_0x58550e),_0x46e691=''+_0x582eca+_0x3b0a20;console['error']('>\x20'+_0x2be0cb+'\x20'+_0x46e691);const _0x447a0d=getAuthHeaders(_0x9b941),_0x206789={..._0x447a0d,..._0x2854bc};for(const [_0x216a9c,_0x4013e2]of Object[_0x16ed8f(0x99)](_0x206789)){!isSensitiveHeader(_0x216a9c)&&console[_0x16ed8f(0x83)]('>\x20'+_0x216a9c+':\x20'+_0x4013e2);}_0x37be88&&console[_0x16ed8f(0x83)]('>'),console['error']('');}const _0x1f9bf0=await _0x5a1ea7[_0x16ed8f(0x87)][_0x16ed8f(0x7c)](_0x3b0a20,_0x4390e1);if(_0x5c6e17[_0x16ed8f(0xa5)]&&_0x1f9bf0[_0x16ed8f(0x6d)]){console['error'](_0x16ed8f(0xab)+_0x1f9bf0['status']);for(const [_0x14cdde,_0x3c62c5]of Object[_0x16ed8f(0x99)](_0x1f9bf0['headers'])){!isSensitiveHeader(_0x14cdde)&&console[_0x16ed8f(0x83)]('<\x20'+_0x14cdde+':\x20'+_0x3c62c5);}console[_0x16ed8f(0x83)]('');}const _0x524941=Boolean(_0x5c6e17[_0x16ed8f(0x7f)]),_0x4cae5b={'color':_0x5c6e17[_0x16ed8f(0x74)],'noColor':_0x5c6e17[_0x16ed8f(0x96)]||_0x524941&&!_0x5c6e17['color']},_0x493b30=colorizeJSON(_0x1f9bf0[_0x16ed8f(0x9e)],_0x4cae5b);return _0x5c6e17[_0x16ed8f(0x7f)]?(writeFileSync(_0x5c6e17[_0x16ed8f(0x7f)],_0x493b30),console[_0x16ed8f(0x83)]('Results\x20saved\x20to\x20'+_0x5c6e17['output'])):console['log'](_0x493b30),0x0;}catch(_0x44a4a6){return _0x44a4a6 instanceof Error?(console[_0x16ed8f(0x83)]('Error:\x20'+_0x44a4a6[_0x16ed8f(0x73)]),_0x5c6e17[_0x16ed8f(0xa5)]&&_0x44a4a6[_0x16ed8f(0x85)]&&console[_0x16ed8f(0x83)](_0x16ed8f(0x9f)+_0x44a4a6[_0x16ed8f(0x85)])):console[_0x16ed8f(0x83)]('Error:\x20'+String(_0x44a4a6)),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a7_0x61eb80=a7_0x3394;(function(_0x151e2f,_0x5ca121){const _0xc9d436=a7_0x3394,_0x2cf7b3=_0x151e2f();while(!![]){try{const _0x145af0=parseInt(_0xc9d436(0x212))/0x1*(-parseInt(_0xc9d436(0x201))/0x2)+-parseInt(_0xc9d436(0x1fa))/0x3+parseInt(_0xc9d436(0x204))/0x4+parseInt(_0xc9d436(0x1ed))/0x5+parseInt(_0xc9d436(0x1ef))/0x6*(parseInt(_0xc9d436(0x1f4))/0x7)+parseInt(_0xc9d436(0x1f2))/0x8+parseInt(_0xc9d436(0x1df))/0x9*(-parseInt(_0xc9d436(0x216))/0xa);if(_0x145af0===_0x5ca121)break;else _0x2cf7b3['push'](_0x2cf7b3['shift']());}catch(_0x187a68){_0x2cf7b3['push'](_0x2cf7b3['shift']());}}}(a7_0x4481,0x69a34));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';function a7_0x3394(_0x2443c5,_0x368e0f){_0x2443c5=_0x2443c5-0x1d1;const _0x4481db=a7_0x4481();let _0x3394b5=_0x4481db[_0x2443c5];return _0x3394b5;}import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';function a7_0x4481(){const _0x4790be=['API\x20key\x20cannot\x20be\x20empty','Site\x20name\x20cannot\x20be\x20empty','join','execute','54fWDDuv','apiKey','bold','Enter\x20site\x20name:','auth:setup','Select\x20your\x20Treasure\x20Data\x20site:','\x20for\x20profile:\x20','\x20(profile:\x20','site','✓\x20Authentication\x20successful\x0a','\x0aSetup\x20cancelled','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','jobs','Name:\x20','203135fUSori','\x27\x20registered','18vHGVXH','description','password','1566232vRmdtv','No\x20credential\x20found','1998038vGbksA','trim','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','No\x20API\x20key\x20found\x20in\x20keychain','error','1658859zicIbZ','ERROR','/app/mp/ak','create','You\x20can\x20find\x20your\x20API\x20key\x20at:','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','Enter\x20your\x20TD\x20API\x20key:','2KFCEra','log','status','1516768euQSfM','N/A','green','✗\x20Validation\x20failed:\x20','message','test','auth','profile','Setup\x20API\x20key\x20authentication\x20interactively','other','customSite','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','tdx:\x20auth\x20clear','email','193977iZksSR','\x20\x20tdx','warn','Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20','487130xdChVU','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','red','✓\x20Default\x20site\x20set\x20to\x20','last_name','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','logLevel','yellow','us01','name','\x20--profile\x20','first_name','tdx:\x20auth\x20setup','auth:clear','getUserInfo','✓\x20API\x20key\x20removed\x20from\x20keychain'];a7_0x4481=function(){return _0x4790be;};return a7_0x4481();}import{clearCredentialCache}from'../core/credential-cache.js';import{buildSiteChoices}from'../core/constants.js';import a7_0x409ce6 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_0x5940e7 from'chalk';export class AuthSetupCommand extends BaseCommand{[a7_0x61eb80(0x1d4)]=a7_0x61eb80(0x1e3);['description']=a7_0x61eb80(0x20c);async[a7_0x61eb80(0x1de)](_0x468b2e){const _0x2bb808=a7_0x61eb80,{options:_0x55ce96}=_0x468b2e,_0x2d3593=_0x55ce96[_0x2bb808(0x20b)];console[_0x2bb808(0x202)](a7_0x5940e7[_0x2bb808(0x1e1)](_0x2bb808(0x1d7)));const _0x49f4c9=_0x55ce96[_0x2bb808(0x1e7)]||_0x2bb808(0x1d3),{choices:_0x28a04c,initialIndex:_0x45ad16}=buildSiteChoices(_0x49f4c9),_0x2ef103=_0x2d3593?_0x2bb808(0x215)+_0x2d3593+'):':_0x2bb808(0x1e4),_0x828942=await a7_0x409ce6({'type':'select','name':_0x2bb808(0x1e7),'message':_0x2ef103,'choices':_0x28a04c,'initial':_0x45ad16});if(!_0x828942['site'])return console[_0x2bb808(0x202)]('\x0aSetup\x20cancelled'),0x1;let _0xe9d99d;if(_0x828942['site']===_0x2bb808(0x20d)){const _0x1e248b=await a7_0x409ce6({'type':'text','name':_0x2bb808(0x20e),'message':_0x2bb808(0x1e2),'initial':_0x2bb808(0x1d3),'validate':_0x24474d=>{const _0x534ae4=_0x2bb808;if(!_0x24474d||!_0x24474d[_0x534ae4(0x1f5)]())return _0x534ae4(0x1dc);if(!/^[a-z0-9-]+$/[_0x534ae4(0x209)](_0x24474d['trim']()))return _0x534ae4(0x1ff);return!![];}});if(!_0x1e248b[_0x2bb808(0x20e)])return console[_0x2bb808(0x202)](_0x2bb808(0x1e9)),0x1;_0xe9d99d=_0x1e248b['customSite'];}else _0xe9d99d=_0x828942[_0x2bb808(0x1e7)];const _0x616d25=resolveSite(_0xe9d99d);console[_0x2bb808(0x202)]('Setting\x20up\x20authentication\x20for\x20site:\x20'+_0x616d25),console['log'](_0x2bb808(0x1fe)),console[_0x2bb808(0x202)]('\x20\x20'+getConsoleUrl(_0x616d25,_0x2bb808(0x1fc)));const _0x41c0b3=await a7_0x409ce6({'type':_0x2bb808(0x1f1),'name':_0x2bb808(0x1e0),'message':_0x2bb808(0x200),'validate':_0x3c046e=>{const _0x49f3ed=_0x2bb808;if(!_0x3c046e||!_0x3c046e[_0x49f3ed(0x1f5)]())return _0x49f3ed(0x1db);return!![];}});if(!_0x41c0b3[_0x2bb808(0x1e0)])return console[_0x2bb808(0x202)]('\x0aSetup\x20cancelled'),0x1;const _0x54ee40=_0x41c0b3[_0x2bb808(0x1e0)];console[_0x2bb808(0x202)]('Validating\x20API\x20key...');try{const _0x5bd805=TDX[_0x2bb808(0x1fd)]({'site':_0x616d25,'apiKey':_0x54ee40[_0x2bb808(0x1f5)](),'logLevel':_0x55ce96[_0x2bb808(0x1d1)]??LogLevel[_0x2bb808(0x1fb)]}),_0x5a6a8d=await _0x5bd805[_0x2bb808(0x1eb)][_0x2bb808(0x1d9)]();console[_0x2bb808(0x202)]('✓\x20API\x20key\x20is\x20valid\x20(User:\x20'+_0x5a6a8d['email']+')');const _0x4638ef=await isKeychainAvailable();_0x4638ef?(await saveAPIKeyAsync(_0x54ee40[_0x2bb808(0x1f5)](),_0x616d25,_0x2d3593),console[_0x2bb808(0x202)](_0x2bb808(0x217)+(_0x2d3593?_0x2bb808(0x1e6)+_0x2d3593+')':''))):(console['warn'](a7_0x5940e7['yellow']('⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.')),console[_0x2bb808(0x214)](a7_0x5940e7['yellow'](_0x2bb808(0x21b))));if(_0x2d3593){const _0x2f46ec={'site':_0x616d25};saveProfileToUserConfig(_0x2d3593,_0x2f46ec),console[_0x2bb808(0x202)]('✓\x20Profile\x20\x27'+_0x2d3593+_0x2bb808(0x1ee));}else saveDefaultSiteToUserConfig(_0x616d25),console[_0x2bb808(0x202)](_0x2bb808(0x219)+_0x616d25);const _0x52b07d=_0x2d3593?_0x2bb808(0x1d5)+_0x2d3593:'';return console[_0x2bb808(0x202)](),console[_0x2bb808(0x202)](_0x2bb808(0x1f6)),console[_0x2bb808(0x202)](_0x2bb808(0x213)+_0x52b07d+_0x2bb808(0x1f7)),console[_0x2bb808(0x202)]('\x20\x20tdx'+_0x52b07d+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases'),0x0;}catch(_0x2c9dd7){if(_0x2c9dd7 instanceof HTTPClientError&&_0x2c9dd7[_0x2bb808(0x203)]===0x191)return printAuthError(_0x2c9dd7),0x1;return console[_0x2bb808(0x1f9)](a7_0x5940e7[_0x2bb808(0x218)](_0x2bb808(0x207)+(_0x2c9dd7 instanceof Error?_0x2c9dd7[_0x2bb808(0x208)]:String(_0x2c9dd7)))),console[_0x2bb808(0x1f9)](_0x2bb808(0x20f)),0x1;}}}export class AuthStatusCommand extends BaseCommand{['name']=a7_0x61eb80(0x20a);[a7_0x61eb80(0x1f0)]=a7_0x61eb80(0x1ea);async[a7_0x61eb80(0x1de)](_0x4c723c){const _0x1e94c5=a7_0x61eb80,{options:_0x42eaa1,tdx:_0x2c27d8}=_0x4c723c,_0x64c68f=_0x42eaa1[_0x1e94c5(0x1e7)],_0x2e8ce3=_0x42eaa1[_0x1e94c5(0x20b)],_0x34225b=_0x2e8ce3?_0x2e8ce3:_0x1e94c5(0x205);console['log']('tdx\x20profile:\x20'+_0x34225b+'\x20(site:\x20'+_0x64c68f+')');const _0xd20bf7=await resolveAPIKeyAsync(_0x64c68f,_0x2e8ce3);if(_0xd20bf7){const {source:_0x8ed744,isDeprecated:_0x4ffdef}=_0xd20bf7,_0x1ee000='Read\x20credential\x20from\x20'+_0x8ed744;console[_0x1e94c5(0x202)](_0x4ffdef?a7_0x5940e7[_0x1e94c5(0x1d2)](_0x1ee000):_0x1ee000);}else console[_0x1e94c5(0x202)](a7_0x5940e7['yellow'](_0x1e94c5(0x1f3)));try{const _0x4b5776=await _0x2c27d8[_0x1e94c5(0x1eb)][_0x1e94c5(0x1d9)]();return console[_0x1e94c5(0x202)](a7_0x5940e7[_0x1e94c5(0x206)](_0x1e94c5(0x1e8))),console[_0x1e94c5(0x202)]('User:\x20'+_0x4b5776[_0x1e94c5(0x211)]),(_0x4b5776['first_name']||_0x4b5776[_0x1e94c5(0x21a)])&&console[_0x1e94c5(0x202)](_0x1e94c5(0x1ec)+[_0x4b5776[_0x1e94c5(0x1d6)],_0x4b5776[_0x1e94c5(0x21a)]]['filter'](Boolean)[_0x1e94c5(0x1dd)]('\x20')),0x0;}catch(_0x2a6557){return _0x2a6557 instanceof HTTPClientError&&_0x2a6557[_0x1e94c5(0x203)]===0x191?printAuthError(_0x2a6557,!![],_0x2e8ce3):console[_0x1e94c5(0x1f9)](a7_0x5940e7[_0x1e94c5(0x218)](_0x1e94c5(0x207)+(_0x2a6557 instanceof Error?_0x2a6557[_0x1e94c5(0x208)]:String(_0x2a6557)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x61eb80(0x1d4)]=a7_0x61eb80(0x1d8);[a7_0x61eb80(0x1f0)]='Remove\x20API\x20key\x20from\x20system\x20keychain';async[a7_0x61eb80(0x1de)](_0x502b41){const _0x4835fa=a7_0x61eb80,{options:_0x2b12eb}=_0x502b41,_0x4655a4=_0x2b12eb['profile'];console[_0x4835fa(0x202)](a7_0x5940e7['bold'](_0x4835fa(0x210)));const _0x2a17de=await isKeychainAvailable();if(!_0x2a17de)return console[_0x4835fa(0x1f9)](a7_0x5940e7[_0x4835fa(0x218)]('System\x20keychain\x20is\x20not\x20available')),0x1;const _0x24ee69=await deleteKeychainAPIKey(_0x4655a4);return _0x24ee69?(clearCredentialCache(),console[_0x4835fa(0x202)](_0x4835fa(0x1da)+(_0x4655a4?_0x4835fa(0x1e6)+_0x4655a4+')':'')),0x0):(console[_0x4835fa(0x202)](_0x4835fa(0x1f8)+(_0x4655a4?_0x4835fa(0x1e5)+_0x4655a4:'')),0x1);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a8_0x45face=a8_0x3ad2;(function(_0xf91014,_0x42ea86){const _0x10a09e=a8_0x3ad2,_0x2b03d0=_0xf91014();while(!![]){try{const _0x2e195c=-parseInt(_0x10a09e(0x127))/0x1+-parseInt(_0x10a09e(0x12a))/0x2*(parseInt(_0x10a09e(0x119))/0x3)+-parseInt(_0x10a09e(0x11c))/0x4*(-parseInt(_0x10a09e(0x12d))/0x5)+parseInt(_0x10a09e(0x110))/0x6+parseInt(_0x10a09e(0x12f))/0x7+-parseInt(_0x10a09e(0x107))/0x8*(parseInt(_0x10a09e(0x120))/0x9)+parseInt(_0x10a09e(0x137))/0xa;if(_0x2e195c===_0x42ea86)break;else _0x2b03d0['push'](_0x2b03d0['shift']());}catch(_0x126dca){_0x2b03d0['push'](_0x2b03d0['shift']());}}}(a8_0xa20b,0x7ee22));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{withSpinner}from'../utils/spinner.js';import{parseAgentRef}from'../sdk/agent/agent-ref-parser.js';import{saveLastChatId,loadLastChatId}from'../sdk/llm/chat-cache.js';function handleSDKError(_0x14adf6,_0x5b414d){const _0x4d0c13=a8_0x3ad2;if(_0x14adf6 instanceof SDKError)console['error'](_0x4d0c13(0x139)+_0x14adf6[_0x4d0c13(0x128)]),_0x5b414d[_0x4d0c13(0x116)]&&(_0x14adf6['cause']&&console[_0x4d0c13(0x103)](_0x4d0c13(0x123)+_0x14adf6[_0x4d0c13(0x105)]),_0x14adf6['stack']&&(console[_0x4d0c13(0x103)]('\x0aStack\x20trace:'),console['error'](_0x14adf6[_0x4d0c13(0x108)])));else throw _0x14adf6;}function a8_0x3ad2(_0x2b92a1,_0x3a82dd){_0x2b92a1=_0x2b92a1-0x103;const _0xa20baf=a8_0xa20b();let _0x3ad284=_0xa20baf[_0x2b92a1];return _0x3ad284;}function a8_0xa20b(){const _0x47817=['850424JcIttY','new','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','117EKIjnk','claude-4.5-haiku','Chat\x20session:\x20','\x20\x20Cause:\x20','write','404','llm','694120FWTxUQ','message','validate','247846zxTTET','Resolving\x20agent\x20\x27','getDefaultAgent','5zqLWUD','--agent\x20flag','5511044BvKosV','stdout','session\x20context','llmAgent','metadata','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22','CHAT_NOT_FOUND','4015880NwxcTm','agent','Error:\x20','chatId','error','type','cause','code','519264GSZPLe','stack','args','handleChatEvent','chat','data','Using\x20cached\x20default\x20agent:\x20','content','log','4680450PYnIux','name','join','getAgentId','\x0aError:\x20','llmProject','verbose','streamChat','event','3ZqHOyN','\x27...','includes'];a8_0xa20b=function(){return _0x47817;};return a8_0xa20b();}export class ChatCommand extends BaseCommand{[a8_0x45face(0x111)]=a8_0x45face(0x10b);['description']=a8_0x45face(0x11e);[a8_0x45face(0x129)](_0x3c85b7){const _0x73fcf0=a8_0x45face,_0x1592e4=_0x3c85b7[_0x73fcf0(0x109)][_0x73fcf0(0x112)]('\x20');if(!_0x1592e4)return _0x73fcf0(0x134);return undefined;}async[a8_0x45face(0x117)](_0x53112f,_0x3529af,_0x18517e,_0x1bcc85,_0x17aef0){const _0x5214e7=a8_0x45face;for await(const _0x3a8e8e of _0x53112f[_0x5214e7(0x126)]['chat'](_0x3529af,{'agentId':_0x18517e,'chatId':_0x1bcc85})){if(_0x3a8e8e['type']===_0x5214e7(0x133)){const _0x479855=_0x3a8e8e[_0x5214e7(0x10c)][_0x5214e7(0x13a)];saveLastChatId(_0x479855),_0x17aef0&&console[_0x5214e7(0x103)](_0x5214e7(0x122)+_0x479855);}else _0x3a8e8e[_0x5214e7(0x104)]===_0x5214e7(0x118)&&this[_0x5214e7(0x10a)](_0x3a8e8e['data']);}}async['getAgentId'](_0x5ba791,_0x4c92c1,_0x41153d,_0x5627cd,_0x57f156){const _0x5073b2=a8_0x45face,_0x31ac59=_0x4c92c1||_0x41153d;if(_0x31ac59){const {projectName:_0x1647c7,agentName:_0x5c1527}=parseAgentRef(_0x31ac59),_0x24ec61=_0x5c1527||_0x31ac59,_0x55eead=_0x5c1527?_0x1647c7:_0x5627cd;if(!_0x55eead)throw new Error(_0x5073b2(0x135));if(_0x57f156){const _0x4d5407=_0x4c92c1?_0x5073b2(0x12e):_0x5073b2(0x131);console['error']('Using\x20agent\x20from\x20'+_0x4d5407+':\x20'+_0x55eead+'/'+_0x24ec61);}const _0x2346a6=await withSpinner('Resolving\x20project\x20\x27'+_0x55eead+_0x5073b2(0x11a),()=>_0x5ba791[_0x5073b2(0x126)]['resolveProjectId'](_0x55eead),{'verbose':_0x57f156}),_0x1bec85=await withSpinner(_0x5073b2(0x12b)+_0x24ec61+_0x5073b2(0x11a),()=>_0x5ba791[_0x5073b2(0x126)]['resolveAgentId'](_0x24ec61,_0x2346a6[_0x5073b2(0x10c)]),{'verbose':_0x57f156});return _0x1bec85[_0x5073b2(0x10c)];}else{const _0x4db703=_0x5ba791['llm'][_0x5073b2(0x12c)]();if(_0x4db703)return _0x57f156&&console[_0x5073b2(0x103)](_0x5073b2(0x10d)+_0x4db703[_0x5073b2(0x111)]),_0x4db703['id'];const _0x595cbe=await withSpinner('Getting\x20default\x20agent...',()=>_0x5ba791[_0x5073b2(0x126)]['getOrCreateDefaultAgent'](_0x5073b2(0x121),0x0),{'verbose':_0x57f156});return _0x595cbe['data']['id'];}}async['execute'](_0x36affb){const _0x1357ed=a8_0x45face,{options:_0x2fbd44,args:_0x30c614,tdx:_0x17d548}=_0x36affb,_0x407375=_0x30c614[_0x1357ed(0x112)]('\x20'),_0x1d79a5=_0x2fbd44,_0x4b832c=_0x1d79a5[_0x1357ed(0x138)],_0x5aa96e=_0x1d79a5[_0x1357ed(0x132)],_0x470551=_0x1d79a5[_0x1357ed(0x115)],_0x1a0889=_0x1d79a5[_0x1357ed(0x11d)];try{let _0x477467,_0xd27eb7;!_0x1a0889&&(_0xd27eb7=loadLastChatId(),_0xd27eb7&&_0x2fbd44['verbose']&&console[_0x1357ed(0x103)]('Continuing\x20chat:\x20'+_0xd27eb7));(_0x1a0889||!_0xd27eb7)&&(_0x477467=await this[_0x1357ed(0x113)](_0x17d548,_0x4b832c,_0x5aa96e,_0x470551,_0x2fbd44[_0x1357ed(0x116)]));try{await this[_0x1357ed(0x117)](_0x17d548,_0x407375,_0x477467,_0xd27eb7,_0x2fbd44['verbose']);}catch(_0xcad829){const _0x2c541c=_0xcad829 instanceof SDKError&&_0xcad829[_0x1357ed(0x106)]===ErrorCode[_0x1357ed(0x136)]||_0xcad829 instanceof Error&&_0xcad829['message'][_0x1357ed(0x11b)](_0x1357ed(0x125));if(_0x2c541c)_0x2fbd44[_0x1357ed(0x116)]&&console['error'](_0x1357ed(0x11f)),!_0x477467&&(_0x477467=await this['getAgentId'](_0x17d548,_0x4b832c,_0x5aa96e,_0x470551,_0x2fbd44[_0x1357ed(0x116)])),await this['streamChat'](_0x17d548,_0x407375,_0x477467,undefined,_0x2fbd44['verbose']);else throw _0xcad829;}return console[_0x1357ed(0x10f)](),0x0;}catch(_0x3ce469){return console[_0x1357ed(0x103)](),handleSDKError(_0x3ce469,_0x2fbd44),0x1;}}[a8_0x45face(0x10a)](_0x18bfd0){const _0x267874=a8_0x45face;if('content'in _0x18bfd0)process[_0x267874(0x130)][_0x267874(0x124)](_0x18bfd0[_0x267874(0x10e)]);else _0x267874(0x103)in _0x18bfd0&&console[_0x267874(0x103)](_0x267874(0x114)+_0x18bfd0[_0x267874(0x103)]);}}
|